From 7e7638792e71a8be1fd8a396c18ea719b3cd37b7 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 17 Feb 2022 16:20:35 +0100 Subject: [PATCH 0001/1137] NEW : Added of the field "include_sub_warehouse" in the table "llx_inventory" --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_inventory-stock.sql | 3 ++- htdocs/product/stock/tpl/extrafields_add.tpl.php | 2 +- 3 files changed, 5 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 b78e53bd287..56d5410a898 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 @@ -237,4 +237,6 @@ ALTER TABLE llx_advtargetemailing RENAME TO llx_mailing_advtarget; ALTER TABLE llx_mailing ADD UNIQUE uk_mailing(titre, entity); +ALTER TABLE llx_inventory ADD COLUMN include_sub_warehouse boolean NOT NULL DEFAULT FALSE; + diff --git a/htdocs/install/mysql/tables/llx_inventory-stock.sql b/htdocs/install/mysql/tables/llx_inventory-stock.sql index c25ccb9767b..4053aa971b1 100644 --- a/htdocs/install/mysql/tables/llx_inventory-stock.sql +++ b/htdocs/install/mysql/tables/llx_inventory-stock.sql @@ -30,7 +30,8 @@ CREATE TABLE llx_inventory fk_warehouse integer DEFAULT NULL, fk_product integer DEFAULT NULL, status integer DEFAULT 0, - title varchar(255) NOT NULL, + title varchar(255) NOT NULL, + include_sub_warehouse boolean NOT NULL DEFAULT FALSE, date_inventory datetime DEFAULT NULL, date_validation datetime DEFAULT NULL, import_key varchar(14) -- import key diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php index 62921f0a6e0..4dcddcad672 100644 --- a/htdocs/product/stock/tpl/extrafields_add.tpl.php +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -37,13 +37,13 @@ if (empty($conf) || !is_object($conf)) { // Other attributes if (!isset($parameters)) $parameters = array(); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $movement, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { $params = array(); if (isset($tpl_context)) $params['tpl_context'] = $tpl_context; $params['cols'] = $parameters['colspanvalue']; + var_dump($movement); print $movement->showOptionals($extrafields, 'create', $params); } From 16f6aaf1c8f24dcb22dbe90dd81db50d682d61a5 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 17 Feb 2022 17:24:04 +0100 Subject: [PATCH 0002/1137] NEW : Add new field into $fields array + Creation of the function getChildWarehouse() --- .../inventory/class/inventory.class.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 92061972e60..58ec8e05ca1 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -101,6 +101,7 @@ class Inventory extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax200'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), + 'include_sub_warehouse' => array('type'=>'boolean', 'label'=>'IncludeSubWarehouse', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'index'=>0, 'position'=>31), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35), // This date is not used so disabled by default. 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), @@ -691,6 +692,30 @@ class Inventory extends CommonObject $this->initAsSpecimenCommon(); $this->title = ''; } + + + /** + * Return the child warehouse of the current one + * + * @return int | array <0 if KO, >0 if OK + */ + public function getchildWarehouse() + { + $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'entrepot'; + $sql.= ' WHERE fk_parent='.$this->id; + $sql.= ' ORDER BY rowid'; + $resql = $this->db->query($sql); + if($resql && $this->db->num_rows($resql)>0){ + $TChildWarehouse = array(); + while ($obj = $this->db->fetch_object($resql)){ + $TChildWarehouse[] = $obj->rowid; + } + return $TChildWarehouse; + } else { + return -1; + } + } + } /** From c60047b3c8ced7b79a6069fb50d5890181c92502 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 21 Feb 2022 17:18:05 +0100 Subject: [PATCH 0003/1137] NEW : Add recurring behaviour --- .../install/mysql/migration/15.0.0-16.0.0.sql | 2 +- .../mysql/tables/llx_inventory-stock.sql | 2 +- htdocs/langs/en_US/stocks.lang | 3 ++- htdocs/langs/fr_FR/stocks.lang | 1 + .../inventory/class/inventory.class.php | 18 +++++++++++++----- .../product/stock/tpl/extrafields_add.tpl.php | 2 +- 6 files changed, 19 insertions(+), 9 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 56d5410a898..3aa6353c250 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 @@ -237,6 +237,6 @@ ALTER TABLE llx_advtargetemailing RENAME TO llx_mailing_advtarget; ALTER TABLE llx_mailing ADD UNIQUE uk_mailing(titre, entity); -ALTER TABLE llx_inventory ADD COLUMN include_sub_warehouse boolean NOT NULL DEFAULT FALSE; +ALTER TABLE llx_inventory ADD COLUMN include_sub_warehouse boolean DEFAULT FALSE; diff --git a/htdocs/install/mysql/tables/llx_inventory-stock.sql b/htdocs/install/mysql/tables/llx_inventory-stock.sql index 4053aa971b1..c6ac552de60 100644 --- a/htdocs/install/mysql/tables/llx_inventory-stock.sql +++ b/htdocs/install/mysql/tables/llx_inventory-stock.sql @@ -31,7 +31,7 @@ CREATE TABLE llx_inventory fk_product integer DEFAULT NULL, status integer DEFAULT 0, title varchar(255) NOT NULL, - include_sub_warehouse boolean NOT NULL DEFAULT FALSE, + include_sub_warehouse boolean DEFAULT FALSE, date_inventory datetime DEFAULT NULL, date_validation datetime DEFAULT NULL, import_key varchar(14) -- import key diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index ebd67df79c9..5d6ad811983 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -270,4 +270,5 @@ ErrorOnElementsInventory=Operation canceled for the following reason: ErrorCantFindCodeInInventory=Can't find the following code in inventory QtyWasAddedToTheScannedBarcode=Success !! The quantity was added to all the requested barcode. You can close the Scanner tool. StockChangeDisabled=Change on stock disabled -NoWarehouseDefinedForTerminal=No warehouse defined for terminal \ No newline at end of file +NoWarehouseDefinedForTerminal=No warehouse defined for terminal +IncludeSubWarehouse=Include sub-warehouse ? \ No newline at end of file diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index a907598ff61..44da826b36b 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -271,3 +271,4 @@ ErrorCantFindCodeInInventory=Impossible de trouver le code suivant dans l'invent QtyWasAddedToTheScannedBarcode=Succès !! La quantité a été ajoutée à tous les codes-barres demandés. Vous pouvez fermer l'outil Scanner. StockChangeDisabled=Changement sur stock désactivé NoWarehouseDefinedForTerminal=Aucun entrepôt défini pour le terminal +IncludeSubWarehouse=Inclure les sous-entrepôts ? \ No newline at end of file diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 58ec8e05ca1..b5f49e01076 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -290,8 +290,15 @@ class Inventory extends CommonObject $sql .= " AND ps.fk_product = ".((int) $this->fk_product); } if ($this->fk_warehouse > 0) { - $sql .= " AND ps.fk_entrepot = ".((int) $this->fk_warehouse); + $sql .= " AND (ps.fk_entrepot = ".((int) $this->fk_warehouse); } + if($this->include_sub_warehouse>0 && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE){ + $this->getchildWarehouse($this->fk_warehouse, $TChildWarehouses); + foreach ($TChildWarehouses as $childWarehouse){ + $sql .= " OR ps.fk_entrepot = ".((int) $childWarehouse); + } + } + $sql .= ')'; $inventoryline = new InventoryLine($this->db); @@ -699,18 +706,19 @@ class Inventory extends CommonObject * * @return int | array <0 if KO, >0 if OK */ - public function getchildWarehouse() + public function getchildWarehouse($id, &$TChildWarehouse) { $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'entrepot'; - $sql.= ' WHERE fk_parent='.$this->id; + $sql.= ' WHERE fk_parent='.$id; $sql.= ' ORDER BY rowid'; $resql = $this->db->query($sql); if($resql && $this->db->num_rows($resql)>0){ - $TChildWarehouse = array(); while ($obj = $this->db->fetch_object($resql)){ + $TChildWarehouse[] = $obj->rowid; + $this->getchildWarehouse($obj->rowid, $TChildWarehouse); } - return $TChildWarehouse; + return 1; } else { return -1; } diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php index 4dcddcad672..d3c5f0e362c 100644 --- a/htdocs/product/stock/tpl/extrafields_add.tpl.php +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -43,7 +43,7 @@ if (empty($reshook)) { $params = array(); if (isset($tpl_context)) $params['tpl_context'] = $tpl_context; $params['cols'] = $parameters['colspanvalue']; - var_dump($movement); + print $movement->showOptionals($extrafields, 'create', $params); } From ab8cd6aa062d138187571211ed49a71e5d3385be Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 22 Feb 2022 14:50:25 +0100 Subject: [PATCH 0004/1137] FIX : Global conf --- htdocs/product/inventory/class/inventory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index b5f49e01076..a15aadd243e 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -101,7 +101,7 @@ class Inventory extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax200'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), - 'include_sub_warehouse' => array('type'=>'boolean', 'label'=>'IncludeSubWarehouse', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'index'=>0, 'position'=>31), + 'include_sub_warehouse' => array('type'=>'boolean', 'label'=>'IncludeSubWarehouse', 'enabled'=>'$conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE', 'visible'=>1, 'notnull'=>0, 'index'=>0, 'position'=>31), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35), // This date is not used so disabled by default. 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), From e74e0ffada816a5843b329068efc85f1baf85106 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 22 Feb 2022 14:38:25 +0000 Subject: [PATCH 0005/1137] Fixing style errors. --- htdocs/product/inventory/class/inventory.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index a15aadd243e..4836f8c810a 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -292,9 +292,9 @@ class Inventory extends CommonObject if ($this->fk_warehouse > 0) { $sql .= " AND (ps.fk_entrepot = ".((int) $this->fk_warehouse); } - if($this->include_sub_warehouse>0 && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE){ + if ($this->include_sub_warehouse>0 && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE) { $this->getchildWarehouse($this->fk_warehouse, $TChildWarehouses); - foreach ($TChildWarehouses as $childWarehouse){ + foreach ($TChildWarehouses as $childWarehouse) { $sql .= " OR ps.fk_entrepot = ".((int) $childWarehouse); } } @@ -712,9 +712,8 @@ class Inventory extends CommonObject $sql.= ' WHERE fk_parent='.$id; $sql.= ' ORDER BY rowid'; $resql = $this->db->query($sql); - if($resql && $this->db->num_rows($resql)>0){ - while ($obj = $this->db->fetch_object($resql)){ - + if ($resql && $this->db->num_rows($resql)>0) { + while ($obj = $this->db->fetch_object($resql)) { $TChildWarehouse[] = $obj->rowid; $this->getchildWarehouse($obj->rowid, $TChildWarehouse); } @@ -723,7 +722,6 @@ class Inventory extends CommonObject return -1; } } - } /** From 62bf1e4273cd82ad21ec3d32992eaf4a5740e870 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 22 Feb 2022 15:54:45 +0100 Subject: [PATCH 0006/1137] FIX : Stickler errors --- htdocs/product/inventory/class/inventory.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index a15aadd243e..bc095c9c459 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -700,11 +700,11 @@ class Inventory extends CommonObject $this->title = ''; } - /** * Return the child warehouse of the current one - * - * @return int | array <0 if KO, >0 if OK + * @param int $id Id of warehouse + * @param $TChildWarehouse child warehouses + * @return int <0 if KO, >0 if OK */ public function getchildWarehouse($id, &$TChildWarehouse) { From 6807c53a0fe2acdc08444ebc5c7ca592f06aa6ec Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 22 Feb 2022 15:56:55 +0100 Subject: [PATCH 0007/1137] FIX : Travis errors --- htdocs/product/inventory/class/inventory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index bc095c9c459..82eabc120fa 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -709,7 +709,7 @@ class Inventory extends CommonObject public function getchildWarehouse($id, &$TChildWarehouse) { $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'entrepot'; - $sql.= ' WHERE fk_parent='.$id; + $sql.= ' WHERE fk_parent='.(int) $id; $sql.= ' ORDER BY rowid'; $resql = $this->db->query($sql); if($resql && $this->db->num_rows($resql)>0){ From 02917f28df57f592c64f8213b2859d3a55cf833c Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 24 Feb 2022 10:41:46 +0100 Subject: [PATCH 0008/1137] FIX : PR Returns --- htdocs/product/inventory/class/inventory.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 675446dd2b6..97c11a0370d 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -294,9 +294,7 @@ class Inventory extends CommonObject } if ($this->include_sub_warehouse>0 && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE) { $this->getchildWarehouse($this->fk_warehouse, $TChildWarehouses); - foreach ($TChildWarehouses as $childWarehouse) { - $sql .= " OR ps.fk_entrepot = ".((int) $childWarehouse); - } + $sql .= " OR ps.fk_entrepot IN (".implode(',', $TChildWarehouses).")"; } $sql .= ')'; From 50028dadeffc73e07f9ec36168888cbd3ed7e259 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 24 Feb 2022 11:27:14 +0100 Subject: [PATCH 0009/1137] FIX : Travis returns --- htdocs/product/inventory/class/inventory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 97c11a0370d..0ad970a7d40 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -294,7 +294,7 @@ class Inventory extends CommonObject } if ($this->include_sub_warehouse>0 && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE) { $this->getchildWarehouse($this->fk_warehouse, $TChildWarehouses); - $sql .= " OR ps.fk_entrepot IN (".implode(',', $TChildWarehouses).")"; + $sql .= " OR ps.fk_entrepot IN (".filter_var(implode(',', $TChildWarehouses),FILTER_SANITIZE_STRING).")"; } $sql .= ')'; From abc450e44ce6409d3031e2b9576694f9ae834faa Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 24 Feb 2022 10:30:48 +0000 Subject: [PATCH 0010/1137] Fixing style errors. --- htdocs/product/inventory/class/inventory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 0ad970a7d40..fb2041b6b88 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -294,7 +294,7 @@ class Inventory extends CommonObject } if ($this->include_sub_warehouse>0 && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE) { $this->getchildWarehouse($this->fk_warehouse, $TChildWarehouses); - $sql .= " OR ps.fk_entrepot IN (".filter_var(implode(',', $TChildWarehouses),FILTER_SANITIZE_STRING).")"; + $sql .= " OR ps.fk_entrepot IN (".filter_var(implode(',', $TChildWarehouses), FILTER_SANITIZE_STRING).")"; } $sql .= ')'; From f9c5da4ae27ba7e1714d43bb48ad2175ee679b11 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 24 Feb 2022 16:49:13 +0100 Subject: [PATCH 0011/1137] NEW : Added of a popup on validation instead of a database fielld to know if the user wants to include subwarehouse --- htdocs/langs/en_US/stocks.lang | 4 +++- htdocs/product/inventory/card.php | 18 +++++++++++++++++- .../inventory/class/inventory.class.php | 12 ++++++------ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 5d6ad811983..905bd137350 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -271,4 +271,6 @@ ErrorCantFindCodeInInventory=Can't find the following code in inventory QtyWasAddedToTheScannedBarcode=Success !! The quantity was added to all the requested barcode. You can close the Scanner tool. StockChangeDisabled=Change on stock disabled NoWarehouseDefinedForTerminal=No warehouse defined for terminal -IncludeSubWarehouse=Include sub-warehouse ? \ No newline at end of file +ValidateInventory=Inventory validation +IncludeSubWarehouse=Include sub-warehouse ? +IncludeSubWarehouseExplanation=Check this box if you want to include all sub-warehouses of the associated warehouse in the inventory \ No newline at end of file diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 23473545b11..14a107d3d6a 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -291,6 +291,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); } + + if ($action == 'validate'){ + $form = new Form($db); + $formquestion = ''; + if($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)){ + $formquestion = array( + array('type' => 'checkbox', 'name' => 'include_sub_warehouse', 'label' => $langs->trans("IncludeSubWarehouse"), 'value' => 0, 'size' => '10'), + ); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateInventory'), $langs->trans('IncludeSubWarehouseExplanation'), 'confirm_validate', $formquestion, '', 1); + } + } + // Call Hook formConfirm $parameters = array('formConfirm' => $formconfirm); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -414,7 +426,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Validate if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_CANCELED) { if ($permissiontoadd) { - print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; + if($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)){ + print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; + } else { + print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; + } } } diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index fb2041b6b88..8f79a6d8267 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -101,7 +101,6 @@ class Inventory extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax200'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), - 'include_sub_warehouse' => array('type'=>'boolean', 'label'=>'IncludeSubWarehouse', 'enabled'=>'$conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE', 'visible'=>1, 'notnull'=>0, 'index'=>0, 'position'=>31), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35), // This date is not used so disabled by default. 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), @@ -265,6 +264,7 @@ class Inventory extends CommonObject $result = 0; + $this->include_sub_warehouse = GETPOST('include_sub_warehouse'); if ($this->status == self::STATUS_DRAFT) { // Delete inventory $sql = 'DELETE FROM '.$this->db->prefix().'inventorydet WHERE fk_inventory = '.((int) $this->id); @@ -291,12 +291,12 @@ class Inventory extends CommonObject } if ($this->fk_warehouse > 0) { $sql .= " AND (ps.fk_entrepot = ".((int) $this->fk_warehouse); + if (!empty($this->include_sub_warehouse) && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE) { + $this->getchildWarehouse($this->fk_warehouse, $TChildWarehouses); + $sql .= " OR ps.fk_entrepot IN (".filter_var(implode(',', $TChildWarehouses), FILTER_SANITIZE_STRING).")"; + } + $sql .= ')'; } - if ($this->include_sub_warehouse>0 && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE) { - $this->getchildWarehouse($this->fk_warehouse, $TChildWarehouses); - $sql .= " OR ps.fk_entrepot IN (".filter_var(implode(',', $TChildWarehouses), FILTER_SANITIZE_STRING).")"; - } - $sql .= ')'; $inventoryline = new InventoryLine($this->db); From 168b1c7578552a9b0d2cd87fbf755af2676db9b1 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 24 Feb 2022 16:51:14 +0100 Subject: [PATCH 0012/1137] NEW : remove include_subwarehouse form llx_inventory database table --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 2 -- htdocs/install/mysql/tables/llx_inventory-stock.sql | 1 - 2 files changed, 3 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 2e4c271a691..cbf3c8fadc5 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 @@ -237,8 +237,6 @@ ALTER TABLE llx_advtargetemailing RENAME TO llx_mailing_advtarget; ALTER TABLE llx_mailing ADD UNIQUE uk_mailing(titre, entity); -ALTER TABLE llx_inventory ADD COLUMN include_sub_warehouse boolean DEFAULT FALSE; - create table llx_inventory_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, diff --git a/htdocs/install/mysql/tables/llx_inventory-stock.sql b/htdocs/install/mysql/tables/llx_inventory-stock.sql index c6ac552de60..1f38469b300 100644 --- a/htdocs/install/mysql/tables/llx_inventory-stock.sql +++ b/htdocs/install/mysql/tables/llx_inventory-stock.sql @@ -31,7 +31,6 @@ CREATE TABLE llx_inventory fk_product integer DEFAULT NULL, status integer DEFAULT 0, title varchar(255) NOT NULL, - include_sub_warehouse boolean DEFAULT FALSE, date_inventory datetime DEFAULT NULL, date_validation datetime DEFAULT NULL, import_key varchar(14) -- import key From 23cd8bde29fdd0d5e81a01236b296a641476df75 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 24 Feb 2022 15:54:37 +0000 Subject: [PATCH 0013/1137] Fixing style errors. --- htdocs/product/inventory/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 14a107d3d6a..901a4e2a399 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -292,10 +292,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } - if ($action == 'validate'){ + if ($action == 'validate') { $form = new Form($db); $formquestion = ''; - if($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)){ + if ($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)) { $formquestion = array( array('type' => 'checkbox', 'name' => 'include_sub_warehouse', 'label' => $langs->trans("IncludeSubWarehouse"), 'value' => 0, 'size' => '10'), ); @@ -426,7 +426,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Validate if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_CANCELED) { if ($permissiontoadd) { - if($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)){ + if ($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)) { print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; } else { print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; From 43428f622f789f07aead4cb494505bda2f4a86cd Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 31 Mar 2022 15:28:03 +0200 Subject: [PATCH 0014/1137] FIX : Add sub warehouse management on inventory.php file --- htdocs/product/inventory/inventory.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 6026e4316e4..ab3c0276051 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -435,6 +435,17 @@ if ($object->id > 0) { $action = 'view'; } + if ($action == 'validate') { + $form = new Form($db); + $formquestion = ''; + if ($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)) { + $formquestion = array( + array('type' => 'checkbox', 'name' => 'include_sub_warehouse', 'label' => $langs->trans("IncludeSubWarehouse"), 'value' => 0, 'size' => '10'), + ); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateInventory'), $langs->trans('IncludeSubWarehouseExplanation'), 'confirm_validate', $formquestion, '', 1); + } + } + // 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 @@ -541,7 +552,11 @@ if ($object->id > 0) { if (empty($reshook)) { if ($object->status == Inventory::STATUS_DRAFT) { if ($permissiontoadd) { - print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'."\n"; + if ($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)) { + print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; + } else { + print ''.$langs->trans("Validate").' ('.$langs->trans("Start").')'; + } } else { print ''.$langs->trans('Validate').' ('.$langs->trans("Start").')'."\n"; } From 468f4d18cb3634d7ee2b3cf266e86b6b6836bd29 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 7 Apr 2022 17:43:40 +0200 Subject: [PATCH 0015/1137] FIX : PR returns --- htdocs/core/actions_addupdatedelete.inc.php | 9 ++++++++- htdocs/product/inventory/class/inventory.class.php | 5 ++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index f97d4aa94ee..8b0f07c3274 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -366,7 +366,14 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto // Action validate object if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { - $result = $object->validate($user); + if($object->element == 'inventory'){ + //Case of the conf INVENTORY_INCLUDE_SUB_WAREHOUSE + $include_sub_warehouse = !empty(GETPOST('include_sub_warehouse')) ? GETPOST('include_sub_warehouse') : 0; + $result = $object->validate($user, $include_sub_warehouse); + } else { + $result = $object->validate($user); + } + if ($result >= 0) { // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 8f79a6d8267..ddb41813eae 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -257,14 +257,13 @@ class Inventory extends CommonObject * @param bool $notrigger false=launch triggers after, true=disable triggers * @return int <0 if KO, Id of created object if OK */ - public function validate(User $user, $notrigger = false) + public function validate(User $user, $include_sub_warehouse, $notrigger = false) { global $conf; $this->db->begin(); $result = 0; - $this->include_sub_warehouse = GETPOST('include_sub_warehouse'); if ($this->status == self::STATUS_DRAFT) { // Delete inventory $sql = 'DELETE FROM '.$this->db->prefix().'inventorydet WHERE fk_inventory = '.((int) $this->id); @@ -291,7 +290,7 @@ class Inventory extends CommonObject } if ($this->fk_warehouse > 0) { $sql .= " AND (ps.fk_entrepot = ".((int) $this->fk_warehouse); - if (!empty($this->include_sub_warehouse) && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE) { + if (!empty($include_sub_warehouse) && $conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE) { $this->getchildWarehouse($this->fk_warehouse, $TChildWarehouses); $sql .= " OR ps.fk_entrepot IN (".filter_var(implode(',', $TChildWarehouses), FILTER_SANITIZE_STRING).")"; } From 2150c93f61344ef40585fc909c63336e94c4f7fa Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 7 Apr 2022 15:49:53 +0000 Subject: [PATCH 0016/1137] Fixing style errors. --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 8b0f07c3274..45ca6074478 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -366,7 +366,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto // Action validate object if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { - if($object->element == 'inventory'){ + if ($object->element == 'inventory') { //Case of the conf INVENTORY_INCLUDE_SUB_WAREHOUSE $include_sub_warehouse = !empty(GETPOST('include_sub_warehouse')) ? GETPOST('include_sub_warehouse') : 0; $result = $object->validate($user, $include_sub_warehouse); From ac81bacb4ffa46dfe5bdf232b93e1a5a58f1b8d1 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Wed, 20 Apr 2022 13:57:09 +0200 Subject: [PATCH 0017/1137] ADD : add parent product column on list if show_child products is enabled, add a column who contains the parent product --- htdocs/product/list.php | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index de5e4f278b7..bb64f5a8d3e 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -12,6 +12,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2020-2021 Open-DSI + * Copyright (C) 2022 Charlene Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -209,6 +210,7 @@ $arrayfields = array( 'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled)), 'position'=>11), 'p.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled)), 'position'=>12), 'p.duration'=>array('label'=>"Duration", 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1'), 'position'=>13), + 'pac.fk_product_parent' => array('label'=>"ParentProduct", 'checked'=> 1, 'enabled'=>(!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && $show_childproducts)), 'position'=>14), 'p.finished'=>array('label'=>"Nature", 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>19), 'p.weight'=>array('label'=>'Weight', 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>20), 'p.weight_units'=>array('label'=>'WeightUnits', 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>21), @@ -413,8 +415,9 @@ 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)) { - $sql .= ', pac.rowid prod_comb_id'; +if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) )) { + $sql .= ', pac.rowid as prod_comb_id'; + $sql .= ', pac.fk_product_parent'; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -442,7 +445,7 @@ if (!empty($conf->global->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 (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD))) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; } if (!empty($conf->global->PRODUCT_USE_UNITS)) { @@ -574,8 +577,9 @@ 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 (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD))) { $sql .= ', pac.rowid'; + $sql .= ', pac.fk_product_parent'; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -901,7 +905,11 @@ if ($resql) { print ''; print ''; } - + // Parent + if (!empty($arrayfields['pac.fk_product_parent']['checked'])) { + print ''; + print ''; + } // Finished if (!empty($arrayfields['p.finished']['checked'])) { print ''; @@ -1143,6 +1151,9 @@ if ($resql) { if (!empty($arrayfields['p.duration']['checked'])) { print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"], "p.duration", "", $param, '', $sortfield, $sortorder, 'center '); } + if (!empty($arrayfields['pac.fk_product_parent']['checked'])) { + print_liste_field_titre($arrayfields['pac.fk_product_parent']['label'], $_SERVER["PHP_SELF"], "pac.fk_product_parent", "", $param, '', $sortfield, $sortorder, 'center '); + } if (!empty($arrayfields['p.finished']['checked'])) { print_liste_field_titre($arrayfields['p.finished']['label'], $_SERVER["PHP_SELF"], "p.finished", "", $param, '', $sortfield, $sortorder, 'center '); } @@ -1450,7 +1461,19 @@ if ($resql) { $totalarray['nbfield']++; } } - + + if (!empty($arrayfields['pac.fk_product_parent']['checked'])) { + print ''; + if ($obj->fk_product_parent > 0) { + $product_parent_static= new Product($db); + $product_parent_static->fetch($obj->fk_product_parent); + print $product_parent_static->getNomUrl(1); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } // Finished if (!empty($arrayfields['p.finished']['checked'])) { print ''; From 9323b366adde5aa602e30043dba83394ad64e0e3 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Fri, 22 Apr 2022 10:18:07 +0200 Subject: [PATCH 0018/1137] FIX : Retours PR --- htdocs/core/actions_addupdatedelete.inc.php | 5 ++--- htdocs/product/inventory/card.php | 1 + htdocs/product/inventory/class/inventory.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 8b0f07c3274..cb66cc97ca6 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -366,10 +366,9 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto // Action validate object if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { - if($object->element == 'inventory'){ + if($object->element == 'inventory' && !empty($include_sub_warehouse)){ //Case of the conf INVENTORY_INCLUDE_SUB_WAREHOUSE - $include_sub_warehouse = !empty(GETPOST('include_sub_warehouse')) ? GETPOST('include_sub_warehouse') : 0; - $result = $object->validate($user, $include_sub_warehouse); + $result = $object->validate($user, false, $include_sub_warehouse); } else { $result = $object->validate($user); } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 390a57ea989..e2320d047fd 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -39,6 +39,7 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inventorycard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); +$include_sub_warehouse = !empty(GETPOST('include_sub_warehouse')) ? GETPOST('include_sub_warehouse') : 0; if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $result = restrictedArea($user, 'stock', $id); diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index ddb41813eae..e8cd0c87c2c 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -257,7 +257,7 @@ class Inventory extends CommonObject * @param bool $notrigger false=launch triggers after, true=disable triggers * @return int <0 if KO, Id of created object if OK */ - public function validate(User $user, $include_sub_warehouse, $notrigger = false) + public function validate(User $user, $notrigger = false, $include_sub_warehouse = 0) { global $conf; $this->db->begin(); From 8f670ce96d832069de5b2df5af907904f500bfe5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 22 Apr 2022 08:25:49 +0000 Subject: [PATCH 0019/1137] Fixing style errors. --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index cb66cc97ca6..ec3f5a180b9 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -366,7 +366,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto // Action validate object if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { - if($object->element == 'inventory' && !empty($include_sub_warehouse)){ + if ($object->element == 'inventory' && !empty($include_sub_warehouse)) { //Case of the conf INVENTORY_INCLUDE_SUB_WAREHOUSE $result = $object->validate($user, false, $include_sub_warehouse); } else { From a3be6a0c2cdc26e2902ec2bc7a15afc471bef686 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 28 Apr 2022 12:11:59 +0200 Subject: [PATCH 0020/1137] FIX : When conf is active, option "include subwarehouse" must be checked by default --- htdocs/product/inventory/card.php | 2 +- htdocs/product/inventory/inventory.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index e2320d047fd..e3e6cb4c1d3 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -295,7 +295,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formquestion = ''; if ($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)) { $formquestion = array( - array('type' => 'checkbox', 'name' => 'include_sub_warehouse', 'label' => $langs->trans("IncludeSubWarehouse"), 'value' => 0, 'size' => '10'), + array('type' => 'checkbox', 'name' => 'include_sub_warehouse', 'label' => $langs->trans("IncludeSubWarehouse"), 'value' => 1, 'size' => '10'), ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateInventory'), $langs->trans('IncludeSubWarehouseExplanation'), 'confirm_validate', $formquestion, '', 1); } diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index ab3c0276051..82b3c6bc28e 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -440,7 +440,7 @@ if ($object->id > 0) { $formquestion = ''; if ($conf->global->INVENTORY_INCLUDE_SUB_WAREHOUSE && !empty($object->fk_warehouse)) { $formquestion = array( - array('type' => 'checkbox', 'name' => 'include_sub_warehouse', 'label' => $langs->trans("IncludeSubWarehouse"), 'value' => 0, 'size' => '10'), + array('type' => 'checkbox', 'name' => 'include_sub_warehouse', 'label' => $langs->trans("IncludeSubWarehouse"), 'value' => 1, 'size' => '10'), ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateInventory'), $langs->trans('IncludeSubWarehouseExplanation'), 'confirm_validate', $formquestion, '', 1); } From 32f3a2aff642e39f4334b097ddc73271d79ca211 Mon Sep 17 00:00:00 2001 From: kamel Date: Fri, 13 May 2022 10:45:18 +0200 Subject: [PATCH 0021/1137] NEW - Add all id prof checker on thirdparty for code compta customer and supplier --- htdocs/comm/card.php | 1 + htdocs/fourn/card.php | 1 + .../fourn/class/fournisseur.facture.class.php | 50 ++++++++++++++++++- htdocs/langs/en_US/errors.lang | 1 + htdocs/societe/admin/societe.php | 21 ++------ htdocs/societe/class/societe.class.php | 44 ++++++++++++++-- 6 files changed, 96 insertions(+), 22 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 411efc5ae93..055432dc76c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -167,6 +167,7 @@ if (empty($reshook)) { $result = $object->update($object->id, $user, 1, 1, 0); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); + $_GET['action'] = 'editcustomeraccountancycode'; } } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 8ad44d198a8..27493417312 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -103,6 +103,7 @@ if (empty($reshook)) { $result = $object->update($object->id, $user, 1, 0, 1); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); + $_GET['action'] = 'editsupplieraccountancycode'; } } // terms of the settlement diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 52d9b19bfaf..e8e10008fae 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1762,7 +1762,7 @@ class FactureFournisseur extends CommonInvoice */ public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0) { - global $conf, $langs; + global $mysoc, $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -1791,6 +1791,54 @@ class FactureFournisseur extends CommonInvoice return -1; } + // Check for mandatory fields in thirdparty (defined into setup) + if (!empty($this->thirdparty) && is_object($this->thirdparty)) { + $array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL', 'ACCOUNTANCY_CODE_SUPPLIER'); + foreach ($array_to_check as $key) { + $keymin = strtolower($key); + if ($keymin == 'accountancy_code_supplier') $keymin = 'code_compta_fournisseur'; + if (!property_exists($this->thirdparty, $keymin)) { + continue; + } + $vallabel = $this->thirdparty->$keymin; + + $i = (int) preg_replace('/[^0-9]/', '', $key); + if ($i > 0) { + if ($this->thirdparty->isACompany()) { + // Check for mandatory prof id (but only if country is other than ours) + if ($mysoc->country_id > 0 && $this->thirdparty->country_id == $mysoc->country_id) { + $idprof_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY'; + if (!$vallabel && !empty($conf->global->$idprof_mandatory)) { + $langs->load("errors"); + $this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId'.$i, $this->thirdparty->country_code)).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; + dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); + return -1; + } + } + } + } else { + if ($key == 'EMAIL') { + // Check for mandatory + if (!empty($conf->global->SOCIETE_EMAIL_INVOICE_MANDATORY) && !isValidEMail($this->thirdparty->email)) { + $langs->load("errors"); + $this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; + dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); + return -1; + } + } + elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER') { + // Check for mandatory + if (!empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_INVOICE_MANDATORY) && empty($this->thirdparty->code_compta_fournisseur)) { + $langs->load("errors"); + $this->error = $langs->trans("ErrorAccountancyCodeSupplierIsMandatory", $this->thirdparty->name).' ('.$langs->trans("ForbiddenBySetupRules").')'; + dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); + return -1; + } + } + } + } + } + $this->db->begin(); // Define new ref diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 60b2b424aaa..e12751834eb 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -31,6 +31,7 @@ ErrorBadThirdPartyName=Bad value for third-party name ForbiddenBySetupRules=Forbidden by setup rules ErrorProdIdIsMandatory=The %s is mandatory ErrorAccountancyCodeCustomerIsMandatory=The accountancy code of customer %s is mandatory +ErrorAccountancyCodeSupplierIsMandatory=The accountancy code of supplier %s is mandatory ErrorBadCustomerCodeSyntax=Bad syntax for customer code ErrorBadBarCodeSyntax=Bad syntax for barcode. May be you set a bad barcode type or you defined a barcode mask for numbering that does not match value scanned. ErrorCustomerCodeRequired=Customer code required diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 2fb9285379f..870c8dd96b1 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -672,6 +672,10 @@ $profid['IDPROF6'][0] = $langs->trans("ProfId6"); $profid['IDPROF6'][1] = $langs->transcountry('ProfId6', $mysoc->country_code); $profid['EMAIL'][0] = $langs->trans("EMail"); $profid['EMAIL'][1] = $langs->trans('Email'); +$profid['ACCOUNTANCY_CODE_CUSTOMER'][0] = $langs->trans("CustomerAccountancyCodeShort"); +$profid['ACCOUNTANCY_CODE_CUSTOMER'][1] = $langs->trans('CustomerAccountancyCodeShort'); +$profid['ACCOUNTANCY_CODE_SUPPLIER'][0] = $langs->trans("SupplierAccountancyCodeShort"); +$profid['ACCOUNTANCY_CODE_SUPPLIER'][1] = $langs->trans('SupplierAccountancyCodeShort'); $nbofloop = count($profid); foreach ($profid as $key => $val) { @@ -724,23 +728,6 @@ foreach ($profid as $key => $val) { $i++; } -if ($conf->accounting->enabled) { - print ''; - print ''.$langs->trans('CustomerAccountancyCodeShort')."\n"; - print ''; - - if (!empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_INVOICE_MANDATORY)) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print "\n"; -} - print "\n"; print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1d32063c27b..7c35e84a3e2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1152,9 +1152,11 @@ class Societe extends CommonObject } // Check for duplicate or mandatory fields defined into setup - $array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL'); + $array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL', 'ACCOUNTANCY_CODE_CUSTOMER', 'ACCOUNTANCY_CODE_SUPPLIER'); foreach ($array_to_check as $key) { $keymin = strtolower($key); + if ($key == 'ACCOUNTANCY_CODE_CUSTOMER') $keymin = 'code_compta'; + elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER') $keymin = 'code_compta_fournisseur'; $i = (int) preg_replace('/[^0-9]/', '', $key); $vallabel = $this->$keymin; @@ -1198,6 +1200,40 @@ class Societe extends CommonObject } } } + elseif ($key == 'ACCOUNTANCY_CODE_CUSTOMER' && ! empty($this->client)) { + // Check for unicity + if ($vallabel && !empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_UNIQUE)) { + if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { + $langs->loadLangs(array("errors", 'compta')); + $error++; + $this->errors[] = $langs->trans('CustomerAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; + } + } + + // Check for mandatory + if (!empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_MANDATORY) && (!isset($vallabel) || trim($vallabel) === '')) { + $langs->loadLangs(array("errors", 'compta')); + $error++; + $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; + } + } + elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER' && ! empty($this->fournisseur)) { + // Check for unicity + if ($vallabel && !empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_UNIQUE)) { + if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { + $langs->loadLangs(array("errors", 'compta')); + $error++; + $this->errors[] = $langs->trans('SupplierAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; + } + } + + // Check for mandatory + if (!empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_MANDATORY) && (!isset($vallabel) || trim($vallabel) === '')) { + $langs->loadLangs(array("errors", 'compta')); + $error++; + $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; + } + } } } @@ -3359,18 +3395,18 @@ class Societe extends CommonObject global $conf; if (!empty($conf->global->SOCIETE_CODECOMPTA_ADDON)) { + $module=$conf->global->SOCIETE_CODECOMPTA_ADDON; $res = false; $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); foreach ($dirsociete as $dirroot) { - $res = dol_include_once($dirroot.$conf->global->SOCIETE_CODECOMPTA_ADDON.'.php'); + $res = dol_include_once($dirroot.$module.'.php'); if ($res) { break; } } if ($res) { - $classname = $conf->global->SOCIETE_CODECOMPTA_ADDON; - $mod = new $classname; + $mod = new $module(); // Set code count in $mod->code $result = $mod->get_code($this->db, $this, $type); From 23fe8bef37ab7024611756607c526000ac83db97 Mon Sep 17 00:00:00 2001 From: kamel Date: Fri, 13 May 2022 10:53:00 +0200 Subject: [PATCH 0022/1137] Correction Stickler CI --- htdocs/fourn/class/fournisseur.facture.class.php | 3 +-- htdocs/societe/class/societe.class.php | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index e8e10008fae..5aea9b9e278 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1825,8 +1825,7 @@ class FactureFournisseur extends CommonInvoice dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); return -1; } - } - elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER') { + } elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER') { // Check for mandatory if (!empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_INVOICE_MANDATORY) && empty($this->thirdparty->code_compta_fournisseur)) { $langs->load("errors"); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 7c35e84a3e2..8ec94cd4471 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1199,8 +1199,7 @@ class Societe extends CommonObject $error++; $this->errors[] = $langs->trans('Email')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; } } - } - elseif ($key == 'ACCOUNTANCY_CODE_CUSTOMER' && ! empty($this->client)) { + } elseif ($key == 'ACCOUNTANCY_CODE_CUSTOMER' && !empty($this->client)) { // Check for unicity if ($vallabel && !empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_UNIQUE)) { if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { @@ -1216,8 +1215,7 @@ class Societe extends CommonObject $error++; $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; } - } - elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER' && ! empty($this->fournisseur)) { + } elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER' && !empty($this->fournisseur)) { // Check for unicity if ($vallabel && !empty($conf->global->SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_UNIQUE)) { if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { From e1eb85ffb0829d4a3bb88e602320eb8c1f704e2d Mon Sep 17 00:00:00 2001 From: kamel Date: Fri, 13 May 2022 11:53:23 +0200 Subject: [PATCH 0023/1137] relaunch travis From 16bdd0dc491744ecfbff2e7c5b250b4a91ae5ecb Mon Sep 17 00:00:00 2001 From: Norbert Penel Date: Sat, 21 May 2022 18:54:38 +0200 Subject: [PATCH 0024/1137] FIX #20930 --- htdocs/core/ajax/ziptown.php | 3 +++ htdocs/core/class/html.formcompany.class.php | 26 ++++++++++++++++++++ htdocs/user/card.php | 4 +-- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index aa9474ce142..3cd50c8b612 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -141,6 +141,9 @@ if (GETPOST('zipcode') || GETPOST('town')) { } echo json_encode($return_arr); +} elseif (isset($_GET['country_codeid'])) { + $formcompany = new FormCompany($db); + print $formcompany->select_state(GETPOST('selected', 'int', 1), GETPOST('country_codeid', 'int', 1), GETPOST('htmlname', 'alpha', 1), GETPOST('morecss', 'alpha', 1)); } $db->close(); diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index f976fac978d..d1c79ab2979 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -366,6 +366,32 @@ class FormCompany extends Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns the drop-down list of departments/provinces/cantons for all countries or for a given country. + * In the case of an all-country list, the display breaks on the country. + * The key of the list is the code (there can be several entries for a given code but in this case, the country field differs). + * Thus the links with the departments are done on a department independently of its name. + * + * @param string $parent_field_id Parent select name to monitor + * @param integer $selected Code state preselected (mus be state id) + * @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show + * @param string $htmlname Id of department. If '', we want only the string with \n"; + + // Sort + if ($sort == 'ASC') { + asort($array); + } elseif ($sort == 'DESC') { + arsort($array); + } + + foreach ($array as $key => $tmpvalue) { + if (is_array($tmpvalue)) { + $value = $tmpvalue['label']; + $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; + $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; + } else { + $value = $tmpvalue; + $disabled = ''; + $style = ''; + } + if (!empty($disablebademail)) { + if (($disablebademail == 1 && !preg_match('/<.+@.+>/', $value)) + || ($disablebademail == 2 && preg_match('/---/', $value))) { + $disabled = ' disabled'; + $style = ' class="warning"'; + } + } + + if ($key_in_label) { + if (empty($nohtmlescape)) { + $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); + } else { + $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); + } + } else { + if (empty($nohtmlescape)) { + $selectOptionValue = dol_escape_htmltag($maxlen ? dol_trunc($value, $maxlen) : $value); + } else { + $selectOptionValue = $maxlen ? dol_trunc($value, $maxlen) : $value; + } + if ($value == '' || $value == '-') { + $selectOptionValue = ' '; + } + } + + $out .= '\n"; + } } + + $out .= ""; + + // Add code for jquery to use multiselect + if ($addjscombo && $jsbeautify) { + // Enhance with select2 + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', ($show_empty < 0 ? (string) $show_empty : '-1'), $morecss); + } + } elseif ($input == "inputSeparator") { + $out .= ''; + $out .= ''; + $out .= ''; + + $out .= ''; } - $out .= ""; - // Add code for jquery to use multiselect - if ($addjscombo && $jsbeautify) { - // Enhance with select2 - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', ($show_empty < 0 ? (string) $show_empty : '-1'), $morecss); - } + + return $out; } - /** * Return a HTML select string, built from an array of key+value, but content returned into select come from an Ajax call of an URL. * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index b60e26d2931..b85df064385 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -703,6 +703,9 @@ class FormFile $out .= ''; $out .= ''; + $addcolumforpicto = ($delallowed || $printer || $morepicto); + $colspan = (4 + ($addcolumforpicto ? 1 : 0)); + $colspanmore = 0; $out .= ''; } // Payment mode diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ead429c7152..acba0190450 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1582,7 +1582,7 @@ if ($resql) { // Payment term if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) { print ''; } // Payment mode diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 56ef08d1f1e..561880243d1 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -627,7 +627,7 @@ if (!empty($arrayfields['f.total_ttc']['checked'])) { if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { // Payment term print '"; } if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 5e5dde00ab2..31afb45bed6 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1458,7 +1458,7 @@ if ($resql) { // Payment terms if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print ''; } // Module source diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index dd94edf7228..91d4f52881a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4252,9 +4252,10 @@ class Form * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) * 0 : use default deposit percentage from entry * > 0 : force deposit percentage (for example, from company object) + * @param string $mode card or list * @return string String for the HTML select component */ - public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1) + public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $mode = 'card') { global $langs, $user, $conf; @@ -4263,8 +4264,8 @@ class Form $this->load_cache_conditions_paiements(); - // Set default value if not already set by caller - if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) { + // Set default value if not already set by caller only for cards + if (empty($selected) && $mode == 'card' && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) { $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID; } diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 684c7d01b11..48751b702ef 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -522,7 +522,7 @@ if ($resql) { if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { // Payment term print '"; } if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index a3cb7e016a7..c04830f61ac 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1118,7 +1118,7 @@ if (!empty($arrayfields['typent.code']['checked'])) { // Condition of payment if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print ''; } // Payment mode From 276a6ae6a408a4e32cf688da71e6676500f9bc1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Jun 2023 13:58:44 +0200 Subject: [PATCH 0083/1137] do not add default value in list --- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/commande/list_det.php | 2 +- htdocs/compta/bank/various_payment/list.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 2 +- htdocs/compta/facture/list.php | 2 +- htdocs/compta/paiement/list.php | 2 +- htdocs/compta/sociales/list.php | 2 +- htdocs/compta/tva/list.php | 2 +- htdocs/core/class/html.form.class.php | 5 +++-- htdocs/fourn/paiement/list.php | 2 +- htdocs/salaries/list.php | 2 +- 12 files changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 4d05a1a825a..21a6d5a63b8 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1324,7 +1324,7 @@ if ($resql) { // Payment mode if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) { print ''; } if (!empty($arrayfields['p.total_ht']['checked'])) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index acba0190450..db8b3b29edc 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1588,7 +1588,7 @@ if ($resql) { // Payment mode if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { print ''; } // Channel diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 884ba9cf390..24e1703eaa6 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1052,7 +1052,7 @@ if ($resql) { // Payment mode if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { print ''; } // Channel diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 36855eb653c..0470a5a1b73 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -488,7 +488,7 @@ if ($arrayfields['datev']['checked']) { // Payment type if ($arrayfields['type']['checked']) { print ''; } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 561880243d1..cd08f61b869 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -633,7 +633,7 @@ if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { // Payment mode print ''; } if (!empty($arrayfields['recurring']['checked'])) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 31afb45bed6..22fb0fd7e5b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1452,7 +1452,7 @@ if ($resql) { // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { print ''; } // Payment terms diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 12036bd07bc..006e6ee6088 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -416,7 +416,7 @@ if (!empty($arrayfields['s.nom']['checked'])) { // Filter: Payment type if (!empty($arrayfields['c.libelle']['checked'])) { print ''; } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index ea415784943..eb5c6ef33f7 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -519,7 +519,7 @@ if (!empty($arrayfields['cs.fk_user']['checked'])) { // Filter: Type if (!empty($arrayfields['cs.fk_mode_reglement']['checked'])) { print ''; } diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 22ac6310efc..82dcc151e12 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -465,7 +465,7 @@ if (!empty($arrayfields['t.datev']['checked'])) { // Filter: Type if (!empty($arrayfields['t.fk_typepayment']['checked'])) { print ''; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 91d4f52881a..f68dff5a879 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4346,9 +4346,10 @@ class Form * @param int $active Active or not, -1 = all * @param string $morecss Add more CSS on select tag * @param int $nooutput 1=Return string, do not send to output + * @param string $mode card or list * @return string|void String for the HTML select component */ - public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0) + public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0, $mode = 'card') { // phpcs:enable global $langs, $user, $conf; @@ -4369,7 +4370,7 @@ class Form $this->load_cache_types_paiements(); // Set default value if not already set by caller - if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) { + if (empty($selected) && $mode == 'card' && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) { $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID; } diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 61b6ae23df4..bd4b976c833 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -390,7 +390,7 @@ if (!empty($arrayfields['s.nom']['checked'])) { // Filter: Payment type if (!empty($arrayfields['c.libelle']['checked'])) { print ''; } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 5a908a4d58e..d904aa839d9 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -522,7 +522,7 @@ print ''; // Type print ''; // Bank account From 3fa04fb7a8be97e7a2887e2e52430354036ebeb9 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Thu, 29 Jun 2023 15:09:27 +0200 Subject: [PATCH 0084/1137] Fix : some dolibarr log warnings --- htdocs/expensereport/class/paymentexpensereport.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/class/paiementfourn.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 342709d44be..c1907a0f13a 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -646,7 +646,7 @@ class PaymentExpenseReport extends CommonObject $label .= '
'.$langs->trans('Ref').': '.$this->ref; } if (!empty($this->datep)) { - $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->datep, 'dayhour'); + $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->db->jdate($this->datep), 'dayhour'); } if (!empty($this->id)) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 73f66d7fb02..06a51b25194 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2763,7 +2763,7 @@ class FactureFournisseur extends CommonInvoice $datas['label'] = '
'.$langs->trans('Label').': '.$this->label; } if (!empty($this->date)) { - $datas['date'] = '
'.$langs->trans('Date').': '.dol_print_date($this->date, 'day'); + $datas['date'] = '
'.$langs->trans('Date').': '.dol_print_date($this->db->jdate($this->date), 'day'); } if (!empty($this->date_echeance)) { $datas['date_echeance'] = '
'.$langs->trans('DateDue').': '.dol_print_date($this->date_echeance, 'day'); diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 1a90e971df3..2bb43af9628 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -683,7 +683,7 @@ class PaiementFourn extends Paiement $label .= ''.$langs->trans("Ref").': '.$text; $dateofpayment = ($this->datepaye ? $this->datepaye : $this->date); if ($dateofpayment) { - $label .= '
'.$langs->trans("Date").': '.dol_print_date($dateofpayment, 'dayhour', 'tzuser'); + $label .= '
'.$langs->trans("Date").': '.dol_print_date($this->db->jdate($dateofpayment), 'dayhour', 'tzuser'); } if ($this->amount) { $label .= '
'.$langs->trans("Amount").': '.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency); From a09adc9633ed911f9806f4996496c3197f96e01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9=20GDSOFT?= Date: Fri, 30 Jun 2023 11:01:57 +0200 Subject: [PATCH 0085/1137] stock : exports : ajout code barre du produit --- htdocs/core/modules/modStock.class.php | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index e99742a14c4..e4b25dd6239 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -237,6 +237,9 @@ class modStock extends DolibarrModules 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification', 'p.pmp'=>'PMPValue', 'p.cost_price'=>'CostPrice', 'p.seuil_stock_alerte'=>'StockLimit', ); + if (isModEnabled('barcode')) { + $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode')); + } $this->export_TypeFields_array[$r] = array( 'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.lieu'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text', 'p.rowid'=>"Numeric", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text", @@ -245,6 +248,9 @@ class modStock extends DolibarrModules 'ps.reel'=>'Numeric', 'p.seuil_stock_alerte'=>'Numeric', ); + if (isModEnabled('barcode')) { + $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); + } $this->export_entities_array[$r] = array( 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", @@ -252,6 +258,9 @@ class modStock extends DolibarrModules 'ps.reel'=>'stock', 'p.seuil_stock_alerte'=>'product', ); // We define here only fields that use another icon that the one defined into export_icon + if (isModEnabled('barcode')) { + $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); + } $this->export_aggregate_array[$r] = array('ps.reel'=>'SUM'); // TODO Not used yet $this->export_dependencies_array[$r] = array('stock'=>array('p.rowid', 'e.rowid')); // We must keep this until the aggregate_array is used. To have a unique key, if we ask a field of a child, to avoid the DISTINCT to discard them. $keyforselect = 'product'; @@ -284,6 +293,9 @@ class modStock extends DolibarrModules 'pb.rowid'=>'Id', 'pb.batch'=>'Batch', 'pb.qty'=>'Qty', 'pl.eatby'=>'EatByDate', 'pl.sellby'=>'SellByDate' ); + if (isModEnabled('barcode')) { + $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode')); + } $this->export_TypeFields_array[$r] = array( 'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.lieu'=>'Text', 'e.description'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text', 'p.rowid'=>"Numeric", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text", @@ -292,6 +304,9 @@ class modStock extends DolibarrModules 'pb.batch'=>'Text', 'pb.qty'=>'Numeric', 'pl.eatby'=>'Date', 'pl.sellby'=>'Date' ); + if (isModEnabled('barcode')) { + $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); + } $this->export_entities_array[$r] = array( 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", @@ -299,6 +314,9 @@ class modStock extends DolibarrModules 'pb.rowid'=>'batch', 'pb.batch'=>'batch', 'pb.qty'=>'batch', 'pl.eatby'=>'batch', 'pl.sellby'=>'batch' ); // We define here only fields that use another icon that the one defined into export_icon + if (isModEnabled('barcode')) { + $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); + } $this->export_aggregate_array[$r] = array('ps.reel'=>'SUM'); // TODO Not used yet $this->export_dependencies_array[$r] = array('stockbatch'=>array('pb.rowid'), 'batch'=>array('pb.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. $keyforselect = 'product_lot'; @@ -329,12 +347,18 @@ class modStock extends DolibarrModules 'p.rowid'=>"ProductId", 'p.ref'=>"Ref", 'p.fk_product_type'=>"Type", 'p.label'=>"Label", 'p.description'=>"Description", 'p.note'=>"Note", 'p.price'=>"Price", 'p.tva_tx'=>'VAT', 'p.tosell'=>"OnSell", 'p.tobuy'=>'OnBuy', 'p.duration'=>"Duration", 'p.datec'=>'DateCreation', 'p.tms'=>'DateModification' ); + if (isModEnabled('barcode')) { + $this->export_fields_array[$r] = array_merge($this->export_fields_array[$r], array('p.barcode'=>'BarCode')); + } $this->export_TypeFields_array[$r] = array( 'sm.rowid'=>'Numeric', 'sm.value'=>'Numeric', 'sm.datem'=>'Date', 'sm.batch'=>'Text', 'sm.label'=>'Text', 'sm.inventorycode'=>'Text', 'e.rowid'=>'List:entrepot:ref::stock', 'e.ref'=>'Text', 'e.description'=>'Text', 'e.lieu'=>'Text', 'e.address'=>'Text', 'e.zip'=>'Text', 'e.town'=>'Text', 'p.rowid'=>"Numeric", 'p.ref'=>"Text", 'p.fk_product_type'=>"Text", 'p.label'=>"Text", 'p.description'=>"Text", 'p.note'=>"Text", 'p.price'=>"Numeric", 'p.tva_tx'=>'Numeric', 'p.tosell'=>"Boolean", 'p.tobuy'=>"Boolean", 'p.duration'=>"Duree", 'p.datec'=>'Date', 'p.tms'=>'Date' ); + if (isModEnabled('barcode')) { + $this->export_TypeFields_array[$r] = array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); + } $this->export_entities_array[$r] = array( 'e.rowid'=>'warehouse', 'e.ref'=>'warehouse', 'e.description'=>'warehouse', 'e.lieu'=>'warehouse', 'e.address'=>'warehouse', 'e.zip'=>'warehouse', 'e.town'=>'warehouse', 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", @@ -345,6 +369,9 @@ class modStock extends DolibarrModules $this->export_TypeFields_array[$r]['sm.batch'] = 'Text'; $this->export_entities_array[$r]['sm.batch'] = 'movement'; } + if (isModEnabled('barcode')) { + $this->export_entities_array[$r] = array_merge($this->export_entities_array[$r], array('p.barcode'=>'product')); + } $this->export_aggregate_array[$r] = array('sm.value'=>'SUM'); // TODO Not used yet $this->export_dependencies_array[$r] = array('movement'=>array('sm.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. From 48541caee573bdc7b8c54c8aa43515382381ecc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:22:27 +0200 Subject: [PATCH 0086/1137] add contact field --- htdocs/install/mysql/tables/llx_ticket-ticket.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/tables/llx_ticket-ticket.sql b/htdocs/install/mysql/tables/llx_ticket-ticket.sql index c651eaccca2..dc7ab197735 100644 --- a/htdocs/install/mysql/tables/llx_ticket-ticket.sql +++ b/htdocs/install/mysql/tables/llx_ticket-ticket.sql @@ -1,5 +1,6 @@ -- SQL definition for module ticket -- Copyright (C) 2013 Jean-François FERRY +-- Copyright (C) 2023 Charlene Benke -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -22,6 +23,7 @@ CREATE TABLE llx_ticket track_id varchar(128) NOT NULL, fk_soc integer DEFAULT 0, fk_project integer DEFAULT 0, + fk_contract integer DEFAULT 0, origin_email varchar(128), fk_user_create integer, fk_user_assign integer, From 9b596c6e19443b4d9841c481c3e1428089b7e5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:24:30 +0200 Subject: [PATCH 0087/1137] Create 18.0.0-19.0.0.sql --- .../install/mysql/migration/18.0.0-19.0.0.sql | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 htdocs/install/mysql/migration/18.0.0-19.0.0.sql diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql new file mode 100644 index 00000000000..d4b3a6c8d2c --- /dev/null +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -0,0 +1,36 @@ + +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 18.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 ADD PRIMARY KEY(rowid); +-- -- 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(); + + +- V18 From ff7a2ca40cd6ed563f2dca84e3461b8bb2a5f78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:26:44 +0200 Subject: [PATCH 0088/1137] Update 18.0.0-19.0.0.sql add fk_contract on ticket table --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index d4b3a6c8d2c..d1f2a74af7a 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -33,4 +33,5 @@ -- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences(); -- V18 +- V19 +ALTER TABLE llx_ticket_ticket ADD COLUMN fk_contract integer DEFAULT 0 after fk_project; From f56bc55b49ab488d6f898ced5d59595c4ec4d55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Sun, 2 Jul 2023 14:00:50 +0200 Subject: [PATCH 0089/1137] Update 18.0.0-19.0.0.sql --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index d1f2a74af7a..abd778f71aa 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -34,4 +34,4 @@ - V19 -ALTER TABLE llx_ticket_ticket ADD COLUMN fk_contract integer DEFAULT 0 after fk_project; +ALTER TABLE llx_ticket ADD COLUMN fk_contract integer DEFAULT 0 after fk_project; From 5584609662d63a9a0d760227395c2f0103384f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 3 Jul 2023 21:08:29 +0200 Subject: [PATCH 0090/1137] fix --- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 4 ++-- htdocs/core/class/html.form.class.php | 12 ++++++------ htdocs/fourn/facture/list.php | 2 +- htdocs/salaries/list.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 21a6d5a63b8..e442ccbbc3f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1318,7 +1318,7 @@ if ($resql) { // Payment term if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { print '
'; } // Payment mode diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index db8b3b29edc..ead429c7152 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1582,13 +1582,13 @@ if ($resql) { // Payment term if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) { print ''; } // Payment mode if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { print ''; } // Channel diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f68dff5a879..78b033c6bb0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4252,10 +4252,9 @@ class Form * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) * 0 : use default deposit percentage from entry * > 0 : force deposit percentage (for example, from company object) - * @param string $mode card or list * @return string String for the HTML select component */ - public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $mode = 'card') + public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1) { global $langs, $user, $conf; @@ -4265,7 +4264,8 @@ class Form $this->load_cache_conditions_paiements(); // Set default value if not already set by caller only for cards - if (empty($selected) && $mode == 'card' && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) { + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) { + dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID; } @@ -4346,10 +4346,9 @@ class Form * @param int $active Active or not, -1 = all * @param string $morecss Add more CSS on select tag * @param int $nooutput 1=Return string, do not send to output - * @param string $mode card or list * @return string|void String for the HTML select component */ - public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0, $mode = 'card') + public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '', $nooutput = 0) { // phpcs:enable global $langs, $user, $conf; @@ -4370,7 +4369,8 @@ class Form $this->load_cache_types_paiements(); // Set default value if not already set by caller - if (empty($selected) && $mode == 'card' && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) { + if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) { + dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID; } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index c04830f61ac..ea46e8ed25d 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1118,7 +1118,7 @@ if (!empty($arrayfields['typent.code']['checked'])) { // Condition of payment if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print ''; } // Payment mode diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index d904aa839d9..5a908a4d58e 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -522,7 +522,7 @@ print ''; // Type print ''; // Bank account From 107cdc881011708893de0f00ba7dc41a1367761c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 3 Jul 2023 21:09:34 +0200 Subject: [PATCH 0091/1137] fix --- htdocs/fourn/paiement/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index bd4b976c833..61b6ae23df4 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -390,7 +390,7 @@ if (!empty($arrayfields['s.nom']['checked'])) { // Filter: Payment type if (!empty($arrayfields['c.libelle']['checked'])) { print ''; } From e65f4c0ec6b5972f39e1a0b51c292cddc6fc823e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 3 Jul 2023 21:10:58 +0200 Subject: [PATCH 0092/1137] fix --- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list_det.php | 2 +- htdocs/compta/bank/various_payment/list.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 4 ++-- htdocs/compta/facture/list.php | 4 ++-- htdocs/compta/paiement/list.php | 2 +- htdocs/compta/sociales/list.php | 2 +- htdocs/compta/tva/list.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/fourn/facture/list-rec.php | 2 +- htdocs/fourn/facture/list.php | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index e442ccbbc3f..753c449a278 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1324,7 +1324,7 @@ if ($resql) { // Payment mode if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) { print ''; } if (!empty($arrayfields['p.total_ht']['checked'])) { diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 24e1703eaa6..884ba9cf390 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1052,7 +1052,7 @@ if ($resql) { // Payment mode if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { print ''; } // Channel diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 0470a5a1b73..36855eb653c 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -488,7 +488,7 @@ if ($arrayfields['datev']['checked']) { // Payment type if ($arrayfields['type']['checked']) { print ''; } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index cd08f61b869..56ef08d1f1e 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -627,13 +627,13 @@ if (!empty($arrayfields['f.total_ttc']['checked'])) { if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { // Payment term print '"; } if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { // Payment mode print ''; } if (!empty($arrayfields['recurring']['checked'])) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 22fb0fd7e5b..5e5dde00ab2 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1452,13 +1452,13 @@ if ($resql) { // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { print ''; } // Payment terms if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print ''; } // Module source diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 006e6ee6088..12036bd07bc 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -416,7 +416,7 @@ if (!empty($arrayfields['s.nom']['checked'])) { // Filter: Payment type if (!empty($arrayfields['c.libelle']['checked'])) { print ''; } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index eb5c6ef33f7..ea415784943 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -519,7 +519,7 @@ if (!empty($arrayfields['cs.fk_user']['checked'])) { // Filter: Type if (!empty($arrayfields['cs.fk_mode_reglement']['checked'])) { print ''; } diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 82dcc151e12..22ac6310efc 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -465,7 +465,7 @@ if (!empty($arrayfields['t.datev']['checked'])) { // Filter: Type if (!empty($arrayfields['t.fk_typepayment']['checked'])) { print ''; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 78b033c6bb0..06801ce12d2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4263,7 +4263,7 @@ class Form $this->load_cache_conditions_paiements(); - // Set default value if not already set by caller only for cards + // Set default value if not already set by caller if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID)) { dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID; diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 48751b702ef..684c7d01b11 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -522,7 +522,7 @@ if ($resql) { if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { // Payment term print '"; } if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index ea46e8ed25d..a3cb7e016a7 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1118,7 +1118,7 @@ if (!empty($arrayfields['typent.code']['checked'])) { // Condition of payment if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print ''; } // Payment mode From 08ff6583dcbe680aa14160cd3f9757c64d10c6a8 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 4 Jul 2023 11:36:06 +0200 Subject: [PATCH 0093/1137] better fix --- htdocs/expensereport/class/paymentexpensereport.class.php | 2 +- htdocs/expensereport/payment/list.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index c1907a0f13a..342709d44be 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -646,7 +646,7 @@ class PaymentExpenseReport extends CommonObject $label .= '
'.$langs->trans('Ref').': '.$this->ref; } if (!empty($this->datep)) { - $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->db->jdate($this->datep), 'dayhour'); + $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->datep, 'dayhour'); } if (!empty($this->id)) { diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 0a142ed3d25..4f292c2987b 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -483,7 +483,7 @@ while ($i < $imaxinloop) { $paymentexpensereportstatic->id = $objp->rowid; $paymentexpensereportstatic->ref = $objp->ref; - $paymentexpensereportstatic->datep = $objp->datep; + $paymentexpensereportstatic->datep = $db->jdate($objp->datep); $paymentexpensereportstatic->amount = $objp->pamount; $paymentexpensereportstatic->fk_typepayment = $objp->paiement_type; From f72df4510c478f4d68aeab1e1968d2393882ef74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Tue, 4 Jul 2023 12:14:44 +0200 Subject: [PATCH 0094/1137] Update card.php php v8 warning, tva_npr var not initialised --- htdocs/comm/propal/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 419f552cecc..f2e95d8b076 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1040,6 +1040,7 @@ if (empty($reshook)) { $pu_ttc_devise = 0; $price_min = 0; $price_min_ttc = 0; + $tva_npr=0; $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); $db->begin(); From afa4cc7bce7dfde702480078d2cb0840e70d88b3 Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 4 Jul 2023 23:19:04 +0200 Subject: [PATCH 0095/1137] FIX|Fix (#24085) Add the Project filter --- htdocs/product/stock/movement_list.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 232b31ca984..b0d61297e97 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -85,7 +85,7 @@ $search_user = trim(GETPOST("search_user")); $search_batch = trim(GETPOST("search_batch")); $search_qty = trim(GETPOST("search_qty")); $search_type_mouvement = GETPOST('search_type_mouvement', 'int'); -$search_fk_projet=GETPOST("search_fk_projet", 'int'); +$search_fk_project=GETPOST("search_fk_project"); $type = GETPOST("type", "int"); @@ -226,10 +226,10 @@ if (empty($reshook)) { $search_user = ""; $search_batch = ""; $search_qty = ''; - $search_fk_projet=0; $search_all = ""; $toselect = array(); $search_array_options = array(); + $search_fk_project = ""; } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { @@ -690,8 +690,8 @@ if (!empty($search_batch)) { if (!empty($product_id) && $product_id != '-1') { $sql .= natural_search('p.rowid', $product_id); } -if (!empty($search_fk_projet) && $search_fk_projet != '-1') { - $sql .= natural_search('m.fk_projet', $search_fk_projet); +if (!empty($search_fk_project)) { + $sql .= natural_search('m.fk_projet', $search_fk_project); } if ($search_qty != '') { $sql .= natural_search('m.value', $search_qty, 1); @@ -1008,6 +1008,9 @@ if ($search_user) { if ($idproduct > 0) { $param .= '&idproduct='.urlencode($idproduct); } +if ($search_fk_project != '') { + $param .= '&search_fk_project='.urlencode($search_fk_project); +} // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks @@ -1178,10 +1181,17 @@ if (!empty($arrayfields['origin']['checked'])) { print '  '; print ''; } +// if (!empty($arrayfields['p.ref']['checked'])) { +// print '
'; +// } if (!empty($arrayfields['m.fk_projet']['checked'])) { // fk_project print ''; } if (!empty($arrayfields['m.type_mouvement']['checked'])) { From b8232551da792591587dfe829d8b1b6f7800e4f8 Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 4 Jul 2023 23:22:28 +0200 Subject: [PATCH 0096/1137] remove comments --- htdocs/product/stock/movement_list.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index b0d61297e97..fc9e9bf19bd 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1181,17 +1181,10 @@ if (!empty($arrayfields['origin']['checked'])) { print '  '; print ''; } -// if (!empty($arrayfields['p.ref']['checked'])) { -// print ''; -// } if (!empty($arrayfields['m.fk_projet']['checked'])) { // fk_project print ''; } if (!empty($arrayfields['m.type_mouvement']['checked'])) { From 9427b4e0519537079bc09a30541b2d3460978201 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 11:03:18 +0200 Subject: [PATCH 0097/1137] Typo --- htdocs/core/class/html.formcompany.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index a89fd916c94..73060a38d43 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -1169,7 +1169,7 @@ class FormCompany extends Form url: \'' . DOL_URL_ROOT . '/core/ajax/ajaxstatusprospect.php\', data: { id: statusid, prospectid: prospectid, token: \''. newToken() .'\', action: \'updatestatusprospect\' }, success: function(response) { -console.log(response.img); + console.log(response.img); image.replaceWith(response.img); }, error: function() { From a2671fdbb262a8b1b234ad9b8ca24c925cf4558f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 12:15:44 +0200 Subject: [PATCH 0098/1137] Prepare v19 --- htdocs/core/class/html.formcontract.class.php | 2 +- htdocs/filefunc.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index f4486bfb2b5..9c54dc770a7 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -59,7 +59,7 @@ class FormContract * @param int $maxlength Maximum length of label * @param int $showempty Show empty line * @param int $showRef Show customer and supplier reference on each contract (when found) - * @return int Nbr of project if OK, <0 if KO + * @return int Nbr of contract if OK, <0 if KO */ public function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0) { diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index f4f7e281cd3..e9d2069154f 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '18.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '19.0.0-dev'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 11509c2e9447c527864a40f0ec9fb734126cc187 Mon Sep 17 00:00:00 2001 From: FLIO Date: Wed, 5 Jul 2023 13:16:12 +0200 Subject: [PATCH 0099/1137] fix the condition if you put nothing in the selectbox --- htdocs/product/stock/movement_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index fc9e9bf19bd..addb445b8e6 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -690,7 +690,7 @@ if (!empty($search_batch)) { if (!empty($product_id) && $product_id != '-1') { $sql .= natural_search('p.rowid', $product_id); } -if (!empty($search_fk_project)) { +if (!empty($search_fk_project) && $search_fk_project != '-1') { $sql .= natural_search('m.fk_projet', $search_fk_project); } if ($search_qty != '') { @@ -1008,7 +1008,7 @@ if ($search_user) { if ($idproduct > 0) { $param .= '&idproduct='.urlencode($idproduct); } -if ($search_fk_project != '') { +if ($search_fk_project != '' && $search_fk_project != '-1') { $param .= '&search_fk_project='.urlencode($search_fk_project); } // Add $param from extra fields From 7aad3649cae007987515f5fa4809d344ea612c93 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Wed, 5 Jul 2023 13:33:22 +0200 Subject: [PATCH 0100/1137] better fix for date --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/fourn/class/paiementfourn.class.php | 2 +- htdocs/fourn/facture/list.php | 2 +- htdocs/fourn/paiement/list.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 06a51b25194..73f66d7fb02 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2763,7 +2763,7 @@ class FactureFournisseur extends CommonInvoice $datas['label'] = '
'.$langs->trans('Label').': '.$this->label; } if (!empty($this->date)) { - $datas['date'] = '
'.$langs->trans('Date').': '.dol_print_date($this->db->jdate($this->date), 'day'); + $datas['date'] = '
'.$langs->trans('Date').': '.dol_print_date($this->date, 'day'); } if (!empty($this->date_echeance)) { $datas['date_echeance'] = '
'.$langs->trans('DateDue').': '.dol_print_date($this->date_echeance, 'day'); diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 2bb43af9628..1a90e971df3 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -683,7 +683,7 @@ class PaiementFourn extends Paiement $label .= ''.$langs->trans("Ref").': '.$text; $dateofpayment = ($this->datepaye ? $this->datepaye : $this->date); if ($dateofpayment) { - $label .= '
'.$langs->trans("Date").': '.dol_print_date($this->db->jdate($dateofpayment), 'dayhour', 'tzuser'); + $label .= '
'.$langs->trans("Date").': '.dol_print_date($dateofpayment, 'dayhour', 'tzuser'); } if ($this->amount) { $label .= '
'.$langs->trans("Amount").': '.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index a41f3011c17..101dafe6c13 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1488,7 +1488,7 @@ while ($i < $imaxinloop) { $facturestatic->type = $obj->type; $facturestatic->socid = $thirdparty->getNomUrl(1, 'supplier', 3); $facturestatic->total_ht = $obj->total_ht; - $facturestatic->date = $obj->datef; + $facturestatic->date = $db->jdate($obj->datef); $object = $facturestatic; diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 61b6ae23df4..97f441d4398 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -475,7 +475,7 @@ while ($i < min($num, $limit)) { $paymentfournstatic->id = $objp->rowid; $paymentfournstatic->ref = $objp->ref; - $paymentfournstatic->datepaye = $objp->datep; + $paymentfournstatic->datepaye = $db->jdate($objp->datep); $companystatic->id = $objp->socid; $companystatic->name = $objp->name; From 2c39cc4de3bbd6c9b2478a89e7243c174c2b01b9 Mon Sep 17 00:00:00 2001 From: Kamel Khelifa Date: Wed, 5 Jul 2023 17:43:32 +0200 Subject: [PATCH 0101/1137] NEW: Add context for the movement stock (role toconsume/toproduce) on mrp --- htdocs/mrp/mo_production.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 7bb0fb780aa..31085048bc4 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -229,6 +229,7 @@ if (empty($reshook)) { // Record stock movement $id_product_batch = 0; $stockmove->setOrigin($object->element, $object->id); + $stockmove->context['mrp_role'] = 'toconsume'; if ($qtytoprocess >= 0) { $idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); @@ -304,6 +305,7 @@ if (empty($reshook)) { $id_product_batch = 0; $stockmove->origin_type = $object->element; $stockmove->origin_id = $object->id; + $stockmove->context['mrp_role'] = 'toproduce'; $idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i), $qtytoprocess, $pricetoprocess, $labelmovement, '', '', GETPOST('batchtoproduce-'.$line->id.'-'.$i), dol_now(), $id_product_batch, $codemovement); if ($idstockmove < 0) { From 92219bb43eb5a72bea2d4c63db64d26776b605e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 20:03:02 +0200 Subject: [PATCH 0102/1137] Try to replace stickler --- .github/workflows/phpcsfixer.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index 5c74397ecfc..18076d2bb7d 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -1,6 +1,8 @@ name: GitHub CI PHPCS and PHPCBF -on: push +on: + pull_request: + types: [opened] #on: # push: # paths: From 7d0cdd67e9ff555b0a77d1c6daacf1271fd5651a Mon Sep 17 00:00:00 2001 From: Can Arslan Date: Wed, 5 Jul 2023 11:53:57 -0600 Subject: [PATCH 0103/1137] fix: Unknown column 'fk_projet' in 'field list' when trying to link... --- htdocs/projet/class/project.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 31bac71a1d8..88b69ba6426 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1923,7 +1923,7 @@ class Project extends CommonObject if ($tableName == "actioncomm") { $sql .= " SET fk_project=".$this->id; $sql .= " WHERE id=".((int) $elementSelectId); - } elseif ($tableName == "entrepot") { + } elseif (in_array($tableName, ["entrepot","mrp_mo"])) { $sql .= " SET fk_project=".$this->id; $sql .= " WHERE rowid=".((int) $elementSelectId); } else { From 533360ff272a5cee1b36cfa81ad283de1a101c68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Jul 2023 23:57:43 +0200 Subject: [PATCH 0104/1137] Test CI --- .github/workflows/phpcsfixer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index 18076d2bb7d..eeb943534d7 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -20,8 +20,8 @@ jobs: #needs: filesChanged steps: - uses: actions/checkout@v3 - with: - fetch-depth: 10 + #with: + # fetch-depth: 10 - name: echo Get list of all changed files run: | From 8990b47390b65778fae22068f90dcaac184efa19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Jul 2023 19:35:57 +0200 Subject: [PATCH 0105/1137] Fix css --- htdocs/mrp/mo_production.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 31085048bc4..d50bc18237e 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -229,7 +229,7 @@ if (empty($reshook)) { // Record stock movement $id_product_batch = 0; $stockmove->setOrigin($object->element, $object->id); - $stockmove->context['mrp_role'] = 'toconsume'; + $stockmove->context['mrp_role'] = 'toconsume'; if ($qtytoprocess >= 0) { $idstockmove = $stockmove->livraison($user, $line->fk_product, GETPOST('idwarehouse-'.$line->id.'-'.$i), $qtytoprocess, 0, $labelmovement, dol_now(), '', '', GETPOST('batch-'.$line->id.'-'.$i), $id_product_batch, $codemovement); @@ -305,7 +305,7 @@ if (empty($reshook)) { $id_product_batch = 0; $stockmove->origin_type = $object->element; $stockmove->origin_id = $object->id; - $stockmove->context['mrp_role'] = 'toproduce'; + $stockmove->context['mrp_role'] = 'toproduce'; $idstockmove = $stockmove->reception($user, $line->fk_product, GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i), $qtytoprocess, $pricetoprocess, $labelmovement, '', '', GETPOST('batchtoproduce-'.$line->id.'-'.$i), dol_now(), $id_product_batch, $codemovement); if ($idstockmove < 0) { From eb22ebced9ad415e2e08257ce2226b47a4f13208 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Jul 2023 19:57:09 +0200 Subject: [PATCH 0106/1137] Fix int --- htdocs/commande/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 971c7472a9a..e3ecec5a1d8 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -281,22 +281,22 @@ if (empty($reshook)) { $object->date_commande = $datecommande; $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->source = GETPOST('source_id'); + $object->source = GETPOST('source_id', 'int'); $object->fk_project = GETPOST('projectid', 'int'); $object->ref_client = GETPOST('ref_client', 'alpha'); $object->model_pdf = GETPOST('model'); - $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->cond_reglement_id = GETPOST('cond_reglement_id', 'int'); $object->deposit_percent = GETPOST('cond_reglement_id_deposit_percent', 'alpha'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); $object->fk_account = GETPOST('fk_account', 'int'); $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->demand_reason_id = GETPOST('demand_reason_id', 'int'); $object->date_livraison = $date_delivery; // deprecated $object->delivery_date = $date_delivery; $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->warehouse_id = GETPOST('warehouse_id', 'int'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->contact_id = GETPOST('contactid'); + $object->fk_delivery_address = GETPOST('fk_address', 'int'); + $object->contact_id = GETPOST('contactid', 'int'); $object->fk_incoterms = GETPOST('incoterm_id', 'int'); $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); From d47f004759fbdc2741d32260c608fc926f3add7a Mon Sep 17 00:00:00 2001 From: vmaury Date: Fri, 7 Jul 2023 16:16:55 +0200 Subject: [PATCH 0107/1137] Fix #25302 Sum of tasks time spent on project referrers page (projet/element.php) --- htdocs/projet/element.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 3b8393c402d..26a60ff2370 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -853,13 +853,8 @@ foreach ($listofreferent as $key => $value) { } elseif ($tablename == 'stock_mouvement') { $total_ht_by_line = $element->price * abs($element->qty); } elseif ($tablename == 'projet_task') { - if ($idofelementuser) { - $tmp = $element->getSumOfAmount($elementuser, $dates, $datee); - $total_ht_by_line = price2num($tmp['amount'], 'MT'); - } else { - $tmp = $element->getSumOfAmount('', $dates, $datee); - $total_ht_by_line = price2num($tmp['amount'], 'MT'); - } + $tmp = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee); + $total_ht_by_line = price2num($tmp['amount'], 'MT'); } elseif ($key == 'loan') { if ((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)) { // Get total loan @@ -1344,7 +1339,7 @@ foreach ($listofreferent as $key => $value) { print " - ".dol_print_date($element->datef, 'dayhour'); } } elseif (in_array($tablename, array('projet_task'))) { - $tmpprojtime = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty + $tmpprojtime = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee); // $element is a task. $elementuser may be empty print ''; print convertSecondToTime($tmpprojtime['nbseconds'], 'allhourmin'); print ''; @@ -1673,4 +1668,4 @@ function sortElementsByClientName($elementarray) } return $elementarray; -} +} \ No newline at end of file From f6206770bd457daea705d1b755337b278b7be77b Mon Sep 17 00:00:00 2001 From: mc2rcanarslan <138895927+mc2rcanarslan@users.noreply.github.com> Date: Fri, 7 Jul 2023 15:24:12 +0000 Subject: [PATCH 0108/1137] fix: project status bug when PROJECT_CREATE_NO_DRAFT is set --- htdocs/projet/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 1f834639626..7e5219e7e1f 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -191,7 +191,7 @@ if (empty($reshook)) { } // Create with status validated immediatly - if (!empty($conf->global->PROJECT_CREATE_NO_DRAFT)) { + if (!empty($conf->global->PROJECT_CREATE_NO_DRAFT) && !$error) { $status = Project::STATUS_VALIDATED; } From bcd5666e01c25350f14dc12590b21c20383e3db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Sun, 9 Jul 2023 12:16:05 +0200 Subject: [PATCH 0109/1137] Support extrafields in selectForForms --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 39a0d9754e0..59b9c70dca2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8030,6 +8030,7 @@ class Form // Search data $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; + $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; if (isset($objecttmp->ismultientitymanaged)) { if (!is_numeric($objecttmp->ismultientitymanaged)) { $tmparray = explode('@', $objecttmp->ismultientitymanaged); From 4b708e9f3f7fbca0c945110351c83bca640ed390 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Jul 2023 12:43:32 +0200 Subject: [PATCH 0110/1137] Fix warning --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8e9fdf95575..d64aaa910c4 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -688,7 +688,6 @@ class User extends CommonObject */ public function hasRight($module, $permlevel1, $permlevel2 = '') { - global $conf; // For compatibility with bad naming permissions on module $moduletomoduletouse = array( 'compta' => 'comptabilite', From 3998413445bfe755680b33925c278d096307e7eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Jul 2023 13:12:17 +0200 Subject: [PATCH 0111/1137] Doc --- htdocs/install/mysql/tables/llx_stock_mouvement.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_stock_mouvement.sql b/htdocs/install/mysql/tables/llx_stock_mouvement.sql index ec3465a6c2d..32afd3c575b 100644 --- a/htdocs/install/mysql/tables/llx_stock_mouvement.sql +++ b/htdocs/install/mysql/tables/llx_stock_mouvement.sql @@ -27,12 +27,12 @@ create table llx_stock_mouvement eatby date DEFAULT NULL, -- Eatby date (deprecated, we should get value from batch number in table llx_product_lot) sellby date DEFAULT NULL, -- Sellby date (deprecated, we should get value from batch number in table llx_product_lot) fk_entrepot integer NOT NULL, -- Id warehouse - value real, -- Qty of movement - price double(24,8) DEFAULT 0, -- Entry price (used to calculate PMP, FIFO or LIFO value) - type_mouvement smallint, -- Type/Direction of movement - fk_user_author integer, -- Id user making movement - label varchar(255), -- Comment on movement - inventorycode varchar(128), -- Code used to group different movement line into one operation (may be an inventory, a mass picking) + value real, -- Qty of movement + price double(24,8) DEFAULT 0, -- Entry price (used to calculate PMP, FIFO or LIFO value) + type_mouvement smallint, -- Type/Direction of movement (manual entry = 0, manual exit = 1, automatic exit = 2, automatic entry = 3) + fk_user_author integer, -- Id user making movement + label varchar(255), -- Comment on movement + inventorycode varchar(128), -- Code used to group different movement line into one operation (may be an inventory, a mass picking) fk_project integer, fk_origin integer, origintype varchar(64), From 34908a72c7b0633a5077a264eaf5166e50828e4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Jul 2023 13:48:05 +0200 Subject: [PATCH 0112/1137] Test CI --- .github/workflows/phpcsfixer.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index eeb943534d7..490a61281ff 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -41,6 +41,6 @@ jobs: phpcs_ref_name: ${{github.ref_name}} phpcs_github_event_name: ${{github.event_name}} phpcs_files: ${{ needs.filesChanged.outputs.all_changed_files }} - - uses: stefanzweifel/git-auto-commit-action@v4 # auto commit the fixes action for GitHub - with: - commit_message: Fix PHPCS errors by GitHub PHPCSfixer action + #- uses: stefanzweifel/git-auto-commit-action@v4 # auto commit the fixes action for GitHub + # with: + # commit_message: Fix PHPCS errors by GitHub PHPCSfixer action From 2c835002bd3bcf8858ee18c2303bb815749a3655 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Jul 2023 13:48:34 +0200 Subject: [PATCH 0113/1137] Test CI --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 26a60ff2370..0669ba9f61b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1668,4 +1668,4 @@ function sortElementsByClientName($elementarray) } return $elementarray; -} \ No newline at end of file +} From 043bda80a081383ad8b741ec115282e4f57f6ef2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Jul 2023 14:04:57 +0200 Subject: [PATCH 0114/1137] Test CI --- .github/workflows/phpcsfixer.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index 490a61281ff..0e8ebbfc895 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -20,8 +20,10 @@ jobs: #needs: filesChanged steps: - uses: actions/checkout@v3 - #with: - # fetch-depth: 10 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + # fetch-depth: 10 - name: echo Get list of all changed files run: | From b74fe4f99b3dd31ead5a784b7d022643047ce1ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Jul 2023 14:20:28 +0200 Subject: [PATCH 0115/1137] Test CI --- .github/workflows/phpcsfixer.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml index 0e8ebbfc895..1bd342f9737 100644 --- a/.github/workflows/phpcsfixer.yml +++ b/.github/workflows/phpcsfixer.yml @@ -43,6 +43,20 @@ jobs: phpcs_ref_name: ${{github.ref_name}} phpcs_github_event_name: ${{github.event_name}} phpcs_files: ${{ needs.filesChanged.outputs.all_changed_files }} + #- uses: stefanzweifel/git-auto-commit-action@v4 # auto commit the fixes action for GitHub # with: # commit_message: Fix PHPCS errors by GitHub PHPCSfixer action + + - name: Commit changes + uses: EndBug/add-and-commit@v9.1.3 + with: + default_author: github_actions + committer_name: GitHub Actions + committer_email: actions@github.com + #author_name: PHP CS fixer + #author_email: eldy@destailleur.fr + #committer_name: PHP CS fixer + #committer_email: eldy@destailleur.fr + message: 'PHP CS fixer github action' + add: '*.php' From 7ff460152e36ee8006185fff10636c984561d13b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 Jul 2023 15:07:01 +0200 Subject: [PATCH 0116/1137] FIX #24085 #25270 --- htdocs/product/stock/movement_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index addb445b8e6..7ddfb5433af 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -85,7 +85,7 @@ $search_user = trim(GETPOST("search_user")); $search_batch = trim(GETPOST("search_batch")); $search_qty = trim(GETPOST("search_qty")); $search_type_mouvement = GETPOST('search_type_mouvement', 'int'); -$search_fk_project=GETPOST("search_fk_project"); +$search_fk_project=GETPOST("search_fk_project", 'int'); $type = GETPOST("type", "int"); @@ -226,10 +226,10 @@ if (empty($reshook)) { $search_user = ""; $search_batch = ""; $search_qty = ''; + $search_fk_project = ""; $search_all = ""; $toselect = array(); $search_array_options = array(); - $search_fk_project = ""; } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { @@ -1184,7 +1184,7 @@ if (!empty($arrayfields['origin']['checked'])) { if (!empty($arrayfields['m.fk_projet']['checked'])) { // fk_project print '
'; } if (!empty($arrayfields['m.type_mouvement']['checked'])) { From 3c3f5896d2e9ff1d8060ea7ef4ec5f668a0318dc Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Sun, 9 Jul 2023 15:11:16 +0200 Subject: [PATCH 0117/1137] Fix:warehouses table name is entrepot which does not hold an fk_soc field, so _checkAccessToResource returns always false and must be disabled before fix. (#25135) * Fix:warehouses table name is entrepot which does not hold an fk_soc field, so _checkAccessToResource returns always false and must be disabled before fix. * Fix:warehouses table name is entrepot which does not hold an fk_soc field, so _checkAccessToResource returns always false and must be disabled before fix. * Fix check params It is sufficient to fix check parameters to get it working * Update api_warehouses.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/product/stock/class/api_warehouses.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index c7b9e67fce7..28ae1f25247 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -71,7 +71,7 @@ class Warehouses extends DolibarrApi throw new RestException(404, 'warehouse not found'); } - if (!DolibarrApi::_checkAccessToResource('warehouse', $this->warehouse->id)) { + if (!DolibarrApi::_checkAccessToResource('stock', $this->warehouse->id, 'entrepot')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } From d88736dd74f10dd957c05024cce9643db30a19b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Jul 2023 01:09:02 +0200 Subject: [PATCH 0118/1137] Debug v18 --- htdocs/bookmarks/list.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index d2d3812400d..3e4ae193a94 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -41,6 +41,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $mode = GETPOST('mode', 'aZ'); $id = GETPOST("id", 'int'); +$search_title = GETPOST('search_title', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -165,6 +166,9 @@ $sqlfields = $sql; // $sql fields to remove for count total $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid"; $sql .= " WHERE 1=1"; +if ($search_title) { + $sql .= natural_search('title', $search_title); +} $sql .= " AND b.entity IN (".getEntity('bookmark').")"; if (!$user->admin) { $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)"; @@ -313,21 +317,25 @@ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { $totalarray['nbfield']++; } print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder); +$totalarray['nbfield']++; print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder); +$totalarray['nbfield']++; print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder); +$totalarray['nbfield']++; print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center '); +$totalarray['nbfield']++; print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center '); +$totalarray['nbfield']++; print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center '); +$totalarray['nbfield']++; print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right '); +$totalarray['nbfield']++; if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; $totalarray['nbfield']++; } print ''."\n"; -$totalarray = array(); -$totalarray['nbfield'] = 0; - // Loop on record // -------------------------------------------------------------------- $i = 0; @@ -475,7 +483,7 @@ if ($num == 0) { $colspan++; } } - print ''; + print ''; } $db->free($resql); From aade58c437ad36fcd154fdaa2a3e312f5a181598 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Jul 2023 02:41:11 +0200 Subject: [PATCH 0119/1137] Debuv 18 --- htdocs/compta/sociales/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 187a4ab7b8f..df226ad807e 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -63,7 +63,7 @@ $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); $label = GETPOST('label', 'alpha'); $actioncode = GETPOST('actioncode'); -$fk_user = GETPOST('userid', 'int'); +$fk_user = GETPOST('userid', 'int') > 0 ? GETPOST('userid', 'int') : 0; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('taxcard', 'globalcard')); @@ -511,7 +511,7 @@ if ($id > 0) { // Employee if ($action != 'editfk_user') { - if ($object->getSommePaiement() > 0 && !empty($object->fk_user)) { + if ($object->getSommePaiement() > 0 && $object->fk_user > 0) { $userstatic = new User($db); $result = $userstatic->fetch($object->fk_user); if ($result > 0) { @@ -519,7 +519,7 @@ if ($id > 0) { } } else { $morehtmlref .= '
' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->rights->salaries->write, 'string', '', 0, 1); - if (!empty($object->fk_user)) { + if ($object->fk_user > 0) { $userstatic = new User($db); $result = $userstatic->fetch($object->fk_user); if ($result > 0) { From 456e6441b95c7903bddda1b4bdac76cb1f1634d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Jul 2023 03:16:21 +0200 Subject: [PATCH 0120/1137] Debug v18 --- htdocs/core/boxes/box_factures.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 3991c95bc60..6f37390d27b 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -99,7 +99,10 @@ class box_factures extends ModeleBoxes $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; $sql .= ", s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; + $sql .= ", SUM(pf.amount) as am"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture,"; + $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -111,6 +114,8 @@ class box_factures extends ModeleBoxes if ($user->socid) { $sql .= " AND s.rowid = ".((int) $user->socid); } + $sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.code_client, s.code_compta, s.client, s.logo, s.email, s.entity, s.tva_intra, s.siren, s.siret, s.ape, s.idprof4, s.idprof5, s.idprof6,"; + $sql .= " f.rowid, f.ref, f.type, f.total_ht, f.total_tva, f.total_ttc, f.datef, f.paye, f.fk_statut, f.datec, f.tms, f.date_lim_reglement"; if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) { $sql .= " ORDER BY f.datef DESC, f.ref DESC "; } else { @@ -128,8 +133,8 @@ class box_factures extends ModeleBoxes while ($line < $num) { $objp = $this->db->fetch_object($result); + $datelimite = $this->db->jdate($objp->datelimite); - $date = $this->db->jdate($objp->date); $datem = $this->db->jdate($objp->tms); $facturestatic->id = $objp->facid; @@ -142,7 +147,9 @@ class box_factures extends ModeleBoxes $facturestatic->status = $objp->status; $facturestatic->date = $this->db->jdate($objp->date); $facturestatic->date_lim_reglement = $this->db->jdate($objp->datelimite); - $facturestatic->alreadypaid = $objp->paye; + + $facturestatic->paye = $objp->paye; + $facturestatic->alreadypaid = $objp->am; $societestatic->id = $objp->socid; $societestatic->name = $objp->name; @@ -191,7 +198,7 @@ class box_factures extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', - 'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $objp->paye), + 'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $objp->am), ); $line++; From 9c54c7e52f7d7a4606c238fba7daf19520d21a5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Jul 2023 03:55:00 +0200 Subject: [PATCH 0121/1137] Trans --- htdocs/langs/en_US/errors.lang | 2 +- htdocs/langs/fr_FR/errors.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 11a65a351bf..12388f6b9d1 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -304,7 +304,7 @@ ErrorValueForTooLow=Value for %s is too low ErrorValueCantBeNull=Value for %s can't be null ErrorDateOfMovementLowerThanDateOfFileTransmission=The date of the bank transaction can't be lower than the date of the file transmission ErrorTooMuchFileInForm=Too much files in form, the maximum number is %s file(s) -ErrorSessionInvalidatedAfterPasswordChange=The session was been invalidated following a change of password, status or dates of validity. Please relogin. +ErrorSessionInvalidatedAfterPasswordChange=The session was been invalidated following a change of password, email, status or dates of validity. Please relogin. ErrorExistingPermission = Permission %s for object %s already exists ErrorFieldExist=The value for %s already exist ErrorEqualModule=Module invalid in %s diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 2ab780bf472..2dc05f8c5e5 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -304,7 +304,7 @@ ErrorValueForTooLow=La valeur pour %s est trop faible ErrorValueCantBeNull=La valeur pour %s ne peut pas être nulle ErrorDateOfMovementLowerThanDateOfFileTransmission=La date de l'opération bancaire ne peut être inférieure à la date de transmission du fichier ErrorTooMuchFileInForm=Trop de fichiers dans le formulaire, le nombre maximum est de %s fichier(s) -ErrorSessionInvalidatedAfterPasswordChange=La session a été invalidée suite à un changement de mot de passe, d'état ou de dates de validité. Veuillez vous reconnecter. +ErrorSessionInvalidatedAfterPasswordChange=La session a été invalidée suite à un changement de mot de passe, email, statut ou de dates de validité. Veuillez vous reconnecter. ErrorExistingPermission = La permission %s pour l'objet %s existe déjà. ErrorFieldExist=La valeur pour %s existe déjà ErrorEqualModule=Module invalide dans %s. From 83eb8fed611d6a9f349c5128064b844062063902 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Jul 2023 04:03:57 +0200 Subject: [PATCH 0122/1137] Doc --- htdocs/core/modules/oauth/google_oauthcallback.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index a043cf23e57..39217fdf825 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -263,6 +263,7 @@ if (!GETPOST('code')) { dol_syslog("userinfo=".var_export($userinfo, true)); $useremail = $userinfo['email']; + /* $useremailverified = $userinfo['email_verified']; $useremailuniq = $userinfo['sub']; @@ -280,6 +281,12 @@ if (!GETPOST('code')) { // Verify that the ID token is properly signed by the issuer. Google-issued tokens are signed using one of the certificates found at the URI specified in the jwks_uri metadata value of the Discovery document. // TODO + // Verify that email is a verified email + /*if (empty($userinfo['email_verified'])) { + setEventMessages($langs->trans('Bad value for email, emai lwas not verified by Google'), null, 'errors'); + $errorincheck++; + }*/ + // Verify that the value of the iss claim in the ID token is equal to https://accounts.google.com or accounts.google.com. if ($userinfo['iss'] != 'accounts.google.com' && $userinfo['iss'] != 'https://accounts.google.com') { setEventMessages($langs->trans('Bad value for returned userinfo[iss]'), null, 'errors'); From 231658cf68e703f30a96a6e2755f5a8619859203 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Jul 2023 20:01:46 +0200 Subject: [PATCH 0123/1137] Fix regression --- htdocs/product/class/product.class.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 386e7353510..2e6f9bc07c5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -488,6 +488,19 @@ class Product extends CommonObject */ public $supplierprices; + /** + * Array with list of sub-products for Kits + * + * @var array + */ + public $sousprods; + + /** + * Path of subproducts. Build from ->sousprods with get_arbo_each_prod() + */ + public $res; + + /** * Property set to save result of isObjectUsed(). Used for example by Product API. * @@ -497,8 +510,6 @@ class Product extends CommonObject /** - * - * * */ public $mandatory_period; @@ -4730,7 +4741,7 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Fonction recursive uniquement utilisee par get_arbo_each_prod, recompose l'arborescence des sousproduits + * Function recursive, used only by get_arbo_each_prod(), to build tree of subproducts into ->res * Define value of this->res * * @param array $prod Products array @@ -4808,16 +4819,16 @@ class Product extends CommonObject public function get_arbo_each_prod($multiply = 1, $ignore_stock_load = 0) { // phpcs:enable - $res = array(); + $this->res = array(); if (isset($this->sousprods) && is_array($this->sousprods)) { foreach ($this->sousprods as $prod_name => $desc_product) { if (is_array($desc_product)) { - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res } } } //var_dump($res); - return $res; + return $this->res; } /** From 7442a855146a7070a0b1ec904f797c3a170200b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Tue, 11 Jul 2023 06:40:33 +0200 Subject: [PATCH 0124/1137] check if object has extrafields --- htdocs/core/class/html.form.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 59b9c70dca2..4d7e41f6501 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8030,7 +8030,9 @@ class Form // Search data $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; + if (!empty($objecttmp->isextrafieldmanaged)) { + $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; + } if (isset($objecttmp->ismultientitymanaged)) { if (!is_numeric($objecttmp->ismultientitymanaged)) { $tmparray = explode('@', $objecttmp->ismultientitymanaged); From 3681486fe84f1dc96a8d3c75b2851610ac592bed Mon Sep 17 00:00:00 2001 From: jyhere Date: Wed, 12 Jul 2023 12:27:12 +0200 Subject: [PATCH 0125/1137] FIX: misleading phpdoc (#25342) --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 29b4fc2aa70..64dd3ad564a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -468,7 +468,7 @@ class Commande extends CommonOrder * @param User $user User making status change * @param int $idwarehouse Id of warehouse to use for stock decrease * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @return int <=0 if OK, 0=Nothing done, >0 if KO + * @return int <0 if KO, 0=Nothing done, >0 if OK */ public function valid($user, $idwarehouse = 0, $notrigger = 0) { From bbbf42569724d3c07e247badcac0262daa458119 Mon Sep 17 00:00:00 2001 From: mc2contributor Date: Wed, 12 Jul 2023 04:28:20 -0600 Subject: [PATCH 0126/1137] Fix undefined property (#25337) --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 857a3f381d3..8b8c80c466f 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1562,7 +1562,7 @@ while ($i < $imaxinloop) { $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; $companystatic->fk_prospectlevel = $obj->fk_prospectlevel; - $companystatic->parent = $obj->fk_parent; + $companystatic->fk_parent = $obj->fk_parent; $companystatic->entity = $obj->entity; } From 6a9c9c684f4782b14b2015ce36491160f0c72a88 Mon Sep 17 00:00:00 2001 From: Yoan Mollard Date: Wed, 12 Jul 2023 12:55:53 +0200 Subject: [PATCH 0127/1137] Show nb docs in list of suppliers invoices (#25338) * FIX Selection of customer on second or more parallel sell in TakePOS * FIX Bad management of localtax on TakePOS due to typo error in var name * FIX Missing localtaxes on receipt in TakePOS * Show nb docs in list of suppliers invoices --------- Co-authored-by: Laurent Destailleur --- htdocs/fourn/facture/list.php | 20 ++++++++++++++++++++ htdocs/societe/list.php | 3 +++ htdocs/takepos/invoice.php | 4 ++-- htdocs/takepos/receipt.php | 22 ++++++++++++++++++++-- 4 files changed, 45 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9e9a8a46a62..910d22e9319 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -200,6 +200,7 @@ $arrayfields = array( '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), + 'f.nb_docs'=>array('label'=>"Documents", 'checked'=>1, 'position'=>510), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -1157,6 +1158,11 @@ if (!empty($arrayfields['f.total_ttc']['checked'])) { print ''; print ''; } +if (!empty($arrayfields['f.nb_docs']['checked'])) { + // Nb of attached documents + print '
'; +} if (!empty($arrayfields['u.login']['checked'])) { // Author print ''; + } + // Author if (!empty($arrayfields['u.login']['checked'])) { print ' @@ -251,6 +252,23 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER) { echo $langs->trans("TotalVAT").' +useLocalTax(1) || price2num($object->total_localtax1, 'MU')) { ?> + + + + +useLocalTax(2) || price2num($object->total_localtax2, 'MU')) { ?> + + +'; print ''; @@ -4433,12 +4462,17 @@ if ($module == 'initmodule') { $propMainmenu = !empty($menu['mainmenu']) ? $menu['mainmenu'] : GETPOST('mainmenu'); $propLeftmenu = !empty($menu['leftmenu']) ? $menu['leftmenu'] : GETPOST('leftmenu'); $propUrl = !empty($menu['url']) ? $menu['url'] : GETPOST('url', 'alpha'); - $propPerms = empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); + $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); $propUser = !empty($menu['user']) ? $menu['user'] : GETPOST('user'); $propTarget = !empty($menu['target']) ? $menu['target'] : GETPOST('target'); $propEnabled = empty($menu['enabled']) ? $menu['enabled'] : GETPOST('enabled'); + + //Perms + $arguments = explode(",", $propPerms); + $valPerms = trim($arguments[2], ' " "\)'); + if ($action == 'editmenu' && GETPOST('menukey', 'int') == $i) { - //var_dump($propFk_menu);exit; + //var_dump($propPerms);exit; print ''; print ''; print ''; @@ -4474,7 +4508,7 @@ if ($module == 'initmodule') { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -4490,11 +4524,11 @@ if ($module == 'initmodule') { print ''; print ''; @@ -4548,9 +4582,12 @@ if ($module == 'initmodule') { print ''; - print ''; print ''; - print ''; print ''; print ''; @@ -4470,6 +4484,7 @@ if ($module == 'initmodule') { //Perms $arguments = explode(",", $propPerms); $valPerms = trim($arguments[2], ' " "\)'); + $objPerms = trim($arguments[1], ' " "\)'); if ($action == 'editmenu' && GETPOST('menukey', 'int') == $i) { //var_dump($propPerms);exit; @@ -4522,14 +4537,17 @@ if ($module == 'initmodule') { } print ''; print ''; - print ''; print ''; @@ -4620,6 +4638,43 @@ if ($module == 'initmodule') { print '
'; @@ -718,7 +721,8 @@ class FormFile if ($conf->browser->layout == 'phone') { $morecss = 'maxwidth100'; } - $out .= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss); + $out .= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1, '', 0, 0); + $out .= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1, '', 0, 0, "inputSeparator"); if ($conf->use_javascript_ajax) { $out .= ajax_combobox('model'); } @@ -976,6 +980,18 @@ class FormFile } } $out .= ''."\n"; + + $out .= ''; //return ($i?$i:$headershown); return $out; } diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php index 0cad4f76509..0ae9379c632 100644 --- a/htdocs/core/modules/export/modules_export.php +++ b/htdocs/core/modules/export/modules_export.php @@ -72,6 +72,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac require_once $file; if (class_exists($classname)) { $module = new $classname($db); + // var_dump($classname); // Picto $this->picto[$module->id] = $module->picto; diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 6563e9d6338..1565390b81b 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -586,9 +586,10 @@ class Export * @param array $array_selected Filter on array of fields to export * @param array $array_filterValue Filter on array of fields with a filter * @param string $sqlquery If set, transmit the sql request for select (otherwise, sql request is generated from arrays) + * @param string $separator separator to fill $objmodel->separator with the new separator * @return int <0 if KO, >0 if OK */ - public function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '') + public function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '', $separator = '') { // phpcs:enable global $conf, $langs, $mysoc; @@ -612,6 +613,10 @@ class Export require_once $dir.$file; $objmodel = new $classname($this->db); + if (in_array($model, array('csvutf8', 'csviso')) && !empty($separator)) { + $objmodel->separator = $separator; + } + if (!empty($sqlquery)) { $sql = $sqlquery; } else { diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 8fc16e43963..5b6116d153c 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -269,6 +269,7 @@ if ($step == 1 || $action == 'cleanselect') { } if ($action == 'builddoc') { + $separator = GETPOST('delimiter', 'alpha'); $max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined $max_time = @ini_get("max_execution_time"); if ($max_time && $max_time < $max_execution_time_for_importexport) { @@ -277,7 +278,7 @@ if ($action == 'builddoc') { } // Build export file - $result = $objexport->build_file($user, GETPOST('model', 'alpha'), $datatoexport, $array_selected, $array_filtervalue); + $result = $objexport->build_file($user, GETPOST('model', 'alpha'), $datatoexport, $array_selected, $array_filtervalue, '', $separator); if ($result < 0) { setEventMessages($objexport->error, $objexport->errors, 'errors'); $sqlusedforexport = $objexport->sqlusedforexport; From 1395a9ff8f72deb8ef70601bb60f35d5840e8fd9 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Fri, 23 Jun 2023 16:32:01 +0200 Subject: [PATCH 0081/1137] New : mass modification of status for coferenceorbooth --- .../conferenceorbooth_list.php | 53 +++++++++++++++++++ htdocs/langs/en_US/eventorganization.lang | 6 +++ 2 files changed, 59 insertions(+) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 49940ef7881..e9b1c0d01cd 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -223,6 +223,42 @@ if (empty($reshook)) { $uploaddir = $conf->eventorganization->dir_output; include DOL_DOCUMENT_ROOT.'/eventorganization/core/actions_massactions_mail.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + + if ($permissiontoadd && (($action == 'setstatus' && $confirm == "yes") || $massaction == 'setstatus')) { + $db->begin(); + $error = 0;$nbok = 0; + $objecttmp = new $objectclass($db); + foreach ($toselect as $key => $idselect) { + $result = $objecttmp->fetch($idselect); + if ($result > 0) { + $objecttmp->status = GETPOST("statusmassaction", 'int'); + $result = $objecttmp->update($user); + if ($result <= 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } else { + $nbok++; + } + } else { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error ++; + break; + } + } + if (empty($error)) { + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsUpdated", $nbok), null, 'mesgs'); + } elseif ($nbok > 0) { + setEventMessages($langs->trans("RecordUpdated", $nbok), null, 'mesgs'); + } else { + setEventMessages($langs->trans("NoRecordUpdated"), null, 'mesgs'); + } + $db->commit(); + } else { + $db->rollback(); + } + } } @@ -680,6 +716,9 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } +if (!empty($permissiontoadd)) { + $arrayofmassactions['presetstatus'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("ModifyStatus"); +} if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } @@ -716,6 +755,20 @@ $trackid = 'conferenceorbooth_'.$object->id; $withmaindocfilemail = 0; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; +if ($massaction == 'presetstatus') { + $formquestion = array(); + $statuslist[$objecttmp::STATUS_DRAFT] = $objecttmp->LibStatutEvent($objecttmp::STATUS_DRAFT); + $statuslist[$objecttmp::STATUS_SUGGESTED] = $objecttmp->LibStatutEvent($objecttmp::STATUS_SUGGESTED); + $statuslist[$objecttmp::STATUS_CONFIRMED] = $objecttmp->LibStatutEvent($objecttmp::STATUS_CONFIRMED); + $statuslist[$objecttmp::STATUS_NOT_QUALIFIED] = $objecttmp->LibStatutEvent($objecttmp::STATUS_NOT_QUALIFIED); + $statuslist[$objecttmp::STATUS_DONE] = $objecttmp->LibStatutEvent($objecttmp::STATUS_DONE); + $statuslist[$objecttmp::STATUS_CANCELED] = $objecttmp->LibStatutEvent($objecttmp::STATUS_CANCELED); + $formquestion[] = array('type' => 'other', + 'name' => 'affectedcommercial', + 'label' => $form->editfieldkey('ModifyStatus', 'status_id', '', $object, 0), + 'value' => $form->selectarray('statusmassaction', $statuslist, GETPOST('statusmassaction'))); + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmModifyStatus"), $langs->trans("ConfirmModifyStatusQuestion", count($toselect)), "setstatus", $formquestion, 1, 0, 200, 500, 1); +} if ($search_all) { $setupstring = ''; diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 894c9de4f13..4c9fd31b896 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -175,3 +175,9 @@ NoPublicActionsAllowedForThisEvent=No public actions are open to public for this MaxNbOfAttendees=Max number of attendees DateStartEvent=Event start date DateEndEvent=Event end date +ModifyStatus=Modify status +ConfirmModifyStatus=Confirm status modification +ConfirmModifyStatusQuestion=Are you sure you want to modify the %s selected record(s)? +RecordsUpdated = %s Records updated +RecordUpdated = Record updated +NoRecordUpdated = No Record updated \ No newline at end of file From 37e39f5305308e720ab5002839136b7534ac8911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Jun 2023 13:48:16 +0200 Subject: [PATCH 0082/1137] do not add default value in list --- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 2 +- htdocs/compta/facture/list.php | 2 +- htdocs/core/class/html.form.class.php | 7 ++++--- htdocs/fourn/facture/list-rec.php | 2 +- htdocs/fourn/facture/list.php | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 753c449a278..4d05a1a825a 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1318,7 +1318,7 @@ if ($resql) { // Payment term if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) { print ''; - print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); + print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1, '', -1, 'list'); print ''; - print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); + print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1, '', -1, 'list'); print ''; - print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100'); + print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100', -1, 'list'); print "'; - print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100'); + print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100', -1, 'list'); print ''; - print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100'); + print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100', -1, 'list'); print "'; - print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100'); + print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100', -1, 'list'); print ''; - print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1); + print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1, 'list'); print ''; - print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1); + print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1, 'list'); print ''; - $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1); + $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 0, 'list'); print ''; - print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth100', 1); + print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth100', 1, 'list'); print ''; - print $form->select_types_paiements($search_payment_mode, 'search_payment_mode', '', 0, 1, 1, 0, 1, 'maxwidth100', 1); + print $form->select_types_paiements($search_payment_mode, 'search_payment_mode', '', 0, 1, 1, 0, 1, 'maxwidth100', 1, 'list'); print ''; - print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 0, 1, 'minwidth100 maxwidth100', 1); + print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 0, 1, 'minwidth100 maxwidth100', 1, 'list'); print ''; - print $form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1, 1, 1, '', 1); + print $form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1, 1, 1, '', 1, 'list'); print ''; - print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 0, 1, 'maxwidth150', 1); + print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 0, 1, 'maxwidth150', 1, 'list'); print ''; - print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 16, 1, '', 1); + print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 16, 1, '', 1, 'list'); print ''; - $form->select_types_paiements($search_payment_type, 'search_payment_type', '', 2, 1, 1); + $form->select_types_paiements($search_payment_type, 'search_payment_type', '', 2, 1, 1, 0, 1, '', 0, 'list'); print ''; -print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth125', 1); +print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth125', 1, 'list'); print ''; - print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1, '', -1, 'list'); + print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); print ''; - print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1, '', -1, 'list'); + print $form->getSelectConditionsPaiements($search_fk_cond_reglement, 'search_fk_cond_reglement', 1, 1, 1); print ''; - print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1, 'list'); + print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1); print ''; - print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100', -1, 'list'); + print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100', -1); print ''; -print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth125', 1, 'list'); +print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth125', 1); print ''; - $form->select_types_paiements($search_payment_type, 'search_payment_type', '', 2, 1, 1, 0, 1, '', 0, 'list'); + $form->select_types_paiements($search_payment_type, 'search_payment_type', '', 2, 1, 1); print ''; - print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1, 'list'); + print $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 1); print ''; - $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1, '', 0, 'list'); + $form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1); print ''; - print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth100', 1, 'list'); + print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth100', 1); print ''; - print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100', -1, 'list'); + print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100'); print "'; - print $form->select_types_paiements($search_payment_mode, 'search_payment_mode', '', 0, 1, 1, 0, 1, 'maxwidth100', 1, 'list'); + print $form->select_types_paiements($search_payment_mode, 'search_payment_mode', '', 0, 1, 1, 0, 1, 'maxwidth100', 1); print ''; - print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 0, 1, 'minwidth100 maxwidth100', 1, 'list'); + print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 0, 1, 'minwidth100 maxwidth100', 1); print ''; - print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100', -1, 'list'); + print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100'); print ''; - print $form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1, 1, 1, '', 1, 'list'); + print $form->select_types_paiements($search_paymenttype, 'search_paymenttype', '', 2, 1, 1, 1, 1, '', 1); print ''; - print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 0, 1, 'maxwidth150', 1, 'list'); + print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 0, 1, 'maxwidth150', 1); print ''; - print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 16, 1, '', 1, 'list'); + print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 16, 1, '', 1); print ''; - print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100', -1, 'list'); + print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100'); print "'; - print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100', -1); + print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100'); print ''; +// print ''; +// print ''; - print '  '; + // var_dump($val, $key, $search_fk_projet, $object->fields['fk_project']); + print $object->showInputField($object->fields['fk_project'], 'fk_project', '', '', '', 'search_', 'maxwidth125', 1); + // print ''; print ''; -// print ''; -// print ''; - // var_dump($val, $key, $search_fk_projet, $object->fields['fk_project']); print $object->showInputField($object->fields['fk_project'], 'fk_project', '', '', '', 'search_', 'maxwidth125', 1); - // print ''; print ''; - print $object->showInputField($object->fields['fk_project'], 'fk_project', '', '', '', 'search_', 'maxwidth125', 1); + print $object->showInputField($object->fields['fk_project'], 'fk_project', $search_fk_project, '', '', 'search_', 'maxwidth125', 1); print '
'.$langs->trans("NoRecordFound").'
'.$langs->trans("NoRecordFound").'
'; + print ''; @@ -1341,6 +1347,9 @@ if (!empty($arrayfields['f.total_ttc']['checked'])) { print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; } +if (!empty($arrayfields['f.nb_docs']['checked'])) { + print_liste_field_titre($arrayfields['f.nb_docs']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); +} if (!empty($arrayfields['u.login']['checked'])) { print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); $totalarray['nbfield']++; @@ -1770,6 +1779,17 @@ while ($i < $imaxinloop) { $totalarray['val']['f.total_ttc'] += $obj->total_ttc; } + // Number of attached documents + if (!empty($arrayfields['f.nb_docs']['checked'])) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($facturestatic->id, 2, 0, 0, $facturestatic, 'invoice_supplier').$facturestatic->ref; + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $facturestatic->element, $facturestatic->id); + $nbTotal = $nbFiles + $nbLinks; + echo ''.(empty($nbTotal)? '':$nbTotal).''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 8b8c80c466f..9a488edf056 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1018,6 +1018,9 @@ print ''; print ''; //print ''; print ''; +if (!empty($place)) { + print ''; +} print ''; print ''; if (empty($arrayfields['customerorsupplier']['checked'])) { diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 592da00c24d..56a850f11fd 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -460,7 +460,7 @@ if (empty($reshook)) { } if (($action == "addline" || $action == "freezone") && $placeid == 0) { - $invoice->socid = getDolGlobalString("$constforcompanyid"); + $invoice->socid = getDolGlobalString($constforcompanyid); $invoice->date = dol_now(); $invoice->module_source = 'takepos'; $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; @@ -537,7 +537,7 @@ if (empty($reshook)) { $invoice->fetch_thirdparty(); $array_options = array(); - $line = array('description' => $prod->description, 'price' => $price, 'tva_tx' => $tva_tx, 'locatax1_tx' => $localtax1_tx, 'locatax2_tx' => $localtax2_tx, 'remise_percent' => $customer->remise_percent, 'price_ttc' => $price_ttc, 'array_options' => $array_options); + $line = array('description' => $prod->description, 'price' => $price, 'tva_tx' => $tva_tx, 'localtax1_tx' => $localtax1_tx, 'localtax2_tx' => $localtax2_tx, 'remise_percent' => $customer->remise_percent, 'price_ttc' => $price_ttc, 'array_options' => $array_options); /* setup of margin calculation */ if (isset($conf->global->MARGIN_TYPE)) { diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index d09869d22dc..99579eeaf97 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -1,10 +1,10 @@ - * Copyright (C) 2011 Laurent Destailleur + * Copyright (C) 2011-2023 Laurent Destailleur * Copyright (C) 2012 Marcos García * Copyright (C) 2018 Andreu Bisquerra * Copyright (C) 2019 Josep Lluís Amador - * Copyright (C) 2021 Nicolas ZABOURI + * Copyright (C) 2021 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 @@ -233,6 +233,7 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER) { } $vat_groups[$line->tva_tx] += $line->total_tva; } + // Loop on each VAT group foreach ($vat_groups as $key => $val) { ?>
'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency)."\n"; } ?>
trans("TotalLT1").''.price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency)."\n"; + } ?>
trans("TotalLT2").''.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency)."\n"; + } ?>
Date: Wed, 12 Jul 2023 13:15:04 +0200 Subject: [PATCH 0128/1137] php V8 error on ticket module (#25327) * php V8 warning append on create contract * php V8 warning * Update card.php --- htdocs/contrat/card.php | 4 +++- htdocs/ticket/card.php | 2 +- htdocs/ticket/list.php | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 72b7ebed3ed..c3b7099e70d 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -10,6 +10,7 @@ * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2023 Charlene Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -993,7 +994,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to build doc - $upload_dir = $conf->contrat->multidir_output[$object->entity]; + $upload_dir = $conf->contrat->multidir_output[!empty($object->entity)?$object->entity:$conf->entity]; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Actions to send emails @@ -1086,6 +1087,7 @@ if ($result > 0) { // Create if ($action == 'create') { + $objectsrc = null; print load_fiche_titre($langs->trans('AddContract'), '', 'contract'); $soc = new Societe($db); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 4c318197b1e..1baabd1e0d2 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1131,7 +1131,7 @@ if ($action == 'create' || $action == 'presend') { $foundinter = 0; if ($num) { foreach ($object->linkedObjects as $objecttype => $objects) { - if ($objecttype = "fichinter") { + if ($objecttype == "fichinter") { foreach ($objects as $fichinter) { $foundinter++; $timing += $fichinter->duration; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 89550402515..36b3f33d800 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -55,10 +55,13 @@ $mode = GETPOST('mode', 'alpha'); $id = GETPOST('id', 'int'); $msg_id = GETPOST('msg_id', 'int'); $socid = GETPOST('socid', 'int'); +$contractid = GETPOST('contractid', 'int'); $projectid = GETPOST('projectid', 'int'); $project_ref = GETPOST('project_ref', 'alpha'); $search_societe = GETPOST('search_societe', 'alpha'); $search_fk_project = GETPOST('search_fk_project', 'int') ?GETPOST('search_fk_project', 'int') : GETPOST('projectid', 'int'); +$search_fk_contract = GETPOST('search_fk_contract', 'int') ?GETPOST('search_fk_contract', 'int') : GETPOST('contractid', 'int'); + $search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); $search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); $search_dateread_start = dol_mktime(0, 0, 0, GETPOST('search_dateread_startmonth', 'int'), GETPOST('search_dateread_startday', 'int'), GETPOST('search_dateread_startyear', 'int')); @@ -427,6 +430,9 @@ if ($search_societe) { if ($search_fk_project > 0) { $sql .= natural_search('fk_project', $search_fk_project, 2); } +if ($search_fk_contracct > 0) { + $sql .= natural_search('fk_contract', $search_fk_contract, 2); +} if ($search_date_start) { $sql .= " AND t.datec >= '".$db->idate($search_date_start)."'"; } @@ -918,7 +924,7 @@ foreach ($object->fields as $key => $val) { if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); + print $object->showInputField($val, $key, !empty($search[$key])?$search[$key]:"", '', '', 'search_', 'maxwidth150', 1); } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { print ''; } From eb53dd2d8778ce4cf2075978d5b8fe6814de321b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:24:21 +0200 Subject: [PATCH 0129/1137] Update ChangeLog (#25323) minor adjustments / assortments + two duplicate entries deleted: - Ticket - notification email - PDF - more recend model as default --- ChangeLog | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29418815dd1..da15649487f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,7 +60,6 @@ NEW: Can set the page "List of opportunities" as landing page NEW: Can show the sql request used on emailing selection NEW: can stay on edit field when errors occurs NEW: comment in api_mymodule for seperate methods -NEW: constant PROPALE_ADDON_NOTE_PUBLIC_DEFAULT NEW: create email substitution variable for intervention signature URL NEW: Debug the custom CSS feature to avoid a directory search/scan at NEW: dev name @@ -75,6 +74,7 @@ NEW: Email-Collector: operation type in email collector to load or create contac NEW: Email-Collector: easier setup - can also use ! for negative search NEW: Events: can add any contact on events if global MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT is set at 1 NEW: Events: list with color +NEW: Events: remove default percentage for event creation url NEW: expend/collapse list of social networks NEW: Filter on amount and qty on list of service's contracts NEW: formconfirm can support field with format datetime @@ -98,7 +98,6 @@ NEW: Import: map table to element for get entity in import NEW: inc.php: handle parameters from argv NEW: Invoice - show category of operations NEW: Keep a link between user created from recruitment and application -NEW: List product in orders NEW: Mass Actions: Better responsive for mass actions NEW: Members: add numbering modules for members NEW: Members: add widget box_members_by_tags.php @@ -116,28 +115,31 @@ NEW: only get openned contact from liste_contact function, to not have acces to NEW: Option to manage deposit slips for more payment modes (not only NEW: Option to show column for field and line selection on the left NEW: Orders: add sub total in order list det +NEW: Orders: list product in orders NEW: Orders export: allow to export field 'shipment method' NEW: payment default values when supplier order created from reception -NEW: Payment : manage contracts +NEW: Payment: manage contracts +NEW: Payment: sepaStripe now creates the payment mode with type pm_ using new API NEW: presend mass action in contact list NEW: Print PDF: category of operation for crabe PDF model NEW: Print PDF: Name and date to print on PDF Sign NEW: Print PDF: Use the more recent PDF templates for documents by default on a fresh install +NEW: Print PDF: Option PDF_SHOW_PHONE_AFTER_USER_CONTACT to show phone after specific assigned contact on PDF +NEW: Print PDF: Option PDF_SHOW_EMAIL_AFTER_USER_CONTACT to show email after specific assigned contact on PDF NEW: product images on popup are cached NEW: Products: Add statistics by amount on statistics of products. NEW: Proposals: filter for Signed+Billed in proposals NEW: Proposals: can modify margin rates in offers like VAT rates NEW: Proposals: option filter for NoSalesRepresentativeAffected in proposals list +NEW: Proposals: constant PROPALE_ADDON_NOTE_PUBLIC_DEFAULT NEW: Provide the oldcopy value when calling setValueFrom() function with a trigger key NEW: Reception: can receive more than qty ordered on reception NEW: referential objects of batch -NEW: remove default percentage for event creation url NEW: remove keys whose table element is the same as element in map list NEW: repair script skip views NEW: Security: Save date to invalidate other session into user table NEW: Security: Invalidate all sessions of a user when password is modified. NEW: search on time spent duration range -NEW: sepaStripe now creates the payment mode with type pm_ using new API NEW: set payment default values when supplier order created from reception NEW: set today start time at beginning NEW: Show counter of access of website in website list @@ -159,9 +161,8 @@ NEW: tables: llx_element_time to store time spent on several elements (mo, ticke NEW: TakePOS: adapt category and product pictures sizes on TakePOS NEW: TakePOS: limit load products in TakePOS NEW: The batch for remind on due date can be setup for using validation date -NEW: The refresh link for imap collector is always visible +NEW: The refresh link for IMAP collector is always visible NEW: The upgrade process can be done by creating a file upgrade.unlock -NEW: Tickets: --Send an email when ticket assigned-- NEW: Tickets: Send a notification email when ticket assigned NEW: Tickets: set ticket status to answered if the client has answered from the public interface NEW: Tickets: added an option to display the progress of tickets on the public interface @@ -169,13 +170,10 @@ NEW: Tickets: add link to thirdparty tickets history NEW: Tickets: notify also the contributor affected to a ticket if a new message public is post (add global TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ALSO_CONTRIBUTOR) NEW: Use a cache file for external RSS in calendar NEW: Use by default the domain $dolibarr_main_url_root for SMTP HELO -NEW: use more recent model by default NEW: VAT can be modified during add of line NEW: Website Module: Increment website counter on each page access in website module NEW: write all fields and their properties in asciidoc format NEW: Can add an array of several links in date selector -NEW: Option PDF_SHOW_PHONE_AFTER_USER_CONTACT to show phone after specific assigned contact on PDF -NEW: Option PDF_SHOW_EMAIL_AFTER_USER_CONTACT to show email after specific assigned contact on PDF NEW: Widgets: Implement MAIN_ACTIVATE_FILECACHE on birthday widget NEW: Widgets: Add widget "The next upcoming events" NEW: Widgets: Add widget of open opportunities @@ -192,10 +190,11 @@ NEW: add triggers on mailing NEW: Add a trigger when create a shipping line batch and fix propagate missing errors NEW: add function for listiong objects from directory NEW: add helplist property to describe fields of objects -NEW: add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', Add hook online sign +NEW: Hooks: printFieldListFrom in contact list +NEW: Hooks: add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', Add hook online sign NEW: Update lib parsedownto 1.7.4, phpspreadsheet lib to v1.12, ESCPOS v3.0, jquery, Stripe. -NEW: Support contact in post() document API -NEW: More APIs (update currency rate, upload of supplier documents, ...) +NEW: API: Support contact in post() document API +NEW: API: more APIs (update currency rate, upload of supplier documents, ...) NEW: ModuleBuilder: updating in modulbuilder on tab Menu when adding object NEW: ModuleBuilder: add/edit permissions NEW: ModuleBuilder: better generated documentation From 4ca8d2ef78714c1fe3ec6cc74037b04db67d2bdb Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:24:31 +0200 Subject: [PATCH 0130/1137] Update admin.lang (#25322) --- htdocs/langs/en_US/admin.lang | 76 ++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 21cc6602048..9e1ccef84e2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -365,10 +365,10 @@ GenericMaskCodes=You may enter any numbering mask. In this mask, the following t GenericMaskCodes2={cccc} the client code on n characters
{cccc000} the client code on n characters is followed by a counter dedicated to the customer. This counter dedicated to customer is reset at same time as the global counter.
{tttt} The code of third party type on n characters (see menu Home - Setup - Dictionary - Types of third parties). If you add this tag, the counter will be different for each type of third party.
GenericMaskCodes3=All other characters in the mask will remain intact.
Spaces are not allowed.
GenericMaskCodes3EAN=All other characters in the mask will remain intact (except * or ? in 13th position in EAN13).
Spaces are not allowed.
In EAN13, the last character after the last } in 13th position should be * or ? . It will be replaced by the calculated key.
-GenericMaskCodes4a=Example on the 99th %s of the third party TheCompany, with date 2007-01-31:
-GenericMaskCodes4b=Example on third party created on 2007-03-01:
-GenericMaskCodes4c=Example on product created on 2007-03-01:
-GenericMaskCodes5=ABC{yy}{mm}-{000000} will give ABC0701-000099
{0000+100@1}-ZZZ/{dd}/XXX will give 0199-ZZZ/31/XXX
IN{yy}{mm}-{0000}-{t} will give IN0701-0099-A if the type of company is 'Responsable Inscripto' with code for type that is 'A_RI' +GenericMaskCodes4a=Example on the 99th %s of the third party TheCompany, with date 2023-01-31:
+GenericMaskCodes4b=Example on third party created on 2023-01-31:
+GenericMaskCodes4c=Example on product created on 2023-01-31:
+GenericMaskCodes5=ABC{yy}{mm}-{000000} will give ABC2301-000099
{0000+100@1}-ZZZ/{dd}/XXX will give 0199-ZZZ/31/XXX
IN{yy}{mm}-{0000}-{t} will give IN2301-0099-A if the type of company is 'Responsable Inscripto' with code for type that is 'A_RI' GenericNumRefModelDesc=Returns a customizable number according to a defined mask. ServerAvailableOnIPOrPort=Server is available at address %s on port %s ServerNotAvailableOnIPOrPort=Server is not available at address %s on port %s @@ -394,7 +394,7 @@ ListOfDirectoriesForModelGenODT=List of directories containing templates files w NumberOfModelFilesFound=Number of ODT/ODS template files found in these directories ExampleOfDirectoriesForModelGen=Examples of syntax:
c:\\myapp\\mydocumentdir\\mysubdir
/home/myapp/mydocumentdir/mysubdir
DOL_DATA_ROOT/ecm/ecmdir FollowingSubstitutionKeysCanBeUsed=
To know how to create your odt document templates, before storing them in those directories, read wiki documentation: -FullListOnOnlineDocumentation=http://wiki.dolibarr.org/index.php/Create_an_ODT_document_template +FullListOnOnlineDocumentation=https://wiki.dolibarr.org/index.php/Create_an_ODT_document_template FirstnameNamePosition=Position of Name/Lastname DescWeather=The following images will be shown on the dashboard when the number of late actions reach the following values: KeyForWebServicesAccess=Key to use Web Services (parameter "dolibarrkey" in webservices) @@ -542,7 +542,7 @@ DAV_ALLOW_PUBLIC_DIR=Enable the generic public directory (WebDAV dedicated direc DAV_ALLOW_PUBLIC_DIRTooltip=The generic public directory is a WebDAV directory anybody can access (in read and write mode), with no authorization required (login/password account). DAV_ALLOW_ECM_DIR=Enable the DMS/ECM private directory (root directory of the DMS/ECM module - login required) DAV_ALLOW_ECM_DIRTooltip=The root directory where all files are manually uploaded when using the DMS/ECM module. Similarly as access from the web interface, you will need a valid login/password with adecuate permissions to access it. -# Modules +##### Modules ##### Module0Name=Users & Groups Module0Desc=Users / Employees and Groups management Module1Name=Third Parties @@ -712,6 +712,7 @@ Module63000Desc=Manage resources (printers, cars, rooms, ...) for allocating to Module66000Name=OAuth2 token management Module66000Desc=Provide a tool to generate and manage OAuth2 tokens. The token can then be used by some other modules. Module94160Name=Receptions +##### Permissions ##### Permission11=Read customer invoices (and payments) Permission12=Create/modify customer invoices Permission13=Invalidate customer invoices @@ -1439,10 +1440,10 @@ MustBeUnique=Must be unique? MustBeMandatory=Mandatory to create third parties (if VAT number or type of company defined) ? MustBeInvoiceMandatory=Mandatory to validate invoices? TechnicalServicesProvided=Technical services provided -#####DAV ##### +##### WebDAV ##### WebDAVSetupDesc=This is the link to access the WebDAV directory. It contains a "public" dir open to any user knowing the URL (if public directory access allowed) and a "private" directory that needs an existing login account/password for access. WebDavServer=Root URL of %s server: %s -##### Webcal setup ##### +##### WebCAL setup ##### WebCalUrlForVCalExport=An export link to %s format is available at following link: %s ##### Invoices ##### BillsSetup=Invoices module setup @@ -1641,9 +1642,9 @@ LDAPFieldEndLastSubscription=Date of subscription end LDAPFieldTitle=Job position LDAPFieldTitleExample=Example: title LDAPFieldGroupid=Group id -LDAPFieldGroupidExample=Exemple : gidnumber +LDAPFieldGroupidExample=Example : gidnumber LDAPFieldUserid=User id -LDAPFieldUseridExample=Exemple : uidnumber +LDAPFieldUseridExample=Example : uidnumber LDAPFieldHomedirectory=Home directory LDAPFieldHomedirectoryExample=Exemple : homedirectory LDAPFieldHomedirectoryprefix=Home directory prefix @@ -1834,26 +1835,26 @@ AccountancyCodeSell=Sale account. code AccountancyCodeBuy=Purchase account. code CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT=Keep the checkbox “Automatically create the payment” empty by default when creating a new tax ##### Agenda ##### -AgendaSetup=Events and agenda module setup -PasswordTogetVCalExport=Key to authorize export link -SecurityKey = Security Key +AgendaSetup = Events and agenda module setup +AGENDA_DEFAULT_FILTER_TYPE = Automatically set this type of event in search filter of agenda view +AGENDA_DEFAULT_FILTER_STATUS = Automatically set this status for events in search filter of agenda view +AGENDA_DEFAULT_VIEW = Which view do you want to open by default when selecting menu Agenda +AGENDA_EVENT_PAST_COLOR = Past event color +AGENDA_EVENT_CURRENT_COLOR = Current event color +AGENDA_EVENT_FUTURE_COLOR = Future event color +AGENDA_REMINDER_BROWSER = Enable event reminder on user's browser (When remind date is reached, a popup is shown by the browser. Each user can disable such notifications from its browser notification setup). +AGENDA_REMINDER_BROWSER_SOUND = Enable sound notification +AGENDA_REMINDER_EMAIL = Enable event reminder by emails (remind option/delay can be defined on each event). +AGENDA_REMINDER_EMAIL_NOTE = Note: The frequency of the scheduled job %s must be enough to be sure that the remind are sent at the correct moment. +AGENDA_SHOW_LINKED_OBJECT = Show linked object into agenda view +AGENDA_USE_EVENT_TYPE = Use events types (managed in menu Setup -> Dictionaries -> Type of agenda events) +AGENDA_USE_EVENT_TYPE_DEFAULT = Automatically set this default value for type of event in event create form +PasswordTogetVCalExport = Key to authorize export link PastDelayVCalExport=Do not export event older than -AGENDA_USE_EVENT_TYPE=Use events types (managed in menu Setup -> Dictionaries -> Type of agenda events) -AGENDA_USE_EVENT_TYPE_DEFAULT=Automatically set this default value for type of event in event create form -AGENDA_DEFAULT_FILTER_TYPE=Automatically set this type of event in search filter of agenda view -AGENDA_DEFAULT_FILTER_STATUS=Automatically set this status for events in search filter of agenda view -AGENDA_EVENT_PAST_COLOR=Past event color -AGENDA_EVENT_CURRENT_COLOR=Current event color -AGENDA_EVENT_FUTURE_COLOR=Future event color -AGENDA_DEFAULT_VIEW=Which view do you want to open by default when selecting menu Agenda -AGENDA_REMINDER_BROWSER=Enable event reminder on user's browser (When remind date is reached, a popup is shown by the browser. Each user can disable such notifications from its browser notification setup). -AGENDA_REMINDER_BROWSER_SOUND=Enable sound notification -AGENDA_REMINDER_EMAIL=Enable event reminder by emails (remind option/delay can be defined on each event). -AGENDA_REMINDER_EMAIL_NOTE=Note: The frequency of the scheduled job %s must be enough to be sure that the remind are sent at the correct moment. -AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view -##### Clicktodial ##### +SecurityKey = Security Key +##### ClickToDial ##### ClickToDialSetup=Click To Dial module setup -ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
__PHONETO__ that will be replaced with the phone number of person to call
__PHONEFROM__ that will be replaced with phone number of calling person (yours)
__LOGIN__ that will be replaced with clicktodial login (defined on user card)
__PASS__ that will be replaced with clicktodial password (defined on user card). +ClickToDialUrlDesc=URL called when a click on phone picto is done. In URL, you can use tags
__PHONETO__ that will be replaced with the phone number of person to call
__PHONEFROM__ that will be replaced with phone number of calling person (yours)
__LOGIN__ that will be replaced with clicktodial login (defined on user card)
__PASS__ that will be replaced with clicktodial password (defined on user card). ClickToDialDesc=This module change phone numbers, when using a desktop computer, into clickable links. A click will call the number. This can be used to start the phone call when using a soft phone on your desktop or when using a CTI system based on SIP protocol for example. Note: When using a smartphone, phone numbers are always clickable. ClickToDialUseTelLink=Use just a link "tel:" on phone numbers ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface, installed on the same computer as the browser, and called when you click on a link starting with "tel:" in your browser. If you need a link that start with "sip:" or a full server solution (no need of local software installation), you must set this to "No" and fill the next field. @@ -2066,6 +2067,7 @@ BaseCurrency=Reference currency of the company (go into setup of company to chan WarningNoteModuleInvoiceForFrenchLaw=This module %s is compliant with French laws (Loi Finance 2016). WarningNoteModulePOSForFrenchLaw=This module %s is compliant with French laws (Loi Finance 2016) because module Non Reversible Logs is automatically activated. WarningInstallationMayBecomeNotCompliantWithLaw=You are trying to install module %s that is an external module. Activating an external module means you trust the publisher of that module and that you are sure that this module does not adversely impact the behavior of your application, and is compliant with laws of your country (%s). If the module introduces an illegal feature, you become responsible for the use of illegal software. + MAIN_PDF_MARGIN_LEFT=Left margin on PDF MAIN_PDF_MARGIN_RIGHT=Right margin on PDF MAIN_PDF_MARGIN_TOP=Top margin on PDF @@ -2110,7 +2112,7 @@ NewEmailCollector=New Email Collector EMailHost=Host of email IMAP server EMailHostPort=Port of email IMAP server loginPassword=Login/Password -oauthToken=Oauth2 token +oauthToken=OAuth2 token accessType=Acces type oauthService=Oauth service TokenMustHaveBeenCreated=Module OAuth2 must be enabled and an oauth2 token must have been created with the correct permissions (for example scope "gmail_full" with OAuth for Gmail). @@ -2336,7 +2338,7 @@ IconOnly=Icon only - Text on tooltip only INVOICE_ADD_ZATCA_QR_CODE=Show the ZATCA QR code on invoices INVOICE_ADD_ZATCA_QR_CODEMore=Some Arabic countries need this QR Code on their invoices INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices -INVOICE_ADD_SWISS_QR_CODEMore=Switzerland's standard for invoices; make sure ZIP&City are filled and that the accounts have valid Swiss/Liechtenstein IBANs. +INVOICE_ADD_SWISS_QR_CODEMore=Switzerland's standard for invoices; make sure ZIP & City are filled and that the accounts have valid Swiss/Liechtenstein IBANs. INVOICE_SHOW_SHIPPING_ADDRESS=Show shipping address INVOICE_SHOW_SHIPPING_ADDRESSMore=Compulsory mention for France UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID. @@ -2366,12 +2368,12 @@ DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program 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 lists -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" +CssOnEdit=CSS on edit pages +CssOnView=CSS on view pages +CssOnList=CSS on lists +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 WarningDisabled=Warning disabled @@ -2396,4 +2398,4 @@ Defaultfortype=Default DefaultForTypeDesc=Template used by default when creating a new email for the template type OptionXShouldBeEnabledInModuleY=Option "%s" should be enabled into module %s OptionXIsCorrectlyEnabledInModuleY=Option "%s" is enabled into module %s -AtBottomOfPage=At bottom of page \ No newline at end of file +AtBottomOfPage=At bottom of page From c8ba68cda8fcfa889fbfb5b7bbc242672336d739 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 12 Jul 2023 13:24:55 +0200 Subject: [PATCH 0131/1137] fix: dev/examples/zapier/package.json to reduce vulnerabilities (#25316) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-SEMVER-3247795 Co-authored-by: snyk-bot --- dev/examples/zapier/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json index 8852928771f..ef70b2af8fd 100644 --- a/dev/examples/zapier/package.json +++ b/dev/examples/zapier/package.json @@ -15,7 +15,7 @@ "npm": ">=5.6.0" }, "dependencies": { - "zapier-platform-core": "11.3.1" + "zapier-platform-core": "15.0.1" }, "devDependencies": { "mocha": "^5.2.0", From a366e567e83aca0ad7fb00cf7382dd14a1e2bf8d Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 12 Jul 2023 14:22:27 +0200 Subject: [PATCH 0132/1137] fix: cornas PDF have to use the same way of display column as cyan (#25329) * fix: use std method to display column titles * reveiw with cyan --- .../supplier_order/doc/pdf_cornas.modules.php | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index cf94376b285..230a46ed90a 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -161,6 +161,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Define position of columns $this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support durring PDF transition: TODO remove this at the end + $this->tabTitleHeight = 5; // default height + $this->tva = array(); $this->tva_array = array(); $this->localtax1 = array(); @@ -511,11 +513,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders $height_note = 0; } - $nexY = $tab_top + 5; - // Use new auto collum system $this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref); + $nexY = $tab_top + $this->tabTitleHeight; + // Loop on each lines $pageposbeforeprintlines = $pdf->getPage(); $pagenb = $pageposbeforeprintlines; @@ -1185,29 +1187,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Output Rect $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter - foreach ($this->cols as $colKey => $colDef) { - if (!$this->getColumnStatus($colKey)) { - continue; - } - - // get title label - $colDef['title']['label'] = !empty($colDef['title']['label']) ? $colDef['title']['label'] : $outputlangs->transnoentities($colDef['title']['textkey']); - - // Add column separator - if (!empty($colDef['border-left'])) { - $pdf->line($colDef['xStartPos'], $tab_top, $colDef['xStartPos'], $tab_top + $tab_height); - } - - if (empty($hidetop)) { - $pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0]); - - $textWidth = $colDef['width'] - $colDef['title']['padding'][3] - $colDef['title']['padding'][1]; - $pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']); - } - } + $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line takes a position y in 2nd parameter and 4th parameter + $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight); // line takes a position y in 2nd parameter and 4th parameter } } @@ -1547,7 +1530,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label - 'padding' => array(0.5, 1, 0.5, 1.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left + 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( 'align' => 'L', From 91020eacfadf8fc162ed5f247f3d61e7c7add005 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Wed, 12 Jul 2023 16:13:32 +0200 Subject: [PATCH 0133/1137] Fix : bookcal database structure (#25326) * Fix : bookcal database structure * fix status --------- Co-authored-by: Hystepik --- htdocs/bookcal/class/booking.class.php | 2 ++ htdocs/install/mysql/tables/llx_bookcal_booking-bookcal.sql | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/bookcal/class/booking.class.php b/htdocs/bookcal/class/booking.class.php index fab4cd6ba95..897936f995b 100644 --- a/htdocs/bookcal/class/booking.class.php +++ b/htdocs/bookcal/class/booking.class.php @@ -122,6 +122,7 @@ class Booking extends CommonObject 'email' => array('type'=>'varchar(128)', 'label'=>'email', 'enabled'=>'1', 'position'=>4, 'notnull'=>1, 'visible'=>-1,), 'start' => array('type'=>'datetime', 'label'=>'Start Hour', 'enabled'=>'1', 'position'=>5, 'notnull'=>1, 'visible'=>-1,), 'duration' => array('type'=>'integer', 'label'=>'Duration', 'enabled'=>'1', 'position'=>6, 'notnull'=>1, 'visible'=>-1,), + 'fk_bookcal_availability' => array('type'=>'integer:Availabilities:bookcal/class/availabilities.class.php', 'label'=>'AvailabilityId', 'enabled'=>'1', 'position'=>49, 'notnull'=>1, 'visible'=>-1,), ); public $rowid; public $ref; @@ -143,6 +144,7 @@ class Booking extends CommonObject public $email; public $start; public $duration; + public $fk_bookcal_availability; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/install/mysql/tables/llx_bookcal_booking-bookcal.sql b/htdocs/install/mysql/tables/llx_bookcal_booking-bookcal.sql index df3f6384d23..d327bd56183 100644 --- a/htdocs/install/mysql/tables/llx_bookcal_booking-bookcal.sql +++ b/htdocs/install/mysql/tables/llx_bookcal_booking-bookcal.sql @@ -35,6 +35,7 @@ CREATE TABLE llx_bookcal_booking( lastname varchar(128) NOT NULL, email varchar(128) NOT NULL, start datetime NOT NULL, - duration integer NOT NULL + duration integer NOT NULL, + fk_bookcal_availability integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; From f202bc62f3d43ea9037950c1b022cc07b08ac621 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Thu, 13 Jul 2023 17:13:43 +0200 Subject: [PATCH 0134/1137] Fix : modulebuilder security check (#25354) Co-authored-by: Hystepik --- htdocs/core/lib/security.lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 7ca7a442909..8211fa50823 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -617,6 +617,11 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '', $createok = 0; $nbko++; } + } elseif ($feature == 'modulebuilder') { + if (!$user->hasRight('modulebuilder', 'run')) { + $createok = 0; + $nbko++; + } } elseif (!empty($feature2)) { // This is for permissions on 2 levels (module->object->write) foreach ($feature2 as $subfeature) { if ($subfeature == 'user' && $user->id == $objectid && $user->hasRight('user', 'self', 'creer')) { From 76d1430dfa702be447aaf7c5c988f636d8a26751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Thu, 13 Jul 2023 17:14:43 +0200 Subject: [PATCH 0135/1137] extrafields fails on update (#25356) --- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 294aea5e8e7..cb5775ca347 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -172,9 +172,9 @@ $css = $extrafields->attributes[$elementtype]['css'][$attrname]; $cssview = $extrafields->attributes[$elementtype]['cssview'][$attrname]; $csslist = $extrafields->attributes[$elementtype]['csslist'][$attrname]; +$param_chain = ''; if (is_array($param)) { if (($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) { - $param_chain = ''; foreach ($param['options'] as $key => $value) { if (strlen($key)) { $param_chain .= $key.','.$value."\n"; From e76641c491e4105e9cb1ded6149771c621d822b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Thu, 13 Jul 2023 17:18:10 +0200 Subject: [PATCH 0136/1137] Add emptyObjectVars() to CommonObject (#25357) To be able ti unset all vars when looping and fetching in each loop. --- htdocs/core/class/commonobject.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bb44c3bce4e..75f2a76e7c2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9136,6 +9136,16 @@ abstract class CommonObject } } + /** + * Sets all object fields to null. Useful for example in lists, when printing multiple lines and a different object os fetched for each line. + * @return void + */ + public function emtpyObjectVars() { + foreach ($this->fields as $field => $arr) { + $this->$field = null; + } + } + /** * Function to concat keys of fields * From aaf4f57ae9498b69bfeb2165277985d676a79095 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 16 Jul 2023 14:40:00 +0200 Subject: [PATCH 0137/1137] Fix php 8 list.php (#25363) --- htdocs/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 36b3f33d800..524141588e2 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -430,7 +430,7 @@ if ($search_societe) { if ($search_fk_project > 0) { $sql .= natural_search('fk_project', $search_fk_project, 2); } -if ($search_fk_contracct > 0) { +if ($search_fk_contract > 0) { $sql .= natural_search('fk_contract', $search_fk_contract, 2); } if ($search_date_start) { From 3ba8505e701c4e194277b6b63d294e777e90f145 Mon Sep 17 00:00:00 2001 From: mc2contributor Date: Sun, 16 Jul 2023 06:46:07 -0600 Subject: [PATCH 0138/1137] Add missing Canadian territories (#25364) --- htdocs/install/mysql/data/llx_20_c_departements.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index ad647028c9a..81f4b473f60 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -301,6 +301,9 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1401, 'SK', '', 1, '', 'Saskatchewan'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1401, 'AB', '', 1, '', 'Alberta'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1401, 'NL', '', 1, '', 'Newfoundland and Labrador'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1401, 'YT', '', 1, '', 'Yukon'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1401, 'NT', '', 1, '', 'Northwest Territories'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1401, 'NU', '', 1, '', 'Nunavut'); -- Chile Provinces (id country=67) From 21b02d56984e6ffe1dea632adf93a8153a72f90f Mon Sep 17 00:00:00 2001 From: mc2contributor Date: Sun, 16 Jul 2023 06:54:08 -0600 Subject: [PATCH 0139/1137] Add 'name' property for fetching user's name (#25359) --- htdocs/user/class/user.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index d64aaa910c4..06e7a481bfd 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3844,7 +3844,7 @@ class User extends CommonObject * Return property of user from its id * * @param int $rowid id of contact - * @param string $mode 'email' or 'mobile' + * @param string $mode 'email', 'mobile', or 'name' * @return string Email of user with format: "Full name " */ public function user_get_property($rowid, $mode) @@ -3871,6 +3871,8 @@ class User extends CommonObject $user_property = dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">"; } elseif ($mode == 'mobile') { $user_property = $obj->user_mobile; + } elseif ($mode == 'name') { + $user_property = dolGetFirstLastname($obj->firstname, $obj->lastname); } } return $user_property; From e6527a79e5a7edf2e26b16c4d28744415cf8dd66 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 17 Jul 2023 18:31:00 +0200 Subject: [PATCH 0140/1137] fix some incoherence in ModuleBuilder menus --- htdocs/modulebuilder/index.php | 73 +++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 18 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4bc7deca258..c0be68b89cb 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1391,8 +1391,8 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { 'url'=>'/mymodule/myobject_list.php', 'langs'=>'mymodule@mymodule', 'position'=>1000+\$r, - 'enabled'=>'\$conf->testmodule->enabled', - 'perms'=>'1', + 'enabled'=>'\$conf->mymodule->enabled', + 'perms'=>'\$user->hasRight(\"mymodule\", \"myobject\", \"read\")', 'target'=>'', 'user'=>2, ); @@ -1406,7 +1406,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { 'langs'=>'mymodule@mymodule', 'position'=>1000+\$r, 'enabled'=>'\$conf->mymodule->enabled', - 'perms'=>'1', + 'perms'=>'\$user->hasRight(\"mymodule\", \"myobject\", \"read\")', 'target'=>'', 'user'=>2, ); @@ -1420,7 +1420,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { 'langs'=>'mymodule@mymodule', 'position'=>1000+\$r, 'enabled'=>'\$conf->mymodule->enabled', - 'perms'=>'1', + 'perms'=>'\$user->hasRight(\"mymodule\", \"myobject\", \"write\")', 'target'=>'', 'user'=>2 );\n"; @@ -2535,7 +2535,13 @@ if ($dirins && $action == 'addmenu' && empty($cancel)) { } // modify a menu -if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int')) { +if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST('tabobj')) { + $objectname = GETPOST('tabobj'); + $dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; + $destdir = $dirins.'/'.strtolower($module); + $objects = dolGetListOfObjectClasses($destdir); + + if (empty($cancel)) { if (isModEnabled(strtolower($module))) { $result = unActivateModule(strtolower($module)); @@ -2585,12 +2591,31 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int')) { } else { $menuModify['fk_menu'] = 'fk_mainmenu='.GETPOST('mainmenu'); } - if (GETPOST('enabled') != '0') { + if (empty(GETPOST('enabled')) || GETPOST('enabled') != '0') { $menuModify['enabled'] = "\$conf->".strtolower($module)."->enabled"; } else { $menuModify['enabled'] = "0"; } + //for extract object and compare it + $leftMenuValue = substr($menuModify['fk_menu'], strpos($menuModify['fk_menu'], 'fk_leftmenu=') + strlen('fk_leftmenu=')); + $found = false; + foreach ($objects as $value) { + if (strcasecmp($value, $leftMenuValue) === 0) { + $found = true; + break; + } + } + if ($found) { + $objectname = $leftMenuValue; + } else { + $objectname = 'myobject'; + } + + if (!empty(GETPOST('perms'))) { + $menuModify['perms'] = '$user->hasRight("'.strtolower($module).'", "'.strtolower($objectname).'", "'.GETPOST('perms').'")'; + } + if (GETPOST('type', 'alpha') == 'top') { $error++; setEventMessages($langs->trans("ErrorTypeMenu", $langs->transnoentities("type")), null, 'errors'); @@ -4322,6 +4347,9 @@ if ($module == 'initmodule') { $menus = $moduleobj->menu; + $permissions = $moduleobj->rights; + $crud = array('read'=>'CRUDRead', 'write'=>'CRUDCreateWrite', 'delete'=>'Delete'); + if ($action == 'deletemenu') { $formconfirms = $form->formconfirm( $_SERVER["PHP_SELF"].'?menukey='.urlencode(GETPOST('menukey', 'int')).'&tab='.urlencode($tab).'&module='.urlencode($module), @@ -4408,8 +4436,9 @@ if ($module == 'initmodule') { print ''; print '
'; print ''; print '
'; print ''; print ''; print (dol_escape_htmltag($menu['enabled']) == '0' ? $langs->trans("Hide") : $langs->trans("Show")); print ''; - print (dol_escape_htmltag($menu['perms'])== '1' ? $langs->trans("Yes") : $langs->trans("No")); + if (strpos($menu['perms'], "\$user->hasRight") !== 0) { + print ''; + } else { + print (dol_escape_htmltag($langs->trans($crud[$valPerms])) ); + } print ''; From 4bd9a62a4408d08552b48da8690b6fc3f9cdcff9 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 18 Jul 2023 12:24:16 +0200 Subject: [PATCH 0141/1137] add select perms for each object when add menu --- htdocs/modulebuilder/index.php | 77 +++++++++++++++++++++++++++----- htdocs/theme/eldy/global.inc.php | 8 ++++ 2 files changed, 74 insertions(+), 11 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index c0be68b89cb..e02e3d191cb 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2505,7 +2505,7 @@ if ($dirins && $action == 'addmenu' && empty($cancel)) { 'langs' => strtolower($module)."@".strtolower($module), 'position' => '', 'enabled' => GETPOST('enabled', 'alpha'), - 'perms' => GETPOST('perms', 'alpha'), + 'perms' => '$user->hasRight("'.strtolower($module).'", "'.GETPOST('objects', 'alpha').'", "'.GETPOST('perms', 'alpha').'")', 'target' => GETPOST('target', 'alpha'), 'user' => GETPOST('user', 'alpha'), ); @@ -4350,6 +4350,17 @@ if ($module == 'initmodule') { $permissions = $moduleobj->rights; $crud = array('read'=>'CRUDRead', 'write'=>'CRUDCreateWrite', 'delete'=>'Delete'); + //grouped permissions + $groupedRights = array(); + foreach ($permissions as $right) { + $key = $right[4]; + if (!isset($groupedRights[$key])) { + $groupedRights[$key] = array(); + } + $groupedRights[$key][] = $right; + } + $groupedRights_json = json_encode($groupedRights); + if ($action == 'deletemenu') { $formconfirms = $form->formconfirm( $_SERVER["PHP_SELF"].'?menukey='.urlencode(GETPOST('menukey', 'int')).'&tab='.urlencode($tab).'&module='.urlencode($module), @@ -4434,12 +4445,15 @@ if ($module == 'initmodule') { print ''; print ''; print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; + print ''; print '
'; print ''; + // display permissions for each object + print ''; + print ''; } else { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 644e183065f..a71d2697e23 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -7994,6 +7994,11 @@ table.jPicker { } } +/* for hide a select */ +.hideSelect { + display : none; +} + @media only screen and (max-width: 320px) { .dropdown dd ul { @@ -8035,3 +8040,6 @@ if (!empty($conf->global->THEME_CUSTOM_CSS)) { div.flot-text .flot-tick-label .tickLabel, .fa-color-unset { color: unset; } + + + From 94f5896d4323fdf291e95db1735c6a3de0028439 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 19 Jul 2023 11:57:13 +0200 Subject: [PATCH 0142/1137] fix incoherences in update menu in relation to select permission --- htdocs/core/lib/modulebuilder.lib.php | 6 +-- htdocs/modulebuilder/index.php | 62 ++++++++++++++------------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index de26ad0462d..47f05414fa3 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -949,7 +949,7 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action) array_push($menus, $menuWantTo); } elseif ($action == 2 && !empty($key) && !empty($menuWantTo)) { // update right from permissions array - + $urlCounter=0; // check if the values already exists foreach ($menus as $index => $menu) { if ($index !== $key) { @@ -958,12 +958,12 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action) $counter++; } if (strcasecmp(str_replace(' ', '', $menu['url']), str_replace(' ', '', $menuWantTo['url'])) === 0) { - $counter++; + $urlCounter++; } } } } - if (!$counter) { + if (!$counter && $urlCounter < 2) { $menus[$key] = $menuWantTo; } else { $errors++; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index e02e3d191cb..74e78adba8e 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2522,6 +2522,10 @@ if ($dirins && $action == 'addmenu' && empty($cancel)) { } else { $menuToAdd['enabled'] = "0"; } + if (empty(GETPOST('objects'))) { + $menuToAdd['perms'] = '1'; + } + $result = reWriteAllMenus($moduledescriptorfile, $menus, $menuToAdd, null, 1); clearstatcache(true); @@ -2580,7 +2584,7 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST( 'langs' => strtolower($module)."@".strtolower($module), 'position' => '', 'enabled' => GETPOST('enabled', 'alpha'), - 'perms' => GETPOST('perms', 'alpha'), + 'perms' => '', 'target' => GETPOST('target', 'alpha'), 'user' => GETPOST('user', 'alpha'), ); @@ -2596,24 +2600,11 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST( } else { $menuModify['enabled'] = "0"; } - - //for extract object and compare it - $leftMenuValue = substr($menuModify['fk_menu'], strpos($menuModify['fk_menu'], 'fk_leftmenu=') + strlen('fk_leftmenu=')); - $found = false; - foreach ($objects as $value) { - if (strcasecmp($value, $leftMenuValue) === 0) { - $found = true; - break; - } + if (!empty(GETPOST('perms')) && !empty(GETPOST('objects'))) { + $menuModify['perms'] = '$user->hasRight("'.strtolower($module).'", "'.GETPOST('objects', 'alpha').'", "'.GETPOST('perms', 'alpha').'")'; } - if ($found) { - $objectname = $leftMenuValue; - } else { - $objectname = 'myobject'; - } - - if (!empty(GETPOST('perms'))) { - $menuModify['perms'] = '$user->hasRight("'.strtolower($module).'", "'.strtolower($objectname).'", "'.GETPOST('perms').'")'; + if (empty(GETPOST('objects'))) { + $menuModify['perms'] = '1'; } if (GETPOST('type', 'alpha') == 'top') { @@ -4537,18 +4528,31 @@ if ($module == 'initmodule') { } print ''; print ''; - print ''; - print ''; + print ''; + } else { + print ''; + print ''; } - print ''; - print ''; print ''; print ''; print ''; @@ -4638,7 +4642,6 @@ if ($module == 'initmodule') { print ''; print ''; - // display permissions for each object print ''; - - print ''; + // display permissions for each object } else { $fullpathoffile = dol_buildpath($file, 0); From f0977b246755ea73cebb3bff23929a49a2bfce5b Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 19 Jul 2023 12:43:11 +0200 Subject: [PATCH 0143/1137] add auto fill in for url when add menu --- htdocs/modulebuilder/index.php | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 74e78adba8e..a85ede37709 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -4353,15 +4353,15 @@ if ($module == 'initmodule') { $groupedRights_json = json_encode($groupedRights); if ($action == 'deletemenu') { - $formconfirms = $form->formconfirm( - $_SERVER["PHP_SELF"].'?menukey='.urlencode(GETPOST('menukey', 'int')).'&tab='.urlencode($tab).'&module='.urlencode($module), - $langs->trans('Delete'), - $langs->trans('Confirm Delete Menu', GETPOST('menukey', 'int')), - 'confirm_deletemenu', - '', - 0, - 1 - ); + $formconfirms = $form->formconfirm( + $_SERVER["PHP_SELF"].'?menukey='.urlencode(GETPOST('menukey', 'int')).'&tab='.urlencode($tab).'&module='.urlencode($module), + $langs->trans('Delete'), + ($menus[GETPOST('menukey')]['fk_menu'] === 'fk_mainmenu='.strtolower($module) ? $langs->trans('Warning: you will delete all menus linked to this one.', GETPOST('menukey', 'int')) : $langs->trans('Confirm Delete Menu', GETPOST('menukey', 'int'))), + 'confirm_deletemenu', + '', + 0, + 1 + ); print $formconfirms; } if ($action != 'editfile' || empty($file)) { @@ -4426,8 +4426,8 @@ if ($module == 'initmodule') { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -4642,8 +4642,16 @@ if ($module == 'initmodule') { print ''; print ''; + print ''; print ''; - print ''; + // display permissions for each object } else { $fullpathoffile = dol_buildpath($file, 0); From a5d2c5c625635b82a5a30eccab661163aaa53590 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 19 Jul 2023 13:12:39 +0200 Subject: [PATCH 0144/1137] other fixes --- htdocs/modulebuilder/index.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index a85ede37709..ef197d876ed 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2595,10 +2595,10 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST( } else { $menuModify['fk_menu'] = 'fk_mainmenu='.GETPOST('mainmenu'); } - if (empty(GETPOST('enabled')) || GETPOST('enabled') != '0') { + if (GETPOST('enabled') != '0') { $menuModify['enabled'] = "\$conf->".strtolower($module)."->enabled"; } else { - $menuModify['enabled'] = "0"; + $menuModify['enabled'] = '0'; } if (!empty(GETPOST('perms')) && !empty(GETPOST('objects'))) { $menuModify['perms'] = '$user->hasRight("'.strtolower($module).'", "'.GETPOST('objects', 'alpha').'", "'.GETPOST('perms', 'alpha').'")'; @@ -2613,6 +2613,7 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST( } if (!$error) { //update menu + //var_dump($menuModify);exit; $result = reWriteAllMenus($moduledescriptorfile, $menus, $menuModify, $key, 2); clearstatcache(true); @@ -4470,7 +4471,7 @@ if ($module == 'initmodule') { $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms'); $propUser = !empty($menu['user']) ? $menu['user'] : GETPOST('user'); $propTarget = !empty($menu['target']) ? $menu['target'] : GETPOST('target'); - $propEnabled = empty($menu['enabled']) ? $menu['enabled'] : GETPOST('enabled'); + $propEnabled = !empty($menu['enabled']) ? $menu['enabled'] : GETPOST('enabled'); //Perms $arguments = explode(",", $propPerms); @@ -4520,11 +4521,11 @@ if ($module == 'initmodule') { print ''; print ''; print ''; print ''; @@ -4648,8 +4649,12 @@ if ($module == 'initmodule') { //for fill in auto url $("#leftmenu").on("input", function() { var inputLeftMenu = $("#leftmenu").val(); - var url = "/'.strtolower($module).'/"+ inputLeftMenu+".php"; - $("#url").val(url); + if (inputLeftMenu !== "") { + var url = "/'.strtolower($module).'/"+ inputLeftMenu+".php"; + $("#url").val(url); + }else { + $("#url").val(""); + } }); var groupedRights = ' . $groupedRights_json . '; From a25c9f58e827c4b10c7f96227f7c19813d6db9f0 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 19 Jul 2023 16:24:59 +0200 Subject: [PATCH 0145/1137] product_card problem unexpected tocken --- htdocs/product/card.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 15a04ce4003..f80d131b1ec 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2054,11 +2054,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); print $formproduct->selectWarehouses((GETPOSTISSET('fk_default_warehouse') ? GETPOST('fk_default_warehouse') : $object->fk_default_warehouse), 'fk_default_warehouse', 'warehouseopen', 1); -<<<<<<< HEAD - print ' '; -======= print ' '; ->>>>>>> branch '15.0' of git@github.com:Dolibarr/dolibarr.git print ''; print ''; /* From 00bec4e971426bf6e1346b2ee9d4452a5dc1ed80 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 19 Jul 2023 16:27:33 +0200 Subject: [PATCH 0146/1137] fix --- htdocs/modulebuilder/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index ef197d876ed..2e11db2a7f7 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2613,7 +2613,6 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int') && GETPOST( } if (!$error) { //update menu - //var_dump($menuModify);exit; $result = reWriteAllMenus($moduledescriptorfile, $menus, $menuModify, $key, 2); clearstatcache(true); From a587b732e437c9bb199e35832235c761eac9b984 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Jul 2023 20:37:11 +0200 Subject: [PATCH 0147/1137] Add migration v19 --- .travis.yml | 3 +++ htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 410b35d4124..6ed538bdb8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -434,6 +434,9 @@ script: php upgrade.php 17.0.0 18.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade17001800.log php upgrade2.php 17.0.0 18.0.0 > $TRAVIS_BUILD_DIR/upgrade17001800-2.log php step5.php 17.0.0 18.0.0 > $TRAVIS_BUILD_DIR/upgrade17001800-3.log + php upgrade.php 18.0.0 19.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade18001900.log + php upgrade2.php 18.0.0 19.0.0 > $TRAVIS_BUILD_DIR/upgrade18001900-2.log + php step5.php 18.0.0 19.0.0 > $TRAVIS_BUILD_DIR/upgrade18001900-3.log #show table content and log #echo '\d llx_adherent' | psql 'postgresql://postgres:postgres@127.0.0.1:5432/travis' diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index abd778f71aa..a63e74946c3 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -33,5 +33,5 @@ -- -- VPGSQL8.2 SELECT dol_util_rebuild_sequences(); -- V19 +-- V19 ALTER TABLE llx_ticket ADD COLUMN fk_contract integer DEFAULT 0 after fk_project; From 72494fc48eae843e4469e7968529187e6b332b35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 20 Jul 2023 21:24:35 +0200 Subject: [PATCH 0148/1137] NEW Add a goto url from smartphone search page --- htdocs/core/search_page.php | 63 +++++++++++++++++++++++++++++++++-- htdocs/langs/en_US/other.lang | 1 + 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 2e5cad17c58..b558aa32062 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -45,10 +45,42 @@ if (GETPOST('lang', 'aZ09')) { $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php } -$langs->load("main"); +$langs->loadLangs(array("main", "other")); -$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right'); -$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left'); +$action = GETPOST('action', 'aZ09'); + +/*$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right'); +$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');*/ + + +/* + * Actions + */ + +if ($action == 'redirect') { + global $dolibarr_main_url_root; + + $url = GETPOST('url'); + $url = dol_sanitizeUrl($url); + //$url = preg_replace('/^http(s?):\/\//i', '', $url); + + //var_dump($url); + + $tmpurlrootwithouthttp = preg_replace('/^http(s?):\/\//i', '', DOL_MAIN_URL_ROOT); + //var_dump($dolibarr_main_url_root); + //var_dump(DOL_MAIN_URL_ROOT); + //var_dump($tmpurlrootwithouthttp); + $url = preg_replace('/'.preg_quote($dolibarr_main_url_root, '/').'/', '', $url); + $url = preg_replace('/'.preg_quote(DOL_MAIN_URL_ROOT, '/').'/', '', $url); + $url = preg_replace('/'.preg_quote($tmpurlrootwithouthttp, '/').'/', '', $url); + $urlrelativeforredirect = (DOL_URL_ROOT.(preg_match('/\//', $url) ? '' : '/').$url); + //$urlrelativeforredirectwithoutparam = preg_replace('/\?.*$/', '', $urlrelativeforredirect); + //var_dump($urlrelativeforredirect); + + dol_syslog("Ask search form to redirect on URL: ".$urlrelativeforredirect); + header("Location: ".$urlrelativeforredirect); + exit; +} /* @@ -120,6 +152,7 @@ if ($conf->use_javascript_ajax && 1 == 2) { // select2 is not best with smartp } } + // Execute hook printSearchForm $parameters = array('searchform'=>$searchform); $reshook = $hookmanager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks @@ -129,7 +162,30 @@ if (empty($reshook)) { $searchform = $hookmanager->resPrint; } +$searchform .= '
'; +// Add search on URL +$ret = ''; +$ret .= '
'; +$ret .= ''; +$ret .= ''; +$ret .= ''; +$ret .= '
'; +$ret .= img_picto('', 'url', '', false, 0, 0, '', 'paddingright width20'); +$ret .= 'trans("OrPasteAnURL")).'"'; +$ret .= ' name="url" id="url" />'; +$ret .= ''; +$ret .= '
'; +$ret .= "
\n"; + +$searchform .= $ret; + + +// Show all forms print "\n"; print "\n"; print '
'; @@ -140,6 +196,7 @@ print '
'."\n"; print '
'; print "\n\n"; + print ''; print ''."\n"; diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index bce50fba686..e3927bd7a72 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -300,6 +300,7 @@ ConfirmBtnCommonContent = Are you sure you want to "%s" ? ConfirmBtnCommonTitle = Confirm your action CloseDialog = Close Autofill = Autofill +OrPasteAnURL=or Paste an URL # externalsite ExternalSiteSetup=Setup link to external website From a6ed391b60e9ee3c86c6a9bae34ec4ef0015ab60 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Fri, 21 Jul 2023 16:19:04 +0200 Subject: [PATCH 0149/1137] fix problem --- htdocs/modulebuilder/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 2e11db2a7f7..0a11323eb80 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2671,7 +2671,7 @@ print '
'; //print $textforlistofdirs; //print '
'; -//var_dump($listofmodules); + $message = ''; From 07fbb2da9da98d3f28b7e15f4f23a5d7d8267532 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Jul 2023 19:40:40 +0200 Subject: [PATCH 0150/1137] Doc --- htdocs/langs/zh_CN/README.md | 2 ++ htdocs/langs/zh_HK/README.md | 2 ++ htdocs/langs/zh_TW/README.md | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 htdocs/langs/zh_CN/README.md create mode 100644 htdocs/langs/zh_HK/README.md create mode 100644 htdocs/langs/zh_TW/README.md diff --git a/htdocs/langs/zh_CN/README.md b/htdocs/langs/zh_CN/README.md new file mode 100644 index 00000000000..7ee58e0311a --- /dev/null +++ b/htdocs/langs/zh_CN/README.md @@ -0,0 +1,2 @@ +Language code for ZH language in China. +This is the simplified chinese. diff --git a/htdocs/langs/zh_HK/README.md b/htdocs/langs/zh_HK/README.md new file mode 100644 index 00000000000..28350b77f38 --- /dev/null +++ b/htdocs/langs/zh_HK/README.md @@ -0,0 +1,2 @@ +Language code for ZH language in Hong Kong. +This is the traditionnal chinese. diff --git a/htdocs/langs/zh_TW/README.md b/htdocs/langs/zh_TW/README.md new file mode 100644 index 00000000000..46675a6d946 --- /dev/null +++ b/htdocs/langs/zh_TW/README.md @@ -0,0 +1,2 @@ +Language code for ZH language in Taiwan. +This is the traditionnal chinese. From 47f10f2553e4e0ae7aa5eca155efb190a03ac243 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Jul 2023 00:32:35 +0200 Subject: [PATCH 0151/1137] Better placeholder --- htdocs/user/card.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 04efa858041..8a5ee797727 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1049,11 +1049,11 @@ if ($action == 'create' || $action == 'adduserldap') { // Date validity print ''.$langs->trans("RangeOfLoginValidity").''; print ''; - print $form->selectDate($datestartvalidity, 'datestartvalidity', 0, 0, 1, 'formdatestartvalidity', 1, 1); + print $form->selectDate($datestartvalidity, 'datestartvalidity', 0, 0, 1, 'formdatestartvalidity', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from")); print '   '; - print $form->selectDate($dateendvalidity, 'dateendvalidity', 0, 0, 1, 'formdateendvalidity', 1, 0); + print $form->selectDate($dateendvalidity, 'dateendvalidity', 0, 0, 1, 'formdateendvalidity', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print ''; print "\n"; @@ -1344,7 +1344,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Salary print ''.$langs->trans("Salary").''; print ''; - print img_picto('', 'salary', 'class="pictofixedwidth paddingright"').' '.$langs->getCurrencySymbol($conf->currency); + print img_picto('', 'salary', 'class="pictofixedwidth paddingright"').' '.$langs->getCurrencySymbol($conf->currency); print ''; print "\n"; } @@ -1359,11 +1359,11 @@ if ($action == 'create' || $action == 'adduserldap') { // Date employment print ''.$langs->trans("DateOfEmployment").''; print ''; - print $form->selectDate($dateemployment, 'dateemployment', 0, 0, 1, 'formdateemployment', 1, 1); + print $form->selectDate($dateemployment, 'dateemployment', 0, 0, 1, 'formdateemployment', 1, 1, 0, '', '', '', '', 1, '', $langs->trans("from")); print ' - '; - print $form->selectDate($dateemploymentend, 'dateemploymentend', 0, 0, 1, 'formdateemploymentend', 1, 0); + print $form->selectDate($dateemploymentend, 'dateemploymentend', 0, 0, 1, 'formdateemploymentend', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print ''; print "\n"; @@ -2210,7 +2210,7 @@ if ($action == 'create' || $action == 'adduserldap') { $langs->load("admin"); print ''; print ''.yn($object->admin); - print ' ('.$langs->trans("ExternalUser").')'; + print ' ('.$langs->trans("ExternalUser").')'; print ''; } else { print ''; @@ -2417,18 +2417,14 @@ if ($action == 'create' || $action == 'adduserldap') { print ''.$langs->trans("RangeOfLoginValidity").''; print ''; if ($caneditfield) { - print $form->selectDate($datestartvalidity ? $datestartvalidity : $object->datestartvalidity, 'datestartvalidity', 0, 0, 1, 'formdatestartvalidity', 1, 1, 0, '', '', '', '', 1, '', ''); + print $form->selectDate($datestartvalidity ? $datestartvalidity : $object->datestartvalidity, 'datestartvalidity', 0, 0, 1, 'formdatestartvalidity', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from")); } else { print dol_print_date($object->datestartvalidity, 'day'); } - - /*if ($datestartvalidity && $dateendvalidity) { - print ' - '; - }*/ print '   '; if ($caneditfield) { - print $form->selectDate($dateendvalidity ? $datendevalidity : $object->dateendvalidity, 'dateendvalidity', 0, 0, 1, 'formdateendvalidity', 1, 0, 0, '', '', '', '', 1, '', ''); + print $form->selectDate($dateendvalidity ? $dateendvalidity : $object->dateendvalidity, 'dateendvalidity', 0, 0, 1, 'formdateendvalidity', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); } else { print dol_print_date($object->dateendvalidity, 'day'); } @@ -2859,7 +2855,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''.$langs->trans("DateEmployment").''; print ''; if ($caneditfield) { - print $form->selectDate($dateemployment ? $dateemployment : $object->dateemployment, 'dateemployment', 0, 0, 1, 'formdateemployment', 1, 1); + print $form->selectDate($dateemployment ? $dateemployment : $object->dateemployment, 'dateemployment', 0, 0, 1, 'formdateemployment', 1, 1, 0, '', '', '', '', 1, '', $langs->trans("from")); } else { print dol_print_date($object->dateemployment, 'day'); } @@ -2869,7 +2865,7 @@ if ($action == 'create' || $action == 'adduserldap') { } if ($caneditfield) { - print $form->selectDate($dateemploymentend ? $dateemploymentend : $object->dateemploymentend, 'dateemploymentend', 0, 0, 1, 'formdateemploymentend', 1, 0); + print $form->selectDate($dateemploymentend ? $dateemploymentend : $object->dateemploymentend, 'dateemploymentend', 0, 0, 1, 'formdateemploymentend', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); } else { print dol_print_date($object->dateemploymentend, 'day'); } From 3bcf6ee6554a106d8eb57c356482222146da25ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Jul 2023 00:39:22 +0200 Subject: [PATCH 0152/1137] CSS --- htdocs/user/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 924d69daeab..bdd2747933a 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -953,7 +953,7 @@ if ($action == 'create' || $action == 'adduserldap') { if (!empty($user->admin)) { print ''.$langs->trans("Administrator").''; print ''; - print $form->selectyesno('admin', GETPOST('admin'), 1); + print $form->selectyesno('admin', GETPOST('admin'), 1, false, 0, 1); if (isModEnabled('multicompany') && !$user->entity) { if (!empty($conf->use_javascript_ajax)) { @@ -2225,7 +2225,7 @@ if ($action == 'create' || $action == 'adduserldap') { || (isModEnabled('multicompany') && (($object->entity > 0 || ($user->entity == 0 && $object->entity == 0)) || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone ) ) { - print $form->selectyesno('admin', $object->admin, 1); + print $form->selectyesno('admin', $object->admin, 1, false, 0, 1); if (isModEnabled('multicompany') && !$user->entity) { if ($conf->use_javascript_ajax) { From ea8cc555d54a55a40ddb50c770f7d3f7c4a2061a Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Sun, 23 Jul 2023 19:38:57 +0200 Subject: [PATCH 0153/1137] Fix duplicated deletion of linked object in supplier invoice (#25415) --- htdocs/fourn/class/fournisseur.facture.class.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 96a7ceb2e95..6ac986093b7 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1512,14 +1512,6 @@ class FactureFournisseur extends CommonInvoice } } - if (!$error) { - // Delete linked object - $res = $this->deleteObjectLinked(); - if ($res < 0) { - $error++; - } - } - if (!$error) { // Delete record into ECM index (Note that delete is also done when deleting files with the dol_delete_dir_recursive $this->deleteEcmFiles(); From 1f6100d8973dfb6e325527619d7eb0c1572c143a Mon Sep 17 00:00:00 2001 From: mc2contributor Date: Sun, 23 Jul 2023 11:58:42 -0600 Subject: [PATCH 0154/1137] Fix undefined array key warnings on $this->datacolor[$i] (#25404) --- htdocs/core/class/dolgraph.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 5ae49ee1403..9094e4accda 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1441,11 +1441,14 @@ class DolGraph $color = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ', 0.9)'; $bordercolor = 'rgb(' . $newcolor[0] . ', ' . $newcolor[1] . ', ' . $newcolor[2] . ')'; } else { // We do not use a 'group by' - if (!empty($this->datacolor[$i]) && is_array($this->datacolor[$i])) { - $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ', 0.9)'; - } else { - $color = $this->datacolor[$i]; + if (!empty($this->datacolor[$i])) { + if (is_array($this->datacolor[$i])) { + $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ', 0.9)'; + } else { + $color = $this->datacolor[$i]; + } } + // else: $color will be undefined if (!empty($this->bordercolor[$i]) && is_array($this->bordercolor[$i])) { $bordercolor = 'rgb(' . $this->bordercolor[$i][0] . ', ' . $this->bordercolor[$i][1] . ', ' . $this->bordercolor[$i][2] . ', 0.9)'; } else { From 9119288795528952d688e1d26aafef443dc0dbae Mon Sep 17 00:00:00 2001 From: mc2contributor Date: Sun, 23 Jul 2023 12:00:58 -0600 Subject: [PATCH 0155/1137] Add missing argument (#25403) --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5b47c3d31b6..1c5332ac746 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9717,7 +9717,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, // No need to make a return $head. Var is modified as a reference if (!empty($hookmanager)) { $parameters = array('object' => $object, 'mode' => $mode, 'head' => &$head, 'filterorigmodule' => $filterorigmodule); - $reshook = $hookmanager->executeHooks('completeTabsHead', $parameters); + $reshook = $hookmanager->executeHooks('completeTabsHead', $parameters, $object); if ($reshook > 0) { // Hook ask to replace completely the array $head = $hookmanager->resArray; } else { // Hook From ac25be7c2678f87e8c886dca98f15f51c7cc555e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 23 Jul 2023 20:03:23 +0200 Subject: [PATCH 0156/1137] fix parenthesis (#25401) --- htdocs/comm/mailing/class/advtargetemailing.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 271f0d49ad3..e22fa89e6fc 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -575,7 +575,7 @@ class AdvanceTargetingMailing extends CommonObject if (!empty($arrayquery['cust_typecust']) && count($arrayquery['cust_typecust']) > 0) { $sqlwhere[] = " (t.client IN (".$this->db->sanitize(implode(',', $arrayquery['cust_typecust']))."))"; } - if (!empty($arrayquery['cust_comm_status']) && count($arrayquery['cust_comm_status'] > 0)) { + if (!empty($arrayquery['cust_comm_status']) && count($arrayquery['cust_comm_status']) > 0) { $sqlwhere[] = " (t.fk_stcomm IN (".$this->db->sanitize(implode(',', $arrayquery['cust_comm_status']))."))"; } if (!empty($arrayquery['cust_prospect_status']) && count($arrayquery['cust_prospect_status']) > 0) { @@ -816,7 +816,7 @@ class AdvanceTargetingMailing extends CommonObject if (!empty($arrayquery['cust_typecust']) && count($arrayquery['cust_typecust']) > 0) { $sqlwhere[] = " (ts.client IN (".$this->db->sanitize(implode(',', $arrayquery['cust_typecust']))."))"; } - if (!empty($arrayquery['cust_comm_status']) && count($arrayquery['cust_comm_status'] > 0)) { + if (!empty($arrayquery['cust_comm_status']) && count($arrayquery['cust_comm_status']) > 0) { $sqlwhere[] = " (ts.fk_stcomm IN (".$this->db->sanitize(implode(',', $arrayquery['cust_comm_status']))."))"; } if (!empty($arrayquery['cust_prospect_status']) && count($arrayquery['cust_prospect_status']) > 0) { From b7c87b6f70d548491f88ffb2b1ea26dd27f86164 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Sun, 23 Jul 2023 22:31:20 +0300 Subject: [PATCH 0157/1137] Disable standard invoice if "create credit note" button is pressed (#25414) --- htdocs/compta/facture/card.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5fb7442d379..6a3bb2476b5 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3552,9 +3552,15 @@ if ($action == 'create') { $tmp .= ' disabled'; } $tmp .= '> '; - // Show credit note options only if we checked credit note + // Show credit note options only if we checked credit note and disable standard invoice if "create credit note" button is pressed print ''; + + +// Part to create +if ($action == 'create') { + if (empty($permissiontoadd)) { + accessforbidden('NotEnoughPermissions', 0, 1); + } + + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Calendar")), '', 'object_'.$object->picto); + + print '
'; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + if ($backtopagejsfields) { + print ''; + } + if ($dol_openinpopup) { + print ''; + } + + print dol_get_fiche_head(array(), ''); + + // Set some default values + //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; + + 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 '
'; + + //dol_set_focus('input[name="ref"]'); +} + +// Part to edit record +if (($id || $ref) && $action == 'edit') { + print load_fiche_titre($langs->trans("Calendar"), '', 'object_'.$object->picto); + + print '
'; + print ''; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(); + + 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(); + + print '
'; +} + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $head = calendarPrepareHead($object); + + print dol_get_fiche_head($head, 'card', $langs->trans("Calendar"), -1, $object->picto, 0, '', '', 0, '', 1); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteCalendar'), $langs->trans('ConfirmDeleteObject'), '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); + } + + // 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('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } + + // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) + if ($action == 'xxx') { + $text = $langs->trans('ConfirmActionCalendar', $object->ref); + /*if (isModEnabled('notification')) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('MYOBJECT_CLOSE', $object->socid, $object); + }*/ + + $formquestion = array(); + + /* + $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), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); + */ + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $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; + } + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
'; + /* + // Ref customer + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); + // Thirdparty + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } + // Project + if (isModEnabled('project')) { + $langs->load("projects"); + $morehtmlref .= '
'; + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify') { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } + } + } + */ + $morehtmlref .= '
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + print ''."\n"; + + // Common attributes + //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field + //unset($object->fields['fk_project']); // Hide field already shown in banner + //unset($object->fields['fk_soc']); // Hide field already shown in banner + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + + // Other attributes. Fields from hook formObjectOptions and Extrafields. + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + + print '
'; + print '
'; + print '
'; + + print '
'; + + print dol_get_fiche_end(); + + + /* + * Lines + */ + + if (!empty($object->table_element_line)) { + // Show object lines + $result = $object->getLinesArray(); + + 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); + } + + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products/services form + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, $soc); + } + } + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } + print '
'; + + print "
\n"; + } + + + // Buttons for actions + + if ($action != 'presend' && $action != 'editline') { + print '
'."\n"; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + + if (empty($reshook)) { + // Send + if (empty($user->socid)) { + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); + } + + // Back to draft + if ($object->status == $object::STATUS_VALIDATED) { + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); + } + + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + + // Validate + if ($object->status == $object::STATUS_DRAFT) { + if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { + print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); + } else { + $langs->load("errors"); + print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); + } + } + + // Clone + if ($permissiontoadd) { + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); + } + + /* + if ($permissiontoadd) { + if ($object->status == $object::STATUS_ENABLED) { + print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd); + } else { + print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd); + } + } + if ($permissiontoadd) { + if ($object->status == $object::STATUS_VALIDATED) { + print dolGetButtonAction('', $langs->trans('Cancel'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); + } else { + print dolGetButtonAction('', $langs->trans('Re-Open'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd); + } + } + */ + + // Delete + $params = array(); + print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete, $params); + } + print '
'."\n"; + } + + + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + if ($action != 'presend') { + print '
'; + print ''; // ancre + + $includedocgeneration = 0; + + // Documents + if ($includedocgeneration) { + $objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref.'/'.$objref.'.pdf'; + $filedir = $conf->bookcal->dir_output.'/'.$object->element.'/'.$objref; + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed = $permissiontoread; // If you can read, you can build the PDF to read content + $delallowed = $permissiontoadd; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('bookcal:Calendar', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); + } + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('calendar')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
'; + + $MAXEVENT = 10; + + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/bookcal/calendar_agenda.php', 1).'?id='.$object->id); + + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); + + print '
'; + } + + //Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + // Presend form + $modelmail = 'calendar'; + $defaulttopic = 'InformationMessage'; + $diroutput = $conf->bookcal->dir_output; + $trackid = 'calendar'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/bookcal/calendar_contact.php b/htdocs/bookcal/calendar_contact.php new file mode 100644 index 00000000000..e1e45a0d8e5 --- /dev/null +++ b/htdocs/bookcal/calendar_contact.php @@ -0,0 +1,227 @@ + + * Copyright (C) 2023 Alice Adminson + * + * 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 calendar_contact.php + * \ingroup bookcal + * \brief Tab for contacts linked to Calendar + */ + +// Load Dolibarr environment +$res = 0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +} +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; +while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { + $i--; $j--; +} +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; +} +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; +} +// Try main.inc.php using relative path +if (!$res && file_exists("../main.inc.php")) { + $res = @include "../main.inc.php"; +} +if (!$res && file_exists("../../main.inc.php")) { + $res = @include "../../main.inc.php"; +} +if (!$res && file_exists("../../../main.inc.php")) { + $res = @include "../../../main.inc.php"; +} +if (!$res) { + die("Include of main fails"); +} + +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +dol_include_once('/bookcal/class/calendar.class.php'); +dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); + +$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); +$lineid = GETPOST('lineid', 'int'); +$socid = GETPOST('socid', 'int'); +$action = GETPOST('action', 'aZ09'); + +// Initialize technical objects +$object = new Calendar($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('calendarcontact', '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 + +// There is several ways to check permission. +// Set $enablepermissioncheck to 1 to enable a minimum low level of checks +$enablepermissioncheck = 0; +if ($enablepermissioncheck) { + $permissiontoread = $user->rights->bookcal->calendar->read; + $permission = $user->rights->bookcal->calendar->write; +} else { + $permissiontoread = 1; + $permission = 1; +} + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft); +if (!isModEnabled("bookcal")) { + accessforbidden(); +} +if (!$permissiontoread) accessforbidden(); + + +/* + * Add a new contact + */ + +if ($action == 'addcontact' && $permission) { + $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); + $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} elseif ($action == 'swapstatut' && $permission) { + // Toggle the status of a contact + $result = $object->swapContactStatus(GETPOST('ligne', 'int')); +} elseif ($action == 'deletecontact' && $permission) { + // Deletes a contact + $result = $object->delete_contact($lineid); + + if ($result >= 0) { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } else { + dol_print_error($db); + } +} + + +/* + * View + */ + +$title = $langs->trans('Calendar')." - ".$langs->trans('ContactsAddresses'); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +$form = new Form($db); +$formcompany = new FormCompany($db); +$contactstatic = new Contact($db); +$userstatic = new User($db); + + +/* *************************************************************************** */ +/* */ +/* View and edit mode */ +/* */ +/* *************************************************************************** */ + +if ($object->id) { + /* + * Show tabs + */ + $head = calendarPrepareHead($object); + + print dol_get_fiche_head($head, 'contact', $langs->trans("Calendar"), -1, $object->picto); + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
'; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (isModEnabled('project')) { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($permissiontoadd) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ': '.$proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + }*/ + $morehtmlref .= '
'; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); + + print dol_get_fiche_end(); + + print '
'; + + // Contacts lines (modules that overwrite templates must declare this into descriptor) + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl')); + foreach ($dirtpls as $reldir) { + $res = @include dol_buildpath($reldir.'/contacts.tpl.php'); + if ($res) { + break; + } + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/bookcal/calendar_document.php b/htdocs/bookcal/calendar_document.php new file mode 100644 index 00000000000..2936fa0e830 --- /dev/null +++ b/htdocs/bookcal/calendar_document.php @@ -0,0 +1,260 @@ + + * Copyright (C) 2023 Alice Adminson + * + * 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 calendar_document.php + * \ingroup bookcal + * \brief Tab for documents linked to Calendar + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("MAIN_SECURITY_FORCECSP")) define('MAIN_SECURITY_FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// Load Dolibarr environment +$res = 0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +} +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; +while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { + $i--; $j--; +} +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; +} +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; +} +// Try main.inc.php using relative path +if (!$res && file_exists("../main.inc.php")) { + $res = @include "../main.inc.php"; +} +if (!$res && file_exists("../../main.inc.php")) { + $res = @include "../../main.inc.php"; +} +if (!$res && file_exists("../../../main.inc.php")) { + $res = @include "../../../main.inc.php"; +} +if (!$res) { + die("Include of main fails"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +dol_include_once('/bookcal/class/calendar.class.php'); +dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); + + +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm'); +$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$ref = GETPOST('ref', 'alpha'); + +// Get parameters +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortorder) { + $sortorder = "ASC"; +} +if (!$sortfield) { + $sortfield = "name"; +} +//if (! $sortfield) $sortfield="position_name"; + +// Initialize technical objects +$object = new Calendar($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('calendardocument', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->bookcal->multidir_output[$object->entity ? $object->entity : $conf->entity]."/calendar/".get_exdir(0, 0, 0, 1, $object); +} + +// There is several ways to check permission. +// Set $enablepermissioncheck to 1 to enable a minimum low level of checks +$enablepermissioncheck = 0; +if ($enablepermissioncheck) { + $permissiontoread = $user->rights->bookcal->calendar->read; + $permissiontoadd = $user->rights->bookcal->calendar->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php +} else { + $permissiontoread = 1; + $permissiontoadd = 1; +} + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft); +if (!isModEnabled("bookcal")) { + accessforbidden(); +} +if (!$permissiontoread) { + accessforbidden(); +} +if (empty($object->id)) { + accessforbidden(); +} + + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; + + +/* + * View + */ + +$form = new Form($db); + +$title = $langs->trans("Calendar").' - '.$langs->trans("Files"); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +// Show tabs +$head = calendarPrepareHead($object); + +print dol_get_fiche_head($head, 'document', $langs->trans("Calendar"), -1, $object->picto); + + +// Build file list +$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); +$totalsize = 0; +foreach ($filearray as $key => $file) { + $totalsize += $file['size']; +} + +// Object card +// ------------------------------------------------------------ +$linkback = ''.$langs->trans("BackToList").''; + +$morehtmlref = '
'; +/* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (isModEnabled('project')) { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($permissiontoadd) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ': '.$proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + }*/ +$morehtmlref .= '
'; + +dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + +print '
'; + +print '
'; +print ''; + +// Number of files +print ''; + +// Total size +print ''; + +print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + +print '
'; + +print dol_get_fiche_end(); + +$modulepart = 'bookcal'; +//$permissiontoadd = $user->rights->bookcal->calendar->write; +$permissiontoadd = 1; +//$permtoedit = $user->rights->bookcal->calendar->write; +$permtoedit = 1; +$param = '&id='.$object->id; + +//$relativepathwithnofile='calendar/' . dol_sanitizeFileName($object->id).'/'; +$relativepathwithnofile = 'calendar/'.dol_sanitizeFileName($object->ref).'/'; + +include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php new file mode 100644 index 00000000000..38f866c1d4c --- /dev/null +++ b/htdocs/bookcal/calendar_list.php @@ -0,0 +1,866 @@ + + * Copyright (C) 2023 Alice Adminson + * + * 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 calendar_list.php + * \ingroup bookcal + * \brief List page for calendar + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("MAIN_SECURITY_FORCECSP")) define('MAIN_SECURITY_FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification +//if (! defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions + +// Load Dolibarr environment +$res = 0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +} +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; +while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { + $i--; + $j--; +} +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; +} +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; +} +// Try main.inc.php using relative path +if (!$res && file_exists("../main.inc.php")) { + $res = @include "../main.inc.php"; +} +if (!$res && file_exists("../../main.inc.php")) { + $res = @include "../../main.inc.php"; +} +if (!$res && file_exists("../../../main.inc.php")) { + $res = @include "../../../main.inc.php"; +} +if (!$res) { + die("Include of main fails"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// load module libraries +require_once __DIR__.'/class/calendar.class.php'; + +// for other modules +//dol_include_once('/othermodule/class/otherobject.class.php'); + +// Load translation files required by the page +$langs->loadLangs(array("bookcal@bookcal", "other")); + +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) + +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); + +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters + $page = 0; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + +// Initialize technical objects +$object = new Calendar($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); +//$extrafields->fetch_name_optionals_label($object->table_element_line); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Default sort order (if not yet defined by previous GETPOST) +if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. + $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. +} +if (!$sortorder) { + $sortorder = "ASC"; +} + +// Initialize array of search criterias +$search_all = GETPOST('search_all', 'alphanohtml'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha') !== '') { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } +} + +// List of fields to search into when doing a "search in all" +// $fieldstosearchall = array(); +// foreach ($object->fields as $key => $val) { +// if (!empty($val['searchall'])) { +// $fieldstosearchall['t.'.$key] = $val['label']; +// } +// } +// $parameters = array('fieldstosearchall'=>$fieldstosearchall); +// $reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +// if ($reshook > 0) { +// $fieldstosearchall = empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']; +// } elseif ($reshook == 0) { +// $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']); +// } + +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + +$object->fields = dol_sort_array($object->fields, 'position'); +//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); +$arrayfields = dol_sort_array($arrayfields, 'position'); + +// There is several ways to check permission. +// Set $enablepermissioncheck to 1 to enable a minimum low level of checks +$enablepermissioncheck = 0; +if ($enablepermissioncheck) { + $permissiontoread = $user->hasRight('bookcal', 'calendar', 'read'); + $permissiontoadd = $user->hasRight('bookcal', 'calendar', 'write'); + $permissiontodelete = $user->hasRight('bookcal', 'calendar', 'delete'); +} else { + $permissiontoread = 1; + $permissiontoadd = 1; + $permissiontodelete = 1; +} + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) accessforbidden(); +//$socid = 0; if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->module, 0, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft); +if (!isModEnabled("bookcal")) { + accessforbidden('Module bookcal not enabled'); +} +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; + $massaction = ''; +} +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { + $massaction = ''; +} + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + foreach ($object->fields as $key => $val) { + $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } + } + $toselect = array(); + $search_array_options = array(); + } + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { + $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass = 'Calendar'; + $objectlabel = 'Calendar'; + $uploaddir = $conf->bookcal->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + + // You can add more action here + // if ($action == 'xxx' && $permissiontoxxx) ... +} + + + +/* + * View + */ + +$form = new Form($db); + +$now = dol_now(); + +$title = $langs->trans("Calendars"); +//$help_url = "EN:Module_Calendar|FR:Module_Calendar_FR|ES:Módulo_Calendar"; +$help_url = ''; +$morejs = array(); +$morecss = array(); + + +// Build and execute select +// -------------------------------------------------------------------- +$sql = 'SELECT '; +$sql .= $object->getFieldList('t'); +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); + } +} +// Add fields from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); +//$sql .= ", COUNT(rc.rowid) as anotherfield"; + +$sqlfields = $sql; // $sql fields to remove for count total + +$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; +//$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."anothertable as rc ON rc.parent = t.rowid"; +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; +} +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +if ($object->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; +} else { + $sql .= " WHERE 1 = 1"; +} +foreach ($search as $key => $val) { + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + 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'])))) { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'"; + } + } + } + } +} +if ($search_all) { + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); +} +//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); +// Add where from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + +/* If a group by is required +$sql .= " GROUP BY "; +foreach($object->fields as $key => $val) { + $sql .= "t.".$db->escape($key).", "; +} +// Add fields from extrafields +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } +} +// Add groupby from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); +*/ + +// Add HAVING from hooks +/* +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; +*/ + +// Count total nb of records +$nbtotalofrecords = ''; +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 + $page = 0; + $offset = 0; + } + $db->free($resql); +} + +// Complete request and execute it with limit +$sql .= $db->order($sortfield, $sortorder); +if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); +} + +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + + +// Direct jump if only one record found +if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".dol_buildpath('/bookcal/calendar_card.php', 1).'?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll + +// Example : Adding jquery code +// print ''; + +$arrayofselected = is_array($toselect) ? $toselect : array(); + +$param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.((int) $limit); +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +foreach ($search as $key => $val) { + if (is_array($search[$key])) { + foreach ($search[$key] as $skey) { + if ($skey != '') { + $param .= '&search_'.$key.'[]='.urlencode($skey); + } + } + } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { + $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); + $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); + $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + } elseif ($search[$key] != '') { + $param .= '&search_'.$key.'='.urlencode($search[$key]); + } +} +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; + +// List of mass actions available +$arrayofmassactions = array( + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); +if (!empty($permissiontodelete)) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +print '
'."\n"; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + + +$newcardbutton = ''; +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitleSeparator(); +$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/bookcal/calendar_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); + +// Add code for pre mass action (confirmation or email presend form) +$topicmail = "SendCalendarRef"; +$modelmail = "calendar"; +$objecttmp = new Calendar($db); +$trackid = 'xxxx'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +if ($search_all) { + $setupstring = ''; + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); + $setupstring .= $key."=".$val.";"; + } + print ''."\n"; + print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'."\n"; +} + +$moreforfilter = ''; +/*$moreforfilter.='
'; +$moreforfilter.= $langs->trans('MyFilter') . ': '; +$moreforfilter.= '
';*/ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +if (!empty($moreforfilter)) { + print '
'; + print $moreforfilter; + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; +} + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; + +// Fields title search +// -------------------------------------------------------------------- +print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +foreach ($object->fields as $key => $val) { + $searchkey = empty($search[$key]) ? '' : $search[$key]; + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +/*if (!empty($arrayfields['anotherfield']['checked'])) { + print ''; +}*/ +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +print ''."\n"; + +$totalarray = array(); +$totalarray['nbfield'] = 0; + +// Fields title label +// -------------------------------------------------------------------- +print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} +foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label + if (!empty($arrayfields['t.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; + $totalarray['nbfield']++; + } +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +/*if (!empty($arrayfields['anotherfield']['checked'])) { + print ''; + $totalarray['nbfield']++; +}*/ +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} +print ''."\n"; + +// Detect if we need a fetch on each output line +$needToFetchEachLine = 0; +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (!is_null($val) && preg_match('/\$object/', $val)) { + $needToFetchEachLine++; // There is at least one compute field that use $object + } + } +} + + +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$savnbfield = $totalarray['nbfield']; +$totalarray = array(); +$totalarray['nbfield'] = 0; +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + $object->setVarsFromFetchObj($obj); + + if ($mode == 'kanban') { + if ($i == 0) { + print ''; + } + } else { + // Show line of result + $j = 0; + print ''; + + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } + + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; + } + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.'.$key]['checked'])) { + print '$key)) { + print ' title="'.dol_escape_htmltag($object->$key).'"'; + } + print '>'; + if ($key == 'status') { + print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); + } else { + print $object->showOutputField($val, $key, $object->$key, ''); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } + $totalarray['val']['t.'.$key] += $object->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + /*if (!empty($arrayfields['anotherfield']['checked'])) { + print ''; + }*/ + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + print ''."\n"; + } + + $i++; +} + +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; +} + + +$db->free($resql); + +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); +$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 ''; + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1); + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
'; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
'; + } elseif ($key == 'lang') { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; + $formadmin = new FormAdmin($db); + print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2); + } else { + print ''; + } + print '
'; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
'.$langs->trans("AnotherField").'
'; + print '
'; + } + // Output Kanban + $selected = -1; + 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 $object->getKanbanView('', array('selected' => $selected)); + if ($i == ($imaxinloop - 1)) { + print '
'; + print '
'; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''.$obj->anotherfield.''; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
'.$langs->trans("NoRecordFound").'
'."\n"; +print '
'."\n"; + +print '
'."\n"; + +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { + $hidegeneratedfilelistifempty = 1; + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; + } + + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new FormFile($db); + + // Show list of available documents + $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; + $urlsource .= str_replace('&', '&', $param); + + $filedir = $diroutputmassaction; + $genallowed = $permissiontoread; + $delallowed = $permissiontoadd; + + print $formfile->showdocuments('massfilesarea_'.$object->module, '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/bookcal/calendar_note.php b/htdocs/bookcal/calendar_note.php new file mode 100644 index 00000000000..325baaf954e --- /dev/null +++ b/htdocs/bookcal/calendar_note.php @@ -0,0 +1,220 @@ + + * Copyright (C) 2023 Alice Adminson + * + * 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 calendar_note.php + * \ingroup bookcal + * \brief Tab for notes on Calendar + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("MAIN_SECURITY_FORCECSP")) define('MAIN_SECURITY_FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + +// Load Dolibarr environment +$res = 0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +} +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; +while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { + $i--; $j--; +} +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; +} +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; +} +// Try main.inc.php using relative path +if (!$res && file_exists("../main.inc.php")) { + $res = @include "../main.inc.php"; +} +if (!$res && file_exists("../../main.inc.php")) { + $res = @include "../../main.inc.php"; +} +if (!$res && file_exists("../../../main.inc.php")) { + $res = @include "../../../main.inc.php"; +} +if (!$res) { + die("Include of main fails"); +} + +dol_include_once('/bookcal/class/calendar.class.php'); +dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("bookcal@bookcal", "companies")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); + +// Initialize technical objects +$object = new Calendar($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->bookcal->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('calendarnote', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->bookcal->multidir_output[empty($object->entity) ? $conf->entity : $object->entity]."/".$object->id; +} + + +// There is several ways to check permission. +// Set $enablepermissioncheck to 1 to enable a minimum low level of checks +$enablepermissioncheck = 0; +if ($enablepermissioncheck) { + $permissiontoread = $user->rights->bookcal->calendar->read; + $permissiontoadd = $user->rights->bookcal->calendar->write; + $permissionnote = $user->rights->bookcal->calendar->write; // Used by the include of actions_setnotes.inc.php +} else { + $permissiontoread = 1; + $permissiontoadd = 1; + $permissionnote = 1; +} + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft); +if (!isModEnabled("bookcal")) { + accessforbidden(); +} +if (!$permissiontoread) accessforbidden(); + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} + + +/* + * View + */ + +$form = new Form($db); + +//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +$help_url = ''; +$title = $langs->trans('Calendar').' - '.$langs->trans("Notes"); +llxHeader('', $title, $help_url); + +if ($id > 0 || !empty($ref)) { + $object->fetch_thirdparty(); + + $head = calendarPrepareHead($object); + + print dol_get_fiche_head($head, 'note', $langs->trans("Calendar"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
'; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); + // Project + if (isModEnabled('project')) { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($permissiontoadd) + { + if ($action != 'classify') + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.=' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ': '.$proj->getNomUrl(); + } else { + $morehtmlref .= ''; + } + } + }*/ + $morehtmlref .= '
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + + + $cssclass = "titlefield"; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + + print '
'; + + print dol_get_fiche_end(); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index c7e86a9f589..9251dd85eef 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -116,12 +116,13 @@ class Availabilities extends CommonObject 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'), 'validate'=>'1',), - 'start' => array('type'=>'date', 'label'=>'Start Date', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>1, 'searchall'=>1), - 'end' => array('type'=>'date', 'label'=>'End Date', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'searchall'=>1), + 'start' => array('type'=>'date', 'label'=>'Start Date', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>1, 'searchall'=>1,), + 'end' => array('type'=>'date', 'label'=>'End Date', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'searchall'=>1,), 'type' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>'1', 'position'=>49, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Customer', '1'=>'Supplier', '2'=>'Else'),), - 'duration' => array('type'=>'integer', 'label'=>'Duration', 'enabled'=>'1', 'position'=>47, 'notnull'=>1, 'visible'=>1, 'default'=>'30'), + 'duration' => array('type'=>'integer', 'label'=>'Duration', 'enabled'=>'1', 'position'=>47, 'notnull'=>1, 'visible'=>1, 'default'=>'30',), 'startHour' => array('type'=>'integer', 'label'=>'Start Hour', 'enabled'=>'1', 'position'=>46, 'notnull'=>1, 'visible'=>-1,), 'endHour' => array('type'=>'integer', 'label'=>'End Hour', 'enabled'=>'1', 'position'=>46.5, 'notnull'=>1, 'visible'=>-1,), + 'fk_bookcal_calendar' => array('type'=>'integer:Calendar:bookcal/class/calendar.class.php:1', 'label'=>'CalendarId', 'enabled'=>'1', 'position'=>48, 'notnull'=>1, 'visible'=>1,), ); public $rowid; public $ref; @@ -143,6 +144,7 @@ class Availabilities extends CommonObject public $duration; public $startHour; public $endHour; + public $fk_bookcal_calendar; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php new file mode 100644 index 00000000000..a7a589fb949 --- /dev/null +++ b/htdocs/bookcal/class/calendar.class.php @@ -0,0 +1,1159 @@ + + * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023 Alice Adminson + * + * 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 class/calendar.class.php + * \ingroup bookcal + * \brief This file is a CRUD class file for Calendar (Create/Read/Update/Delete) + */ + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; +//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + +/** + * Class for Calendar + */ +class Calendar extends CommonObject +{ + /** + * @var string ID of module. + */ + public $module = 'bookcal'; + + /** + * @var string ID to identify managed object. + */ + public $element = 'calendar'; + + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'bookcal_calendar'; + + /** + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged = 0; + + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + + /** + * @var string String with name of icon for calendar. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'calendar@bookcal' if picto is file 'img/object_calendar.png'. + */ + public $picto = 'fa-file'; + + + const STATUS_DRAFT = 0; + const STATUS_VALIDATED = 1; + const STATUS_CANCELED = 9; + + + /** + * 'type' field format: + * 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', + * 'select' (list of values are in 'options'), + * 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', + * 'chkbxlst:...', + * 'varchar(x)', + * 'text', 'text:none', 'html', + * 'double(24,8)', 'real', 'price', + * 'date', 'datetime', 'timestamp', 'duration', + * 'boolean', 'checkbox', 'radio', 'array', + * 'mail', 'phone', 'url', 'password', 'ip' + * Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt('MY_SETUP_PARAM') or 'isModEnabled("multicurrency")' ...) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0') + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' and 'helplist' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'validate' is 1 if need to validate with $this->validateField() + * 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value) + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'validate'=>'1', 'comment'=>"Reference of object"), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'alwayseditable'=>'1', 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'isModEnabled("societe")', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150', 'help'=>"OrganizationEventLinkToThirdParty", 'validate'=>'1',), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'isModEnabled("project")', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150', 'validate'=>'1',), + 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',), + 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0, 'cssview'=>'wordbreak', 'validate'=>'1',), + 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0, 'cssview'=>'wordbreak', 'validate'=>'1',), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), + 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'picto'=>'user', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax150',), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2, 'csslist'=>'tdoverflowmax150',), + 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), + 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validé', '9'=>'Annulé'), 'validate'=>'1',), + ); + public $rowid; + public $ref; + public $label; + public $fk_soc; + public $fk_project; + public $description; + public $note_public; + public $note_private; + public $date_creation; + public $tms; + public $fk_user_creat; + public $fk_user_modif; + public $import_key; + public $status; + // END MODULEBUILDER PROPERTIES + + + // If this object has a subtable with lines + + // /** + // * @var string Name of subtable line + // */ + // public $table_element_line = 'bookcal_calendarline'; + + // /** + // * @var string Field with ID of parent key if this object has a parent + // */ + // public $fk_element = 'fk_calendar'; + + // /** + // * @var string Name of subtable class that manage subtable lines + // */ + // public $class_element_line = 'Calendarline'; + + // /** + // * @var array List of child tables. To test if we can delete object. + // */ + // protected $childtables = array('mychildtable' => array('name'=>'Calendar', 'fk_element'=>'fk_calendar')); + + // /** + // * @var array List of child tables. To know object to delete on cascade. + // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will + // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object + // */ + // protected $childtablesoncascade = array('bookcal_calendardet'); + + // /** + // * @var CalendarLine[] Array of subtable lines + // */ + // public $lines = array(); + + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + + if (!getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) { + $this->fields['rowid']['visible'] = 0; + } + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { + $this->fields['entity']['enabled'] = 0; + } + + // Example to show how to set values of fields definition dynamically + /*if ($user->hasRight('bookcal', 'calendar', 'read')) { + $this->fields['myfield']['visible'] = 1; + $this->fields['myfield']['noteditable'] = 0; + }*/ + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) + { + $resultcreate = $this->createCommon($user, $notrigger); + + //$resultvalidate = $this->validate($user, $notrigger); + + return $resultcreate; + } + + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return mixed New object created, <0 if KO + */ + public function createFromClone(User $user, $fromid) + { + global $langs, $extrafields; + $error = 0; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $object = new self($this->db); + + $this->db->begin(); + + // Load source object + $result = $object->fetchCommon($fromid); + if ($result > 0 && !empty($object->table_element_line)) { + $object->fetchLines(); + } + + // get lines so they will be clone + //foreach($this->lines as $line) + // $line->fetch_optionals(); + + // Reset some properties + unset($object->id); + unset($object->fk_user_creat); + unset($object->import_key); + + // Clear fields + if (property_exists($object, 'ref')) { + $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; + } + if (property_exists($object, 'label')) { + $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; + } + if (property_exists($object, 'status')) { + $object->status = self::STATUS_DRAFT; + } + if (property_exists($object, 'date_creation')) { + $object->date_creation = dol_now(); + } + if (property_exists($object, 'date_modification')) { + $object->date_modification = null; + } + // ... + // Clear extrafields that are unique + if (is_array($object->array_options) && count($object->array_options) > 0) { + $extrafields->fetch_name_optionals_label($this->table_element); + foreach ($object->array_options as $key => $option) { + $shortkey = preg_replace('/options_/', '', $key); + if (!empty($extrafields->attributes[$this->table_element]['unique'][$shortkey])) { + //var_dump($key); + //var_dump($clonedObj->array_options[$key]); exit; + unset($object->array_options[$key]); + } + } + } + + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $result = $object->createCommon($user); + if ($result < 0) { + $error++; + $this->setErrorsFromObject($object); + } + + if (!$error) { + // copy internal contacts + if ($this->copy_linked_contact($object, 'internal') < 0) { + $error++; + } + } + + if (!$error) { + // copy external contacts if same company + if (!empty($object->socid) && property_exists($this, 'fk_soc') && $this->fk_soc == $object->socid) { + if ($this->copy_linked_contact($object, 'external') < 0) { + $error++; + } + } + } + + unset($object->context['createfromclone']); + + // End + if (!$error) { + $this->db->commit(); + return $object; + } else { + $this->db->rollback(); + return -1; + } + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null) + { + $result = $this->fetchCommon($id, $ref); + if ($result > 0 && !empty($this->table_element_line)) { + $this->fetchLines(); + } + return $result; + } + + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + $this->lines = array(); + + $result = $this->fetchLinesCommon(); + return $result; + } + + + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + { + global $conf; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $records = array(); + + $sql = "SELECT "; + $sql .= $this->getFieldList('t'); + $sql .= " FROM ".$this->db->prefix().$this->table_element." as t"; + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { + $sql .= " WHERE t.entity IN (".getEntity($this->element).")"; + } else { + $sql .= " WHERE 1 = 1"; + } + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 't.rowid') { + $sqlwhere[] = $key." = ".((int) $value); + } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; + } elseif ($key == 'customsql') { + $sqlwhere[] = $value; + } elseif (strpos($value, '%') === false) { + $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; + } else { + $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'"; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")"; + } + + if (!empty($sortfield)) { + $sql .= $this->db->order($sortfield, $sortorder); + } + if (!empty($limit)) { + $sql .= $this->db->plimit($limit, $offset); + } + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < ($limit ? min($limit, $num) : $num)) { + $obj = $this->db->fetch_object($resql); + + $record = new self($this->db); + $record->setVarsFromFetchObj($obj); + + $records[$record->id] = $record; + + $i++; + } + $this->db->free($resql); + + return $records; + } else { + $this->errors[] = 'Error '.$this->db->lasterror(); + dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); + + return -1; + } + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) + { + return $this->updateCommon($user, $notrigger); + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + return $this->deleteCommon($user, $notrigger); + //return $this->deleteCommon($user, $notrigger, 1); + } + + /** + * Delete a line of object in database + * + * @param User $user User that delete + * @param int $idline Id of line to delete + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int >0 if OK, <0 if KO + */ + public function deleteLine(User $user, $idline, $notrigger = false) + { + if ($this->status < 0) { + $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; + return -2; + } + + return $this->deleteLineCommon($user, $idline, $notrigger); + } + + + /** + * Validate object + * + * @param User $user User making status change + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int <=0 if OK, 0=Nothing done, >0 if KO + */ + public function validate($user, $notrigger = 0) + { + global $conf, $langs; + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $error = 0; + + // Protection + if ($this->status == self::STATUS_VALIDATED) { + dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); + return 0; + } + + /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->bookcal->calendar->write)) + || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->bookcal->calendar->calendar_advance->validate)))) + { + $this->error='NotEnoughPermissions'; + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); + return -1; + }*/ + + $now = dol_now(); + + $this->db->begin(); + + // Define new ref + if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life + $num = $this->getNextNumRef(); + } else { + $num = $this->ref; + } + $this->newref = $num; + + if (!empty($num)) { + // Validate + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; + $sql .= " SET ref = '".$this->db->escape($num)."',"; + $sql .= " status = ".self::STATUS_VALIDATED; + if (!empty($this->fields['date_validation'])) { + $sql .= ", date_validation = '".$this->db->idate($now)."'"; + } + if (!empty($this->fields['fk_user_valid'])) { + $sql .= ", fk_user_valid = ".((int) $user->id); + } + $sql .= " WHERE rowid = ".((int) $this->id); + + dol_syslog(get_class($this)."::validate()", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + dol_print_error($this->db); + $this->error = $this->db->lasterror(); + $error++; + } + + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('MYOBJECT_VALIDATE', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } + } + + if (!$error) { + $this->oldref = $this->ref; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) { + // Now we rename also files into index + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'calendar/".$this->db->escape($this->newref)."'"; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'calendar/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; + $resql = $this->db->query($sql); + if (!$resql) { + $error++; $this->error = $this->db->lasterror(); + } + + // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->bookcal->dir_output.'/calendar/'.$oldref; + $dirdest = $conf->bookcal->dir_output.'/calendar/'.$newref; + if (!$error && file_exists($dirsource)) { + dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles = dol_dir_list($conf->bookcal->dir_output.'/calendar/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach ($listoffiles as $fileentry) { + $dirsource = $fileentry['name']; + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource = $fileentry['path'].'/'.$dirsource; + $dirdest = $fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } + } + } + } + } + + // Set new ref and current status + if (!$error) { + $this->ref = $num; + $this->status = self::STATUS_VALIDATED; + } + + if (!$error) { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return -1; + } + } + + + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, >0 if OK + */ + public function setDraft($user, $notrigger = 0) + { + // Protection + if ($this->status <= self::STATUS_DRAFT) { + return 0; + } + + /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->bookcal->write)) + || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->bookcal->bookcal_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'MYOBJECT_UNVALIDATE'); + } + + /** + * Set cancel status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, 0=Nothing done, >0 if OK + */ + public function cancel($user, $notrigger = 0) + { + // Protection + if ($this->status != self::STATUS_VALIDATED) { + return 0; + } + + /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->bookcal->write)) + || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->bookcal->bookcal_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'MYOBJECT_CANCEL'); + } + + /** + * Set back to validated status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, 0=Nothing done, >0 if OK + */ + public function reopen($user, $notrigger = 0) + { + // Protection + if ($this->status == self::STATUS_VALIDATED) { + return 0; + } + + /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->bookcal->write)) + || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->bookcal->bookcal_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'MYOBJECT_REOPEN'); + } + + /** + * getTooltipContentArray + * + * @param array $params Params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + global $conf, $langs; + + $datas = []; + + if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) { + return ['optimize' => $langs->trans("ShowCalendar")]; + } + $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("Calendar").''; + if (isset($this->status)) { + $datas['picto'] .= ' '.$this->getLibStatut(5); + } + $datas['ref'] .= '
'.$langs->trans('Ref').': '.$this->ref; + + return $datas; + } + + /** + * Return a link to the object card (with optionaly the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + global $conf, $langs, $hookmanager; + + if (!empty($conf->dol_no_mouse_hover)) { + $notooltip = 1; // Force disable tooltips + } + + $result = ''; + $params = [ + 'id' => $this->id, + 'objecttype' => $this->element.($this->module ? '@'.$this->module : ''), + 'option' => $option, + ]; + $classfortooltip = 'classfortooltip'; + $dataparams = ''; + if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { + $classfortooltip = 'classforajaxtooltip'; + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); + } + + $url = dol_buildpath('/bookcal/calendar_card.php', 1).'?id='.$this->id; + + if ($option !== 'nolink') { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { + $add_save_lastsearch_values = 1; + } + if ($url && $add_save_lastsearch_values) { + $url .= '&save_lastsearch_values=1'; + } + } + + $linkclose = ''; + if (empty($notooltip)) { + if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) { + $label = $langs->trans("ShowCalendar"); + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; + } else { + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } + + if ($option == 'nolink' || empty($url)) { + $linkstart = ''; + if ($option == 'nolink' || empty($url)) { + $linkend = ''; + } else { + $linkend = ''; + } + + $result .= $linkstart; + + if (empty($this->showphoto_on_popup)) { + if ($withpicto) { + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), (($withpicto != 2) ? 'class="paddingright"' : ''), 0, 0, $notooltip ? 0 : 1); + } + } else { + if ($withpicto) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + list($class, $module) = explode('@', $this->picto); + $upload_dir = $conf->$module->multidir_output[$conf->entity]."/$class/".dol_sanitizeFileName($this->ref); + $filearray = dol_dir_list($upload_dir, "files"); + $filename = $filearray[0]['name']; + if (!empty($filename)) { + $pospoint = strpos($filearray[0]['name'], '.'); + + $pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint); + if (!getDolGlobalInt(strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS')) { + $result .= '
No photo
'; + } else { + $result .= '
No photo
'; + } + + $result .= ''; + } else { + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"'), 0, 0, $notooltip ? 0 : 1); + } + } + } + + if ($withpicto != 2) { + $result .= $this->ref; + } + + $result .= $linkend; + //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + + global $action, $hookmanager; + $hookmanager->initHooks(array($this->element.'dao')); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + + return $result; + } + + /** + * Return a thumb for kanban views + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array $arraydata Array of data + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '', $arraydata = null) + { + global $conf, $langs; + + $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); + + $return = '
'; + $return .= '
'; + $return .= ''; + $return .= img_picto('', $this->picto); + $return .= ''; + $return .= '
'; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; + if ($selected >= 0) { + $return .= ''; + } + if (property_exists($this, 'label')) { + $return .= '
'.$this->label.'
'; + } + if (property_exists($this, 'amount')) { + $return .= '
'; + $return .= ''.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).''; + } + if (method_exists($this, 'getLibStatut')) { + $return .= '
'.$this->getLibStatut(3).'
'; + } + $return .= '
'; + $return .= '
'; + $return .= '
'; + + return $return; + } + + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLabelStatus($mode = 0) + { + return $this->LibStatut($this->status, $mode); + } + + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + return $this->LibStatut($this->status, $mode); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the label of a given status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + // phpcs:enable + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { + global $langs; + //$langs->load("bookcal@bookcal"); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); + } + + $statusType = 'status'.$status; + //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; + if ($status == self::STATUS_CANCELED) { + $statusType = 'status6'; + } + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + } + + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + $sql = "SELECT rowid,"; + $sql .= " date_creation as datec, tms as datem,"; + $sql .= " fk_user_creat, fk_user_modif"; + $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; + $sql .= " WHERE t.rowid = ".((int) $id); + + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + + $this->id = $obj->rowid; + + $this->user_creation_id = $obj->fk_user_creat; + $this->user_modification_id = $obj->fk_user_modif; + if (!empty($obj->fk_user_valid)) { + $this->user_validation_id = $obj->fk_user_valid; + } + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); + if (!empty($obj->datev)) { + $this->date_validation = empty($obj->datev) ? '' : $this->db->jdate($obj->datev); + } + } + + $this->db->free($result); + } else { + dol_print_error($this->db); + } + } + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + public function initAsSpecimen() + { + // Set here init that are not commonf fields + // $this->property1 = ... + // $this->property2 = ... + + $this->initAsSpecimenCommon(); + } + + /** + * Create an array of lines + * + * @return array|int array of lines if OK, <0 if KO + */ + public function getLinesArray() + { + $this->lines = array(); + + $objectline = new CalendarLine($this->db); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_calendar = '.((int) $this->id))); + + if (is_numeric($result)) { + $this->setErrorsFromObject($objectline); + return $result; + } else { + $this->lines = $result; + return $this->lines; + } + } + + /** + * Returns the reference to the following non used object depending on the active numbering module. + * + * @return string Object free reference + */ + public function getNextNumRef() + { + global $langs, $conf; + $langs->load("bookcal@bookcal"); + + if (empty(getDolGlobalString('BOOKCAL_MYOBJECT_ADDON'))) { + $conf->global->BOOKCAL_MYOBJECT_ADDON = 'mod_calendar_standard'; + } + + if (!empty(getDolGlobalString('BOOKCAL_MYOBJECT_ADDON'))) { + $mybool = false; + + $file = getDolGlobalString('BOOKCAL_MYOBJECT_ADDON').".php"; + $classname = getDolGlobalString('BOOKCAL_MYOBJECT_ADDON'); + + // Include file with class + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) { + $dir = dol_buildpath($reldir."core/modules/bookcal/"); + + // Load file with numbering class (if found) + $mybool |= @include_once $dir.$file; + } + + if ($mybool === false) { + dol_print_error('', "Failed to include file ".$file); + return ''; + } + + if (class_exists($classname)) { + $obj = new $classname(); + $numref = $obj->getNextValue($this); + + if ($numref != '' && $numref != '-1') { + return $numref; + } else { + $this->error = $obj->error; + //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); + return ""; + } + } else { + print $langs->trans("Error")." ".$langs->trans("ClassNotFound").' '.$classname; + return ""; + } + } else { + print $langs->trans("ErrorNumberingModuleNotSetup", $this->element); + return ""; + } + } + + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs objet lang a utiliser pour traduction + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @param null|array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) + { + global $conf, $langs; + + $result = 0; + $includedocgeneration = 0; + + $langs->load("bookcal@bookcal"); + + if (!dol_strlen($modele)) { + $modele = 'standard_calendar'; + + if (!empty($this->model_pdf)) { + $modele = $this->model_pdf; + } elseif (getDolGlobalString('MYOBJECT_ADDON_PDF')) { + $modele = getDolGlobalString('MYOBJECT_ADDON_PDF'); + } + } + + $modelpath = "core/modules/bookcal/doc/"; + + if ($includedocgeneration && !empty($modele)) { + $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + } + + return $result; + } + + /** + * Action executed by scheduler + * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' + * Use public function doScheduledJob($param1, $param2, ...) to get parameters + * + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function doScheduledJob() + { + //global $conf, $langs; + + //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; + + $error = 0; + $this->output = ''; + $this->error = ''; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $now = dol_now(); + + $this->db->begin(); + + // ... + + $this->db->commit(); + + return $error; + } +} + + +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; + +/** + * Class CalendarLine. You can also remove this and generate a CRUD class for lines objects. + */ +class CalendarLine extends CommonObjectLine +{ + // To complete with content of an object CalendarLine + // We should have a field rowid, fk_calendar and position + + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 0; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + $this->db = $db; + } +} diff --git a/htdocs/bookcal/lib/bookcal_calendar.lib.php b/htdocs/bookcal/lib/bookcal_calendar.lib.php new file mode 100644 index 00000000000..833d33bc98e --- /dev/null +++ b/htdocs/bookcal/lib/bookcal_calendar.lib.php @@ -0,0 +1,110 @@ + + * + * 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 lib/bookcal_calendar.lib.php + * \ingroup bookcal + * \brief Library files with common functions for Calendar + */ + +/** + * Prepare array of tabs for Calendar + * + * @param Calendar $object Calendar + * @return array Array of tabs + */ +function calendarPrepareHead($object) +{ + global $db, $langs, $conf; + + $langs->load("bookcal@bookcal"); + + $showtabofpagecontact = 1; + $showtabofpagenote = 1; + $showtabofpagedocument = 1; + $showtabofpageagenda = 1; + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/bookcal/calendar_card.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + if ($showtabofpagecontact) { + $head[$h][0] = dol_buildpath("/bookcal/calendar_contact.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Contacts"); + $head[$h][2] = 'contact'; + $h++; + } + + if ($showtabofpagenote) { + if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = dol_buildpath('/bookcal/calendar_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? ''.$nbNote.'' : ''); + } + $head[$h][2] = 'note'; + $h++; + } + } + + if ($showtabofpagedocument) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->bookcal->dir_output."/calendar/".dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); + $nbLinks = Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/bookcal/calendar_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles + $nbLinks) > 0) { + $head[$h][1] .= ''.($nbFiles + $nbLinks).''; + } + $head[$h][2] = 'document'; + $h++; + } + + if ($showtabofpageagenda) { + $head[$h][0] = dol_buildpath("/bookcal/calendar_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + } + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@bookcal:/bookcal/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@bookcal:/bookcal/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'calendar@bookcal'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'calendar@bookcal', 'remove'); + + return $head; +} diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index 935293fedc4..c7253d7f7f6 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -259,21 +259,37 @@ class modBookCal extends DolibarrModules $r = 0; // Add here entries to declare new permissions /* BEGIN MODULEBUILDER PERMISSIONS */ - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) - $this->rights[$r][1] = 'Read objects of BookCal'; // Permission label + $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 0 + 1); + $this->rights[$r][1] = 'Read objects of BookCal'; $this->rights[$r][4] = 'availabilities'; - $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->bookcal->availabilities->read) + $this->rights[$r][5] = 'read'; $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/Update objects of BookCal'; // Permission label + $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 1 + 1); + $this->rights[$r][1] = 'Create/Update objects of BookCal'; $this->rights[$r][4] = 'availabilities'; - $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->bookcal->availabilities->write) + $this->rights[$r][5] = 'write'; $r++; - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) - $this->rights[$r][1] = 'Delete objects of BookCal'; // Permission label + $this->rights[$r][0] = $this->numero . sprintf('%02d', (0 * 10) + 2 + 1); + $this->rights[$r][1] = 'Delete objects of BookCal'; $this->rights[$r][4] = 'availabilities'; - $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->bookcal->availabilities->delete) + $this->rights[$r][5] = 'delete'; $r++; + $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 0 + 1); + $this->rights[$r][1] = 'Read Calendar object of BookCal'; + $this->rights[$r][4] = 'calendar'; + $this->rights[$r][5] = 'read'; + $r++; + $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 1 + 1); + $this->rights[$r][1] = 'Create/Update Calendar object of BookCal'; + $this->rights[$r][4] = 'calendar'; + $this->rights[$r][5] = 'write'; + $r++; + $this->rights[$r][0] = $this->numero . sprintf('%02d', (1 * 10) + 2 + 1); + $this->rights[$r][1] = 'Delete Calendar object of BookCal'; + $this->rights[$r][4] = 'calendar'; + $this->rights[$r][5] = 'delete'; + $r++; + /* END MODULEBUILDER PERMISSIONS */ // Main menu entries to add diff --git a/htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal.key.sql b/htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal.key.sql index 3850933f5df..95a0ae1a4a4 100644 --- a/htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal.key.sql +++ b/htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal.key.sql @@ -20,6 +20,8 @@ ALTER TABLE llx_bookcal_availabilities ADD INDEX idx_bookcal_availabilities_ref ALTER TABLE llx_bookcal_availabilities ADD CONSTRAINT llx_bookcal_availabilities_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); ALTER TABLE llx_bookcal_availabilities ADD INDEX idx_bookcal_availabilities_status (status); ALTER TABLE llx_bookcal_availabilities ADD INDEX idx_bookcal_availabilities_type (type); +ALTER TABLE llx_bookcal_availabilities ADD CONSTRAINT llx_bookcal_availabilities_fk_bookcal_calendar FOREIGN KEY (fk_bookcal_calendar) REFERENCES llx_bookcal_calendar(rowid); + -- END MODULEBUILDER INDEXES --ALTER TABLE llx_bookcal_availabilities ADD UNIQUE INDEX uk_bookcal_availabilities_fieldxy(fieldx, fieldy); diff --git a/htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal.sql b/htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal.sql index 8c8625e10cb..786665a2545 100644 --- a/htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal.sql +++ b/htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal.sql @@ -35,7 +35,8 @@ CREATE TABLE llx_bookcal_availabilities( type integer NOT NULL, duration integer DEFAULT 30 NOT NULL, startHour integer NOT NULL, - endHour integer NOT NULL + endHour integer NOT NULL, + fk_bookcal_calendar integer NOT NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_bookcal_calendar-bookcal.key.sql b/htdocs/install/mysql/tables/llx_bookcal_calendar-bookcal.key.sql new file mode 100644 index 00000000000..459f00aab2f --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bookcal_calendar-bookcal.key.sql @@ -0,0 +1,29 @@ +-- Copyright (C) 2023 Alice Adminson +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_bookcal_calendar ADD INDEX idx_bookcal_calendar_rowid (rowid); +ALTER TABLE llx_bookcal_calendar ADD INDEX idx_bookcal_calendar_ref (ref); +ALTER TABLE llx_bookcal_calendar ADD INDEX idx_bookcal_calendar_fk_soc (fk_soc); +ALTER TABLE llx_bookcal_calendar ADD INDEX idx_bookcal_calendar_fk_project (fk_project); +ALTER TABLE llx_bookcal_calendar ADD CONSTRAINT llx_bookcal_calendar_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_bookcal_calendar ADD INDEX idx_bookcal_calendar_status (status); +-- END MODULEBUILDER INDEXES + +--ALTER TABLE llx_bookcal_calendar ADD UNIQUE INDEX uk_bookcal_calendar_fieldxy(fieldx, fieldy); + +--ALTER TABLE llx_bookcal_calendar ADD CONSTRAINT llx_bookcal_calendar_fk_field FOREIGN KEY (fk_field) REFERENCES llx_bookcal_myotherobject(rowid); + diff --git a/htdocs/install/mysql/tables/llx_bookcal_calendar-bookcal.sql b/htdocs/install/mysql/tables/llx_bookcal_calendar-bookcal.sql new file mode 100644 index 00000000000..061d3dbe01a --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bookcal_calendar-bookcal.sql @@ -0,0 +1,34 @@ +-- Copyright (C) 2023 Alice Adminson +-- +-- 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 https://www.gnu.org/licenses/. + + +CREATE TABLE llx_bookcal_calendar( + -- BEGIN MODULEBUILDER FIELDS + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref varchar(128) NOT NULL, + label varchar(255), + fk_soc integer, + fk_project integer, + description text, + note_public text, + note_private text, + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), + status integer NOT NULL + -- END MODULEBUILDER FIELDS +) ENGINE=innodb; diff --git a/htdocs/langs/en_US/bookcal.lang b/htdocs/langs/en_US/bookcal.lang new file mode 100644 index 00000000000..14c2bbce328 --- /dev/null +++ b/htdocs/langs/en_US/bookcal.lang @@ -0,0 +1,54 @@ +# Copyright (C) ---Put here your own copyright and developer email--- +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# Generic +# + +# Module label 'ModuleBookCalName' +ModuleBookCalName = Booking Calendar System +# Module description 'ModuleBookCalDesc' +ModuleBookCalDesc = Manage a Calendar to book appointments + +# +# Admin page +# +BookCalSetup = BookCal setup +Settings = Settings +BookCalSetupPage = BookCal setup page +BOOKCAL_MYPARAM1 = My param 1 +BOOKCAL_MYPARAM1Tooltip = My param 1 tooltip +BOOKCAL_MYPARAM2=My param 2 +BOOKCAL_MYPARAM2Tooltip=My param 2 tooltip + + +# +# About page +# +About = About +BookCalAbout = About BookCal +BookCalAboutPage = BookCal about page + +# +# Sample page +# +BookCalArea = Home BookCal +MyPageName = My page name + +# +# Sample widget +# +MyWidget = My widget +MyWidgetDescription = My widget description From ffa2f40a41979dc856a699c1afa20c0bfbb5e5fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Jul 2023 23:47:01 +0200 Subject: [PATCH 0185/1137] Fix for sql int comparison on rowid --- htdocs/core/class/commonobject.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 00b0e682636..2e13e950277 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2091,7 +2091,11 @@ abstract class CommonObject if ($restrictiononfksoc && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".$this->db->prefix()."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc"; } - $sql .= " WHERE te.".$fieldid." < '".$this->db->escape($fieldid == 'rowid' ? $this->id : $this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) + if ($fieldid == 'rowid') { + $sql .= " WHERE te.".$fieldid." < ".((int) $this->id); + } else { + $sql .= " WHERE te.".$fieldid." < '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) + } if ($restrictiononfksoc == 1 && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } @@ -2161,7 +2165,11 @@ abstract class CommonObject if ($restrictiononfksoc && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".$this->db->prefix()."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc"; } - $sql .= " WHERE te.".$fieldid." > '".$this->db->escape($fieldid == 'rowid' ? $this->id : $this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) + if ($fieldid == 'rowid') { + $sql .= " WHERE te.".$fieldid." > ".((int) $this->id); + } else { + $sql .= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) + } if ($restrictiononfksoc == 1 && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND sc.fk_user = ".((int) $user->id); } From 234a9cb1a63a8db63b1510c77543c565ad1dda96 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 23 Jul 2023 23:51:11 +0200 Subject: [PATCH 0186/1137] Update box_graph_nb_tickets_type.php (#25430) --- htdocs/core/boxes/box_graph_nb_tickets_type.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index 6b25f5d84d0..1b2aaeca0d9 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -26,13 +26,13 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** - * Class to manage the box + * Class to manage the box to show number of ticket types */ class box_graph_nb_tickets_type extends ModeleBoxes { public $boxcode = "box_graph_nb_tickets_type"; - public $boximg = "ticket"; + public $boximg = "ticket"; public $boxlabel; public $depends = array("ticket"); From 3eac209f6872d2715025d3cc0afda9c9f103c013 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 23 Jul 2023 23:51:23 +0200 Subject: [PATCH 0187/1137] Update box_supplier_orders_awaiting_reception.php (#25434) --- .../boxes/box_supplier_orders_awaiting_reception.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index ce0161582de..a87d2984c72 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -19,22 +19,22 @@ */ /** - * \file htdocs/core/boxes/box_supplier_orders.php + * \file htdocs/core/boxes/box_supplier_orders_awaiting_reception.php * \ingroup fournisseurs * \brief Module that generates the latest supplier orders box */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class that manages the box showing latest supplier orders + * Class to manage the box to show last supplier orders awaiting reception */ class box_supplier_orders_awaiting_reception extends ModeleBoxes { - public $boxcode = "supplierordersawaitingreception"; - public $boximg = "object_order"; + public $boxcode = "supplierordersawaitingreception"; + public $boximg = "object_order"; public $boxlabel = "BoxLatestSupplierOrdersAwaitingReception"; - public $depends = array("fournisseur"); + public $depends = array("fournisseur"); /** * @var DoliDB Database handler. From 6d77cb4511afffe248ed0350047d5862254263a4 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 23 Jul 2023 23:51:41 +0200 Subject: [PATCH 0188/1137] Update box_members_by_tags.php (#25432) --- htdocs/core/boxes/box_members_by_tags.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php index efee61607ba..59faf193ddf 100644 --- a/htdocs/core/boxes/box_members_by_tags.php +++ b/htdocs/core/boxes/box_members_by_tags.php @@ -22,21 +22,21 @@ /** * \file htdocs/core/boxes/box_members_by_tags.php * \ingroup adherent - * \brief Module to show box of members + * \brief Module to show box of members by tags */ include_once DOL_DOCUMENT_ROOT . '/core/boxes/modules_boxes.php'; /** - * Class to manage the box to show last modofied members + * Class to manage the box to show (last modified) members by tags */ class box_members_by_tags extends ModeleBoxes { - public $boxcode = "box_members_by_tags"; - public $boximg = "object_user"; + public $boxcode = "box_members_by_tags"; + public $boximg = "object_user"; public $boxlabel = "BoxTitleMembersByTags"; - public $depends = array("adherent", "categorie"); + public $depends = array("adherent", "categorie"); /** * @var DoliDB Database handler. From f75024e5b836fdc2d04807ca080e131af35a4ffc Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 23 Jul 2023 23:51:51 +0200 Subject: [PATCH 0189/1137] Update box_mos.php (#25431) --- htdocs/core/boxes/box_mos.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 812fcab7b64..a01a68bd02b 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -28,14 +28,14 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class to manage the box to show last orders + * Class to manage the box to show last manufacturing orders (MO) */ class box_mos extends ModeleBoxes { - public $boxcode = "lastmos"; - public $boximg = "object_mrp"; - public $boxlabel = "BoxTitleLatestModifiedMos"; - public $depends = array("mrp"); + public $boxcode = "lastmos"; + public $boximg = "object_mrp"; + public $boxlabel = "BoxTitleLatestModifiedMOs"; + public $depends = array("mrp"); /** * @var DoliDB Database handler. From bc23f3c5922566e28c70fb767b627c53b14ec09b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Sun, 23 Jul 2023 23:52:09 +0200 Subject: [PATCH 0190/1137] Update box_members_last_subscriptions.php (#25433) --- htdocs/core/boxes/box_members_last_subscriptions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 324d0df218d..829edf4ceab 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -21,21 +21,21 @@ /** * \file htdocs/core/boxes/box_members_last_subscriptions.php * \ingroup adherent - * \brief Module to show box of members + * \brief Module to show box of last members subscriptions */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class to manage the box to show last modofied members + * Class to manage the box to show last members subscriptions */ class box_members_last_subscriptions extends ModeleBoxes { - public $boxcode = "box_members_last_subscriptions"; - public $boximg = "object_user"; + public $boxcode = "box_members_last_subscriptions"; + public $boximg = "object_user"; public $boxlabel = "BoxLastMembersSubscriptions"; - public $depends = array("adherent"); + public $depends = array("adherent"); /** * @var DoliDB Database handler. From 7dfc5f8375ccef9eb65b469ab5d1fec4de23f23f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:44:43 +0200 Subject: [PATCH 0191/1137] Update mo_card.php (#25455) if (isModEnabled('workstation')) { require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; } --- htdocs/mrp/mo_card.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 52f93870619..8a2ebee5e63 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -34,6 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; +if (isModEnabled('workstation')) { + require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; +} + // Load translation files required by the page $langs->loadLangs(array('mrp', 'other')); From 4e9da73eab4120742b561b8d2f39f462dc44c172 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:45:39 +0200 Subject: [PATCH 0192/1137] Update bom.class.php (#25457) --- htdocs/bom/class/bom.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 866c8be0857..02207be5265 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -25,9 +25,13 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -require_once DOL_DOCUMENT_ROOT."/core/class/commonobjectline.class.php"; -require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + +if (isModEnabled('workstation')) { + 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'; From b1befd8bd7aa562ccd304555e7b022a50a4460a0 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:45:56 +0200 Subject: [PATCH 0193/1137] Update mod_project_universal.php (#25462) --- .../modules/project/mod_project_universal.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index 93530cc793c..61b6962cefc 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -17,16 +17,16 @@ */ /** - * \file htdocs/core/modules/project/mod_project_universal.php - * \ingroup project - * \brief Fichier contenant la classe du modele de numerotation de reference de projet Universal + * \file htdocs/core/modules/project/mod_project_universal.php + * \ingroup project + * \brief File containing the Universal project reference numbering model class */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; /** - * Classe du modele de numerotation de reference de projet Universal + * Class to manage the numbering module Universal for project references */ class mod_project_universal extends ModeleNumRefProjects { @@ -86,7 +86,7 @@ class mod_project_universal extends ModeleNumRefProjects $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Project"), $langs->transnoentities("Project")); $tooltip .= $langs->trans("GenericMaskCodes5"); - // Parametrage du prefix + // Prefix settings $texte .= ''.$langs->trans("Mask").':'; $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; @@ -123,9 +123,9 @@ class mod_project_universal extends ModeleNumRefProjects /** * Return next value * - * @param Societe $objsoc Object third party + * @param Societe $objsoc Object third party * @param Project $project Object project - * @return string Value if OK, 0 if KO + * @return string Value if OK, 0 if KO */ public function getNextValue($objsoc, $project) { @@ -133,7 +133,7 @@ class mod_project_universal extends ModeleNumRefProjects require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - // On defini critere recherche compteur + // We define criterion search counter $mask = getDolGlobalString('PROJECT_UNIVERSAL_MASK'); if (!$mask) { From c7729b22c37c6f453be4dbe7041d2ddbffc7d7c3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:46:07 +0200 Subject: [PATCH 0194/1137] Update mod_ticket_universal.php (#25463) translations --- .../modules/ticket/mod_ticket_universal.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 8cd2cd6f614..42598771b2d 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -19,36 +19,36 @@ /** * \file htdocs/core/modules/ticket/mod_ticket_universal.php * \ingroup ticket - * \brief Fichier contenant la classe du modele de numerotation de reference de projet Universal + * \brief File with class to manage the numbering module Universal for Ticket references */ require_once DOL_DOCUMENT_ROOT.'/core/modules/ticket/modules_ticket.php'; /** - * Classe du modele de numerotation de reference de projet Universal + * Class to manage the numbering module Universal for Ticket references */ class mod_ticket_universal extends ModeleNumRefTicket { /** - * Dolibarr version of the loaded document - * @var string + * Dolibarr version of the loaded document + * @var string */ - public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' /** - * @var string Error code (or message) + * @var string Error code (or message) */ public $error = ''; /** - * @var string Nom du modele - * @deprecated - * @see $name + * @var string Nom du modele + * @deprecated + * @see $name */ public $nom = 'Universal'; /** - * @var string model name + * @var string model name */ public $name = 'Universal'; @@ -79,7 +79,7 @@ class mod_ticket_universal extends ModeleNumRefTicket $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Ticket"), $langs->transnoentities("Ticket")); $tooltip .= $langs->trans("GenericMaskCodes5"); - // Parametrage du prefix + // Prefix settings $texte .= ''.$langs->trans("Mask").':'; $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; @@ -126,7 +126,7 @@ class mod_ticket_universal extends ModeleNumRefTicket include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - // On defini critere recherche compteur + // We define criterion search counter $mask = getDolGlobalString("TICKET_UNIVERSAL_MASK"); if (!$mask) { From e897037a5dba5e68e4938448317f50f9244dc290 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:46:36 +0200 Subject: [PATCH 0195/1137] Update mo_movements.php (#25456) --- htdocs/mrp/mo_movements.php | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index ea378e30fdb..de925fd743f 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -17,9 +17,9 @@ */ /** - * \file mo_movements.php - * \ingroup mrp - * \brief Page to show tock movements of a MO + * \file mo_movements.php + * \ingroup mrp + * \brief Page to show stock movements of a MO */ // Load Dolibarr environment @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; + dol_include_once('/mrp/class/mo.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); @@ -39,20 +40,21 @@ dol_include_once('/mrp/lib/mrp_mo.lib.php'); $langs->loadLangs(array("mrp", "stocks", "other")); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm', 'alpha'); -$cancel = GETPOST('cancel', 'aZ09'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mostockmovement'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$massaction = GETPOST('massaction', 'aZ09'); -$lineid = GETPOST('lineid', 'int'); +$backtopage = GETPOST('backtopage', 'alpha'); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$massaction = GETPOST('massaction', 'aZ09'); +$lineid = GETPOST('lineid', 'int'); -$msid = GETPOST('msid', 'int'); -$year = GETPOST("year", 'int'); +$msid = GETPOST('msid', 'int'); +$year = GETPOST("year", 'int'); $month = GETPOST("month", 'int'); + $search_ref = GETPOST('search_ref', 'alpha'); $search_movement = GETPOST("search_movement", 'alpha'); $search_product_ref = trim(GETPOST("search_product_ref", 'alpha')); @@ -65,7 +67,7 @@ $search_qty = trim(GETPOST("search_qty", 'alpha')); $search_type_mouvement = GETPOST('search_type_mouvement', 'int'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); if (empty($page) || $page == -1) { @@ -144,6 +146,7 @@ if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) { $objectlist->fields = dol_sort_array($objectlist->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Permissions $permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->mrp->write; // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->rights->mrp->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php From c643f3c712053907ddcbd26e0ccdd8fd3c89f6ed Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:46:47 +0200 Subject: [PATCH 0196/1137] Update mo_production.php (#25451) --- htdocs/mrp/mo_production.php | 38 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index a7b021c9d00..f3a86e4ad35 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -18,9 +18,9 @@ */ /** - * \file mo_production.php - * \ingroup mrp - * \brief Page to make production on a MO + * \file mo_production.php + * \ingroup mrp + * \brief Page to make production on a MO */ // Load Dolibarr environment @@ -35,23 +35,24 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; -dol_include_once('/mrp/class/mo.class.php'); + dol_include_once('/bom/class/bom.class.php'); +dol_include_once('/mrp/class/mo.class.php'); dol_include_once('/mrp/lib/mrp_mo.lib.php'); // Load translation files required by the page $langs->loadLangs(array("mrp", "stocks", "other", "product", "productbatch")); // Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm', 'alpha'); -$cancel = GETPOST('cancel', 'aZ09'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$fk_movement = GETPOST('fk_movement', 'int'); +$backtopage = GETPOST('backtopage', 'alpha'); +$lineid = GETPOST('lineid', 'int'); +$fk_movement = GETPOST('fk_movement', 'int'); $fk_default_warehouse = GETPOST('fk_default_warehouse', 'int'); $collapse = GETPOST('collapse', 'aZ09comma'); @@ -60,6 +61,7 @@ $collapse = GETPOST('collapse', 'aZ09comma'); $object = new Mo($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id; + $hookmanager->initHooks(array('mocard', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels @@ -89,15 +91,17 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'rowid', $isdraft); +// Permissions $permissionnote = $user->rights->mrp->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->mrp->write; // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->rights->mrp->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); -$upload_dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->entity : 1]; $permissiontoproduce = $permissiontoadd; $permissiontoupdatecost = $user->hasRight('bom', 'read'); // User who can define cost must have knowledge of pricing +$upload_dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->entity : 1]; + /* * Actions @@ -539,10 +543,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - /* + + /* // Ref bis $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1);*/ + $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1); + */ + // Thirdparty if (is_object($object->thirdparty)) { $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); @@ -550,6 +557,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } } + // Project if (isModEnabled('project')) { $langs->load("projects"); From 6a79459deb384e5693bcf5335f03fc8a76aa4300 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Jul 2023 19:00:56 +0200 Subject: [PATCH 0197/1137] Fix phpcs --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 4 ++-- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1c5332ac746..614fdfa366a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10784,7 +10784,7 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi $resql = $db->query($sql); if ($resql) { while ($obj = $db->fetch_object($resql)) { - $dictvalues[$obj->{$rowidfield}] = $obj; // $obj is stdClass + $dictvalues[$obj->$rowidfield] = $obj; // $obj is stdClass } } else { dol_print_error($db); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 6454c9b1da2..57a9e81ddef 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1523,12 +1523,12 @@ class pdf_cyan extends ModelePDFPropales // Output Rect $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter - + if (!empty($conf->global->MAIN_PDF_TITLE_TEXT_COLOR)) { $arrayColorTextTitle = explode(',', $conf->global->MAIN_PDF_TITLE_TEXT_COLOR); $pdf->SetTextColor($arrayColorTextTitle[0], $arrayColorTextTitle[1], $arrayColorTextTitle[2]); } - + $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); if (!empty($conf->global->MAIN_PDF_TITLE_TEXT_COLOR)) { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 02f30356cf8..0f6d52638cb 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -3390,7 +3390,7 @@ class EmailCollector extends CommonObject $attachments[$filename] = $data; // this is a problem if two files have same name if (strlen($destdir)) { - if (substr($destdir,-1) != '/') $destdir .= '/'; + if (substr($destdir, -1) != '/') $destdir .= '/'; // Get file name (with extension) $file_name_complete = $params['filename']; From dcc01599d4b12682aecd1fa2a49ec4fafbaf6772 Mon Sep 17 00:00:00 2001 From: Oussama <36703787+FliyFly@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:03:54 +0200 Subject: [PATCH 0198/1137] New|NEW(#24834) new option for hide the footer (#25464) * New|NEW new option for hide the footer of tickets on the public interface * fix condition in index --------- Co-authored-by: FLIO --- htdocs/admin/ticket_public.php | 15 +++++++++++++++ htdocs/core/modules/modTicket.class.php | 3 ++- htdocs/langs/en_US/ticket.lang | 2 ++ htdocs/langs/fr_FR/ticket.lang | 2 ++ htdocs/public/ticket/index.php | 6 ++++-- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 2bd16271650..f642c261c52 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -379,6 +379,21 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''; print ''; + // show footer for company + print ''.$langs->trans("TicketsShowCompanyFooter").''; + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_SHOW_COMPANY_FOOTER'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKET_SHOW_COMPANY_FOOTER", $arrval, $conf->global->TICKET_SHOW_COMPANY_FOOTER); + } + print ''; + print ''; + print $form->textwithpicto('', $langs->trans("TicketsShowCompanyFooterHelp"), 1, 'help'); + print ''; + print ''; + // Show progression print ''.$langs->trans("TicketsShowProgression").''; print ''; diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index a165a4acd2e..097c46186f0 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -119,7 +119,8 @@ class modTicket extends DolibarrModules 11 => array('TICKET_MESSAGE_MAIL_SIGNATURE', 'chaine', $default_footer, 'Signature to use by default for messages sent from Dolibarr', 0), 12 => array('MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER', 'chaine', "1", 'Disable the rendering of headers in tickets', 0), 13 => array('MAIN_SECURITY_ENABLECAPTCHA_TICKET', 'chaine', getDolGlobalInt('MAIN_SECURITY_ENABLECAPTCHA_TICKET'), 'Enable captcha code by default', 0), - 14 => array('TICKET_SHOW_COMPANY_LOGO', 'chaine', getDolGlobalInt('TICKET_SHOW_COMPANY_LOGO'), 'Enable logo header on ticket public page', 0) + 14 => array('TICKET_SHOW_COMPANY_LOGO', 'chaine', getDolGlobalInt('TICKET_SHOW_COMPANY_LOGO'), 'Enable logo header on ticket public page', 0), + 15 => array('TICKET_SHOW_COMPANY_FOOTER', 'chaine', getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER'), 'Enable footer on ticket public page', 0) ); diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 00b1b34d492..6832c77292c 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -127,6 +127,8 @@ TicketsShowModuleLogo=Display the logo of the module in the public interface TicketsShowModuleLogoHelp=Enable this option to hide the logo module in the pages of the public interface TicketsShowCompanyLogo=Display the logo of the company in the public interface TicketsShowCompanyLogoHelp=Enable this option to hide the logo of the main company in the pages of the public interface +TicketsShowCompanyFooter=Display the footer of the company in the public interface +TicketsShowCompanyFooterHelp=Enable this option to hide the footer of the main company in the pages of the public interface TicketsEmailAlsoSendToMainAddress=Also send a notification to the main email address TicketsEmailAlsoSendToMainAddressHelp=Enable this option to also send an email to the address defined into setup "%s" (see tab "%s") TicketsLimitViewAssignedOnly=Restrict the display to tickets assigned to the current user (not effective for external users, always be limited to the third party they depend on) diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index 2db5e2b9924..cde34d64c33 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -128,6 +128,8 @@ TicketsShowModuleLogo=Afficher le logo du module dans l'interface publique TicketsShowModuleLogoHelp=Activer cette option pour cacher le logo du module dans les pages de l'interface publique TicketsShowCompanyLogo=Afficher le logo de la société dans l'interface publique TicketsShowCompanyLogoHelp=Activez cette option pour masquer le logo de la société dans les pages de l'interface publique +TicketsShowCompanyFooter=Afficher le pied de page de l'entreprise dans l'interface publique +TicketsShowCompanyFooterHelp=Activez cette option pour masquer le pied de la page de la société dans les pages de l'interface publique TicketsEmailAlsoSendToMainAddress=Envoyer également une notification à l'adresse e-mail principale TicketsEmailAlsoSendToMainAddressHelp=Activer cette option pour envoyer aussi un email à l'adresse définie dans la configuration "%s" (Voir onglet "%s") TicketsLimitViewAssignedOnly=Limiter l'afficher des tickets assignés à l'utilisateur courant (non valable pour les utilisateurs externes, toujours limité par le tiers dont ils dépendent) diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index 70f0b027559..fb7dd6277c6 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -93,8 +93,10 @@ print '
'; print '
'; print ''; -// End of page -htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); +if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) { + // End of page + htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); +} llxFooter('', 'public'); From f4a56208076d655b3b2ed4c2c97e8d347da936d2 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:04:20 +0200 Subject: [PATCH 0199/1137] Update wrapper.php (#25449) --- htdocs/asterisk/wrapper.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 433c22979da..6c68864f3ee 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -121,20 +121,27 @@ $called = GETPOST('called', 'alphanohtml'); // IP address of Asterisk server $strHost = $conf->global->ASTERISK_HOST; -// Spécifiez le type d'extension par laquelle vous poste est connecte. + +// Specify the type of extension through which your extension is connected. // ex: SIP/, IAX2/, ZAP/, etc $channel = $conf->global->ASTERISK_TYPE; -// Indicatif de la ligne sortante + +// Outgoing call sign $prefix = $conf->global->ASTERISK_INDICATIF; -// Port + +// Asterisk Port $port = $conf->global->ASTERISK_PORT; + // Context ( generalement from-internal ) $strContext = $conf->global->ASTERISK_CONTEXT; -// Delai d'attente avant de raccrocher + +// Waiting time before hanging up $strWaitTime = $conf->global->ASTERISK_WAIT_TIME; + // Priority $strPriority = $conf->global->ASTERISK_PRIORITY; -// Nomber of try + +// Number of call attempts $strMaxRetry = $conf->global->ASTERISK_MAX_RETRY; From 3ed32f33a96d4330dcb406733e106a86bc3c4286 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:05:00 +0200 Subject: [PATCH 0200/1137] Update card.php (#25450) isModEnabled('workstation') --- htdocs/product/card.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 86497cf38e3..47d64aba1d0 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -55,7 +55,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php' require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; + if (isModEnabled('propal')) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; @@ -74,6 +74,9 @@ if (isModEnabled('accounting')) { if (isModEnabled('bom')) { require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; } +if (isModEnabled('workstation')) { + require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; +} // Load translation files required by the page $langs->loadLangs(array('products', 'other')); From 9bdee115d971bfdf4a63643f3cca6e10a793c977 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:21:54 +0200 Subject: [PATCH 0201/1137] Update os.php (#25447) --- htdocs/admin/system/os.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index c60e1610054..739291d8e89 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -9,16 +9,16 @@ * * 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. + * 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/system/os.php - * \brief Page des infos systeme de l'OS + * \file htdocs/admin/system/os.php + * \brief Page about System OS (Operating System) */ // Load Dolibarr environment @@ -43,10 +43,10 @@ print ''; print ''; print "\n"; -// Recupere l'OS au sens PHP +// Recovers the OS in the PHP sense print '\n"; -// Recupere la version de l'OS +// Recovers the OS version $osversion = version_os(); print '\n"; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("PHP_OS")."".PHP_OS."
'.$langs->trans("Version")."".$osversion."
'; From 22becb2ff407ae4bd15bf871c10e3e6325b20255 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:22:15 +0200 Subject: [PATCH 0202/1137] Update box_lastlogin.php (#25445) --- htdocs/core/boxes/box_lastlogin.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index e5e11d9ba8f..139f3eec4a9 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -10,8 +10,8 @@ * * 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. + * 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 . @@ -20,23 +20,23 @@ /** * \file htdocs/core/boxes/box_lastlogin.php * \ingroup core - * \brief Module to show box of bills, orders & propal of the current year + * \brief Module to show box of last user logins */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class to manage the box of last login + * Class to manage the box of last login */ class box_lastlogin extends ModeleBoxes { - public $boxcode = "lastlogin"; - public $boximg = "object_user"; + public $boxcode = "lastlogin"; + public $boximg = "object_user"; public $boxlabel = 'BoxLoginInformation'; - public $depends = array("user"); + public $depends = array("user"); /** - * @var DoliDB Database handler. + * @var DoliDB Database handler. */ public $db; @@ -61,7 +61,7 @@ class box_lastlogin extends ModeleBoxes } /** - * Charge les donnees en memoire pour affichage ulterieur + * Load data into memory for later display * * @param int $max Maximum number of records to load * @return void From e9d6a28e66a6788340b1343eff528e6f2beb4f05 Mon Sep 17 00:00:00 2001 From: Eric <1468823+rycks@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:22:54 +0200 Subject: [PATCH 0203/1137] 16.0 urgent fix societe class (#25443) * Fix : set_as_client can't use prospect/customer value if disabled (#25380) * fix missing { on societe.class.php --------- Co-authored-by: Maxime Kohlhaas --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c574b96cb29..6a4d97dc4c6 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2177,7 +2177,7 @@ class Societe extends CommonObject // phpcs:enable if ($this->id) { $newclient = 1; - if ($this->client == 2 || $this->client == 3) { + if (($this->client == 2 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { $newclient = 3; //If prospect, we keep prospect tag } $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; From a836abcf93c60be1dcb69b7c7f629209a6a873f9 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Mon, 24 Jul 2023 20:23:18 +0300 Subject: [PATCH 0204/1137] FIX fullscreen translation (#25442) --- htdocs/langs/en_US/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index a5ad75f9f1f..01a57eb4175 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1232,4 +1232,4 @@ UploadFileDragDropSuccess=The file(s) have been uploaded successfully SearchSyntaxTooltipForStringOrNum=For searching inside text fields, you can use the characters ^ or $ to make a 'start or end with' search or use the ! to make a 'does not contain' test. You can use the | between two strings instead of a space for a 'OR' condition instead of 'AND'. For numeric values, you can use the operator <, >, <=, >= or != before the value, to filter using a mathematical comparison InProgress=In progress DateOfPrinting=Date of printing -ClickFullScreenEscapeToLeave=Click here to swith in Full screen mode. Type ESCAPE to leave Full screen mode. \ No newline at end of file +ClickFullScreenEscapeToLeave=Click here to switch in Full screen mode. Press ESCAPE to leave Full screen mode. From 0ea0b29e63e6080ad2917571b5cf29402876925f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:23:48 +0200 Subject: [PATCH 0205/1137] Update qodana.yaml (#25440) sorting alphabetical --- qodana.yaml | 174 ++++++++++++++++++++++++++-------------------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/qodana.yaml b/qodana.yaml index 77f33582906..4951ba9b5d6 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -17,104 +17,104 @@ exclude: - htdocs/install/doctemplates - htdocs/modulebuilder/template/test/phpunit/functionnal - htdocs/theme/common/fontawesome-5 - - name: PhpIssetCanBeReplacedWithCoalesceInspection - - name: PhpRedundantOptionalArgumentInspection - - name: PhpLanguageLevelInspection - - name: PhpIncludeInspection + - name: BadExpressionStatementJS + - name: CommaExpressionJS + - name: DuplicatedCode - name: HtmlWrongAttributeValue - - name: PhpUndefinedClassConstantInspection - - name: RegExpRedundantEscape - - name: PhpUnnecessaryLocalVariableInspection - - name: PhpUnusedParameterInspection - - name: PhpUnusedLocalVariableInspection - - name: PhpTernaryExpressionCanBeReplacedWithConditionInspection - - name: PhpSwitchStatementWitSingleBranchInspection - - name: PhpLoopCanBeReplacedWithImplodeInspection + - name: JSCheckFunctionSignatures + - name: JSDuplicatedDeclaration + - name: JSEqualityComparisonWithCoercion + - name: JSHint + - name: JSIgnoredPromiseFromCall + - name: JSJQueryEfficiency + - name: JSPrimitiveTypeWrapperUsage + - name: JSTypeOfValues + - name: JSUnnecessarySemicolon + - name: JSUnresolvedLibraryURL + - name: JSUnusedAssignment + - name: JSUnusedLocalSymbols + - name: JSValidateTypes - name: PhpArrayAccessCanBeReplacedWithForeachValueInspection - - name: PhpArrayPushWithOneElementInspection - - name: PhpCastIsUnnecessaryInspection - - name: PhpDeprecationInspection - - name: PhpStatementHasEmptyBodyInspection - - name: PhpConditionAlreadyCheckedInspection - - name: PhpExpressionResultUnusedInspection - - name: PhpUndefinedClassInspection - - name: RegExpSimplifiable - - name: PhpConcatenationWithEmptyStringCanBeInlinedInspection - - name: PhpConditionCanBeReplacedWithMinMaxCallInspection + - name: PhpArrayIndexImmediatelyRewrittenInspection - name: PhpArrayIsAlwaysEmptyInspection - - name: PhpParameterByRefIsNotUsedAsReferenceInspection - - name: PhpWrongStringConcatenationInspection - - name: PhpUnusedAliasInspection - - name: PhpUnusedPrivateMethodInspection - - name: PhpUnusedPrivateFieldInspection - - name: PhpExpressionAlwaysNullInspection - - name: PhpIfWithCommonPartsInspection - - name: PhpTernaryExpressionCanBeReducedToShortVersionInspection - - name: PhpExpressionWithSameOperandsInspection - - name: PhpInArrayCanBeReplacedWithComparisonInspection - - name: PhpUnusedAliasInspection - - name: PhpPossiblePolymorphicInvocationInspection - - name: PhpReturnValueOfMethodIsNeverUsedInspection - - name: PhpPregReplaceWithEmptyReplacementInspection - - name: PhpFieldImmediatelyRewrittenInspection - - name: PhpIllegalStringOffsetInspection - - name: PhpWrongForeachArgumentTypeInspection - - name: PhpRegExpRedundantModifierInspection - - name: PhpClassConstantAccessedViaChildClassInspection - - name: RegExpUnnecessaryNonCapturingGroup - - name: PhpPregMatchReplaceWithComparisonInspection - - name: PhpArrayWriteIsNotUsedInspection - - name: PhpUndefinedNamespaceInspection + - name: PhpArrayPushWithOneElementInspection - name: PhpArraySearchInBooleanContextInspection - - name: PhpLoopCanBeReplacedWithStrRepeatInspection - - name: PhpPropertyOnlyWrittenInspection + - name: PhpArrayUsedOnlyForWriteInspection + - name: PhpArrayWriteIsNotUsedInspection + - name: PhpCastIsUnnecessaryInspection + - name: PhpClassConstantAccessedViaChildClassInspection + - name: PhpConcatenationWithEmptyStringCanBeInlinedInspection + - name: PhpConditionAlreadyCheckedInspection + - name: PhpConditionCanBeReplacedWithMinMaxCallInspection + - name: PhpConditionCheckedByNextConditionInspection - name: PhpCoveredCharacterInClassInspection + - name: PhpDefineCanBeReplacedWithConstInspection + - name: PhpDeprecationInspection + - name: PhpDocMissingThrowsInspection + - name: PhpDuplicateCatchBodyInspection + - name: PhpDuplicateSwitchCaseBodyInspection + - name: PhpExpressionAlwaysNullInspection + - name: PhpExpressionResultUnusedInspection + - name: PhpExpressionWithSameOperandsInspection + - name: PhpFieldImmediatelyRewrittenInspection + - name: PhpFullyQualifiedNameUsageInspection + - name: PhpIfWithCommonPartsInspection + - name: PhpIllegalStringOffsetInspection + - name: PhpInArrayCanBeReplacedWithComparisonInspection + - name: PhpIncludeInspection + - name: PhpIssetCanBeReplacedWithCoalesceInspection + - name: PhpIssetCanCheckNestedAccessDirectlyInspection + - name: PhpLanguageLevelInspection + - name: PhpLoopCanBeReplacedWithImplodeInspection + - name: PhpLoopCanBeReplacedWithStrRepeatInspection + - name: PhpMissingParamTypeInspection + - name: PhpMissingParentConstructorInspection + - name: PhpMissingReturnTypeInspection + - name: PhpNestedDirNameCallsCanBeReplacedWithLevelParameterInspection + - name: PhpObjectFieldsAreOnlyWrittenInspection + - name: PhpParameterByRefIsNotUsedAsReferenceInspection + - name: PhpParameterNameChangedDuringInheritanceInspection + - name: PhpPointlessBooleanExpressionInConditionInspection + - name: PhpPossiblePolymorphicInvocationInspection + - name: PhpPregMatchReplaceWithComparisonInspection + - name: PhpPregReplaceWithEmptyReplacementInspection + - name: PhpPropertyOnlyWrittenInspection + - name: PhpRedundantCatchClauseInspection + - name: PhpRedundantOptionalArgumentInspection + - name: PhpRedundantVariableDocTypeInspection + - name: PhpRegExpRedundantModifierInspection + - name: PhpReturnDocTypeMismatchInspection + - name: PhpReturnValueOfMethodIsNeverUsedInspection - name: PhpSameParameterValueInspection - name: PhpSillyAssignmentInspection - - name: PhpConditionCheckedByNextConditionInspection - - name: RegExpSingleCharAlternation + - name: PhpStatementHasEmptyBodyInspection - name: PhpSuspiciousNameCombinationInspection - - name: PhpObjectFieldsAreOnlyWrittenInspection - - name: PhpMissingParentConstructorInspection - - name: PhpWriteAccessToReferencedArrayValueWithoutUnsetInspection - - name: PhpArrayUsedOnlyForWriteInspection - - name: PhpArrayIndexImmediatelyRewrittenInspection - - name: PhpParameterNameChangedDuringInheritanceInspection - - name: PhpDuplicateSwitchCaseBodyInspection - - name: PhpNestedDirNameCallsCanBeReplacedWithLevelParameterInspection - - name: PhpPointlessBooleanExpressionInConditionInspection + - name: PhpSwitchStatementWitSingleBranchInspection + - name: PhpSwitchWithCommonPartsInspection + - name: PhpTernaryExpressionCanBeReducedToShortVersionInspection + - name: PhpTernaryExpressionCanBeReplacedWithConditionInspection + - name: PhpUndefinedClassConstantInspection + - name: PhpUndefinedClassInspection - name: PhpUndefinedMethodInspection - - name: PhpDuplicateCatchBodyInspection - - name: PhpDefineCanBeReplacedWithConstInspection - - name: PhpMissingParamTypeInspection - - name: PhpMissingReturnTypeInspection - - name: CommaExpressionJS - - name: JSTypeOfValues - - name: PhpRedundantVariableDocTypeInspection + - name: PhpUndefinedNamespaceInspection - name: PhpUnhandledExceptionInspection - - name: JSIgnoredPromiseFromCall - - name: DuplicatedCode - - name: BadExpressionStatementJS - - name: PhpRedundantCatchClauseInspection - - name: PhpIssetCanCheckNestedAccessDirectlyInspection - - name: JSEqualityComparisonWithCoercion - - name: JSUnusedAssignment - - name: JSHint + - name: PhpUnnecessaryLocalVariableInspection + - name: PhpUnusedAliasInspection + - name: PhpUnusedAliasInspection + - name: PhpUnusedLocalVariableInspection + - name: PhpUnusedParameterInspection + - name: PhpUnusedPrivateFieldInspection + - name: PhpUnusedPrivateMethodInspection + - name: PhpWriteAccessToReferencedArrayValueWithoutUnsetInspection + - name: PhpWrongForeachArgumentTypeInspection + - name: PhpWrongStringConcatenationInspection + - name: RegExpRedundantEscape + - name: RegExpSimplifiable + - name: RegExpSingleCharAlternation + - name: RegExpUnnecessaryNonCapturingGroup - name: ReservedWordUsedAsNameJS - - name: JSUnusedLocalSymbols - name: TrivialIfJS - - name: JSJQueryEfficiency - - name: JSDuplicatedDeclaration - - name: JSUnresolvedLibraryURL + - name: UnnecessaryLabelJS - name: UnnecessaryReturnJS - name: UnreachableCodeJS - - name: JSUnnecessarySemicolon - - name: JSPrimitiveTypeWrapperUsage - - name: PhpFullyQualifiedNameUsageInspection - - name: PhpDocMissingThrowsInspection - - name: UnnecessaryLabelJS - - name: JSCheckFunctionSignatures - - name: JSValidateTypes - - name: PhpReturnDocTypeMismatchInspection - - name: PhpSwitchWithCommonPartsInspection - \ No newline at end of file + From 583a268c358db21cdc72f7a8736035e7d02a7ce3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:32:11 +0200 Subject: [PATCH 0206/1137] Update index.php (#25444) --- htdocs/public/ticket/index.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index fb7dd6277c6..8537fa9563f 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -9,7 +9,7 @@ * * 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 + * 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 @@ -17,25 +17,28 @@ */ /** - * \file htdocs/public/ticket/index.php - * \ingroup ticket - * \brief Public page to add and manage ticket + * \file htdocs/public/ticket/index.php + * \ingroup ticket + * \brief Public page to add and manage tickets */ if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); } + if (!defined('NOLOGIN')) { define('NOLOGIN', '1'); // If this page is public (can be called outside logged session) } + if (!defined('NOIPCHECK')) { define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip } + if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } -// For MultiCompany module. +// For MultiCompany module // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) { @@ -59,8 +62,9 @@ $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'aZ09'); $suffix = ""; +// Check access to Module(s) if (!isModEnabled('ticket')) { - httponly_accessforbidden('Module Ticket not enabled'); + httponly_accessforbidden('Module Ticket is not enabled'); } @@ -75,10 +79,11 @@ if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print $langs->trans('TicketPublicInterfaceForbidden'); exit; } -$arrayofjs = array(); + +$arrayofjs = array(); $arrayofcss = array('/ticket/css/styles.css.php'); -llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); +llxHeaderTicket($langs->trans('Tickets'), "", 0, 0, $arrayofjs, $arrayofcss); print ''; -print ''; +print ''; // ends '
'; +print '
'; // ends '
'; if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) { // End of page From 1cf187da83fbaf4cab24e158447d766ed64bba34 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:38:16 +0200 Subject: [PATCH 0207/1137] Update box_graph_nb_ticket_last_x_days.php (#25438) --- htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index c77db7a6f9d..bf45b0f1cd4 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -26,13 +26,13 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** - * Class to manage the box + * Class to manage the box to show new daily tickets */ class box_graph_nb_ticket_last_x_days extends ModeleBoxes { public $boxcode = "box_graph_nb_ticket_last_x_days"; - public $boximg = "ticket"; + public $boximg = "ticket"; public $boxlabel; public $depends = array("ticket"); From 1a6203b5a35de8866e8b15533bcaf1409f141fc4 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:39:00 +0200 Subject: [PATCH 0208/1137] Update modules_boxes.php (#25436) * Update modules_boxes.php * Update modules_boxes.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/boxes/modules_boxes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 03020da8de5..10cde722e65 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -21,8 +21,8 @@ /** * \file htdocs/core/boxes/modules_boxes.php - * \ingroup facture - * \brief Fichier contenant la classe mere des boites + * \ingroup core + * \brief File containing the parent class of boxes */ From 489b632021a7892107e2a942f274ebe199cc3d25 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:39:15 +0200 Subject: [PATCH 0209/1137] Update box_graph_propales_permonth.php (#25437) --- htdocs/core/boxes/box_graph_propales_permonth.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 89475095eb4..da2d7710064 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -24,14 +24,14 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class to manage the box to show last propals + * Class to manage the box to show proposals per month graph */ class box_graph_propales_permonth extends ModeleBoxes { - public $boxcode = "propalpermonth"; - public $boximg = "object_propal"; + public $boxcode = "propalpermonth"; + public $boximg = "object_propal"; public $boxlabel = "BoxProposalsPerMonth"; - public $depends = array("propal"); + public $depends = array("propal"); /** * @var DoliDB Database handler. From 6f8845a21481a5cd748499abb19808d666bb6b0b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:39:25 +0200 Subject: [PATCH 0210/1137] Update box_commandes.php (#25435) --- htdocs/core/boxes/box_commandes.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index f0534728aad..c83d1de30c0 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -28,14 +28,14 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class to manage the box to show last orders + * Class to manage the box to show last customer orders */ class box_commandes extends ModeleBoxes { - public $boxcode = "lastcustomerorders"; - public $boximg = "object_order"; + public $boxcode = "lastcustomerorders"; + public $boximg = "object_order"; public $boxlabel = "BoxLastCustomerOrders"; - public $depends = array("commande"); + public $depends = array("commande"); /** * @var DoliDB Database handler. From f0922c8d8b748811f7f3c887b596a831342d4325 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:41:27 +0200 Subject: [PATCH 0211/1137] Bump JetBrains/qodana-action from 2023.1.5 to 2023.2.1 (#25441) Bumps [JetBrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2023.1.5 to 2023.2.1. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2023.1.5...v2023.2.1) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code_quality_qodana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality_qodana.yml b/.github/workflows/code_quality_qodana.yml index cb08ea9b4cd..f9296bf377e 100644 --- a/.github/workflows/code_quality_qodana.yml +++ b/.github/workflows/code_quality_qodana.yml @@ -21,7 +21,7 @@ jobs: fetch-depth: 1 #php-version: '7.1' - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.1.5 + uses: JetBrains/qodana-action@v2023.2.1 #with: # php-version: '7.1' env: From eec8868cfb7c0c1aabdadec81e9aa33a18609c98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Jul 2023 19:52:31 +0200 Subject: [PATCH 0212/1137] Clean code --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 2af920da42e..913c9a879ba 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -52,7 +52,7 @@ class pdf_ban extends ModeleBankAccountDoc */ public function __construct($db) { - global $conf, $langs, $mysoc; + global $langs, $mysoc; // Load translation files required by the page $langs->loadLangs(array("main", "bank", "withdrawals", "companies")); From 1bb649bc7eaf6bbf78863cf7e33efefb96ecec2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Jul 2023 22:54:45 +0200 Subject: [PATCH 0213/1137] Fix phpcs --- htdocs/mrp/mo_production.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index f3a86e4ad35..bcf05b0c02d 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -543,7 +543,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - + /* // Ref bis $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1); @@ -557,7 +557,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } } - + // Project if (isModEnabled('project')) { $langs->load("projects"); From b08d24348cc45c8e52bb177ab5976666061440cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jul 2023 12:00:50 +0200 Subject: [PATCH 0214/1137] Add 2 more dangerous function to disable --- htdocs/admin/system/security.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index dbad63d37ab..cebd1fd443b 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -113,6 +113,8 @@ print "PHP allow_url_include = ".(ini_get('allow_url_include') print "PHP disable_functions = "; $arrayoffunctionsdisabled = explode(',', ini_get('disable_functions')); $arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals'); +$arrayoffunctionstodisable[] = 'stream_wrapper_restore'; +$arrayoffunctionstodisable[] = 'stream_wrapper_register'; if ($execmethod == 1) { $arrayoffunctionstodisable2 = explode(',', 'passthru,shell_exec,system,proc_open,popen'); $functiontokeep = 'exec'; @@ -351,7 +353,7 @@ if (empty($conf->global->MAIN_SESSION_TIMEOUT)) { $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout; } print ''.$langs->trans("SessionTimeOut").''; -if (ini_get("session.gc_probability") == 0) { +if (!ini_get("session.gc_probability")) { print $form->textwithpicto('', $langs->trans("SessionsPurgedByExternalSystem", ini_get("session.gc_maxlifetime"))); } else { print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"), ini_get("session.gc_maxlifetime"))); From 9c62e76c469fa25dff415dad04fe8fb42c5dc687 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jul 2023 12:30:09 +0200 Subject: [PATCH 0215/1137] NEW Disable not used PHP streams --- htdocs/admin/system/security.php | 4 ++-- htdocs/filefunc.inc.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index cebd1fd443b..b7fa041bed2 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -113,8 +113,8 @@ print "PHP allow_url_include = ".(ini_get('allow_url_include') print "PHP disable_functions = "; $arrayoffunctionsdisabled = explode(',', ini_get('disable_functions')); $arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals'); -$arrayoffunctionstodisable[] = 'stream_wrapper_restore'; -$arrayoffunctionstodisable[] = 'stream_wrapper_register'; +//$arrayoffunctionstodisable[] = 'stream_wrapper_restore'; +//$arrayoffunctionstodisable[] = 'stream_wrapper_register'; if ($execmethod == 1) { $arrayoffunctionstodisable2 = explode(',', 'passthru,shell_exec,system,proc_open,popen'); $functiontokeep = 'exec'; diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index e9d2069154f..f5afeb15613 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -62,6 +62,16 @@ if (defined('DOL_INC_FOR_VERSION_ERROR')) { } +// Disable some not used PHP stream +$listofwrappers = stream_get_wrappers(); +$arrayofstreamtodisable = array('compress.zlib', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'phar', 'rar', 'zip', 'zlib'); +foreach ($arrayofstreamtodisable as $streamtodisable) { + if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) { + stream_wrapper_unregister($streamtodisable); + } +} + + // Define vars $conffiletoshowshort = "conf.php"; // Define localization of conf file From 5377e72593266784eba19b23ea4f2a96462c211c Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 25 Jul 2023 20:32:13 +0200 Subject: [PATCH 0216/1137] make button add property --- htdocs/modulebuilder/index.php | 75 ++- .../template/myobject_property_card.php | 631 ++++++++++++++++++ htdocs/theme/eldy/global.inc.php | 2 +- 3 files changed, 678 insertions(+), 30 deletions(-) create mode 100644 htdocs/modulebuilder/template/myobject_property_card.php diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4bc7deca258..d5172d7f6fb 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -311,6 +311,7 @@ if ($dirins && $action == 'initmodule' && $modulename) { dol_delete_file($destdir.'/myobject_document.php'); dol_delete_file($destdir.'/myobject_agenda.php'); dol_delete_file($destdir.'/myobject_list.php'); + dol_delete_file($destdir.'/myobject_property_card.php'); dol_delete_file($destdir.'/lib/'.strtolower($modulename).'_myobject.lib.php'); dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.sql'); @@ -1239,6 +1240,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', + 'myobject_property_card.php'=>strtolower($objectname).'_property_card.php', 'admin/myobject_extrafields.php'=>'admin/'.strtolower($objectname).'_extrafields.php', 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', //'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php', @@ -2621,6 +2623,9 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int')) { } } +if ($dirins && $action == "create_property") { +} + /* * View */ @@ -3440,8 +3445,7 @@ if ($module == 'initmodule') { // Print form confirm print $formconfirm; } - - if ($action != 'editfile' || empty($file)) { + if ($action != 'editfile' || empty($file) ) { try { //$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; @@ -3759,33 +3763,44 @@ if ($module == 'initmodule') { if (!empty($properties)) { // Line to add a property print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // //print ''; + // print ''; + // print ''; + // print ''; + // print ''; + // print ''; + for ($i = 0; $i<22;$i++) { + print ''; + } + $mod = strtolower($module); + $obj = strtolower($tabobj); + if ($user->hasRight("$mod", "$obj", "write")) { + $newcardbutton .= dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?action=create_property&tab=objects&module='.urlencode($module).'&tabobj='.urlencode($tabobj)); + print ''; + print_barre_liste('', $page, $_SERVER["PHP_SELF"], '', '', '', '', '', 0, '', 0, $newcardbutton, '', '', 0, 0, 1); + print ''; + } + print ''; // List of existing properties foreach ($properties as $propkey => $propval) { /* If from Reflection @@ -3989,6 +4004,8 @@ if ($module == 'initmodule') { print ''; } print ''; + if ($action == 'create_property') { + } } } else { if ($tab == 'specifications') { diff --git a/htdocs/modulebuilder/template/myobject_property_card.php b/htdocs/modulebuilder/template/myobject_property_card.php new file mode 100644 index 00000000000..b9c3be569aa --- /dev/null +++ b/htdocs/modulebuilder/template/myobject_property_card.php @@ -0,0 +1,631 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/modulebuilder/template/myobject_card.php + * \ingroup mymodule + * \brief Page to create/edit/view myobject + */ + +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs +//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters +//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library +//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value +//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler +//if (! defined("MAIN_SECURITY_FORCECSP")) define('MAIN_SECURITY_FORCECSP', 'none'); // Disable all Content Security Policies +//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification +//if (! defined('NOSESSION')) define('NOSESSION', '1'); // Disable session + +// Load Dolibarr environment +$res = 0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; +} +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; +while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { + $i--; $j--; +} +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; +} +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; +} +// Try main.inc.php using relative path +if (!$res && file_exists("../main.inc.php")) { + $res = @include "../main.inc.php"; +} +if (!$res && file_exists("../../main.inc.php")) { + $res = @include "../../main.inc.php"; +} +if (!$res && file_exists("../../../main.inc.php")) { + $res = @include "../../../main.inc.php"; +} +if (!$res) { + die("Include of main fails"); +} + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +dol_include_once('/mymodule/class/myobject.class.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); + +// Load translation files required by the page +$langs->loadLangs(array("mymodule@mymodule", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$lineid = GETPOST('lineid', 'int'); + +$action = GETPOST('action', 'aZ09'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used +$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); +$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); + +if (!empty($backtopagejsfields)) { + $tmpbacktopagejsfields = explode(':', $backtopagejsfields); + $dol_openinpopup = $tmpbacktopagejsfields[0]; +} + +// Initialize technical objects +$object = new MyObject($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('myobjectcard', 'globalcard')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +// Initialize array of search criterias +$search_all = GETPOST("search_all", 'alpha'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha')) { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } +} + +if (empty($action) && empty($id) && empty($ref)) { + $action = 'view'; +} + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. + +// There is several ways to check permission. +// Set $enablepermissioncheck to 1 to enable a minimum low level of checks +$enablepermissioncheck = 0; +if ($enablepermissioncheck) { + $permissiontoread = $user->hasRight('mymodule', 'myobject', 'read'); + $permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + $permissiontodelete = $user->hasRight('mymodule', 'myobject', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); + $permissionnote = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_setnotes.inc.php + $permissiondellink = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_dellink.inc.php +} else { + $permissiontoread = 1; + $permissiontoadd = 1; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + $permissiontodelete = 1; + $permissionnote = 1; + $permissiondellink = 1; +} + +$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1].'/myobject'; + +// Security check (enable the most restrictive one) +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); +//restrictedArea($user, $object->module, $object, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft); +if (!isModEnabled("mymodule")) { + accessforbidden(); +} +if (!$permissiontoread) { + accessforbidden(); +} + + +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + $backurlforlist = dol_buildpath('/mymodule/myobject_list.php', 1); + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); + } + } + } + + $triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record + + // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + + // Actions when linking object each other + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + + // Action to move up and down lines of object + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; + + // Action to build doc + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + + if ($action == 'set_thirdparty' && $permissiontoadd) { + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + } + if ($action == 'classin' && $permissiontoadd) { + $object->setProject(GETPOST('projectid', 'int')); + } + + // Actions to send emails + $triggersendname = 'MYMODULE_MYOBJECT_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; + $trackid = 'myobject'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; +} + + + + +/* + * View + */ + +$form = new Form($db); +$formfile = new FormFile($db); +$formproject = new FormProjets($db); + +$title = $langs->trans("MyObject"); +$help_url = ''; +llxHeader('', $title, $help_url); + +// Example : Adding jquery code +// print ''; + + +// Part to create +if ($action == 'create') { + if (empty($permissiontoadd)) { + accessforbidden('NotEnoughPermissions', 0, 1); + } + + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("MyObject")), '', 'object_'.$object->picto); + + print '
'; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + if ($backtopagejsfields) { + print ''; + } + if ($dol_openinpopup) { + print ''; + } + + print dol_get_fiche_head(array(), ''); + + // Set some default values + //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; + + 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 '
'; + + //dol_set_focus('input[name="ref"]'); +} + +// Part to edit record +if (($id || $ref) && $action == 'edit') { + print load_fiche_titre($langs->trans("MyObject"), '', 'object_'.$object->picto); + + print '
'; + print ''; + print ''; + print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + + print dol_get_fiche_head(); + + 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(); + + print '
'; +} + +// Part to show record +if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { + $head = myobjectPrepareHead($object); + + print dol_get_fiche_head($head, 'card', $langs->trans("MyObject"), -1, $object->picto, 0, '', '', 0, '', 1); + + $formconfirm = ''; + + // Confirmation to delete + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), '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); + } + + // 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('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } + + // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) + if ($action == 'xxx') { + $text = $langs->trans('ConfirmActionMyObject', $object->ref); + /*if (isModEnabled('notification')) + { + require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('MYOBJECT_CLOSE', $object->socid, $object); + }*/ + + $formquestion = array(); + + /* + $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), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); + */ + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $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; + } + + // Print form confirm + print $formconfirm; + + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
'; + /* + // Ref customer + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); + // Thirdparty + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { + $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + } + // Project + if (isModEnabled('project')) { + $langs->load("projects"); + $morehtmlref .= '
'; + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify') { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } + } + } + */ + $morehtmlref .= '
'; + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + print ''."\n"; + + // Common attributes + //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field + //unset($object->fields['fk_project']); // Hide field already shown in banner + //unset($object->fields['fk_soc']); // Hide field already shown in banner + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + + // Other attributes. Fields from hook formObjectOptions and Extrafields. + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + + print '
'; + print '
'; + print '
'; + + print '
'; + + print dol_get_fiche_end(); + + + /* + * Lines + */ + + if (!empty($object->table_element_line)) { + // Show object lines + $result = $object->getLinesArray(); + + 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); + } + + // Form to add new line + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products/services form + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, $soc); + } + } + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
'; + } + print '
'; + + print "
\n"; + } + + + // Buttons for actions + + if ($action != 'presend' && $action != 'editline') { + print '
'."\n"; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + + if (empty($reshook)) { + // Send + if (empty($user->socid)) { + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); + } + + // Back to draft + if ($object->status == $object::STATUS_VALIDATED) { + print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); + } + + print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); + + // Validate + if ($object->status == $object::STATUS_DRAFT) { + if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { + print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); + } else { + $langs->load("errors"); + print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); + } + } + + // Clone + if ($permissiontoadd) { + print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd); + } + + /* + if ($permissiontoadd) { + if ($object->status == $object::STATUS_ENABLED) { + print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd); + } else { + print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd); + } + } + if ($permissiontoadd) { + if ($object->status == $object::STATUS_VALIDATED) { + print dolGetButtonAction('', $langs->trans('Cancel'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd); + } else { + print dolGetButtonAction('', $langs->trans('Re-Open'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd); + } + } + */ + + // Delete + $params = array(); + print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete, $params); + } + print '
'."\n"; + } + + + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + if ($action != 'presend') { + print '
'; + print ''; // ancre + + $includedocgeneration = 0; + + // Documents + if ($includedocgeneration) { + $objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref.'/'.$objref.'.pdf'; + $filedir = $conf->mymodule->dir_output.'/'.$object->element.'/'.$objref; + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed = $permissiontoread; // If you can read, you can build the PDF to read content + $delallowed = $permissiontoadd; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('mymodule:MyObject', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); + } + + // Show links to link elements + $linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject')); + $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
'; + + $MAXEVENT = 10; + + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); + + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); + + print '
'; + } + + //Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + // Presend form + $modelmail = 'myobject'; + $defaulttopic = 'InformationMessage'; + $diroutput = $conf->mymodule->dir_output; + $trackid = 'myobject'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 190d6159afb..fc2c04d51f5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -8045,4 +8045,4 @@ if (!empty($conf->global->THEME_CUSTOM_CSS)) { /* Must be at end */ div.flot-text .flot-tick-label .tickLabel, .fa-color-unset { color: unset; -} +} \ No newline at end of file From d2e15b149b5e1560ee98bbc02c46d21ad9d6e429 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:07:28 +0200 Subject: [PATCH 0217/1137] Update modExport.class.php (#25486) defgroup brief --- htdocs/core/modules/modExport.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php index df996a312bf..7f36c78273b 100644 --- a/htdocs/core/modules/modExport.class.php +++ b/htdocs/core/modules/modExport.class.php @@ -17,11 +17,12 @@ */ /** - * \defgroup export Module export - * \brief Module generique pour realiser des exports de donnees en base - * \file htdocs/core/modules/modExport.class.php - * \ingroup export - * \brief Description and activation file for the module export + * \defgroup export Module Export + * \brief Module to manage data exports from Dolibarr database + * + * \file htdocs/core/modules/modExport.class.php + * \ingroup export + * \brief Description and activation file for the module export */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 29f8ac91717c17e3e151dc67f3c53b390dcf421e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:07:57 +0200 Subject: [PATCH 0218/1137] Update modComptabilite.class.php (#25485) defgroup brief --- htdocs/core/modules/modComptabilite.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modComptabilite.class.php b/htdocs/core/modules/modComptabilite.class.php index be8f1954959..6c485f912f9 100644 --- a/htdocs/core/modules/modComptabilite.class.php +++ b/htdocs/core/modules/modComptabilite.class.php @@ -19,11 +19,12 @@ */ /** - * \defgroup comptabilite Module comptabilite - * \brief Module pour inclure des fonctions de comptabilite (gestion de comptes comptables et rapports) - * \file htdocs/core/modules/modComptabilite.class.php - * \ingroup comptabilite - * \brief Description and activation file for the module simple accountancy + * \defgroup comptabilite Module Comptabilite + * \brief Module to include accounting functions (account management and reporting) + * + * \file htdocs/core/modules/modComptabilite.class.php + * \ingroup comptabilite + * \brief Description and activation file for the module simple accountancy */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 9c864759a28d9b473764dd2580a18cabf88f23ad Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:08:49 +0200 Subject: [PATCH 0219/1137] Update modSyslog.class.php (#25483) defgroup brief --- htdocs/core/modules/modSyslog.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 0fa0da9dcdb..8a2cbf68bab 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -17,11 +17,12 @@ */ /** - * \defgroup syslog Module syslog - * \brief Module pour gerer les messages d'erreur dans syslog - * \file htdocs/core/modules/modSyslog.class.php - * \ingroup syslog - * \brief Description and activation file for the module syslog + * \defgroup syslog Module Syslog + * \brief Module to manage error messages in syslog + * + * \file htdocs/core/modules/modSyslog.class.php + * \ingroup syslog + * \brief Description and activation file for the module syslog */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 6c52d2d68f2098d3a6f35994fd99d7ddd96eeb62 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:09:16 +0200 Subject: [PATCH 0220/1137] Update modHoliday.class.php (#25473) defgroup brief --- htdocs/core/modules/modHoliday.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 630320adaaf..ad4d135f491 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -23,7 +23,8 @@ /** * \defgroup holiday Module holiday - * \brief Module de gestion des congés + * \brief Module for leave/vacation management + * * \file htdocs/core/modules/modHoliday.class.php * \ingroup holiday * \brief Description and activation file for the module holiday From 2c8be187157a5c3cb0f30e3ad956184194248544 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:09:52 +0200 Subject: [PATCH 0221/1137] Update box_clients.php (#25468) --- htdocs/core/boxes/box_clients.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index cb934debef3..4e14b01079b 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -21,21 +21,21 @@ /** * \file htdocs/core/boxes/box_clients.php * \ingroup societes - * \brief Module de generation de l'affichage de la box clients + * \brief Module for generating box to show last customers */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class to manage the box to show last thirdparties + * Class to manage the box to show last customers */ class box_clients extends ModeleBoxes { - public $boxcode = "lastcustomers"; - public $boximg = "object_company"; + public $boxcode = "lastcustomers"; + public $boximg = "object_company"; public $boxlabel = "BoxLastCustomers"; - public $depends = array("societe"); + public $depends = array("societe"); /** * @var DoliDB Database handler. From 2fee75b81a731c22f811b692e95078ae58bc76e5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:10:06 +0200 Subject: [PATCH 0222/1137] Update modECM.class.php (#25480) defgroup brief --- htdocs/core/modules/modECM.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 719468c076b..f9b0238a8c4 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -16,11 +16,13 @@ * along with this program. If not, see . */ -/** \defgroup ecm Module ecm - * \brief Module for ECM (Electronic Content Management) - * \file htdocs/core/modules/modECM.class.php - * \ingroup ecm - * \brief Description and activation file for the module ECM +/** + * \defgroup ecm Module ECM + * \brief Module ECM (Electronic Content Management) to manage Documents + * + * \file htdocs/core/modules/modECM.class.php + * \ingroup ecm + * \brief Description and activation file for the module ECM */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 96b0b3f005862654df5b60127442ae498bff2a02 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:10:32 +0200 Subject: [PATCH 0223/1137] Update modExpedition.class.php (#25484) defgroup brief --- htdocs/core/modules/modExpedition.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 3b6b4e10c82..b3125409a57 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -20,11 +20,12 @@ */ /** - * \defgroup expedition Module shipping - * \brief Module pour gerer les expeditions de produits - * \file htdocs/core/modules/modExpedition.class.php - * \ingroup expedition - * \brief Description and activation file for the module Expedition + * \defgroup expedition Module Shipping + * \brief Module to manage product shipments + * + * \file htdocs/core/modules/modExpedition.class.php + * \ingroup expedition + * \brief Description and activation file for the module Expedition */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 3915bbaa14f025cf91ca1cce686720212b7fbbfc Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:10:46 +0200 Subject: [PATCH 0224/1137] Update modReception.class.php (#25479) defgroup brief --- htdocs/core/modules/modReception.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index d6341e6279d..7a606b9c0a8 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -16,11 +16,12 @@ */ /** - * \defgroup reception Module reception - * \brief Module pour gerer les réceptions de produits - * \file htdocs/core/modules/modReception.class.php - * \ingroup reception - * \brief Description and activation file for the module Reception + * \defgroup reception Module Reception + * \brief Module to manage receptions of products + * + * \file htdocs/core/modules/modReception.class.php + * \ingroup reception + * \brief Description and activation file for the module Reception */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 161684bc24d7803d4a924238f2efb2b1d7bfcb49 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:11:09 +0200 Subject: [PATCH 0225/1137] Update modEmailCollector.class.php (#25481) defgroup brief --- htdocs/core/modules/modEmailCollector.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 0a8f67016e1..a6e27a546b9 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -16,8 +16,8 @@ */ /** - * \defgroup emailcollector Module emailcollector - * \brief emailcollector module descriptor. + * \defgroup emailcollector Module Emailcollector + * \brief Module to collect emails * * \file htdocs/core/modules/modEmailCollector.class.php * \ingroup emailcollector From c96e1de4b0c6d71cac5fc5fe29a97e9ee2106e96 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:11:21 +0200 Subject: [PATCH 0226/1137] Update modUser.class.php (#25482) defgroup brief --- htdocs/core/modules/modUser.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index df5cfba961f..4fce2b8021f 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -18,11 +18,12 @@ */ /** - * \defgroup user Module user management - * \brief Module pour gerer les utilisateurs - * \file htdocs/core/modules/modUser.class.php - * \ingroup user - * \brief Description and activation file for the module users + * \defgroup user Module user management + * \brief Module to manage users and usergroups + * + * \file htdocs/core/modules/modUser.class.php + * \ingroup user + * \brief Description and activation file for the module users */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 54c7e0af2e99032861b8ab804c6a6336b1c20cb8 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:11:37 +0200 Subject: [PATCH 0227/1137] Update modMrp.class.php (#25475) defgroup brief --- htdocs/core/modules/modMrp.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index f315a4594c4..caf221bfd83 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -20,7 +20,7 @@ /** * \defgroup mrp Module Mrp - * \brief Mrp module descriptor. + * \brief Module to manage Manufacturing Orders (MO) * * \file htdocs/core/modules/modMrp.class.php * \ingroup mrp From 09d286c0dd134b4c2b987ea5fc125d107941484f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:12:53 +0200 Subject: [PATCH 0228/1137] Update llx_10_c_regions.sql (#25469) --- .../install/mysql/data/llx_10_c_regions.sql | 69 ++++++++++--------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index d319396e246..84fbf7e006c 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -10,7 +10,7 @@ -- Copyright (C) 2012 Ricardo Schluter -- Copyright (C) 2015 Ferran Marcet -- Copyright (C) 2019~ Lao Tian <281388879@qq.com> --- Copyright (C) 2020-2021 Udo Tamm +-- Copyright (C) 2020-2023 Udo Tamm -- Copyright (C) 2022 Miro Sertić -- -- This program is free software; you can redistribute it and/or modify @@ -42,51 +42,52 @@ -- CONTENT ------------------------------------------------------------------- -- --- Algeria -> for Departmements --- Andorra -> for Departmements --- Angola -> for Departmements +-- Algeria -> only for Departmements +-- Andorra -> only for Departmements +-- Angola -> only for Departmements -- Argentina --- Australia -> for Departmements --- Austria -> for Departmements --- Barbados -> for Departmements +-- Australia -> only for Departmements +-- Austria -> only for Departmements +-- Barbados -> only for Departmements -- Belgium -- Bolivia --- Brazil -> for Departmements +-- Brazil -> only for Departmements -- Burundi --- Canada -> for Departmements +-- Canada -> only for Departmements -- Chile -- China --- Colombie -> for Departmements +-- Colombie -> only for Departmements -- Croatia -- Denmark -- France --- Germany -> for Departmements +-- Germany -> only for Departmements -- Greece --- Honduras -> for Departmements +-- Honduras -> only for Departmements -- Hungary --- India -> for Departmements --- Indonesia -> for Departmements +-- India -> only for Departmements +-- Indonesia -> only for Departmements -- Italy --- Japan -> only for Departmements +-- Japan -> only for Departmements -- Luxembourg -- Mauritius --- Mexique -> for Departmements +-- Mexique -> only for Departmements -- Morocco --- Netherlands -> for Departmements --- Panama -> for Departmements +-- Netherlands -> only for Departmements +-- Panama -> only for Departmements -- Peru -- Portugal --- Romania -> for Departmements +-- Romania -> only for Departmements -- San Salvador -- Slovakia -- Slovenia -- Spain --- Switzerland/Suisse -> for Departmements/Cantons --- Taiwan -> for Departmements +-- Switzerland/Suisse -> only for Departmements/Cantons +-- Taiwan -> only for Departmements -- Tunesia --- United Arab Emirates -> for Departmements +-- Turkey +-- United Arab Emirates -> only for Departmements -- United Kingdom --- USA -> for Departmements +-- USA -> only for Departmements -- Venezuela @@ -400,7 +401,7 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( -- Netherlands Regions (id country=17) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 17, 1701, '', 0,'Provincies van Nederland '); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 17, 1701, '', 0, 'Provincies van Nederland '); -- Panama Regions (id country=178) @@ -437,7 +438,7 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 1 -- Portugal Regions (rowid country=25) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 25, 15001, 'PT', NULL, 'Portugal'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 25, 15001, 'PT', NULL, 'Portugal'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 25, 15002, 'PT9', NULL, 'Azores-Madeira'); @@ -521,6 +522,16 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 1 insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 10, 1024, '', 0, 'Zaghouan'); +-- Turkiye (Turkey) Regions (id country=221) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22101, '', 0, 'Marmara'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22102, '', 0, 'İç Anadolu'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22103, '', 0, 'Ege'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22104, '', 0, 'Akdeniz'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22105, '', 0, 'Güneydoğu'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22106, '', 0, 'Karadeniz'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22107, '', 0, 'Doğu Anadolu'); + + -- United Arab Emirates (UAE) Region (rowid country=227) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 227, 22701, '', 0, 'United Arab Emirates'); @@ -547,11 +558,3 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23208, '', 0, 'Nor-Oriental'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23209, '', 0, 'Zuliana'); --- Turkiye (Turkey) Regions (id country=221) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22101, '', 0, 'Marmara'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22102, '', 0, 'İç Anadolu'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22103, '', 0, 'Ege'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22104, '', 0, 'Akdeniz'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22105, '', 0, 'Güneydoğu'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22106, '', 0, 'Karadeniz'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 221, 22107, '', 0, 'Doğu Anadolu'); From 73a82b7d8a20361a337d85567ee64c3f669a6663 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:13:42 +0200 Subject: [PATCH 0229/1137] Update modNotification.class.php (#25477) defgroup brief --- htdocs/core/modules/modNotification.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index 63086fd9112..0e59169bda3 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -17,11 +17,12 @@ */ /** - * \defgroup notification Module email notification - * \brief Module pour gerer les notifications (par mail ou autre) - * \file htdocs/core/modules/modNotification.class.php - * \ingroup notification - * \brief Description and activation file for the module Notification + * \defgroup notification Module notification + * \brief Module for managing notifications (by e-mail or other means) + * + * \file htdocs/core/modules/modNotification.class.php + * \ingroup notification + * \brief Description and activation file for the module Notification */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 3d44cb7cb5411a76c46ab242612244c4e3f58dfa Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:13:50 +0200 Subject: [PATCH 0230/1137] Update modFournisseur.class.php (#25476) defgroup brief --- htdocs/core/modules/modFournisseur.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 81a8e6224cf..3127a0d76bb 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -21,10 +21,12 @@ */ /** - * \defgroup fournisseur Module suppliers - * \file htdocs/core/modules/modFournisseur.class.php - * \ingroup fournisseur - * \brief Description and activation file for the module Supplier + * \defgroup fournisseur Module suppliers + * \brief Module to manage suppliers relations and activities + * + * \file htdocs/core/modules/modFournisseur.class.php + * \ingroup fournisseur + * \brief Description and activation file for the module Supplier */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; From 0d0395fce35604efef69cecb9bb59c5e8226e9a9 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:14:17 +0200 Subject: [PATCH 0231/1137] Update modApi.class.php (#25478) --- htdocs/core/modules/modApi.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 4ac93f87c9a..acceaa822d1 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -20,7 +20,8 @@ /** * \defgroup api Module Api - * \brief Descriptor file for Api modulee + * \brief Module for API (REST) management + * * \file htdocs/core/modules/modApi.class.php * \ingroup api * \brief Description and activation file for the module Api From 25c4e51076b691a86b8ee2c3294c1baf3c0bc2ff Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:15:43 +0200 Subject: [PATCH 0232/1137] Update llx_20_c_departements.sql (#25470) --- .../mysql/data/llx_20_c_departements.sql | 192 +++++++++--------- 1 file changed, 97 insertions(+), 95 deletions(-) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 81f4b473f60..59127065612 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -12,7 +12,7 @@ -- Copyright (C) 2012 Sebastian Neuwert -- Copyright (C) 2012 Ricardo Schluter -- Copyright (C) 2015 Ferran Marcet --- Copyright (C) 2020-2021 Udo Tamm +-- Copyright (C) 2020-2023 Udo Tamm -- Copyright (C) 2022 Miro Sertić -- Copyright (C) 2022 ButterflyOfFire -- @@ -63,15 +63,16 @@ -- Honduras -- Hungary -- Italy +-- Japan -- Luxembourg --- Netherlands -- Morocco +-- Netherlands -- Panama -- Peru -- Portugal -- Romania -- San Salvador -> El Salvador --- Slovenia (need to check code SI-Id) +-- Slovenia (need to check code SI-Id) -- Switzerland / Suisse -- Taiwan -- Tunisia @@ -424,11 +425,11 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc -- France Departements (id country=1) -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 1, '971','97105',3,'GUADELOUPE','Guadeloupe'); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 2, '972','97209',3,'MARTINIQUE','Martinique'); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 3, '973','97302',3,'GUYANE','Guyane'); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 4, '974','97411',3,'REUNION','Réunion'); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 6, '976','97601',3,'MAYOTTE','Mayotte'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 1, '971','97105',3, 'GUADELOUPE','Guadeloupe'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 2, '972','97209',3, 'MARTINIQUE','Martinique'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 3, '973','97302',3, 'GUYANE','Guyane'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 4, '974','97411',3, 'REUNION','Réunion'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 6, '976','97601',3, 'MAYOTTE','Mayotte'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (84, '01', '01053',5, 'AIN', 'Ain'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (32, '02', '02408',5, 'AISNE', 'Aisne'); @@ -775,6 +776,56 @@ insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (307, 'VT', NULL, NULL, NULL, 'VITERBO'); +-- Japan 都道府県 (id country=123) +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '01', '', 0, '北海', '北海道', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '02', '', 0, '青森', '青森県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '03', '', 0, '岩手', '岩手県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '04', '', 0, '宮城', '宮城県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '05', '', 0, '秋田', '秋田県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '06', '', 0, '山形', '山形県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '07', '', 0, '福島', '福島県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '08', '', 0, '茨城', '茨城県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '09', '', 0, '栃木', '栃木県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '10', '', 0, '群馬', '群馬県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '11', '', 0, '埼玉', '埼玉県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '12', '', 0, '千葉', '千葉県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '13', '', 0, '東京', '東京都', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '14', '', 0, '神奈川', '神奈川県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '15', '', 0, '新潟', '新潟県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '16', '', 0, '富山', '富山県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '17', '', 0, '石川', '石川県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '18', '', 0, '福井', '福井県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '19', '', 0, '山梨', '山梨県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '20', '', 0, '長野', '長野県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '21', '', 0, '岐阜', '岐阜県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '22', '', 0, '静岡', '静岡県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '23', '', 0, '愛知', '愛知県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '24', '', 0, '三重', '三重県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '25', '', 0, '滋賀', '滋賀県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '26', '', 0, '京都', '京都府', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '27', '', 0, '大阪', '大阪府', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '28', '', 0, '兵庫', '兵庫県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '29', '', 0, '奈良', '奈良県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '30', '', 0, '和歌山', '和歌山県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '31', '', 0, '鳥取', '鳥取県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '32', '', 0, '島根', '島根県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '33', '', 0, '岡山', '岡山県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '34', '', 0, '広島', '広島県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '35', '', 0, '山口', '山口県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '36', '', 0, '徳島', '徳島県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '37', '', 0, '香川', '香川県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '38', '', 0, '愛媛', '愛媛県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '39', '', 0, '高知', '高知県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '40', '', 0, '福岡', '福岡県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '41', '', 0, '佐賀', '佐賀県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '42', '', 0, '長崎', '長崎県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '43', '', 0, '熊本', '熊本県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '44', '', 0, '大分', '大分県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '45', '', 0, '宮崎', '宮崎県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '46', '', 0, '鹿児島', '鹿児島県', 1); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '47', '', 0, '沖縄', '沖縄県', 1); + + -- Luxembourg Cantons (id country=140) INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (14001, 'LU0001', '', 0, '', 'Clervaux'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (14001, 'LU0002', '', 0, '', 'Diekirch'); @@ -1640,42 +1691,42 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc -- Provinces India (id country=117) -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AN', 11701, NULL, 0, 'AN', 'Andaman & Nicobar', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AP', 11701, NULL, 0, 'AP', 'Andhra Pradesh', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AR', 11701, NULL, 0, 'AR', 'Arunachal Pradesh', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AS', 11701, NULL, 0, 'AS', 'Assam', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BR', 11701, NULL, 0, 'BR', 'Bihar', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CG', 11701, NULL, 0, 'CG', 'Chattisgarh', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CH', 11701, NULL, 0, 'CH', 'Chandigarh', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('DD', 11701, NULL, 0, 'DD', 'Daman & Diu', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('DL', 11701, NULL, 0, 'DL', 'Delhi', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('DN', 11701, NULL, 0, 'DN', 'Dadra and Nagar Haveli', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GA', 11701, NULL, 0, 'GA', 'Goa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GJ', 11701, NULL, 0, 'GJ', 'Gujarat', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HP', 11701, NULL, 0, 'HP', 'Himachal Pradesh', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HR', 11701, NULL, 0, 'HR', 'Haryana', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JH', 11701, NULL, 0, 'JH', 'Jharkhand', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JK', 11701, NULL, 0, 'JK', 'Jammu & Kashmir', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KA', 11701, NULL, 0, 'KA', 'Karnataka', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('KL', 11701, NULL, 0, 'KL', 'Kerala', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LD', 11701, NULL, 0, 'LD', 'Lakshadweep', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MH', 11701, NULL, 0, 'MH', 'Maharashtra', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ML', 11701, NULL, 0, 'ML', 'Meghalaya', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MN', 11701, NULL, 0, 'MN', 'Manipur', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MP', 11701, NULL, 0, 'MP', 'Madhya Pradesh', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MZ', 11701, NULL, 0, 'MZ', 'Mizoram', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('NL', 11701, NULL, 0, 'NL', 'Nagaland', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('OR', 11701, NULL, 0, 'OR', 'Orissa', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PB', 11701, NULL, 0, 'PB', 'Punjab', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PY', 11701, NULL, 0, 'PY', 'Puducherry', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('RJ', 11701, NULL, 0, 'RJ', 'Rajasthan', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SK', 11701, NULL, 0, 'SK', 'Sikkim', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TE', 11701, NULL, 0, 'TE', 'Telangana', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TN', 11701, NULL, 0, 'TN', 'Tamil Nadu', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TR', 11701, NULL, 0, 'TR', 'Tripura', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('UL', 11701, NULL, 0, 'UL', 'Uttarakhand', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('UP', 11701, NULL, 0, 'UP', 'Uttar Pradesh', 1); -INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('WB', 11701, NULL, 0, 'WB', 'West Bengal', 1); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AN', 11701, NULL, 0, 'AN', 'Andaman & Nicobar'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AP', 11701, NULL, 0, 'AP', 'Andhra Pradesh'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AR', 11701, NULL, 0, 'AR', 'Arunachal Pradesh'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AS', 11701, NULL, 0, 'AS', 'Assam'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('BR', 11701, NULL, 0, 'BR', 'Bihar'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('CG', 11701, NULL, 0, 'CG', 'Chattisgarh'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('CH', 11701, NULL, 0, 'CH', 'Chandigarh'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('DD', 11701, NULL, 0, 'DD', 'Daman & Diu'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('DL', 11701, NULL, 0, 'DL', 'Delhi'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('DN', 11701, NULL, 0, 'DN', 'Dadra and Nagar Haveli'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('GA', 11701, NULL, 0, 'GA', 'Goa'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('GJ', 11701, NULL, 0, 'GJ', 'Gujarat'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HP', 11701, NULL, 0, 'HP', 'Himachal Pradesh'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('HR', 11701, NULL, 0, 'HR', 'Haryana'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('JH', 11701, NULL, 0, 'JH', 'Jharkhand'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('JK', 11701, NULL, 0, 'JK', 'Jammu & Kashmir'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('KA', 11701, NULL, 0, 'KA', 'Karnataka'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('KL', 11701, NULL, 0, 'KL', 'Kerala'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('LD', 11701, NULL, 0, 'LD', 'Lakshadweep'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('MH', 11701, NULL, 0, 'MH', 'Maharashtra'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('ML', 11701, NULL, 0, 'ML', 'Meghalaya'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('MN', 11701, NULL, 0, 'MN', 'Manipur'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('MP', 11701, NULL, 0, 'MP', 'Madhya Pradesh'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('MZ', 11701, NULL, 0, 'MZ', 'Mizoram'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('NL', 11701, NULL, 0, 'NL', 'Nagaland'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('OR', 11701, NULL, 0, 'OR', 'Orissa'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PB', 11701, NULL, 0, 'PB', 'Punjab'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PY', 11701, NULL, 0, 'PY', 'Puducherry'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('RJ', 11701, NULL, 0, 'RJ', 'Rajasthan'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('SK', 11701, NULL, 0, 'SK', 'Sikkim'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('TE', 11701, NULL, 0, 'TE', 'Telangana'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('TN', 11701, NULL, 0, 'TN', 'Tamil Nadu'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('TR', 11701, NULL, 0, 'TR', 'Tripura'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('UL', 11701, NULL, 0, 'UL', 'Uttarakhand'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('UP', 11701, NULL, 0, 'UP', 'Uttar Pradesh'); +INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('WB', 11701, NULL, 0, 'WB', 'West Bengal'); -- Provinces Indonesia (id country=118) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BA', 11801, NULL, 0, 'BA', 'Bali', 1); @@ -1748,7 +1799,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ZAC', 15401, '', 0, 'ZAC', 'Zacatecas', 1); --- Provinces Venezuela (id country=232) +-- Venezuela Provinces (id country=232) INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-L', 23201, '', 0, 'VE-L', 'Mérida', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-T', 23201, '', 0, 'VE-T', 'Trujillo', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('VE-E', 23201, '', 0, 'VE-E', 'Barinas', 1); @@ -1897,6 +1948,7 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0118', '', 0, '', 'Nyabitsinda'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (6118, 'BI0119', '', 0, '', 'Ruyigi'); + -- Provinces United Arab Emirates (id country=227) INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-1', 22701, '', 0, '', 'Abu Dhabi'); INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-2', 22701, '', 0, '', 'Dubai'); @@ -1906,58 +1958,8 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-6', 22701, '', 0, '', 'Sharjah'); INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AE-7', 22701, '', 0, '', 'Umm al-Quwain'); --- Japan 都道府県 (id country=123) -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '01', '', 0, '北海', '北海道', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '02', '', 0, '青森', '青森県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '03', '', 0, '岩手', '岩手県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '04', '', 0, '宮城', '宮城県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '05', '', 0, '秋田', '秋田県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '06', '', 0, '山形', '山形県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '07', '', 0, '福島', '福島県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '08', '', 0, '茨城', '茨城県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '09', '', 0, '栃木', '栃木県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '10', '', 0, '群馬', '群馬県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '11', '', 0, '埼玉', '埼玉県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '12', '', 0, '千葉', '千葉県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '13', '', 0, '東京', '東京都', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '14', '', 0, '神奈川', '神奈川県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '15', '', 0, '新潟', '新潟県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '16', '', 0, '富山', '富山県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '17', '', 0, '石川', '石川県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '18', '', 0, '福井', '福井県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '19', '', 0, '山梨', '山梨県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '20', '', 0, '長野', '長野県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '21', '', 0, '岐阜', '岐阜県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '22', '', 0, '静岡', '静岡県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '23', '', 0, '愛知', '愛知県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '24', '', 0, '三重', '三重県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '25', '', 0, '滋賀', '滋賀県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '26', '', 0, '京都', '京都府', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '27', '', 0, '大阪', '大阪府', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '28', '', 0, '兵庫', '兵庫県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '29', '', 0, '奈良', '奈良県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '30', '', 0, '和歌山', '和歌山県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '31', '', 0, '鳥取', '鳥取県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '32', '', 0, '島根', '島根県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '33', '', 0, '岡山', '岡山県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '34', '', 0, '広島', '広島県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '35', '', 0, '山口', '山口県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '36', '', 0, '徳島', '徳島県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '37', '', 0, '香川', '香川県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '38', '', 0, '愛媛', '愛媛県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '39', '', 0, '高知', '高知県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '40', '', 0, '福岡', '福岡県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '41', '', 0, '佐賀', '佐賀県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '42', '', 0, '長崎', '長崎県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '43', '', 0, '熊本', '熊本県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '44', '', 0, '大分', '大分県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '45', '', 0, '宮崎', '宮崎県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '46', '', 0, '鹿児島', '鹿児島県', 1); -insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) values (12301, '47', '', 0, '沖縄', '沖縄県', 1); - -- Turkiye (Turkey) (id country=221) - INSERT INTO llx_c_departements (code_departement, fk_region, nom) VALUES ('TR-01',22104,'Adana'); INSERT INTO llx_c_departements (code_departement, fk_region, nom) VALUES ('TR-02',22107,'Adıyaman'); INSERT INTO llx_c_departements (code_departement, fk_region, nom) VALUES ('TR-03',22103,'Afyon'); From 37937f2a46187a8339e76c2ad4a65696b3c28b22 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:15:53 +0200 Subject: [PATCH 0233/1137] Update modHRM.class.php (#25474) defgroup brief --- htdocs/core/modules/modHRM.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index f4295f53193..cd625811860 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -17,10 +17,12 @@ */ /** - * \defgroup HRM Module hrm - * \file htdocs/core/modules/modHRM.class.php - * \ingroup HRM - * \brief Description and activation file for the module HRM + * \defgroup HRM Module hrm + * \brief Module for Human Resource Management (HRM) + * + * \file htdocs/core/modules/modHRM.class.php + * \ingroup HRM + * \brief Description and activation file for the module HRM */ include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; From c86b608a413a0339747b9e1dda0a13f25993cc13 Mon Sep 17 00:00:00 2001 From: Alban Durrheimer Date: Tue, 25 Jul 2023 23:17:09 +0200 Subject: [PATCH 0234/1137] NEW Add more information to holiday mailings (#25461) * Add more information to holiday mailings * Fix leave type in mailings --- htdocs/holiday/card.php | 20 +++++++++++++++++++- htdocs/holiday/card_group.php | 20 +++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index f9fe67d07dc..9d4e8a5c2d1 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -522,11 +522,29 @@ if (empty($reshook)) { } } + $typeleaves = $object->getTypes(1, -1); + $labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']); + + if ($object->halfday == 2) { + $starthalfdaykey = "Afternoon"; + $endhalfdaykey = "Morning"; + } elseif ($object->halfday == -1) { + $starthalfdaykey = "Afternoon"; + $endhalfdaykey = "Afternoon"; + } elseif ($object->halfday == 1) { + $starthalfdaykey = "Morning"; + $endhalfdaykey = "Morning"; + } elseif ($object->halfday == 2) { + $starthalfdaykey = "Morning"; + $endhalfdaykey = "Afternoon"; + } + $link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id; $message .= "
    "; $message .= "
  • ".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."
  • \n"; - $message .= "
  • ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."
  • \n"; + $message .= "
  • ".$langs->transnoentitiesnoconv("Type")." : ".(empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow)."
  • \n"; + $message .= "
  • ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv($starthalfdaykey)." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')." ".$langs->transnoentitiesnoconv($endhalfdaykey)."
  • \n"; $message .= "
  • ".$langs->transnoentitiesnoconv("Link").' : '.$link."
  • \n"; $message .= "
\n"; diff --git a/htdocs/holiday/card_group.php b/htdocs/holiday/card_group.php index 5ef93d686c9..27c0e14b4d2 100644 --- a/htdocs/holiday/card_group.php +++ b/htdocs/holiday/card_group.php @@ -747,11 +747,29 @@ function sendMail($id, $cancreate, $now, $autoValidation) } } + $typeleaves = $object->getTypes(1, -1); + $labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']); + + if ($object->halfday == 2) { + $starthalfdaykey = "Afternoon"; + $endhalfdaykey = "Morning"; + } elseif ($object->halfday == -1) { + $starthalfdaykey = "Afternoon"; + $endhalfdaykey = "Afternoon"; + } elseif ($object->halfday == 1) { + $starthalfdaykey = "Morning"; + $endhalfdaykey = "Morning"; + } elseif ($object->halfday == 2) { + $starthalfdaykey = "Morning"; + $endhalfdaykey = "Afternoon"; + } + $link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id; $message .= "
    "; $message .= "
  • ".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."
  • \n"; - $message .= "
  • ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."
  • \n"; + $message .= "
  • ".$langs->transnoentitiesnoconv("Type")." : ".(empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow)."
  • \n"; + $message .= "
  • ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv($starthalfdaykey)." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')." ".$langs->transnoentitiesnoconv($endhalfdaykey)."
  • \n"; $message .= "
  • ".$langs->transnoentitiesnoconv("Link").' : '.$link."
  • \n"; $message .= "
\n"; From cc3468abe3b11b6b17c7848d9c0e4a20f06d3168 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Jul 2023 23:17:38 +0200 Subject: [PATCH 0235/1137] Update box_graph_invoices_permonth.php (#25467) --- htdocs/core/boxes/box_graph_invoices_permonth.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 556b3a7fe42..49be094ecb0 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -24,14 +24,14 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; /** - * Class to manage the box to show last invoices + * Class to manage the box to show invoices per month graph */ class box_graph_invoices_permonth extends ModeleBoxes { - public $boxcode = "invoicespermonth"; - public $boximg = "object_bill"; + public $boxcode = "invoicespermonth"; + public $boximg = "object_bill"; public $boxlabel = "BoxCustomersInvoicesPerMonth"; - public $depends = array("facture"); + public $depends = array("facture"); /** * @var DoliDB Database handler. From 3ef192903ba83400df5ef84f965d4202592f0159 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jul 2023 23:51:24 +0200 Subject: [PATCH 0236/1137] Trans --- htdocs/langs/en_US/languages.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 1e924d96448..2241b9f18d8 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -123,6 +123,6 @@ Language_ur_PK=Urdu Language_uz_UZ=Uzbek Language_vi_VN=Vietnamese Language_zh_CN=Chinese -Language_zh_TW=Chinese (Traditional) +Language_zh_TW=Chinese (Taiwan) Language_zh_HK=Chinese (Hong Kong) Language_bh_MY=Malay From d8fba18a9a4ff532cfd6631f77b50def713bac6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Jul 2023 01:49:05 +0200 Subject: [PATCH 0237/1137] Doc --- htdocs/install/check.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index ec78b5d38cd..d743defe9bd 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -154,7 +154,6 @@ if (!function_exists("imagecreate")) { print 'Ok '.$langs->trans("PHPSupport", "GD")."
\n"; } - // Check if Curl is supported if (!function_exists("curl_init")) { $langs->load("errors"); @@ -189,7 +188,7 @@ if (!function_exists("utf8_encode")) { print 'Ok '.$langs->trans("PHPSupport", "UTF8")."
\n"; } -// Check if intl methods are supported +// Check if intl methods are supported if install is not from DoliWamp. TODO Why ? if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@localhost') { if (!function_exists("locale_get_primary_language") || !function_exists("locale_get_region")) { $langs->load("errors"); From 74acbcf72ddd9e5c6af5b2de931ff77fcc83c588 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Jul 2023 02:46:43 +0200 Subject: [PATCH 0238/1137] Fix phpcs --- htdocs/mrp/mo_production.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index bcf05b0c02d..8bb358c0729 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -544,11 +544,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref = '
'; - /* + /* // Ref bis $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mrp->creer, 'string', '', null, null, '', 1); - */ + */ // Thirdparty if (is_object($object->thirdparty)) { From 57adce857c0c39be7678f4a3e3b186a6a9dfb37f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Jul 2023 02:47:49 +0200 Subject: [PATCH 0239/1137] Fix phpcs --- htdocs/core/modules/modECM.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index f9b0238a8c4..b99e2c5b00b 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -/** +/** * \defgroup ecm Module ECM * \brief Module ECM (Electronic Content Management) to manage Documents * From 4f14f52410cc5979b528fb591b281a3f6223fe2c Mon Sep 17 00:00:00 2001 From: Pascal Hubrecht Date: Wed, 26 Jul 2023 03:22:33 +0200 Subject: [PATCH 0240/1137] FIX unexistant POST variables (#25309) The $_POST['price_ht_devise'] and $_POST['price_ttc_devise'] don't exist. The correct variables are multicurrency_price_ht and multicurrency_price_ttc --- htdocs/fourn/facture/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 3e65cd55e99..32bb4e752fd 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1618,11 +1618,11 @@ if (empty($reshook)) { $localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); $type = $productsupplier->type; - if (GETPOST('price_ht') != '' || GETPOST('price_ht_devise') != '') { + if (GETPOST('price_ht') != '' || GETPOST('multicurrency_price_ht') != '') { $price_base_type = 'HT'; $pu = price2num($price_ht, 'MU'); $pu_devise = price2num($price_ht_devise, 'CU'); - } elseif (GETPOST('price_ttc') != '' || GETPOST('price_ttc_devise') != '') { + } elseif (GETPOST('price_ttc') != '' || GETPOST('multicurrency_price_ttc') != '') { $price_base_type = 'TTC'; $pu = price2num($price_ttc, 'MU'); $pu_devise = price2num($price_ttc_devise, 'CU'); @@ -1706,7 +1706,7 @@ if (empty($reshook)) { $localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); $localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty); - if (GETPOST('price_ht') != '' || GETPOST('price_ht_devise') != '') { + if (GETPOST('price_ht') != '' || GETPOST('multicurrency_price_ht') != '') { $pu_ht = price2num($price_ht, 'MU'); // $pu_ht must be rounded according to settings } else { $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); From a73024bec87517dea55948c7b79f52774187dc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Wed, 26 Jul 2023 14:54:58 +0200 Subject: [PATCH 0241/1137] add extrafieldmanaged in commande.class.php --- htdocs/commande/class/commande.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 64dd3ad564a..ec23a97acc5 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -82,6 +82,11 @@ class Commande extends CommonOrder */ public $ismultientitymanaged = 1; + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer From bb1aad54c0c3cb218699a064dc5a34d6d1587121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Wed, 26 Jul 2023 14:56:25 +0200 Subject: [PATCH 0242/1137] add $isextrafieldmanaged to contact.class.php --- htdocs/contact/class/contact.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 3a4128f01cf..728efba79a1 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -60,6 +60,11 @@ class Contact extends CommonObject */ public $ismultientitymanaged = 1; + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ From 38037089dd12b52299bb43523054a4f1b3248870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Wed, 26 Jul 2023 14:57:50 +0200 Subject: [PATCH 0243/1137] add $isextrafieldmanaged to facture.class.php --- htdocs/compta/facture/class/facture.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 851fc3a08b1..5bbf4fadf98 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -90,6 +90,11 @@ class Facture extends CommonInvoice */ public $ismultientitymanaged = 1; + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer From 6ec130d2e6d6be28c840037a100b9545d547682d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Wed, 26 Jul 2023 14:58:55 +0200 Subject: [PATCH 0244/1137] add $isextrafieldmanaged to expedition.class.php --- htdocs/expedition/class/expedition.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b62a9a94a5b..dae0b9dc329 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -79,6 +79,11 @@ class Expedition extends CommonObject */ public $ismultientitymanaged = 1; + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ From c1cdf49cba37607c50125feedd207e870d6f5565 Mon Sep 17 00:00:00 2001 From: mschamp <34092708+mschamp@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:39:36 +0200 Subject: [PATCH 0245/1137] Update llx_accounting_abc.sql Add the dutch chart --- htdocs/install/mysql/data/llx_accounting_abc.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 00a961a5706..114f5eb6f08 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -71,6 +71,8 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account BE PCMN-BASE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 2, 'PCMN-BASE', 'The base accountancy belgium plan', 1); +-- Description of chart of account BE PCMN-BASE +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 2, 'MAR-VERKORT', 'The base accountancy belgium plan Dutch', 1); -- Description of chart of account ES PCG08-PYME INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 4, 'PCG08-PYME', 'The PYME accountancy spanish plan', 1); From 155848585f16eb5f7bd23d2c71edca1b99dfd28f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:16:00 +0200 Subject: [PATCH 0246/1137] Update interface_20_all_Logevents.class.php $langs->load("users"); only once at the start --- .../interface_20_all_Logevents.class.php | 79 ++++++++++--------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index 3b9d59778e9..ab32870a8c8 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2009 Laurent Destailleur * Copyright (C) 2009-2017 Regis Houssin * Copyright (C) 2014 Marcos García + * Copyright (C) 2023 Udo Tamm * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ /** * \file htdocs/core/triggers/interface_20_all_Logevents.class.php * \ingroup core - * \brief Trigger file for + * \brief Trigger file for log events */ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; @@ -40,12 +41,11 @@ class InterfaceLogevents extends DolibarrTriggers { $this->db = $db; - $this->name = preg_replace('/^Interface/i', '', get_class($this)); - $this->family = "core"; - $this->description = "Triggers of this module allows to add security event records inside Dolibarr."; - // 'development', 'experimental', 'dolibarr' or version - $this->version = self::VERSION_DOLIBARR; - $this->picto = 'technic'; + $this->name = preg_replace('/^Interface/i', '', get_class($this)); + $this->family = "core"; + $this->description = "Triggers of this module allows to add security event records inside Dolibarr."; + $this->version = self::VERSION_DOLIBARR; // VERSION_ 'DEVELOPMENT' or 'EXPERMENTAL' or 'DOLIBARR' + $this->picto = 'technic'; } /** @@ -77,54 +77,58 @@ class InterfaceLogevents extends DolibarrTriggers $date = dol_now(); - // Actions + /* Actions */ + + $langs->load("users"); + + // USER_LOGIN if ($action == 'USER_LOGIN') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = "(UserLogged,".$object->login.")"; $text .= (empty($object->trigger_mesg) ? '' : ' - '.$object->trigger_mesg); $desc = "(UserLogged,".$object->login.")"; $desc .= (empty($object->trigger_mesg) ? '' : ' - '.$object->trigger_mesg); + + // USER_LOGIN_FAILED } elseif ($action == 'USER_LOGIN_FAILED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $object->trigger_mesg; // Message direct $desc = $object->trigger_mesg; // Message direct + + // USER_LOGOUT } elseif ($action == 'USER_LOGOUT') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = "(UserLogoff,".$object->login.")"; $desc = "(UserLogoff,".$object->login.")"; + + // USER_CREATE } elseif ($action == 'USER_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("NewUserCreated", $object->login); $desc = $langs->transnoentities("NewUserCreated", $object->login); + + // USER_MODIFY } elseif ($action == 'USER_MODIFY') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("EventUserModified", $object->login); $desc = $langs->transnoentities("EventUserModified", $object->login); + + // USER_NEW_PASSWORD } elseif ($action == 'USER_NEW_PASSWORD') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("NewUserPassword", $object->login); $desc = $langs->transnoentities("NewUserPassword", $object->login); + + // USER ENABLED/DISABLED } elseif ($action == 'USER_ENABLEDISABLE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) if ($object->statut == 0) { $text = $langs->transnoentities("UserEnabled", $object->login); $desc = $langs->transnoentities("UserEnabled", $object->login); @@ -133,29 +137,32 @@ class InterfaceLogevents extends DolibarrTriggers $text = $langs->transnoentities("UserDisabled", $object->login); $desc = $langs->transnoentities("UserDisabled", $object->login); } + + // USER_DELETE } elseif ($action == 'USER_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("UserDeleted", $object->login); $desc = $langs->transnoentities("UserDeleted", $object->login); + + // USERGROUP_CREATE } elseif ($action == 'USERGROUP_CREATE') { - // Groups dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("NewGroupCreated", $object->name); $desc = $langs->transnoentities("NewGroupCreated", $object->name); + + // USERGROUP_MODIFY } elseif ($action == 'USERGROUP_MODIFY') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("GroupModified", $object->name); $desc = $langs->transnoentities("GroupModified", $object->name); + + // USERGROUP_DELETE } elseif ($action == 'USERGROUP_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - $langs->load("users"); - // Initialisation donnees (date,duree,texte,desc) + // Initialize data (date,duree,text,desc) $text = $langs->transnoentities("GroupDeleted", $object->name); $desc = $langs->transnoentities("GroupDeleted", $object->name); } From c53c2ebd9da7888d2ba35412ea3b0c66fa3510e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Jul 2023 15:09:25 +0200 Subject: [PATCH 0247/1137] Trans --- htdocs/langs/en_US/banks.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index a5b3f64efea..f164bcfe31c 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -60,7 +60,7 @@ EditFinancialAccount=Edit account LabelBankCashAccount=Bank or cash label AccountType=Account type BankType0=Savings account -BankType1=Current or credit card account +BankType1=Current, cheque or credit card account BankType2=Cash account AccountsArea=Accounts area AccountCard=Account card From 31082fbea00ca8d82189778fdfc3f63404e28bc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Jul 2023 15:51:32 +0200 Subject: [PATCH 0248/1137] Log --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 92acf87898a..1df1ee37122 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1711,7 +1711,7 @@ class CMailFile // tls smtp start with no encryption //if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; - dol_syslog("Try socket connection to host=".$host." port=".$port); + dol_syslog("Try socket connection to host=".$host." port=".$port." timeout=".$timeout); //See if we can connect to the SMTP server $errno = 0; $errstr = ''; if ($socket = @fsockopen( From 3bf1093afa6b9d3108c2b078b651a73418513411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Jul 2023 17:45:40 +0200 Subject: [PATCH 0249/1137] Doc (#25498) --- htdocs/user/class/user.class.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 06e7a481bfd..53f16d488c1 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -80,7 +80,14 @@ class User extends CommonObject public $picto = 'user'; public $id = 0; + + /** + * @var int + * @deprecated + * @see $status + */ public $statut; + public $ldap_sid; public $search_sid; public $employee; @@ -168,6 +175,11 @@ class User extends CommonObject */ public $pass; + /** + * @var string Crypted password in memory + */ + public $pass_crypted; + /** * @var string Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0) */ @@ -342,6 +354,10 @@ class User extends CommonObject */ public $fk_warehouse; + /** + * @var int egroupware id + */ + public $egroupware_id; public $fields = array( 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), @@ -830,7 +846,6 @@ class User extends CommonObject dol_syslog(get_class($this)."::addrights $rid, $allmodule, $allperms, $entity, $notrigger for user id=".$this->id); if (empty($this->id)) { - $error++; $this->error = 'Try to call addrights on an object user with an empty id'; return -1; } @@ -2937,7 +2952,7 @@ class User extends CommonObject } if ($withpictoimg > -2 && $withpictoimg != 2) { if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $result .= ''; + $result .= ''; } if ($mode == 'login') { $result .= dol_string_nohtmltag(dol_trunc($this->login, $maxlen)); @@ -3256,7 +3271,7 @@ class User extends CommonObject } } - if ($conf->global->LDAP_SERVER_TYPE == 'egroupware') { + if (getDolGlobalString('LDAP_SERVER_TYPE') == 'egroupware') { $info["objectclass"][4] = "phpgwContact"; // compatibilite egroupware $info['uidnumber'] = $this->id; From 22d059c1837fb1d428f3678d6bfe3aacacb2ee4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Jul 2023 17:51:41 +0200 Subject: [PATCH 0250/1137] Doc (#25497) --- htdocs/user/class/usergroup.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index d2146e3c368..9fb263b8d9d 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -98,6 +98,9 @@ class UserGroup extends CommonObject */ public $note; + /** + * @var User[] + */ public $members = array(); // Array of users public $nb_rights; // Number of rights granted to the user From fac590261f6635d4eb53f87b5ae81b9c8cce63fe Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Fri, 28 Jul 2023 01:19:03 +0200 Subject: [PATCH 0251/1137] fix button and change the page --- htdocs/core/actions_addupdatedelete.inc.php | 1 + .../myobject_property_card.php => card.php} | 0 htdocs/modulebuilder/index.php | 44 +++++++++---------- 3 files changed, 22 insertions(+), 23 deletions(-) rename htdocs/modulebuilder/{template/myobject_property_card.php => card.php} (100%) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 71901f8db44..fbf803c676f 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -55,6 +55,7 @@ if ($cancel) { // Action to add record if ($action == 'add' && !empty($permissiontoadd)) { + var_dump(GETPOST('label', 'alpha'));exit; foreach ($object->fields as $key => $val) { if ($object->fields[$key]['type'] == 'duration') { if (GETPOST($key.'hour') == '' && GETPOST($key.'min') == '') { diff --git a/htdocs/modulebuilder/template/myobject_property_card.php b/htdocs/modulebuilder/card.php similarity index 100% rename from htdocs/modulebuilder/template/myobject_property_card.php rename to htdocs/modulebuilder/card.php diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d5172d7f6fb..24f2cd9e07c 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -233,7 +233,6 @@ if ($dirins && $action == 'initmodule' && $modulename) { 'mymodule'=>strtolower($modulename), 'MyModule'=>$modulename ); - $result = dolCopyDir($srcdir, $destdir, 0, 0, $arrayreplacement); //dol_mkdir($destfile); if ($result <= 0) { @@ -311,7 +310,6 @@ if ($dirins && $action == 'initmodule' && $modulename) { dol_delete_file($destdir.'/myobject_document.php'); dol_delete_file($destdir.'/myobject_agenda.php'); dol_delete_file($destdir.'/myobject_list.php'); - dol_delete_file($destdir.'/myobject_property_card.php'); dol_delete_file($destdir.'/lib/'.strtolower($modulename).'_myobject.lib.php'); dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.sql'); @@ -380,6 +378,11 @@ if ($dirins && $action == 'initmodule' && $modulename) { dol_delete_file($destdir.'/README.md'); file_put_contents($destdir.'/README.md', $conf->global->MODULEBUILDER_SPECIFIC_README); } + // for create file to add properties + // file_put_contents($destdir.'/'.strtolower($modulename).'propertycard.php',''); + // $srcFileCard = DOL_DOCUMENT_ROOT.'/modulebuilder/card.php'; + // $destFileCard = $dirins.'/'.strtolower($modulename).'/template/card.php'; + // dol_copy($srcFileCard, $destdir.'/'.strtolower($modulename).'propertycard.php', 0,1, $arrayreplacement); } if (!$error) { @@ -1240,7 +1243,6 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'myobject_property_card.php'=>strtolower($objectname).'_property_card.php', 'admin/myobject_extrafields.php'=>'admin/'.strtolower($objectname).'_extrafields.php', 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', //'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php', @@ -2623,9 +2625,6 @@ if ($dirins && $action == "modify_menu" && GETPOST('menukey', 'int')) { } } -if ($dirins && $action == "create_property") { -} - /* * View */ @@ -3415,6 +3414,15 @@ if ($module == 'initmodule') { print '
'; */ + print ''; + } elseif ($tabobj == 'createproperty') { + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + var_dump($obj); print '
'; } elseif ($tabobj == 'deleteobject') { // Delete object tab @@ -3716,8 +3724,13 @@ if ($module == 'initmodule') { print ''; print '

'; - print load_fiche_titre($langs->trans("ObjectProperties"), '', ''); + $mod = strtolower($module); + $obj = strtolower($tabobj); + $newproperty = dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.urlencode($module).'&tabobj=createproperty'); + print_barre_liste($langs->trans("ObjectProperties"), $page, $_SERVER["PHP_SELF"], '', '', '', '', '', 0, '', 0, $newproperty, '', '', 0, 0, 1); + + //var_dump($reflectorpropdefault);exit; print ''."\n"; print '
'; print ''; @@ -3759,10 +3772,9 @@ if ($module == 'initmodule') { // modified during the constructor and we want value into head of class before constructor is called. //$properties = dol_sort_array($tmpobject->fields, 'position'); $properties = dol_sort_array($reflectorpropdefault['fields'], 'position'); - if (!empty($properties)) { // Line to add a property - print ''; + //print ''; // print ''; // print ''; // print ''; @@ -3789,18 +3801,6 @@ if ($module == 'initmodule') { // print ''; - for ($i = 0; $i<22;$i++) { - print ''; - } - $mod = strtolower($module); - $obj = strtolower($tabobj); - if ($user->hasRight("$mod", "$obj", "write")) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?action=create_property&tab=objects&module='.urlencode($module).'&tabobj='.urlencode($tabobj)); - print ''; - } - print ''; // List of existing properties foreach ($properties as $propkey => $propval) { /* If from Reflection @@ -4004,8 +4004,6 @@ if ($module == 'initmodule') { print ''; } print ''; - if ($action == 'create_property') { - } } } else { if ($tab == 'specifications') { From 38d6abbc7631ed2e90778817699181a372eedf26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Jul 2023 14:19:27 +0200 Subject: [PATCH 0252/1137] Better fail2ban files --- dev/setup/fail2ban/filter.d/web-accesslog-limit403.conf | 2 +- dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf | 2 +- dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf | 2 +- .../fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/setup/fail2ban/filter.d/web-accesslog-limit403.conf b/dev/setup/fail2ban/filter.d/web-accesslog-limit403.conf index 1356df80115..43163cf5d9a 100644 --- a/dev/setup/fail2ban/filter.d/web-accesslog-limit403.conf +++ b/dev/setup/fail2ban/filter.d/web-accesslog-limit403.conf @@ -13,7 +13,7 @@ # fail2ban-client status web-accesslog-limit403 # # To test rule file on a existing log file -# fail2ban-regex /var/log/apache2/access.log /etc/fail2ban/filter.d/web-accesslog-limit403.conf +# fail2ban-regex /var/log/apache2/access.log /etc/fail2ban/filter.d/web-accesslog-limit403.conf --print-all-matched failregex = - - .*HTTP/[0-9]+(.[0-9]+)?" 403 ignoreregex = diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf index 2eedad18821..13d2b99d095 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf @@ -13,7 +13,7 @@ # fail2ban-client status web-dolibarr-limitpublic # # To test rule file on a existing log file -# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-limitpublic.conf +# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-limitpublic.conf --print-all-matched failregex = ^ [A-Z\s]+ \s+--- Access to .*/public/ ignoreregex = diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf index dd6694c1a6f..79ca5c2fb95 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf @@ -13,7 +13,7 @@ # fail2ban-client status web-dolibarr-rulesbruteforce # # To test rule file on a existing log file -# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf +# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf --print-all-matched failregex = ^ [A-Z\s]+ \s+functions_.*::check_user_.* Authentication KO ignoreregex = diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf index 8cc20dd4be4..0316a7e7774 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf @@ -13,7 +13,7 @@ # fail2ban-client status web-dolibarr-rulespassforgotten # # To test rule file on a existing log file -# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf +# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf --print-all-matched failregex = ^ [A-Z\s]+ \s+--- Access to .*/passwordforgotten.php - action=buildnewpassword ignoreregex = From c8c3345415e5b44dd1b506723a8ae7f67478e10a Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Fri, 28 Jul 2023 14:42:09 +0200 Subject: [PATCH 0253/1137] Fix bad parameter in backtopage algo of product (#25510) --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 47d64aba1d0..c8ad5047fe7 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -695,7 +695,7 @@ if (empty($reshook)) { if (!empty($backtopage)) { $backtopage = preg_replace('/__ID__/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation if (preg_match('/\?/', $backtopage)) { - $backtopage .= '&socid='.$object->id; // Old method + $backtopage .= '&productid='.$object->id; // Old method } header("Location: ".$backtopage); exit; From 1a6c53ef86867bfc48a83683368bc097f4231ef7 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Fri, 28 Jul 2023 19:41:25 +0200 Subject: [PATCH 0254/1137] add autocomplete for an input --- htdocs/langs/en_US/errors.lang | 2 +- htdocs/langs/fr_FR/errors.lang | 1 + htdocs/modulebuilder/index.php | 159 ++++++++++++++++++++++++++------- 3 files changed, 127 insertions(+), 35 deletions(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 8f85caebb50..7759ac91a9c 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -317,7 +317,7 @@ ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Error: The URL of you ErrorMenuExistValue=A Menu already exist with this Title or URL ErrorSVGFilesNotAllowedAsLinksWithout=SVG files are not allowed as external links without the option %s ErrorTypeMenu=Impossible to add another menu for the same module on the navbar, not handle yet - +ErrorObjectNotFound = The object %s is not found, please check your url # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index d81be42b602..052efda2e0f 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -317,6 +317,7 @@ ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Erreur : L'URL de vot ErrorMenuExistValue=Un menu existe déjà avec ce titre ou cette URL ErrorSVGFilesNotAllowedAsLinksWithout=Les fichiers SVG ne sont pas autorisés en tant que liens externes sans l'option %s ErrorTypeMenu=Impossible d'ajouter un autre menu pour le même module sur la barre de navigation, pas encore géré +ErrorObjectNotFound=L'objet %s est introuvable verifier votre url # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente. diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 24f2cd9e07c..2fa4d8a568e 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1607,10 +1607,10 @@ if ($dirins && ($action == 'droptable' || $action == 'droptableextrafields') && } } -if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && !empty($tabobj)) { +if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && !empty(GETPOST('obj')) && $tabobj == "createproperty") { $error = 0; - $objectname = $tabobj; + $objectname = GETPOST('obj'); $dirins = $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; $moduletype = $listofmodules[strtolower($module)]['moduletype']; @@ -1619,6 +1619,11 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && $destdir = $dirins.'/'.strtolower($module); dol_mkdir($destdir); + $objects = dolGetListOfObjectClasses($destdir); + if (!in_array($objectname, array_values($objects))) { + $error++; + setEventMessages($langs->trans("ErrorObjectNotFound", $langs->transnoentities($objectname)), null, 'errors'); + } // We click on add property if (!GETPOST('regenerateclasssql') && !GETPOST('regeneratemissing')) { if (!GETPOST('propname', 'aZ09')) { @@ -3360,6 +3365,7 @@ if ($module == 'initmodule') { print dol_get_fiche_head($head3, $tabobj, '', -1, '', 0, '', '', 0, 'forobjectsuffix'); // Level 3 + if ($tabobj == 'newobject') { // New object tab print '
'; @@ -3416,14 +3422,127 @@ if ($module == 'initmodule') { print ''; } elseif ($tabobj == 'createproperty') { - print '
'; + $attributesUnique = array ( + 'propname' => $form->textwithpicto($langs->trans("Code"), $langs->trans("PropertyDesc"), 1, 'help', 'extracss', 0, 3, 'propertyhelp'), + 'proplabel' => $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")), + 'proptype' => $form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'

'.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp'), + 'proparrayofkeyval' => $form->textwithpicto($langs->trans("ArrayOfKeyValues"), $langs->trans("ArrayOfKeyValuesDesc")), + 'propnotnull' => $form->textwithpicto($langs->trans("NotNull"), $langs->trans("NotNullDesc")), + 'propdefault' => $langs->trans("DefaultValue"), + 'propindex' => $langs->trans("DatabaseIndex"), + 'propforeignkey' => $form->textwithpicto($langs->trans("ForeignKey"), $langs->trans("ForeignKeyDesc"), 1, 'help', 'extracss', 0, 3, 'foreignkeyhelp'), + 'propposition' => $langs->trans("Position"), + 'propenabled' => $form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc"), 1, 'help', 'extracss', 0, 3, 'enabledhelp'), + 'propvisible' => $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'

'.$langs->trans("ItCanBeAnExpression"), 1, 'help', 'extracss', 0, 3, 'visiblehelp'), + 'propnoteditable' => $langs->trans("NotEditable"), + 'propalwayseditable' => $langs->trans("AlwaysEditable"), + 'propsearchall' => $form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")), + 'propisameasure' => $form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")), + 'propcss' => $langs->trans("CSSClass"), + 'propcssview' => $langs->trans("CSSViewClass"), + 'propcsslist' => $langs->trans("CSSListClass"), + 'prophelp' => $langs->trans("KeyForTooltip"), + 'propshowoncombobox' => $langs->trans("ShowOnCombobox"), + 'propvalidate' => $form->textwithpicto($langs->trans("Validate"), $langs->trans("ValidateModBuilderDesc")), + 'propcomment' => $langs->trans("Comment"), + ); + print ''; print ''; print ''; print ''; print ''; - print ''; - var_dump($obj); + print ''; + + print '
'; // print ''; // print '
'; - print_barre_liste('', $page, $_SERVER["PHP_SELF"], '', '', '', '', '', 0, '', 0, $newcardbutton, '', '', 0, 0, 1); - print '
'."\n"; + $counter = 0; + foreach ($attributesUnique as $key => $attribute) { + if ($counter % 2 === 0) { + print ''; + } + if ($key == 'propname' || $key == 'proplabel') { + print ''; + } elseif ($key == 'proptype') { + print ''; + } elseif ($key == 'propvalidate') { + print ''; + } else { + print ''; + } + $counter++; + if ($counter % 2 === 0) { + print ''; + } + } + if ($counter % 2 !== 0) { + while ($counter % 2 !== 0) { + print ''; + $counter++; + } + print ''; + } + print '
'.$attribute.''.$attribute.'
'.$attribute.''.$attribute.'

'."\n"; + print '
'; + print ''; + print ''; + print '
'; print ''; + // javascript + print ''; } elseif ($tabobj == 'deleteobject') { // Delete object tab print '
'; @@ -3726,7 +3845,7 @@ if ($module == 'initmodule') { $mod = strtolower($module); $obj = strtolower($tabobj); - $newproperty = dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.urlencode($module).'&tabobj=createproperty'); + $newproperty = dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.urlencode($module).'&tabobj=createproperty&obj='.urlencode($tabobj)); print_barre_liste($langs->trans("ObjectProperties"), $page, $_SERVER["PHP_SELF"], '', '', '', '', '', 0, '', 0, $newproperty, '', '', 0, 0, 1); @@ -3773,34 +3892,6 @@ if ($module == 'initmodule') { //$properties = dol_sort_array($tmpobject->fields, 'position'); $properties = dol_sort_array($reflectorpropdefault['fields'], 'position'); if (!empty($properties)) { - // Line to add a property - //print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // //print ''; - // print ''; - // print ''; - // print ''; - // print ''; - // print ''; // List of existing properties foreach ($properties as $propkey => $propval) { /* If from Reflection From 69c75796108eaad992917c2a105bcf5eebeeaaf4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jul 2023 16:41:20 +0200 Subject: [PATCH 0255/1137] Reenable phar --- htdocs/filefunc.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index f5afeb15613..c992136f116 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -64,7 +64,8 @@ if (defined('DOL_INC_FOR_VERSION_ERROR')) { // Disable some not used PHP stream $listofwrappers = stream_get_wrappers(); -$arrayofstreamtodisable = array('compress.zlib', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'phar', 'rar', 'zip', 'zlib'); +// We need '.phar' for geoip2. TODO Replace phar with explode files so we can disable phar. +$arrayofstreamtodisable = array('compress.zlib', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'rar', 'zip', 'zlib'); foreach ($arrayofstreamtodisable as $streamtodisable) { if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) { stream_wrapper_unregister($streamtodisable); From e12bfb3e3cb9d89384cfb33be168f69e4ac2d97c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jul 2023 17:31:27 +0200 Subject: [PATCH 0256/1137] Can re-enable a default disabled stream with conf.php --- htdocs/core/class/dolgeoip.class.php | 2 ++ htdocs/filefunc.inc.php | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 607cd1053af..2aaaf2e666f 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -56,11 +56,13 @@ class DolGeoIP if ($type == 'country') { // geoip may have been already included with PEAR if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) { + stream_wrapper_restore('phar'); require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar'; } } elseif ($type == 'city') { // geoip may have been already included with PEAR if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) { + stream_wrapper_restore('phar'); require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar'; } } else { diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c992136f116..d110660b6f5 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -61,18 +61,6 @@ if (defined('DOL_INC_FOR_VERSION_ERROR')) { return; } - -// Disable some not used PHP stream -$listofwrappers = stream_get_wrappers(); -// We need '.phar' for geoip2. TODO Replace phar with explode files so we can disable phar. -$arrayofstreamtodisable = array('compress.zlib', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'rar', 'zip', 'zlib'); -foreach ($arrayofstreamtodisable as $streamtodisable) { - if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) { - stream_wrapper_unregister($streamtodisable); - } -} - - // Define vars $conffiletoshowshort = "conf.php"; // Define localization of conf file @@ -87,10 +75,22 @@ $conffiletoshow = "htdocs/conf/conf.php"; // Include configuration // --- End of part replaced by Dolibarr packager makepack-dolibarr - // Include configuration $result = @include_once $conffile; // Keep @ because with some error reporting this break the redirect done when file not found +// Disable some not used PHP stream +$listofwrappers = stream_get_wrappers(); +// We need '.phar' for geoip2. TODO Replace phar with explode files so we can disable phar. +$arrayofstreamtodisable = array('compress.zlib', 'compress.bzip2', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'rar', 'zip', 'zlib'); +foreach ($arrayofstreamtodisable as $streamtodisable) { + if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) { + if (!empty($dolibarr_main_stream_enabled) && is_array($dolibarr_main_stream_enabled) && in_array($streamtodisable, $dolibarr_main_stream_enabled)) { + continue; // We do not disable this stream + } + stream_wrapper_unregister($streamtodisable); + } +} + if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) { // If install not done and we are in a web session if (!empty($_SERVER["CONTEXT_PREFIX"])) { // CONTEXT_PREFIX and CONTEXT_DOCUMENT_ROOT are not defined on all apache versions $path = $_SERVER["CONTEXT_PREFIX"]; // example '/dolibarr/' when using an apache alias. From 2f8130d74a0ee47c0170aeb2a20cb140197fe8e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jul 2023 21:02:52 +0200 Subject: [PATCH 0257/1137] NEW Add tab Events/Agenda on recurring invoices --- htdocs/compta/facture/agenda-rec.php | 263 ++++++++++++++++++ htdocs/compta/facture/card-rec.php | 19 +- .../facture/class/facture-rec.class.php | 38 +++ htdocs/core/lib/company.lib.php | 14 +- htdocs/core/lib/invoice.lib.php | 36 ++- htdocs/langs/en_US/bills.lang | 1 + 6 files changed, 353 insertions(+), 18 deletions(-) create mode 100644 htdocs/compta/facture/agenda-rec.php diff --git a/htdocs/compta/facture/agenda-rec.php b/htdocs/compta/facture/agenda-rec.php new file mode 100644 index 00000000000..c70d3176c5d --- /dev/null +++ b/htdocs/compta/facture/agenda-rec.php @@ -0,0 +1,263 @@ + + * + * 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/compta/facture/agenda-rec.php + * \ingroup facture + * \brief Tab of events on Invoices + */ +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array("bills", "other")); + +// Get parameters +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); + +if (GETPOST('actioncode', 'array')) { + $actioncode = GETPOST('actioncode', 'array', 3); + if (!count($actioncode)) { + $actioncode = '0'; + } +} else { + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); +} +$search_rowid = GETPOST('search_rowid'); +$search_agenda_label = GETPOST('search_agenda_label'); + +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1) { + $page = 0; +} // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortfield) { + $sortfield = 'a.datep,a.id'; +} +if (!$sortorder) { + $sortorder = 'DESC,DESC'; +} + +// Initialize technical objects +$object = new FactureRec($db); +$extrafields = new ExtraFields($db); +$hookmanager->initHooks(array('invoicerecagenda', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->facture->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; +} + +$permissiontoread = $user->hasRight("facture", "lire"); +$permissiontoadd = $user->hasRight("facture", "creer"); + +// Security check +if (!empty($user->socid)) { + $socid = $user->socid; +} +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +restrictedArea($user, 'facture', $object->id, 'facture_rec', '', 'fk_soc', 'rowid', $isdraft); + + +/* + * Actions + */ + +$parameters = array('id'=>$id); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + // Cancel + if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $actioncode = ''; + $search_agenda_label = ''; + } +} + + + +/* + * View + */ + +$form = new Form($db); + +if ($object->id > 0) { + $title = $langs->trans("Agenda"); + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + $help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung'; + llxHeader('', $title, $help_url); + + if (isModEnabled('notification')) { + $langs->load("mails"); + } + $head = invoice_rec_prepare_head($object); + + + print dol_get_fiche_head($head, 'agenda', $langs->trans("RepeatableInvoice"), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = ''; + if ($action != 'editref') { + $morehtmlref .= $form->editfieldkey($object->ref, 'ref', $object->ref, $object, 0, '', '', 0, 2); + } else { + $morehtmlref .= $form->editfieldval('', 'ref', $object->ref, $object, 0, 'string'); + } + + $morehtmlref .= '
'; + // Thirdparty + $morehtmlref .= $object->thirdparty->getNomUrl(1); + // Project + if (isModEnabled('project')) { + $langs->load("projects"); + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify') { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } + } + } + $morehtmlref .= '
'; + + $morehtmlright = ''; + + dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright); + + print '
'; + print '
'; + + $object->info($object->id); + dol_print_object_info($object, 1); + + print '
'; + + print dol_get_fiche_end(); + + + + // Actions buttons + + $objthirdparty = $object; + $objcon = new stdClass(); + + $out = '&origin='.urlencode($object->element.(property_exists($object, 'module') ? '@'.$object->module : '')).'&originid='.urlencode($object->id); + $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; + $out .= '&backtopage='.urlencode($urlbacktopage); + $permok = $user->hasRight('paymentbagendaybanktransfer', 'myactions', 'create'); + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + $morehtmlright = ''; + + //$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id; + //$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); + //$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; + //$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); + + if (isModEnabled('agenda')) { + /* + if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + } else { + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); + } + */ + } + + + if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { + print '
'; + + $param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : ''); + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.((int) $limit); + } + + // Try to know count of actioncomm from cache + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; + $cachekey = 'count_events_facture_'.$object->id; + $nbEvent = dol_getcache($cachekey); + + print_barre_liste($langs->trans("ActionsOnBillRec").(is_numeric($nbEvent) ? '('.$nbEvent.')': ''), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); + //print_barre_liste($langs->trans("ActionsOnBill"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + $filters['search_rowid'] = $search_rowid; + + // TODO Replace this with same code than into list.php + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, property_exists($object, 'module') ? $object->module : ''); + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 7004ef52a0a..902fb27cbd4 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1224,26 +1224,17 @@ if ($action == 'create') { //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->hasRight('facture', 'creer'), 'string', '', 0, 1); //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->hasRight('facture', 'creer'), 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; + $morehtmlref .= '
'; if ($user->hasRight('facture', 'creer')) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { if (!empty($object->fk_project)) { $proj = new Project($db); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index dc2181e8e46..e58f0ee9f55 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1649,6 +1649,44 @@ class FactureRec extends CommonInvoice return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } + /** + * Load miscellaneous information for tab "Info" + * + * @param int $id Id of object to load + * @return void + */ + public function info($id) + { + $sql = 'SELECT c.rowid, datec, tms as datem,'; + $sql .= ' fk_user_author, fk_user_modif'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as c'; + $sql .= ' WHERE c.rowid = '.((int) $id); + + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + if ($obj->fk_user_modif) { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modif); + $this->user_modification = $muser; + } + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + } + $this->db->free($result); + } else { + dol_print_error($this->db); + } + } + /** * Initialise an instance with random values. * Used to build previews or test instances. diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 02c4fccabed..0cd791fcd18 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1672,8 +1672,12 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql .= ", ".MAIN_DB_PREFIX."bom_bom as o"; } elseif (is_object($filterobj) && get_class($filterobj) == 'Contrat') { $sql .= ", ".MAIN_DB_PREFIX."contrat as o"; - } elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && (!empty($filterobj->fields['ref']) && is_array($filterobj->fields['ref']) || $filterobj->fields['label'] && is_array($filterobj->fields['label'])) && $filterobj->table_element && $filterobj->element) { + } elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) + && ((!empty($filterobj->fields['ref']) && is_array($filterobj->fields['ref'])) || (!empty($filterobj->fields['label']) && is_array($filterobj->fields['label'])) || (!empty($filterobj->fields['titre']) && is_array($filterobj->fields['titre']))) + && $filterobj->table_element && $filterobj->element) { $sql .= ", ".MAIN_DB_PREFIX.$filterobj->table_element." as o"; + } elseif (is_object($filterobj)) { + return 'Bad value for $filterobj'; } $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; @@ -1724,12 +1728,16 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin if ($filterobj->id) { $sql .= " AND a.fk_element = ".((int) $filterobj->id); } - } elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && (!empty($filterobj->fields['ref']) && is_array($filterobj->fields['ref']) || $filterobj->fields['label'] && is_array($filterobj->fields['label'])) && $filterobj->table_element && $filterobj->element) { - // Generic case + } elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) + && ((!empty($filterobj->fields['ref']) && is_array($filterobj->fields['ref'])) || (!empty($filterobj->fields['label']) && is_array($filterobj->fields['label'])) || (!empty($filterobj->fields['titre']) && is_array($filterobj->fields['titre']))) + && $filterobj->table_element && $filterobj->element) { + // Generic case (if there is a $filterobj and a field rowid and (ref or label) exists. $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element).($module ? "@".$module : "")."'"; if ($filterobj->id) { $sql .= " AND a.fk_element = ".((int) $filterobj->id); } + } elseif (is_object($filterobj)) { + return 'Bad value for $filterobj'; } } diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 9a9b986fb8e..70acc2bc34d 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -250,7 +250,7 @@ function invoice_admin_prepare_head() */ function invoice_rec_prepare_head($object) { - global $db, $langs, $conf; + global $db, $langs, $conf, $user; $h = 0; $head = array(); @@ -260,6 +260,40 @@ function invoice_rec_prepare_head($object) $head[$h][2] = 'card'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/agenda-rec.php?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { + $nbEvent = 0; + // Enable caching of thirdparty count actioncomm + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; + $cachekey = 'count_events_facturerec_'.$object->id; + $dataretrieved = dol_getcache($cachekey); + if (!is_null($dataretrieved)) { + $nbEvent = $dataretrieved; + } else { + $sql = "SELECT COUNT(id) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm"; + $sql .= " WHERE fk_element = ".((int) $object->id); + $sql .= " AND elementtype = 'invoicerec'"; + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + $nbEvent = $obj->nb; + } else { + dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR); + } + dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. + } + + $head[$h][1] .= '/'; + $head[$h][1] .= $langs->trans("Agenda"); + if ($nbEvent > 0) { + $head[$h][1] .= ''.$nbEvent.''; + } + } + $head[$h][2] = 'agenda'; + $h++; + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index ad806050632..9b6af76a564 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -164,6 +164,7 @@ BillFrom=From BillTo=To ShippingTo=Shipping to ActionsOnBill=Actions on invoice +ActionsOnBillRec=Actions on recurring invoice RecurringInvoiceTemplate=Template / Recurring invoice NoQualifiedRecurringInvoiceTemplateFound=No recurring template invoice qualified for generation. FoundXQualifiedRecurringInvoiceTemplate=Found %s recurring template invoice(s) qualified for generation. From 9b31b26b11e4d8aa83b8f9d439956062d626662e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 04:42:46 +0200 Subject: [PATCH 0258/1137] Doc --- htdocs/langs/en_US/stocks.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 26a12755f6e..176857c0c6b 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -239,7 +239,7 @@ InventoryForASpecificWarehouse=Inventory for a specific warehouse InventoryForASpecificProduct=Inventory for a specific product 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) +AlwaysShowFullArbo=Display the full path of a warehouse (parent warehouses) on the 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 StockAtDateFutureDesc=You can view here the stock (virtual stock) at a given date in the future CurrentStock=Current stock From 78212d3b9d4bd646ec07bcc7ff7db518208676e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 18:32:44 +0200 Subject: [PATCH 0259/1137] Fix warning --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index d282d29d262..85576e467ec 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1502,8 +1502,10 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size + 3); + $w = 100; + $posy = $this->marge_haute; - $posx = $this->page_largeur - $this->marge_droite - 100; + $posx = $this->page_largeur - $this->marge_droite - $w; $pdf->SetXY($this->marge_gauche, $posy); From f580a9aca4047f616c80205d82290cbef6bb1101 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 18:33:03 +0200 Subject: [PATCH 0260/1137] NEW Add a CLI tool to regenerate all documents --- scripts/doc/regenerate_docs.php | 132 ++++++++++++++++++++++++++ scripts/product/regenerate_thumbs.php | 4 +- 2 files changed, 134 insertions(+), 2 deletions(-) create mode 100755 scripts/doc/regenerate_docs.php diff --git a/scripts/doc/regenerate_docs.php b/scripts/doc/regenerate_docs.php new file mode 100755 index 00000000000..d819be0bbff --- /dev/null +++ b/scripts/doc/regenerate_docs.php @@ -0,0 +1,132 @@ +#!/usr/bin/env php + + * Copyright (C) 2015 Jean Heimburger + * + * 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 scripts/doc/regenerate_docs.php + * \ingroup scripts + * \brief Regenerated main documents into documents directory + */ + +if (!defined('NOSESSION')) { + define('NOSESSION', '1'); +} + +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path = __DIR__.'/'; + +// Test if batch mode +if (substr($sapi_type, 0, 3) == 'cgi') { + echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; + exit(-1); +} + +@set_time_limit(0); // No timeout for this script +define('EVEN_IF_ONLY_LOGIN_ALLOWED', 1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only". + +// Include and load Dolibarr environment variables +require_once $path."../../htdocs/master.inc.php"; +require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/images.lib.php"; +// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file). +// $user is created but empty. + +// $langs->setDefaultLang('en_US'); // To change default language of $langs +$langs->load("main"); // To load language file for default language + +// Global variables +$version = DOL_VERSION; +$error = 0; +$forcecommit = 0; + +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',', $argv)); + +if (empty($argv[1])) { + print "Usage: $script_file subdirtoscan (in ".DOL_DATA_ROOT.")\n"; + print "Example: $script_file propale\n"; + exit(-1); +} + +print '--- start'."\n"; + +$dir = DOL_DATA_ROOT; +$subdir = $argv[1]; +if (empty($dir) || empty($subdir)) { + dol_print_error('', 'dir not defined'); + exit(1); +} +if (!dol_is_dir($dir.'/'.$subdir)) { + print 'Directory '.$dir.'/'.$subdir.' not found.'."\n"; + exit(2); +} + +print 'Scan directory '.$dir.'/'.$subdir."\n"; + +$filearray = dol_dir_list($dir.'/'.$subdir, "directories", 0, '', 'temp$'); + +$nbok = $nbko = 0; + +require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"; + +foreach ($filearray as $keyf => $valf) { + $ref = basename($valf['name']); + print 'Process document for dir = '.$subdir.', ref '.$ref."\n"; + + if ($subdir == 'propale') { + $tmpobject = new Propal($db); + $ret1 = $tmpobject->fetch(0, $ref); + $ret2 = $tmpobject->fetch_thirdparty(); + + if ($ret1 > 0) { + //$tmpobject->build + //$tmpobject->setDocModel($user, GETPOST('model', 'alpha')); + $outputlangs = $langs; + $newlang = ''; + + if (!empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + + $hidedetails = 0; + $hidedesc = 0; + $hideref = 0; + $moreparams = null; + + $result = $tmpobject->generateDocument($tmpobject->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + if ($result <= 0) { + print 'File '.$tmpobject->model_pdf.' regenerated'."\n"; + $nbko++; + } else { + $nbok++; + } + } else { + $nbko++; + } + } +} + +print $nbok." objects processed\n"; +print $nbko." objects with errors\n"; + +$db->close(); // Close $db database opened handler + +exit($error); diff --git a/scripts/product/regenerate_thumbs.php b/scripts/product/regenerate_thumbs.php index f4e50c0555a..1574f377035 100755 --- a/scripts/product/regenerate_thumbs.php +++ b/scripts/product/regenerate_thumbs.php @@ -18,9 +18,9 @@ */ /** - * \file scripts/product/migrate_picture_path.php + * \file scripts/product/regenerate_thumbs.php * \ingroup scripts - * \brief Migrate pictures from old system prior to 3.7 to new path for 3.7+ + * \brief Regenerated thumbs of image files for products */ if (!defined('NOSESSION')) { From 6748835cee62c5662b261edc60b48d624bd48cfa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 18:42:05 +0200 Subject: [PATCH 0261/1137] Fix warning --- htdocs/core/lib/signature.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index e88d8dd3635..49a250963a1 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -90,7 +90,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) if ($mode == 1) { $out .= "hash('".$securekeyseed."' + '".$type."' + proposal_ref)"; } else { - $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0'); + $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled('multicompany') ? (is_null($object) ? '' : $object->entity) : ''), '0'); } /* if ($mode == 1) { From 980923e4b2bd3f858dc6d9a42044c9268ad3a6bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 18:47:40 +0200 Subject: [PATCH 0262/1137] Fix warnings --- htdocs/core/lib/signature.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 49a250963a1..1e18d570703 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -129,7 +129,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) if ($mode == 1) { $out .= "hash('".$securekeyseed."' + '".$type."' + contract_ref)"; } else { - $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0'); + $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled('multicompany') ? (is_null($object) ? '' : $object->entity) : ''), '0'); } } elseif ($type == 'fichinter') { $securekeyseed = isset($conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN : ''; @@ -144,13 +144,13 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) if ($mode == 1) { $out .= "hash('".$securekeyseed."' + '".$type."' + fichinter_ref)"; } else { - $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0'); + $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled('multicompany') ? (is_null($object) ? '' : $object->entity) : ''), '0'); } } // For multicompany if (!empty($out) && isModEnabled('multicompany')) { - $out .= "&entity=".$object->entity; // Check the entity because we may have the same reference in several entities + $out .= "&entity=".(is_null($object) ? '' : $object->entity); // Check the entity because we may have the same reference in several entities } return $out; From c0d75460adc77cd1f5151c7b0be792f0b3b8cca4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 18:52:31 +0200 Subject: [PATCH 0263/1137] Fix warning --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 57a9e81ddef..6c60efe4c95 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -390,6 +390,7 @@ class pdf_cyan extends ModelePDFPropales $tab_top = 90 + $top_shift; $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); + $nexY = $tab_top; // Incoterm $height_incoterms = 0; From a8347300b512967b0fcf7d68d18fcf8b3be51367 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 18:56:01 +0200 Subject: [PATCH 0264/1137] Finish tool to regenerate proposal files --- scripts/doc/regenerate_docs.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/doc/regenerate_docs.php b/scripts/doc/regenerate_docs.php index d819be0bbff..19da7751819 100755 --- a/scripts/doc/regenerate_docs.php +++ b/scripts/doc/regenerate_docs.php @@ -113,14 +113,16 @@ foreach ($filearray as $keyf => $valf) { $result = $tmpobject->generateDocument($tmpobject->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); if ($result <= 0) { - print 'File '.$tmpobject->model_pdf.' regenerated'."\n"; $nbko++; } else { + print 'File for ref '.$tmpobject->ref.' regenerated with template '.$tmpobject->model_pdf."\n"; $nbok++; } } else { $nbko++; } + } else { + print 'Dir '.$subdir.' not yet supported'."\n"; } } From 672f3284c69eeaf4bd73da6756105dda149fdcde Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 19:05:21 +0200 Subject: [PATCH 0265/1137] Debug --- scripts/doc/regenerate_docs.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/doc/regenerate_docs.php b/scripts/doc/regenerate_docs.php index 19da7751819..cc173327722 100755 --- a/scripts/doc/regenerate_docs.php +++ b/scripts/doc/regenerate_docs.php @@ -56,12 +56,12 @@ $version = DOL_VERSION; $error = 0; $forcecommit = 0; -print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." - dir=".DOL_DATA_ROOT." *****\n"; dol_syslog($script_file." launched with arg ".join(',', $argv)); if (empty($argv[1])) { - print "Usage: $script_file subdirtoscan (in ".DOL_DATA_ROOT.")\n"; - print "Example: $script_file propale\n"; + print "Usage: $script_file subdirtoscan (test|confirm)\n"; + print "Example: $script_file propale test\n"; exit(-1); } @@ -111,9 +111,15 @@ foreach ($filearray as $keyf => $valf) { $hideref = 0; $moreparams = null; - $result = $tmpobject->generateDocument($tmpobject->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); - if ($result <= 0) { + $result = 0; + if (!empty($argv[2]) && $argv[2] == 'confirm') { + $result = $tmpobject->generateDocument($tmpobject->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + } + if ($result < 0) { $nbko++; + } if ($result == 0) { + print 'File for ref '.$tmpobject->ref.' returned 0 during regeneration with template '.$tmpobject->model_pdf."\n"; + $nbok++; } else { print 'File for ref '.$tmpobject->ref.' regenerated with template '.$tmpobject->model_pdf."\n"; $nbok++; From 7cbc8728a58da10900742e360019d89d9e67e750 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 19:26:07 +0200 Subject: [PATCH 0266/1137] FIX warnings --- .../core/class/commondocgenerator.class.php | 12 +++---- .../asset/doc/pdf_standard_asset.modules.php | 12 +++++-- .../commande/doc/pdf_einstein.modules.php | 12 +++++-- .../commande/doc/pdf_eratosthene.modules.php | 12 +++++-- .../doc/doc_generic_invoice_odt.modules.php | 31 ++++++++++--------- .../facture/doc/pdf_sponge.modules.php | 12 +++++-- .../product/doc/pdf_standard.modules.php | 18 ++++++++--- .../modules/propale/doc/pdf_cyan.modules.php | 12 +++++-- .../doc/pdf_eagle_proforma.modules.php | 18 ++++++++--- .../supplier_order/doc/pdf_cornas.modules.php | 12 +++++-- .../doc/pdf_muscadet.modules.php | 12 +++++-- .../doc/pdf_aurore.modules.php | 12 +++++-- htdocs/includes/odtphp/Segment.php | 4 +-- .../doc/pdf_standard_myobject.modules.php | 12 +++++-- 14 files changed, 142 insertions(+), 49 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 7e85071e453..76e104be4ea 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -272,7 +272,7 @@ abstract class CommonDocGenerator 'mycompany_idprof5'=>$mysoc->idprof5, 'mycompany_idprof6'=>$mysoc->idprof6, 'mycompany_vatnumber'=>$mysoc->tva_intra, - 'mycompany_object'=>$mysoc->object, + 'mycompany_socialobject'=>$mysoc->socialobject, 'mycompany_note_private'=>$mysoc->note_private, //'mycompany_note_public'=>$mysoc->note_public, // Only private not exists for "mysoc" but both for thirdparties ); @@ -516,11 +516,11 @@ abstract class CommonDocGenerator $array_key.'_incoterms' => (method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''), - $array_key.'_bank_iban'=>$bank_account->iban, - $array_key.'_bank_bic'=>$bank_account->bic, - $array_key.'_bank_label'=>$bank_account->label, - $array_key.'_bank_number'=>$bank_account->number, - $array_key.'_bank_proprio'=>$bank_account->proprio, + $array_key.'_bank_iban' => (!empty($bank_account) ? $bank_account->iban : ''), + $array_key.'_bank_bic' => (!empty($bank_account) ? $bank_account->bic : ''), + $array_key.'_bank_label' => (!empty($bank_account) ? $bank_account->label : ''), + $array_key.'_bank_number' => (!empty($bank_account) ? $bank_account->number : ''), + $array_key.'_bank_proprio' => (!empty($bank_account) ? $bank_account->proprio : ''), $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs), $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 75fb8025e42..56057582d11 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -706,10 +706,18 @@ class pdf_standard_asset extends ModelePDFAsset // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 9f8008dda11..3f1a62c1b2b 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -566,10 +566,18 @@ class pdf_einstein extends ModelePDFCommandes // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 458cc39dd27..f6f9cf79bfa 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -784,10 +784,18 @@ class pdf_eratosthene extends ModelePDFCommandes // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 9e203e8d5ce..ba273ef270c 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -330,12 +330,13 @@ class doc_generic_invoice_odt extends ModelePDFFactures $object->fetchObjectLinked('', '', '', ''); //print_r($object->linkedObjects['propal']); exit; - $array_propal_object = $object->linkedObjects['propal']; - if (isset($array_propal_object) && is_array($array_propal_object) && count($array_propal_object) > 0) { - $tmparrayofvalue = array_values($array_propal_object); - $propal_object = $tmparrayofvalue[0]; - } else { - $propal_object = null; + $propal_object = null; + if (!empty($object->linkedObjects['propal'])) { + $array_propal_object = $object->linkedObjects['propal']; + if (isset($array_propal_object) && is_array($array_propal_object) && count($array_propal_object) > 0) { + $tmparrayofvalue = array_values($array_propal_object); + $propal_object = $tmparrayofvalue[0]; + } } // Make substitution @@ -411,15 +412,15 @@ class doc_generic_invoice_odt extends ModelePDFFactures // TODO Search all tags {object_...:xxxx} into template then loop on this found tags to analyze them and the the corresponding // property of object and use the xxxx to know how to format it. // Before that, we hard code this substitution as if we have found them into the template. - $tmparray['object_PREVIOUS_MONTH'] = dol_print_date(dol_time_plus_duree($this->date, -1, 'm'), '%m'); - $tmparray['object_MONTH'] = dol_print_date($this->date, '%m'); - $tmparray['object_NEXT_MONTH'] = dol_print_date(dol_time_plus_duree($this->date, 1, 'm'), '%m'); - $tmparray['object_PREVIOUS_MONTH_TEXT'] = dol_print_date(dol_time_plus_duree($this->date, -1, 'm'), '%B'); - $tmparray['object_MONTH_TEXT'] = dol_print_date($this->date, '%B'); - $tmparray['object_NEXT_MONTH_TEXT'] = dol_print_date(dol_time_plus_duree($this->date, 1, 'm'), '%B'); - $tmparray['object_PREVIOUS_YEAR'] = dol_print_date(dol_time_plus_duree($this->date, -1, 'y'), '%Y'); - $tmparray['object_YEAR'] = dol_print_date($this->date, '%Y'); - $tmparray['object_NEXT_YEAR'] = dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y'); + $tmparray['object_PREVIOUS_MONTH'] = dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m'); + $tmparray['object_MONTH'] = dol_print_date($object->date, '%m'); + $tmparray['object_NEXT_MONTH'] = dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m'); + $tmparray['object_PREVIOUS_MONTH_TEXT'] = dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B'); + $tmparray['object_MONTH_TEXT'] = dol_print_date($object->date, '%B'); + $tmparray['object_NEXT_MONTH_TEXT'] = dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B'); + $tmparray['object_PREVIOUS_YEAR'] = dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y'); + $tmparray['object_YEAR'] = dol_print_date($object->date, '%Y'); + $tmparray['object_NEXT_YEAR'] = dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y'); // Call the ODTSubstitution hook $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index fbf1907ec7d..b219888596c 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -950,10 +950,18 @@ class pdf_sponge extends ModelePDFFactures // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index afcb9503997..3cd29891550 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -481,10 +481,20 @@ class pdf_standard extends ModelePDFProduct } // retrieve global local tax - if ($localtax1_type && $localtax1ligne != 0) - $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2_type && $localtax2ligne != 0) - $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; + if ($localtax1_type && $localtax1ligne != 0) { + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } + } + if ($localtax2_type && $localtax2ligne != 0) { + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } + } if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 6c60efe4c95..7bb166c59b7 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -795,10 +795,18 @@ class pdf_cyan extends ModelePDFPropales // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 69c1ed27a51..83f0cb802e9 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -704,10 +704,20 @@ class pdf_eagle_proforma extends ModelePDFCommandes } // retrieve global local tax - if ($localtax1_type && $localtax1ligne != 0) - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; - if ($localtax2_type && $localtax2ligne != 0) - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if ($localtax1_type && $localtax1ligne != 0) { + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } + } + if ($localtax2_type && $localtax2ligne != 0) { + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } + } if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate .= '*'; if (!isset($this->tva[$vatrate])) $this->tva[$vatrate] = 0; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 230a46ed90a..f651951fb98 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -725,10 +725,18 @@ class pdf_cornas extends ModelePDFSuppliersOrders // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 1206d91a794..1b90c123e99 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -603,10 +603,18 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 046c72cd06b..84c13dc0ee6 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -589,10 +589,18 @@ class pdf_aurore extends ModelePDFSupplierProposal // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index b57983321a3..928cefcd1bf 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -180,8 +180,8 @@ class Segment implements IteratorAggregate, Countable '/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u', '/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u', '/__CURRENTYEAR__/u','/__NEXTYEAR__/u' ); - $values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['weekday']), - $hoy['mon'], $langs->transnoentitiesnoconv($hoy['month']), + $values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['wday']), + $hoy['mon'], monthArray($langs)[$hoy['mon']], $nextMonth, monthArray($langs)[$nextMonth], $hoy['year'], $hoy['year']+1 ); diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index d3c717bcd3c..5dca1a952b1 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -672,10 +672,18 @@ class pdf_standard_myobject extends ModelePDFMyObject // retrieve global local tax if ($localtax1_type && $localtax1ligne != 0) { - $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) { + $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne; + } else { + $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne; + } } if ($localtax2_type && $localtax2ligne != 0) { - $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) { + $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne; + } else { + $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne; + } } if (($object->lines[$i]->info_bits & 0x01) == 0x01) { From 506da9fea0925d4a4fed35981cf90ac5f95725d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Jul 2023 19:44:23 +0200 Subject: [PATCH 0267/1137] Debug script --- scripts/doc/regenerate_docs.php | 39 +++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/scripts/doc/regenerate_docs.php b/scripts/doc/regenerate_docs.php index cc173327722..b0a3ee17cf2 100755 --- a/scripts/doc/regenerate_docs.php +++ b/scripts/doc/regenerate_docs.php @@ -84,14 +84,37 @@ $filearray = dol_dir_list($dir.'/'.$subdir, "directories", 0, '', 'temp$'); $nbok = $nbko = 0; -require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"; - -foreach ($filearray as $keyf => $valf) { - $ref = basename($valf['name']); - print 'Process document for dir = '.$subdir.', ref '.$ref."\n"; - - if ($subdir == 'propale') { +$tmpobject = null; +if ($subdir == 'propale' || $subdir == 'proposal') { + if (isModEnabled('propal')) { + require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"; $tmpobject = new Propal($db); + } else { + print 'Error, module not enabled'."\n"; + } +} else if ($subdir == 'commande' || $subdir == 'order') { + if (isModEnabled('commande')) { + require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"; + $tmpobject = new Commande($db); + } else { + print 'Error, module not enabled'."\n"; + } +} else if ($subdir == 'facture' || $subdir == 'invoice') { + if (isModEnabled('facture')) { + require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"; + $tmpobject = new Facture($db); + } else { + print 'Error, module not enabled'."\n"; + } +} else { + print 'Dir '.$subdir.' not yet supported'."\n"; +} + +if ($tmpobject) { + foreach ($filearray as $keyf => $valf) { + $ref = basename($valf['name']); + print 'Process document for dir = '.$subdir.', ref '.$ref."\n"; + $ret1 = $tmpobject->fetch(0, $ref); $ret2 = $tmpobject->fetch_thirdparty(); @@ -127,8 +150,6 @@ foreach ($filearray as $keyf => $valf) { } else { $nbko++; } - } else { - print 'Dir '.$subdir.' not yet supported'."\n"; } } From 79f645f9e196f8acebd40a6b286b618df387c728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 31 Jul 2023 01:36:33 +0200 Subject: [PATCH 0268/1137] clean code (#25516) --- htdocs/core/boxes/box_produits.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 35d91d34064..508787bba92 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015-2021 Frederic France + * Copyright (C) 2015-2023 Frederic 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 @@ -61,8 +61,8 @@ class box_produits extends ModeleBoxes $this->db = $db; - $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); - $tmpentry = array('enabled'=>(isModEnabled("product") || isModEnabled("service")), 'perms'=>(!empty($user->rights->produit->lire) || $user->hasRight('service', 'lire')), 'module'=>'product|service'); + $listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); + $tmpentry = array('enabled'=>(isModEnabled("product") || isModEnabled("service")), 'perms'=>($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')), 'module'=>'product|service'); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $this->hidden = ($showmode != 1); } @@ -84,7 +84,7 @@ class box_produits extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLastProducts", $max)); - if ($user->rights->produit->lire || $user->hasRight('service', 'lire')) { + if ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')) { $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression, p.entity"; $sql .= ", p.accountancy_code_sell"; $sql .= ", p.accountancy_code_sell_intra"; @@ -95,10 +95,10 @@ class box_produits extends ModeleBoxes $sql .= ', p.barcode'; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= ' WHERE p.entity IN ('.getEntity($productstatic->element).')'; - if (empty($user->rights->produit->lire)) { + if (!$user->hasRight('produit', 'lire')) { $sql .= ' AND p.fk_product_type != 0'; } - if (empty($user->rights->service->lire)) { + if (!$user->hasRight('service', 'lire')) { $sql .= ' AND p.fk_product_type != 1'; } // Add where from hooks From 4dc4d492c7252f555f4e4c68530bd0a668fef3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 31 Jul 2023 01:37:04 +0200 Subject: [PATCH 0269/1137] Fix Undefined variable dol_dst (#25514) --- htdocs/public/test/test_forms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index b7ed524e297..5352db64d11 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -42,7 +42,7 @@ print '
'; // You can use div-table-responsive- print "Test 1a: We must have here current date and hour for user (must match hour on browser). Note: Check your are logged so user TZ and DST are known."; $offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; $offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; -print " (dol_tz=".$offsettz." dol_dst=".$dol_dst.")
\n"; +print " (dol_tz=".$offsettz." dol_dst=".$offsetdst.")
\n"; print $form->selectDate(dol_now(), 'test1a', 1, 1, 0); print '

'."\n"; From e2915d29792f2f22e57778a33bc65ff39a9047f7 Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Mon, 31 Jul 2023 01:41:24 +0200 Subject: [PATCH 0270/1137] NEW Add picto in product/service list in object lines (#25511) --- htdocs/core/class/html.form.class.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d258d5726a4..e067fbcf56f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3547,7 +3547,25 @@ class Form $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '$1', $label, 1); } - $optlabel = $objp->ref; + switch ($objp->fk_product_type) { + case Product::TYPE_PRODUCT: + $picto = 'product'; + break; + case Product::TYPE_SERVICE: + $picto = 'service'; + break; + default: + $picto = ''; + break; + } + + if (empty($picto)) { + $optlabel = ''; + } else { + $optlabel = img_object('', $picto, 'class="paddingright classfortooltip"', 0, 0, 1); + } + + $optlabel .= $objp->ref; if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { $optlabel .= ' (' . $objp->ref_fourn . ')'; } From cdc8bc1b6f1f86edb547d380be8e29b5c2f808ae Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Mon, 31 Jul 2023 01:54:49 +0200 Subject: [PATCH 0271/1137] FIX add notification hook to allow external module trigger (#25506) --- ...ace_50_modNotification_Notification.class.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 1aa21dbd1ba..23c81df9c9a 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -66,10 +66,25 @@ class InterfaceNotification extends DolibarrTriggers */ public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { + global $hookmanager; + if (empty($conf->notification) || !isModEnabled('notification')) { return 0; // Module not active, we do nothing } + if (!is_object($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($this->db); + } + $hookmanager->initHooks(array('notification')); + + $reshook = $hookmanager->executeHooks('notifsupported', $parameters, $object, $action); + if (empty($reshook)) { + if (!empty($hookmanager->resArray['arrayofnotifsupported'])) { + $this->listofmanagedevents = array_merge($this->listofmanagedevents, $hookmanager->resArray['arrayofnotifsupported']); + } + } + // If the trigger code is not managed by the Notification module if (!in_array($action, $this->listofmanagedevents)) { return 0; @@ -83,7 +98,6 @@ class InterfaceNotification extends DolibarrTriggers return 1; } - /** * Return list of events managed by notification module * From f6a5cc67c8a2513508cfa285ea34bbd6e3a6474b Mon Sep 17 00:00:00 2001 From: iouston <4319513+iouston@users.noreply.github.com> Date: Mon, 31 Jul 2023 02:00:55 +0200 Subject: [PATCH 0272/1137] Add hdden option ACCOUNTANCY_JOURNAL_USE_CURRENT_MONTH (#25499) Sometimes customers ask to have the current month by default on this form, so this option did it --- htdocs/accountancy/journal/sellsjournal.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 7cae93566c6..b37f94483f9 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -101,6 +101,10 @@ if (empty($date_startmonth) || empty($date_endmonth)) { $pastmonth = $dates['pastmonth']; } +if($conf->global->ACCOUNTANCY_JOURNAL_USE_CURRENT_MONTH){ + $pastmonth+=1; +} + if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false); $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false); From bcce9da09d8899847f39f811d2ddcdc3122a0bb4 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 31 Jul 2023 02:36:10 +0200 Subject: [PATCH 0273/1137] New : add a dashboard showing number of orders to bill #17963 (#18600) * New : add a dashboard showing number of orders to bill #17963 * Fix orders statuses for dashboard and list * Fix label in dashboard --- htdocs/commande/class/commande.class.php | 45 ++++++++++++++++++++---- htdocs/commande/list.php | 17 ++++----- htdocs/index.php | 9 +++-- 3 files changed, 51 insertions(+), 20 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 64dd3ad564a..e49622c4896 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3571,9 +3571,10 @@ class Commande extends CommonOrder * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Object user + * @param String $mode Mode (toship, tobill, shippedtobill) * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - public function load_board($user) + public function load_board($user, $mode) { // phpcs:enable global $conf, $langs; @@ -3589,18 +3590,48 @@ class Commande extends CommonOrder } $sql .= $clause." c.entity IN (".getEntity('commande').")"; //$sql.= " AND c.fk_statut IN (1,2,3) AND c.facture = 0"; - $sql .= " AND ((c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.")) OR (c.fk_statut = ".self::STATUS_CLOSED." AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected + if ($mode == 'toship') { + // An order to ship is an open order (validated or in progress) + $sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ")"; + } + if ($mode == 'tobill') { + // An order to bill is an order not already billed + $sql .= " AND c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_SHIPMENTONPROCESS . ", " . self::STATUS_CLOSED . ") AND c.facture = 0"; + } + if ($mode == 'shippedtobill') { + // An order shipped and to bill is a delivered order not already billed + $sql .= " AND c.fk_statut IN (" . self::STATUS_CLOSED . ") AND c.facture = 0"; + } if ($user->socid) { $sql .= " AND c.fk_soc = ".((int) $user->socid); } $resql = $this->db->query($sql); if ($resql) { + $delay_warning = 0; + $label = $labelShort = $url = ''; + if ($mode == 'toship') { + $delay_warning = $conf->commande->client->warning_delay / 60 / 60 / 24; + $url = DOL_URL_ROOT.'/commande/list.php?search_status=-2&mainmenu=commercial&leftmenu=orders'; + $label = $langs->transnoentitiesnoconv("OrdersToProcess"); + $labelShort = $langs->transnoentitiesnoconv("Opened"); + } + if ($mode == 'tobill') { + $url = DOL_URL_ROOT.'/commande/list.php?search_status=-3&search_billed=0&mainmenu=commercial&leftmenu=orders'; + $label = $langs->trans("OrdersToBill"); // We set here bill but may be billed or ordered + $labelShort = $langs->trans("ToBill"); + } + if ($mode == 'shippedtobill') { + $url = DOL_URL_ROOT.'/commande/list.php?search_status=3&search_billed=0&mainmenu=commercial&leftmenu=orders'; + $label = $langs->trans("OrdersToBill"); // We set here bill but may be billed or ordered + $labelShort = $langs->trans("StatusOrderDelivered").' '.$langs->trans("and").' '.$langs->trans("ToBill"); + } + $response = new WorkboardResponse(); - $response->warning_delay = $conf->commande->client->warning_delay / 60 / 60 / 24; - $response->label = $langs->trans("OrdersToProcess"); - $response->labelShort = $langs->trans("Opened"); - $response->url = DOL_URL_ROOT.'/commande/list.php?search_status=-3&mainmenu=commercial&leftmenu=orders'; + $response->warning_delay = $delay_warning; + $response->label = $label; + $response->labelShort = $labelShort; + $response->url = $url; $response->img = img_object('', "order"); $generic_commande = new Commande($this->db); @@ -3615,7 +3646,7 @@ class Commande extends CommonOrder $generic_commande->date_livraison = $this->db->jdate($obj->delivery_date); $generic_commande->delivery_date = $this->db->jdate($obj->delivery_date); - if ($generic_commande->hasDelay()) { + if ($mode == 'toship' && $generic_commande->hasDelay()) { $response->nbtodolate++; } } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 70187b3a6a8..226de495e9a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -897,17 +897,12 @@ if ($search_status <> '') { $sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled } } - if ($search_status == -2) { // "validated + in process" - //$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0'; - $sql .= " AND (c.fk_statut IN (1,2))"; + + if ($search_status == -2) { // To shipp (validated and in progress) + $sql .= " AND c.fk_statut IN (1,2)"; } - if ($search_status == -3) { // "validated + in process + delivered" - //$sql.= ' AND c.fk_statut in (1,2,3)'; - //$sql.= ' AND c.facture = 0'; // invoice not created - $sql .= ' AND (c.fk_statut IN (1,2,3))'; // validated, in process or closed - } - if ($search_status == -4) { // "validate + in progress" - $sql .= ' AND (c.fk_statut IN (1,2))'; // validated, in process + if ($search_status == -3) { // To bill (validated, in progress and shipped but not invoiced) + $sql .= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0'; } } @@ -1741,9 +1736,9 @@ if ($resql) { Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"), Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"), + -2=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"), Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), -3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"), - -2=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"), Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort") ); print $form->selectarray('search_status', $liststatus, $search_status, -5, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1); diff --git a/htdocs/index.php b/htdocs/index.php index 3a015f61bde..c9a4544852b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -209,7 +209,12 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { if (isModEnabled('commande') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('commande', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $board = new Commande($db); - $dashboardlines[$board->element] = $board->load_board($user); + // Number of customer orders to be shipped (validated and in progress) + $dashboardlines[$board->element.'_toship'] = $board->load_board($user, 'toship'); + // Number of customer orders to be billed + $dashboardlines[$board->element.'_tobill'] = $board->load_board($user, 'tobill'); + // Number of customer orders to be billed (delivered but not billed) + $dashboardlines[$board->element.'_shippedtobill'] = $board->load_board($user, 'shippedtobill'); } // Number of suppliers orders a deal @@ -349,7 +354,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'groupName' => 'Orders', 'globalStatsKey' => 'orders', 'stats' => - array('commande'), + array('commande_toship', 'commande_tobill', 'commande_shippedtobill'), ), 'facture' => array( From f901827556770e8ecc5a576df722a472d04c7530 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2023 02:41:03 +0200 Subject: [PATCH 0274/1137] Fix condition --- htdocs/commande/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 226de495e9a..88e558e6e3e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -901,8 +901,8 @@ if ($search_status <> '') { if ($search_status == -2) { // To shipp (validated and in progress) $sql .= " AND c.fk_statut IN (1,2)"; } - if ($search_status == -3) { // To bill (validated, in progress and shipped but not invoiced) - $sql .= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0'; + if ($search_status == -3) { // Processed (validated, in progress and shipped) + $sql .= ' AND c.fk_statut IN (1,2,3)'; } } @@ -1737,8 +1737,8 @@ if ($resql) { Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"), Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"), -2=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"), - Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), -3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"), + Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"), Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort") ); print $form->selectarray('search_status', $liststatus, $search_status, -5, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1); From 7d8ce6a7f0f253db282d3e351159b581cf0e2a55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2023 02:43:22 +0200 Subject: [PATCH 0275/1137] Fix phpcs --- htdocs/accountancy/journal/sellsjournal.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index b37f94483f9..51732a5db04 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -100,8 +100,7 @@ if (empty($date_startmonth) || empty($date_endmonth)) { $pastmonthyear = $dates['pastmonthyear']; $pastmonth = $dates['pastmonth']; } - -if($conf->global->ACCOUNTANCY_JOURNAL_USE_CURRENT_MONTH){ +if (getDolGlobalString('ACCOUNTANCY_JOURNAL_USE_CURRENT_MONTH')) { $pastmonth+=1; } From 9302a427a972bb7f160d7b2e42baddbd2315b35b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2023 03:00:05 +0200 Subject: [PATCH 0276/1137] Debug v19 --- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/index.php | 6 ++++-- htdocs/salaries/card.php | 8 +++++--- .../supplier_proposal/class/supplier_proposal.class.php | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ce1758e7591..2be39830d13 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3448,7 +3448,7 @@ class Propal extends CommonObject * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Object user - * @param int $mode "opened" for proposal to close, "signed" for proposal to invoice + * @param string $mode "opened" for proposal to close, "signed" for proposal to invoice * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ public function load_board($user, $mode) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e49622c4896..42c68e2cbc6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3571,7 +3571,7 @@ class Commande extends CommonOrder * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Object user - * @param String $mode Mode (toship, tobill, shippedtobill) + * @param string $mode Mode ('toship', 'tobill', 'shippedtobill') * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ public function load_board($user, $mode) diff --git a/htdocs/index.php b/htdocs/index.php index c9a4544852b..b1ef9a66d0a 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -211,8 +211,10 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $board = new Commande($db); // Number of customer orders to be shipped (validated and in progress) $dashboardlines[$board->element.'_toship'] = $board->load_board($user, 'toship'); - // Number of customer orders to be billed - $dashboardlines[$board->element.'_tobill'] = $board->load_board($user, 'tobill'); + // Number of customer orders to be billed (not visible by default, does not match a lot of organization). + if (getDolGlobalInt('ORDER_BILL_AFTER_VALIDATION')) { + $dashboardlines[$board->element.'_tobill'] = $board->load_board($user, 'tobill'); + } // Number of customer orders to be billed (delivered but not billed) $dashboardlines[$board->element.'_shippedtobill'] = $board->load_board($user, 'shippedtobill'); } diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 1289a714b7f..877a17e23c2 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -384,7 +384,9 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->salaries->write) } } -if ($action == 'confirm_clone' && $confirm != 'yes') { $action = ''; } +if ($action == 'confirm_clone' && $confirm != 'yes') { + $action = ''; +} if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries->write)) { $db->begin(); @@ -733,9 +735,9 @@ if ($id > 0) { //$formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_date_start', 'label' => $langs->trans("DateStart"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_date_end', 'label' => $langs->trans("DateEnd"), 'value' => -1); - $formquestion[] = array('type' => 'text', 'name' => 'amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount), 'morecss' => 'width100'); + $formquestion[] = array('type' => 'text', 'name' => 'amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount), 'morecss' => 'width100 right'); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 280); } if ($action == 'paid') { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 47514bb4b2f..2896cee6454 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2222,7 +2222,7 @@ class SupplierProposal extends CommonObject * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Object user - * @param int $mode "opened" for askprice to close, "signed" for proposal to invoice + * @param string $mode "opened" for askprice to close, "signed" for proposal to invoice * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ public function load_board($user, $mode) From 016ab201558b9526eed9bcc1232f1e894a68b33c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2023 03:52:05 +0200 Subject: [PATCH 0277/1137] Fix warning --- .../triggers/interface_50_modNotification_Notification.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 23c81df9c9a..ee78895f99b 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -78,6 +78,7 @@ class InterfaceNotification extends DolibarrTriggers } $hookmanager->initHooks(array('notification')); + $parameters = array(); $reshook = $hookmanager->executeHooks('notifsupported', $parameters, $object, $action); if (empty($reshook)) { if (!empty($hookmanager->resArray['arrayofnotifsupported'])) { From 840fe26bdad2187ce9a4936ee553be7296238831 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2023 04:11:56 +0200 Subject: [PATCH 0278/1137] Fix trans --- htdocs/langs/en_US/ticket.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 6832c77292c..46bb70ebc40 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -126,9 +126,9 @@ TicketParams=Params TicketsShowModuleLogo=Display the logo of the module in the public interface TicketsShowModuleLogoHelp=Enable this option to hide the logo module in the pages of the public interface TicketsShowCompanyLogo=Display the logo of the company in the public interface -TicketsShowCompanyLogoHelp=Enable this option to hide the logo of the main company in the pages of the public interface +TicketsShowCompanyLogoHelp=Enable this option to show the logo of the main company in the pages of the public interface TicketsShowCompanyFooter=Display the footer of the company in the public interface -TicketsShowCompanyFooterHelp=Enable this option to hide the footer of the main company in the pages of the public interface +TicketsShowCompanyFooterHelp=Enable this option to show the footer of the main company in the pages of the public interface TicketsEmailAlsoSendToMainAddress=Also send a notification to the main email address TicketsEmailAlsoSendToMainAddressHelp=Enable this option to also send an email to the address defined into setup "%s" (see tab "%s") TicketsLimitViewAssignedOnly=Restrict the display to tickets assigned to the current user (not effective for external users, always be limited to the third party they depend on) From 07a8dc3b5cf98d87d0b05512b332f8bce69255e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2023 04:14:18 +0200 Subject: [PATCH 0279/1137] Debug v19 --- htdocs/public/ticket/create_ticket.php | 6 ++++-- htdocs/public/ticket/list.php | 6 ++++-- htdocs/public/ticket/view.php | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 464f43cb1a7..ae194d7236a 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -536,8 +536,10 @@ if ($action != "infos_success") { print '
'; -// End of page -htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $object); +if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) { + // End of page + htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); +} llxFooter('', 'public'); diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 005c671fd43..954e2428cfe 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -766,8 +766,10 @@ if ($action == "view_ticketlist") { print "
"; } -// End of page -htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); +if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) { + // End of page + htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); +} llxFooter('', 'public'); diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index b6b576747e4..ee0e842020d 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -426,8 +426,10 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a print "
"; -// End of page -htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); +if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) { + // End of page + htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); +} llxFooter('', 'public'); From fc225cc5dd46e1608715ecd3bc83e2028dbbf085 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2023 15:32:56 +0200 Subject: [PATCH 0280/1137] Fix tool dos2unix --- dev/tools/fixdosfiles.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tools/fixdosfiles.sh b/dev/tools/fixdosfiles.sh index e5e5d97b554..52db065db03 100755 --- a/dev/tools/fixdosfiles.sh +++ b/dev/tools/fixdosfiles.sh @@ -10,21 +10,21 @@ # Syntax if [ "x$1" != "xlist" -a "x$1" != "xfix" ] then - echo "This script detect or clean files with CR+LF into files with LF only. All source files are included, also files into includes." + echo "This script detect or clean files with CR+LF into files with LF only. All source files are included, including files into includes." echo "Usage: fixdosfiles.sh [list|fix]" fi # To detec if [ "x$1" = "xlist" ] then - find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v "CRLF" | grep -v 'custom\/' | grep -v 'documents\/website' | grep -v 'documents\/medias' | grep -v 'documents\/sellyoursaas' | grep CRLF + find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'custom\/' | grep -v 'documents\/website' | grep -v 'documents\/medias' | grep -v 'documents\/sellyoursaas' | grep CRLF # find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v "CRLF" | grep -v 'custom\/' | grep -v 'documents\/website' | grep -v 'documents\/medias' | grep -v 'documents\/sellyoursaas' | grep -v 'htdocs\/includes' | grep CRLF fi # To convert if [ "x$1" = "xfix" ] then - for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v "CRLF" | grep -v 'custom\/' | grep -v 'documents\/website' | grep -v 'documents\/medias' | grep -v 'documents\/sellyoursaas' | grep CRLF | awk -F':' '{ print $1 }' ` + for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'custom\/' | grep -v 'documents\/website' | grep -v 'documents\/medias' | grep -v 'documents\/sellyoursaas' | grep CRLF | awk -F':' '{ print $1 }' ` do echo "Fix file $fic" dos2unix "$fic" From 21559be84d8555c1180aff91a0b92b83c08a38da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 31 Jul 2023 15:36:55 +0200 Subject: [PATCH 0281/1137] Upgrade ckeditor 4.22.1 --- COPYRIGHT | 2 +- htdocs/includes/ckeditor/UPGRADE.md | 2 +- htdocs/includes/ckeditor/ckeditor/CHANGES.md | 161 +- htdocs/includes/ckeditor/ckeditor/LICENSE.md | 18 +- htdocs/includes/ckeditor/ckeditor/README.md | 4 +- .../ckeditor/ckeditor/build-config.js | 7 +- htdocs/includes/ckeditor/ckeditor/ckeditor.js | 1296 +++++++++-------- htdocs/includes/ckeditor/ckeditor/config.js | 2 +- .../includes/ckeditor/ckeditor/contents.css | 2 +- htdocs/includes/ckeditor/ckeditor/lang/af.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ar.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/az.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/bg.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/bn.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/bs.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ca.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/cs.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/cy.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/da.js | 4 +- .../includes/ckeditor/ckeditor/lang/de-ch.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/de.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/el.js | 4 +- .../includes/ckeditor/ckeditor/lang/en-au.js | 4 +- .../includes/ckeditor/ckeditor/lang/en-ca.js | 4 +- .../includes/ckeditor/ckeditor/lang/en-gb.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/en.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/eo.js | 4 +- .../includes/ckeditor/ckeditor/lang/es-mx.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/es.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/et.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/eu.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/fa.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/fi.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/fo.js | 4 +- .../includes/ckeditor/ckeditor/lang/fr-ca.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/fr.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/gl.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/gu.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/he.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/hi.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/hr.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/hu.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/id.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/is.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/it.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ja.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ka.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/km.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ko.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ku.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/lt.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/lv.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/mk.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/mn.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ms.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/nb.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/nl.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/no.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/oc.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/pl.js | 4 +- .../includes/ckeditor/ckeditor/lang/pt-br.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/pt.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ro.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ru.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/si.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/sk.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/sl.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/sq.js | 4 +- .../ckeditor/ckeditor/lang/sr-latn.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/sr.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/sv.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/th.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/tr.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/tt.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/ug.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/uk.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/vi.js | 4 +- .../includes/ckeditor/ckeditor/lang/zh-cn.js | 4 +- htdocs/includes/ckeditor/ckeditor/lang/zh.js | 4 +- .../plugins/a11yhelp/dialogs/a11yhelp.js | 2 +- .../dialogs/lang/_translationstatus.txt | 2 +- .../plugins/a11yhelp/dialogs/lang/af.js | 4 +- .../plugins/a11yhelp/dialogs/lang/ar.js | 17 +- .../plugins/a11yhelp/dialogs/lang/az.js | 2 +- .../plugins/a11yhelp/dialogs/lang/bg.js | 17 +- .../plugins/a11yhelp/dialogs/lang/ca.js | 2 +- .../plugins/a11yhelp/dialogs/lang/cs.js | 2 +- .../plugins/a11yhelp/dialogs/lang/cy.js | 4 +- .../plugins/a11yhelp/dialogs/lang/da.js | 2 +- .../plugins/a11yhelp/dialogs/lang/de-ch.js | 2 +- .../plugins/a11yhelp/dialogs/lang/de.js | 2 +- .../plugins/a11yhelp/dialogs/lang/el.js | 2 +- .../plugins/a11yhelp/dialogs/lang/en-au.js | 17 +- .../plugins/a11yhelp/dialogs/lang/en-gb.js | 17 +- .../plugins/a11yhelp/dialogs/lang/en.js | 17 +- .../plugins/a11yhelp/dialogs/lang/eo.js | 2 +- .../plugins/a11yhelp/dialogs/lang/es-mx.js | 2 +- .../plugins/a11yhelp/dialogs/lang/es.js | 2 +- .../plugins/a11yhelp/dialogs/lang/et.js | 2 +- .../plugins/a11yhelp/dialogs/lang/eu.js | 2 +- .../plugins/a11yhelp/dialogs/lang/fa.js | 2 +- .../plugins/a11yhelp/dialogs/lang/fi.js | 5 +- .../plugins/a11yhelp/dialogs/lang/fo.js | 17 +- .../plugins/a11yhelp/dialogs/lang/fr-ca.js | 5 +- .../plugins/a11yhelp/dialogs/lang/fr.js | 2 +- .../plugins/a11yhelp/dialogs/lang/gl.js | 6 +- .../plugins/a11yhelp/dialogs/lang/gu.js | 17 +- .../plugins/a11yhelp/dialogs/lang/he.js | 4 +- .../plugins/a11yhelp/dialogs/lang/hi.js | 17 +- .../plugins/a11yhelp/dialogs/lang/hr.js | 2 +- .../plugins/a11yhelp/dialogs/lang/hu.js | 2 +- .../plugins/a11yhelp/dialogs/lang/id.js | 2 +- .../plugins/a11yhelp/dialogs/lang/it.js | 6 +- .../plugins/a11yhelp/dialogs/lang/ja.js | 4 +- .../plugins/a11yhelp/dialogs/lang/km.js | 17 +- .../plugins/a11yhelp/dialogs/lang/ko.js | 2 +- .../plugins/a11yhelp/dialogs/lang/ku.js | 2 +- .../plugins/a11yhelp/dialogs/lang/lt.js | 17 +- .../plugins/a11yhelp/dialogs/lang/lv.js | 5 +- .../plugins/a11yhelp/dialogs/lang/mk.js | 17 +- .../plugins/a11yhelp/dialogs/lang/mn.js | 17 +- .../plugins/a11yhelp/dialogs/lang/nb.js | 2 +- .../plugins/a11yhelp/dialogs/lang/nl.js | 2 +- .../plugins/a11yhelp/dialogs/lang/no.js | 15 +- .../plugins/a11yhelp/dialogs/lang/oc.js | 2 +- .../plugins/a11yhelp/dialogs/lang/pl.js | 2 +- .../plugins/a11yhelp/dialogs/lang/pt-br.js | 6 +- .../plugins/a11yhelp/dialogs/lang/pt.js | 2 +- .../plugins/a11yhelp/dialogs/lang/ro.js | 2 +- .../plugins/a11yhelp/dialogs/lang/ru.js | 2 +- .../plugins/a11yhelp/dialogs/lang/si.js | 4 +- .../plugins/a11yhelp/dialogs/lang/sk.js | 2 +- .../plugins/a11yhelp/dialogs/lang/sl.js | 7 +- .../plugins/a11yhelp/dialogs/lang/sq.js | 2 +- .../plugins/a11yhelp/dialogs/lang/sr-latn.js | 9 +- .../plugins/a11yhelp/dialogs/lang/sr.js | 9 +- .../plugins/a11yhelp/dialogs/lang/sv.js | 2 +- .../plugins/a11yhelp/dialogs/lang/th.js | 17 +- .../plugins/a11yhelp/dialogs/lang/tr.js | 2 +- .../plugins/a11yhelp/dialogs/lang/tt.js | 17 +- .../plugins/a11yhelp/dialogs/lang/ug.js | 2 +- .../plugins/a11yhelp/dialogs/lang/uk.js | 2 +- .../plugins/a11yhelp/dialogs/lang/vi.js | 4 +- .../plugins/a11yhelp/dialogs/lang/zh-cn.js | 2 +- .../plugins/a11yhelp/dialogs/lang/zh.js | 12 +- .../ckeditor/plugins/about/dialogs/about.js | 6 +- .../plugins/clipboard/dialogs/paste.js | 2 +- .../colordialog/dialogs/colordialog.css | 2 +- .../colordialog/dialogs/colordialog.js | 2 +- .../copyformatting/styles/copyformatting.css | 2 +- .../plugins/dialog/dialogDefinition.js | 2 +- .../ckeditor/plugins/find/dialogs/find.js | 45 +- .../ckeditor/plugins/forms/dialogs/button.js | 2 +- .../plugins/forms/dialogs/checkbox.js | 2 +- .../ckeditor/plugins/forms/dialogs/form.js | 2 +- .../plugins/forms/dialogs/hiddenfield.js | 2 +- .../ckeditor/plugins/forms/dialogs/radio.js | 2 +- .../ckeditor/plugins/forms/dialogs/select.js | 2 +- .../plugins/forms/dialogs/textarea.js | 2 +- .../plugins/forms/dialogs/textfield.js | 2 +- .../ckeditor/ckeditor/plugins/icons.png | Bin 12237 -> 12270 bytes .../ckeditor/ckeditor/plugins/icons_hidpi.png | Bin 38309 -> 39394 bytes .../ckeditor/plugins/iframe/dialogs/iframe.js | 12 +- .../ckeditor/plugins/image/dialogs/image.js | 2 +- .../ckeditor/plugins/link/dialogs/anchor.js | 5 +- .../ckeditor/plugins/link/dialogs/link.js | 2 +- .../plugins/liststyle/dialogs/liststyle.js | 2 +- .../plugins/pastefromgdocs/filter/default.js | 2 +- .../pastefromlibreoffice/filter/default.js | 2 +- .../plugins/pastefromword/filter/default.js | 77 +- .../plugins/pastetools/filter/common.js | 2 +- .../plugins/pastetools/filter/image.js | 2 +- .../ckeditor/plugins/smiley/dialogs/smiley.js | 2 +- .../sourcedialog/dialogs/sourcedialog.js | 2 +- .../dialogs/lang/_translationstatus.txt | 2 +- .../plugins/specialchar/dialogs/lang/af.js | 2 +- .../plugins/specialchar/dialogs/lang/ar.js | 2 +- .../plugins/specialchar/dialogs/lang/az.js | 2 +- .../plugins/specialchar/dialogs/lang/bg.js | 2 +- .../plugins/specialchar/dialogs/lang/ca.js | 2 +- .../plugins/specialchar/dialogs/lang/cs.js | 2 +- .../plugins/specialchar/dialogs/lang/cy.js | 2 +- .../plugins/specialchar/dialogs/lang/da.js | 2 +- .../plugins/specialchar/dialogs/lang/de-ch.js | 2 +- .../plugins/specialchar/dialogs/lang/de.js | 2 +- .../plugins/specialchar/dialogs/lang/el.js | 2 +- .../plugins/specialchar/dialogs/lang/en-au.js | 2 +- .../plugins/specialchar/dialogs/lang/en-ca.js | 2 +- .../plugins/specialchar/dialogs/lang/en-gb.js | 2 +- .../plugins/specialchar/dialogs/lang/en.js | 2 +- .../plugins/specialchar/dialogs/lang/eo.js | 2 +- .../plugins/specialchar/dialogs/lang/es-mx.js | 2 +- .../plugins/specialchar/dialogs/lang/es.js | 2 +- .../plugins/specialchar/dialogs/lang/et.js | 2 +- .../plugins/specialchar/dialogs/lang/eu.js | 2 +- .../plugins/specialchar/dialogs/lang/fa.js | 2 +- .../plugins/specialchar/dialogs/lang/fi.js | 2 +- .../plugins/specialchar/dialogs/lang/fr-ca.js | 2 +- .../plugins/specialchar/dialogs/lang/fr.js | 2 +- .../plugins/specialchar/dialogs/lang/gl.js | 2 +- .../plugins/specialchar/dialogs/lang/he.js | 2 +- .../plugins/specialchar/dialogs/lang/hr.js | 2 +- .../plugins/specialchar/dialogs/lang/hu.js | 2 +- .../plugins/specialchar/dialogs/lang/id.js | 2 +- .../plugins/specialchar/dialogs/lang/it.js | 2 +- .../plugins/specialchar/dialogs/lang/ja.js | 2 +- .../plugins/specialchar/dialogs/lang/km.js | 2 +- .../plugins/specialchar/dialogs/lang/ko.js | 2 +- .../plugins/specialchar/dialogs/lang/ku.js | 2 +- .../plugins/specialchar/dialogs/lang/lt.js | 2 +- .../plugins/specialchar/dialogs/lang/lv.js | 2 +- .../plugins/specialchar/dialogs/lang/nb.js | 2 +- .../plugins/specialchar/dialogs/lang/nl.js | 2 +- .../plugins/specialchar/dialogs/lang/no.js | 2 +- .../plugins/specialchar/dialogs/lang/oc.js | 2 +- .../plugins/specialchar/dialogs/lang/pl.js | 2 +- .../plugins/specialchar/dialogs/lang/pt-br.js | 2 +- .../plugins/specialchar/dialogs/lang/pt.js | 2 +- .../plugins/specialchar/dialogs/lang/ro.js | 2 +- .../plugins/specialchar/dialogs/lang/ru.js | 2 +- .../plugins/specialchar/dialogs/lang/si.js | 2 +- .../plugins/specialchar/dialogs/lang/sk.js | 2 +- .../plugins/specialchar/dialogs/lang/sl.js | 2 +- .../plugins/specialchar/dialogs/lang/sq.js | 2 +- .../specialchar/dialogs/lang/sr-latn.js | 2 +- .../plugins/specialchar/dialogs/lang/sr.js | 2 +- .../plugins/specialchar/dialogs/lang/sv.js | 2 +- .../plugins/specialchar/dialogs/lang/th.js | 2 +- .../plugins/specialchar/dialogs/lang/tr.js | 2 +- .../plugins/specialchar/dialogs/lang/tt.js | 2 +- .../plugins/specialchar/dialogs/lang/ug.js | 2 +- .../plugins/specialchar/dialogs/lang/uk.js | 2 +- .../plugins/specialchar/dialogs/lang/vi.js | 2 +- .../plugins/specialchar/dialogs/lang/zh-cn.js | 2 +- .../plugins/specialchar/dialogs/lang/zh.js | 2 +- .../specialchar/dialogs/specialchar.js | 2 +- .../ckeditor/plugins/table/dialogs/table.js | 36 +- .../plugins/tabletools/dialogs/tableCell.js | 30 +- .../plugins/templates/dialogs/templates.css | 2 +- .../plugins/templates/dialogs/templates.js | 2 +- .../plugins/templates/templatedefinition.js | 2 +- .../plugins/templates/templates/default.js | 2 +- .../ckeditor/skins/moono-lisa/dialog.css | 2 +- .../ckeditor/skins/moono-lisa/dialog_ie.css | 2 +- .../ckeditor/skins/moono-lisa/dialog_ie8.css | 2 +- .../skins/moono-lisa/dialog_iequirks.css | 2 +- .../ckeditor/skins/moono-lisa/editor.css | 4 +- .../skins/moono-lisa/editor_gecko.css | 4 +- .../ckeditor/skins/moono-lisa/editor_ie.css | 4 +- .../ckeditor/skins/moono-lisa/editor_ie8.css | 4 +- .../skins/moono-lisa/editor_iequirks.css | 4 +- .../ckeditor/skins/moono-lisa/icons.png | Bin 12237 -> 12270 bytes .../ckeditor/skins/moono-lisa/icons_hidpi.png | Bin 38309 -> 39394 bytes .../ckeditor/skins/moono-lisa/readme.md | 2 +- htdocs/includes/ckeditor/ckeditor/styles.js | 4 +- 255 files changed, 1407 insertions(+), 1205 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 2485625914a..96c39a39650 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -52,7 +52,7 @@ bacon, dasprid, swiss-qr-bill, kmukku, symfony/validator JS libraries: Ace 1.4.14 BSD Yes JS library to get code syntaxique coloration in a textarea. ChartJS 3.7.1 MIT License Yes JS library for graph -CKEditor 4.18 LGPL-2.1+ Yes Editor WYSIWYG +CKEditor 4.22.1 LGPL-2.1+ Yes Editor WYSIWYG jQuery 3.6.4 MIT License Yes JS library jQuery UI 1.13.2 GPL and MIT License Yes JS library plugin UI jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css diff --git a/htdocs/includes/ckeditor/UPGRADE.md b/htdocs/includes/ckeditor/UPGRADE.md index 73d46f6eb74..d0ebe558c47 100644 --- a/htdocs/includes/ckeditor/UPGRADE.md +++ b/htdocs/includes/ckeditor/UPGRADE.md @@ -1,7 +1,7 @@ To upgrade ckeditor: - Go on web site. - Choose profile "Online builder" -- Choose Full package +- Choose Custom - Full package - Add plugin SourceDialog (for "source" button on edit inline) - Choose skin mona-lisa - Choose all languages diff --git a/htdocs/includes/ckeditor/ckeditor/CHANGES.md b/htdocs/includes/ckeditor/ckeditor/CHANGES.md index 94ecf8517b9..0cfec356a8c 100644 --- a/htdocs/includes/ckeditor/ckeditor/CHANGES.md +++ b/htdocs/includes/ckeditor/ckeditor/CHANGES.md @@ -1,5 +1,162 @@ -CKEditor 4 Changelog -==================== +⚠️️️ **CKEditor 4 (the open source edition) is no longer maintained.** ⚠️ + +If you would like to keep access to future CKEditor 4 security patches, check the [Extended Support Model](https://ckeditor.com/ckeditor-4-support/), which guarantees **security updates and critical bug fixes until December 2026**. Alternatively, [upgrade to CKEditor 5](https://ckeditor.com/docs/ckeditor5/latest/updating/ckeditor4/migration-from-ckeditor-4.html). + +## CKEditor 4.22.0 / 4.22.1 + +⚠️ This is the last open source release of CKEditor 4. As announced in 2018, CKEditor 4 has reached its End of Life in June 2023. + + +New Features: + +* [#5316](https://github.com/ckeditor/ckeditor4/issues/5316): Added vertical margins support for list elements in the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin. +* [#5410](https://github.com/ckeditor/ckeditor4/issues/5410): Added the ability to indicate the language of styles in the [Styles Combo](https://ckeditor.com/cke4/addon/stylescombo) plugin via the [`config.styleSet`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-stylesSet) configuration option. +* [#5510](https://github.com/ckeditor/ckeditor4/issues/5510): Added notification system to the editor informing users that the editor version is up-to-date and secure. See [`config.versionCheck`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-versionCheck) configuration option to learn more. + +Fixed Issues: + +* [#5437](https://github.com/ckeditor/ckeditor4/issues/5437): Fixed: Incorrect indication of selected items in combo boxes. The selected item was unmarked upon each opening of the combo box. +* [#5495](https://github.com/ckeditor/ckeditor4/issues/5495): Fixed: Insufficient color ratio for links inside [Notifications](https://ckeditor.com/cke4/addon/notification). + +Other Changes: + +* [#5412](https://github.com/ckeditor/ckeditor4/issues/5412): Prevent using `document.domain` in Firefox in the [Preview](https://ckeditor.com/cke4/addon/preview) plugin. + +Note: CKEditor 4.22.1 has been released immediately after 4.22.0 to fix the README issues on [npm](https://www.npmjs.com/) and contains no changes vs 4.22.0. + +## CKEditor 4.21.0 + +**Security Updates:** + +A cross-site scripting vulnerability has been discovered affecting [Iframe Dialog](https://ckeditor.com/cke4/addon/iframe) and [Media Embed](https://ckeditor.com/cke4/addon/embed) plugins. + +This vulnerability might affect a small percentage of integrators that depend on dynamic editor initialization/destroy mechanism. See [GitHub advisory](https://github.com/ckeditor/ckeditor4/security/advisories/GHSA-vh5c-xwqv-cv9g) for more details. + +**Potential breaking changes** + +In some rare cases, a security release may introduce a breaking change to your application. We have provided configuration options that will help you mitigate any potential issues with the upgrade: + +- Starting from version 4.21, the [Iframe Dialog](https://ckeditor.com/cke4/addon/iframe) plugin applies the `sandbox` attribute by default, which restricts JavaScript code execution in the iframe element. To change this behavior, configure the [`config.iframe_attributes`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-iframe_attributes) option. +- Starting from version 4.21, the [Media Embed](https://ckeditor.com/cke4/addon/embed) plugin regenerates the entire content of the embed widget by default. To change this behavior, configure the [`config.embed_keepOriginalContent`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-embed_keepOriginalContent) option. + +If you choose to change either of the above options, make sure to properly configure [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) to avoid any potential security issues that may arise from embedding iframe elements on your web page. + +You can read more details in the relevant security advisory and [contact us](security@cksource.com) if you have more questions. + +**An upgrade is highly recommended!** + +New Features: + +* [#4400](https://github.com/ckeditor/ckeditor4/issues/4400): Added the [`config.uploadImage_supportedTypes`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-uploadImage_supportedTypes) configuration option allowing to change the image formats accepted by the [Upload Image](https://ckeditor.com/cke4/addon/uploadimage) plugin. Thanks to [SilverYoCha](https://github.com/SilverYoCha)! + +Fixed Issues: + +* [#5431](https://github.com/ckeditor/ckeditor4/issues/5431): Fixed: No notification is shown when pasting or dropping unsupported image types into the editor. + +## CKEditor 4.20.2 + +Fixed Issues: + +* [#439](https://github.com/ckeditor/ckeditor4/issues/439): Fixed: Incorrect Tab and Shift+Tab navigation for radio buttons inside the dialog. +* [#4829](https://github.com/ckeditor/ckeditor4/issues/4829): Fixed: Undo reversed entire table content instead of a single cell. Thanks to that fix, multiple changes in a table can be undone one by one. +* [#5396](https://github.com/ckeditor/ckeditor4/issues/5396): Fixed: Event listeners for `popstate` and `hashchange` events on the `window`, added by the [Maximize](https://ckeditor.com/cke4/addon/maximize) plugin, were not removed when destroying the editor instance. +* [#5414](https://github.com/ckeditor/ckeditor4/issues/5414): Fixed: File and image uploaders based on the [Upload Widget plugin](https://ckeditor.com/cke4/addon/uploadwidget) and [Easy Image plugin ](https://ckeditor.com/cke4/addon/easyimage) didn't fire the [`change` event](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-change) upon finishing upload, resulting in passing incorrect data in form controls for integration frameworks, like [Reactive forms in Angular](https://angular.io/guide/reactive-forms). +* [#698](https://github.com/ckeditor/ckeditor4/issues/698): Fixed: An error was thrown after applying formatting to the widget with inline editable and switching to the source mode. Thanks to [Glen](https://github.com/glen-84)! + +API changes: + +* [#3540](https://github.com/ckeditor/ckeditor4/issues/3540): The [startup data](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_widget.html) passed to the widget's command is now used to also populate the widget's template. +* [#5352](https://github.com/ckeditor/ckeditor4/issues/5352): Added the [`colorButton_contentsCss`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-colorButton_contentsCss) configuration option allowing to add custom CSS to the [Color Button](https://ckeditor.com/cke4/addon/colorbutton) menu content. Thanks to [mihilion](https://github.com/mihilion)! + +## CKEditor 4.20.1 + +Fixed Issues: + +* [#5333](https://github.com/ckeditor/ckeditor4/issues/5333): Fixed: The original name of the uploaded image is not preserved by the [Upload Image](https://ckeditor.com/cke4/addon/uploadimage) plugin if the [Clipboard](https://ckeditor.com/cke4/addon/clipboard) plugin has enabled image handling. +* [#2881](https://github.com/ckeditor/ckeditor4/issues/2881): Fixed: Changing table headers from "Both" to "First column" in the [Table](https://ckeditor.com/cke4/addon/table) dialog does not change the first column cell correctly. +* [#2996](https://github.com/ckeditor/ckeditor4/issues/2996): Fixed: Table header "scope" attribute is incorrect for the "Headers: both" option in the [Table](https://ckeditor.com/cke4/addon/table) dialog. +* [#4802](https://github.com/ckeditor/ckeditor4/issues/4802): Fixed: [Tableselection](https://ckeditor.com/cke4/addon/tableselection) caret moves to the previous cell after tabbing into the next cell and then removing its content. +* [#5365](https://github.com/ckeditor/ckeditor4/issues/5365): Fixed: The value of the [`config.baseFloatZIndex`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-baseFloatZIndex) config variable is incorrectly applied to parent dialog when the child dialog is closed resulting in the dialog overlay covering up the dialog. Thanks to [JenoDK](https://github.com/JenoDK)! +* [#5305](https://github.com/ckeditor/ckeditor4/issues/5305): Fixed: Anchor name can invalidly include spaces. + +## CKEditor 4.20 + +New Features: + +* [#5084](https://github.com/ckeditor/ckeditor4/issues/5084): Added the [`config.tabletools_scopedHeaders`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-tabletools_scopedHeaders) configuration option controlling the behaviour of table headers with and without the `[scope]` attribute. +* [#5219](https://github.com/ckeditor/ckeditor4/issues/5219): Added the [`config.image2_defaultLockRatio`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-image2_defaultLockRatio) configuration option allowing to set the default value of the "Lock ratio" option in the [Enhanced Image](https://ckeditor.com/cke4/addon/image2) dialog. +* [#2008](https://github.com/ckeditor/ckeditor-dev/pull/2008): Extended the [Mentions](https://ckeditor.com/cke4/addon/mentions) and [Emoji](https://ckeditor.com/cke4/addon/emoji) plugins with a feature option that adds a space after an accepted autocompletion match. See: + * [`configDefinition.followingSpace`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_mentions_configDefinition.html#property-followingSpace) option for the mentions plugin, and + * [`config.emoji_followingSpace`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-emoji_followingSpace) option for the emoji plugin. +* [#5215](https://github.com/ckeditor/ckeditor4/issues/5215): Added the [`config.coreStyles_toggleSubSup`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-coreStyles_toggleSubSup) configuration option which disallows setting the subscript and superscript on the same element simultaneously using UI buttons. This option is turned off by default. + +Fixed Issues: + +* [#4889](https://github.com/ckeditor/ckeditor4/issues/4889): Fixed: Incorrect position of the [Table Resize](https://ckeditor.com/cke4/addon/tableresize) cursor after scrolling the editor horizontally. +* [#5319](https://github.com/ckeditor/ckeditor4/issues/5319): Fixed: [Autolink](https://ckeditor.com/cke4/addon/autolink) [`config.autolink_urlRegex`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-autolink_urlRegex) option produced invalid links when configured directly using the editor instance config. Thanks to [Aigars Zeiza](https://github.com/Zuzon)! +* [#4941](https://github.com/ckeditor/ckeditor4/issues/4941): Fixed: Some entities got wrongly encoded when using [`entities_processNumerical = true`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-entities_processNumerical) configuration option. +* [#4931](https://github.com/ckeditor/ckeditor4/issues/4931): Fixed: Selecting the whole editor content when there is only a list with an empty element at the end inside and deleting it did not delete all list items. + + +API changes: + +* [#5122](https://github.com/ckeditor/ckeditor4/issues/5122): Added the ability to provide a list of buttons as an array to the [`config.removeButtons`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-removeButtons) config variable. +* [#2008](https://github.com/ckeditor/ckeditor-dev/pull/2008): Added [Autocomplete](https://ckeditor.com/cke4/addon/autocomplete) [`followingSpace`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_autocomplete_configDefinition.html#property-followingSpace) option that finishes an accepted match with a space. + +## CKEditor 4.19.1 + +Fixed Issues: + +* [#5125](https://github.com/ckeditor/ckeditor4/issues/5125): Fixed: Deleting a widget with disabled [autoParagraph](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-autoParagraph) by the keyboard `backspace` key removes the editor editable area and crashes the editor. +* [#5135](https://github.com/ckeditor/ckeditor4/issues/5135): Fixed: The [`checkbox.setValue`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_ui_dialog_checkbox.html#method-setValue) and [`radio.setValue`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_ui_dialog_radio.html#method-setValue) methods are not chainable as stated in the documentation. Thanks to [Jordan Bradford](https://github.com/LordPachelbel)! +* [#5085](https://github.com/ckeditor/ckeditor4/issues/5085): Fixed: The [Language](https://ckeditor.com/cke4/addon/language) plugin removes the element marking the text in foreign language if said element does not have an information about the text direction. +* [#4284](https://github.com/ckeditor/ckeditor4/issues/4284): Fixed: [Tableselection](https://ckeditor.com/cke4/addon/tableselection) Merging cells with a rowspan throws an unexpected error and does not create an undo step. +* [#5184](https://github.com/ckeditor/ckeditor4/issues/5184): Fixed: The [Editor Placeholder](https://ckeditor.com/cke4/addon/wysiwygarea) plugin degrades typing performance. +* [#5158](https://github.com/ckeditor/ckeditor4/issues/5158): Fixed: [`CKEDITOR.tools#convertToPx()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-convertToPx) gives invalid results if the helper calculator element was deleted from the DOM. +* [#5234](https://github.com/ckeditor/ckeditor4/issues/5234): Fixed: [Easy Image](https://ckeditor.com/cke4/addon/easyimage) doesn't allow to upload images files using toolbar button. +* [#438](https://github.com/ckeditor/ckeditor4/issues/438): Fixed: It is impossible to navigate to the [elementspath](https://ckeditor.com/cke4/addon/elementspath) from the [toolbar](https://ckeditor.com/cke4/addon/toolbar) by keyboard and vice versa. +* [#4449](https://github.com/ckeditor/ckeditor4/issues/4449): Fixed: [`dialog.validate#functions`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-functions) incorrectly composes functions that return an optional error message, like e.g. [`dialog.validate.number`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-number) due to unnecessary return type coercion. +* [#4473](https://github.com/ckeditor/ckeditor4/issues/4473): Fixed: The [dialog.validate](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html) method does not accept parameter value. The issue originated in [dialog.validate.functions](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-functions) method that did not properly propagate parameter value to validator. Affected validators: + * [`functions`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-functions) + * [`equals`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-equals) + * [`notEqual`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-notEqual) + * [`cssLength`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-cssLength) + * [`htmlLength`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-htmlLength) + * [`inlineStyle`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dialog_validate.html#method-inlineStyle) +* [#5147](https://github.com/ckeditor/ckeditor4/issues/5147): Fixed: The [Accessibility Help](https://ckeditor.com/cke4/addon/a11yhelp) dialog does not contain info about focus being moved back to the editing area upon leaving dialogs. +* [#5144](https://github.com/ckeditor/ckeditor4/issues/5144): Fixed: [Menu buttons](https://ckeditor.com/cke4/addon/menubutton) and [panel buttons](https://ckeditor.com/cke4/addon/panelbutton) incorrectly indicate the open status of their associated pop-up menus in the browser's accessibility tree. +* [#5022](https://github.com/ckeditor/ckeditor4/issues/5022): Fixed: [Find and Replace](https://ckeditor.com/cke4/addon/find) does not respond to the `Enter` key. + +API changes: + +* [#5184](https://github.com/ckeditor/ckeditor4/issues/5184): Added the [`config.editorplaceholder_delay`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-editorplaceholder_delay) configuration option allowing to delay placeholder before it is toggled when changing editor content. +* [#5184](https://github.com/ckeditor/ckeditor4/issues/5184): Added the [`CKEDITOR.tools#debounce()`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-debounce) function allowing to postpone a passed function execution until the given milliseconds have elapsed since the last time it was invoked. + +## CKEditor 4.19.0 + +New features: + +* [#2444](https://github.com/ckeditor/ckeditor4/issues/2444): Togglable toolbar buttons are now exposed as toggle buttons in the browser's accessibility tree. +* [#4641](https://github.com/ckeditor/ckeditor4/issues/4641): Added an option allowing to cancel the [Delayed Editor Creation](https://ckeditor.com/docs/ckeditor4/latest/features/delayed_creation.html) feature as a function handle for editor creators ([`CKEDITOR.replace`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#method-replace), [`CKEDITOR.inline`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#method-inline), [`CKEDITOR.appendTo`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#method-appendTo)). +* [#4986](https://github.com/ckeditor/ckeditor4/issues/4986): Added [`config.shiftLineBreaks`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-shiftLineBreaks) allowing to preserve inline elements formatting when the `shift`+`enter` keystroke is used. +* [#2445](https://github.com/ckeditor/ckeditor4/issues/2445): Added [`config.applicationTitle`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-applicationTitle) configuration option allowing to customize or disable the editor's application region label. This option, combined with [`config.title`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-title), gives much better control over the editor's labels read by screen readers. + +Fixed Issues: + +* [#4543](https://github.com/ckeditor/ckeditor4/issues/4543): Fixed: Toolbar buttons toggle state is not correctly announced by screen readers lacking the information whether the feature is on or off. +* [#4052](https://github.com/ckeditor/ckeditor4/issues/4052): Fixed: Editor labels are read incorrectly by screen readers due to invalid editor control type for the [Iframe Editing Area](https://ckeditor.com/cke4/addon/wysiwygarea) editors. +* [#1904](https://github.com/ckeditor/ckeditor4/issues/1904): Fixed: Screen readers are not announcing the read-only editor state. +* [#4904](https://github.com/ckeditor/ckeditor4/issues/4904): Fixed: Table cell selection and navigation with the `tab` key behavior is inconsistent after adding a new row. +* [#3394](https://github.com/ckeditor/ckeditor4/issues/3394): Fixed: [Enhanced image](https://ckeditor.com/cke4/addon/image2) plugin dialog is not supporting URL with query string parameters. Thanks to [Simon Urli](https://github.com/surli)! +* [#5049](https://github.com/ckeditor/ckeditor4/issues/5049): Fixed: The editor fails in strict mode due to not following the `use strict` directives in a core editor module. +* [#5095](https://github.com/ckeditor/ckeditor4/issues/5095): Fixed: The [clipboard](https://ckeditor.com/cke4/addon/clipboard) plugin shows notification about unsupported file format when the file type is different than `jpg`, `gif`, `png`, not respecting [supported types](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_fileTools_uploadWidgetDefinition.html#property-supportedTypes) by the [Upload Widget](https://ckeditor.com/cke4/addon/uploadwidget) plugin. +* [#4855](https://github.com/ckeditor/ckeditor4/issues/4855): [iOS] Fixed: Focusing toolbar buttons with an enabled VoiceOver screen reader moves the browser focus into an editable area and interrupts button functionality. + +API changes: + +* [#4641](https://github.com/ckeditor/ckeditor4/issues/4641): The [`CKEDITOR.replace`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#method-replace), [`CKEDITOR.inline`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#method-inline), [`CKEDITOR.appendTo`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html#method-appendTo) functions are now returning a handle function allowing to cancel the [Delayed Editor Creation](https://ckeditor.com/docs/ckeditor4/latest/features/delayed_creation.html) feature. +* [#5095](https://github.com/ckeditor/ckeditor4/issues/5095): Added the [CKEDITOR.plugins.clipboard.addFileMatcher](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_clipboard.html#method-addFileMatcher) function allowing to define file formats supported by the [clipboard](https://ckeditor.com/cke4/addon/clipboard) plugin. Trying to paste unsupported files will result in a notification that a file cannot be dropped or pasted into the editor. +* [#2445](https://github.com/ckeditor/ckeditor4/issues/2445): Added [`config.applicationTitle`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-applicationTitle) alongside [`CKEDITOR.editor#applicationTitle`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#property-applicationTitle) to allow customizing editor's application region label. ## CKEditor 4.18.0 diff --git a/htdocs/includes/ckeditor/ckeditor/LICENSE.md b/htdocs/includes/ckeditor/ckeditor/LICENSE.md index 4056b1f214e..54616f01086 100644 --- a/htdocs/includes/ckeditor/ckeditor/LICENSE.md +++ b/htdocs/includes/ckeditor/ckeditor/LICENSE.md @@ -1,8 +1,16 @@ -Software License Agreement -========================== +Software License Agreement for CKEditor 4 LTS (4.23.0 and above) +================================================================ -CKEditor - The text editor for Internet - https://ckeditor.com/ -Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. +CKEditor - The text editor for Internet - https://ckeditor.com/
+Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. + +CKEditor 4 LTS ("Long Term Support") is available under exclusive terms of the [Extended Support Model](https://ckeditor.com/ckeditor-4-support/). [Contact us](https://ckeditor.com/contact/) to obtain a commercial license. + +Software License Agreement for CKEditor 4.22.* and below +======================================================== + +CKEditor - The text editor for Internet - https://ckeditor.com/
+Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. Licensed under the terms of any of the following licenses at your choice: @@ -37,7 +45,7 @@ done by developers outside of CKSource with their express permission. The following libraries are included in CKEditor under the MIT license (see Appendix D): -* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2022, CKSource Holding sp. z o.o. +* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2023, CKSource Holding sp. z o.o. * PicoModal (included in `samples/js/sf.js`) - Copyright (c) 2012 James Frasca. * CodeMirror (included in the samples) - Copyright (C) 2014 by Marijn Haverbeke and others. * ES6Promise - Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors. diff --git a/htdocs/includes/ckeditor/ckeditor/README.md b/htdocs/includes/ckeditor/ckeditor/README.md index 25a1e604b62..79828f34f31 100644 --- a/htdocs/includes/ckeditor/ckeditor/README.md +++ b/htdocs/includes/ckeditor/ckeditor/README.md @@ -1,8 +1,8 @@ CKEditor 4 ========== -Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. -https://ckeditor.com - See LICENSE.md for license information. +Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. +https://ckeditor.com - See https://ckeditor.com/legal/ckeditor-oss-license for license information. CKEditor 4 is a text editor to be used inside web pages. It's not a replacement for desktop text editors like Word or OpenOffice, but a component to be used as diff --git a/htdocs/includes/ckeditor/ckeditor/build-config.js b/htdocs/includes/ckeditor/ckeditor/build-config.js index 2053f41ac96..f38a7581efd 100644 --- a/htdocs/includes/ckeditor/ckeditor/build-config.js +++ b/htdocs/includes/ckeditor/ckeditor/build-config.js @@ -1,5 +1,5 @@ /** - * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. + * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license/ */ @@ -13,10 +13,10 @@ * (1) https://ckeditor.com/cke4/builder * Visit online builder to build CKEditor from scratch. * - * (2) https://ckeditor.com/cke4/builder/6490967e78ab135a44d8c0998d90e841 + * (2) https://ckeditor.com/cke4/builder/8b396e2e83e08da2ad0c51afee1a2118 * Visit online builder to build CKEditor, starting with the same setup as before. * - * (3) https://ckeditor.com/cke4/builder/download/6490967e78ab135a44d8c0998d90e841 + * (3) https://ckeditor.com/cke4/builder/download/8b396e2e83e08da2ad0c51afee1a2118 * Straight download link to the latest version of CKEditor (Optimized) with the same setup as before. * * NOTE: @@ -107,6 +107,7 @@ var CKBUILDER_CONFIG = { 'showborders' : 1, 'smiley' : 1, 'sourcearea' : 1, + 'sourcedialog' : 1, 'specialchar' : 1, 'stylescombo' : 1, 'tab' : 1, diff --git a/htdocs/includes/ckeditor/ckeditor/ckeditor.js b/htdocs/includes/ckeditor/ckeditor/ckeditor.js index 5edc17d91a8..0e787fb4848 100644 --- a/htdocs/includes/ckeditor/ckeditor/ckeditor.js +++ b/htdocs/includes/ckeditor/ckeditor/ckeditor.js @@ -1,15 +1,15 @@ /* -Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. +Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license/ */ -(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,d={timestamp:"M2G9",version:"4.18.0",revision:"5fe059002f3",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var b=window.CKEDITOR_BASEPATH||"";if(!b)for(var c=document.getElementsByTagName("script"),d=0;dy.getListenerIndex(c)){y=y.listeners;k||(k=this);isNaN(l)&&(l=10);r.fn=c;r.priority=l;for(var z=y.length-1;0<=z;z--)if(y[z].priority<=l)return y.splice(z+1,0,r),{removeListener:g}; -y.unshift(r)}return{removeListener:g}},once:function(){var a=Array.prototype.slice.call(arguments),b=a[1];a[1]=function(a){a.removeListener();return b.apply(this,arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var c=0,e=function(){c=1},d=0,h=function(){d=1};return function(l,r,g){var w=b(this)[l];l=c;var y=d;c=d=0;if(w){var z=w.listeners;if(z.length)for(var z=z.slice(0), -A,t=0;ty.getListenerIndex(c)){y=y.listeners;k||(k=this);isNaN(n)&&(n=10);l.fn=c;l.priority=n;for(var z=y.length-1;0<=z;z--)if(y[z].priority<=n)return y.splice(z+1,0,l),{removeListener:g}; +y.unshift(l)}return{removeListener:g}},once:function(){var a=Array.prototype.slice.call(arguments),b=a[1];a[1]=function(a){a.removeListener();return b.apply(this,arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var c=0,e=function(){c=1},d=0,h=function(){d=1};return function(n,l,g){var x=b(this)[n];n=c;var y=d;c=d=0;if(x){var z=x.listeners;if(z.length)for(var z=z.slice(0), +G,v=0;vdocument.documentMode),mobile:-1c||b.quirks);b.gecko&&(d=a.match(/rv:([\d\.]+)/))&&(d=d[1].split("."),c=1E4*d[0]+100*(d[1]||0)+1*(d[2]||0));b.air&&(c=parseFloat(a.match(/ adobeair\/(\d+)/)[1])); @@ -19,46 +19,46 @@ b.iOS&&(b.cssClass+=" cke_browser_ios");b.hidpi&&(b.cssClass+=" cke_hidpi");retu CKEDITOR.loadFullCore,d=CKEDITOR.loadFullCoreTimeout;a&&(CKEDITOR.status="basic_ready",a&&a._load?a():d&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1E3*d))})})();CKEDITOR.status="basic_loaded"}();"use strict";CKEDITOR.VERBOSITY_WARN=1;CKEDITOR.VERBOSITY_ERROR=2;CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR;CKEDITOR.warn=function(a,d){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:a,additionalData:d})}; CKEDITOR.error=function(a,d){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log",{type:"error",errorCode:a,additionalData:d})}; CKEDITOR.on("log",function(a){if(window.console&&window.console.log){var d=console[a.data.type]?a.data.type:"log",b=a.data.errorCode;if(a=a.data.additionalData)console[d]("[CKEDITOR] Error code: "+b+".",a);else console[d]("[CKEDITOR] Error code: "+b+".");console[d]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#"+b)}},null,null,999);CKEDITOR.dom={}; -(function(){function a(a,y,b){this._minInterval=a;this._context=b;this._lastOutput=this._scheduledTimer=0;this._output=CKEDITOR.tools.bind(y,b||{});var c=this;this.input=function(){function a(){c._lastOutput=(new Date).getTime();c._scheduledTimer=0;c._call()}if(!c._scheduledTimer||!1!==c._reschedule()){var w=(new Date).getTime()-c._lastOutput;w/g,k=//g,k=/|\s) /g,function(a,b){return b+"\x26nbsp;"}).replace(/ (?=<)/g,"\x26nbsp;")},getNextNumber:function(){var a=0;return function(){return++a}}(),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var a="e",b=0;8>b;b++)a+=Math.floor(65536*(1+Math.random())).toString(16).substring(1); -return a},override:function(a,b){var c=b(a);c.prototype=a.prototype;return c},setTimeout:function(a,b,c,g,h){h||(h=window);c||(c=h);return h.setTimeout(function(){g?a.apply(c,[].concat(g)):a.apply(c)},b||0)},throttle:function(a,b,c){return new this.buffers.throttle(a,b,c)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(b){return b.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(b){return b.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(b){return b.replace(a, -"")}}(),indexOf:function(a,b){if("function"==typeof b)for(var c=0,g=a.length;cparseFloat(c);g&&(c=c.replace("-",""));a.setStyle("width",c);b=a.getClientRect();c=Math.round(b.width);return g?-c:c}return c}}(),repeat:function(a,b){return Array(b+1).join(a)},tryThese:function(){for(var a,b=0,c=arguments.length;bb;b++)a[b]=("0"+parseInt(a[b],10).toString(16)).slice(-2);return"#"+a.join("")})},normalizeHex:function(a){return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi, -function(a,b,c,g){a=b.toLowerCase();3==a.length&&(a=a.split(""),a=[a[0],a[0],a[1],a[1],a[2],a[2]].join(""));return"#"+a+g})},_isValidColorFormat:function(a){if(!a)return!1;a=a.replace(/\s+/g,"");return/^[a-z0-9()#%,./]+$/i.test(a)},parseCssText:function(a,b,c){var g={};c&&(a=(new CKEDITOR.dom.element("span")).setAttribute("style",a).getAttribute("style")||"");a&&(a=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));if(!a||";"==a)return g;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, -function(a,c,w){b&&(c=c.toLowerCase(),"font-family"==c&&(w=w.replace(/\s*,\s*/g,",")),w=CKEDITOR.tools.trim(w));g[c]=w});return g},writeCssText:function(a,b){var c,g=[];for(c in a)g.push(c+":"+a[c]);b&&g.sort();return g.join("; ")},objectCompare:function(a,b,c){var g;if(!a&&!b)return!0;if(!a||!b)return!1;for(g in a)if(a[g]!=b[g])return!1;if(!c)for(g in b)if(a[g]!=b[g])return!1;return!0},objectKeys:function(a){return CKEDITOR.tools.object.keys(a)},convertArrayToObject:function(a,b){var c={};1==arguments.length&& -(b=!0);for(var g=0,h=a.length;gc;c++)a.push(Math.floor(256*Math.random()));for(c=0;c=g||0==c&&48<= -g&&57>=g||1==c&&48<=g&&57>=g&&45==m?h+("\\"+g.toString(16)+" "):0==c&&1==b&&45==g?h+("\\"+a.charAt(c)):128<=g||45==g||95==g||48<=g&&57>=g||65<=g&&90>=g||97<=g&&122>=g?h+a.charAt(c):h+("\\"+a.charAt(c));a=h}else a="";return a},getMouseButton:function(a){return(a=a&&a.data?a.data.$:a)?CKEDITOR.tools.normalizeMouseButton(a.button):!1},normalizeMouseButton:function(a,b){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&!CKEDITOR.env.ie6Compat)return a;for(var c=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE, -4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],g=0;gm)for(d=m;3>d;d++)h[d]=0;e[0]=(h[0]&252)>>2;e[1]=(h[0]&3)<<4|h[1]>>4;e[2]=(h[1]&15)<<2|(h[2]&192)>>6;e[3]=h[2]&63;for(d=0;4>d;d++)b=d<=m? -b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e[d]):b+"\x3d"}return b},style:{parse:{_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "),_widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(a){var b={},c=this._findColor(a); -c.length&&(b.color=c[0],CKEDITOR.tools.array.forEach(c,function(b){a=a.replace(b,"")}));if(a=CKEDITOR.tools.trim(a))b.unprocessed=a;return b},margin:function(a){return CKEDITOR.tools.style.parse.sideShorthand(a,function(a){return a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)||["0px"]})},sideShorthand:function(a,b){function c(a){g.top=h[a[0]];g.right=h[a[1]];g.bottom=h[a[2]];g.left=h[a[3]]}var g={},h=b?b(a):a.split(/\s+/);switch(h.length){case 1:c([0,0,0,0]);break;case 2:c([0, -1,0,1]);break;case 3:c([0,1,2,1]);break;case 4:c([0,1,2,3])}return g},border:function(a){return CKEDITOR.tools.style.border.fromCssRule(a)},_findColor:function(a){var b=[],c=CKEDITOR.tools.array,b=b.concat(a.match(this._rgbaRegExp)||[]),b=b.concat(a.match(this._hslaRegExp)||[]);return b=b.concat(c.filter(a.split(/\s+/),function(a){return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:a.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(a,b,c){var g=[];this.forEach(a, -function(h,m){b.call(c,h,m,a)&&g.push(h)});return g},find:function(a,b,c){for(var g=a.length,h=0;hCKEDITOR.env.version&&(!a||"object"!==typeof a)){b=[];if("string"===typeof a)for(c=0;cCKEDITOR.env.version)for(h=0;hparseFloat(c);g&&(c=c.replace("-",""));a.setStyle("width",c);b=a.getClientRect();c=Math.round(b.width);return g?-c:c}return c}}(),repeat:function(a,b){return Array(b+1).join(a)},tryThese:function(){for(var a, +b=0,c=arguments.length;bb;b++)a[b]=("0"+parseInt(a[b],10).toString(16)).slice(-2);return"#"+a.join("")})},normalizeHex:function(a){return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(a,b,c,g){a=b.toLowerCase();3==a.length&&(a=a.split(""),a=[a[0],a[0],a[1],a[1],a[2],a[2]].join(""));return"#"+a+g})},_isValidColorFormat:function(a){if(!a)return!1;a=a.replace(/\s+/g,"");return/^[a-z0-9()#%,./]+$/i.test(a)},parseCssText:function(a,b,c){var g={};c&&(a=(new CKEDITOR.dom.element("span")).setAttribute("style", +a).getAttribute("style")||"");a&&(a=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));if(!a||";"==a)return g;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,c,x){b&&(c=c.toLowerCase(),"font-family"==c&&(x=x.replace(/\s*,\s*/g,",")),x=CKEDITOR.tools.trim(x));g[c]=x});return g},writeCssText:function(a,b){var c,g=[];for(c in a)g.push(c+":"+a[c]);b&&g.sort();return g.join("; ")},objectCompare:function(a,b,c){var g;if(!a&&!b)return!0;if(!a||!b)return!1; +for(g in a)if(a[g]!=b[g])return!1;if(!c)for(g in b)if(a[g]!=b[g])return!1;return!0},objectKeys:function(a){return CKEDITOR.tools.object.keys(a)},convertArrayToObject:function(a,b){var c={};1==arguments.length&&(b=!0);for(var g=0,h=a.length;gc;c++)a.push(Math.floor(256*Math.random()));for(c=0;c=g||0==c&&48<=g&&57>=g||1==c&&48<=g&&57>=g&&45==m?h+("\\"+g.toString(16)+" "):0==c&&1==b&&45==g?h+("\\"+a.charAt(c)):128<=g||45==g||95==g||48<=g&&57>=g||65<=g&&90>=g||97<=g&&122>=g?h+a.charAt(c):h+("\\"+a.charAt(c));a=h}else a="";return a}, +getMouseButton:function(a){return(a=a&&a.data?a.data.$:a)?CKEDITOR.tools.normalizeMouseButton(a.button):!1},normalizeMouseButton:function(a,b){if(!CKEDITOR.env.ie||9<=CKEDITOR.env.version&&!CKEDITOR.env.ie6Compat)return a;for(var c=[[CKEDITOR.MOUSE_BUTTON_LEFT,1],[CKEDITOR.MOUSE_BUTTON_MIDDLE,4],[CKEDITOR.MOUSE_BUTTON_RIGHT,2]],g=0;gm)for(d=m;3>d;d++)h[d]=0;e[0]=(h[0]&252)>>2;e[1]=(h[0]&3)<<4|h[1]>>4;e[2]=(h[1]&15)<<2|(h[2]&192)>>6;e[3]=h[2]&63;for(d=0;4>d;d++)b=d<=m?b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e[d]):b+"\x3d"}return b},style:{parse:{_borderStyle:"none hidden dotted dashed solid double groove ridge inset outset".split(" "),_widthRegExp:/^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/, +_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(a){var b={},c=this._findColor(a);c.length&&(b.color=c[0],CKEDITOR.tools.array.forEach(c,function(b){a=a.replace(b,"")}));if(a=CKEDITOR.tools.trim(a))b.unprocessed=a;return b},margin:function(a){return CKEDITOR.tools.style.parse.sideShorthand(a,function(a){return a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g)|| +["0px"]})},sideShorthand:function(a,b){function c(a){g.top=h[a[0]];g.right=h[a[1]];g.bottom=h[a[2]];g.left=h[a[3]]}var g={},h=b?b(a):a.split(/\s+/);switch(h.length){case 1:c([0,0,0,0]);break;case 2:c([0,1,0,1]);break;case 3:c([0,1,2,1]);break;case 4:c([0,1,2,3])}return g},border:function(a){return CKEDITOR.tools.style.border.fromCssRule(a)},_findColor:function(a){var b=[],c=CKEDITOR.tools.array,b=b.concat(a.match(this._rgbaRegExp)||[]),b=b.concat(a.match(this._hslaRegExp)||[]);return b=b.concat(c.filter(a.split(/\s+/), +function(a){return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)?!0:a.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(a,b,c){var g=[];this.forEach(a,function(h,e){b.call(c,h,e,a)&&g.push(h)});return g},find:function(a,b,c){for(var g=a.length,h=0;hCKEDITOR.env.version&&(!a||"object"!==typeof a)){b=[];if("string"===typeof a)for(c=0;cCKEDITOR.env.version)for(h=0;hCKEDITOR.env.version?this.$.text+=a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();a&&a.is&&a.is("br")||(a=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&a.setAttribute("type","_moz"),this.append(a))}},breakParent:function(a,b){var c=new CKEDITOR.dom.range(this.getDocument());c.setStartAfter(this);c.setEndAfter(a); -var g=c.extractContents(!1,b||!1),d;c.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(c=new CKEDITOR.dom.element("div");d=g.getFirst();)d.$.style.backgroundColor&&(d.$.style.backgroundColor=d.$.style.backgroundColor),c.append(d);c.insertAfter(this);c.remove(!0)}else g.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&16)}:function(a){var b=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?b.contains(a.getParent().$): +var g=c.extractContents(!1,b||!1),e;c.insertNode(this.remove());if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(c=new CKEDITOR.dom.element("div");e=g.getFirst();)e.$.style.backgroundColor&&(e.$.style.backgroundColor=e.$.style.backgroundColor),c.append(e);c.insertAfter(this);c.remove(!0)}else g.insertAfterNode(this)},contains:document.compareDocumentPosition?function(a){return!!(this.$.compareDocumentPosition(a.$)&16)}:function(a){var b=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?b.contains(a.getParent().$): b!=a.$&&b.contains(a.$)},focus:function(){function a(){try{this.$.focus()}catch(b){}}return function(b){b?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(!0));return a.innerHTML},getClientRect:function(a){var b=CKEDITOR.tools.extend({}, this.$.getBoundingClientRect());!b.width&&(b.width=b.right-b.left);!b.height&&(b.height=b.bottom-b.top);return a?CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(),b):b},setHtml:CKEDITOR.env.ie&&9>CKEDITOR.env.version?function(a){try{var b=this.$;if(this.getParent())return b.innerHTML=a;var c=this.getDocument()._getHtml5ShivFrag();c.appendChild(b);b.innerHTML=a;c.removeChild(b);return a}catch(g){this.$.innerHTML="";b=new CKEDITOR.dom.element("body",this.getDocument());b.$.innerHTML=a;for(b=b.getChildren();b.count();)this.append(b.getItem(0)); return a}}:function(a){return this.$.innerHTML=a},setText:function(){var a=document.createElement("p");a.innerHTML="x";a=a.textContent;return function(b){this.$[a?"textContent":"innerText"]=b}}(),getAttribute:function(){var a=function(a){return this.$.getAttribute(a,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){switch(a){case "class":a="className";break;case "http-equiv":a="httpEquiv";break;case "name":return this.$.name;case "tabindex":return a=this.$.getAttribute(a, @@ -113,144 +113,144 @@ CKEDITOR.dtd.span,!(!a||!a["#"])):!0},isIdentical:function(a){var b=this.clone(0 a.getOuterHtml();if(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&this.is("a")){var c=this.getParent();c.type==CKEDITOR.NODE_ELEMENT&&(c=c.clone(),c.setHtml(b),b=c.getHtml(),c.setHtml(a),a=c.getHtml())}return b==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility"),b,c;a&&CKEDITOR.env.webkit&&(b=this.getWindow(),!b.equals(CKEDITOR.document.getWindow())&&(c=b.$.frameElement)&&(a=(new CKEDITOR.dom.element(c)).isVisible()));return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1; for(var a=this.getChildren(),b=0,c=a.count();bCKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var c=this.$;a=a.$;if(c!=a){var g;if(b)for(;g=c.lastChild;)a.insertBefore(c.removeChild(g),a.firstChild);else for(;g=c.firstChild;)a.appendChild(c.removeChild(g))}},mergeSiblings:function(){function a(b,c,g){if(c&&c.type==CKEDITOR.NODE_ELEMENT){for(var d= -[];c.data("cke-bookmark")||c.isEmptyInlineRemoveable();)if(d.push(c),c=g?c.getNext():c.getPrevious(),!c||c.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(c)){for(var e=g?b.getLast():b.getFirst();d.length;)d.shift().move(b,!g);c.moveChildren(b,!g);c.remove();e&&e.type==CKEDITOR.NODE_ELEMENT&&e.mergeSiblings()}}}return function(b){if(!1===b||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))a(this,this.getNext(),!0),a(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"", +c.specified:!1}return CKEDITOR.env.ie?8>CKEDITOR.env.version?function(b){return"name"==b?!!this.$.name:a.call(this,b)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,b){var c=this.$;a=a.$;if(c!=a){var g;if(b)for(;g=c.lastChild;)a.insertBefore(c.removeChild(g),a.firstChild);else for(;g=c.firstChild;)a.appendChild(c.removeChild(g))}},mergeSiblings:function(){function a(b,c,g){if(c&&c.type==CKEDITOR.NODE_ELEMENT){for(var e= +[];c.data("cke-bookmark")||c.isEmptyInlineRemoveable();)if(e.push(c),c=g?c.getNext():c.getPrevious(),!c||c.type!=CKEDITOR.NODE_ELEMENT)return;if(b.isIdentical(c)){for(var h=g?b.getLast():b.getFirst();e.length;)e.shift().move(b,!g);c.moveChildren(b,!g);c.remove();h&&h.type==CKEDITOR.NODE_ELEMENT&&h.mergeSiblings()}}}return function(b){if(!1===b||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))a(this,this.getNext(),!0),a(this,this.getPrevious())}}(),show:function(){this.setStyles({display:"", visibility:""})},setAttribute:function(){var a=function(a,b){this.$.setAttribute(a,b);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(b,c){"class"==b?this.$.className=c:"style"==b?this.$.style.cssText=c:"tabindex"==b?this.$.tabIndex=c:"checked"==b?this.$.checked=c:"contenteditable"==b?a.call(this,"contentEditable",c):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,c){if("src"==b&&c.match(/^http:\/\//))try{a.apply(this, arguments)}catch(g){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var b in a)this.setAttribute(b,a[b]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){"class"==a?a="className":"tabindex"==a?a="tabIndex":"contenteditable"==a&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b= -0;bCKEDITOR.env.version?(a=Math.round(100*a),this.setStyle("filter",100<=a?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+a+")")):this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", -"none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,b=this.getElementsByTag("*"),c=0,g=b.count();cf||0f?f:d);c&&(0>e||0e?e:g,0)},setState:function(a,b,c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+ +0;bCKEDITOR.env.version?(a=Math.round(100*a),this.setStyle("filter",100<=a?"":"progid:DXImageTransform.Microsoft.Alpha(opacity\x3d"+a+")")):this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", +"none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,b=this.getElementsByTag("*"),c=0,g=b.count();cf||0f?f:e);c&&(0>d||0d?d:g,0)},setState:function(a,b,c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+ "_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",!0);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");c&&this.setAttribute("aria-disabled",!0);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off"),this.removeClass(b+"_on"),this.removeClass(b+"_disabled"),c&&this.removeAttribute("aria-pressed"),c&&this.removeAttribute("aria-disabled")}}, -getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,b){var c=this.$.attributes;b=b||{};for(var g=0;gCKEDITOR.env.version){var d=g.ownerDocument.createEventObject(),e;for(e in b)d[e]=b[e];g.fireEvent(c, -d)}else g[g[a]?a:c](b)},isDetached:function(){var a=this.getDocument(),b=a.getDocumentElement();return b.equals(this)||b.contains(this)?!CKEDITOR.env.ie||8CKEDITOR.env.version){var e=g.ownerDocument.createEventObject(),d;for(d in b)e[d]=b[d];g.fireEvent(c, +e)}else g[g[a]?a:c](b)},isDetached:function(){var a=this.getDocument(),b=a.getDocumentElement();return b.equals(this)||b.contains(this)?!CKEDITOR.env.ie||8=F.getChildCount()?(F=F.getChild(x-1),p=!0):F=F.getChild(x):B=p=!0;u.type==CKEDITOR.NODE_TEXT?l?G=!0:u.split(H):0ea)for(;X;)X=f(X,C,!0);C=L}l|| -h()}}function b(){var a=!1,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(f){return c(f)||b(f)?!0:d(f)&&!a?a=!0:f.type==CKEDITOR.NODE_TEXT&&(f.hasAscendant("pre")||CKEDITOR.tools.trim(f.getText()).length)||f.type==CKEDITOR.NODE_ELEMENT&&!f.is(e)?!1:!0}}function c(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||b(d)?!0:!a&&k(d)||d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}} -function f(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&r(a)&&(b=a);return l(a)&&!(k(a)&&a.equals(b))})}}var e={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},k=CKEDITOR.dom.walker.bogus(),h=/^[\t\r\n ]*(?: |\xa0)$/,l=CKEDITOR.dom.walker.editable(),r=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var a= +(function(){function a(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset}function d(a,b,c,e,d){function f(a,b,c,g){var Y=c?a.getPrevious():a.getNext();if(g&&k)return Y;n||g?b.append(a.clone(!0,d),c):(a.remove(),l&&b.append(a,c));return Y}function m(){var a,b,c,g=Math.min(L.length,r.length);for(a=0;a=u.getChildCount()?(u=u.getChild(D-1),t=!0):u=u.getChild(D):A=t=!0;q.type==CKEDITOR.NODE_TEXT?n?I=!0:q.split(K):0ea)for(;W;)W=f(W,C,!0);C=Y}n|| +h()}}function b(){var a=!1,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!0),d=CKEDITOR.dom.walker.bogus();return function(f){return c(f)||b(f)?!0:d(f)&&!a?a=!0:f.type==CKEDITOR.NODE_TEXT&&(f.hasAscendant("pre")||CKEDITOR.tools.trim(f.getText()).length)||f.type==CKEDITOR.NODE_ELEMENT&&!f.is(e)?!1:!0}}function c(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(e){return c(e)||b(e)?!0:!a&&k(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$removeEmpty)}} +function f(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&l(a)&&(b=a);return n(a)&&!(k(a)&&a.equals(b))})}}var e={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},k=CKEDITOR.dom.walker.bogus(),h=/^[\t\r\n ]*(?: |\xa0)$/,n=CKEDITOR.dom.walker.editable(),l=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var a= new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){a?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),this.startOffset=this.endOffset);this.collapsed=!0},cloneContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed|| d(this,2,b,!1,"undefined"==typeof a?!0:a);return b},deleteContents:function(a){this.collapsed||d(this,0,null,a)},extractContents:function(a,b){var c=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||d(this,1,c,a,"undefined"==typeof b?!0:b);return c},equals:function(a){return this.startOffset===a.startOffset&&this.endOffset===a.endOffset&&this.startContainer.equals(a.startContainer)&&this.endContainer.equals(a.endContainer)},createBookmark:function(a){function b(a){return a.getAscendant(function(a){var b; -if(b=a.data&&a.data("cke-temp"))b=-1===CKEDITOR.tools.array.indexOf(["cke_copybin","cke_pastebin"],a.getAttribute("id"));return b},!0)}var c=this.startContainer,d=this.endContainer,e=this.collapsed,f,m,h,k;f=this.document.createElement("span");f.data("cke-bookmark",1);f.setStyle("display","none");f.setHtml("\x26nbsp;");a&&(h="cke_bm_"+CKEDITOR.tools.getNextNumber(),f.setAttribute("id",h+(e?"C":"S")));e||(m=f.clone(),m.setHtml("\x26nbsp;"),a&&m.setAttribute("id",h+"E"),k=this.clone(),b(d)&&(d=b(d), -k.moveToPosition(d,CKEDITOR.POSITION_AFTER_END)),k.collapse(),k.insertNode(m));k=this.clone();b(c)&&(d=b(c),k.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START));k.collapse(!0);k.insertNode(f);m?(this.setStartAfter(f),this.setEndBefore(m)):this.moveToPosition(f,CKEDITOR.POSITION_AFTER_END);return{startNode:a?h+(e?"C":"S"):f,endNode:a?h+"E":m,serializable:a,collapsed:e}},createBookmark2:function(){function a(b){var g=b.container,d=b.offset,e;e=g;var f=d;e=e.type!=CKEDITOR.NODE_ELEMENT||0===f||f==e.getChildCount()? -0:e.getChild(f-1).type==CKEDITOR.NODE_TEXT&&e.getChild(f).type==CKEDITOR.NODE_TEXT;e&&(g=g.getChild(d-1),d=g.getLength());if(g.type==CKEDITOR.NODE_ELEMENT&&0=a.offset&&(a.offset=d.getIndex(),a.container=d.getParent()))}}var c=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(c){var d=this.collapsed,e={container:this.startContainer,offset:this.startOffset},m={container:this.endContainer,offset:this.endOffset};c&&(a(e),b(e,this.root), -d||(a(m),b(m,this.root)));return{start:e.container.getAddress(c),end:d?null:m.container.getAddress(c),startOffset:e.offset,endOffset:m.offset,normalized:c,collapsed:d,is2:!0}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),c=a.startOffset,d=a.end&&this.document.getByAddress(a.end,a.normalized);a=a.endOffset;this.setStart(b,c);d?this.setEnd(d,a):this.collapse(!0)}else b=(c=a.serializable)?this.document.getById(a.startNode):a.startNode,a=c?this.document.getById(a.endNode): -a.endNode,this.setStartBefore(b),b.remove(),a?(this.setEndBefore(a),a.remove()):this.collapse(!0)},getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,c=this.startOffset,d=this.endOffset,e;if(a.type==CKEDITOR.NODE_ELEMENT)if(e=a.getChildCount(),e>c)a=a.getChild(c);else if(1>e)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a=a.getNextSourceNode()||a}if(b.type==CKEDITOR.NODE_ELEMENT)if(e=b.getChildCount(),e>d)b=b.getChild(d).getPreviousSourceNode(!0); -else if(1>e)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=b.lastChild;b=new CKEDITOR.dom.node(b)}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var c=this.startContainer,d=this.endContainer,c=c.equals(d)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(d);return b&&!c.is?c.getParent():c},optimize:function(){var a=this.startContainer,b=this.startOffset; +if(b=a.data&&a.data("cke-temp"))b=-1===CKEDITOR.tools.array.indexOf(["cke_copybin","cke_pastebin"],a.getAttribute("id"));return b},!0)}var c=this.startContainer,e=this.endContainer,d=this.collapsed,f,m,h,k;f=this.document.createElement("span");f.data("cke-bookmark",1);f.setStyle("display","none");f.setHtml("\x26nbsp;");a&&(h="cke_bm_"+CKEDITOR.tools.getNextNumber(),f.setAttribute("id",h+(d?"C":"S")));d||(m=f.clone(),m.setHtml("\x26nbsp;"),a&&m.setAttribute("id",h+"E"),k=this.clone(),b(e)&&(e=b(e), +k.moveToPosition(e,CKEDITOR.POSITION_AFTER_END)),k.collapse(),k.insertNode(m));k=this.clone();b(c)&&(e=b(c),k.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START));k.collapse(!0);k.insertNode(f);m?(this.setStartAfter(f),this.setEndBefore(m)):this.moveToPosition(f,CKEDITOR.POSITION_AFTER_END);return{startNode:a?h+(d?"C":"S"):f,endNode:a?h+"E":m,serializable:a,collapsed:d}},createBookmark2:function(){function a(b){var g=b.container,e=b.offset,d;d=g;var f=e;d=d.type!=CKEDITOR.NODE_ELEMENT||0===f||f==d.getChildCount()? +0:d.getChild(f-1).type==CKEDITOR.NODE_TEXT&&d.getChild(f).type==CKEDITOR.NODE_TEXT;d&&(g=g.getChild(e-1),e=g.getLength());if(g.type==CKEDITOR.NODE_ELEMENT&&0=a.offset&&(a.offset=e.getIndex(),a.container=e.getParent()))}}var c=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(c){var e=this.collapsed,d={container:this.startContainer,offset:this.startOffset},m={container:this.endContainer,offset:this.endOffset};c&&(a(d),b(d,this.root), +e||(a(m),b(m,this.root)));return{start:d.container.getAddress(c),end:e?null:m.container.getAddress(c),startOffset:d.offset,endOffset:m.offset,normalized:c,collapsed:e,is2:!0}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),c=a.startOffset,e=a.end&&this.document.getByAddress(a.end,a.normalized);a=a.endOffset;this.setStart(b,c);e?this.setEnd(e,a):this.collapse(!0)}else b=(c=a.serializable)?this.document.getById(a.startNode):a.startNode,a=c?this.document.getById(a.endNode): +a.endNode,this.setStartBefore(b),b.remove(),a?(this.setEndBefore(a),a.remove()):this.collapse(!0)},getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,c=this.startOffset,e=this.endOffset,d;if(a.type==CKEDITOR.NODE_ELEMENT)if(d=a.getChildCount(),d>c)a=a.getChild(c);else if(1>d)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a=a.getNextSourceNode()||a}if(b.type==CKEDITOR.NODE_ELEMENT)if(d=b.getChildCount(),d>e)b=b.getChild(e).getPreviousSourceNode(!0); +else if(1>d)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=b.lastChild;b=new CKEDITOR.dom.node(b)}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var c=this.startContainer,e=this.endContainer,c=c.equals(e)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(e);return b&&!c.is?c.getParent():c},optimize:function(){var a=this.startContainer,b=this.startOffset; a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&a.is("span")&&a.data("cke-bookmark")&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START);b&&b.is&&b.is("span")&&b.data("cke-bookmark")&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a, -b){var c=this.startContainer,d=this.startOffset,e=this.collapsed;if((!a||e)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength())d=c.getIndex()+1,c=c.getParent();else{var f=c.split(d),d=c.getIndex()+1,c=c.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(f,this.endOffset-this.startOffset):c.equals(this.endContainer)&&(this.endOffset+=1)}else d=c.getIndex(),c=c.getParent();this.setStart(c,d);if(e){this.collapse(!0);return}}c=this.endContainer;d=this.endOffset;b||e||!c||c.type!= -CKEDITOR.NODE_TEXT||(d?(d>=c.getLength()||c.split(d),d=c.getIndex()+1):d=c.getIndex(),c=c.getParent(),this.setEnd(c,d))},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var d=new RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var e=1;case CKEDITOR.ENLARGE_ELEMENT:var f=function(a,b){var c=new CKEDITOR.dom.range(h);c.setStart(a,b);c.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),g;for(c.guard= -function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=c.next();){if(g.type!=CKEDITOR.NODE_TEXT)return!1;K=g!=a?g.getText():g.substring(b);if(d.test(K))return!1}return!0};if(this.collapsed)break;var m=this.getCommonAncestor(),h=this.root,k,r,l,u,F,H=!1,x,K;x=this.startContainer;var p=this.startOffset;x.type==CKEDITOR.NODE_TEXT?(p&&(x=!CKEDITOR.tools.trim(x.substring(0,p)).length&&x,H=!!x),x&&((u=x.getPrevious())||(l=x.getParent()))):(p&&(u=x.getChild(p-1)||x.getLast()),u||(l=x)); -for(l=c(l);l||u;){if(l&&!u){!F&&l.equals(m)&&(F=!0);if(e?l.isBlockBoundary():!h.contains(l))break;H&&"inline"==l.getComputedStyle("display")||(H=!1,F?k=l:this.setStartBefore(l));u=l.getPrevious()}for(;u;)if(x=!1,u.type==CKEDITOR.NODE_COMMENT)u=u.getPrevious();else{if(u.type==CKEDITOR.NODE_TEXT)K=u.getText(),d.test(K)&&(u=null),x=/[\s\ufeff]$/.test(K);else if((u.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&u.is("br"))&&!u.data("cke-bookmark"))if(H&&CKEDITOR.dtd.$removeEmpty[u.getName()]){K=u.getText(); -if(d.test(K))u=null;else for(var p=u.$.getElementsByTagName("*"),D=0,B;B=p[D++];)if(!CKEDITOR.dtd.$removeEmpty[B.nodeName.toLowerCase()]){u=null;break}u&&(x=!!K.length)}else u=null;x&&(H?F?k=l:l&&this.setStartBefore(l):H=!0);if(u){x=u.getPrevious();if(!l&&!x){l=u;u=null;break}u=x}else l=null}l&&(l=c(l.getParent()))}x=this.endContainer;p=this.endOffset;l=u=null;F=H=!1;x.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(x.substring(p)).length?H=!0:(H=!x.getLength(),p==x.getLength()?(u=x.getNext())||(l=x.getParent()): -f(x,p)&&(l=x.getParent())):(u=x.getChild(p))||(l=x);for(;l||u;){if(l&&!u){!F&&l.equals(m)&&(F=!0);if(e?l.isBlockBoundary():!h.contains(l))break;H&&"inline"==l.getComputedStyle("display")||(H=!1,F?r=l:l&&this.setEndAfter(l));u=l.getNext()}for(;u;){x=!1;if(u.type==CKEDITOR.NODE_TEXT)K=u.getText(),f(u,0)||(u=null),x=/^[\s\ufeff]/.test(K);else if(u.type==CKEDITOR.NODE_ELEMENT){if((0=m.getLength()?f.setStartAfter(m):(f.setStartBefore(m),c=0):f.setStartBefore(m));h&&h.type==CKEDITOR.NODE_TEXT&&(l?l>=h.getLength()?f.setEndAfter(h):(f.setEndAfter(h),r=0):f.setEndBefore(h));var f=new CKEDITOR.dom.walker(f),u=CKEDITOR.dom.walker.bookmark(),F=CKEDITOR.dom.walker.bogus();f.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var H;f.guard=function(b,c){if(e&&F(b)||u(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&& -b.type==CKEDITOR.NODE_TEXT||c&&b.equals(H)||!1===d&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return!1;c||b.type!=CKEDITOR.NODE_ELEMENT||(H=b);return!0};c&&(m=f[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(m,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);r&&(f.reset(),(f=f[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(f,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)); -return!(!c&&!r)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(!0)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset);this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a, +b){var c=this.startContainer,e=this.startOffset,d=this.collapsed;if((!a||d)&&c&&c.type==CKEDITOR.NODE_TEXT){if(e)if(e>=c.getLength())e=c.getIndex()+1,c=c.getParent();else{var f=c.split(e),e=c.getIndex()+1,c=c.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(f,this.endOffset-this.startOffset):c.equals(this.endContainer)&&(this.endOffset+=1)}else e=c.getIndex(),c=c.getParent();this.setStart(c,e);if(d){this.collapse(!0);return}}c=this.endContainer;e=this.endOffset;b||d||!c||c.type!= +CKEDITOR.NODE_TEXT||(e?(e>=c.getLength()||c.split(e),e=c.getIndex()+1):e=c.getIndex(),c=c.getParent(),this.setEnd(c,e))},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}function e(a,b,c){var g=new CKEDITOR.dom.range(c);g.setStart(a,b);g.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(g);for(c.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=c.next();){if(g.type!=CKEDITOR.NODE_TEXT)return!1; +f=g!=a?g.getText():g.substring(b);if(d.test(f))return!1}return!0}var d=new RegExp(/[^\s\ufeff]/),f,m;switch(a){case CKEDITOR.ENLARGE_INLINE:var h=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var k=this.getCommonAncestor();m=this.root;var l,n,q,u,K,D=!1,B;B=this.startContainer;var t=this.startOffset;B.type==CKEDITOR.NODE_TEXT?(t&&(B=!CKEDITOR.tools.trim(B.substring(0,t)).length&&B,D=!!B),B&&((u=B.getPrevious())||(q=B.getParent()))):(t&&(u=B.getChild(t-1)||B.getLast()),u||(q=B));for(q=c(q);q|| +u;){if(q&&!u){!K&&q.equals(k)&&(K=!0);if(h?q.isBlockBoundary():!m.contains(q))break;D&&"inline"==q.getComputedStyle("display")||(D=!1,K?l=q:this.setStartBefore(q));u=q.getPrevious()}for(;u;)if(B=!1,u.type==CKEDITOR.NODE_COMMENT)u=u.getPrevious();else{if(u.type==CKEDITOR.NODE_TEXT)f=u.getText(),d.test(f)&&(u=null),B=/[\s\ufeff]$/.test(f);else if((u.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&u.is("br"))&&!u.data("cke-bookmark"))if(D&&CKEDITOR.dtd.$removeEmpty[u.getName()]){f=u.getText();if(d.test(f))u= +null;else for(var t=u.$.getElementsByTagName("*"),H=0,A;A=t[H++];)if(!CKEDITOR.dtd.$removeEmpty[A.nodeName.toLowerCase()]){u=null;break}u&&(B=!!f.length)}else u=null;B&&(D?K?l=q:q&&this.setStartBefore(q):D=!0);if(u){B=u.getPrevious();if(!q&&!B){q=u;u=null;break}u=B}else q=null}q&&(q=c(q.getParent()))}B=this.endContainer;t=this.endOffset;q=u=null;K=D=!1;B.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(B.substring(t)).length?D=!0:(D=!B.getLength(),t==B.getLength()?(u=B.getNext())||(q=B.getParent()):e(B, +t,m)&&(q=B.getParent())):(u=B.getChild(t))||(q=B);for(;q||u;){if(q&&!u){!K&&q.equals(k)&&(K=!0);if(h?q.isBlockBoundary():!m.contains(q))break;D&&"inline"==q.getComputedStyle("display")||(D=!1,K?n=q:q&&this.setEndAfter(q));u=q.getNext()}for(;u;){B=!1;if(u.type==CKEDITOR.NODE_TEXT)f=u.getText(),e(u,0,m)||(u=null),B=/^[\s\ufeff]/.test(f);else if(u.type==CKEDITOR.NODE_ELEMENT){if((0=m.getLength()?f.setStartAfter(m):(f.setStartBefore(m),c=0):f.setStartBefore(m));h&&h.type==CKEDITOR.NODE_TEXT&&(l?l>=h.getLength()?f.setEndAfter(h):(f.setEndAfter(h),n=0):f.setEndBefore(h));var f=new CKEDITOR.dom.walker(f),q=CKEDITOR.dom.walker.bookmark(),u=CKEDITOR.dom.walker.bogus();f.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var K;f.guard=function(b,c){if(d&&u(b)||q(b))return!0;if(a==CKEDITOR.SHRINK_ELEMENT&& +b.type==CKEDITOR.NODE_TEXT||c&&b.equals(K)||!1===e&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return!1;c||b.type!=CKEDITOR.NODE_ELEMENT||(K=b);return!0};c&&(m=f[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(m,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);n&&(f.reset(),(f=f[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(f,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)); +return!(!c&&!n)}},insertNode:function(a){this.optimizeBookmark();this.trim(!1,!0);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(!0)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset);this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a, a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(b,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex(),b=b.getParent());this._setStartContainer(b);this.startOffset=c;this.endContainer||(this._setEndContainer(b),this.endOffset=c);a(this)},setEnd:function(b,c){b.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[b.getName()]&&(c=b.getIndex()+1,b=b.getParent());this._setEndContainer(b);this.endOffset=c;this.startContainer||(this._setStartContainer(b), this.startOffset=c);a(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(b,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setStart(b,0);break;case CKEDITOR.POSITION_BEFORE_END:b.type==CKEDITOR.NODE_TEXT?this.setStart(b,b.getLength()):this.setStart(b, b.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(b);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(b)}a(this)},setEndAt:function(b,c){switch(c){case CKEDITOR.POSITION_AFTER_START:this.setEnd(b,0);break;case CKEDITOR.POSITION_BEFORE_END:b.type==CKEDITOR.NODE_TEXT?this.setEnd(b,b.getLength()):this.setEnd(b,b.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(b);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(b)}a(this)},fixBlock:function(a, -b){var c=this.createBookmark(),d=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);d.trim();this.insertNode(d);var e=d.getBogus();e&&e.remove();d.appendBogus();this.moveToBookmark(c);return d},splitBlock:function(a,b){var c=new CKEDITOR.dom.elementPath(this.startContainer,this.root),d=new CKEDITOR.dom.elementPath(this.endContainer,this.root),e=c.block,f=d.block,m=null;if(!c.blockLimit.equals(d.blockLimit))return null;"br"!= -a&&(e||(e=this.fixBlock(!0,a),f=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),f||(f=this.fixBlock(!1,a)));c=e&&this.checkStartOfBlock();d=f&&this.checkEndOfBlock();this.deleteContents();e&&e.equals(f)&&(d?(m=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(f,CKEDITOR.POSITION_AFTER_END),f=null):c?(m=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START),e=null):(f=this.splitElement(e,b|| -!1),e.is("ul","ol")||e.appendBogus()));return{previousBlock:e,nextBlock:f,wasStartOfBlock:c,wasEndOfBlock:d,elementPath:m}},splitElement:function(a,b){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var c=this.extractContents(!1,b||!1),d=a.clone(!1,b||!1);c.appendTo(d);d.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return d},removeEmptyBlocksAtEnd:function(){function a(d){return function(a){return b(a)||c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable()|| -d.is("table")&&a.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var c=this.createBookmark(),d=this[b?"endPath":"startPath"](),e=d.block||d.blockLimit,f;e&&!e.equals(d.root)&&!e.getFirst(a(e));)f=e.getParent(),this[b?"setEndAt":"setStartAt"](e,CKEDITOR.POSITION_AFTER_END),e.remove(1),e=f;this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer, -this.root)},checkBoundaryOfElement:function(a,b){var d=b==CKEDITOR.START,e=this.clone();e.collapse(d);e[d?"setStartAt":"setEndAt"](a,d?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);e=new CKEDITOR.dom.walker(e);e.evaluator=c(d);return e[d?"checkBackward":"checkForward"]()},checkStartOfBlock:function(a){var c=this.startContainer,d=this.startOffset;CKEDITOR.env.ie&&d&&c.type==CKEDITOR.NODE_TEXT&&(c=CKEDITOR.tools.ltrim(c.substring(0,d)),h.test(c)&&this.trim(0,1));a||this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer, -this.root);c=this.clone();c.collapse(!0);c.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkBackward()},checkEndOfBlock:function(a){var c=this.endContainer,d=this.endOffset;CKEDITOR.env.ie&&c.type==CKEDITOR.NODE_TEXT&&(c=CKEDITOR.tools.rtrim(c.substring(d)),h.test(c)&&this.trim(1,0));a||this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer,this.root);c=this.clone();c.collapse(!1);c.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END); -a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkForward()},getPreviousNode:function(a,b,c){var d=this.clone();d.collapse(1);d.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(b,c){for(;b;){if(b.type== +b){var c=this.createBookmark(),e=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(e);e.trim();this.insertNode(e);var d=e.getBogus();d&&d.remove();e.appendBogus();this.moveToBookmark(c);return e},splitBlock:function(a,b){var c=new CKEDITOR.dom.elementPath(this.startContainer,this.root),e=new CKEDITOR.dom.elementPath(this.endContainer,this.root),d=c.block,f=e.block,m=null;if(!c.blockLimit.equals(e.blockLimit))return null;"br"!= +a&&(d||(d=this.fixBlock(!0,a),f=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block),f||(f=this.fixBlock(!1,a)));c=d&&this.checkStartOfBlock();e=f&&this.checkEndOfBlock();this.deleteContents();d&&d.equals(f)&&(e?(m=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(f,CKEDITOR.POSITION_AFTER_END),f=null):c?(m=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START),d=null):(f=this.splitElement(d,b|| +!1),d.is("ul","ol")||d.appendBogus()));return{previousBlock:d,nextBlock:f,wasStartOfBlock:c,wasEndOfBlock:e,elementPath:m}},splitElement:function(a,b){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var c=this.extractContents(!1,b||!1),e=a.clone(!1,b||!1);c.appendTo(e);e.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return e},removeEmptyBlocksAtEnd:function(){function a(e){return function(a){return b(a)||c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable()|| +e.is("table")&&a.is("caption")?!1:!0}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(!1);return function(b){for(var c=this.createBookmark(),e=this[b?"endPath":"startPath"](),d=e.block||e.blockLimit,f;d&&!d.equals(e.root)&&!d.getFirst(a(d));)f=d.getParent(),this[b?"setEndAt":"setStartAt"](d,CKEDITOR.POSITION_AFTER_END),d.remove(1),d=f;this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer, +this.root)},checkBoundaryOfElement:function(a,b){var e=b==CKEDITOR.START,d=this.clone();d.collapse(e);d[e?"setStartAt":"setEndAt"](a,e?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=c(e);return d[e?"checkBackward":"checkForward"]()},checkStartOfBlock:function(a){var c=this.startContainer,e=this.startOffset;CKEDITOR.env.ie&&e&&c.type==CKEDITOR.NODE_TEXT&&(c=CKEDITOR.tools.ltrim(c.substring(0,e)),h.test(c)&&this.trim(0,1));a||this.trim();a=new CKEDITOR.dom.elementPath(this.startContainer, +this.root);c=this.clone();c.collapse(!0);c.setStartAt(a.block||a.blockLimit,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkBackward()},checkEndOfBlock:function(a){var c=this.endContainer,e=this.endOffset;CKEDITOR.env.ie&&c.type==CKEDITOR.NODE_TEXT&&(c=CKEDITOR.tools.rtrim(c.substring(e)),h.test(c)&&this.trim(1,0));a||this.trim();a=new CKEDITOR.dom.elementPath(this.endContainer,this.root);c=this.clone();c.collapse(!1);c.setEndAt(a.block||a.blockLimit,CKEDITOR.POSITION_BEFORE_END); +a=new CKEDITOR.dom.walker(c);a.evaluator=b();return a.checkForward()},getPreviousNode:function(a,b,c){var e=this.clone();e.collapse(1);e.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(e);c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var e=this.clone();e.collapse();e.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(e);c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(b,c){for(;b;){if(b.type== CKEDITOR.NODE_ELEMENT){if("false"==b.getAttribute("contentEditable")&&!b.data("cke-editable"))return 0;if(b.is("html")||"true"==b.getAttribute("contentEditable")&&(b.contains(c)||b.equals(c)))break}b=b.getParent()}return 1}return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(!1))return this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START), !0;for(var c=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&h.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);c=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable())this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),c=1;else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START); -else if("false"==a.getAttribute("contenteditable")&&a.is(CKEDITOR.dtd.$block))return this.setStartBefore(a),this.setEndAfter(a),!0;var d=a,e=c,f=void 0;d.type==CKEDITOR.NODE_ELEMENT&&d.isEditable(!1)&&(f=d[b?"getLast":"getFirst"](r));e||f||(f=d[b?"getPrevious":"getNext"](r));a=f}return!!c},moveToClosestEditablePosition:function(a,b){var c,d=0,e,f,m=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];a?(c=new CKEDITOR.dom.range(this.root),c.moveToPosition(a,m[b?0:1])):c=this.clone();if(a&& -!a.is(CKEDITOR.dtd.$block))d=1;else if(e=c[b?"getNextEditableNode":"getPreviousEditableNode"]())d=1,(f=e.type==CKEDITOR.NODE_ELEMENT)&&e.is(CKEDITOR.dtd.$block)&&"false"==e.getAttribute("contenteditable")?(c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),c.setEndAt(e,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&f&&e.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(c.setEnd(e,0),c.collapse()):c.moveToPosition(e,m[b?1:0]);d&&this.moveToRange(c);return!!d},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)}, -moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,!0)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(!1,!0),c=CKEDITOR.dom.walker.whitespaces(!0);a.evaluator=function(a){return c(a)&&b(a)};var d=a.next();a.reset();return d&&d.equals(a.previous())?d:null},getTouchedStartNode:function(){var a=this.startContainer; -return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=this.endContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:f(),getPreviousEditableNode:f(1),_getTableElement:function(a){a=a||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var b=this.getTouchedStartNode(),c=this.getTouchedEndNode(),d=b.getAscendant("table",!0),c=c.getAscendant("table",!0);return d&&!this.root.contains(d)? -null:this.getEnclosedNode()?this.getEnclosedNode().getAscendant(a,!0):d&&c&&(d.equals(c)||d.contains(c)||c.contains(d))?b.getAscendant(a,!0):null},scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",this.document),b,c,d,e=this.clone();e.optimize();(d=e.startContainer.type==CKEDITOR.NODE_TEXT)?(c=e.startContainer.getText(),b=e.startContainer.split(e.startOffset),a.insertAfter(e.startContainer)):e.insertNode(a);a.scrollIntoView();d&&(e.startContainer.setText(c), -b.remove());a.remove()},getClientRects:function(){function a(b,c){var d=CKEDITOR.tools.array.map(b,function(a){return a}),e=new CKEDITOR.dom.range(c.root),g,f,h;c.startContainer instanceof CKEDITOR.dom.element&&(f=0===c.startOffset&&c.startContainer.hasAttribute("data-widget"));c.endContainer instanceof CKEDITOR.dom.element&&(h=(h=c.endOffset===(c.endContainer.getChildCount?c.endContainer.getChildCount():c.endContainer.length))&&c.endContainer.hasAttribute("data-widget"));f&&e.setStart(c.startContainer.getParent(), -c.startContainer.getIndex());h&&e.setEnd(c.endContainer.getParent(),c.endContainer.getIndex()+1);if(f||h)c=e;e=c.cloneContents().find("[data-cke-widget-id]").toArray();if(e=CKEDITOR.tools.array.map(e,function(a){var b=c.root.editor;a=a.getAttribute("data-cke-widget-id");return b.widgets.instances[a].element}))return e=CKEDITOR.tools.array.map(e,function(a){var b;b=a.getParent().hasClass("cke_widget_wrapper")?a.getParent():a;g=this.root.getDocument().$.createRange();g.setStart(b.getParent().$,b.getIndex()); -g.setEnd(b.getParent().$,b.getIndex()+1);b=g.getClientRects();b.widgetRect=a.getClientRect();return b},c),CKEDITOR.tools.array.forEach(e,function(a){function b(e){CKEDITOR.tools.array.forEach(d,function(b,g){var f=CKEDITOR.tools.objectCompare(a[e],b);f||(f=CKEDITOR.tools.objectCompare(a.widgetRect,b));f&&(Array.prototype.splice.call(d,g,a.length-e,a.widgetRect),c=!0)});c||(earguments.length||(this.range=a,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function d(a){var b=[];a.forEach(function(a){if("true"==a.getAttribute("contenteditable"))return b.push(a),!1},CKEDITOR.NODE_ELEMENT,!0);return b}function b(a,c,e,f){a:{null==f&&(f=d(e));for(var h;h=f.shift();)if(h.getDtd().p){f={element:h,remaining:f};break a}f=null}if(!f)return 0;if((h=CKEDITOR.filter.instances[f.element.data("cke-filter")])&&!h.check(c))return b(a, c,e,f.remaining);c=new CKEDITOR.dom.range(f.element);c.selectNodeContents(f.element);c=c.createIterator();c.enlargeBr=a.enlargeBr;c.enforceRealBlocks=a.enforceRealBlocks;c.activeFilter=c.filter=h;a._.nestedEditable={element:f.element,container:e,remaining:f.remaining,iterator:c};return 1}function c(a,b,c){if(!b)return!1;a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var f=/^[\r\n\t ]+$/,e=CKEDITOR.dom.walker.bookmark(!1,!0),k=CKEDITOR.dom.walker.whitespaces(!0), -h=function(a){return e(a)&&k(a)},l={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,k,y,z,A;a=a||"p";if(this._.nestedEditable){if(d=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,d;this.activeFilter=this.filter;if(b(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable= -null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var t=this.range.clone();k=t.startPath();var m=t.endPath(),M=!t.collapsed&&c(t,k.block),v=!t.collapsed&&c(t,m.block,1);t.shrink(CKEDITOR.SHRINK_ELEMENT,!0);M&&t.setStartAt(k.block,CKEDITOR.POSITION_BEFORE_END);v&&t.setEndAt(m.block,CKEDITOR.POSITION_AFTER_START);k=t.endContainer.hasAscendant("pre",!0)||t.startContainer.hasAscendant("pre",!0);t.enlarge(this.forceBrBreak&&!k||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS); -t.collapsed||(k=new CKEDITOR.dom.walker(t.clone()),m=CKEDITOR.dom.walker.bookmark(!0,!0),k.evaluator=m,this._.nextNode=k.next(),k=new CKEDITOR.dom.walker(t.clone()),k.evaluator=m,k=k.previous(),this._.lastNode=k.getNextSourceNode(!0,null,t.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(m=this.range.clone(),m.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),m.checkEndOfBlock()&& -(m=new CKEDITOR.dom.elementPath(m.endContainer,m.root),this._.lastNode=(m.block||m.blockLimit).getNextSourceNode(!0))),this._.lastNode&&t.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=t.document.createText(""),this._.lastNode.insertAfter(k)),t=null);this._.started=1;k=t}m=this._.nextNode;t=this._.lastNode;for(this._.nextNode=null;m;){var M=0,v=m.hasAscendant("pre"),J=m.type!=CKEDITOR.NODE_ELEMENT,E=0;if(J)m.type==CKEDITOR.NODE_TEXT&&f.test(m.getText())&&(J=0);else{var u=m.getName(); -if(CKEDITOR.dtd.$block[u]&&"false"==m.getAttribute("contenteditable")){d=m;b(this,a,d);break}else if(m.isBlockBoundary(this.forceBrBreak&&!v&&{br:1})){if("br"==u)J=1;else if(!k&&!m.getChildCount()&&"hr"!=u){d=m;y=m.equals(t);break}k&&(k.setEndAt(m,CKEDITOR.POSITION_BEFORE_START),"br"!=u&&(this._.nextNode=m));M=1}else{if(m.getFirst()){k||(k=this.range.clone(),k.setStartAt(m,CKEDITOR.POSITION_BEFORE_START));m=m.getFirst();continue}J=1}}J&&!k&&(k=this.range.clone(),k.setStartAt(m,CKEDITOR.POSITION_BEFORE_START)); -y=(!M||J)&&m.equals(t);if(k&&!M)for(;!m.getNext(h)&&!y;){u=m.getParent();if(u.isBlockBoundary(this.forceBrBreak&&!v&&{br:1})){M=1;J=0;y||u.equals(t);k.setEndAt(u,CKEDITOR.POSITION_BEFORE_END);break}m=u;J=1;y=m.equals(t);E=1}J&&k.setEndAt(m,CKEDITOR.POSITION_AFTER_END);m=this._getNextSourceNode(m,E,t);if((y=!m)||M&&k)break}if(!d){if(!k)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;d=new CKEDITOR.dom.elementPath(k.startContainer,k.root);m=d.blockLimit;M={div:1,th:1,td:1}; -d=d.block;!d&&m&&!this.enforceRealBlocks&&M[m.getName()]&&k.checkStartOfBlock()&&k.checkEndOfBlock()&&!m.equals(k.root)?d=m:!d||this.enforceRealBlocks&&d.is(l)?(d=this.range.document.createElement(a),k.extractContents().appendTo(d),d.trim(),k.insertNode(d),z=A=!0):"li"!=d.getName()?k.checkStartOfBlock()&&k.checkEndOfBlock()||(d=d.clone(!1),k.extractContents().appendTo(d),d.trim(),A=k.splitBlock(),z=!A.wasStartOfBlock,A=!A.wasEndOfBlock,k.insertNode(d)):y||(this._.nextNode=d.equals(t)?null:this._getNextSourceNode(k.getBoundaryNodes().endNode, -1,t))}z&&(z=d.getPrevious())&&z.type==CKEDITOR.NODE_ELEMENT&&("br"==z.getName()?z.remove():z.getLast()&&"br"==z.getLast().$.nodeName.toLowerCase()&&z.getLast().remove());A&&(z=d.getLast())&&z.type==CKEDITOR.NODE_ELEMENT&&"br"==z.getName()&&(!CKEDITOR.env.needsBrFiller||z.getPrevious(e)||z.getNext(e))&&z.remove();this._.nextNode||(this._.nextNode=y||d.equals(t)||!t?null:this._getNextSourceNode(d,1,t));return d},_getNextSourceNode:function(a,b,c){function d(a){return!(a.equals(c)||a.equals(f))}var f= +h=function(a){return e(a)&&k(a)},n={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var d,k,y,z,G;a=a||"p";if(this._.nestedEditable){if(d=this._.nestedEditable.iterator.getNextParagraph(a))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,d;this.activeFilter=this.filter;if(b(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(a);this._.nestedEditable= +null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var v=this.range.clone();k=v.startPath();var m=v.endPath(),M=!v.collapsed&&c(v,k.block),w=!v.collapsed&&c(v,m.block,1);v.shrink(CKEDITOR.SHRINK_ELEMENT,!0);M&&v.setStartAt(k.block,CKEDITOR.POSITION_BEFORE_END);w&&v.setEndAt(m.block,CKEDITOR.POSITION_AFTER_START);k=v.endContainer.hasAscendant("pre",!0)||v.startContainer.hasAscendant("pre",!0);v.enlarge(this.forceBrBreak&&!k||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS); +v.collapsed||(k=new CKEDITOR.dom.walker(v.clone()),m=CKEDITOR.dom.walker.bookmark(!0,!0),k.evaluator=m,this._.nextNode=k.next(),k=new CKEDITOR.dom.walker(v.clone()),k.evaluator=m,k=k.previous(),this._.lastNode=k.getNextSourceNode(!0,null,v.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&(m=this.range.clone(),m.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),m.checkEndOfBlock()&& +(m=new CKEDITOR.dom.elementPath(m.endContainer,m.root),this._.lastNode=(m.block||m.blockLimit).getNextSourceNode(!0))),this._.lastNode&&v.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=v.document.createText(""),this._.lastNode.insertAfter(k)),v=null);this._.started=1;k=v}m=this._.nextNode;v=this._.lastNode;for(this._.nextNode=null;m;){var M=0,w=m.hasAscendant("pre"),J=m.type!=CKEDITOR.NODE_ELEMENT,F=0;if(J)m.type==CKEDITOR.NODE_TEXT&&f.test(m.getText())&&(J=0);else{var q=m.getName(); +if(CKEDITOR.dtd.$block[q]&&"false"==m.getAttribute("contenteditable")){d=m;b(this,a,d);break}else if(m.isBlockBoundary(this.forceBrBreak&&!w&&{br:1})){if("br"==q)J=1;else if(!k&&!m.getChildCount()&&"hr"!=q){d=m;y=m.equals(v);break}k&&(k.setEndAt(m,CKEDITOR.POSITION_BEFORE_START),"br"!=q&&(this._.nextNode=m));M=1}else{if(m.getFirst()){k||(k=this.range.clone(),k.setStartAt(m,CKEDITOR.POSITION_BEFORE_START));m=m.getFirst();continue}J=1}}J&&!k&&(k=this.range.clone(),k.setStartAt(m,CKEDITOR.POSITION_BEFORE_START)); +y=(!M||J)&&m.equals(v);if(k&&!M)for(;!m.getNext(h)&&!y;){q=m.getParent();if(q.isBlockBoundary(this.forceBrBreak&&!w&&{br:1})){M=1;J=0;y||q.equals(v);k.setEndAt(q,CKEDITOR.POSITION_BEFORE_END);break}m=q;J=1;y=m.equals(v);F=1}J&&k.setEndAt(m,CKEDITOR.POSITION_AFTER_END);m=this._getNextSourceNode(m,F,v);if((y=!m)||M&&k)break}if(!d){if(!k)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;d=new CKEDITOR.dom.elementPath(k.startContainer,k.root);m=d.blockLimit;M={div:1,th:1,td:1}; +d=d.block;!d&&m&&!this.enforceRealBlocks&&M[m.getName()]&&k.checkStartOfBlock()&&k.checkEndOfBlock()&&!m.equals(k.root)?d=m:!d||this.enforceRealBlocks&&d.is(n)?(d=this.range.document.createElement(a),k.extractContents().appendTo(d),d.trim(),k.insertNode(d),z=G=!0):"li"!=d.getName()?k.checkStartOfBlock()&&k.checkEndOfBlock()||(d=d.clone(!1),k.extractContents().appendTo(d),d.trim(),G=k.splitBlock(),z=!G.wasStartOfBlock,G=!G.wasEndOfBlock,k.insertNode(d)):y||(this._.nextNode=d.equals(v)?null:this._getNextSourceNode(k.getBoundaryNodes().endNode, +1,v))}z&&(z=d.getPrevious())&&z.type==CKEDITOR.NODE_ELEMENT&&("br"==z.getName()?z.remove():z.getLast()&&"br"==z.getLast().$.nodeName.toLowerCase()&&z.getLast().remove());G&&(z=d.getLast())&&z.type==CKEDITOR.NODE_ELEMENT&&"br"==z.getName()&&(!CKEDITOR.env.needsBrFiller||z.getPrevious(e)||z.getNext(e))&&z.remove();this._.nextNode||(this._.nextNode=y||d.equals(v)||!v?null:this._getNextSourceNode(d,1,v));return d},_getNextSourceNode:function(a,b,c){function d(a){return!(a.equals(c)||a.equals(f))}var f= this.range.root;for(a=a.getNextSourceNode(b,null,d);!e(a);)a=a.getNextSourceNode(b,null,d);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})(); CKEDITOR.command=function(a,d){this.uiItems=[];this.exec=function(b){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return!1;this.editorFocus&&a.focus();return!1===this.fire("exec")?!0:!1!==d.exec.call(this,a,b)};this.refresh=function(a,b){if(!this.readOnly&&a.readOnly)return!0;if(this.context&&!b.isContextFor(this.context)||!this.checkAllowed(!0))return this.disable(),!0;this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&this.disable();return!1===this.fire("refresh", {editor:a,path:b})?!0:d.refresh&&!1!==d.refresh.apply(this,arguments)};var b;this.checkAllowed=function(c){return c||"boolean"!=typeof b?b=a.activeFilter.checkFeature(this):b};CKEDITOR.tools.extend(this,d,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!d.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)}; CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return!1;this.previousState=this.state;this.state=a;this.fire("state");return!0},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF? this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3; CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"\x3c!DOCTYPE html\x3e",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,useComputedState:!0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]}; -(function(){function a(a,b,c,d,e){var f,g;a=[];for(f in b){g=b[f];g="boolean"==typeof g?{}:"function"==typeof g?{match:g}:D(g);"$"!=f.charAt(0)&&(g.elements=f);c&&(g.featureName=c.toLowerCase());var n=g;n.elements=k(n.elements,/\s+/)||null;n.propertiesOnly=n.propertiesOnly||!0===n.elements;var p=/\s*,\s*/,q=void 0;for(q in T){n[q]=k(n[q],p)||null;var B=n,m=O[q],x=k(n[O[q]],p),h=n[q],C=[],G=!0,I=void 0;x?G=!1:x={};for(I in h)"!"==I.charAt(0)&&(I=I.slice(1),C.push(I),x[I]=!0,G=!1);for(;I=C.pop();)h[I]= -h["!"+I],delete h["!"+I];B[m]=(G?!1:x)||null}n.match=n.match||null;d.push(g);a.push(g)}b=e.elements;e=e.generic;var l;c=0;for(d=a.length;c=--l&&(e&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),w(b))},z=function(b,c){a[b]=1;var e=d[b];delete d[b];for(var f=0;f=--n&&(e&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),x(b))},z=function(b,c){a[b]=1;var e=d[b];delete d[b];for(var f=0;f=CKEDITOR.env.version||CKEDITOR.env.ie9Compat)?f.$.onreadystatechange=function(){if("loaded"==f.$.readyState||"complete"==f.$.readyState)f.$.onreadystatechange=null,z(b,!0)}:(f.$.onload=function(){setTimeout(function(){f.$.onload=null;f.$.onerror=null;z(b,!0)},0)},f.$.onerror=function(){f.$.onload=null;f.$.onerror=null;z(b,!1)}));f.appendTo(CKEDITOR.document.getHead())}}};e&&CKEDITOR.document.getDocumentElement().setStyle("cursor", -"wait");for(var t=0;t]+)>)|(?:!--([\S|\s]*?)--!?>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}}; +!1;a.tabIndex=c.tabIndex||a.element&&a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:c.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:c.shiftEnterMode;c.skin&&(CKEDITOR.skinName=c.skin);a.fireOnce("configLoaded");a.dataProcessor=new CKEDITOR.htmlDataProcessor(a);a.filter=a.activeFilter=new CKEDITOR.filter(a);n(a)});b&&null!=b.customConfig&&(a.config.customConfig=b.customConfig);k(a)||a.fireOnce("customConfigLoaded")} +function n(a){CKEDITOR.skin.loadPart("editor",function(){l(a)})}function l(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(b,c){var e=a.config.title,d=a.config.applicationTitle;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(c);a.title="string"==typeof e||!1===e?e:[a.lang.editor,a.name].join(", ");a.applicationTitle="string"==typeof d||!1===d?d:[a.lang.application,a.name].join(", ");a.config.contentsLangDirection||(a.config.contentsLangDirection=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE? +a.element.getDirection(1):a.lang.dir);a.fire("langLoaded");g(a)})}function g(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",{styles:b})},null,null,1);x(a)})}function x(a){function b(a){if(!a)return"";CKEDITOR.tools.isArray(a)&&(a=a.join(","));return a.replace(/\s/g,"")}var c=a.config,e=b(c.plugins),d=b(c.extraPlugins),f=b(c.removePlugins);if(d)var g=new RegExp("(?:^|,)(?:"+d.replace(/,/g,"|")+")(?\x3d,|$)","g"),e=e.replace(g,""),e=e+(","+d);if(f)var h=new RegExp("(?:^|,)(?:"+ +f.replace(/,/g,"|")+")(?\x3d,|$)","g"),e=e.replace(h,"");CKEDITOR.env.air&&(e+=",adobeair");CKEDITOR.plugins.load(e.split(","),function(b){var e=[],d=[],f=[];a.plugins=CKEDITOR.tools.extend({},a.plugins,b);for(var g in b){var k=b[g],N=k.lang,L=null,r=k.requires,E;CKEDITOR.tools.isArray(r)&&(r=r.join(","));if(r&&(E=r.match(h)))for(;r=E.pop();)CKEDITOR.error("editor-plugin-required",{plugin:r.replace(",",""),requiredBy:g});N&&!a.lang[g]&&(N.split&&(N=N.split(",")),0<=CKEDITOR.tools.indexOf(N,a.langCode)? +L=a.langCode:(L=a.langCode.replace(/-.*/,""),L=L!=a.langCode&&0<=CKEDITOR.tools.indexOf(N,L)?L:0<=CKEDITOR.tools.indexOf(N,"en")?"en":N[0]),k.langEntries&&k.langEntries[L]?(a.lang[g]=k.langEntries[L],L=null):f.push(CKEDITOR.getUrl(k.path+"lang/"+L+".js")));d.push(L);e.push(k)}CKEDITOR.scriptLoader.load(f,function(){if(!a.isDestroyed()&&!a.isDetached()){for(var b=["beforeInit","init","afterInit"],f=0;f]+)>)|(?:!--([\S|\s]*?)--!?>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}}; (function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,d={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(b){for(var c,f,e=0,k;c=this._.htmlPartsRegex.exec(b);){f=c.index;if(f>e)if(e=b.substring(e,f),k)k.push(e);else this.onText(e); -e=this._.htmlPartsRegex.lastIndex;if(f=c[1])if(f=f.toLowerCase(),k&&CKEDITOR.dtd.$cdata[f]&&(this.onCDATA(k.join("")),k=null),!k){this.onTagClose(f);continue}if(k)k.push(c[0]);else if(f=c[3]){if(f=f.toLowerCase(),!/="/.test(f)){var h={},l,r=c[4];c=!!c[5];if(r)for(;l=a.exec(r);){var g=l[1].toLowerCase();l=l[2]||l[3]||l[4]||"";h[g]=!l&&d[g]?g:CKEDITOR.tools.htmlDecodeAttr(l)}this.onTagOpen(f,h,c);!k&&CKEDITOR.dtd.$cdata[f]&&(k=[])}}else if(f=c[2])this.onComment(f)}if(b.length>e)this.onText(b.substring(e, +e=this._.htmlPartsRegex.lastIndex;if(f=c[1])if(f=f.toLowerCase(),k&&CKEDITOR.dtd.$cdata[f]&&(this.onCDATA(k.join("")),k=null),!k){this.onTagClose(f);continue}if(k)k.push(c[0]);else if(f=c[3]){if(f=f.toLowerCase(),!/="/.test(f)){var h={},n,l=c[4];c=!!c[5];if(l)for(;n=a.exec(l);){var g=n[1].toLowerCase();n=n[2]||n[3]||n[4]||"";h[g]=!n&&d[g]?g:CKEDITOR.tools.htmlDecodeAttr(n)}this.onTagOpen(f,h,c);!k&&CKEDITOR.dtd.$cdata[f]&&(k=[])}}else if(f=c[2])this.onComment(f)}if(b.length>e)this.onText(b.substring(e, b.length))}}})(); CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(a){this._.output.push("\x3c",a)},openTagClose:function(a,d){d?this._.output.push(" /\x3e"):this._.output.push("\x3e")},attribute:function(a,d){"string"==typeof d&&(d=CKEDITOR.tools.htmlEncodeAttr(d));this._.output.push(" ",a,'\x3d"',d,'"')},closeTag:function(a){this._.output.push("\x3c/",a,"\x3e")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("\x3c!--",a, "--\x3e")},write:function(a){this._.output.push(a)},reset:function(){this._.output=[];this._.indent=!1},getHtml:function(a){var d=this._.output.join("");a&&this.reset();return d}}});"use strict"; @@ -309,228 +310,232 @@ CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlPar (function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a){var d=this.getAscendant("style");if(d&&d.getAscendant({math:1,svg:1})){var d=CKEDITOR.htmlParser.fragment.fromHtml(this.value),b=new CKEDITOR.htmlParser.basicWriter;a.applyTo(d);d.writeHtml(b);this.value=b.getHtml()}},writeHtml:function(a){a.write(this.value)}})})();"use strict"; CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:!0,hasInlineStarted:!1}}; (function(){function a(a){return a.attributes["data-cke-survive"]?!1:"a"==a.name&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var d=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),b={ol:1,ul:1},c=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),f={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml= -function(e,k,h){function l(a){var b;if(0k;k++)if(e=d[k]){e=e.exec(a,c,this);if(!1===e)return null;if(e&&e!=c)return this.onNode(a,e);if(c.parent&&!c.name)break}return c}, onNode:function(a,c){var d=c.type;return d==CKEDITOR.NODE_ELEMENT?this.onElement(a,c):d==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,c.value,c)):d==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,c.value,c)):null},onAttribute:function(a,c,d,e){return(d=this.attributesRules[d])?d.exec(a,e,c,this):e}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,c,d){this.rules.splice(this.findIndex(c),0,{value:a,priority:c,options:d})},addMany:function(a, -c,d){for(var e=[this.findIndex(c),0],k=0,h=a.length;k/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function w(a){return a.replace(O,function(a,b){return decodeURIComponent(b)})}function y(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, -function(a){return"\x3c!--"+v+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function z(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)})}function A(a,b){var c=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function t(a,b,c){var d=[],e=b.config.protectedSource,f=b._.dataStore|| -(b._.dataStore={id:1}),g=new RegExp("\x3c\\!--\\{cke_temp_"+c+"(comment)?\\}(\\d*?)--\x3e","g"),e=[/|$)/gi,//gi,//gi].concat(e);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_temp_"+c+"comment}"+(d.push(a)-1)+"--\x3e"});for(var p=0;p]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(a,b){f[f.id]=decodeURIComponent(b);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,e){return"\x3c"+c+d+"\x3e"+A(z(e),b)+"\x3c/"+c+"\x3e"})}var m;CKEDITOR.htmlDataProcessor= -function(b){var c,e,f=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(F);c.addRules(H,{applyToAll:!0});c.addRules(a(b,"data"),{applyToAll:!0});e.addRules(x);e.addRules(K,{applyToAll:!0});e.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){var c;var e=window.crypto||window.msCrypto;c=e?e.getRandomValues(new Uint32Array(1))[0]:Math.floor(9E9*Math.random()+1E9); -a=a.data;var e=a.dataValue,e=m(e),e=t(e,b,c),e=g(e,T),e=r(e,c),e=g(e,G),e=e.replace(q,"$1cke:$2"),e=e.replace(N,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),e=e.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),e=e.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+c+"-$2"),f=a.context||b.editable().getName(),p;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==f&&(f="div",e="\x3cpre\x3e"+e+"\x3c/pre\x3e",p=1);f=b.document.createElement(f);f.setHtml("a"+e);e=f.getHtml().substr(1);e=e.replace(new RegExp("data-cke-"+ -c+"-","ig"),"");p&&(e=e.replace(/^
|<\/pre>$/gi,""));e=e.replace(I,"$1$2");e=w(e);e=z(e);c=!1===a.fixForBody?!1:d(a.enterMode,b.config.autoParagraph);e=CKEDITOR.htmlParser.fragment.fromHtml(e,a.context,c);c&&(p=e,!p.children.length&&CKEDITOR.dtd[p.name][c]&&(c=new CKEDITOR.htmlParser.element(c),p.add(c)));a.dataValue=e},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(f.dataFilter,
+c,d){for(var e=[this.findIndex(c),0],k=0,h=a.length;k/g,"\x26gt;")+"\x3c/textarea\x3e");return"\x3ccke:encoded\x3e"+encodeURIComponent(a)+"\x3c/cke:encoded\x3e"})}function x(a){return a.replace(L,function(a,b){return decodeURIComponent(b)})}function y(a){return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,
+function(a){return"\x3c!--"+w+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\x3e"})}function z(a){return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)})}function G(a,b){var c=b._.dataStore;return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function v(a,b,c){var d=[],e=b.config.protectedSource,f=b._.dataStore||
+(b._.dataStore={id:1}),g=new RegExp("\x3c\\!--\\{cke_temp_"+c+"(comment)?\\}(\\d*?)--\x3e","g"),e=[/|$)/gi,//gi,//gi].concat(e);a=a.replace(/\x3c!--[\s\S]*?--\x3e/g,function(a){return"\x3c!--{cke_temp_"+c+"comment}"+(d.push(a)-1)+"--\x3e"});for(var t=0;t]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(a){return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(a,b){f[f.id]=decodeURIComponent(b);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,e){return"\x3c"+c+d+"\x3e"+G(z(e),b)+"\x3c/"+c+"\x3e"})}var m;CKEDITOR.htmlDataProcessor=
+function(b){var c,e,f=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;this.htmlFilter=e=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(u);c.addRules(K,{applyToAll:!0});c.addRules(a(b,"data"),{applyToAll:!0});e.addRules(D);e.addRules(B,{applyToAll:!0});e.addRules(a(b,"html"),{applyToAll:!0});b.on("toHtml",function(a){var c;var e=window.crypto||window.msCrypto;c=e?e.getRandomValues(new Uint32Array(1))[0]:Math.floor(9E9*Math.random()+1E9);
+a=a.data;var e=a.dataValue,e=m(e),e=v(e,b,c),e=g(e,N),e=l(e,c),e=g(e,I),e=e.replace(r,"$1cke:$2"),e=e.replace(S,"\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),e=e.replace(/(]*>)(\r\n|\n)/g,"$1$2$2"),e=e.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+c+"-$2"),f=a.context||b.editable().getName(),t;CKEDITOR.env.ie&&9>CKEDITOR.env.version&&"pre"==f&&(f="div",e="\x3cpre\x3e"+e+"\x3c/pre\x3e",t=1);f=b.document.createElement(f);f.setHtml("a"+e);e=f.getHtml().substr(1);e=e.replace(new RegExp("data-cke-"+
+c+"-","ig"),"");t&&(e=e.replace(/^
|<\/pre>$/gi,""));e=e.replace(E,"$1$2");e=x(e);e=z(e);c=!1===a.fixForBody?!1:d(a.enterMode,b.config.autoParagraph);e=CKEDITOR.htmlParser.fragment.fromHtml(e,a.context,c);c&&(t=e,!t.children.length&&CKEDITOR.dtd[t.name][c]&&(c=new CKEDITOR.htmlParser.element(c),t.add(c)));a.dataValue=e},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,!0,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(f.dataFilter,
 !0)},null,null,10);b.on("toHtml",function(a){a=a.data;var b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(!0);a.dataValue=y(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^
/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,d(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(f.htmlFilter, -!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,!1,!0)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,d=f.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(!0);c=z(c);c=A(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var e=this.editor,f,g,p,q;b&&"object"==typeof b?(f=b.context,c=b.fixForBody,d=b.dontFilter,g=b.filter,p=b.enterMode,q=b.protectedWhitespaces):f=b;f||null===f||(f= -e.editable().getName());return e.fire("toHtml",{dataValue:a,context:f,fixForBody:c,dontFilter:d,filter:g||e.filter,enterMode:p||e.enterMode,protectedWhitespaces:q}).dataValue},toDataFormat:function(a,b){var c,d,e;b&&(c=b.context,d=b.filter,e=b.enterMode);c||null===c||(c=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,filter:d||this.editor.filter,context:c,enterMode:e||this.editor.enterMode}).dataValue},protectSource:function(a){return t(a,this.editor)},unprotectSource:function(a){return A(a, -this.editor)},unprotectRealComments:function(a){return z(a)}};var M=/(?: |\xa0)$/,v="{cke_protected}",J=CKEDITOR.dtd,E="caption colgroup col thead tfoot tbody".split(" "),u=CKEDITOR.tools.extend({},J.$blockLimit,J.$block),F={elements:{input:h,textarea:h}},H={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var b=a.attributes.src.toLowerCase().replace(/[^a-z]/gi,"");if(0===b.indexOf("javascript")|| -0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},x={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var c=b.attributes.width,b=b.attributes.height;c&&(a.attributes.width=c);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},K={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/, -""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var c=["name","href","src"],d,e=0;ed?1:-1})},param:function(a){a.children= +!0)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,!1,!0)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,e=f.writer;e.reset();c.writeChildrenHtml(e);c=e.getHtml(!0);c=z(c);c=G(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,e){var d=this.editor,f,g,t,r;b&&"object"==typeof b?(f=b.context,c=b.fixForBody,e=b.dontFilter,g=b.filter,t=b.enterMode,r=b.protectedWhitespaces):f=b;f||null===f||(f= +d.editable().getName());return d.fire("toHtml",{dataValue:a,context:f,fixForBody:c,dontFilter:e,filter:g||d.filter,enterMode:t||d.enterMode,protectedWhitespaces:r}).dataValue},toDataFormat:function(a,b){var c,e,d;b&&(c=b.context,e=b.filter,d=b.enterMode);c||null===c||(c=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,filter:e||this.editor.filter,context:c,enterMode:d||this.editor.enterMode}).dataValue},protectSource:function(a){return v(a,this.editor)},unprotectSource:function(a){return G(a, +this.editor)},unprotectRealComments:function(a){return z(a)}};var M=/(?: |\xa0)$/,w="{cke_protected}",J=CKEDITOR.dtd,F="caption colgroup col thead tfoot tbody".split(" "),q=CKEDITOR.tools.extend({},J.$blockLimit,J.$block),u={elements:{input:h,textarea:h}},K={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(a){if(a.attributes&&a.attributes.src){var b=a.attributes.src.toLowerCase().replace(/[^a-z]/gi,"");if(0===b.indexOf("javascript")|| +0===b.indexOf("data"))a.attributes["data-cke-pa-src"]=a.attributes.src,delete a.attributes.src}}}},D={elements:{embed:function(a){var b=a.parent;if(b&&"object"==b.name){var c=b.attributes.width,b=b.attributes.height;c&&(a.attributes.width=c);b&&(a.attributes.height=b)}},a:function(a){var b=a.attributes;if(!(a.children.length||b.name||b.id||a.attributes["data-cke-saved-name"]))return!1}}},B={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/, +""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return!1;for(var c=["name","href","src"],e,d=0;de?1:-1})},param:function(a){a.children= [];a.isEmpty=!0;return a},span:function(a){"Apple-style-span"==a.attributes["class"]&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];b&&b.value&&(b.value=CKEDITOR.tools.trim(b.value));a.attributes.type||(a.attributes.type="text/css")},title:function(a){var b=a.children[0];!b&&k(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]|| -""},input:l,textarea:l},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(K.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})});var p=/<(a|area|img|input|source)\b([^>]*)>/gi,D=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,B=/^(href|src|name)$/i,G=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,T=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi, -O=/([^<]*)<\/cke:encoded>/gi,q=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,I=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,N=/]*?)\/?>(?!\s*<\/cke:\1)/gi;m=function(){function a(b,c){for(var d=0;d/g];return function(b){for(;a(d,b);)for(var c=d,e=0;e]*)>/gi,H=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,A=/^(href|src|name)$/i,I=/(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,N=/(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi, +L=/([^<]*)<\/cke:encoded>/gi,r=/(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,E=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,S=/]*?)\/?>(?!\s*<\/cke:\1)/gi;m=function(){function a(b,c){for(var e=0;e/g];return function(b){for(;a(e,b);)for(var c=e,d=0;db?1:0},b=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:b.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var d=this,k,h;b=d.getFilterContext(b);if(!d.parent)a.onRoot(b, -d);for(;;){k=d.name;if(!(h=a.onElementName(b,k)))return this.remove(),!1;d.name=h;if(!(d=a.onElement(b,d)))return this.remove(),!1;if(d!==this)return this.replaceWith(d),!1;if(d.name==k)break;if(d.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(d),!1;if(!d.name)return this.replaceWithChildren(),!1}k=d.attributes;var l,r;for(l in k){for(h=k[l];;)if(r=a.onAttributeName(b,l))if(r!=l)delete k[l],l=r;else break;else{delete k[l];break}r&&(!1===(h=a.onAttribute(b,d,r,h))?delete k[r]:k[r]=h)}d.isEmpty|| -this.filterChildren(a,!1,b);return!0},filterChildren:b.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var e=this.name,k=[],h=this.attributes,l,r;a.openTag(e,h);for(l in h)k.push([l,h[l]]);a.sortAttributes&&k.sort(d);l=0;for(r=k.length;lb?1:0},b=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:b.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var e=this,d,h;b=e.getFilterContext(b);if(!e.parent)a.onRoot(b, +e);for(;;){d=e.name;if(!(h=a.onElementName(b,d)))return this.remove(),!1;e.name=h;if(!(e=a.onElement(b,e)))return this.remove(),!1;if(e!==this)return this.replaceWith(e),!1;if(e.name==d)break;if(e.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(e),!1;if(!e.name)return this.replaceWithChildren(),!1}d=e.attributes;var n,l;for(n in d){for(h=d[n];;)if(l=a.onAttributeName(b,n))if(l!=n)delete d[n],n=l;else break;else{delete d[n];break}l&&(!1===(h=a.onAttribute(b,e,l,h))?delete d[l]:d[l]=h)}e.isEmpty|| +this.filterChildren(a,!1,b);return!0},filterChildren:b.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var e=this.name,k=[],h=this.attributes,n,l;a.openTag(e,h);for(n in h)k.push([n,h[n]]);a.sortAttributes&&k.sort(d);n=0;for(l=k.length;ne.secure.minor||e.current.minor===e.secure.minor&& +e.current.patch>=e.secure.patch?!0:!1;a()}};b.open("GET",c);b.responseType="text";b.send()}catch(f){}}function d(a){var c=a.match(b);return c?{original:a,major:4,minor:Number(c[1]),patch:Number(c[2]),isLts:!!c[3]}:null}var b=/^4\.(\d+)\.(\d+)(-lts)?(?: \(?.+?\)?)?$/,c="Drupal"in window,f=!1,e={current:d(CKEDITOR.version)};!c&&e.current&&(CKEDITOR.config.versionCheck=e.current.isLts?!1:!0,CKEDITOR.on("instanceReady",function(b){var c=b.editor;c.config.versionCheck&&(c.on("dialogShow",function(b){var d= +b.data;"about"===d._.name&&a(function(){var a=d.getElement().findOne(".cke_about_version-check"),b;b=c.lang.versionCheck;var f="";e.isLatest||(f=b.aboutDialogUpgradeMessage);e.isSecure||(f=b.aboutDialogInsecureMessage);b=f.replace("%current",e.current.original).replace("%latest",e.latest.original).replace(/%link/g,"https://ckeditor.com/ckeditor-4-support/");a.setHtml("");c.config.versionCheck&&(a.setStyle("color",e.isSecure?"":"#C83939"),a.setHtml(b))})}),a(function(){if(!e.isSecure){var a=c.lang.versionCheck.notificationMessage.replace("%current", +e.current.original).replace("%latest",e.latest.original).replace(/%link/g,"https://ckeditor.com/ckeditor-4-support/"),b="notification"in c.plugins;if(window.console&&window.console.error&&!f){f=!0;var d=c.lang.versionCheck.consoleMessage.replace("%current",e.current.original).replace("%latest",e.latest.original).replace(/%link/g,"https://ckeditor.com/ckeditor-4-support/");console.error(d)}b&&c.showNotification(a,"warning")}}))}))})();delete CKEDITOR.loadFullCore;CKEDITOR.instances={}; +CKEDITOR.document=new CKEDITOR.dom.document(document);CKEDITOR.add=function(a){function d(){CKEDITOR.currentInstance==a&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}CKEDITOR.instances[a.name]=a;a.on("focus",function(){CKEDITOR.currentInstance!=a&&(CKEDITOR.currentInstance=a,CKEDITOR.fire("currentInstance"))});a.on("blur",d);a.on("destroy",d);CKEDITOR.fire("instance",null,a)};CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]}; (function(){var a={};CKEDITOR.addTemplate=function(d,b){var c=a[d];if(c)return c;c={name:d,source:b};CKEDITOR.fire("template",c);return a[d]=new CKEDITOR.template(c.source)};CKEDITOR.getTemplate=function(d){return a[d]}})();(function(){var a=[];CKEDITOR.addCss=function(d){a.push(d)};CKEDITOR.getCss=function(){return a.join("\n")}})();CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")});CKEDITOR.TRISTATE_ON=1;CKEDITOR.TRISTATE_OFF=2; CKEDITOR.TRISTATE_DISABLED=0; -(function(){CKEDITOR.inline=function(a,d){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;if(CKEDITOR.editor.shouldDelayEditorCreation(a,d))return CKEDITOR.editor.initializeDelayedEditorCreation(a,d,"inline"),null;var b=a.is("textarea")?a:null,c=b?b.getValue():a.getHtml(),f=new CKEDITOR.editor(d,a,CKEDITOR.ELEMENT_MODE_INLINE);b?(f.setData(c,null,!0),a=CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"'+!!f.readOnly+'" class\x3d"cke_textarea_inline"\x3e'+b.getValue()+"\x3c/div\x3e", +(function(){CKEDITOR.inline=function(a,d){a=CKEDITOR.editor._getEditorElement(a);if(!a)return null;if(CKEDITOR.editor.shouldDelayEditorCreation(a,d))return CKEDITOR.editor.initializeDelayedEditorCreation(a,d,"inline");var b=a.is("textarea")?a:null,c=b?b.getValue():a.getHtml(),f=new CKEDITOR.editor(d,a,CKEDITOR.ELEMENT_MODE_INLINE);b?(f.setData(c,null,!0),a=CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"'+!!f.readOnly+'" class\x3d"cke_textarea_inline"\x3e'+b.getValue()+"\x3c/div\x3e", CKEDITOR.document),a.insertAfter(b),b.hide(),b.$.form&&f._attachToForm()):(d&&"undefined"!==typeof d.readOnly&&!d.readOnly&&a.setAttribute("contenteditable","true"),f.setData(c,null,!0));f.on("loaded",function(){f.fire("uiReady");f.editable(a);f.container=a;f.ui.contentsElement=a;f.setData(f.getData(1));f.resetDirty();f.fire("contentDom");f.mode="wysiwyg";f.fire("mode");f.status="ready";f.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,f)},null,null,1E4);f.on("destroy",function(){var a= f.container;b&&a&&(a.clearCustomData(),a.remove());b&&b.show();f.element.clearCustomData();delete f.element});return f};CKEDITOR.inlineAll=function(){var a,d,b;for(b in CKEDITOR.dtd.$editable)for(var c=CKEDITOR.document.getElementsByTag(b),f=0,e=c.count();fCKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),b());else if(this.hasFocus)this.focus(),a();else this.once("focus", -function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document);a={doc:this.getDocument(),range:a.clone()};u.eol.detect(a,this);u.bogus.exclude(a);u.cell.shrink(a);a.fragment=a.range.cloneContents();u.tree.rebuild(a,this);u.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var c=F,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(),e;a.enlarge(CKEDITOR.ENLARGE_INLINE, -1);c.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var g=this.editor.createRange();g.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=g.createBookmark();c.list.detectMerge(d,this);c.table.detectRanges(d,this);c.block.detectMerge(d,this);d.tableContentsRanges?(c.table.deleteRanges(d),a.moveToBookmark(d.bookmark),d.range=a):(a.moveToBookmark(d.bookmark),d.range=a,a.extractContents(c.detectExtractMerge(d)));a.moveToBookmark(d.targetBookmark);a.optimize(); -c.fixUneditableRangePosition(a);c.list.merge(d,this);c.table.purge(d,this);c.block.merge(d,this);if(b){c=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&c.block&&!a.root.equals(c.block)){a:{var d=c.block.getElementsByTag("span"),g=0,f;if(d)for(;f=d.getItem(g++);)if(!A(f)){d=!0;break a}d=!1}d=!d}d&&(a.moveToPosition(c.block,CKEDITOR.POSITION_BEFORE_START),c.block.remove())}else c.autoParagraph(this.editor,a),t(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings(); +g||e==CKEDITOR.ENTER_BR||(g=b.fixBlock(!0,e==CKEDITOR.ENTER_DIV?"div":"p"),b.moveToElementEditStart(g))));d.selectRanges([b]);x(this)},insertElementIntoSelection:function(a){this.insertElement(a)},insertElementIntoRange:function(a,b){var c=this.editor,d=c.config.enterMode,e=a.getName(),f=CKEDITOR.dtd.$block[e];if(b.checkReadOnly())return!1;b.deleteContents(1);b.startContainer.type==CKEDITOR.NODE_ELEMENT&&(b.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})?J(b):b.startContainer.is(CKEDITOR.dtd.$list)&& +F(b));var h,k;if(f)for(;(h=b.getCommonAncestor(0,1))&&(k=CKEDITOR.dtd[h.getName()])&&(!k||!k[e]);)if(h.getName()in CKEDITOR.dtd.span){var f=b.splitElement(h),r=b.createBookmark();g(h);g(f);b.moveToBookmark(r)}else b.checkStartOfBlock()&&b.checkEndOfBlock()?(b.setStartBefore(h),b.collapse(!0),h.remove()):b.splitBlock(d==CKEDITOR.ENTER_DIV?"div":"p",c.editable());b.insertNode(a);return!0},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.fixInitialSelection();"unloaded"== +this.status&&(this.status="ready");this.editor.fire("dataReady")},getData:function(a){var b=this.getHtml();a||(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",String(!a));this.setAttribute("aria-readonly",String(a))},detach:function(){this.status="detached";this.editor.setData(this.editor.getData(),{internal:!0});this.clearListeners();try{this._.cleanCustomData()}catch(a){if(!CKEDITOR.env.ie||-2146828218!==a.number)throw a;}this.editor.fire("contentDomUnload"); +delete this.editor.document;delete this.editor.window;delete this.editor},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function a(){var b=c.getDocument().$,d=b.getSelection(),e;a:if(d.anchorNode&&d.anchorNode==c.$)e=!0;else{if(CKEDITOR.env.webkit&&(e=c.getDocument().getActive())&&e.equals(c)&&!d.anchorNode){e=!0;break a}e=void 0}e&&(e=new CKEDITOR.dom.range(c),e.moveToElementEditStart(c),b=b.createRange(),b.setStart(e.startContainer.$,e.startOffset), +b.collapse(!0),d.removeAllRanges(),d.addRange(b))}function b(){var a=c.getDocument().$,d=a.selection,e=c.getDocument().getActive();"None"==d.type&&e.equals(c)&&(d=new CKEDITOR.dom.range(c),a=a.body.createTextRange(),d.moveToElementEditStart(c),d=d.startContainer,d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent()),a.moveToElementText(d.$),a.collapse(!0),a.select())}var c=this;if(CKEDITOR.env.ie&&(9>CKEDITOR.env.version||CKEDITOR.env.quirks))this.hasFocus&&(this.focus(),b());else if(this.hasFocus)this.focus(), +a();else this.once("focus",function(){a()},null,null,-999)},getHtmlFromRange:function(a){if(a.collapsed)return new CKEDITOR.dom.documentFragment(a.document);a={doc:this.getDocument(),range:a.clone()};q.eol.detect(a,this);q.bogus.exclude(a);q.cell.shrink(a);a.fragment=a.range.cloneContents();q.tree.rebuild(a,this);q.eol.fix(a,this);return new CKEDITOR.dom.documentFragment(a.fragment.$)},extractHtmlFromRange:function(a,b){var c=u,d={range:a,doc:a.document},e=this.getHtmlFromRange(a);if(a.collapsed)return a.optimize(), +e;a.enlarge(CKEDITOR.ENLARGE_INLINE,1);c.table.detectPurge(d);d.bookmark=a.createBookmark();delete d.range;var g=this.editor.createRange();g.moveToPosition(d.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START);d.targetBookmark=g.createBookmark();c.list.detectMerge(d,this);c.table.detectRanges(d,this);c.block.detectMerge(d,this);d.tableContentsRanges?(c.table.deleteRanges(d),a.moveToBookmark(d.bookmark),d.range=a):(a.moveToBookmark(d.bookmark),d.range=a,a.extractContents(c.detectExtractMerge(d)));a.moveToBookmark(d.targetBookmark); +a.optimize();c.fixUneditableRangePosition(a);c.list.merge(d,this);c.table.purge(d,this);c.block.merge(d,this);if(b){c=a.startPath();if(d=a.checkStartOfBlock()&&a.checkEndOfBlock()&&c.block&&!a.root.equals(c.block)){a:{var d=c.block.getElementsByTag("span"),g=0,f;if(d)for(;f=d.getItem(g++);)if(!G(f)){d=!0;break a}d=!1}d=!d}d&&(a.moveToPosition(c.block,CKEDITOR.POSITION_BEFORE_START),c.block.remove())}else c.autoParagraph(this.editor,a),v(a.startContainer)&&a.startContainer.appendBogus();a.startContainer.mergeSiblings(); return e},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=this.getData();this.is("textarea")||!1!==a.config.ignoreEmptyParagraph&&(b=b.replace(M,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a, "beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&"Control"==b.type||this.focus()},this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode,a.data.range)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"): a.elementMode!=CKEDITOR.ELEMENT_MODE_REPLACE&&a.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||this.attachClass("cke_editable_themed");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=!1},null,null,-1);this.on("focus",function(){this.hasFocus=!0},null,null,-1);if(CKEDITOR.env.webkit)this.on("scroll",function(){a._.previousScrollTop=a.editable().$.scrollTop},null, null,-1);if(CKEDITOR.env.edge&&14CKEDITOR.env.version?G.$.styleSheet.cssText=B:G.setText(B)):(B=g.appendStyleText(B),B=new CKEDITOR.dom.element(B.ownerNode||B.owningElement),f.setCustomData("stylesheet", -B),B.data("cke-temp",1))}f=g.getCustomData("stylesheet_ref")||0;g.setCustomData("stylesheet_ref",f+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey(),d,g=a.getSelection();if(0!==g.getRanges().length){if(c in -l){var f;b=g.getRanges()[0];var p=b.startPath(),B,D,G,c=8==c,r=!1;if(CKEDITOR.env.ie&&11>CKEDITOR.env.version&&g.getSelectedElement())f=g.getSelectedElement();else if(e(g)){var m=new CKEDITOR.dom.walker(b),w=b.collapsed?b.startContainer:m.next(),r=!1,K;if(b.checkStartOfBlock()){K=b.startPath().block||b.startPath().blockLimit;var t=K.getName();K=-1!==CKEDITOR.tools.array.indexOf(["dd","dt","li"],t)&&null===K.getPrevious()}else K=!1;if(K){for(;w&&!r;)r=w.$.nodeName.toLowerCase(),r=!!H[r],w=m.next(); -m=h(b.startPath());w=h(b.endPath());r=r||m!==w}else r=void 0;r||(f=k(g))}f||r?(a.fire("saveSnapshot"),r?((d=b.startContainer.getAscendant(H,!0))?(b.setStart(d,0),b.enlarge(CKEDITOR.ENLARGE_ELEMENT),f=b):f=null,f.deleteContents()):(b.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START),f.remove()),b.select(),a.fire("saveSnapshot"),d=1):b.collapsed&&((B=p.block)&&(G=B[c?"getPrevious":"getNext"](z))&&G.type==CKEDITOR.NODE_ELEMENT&&G.is("table")&&b[c?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"), -b[c?"checkEndOfBlock":"checkStartOfBlock"]()&&B.remove(),b["moveToElementEdit"+(c?"End":"Start")](G),b.select(),a.fire("saveSnapshot"),d=1):p.blockLimit&&p.blockLimit.is("td")&&(D=p.blockLimit.getAscendant("table"))&&b.checkBoundaryOfElement(D,c?CKEDITOR.START:CKEDITOR.END)&&(G=D[c?"getPrevious":"getNext"](z))?(a.fire("saveSnapshot"),b["moveToElementEdit"+(c?"End":"Start")](G),b.checkStartOfBlock()&&b.checkEndOfBlock()?G.remove():b.select(),a.fire("saveSnapshot"),d=1):(D=p.contains(["td","th","caption"]))&& -b.checkBoundaryOfElement(D,c?CKEDITOR.START:CKEDITOR.END)&&(d=1))}return!d}});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(b){b.data.getKeystroke()in l&&!this.getFirst(c)&&(this.appendBogus(),b=a.createRange(),b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),b.select())});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return!1;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this, +this.getDocument();a.window=this.getWindow();var g=a.document;this.changeAttr("spellcheck",!a.config.disableNativeSpellChecker);var f=a.config.contentsLangDirection;this.getDirection(1)!=f&&this.changeAttr("dir",f);var A=CKEDITOR.getCss();if(A){var f=g.getHead(),I=f.getCustomData("stylesheet");I?A!=I.getText()&&(CKEDITOR.env.ie&&9>CKEDITOR.env.version?I.$.styleSheet.cssText=A:I.setText(A)):(A=g.appendStyleText(A),A=new CKEDITOR.dom.element(A.ownerNode||A.owningElement),f.setCustomData("stylesheet", +A),A.data("cke-temp",1))}f=g.getCustomData("stylesheet_ref")||0;g.setCustomData("stylesheet_ref",f+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){a=a.data;var b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&2!=a.$.button&&b.isReadOnly()&&a.preventDefault()});var N={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c=b.data.domEvent.getKey(),d,g=a.getSelection();if(0!==g.getRanges().length){if(c in +N){var f;b=g.getRanges()[0];var t=b.startPath(),A,H,I,c=8==c,l=!1;if(CKEDITOR.env.ie&&11>CKEDITOR.env.version&&g.getSelectedElement())f=g.getSelectedElement();else if(e(g)){var n=new CKEDITOR.dom.walker(b),m=b.collapsed?b.startContainer:n.next(),l=!1,B;if(b.checkStartOfBlock()){B=b.startPath().block||b.startPath().blockLimit;var q=B.getName();B=-1!==CKEDITOR.tools.array.indexOf(["dd","dt","li"],q)&&null===B.getPrevious()}else B=!1;if(B){for(;m&&!l;)l=m.$.nodeName.toLowerCase(),l=!!K[l],m=n.next(); +n=h(b.startPath());m=h(b.endPath());l=l||n!==m}else l=void 0;l||(f=k(g))}f||l?(a.fire("saveSnapshot"),l?((d=b.startContainer.getAscendant(K,!0))?(b.setStart(d,0),b.enlarge(CKEDITOR.ENLARGE_ELEMENT),f=b):f=null,f.deleteContents()):(b.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START),f.remove()),b.select(),a.fire("saveSnapshot"),d=1):b.collapsed&&((A=t.block)&&(I=A[c?"getPrevious":"getNext"](z))&&I.type==CKEDITOR.NODE_ELEMENT&&I.is("table")&&b[c?"checkStartOfBlock":"checkEndOfBlock"]()?(a.fire("saveSnapshot"), +b[c?"checkEndOfBlock":"checkStartOfBlock"]()&&A.remove(),b["moveToElementEdit"+(c?"End":"Start")](I),b.select(),a.fire("saveSnapshot"),d=1):t.blockLimit&&t.blockLimit.is("td")&&(H=t.blockLimit.getAscendant("table"))&&b.checkBoundaryOfElement(H,c?CKEDITOR.START:CKEDITOR.END)&&(I=H[c?"getPrevious":"getNext"](z))?(a.fire("saveSnapshot"),b["moveToElementEdit"+(c?"End":"Start")](I),b.checkStartOfBlock()&&b.checkEndOfBlock()?I.remove():b.select(),a.fire("saveSnapshot"),d=1):(H=t.contains(["td","th","caption"]))&& +b.checkBoundaryOfElement(H,c?CKEDITOR.START:CKEDITOR.END)&&(d=1))}return!d}});a.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(b){b.data.getKeystroke()in N&&!this.getFirst(c)&&(this.appendBogus(),b=a.createRange(),b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START),b.select())});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return!1;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this, "click",b);CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();c.is("img","hr","input","textarea","select")&&!c.isReadOnly()&&(a.getSelection().selectElement(c),c.is("input","textarea","select")&&b.data.preventDefault())});CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(b){(b=b.data.getTarget())&&b.is("img")&&!b.isReadOnly()&&a.getSelection().selectElement(b)});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(2== b.data.$.button&&(b=b.data.getTarget(),!b.getAscendant("table")&&!b.getOuterHtml().replace(M,""))){var c=a.createRange();c.moveToElementEditStart(b);c.select(!0)}});CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()}),this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()}));CKEDITOR.env.webkit&&this.attachListener(a,"key",function(b){if(a.readOnly)return!0;var c= -b.data.domEvent.getKey();if(c in l&&(b=a.getSelection(),0!==b.getRanges().length)){var c=8==c,d=b.getRanges()[0];b=d.startPath();if(d.collapsed)a:{var e=b.block;if(e&&d[c?"checkStartOfBlock":"checkEndOfBlock"](!0)&&d.moveToClosestEditablePosition(e,!c)&&d.collapsed){if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var g=d.startContainer.getChild(d.startOffset-(c?1:0));if(g&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("hr")){a.fire("saveSnapshot");g.remove();b=!0;break a}}d=d.startPath().block;if(!d||d&&d.contains(e))b= +b.data.domEvent.getKey();if(c in N&&(b=a.getSelection(),0!==b.getRanges().length)){var c=8==c,d=b.getRanges()[0];b=d.startPath();if(d.collapsed)a:{var e=b.block;if(e&&d[c?"checkStartOfBlock":"checkEndOfBlock"](!0)&&d.moveToClosestEditablePosition(e,!c)&&d.collapsed){if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var g=d.startContainer.getChild(d.startOffset-(c?1:0));if(g&&g.type==CKEDITOR.NODE_ELEMENT&&g.is("hr")){a.fire("saveSnapshot");g.remove();b=!0;break a}}d=d.startPath().block;if(!d||d&&d.contains(e))b= void 0;else{a.fire("saveSnapshot");var f;(f=(c?d:e).getBogus())&&f.remove();f=a.getSelection();g=f.createBookmarks();(c?e:d).moveChildren(c?d:e,!1);b.lastElement.mergeSiblings();y(e,d,!c);f.selectBookmarks(g);b=!0}}else b=!1}else c=d,f=b.block,d=c.endPath().block,f&&d&&!f.equals(d)?(a.fire("saveSnapshot"),(e=f.getBogus())&&e.remove(),c.enlarge(CKEDITOR.ENLARGE_INLINE),c.deleteContents(),d.getParent()&&(d.moveChildren(f,!1),b.lastElement.mergeSiblings(),y(f,d,!0)),c=a.getSelection().getRanges()[0], c.collapse(1),c.optimize(),""===c.startContainer.getHtml()&&c.startContainer.appendBogus(),c.select(),b=!0):b=!1;if(!b)return;a.getSelection().scrollIntoView();a.fire("saveSnapshot");return!1}},this,null,100)}},getUniqueId:function(){var a;try{this._.expandoNumber=a=CKEDITOR.dom.domObject.prototype.getUniqueId.call(this)}catch(b){a=this._&&this._.expandoNumber}return a}},_:{cleanCustomData:function(){this.removeClass("cke_editable");this.restoreAttrs();for(var a=this.removeCustomData("classes");a&& a.length;)this.removeClass(a.pop());if(!this.is("textarea")){var a=this.getDocument(),b=a.getHead();if(b.getCustomData("stylesheet")){var c=a.getCustomData("stylesheet_ref");--c?a.setCustomData("stylesheet_ref",c):(a.removeCustomData("stylesheet_ref"),b.removeCustomData("stylesheet").remove())}}}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;if(!arguments.length)return b;a?b=a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),b= null);return this._.editable=b};CKEDITOR.on("instanceLoaded",function(b){var c=b.editor;c.on("insertElement",function(a){a=a.data;a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))&&("false"!=a.getAttribute("contentEditable")&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1"),a.setAttribute("contentEditable",!1))});c.on("selectionChange",function(b){if(!c.readOnly){var d=c.getSelection();d&&!d.isLocked&&(d=c.checkDirty(),c.fire("lockSnapshot"),a(b),c.fire("unlockSnapshot"), -!d&&c.resetDirty())}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var c=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-multiline","true");a.changeAttr("aria-label",c);c&&a.changeAttr("title",c);var d=b.fire("ariaEditorHelpLabel",{}).label;if(d&&(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"'+ -e+'" class\x3d"cke_voice_label"\x3e'+d+"\x3c/span\x3e");c.append(d);a.changeAttr("aria-describedby",e)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");z=CKEDITOR.dom.walker.whitespaces(!0);A=CKEDITOR.dom.walker.bookmark(!1,!0);t=CKEDITOR.dom.walker.empty();m=CKEDITOR.dom.walker.bogus();M=/(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;v= -function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,g,f,q,h=[],p=d.range.startContainer;e=d.range.startPath();for(var p=m[p.getName()],k=0,B=c.getChildren(),D=B.count(),G=-1,l=-1,I=0,N=e.contains(m.$list);k]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;w= +function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,g,f,r,h=[],t=d.range.startContainer;e=d.range.startPath();for(var t=L[t.getName()],k=0,A=c.getChildren(),H=A.count(),I=-1,E=-1,S=0,N=e.contains(L.$list);kCKEDITOR.env.version&&d.getChildCount()&&d.getFirst().remove())}return function(d){var e=d.startContainer,g=e.getAscendant("table",1),f=!1;c(g.getElementsByTag("td"));c(g.getElementsByTag("th"));g=d.clone();g.setStart(e,0);g=a(g).lastBackward();g||(g=d.clone(),g.setEndAt(e, -CKEDITOR.POSITION_BEFORE_END),g=a(g).lastForward(),f=!0);g||(g=e);g.is("table")?(d.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),d.collapse(!0),g.remove()):(g.is({tbody:1,thead:1,tfoot:1})&&(g=b(g,"tr",f)),g.is("tr")&&(g=b(g,g.getParent().is("thead")?"th":"td",f)),(e=g.getBogus())&&e.remove(),d.moveToPosition(g,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}();E=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)|| +CKEDITOR.POSITION_BEFORE_END),g=a(g).lastForward(),f=!0);g||(g=e);g.is("table")?(d.setStartAt(g,CKEDITOR.POSITION_BEFORE_START),d.collapse(!0),g.remove()):(g.is({tbody:1,thead:1,tfoot:1})&&(g=b(g,"tr",f)),g.is("tr")&&(g=b(g,g.getParent().is("thead")?"th":"td",f)),(e=g.getBogus())&&e.remove(),d.moveToPosition(g,f?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}();F=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return!1;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$list)|| a.is(CKEDITOR.dtd.$listItem)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$listItem)};return b}return function(b){var c=b.startContainer,d=!1,e;e=b.clone();e.setStart(c,0);e=a(e).lastBackward();e||(e=b.clone(),e.setEndAt(c,CKEDITOR.POSITION_BEFORE_END),e=a(e).lastForward(),d=!0);e||(e=c);e.is(CKEDITOR.dtd.$list)?(b.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),b.collapse(!0),e.remove()):((c=e.getBogus())&&c.remove(),b.moveToPosition(e,d?CKEDITOR.POSITION_AFTER_START: -CKEDITOR.POSITION_BEFORE_END),b.select())}}();u={eol:{detect:function(a,b){var c=a.range,d=c.clone(),e=c.clone(),g=new CKEDITOR.dom.elementPath(c.startContainer,b),f=new CKEDITOR.dom.elementPath(c.endContainer,b);d.collapse(1);e.collapse();g.block&&d.checkBoundaryOfElement(g.block,CKEDITOR.END)&&(c.setStartAfter(g.block),a.prependEolBr=1);f.block&&e.checkBoundaryOfElement(f.block,CKEDITOR.START)&&(c.setEndBefore(f.block),a.appendEolBr=1)},fix:function(a,b){var c=b.getDocument(),d;a.appendEolBr&&(d= +CKEDITOR.POSITION_BEFORE_END),b.select())}}();q={eol:{detect:function(a,b){var c=a.range,d=c.clone(),e=c.clone(),g=new CKEDITOR.dom.elementPath(c.startContainer,b),f=new CKEDITOR.dom.elementPath(c.endContainer,b);d.collapse(1);e.collapse();g.block&&d.checkBoundaryOfElement(g.block,CKEDITOR.END)&&(c.setStartAfter(g.block),a.prependEolBr=1);f.block&&e.checkBoundaryOfElement(f.block,CKEDITOR.START)&&(c.setEndBefore(f.block),a.appendEolBr=1)},fix:function(a,b){var c=b.getDocument(),d;a.appendEolBr&&(d= this.createEolBr(c),a.fragment.append(d));!a.prependEolBr||d&&!d.getPrevious()||a.fragment.append(this.createEolBr(c),1)},createEolBr:function(a){return a.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(a){var b=a.range.getBoundaryNodes(),c=b.startNode,b=b.endNode;!b||!m(b)||c&&c.equals(b)||a.range.setEndBefore(b)}},tree:{rebuild:function(a,b){var c=a.range,d=c.getCommonAncestor(),e=new CKEDITOR.dom.elementPath(d,b),g=new CKEDITOR.dom.elementPath(c.startContainer,b), -c=new CKEDITOR.dom.elementPath(c.endContainer,b),f;d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());if(e.blockLimit.is({tr:1,table:1})){var h=e.contains("table").getParent();f=function(a){return!a.equals(h)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)&&(g=g.contains(CKEDITOR.dtd.$list),c=c.contains(CKEDITOR.dtd.$list),!g.equals(c))){var q=e.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(q)}}f||(f=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a, -b,d,f)},rebuildFragment:function(a,b,c,d){for(var e;c&&!c.equals(b)&&d(c);)e=c.clone(0,1),a.fragment.appendTo(e),a.fragment=e,c=c.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,c=a.endContainer,d=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(c)&&b.is("tr")&&++d==e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};F=function(){function a(b,c){var d=b.getParent();if(d.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](d)}function b(c,d,e){a(d);a(e,1);for(var g;g= -e.getNext();)g.insertAfter(d),d=g;t(c)&&c.remove()}function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,a.bookmark),e=d.startPath(),g=d.endPath(),f=e.contains(CKEDITOR.dtd.$list),h=g.contains(CKEDITOR.dtd.$list);a.mergeList=f&&h&&f.getParent().equals(h.getParent())&&!f.equals(h);a.mergeListItems=e.block&&g.block&&e.block.is(CKEDITOR.dtd.$listItem)&&g.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList|| +c=new CKEDITOR.dom.elementPath(c.endContainer,b),f;d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());if(e.blockLimit.is({tr:1,table:1})){var h=e.contains("table").getParent();f=function(a){return!a.equals(h)}}else if(e.block&&e.block.is(CKEDITOR.dtd.$listItem)&&(g=g.contains(CKEDITOR.dtd.$list),c=c.contains(CKEDITOR.dtd.$list),!g.equals(c))){var r=e.contains(CKEDITOR.dtd.$list).getParent();f=function(a){return!a.equals(r)}}f||(f=function(a){return!a.equals(e.block)&&!a.equals(e.blockLimit)});this.rebuildFragment(a, +b,d,f)},rebuildFragment:function(a,b,c,d){for(var e;c&&!c.equals(b)&&d(c);)e=c.clone(0,1),a.fragment.appendTo(e),a.fragment=e,c=c.getParent()}},cell:{shrink:function(a){a=a.range;var b=a.startContainer,c=a.endContainer,d=a.startOffset,e=a.endOffset;b.type==CKEDITOR.NODE_ELEMENT&&b.equals(c)&&b.is("tr")&&++d==e&&a.shrink(CKEDITOR.SHRINK_TEXT)}}};u=function(){function a(b,c){var d=b.getParent();if(d.is(CKEDITOR.dtd.$inline))b[c?"insertBefore":"insertAfter"](d)}function b(c,d,e){a(d);a(e,1);for(var g;g= +e.getNext();)g.insertAfter(d),d=g;v(c)&&c.remove()}function c(a,b){var d=new CKEDITOR.dom.range(a);d.setStartAfter(b.startNode);d.setEndBefore(b.endNode);return d}return{list:{detectMerge:function(a,b){var d=c(b,a.bookmark),e=d.startPath(),g=d.endPath(),f=e.contains(CKEDITOR.dtd.$list),h=g.contains(CKEDITOR.dtd.$list);a.mergeList=f&&h&&f.getParent().equals(h.getParent())&&!f.equals(h);a.mergeListItems=e.block&&g.block&&e.block.is(CKEDITOR.dtd.$listItem)&&g.block.is(CKEDITOR.dtd.$listItem);if(a.mergeList|| a.mergeListItems)d=d.clone(),d.setStartBefore(a.bookmark.startNode),d.setEndAfter(a.bookmark.endNode),a.mergeListBookmark=d.createBookmark()},merge:function(a,c){if(a.mergeListBookmark){var d=a.mergeListBookmark.startNode,e=a.mergeListBookmark.endNode,g=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(e,c);if(a.mergeList){var h=g.contains(CKEDITOR.dtd.$list),k=f.contains(CKEDITOR.dtd.$list);h.equals(k)||(k.moveChildren(h),k.remove())}a.mergeListItems&&(g=g.contains(CKEDITOR.dtd.$listItem), f=f.contains(CKEDITOR.dtd.$listItem),g.equals(f)||b(f,d,e));d.remove();e.remove()}}},block:{detectMerge:function(a,b){if(!a.tableContentsRanges&&!a.mergeListBookmark){var c=new CKEDITOR.dom.range(b);c.setStartBefore(a.bookmark.startNode);c.setEndAfter(a.bookmark.endNode);a.mergeBlockBookmark=c.createBookmark()}},merge:function(a,c){if(a.mergeBlockBookmark&&!a.purgeTableBookmark){var d=a.mergeBlockBookmark.startNode,e=a.mergeBlockBookmark.endNode,g=new CKEDITOR.dom.elementPath(d,c),f=new CKEDITOR.dom.elementPath(e, -c),g=g.block,f=f.block;g&&f&&!g.equals(f)&&b(f,d,e);d.remove();e.remove()}}},table:function(){function a(c){var e=[],g,f=new CKEDITOR.dom.walker(c),h=c.startPath().contains(d),k=c.endPath().contains(d),p={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var l="visited_"+(f?"out":"in");if(a.getCustomData(l))return;CKEDITOR.dom.element.setMarker(p,a,l,1)}if(f&&h&&a.equals(h))g=c.clone(),g.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),e.push(g);else if(!f&&k&&a.equals(k))g=c.clone(),g.setStartAt(k, -CKEDITOR.POSITION_AFTER_START),e.push(g);else{if(l=!f)l=a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!h||b(a,h))&&(!k||b(a,k));if(!l&&(l=f))if(a.is(d))var l=h&&h.getAscendant("table",!0),D=k&&k.getAscendant("table",!0),I=a.getAscendant("table",!0),l=l&&l.contains(I)||D&&D.contains(I);else l=void 0;l&&(g=c.clone(),g.selectNodeContents(a),e.push(g))}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(p);return e}function b(a,c){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(c); +c),g=g.block,f=f.block;g&&f&&!g.equals(f)&&b(f,d,e);d.remove();e.remove()}}},table:function(){function a(c){var e=[],g,f=new CKEDITOR.dom.walker(c),h=c.startPath().contains(d),k=c.endPath().contains(d),t={};f.guard=function(a,f){if(a.type==CKEDITOR.NODE_ELEMENT){var E="visited_"+(f?"out":"in");if(a.getCustomData(E))return;CKEDITOR.dom.element.setMarker(t,a,E,1)}if(f&&h&&a.equals(h))g=c.clone(),g.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),e.push(g);else if(!f&&k&&a.equals(k))g=c.clone(),g.setStartAt(k, +CKEDITOR.POSITION_AFTER_START),e.push(g);else{if(E=!f)E=a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&(!h||b(a,h))&&(!k||b(a,k));if(!E&&(E=f))if(a.is(d))var E=h&&h.getAscendant("table",!0),H=k&&k.getAscendant("table",!0),l=a.getAscendant("table",!0),E=E&&E.contains(l)||H&&H.contains(l);else E=void 0;E&&(g=c.clone(),g.selectNodeContents(a),e.push(g))}};f.lastForward();CKEDITOR.dom.element.clearAllMarkers(t);return e}function b(a,c){var d=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,e=a.getPosition(c); return e===CKEDITOR.POSITION_IDENTICAL?!1:0===(e&d)}var d={td:1,th:1,caption:1};return{detectPurge:function(a){var b=a.range,c=b.clone();c.enlarge(CKEDITOR.ENLARGE_ELEMENT);var c=new CKEDITOR.dom.walker(c),e=0;c.evaluator=function(a){a.type==CKEDITOR.NODE_ELEMENT&&a.is(d)&&++e};c.checkForward();if(1g&&e&&e.intersectsNode(c.$)){var f=[{node:d.anchorNode,offset:d.anchorOffset}, -{node:d.focusNode,offset:d.focusOffset}];d.anchorNode==c.$&&d.anchorOffset>g&&(f[0].offset-=g);d.focusNode==c.$&&d.focusOffset>g&&(f[1].offset-=g)}}c.setText(y(c.getText(),1));f&&(c=a.getDocument().$,d=c.getSelection(),c=c.createRange(),c.setStart(f[0].node,f[0].offset),c.collapse(!0),d.removeAllRanges(),d.addRange(c),d.extend(f[1].node,f[1].offset))}}function y(a,b){return b?a.replace(J,function(a,b){return b?" ":""}):a.replace(v,"")}function z(a,b){var c=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;", +return c+=d.join("\t")}function f(a){var b=this.root.editor,d=b.getSelection(1);this.reset();F=!0;d.root.once("selectionchange",function(a){a.cancel()},null,null,0);d.selectRanges([a[0]]);d=this._.cache;d.ranges=new CKEDITOR.dom.rangeList(a);d.type=CKEDITOR.SELECTION_TEXT;d.selectedElement=a[0]._getTableElement();d.selectedText=c(a);d.nativeSel=null;this.isFake=1;this.rev=M++;b._.fakeSelection=this;F=!1;this.root.fire("selectionchange")}function e(){var b=this._.fakeSelection,c;if(b){c=this.getSelection(1); +var e;if(!(e=!c)&&(e=!c.isHidden())){e=b;var g=c.getRanges(),f=e.getRanges(),h=g.length&&g[0]._getTableElement()&&g[0]._getTableElement().getAscendant("table",!0),k=f.length&&f[0]._getTableElement()&&f[0]._getTableElement().getAscendant("table",!0),E=1===g.length&&g[0]._getTableElement()&&g[0]._getTableElement().is("table"),l=1===f.length&&f[0]._getTableElement()&&f[0]._getTableElement().is("table");if(a(e.getSelectedElement()))e=!1;else{var p=1===g.length&&g[0].collapsed,f=d(g,!!CKEDITOR.env.webkit)&& +d(f);h=h&&k?h.equals(k)||k.contains(h):!1;h&&(p||f)?(E&&!l&&e.selectRanges(g),e=!0):e=!1}e=!e}e&&(b.reset(),b=0)}if(!b&&(b=c||this.getSelection(1),!b||b.getType()==CKEDITOR.SELECTION_NONE))return;this.fire("selectionCheck",b);c=this.elementPath();c.compare(this._.selectionPreviousPath)||(e=this._.selectionPreviousPath&&this._.selectionPreviousPath.blockLimit.equals(c.blockLimit),!CKEDITOR.env.webkit&&!CKEDITOR.env.gecko||e||(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath= +c,this.fire("selectionChange",{selection:b,path:c}))}function k(){u=!0;q||(h.call(this),q=CKEDITOR.tools.setTimeout(h,200,this))}function h(){q=null;u&&(CKEDITOR.tools.setTimeout(e,0,this),u=!1)}function n(a){return K(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?!0:!1}function l(a){function b(c,d){return c&&c.type!=CKEDITOR.NODE_TEXT?a.clone()["moveToElementEdit"+(d?"End":"Start")](c):!1}if(!(a.root instanceof CKEDITOR.editable))return!1;var c=a.startContainer,d=a.getPreviousNode(n, +null,c),e=a.getNextNode(n,null,c);return b(d)||b(e,1)||!(d||e||c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()&&c.getBogus())?!0:!1}function g(a){x(a,!1);var b=a.getDocument().createText(w);a.setCustomData("cke-fillingChar",b);return b}function x(a,b){var c=a&&a.removeCustomData("cke-fillingChar");if(c){if(!1!==b){var d=a.getDocument().getSelection().getNative(),e=d&&"None"!=d.type&&d.getRangeAt(0),g=w.length;if(c.getLength()>g&&e&&e.intersectsNode(c.$)){var f=[{node:d.anchorNode,offset:d.anchorOffset}, +{node:d.focusNode,offset:d.focusOffset}];d.anchorNode==c.$&&d.anchorOffset>g&&(f[0].offset-=g);d.focusNode==c.$&&d.focusOffset>g&&(f[1].offset-=g)}}c.setText(y(c.getText(),1));f&&(c=a.getDocument().$,d=c.getSelection(),c=c.createRange(),c.setStart(f[0].node,f[0].offset),c.collapse(!0),d.removeAllRanges(),d.addRange(c),d.extend(f[1].node,f[1].offset))}}function y(a,b){return b?a.replace(J,function(a,b){return b?" ":""}):a.replace(w,"")}function z(a,b){var c=b&&CKEDITOR.tools.htmlEncode(b)||"\x26nbsp;", c=CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"'+(CKEDITOR.env.ie&&14>CKEDITOR.env.version?"display:none":"position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;")+'"\x3e'+c+"\x3c/div\x3e",a.document);a.fire("lockSnapshot");a.editable().append(c);var d=a.getSelection(1),e=a.createRange(),g=d.root.on("selectionchange",function(a){a.cancel()},null,null,0);e.setStartAt(c,CKEDITOR.POSITION_AFTER_START);e.setEndAt(c,CKEDITOR.POSITION_BEFORE_END); -d.selectRanges([e]);g.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=c}function A(a){var b={37:1,39:1,8:1,46:1};return function(c){var d=c.data.getKeystroke();if(b[d]){var e=a.getSelection(),g=e.getRanges()[0];e.isCollapsed()&&(g=g[38>d?"getPreviousEditableNode":"getNextEditableNode"]())&&g.type==CKEDITOR.NODE_ELEMENT&&"false"==g.getAttribute("contenteditable")&&(e=e.getStartElement(),!e.isBlockBoundary()||""!==(void 0===e.$.textContent?e.$.innerText:e.$.textContent)||8!== -d&&46!==d||(e.remove(),a.fire("saveSnapshot")),a.getSelection().fake(g),c.data.preventDefault(),c.cancel())}}}function t(a){for(var b=0;be?"getPreviousEditableNode":"getNextEditableNode"]())&&f.type==CKEDITOR.NODE_ELEMENT&&"false"==f.getAttribute("contenteditable")&&(g=g.getStartElement(),!g.isBlockBoundary()||""!==(void 0===g.$.textContent?g.$.innerText:g.$.textContent)||a(g.getFirst())|| +8!==e&&46!==e||(g.remove(),b.fire("saveSnapshot")),b.getSelection().fake(f),d.data.preventDefault(),d.cancel())}}}function v(a){for(var b=0;b=d.getLength()?h.setStartAfter(d):h.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(f?h.setEndAfter(e):h.setEndBefore(e));d=new CKEDITOR.dom.walker(h);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&d.isReadOnly()){var e=c.clone();c.setEndBefore(d);c.collapsed&&a.splice(b--,1);d.getPosition(h.endContainer)&CKEDITOR.POSITION_CONTAINS||(e.setStartAfter(d),e.collapsed||a.splice(b+1,0,e));return!0}return!1};d.next()}}return a}var m= -"function"!=typeof window.getSelection,M=1,v=CKEDITOR.tools.repeat("​",7),J=new RegExp(v+"( )?","g"),E,u,F,H=CKEDITOR.dom.walker.invisible(1),x=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return!1}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;if(!c.readOnly)return(e=d.moveToClosestEditablePosition(b.selected,a))||(e=d.moveToClosestEditablePosition(b.selected, -!a)),e&&c.getSelection().selectRanges([d]),c.fire("saveSnapshot"),b.selected.remove(),e||(d.moveToElementEditablePosition(c.editable()),c.getSelection().selectRanges([d])),c.fire("saveSnapshot"),!1}}var c=a(),d=a(1);return{37:c,38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(a){function b(){var a=c.getSelection();a&&a.removeAllRanges()}var c=a.editor;c.on("contentDom",function(){function a(){u=new CKEDITOR.dom.selection(c.getSelection());u.lock()}function b(){h.removeListener("mouseup", -b);p.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,c=a.createRange();"None"!=a.type&&c.parentElement()&&c.parentElement().ownerDocument==f.$&&c.select()}function d(a){var b,c;b=(b=this.document.getActive())?"input"===b.getName()||"textarea"===b.getName():!1;b||(b=this.getSelection(1),(c=g(b))&&!c.equals(n)&&(b.selectElement(c),a.data.preventDefault()))}function g(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")}, -!0))&&"false"===a.getAttribute("contenteditable")?a:null:null}var f=c.document,h=CKEDITOR.document,n=c.editable(),l=f.getBody(),p=f.getDocumentElement(),r=n.isInline(),D,u;CKEDITOR.env.gecko&&n.attachListener(n,"focus",function(a){a.removeListener();0!==D&&(a=c.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==n.$&&(a=c.createRange(),a.moveToElementEditStart(n),a.select())},null,null,-2);n.attachListener(n,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(D&&(CKEDITOR.env.webkit|| -CKEDITOR.env.gecko)){D=c._.previousActive&&c._.previousActive.equals(f.getActive());var a=null!=c._.previousScrollTop&&c._.previousScrollTop!=n.$.scrollTop;CKEDITOR.env.webkit&&D&&a&&(n.$.scrollTop=c._.previousScrollTop)}c.unlockSelection(D);D=0},null,null,-1);n.attachListener(n,"mousedown",function(){D=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||r)m?n.attachListener(n,"beforedeactivate",a,null,null,-1):n.attachListener(c,"selectionCheck",a,null,null,-1),n.attachListener(n,CKEDITOR.env.webkit||CKEDITOR.env.gecko? -"focusout":"blur",function(){var a=u&&(u.isFake||2>u.getRanges().length);CKEDITOR.env.gecko&&!r&&a||(c.lockSelection(u),D=1)},null,null,-1),n.attachListener(n,"mousedown",function(){D=0});if(CKEDITOR.env.ie&&!r){var t;n.attachListener(n,"mousedown",function(a){2==a.data.$.button&&((a=c.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(t=c.window.getScrollPosition()))});n.attachListener(n,"mouseup",function(a){2==a.data.$.button&&t&&(c.document.$.documentElement.scrollLeft=t.x,c.document.$.documentElement.scrollTop= -t.y);t=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var y,v;p.on("mousedown",function(a){function b(a){a=a.data.$;if(y){var c=l.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(d){}y.setEndPoint(0>v.compareEndPoints("StartToStart",c)?"EndToEnd":"StartToStart",c);y.select()}}function c(){p.removeListener("mousemove",b);h.removeListener("mouseup",c);p.removeListener("mouseup",c);y.select()}a=a.data;if(a.getTarget().is("html")&&a.$.yCKEDITOR.env.version)p.on("mousedown",function(a){a.data.getTarget().is("html")&&(h.on("mouseup",b),p.on("mouseup",b))})}}n.attachListener(n,"selectionchange",e,c);n.attachListener(n,"keyup",k,c);n.attachListener(n,"touchstart",k,c);n.attachListener(n,"touchend",k,c);CKEDITOR.env.ie&&n.attachListener(n, -"keydown",d,c);n.attachListener(n,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){c.forceNextSelectionCheck();c.selectionChange(1)});if(r&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var z;n.attachListener(n,"mousedown",function(){z=1});n.attachListener(f.getDocumentElement(),"mouseup",function(){z&&k.call(c);z=0})}else n.attachListener(CKEDITOR.env.ie?n:f.getDocumentElement(),"mouseup",k,c);CKEDITOR.env.webkit&&n.attachListener(f,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:n.hasFocus&& -w(n)}},null,null,-1);n.attachListener(n,"keydown",A(c),null,null,-1)});c.on("setData",function(){c.unlockSelection();CKEDITOR.env.webkit&&b()});c.on("contentDomUnload",function(){c.unlockSelection()});if(CKEDITOR.env.ie9Compat)c.on("beforeDestroy",b,null,null,9);c.on("dataReady",function(){delete c._.fakeSelection;delete c._.hiddenSelectionContainer;c.selectionChange(1)});c.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=c.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&& -(b.remove(),CKEDITOR.env.gecko&&(a=c.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);c.on("key",function(a){if("wysiwyg"==c.mode){var b=c.getSelection();if(b.isFake){var d=x[a.data.keyCode];if(d)return d({editor:c,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),c=a.getCustomData("cke-fillingChar"); -c&&(c.getCustomData("ready")?(w(a),a.editor.fire("selectionCheck")):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){w(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=y(a.data))},b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=y(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?e:k).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection|| +"function"!=typeof window.getSelection,M=1,w=CKEDITOR.tools.repeat("​",7),J=new RegExp(w+"( )?","g"),F,q,u,K=CKEDITOR.dom.walker.invisible(1),D=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return!1}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;if(!c.readOnly)return(e=d.moveToClosestEditablePosition(b.selected,a))||(e=d.moveToClosestEditablePosition(b.selected, +!a)),e&&c.getSelection().selectRanges([d]),c.fire("saveSnapshot"),b.selected.remove(),e||(d.moveToElementEditablePosition(c.editable()),c.getSelection().selectRanges([d])),c.fire("saveSnapshot"),!1}}var c=a(),d=a(1);return{37:c,38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(a){function b(){var a=c.getSelection();a&&a.removeAllRanges()}var c=a.editor;c.on("contentDom",function(){function a(){q=new CKEDITOR.dom.selection(c.getSelection());q.lock()}function b(){h.removeListener("mouseup", +b);l.removeListener("mouseup",b);var a=CKEDITOR.document.$.selection,c=a.createRange();"None"!=a.type&&c.parentElement()&&c.parentElement().ownerDocument==f.$&&c.select()}function d(a){var b,c;b=(b=this.document.getActive())?"input"===b.getName()||"textarea"===b.getName():!1;b||(b=this.getSelection(1),(c=g(b))&&!c.equals(p)&&(b.selectElement(c),a.data.preventDefault()))}function g(a){a=a.getRanges()[0];return a?(a=a.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")}, +!0))&&"false"===a.getAttribute("contenteditable")?a:null:null}var f=c.document,h=CKEDITOR.document,p=c.editable(),t=f.getBody(),l=f.getDocumentElement(),H=p.isInline(),n,q;CKEDITOR.env.gecko&&p.attachListener(p,"focus",function(a){a.removeListener();0!==n&&(a=c.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==p.$&&(a=c.createRange(),a.moveToElementEditStart(p),a.select())},null,null,-2);p.attachListener(p,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){if(n&&(CKEDITOR.env.webkit|| +CKEDITOR.env.gecko)){n=c._.previousActive&&c._.previousActive.equals(f.getActive());var a=null!=c._.previousScrollTop&&c._.previousScrollTop!=p.$.scrollTop;CKEDITOR.env.webkit&&n&&a&&(p.$.scrollTop=c._.previousScrollTop)}c.unlockSelection(n);n=0},null,null,-1);p.attachListener(p,"mousedown",function(){n=0});if(CKEDITOR.env.ie||CKEDITOR.env.gecko||H)m?p.attachListener(p,"beforedeactivate",a,null,null,-1):p.attachListener(c,"selectionCheck",a,null,null,-1),p.attachListener(p,CKEDITOR.env.webkit||CKEDITOR.env.gecko? +"focusout":"blur",function(){var a=q&&(q.isFake||2>q.getRanges().length);CKEDITOR.env.gecko&&!H&&a||(c.lockSelection(q),n=1)},null,null,-1),p.attachListener(p,"mousedown",function(){n=0});if(CKEDITOR.env.ie&&!H){var v;p.attachListener(p,"mousedown",function(a){2==a.data.$.button&&((a=c.document.getSelection())&&a.getType()!=CKEDITOR.SELECTION_NONE||(v=c.window.getScrollPosition()))});p.attachListener(p,"mouseup",function(a){2==a.data.$.button&&v&&(c.document.$.documentElement.scrollLeft=v.x,c.document.$.documentElement.scrollTop= +v.y);v=null});if("BackCompat"!=f.$.compatMode){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat){var u,y;l.on("mousedown",function(a){function b(a){a=a.data.$;if(u){var c=t.$.createTextRange();try{c.moveToPoint(a.clientX,a.clientY)}catch(d){}u.setEndPoint(0>y.compareEndPoints("StartToStart",c)?"EndToEnd":"StartToStart",c);u.select()}}function c(){l.removeListener("mousemove",b);h.removeListener("mouseup",c);l.removeListener("mouseup",c);u.select()}a=a.data;if(a.getTarget().is("html")&&a.$.yCKEDITOR.env.version)l.on("mousedown",function(a){a.data.getTarget().is("html")&&(h.on("mouseup",b),l.on("mouseup",b))})}}p.attachListener(p,"selectionchange",e,c);p.attachListener(p,"keyup",k,c);p.attachListener(p,"touchstart",k,c);p.attachListener(p,"touchend",k,c);CKEDITOR.env.ie&&p.attachListener(p, +"keydown",d,c);p.attachListener(p,CKEDITOR.env.webkit||CKEDITOR.env.gecko?"focusin":"focus",function(){c.forceNextSelectionCheck();c.selectionChange(1)});if(H&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var w;p.attachListener(p,"mousedown",function(){w=1});p.attachListener(f.getDocumentElement(),"mouseup",function(){w&&k.call(c);w=0})}else p.attachListener(CKEDITOR.env.ie?p:f.getDocumentElement(),"mouseup",k,c);CKEDITOR.env.webkit&&p.attachListener(f,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:p.hasFocus&& +x(p)}},null,null,-1);p.attachListener(p,"keydown",G(c),null,null,-1)});c.on("setData",function(){c.unlockSelection();CKEDITOR.env.webkit&&b()});c.on("contentDomUnload",function(){c.unlockSelection()});if(CKEDITOR.env.ie9Compat)c.on("beforeDestroy",b,null,null,9);c.on("dataReady",function(){delete c._.fakeSelection;delete c._.hiddenSelectionContainer;c.selectionChange(1)});c.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=c.editable().getLast(a);b&&b.hasAttribute("data-cke-hidden-sel")&& +(b.remove(),CKEDITOR.env.gecko&&(a=c.editable().getFirst(a))&&a.is("br")&&a.getAttribute("_moz_editor_bogus_node")&&a.remove())},null,null,100);c.on("key",function(a){if("wysiwyg"==c.mode){var b=c.getSelection();if(b.isFake){var d=D[a.data.keyCode];if(d)return d({editor:c,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});if(CKEDITOR.env.webkit)CKEDITOR.on("instanceReady",function(a){var b=a.editor;b.on("selectionChange",function(){var a=b.editable(),c=a.getCustomData("cke-fillingChar"); +c&&(c.getCustomData("ready")?(x(a),a.editor.fire("selectionCheck")):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){x(b.editable())},null,null,-1);b.on("getSnapshot",function(a){a.data&&(a.data=y(a.data))},b,null,20);b.on("toDataFormat",function(a){a.data.dataValue=y(a.data.dataValue)},null,null,0)});CKEDITOR.editor.prototype.selectionChange=function(a){(a?e:k).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){return!this._.savedSelection&&!this._.fakeSelection|| a?(a=this.editable())&&"wysiwyg"==this.mode&&"recreating"!==this.status?new CKEDITOR.dom.selection(a):null:this._.savedSelection||this._.fakeSelection};CKEDITOR.editor.prototype.getSelectedRanges=function(a){var b=this.getSelection();return b&&b.getRanges(a)||[]};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);return a.getType()!=CKEDITOR.SELECTION_NONE?(!a.isLocked&&a.lock(),this._.savedSelection=a,!0):!1};CKEDITOR.editor.prototype.unlockSelection=function(a){var b= this._.savedSelection;return b?(b.unlock(a),delete this._.savedSelection,!0):!1};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT= 2;CKEDITOR.SELECTION_ELEMENT=3;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection){var b=a;a=a.root}var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:M++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b)return CKEDITOR.tools.extend(this._.cache,b._.cache),this.isFake=b.isFake,this.isLocked=b.isLocked,this;a=this.getNative();var d,e;if(a)if(a.getRangeAt)d=(e=a.rangeCount&&a.getRangeAt(0))&& -new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(g){}d=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!d||d.type!=CKEDITOR.NODE_ELEMENT&&d.type!=CKEDITOR.NODE_TEXT||!this.root.equals(d)&&!this.root.contains(d))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var K={img:1,hr:1,li:1,table:1,tr:1,td:1, -th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:y,_createFillingCharSequenceNode:g,FILLING_CHAR_SEQUENCE:v});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=m?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:m?function(){var a=this._.cache;if(a.type)return a.type; +new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(g){}d=e&&CKEDITOR.dom.element.get(e.item&&e.item(0)||e.parentElement())}if(!d||d.type!=CKEDITOR.NODE_ELEMENT&&d.type!=CKEDITOR.NODE_TEXT||!this.root.equals(d)&&!this.root.contains(d))this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList;return this};var B={img:1,hr:1,li:1,table:1,tr:1,td:1, +th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:y,_createFillingCharSequenceNode:g,FILLING_CHAR_SEQUENCE:w});CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=m?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:m?function(){var a=this._.cache;if(a.type)return a.type; var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;"Text"==d&&(b=CKEDITOR.SELECTION_TEXT);"Control"==d&&(b=CKEDITOR.SELECTION_ELEMENT);c.createRange().parentElement()&&(b=CKEDITOR.SELECTION_TEXT)}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(1==c.rangeCount){var c=c.getRangeAt(0),d=c.startContainer;d==c.endContainer&&1==d.nodeType&&1==c.endOffset- -c.startOffset&&K[d.childNodes[c.startOffset].nodeName.toLowerCase()]&&(b=CKEDITOR.SELECTION_ELEMENT)}return a.type=b},getRanges:function(){var a=m?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var d=b.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var e=d.children,g,f,h=b.duplicate(),k=0,l=e.length-1,p=-1,r,m;k<=l;)if(p=Math.floor((k+l)/2),g=e[p],h.moveToElementText(g),r=h.compareEndPoints("StartToStart", -b),0r)k=p+1;else return{container:d,offset:a(g)};if(-1==p||p==e.length-1&&0>r){h.moveToElementText(d);h.setEndPoint("StartToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h)return g=e[e.length-1],g.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:g,offset:g.nodeValue.length};for(d=e.length;0m)k=t+1;else return{container:d,offset:a(g)};if(-1==t||t==e.length-1&&0>m){h.moveToElementText(d);h.setEndPoint("StartToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h)return g=e[e.length-1],g.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:g,offset:g.nodeValue.length};for(d=e.length;0c.length?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection)if(this.rev== a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var c=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!c&&a.resetDirty()}delete a._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=M++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var b=this.root.editor,c=b&&b._.hiddenSelectionContainer;this.reset(); -if(c)for(var c=this.root,e,h=0;h]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g," ");f=f.replace(/]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="\x3cpre\x3e"+f+"\x3c/pre\x3e";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=y(c?[a.getHtml()]:g(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,k;(k=c.getPrevious(G))&& -k.type==CKEDITOR.NODE_ELEMENT&&k.is("pre")&&(d=w(k.getHtml(),/\n$/,"")+"\n\n"+w(c.getHtml(),/^\n/,""),CKEDITOR.env.ie?c.$.outerHTML="\x3cpre\x3e"+d+"\x3c/pre\x3e":c.setHtml(d),k.remove())}else c&&m(b)}function g(a){var b=[];w(a.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"\x3c/pre\x3e"+c+"\x3cpre\x3e"}).replace(/([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function w(a,b,c){var d="",e="";a=a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi, -function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function y(a,b){var c;1]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g," ");f=f.replace(/]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="\x3cpre\x3e"+f+"\x3c/pre\x3e";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=y(c?[a.getHtml()]:g(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,k;(k=c.getPrevious(I))&& +k.type==CKEDITOR.NODE_ELEMENT&&k.is("pre")&&(d=x(k.getHtml(),/\n$/,"")+"\n\n"+x(c.getHtml(),/^\n/,""),CKEDITOR.env.ie?c.$.outerHTML="\x3cpre\x3e"+d+"\x3c/pre\x3e":c.setHtml(d),k.remove())}else c&&m(b)}function g(a){var b=[];x(a.getOuterHtml(),/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"\x3c/pre\x3e"+c+"\x3cpre\x3e"}).replace(/([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function x(a,b,c){var d="",e="";a=a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi, +function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function y(a,b){var c;1=b&&a<=c}function f(a){a=a.toString(16);return 1==a.length?"0"+a:a}CKEDITOR.tools.color= CKEDITOR.tools.createClass({$:function(a,b){this._.initialColorCode=a;this._.defaultValue=b;this._.parseInput(a)},proto:{getHex:function(){if(!this._.isValidColor)return this._.defaultValue;var a=this._.blendAlphaColor(this._.red,this._.green,this._.blue,this._.alpha);return this._.formatHexString(a[0],a[1],a[2])},getHexWithAlpha:function(){if(!this._.isValidColor)return this._.defaultValue;var a=Math.round(this._.alpha*CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE);return this._.formatHexString(this._.red, this._.green,this._.blue,a)},getRgb:function(){if(!this._.isValidColor)return this._.defaultValue;var a=this._.blendAlphaColor(this._.red,this._.green,this._.blue,this._.alpha);return this._.formatRgbString("rgb",a[0],a[1],a[2])},getRgba:function(){return this._.isValidColor?this._.formatRgbString("rgba",this._.red,this._.green,this._.blue,this._.alpha):this._.defaultValue},getHsl:function(){var a=0===this._.alpha||1===this._.alpha;if(!this._.isValidColor)return this._.defaultValue;this._.type=== @@ -539,11 +544,11 @@ a[0],a[1],a[2],this._.alpha)},getInitialValue:function(){return this._.initialCo b,c,d,f){b=[b,c,d];void 0!==f&&b.push(f);return a+"("+b.join(",")+")"},formatHslString:function(a,b,c,d,f){return a+"("+b+","+c+"%,"+d+"%"+(void 0!==f?","+f:"")+")"},parseInput:function(a){if("string"!==typeof a)this._.isValidColor=!1;else{a=CKEDITOR.tools.trim(a);var b=this._.matchStringToNamedColor(a);b&&(a=b);var b=this._.extractColorChannelsFromHex(a),c=this._.extractColorChannelsFromRgba(a);a=this._.extractColorChannelsFromHsla(a);(a=b||c||a)?(this._.type=a.type,this._.red=a.red,this._.green= a.green,this._.blue=a.blue,this._.alpha=a.alpha,a.type===CKEDITOR.tools.color.TYPE_HSL&&(this._.hue=a.hue,this._.saturation=a.saturation,this._.lightness=a.lightness)):this._.isValidColor=!1}},matchStringToNamedColor:function(a){return CKEDITOR.tools.color.namedColors[a.toLowerCase()]||null},extractColorChannelsFromHex:function(a){-1===a.indexOf("#")&&(a="#"+a);a.match(CKEDITOR.tools.color.hex3CharsRegExp)&&(a=this._.hex3ToHex6(a));a.match(CKEDITOR.tools.color.hex4CharsRegExp)&&(a=this._.hex4ToHex8(a)); if(!a.match(CKEDITOR.tools.color.hex6CharsRegExp)&&!a.match(CKEDITOR.tools.color.hex8CharsRegExp))return null;a=a.split("");var b=1;a[7]&&a[8]&&(b=parseInt(a[7]+a[8],16),b/=CKEDITOR.tools.color.MAX_RGB_CHANNEL_VALUE,b=Number(b.toFixed(1)));return{type:CKEDITOR.tools.color.TYPE_RGB,red:parseInt(a[1]+a[2],16),green:parseInt(a[3]+a[4],16),blue:parseInt(a[5]+a[6],16),alpha:b}},extractColorChannelsFromRgba:function(b){var c=this._.extractColorChannelsByPattern(b,CKEDITOR.tools.color.rgbRegExp);if(!c|| -3>c.length||4c.length||4c.length||4c.length||4=c?(e=f.createText(""),e.insertAfter(this)):(a=f.createText(""),a.insertAfter(e),a.remove()));return e},substring:function(a,d){return"number"!=typeof d?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,d)}}); -(function(){function a(a,c,d){var e=a.serializable,k=c[d?"endContainer":"startContainer"],h=d?"endOffset":"startOffset",l=e?c.document.getById(a.startNode):a.startNode;a=e?c.document.getById(a.endNode):a.endNode;k.equals(l.getPrevious())?(c.startOffset=c.startOffset-k.getLength()-a.getPrevious().getLength(),k=a.getNext()):k.equals(a.getPrevious())&&(c.startOffset-=k.getLength(),k=a.getNext());k.equals(l.getParent())&&c[h]++;k.equals(a.getParent())&&c[h]++;c[d?"endContainer":"startContainer"]=k;return c} -CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,d)};var d={createIterator:function(){var a=this,c=CKEDITOR.dom.walker.bookmark(),d=[],e;return{getNextRange:function(k){e=void 0===e?0:e+1;var h=a[e];if(h&&1b?-1:1}),e=0,f;eCKEDITOR.env.version? a[h].$.styleSheet.cssText+=f:a[h].$.innerHTML+=f}}var e={};CKEDITOR.skin={path:a,loadPart:function(c,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+"skin.js"),function(){b(c,d)}):b(c,d)},getPath:function(a){return CKEDITOR.getUrl(d(a))},icons:{},addIcon:function(a,b,c,d){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:c||0,bgsize:d||"16px"})},getIconStyle:function(a,b,c,d,e){var f;a&&(a=a.toLowerCase(),b&&(f=this.icons[a+"-rtl"]), f||(f=this.icons[a]));a=c||f&&f.path||"";d=d||f&&f.offset;e=e||f&&f.bgsize||"16px";a&&(a=a.replace(/'/g,"\\'"));return a&&"background-image:url('"+CKEDITOR.getUrl(a)+"');background-position:0 "+d+"px;background-size:"+e+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(a){var b=c(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var c=CKEDITOR.skin.chameleon,d="",e="";"function"==typeof c&&(d=c(this,"editor"),e= -c(this,"panel"));a=[[l,a]];f([b],d,a);f(h,e,a)}).call(this,a)}});var k="cke_ui_color",h=[],l=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var b=a.editor;a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){var d=c(a);h.push(d);b.on("destroy",function(){h=CKEDITOR.tools.array.filter(h,function(a){return d!==a})});(a=b.getUiColor())&&f([d],CKEDITOR.skin.chameleon(b,"panel"), -[[l,a]])}};b.on("panelShow",a);b.on("menuShow",a);b.config.uiColor&&b.setUiColor(b.config.uiColor)}})})(); +c(this,"panel"));a=[[n,a]];f([b],d,a);f(h,e,a)}).call(this,a)}});var k="cke_ui_color",h=[],n=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var b=a.editor;a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){var d=c(a);h.push(d);b.on("destroy",function(){h=CKEDITOR.tools.array.filter(h,function(a){return d!==a})});(a=b.getUiColor())&&f([d],CKEDITOR.skin.chameleon(b,"panel"), +[[n,a]])}};b.on("panelShow",a);b.on("menuShow",a);b.config.uiColor&&b.setUiColor(b.config.uiColor)}})})(); (function(){var a=CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e',CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var d=a.getComputedStyle("border-top-color"),b=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!d||d!=b)}catch(c){CKEDITOR.env.hc=!1}a.remove();CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc");CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}"); CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending)for(delete CKEDITOR._.pending,d=0;de;e++){var f=e,c;c=parseInt(a[e],16);c=("0"+(0>d?0|c*(1+d):0|c+(255-c)*d).toString(16)).slice(-2);a[f]=c}return"#"+a.join("")}}(),f={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover,{id} a.cke_path_item:focus,{id} a.cke_path_item:active [background-color:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] "),panel:new CKEDITOR.template(".cke_panel_grouptitle [background-color:{lightBackground};border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active [background-color:{menubuttonHover};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")}; -return function(g,d){var a=b(g.uiColor,.4),a={id:"."+g.id,defaultBorder:b(a,-.2),toolbarElementsBorder:b(a,-.25),defaultBackground:a,lightBackground:b(a,.8),darkBackground:b(a,-.15),ckeButtonOn:b(a,.4),ckeResizer:b(a,-.4),ckeColorauto:b(a,.8),dialogBody:b(a,.7),dialogTab:b(a,.65),dialogTabSelected:"#FFF",dialogTabSelectedBorder:"#FFF",elementsPathColor:b(a,-.6),menubuttonHover:b(a,.1),menubuttonIcon:b(a,.5),menubuttonIconHover:b(a,.3)};return f[d].output(a).replace(/\[/g,"{").replace(/\]/g,"}")}}();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var h=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var a=[this._],d=1;darguments.length)){var c=h.call(this,a);c.labelId=CKEDITOR.tools.getNextId()+ -"_label";this._.children=[];var e={role:a.role||"presentation"};a.includeLabel&&(e["aria-labelledby"]=c.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"div",null,e,function(){var e=[],g=a.required?" cke_required":"";"horizontal"!=a.labelLayout?e.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" ',' id\x3d"'+c.labelId+'"',c.inputId?' for\x3d"'+c.inputId+'"':"",(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",a.required?a.label+'\x3cspan class\x3d"cke_dialog_ui_labeled_required" aria-hidden\x3d"true"\x3e*\x3c/span\x3e': -a.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',a.controlStyle?' style\x3d"'+a.controlStyle+'"':"",' role\x3d"presentation"\x3e',f.call(this,b,a),"\x3c/div\x3e"):(g={type:"hbox",widths:a.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" id\x3d"'+c.labelId+'" for\x3d"'+c.inputId+'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(a.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+ -(a.controlStyle?' style\x3d"'+a.controlStyle+'"':"")+"\x3e"+f.call(this,b,a)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,g,e));return e.join("")})}},textInput:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);var f=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",c={"class":"cke_dialog_ui_input_"+a.type,id:f,type:a.type};a.validate&&(this.validate=a.validate);a.maxLength&&(c.maxlength=a.maxLength);a.size&&(c.size=a.size);a.inputStyle&&(c.style=a.inputStyle);var e= -this,m=!1;b.on("load",function(){e.getInputElement().on("keydown",function(a){13==a.data.getKeystroke()&&(m=!0)});e.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&m&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),m=!1);e.bidi&&w.call(e,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var b=['\x3cdiv class\x3d"cke_dialog_ui_input_',a.type,'" role\x3d"presentation"'];a.width&&b.push('style\x3d"width:'+a.width+'" ');b.push("\x3e\x3cinput "); -c["aria-labelledby"]=this._.labelId;this._.required&&(c["aria-required"]=this._.required);for(var e in c)b.push(e+'\x3d"'+c[e]+'" ');b.push(" /\x3e\x3c/div\x3e");return b.join("")})}},textarea:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);var f=this,c=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",e={};a.validate&&(this.validate=a.validate);e.rows=a.rows||5;e.cols=a.cols||20;e["class"]="cke_dialog_ui_input_textarea "+(a["class"]||"");"undefined"!=typeof a.inputStyle&&(e.style=a.inputStyle); -a.dir&&(e.dir=a.dir);if(f.bidi)b.on("load",function(){f.getInputElement().on("keyup",w)},f);CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){e["aria-labelledby"]=this._.labelId;this._.required&&(e["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',c,'" '],b;for(b in e)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(e[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(f._["default"]),"\x3c/textarea\x3e\x3c/div\x3e"); -return a.join("")})}},checkbox:function(b,a,d){if(!(3>arguments.length)){var f=h.call(this,a,{"default":!!a["default"]});a.validate&&(this.validate=a.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"span",null,null,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),e=[],d=CKEDITOR.tools.getNextId()+"_label",g={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":d};t(c);a["default"]&&(g.checked="checked");"undefined"!= -typeof c.inputStyle&&(c.style=c.inputStyle);f.checkbox=new CKEDITOR.ui.dialog.uiElement(b,c,e,"input",null,g);e.push(' \x3clabel id\x3d"',d,'" for\x3d"',g.id,'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(a.label),"\x3c/label\x3e");return e.join("")})}},radio:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);this._["default"]||(this._["default"]=this._.initValue=a.items[0][1]);a.validate&&(this.validate=a.validate);var f=[],c=this;a.role="radiogroup"; -a.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){for(var e=[],d=[],g=(a.id?a.id:CKEDITOR.tools.getNextId())+"_radio",k=0;karguments.length)){var f=h.call(this,a);a.validate&&(this.validate=a.validate);f.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),e=[],d=[],g={id:f.inputId,"class":"cke_dialog_ui_input_select", -"aria-labelledby":this._.labelId};e.push('\x3cdiv class\x3d"cke_dialog_ui_input_',a.type,'" role\x3d"presentation"');a.width&&e.push('style\x3d"width:'+a.width+'" ');e.push("\x3e");void 0!==a.size&&(g.size=a.size);void 0!==a.multiple&&(g.multiple=a.multiple);t(c);for(var k=0,l;karguments.length)){void 0===a["default"]&&(a["default"]="");var f=CKEDITOR.tools.extend(h.call(this,a),{definition:a,buttons:[]});a.validate&&(this.validate=a.validate);b.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d, -function(){f.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var b=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',f.frameId,'" title\x3d"',a.label,'" src\x3d"javascript:void('];b.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");b.push(')"\x3e\x3c/iframe\x3e');return b.join("")})}},fileButton:function(b,a,d){var f=this;if(!(3>arguments.length)){h.call(this, -a);a.validate&&(this.validate=a.validate);var c=CKEDITOR.tools.extend({},a),e=c.onClick;c.className=(c.className?c.className+" ":"")+"cke_dialog_ui_button";c.onClick=function(c){var d=a["for"];c=e?e.call(this,c):!1;!1!==c&&("xhr"!==c&&b.getContentElement(d[0],d[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(a["for"][0],a["for"][1])._.buttons.push(f)});CKEDITOR.ui.dialog.button.call(this,b,c,d)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,a=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/, -d=/\/$/;return function(f,c,e){if(!(3>arguments.length)){var m=[],g=c.html;"\x3c"!=g.charAt(0)&&(g="\x3cspan\x3e"+g+"\x3c/span\x3e");var k=c.focus;if(k){var l=this.focus;this.focus=function(){("function"==typeof k?k:l).call(this);this.fire("focus")};c.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,f,c,m,"span",null,null,"");m=m.join("").match(b);g=g.match(a)||["","",""];d.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);e.push([g[1], -" ",m[1]||"",g[2]].join(""))}}}(),fieldset:function(b,a,d,f,c){var e=c.label;this._={children:a};CKEDITOR.ui.dialog.uiElement.call(this,b,c,f,"fieldset",null,null,function(){var a=[];e&&a.push("\x3clegend"+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+e+"\x3c/legend\x3e");for(var b=0;barguments.length)){var c=k.call(this,a);c.labelId=CKEDITOR.tools.getNextId()+ +"_label";this._.children=[];var f={role:a.role||"presentation"};a.includeLabel&&(f["aria-labelledby"]=c.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"div",null,f,function(){var d=[],g=a.required?" cke_required":"";"horizontal"!=a.labelLayout?d.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" ',' id\x3d"'+c.labelId+'"',c.inputId?' for\x3d"'+c.inputId+'"':"",(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",a.required?a.label+'\x3cspan class\x3d"cke_dialog_ui_labeled_required" aria-hidden\x3d"true"\x3e*\x3c/span\x3e': +a.label,"\x3c/label\x3e",'\x3cdiv class\x3d"cke_dialog_ui_labeled_content"',a.controlStyle?' style\x3d"'+a.controlStyle+'"':"",' role\x3d"presentation"\x3e',e.call(this,b,a),"\x3c/div\x3e"):(g={type:"hbox",widths:a.widths,padding:0,children:[{type:"html",html:'\x3clabel class\x3d"cke_dialog_ui_labeled_label'+g+'" id\x3d"'+c.labelId+'" for\x3d"'+c.inputId+'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e"+CKEDITOR.tools.htmlEncode(a.label)+"\x3c/label\x3e"},{type:"html",html:'\x3cspan class\x3d"cke_dialog_ui_labeled_content"'+ +(a.controlStyle?' style\x3d"'+a.controlStyle+'"':"")+"\x3e"+e.call(this,b,a)+"\x3c/span\x3e"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,g,d));return d.join("")})}},textInput:function(b,a,d){if(!(3>arguments.length)){k.call(this,a);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",c={"class":"cke_dialog_ui_input_"+a.type,id:e,type:a.type};a.validate&&(this.validate=a.validate);a.maxLength&&(c.maxlength=a.maxLength);a.size&&(c.size=a.size);a.inputStyle&&(c.style=a.inputStyle);var f= +this,h=!1;b.on("load",function(){f.getInputElement().on("keydown",function(a){13==a.data.getKeystroke()&&(h=!0)});f.getInputElement().on("keyup",function(a){13==a.data.getKeystroke()&&h&&(b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0),h=!1);f.bidi&&w.call(f,a)},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var b=['\x3cdiv class\x3d"cke_dialog_ui_input_',a.type,'" role\x3d"presentation"'];a.width&&b.push('style\x3d"width:'+a.width+'" ');b.push("\x3e\x3cinput "); +c["aria-labelledby"]=this._.labelId;this._.required&&(c["aria-required"]=this._.required);for(var e in c)b.push(e+'\x3d"'+c[e]+'" ');b.push(" /\x3e\x3c/div\x3e");return b.join("")})}},textarea:function(b,a,d){if(!(3>arguments.length)){k.call(this,a);var e=this,c=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",f={};a.validate&&(this.validate=a.validate);f.rows=a.rows||5;f.cols=a.cols||20;f["class"]="cke_dialog_ui_input_textarea "+(a["class"]||"");"undefined"!=typeof a.inputStyle&&(f.style=a.inputStyle); +a.dir&&(f.dir=a.dir);if(e.bidi)b.on("load",function(){e.getInputElement().on("keyup",w)},e);CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){f["aria-labelledby"]=this._.labelId;this._.required&&(f["aria-required"]=this._.required);var a=['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"',c,'" '],b;for(b in f)a.push(b+'\x3d"'+CKEDITOR.tools.htmlEncode(f[b])+'" ');a.push("\x3e",CKEDITOR.tools.htmlEncode(e._["default"]),"\x3c/textarea\x3e\x3c/div\x3e"); +return a.join("")})}},checkbox:function(b,a,d){if(!(3>arguments.length)){var e=k.call(this,a,{"default":!!a["default"]});a.validate&&(this.validate=a.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"span",null,null,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),d=[],h=CKEDITOR.tools.getNextId()+"_label",g={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":h};t(c);a["default"]&&(g.checked="checked");"undefined"!= +typeof c.inputStyle&&(c.style=c.inputStyle);e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,c,d,"input",null,g);d.push(' \x3clabel id\x3d"',h,'" for\x3d"',g.id,'"'+(a.labelStyle?' style\x3d"'+a.labelStyle+'"':"")+"\x3e",CKEDITOR.tools.htmlEncode(a.label),"\x3c/label\x3e");return d.join("")})}},radio:function(b,a,d){if(!(3>arguments.length)){k.call(this,a);this._["default"]||(this._["default"]=this._.initValue=a.items[0][1]);a.validate&&(this.validate=a.validate);var e=[],c=this;a.role="radiogroup"; +a.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){for(var d=[],h=[],g=(a.id?a.id:CKEDITOR.tools.getNextId())+"_radio",n=0;narguments.length)){var e=k.call(this,a);a.validate&&(this.validate=a.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),d=[],h=[],g={id:e.inputId, +"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};d.push('\x3cdiv class\x3d"cke_dialog_ui_input_',a.type,'" role\x3d"presentation"');a.width&&d.push('style\x3d"width:'+a.width+'" ');d.push("\x3e");void 0!==a.size&&(g.size=a.size);void 0!==a.multiple&&(g.multiple=a.multiple);t(c);for(var n=0,l;narguments.length)){void 0===a["default"]&&(a["default"]="");var e=CKEDITOR.tools.extend(k.call(this,a),{definition:a,buttons:[]});a.validate&&(this.validate=a.validate);b.on("load",function(){CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this, +b,a,d,function(){e.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var b=['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',e.frameId,'" title\x3d"',a.label,'" src\x3d"javascript:void('];b.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");b.push(')"\x3e\x3c/iframe\x3e');return b.join("")})}},fileButton:function(b,a,d){var e=this;if(!(3>arguments.length)){k.call(this, +a);a.validate&&(this.validate=a.validate);var c=CKEDITOR.tools.extend({},a),f=c.onClick;c.className=(c.className?c.className+" ":"")+"cke_dialog_ui_button";c.onClick=function(c){var d=a["for"];c=f?f.call(this,c):!1;!1!==c&&("xhr"!==c&&b.getContentElement(d[0],d[1]).submit(),this.disable())};b.on("load",function(){b.getContentElement(a["for"][0],a["for"][1])._.buttons.push(e)});CKEDITOR.ui.dialog.button.call(this,b,c,d)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,a=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/, +d=/\/$/;return function(e,c,f){if(!(3>arguments.length)){var h=[],g=c.html;"\x3c"!=g.charAt(0)&&(g="\x3cspan\x3e"+g+"\x3c/span\x3e");var n=c.focus;if(n){var l=this.focus;this.focus=function(){("function"==typeof n?n:l).call(this);this.fire("focus")};c.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,c,h,"span",null,null,"");h=h.join("").match(b);g=g.match(a)||["","",""];d.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);f.push([g[1], +" ",h[1]||"",g[2]].join(""))}}}(),fieldset:function(b,a,d,e,c){var f=c.label;this._={children:a};CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"fieldset",null,null,function(){var a=[];f&&a.push("\x3clegend"+(c.labelStyle?' style\x3d"'+c.labelStyle+'"':"")+"\x3e"+f+"\x3c/legend\x3e");for(var b=0;ba.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(a):a.getChild(0).$.nodeValue=b;return this},getLabel:function(){var b=CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:v},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return this._.disabled?!1:this.fire("click",{dialog:this._.dialog})}, enable:function(){this._.disabled=!1;var b=this.getElement();b&&b.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(b,a){this.on("click",function(){a.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()}, accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},focus:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&a.$.focus()},0)},select:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&(a.$.focus(),a.$.select())},0)},accessKeyUp:function(){this.select()}, setValue:function(b){if(this.bidi){var a=b&&b.charAt(0);(a="‪"==a?"ltr":"‫"==a?"rtl":null)&&(b=b.slice(1));this.setDirectionMarker(a)}b||(b="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},getValue:function(){var b=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&b){var a=this.getDirectionMarker();a&&(b=("ltr"==a?"‪":"‫")+b)}return b},setDirectionMarker:function(b){var a=this.getInputElement();b?a.setAttributes({dir:b,"data-cke-dir-marker":b}): -this.getDirectionMarker()&&a.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},q,!0);CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(b,a,d){var f=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document), -c=this.getInputElement().$;f.$.text=b;f.$.value=void 0===a||null===a?b:a;void 0===d||null===d?CKEDITOR.env.ie?c.add(f.$):c.add(f.$,null):c.add(f.$,d);return this},remove:function(b){this.getInputElement().$.remove(b);return this},clear:function(){for(var b=this.getInputElement().$;0this.focusIndex&&!c&&(a=b[b.length-1]);d.currentFocusIndex=this.focusIndex;for(d=0;db-a;c--)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function W(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;ch.width-c.width-g?h.width-c.width+("rtl"==f.lang.dir?0:k[1]):d.x;c=d.y+k[0]h.height-c.height-g?h.height-c.height+k[2]:d.y;q=Math.floor(q);c=Math.floor(c);a.move(q,c,1);b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=u.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup", +b.on("blur",function(){this.fire("mouseout")})}function ba(a){function b(){a.layout()}var c=CKEDITOR.document.getWindow();c.on("resize",b);a.on("hide",function(){c.removeListener("resize",b)})}function M(a,b){this.dialog=a;for(var c=b.contents,e=0,d;d=c[e];e++)c[e]=d&&new N(a,d);CKEDITOR.tools.extend(this,b)}function N(a,b){this._={dialog:a};CKEDITOR.tools.extend(this,b)}function ca(a){function b(b){var c=a.getSize(),h=a.parts.dialog.getParent().getClientSize(),q=b.data.$.screenX,m=b.data.$.screenY, +r=q-e.x,n=m-e.y;e={x:q,y:m};d.x+=r;d.y+=n;q=d.x+k[3]h.width-c.width-g?h.width-c.width+("rtl"==f.lang.dir?0:k[1]):d.x;c=d.y+k[0]h.height-c.height-g?h.height-c.height+k[2]:d.y;q=Math.floor(q);c=Math.floor(c);a.move(q,c,1);b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",c);if(CKEDITOR.env.ie6Compat){var a=u.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup", c)}}var e=null,d=null,f=a.getParentEditor(),g=f.config.dialog_magnetDistance,k=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof g&&(g=20);a.parts.title.on("mousedown",function(f){if(!a._.moved){var g=a._.element;g.getFirst().setStyle("position","absolute");g.removeStyle("display");a._.moved=!0;a.layout()}e={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);d=a.getPosition();CKEDITOR.env.ie6Compat&&(g=u.getChild(0).getFrameDocument(),g.on("mousemove", -b),g.on("mouseup",c));f.data.preventDefault()},a)}function da(a){function b(b){var c="rtl"==f.lang.dir,n=h.width,q=h.height,w=n+(b.data.$.screenX-l.x)*(c?-1:1)*(a._.moved?1:2),A=q+(b.data.$.screenY-l.y)*(a._.moved?1:2),C=a._.element.getFirst(),C=c&&parseInt(C.getComputedStyle("right"),10),v=a.getPosition();v.x=v.x||0;v.y=v.y||0;v.y+A>p.height&&(A=p.height-v.y);(c?C:v.x)+w>p.width&&(w=p.width-(c?C:v.x));A=Math.floor(A);w=Math.floor(w);if(d==CKEDITOR.DIALOG_RESIZE_WIDTH||d==CKEDITOR.DIALOG_RESIZE_BOTH)n= -Math.max(e.minWidth||0,w-g);if(d==CKEDITOR.DIALOG_RESIZE_HEIGHT||d==CKEDITOR.DIALOG_RESIZE_BOTH)q=Math.max(e.minHeight||0,A-k);a.resize(n,q);a._.moved&&O(a,a._.position.x,a._.position.y);a._.moved||a.layout();b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mouseup",c);CKEDITOR.document.removeListener("mousemove",b);q&&(q.remove(),q=null);if(CKEDITOR.env.ie6Compat){var a=u.getChild(0).getFrameDocument();a.removeListener("mouseup",c);a.removeListener("mousemove",b)}}var e=a.definition, -d=e.resizable;if(d!=CKEDITOR.DIALOG_RESIZE_NONE){var f=a.getParentEditor(),g,k,p,l,h,q,n=CKEDITOR.tools.addFunction(function(d){function e(a){return a.isVisible()}h=a.getSize();var f=a.parts.contents,n=f.$.getElementsByTagName("iframe").length,w=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);n&&(q=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%; left:0; top:0;"\x3e\x3c/div\x3e'),f.append(q));k=h.height- +b),g.on("mouseup",c));f.data.preventDefault()},a)}function da(a){function b(b){var c="rtl"==f.lang.dir,m=h.width,q=h.height,w=m+(b.data.$.screenX-l.x)*(c?-1:1)*(a._.moved?1:2),A=q+(b.data.$.screenY-l.y)*(a._.moved?1:2),C=a._.element.getFirst(),C=c&&parseInt(C.getComputedStyle("right"),10),v=a.getPosition();v.x=v.x||0;v.y=v.y||0;v.y+A>p.height&&(A=p.height-v.y);(c?C:v.x)+w>p.width&&(w=p.width-(c?C:v.x));A=Math.floor(A);w=Math.floor(w);if(d==CKEDITOR.DIALOG_RESIZE_WIDTH||d==CKEDITOR.DIALOG_RESIZE_BOTH)m= +Math.max(e.minWidth||0,w-g);if(d==CKEDITOR.DIALOG_RESIZE_HEIGHT||d==CKEDITOR.DIALOG_RESIZE_BOTH)q=Math.max(e.minHeight||0,A-k);a.resize(m,q);a._.moved&&O(a,a._.position.x,a._.position.y);a._.moved||a.layout();b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mouseup",c);CKEDITOR.document.removeListener("mousemove",b);q&&(q.remove(),q=null);if(CKEDITOR.env.ie6Compat){var a=u.getChild(0).getFrameDocument();a.removeListener("mouseup",c);a.removeListener("mousemove",b)}}var e=a.definition, +d=e.resizable;if(d!=CKEDITOR.DIALOG_RESIZE_NONE){var f=a.getParentEditor(),g,k,p,l,h,q,m=CKEDITOR.tools.addFunction(function(d){function e(a){return a.isVisible()}h=a.getSize();var f=a.parts.contents,m=f.$.getElementsByTagName("iframe").length,w=!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks);m&&(q=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%; left:0; top:0;"\x3e\x3c/div\x3e'),f.append(q));k=h.height- a.parts.contents.getFirst(e).getSize("height",w);g=h.width-a.parts.contents.getFirst(e).getSize("width",1);l={x:d.screenX,y:d.screenY};p=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);CKEDITOR.env.ie6Compat&&(f=u.getChild(0).getFrameDocument(),f.on("mousemove",b),f.on("mouseup",c));d.preventDefault&&d.preventDefault()});a.on("load",function(){var b="";d==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":d==CKEDITOR.DIALOG_RESIZE_HEIGHT&& -(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+n+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(n)})}}function O(a,b,c){var e=a.parts.dialog.getParent().getClientSize(),d=a.getSize(),f=a._.viewportRatio,g=Math.max(e.width- +(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer'+b+" cke_resizer_"+f.lang.dir+'" title\x3d"'+CKEDITOR.tools.htmlEncode(f.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+m+', event )"\x3e'+("ltr"==f.lang.dir?"◢":"◣")+"\x3c/div\x3e");a.parts.footer.append(b,1)});f.on("destroy",function(){CKEDITOR.tools.removeFunction(m)})}}function O(a,b,c){var e=a.parts.dialog.getParent().getClientSize(),d=a.getSize(),f=a._.viewportRatio,g=Math.max(e.width- d.width,0),e=Math.max(e.height-d.height,0);f.width=g?b/g:f.width;f.height=e?c/e:f.height;a._.viewportRatio=f}function H(a){a.data.preventDefault(1)}function P(a){var b=a.config,c=CKEDITOR.skinName||a.config.skin,e=b.dialog_backgroundCoverColor||("moono-lisa"==c?"black":"white"),c=b.dialog_backgroundCoverOpacity,d=b.baseFloatZIndex,b=CKEDITOR.tools.genKey(e,c,d),f=B[b];CKEDITOR.document.getBody().addClass("cke_dialog_open");f?f.show():(d=['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ',CKEDITOR.env.ie6Compat? "absolute":"fixed","; z-index: ",d,"; top: 0px; left: 0px; ","; width: 100%; height: 100%;",CKEDITOR.env.ie6Compat?"":"background-color: "+e,'" class\x3d"cke_dialog_background_cover"\x3e'],CKEDITOR.env.ie6Compat&&(e="\x3chtml\x3e\x3cbody style\x3d\\'background-color:"+e+";\\'\x3e\x3c/body\x3e\x3c/html\x3e",d.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),d.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+ ")();document.write( '"+e+"' );document.close();")+"})())"),d.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')),d.push("\x3c/div\x3e"),f=CKEDITOR.dom.element.createFromHtml(d.join("")),f.setOpacity(void 0!==c?c:.5),f.on("keydown",H),f.on("keypress",H),f.on("keyup",H),f.appendTo(CKEDITOR.document.getBody()),B[b]=f);a.focusManager.add(f);u=f;CKEDITOR.env.mac&&CKEDITOR.env.webkit||f.focus()}function Q(a){CKEDITOR.document.getBody().removeClass("cke_dialog_open"); u&&(a.focusManager.remove(u),u.hide())}function R(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,e=a.data.$.shiftKey,d=String.fromCharCode(a.data.$.keyCode);(b=x[(b?"CTRL+":"")+(c?"ALT+":"")+(e?"SHIFT+":"")+d])&&b.length&&(b=b[b.length-1],b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key),a.data.preventDefault())}function S(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,e=a.data.$.shiftKey,d=String.fromCharCode(a.data.$.keyCode);(b=x[(b?"CTRL+":"")+(c?"ALT+":"")+(e? "SHIFT+":"")+d])&&b.length&&(b=b[b.length-1],b.keyup&&(b.keyup.call(b.uiElement,b.dialog,b.key),a.data.preventDefault()))}function T(a,b,c,e,d){(x[c]||(x[c]=[])).push({uiElement:a,dialog:b,key:c,keyup:d||a.accessKeyUp,keydown:e||a.accessKeyDown})}function ea(a){for(var b in x){for(var c=x[b],e=c.length-1;0<=e;e--)c[e].dialog!=a&&c[e].uiElement!=a||c.splice(e,1);0===c.length&&delete x[b]}}function fa(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])}function ga(){}var y=CKEDITOR.tools.cssLength, U,u,V=!1,D=!CKEDITOR.env.ie||CKEDITOR.env.edge,aa='\x3cdiv class\x3d"cke_reset_all cke_dialog_container {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" style\x3d"'+(D?"display:flex":"")+'" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style\x3d"'+(D?"margin:auto":"position:absolute")+'" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e'; -CKEDITOR.dialog=function(a,b){function c(){var a=m._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;cb.length)){var c=m._.currentFocusIndex;m._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(d){}var e=c,f=1b.length)){var c=n._.currentFocusIndex;n._.tabBarMode&&0>a&&(c=0);try{b[c].getInputElement().$.blur()}catch(d){}var e=c,f=1arguments.length)){var k=(e.call?e(b):e)||"div",p=["\x3c",k," "],l=(d&&d.call?d(b):d)||{},h=(f&&f.call?f(b):f)||{},q=(g&&g.call?g.call(this,a,b):g)||"",n=this.domId=h.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(l.display="none",this.notAllowed= -!0);h.id=n;var r={};b.type&&(r["cke_dialog_ui_"+b.type]=1);b.className&&(r[b.className]=1);b.disabled&&(r.cke_disabled=1);for(var m=h["class"]&&h["class"].split?h["class"].split(" "):[],n=0;narguments.length)){var k=(e.call?e(b):e)||"div",p=["\x3c",k," "],l=(d&&d.call?d(b):d)||{},h=(f&&f.call?f(b):f)||{},q=(g&&g.call?g.call(this,a,b):g)||"",m=this.domId=h.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(l.display="none",this.notAllowed= +!0);h.id=m;var r={};b.type&&(r["cke_dialog_ui_"+b.type]=1);b.className&&(r[b.className]=1);b.disabled&&(r.cke_disabled=1);for(var n=h["class"]&&h["class"].split?h["class"].split(" "):[],m=0;mCKEDITOR.env.version?"cke_dialog_ui_focused":"";b.on("focus", function(){a._.tabBarMode=!1;a._.hasFocus=!0;t.fire("focus");c&&this.addClass(c)});b.on("blur",function(){t.fire("blur");c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=t.focusIndex}))}},hbox:function(a,b,c,e,d){if(!(4>arguments.length)){this._||(this._={});var f=this._.children=b,g=d&&d.widths||null,k=d&&d.height||null,p,l={role:"presentation"}; d&&d.align&&(l.align=d.align);CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"hbox"},e,"table",{},l,function(){var a=['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];for(p=0;parguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a, c,e){for(var d=c.children,f,g=[],k=[],p=0;pe.length&&(a=g.document.createElement(g.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),b=h.shift(),c.insertNode(a),a.append(new CKEDITOR.dom.text("",g.document)),c.moveToBookmark(b),c.selectNodeContents(a),c.collapse(!0),b=c.createBookmark(),e.push(a),h.unshift(b));d=e[0].getParent();c=[];for(b=0;ba||(this.notifications.splice(a,1),b.element.remove(),this.element.getChild a.on("change",this._changeBuffer.input);a.on("floatingSpaceLayout",this._layout,this,null,20);a.on("blur",this._layout,this,null,20)},_removeListeners:function(){var b=CKEDITOR.document.getWindow(),a=this.editor;b.removeListener("scroll",this._uiBuffer.input);b.removeListener("resize",this._uiBuffer.input);a.removeListener("change",this._changeBuffer.input);a.removeListener("floatingSpaceLayout",this._layout);a.removeListener("blur",this._layout)},_layout:function(){function b(){a.setStyle("left", k(n+d.width-g-h))}var a=this.element,c=this.editor,d=c.ui.contentsElement.getClientRect(),e=c.ui.contentsElement.getDocumentPosition(),f,l,u=a.getClientRect(),m,g=this._notificationWidth,h=this._notificationMargin;m=CKEDITOR.document.getWindow();var p=m.getScrollPosition(),t=m.getViewPaneSize(),q=CKEDITOR.document.getBody(),r=q.getDocumentPosition(),k=CKEDITOR.tools.cssLength;g&&h||(m=this.element.getChild(0),g=this._notificationWidth=m.getClientRect().width,h=this._notificationMargin=parseInt(m.getComputedStyle("margin-left"), 10)+parseInt(m.getComputedStyle("margin-right"),10));c.toolbar&&(f=c.ui.space(c.config.toolbarLocation),l=f.getClientRect());f&&f.isVisible()&&l.bottom>d.top&&l.bottomp.y?a.setStyles({position:"fixed",top:0}):a.setStyles({position:"absolute",top:k(e.y+d.height-u.height)});var n="fixed"==a.getStyle("position")?d.left:"static"!=q.getComputedStyle("position")? -e.x-r.x:e.x;d.widthp.x+t.width?b():a.setStyle("left",k(n)):e.x+g+h>p.x+t.width?a.setStyle("left",k(n)):e.x+d.width/2+g/2+h>p.x+t.width?a.setStyle("left",k(n-e.x+p.x+t.width-g-h)):0>d.left+d.width-g-h?b():0>d.left+d.width/2-g/2?a.setStyle("left",k(n-e.x+p.x)):a.setStyle("left",k(n+d.width/2-g/2-h/2))}};CKEDITOR.plugins.notification=q})();(function(){var c='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(c+=' onkeypress\x3d"return false;"');CKEDITOR.env.gecko&&(c+= -' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var l="";CKEDITOR.env.ie&&(l='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var c=c+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+l+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"')+ +e.x-r.x:e.x;d.widthp.x+t.width?b():a.setStyle("left",k(n)):e.x+g+h>p.x+t.width?a.setStyle("left",k(n)):e.x+d.width/2+g/2+h>p.x+t.width?a.setStyle("left",k(n-e.x+p.x+t.width-g-h)):0>d.left+d.width-g-h?b():0>d.left+d.width/2-g/2?a.setStyle("left",k(n-e.x+p.x)):a.setStyle("left",k(n+d.width/2-g/2-h/2))}};CKEDITOR.plugins.notification=q})();(function(){var c='\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"{hasArrowAriaHtml}{toggleAriaHtml}';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(c+=' onkeypress\x3d"return false;"'); +CKEDITOR.env.gecko&&(c+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');var l="";CKEDITOR.env.ie&&(l='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var c=c+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+l+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"')+ '\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcutSpace}{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e',v=CKEDITOR.addTemplate("buttonArrow",'\x3cspan class\x3d"cke_button_arrow"\x3e'+(CKEDITOR.env.hc?"\x26#9660;":"")+"\x3c/span\x3e"),w=CKEDITOR.addTemplate("button",c);CKEDITOR.plugins.add("button", -{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,b){function c(){var f=a.mode;f&&(f=this.modes[f]?void 0!==p[f]?p[f]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED, -f=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:f,this.setState(f),this.refresh&&this.refresh())}var p=null,q=CKEDITOR.env,r=this._.id=CKEDITOR.tools.getNextId(),g="",d=this.command,l,m,k;this._.editor=a;var e={id:r,button:this,editor:a,focus:function(){CKEDITOR.document.getById(r).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},x=CKEDITOR.tools.addFunction(function(a){if(e.onkey)return a=new CKEDITOR.dom.event(a),!1!==e.onkey(e,a.getKeystroke())}), -y=CKEDITOR.tools.addFunction(function(a){var b;e.onfocus&&(b=!1!==e.onfocus(e,new CKEDITOR.dom.event(a)));return b}),u=0;e.clickFn=l=CKEDITOR.tools.addFunction(function(){u&&(a.unlockSelection(1),u=0);e.execute();q.iOS&&a.focus()});this.modes?(p={},a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(p[a.mode]=this._.state)},this),a.on("activeFilterChange",c,this),a.on("mode",c,this),!this.readOnly&&a.on("readOnly",c,this)):d&&(d=a.getCommand(d))&&(d.on("state",function(){this.setState(d.state)}, -this),g+=d.state==CKEDITOR.TRISTATE_ON?"on":d.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");var n;if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),d=c.getFirst();b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(n,"rtl"==b,this.icon,this.iconOffset))},this);d?(m=a.getCommandKeystroke(d))&&(k=CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,m)): -g+="off";m=this.name||this.command;var h=null,t=this.icon;n=m;this.icon&&!/\./.test(this.icon)?(n=this.icon,t=null):(this.icon&&(h=this.icon),CKEDITOR.env.hidpi&&this.iconHiDpi&&(h=this.iconHiDpi));h?(CKEDITOR.skin.addIcon(h,h),t=null):h=n;g={id:r,name:m,iconName:n,label:this.label,cls:(this.hasArrow?"cke_button_expandable ":"")+(this.className||""),state:g,ariaDisabled:"disabled"==g?"true":"false",title:this.title+(k?" ("+k.display+")":""),ariaShortcutSpace:k?"\x26nbsp;":"",ariaShortcut:k?a.lang.common.keyboardShortcut+ -" "+k.aria:"",titleJs:q.gecko&&!q.hc?"":(this.title||"").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:x,focusFn:y,clickFn:l,style:CKEDITOR.skin.getIconStyle(h,"rtl"==a.lang.dir,t,this.iconOffset),arrowHtml:this.hasArrow?v.output():""};w.output(g,b);if(this.onRender)this.onRender();return e},setState:function(a){if(this._.state==a)return!1;this._.state=a;var b=CKEDITOR.document.getById(this._.id);return b?(b.setState(a,"cke_button"), -b.setAttribute("aria-disabled",a==CKEDITOR.TRISTATE_DISABLED),this.hasArrow?b.setAttribute("aria-expanded",a==CKEDITOR.TRISTATE_ON):a===CKEDITOR.TRISTATE_ON?b.setAttribute("aria-pressed",!0):b.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var b=this;this.allowedContent||this.requiredContent||!this.command||(b=a.getCommand(this.command)||b);return this._.feature=b}};CKEDITOR.ui.prototype.addButton=function(a, -b){this.add(a,CKEDITOR.UI_BUTTON,b)}})();(function(){function D(a){function d(){for(var b=f(),e=CKEDITOR.tools.clone(a.config.toolbarGroups)||v(a),n=0;na.order?-1:0>b.order?1:b.order]+data-cke-bookmark[^<]*?<\/span>/ig, -"");d&&u(a,c)})}function q(){if("wysiwyg"==a.mode){var b=t("paste");a.getCommand("cut").setState(t("cut"));a.getCommand("copy").setState(t("copy"));a.getCommand("paste").setState(b);a.fire("pasteState",b)}}function t(b){var c=a.getSelection(),c=c&&c.getRanges()[0];if((a.readOnly||c&&c.checkReadOnly())&&b in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==b)return CKEDITOR.TRISTATE_OFF;b=a.getSelection();c=b.getRanges();return b.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed? -CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var n=CKEDITOR.plugins.clipboard,v=0,p=0;(function(){a.on("key",h);a.on("contentDom",b);a.on("selectionChange",q);if(a.contextMenu){a.contextMenu.addListener(function(){return{cut:t("cut"),copy:t("copy"),paste:t("paste")}});var c=null;a.on("menuShow",function(){c&&(c.removeListener(),c=null);var b=a.contextMenu.findItemByCommandName("paste");b&&b.element&&(c=b.element.on("touchend",function(){a._.forcePasteDialog=!0}))})}if(a.ui.addButton)a.once("instanceReady", -function(){a._.pasteButtons&&CKEDITOR.tools.array.forEach(a._.pasteButtons,function(b){if(b=a.ui.get(b))if(b=CKEDITOR.document.getById(b._.id))b.on("touchend",function(){a._.forcePasteDialog=!0})})})})();(function(){function b(c,d,h,k,f){var m=a.lang.clipboard[d];a.addCommand(d,h);a.ui.addButton&&a.ui.addButton(c,{label:m,command:d,toolbar:"clipboard,"+k});a.addMenuItems&&a.addMenuItem(d,{label:m,command:d,group:"clipboard",order:f})}b("Cut","cut",c("cut"),10,1);b("Copy","copy",c("copy"),20,4);b("Paste", -"paste",d(),30,8);a._.pasteButtons||(a._.pasteButtons=[]);a._.pasteButtons.push("Paste")})();a.getClipboardData=function(b,c){function d(a){a.removeListener();a.cancel();c(a.data)}function h(a){a.removeListener();a.cancel();c({type:f,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var k=!1,f="auto";c||(c=b,b=null);a.on("beforePaste",function(a){a.removeListener();k=!0;f=a.data.type},null,null,1E3);a.on("paste",d,null,null,0);!1===r()&&(a.removeListener("paste",d),a._.forcePasteDialog&& -k&&a.fire("pasteDialog")?(a.on("pasteDialogCommit",h),a.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",h);a.data._.committed||c(null)})):c(null))}}function y(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&!a.match(/^(
<\/div>|
[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|)*$/gi)&&!a.match(/^(

([^<]|)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!a.match(/^([^<]|)*$/gi))return"html"}else return"html"; -return"htmlifiedtext"}function z(a,b){function c(a){return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e",~~(a/2))+(1==a%2?"\x3cbr\x3e":"")}b=b.replace(/(?!\u3000)\s+/g," ").replace(/> +/gi,"\x3cbr\x3e");b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(b.match(/^[^<]$/))return b;CKEDITOR.env.webkit&&-1(
|)<\/div>)(?!$|(

(
|)<\/div>))/g,"\x3cbr\x3e").replace(/^(
(
|)<\/div>){2}(?!$)/g,"\x3cdiv\x3e\x3c/div\x3e"), -b.match(/
(
|)<\/div>/)&&(b="\x3cp\x3e"+b.replace(/(
(
|)<\/div>)+/g,function(a){return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length+1)})+"\x3c/p\x3e"),b=b.replace(/<\/div>
/g,"\x3cbr\x3e"),b=b.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^

$/,"\x3cbr\x3e")),-1){2,}/g,function(a){return c(a.length/4)})+"\x3c/p\x3e"));return A(a,b)}function B(a){function b(){var a= -{},b;for(b in CKEDITOR.dtd)"$"!=b.charAt(0)&&"div"!=b&&"span"!=b&&(a[b]=1);return a}var c={};return{get:function(d){return"plain-text"==d?c.plainText||(c.plainText=new CKEDITOR.filter(a,"br")):"semantic-content"==d?((d=c.semanticContent)||(d=new CKEDITOR.filter(a,{}),d.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),d=c.semanticContent=d),d):d?new CKEDITOR.filter(a,d):null}}}function w(a,b,c){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var d=new CKEDITOR.htmlParser.basicWriter;c.applyTo(b, -!0,!1,a.activeEnterMode);b.writeHtml(d);return d.getHtml()}function A(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p>

)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e",a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function C(a){a.data.preventDefault();a.data.$.dataTransfer.dropEffect="none"}function D(a){var b=CKEDITOR.plugins.clipboard;a.on("contentDom",function(){function c(b,c,d){c.select();u(a,{dataTransfer:d, -method:"drop"},1);d.sourceEditor.fire("saveSnapshot");d.sourceEditor.editable().extractHtmlFromRange(b);d.sourceEditor.getSelection().selectRanges([b]);d.sourceEditor.fire("saveSnapshot")}function d(c,d){c.select();u(a,{dataTransfer:d,method:"drop"},1);b.resetDragDataTransfer()}function e(b,c,d){var k={$:b.data.$,target:b.data.getTarget()};c&&(k.dragRange=c);d&&(k.dropRange=d);!1===a.fire(b.name,k)&&b.data.preventDefault()}function g(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()} -var f=a.editable(),l=CKEDITOR.plugins.clipboard.getDropTarget(a),k=a.ui.space("top"),r=a.ui.space("bottom");b.preventDefaultDropOnElement(k);b.preventDefaultDropOnElement(r);f.attachListener(l,"dragstart",e);f.attachListener(a,"dragstart",b.resetDragDataTransfer,b,null,1);f.attachListener(a,"dragstart",function(c){b.initDragDataTransfer(c,a)},null,null,2);f.attachListener(a,"dragstart",function(){var c=b.dragRange=a.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(b.dragStartContainerChildCount= -c?g(c.startContainer):null,b.dragEndContainerChildCount=c?g(c.endContainer):null)},null,null,100);f.attachListener(l,"dragend",e);f.attachListener(a,"dragend",b.initDragDataTransfer,b,null,1);f.attachListener(a,"dragend",b.resetDragDataTransfer,b,null,100);f.attachListener(l,"dragover",function(a){if(CKEDITOR.env.edge)a.data.preventDefault();else{var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&& -a.data.preventDefault()}});f.attachListener(l,"drop",function(c){if(!c.data.$.defaultPrevented&&(c.data.preventDefault(),!a.readOnly)){var d=c.data.getTarget();if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=b.getRangeAtDropPosition(c,a),k=b.dragRange;d&&e(c,k,d)}}},null,null,9999);f.attachListener(a,"drop",b.initDragDataTransfer,b,null,1);f.attachListener(a,"drop",function(k){if(k=k.data){var f=k.dropRange,r=k.dragRange,e=k.dataTransfer;e.getTransferType(a)==CKEDITOR.DATA_TRANSFER_INTERNAL? -setTimeout(function(){b.internalDrop(r,f,e,a)},0):e.getTransferType(a)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?c(r,f,e):d(f,e)}},null,null,9999)})}var p;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",init:function(a){function b(b){b=CKEDITOR.tools.array.map(b,function(a){return a.split("/")[1].toUpperCase()}).join(", ");return a.lang.clipboard.fileFormatNotSupportedNotification.replace(/\${formats\}/g,b)}function c(a,b){return CKEDITOR.env.ie&&a.data.fileTransferCancel||!(CKEDITOR.env.ie|| -b&&l!==b.id)?!1:b.isFileTransfer()&&1===b.getFilesCount()}var d,e=B(a);a.config.forcePasteAsPlainText?d="plain-text":a.config.pasteFilter?d=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(d="semantic-content");a.pasteFilter=e.get(d);x(a);D(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));if((CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||CKEDITOR.plugins.clipboard.isFileApiSupported)&&a.config.clipboard_handleImages){var g=["image/png","image/jpeg", -"image/gif"],f=b(g),l;a.on("paste",function(b){var d=b.data,h=d.dataTransfer;if(!d.dataValue&&c(b,h))if(h=h.getFile(0),-1===CKEDITOR.tools.indexOf(g,h.type))a.showNotification(f,"info",a.config.clipboard_notificationDuration);else{var e=new FileReader;e.addEventListener("load",function(){b.data.dataValue='\x3cimg src\x3d"'+e.result+'" /\x3e';a.fire("paste",b.data)},!1);e.addEventListener("abort",function(){CKEDITOR.env.ie&&(b.data.fileTransferCancel=!0);a.fire("paste",b.data)},!1);e.addEventListener("error", -function(){CKEDITOR.env.ie&&(b.data.fileTransferCancel=!0);a.fire("paste",b.data)},!1);e.readAsDataURL(h);l=d.dataTransfer.id;b.stop()}},null,null,1)}a.on("paste",function(b){b.data.dataTransfer||(b.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer);if(!b.data.dataValue){var c=b.data.dataTransfer,d=c.getData("text/html");if(d)b.data.dataValue=d,b.data.type="html";else if(d=c.getData("text/plain"))b.data.dataValue=a.editable().transformPlainTextToHtml(d),b.data.type="text"}},null,null, -1);a.on("paste",function(a){var b=a.data.dataValue,c=CKEDITOR.dtd.$block;-1 <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1/,"")), -b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var d,f,e=new CKEDITOR.dom.element("div");for(e.setHtml(b);1==e.getChildCount()&&(d=e.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)e=f=d;f&&(b=f.getHtml().replace(/
$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,d){return d.toLowerCase()in c?(a.data.preSniffing="html","\x3c"+d):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)>


<\/div>$/, -function(b,d){return d in c?(a.data.endsWithEOL=1,"\x3c/"+d+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)
$/,"$1"));a.data.dataValue=b},null,null,3);a.on("paste",function(b){b=b.data;var c=a._.nextPasteType||b.type,d=b.dataValue,f,g=a.config.clipboard_defaultContentType||"html",l=b.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,n=!0===a.config.forcePasteAsPlainText;f="html"==c||"html"==b.preSniffing?"html":y(d);delete a._.nextPasteType;"htmlifiedtext"==f&&(d=z(a.config,d)); -if("text"==c&&"html"==f)d=w(a,d,e.get("plain-text"));else if(l&&a.pasteFilter&&!b.dontFilter||n)d=w(a,d,a.pasteFilter);b.startsWithEOL&&(d='\x3cbr data-cke-eol\x3d"1"\x3e'+d);b.endsWithEOL&&(d+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==c&&(c="html"==f||"html"==g?"html":"text");b.type=c;b.dataValue=d;delete b.preSniffing;delete b.startsWithEOL;delete b.endsWithEOL},null,null,6);a.on("paste",function(b){b=b.data;b.dataValue&&(a.insertHtml(b.dataValue,b.type,b.range),setTimeout(function(){a.fire("afterPaste")}, -0))},null,null,1E3);a.on("pasteDialog",function(b){setTimeout(function(){a.openDialog("paste",b.data)},0)})}});CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:CKEDITOR.env.ie&&16>CKEDITOR.env.version||CKEDITOR.env.iOS&&605>CKEDITOR.env.version?!1:!0,isCustomDataTypesSupported:!CKEDITOR.env.ie||16<=CKEDITOR.env.version,isFileApiSupported:!CKEDITOR.env.ie||9CKEDITOR.env.version||b.isInline()?b:a.document},fixSplitNodesAfterDrop:function(a,b,c,d){function e(a,c,d){var e=a;e.type==CKEDITOR.NODE_TEXT&&(e=a.getParent());if(e.equals(c)&&d!=c.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),c=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&c&&c.type==CKEDITOR.NODE_TEXT&&(d=a.getLength(),a.setText(a.getText()+c.getText()),c.remove(),b.setStart(a,d),b.collapse(!0)),!0}var g=b.startContainer;"number"==typeof d&&"number"== -typeof c&&g.type==CKEDITOR.NODE_ELEMENT&&(e(a.startContainer,g,c)||e(a.endContainer,g,d))},isDropRangeAffectedByDragRange:function(a,b){var c=b.startContainer,d=b.endOffset;return a.endContainer.equals(c)&&a.endOffset<=d||a.startContainer.getParent().equals(c)&&a.startContainer.getIndex()CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(a,b,e.dragStartContainerChildCount,e.dragEndContainerChildCount);(l=this.isDropRangeAffectedByDragRange(a,b))||(f=a.createBookmark(!1));e=b.clone().createBookmark(!1);l&&(f=a.createBookmark(!1));a=f.startNode;b=f.endNode;l=e.startNode;b&&a.getPosition(l)&CKEDITOR.POSITION_PRECEDING&&b.getPosition(l)&CKEDITOR.POSITION_FOLLOWING&&l.insertBefore(a);a=d.createRange();a.moveToBookmark(f);g.extractHtmlFromRange(a,1);b=d.createRange(); -e.startNode.getCommonAncestor(g)||(e=d.getSelection().createBookmarks()[0]);b.moveToBookmark(e);u(d,{dataTransfer:c,method:"drop",range:b},1);d.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,b){var c=a.data.$,d=c.clientX,e=c.clientY,g=b.getSelection(!0).getRanges()[0],f=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&&b.document.$.caretRangeFromPoint(d,e))c=b.document.$.caretRangeFromPoint(d,e),f.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset), -f.collapse(!0);else if(c.rangeParent)f.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),f.collapse(!0);else{if(CKEDITOR.env.ie&&8k&&!l;k++){if(!l)try{c.moveToPoint(d,e-k),l=!0}catch(p){}if(!l)try{c.moveToPoint(d,e+k),l=!0}catch(h){}}if(l){var m="cke-temp-"+(new Date).getTime();c.pasteHTML('\x3cspan id\x3d"'+m+'"\x3e​\x3c/span\x3e'); -var q=b.document.getById(m);f.moveToPosition(q,CKEDITOR.POSITION_BEFORE_START);q.remove()}else{var t=b.document.$.elementFromPoint(d,e),n=new CKEDITOR.dom.element(t),v;if(n.equals(b.editable())||"html"==n.getName())return g&&g.startContainer&&!g.startContainer.equals(b.editable())?g:null;v=n.getClientRect();d/i,fragmentRegExp:/\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g, -types:[],data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==a?"Text":"url"==a?"URL":"files"===a?"Files":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(p);this.id||(this.id="Text"==p?"":"cke-"+CKEDITOR.tools.getUniqueId());b&&(this.sourceEditor=b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==p||this.getData("text/plain")||this.setData("text/plain",b.getSelection().getSelectedText()))}; -CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype={getData:function(a,b){a=this._.normalizeType(a);var c="text/html"==a&&b?this._.nativeHtmlCache:this._.data[a];if(void 0===c||null===c||""===c){if(this._.fallbackDataTransfer.isRequired())c=this._.fallbackDataTransfer.getData(a,b);else try{c=this.$.getData(a)||""}catch(d){c=""}"text/html"!=a||b||(c=this._stripHtml(c))}"Text"==a&&CKEDITOR.env.gecko&& -this.getFilesCount()&&"file://"==c.substring(0,7)&&(c="");if("string"===typeof c)var e=c.indexOf("\x3c/html\x3e"),c=-1!==e?c.substring(0,e+7):c;return c},setData:function(a,b){a=this._.normalizeType(a);"text/html"==a?(this._.data[a]=this._stripHtml(b),this._.nativeHtmlCache=b):this._.data[a]=b;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==a||"Text"==a)if("Text"==p&&"Text"==a&&(this.id=b),this._.fallbackDataTransfer.isRequired())this._.fallbackDataTransfer.setData(a,b);else try{this.$.setData(a, -b)}catch(c){}},storeId:function(){"Text"!==p&&this.setData(p,this.id)},getTransferType:function(a){return this.sourceEditor?this.sourceEditor==a?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function a(a){a=b._.normalizeType(a);var c=b.getData(a);"text/html"==a&&(b._.nativeHtmlCache=b.getData(a,!0),c=b._stripHtml(c));c&&(b._.data[a]=c);b._.types.push(a)}if(this.$){var b=this,c,d,e;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c= -0;c$/gi,"")}a&&a.length&&(a=b(a),a=a.replace(this._.metaRegExp,""),a=a.replace(this._.fragmentRegExp,""));return a}};CKEDITOR.plugins.clipboard.fallbackDataTransfer=function(a){this._dataTransfer=a;this._customDataFallbackType="text/html"};CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported= -null;CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes=[];CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype={isRequired:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer,b=this._dataTransfer.$;if(null===a._isCustomMimeTypeSupported)if(b){a._isCustomMimeTypeSupported=!1;if(CKEDITOR.env.edge&&17<=CKEDITOR.env.version)return!0;try{b.setData("cke/mimetypetest","cke test value"),a._isCustomMimeTypeSupported="cke test value"===b.getData("cke/mimetypetest"),b.clearData("cke/mimetypetest")}catch(c){}}else return!1; -return!a._isCustomMimeTypeSupported},getData:function(a,b){var c=this._getData(this._customDataFallbackType,!0);if(b)return c;var c=this._extractDataComment(c),d=null,d=a===this._customDataFallbackType?c.content:c.data&&c.data[a]?c.data[a]:this._getData(a,!0);return null!==d?d:""},setData:function(a,b){var c=a===this._customDataFallbackType;c&&(b=this._applyDataComment(b,this._getFallbackTypeData()));var d=b,e=this._dataTransfer.$;try{e.setData(a,d),c&&(this._dataTransfer._.nativeHtmlCache=d)}catch(g){if(this._isUnsupportedMimeTypeError(g)){c= -CKEDITOR.plugins.clipboard.fallbackDataTransfer;-1===CKEDITOR.tools.indexOf(c._customTypes,a)&&c._customTypes.push(a);var c=this._getFallbackTypeContent(),f=this._getFallbackTypeData();f[a]=d;try{d=this._applyDataComment(c,f),e.setData(this._customDataFallbackType,d),this._dataTransfer._.nativeHtmlCache=d}catch(l){d=""}}}return d},_getData:function(a,b){var c=this._dataTransfer._.data;if(!b&&c[a])return c[a];try{return this._dataTransfer.$.getData(a)}catch(d){return null}},_getFallbackTypeContent:function(){var a= -this._dataTransfer._.data[this._customDataFallbackType];a||(a=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).content);return a},_getFallbackTypeData:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes,b=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).data||{},c=this._dataTransfer._.data;CKEDITOR.tools.array.forEach(a,function(a){void 0!==c[a]?b[a]=c[a]:void 0!==b[a]&&(b[a]=b[a])},this);return b},_isUnsupportedMimeTypeError:function(a){return a.message&& --1!==a.message.search(/element not found/gi)},_extractDataComment:function(a){var b={data:null,content:a||""};if(a&&16b.order?-1:0>a.order?1:a.order]+data-cke-bookmark[^<]*?<\/span>/ig, +"");h&&t(a,c)})}function p(){if("wysiwyg"==a.mode){var b=k("paste");a.getCommand("cut").setState(k("cut"));a.getCommand("copy").setState(k("copy"));a.getCommand("paste").setState(b);a.fire("pasteState",b)}}function k(b){var c=a.getSelection(),c=c&&c.getRanges()[0];if((a.readOnly||c&&c.checkReadOnly())&&b in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==b)return CKEDITOR.TRISTATE_OFF;b=a.getSelection();c=b.getRanges();return b.getType()==CKEDITOR.SELECTION_NONE||1==c.length&&c[0].collapsed? +CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var n=CKEDITOR.plugins.clipboard,u=0,w=0;(function(){a.on("key",h);a.on("contentDom",b);a.on("selectionChange",p);if(a.contextMenu){a.contextMenu.addListener(function(){return{cut:k("cut"),copy:k("copy"),paste:k("paste")}});var c=null;a.on("menuShow",function(){c&&(c.removeListener(),c=null);var b=a.contextMenu.findItemByCommandName("paste");b&&b.element&&(c=b.element.on("touchend",function(){a._.forcePasteDialog=!0}))})}if(a.ui.addButton)a.once("instanceReady", +function(){a._.pasteButtons&&CKEDITOR.tools.array.forEach(a._.pasteButtons,function(b){if(b=a.ui.get(b))if(b=CKEDITOR.document.getById(b._.id))b.on("touchend",function(){a._.forcePasteDialog=!0})})})})();(function(){function b(c,h,d,m,e){var p=a.lang.clipboard[h];a.addCommand(h,d);a.ui.addButton&&a.ui.addButton(c,{label:p,command:h,toolbar:"clipboard,"+m});a.addMenuItems&&a.addMenuItem(h,{label:p,command:h,group:"clipboard",order:e})}b("Cut","cut",c("cut"),10,1);b("Copy","copy",c("copy"),20,4);b("Paste", +"paste",d(),30,8);a._.pasteButtons||(a._.pasteButtons=[]);a._.pasteButtons.push("Paste")})();a.getClipboardData=function(b,c){function h(a){a.removeListener();a.cancel();c(a.data)}function d(a){a.removeListener();a.cancel();c({type:e,dataValue:a.data.dataValue,dataTransfer:a.data.dataTransfer,method:"paste"})}var m=!1,e="auto";c||(c=b,b=null);a.on("beforePaste",function(a){a.removeListener();m=!0;e=a.data.type},null,null,1E3);a.on("paste",h,null,null,0);!1===v()&&(a.removeListener("paste",h),a._.forcePasteDialog&& +m&&a.fire("pasteDialog")?(a.on("pasteDialogCommit",d),a.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",d);a.data._.committed||c(null)})):c(null))}}function z(a){if(CKEDITOR.env.webkit){if(!a.match(/^[^<]*$/g)&&!a.match(/^(
<\/div>|
[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!a.match(/^([^<]|)*$/gi)&&!a.match(/^(

([^<]|)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!a.match(/^([^<]|)*$/gi))return"html"}else return"html"; +return"htmlifiedtext"}function A(a,b){function c(a){return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e",~~(a/2))+(1==a%2?"\x3cbr\x3e":"")}b=b.replace(/(?!\u3000)\s+/g," ").replace(/> +/gi,"\x3cbr\x3e");b=b.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(b.match(/^[^<]$/))return b;CKEDITOR.env.webkit&&-1(
|)<\/div>)(?!$|(

(
|)<\/div>))/g,"\x3cbr\x3e").replace(/^(
(
|)<\/div>){2}(?!$)/g,"\x3cdiv\x3e\x3c/div\x3e"), +b.match(/
(
|)<\/div>/)&&(b="\x3cp\x3e"+b.replace(/(
(
|)<\/div>)+/g,function(a){return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length+1)})+"\x3c/p\x3e"),b=b.replace(/<\/div>
/g,"\x3cbr\x3e"),b=b.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&a.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(b=b.replace(/^

$/,"\x3cbr\x3e")),-1){2,}/g,function(a){return c(a.length/4)})+"\x3c/p\x3e"));return B(a,b)}function C(a){function b(){var a= +{},b;for(b in CKEDITOR.dtd)"$"!=b.charAt(0)&&"div"!=b&&"span"!=b&&(a[b]=1);return a}var c={};return{get:function(d){return"plain-text"==d?c.plainText||(c.plainText=new CKEDITOR.filter(a,"br")):"semantic-content"==d?((d=c.semanticContent)||(d=new CKEDITOR.filter(a,{}),d.allow({$1:{elements:b(),attributes:!0,styles:!1,classes:!1}}),d=c.semanticContent=d),d):d?new CKEDITOR.filter(a,d):null}}}function x(a,b,c){b=CKEDITOR.htmlParser.fragment.fromHtml(b);var d=new CKEDITOR.htmlParser.basicWriter;c.applyTo(b, +!0,!1,a.activeEnterMode);b.writeHtml(d);return d.getHtml()}function B(a,b){a.enterMode==CKEDITOR.ENTER_BR?b=b.replace(/(<\/p>

)+/g,function(a){return CKEDITOR.tools.repeat("\x3cbr\x3e",a.length/7*2)}).replace(/<\/?p>/g,""):a.enterMode==CKEDITOR.ENTER_DIV&&(b=b.replace(/<(\/)?p>/g,"\x3c$1div\x3e"));return b}function D(a){a.data.preventDefault();a.data.$.dataTransfer.dropEffect="none"}function E(a){var b=CKEDITOR.plugins.clipboard;a.on("contentDom",function(){function c(b,c,d){c.select();t(a,{dataTransfer:d, +method:"drop"},1);d.sourceEditor.fire("saveSnapshot");d.sourceEditor.editable().extractHtmlFromRange(b);d.sourceEditor.getSelection().selectRanges([b]);d.sourceEditor.fire("saveSnapshot")}function d(c,d){c.select();t(a,{dataTransfer:d,method:"drop"},1);b.resetDragDataTransfer()}function g(b,c,d){var e={$:b.data.$,target:b.data.getTarget()};c&&(e.dragRange=c);d&&(e.dropRange=d);!1===a.fire(b.name,e)&&b.data.preventDefault()}function f(a){a.type!=CKEDITOR.NODE_ELEMENT&&(a=a.getParent());return a.getChildCount()} +var e=a.editable(),l=CKEDITOR.plugins.clipboard.getDropTarget(a),q=a.ui.space("top"),v=a.ui.space("bottom");b.preventDefaultDropOnElement(q);b.preventDefaultDropOnElement(v);e.attachListener(l,"dragstart",g);e.attachListener(a,"dragstart",b.resetDragDataTransfer,b,null,1);e.attachListener(a,"dragstart",function(c){b.initDragDataTransfer(c,a)},null,null,2);e.attachListener(a,"dragstart",function(){var c=b.dragRange=a.getSelection().getRanges()[0];CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(b.dragStartContainerChildCount= +c?f(c.startContainer):null,b.dragEndContainerChildCount=c?f(c.endContainer):null)},null,null,100);e.attachListener(l,"dragend",g);e.attachListener(a,"dragend",b.initDragDataTransfer,b,null,1);e.attachListener(a,"dragend",b.resetDragDataTransfer,b,null,100);e.attachListener(l,"dragover",function(a){if(CKEDITOR.env.edge)a.data.preventDefault();else{var b=a.data.getTarget();b&&b.is&&b.is("html")?a.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&a.data.$.dataTransfer.types.contains("Files")&& +a.data.preventDefault()}});e.attachListener(l,"drop",function(c){if(!c.data.$.defaultPrevented&&(c.data.preventDefault(),!a.readOnly)){var d=c.data.getTarget();if(!d.isReadOnly()||d.type==CKEDITOR.NODE_ELEMENT&&d.is("html")){var d=b.getRangeAtDropPosition(c,a),e=b.dragRange;d&&g(c,e,d)}}},null,null,9999);e.attachListener(a,"drop",b.initDragDataTransfer,b,null,1);e.attachListener(a,"drop",function(h){if(h=h.data){var e=h.dropRange,p=h.dragRange,k=h.dataTransfer;k.getTransferType(a)==CKEDITOR.DATA_TRANSFER_INTERNAL? +setTimeout(function(){b.internalDrop(p,e,k,a)},0):k.getTransferType(a)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?c(p,e,k):d(e,k)}},null,null,9999)})}var r;CKEDITOR.plugins.add("clipboard",{requires:"dialog,notification,toolbar",_supportedFileMatchers:[],init:function(a){function b(b){return a.config.clipboard_handleImages?-1!==CKEDITOR.tools.indexOf(["image/png","image/jpeg","image/gif"],b.type):!1}function c(b){return CKEDITOR.tools.array.some(a.plugins.clipboard._supportedFileMatchers,function(a){return a(b)})} +function d(b){b.length&&(b=CKEDITOR.tools.array.unique(b),b=CKEDITOR.tools.array.filter(b,function(a){return!!CKEDITOR.tools.trim(a)}),b=g(b.join(", ")),a.showNotification(b,"info",a.config.clipboard_notificationDuration))}function g(b){return b?a.lang.clipboard.fileFormatNotSupportedNotification.replace(/\${formats\}/g,"\x3cem\x3e"+b+"\x3c/em\x3e"):a.lang.clipboard.fileWithoutFormatNotSupportedNotification}function f(a,b){return CKEDITOR.env.ie&&a.data.fileTransferCancel||!(CKEDITOR.env.ie||b&&v!== +b.id)?!1:b.isFileTransfer()&&1===b.getFilesCount()}var e,l=C(a);a.config.forcePasteAsPlainText?e="plain-text":a.config.pasteFilter?e=a.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in a.config||(e="semantic-content");a.pasteFilter=l.get(e);y(a);E(a);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));var q=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||CKEDITOR.plugins.clipboard.isFileApiSupported,v;CKEDITOR.plugins.clipboard.addFileMatcher(a,b);a.on("paste", +function(a){if(q){var b=a.data;a=b.dataTransfer;if(!b.dataValue){for(var b=[],e=0;e <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g,"\x26nbsp;\x26nbsp; \x26nbsp;")})),-1/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var d,e,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);1==f.getChildCount()&&(d=f.getFirst())&&d.type==CKEDITOR.NODE_ELEMENT&&(d.hasClass("cke_editable")||d.hasClass("cke_contents"));)f=e=d;e&&(b=e.getHtml().replace(/
$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,d){return d.toLowerCase()in c?(a.data.preSniffing= +"html","\x3c"+d):b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)>


<\/div>$/,function(b,d){return d in c?(a.data.endsWithEOL=1,"\x3c/"+d+"\x3e"):b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)
$/,"$1"));a.data.dataValue=b},null,null,3);a.on("paste",function(b){b=b.data;var c=a._.nextPasteType||b.type,d=b.dataValue,e,f=a.config.clipboard_defaultContentType||"html",g=b.dataTransfer.getTransferType(a)==CKEDITOR.DATA_TRANSFER_EXTERNAL,q=!0===a.config.forcePasteAsPlainText;e="html"==c||"html"==b.preSniffing? +"html":z(d);delete a._.nextPasteType;"htmlifiedtext"==e&&(d=A(a.config,d));if("text"==c&&"html"==e)d=x(a,d,l.get("plain-text"));else if(g&&a.pasteFilter&&!b.dontFilter||q)d=x(a,d,a.pasteFilter);b.startsWithEOL&&(d='\x3cbr data-cke-eol\x3d"1"\x3e'+d);b.endsWithEOL&&(d+='\x3cbr data-cke-eol\x3d"1"\x3e');"auto"==c&&(c="html"==e||"html"==f?"html":"text");b.type=c;b.dataValue=d;delete b.preSniffing;delete b.startsWithEOL;delete b.endsWithEOL},null,null,6);a.on("paste",function(b){b=b.data;b.dataValue&& +(a.insertHtml(b.dataValue,b.type,b.range),setTimeout(function(){a.fire("afterPaste")},0))},null,null,1E3);a.on("pasteDialog",function(b){setTimeout(function(){a.openDialog("paste",b.data)},0)})}});CKEDITOR.plugins.clipboard={addFileMatcher:function(a,b){a.plugins.clipboard._supportedFileMatchers.push(b)},isCustomCopyCutSupported:CKEDITOR.env.ie&&16>CKEDITOR.env.version||CKEDITOR.env.iOS&&605>CKEDITOR.env.version?!1:!0,isCustomDataTypesSupported:!CKEDITOR.env.ie||16<=CKEDITOR.env.version,isFileApiSupported:!CKEDITOR.env.ie|| +9CKEDITOR.env.version||b.isInline()?b:a.document},fixSplitNodesAfterDrop:function(a,b,c,d){function g(a,c,d){var f=a;f.type==CKEDITOR.NODE_TEXT&&(f=a.getParent());if(f.equals(c)&&d!=c.getChildCount())return a=b.startContainer.getChild(b.startOffset-1),c=b.startContainer.getChild(b.startOffset),a&&a.type==CKEDITOR.NODE_TEXT&&c&&c.type==CKEDITOR.NODE_TEXT&& +(d=a.getLength(),a.setText(a.getText()+c.getText()),c.remove(),b.setStart(a,d),b.collapse(!0)),!0}var f=b.startContainer;"number"==typeof d&&"number"==typeof c&&f.type==CKEDITOR.NODE_ELEMENT&&(g(a.startContainer,f,c)||g(a.endContainer,f,d))},isDropRangeAffectedByDragRange:function(a,b){var c=b.startContainer,d=b.endOffset;return a.endContainer.equals(c)&&a.endOffset<=d||a.startContainer.getParent().equals(c)&&a.startContainer.getIndex()CKEDITOR.env.version&&this.fixSplitNodesAfterDrop(a,b,g.dragStartContainerChildCount,g.dragEndContainerChildCount);(l=this.isDropRangeAffectedByDragRange(a,b))||(e=a.createBookmark(!1));g=b.clone().createBookmark(!1);l&&(e=a.createBookmark(!1));a=e.startNode;b=e.endNode;l=g.startNode;b&&a.getPosition(l)&CKEDITOR.POSITION_PRECEDING&& +b.getPosition(l)&CKEDITOR.POSITION_FOLLOWING&&l.insertBefore(a);a=d.createRange();a.moveToBookmark(e);f.extractHtmlFromRange(a,1);b=d.createRange();g.startNode.getCommonAncestor(f)||(g=d.getSelection().createBookmarks()[0]);b.moveToBookmark(g);t(d,{dataTransfer:c,method:"drop",range:b},1);d.fire("unlockSnapshot")},getRangeAtDropPosition:function(a,b){var c=a.data.$,d=c.clientX,g=c.clientY,f=b.getSelection(!0).getRanges()[0],e=b.createRange();if(a.data.testRange)return a.data.testRange;if(document.caretRangeFromPoint&& +b.document.$.caretRangeFromPoint(d,g))c=b.document.$.caretRangeFromPoint(d,g),e.setStart(CKEDITOR.dom.node(c.startContainer),c.startOffset),e.collapse(!0);else if(c.rangeParent)e.setStart(CKEDITOR.dom.node(c.rangeParent),c.rangeOffset),e.collapse(!0);else{if(CKEDITOR.env.ie&&8q&&!l;q++){if(!l)try{c.moveToPoint(d,g-q),l=!0}catch(r){}if(!l)try{c.moveToPoint(d, +g+q),l=!0}catch(h){}}if(l){var m="cke-temp-"+(new Date).getTime();c.pasteHTML('\x3cspan id\x3d"'+m+'"\x3e​\x3c/span\x3e');var p=b.document.getById(m);e.moveToPosition(p,CKEDITOR.POSITION_BEFORE_START);p.remove()}else{var k=b.document.$.elementFromPoint(d,g),n=new CKEDITOR.dom.element(k),u;if(n.equals(b.editable())||"html"==n.getName())return f&&f.startContainer&&!f.startContainer.equals(b.editable())?f:null;u=n.getClientRect();d/i,fragmentRegExp:/\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g,types:[],data:{},files:[],nativeHtmlCache:"",normalizeType:function(a){a=a.toLowerCase();return"text"==a||"text/plain"==a?"Text":"url"==a?"URL":"files"===a?"Files":a}};this._.fallbackDataTransfer=new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);this.id=this.getData(r);this.id||(this.id="Text"==r?"":"cke-"+CKEDITOR.tools.getUniqueId());b&&(this.sourceEditor= +b,this.setData("text/html",b.getSelectedHtml(1)),"Text"==r||this.getData("text/plain")||this.setData("text/plain",b.getSelection().getSelectedText()))};CKEDITOR.DATA_TRANSFER_INTERNAL=1;CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2;CKEDITOR.DATA_TRANSFER_EXTERNAL=3;CKEDITOR.plugins.clipboard.dataTransfer.prototype={getData:function(a,b){a=this._.normalizeType(a);var c="text/html"==a&&b?this._.nativeHtmlCache:this._.data[a];if(void 0===c||null===c||""===c){if(this._.fallbackDataTransfer.isRequired())c=this._.fallbackDataTransfer.getData(a, +b);else try{c=this.$.getData(a)||""}catch(d){c=""}"text/html"!=a||b||(c=this._stripHtml(c))}"Text"==a&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==c.substring(0,7)&&(c="");if("string"===typeof c)var g=c.indexOf("\x3c/html\x3e"),c=-1!==g?c.substring(0,g+7):c;return c},setData:function(a,b){a=this._.normalizeType(a);"text/html"==a?(this._.data[a]=this._stripHtml(b),this._.nativeHtmlCache=b):this._.data[a]=b;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==a||"Text"==a)if("Text"== +r&&"Text"==a&&(this.id=b),this._.fallbackDataTransfer.isRequired())this._.fallbackDataTransfer.setData(a,b);else try{this.$.setData(a,b)}catch(c){}},storeId:function(){"Text"!==r&&this.setData(r,this.id)},getTransferType:function(a){return this.sourceEditor?this.sourceEditor==a?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function a(a){a=b._.normalizeType(a);var c=b.getData(a);"text/html"==a&&(b._.nativeHtmlCache=b.getData(a, +!0),c=b._stripHtml(c));c&&(b._.data[a]=c);b._.types.push(a)}if(this.$){var b=this,c,d,g;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(c=0;c$/gi,"")}a&&a.length&&(a=b(a),a=a.replace(this._.metaRegExp,""),a=a.replace(this._.fragmentRegExp,"")); +return a}};CKEDITOR.plugins.clipboard.fallbackDataTransfer=function(a){this._dataTransfer=a;this._customDataFallbackType="text/html"};CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported=null;CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes=[];CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype={isRequired:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer,b=this._dataTransfer.$;if(null===a._isCustomMimeTypeSupported)if(b){a._isCustomMimeTypeSupported= +!1;if(CKEDITOR.env.edge&&17<=CKEDITOR.env.version)return!0;try{b.setData("cke/mimetypetest","cke test value"),a._isCustomMimeTypeSupported="cke test value"===b.getData("cke/mimetypetest"),b.clearData("cke/mimetypetest")}catch(c){}}else return!1;return!a._isCustomMimeTypeSupported},getData:function(a,b){var c=this._getData(this._customDataFallbackType,!0);if(b)return c;var c=this._extractDataComment(c),d=null,d=a===this._customDataFallbackType?c.content:c.data&&c.data[a]?c.data[a]:this._getData(a, +!0);return null!==d?d:""},setData:function(a,b){var c=a===this._customDataFallbackType;c&&(b=this._applyDataComment(b,this._getFallbackTypeData()));var d=b,g=this._dataTransfer.$;try{g.setData(a,d),c&&(this._dataTransfer._.nativeHtmlCache=d)}catch(f){if(this._isUnsupportedMimeTypeError(f)){c=CKEDITOR.plugins.clipboard.fallbackDataTransfer;-1===CKEDITOR.tools.indexOf(c._customTypes,a)&&c._customTypes.push(a);var c=this._getFallbackTypeContent(),e=this._getFallbackTypeData();e[a]=d;try{d=this._applyDataComment(c, +e),g.setData(this._customDataFallbackType,d),this._dataTransfer._.nativeHtmlCache=d}catch(l){d=""}}}return d},_getData:function(a,b){var c=this._dataTransfer._.data;if(!b&&c[a])return c[a];try{return this._dataTransfer.$.getData(a)}catch(d){return null}},_getFallbackTypeContent:function(){var a=this._dataTransfer._.data[this._customDataFallbackType];a||(a=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).content);return a},_getFallbackTypeData:function(){var a=CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes, +b=this._extractDataComment(this._getData(this._customDataFallbackType,!0)).data||{},c=this._dataTransfer._.data;CKEDITOR.tools.array.forEach(a,function(a){void 0!==c[a]?b[a]=c[a]:void 0!==b[a]&&(b[a]=b[a])},this);return b},_isUnsupportedMimeTypeError:function(a){return a.message&&-1!==a.message.search(/element not found/gi)},_extractDataComment:function(a){var b={data:null,content:a||""};if(a&&16((?:.|[\n\r])*?)<\/body>/i,f=a.config.fullPage,a=a.getData();f&&(d=a.match(d))&&1((?:.|[\n\r])*?)<\/body>/i,g=b.config.fullPage,b=b.getData();g&&(f=b.match(f))&&1c.width&&(a.resize_minWidth=c.width);a.resize_minHeight>c.height&&(a.resize_minHeight=c.height);CKEDITOR.document.on("mousemove",f);CKEDITOR.document.on("mouseup",k);b.document&&(b.document.on("mousemove",f),b.document.on("mouseup",k));d.preventDefault&&d.preventDefault()});b.on("destroy", function(){CKEDITOR.tools.removeFunction(q)});b.on("uiSpace",function(a){if("bottom"==a.data.space){var e="";h&&!p&&(e=" cke_resizer_horizontal");!h&&p&&(e=" cke_resizer_vertical");var c='\x3cspan id\x3d"'+r+'" class\x3d"cke_resizer'+e+" cke_resizer_"+g+'" title\x3d"'+CKEDITOR.tools.htmlEncode(b.lang.common.resize)+'" onmousedown\x3d"CKEDITOR.tools.callFunction('+q+', event)"\x3e'+("ltr"==g?"◢":"◣")+"\x3c/span\x3e";"ltr"==g&&"ltr"==e?a.data.html+=c:a.data.html=c+a.data.html}},b,null,100);b.on("maximize", function(a){b.ui.space("resizer")[a.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}});(function(){function q(a,c){function k(b){b=h.list[b];var e;b.equals(a.editable())||"true"==b.getAttribute("contenteditable")?(e=a.createRange(),e.selectNodeContents(b),e=e.select()):(e=a.getSelection(),e.selectElement(b));CKEDITOR.env.ie&&a.fire("selectionChange",{selection:e,path:new CKEDITOR.dom.elementPath(b)});a.focus()}function l(){m&&m.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');delete h.list}var n=a.ui.spaceId("path"),m,h=a._.elementsPath,q=h.idBase;c.html+='\x3cspan id\x3d"'+ n+'_label" class\x3d"cke_voice_label"\x3e'+a.lang.elementspath.eleLabel+'\x3c/span\x3e\x3cspan id\x3d"'+n+'" class\x3d"cke_path" role\x3d"group" aria-labelledby\x3d"'+n+'_label"\x3e\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e\x3c/span\x3e';a.on("uiReady",function(){var b=a.ui.space("path");b&&a.focusManager.add(b,1)});h.onClick=k;var v=CKEDITOR.tools.addFunction(k),w=CKEDITOR.tools.addFunction(function(b,e){var g=h.idBase,d;e=new CKEDITOR.dom.event(e);d="rtl"==a.lang.dir;switch(e.getKeystroke()){case d? -39:37:case 9:return(d=CKEDITOR.document.getById(g+(b+1)))||(d=CKEDITOR.document.getById(g+"0")),d.focus(),!1;case d?37:39:case CKEDITOR.SHIFT+9:return(d=CKEDITOR.document.getById(g+(b-1)))||(d=CKEDITOR.document.getById(g+(h.list.length-1))),d.focus(),!1;case 27:return a.focus(),!1;case 13:case 32:return k(b),!1}return!0});a.on("selectionChange",function(b){for(var e=[],g=h.list=[],d=[],c=h.filters,p=!0,k=b.data.path.elements,u=k.length;u--;){var f=k[u],r=0;b=f.data("cke-display-name")?f.data("cke-display-name"): -f.data("cke-real-element-type")?f.data("cke-real-element-type"):f.getName();(p=f.hasAttribute("contenteditable")?"true"==f.getAttribute("contenteditable"):p)||f.hasAttribute("contenteditable")||(r=1);for(var t=0;tCKEDITOR.env.version?n.createText("\r"):n.createElement("br"),b.deleteContents(),b.insertNode(a),CKEDITOR.env.needsBrFiller?(n.createText("").insertAfter(a),g&&(k||f.blockLimit).appendBogus(),a.getNext().$.nodeValue="",b.setStartAt(a.getNext(), CKEDITOR.POSITION_AFTER_START)):b.setStartAt(a,CKEDITOR.POSITION_AFTER_END)),b.collapse(!0),b.select(),b.scrollIntoView()):r(a,e,b,l)}}};v=CKEDITOR.plugins.enterkey;u=v.enterBr;r=v.enterBlock;w=/^h[1-6]$/})();(function(){function k(a,f){var g={},c=[],e={nbsp:" ",shy:"­",gt:"\x3e",lt:"\x3c",amp:"\x26",apos:"'",quot:'"'};a=a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(a,b){var d=f?"\x26"+b+";":e[b];g[d]=f?e[b]:"\x26"+b+";";c.push(d);return""});a=a.replace(/,$/,"");if(!f&&a){a=a.split(",");var b=document.createElement("div"),d;b.innerHTML="\x26"+a.join(";\x26")+";";d=b.innerHTML;b=null;for(b=0;bh.height-c.bottom?e("pin"):e("bottom"),d=h.width/2,d=l.floatSpacePreferRight?"right":0n.width?"rtl"==l.contentsLangDirection? "right":"left":d-c.left>c.right-d?"left":"right",n.width>h.width?(d="left",f=0):(f="left"==d?0h.width&&(d="left"==d?"right":"left",f=0)),b.setStyle(d,w(("pin"==m?u:p)+f+("pin"==m?0:"left"==d?v:-v)))):(m="pin",e("pin"),t(d))}}}();if(p){var k=new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir\x3d"{langDir}" title\x3d"'+(CKEDITOR.env.gecko? -" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.title?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.title?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({content:p,id:a.id,langDir:a.lang.dir, -langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(l.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),u=CKEDITOR.tools.eventsBuffer(500,t),e=CKEDITOR.tools.eventsBuffer(100,t);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){t(b);a.on("change",u.input);g.on("scroll",e.input);g.on("resize",e.input)});a.on("blur",function(){b.hide();a.removeListener("change",u.input);g.removeListener("scroll", -e.input);g.removeListener("resize",e.input)});a.on("destroy",function(){g.removeListener("scroll",e.input);g.removeListener("resize",e.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var g=CKEDITOR.document.getWindow(),w=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(a){a.on("loaded",function(){k(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var f=CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),g=CKEDITOR.addTemplate("panel-list-item",'\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" draggable\x3d"false" ondragstart\x3d"return false;" href\x3d"javascript:void(\'{val}\')" onclick\x3d"{onclick}CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'), -h=CKEDITOR.addTemplate("panel-list-group",'\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),k=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,b){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),b))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,b){b=b||{};var c=b.attributes||(b.attributes={});(this.multiSelect=!!b.multiSelect)&& -(c["aria-multiselectable"]=!0);!c.role&&(c.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",c.role);c=this.keys;c[40]="next";c[9]="next";c[38]="prev";c[CKEDITOR.SHIFT+9]="prev";c[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(c[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var a=f.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(a); -delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var b=this.toggle(a);if(this.onClick)this.onClick(a,b)},this));return this._.click}},proto:{add:function(a,b,c){var d=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=d;var e;e=CKEDITOR.tools.htmlEncodeAttr(a).replace(k,"\\'");a={id:d,val:e,onclick:CKEDITOR.env.ie?'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26': -"",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(c||a),text:b||a};this._.pendingList.push(g.output(a))},startGroup:function(a){this._.close();var b=CKEDITOR.tools.getNextId();this._.groups[a]=b;this._.pendingHtml.push(h.output({id:b,label:a}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(a){var b=this.isMarked(a);b?this.unmark(a):this.mark(a);return!b},hideGroup:function(a){var b=(a= -this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display","none"),b&&"ul"==b.getName()&&b.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,b=this._.groups,c=this.element.getDocument(),d;for(d in a)c.getById(a[d]).setStyle("display","");for(var e in b)a=c.getById(b[e]),d=a.getNext(),a.setStyle("display",""),d&&"ul"==d.getName()&&d.setStyle("display", -"")},mark:function(a){this.multiSelect||this.unmarkAll();a=this._.items[a];var b=this.element.getDocument().getById(a);b.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(b)},markFirstDisplayed:function(){var a=this;this._.markFirstDisplayed(function(){a.multiSelect||a.unmarkAll()})},unmark:function(a){var b=this.element.getDocument();a=this._.items[a];var c=b.getById(a);c.removeClass("cke_selected");b.getById(a+"_option").removeAttribute("aria-selected"); -this.onUnmark&&this.onUnmark(c)},unmarkAll:function(){var a=this._.items,b=this.element.getDocument(),c;for(c in a){var d=a[c];b.getById(d).removeClass("cke_selected");b.getById(d+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var b=this.element.getElementsByTag("a"),c,d=-1;if(a)for(c=this.element.getDocument().getById(this._.items[a]).getFirst();a= -b.getItem(++d);){if(a.equals(c)){this._.focusIndex=d;break}}else this.element.focus();c&&setTimeout(function(){c.focus()},0)}}})}});CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}}); +" ":"")+'" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"'+(a.applicationTitle?' aria-labelledby\x3d"cke_{name}_arialbl"':" ")+"\x3e"+(a.applicationTitle?'\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e':" ")+'\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({content:p, +id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(l.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.applicationTitle}))),u=CKEDITOR.tools.eventsBuffer(500,t),e=CKEDITOR.tools.eventsBuffer(100,t);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){t(b);a.on("change",u.input);g.on("scroll",e.input);g.on("resize",e.input)});a.on("blur",function(){b.hide();a.removeListener("change", +u.input);g.removeListener("scroll",e.input);g.removeListener("resize",e.input)});a.on("destroy",function(){g.removeListener("scroll",e.input);g.removeListener("resize",e.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var g=CKEDITOR.document.getWindow(),w=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(a){a.on("loaded",function(){k(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var g=CKEDITOR.addTemplate("panel-list",'\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),h=CKEDITOR.addTemplate("panel-list-item",'\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" draggable\x3d"false" ondragstart\x3d"return false;" href\x3d"javascript:void(\'{val}\')" {language} onclick\x3d"{onclick}CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'), +k=CKEDITOR.addTemplate("panel-list-group",'\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),l=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,b){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),b))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,b){b=b||{};var c=b.attributes||(b.attributes={});(this.multiSelect=!!b.multiSelect)&& +(c["aria-multiselectable"]=!0);!c.role&&(c.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",c.role);c=this.keys;c[40]="next";c[9]="next";c[38]="prev";c[CKEDITOR.SHIFT+9]="prev";c[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(c[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var a=g.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(a); +delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var b=this.toggle(a);if(this.onClick)this.onClick(a,b)},this));return this._.click}},proto:{add:function(a,b,c,d){var e=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=e;var f;f=CKEDITOR.tools.htmlEncodeAttr(a).replace(l,"\\'");a={id:e,val:f,onclick:CKEDITOR.env.ie?'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26': +"",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(c||a),text:b||a,language:d?'lang\x3d"'+d+'"':""};this._.pendingList.push(h.output(a))},startGroup:function(a){this._.close();var b=CKEDITOR.tools.getNextId();this._.groups[a]=b;this._.pendingHtml.push(k.output({id:b,label:a}))},commit:function(){this._.close();this.element.appendHtml(this._.pendingHtml.join(""));delete this._.size;this._.pendingHtml=[]},toggle:function(a){var b=this.isMarked(a);b?this.unmark(a):this.mark(a);return!b}, +hideGroup:function(a){var b=(a=this.element.getDocument().getById(this._.groups[a]))&&a.getNext();a&&(a.setStyle("display","none"),b&&"ul"==b.getName()&&b.setStyle("display","none"))},hideItem:function(a){this.element.getDocument().getById(this._.items[a]).setStyle("display","none")},showAll:function(){var a=this._.items,b=this._.groups,c=this.element.getDocument(),d;for(d in a)c.getById(a[d]).setStyle("display","");for(var e in b)a=c.getById(b[e]),d=a.getNext(),a.setStyle("display",""),d&&"ul"== +d.getName()&&d.setStyle("display","")},mark:function(a){this.multiSelect||this.unmarkAll();a=this._.items[a];var b=this.element.getDocument().getById(a);b.addClass("cke_selected");this.element.getDocument().getById(a+"_option").setAttribute("aria-selected",!0);this.onMark&&this.onMark(b)},unmark:function(a){var b=this.element.getDocument();a=this._.items[a];var c=b.getById(a);c.removeClass("cke_selected");b.getById(a+"_option").removeAttribute("aria-selected");this.onUnmark&&this.onUnmark(c)},unmarkAll:function(){var a= +this._.items,b=this.element.getDocument(),c;for(c in a){var d=a[c];b.getById(d).removeClass("cke_selected");b.getById(d+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(a){return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")},focus:function(a){this._.focusIndex=-1;var b=this.element.getElementsByTag("a"),c,d=-1;if(a)for(c=this.element.getDocument().getById(this._.items[a]).getFirst();a=b.getItem(++d);){if(a.equals(c)){this._.focusIndex= +d;break}}else this.element.focus();c&&setTimeout(function(){c.focus()},0)}}})}});CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}}); (function(){var e='\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href\x3d\"javascript:void('{titleJs}')\"")+' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"listbox"',h="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress\x3d"return false;"'); CKEDITOR.env.gecko&&(e+=' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');CKEDITOR.env.ie&&(h='return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26');var e=e+(' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"'+h+'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e'+ (CKEDITOR.env.hc?"\x26#9660;":CKEDITOR.env.air?"\x26nbsp;":"")+"\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),m=CKEDITOR.addTemplate("combo",e);CKEDITOR.UI_RICHCOMBO="richcombo";CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(a){CKEDITOR.tools.extend(this,a,{canGroup:!1,title:a.label,modes:{wysiwyg:1},editorFocus:1});a=this.panel||{};delete this.panel;this.id=CKEDITOR.tools.getNextNumber();this.document=a.parent&&a.parent.getDocument()||CKEDITOR.document;a.className="cke_combopanel"; @@ -982,7 +989,7 @@ c,this));this._.listeners.push(a.on("mode",c,this));this._.listeners.push(a.on(" label:this.label,title:this.title,cls:this.className||"",titleJs:l.gecko&&!l.hc?"":(this.title||"").replace("'",""),keydownFn:h,focusFn:n,clickFn:e};m.output(l,b);if(this.onRender)this.onRender();return g},createPanel:function(a){if(!this._.panel){var b=this._.panelDefinition,c=this._.panelDefinition.block,e=b.parent||CKEDITOR.document.getBody(),g="cke_combopanel__"+this.name,f=new CKEDITOR.ui.floatPanel(a,e,b),b=f.addListBlock(this.id,c),d=this;f.onShow=function(){this.element.addClass(g);d.setState(CKEDITOR.TRISTATE_ON); d._.on=1;d.editorFocus&&!a.focusManager.hasFocus&&a.focus();if(d.onOpen)d.onOpen()};f.onHide=function(b){this.element.removeClass(g);d.setState(d.modes&&d.modes[a.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);d._.on=0;if(!b&&d.onClose)d.onClose()};f.onEscape=function(){f.hide(1)};b.onClick=function(a,b){d.onClick&&d.onClick.call(d,a,b);f.hide()};this._.panel=f;this._.list=b;f.getBlock(this.id).onHide=function(){d._.on=0;d.setState(CKEDITOR.TRISTATE_OFF)};this.init&&this.init()}},setValue:function(a, b){this._.value=a;var c=this.document.getById("cke_"+this.id+"_text");c&&(a||b?c.removeClass("cke_combo_inlinelabel"):(b=this.label,c.addClass("cke_combo_inlinelabel")),c.setText("undefined"!=typeof b?b:a));var c="undefined"!=typeof b?b:a,e=this.label,c=c===e?c:c+", "+e;(e=this.document.getById("cke_"+this.id+"_label"))&&e.setText(c)},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(a){this._.list.mark(a)},hideItem:function(a){this._.list.hideItem(a)}, -hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,b,c){this._.items[a]=c||a;this._.list.add(a,b,c)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(a){if(this._.state!=a){var b=this.document.getById("cke_"+this.id),c=b.getElementsByTag("a").getItem(0);b.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED? +hideGroup:function(a){this._.list.hideGroup(a)},showAll:function(){this._.list.showAll()},add:function(a,b,c,e){this._.items[a]=c||a;this._.list.add(a,b,c,e)},startGroup:function(a){this._.list.startGroup(a)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this));this._.committed=1},setState:function(a){if(this._.state!=a){var b=this.document.getById("cke_"+this.id),c=b.getElementsByTag("a").getItem(0);b.setState(a,"cke_combo");a==CKEDITOR.TRISTATE_DISABLED? b.setAttribute("aria-disabled",!0):b.removeAttribute("aria-disabled");c&&c.setAttribute("aria-expanded",a==CKEDITOR.TRISTATE_ON);this._.state=a}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))},destroy:function(){CKEDITOR.tools.array.forEach(this._.listeners,function(a){a.removeListener()}); this._.listeners=[]},select:function(a){if(!CKEDITOR.tools.isEmpty(this._.items))for(var b in this._.items)if(a({value:b,text:this._.items[b]})){this.setValue(b);break}}},statics:{handler:{create:function(a){return new CKEDITOR.ui.richCombo(a)}}}});CKEDITOR.ui.prototype.addRichCombo=function(a,b){this.add(a,CKEDITOR.UI_RICHCOMBO,b)}})();(function(){function k(a,b){var c=a.config,e=b.lang,d=new CKEDITOR.style(b.styleDefinition),f=new l({entries:b.entries,styleVariable:b.styleVariable,styleDefinition:b.styleDefinition}),g;a.addCommand(b.commandName,{exec:function(a,b){var c=b.newStyle,d=b.oldStyle,e=a.getSelection().getRanges()[0],f=void 0===c;if(d||c)d&&e.collapsed&&m({editor:a,range:e,style:d}),f?a.removeStyle(d):(d&&!n(d,c)&&a.removeStyle(d),a.applyStyle(c))},refresh:function(a,b){d.checkApplicable(b,a,a.activeFilter)||this.setState(CKEDITOR.TRISTATE_DISABLED)}}); g=a.getCommand(b.commandName);a.ui.addRichCombo(b.comboName,{label:e.label,title:e.panelTitle,command:b.commandName,toolbar:"styles,"+b.order,defaultValue:"cke-default",allowedContent:d,requiredContent:d,contentTransformations:"span"===b.styleDefinition.element?[[{element:"font",check:"span",left:function(a){return!!a.attributes.size||!!a.attributes.align||!!a.attributes.face},right:function(a){var b=" x-small small medium large x-large xx-large 48px".split(" ");a.name="span";a.attributes.size&&(a.styles["font-size"]= @@ -1015,27 +1022,29 @@ b.$block&&!(a in{li:1,dt:1,dd:1})});this.setRules("br",{breakAfterOpen:1});this. openTagClose:function(b,a){var c=this._.rules[b];a?(this._.output.push(this.selfClosingEnd),c&&c.breakAfterClose&&(this._.needsSpace=c.needsSpace)):(this._.output.push("\x3e"),c&&c.indent&&(this._.indentation+=this.indentationChars));c&&c.breakAfterOpen&&this.lineBreak();"pre"==b&&(this._.inPre=1)},attribute:function(b,a){"string"==typeof a&&(a=CKEDITOR.tools.htmlEncodeAttr(a),this.forceSimpleAmpersand&&(a=a.replace(/&/g,"\x26")));this._.output.push(" ",b,'\x3d"',a,'"')},closeTag:function(b){var a= this._.rules[b];a&&a.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length));this._.indent?this.indentation():a&&a.breakBeforeClose&&(this.lineBreak(),this.indentation());this._.output.push("\x3c/",b,"\x3e");"pre"==b&&(this._.inPre=0);a&&a.breakAfterClose&&(this.lineBreak(),this._.needsSpace=a.needsSpace);this._.afterCloser=1},text:function(b){this._.indent&&(this.indentation(),!this._.inPre&&(b=CKEDITOR.tools.ltrim(b)));this._.output.push(b)},comment:function(b){this._.indent&& this.indentation();this._.output.push("\x3c!--",b,"--\x3e")},lineBreak:function(){!this._.inPre&&0CKEDITOR.env.version&&b.enterMode!=CKEDITOR.ENTER_DIV&&d("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10this.$.offsetHeight){var d=b.createRange();d[33==c?"moveToElementEditStart":"moveToElementEditEnd"](this);d.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(c,"blur",function(){try{c.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(c,"touchend",function(){a.focus()});e=b.document.getElementsByTag("title").getItem(0); -e.data("cke-title",e.getText());CKEDITOR.env.ie&&(b.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");b.fire("contentDom");this._.isPendingFocus&&(b.focus(),this._.isPendingFocus=!1);setTimeout(function(){b.fire("dataReady")},0)},0,this)}}function w(a){function d(){var c;a.editable().attachListener(a,"selectionChange",function(){var d=a.getSelection().getSelectedElement();d&&(c&&(c.detachEvent("onresizestart",b),c=null),d.$.attachEvent("onresizestart", -b),c=d.$)})}function b(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var c=a.document.$;c.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);c.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(e){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&d()}function x(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");var d=[],b;for(b in CKEDITOR.dtd.$removeEmpty)d.push("html.CSS1Compat "+ -b+"[contenteditable\x3dfalse]");a.push(d.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}var l;CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]", -requiredContent:"body"});a.addMode("wysiwyg",function(d){function b(b){b&&b.removeListener();if(!a.isDestroyed()&&!a.isDetached()&&(a.editable(new l(a,g.getFrameDocument().getBody())),a.setData(a.getData(1),d),t)){if(u)a.on("mode",c,{iframe:g,editor:a,callback:d});a.on("mode",function(){a.status="ready"});e()}}function c(a){a&&a.removeListener();g.on("load",function(){p&&(p=!1,f())})}function e(){m=new MutationObserver(function(b){for(var c=0;cCKEDITOR.env.version&&b.enterMode!=CKEDITOR.ENTER_DIV&&e("div");if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10this.$.offsetHeight){var c=b.createRange();c[33==d?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(c,"blur",function(){try{c.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(c,"touchend",function(){a.focus()});f=b.document.getElementsByTag("title").getItem(0); +f.data("cke-title",f.getText());CKEDITOR.env.ie&&(b.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready");b.fire("contentDom");this._.isPendingFocus&&(b.focus(),this._.isPendingFocus=!1);setTimeout(function(){b.fire("dataReady")},0)},0,this)}}function w(a){function e(){var d;a.editable().attachListener(a,"selectionChange",function(){var c=a.getSelection().getSelectedElement();c&&(d&&(d.detachEvent("onresizestart",b),d=null),c.$.attachEvent("onresizestart", +b),d=c.$)})}function b(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var c=a.document.$;c.execCommand("enableObjectResizing",!1,!a.config.disableObjectResizing);c.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(f){}else CKEDITOR.env.ie&&11>CKEDITOR.env.version&&a.config.disableObjectResizing&&e()}function x(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");var e=[],b;for(b in CKEDITOR.dtd.$removeEmpty)e.push("html.CSS1Compat "+ +b+"[contenteditable\x3dfalse]");a.push(e.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}var l;CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]", +requiredContent:"body"});a.addMode("wysiwyg",function(e){function b(b){b&&b.removeListener();if(!a.isDestroyed()&&!a.isDetached()&&(a.editable(new l(a,g.getFrameDocument().getBody())),a.setData(a.getData(1),e),t)){if(u)a.on("mode",c,{iframe:g,editor:a,callback:e});a.on("mode",function(){a.status="ready"});f()}}function c(a){a&&a.removeListener();g.on("load",function(){p&&(p=!1,d())})}function f(){m=new MutationObserver(function(b){for(var c=0;c/,'\x3cstyle data-cke-temp\x3d"1"\x3e');e||(h+=CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));var g=c.baseHref?'\x3cbase href\x3d"'+c.baseHref+'" data-cke-temp\x3d"1" /\x3e':"";e&&(a=a.replace(/]*>/i,function(a){b.docType=f=a;return""}).replace(/<\?xml\s[^\?]*\?>/i, -function(a){b.xmlDeclaration=a;return""}));a=b.dataProcessor.toHtml(a);e?(/]/.test(a)||(a="\x3cbody\x3e"+a),/]/.test(a)||(a="\x3chtml\x3e"+a+"\x3c/html\x3e"),/]/.test(a)?/]/.test(a)||(a=a.replace(/]*>/,"$\x26\x3ctitle\x3e\x3c/title\x3e")):a=a.replace(/]*>/,"$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),g&&(a=a.replace(/]*?>/,"$\x26"+g)),a=a.replace(/<\/head\s*>/,h+"$\x26"),a=f+a):a=c.docType+'\x3chtml dir\x3d"'+c.contentsLangDirection+ -'" lang\x3d"'+(c.contentsLanguage||b.langCode)+'"\x3e\x3chead\x3e\x3ctitle\x3e'+this._.docTitle+"\x3c/title\x3e"+g+h+"\x3c/head\x3e\x3cbody"+(c.bodyId?' id\x3d"'+c.bodyId+'"':"")+(c.bodyClass?' class\x3d"'+c.bodyClass+'"':"")+"\x3e"+a+"\x3c/body\x3e\x3c/html\x3e";CKEDITOR.env.gecko&&(a=a.replace(/CKEDITOR.env.version&&(a=a.replace(/]*>/,"$\x26\x3c!-- cke-content-start --\x3e")));c='\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"'+ -(CKEDITOR.env.ie?' defer\x3d"defer" ':"")+"\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR \x26\x26 window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded\x3d1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"\x3c/script\x3e";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');g&& -CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,c);this.clearCustomData();this.clearListeners();b.fire("contentDomUnload");var l=this.getDocument();try{l.write(a)}catch(k){setTimeout(function(){l.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var d=a.config,b=d.fullPage,c=b&&a.docType,e=b&&a.xmlDeclaration, -f=this.getDocument(),b=b?f.getDocumentElement().getOuterHtml():f.getBody().getHtml();CKEDITOR.env.gecko&&d.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/
(?=\s*(:?$|<\/body>))/,""));b=a.dataProcessor.toDataFormat(b);e&&(b=e+"\n"+b);c&&(b=c+"\n"+b);return b},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:l.baseProto.focus.call(this)},detach:function(){if(!this.preserveIframe){var a=this.editor,d=a.document,a=a.container.findOne("iframe.cke_wysiwyg_frame");l.baseProto.detach.call(this); -this.clearCustomData(this._.expandoNumber);d.getDocumentElement().clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);a&&(a.clearCustomData(),(d=a.removeCustomData("onResize"))&&d.removeListener(),a.isDetached()||a.remove())}}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.config.observableParent=CKEDITOR.document.$;(function(){function e(b,a){a||(a=b.getSelection().getSelectedElement());if(a&&a.is("img")&&!a.data("cke-realelement")&&!a.isReadOnly())return a}function f(b){var a=b.getStyle("float");if("inherit"==a||"none"==a)a=0;a||(a=b.getAttribute("align"));return a}CKEDITOR.plugins.add("image",{requires:"dialog",init:function(b){if(!b.plugins.detectConflict("image",["easyimage","image2"])){CKEDITOR.dialog.add("image",this.path+"dialogs/image.js");var a="img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}"; +allowTransparency:"true"});!r&&b();a.fire("ariaWidget",g)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var e=this.config,b=e.contentsCss;CKEDITOR.tools.isArray(b)||(e.contentsCss=b?[b]:[]);e.contentsCss.push(a)};l=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(a){CKEDITOR.tools.setTimeout(v,0,this,a)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")||" "},base:CKEDITOR.editable, +proto:{preserveIframe:!1,setData:function(a,e){var b=this.editor;if(e)this.setHtml(a),this.fixInitialSelection(),b.fire("dataReady");else{this._.isLoadingData=!0;b._.dataStore={id:1};var c=b.config,f=c.fullPage,d=c.docType,h=CKEDITOR.tools.buildStyleHtml(x()).replace(/'; + +$html .= ''; + +$html .= '
'; +$html .= '

Advanced Project Statistics

'; +$currentDate = date("Y-m-d H:i:s"); // Format: Year-Month-Day Hour:Minute:Second +$html .= 'Generated on '.$currentDate.''; +$html .= '
'; + +$html .= '
'; +$html .= '

Lines of code

'; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +//$html .= ''; +$html .= ''; +foreach (array('proj', 'dep') as $source) { + if ($source == 'proj') { + $html .= ''; + } elseif ($source == 'dep') { + $html .= ''; + } + foreach ($arrayoflineofcode[$source] as $key => $val) { + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + //$html .= ''; + $html .= ''; + $arrayofmetrics['Files'] += $val['Files']; + $arrayofmetrics['Lines'] += $val['Lines']; + $arrayofmetrics['Blanks'] += $val['Blanks']; + $arrayofmetrics['Comments'] += $val['Comments']; + $arrayofmetrics['Code'] += $val['Code']; + $arrayofmetrics['Complexity'] += $val['Complexity']; + } +} + +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +//$html .= ''; +$html .= ''; +$html .= '
Language'; +$html .= 'FilesLinesBlanksCommentsCode'.$val['Complexity'].'
Written by project team only:
Dependencies:
'.$key.''.$val['Files'].''.$val['Lines'].''.$val['Blanks'].''.$val['Comments'].''.$val['Code'].''.$val['Complexity'].'
Total:
'.$arrayofmetrics['Bytes'].' octets'.$arrayofmetrics['Files'].''.$arrayofmetrics['Lines'].''.$arrayofmetrics['Blanks'].''.$arrayofmetrics['Comments'].''.$arrayofmetrics['Code'].''.$arrayofmetrics['Complexity'].'
'; + +$html .= ''; + +$html .= '
'; +$html .= '

Project value:


'; +$html .= 'CODOMO (Basic model) value: $'.($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency']).'
'; +$html .= 'CODOMO (Basic model) effort: '.($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']).' Month people
'; +$html .= '
'; + +$html .= '
'; +$html .= '

Technical debt: ('.count($output_arrtd).')


'; +$html .= join('
'."\n", $output_arrtd); +$html .= '
'; + +$html .= ''; +$html .= ''; + +$fh = fopen($outputpath, 'w'); +if ($fh) { + fwrite($fh, $html); + fclose($fh); + + print 'Generation of output file '.$outputfile.' done.'."\n"; +} else { + print 'Failed to open '.$outputfile.' for ouput.'."\n"; +} diff --git a/dev/tools/src_loc.sh b/dev/tools/src_loc.sh deleted file mode 100755 index ef9861c917d..00000000000 --- a/dev/tools/src_loc.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Script to count lines of code of the project - -# Count lines of code of Dolibarr itself -#cloc . --exclude-dir=includes --ignore-whitespace --vcs=git --by-file -cloc . --exclude-dir=includes --ignore-whitespace --vcs=git - -# Count lines of code of external dependencies -cloc htdocs/includes --ignore-whitespace --vcs=git diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index be9918de34f..24b5ebafd1a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3611,10 +3611,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli } // Define urlmask - $urlmask = 'ErrorClickToDialModuleNotConfigured'; - if (!empty($conf->global->CLICKTODIAL_URL)) { - $urlmask = $conf->global->CLICKTODIAL_URL; - } + $urlmask = getDolGlobalString('CLICKTODIAL_URL', 'ErrorClickToDialModuleNotConfigured'); if (!empty($user->clicktodial_url)) { $urlmask = $user->clicktodial_url; } From 14d153923e91d483a6e983ee126c2c1a12e4e24a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2023 17:53:12 +0200 Subject: [PATCH 0574/1137] Fix phpcs --- dev/tools/apstats.php | 78 +++++++++++++++------ htdocs/langs/en_US/main.lang | 2 +- htdocs/resource/class/dolresource.class.php | 14 ++-- htdocs/stripe/class/stripe.class.php | 2 +- 4 files changed, 70 insertions(+), 26 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 585fe9be47d..63935eae760 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -110,7 +110,10 @@ exec($commandcheck, $output_arrtd, $resexectd); $arrayoflineofcode = array(); $arraycocomo = array(); -$arrayofmetrics = array('Bytes'=>0, 'Files'=>0, 'Lines'=>0, 'Blanks'=>0, 'Comments'=>0, 'Code'=>0, 'Complexity'=>0); +$arrayofmetrics = array( + 'proj'=>array('Bytes'=>0, 'Files'=>0, 'Lines'=>0, 'Blanks'=>0, 'Comments'=>0, 'Code'=>0, 'Complexity'=>0), + 'dep'=>array('Bytes'=>0, 'Files'=>0, 'Lines'=>0, 'Blanks'=>0, 'Comments'=>0, 'Code'=>0, 'Complexity'=>0) +); // Analyse $output_arrproj foreach (array('proj', 'dep') as $source) { @@ -153,6 +156,15 @@ foreach (array('proj', 'dep') as $source) { $arrayoflineofcode[$source][$reg[1]]['Complexity'] = $reg[7]; } } + + foreach ($arrayoflineofcode[$source] as $key => $val) { + $arrayofmetrics[$source]['Files'] += $val['Files']; + $arrayofmetrics[$source]['Lines'] += $val['Lines']; + $arrayofmetrics[$source]['Blanks'] += $val['Blanks']; + $arrayofmetrics[$source]['Comments'] += $val['Comments']; + $arrayofmetrics[$source]['Code'] += $val['Code']; + $arrayofmetrics[$source]['Complexity'] += $val['Complexity']; + } } @@ -165,6 +177,8 @@ $html .= ' '; $html .= ''; @@ -203,9 +235,10 @@ $html .= ''; $html .= '
'; $html .= '

Lines of code

'; -$html .= '
'; +$html .= '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; @@ -214,42 +247,47 @@ $html .= ''; //$html .= ''; $html .= ''; foreach (array('proj', 'dep') as $source) { + $html .= ''; if ($source == 'proj') { - $html .= ''; + $html .= ''; } elseif ($source == 'dep') { - $html .= ''; + $html .= ''; } + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; foreach ($arrayoflineofcode[$source] as $key => $val) { $html .= ''; $html .= ''; + $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; //$html .= ''; + $html .= ''; $html .= ''; - $arrayofmetrics['Files'] += $val['Files']; - $arrayofmetrics['Lines'] += $val['Lines']; - $arrayofmetrics['Blanks'] += $val['Blanks']; - $arrayofmetrics['Comments'] += $val['Comments']; - $arrayofmetrics['Code'] += $val['Code']; - $arrayofmetrics['Complexity'] += $val['Complexity']; } } -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; //$html .= ''; +$html .= ''; $html .= ''; -$html .= '
Language'; +$html .= 'BytesFilesLinesBlanksCode'.$val['Complexity'].'
Written by project team only:
All files from project only
Dependencies:
All files from dependencies'.$arrayofmetrics[$source]['Bytes'].''.$arrayofmetrics[$source]['Files'].''.$arrayofmetrics[$source]['Lines'].''.$arrayofmetrics[$source]['Blanks'].''.$arrayofmetrics[$source]['Comments'].''.$arrayofmetrics[$source]['Code'].'See detail per file type...
'.$key.''.$val['Files'].''.$val['Lines'].''.$val['Blanks'].''.$val['Comments'].''.$val['Code'].''.$val['Complexity'].'graph here...
Total:
'.$arrayofmetrics['Bytes'].' octets'.$arrayofmetrics['Files'].''.$arrayofmetrics['Lines'].''.$arrayofmetrics['Blanks'].''.$arrayofmetrics['Comments'].''.$arrayofmetrics['Code'].'
Total'.($arrayofmetrics['proj']['Bytes'] + $arrayofmetrics['dep']['Bytes']).''.($arrayofmetrics['proj']['Files'] + $arrayofmetrics['dep']['Files']).''.($arrayofmetrics['proj']['Lines'] + $arrayofmetrics['dep']['Lines']).''.($arrayofmetrics['proj']['Blanks'] + $arrayofmetrics['dep']['Blanks']).''.($arrayofmetrics['proj']['Comments'] + $arrayofmetrics['dep']['Comments']).''.($arrayofmetrics['proj']['Code'] + $arrayofmetrics['dep']['Code']).''.$arrayofmetrics['Complexity'].'
'; +$html .= '
'; $html .= '
'; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 87e05bdf376..d6f21c973a1 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -949,7 +949,7 @@ BulkActions=Bulk actions ClickToShowHelp=Click to show tooltip help WebSite=Website WebSites=Websites -WebSiteAccounts=Website accounts +WebSiteAccounts=Web access accounts ExpenseReport=Expense report ExpenseReports=Expense reports HR=HR diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 1e6a1a0c332..8d8ae0474bf 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -71,12 +71,19 @@ class Dolresource extends CommonObject public $element_type; public $busy; public $mandatory; + public $fulldayevent; + /** * @var int ID */ public $fk_user_create; public $tms = ''; + /** + * Used by fetch_element_resource() to return an object + */ + public $objelement; + /** * @var array Cache of type of resources. TODO Use $conf->cache['type_of_resources'] instead */ @@ -361,7 +368,7 @@ class Dolresource extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load data of link in memory from database + * Load data of resource links in memory from database * * @param int $id Id of link element_resources * @return int <0 if KO, >0 if OK @@ -369,7 +376,6 @@ class Dolresource extends CommonObject public function fetch_element_resource($id) { // phpcs:enable - global $langs; $sql = "SELECT"; $sql .= " t.rowid,"; $sql .= " t.resource_id,"; @@ -398,9 +404,9 @@ class Dolresource extends CommonObject $this->mandatory = $obj->mandatory; $this->fk_user_create = $obj->fk_user_create; - if ($obj->resource_id && $obj->resource_type) { + /*if ($obj->resource_id && $obj->resource_type) { $this->objresource = fetchObjectByElement($obj->resource_id, $obj->resource_type); - } + }*/ if ($obj->element_id && $obj->element_type) { $this->objelement = fetchObjectByElement($obj->element_id, $obj->element_type); } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index dd42210d4e2..614af91a5ae 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -1093,7 +1093,7 @@ class Stripe extends CommonObject } } catch (Exception $e) { $sepa = null; - $this->error = 'Stripe error: '.getMessage().'. Check the BAN information.'; + $this->error = 'Stripe error: '.$e->getMessage().'. Check the BAN information.'; dol_syslog($this->error, LOG_WARNING); // Error from Stripe, so a warning on Dolibarr } } From ad44ab7bff18c4292a4281d22cbe136a71852b45 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2023 18:26:27 +0200 Subject: [PATCH 0575/1137] Fix int --- dev/tools/apstats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 63935eae760..cbb5a82dc3a 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -135,7 +135,7 @@ foreach (array('proj', 'dep') as $source) { //print $line."
\n"; if (preg_match('/^Estimated Cost.*\$(.*)/i', $line, $reg)) { - $arraycocomo[$source]['currency'] = preg_replace('/[^\d\.]/', '', str_replace(array(',', ' '), array('.', ''), $reg[1])); + $arraycocomo[$source]['currency'] = preg_replace('/[^\d\.]/', '', str_replace(array(',', ' '), array('', ''), $reg[1])); } if (preg_match('/^Estimated Schedule Effort.*\s([\d\s,]+)/i', $line, $reg)) { $arraycocomo[$source]['effort'] = str_replace(array(',', ' '), array('.', ''), $reg[1]); From 4d607a8fac6fa46ad15880678bdcbc200f5ba845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 23 Aug 2023 18:40:30 +0200 Subject: [PATCH 0576/1137] fix const --- htdocs/mrp/class/api_mos.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index b3e3ff44ff5..fb29de7c891 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -631,9 +631,9 @@ class Mos extends DolibarrApi dol_syslog("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); //var_dump("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); if ($consumptioncomplete && $productioncomplete) { - $result = $this->mo->setStatut(self::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); + $result = $this->mo->setStatut($this->mo::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); } else { - $result = $this->mo->setStatut(self::STATUS_INPROGRESS, 0, '', 'MRP_MO_PRODUCED'); + $result = $this->mo->setStatut($this->mo::STATUS_INPROGRESS, 0, '', 'MRP_MO_PRODUCED'); } if ($result <= 0) { throw new RestException(500, $this->mo->error); From e69c7792fd6da487e434445f03ca6f8cf1de7491 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2023 18:45:10 +0200 Subject: [PATCH 0577/1137] Remove .idea no more used (Qodana abandonned) --- .gitignore | 7 +- .idea/php.xml | 5 - build/exe/doliwamp/Makefile | 2 +- dev/tools/apstats.php | 16 +- htdocs/bookcal/COPYING | 621 ------------------------------------ htdocs/bookcal/ChangeLog.md | 5 - htdocs/custom/.gitignore | 4 - htdocs/custom/README.md | 27 -- 8 files changed, 10 insertions(+), 677 deletions(-) delete mode 100644 .idea/php.xml delete mode 100644 htdocs/bookcal/COPYING delete mode 100644 htdocs/bookcal/ChangeLog.md delete mode 100644 htdocs/custom/.gitignore delete mode 100644 htdocs/custom/README.md diff --git a/.gitignore b/.gitignore index 8c639a26540..cc8b27dae67 100644 --- a/.gitignore +++ b/.gitignore @@ -59,11 +59,6 @@ package-lock.json doc/install.lock /.asciidoctorconfig.adoc -# Qodana -.idea/vcs.xml -.idea/modules.xml -.idea/workspace.xml -.idea/inspectionProfiles/Project_Default.xml -.idea/jsLinters/jshint.xml +.idea /composer.json /composer.lock diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index 74fc8003a4b..00000000000 --- a/.idea/php.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/build/exe/doliwamp/Makefile b/build/exe/doliwamp/Makefile index 8e446931c74..3344232b177 100644 --- a/build/exe/doliwamp/Makefile +++ b/build/exe/doliwamp/Makefile @@ -1,5 +1,5 @@ #-------------------------------------------------------------------# -# Makefile +# Makefile to build UsedPort exe #-------------------------------------------------------------------# # 1.0 Laurent Destailleur Creation #-------------------------------------------------------------------# diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index cbb5a82dc3a..a2bb2786c32 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -265,12 +265,12 @@ foreach (array('proj', 'dep') as $source) { $html .= ''; $html .= ''.$key.''; $html .= ''; - $html .= ''.$val['Files'].''; - $html .= ''.$val['Lines'].''; - $html .= ''.$val['Blanks'].''; - $html .= ''.$val['Comments'].''; - $html .= ''.$val['Code'].''; - //$html .= ''.$val['Complexity'].''; + $html .= ''.(empty($val['Files']) ? '' : $val['Files']).''; + $html .= ''.(empty($val['Lines']) ? '' : $val['Lines']).''; + $html .= ''.(empty($val['Blanks']) ? '' : $val['Blanks']).''; + $html .= ''.(empty($val['Comments']) ? '' : $val['Comments']).''; + $html .= ''.(empty($val['Code']) ? '' : $val['Code']).''; + //$html .= ''.(empty($val['Complexity']) ? '' : $val['Complexity']).''; $html .= 'graph here...'; $html .= ''; } @@ -293,8 +293,8 @@ $html .= ''; $html .= '
'; $html .= '

Project value:


'; -$html .= 'CODOMO (Basic model) value: $'.($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency']).'
'; -$html .= 'CODOMO (Basic model) effort: '.($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']).' Month people
'; +$html .= 'CODOMO (Basic organic model) value: $'.($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency']).'
'; +$html .= 'CODOMO (Basic organic model) effort: '.($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']).' Month people
'; $html .= '
'; $html .= '
'; diff --git a/htdocs/bookcal/COPYING b/htdocs/bookcal/COPYING deleted file mode 100644 index 94a04532226..00000000000 --- a/htdocs/bookcal/COPYING +++ /dev/null @@ -1,621 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS diff --git a/htdocs/bookcal/ChangeLog.md b/htdocs/bookcal/ChangeLog.md deleted file mode 100644 index 992a3d0842c..00000000000 --- a/htdocs/bookcal/ChangeLog.md +++ /dev/null @@ -1,5 +0,0 @@ -# CHANGELOG BOOKCAL FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) - -## 1.0 - -Initial version diff --git a/htdocs/custom/.gitignore b/htdocs/custom/.gitignore deleted file mode 100644 index 9420e8c61eb..00000000000 --- a/htdocs/custom/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/* -!.gitignore -!README.md -!index.html diff --git a/htdocs/custom/README.md b/htdocs/custom/README.md deleted file mode 100644 index 2fc3067f204..00000000000 --- a/htdocs/custom/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# DOLIBARR ERP & CRM custom directory for external modules - -This directory is dedicated to store external modules. -To use it, just copy here the directory of the module into this directory. - -Note: On linux or MAC systems, it is better to unzip/store the external module directory into -a different place than this directory and just adding a symbolic link here to the htdocs directory -of the module. - -For example on Linux OS: Get the module from the command - -`mkdir ~/git; cd ~/git` - -`git clone https://git.framasoft.org/p/newmodule/newmodule.git` - -Then create the symbolic link - -`ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule` - -WARNING !!! -Check also that the /custom directory is active by adding into dolibarr `conf/conf.php` file the following -two lines, so dolibarr will also scan /custom directory to find external external modules: - -```php -$dolibarr_main_url_root_alt='/custom'; -$dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/'; -``` From 7b3663422d09afe5fd010d12039790ded8a08c0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2023 18:45:52 +0200 Subject: [PATCH 0578/1137] Revert "Remove .idea no more used (Qodana abandonned)" This reverts commit e69c7792fd6da487e434445f03ca6f8cf1de7491. --- htdocs/custom/.gitignore | 4 ++++ htdocs/custom/README.md | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 htdocs/custom/.gitignore create mode 100644 htdocs/custom/README.md diff --git a/htdocs/custom/.gitignore b/htdocs/custom/.gitignore new file mode 100644 index 00000000000..9420e8c61eb --- /dev/null +++ b/htdocs/custom/.gitignore @@ -0,0 +1,4 @@ +/* +!.gitignore +!README.md +!index.html diff --git a/htdocs/custom/README.md b/htdocs/custom/README.md new file mode 100644 index 00000000000..2fc3067f204 --- /dev/null +++ b/htdocs/custom/README.md @@ -0,0 +1,27 @@ +# DOLIBARR ERP & CRM custom directory for external modules + +This directory is dedicated to store external modules. +To use it, just copy here the directory of the module into this directory. + +Note: On linux or MAC systems, it is better to unzip/store the external module directory into +a different place than this directory and just adding a symbolic link here to the htdocs directory +of the module. + +For example on Linux OS: Get the module from the command + +`mkdir ~/git; cd ~/git` + +`git clone https://git.framasoft.org/p/newmodule/newmodule.git` + +Then create the symbolic link + +`ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule` + +WARNING !!! +Check also that the /custom directory is active by adding into dolibarr `conf/conf.php` file the following +two lines, so dolibarr will also scan /custom directory to find external external modules: + +```php +$dolibarr_main_url_root_alt='/custom'; +$dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/'; +``` From 59d8909d4bce375d84731ba774b897b7a6a8167b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Aug 2023 19:29:14 +0200 Subject: [PATCH 0579/1137] Fix warnings --- dev/tools/apstats.php | 82 +++++++++++++------ htdocs/custom/.gitignore | 4 - htdocs/custom/README.md | 27 ------ .../stock/class/mouvementstock.class.php | 2 + htdocs/projet/class/api_projects.class.php | 8 +- 5 files changed, 64 insertions(+), 59 deletions(-) delete mode 100644 htdocs/custom/.gitignore delete mode 100644 htdocs/custom/README.md diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index a2bb2786c32..52374841b56 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -173,6 +173,8 @@ foreach (array('proj', 'dep') as $source) { */ $html = ''; +$html .= ''; +$html .= ''; $html .= ' '; $html .= ''; @@ -303,10 +312,12 @@ $html .= '
'; $html .= '
'; $html .= '

Project value


'; -$html .= 'COCOMO (Basic organic model) value: $'; -$html .= formatNumber($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency'], 2); -$html .= '
'; -$html .= 'COCOMO (Basic organic model) effort: '; +$html .= '
'; +$html .= 'COCOMO (Basic organic model) value:
'; +$html .= '$'.formatNumber($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency'], 2); +$html .= '
'; +$html .= '
'; +$html .= 'COCOMO (Basic organic model) effort
'; $html .= formatNumber($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']); $html .= ' monthes people
'; $html .= '
'; From ca1e139c6a3856a3218c6ec84862fb2e707e1558 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2023 20:28:42 +0200 Subject: [PATCH 0730/1137] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e220f5aa98d..c5d2c5f123b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4255,9 +4255,8 @@ abstract class CommonObject if (empty($fk_object_where) || empty($field_where) || empty($table_element)) { return -1; } - if (!preg_match('/^[_a-zA-Z0-9]+$/', $field_select)) { - error_log("ERROR: Invalid value '$field_select' for parameter \$field_select in call to getAllItemsLinkedByObjectID(). Must be a single field name."); + dol_syslog('Invalid value $field_select for parameter '.$field_select.' in call to getAllItemsLinkedByObjectID(). Must be a single field name.', LOG_ERR); } global $db; From df4781a521f001ae8c3e72dd9c0f536a9ec465bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2023 20:30:43 +0200 Subject: [PATCH 0731/1137] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c5d2c5f123b..364de5092d0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4290,12 +4290,14 @@ abstract class CommonObject global $db; - $sql = "SELECT COUNT(*) n FROM ".$db->prefix().$table_element." WHERE ".$field_where." = ".((int) $fk_object_where); + $sql = "SELECT COUNT(*) as nb FROM ".$db->prefix().$table_element." WHERE ".$field_where." = ".((int) $fk_object_where); $resql = $db->query($sql); $n = 0; if ($resql) { $res = $db->fetch_object($resql); - if ($res) $n = $res->n; + if ($res) { + $n = $res->nb; + } } return $n; From 0a3bb161f84bb419e955e6d0756788739ea996ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 2 Sep 2023 10:14:25 +0200 Subject: [PATCH 0732/1137] phpstan --- htdocs/core/class/html.formmail.class.php | 9 +++++++++ htdocs/core/class/html.formsms.class.php | 1 + 2 files changed, 10 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index d117140e156..264ed21b512 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -134,6 +134,7 @@ class FormMail extends Form public $withtocc; public $withtoccc; public $withtopic; + public $witherrorsto; /** * @var int 0=No attaches files, 1=Show attached files, 2=Can add new attached files @@ -150,13 +151,21 @@ class FormMail extends Form public $withreplytoreadonly; public $withtoreadonly; public $withtoccreadonly; + public $witherrorstoreadonly; public $withtocccreadonly; public $withtopicreadonly; + public $withbodyreadonly; public $withfilereadonly; public $withdeliveryreceipt; public $withcancel; + public $withdeliveryreceiptreadonly; public $withfckeditor; + /** + * @var string ckeditortoolbar + */ + public $ckeditortoolbar; + public $substit = array(); public $substit_lines = array(); public $param = array(); diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 940f76d0ae8..8e20cb8d33c 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -62,6 +62,7 @@ class FormSms public $withreplytoreadonly; public $withtoreadonly; public $withtopicreadonly; + public $withbodyreadonly; public $withcancel; public $substit = array(); From e0189c654c16749c0e46dbd183b50a3ffed5504d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 2 Sep 2023 10:18:46 +0200 Subject: [PATCH 0733/1137] phpcs --- .../modules/facture/doc/doc_generic_invoice_odt.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index ec8d8b5f68d..aaa8bad5ee7 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -430,7 +430,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures // TODO Search all tags {object_...:xxxx} into template then loop on this found tags to analyze them and the the corresponding // property of object and use the xxxx to know how to format it. // Before that, we hard code this substitution as if we have found them into the template. - + $tmparray['object_PREVIOUS_MONTH'] = dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m'); $tmparray['object_MONTH'] = dol_print_date($object->date, '%m'); $tmparray['object_NEXT_MONTH'] = dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m'); @@ -440,7 +440,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $tmparray['object_PREVIOUS_YEAR'] = dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y'); $tmparray['object_YEAR'] = dol_print_date($object->date, '%Y'); $tmparray['object_NEXT_YEAR'] = dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y'); - $tmparray['object_productorservice_operation'] = $outputlangs->transnoentities("MentionCategoryOfOperations" . $categoryOfOperation); + $tmparray['object_productorservice_operation'] = $outputlangs->transnoentities("MentionCategoryOfOperations" . $categoryOfOperation); // Call the ODTSubstitution hook From ae2e383b0ed3bba27a63ac7dddf285e9e38d149d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2023 11:17:47 +0200 Subject: [PATCH 0734/1137] Test on $error --- htdocs/accountancy/journal/purchasesjournal.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 1170a20b969..cc7655d28f3 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -72,6 +72,8 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } +$error = 0; + /* * Actions @@ -341,7 +343,7 @@ foreach ($tabfac as $key => $val) { // Loop on each invoice // Bookkeeping Write -if ($action == 'writebookkeeping') { +if ($action == 'writebookkeeping' && !$error) { $now = dol_now(); $error = 0; @@ -712,7 +714,7 @@ if ($action == 'writebookkeeping') { $form = new Form($db); // Export -if ($action == 'exportcsv') { // ISO and not UTF8 ! +if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 ! $sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV'); $filename = 'journal'; From de72f6d7eb26512152778304c09bcfbd726fa3c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2023 11:18:43 +0200 Subject: [PATCH 0735/1137] Add test on $error --- htdocs/accountancy/journal/sellsjournal.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 6ee2ae461ed..31986312388 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -74,6 +74,8 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } +$error = 0; + /* * Actions @@ -360,7 +362,7 @@ foreach ($tabfac as $key => $val) { // Loop on each invoice // Bookkeeping Write -if ($action == 'writebookkeeping') { +if ($action == 'writebookkeeping' && !$error) { $now = dol_now(); $error = 0; @@ -764,7 +766,7 @@ if ($action == 'writebookkeeping') { $form = new Form($db); // Export -if ($action == 'exportcsv') { // ISO and not UTF8 ! +if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 ! // Note that to have the button to get this feature enabled, you must enable ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL $sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV'); From bd008d78b521c5279335eb6b41e9230a4a0667f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2023 11:36:03 +0200 Subject: [PATCH 0736/1137] Fix label of cron --- htdocs/core/modules/modPartnership.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index b8aafc853fb..48244ae0455 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -253,8 +253,8 @@ class modPartnership extends DolibarrModules $datestart=dol_mktime(21, 15, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); $this->cronjobs = array( - 0 => array('priority'=>60, 'label'=>'CancelPartnershipForExpiredMembers', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doCancelStatusOfMemberPartnership', 'parameters'=>'', 'comment'=>'Cancel status of partnership when subscription is expired + x days.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>1, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart), - 1 => array('priority'=>61, 'label'=>'PartnershipCheckBacklink', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doWarningOfPartnershipIfDolibarrBacklinkNotfound', 'parameters'=>'', 'comment'=>'Warning of partnership if Dolibarr backlink not found on partner website.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>0, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart), + 0 => array('priority'=>60, 'label'=>'CancelPartnershipForExpiredMembers', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doCancelStatusOfMemberPartnership', 'parameters'=>'', 'comment'=>'Cancel status of partnership when subscription is expired + x days.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>1, 'test'=>'isModEnabled("partnership")', 'datestart'=>$datestart), + 1 => array('priority'=>61, 'label'=>'PartnershipCheckBacklink', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doWarningOfPartnershipIfDolibarrBacklinkNotfound', 'parameters'=>'', 'comment'=>'Add a warning on partnership record if the backlink keyword is not found on the partner website.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>0, 'test'=>'isModEnabled("partnership")', 'datestart'=>$datestart), ); // Permissions provided by this module From f72c22f6b7e6862c9a1b70e9731651c59d80bf29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Sep 2023 21:15:42 +0200 Subject: [PATCH 0737/1137] phpstan --- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 0afff52ee73..a7cf4c50b96 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -88,10 +88,10 @@ class pdf_beluga extends ModelePDFProjects public $posxref; public $posxdate; - public $posxsociete; + public $posxsociety; public $posxamountht; public $posxamountttc; - public $posstatut; + public $posxstatut; /** @@ -156,10 +156,10 @@ class pdf_beluga extends ModelePDFProjects if ($this->page_largeur < 210) { // To work with US executive format $this->posxref -= 20; $this->posxdate -= 20; - $this->posxsociete -= 20; + $this->posxsociety -= 20; $this->posxamountht -= 20; $this->posxamountttc -= 20; - $this->posstatut -= 20; + $this->posxstatut -= 20; } } From 3a6b56160579ea95121fc0960bc111218f422732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 2 Sep 2023 21:23:15 +0200 Subject: [PATCH 0738/1137] phpstan --- htdocs/core/class/commondocgenerator.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index e1bbbba56e0..bfec5a6c199 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -155,7 +155,10 @@ abstract class CommonDocGenerator public $posxdesc; // For description public $posxqty; public $posxpuht; - + public $posxtva; + public $atleastonephoto; + public $atleastoneratenotnull; + public $atleastonediscount; /** * Constructor From 455a1dcc667b33d8198fb7bfecfe217fbcb38318 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2023 22:38:07 +0200 Subject: [PATCH 0739/1137] Type ip is ip --- htdocs/partnership/class/partnership.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index bb71d053dfe..5fcbcc39bf5 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -124,7 +124,7 @@ class Partnership extends CommonObject 'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',), 'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>-2,), 'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>73, 'notnull'=>0, 'visible'=>-2,), - 'ip' => array('type'=>'varchar(250)', 'label'=>'Ip', 'enabled'=>'1', 'position'=>74, 'notnull'=>0, 'visible'=>-2,), + 'ip' => array('type'=>'ip', 'label'=>'Ip', 'enabled'=>'1', 'position'=>74, 'notnull'=>0, 'visible'=>-2,), 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>2, 'default'=>'0', 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Accepted', '2'=>'Refused', '8'=>'Suspended', '9'=>'Terminated'),), ); public $rowid; From f2d8246581c46cc650c72d19b0c9c29a5af5f33a Mon Sep 17 00:00:00 2001 From: Mamisoa Date: Sun, 3 Sep 2023 00:11:47 +0200 Subject: [PATCH 0740/1137] FIX delete deprecated file Object.php Delete deprecated file Object.php that cause REST API to crash --- 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 fd1f2f9bc1e..f0aa54fd362 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4137,7 +4137,8 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/mailings/poire.modules.php', '/core/modules/mailings/kiwi.modules.php', '/core/boxes/box_members.php', - + '/includes/restler/framework/Luracast/Restler/Data/Object.php', + '/api/class/api_generic.class.php', '/asterisk/cidlookup.php', '/categories/class/api_category.class.php', From e3a86e327e9787f68398183598075d5a68f3b03d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 02:05:43 +0200 Subject: [PATCH 0741/1137] Fix warning --- .../class/partnershiputils.class.php | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 86722ed1da2..c73bc4230d4 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -233,6 +233,8 @@ class PartnershipUtils $this->output = ''; $this->error = ''; $partnershipsprocessed = array(); + $emailnotfound = ''; + $websitenotfound = ''; $gracedelay = $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; if ($gracedelay < 1) { @@ -251,21 +253,16 @@ class PartnershipUtils $sql = "SELECT p.rowid, p.status, p.".$fk_partner; $sql .= ", p.last_check_backlink"; - $sql .= ', partner.url, partner.email'; - $sql .= " FROM ".MAIN_DB_PREFIX."partnership as p"; - if ($managedfor == 'member') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as partner on (partner.rowid = p.fk_member)"; } else { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as partner on (partner.rowid = p.fk_soc)"; } - - $sql .= " WHERE 1 = 1"; - $sql .= " AND p.".$fk_partner." > 0"; - $sql .= " AND p.status = ".((int) $partnership::STATUS_APPROVED); // Only accepted not yet canceled - $sql .= " AND (p.last_check_backlink IS NULL OR p.last_check_backlink <= '".$this->db->idate($now - 7 * 24 * 3600)."')"; // Every week, check that website contains a link to dolibarr. + $sql .= " WHERE p.".$fk_partner." > 0"; + $sql .= " AND p.status = ".((int) $partnership::STATUS_APPROVED); // Only accepted and not yet canceled + $sql .= " AND (p.last_check_backlink IS NULL OR p.last_check_backlink <= '".$this->db->idate($now - 24 * 3600)."')"; // Never more than 1 check every day to check that website contains a referal link. $sql .= $this->db->order('p.rowid', 'ASC'); // Limit is managed into loop later @@ -274,7 +271,6 @@ class PartnershipUtils $numofexpiredmembers = $this->db->num_rows($resql); $somethingdoneonpartnership = 0; $ifetchpartner = 0; - $websitenotfound = ''; while ($ifetchpartner < $numofexpiredmembers) { $ifetchpartner++; @@ -376,18 +372,16 @@ class PartnershipUtils if (!$error) { $this->db->commit(); - $this->output = $numofexpiredmembers.' partnership checked'."\n"; - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; - if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; - if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; + $this->output = ""; } else { $this->db->rollback(); $this->output = "Rollback after error\n"; - $this->output .= $numofexpiredmembers.' partnership checked'."\n"; - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; - if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; - if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; } + $this->output .= $numofexpiredmembers.' partnership checked'."\n"; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; + if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; + if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; + $this->output .= "\nSQL used to find partnerships to scan: ".$sql; return ($error ? 1 : 0); } From 573b9dd77a2fa73ecdd8e06b0906bbdcec735602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Sep 2023 09:54:56 +0200 Subject: [PATCH 0742/1137] phpstan --- htdocs/core/class/lessc.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index f1620898028..29feea57f29 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -56,8 +56,12 @@ class Lessc public $scope; public $formatter; + public $formatterName; + public $parser; + public $_parseFile; public $env; public $count; + public $inExp; protected $numberPrecision = null; @@ -2640,7 +2644,15 @@ class lessc_parser protected static $literalCache = array(); public $env; + public $buffer; public $count; + public $line; + public $eatWhiteDefault; + public $lessc; + public $sourceName; + public $writeComments; + public $seenComments; + public $currentProperty; public function __construct($lessc, $sourceName = null) @@ -4245,6 +4257,7 @@ class lessc_formatter_classic public $breakSelectors = false; public $compressColors = false; + public $indentLevel; public function __construct() { From 56289850428ca30cd299b06550633d0879a441f2 Mon Sep 17 00:00:00 2001 From: mschamp Date: Sun, 3 Sep 2023 11:35:06 +0200 Subject: [PATCH 0743/1137] Change ID's Replace 200... with 10... in the ID --- .../mysql/data/llx_accounting_account_be.sql | 854 +++++++++--------- 1 file changed, 427 insertions(+), 427 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_be.sql b/htdocs/install/mysql/data/llx_accounting_account_be.sql index a0308360745..248bb400927 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_be.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_be.sql @@ -946,431 +946,431 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1356, 'PCMN-BASE', 'EXPENSE', '6', '0', 'Charges', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1357, 'PCMN-BASE', 'INCOME', '7', '0', 'Produits', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200439, 'MAR-VERKORT', 'CAPIT', '1', '0', 'Eigen vermogen, voorzieningen voor risico''s en kosten en schulden op meer dan één jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200440, 'MAR-VERKORT', 'CAPIT', '10', '200439', 'Kapitaal', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200441, 'MAR-VERKORT', 'CAPIT', '100', '200440', 'Geplaatst kapitaal', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200442, 'MAR-VERKORT', 'CAPIT', '101', '200440', 'Niet-opgevraagd kapitaal (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200443, 'MAR-VERKORT', 'CAPIT', '11', '200439', 'Uitgiftepremies (+)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200444, 'MAR-VERKORT', 'CAPIT', '12', '200439', 'Herwaarderingsmeerwaarden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200445, 'MAR-VERKORT', 'CAPIT', '120', '200444', 'Herwaarderingsmeerwaarden op immateriële vaste activa (+)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200446, 'MAR-VERKORT', 'CAPIT', '121', '200444', 'Herwaarderingsmeerwaarden op materiële vaste activa (+)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200447, 'MAR-VERKORT', 'CAPIT', '122', '200444', 'Herwaarderingsmeerwaarden op financiële vaste activa (+)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200448, 'MAR-VERKORT', 'CAPIT', '123', '200444', 'Herwaarderingsmeerwaarden op voorraden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200449, 'MAR-VERKORT', 'CAPIT', '124', '200444', 'Terugneming van waardeverminderingen op geldbeleggingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200450, 'MAR-VERKORT', 'CAPIT', '13', '200439', 'Reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200451, 'MAR-VERKORT', 'CAPIT', '130', '200450', 'Wettelijke reserve', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200452, 'MAR-VERKORT', 'CAPIT', '131', '200450', 'Onbeschikbare reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200453, 'MAR-VERKORT', 'CAPIT', '1310', '200452', 'Reserve voor eigen aandelen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200454, 'MAR-VERKORT', 'CAPIT', '1311', '200452', 'Andere onbeschikbare reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200455, 'MAR-VERKORT', 'CAPIT', '132', '200450', 'Belastingvrije reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200456, 'MAR-VERKORT', 'CAPIT', '133', '200450', 'Beschikbare reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200457, 'MAR-VERKORT', 'CAPIT', '14', '200439', 'Overgedragen Winst of Overgedragen verlies (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200458, 'MAR-VERKORT', 'CAPIT', '15', '200439', 'Kapitaalsubsidies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200459, 'MAR-VERKORT', 'CAPIT', '16', '200439', 'Voorzieningen en Uitgestelde belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200460, 'MAR-VERKORT', 'CAPIT', '160', '200459', 'Voorzieningen voor pensioenen en soortgelijke verplichtingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200461, 'MAR-VERKORT', 'CAPIT', '161', '200459', 'Voorzieningen voor belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200462, 'MAR-VERKORT', 'CAPIT', '162', '200459', 'Voorzieningen voor grote herstellingswerken en grote onderhoudswerken', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200463, 'MAR-VERKORT', 'CAPIT', '163', '200459', 'Voorzieningen voor milieuverplichtingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200464, 'MAR-VERKORT', 'CAPIT', '168', '200459', 'Uitgestelde belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200465, 'MAR-VERKORT', 'CAPIT', '1680', '200464', 'Uitgestelde belastingen op kapitaalsubsidies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200466, 'MAR-VERKORT', 'CAPIT', '1681', '200464', 'Uitgestelde belastingen op gerealiseerde meerwaarden op immateriële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200467, 'MAR-VERKORT', 'CAPIT', '1682', '200464', 'Uitgestelde belastingen op gerealiseerde meerwaarden op materiële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200468, 'MAR-VERKORT', 'CAPIT', '1687', '200464', 'Uitgestelde belastingen op gerealiseerde meerwaarden op effecten die zijn uitgegeven door de Belgische openbare sector', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200469, 'MAR-VERKORT', 'CAPIT', '1688', '200464', 'Buitenlandse uitgestelde belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200470, 'MAR-VERKORT', 'CAPIT', '17', '200439', 'Schulden op meer dan één jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200471, 'MAR-VERKORT', 'CAPIT', '170', '200470', 'Achtergestelde leningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200472, 'MAR-VERKORT', 'CAPIT', '1700', '200471', 'Converteerbaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200473, 'MAR-VERKORT', 'CAPIT', '1701', '200471', 'Niet-converteerbaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200474, 'MAR-VERKORT', 'CAPIT', '171', '200470', 'Niet achtergestelde obligatieleningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200475, 'MAR-VERKORT', 'CAPIT', '1710', '200474', 'Converteerbaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200476, 'MAR-VERKORT', 'CAPIT', '1711', '200474', 'Niet-converteerbaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200477, 'MAR-VERKORT', 'CAPIT', '172', '200470', 'Leasingschulden en soortgelijke', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200478, 'MAR-VERKORT', 'CAPIT', '173', '200470', 'Kredietinstellingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200479, 'MAR-VERKORT', 'CAPIT', '1730', '200478', 'Schulden op rekening', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200480, 'MAR-VERKORT', 'CAPIT', '1731', '200478', 'Promessen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200481, 'MAR-VERKORT', 'CAPIT', '1732', '200478', 'Acceptkredieten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200482, 'MAR-VERKORT', 'CAPIT', '174', '200470', 'Overige leningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200483, 'MAR-VERKORT', 'CAPIT', '175', '200470', 'Handelsschulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200484, 'MAR-VERKORT', 'CAPIT', '1750', '200483', 'Leveranciers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200485, 'MAR-VERKORT', 'CAPIT', '1751', '200483', 'Te betalen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200486, 'MAR-VERKORT', 'CAPIT', '176', '200470', 'Vooruitbetalingen op bestellingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200487, 'MAR-VERKORT', 'CAPIT', '178', '200470', 'Borgtochten ontvangen in contanten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200488, 'MAR-VERKORT', 'CAPIT', '179', '200470', 'Overige schulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200489, 'MAR-VERKORT', 'CAPIT', '19', '200439', 'Voorschot aan de vennoten op de verdeling van het nettoactief (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200490, 'MAR-VERKORT', 'IMMO', '2', '0', 'Oprichtingskosten, vaste activa en vorderingen op meer dan één jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200491, 'MAR-VERKORT', 'IMMO', '20', '200490', 'Oprichtingskosten (1)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200492, 'MAR-VERKORT', 'IMMO', '200', '200491', 'Kosten voor oprichting en kapitaalsverhoging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200493, 'MAR-VERKORT', 'IMMO', '201', '200491', 'Kosten bij uitgifte van leningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200494, 'MAR-VERKORT', 'IMMO', '202', '200491', 'Overige oprichtingskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200495, 'MAR-VERKORT', 'IMMO', '203', '200491', '', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200496, 'MAR-VERKORT', 'IMMO', '204', '200491', 'Herstructureringskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200497, 'MAR-VERKORT', 'IMMO', '21', '200490', 'Immateriële vaste activa (1)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200498, 'MAR-VERKORT', 'IMMO', '210', '200497', 'Kosten voor onderzoek en ontwikkeling', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200499, 'MAR-VERKORT', 'IMMO', '211', '200497', 'Concessies, octrooien, licenties, know how, merken en soorgelijke rechten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200500, 'MAR-VERKORT', 'IMMO', '212', '200497', 'Goodwill', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200501, 'MAR-VERKORT', 'IMMO', '213', '200497', 'Vooruitbetalingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200502, 'MAR-VERKORT', 'IMMO', '214', '200497', 'Software', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200503, 'MAR-VERKORT', 'IMMO', '215', '200497', 'Databanken', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200504, 'MAR-VERKORT', 'IMMO', '216', '200497', 'Emissierechten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200505, 'MAR-VERKORT', 'IMMO', '219', '200497', 'Overige immateriële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200506, 'MAR-VERKORT', 'IMMO', '22', '200490', 'Terreinen en gebouwen (1)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200507, 'MAR-VERKORT', 'IMMO', '220', '200506', 'Terreinen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200508, 'MAR-VERKORT', 'IMMO', '221', '200506', 'Gebouwen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200509, 'MAR-VERKORT', 'IMMO', '222', '200506', 'Bebouwde terreinen (2)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200510, 'MAR-VERKORT', 'IMMO', '223', '200506', 'Overige zakelijke rechten op onroerende goederen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200511, 'MAR-VERKORT', 'IMMO', '224', '200506', 'Autosnelwegen, wegen en fietspaden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200512, 'MAR-VERKORT', 'IMMO', '225', '200506', 'Vliegvelden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200513, 'MAR-VERKORT', 'IMMO', '226', '200506', 'Waterbouwkundige werken', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200514, 'MAR-VERKORT', 'IMMO', '227', '200506', 'Havens', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200515, 'MAR-VERKORT', 'IMMO', '228', '200506', 'Openbaar vervoer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200516, 'MAR-VERKORT', 'IMMO', '229', '200506', 'Overige werken van burgelijke bouwkunde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200517, 'MAR-VERKORT', 'IMMO', '23', '200490', 'Installaties, machines en uitrusting (1)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200518, 'MAR-VERKORT', 'IMMO', '24', '200490', 'Meubilair en rollend materieel (1)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200519, 'MAR-VERKORT', 'IMMO', '240', '200518', 'Rollend materieel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200520, 'MAR-VERKORT', 'IMMO', '241', '200518', 'Varend materieel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200521, 'MAR-VERKORT', 'IMMO', '242', '200518', 'Vliegend materieel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200522, 'MAR-VERKORT', 'IMMO', '243', '200518', 'Informatica en telematica materieel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200523, 'MAR-VERKORT', 'IMMO', '244', '200518', 'Kantoormeubilair', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200524, 'MAR-VERKORT', 'IMMO', '245', '200518', 'Werken van bibliotheken', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200525, 'MAR-VERKORT', 'IMMO', '246', '200518', 'Kunstvoorwerpen en -werken', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200526, 'MAR-VERKORT', 'IMMO', '25', '200490', 'Vaste activa in leasing of op grond van een soortgelijk recht (1)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200527, 'MAR-VERKORT', 'IMMO', '250', '200526', 'Terreinen en gebouwen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200528, 'MAR-VERKORT', 'IMMO', '251', '200526', 'Installaties, machines en uitrusting', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200529, 'MAR-VERKORT', 'IMMO', '252', '200526', 'Meubilair en rollend materieel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200530, 'MAR-VERKORT', 'IMMO', '26', '200490', 'Overige materiële vaste activa (1)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200531, 'MAR-VERKORT', 'IMMO', '27', '200490', 'Vaste activa in aanbouw en vooruitbetalingen (1)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200532, 'MAR-VERKORT', 'IMMO', '28', '200490', 'Financiële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200533, 'MAR-VERKORT', 'IMMO', '280', '200532', 'Deelnemingen in verbonden ondernemingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200534, 'MAR-VERKORT', 'IMMO', '2800', '200533', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200535, 'MAR-VERKORT', 'IMMO', '2801', '200533', 'Nog te storten bedragen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200536, 'MAR-VERKORT', 'IMMO', '2808', '200533', 'Geboekte meerwaarden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200537, 'MAR-VERKORT', 'IMMO', '2809', '200533', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200538, 'MAR-VERKORT', 'IMMO', '281', '200532', 'Vorderingen op verbonden ondernemingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200539, 'MAR-VERKORT', 'IMMO', '2810', '200538', 'Vordering op rekening', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200540, 'MAR-VERKORT', 'IMMO', '2811', '200538', 'Te innen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200541, 'MAR-VERKORT', 'IMMO', '2812', '200538', 'Vastrentende effecten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200542, 'MAR-VERKORT', 'IMMO', '2817', '200538', 'Dubieuze debiteuren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200543, 'MAR-VERKORT', 'IMMO', '2819', '200538', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200544, 'MAR-VERKORT', 'IMMO', '282', '200532', 'Deelnemingen in ondernemingen waarmee een deelnemingsverhouding bestaat', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200545, 'MAR-VERKORT', 'IMMO', '2820', '200544', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200546, 'MAR-VERKORT', 'IMMO', '2821', '200544', 'Nog te storten bedragen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200547, 'MAR-VERKORT', 'IMMO', '2828', '200544', 'Geboekte meerwaarden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200548, 'MAR-VERKORT', 'IMMO', '2829', '200544', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200549, 'MAR-VERKORT', 'IMMO', '283', '200532', 'Vorderingen op ondernemingen waarmee een deelnemingsverhouding bestaat', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200550, 'MAR-VERKORT', 'IMMO', '2830', '200549', 'Vordering op rekening', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200551, 'MAR-VERKORT', 'IMMO', '2831', '200549', 'Te innen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200552, 'MAR-VERKORT', 'IMMO', '2832', '200549', 'Vastrentende effecten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200553, 'MAR-VERKORT', 'IMMO', '2837', '200549', 'Dubieuze debiteuren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200554, 'MAR-VERKORT', 'IMMO', '2839', '200549', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200555, 'MAR-VERKORT', 'IMMO', '284', '200532', 'Andere aandelen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200556, 'MAR-VERKORT', 'IMMO', '2840', '200555', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200557, 'MAR-VERKORT', 'IMMO', '2841', '200555', 'Nog te storten bedragen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200558, 'MAR-VERKORT', 'IMMO', '2848', '200555', 'Geboekte meerwaarden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200559, 'MAR-VERKORT', 'IMMO', '2849', '200555', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200560, 'MAR-VERKORT', 'IMMO', '285', '200532', 'Overige vorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200561, 'MAR-VERKORT', 'IMMO', '2850', '200560', 'Vordering op rekening', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200562, 'MAR-VERKORT', 'IMMO', '2851', '200560', 'Te innen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200563, 'MAR-VERKORT', 'IMMO', '2852', '200560', 'Vastrentende effecten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200564, 'MAR-VERKORT', 'IMMO', '2857', '200560', 'Dubieuze debiteuren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200565, 'MAR-VERKORT', 'IMMO', '2859', '200560', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200566, 'MAR-VERKORT', 'IMMO', '288', '200532', 'Borgtochten betaald in contanten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200567, 'MAR-VERKORT', 'IMMO', '29', '200490', 'Vorderingen op meer dan één jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200568, 'MAR-VERKORT', 'IMMO', '290', '200567', 'Handelsvorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200569, 'MAR-VERKORT', 'IMMO', '2900', '200568', 'Handelsdebiteuren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200570, 'MAR-VERKORT', 'IMMO', '2901', '200568', 'Te innen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200571, 'MAR-VERKORT', 'IMMO', '2906', '200568', 'Vooruitbetalingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200572, 'MAR-VERKORT', 'IMMO', '2907', '200568', 'Dubieuze debiteuren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200573, 'MAR-VERKORT', 'IMMO', '2909', '200568', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200574, 'MAR-VERKORT', 'IMMO', '291', '200567', 'Overige vorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200575, 'MAR-VERKORT', 'IMMO', '2910', '200574', 'Vordering op rekening', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200576, 'MAR-VERKORT', 'IMMO', '2911', '200574', 'Te innen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200577, 'MAR-VERKORT', 'IMMO', '2917', '200574', 'Dubieuze debiteuren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200578, 'MAR-VERKORT', 'IMMO', '2919', '200574', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200579, 'MAR-VERKORT', 'STOCK', '3', '0', 'Voorraden en bestellingen in uitvoering', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200580, 'MAR-VERKORT', 'STOCK', '30', '200579', 'Grondstoffen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200581, 'MAR-VERKORT', 'STOCK', '300', '200580', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200582, 'MAR-VERKORT', 'STOCK', '309', '200580', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200583, 'MAR-VERKORT', 'STOCK', '31', '200579', 'Hulpstoffen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200584, 'MAR-VERKORT', 'STOCK', '310', '200583', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200585, 'MAR-VERKORT', 'STOCK', '319', '200583', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200586, 'MAR-VERKORT', 'STOCK', '32', '200579', 'Goederen in bewerking', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200587, 'MAR-VERKORT', 'STOCK', '320', '200586', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200588, 'MAR-VERKORT', 'STOCK', '329', '200586', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200589, 'MAR-VERKORT', 'STOCK', '33', '200579', 'Gereed product', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200590, 'MAR-VERKORT', 'STOCK', '330', '200589', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200591, 'MAR-VERKORT', 'STOCK', '339', '200589', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200592, 'MAR-VERKORT', 'STOCK', '34', '200579', 'Handelsgoederen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200593, 'MAR-VERKORT', 'STOCK', '340', '200592', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200594, 'MAR-VERKORT', 'STOCK', '349', '200592', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200595, 'MAR-VERKORT', 'STOCK', '35', '200579', 'Onroerende goederen bestemd voor verkoop', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200596, 'MAR-VERKORT', 'STOCK', '350', '200595', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200597, 'MAR-VERKORT', 'STOCK', '359', '200595', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200598, 'MAR-VERKORT', 'STOCK', '36', '200579', 'Vooruitbetalingen op voorraadinkopen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200599, 'MAR-VERKORT', 'STOCK', '360', '200598', 'Vooruitbetalingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200600, 'MAR-VERKORT', 'STOCK', '369', '200598', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200601, 'MAR-VERKORT', 'STOCK', '37', '200579', 'Bestellingen in uitvoering', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200602, 'MAR-VERKORT', 'STOCK', '370', '200601', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200603, 'MAR-VERKORT', 'STOCK', '371', '200601', 'Toegerekende winst', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200604, 'MAR-VERKORT', 'STOCK', '379', '200601', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200605, 'MAR-VERKORT', 'THIRDPARTY', '4', '0', 'Vorderingen en schulden op ten hoogste een jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200606, 'MAR-VERKORT', 'THIRDPARTY', '40', '200605', 'Handelsvorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200607, 'MAR-VERKORT', 'THIRDPARTY', '400', '200606', 'Handelsdebiteuren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200608, 'MAR-VERKORT', 'THIRDPARTY', '401', '200606', 'Te innen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200609, 'MAR-VERKORT', 'THIRDPARTY', '404', '200606', 'Te innen opbrengsten (3)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200610, 'MAR-VERKORT', 'THIRDPARTY', '406', '200606', 'Vooruitbetalingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200611, 'MAR-VERKORT', 'THIRDPARTY', '407', '200606', 'Dubieuze debiteuren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200612, 'MAR-VERKORT', 'THIRDPARTY', '409', '200606', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200613, 'MAR-VERKORT', 'THIRDPARTY', '41', '200605', 'Overige vorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200614, 'MAR-VERKORT', 'THIRDPARTY', '410', '200613', 'Opgevraagd, niet-gestort kapitaal', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200615, 'MAR-VERKORT', 'THIRDPARTY', '411', '200613', 'Terug te vorderen BTW', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200616, 'MAR-VERKORT', 'THIRDPARTY', '412', '200613', 'Terug te vorderen belastingen en voorheffingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200617, 'MAR-VERKORT', 'THIRDPARTY', '4128', '200616', 'Buitenlandse belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200618, 'MAR-VERKORT', 'THIRDPARTY', '413', '200613', 'Overige vorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200619, 'MAR-VERKORT', 'THIRDPARTY', '414', '200613', 'Te innen opbrengsten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200620, 'MAR-VERKORT', 'THIRDPARTY', '416', '200613', 'Diverse vorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200621, 'MAR-VERKORT', 'THIRDPARTY', '417', '200613', 'Dubieuze vorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200622, 'MAR-VERKORT', 'THIRDPARTY', '418', '200613', 'Borgtochten betaald in contanten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200623, 'MAR-VERKORT', 'THIRDPARTY', '419', '200613', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200624, 'MAR-VERKORT', 'THIRDPARTY', '42', '200605', 'Schulden op meer dan één jaar die binnen het jaar vervallen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200625, 'MAR-VERKORT', 'THIRDPARTY', '420', '200624', 'Achtergestelde leningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200626, 'MAR-VERKORT', 'THIRDPARTY', '4200', '200625', 'Converteerbaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200627, 'MAR-VERKORT', 'THIRDPARTY', '4201', '200625', 'Niet-converteerbaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200628, 'MAR-VERKORT', 'THIRDPARTY', '421', '200624', 'Niet achtergestelde obligatieleningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200629, 'MAR-VERKORT', 'THIRDPARTY', '4210', '200628', 'Converteerbaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200630, 'MAR-VERKORT', 'THIRDPARTY', '4211', '200628', 'Niet-converteerbaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200631, 'MAR-VERKORT', 'THIRDPARTY', '422', '200624', 'Leasingschulden en soortgelijke', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200632, 'MAR-VERKORT', 'THIRDPARTY', '423', '200624', 'Kredietinstellingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200633, 'MAR-VERKORT', 'THIRDPARTY', '4230', '200632', 'Schulden op rekening', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200634, 'MAR-VERKORT', 'THIRDPARTY', '4231', '200632', 'Promessen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200635, 'MAR-VERKORT', 'THIRDPARTY', '4232', '200632', 'Acceptkredieten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200636, 'MAR-VERKORT', 'THIRDPARTY', '424', '200624', 'Overige leningen (+)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200637, 'MAR-VERKORT', 'THIRDPARTY', '425', '200624', 'Handelsschulden (+)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200638, 'MAR-VERKORT', 'THIRDPARTY', '4250', '200637', 'Leveranciers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200639, 'MAR-VERKORT', 'THIRDPARTY', '4251', '200637', 'Te betalen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200640, 'MAR-VERKORT', 'THIRDPARTY', '426', '200624', 'Vooruitbetalingen op bestellingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200641, 'MAR-VERKORT', 'THIRDPARTY', '428', '200624', 'Borgtochten ontvangen in contanten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200642, 'MAR-VERKORT', 'THIRDPARTY', '429', '200624', 'Overige schulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200643, 'MAR-VERKORT', 'THIRDPARTY', '43', '200605', 'Financiële schulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200644, 'MAR-VERKORT', 'THIRDPARTY', '430', '200643', 'Kredietinstellingen – Leningen op rekeningen met vaste termijn', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200645, 'MAR-VERKORT', 'THIRDPARTY', '431', '200643', 'Kredietinstellingen – Promessen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200646, 'MAR-VERKORT', 'THIRDPARTY', '432', '200643', 'Kredietinstellingen – Acceptkrediet', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200647, 'MAR-VERKORT', 'THIRDPARTY', '433', '200643', 'Kredietinstellingen – Schulden in rekening courant (4)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200648, 'MAR-VERKORT', 'THIRDPARTY', '439', '200643', 'Overige leningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200649, 'MAR-VERKORT', 'THIRDPARTY', '44', '200605', 'Handelsschulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200650, 'MAR-VERKORT', 'THIRDPARTY', '440', '200649', 'Leveranciers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200651, 'MAR-VERKORT', 'THIRDPARTY', '441', '200649', 'Te betalen wissels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200652, 'MAR-VERKORT', 'THIRDPARTY', '444', '200649', 'Te ontvangen facturen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200653, 'MAR-VERKORT', 'THIRDPARTY', '45', '200605', 'Schulden met betrekking tot belastingen, bezoldigingen en sociale lasten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200654, 'MAR-VERKORT', 'THIRDPARTY', '450', '200653', 'Geraamd bedrag van de belastingschulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200655, 'MAR-VERKORT', 'THIRDPARTY', '4508', '200654', 'Buitenlandse belastingen en taksen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200656, 'MAR-VERKORT', 'THIRDPARTY', '451', '200653', 'Te betalen BTW', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200657, 'MAR-VERKORT', 'THIRDPARTY', '452', '200653', 'Te betalen belastingen en taksen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200658, 'MAR-VERKORT', 'THIRDPARTY', '4528', '200657', 'Buitenlandse belastingen en taksen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200659, 'MAR-VERKORT', 'THIRDPARTY', '453', '200653', 'Ingehouden voorheffingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200660, 'MAR-VERKORT', 'THIRDPARTY', '454', '200653', 'Rijksdienst voor Sociale Zekerheid', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200661, 'MAR-VERKORT', 'THIRDPARTY', '455', '200653', 'Bezoldigingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200662, 'MAR-VERKORT', 'THIRDPARTY', '456', '200653', 'Vakantiegeld', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200663, 'MAR-VERKORT', 'THIRDPARTY', '459', '200653', 'Andere sociale schulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200664, 'MAR-VERKORT', 'THIRDPARTY', '46', '200605', 'Vooruitbetalingen op bestellingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200665, 'MAR-VERKORT', 'THIRDPARTY', '47', '200605', 'Schulden uit de bestemming van het resultaat', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200666, 'MAR-VERKORT', 'THIRDPARTY', '470', '200665', 'Dividenden en tantièmes over vorige boekjaren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200667, 'MAR-VERKORT', 'THIRDPARTY', '471', '200665', 'Dividenden over het boekjaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200668, 'MAR-VERKORT', 'THIRDPARTY', '472', '200665', 'Tantièmes over het boekjaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200669, 'MAR-VERKORT', 'THIRDPARTY', '473', '200665', 'Andere rechthebbenden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200670, 'MAR-VERKORT', 'THIRDPARTY', '48', '200605', 'Diverse schulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200671, 'MAR-VERKORT', 'THIRDPARTY', '480', '200670', 'Vervallen obligaties en coupons', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200672, 'MAR-VERKORT', 'THIRDPARTY', '481', '200670', 'Te betalen subsidies, dotaties, toelagen en soortgelijke', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200673, 'MAR-VERKORT', 'THIRDPARTY', '488', '200670', 'Borgtochten ontvangen in contanten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200674, 'MAR-VERKORT', 'THIRDPARTY', '489', '200670', 'Andere diverse schulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200675, 'MAR-VERKORT', 'THIRDPARTY', '49', '200605', 'Overlopende rekeningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200676, 'MAR-VERKORT', 'THIRDPARTY', '490', '200675', 'Over te dragen kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200677, 'MAR-VERKORT', 'THIRDPARTY', '491', '200675', 'Verkregen opbrengsten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200678, 'MAR-VERKORT', 'THIRDPARTY', '492', '200675', 'Toe te rekenen kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200679, 'MAR-VERKORT', 'THIRDPARTY', '493', '200675', 'Over te dragen opbrengsten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200680, 'MAR-VERKORT', 'THIRDPARTY', '499', '200675', 'Wachtrekeningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200681, 'MAR-VERKORT', 'FINAN', '5', '0', 'Geldbeleggingen en liquide middelen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200682, 'MAR-VERKORT', 'FINAN', '50', '200681', 'Eigen aandelen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200683, 'MAR-VERKORT', 'FINAN', '51', '200681', 'Aandelen en geldbeleggingen andere dan vastrentende beleggingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200684, 'MAR-VERKORT', 'FINAN', '510', '200683', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200685, 'MAR-VERKORT', 'FINAN', '5100', '200684', 'Aandelen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200686, 'MAR-VERKORT', 'FINAN', '5101', '200684', 'Geldbeleggingen andere dan vastrentende effecten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200687, 'MAR-VERKORT', 'FINAN', '511', '200683', 'Niet-opgevraagde bedragen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200688, 'MAR-VERKORT', 'FINAN', '5110', '200687', 'Aandelen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200689, 'MAR-VERKORT', 'FINAN', '519', '200683', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200690, 'MAR-VERKORT', 'FINAN', '5190', '200689', 'Aandelen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200691, 'MAR-VERKORT', 'FINAN', '5191', '200689', 'Geldbeleggingen andere dan vastrentende effecten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200692, 'MAR-VERKORT', 'FINAN', '52', '200681', 'Vastrentende effecten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200693, 'MAR-VERKORT', 'FINAN', '520', '200692', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200694, 'MAR-VERKORT', 'FINAN', '529', '200692', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200695, 'MAR-VERKORT', 'FINAN', '53', '200681', 'Termijndeposito’s', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200696, 'MAR-VERKORT', 'FINAN', '530', '200695', 'Op meer dan één jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200697, 'MAR-VERKORT', 'FINAN', '531', '200695', 'Op meer dan een maand en op ten hoogste 1 jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200698, 'MAR-VERKORT', 'FINAN', '532', '200695', 'Op ten hoogste 1 maand', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200699, 'MAR-VERKORT', 'FINAN', '539', '200695', 'Geboekte waardeverminderingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200700, 'MAR-VERKORT', 'FINAN', '54', '200681', 'Te incasseren vervallen waarden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200701, 'MAR-VERKORT', 'FINAN', '55', '200681', 'Kredietinstellingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200702, 'MAR-VERKORT', 'FINAN', '57', '200681', 'Kassen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200703, 'MAR-VERKORT', 'FINAN', '578', '200702', 'Kassen-zegels', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200704, 'MAR-VERKORT', 'FINAN', '58', '200681', 'Interne overboekingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200705, 'MAR-VERKORT', 'EXPENSE', '6', '0', 'Kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200706, 'MAR-VERKORT', 'EXPENSE', '60', '200705', 'Handelsgoederen, grond- en hulpstoffen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200707, 'MAR-VERKORT', 'EXPENSE', '600', '200706', 'Aankopen van grondstoffen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200708, 'MAR-VERKORT', 'EXPENSE', '601', '200706', 'Aankopen van hulpstoffen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200709, 'MAR-VERKORT', 'EXPENSE', '602', '200706', 'Aankopen van diensten, werken en studies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200710, 'MAR-VERKORT', 'EXPENSE', '603', '200706', 'Algemene onderaannemingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200711, 'MAR-VERKORT', 'EXPENSE', '604', '200706', 'Aankopen van handelsgoederen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200712, 'MAR-VERKORT', 'EXPENSE', '605', '200706', 'Aankopen van onroerende goederen bestemd voor verkoop', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200713, 'MAR-VERKORT', 'EXPENSE', '609', '200706', 'Voorraadwijzigingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200714, 'MAR-VERKORT', 'EXPENSE', '6090', '200713', 'van grondstoffen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200715, 'MAR-VERKORT', 'EXPENSE', '6091', '200713', 'van hulpstoffen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200716, 'MAR-VERKORT', 'EXPENSE', '6094', '200713', 'van handelsgoederen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200717, 'MAR-VERKORT', 'EXPENSE', '6095', '200713', 'van gekochte onroerende goederen bestemd voor verkoop', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200718, 'MAR-VERKORT', 'EXPENSE', '61', '200705', 'Diensten en diverse goederen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200719, 'MAR-VERKORT', 'EXPENSE', '617', '200718', 'Uitzendkrachten en personen ter beschikking gesteld van de onderneming', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200720, 'MAR-VERKORT', 'EXPENSE', '618', '200718', 'Bezoldigingen, premies voor buitenwettelijke verzekeringen, ouderdoms- en overlevingspensioenen van bestuurders, zaakvoerders en werkende vennoten, die niet worden toegekend uit hoofde van een arbeidsovereenkomst', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200721, 'MAR-VERKORT', 'EXPENSE', '62', '200705', 'Bezoldigingen, sociale lasten en pensioenen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200722, 'MAR-VERKORT', 'EXPENSE', '620', '200721', 'Rechtstreekse sociale voordelen en bezoldigingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200723, 'MAR-VERKORT', 'EXPENSE', '6200', '200722', 'Bestuurders of zaakvoerders', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200724, 'MAR-VERKORT', 'EXPENSE', '6201', '200722', 'Directiepersoneel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200725, 'MAR-VERKORT', 'EXPENSE', '6202', '200722', 'Bedienden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200726, 'MAR-VERKORT', 'EXPENSE', '6203', '200722', 'Arbeiders', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200727, 'MAR-VERKORT', 'EXPENSE', '6204', '200722', 'Andere personeelsleden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200728, 'MAR-VERKORT', 'EXPENSE', '621', '200721', 'Werkgeversbijdragen voor sociale verzekeringen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200729, 'MAR-VERKORT', 'EXPENSE', '622', '200721', 'Werkgeverspremies voor bovenwettelijke verzekeringen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200730, 'MAR-VERKORT', 'EXPENSE', '623', '200721', 'Andere personeelskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200731, 'MAR-VERKORT', 'EXPENSE', '624', '200721', 'Ouderdoms- en overlevingspensioenen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200732, 'MAR-VERKORT', 'EXPENSE', '6240', '200731', 'Bestuurders of zaakvoerders', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200733, 'MAR-VERKORT', 'EXPENSE', '6241', '200731', 'Personeel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200734, 'MAR-VERKORT', 'EXPENSE', '63', '200705', 'Afschrijvingen, waardeverminderingen en voorzieningen voor risico’s', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200735, 'MAR-VERKORT', 'EXPENSE', '630', '200734', 'Afschrijvingen en waardeverminderingen op vaste activa (toevoeging)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200736, 'MAR-VERKORT', 'EXPENSE', '631', '200734', 'Waardeverminderingen op voorraden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200737, 'MAR-VERKORT', 'EXPENSE', '6310', '200736', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200738, 'MAR-VERKORT', 'EXPENSE', '6311', '200736', 'Terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200739, 'MAR-VERKORT', 'EXPENSE', '632', '200734', 'Waardeverminderingen op bestellingen in uitvoering', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200740, 'MAR-VERKORT', 'EXPENSE', '6320', '200739', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200741, 'MAR-VERKORT', 'EXPENSE', '6321', '200739', 'Terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200742, 'MAR-VERKORT', 'EXPENSE', '633', '200734', 'Waardeverminderingen op handelsvorderingen op meer dan één jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200743, 'MAR-VERKORT', 'EXPENSE', '6330', '200742', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200744, 'MAR-VERKORT', 'EXPENSE', '6331', '200742', 'Terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200745, 'MAR-VERKORT', 'EXPENSE', '634', '200734', 'Waardeverminderingen op handelsvorderingen op ten hoogste één jaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200746, 'MAR-VERKORT', 'EXPENSE', '6340', '200745', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200747, 'MAR-VERKORT', 'EXPENSE', '6341', '200745', 'Terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200748, 'MAR-VERKORT', 'EXPENSE', '635', '200734', 'Voorzieningen voor pensioenen en soortgelijke verplichtingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200749, 'MAR-VERKORT', 'EXPENSE', '6350', '200748', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200750, 'MAR-VERKORT', 'EXPENSE', '6351', '200748', 'Besteding en terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200751, 'MAR-VERKORT', 'EXPENSE', '636', '200734', 'Voorzieningen voor grote herstellingswerken en grote onderhoudswerken', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200752, 'MAR-VERKORT', 'EXPENSE', '6360', '200751', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200753, 'MAR-VERKORT', 'EXPENSE', '6361', '200751', 'Besteding en terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200754, 'MAR-VERKORT', 'EXPENSE', '637', '200734', 'Voorzieningen voor milieuverplichtingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200755, 'MAR-VERKORT', 'EXPENSE', '6370', '200754', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200756, 'MAR-VERKORT', 'EXPENSE', '6371', '200754', 'Besteding en terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200757, 'MAR-VERKORT', 'EXPENSE', '638', '200734', 'Voorzieningen voor andere risico’s en kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200758, 'MAR-VERKORT', 'EXPENSE', '6380', '200757', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200759, 'MAR-VERKORT', 'EXPENSE', '6381', '200757', 'Besteding en terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200760, 'MAR-VERKORT', 'EXPENSE', '64', '200705', 'Andere bedrijfskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200761, 'MAR-VERKORT', 'EXPENSE', '640', '200760', 'Bedrijfsbelastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200762, 'MAR-VERKORT', 'EXPENSE', '641', '200760', 'Minwaarden op de courante realisatie van vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200763, 'MAR-VERKORT', 'EXPENSE', '642', '200760', 'Minderwaarden op de realisatie van handelsvorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200764, 'MAR-VERKORT', 'EXPENSE', '649', '200760', 'Als herstructureringskosten geactiveerde bedrijfskosten (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200765, 'MAR-VERKORT', 'EXPENSE', '65', '200705', 'Financiële kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200766, 'MAR-VERKORT', 'EXPENSE', '650', '200765', 'Kosten van schulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200767, 'MAR-VERKORT', 'EXPENSE', '6500', '200766', 'Rente, commissies en kosten verbonden aan schulden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200768, 'MAR-VERKORT', 'EXPENSE', '6501', '200766', 'Afschrijving van kosten bij uitgifte van leningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200769, 'MAR-VERKORT', 'EXPENSE', '6502', '200766', 'Geactiveerde intercalaire intresten (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200770, 'MAR-VERKORT', 'EXPENSE', '651', '200765', 'Waardeverminderingen op vlottende activa (6)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200771, 'MAR-VERKORT', 'EXPENSE', '6510', '200770', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200772, 'MAR-VERKORT', 'EXPENSE', '6511', '200770', 'Terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200773, 'MAR-VERKORT', 'EXPENSE', '652', '200765', 'Minderwaarde op de realisatie van vlottende activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200774, 'MAR-VERKORT', 'EXPENSE', '653', '200765', 'Discontokost op vorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200775, 'MAR-VERKORT', 'EXPENSE', '654', '200765', 'Wisselresultaten (7)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200776, 'MAR-VERKORT', 'EXPENSE', '655', '200765', 'Resultaten uit de omrekening van vreemde valuta (7)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200777, 'MAR-VERKORT', 'EXPENSE', '656', '200765', 'Voorzieningen met financieel karakter (+)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200778, 'MAR-VERKORT', 'EXPENSE', '6560', '200777', 'Toevoeging', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200779, 'MAR-VERKORT', 'EXPENSE', '6561', '200777', 'Besteding en terugneming (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200780, 'MAR-VERKORT', 'EXPENSE', '659', '200765', 'Als herstructureringskosten geactiveerde financiële kosten (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200781, 'MAR-VERKORT', 'EXPENSE', '66', '200705', 'Niet-recurrente bedrijfs- of financiële kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200782, 'MAR-VERKORT', 'EXPENSE', '660', '200781', 'Niet-recurrente afschrijvingen en waardeverminderingen (toevoeging)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200783, 'MAR-VERKORT', 'EXPENSE', '6600', '200782', 'op oprichtingskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200784, 'MAR-VERKORT', 'EXPENSE', '6601', '200782', 'op immateriële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200785, 'MAR-VERKORT', 'EXPENSE', '6602', '200782', 'op materiële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200786, 'MAR-VERKORT', 'EXPENSE', '661', '200781', 'Waardeverminderingen op financiële vaste activa (toevoeging)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200787, 'MAR-VERKORT', 'EXPENSE', '662', '200781', 'Voorzieningen voor niet-recurrente risico’s en kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200788, 'MAR-VERKORT', 'EXPENSE', '6620', '200787', 'Voorzieningen voor niet-recurrente bedrijfsrisico’s en kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200789, 'MAR-VERKORT', 'EXPENSE', '6621', '200787', 'Voorzieningen voor niet-recurrente financiële risico’s en kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200790, 'MAR-VERKORT', 'EXPENSE', '663', '200781', 'Minderwaarden op realisatie van vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200791, 'MAR-VERKORT', 'EXPENSE', '668', '200781', 'Andere niet-recurrente financiële kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200792, 'MAR-VERKORT', 'EXPENSE', '67', '200705', 'Belastingen op het resultaat', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200793, 'MAR-VERKORT', 'EXPENSE', '670', '200792', 'Belgische belastingen op het resultaat van het boekjaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200794, 'MAR-VERKORT', 'EXPENSE', '6700', '200793', 'Verschuldigde of gestorte belastingen en voorheffingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200795, 'MAR-VERKORT', 'EXPENSE', '6701', '200793', 'Geactiveerde overschotten van betaalde belastingen en voorheffingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200796, 'MAR-VERKORT', 'EXPENSE', '6702', '200793', 'Geraamde belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200797, 'MAR-VERKORT', 'EXPENSE', '671', '200792', 'Belgische belastingen op het resultaat van vorige boekjaren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200798, 'MAR-VERKORT', 'EXPENSE', '6710', '200797', 'Verschuldigde of gestorte belastingsupplementen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200799, 'MAR-VERKORT', 'EXPENSE', '6711', '200797', 'Geraamde belastingsupplementen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200800, 'MAR-VERKORT', 'EXPENSE', '6712', '200797', 'Gevormde fiscale voorzieningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200801, 'MAR-VERKORT', 'EXPENSE', '672', '200792', 'Buitenlandse belastingen op het resultaat van het boekjaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200802, 'MAR-VERKORT', 'EXPENSE', '673', '200792', 'Buitenlandse belastingen op het resultaat van vorige boekjaren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200803, 'MAR-VERKORT', 'EXPENSE', '68', '200705', 'Overboeking naar de uitgestelde belastingen en naar de belastingvrije reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200804, 'MAR-VERKORT', 'EXPENSE', '680', '200803', 'Overboeking naar de uitgestelde belastingen (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200805, 'MAR-VERKORT', 'EXPENSE', '689', '200803', 'Overboeking naar de belastingvrije reserves (-)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200806, 'MAR-VERKORT', 'EXPENSE', '69', '200705', 'Resultaatverwerking', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200807, 'MAR-VERKORT', 'EXPENSE', '690', '200806', 'Overgedragen verlies van het vorige boekjaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200808, 'MAR-VERKORT', 'EXPENSE', '691', '200806', 'Toevoeging aan het kapitaal en aan de uitgiftepremie', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200809, 'MAR-VERKORT', 'EXPENSE', '692', '200806', 'Toevoeging aan de reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200810, 'MAR-VERKORT', 'EXPENSE', '6920', '200809', 'Toevoeging aan de wettelijke reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200811, 'MAR-VERKORT', 'EXPENSE', '6921', '200809', 'Toevoeging aan de overige reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200812, 'MAR-VERKORT', 'EXPENSE', '693', '200806', 'Over te dragen winst', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200813, 'MAR-VERKORT', 'EXPENSE', '694', '200806', 'Vergoeding van het kapitaal', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200814, 'MAR-VERKORT', 'EXPENSE', '695', '200806', 'Bestuurders of zaakvoerders', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200815, 'MAR-VERKORT', 'EXPENSE', '696', '200806', 'Werknemers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200816, 'MAR-VERKORT', 'EXPENSE', '697', '200806', 'Andere rechthebbenden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200817, 'MAR-VERKORT', 'INCOME', '7', '0', 'Opbrengsten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200818, 'MAR-VERKORT', 'INCOME', '70', '200817', 'Omzet', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200819, 'MAR-VERKORT', 'INCOME', '708', '200818', 'Toegekende kortingen, ristorno’s en rabatten (-) (8)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200820, 'MAR-VERKORT', 'INCOME', '71', '200817', 'Wijzigingen in de voorraden en bestellingen in uitvoering', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200821, 'MAR-VERKORT', 'INCOME', '712', '200820', 'in de voorraad goederen in bewerking', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200822, 'MAR-VERKORT', 'INCOME', '713', '200820', 'in de voorraad gereed product', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200823, 'MAR-VERKORT', 'INCOME', '715', '200820', 'in de voorraad onroerende goederen bestemd voor verkoop', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200824, 'MAR-VERKORT', 'INCOME', '717', '200820', 'in de bestellingen in uitvoering', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200825, 'MAR-VERKORT', 'INCOME', '7170', '200824', 'Aanschaffingswaarde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200826, 'MAR-VERKORT', 'INCOME', '7171', '200824', 'Toegerekende winst', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200827, 'MAR-VERKORT', 'INCOME', '72', '200817', 'Geproduceerde vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200828, 'MAR-VERKORT', 'INCOME', '74', '200817', 'Andere bedrijfsopbrengsten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200829, 'MAR-VERKORT', 'INCOME', '740', '200828', 'Bedrijfssubsidies en compenserende bedragen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200830, 'MAR-VERKORT', 'INCOME', '741', '200828', 'Meerwaarde op de courante realisatie van materiële vast activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200831, 'MAR-VERKORT', 'INCOME', '742', '200828', 'Meerwaarde op de realisatie van handelsvorderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200832, 'MAR-VERKORT', 'INCOME', '75', '200817', 'Financiële opbrengsten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200833, 'MAR-VERKORT', 'INCOME', '750', '200832', 'Opbrengsten uit financiële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200834, 'MAR-VERKORT', 'INCOME', '751', '200832', 'Opbrengsten uit vlottende activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200835, 'MAR-VERKORT', 'INCOME', '752', '200832', 'Meerwaarde op de realisatie van vlottende activa (6)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200836, 'MAR-VERKORT', 'INCOME', '753', '200832', 'Kapitaal – en interestsubsidies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200837, 'MAR-VERKORT', 'INCOME', '754', '200832', 'Wisselresultaten (7)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200838, 'MAR-VERKORT', 'INCOME', '755', '200832', 'Resultaten uit de omrekening van vreemde valuta (7)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200839, 'MAR-VERKORT', 'INCOME', '76', '200817', 'Niet-recurrente bedrijfs- of financiële opbrengsten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200840, 'MAR-VERKORT', 'INCOME', '760', '200839', 'Terugneming van afschrijvingen en waardeverminderingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200841, 'MAR-VERKORT', 'INCOME', '7600', '200840', 'op immateriële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200842, 'MAR-VERKORT', 'INCOME', '7601', '200840', 'op materiële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200843, 'MAR-VERKORT', 'INCOME', '761', '200839', 'Terugneming van waardeverminderingen op financiële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200844, 'MAR-VERKORT', 'INCOME', '762', '200839', 'Terugneming van voorzieningen voor niet-recurrente risico’s en kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200845, 'MAR-VERKORT', 'INCOME', '7620', '200844', 'Terugneming van voorzieningen voor niet-recurrente bedrijfsrisico’s en kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200846, 'MAR-VERKORT', 'INCOME', '7621', '200844', 'Terugneming van voorzieningen voor niet-recurrente financiële risico’s en kosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200847, 'MAR-VERKORT', 'INCOME', '763', '200839', 'Meerwaarden op de realisatie van vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200848, 'MAR-VERKORT', 'INCOME', '7630', '200847', 'Meerwaarde op de realisatie van immateriële en materiële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200849, 'MAR-VERKORT', 'INCOME', '7631', '200847', 'Meerwaarde op de realisatie van financiële vaste activa', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200850, 'MAR-VERKORT', 'INCOME', '769', '200839', 'Andere niet-recurrente financiële opbrengsten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200851, 'MAR-VERKORT', 'INCOME', '77', '200817', 'Regularisering van belastingen en terugneming van fiscale voorzieningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200852, 'MAR-VERKORT', 'INCOME', '771', '200851', 'Belgische belastingen op het resultaat', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200853, 'MAR-VERKORT', 'INCOME', '7710', '200852', 'Regularisering van verschuldigde of betaalde belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200854, 'MAR-VERKORT', 'INCOME', '7711', '200852', 'Regularisering van geraamde belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200855, 'MAR-VERKORT', 'INCOME', '7712', '200852', 'Terugneming van fiscale voorzieningen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200856, 'MAR-VERKORT', 'INCOME', '773', '200851', 'Buitenlandse belastingen op het resultaat', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200857, 'MAR-VERKORT', 'INCOME', '78', '200817', 'Onttrekking aan de belastingvrije reserves en de uitgestelde belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200858, 'MAR-VERKORT', 'INCOME', '780', '200857', 'Onttrekkingen aan de uitgestelde belastingen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200859, 'MAR-VERKORT', 'INCOME', '789', '200857', 'Onttrekkingen aan de belastingvrije reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200860, 'MAR-VERKORT', 'INCOME', '79', '200817', 'Resultaatverwerking', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200861, 'MAR-VERKORT', 'INCOME', '790', '200860', 'Overgedragen winst van het vorige boekjaar', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200862, 'MAR-VERKORT', 'INCOME', '791', '200860', 'Onttrekking aan het kapitaal en aan de uitgiftepremies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200863, 'MAR-VERKORT', 'INCOME', '792', '200860', 'Onttrekking aan de reserves', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200864, 'MAR-VERKORT', 'INCOME', '793', '200860', 'Over te dragen verlies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200865, 'MAR-VERKORT', 'INCOME', '794', '200860', 'Tussenkomst van vennoten (of van de eigenaar) in het verlies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10439, 'MAR-VERKORT', 'CAPIT', '1', '0', 'Eigen vermogen, voorzieningen voor risico''s en kosten en schulden op meer dan één jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10440, 'MAR-VERKORT', 'CAPIT', '10', '10439', 'Kapitaal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10441, 'MAR-VERKORT', 'CAPIT', '100', '10440', 'Geplaatst kapitaal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10442, 'MAR-VERKORT', 'CAPIT', '101', '10440', 'Niet-opgevraagd kapitaal (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10443, 'MAR-VERKORT', 'CAPIT', '11', '10439', 'Uitgiftepremies (+)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10444, 'MAR-VERKORT', 'CAPIT', '12', '10439', 'Herwaarderingsmeerwaarden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10445, 'MAR-VERKORT', 'CAPIT', '120', '10444', 'Herwaarderingsmeerwaarden op immateriële vaste activa (+)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10446, 'MAR-VERKORT', 'CAPIT', '121', '10444', 'Herwaarderingsmeerwaarden op materiële vaste activa (+)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10447, 'MAR-VERKORT', 'CAPIT', '122', '10444', 'Herwaarderingsmeerwaarden op financiële vaste activa (+)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10448, 'MAR-VERKORT', 'CAPIT', '123', '10444', 'Herwaarderingsmeerwaarden op voorraden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10449, 'MAR-VERKORT', 'CAPIT', '124', '10444', 'Terugneming van waardeverminderingen op geldbeleggingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10450, 'MAR-VERKORT', 'CAPIT', '13', '10439', 'Reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10451, 'MAR-VERKORT', 'CAPIT', '130', '10450', 'Wettelijke reserve', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10452, 'MAR-VERKORT', 'CAPIT', '131', '10450', 'Onbeschikbare reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10453, 'MAR-VERKORT', 'CAPIT', '1310', '10452', 'Reserve voor eigen aandelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10454, 'MAR-VERKORT', 'CAPIT', '1311', '10452', 'Andere onbeschikbare reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10455, 'MAR-VERKORT', 'CAPIT', '132', '10450', 'Belastingvrije reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10456, 'MAR-VERKORT', 'CAPIT', '133', '10450', 'Beschikbare reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10457, 'MAR-VERKORT', 'CAPIT', '14', '10439', 'Overgedragen Winst of Overgedragen verlies (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10458, 'MAR-VERKORT', 'CAPIT', '15', '10439', 'Kapitaalsubsidies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10459, 'MAR-VERKORT', 'CAPIT', '16', '10439', 'Voorzieningen en Uitgestelde belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10460, 'MAR-VERKORT', 'CAPIT', '160', '10459', 'Voorzieningen voor pensioenen en soortgelijke verplichtingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10461, 'MAR-VERKORT', 'CAPIT', '161', '10459', 'Voorzieningen voor belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10462, 'MAR-VERKORT', 'CAPIT', '162', '10459', 'Voorzieningen voor grote herstellingswerken en grote onderhoudswerken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10463, 'MAR-VERKORT', 'CAPIT', '163', '10459', 'Voorzieningen voor milieuverplichtingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10464, 'MAR-VERKORT', 'CAPIT', '168', '10459', 'Uitgestelde belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10465, 'MAR-VERKORT', 'CAPIT', '1680', '10464', 'Uitgestelde belastingen op kapitaalsubsidies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10466, 'MAR-VERKORT', 'CAPIT', '1681', '10464', 'Uitgestelde belastingen op gerealiseerde meerwaarden op immateriële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10467, 'MAR-VERKORT', 'CAPIT', '1682', '10464', 'Uitgestelde belastingen op gerealiseerde meerwaarden op materiële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10468, 'MAR-VERKORT', 'CAPIT', '1687', '10464', 'Uitgestelde belastingen op gerealiseerde meerwaarden op effecten die zijn uitgegeven door de Belgische openbare sector', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10469, 'MAR-VERKORT', 'CAPIT', '1688', '10464', 'Buitenlandse uitgestelde belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10470, 'MAR-VERKORT', 'CAPIT', '17', '10439', 'Schulden op meer dan één jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10471, 'MAR-VERKORT', 'CAPIT', '170', '10470', 'Achtergestelde leningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10472, 'MAR-VERKORT', 'CAPIT', '1700', '10471', 'Converteerbaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10473, 'MAR-VERKORT', 'CAPIT', '1701', '10471', 'Niet-converteerbaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10474, 'MAR-VERKORT', 'CAPIT', '171', '10470', 'Niet achtergestelde obligatieleningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10475, 'MAR-VERKORT', 'CAPIT', '1710', '10474', 'Converteerbaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10476, 'MAR-VERKORT', 'CAPIT', '1711', '10474', 'Niet-converteerbaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10477, 'MAR-VERKORT', 'CAPIT', '172', '10470', 'Leasingschulden en soortgelijke', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10478, 'MAR-VERKORT', 'CAPIT', '173', '10470', 'Kredietinstellingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10479, 'MAR-VERKORT', 'CAPIT', '1730', '10478', 'Schulden op rekening', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10480, 'MAR-VERKORT', 'CAPIT', '1731', '10478', 'Promessen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10481, 'MAR-VERKORT', 'CAPIT', '1732', '10478', 'Acceptkredieten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10482, 'MAR-VERKORT', 'CAPIT', '174', '10470', 'Overige leningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10483, 'MAR-VERKORT', 'CAPIT', '175', '10470', 'Handelsschulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10484, 'MAR-VERKORT', 'CAPIT', '1750', '10483', 'Leveranciers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10485, 'MAR-VERKORT', 'CAPIT', '1751', '10483', 'Te betalen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10486, 'MAR-VERKORT', 'CAPIT', '176', '10470', 'Vooruitbetalingen op bestellingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10487, 'MAR-VERKORT', 'CAPIT', '178', '10470', 'Borgtochten ontvangen in contanten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10488, 'MAR-VERKORT', 'CAPIT', '179', '10470', 'Overige schulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10489, 'MAR-VERKORT', 'CAPIT', '19', '10439', 'Voorschot aan de vennoten op de verdeling van het nettoactief (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10490, 'MAR-VERKORT', 'IMMO', '2', '0', 'Oprichtingskosten, vaste activa en vorderingen op meer dan één jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10491, 'MAR-VERKORT', 'IMMO', '20', '10490', 'Oprichtingskosten (1)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10492, 'MAR-VERKORT', 'IMMO', '200', '10491', 'Kosten voor oprichting en kapitaalsverhoging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10493, 'MAR-VERKORT', 'IMMO', '201', '10491', 'Kosten bij uitgifte van leningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10494, 'MAR-VERKORT', 'IMMO', '202', '10491', 'Overige oprichtingskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10495, 'MAR-VERKORT', 'IMMO', '203', '10491', '', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10496, 'MAR-VERKORT', 'IMMO', '204', '10491', 'Herstructureringskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10497, 'MAR-VERKORT', 'IMMO', '21', '10490', 'Immateriële vaste activa (1)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10498, 'MAR-VERKORT', 'IMMO', '210', '10497', 'Kosten voor onderzoek en ontwikkeling', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10499, 'MAR-VERKORT', 'IMMO', '211', '10497', 'Concessies, octrooien, licenties, know how, merken en soorgelijke rechten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10500, 'MAR-VERKORT', 'IMMO', '212', '10497', 'Goodwill', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10501, 'MAR-VERKORT', 'IMMO', '213', '10497', 'Vooruitbetalingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10502, 'MAR-VERKORT', 'IMMO', '214', '10497', 'Software', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10503, 'MAR-VERKORT', 'IMMO', '215', '10497', 'Databanken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10504, 'MAR-VERKORT', 'IMMO', '216', '10497', 'Emissierechten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10505, 'MAR-VERKORT', 'IMMO', '219', '10497', 'Overige immateriële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10506, 'MAR-VERKORT', 'IMMO', '22', '10490', 'Terreinen en gebouwen (1)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10507, 'MAR-VERKORT', 'IMMO', '220', '10506', 'Terreinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10508, 'MAR-VERKORT', 'IMMO', '221', '10506', 'Gebouwen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10509, 'MAR-VERKORT', 'IMMO', '222', '10506', 'Bebouwde terreinen (2)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10510, 'MAR-VERKORT', 'IMMO', '223', '10506', 'Overige zakelijke rechten op onroerende goederen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10511, 'MAR-VERKORT', 'IMMO', '224', '10506', 'Autosnelwegen, wegen en fietspaden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10512, 'MAR-VERKORT', 'IMMO', '225', '10506', 'Vliegvelden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10513, 'MAR-VERKORT', 'IMMO', '226', '10506', 'Waterbouwkundige werken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10514, 'MAR-VERKORT', 'IMMO', '227', '10506', 'Havens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10515, 'MAR-VERKORT', 'IMMO', '228', '10506', 'Openbaar vervoer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10516, 'MAR-VERKORT', 'IMMO', '229', '10506', 'Overige werken van burgelijke bouwkunde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10517, 'MAR-VERKORT', 'IMMO', '23', '10490', 'Installaties, machines en uitrusting (1)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10518, 'MAR-VERKORT', 'IMMO', '24', '10490', 'Meubilair en rollend materieel (1)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10519, 'MAR-VERKORT', 'IMMO', '240', '10518', 'Rollend materieel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10520, 'MAR-VERKORT', 'IMMO', '241', '10518', 'Varend materieel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10521, 'MAR-VERKORT', 'IMMO', '242', '10518', 'Vliegend materieel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10522, 'MAR-VERKORT', 'IMMO', '243', '10518', 'Informatica en telematica materieel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10523, 'MAR-VERKORT', 'IMMO', '244', '10518', 'Kantoormeubilair', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10524, 'MAR-VERKORT', 'IMMO', '245', '10518', 'Werken van bibliotheken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10525, 'MAR-VERKORT', 'IMMO', '246', '10518', 'Kunstvoorwerpen en -werken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10526, 'MAR-VERKORT', 'IMMO', '25', '10490', 'Vaste activa in leasing of op grond van een soortgelijk recht (1)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10527, 'MAR-VERKORT', 'IMMO', '250', '10526', 'Terreinen en gebouwen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10528, 'MAR-VERKORT', 'IMMO', '251', '10526', 'Installaties, machines en uitrusting', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10529, 'MAR-VERKORT', 'IMMO', '252', '10526', 'Meubilair en rollend materieel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10530, 'MAR-VERKORT', 'IMMO', '26', '10490', 'Overige materiële vaste activa (1)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10531, 'MAR-VERKORT', 'IMMO', '27', '10490', 'Vaste activa in aanbouw en vooruitbetalingen (1)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10532, 'MAR-VERKORT', 'IMMO', '28', '10490', 'Financiële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10533, 'MAR-VERKORT', 'IMMO', '280', '10532', 'Deelnemingen in verbonden ondernemingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10534, 'MAR-VERKORT', 'IMMO', '2800', '10533', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10535, 'MAR-VERKORT', 'IMMO', '2801', '10533', 'Nog te storten bedragen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10536, 'MAR-VERKORT', 'IMMO', '2808', '10533', 'Geboekte meerwaarden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10537, 'MAR-VERKORT', 'IMMO', '2809', '10533', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10538, 'MAR-VERKORT', 'IMMO', '281', '10532', 'Vorderingen op verbonden ondernemingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10539, 'MAR-VERKORT', 'IMMO', '2810', '10538', 'Vordering op rekening', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10540, 'MAR-VERKORT', 'IMMO', '2811', '10538', 'Te innen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10541, 'MAR-VERKORT', 'IMMO', '2812', '10538', 'Vastrentende effecten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10542, 'MAR-VERKORT', 'IMMO', '2817', '10538', 'Dubieuze debiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10543, 'MAR-VERKORT', 'IMMO', '2819', '10538', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10544, 'MAR-VERKORT', 'IMMO', '282', '10532', 'Deelnemingen in ondernemingen waarmee een deelnemingsverhouding bestaat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10545, 'MAR-VERKORT', 'IMMO', '2820', '10544', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10546, 'MAR-VERKORT', 'IMMO', '2821', '10544', 'Nog te storten bedragen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10547, 'MAR-VERKORT', 'IMMO', '2828', '10544', 'Geboekte meerwaarden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10548, 'MAR-VERKORT', 'IMMO', '2829', '10544', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10549, 'MAR-VERKORT', 'IMMO', '283', '10532', 'Vorderingen op ondernemingen waarmee een deelnemingsverhouding bestaat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10550, 'MAR-VERKORT', 'IMMO', '2830', '10549', 'Vordering op rekening', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10551, 'MAR-VERKORT', 'IMMO', '2831', '10549', 'Te innen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10552, 'MAR-VERKORT', 'IMMO', '2832', '10549', 'Vastrentende effecten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10553, 'MAR-VERKORT', 'IMMO', '2837', '10549', 'Dubieuze debiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10554, 'MAR-VERKORT', 'IMMO', '2839', '10549', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10555, 'MAR-VERKORT', 'IMMO', '284', '10532', 'Andere aandelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10556, 'MAR-VERKORT', 'IMMO', '2840', '10555', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10557, 'MAR-VERKORT', 'IMMO', '2841', '10555', 'Nog te storten bedragen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10558, 'MAR-VERKORT', 'IMMO', '2848', '10555', 'Geboekte meerwaarden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10559, 'MAR-VERKORT', 'IMMO', '2849', '10555', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10560, 'MAR-VERKORT', 'IMMO', '285', '10532', 'Overige vorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10561, 'MAR-VERKORT', 'IMMO', '2850', '10560', 'Vordering op rekening', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10562, 'MAR-VERKORT', 'IMMO', '2851', '10560', 'Te innen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10563, 'MAR-VERKORT', 'IMMO', '2852', '10560', 'Vastrentende effecten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10564, 'MAR-VERKORT', 'IMMO', '2857', '10560', 'Dubieuze debiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10565, 'MAR-VERKORT', 'IMMO', '2859', '10560', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10566, 'MAR-VERKORT', 'IMMO', '288', '10532', 'Borgtochten betaald in contanten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10567, 'MAR-VERKORT', 'IMMO', '29', '10490', 'Vorderingen op meer dan één jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10568, 'MAR-VERKORT', 'IMMO', '290', '10567', 'Handelsvorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10569, 'MAR-VERKORT', 'IMMO', '2900', '10568', 'Handelsdebiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10570, 'MAR-VERKORT', 'IMMO', '2901', '10568', 'Te innen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10571, 'MAR-VERKORT', 'IMMO', '2906', '10568', 'Vooruitbetalingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10572, 'MAR-VERKORT', 'IMMO', '2907', '10568', 'Dubieuze debiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10573, 'MAR-VERKORT', 'IMMO', '2909', '10568', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10574, 'MAR-VERKORT', 'IMMO', '291', '10567', 'Overige vorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10575, 'MAR-VERKORT', 'IMMO', '2910', '10574', 'Vordering op rekening', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10576, 'MAR-VERKORT', 'IMMO', '2911', '10574', 'Te innen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10577, 'MAR-VERKORT', 'IMMO', '2917', '10574', 'Dubieuze debiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10578, 'MAR-VERKORT', 'IMMO', '2919', '10574', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10579, 'MAR-VERKORT', 'STOCK', '3', '0', 'Voorraden en bestellingen in uitvoering', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10580, 'MAR-VERKORT', 'STOCK', '30', '10579', 'Grondstoffen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10581, 'MAR-VERKORT', 'STOCK', '300', '10580', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10582, 'MAR-VERKORT', 'STOCK', '309', '10580', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10583, 'MAR-VERKORT', 'STOCK', '31', '10579', 'Hulpstoffen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10584, 'MAR-VERKORT', 'STOCK', '310', '10583', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10585, 'MAR-VERKORT', 'STOCK', '319', '10583', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10586, 'MAR-VERKORT', 'STOCK', '32', '10579', 'Goederen in bewerking', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10587, 'MAR-VERKORT', 'STOCK', '320', '10586', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10588, 'MAR-VERKORT', 'STOCK', '329', '10586', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10589, 'MAR-VERKORT', 'STOCK', '33', '10579', 'Gereed product', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10590, 'MAR-VERKORT', 'STOCK', '330', '10589', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10591, 'MAR-VERKORT', 'STOCK', '339', '10589', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10592, 'MAR-VERKORT', 'STOCK', '34', '10579', 'Handelsgoederen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10593, 'MAR-VERKORT', 'STOCK', '340', '10592', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10594, 'MAR-VERKORT', 'STOCK', '349', '10592', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10595, 'MAR-VERKORT', 'STOCK', '35', '10579', 'Onroerende goederen bestemd voor verkoop', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10596, 'MAR-VERKORT', 'STOCK', '350', '10595', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10597, 'MAR-VERKORT', 'STOCK', '359', '10595', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10598, 'MAR-VERKORT', 'STOCK', '36', '10579', 'Vooruitbetalingen op voorraadinkopen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10599, 'MAR-VERKORT', 'STOCK', '360', '10598', 'Vooruitbetalingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10600, 'MAR-VERKORT', 'STOCK', '369', '10598', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10601, 'MAR-VERKORT', 'STOCK', '37', '10579', 'Bestellingen in uitvoering', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10602, 'MAR-VERKORT', 'STOCK', '370', '10601', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10603, 'MAR-VERKORT', 'STOCK', '371', '10601', 'Toegerekende winst', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10604, 'MAR-VERKORT', 'STOCK', '379', '10601', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10605, 'MAR-VERKORT', 'THIRDPARTY', '4', '0', 'Vorderingen en schulden op ten hoogste een jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10606, 'MAR-VERKORT', 'THIRDPARTY', '40', '10605', 'Handelsvorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10607, 'MAR-VERKORT', 'THIRDPARTY', '400', '10606', 'Handelsdebiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10608, 'MAR-VERKORT', 'THIRDPARTY', '401', '10606', 'Te innen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10609, 'MAR-VERKORT', 'THIRDPARTY', '404', '10606', 'Te innen opbrengsten (3)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10610, 'MAR-VERKORT', 'THIRDPARTY', '406', '10606', 'Vooruitbetalingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10611, 'MAR-VERKORT', 'THIRDPARTY', '407', '10606', 'Dubieuze debiteuren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10612, 'MAR-VERKORT', 'THIRDPARTY', '409', '10606', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10613, 'MAR-VERKORT', 'THIRDPARTY', '41', '10605', 'Overige vorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10614, 'MAR-VERKORT', 'THIRDPARTY', '410', '10613', 'Opgevraagd, niet-gestort kapitaal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10615, 'MAR-VERKORT', 'THIRDPARTY', '411', '10613', 'Terug te vorderen BTW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10616, 'MAR-VERKORT', 'THIRDPARTY', '412', '10613', 'Terug te vorderen belastingen en voorheffingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10617, 'MAR-VERKORT', 'THIRDPARTY', '4128', '10616', 'Buitenlandse belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10618, 'MAR-VERKORT', 'THIRDPARTY', '413', '10613', 'Overige vorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10619, 'MAR-VERKORT', 'THIRDPARTY', '414', '10613', 'Te innen opbrengsten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10620, 'MAR-VERKORT', 'THIRDPARTY', '416', '10613', 'Diverse vorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10621, 'MAR-VERKORT', 'THIRDPARTY', '417', '10613', 'Dubieuze vorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10622, 'MAR-VERKORT', 'THIRDPARTY', '418', '10613', 'Borgtochten betaald in contanten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10623, 'MAR-VERKORT', 'THIRDPARTY', '419', '10613', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10624, 'MAR-VERKORT', 'THIRDPARTY', '42', '10605', 'Schulden op meer dan één jaar die binnen het jaar vervallen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10625, 'MAR-VERKORT', 'THIRDPARTY', '420', '10624', 'Achtergestelde leningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10626, 'MAR-VERKORT', 'THIRDPARTY', '4200', '10625', 'Converteerbaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10627, 'MAR-VERKORT', 'THIRDPARTY', '4201', '10625', 'Niet-converteerbaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10628, 'MAR-VERKORT', 'THIRDPARTY', '421', '10624', 'Niet achtergestelde obligatieleningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10629, 'MAR-VERKORT', 'THIRDPARTY', '4210', '10628', 'Converteerbaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10630, 'MAR-VERKORT', 'THIRDPARTY', '4211', '10628', 'Niet-converteerbaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10631, 'MAR-VERKORT', 'THIRDPARTY', '422', '10624', 'Leasingschulden en soortgelijke', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10632, 'MAR-VERKORT', 'THIRDPARTY', '423', '10624', 'Kredietinstellingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10633, 'MAR-VERKORT', 'THIRDPARTY', '4230', '10632', 'Schulden op rekening', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10634, 'MAR-VERKORT', 'THIRDPARTY', '4231', '10632', 'Promessen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10635, 'MAR-VERKORT', 'THIRDPARTY', '4232', '10632', 'Acceptkredieten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10636, 'MAR-VERKORT', 'THIRDPARTY', '424', '10624', 'Overige leningen (+)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10637, 'MAR-VERKORT', 'THIRDPARTY', '425', '10624', 'Handelsschulden (+)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10638, 'MAR-VERKORT', 'THIRDPARTY', '4250', '10637', 'Leveranciers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10639, 'MAR-VERKORT', 'THIRDPARTY', '4251', '10637', 'Te betalen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10640, 'MAR-VERKORT', 'THIRDPARTY', '426', '10624', 'Vooruitbetalingen op bestellingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10641, 'MAR-VERKORT', 'THIRDPARTY', '428', '10624', 'Borgtochten ontvangen in contanten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10642, 'MAR-VERKORT', 'THIRDPARTY', '429', '10624', 'Overige schulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10643, 'MAR-VERKORT', 'THIRDPARTY', '43', '10605', 'Financiële schulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10644, 'MAR-VERKORT', 'THIRDPARTY', '430', '10643', 'Kredietinstellingen – Leningen op rekeningen met vaste termijn', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10645, 'MAR-VERKORT', 'THIRDPARTY', '431', '10643', 'Kredietinstellingen – Promessen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10646, 'MAR-VERKORT', 'THIRDPARTY', '432', '10643', 'Kredietinstellingen – Acceptkrediet', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10647, 'MAR-VERKORT', 'THIRDPARTY', '433', '10643', 'Kredietinstellingen – Schulden in rekening courant (4)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10648, 'MAR-VERKORT', 'THIRDPARTY', '439', '10643', 'Overige leningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10649, 'MAR-VERKORT', 'THIRDPARTY', '44', '10605', 'Handelsschulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10650, 'MAR-VERKORT', 'THIRDPARTY', '440', '10649', 'Leveranciers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10651, 'MAR-VERKORT', 'THIRDPARTY', '441', '10649', 'Te betalen wissels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10652, 'MAR-VERKORT', 'THIRDPARTY', '444', '10649', 'Te ontvangen facturen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10653, 'MAR-VERKORT', 'THIRDPARTY', '45', '10605', 'Schulden met betrekking tot belastingen, bezoldigingen en sociale lasten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10654, 'MAR-VERKORT', 'THIRDPARTY', '450', '10653', 'Geraamd bedrag van de belastingschulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10655, 'MAR-VERKORT', 'THIRDPARTY', '4508', '10654', 'Buitenlandse belastingen en taksen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10656, 'MAR-VERKORT', 'THIRDPARTY', '451', '10653', 'Te betalen BTW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10657, 'MAR-VERKORT', 'THIRDPARTY', '452', '10653', 'Te betalen belastingen en taksen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10658, 'MAR-VERKORT', 'THIRDPARTY', '4528', '10657', 'Buitenlandse belastingen en taksen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10659, 'MAR-VERKORT', 'THIRDPARTY', '453', '10653', 'Ingehouden voorheffingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10660, 'MAR-VERKORT', 'THIRDPARTY', '454', '10653', 'Rijksdienst voor Sociale Zekerheid', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10661, 'MAR-VERKORT', 'THIRDPARTY', '455', '10653', 'Bezoldigingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10662, 'MAR-VERKORT', 'THIRDPARTY', '456', '10653', 'Vakantiegeld', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10663, 'MAR-VERKORT', 'THIRDPARTY', '459', '10653', 'Andere sociale schulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10664, 'MAR-VERKORT', 'THIRDPARTY', '46', '10605', 'Vooruitbetalingen op bestellingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10665, 'MAR-VERKORT', 'THIRDPARTY', '47', '10605', 'Schulden uit de bestemming van het resultaat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10666, 'MAR-VERKORT', 'THIRDPARTY', '470', '10665', 'Dividenden en tantièmes over vorige boekjaren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10667, 'MAR-VERKORT', 'THIRDPARTY', '471', '10665', 'Dividenden over het boekjaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10668, 'MAR-VERKORT', 'THIRDPARTY', '472', '10665', 'Tantièmes over het boekjaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10669, 'MAR-VERKORT', 'THIRDPARTY', '473', '10665', 'Andere rechthebbenden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10670, 'MAR-VERKORT', 'THIRDPARTY', '48', '10605', 'Diverse schulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10671, 'MAR-VERKORT', 'THIRDPARTY', '480', '10670', 'Vervallen obligaties en coupons', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10672, 'MAR-VERKORT', 'THIRDPARTY', '481', '10670', 'Te betalen subsidies, dotaties, toelagen en soortgelijke', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10673, 'MAR-VERKORT', 'THIRDPARTY', '488', '10670', 'Borgtochten ontvangen in contanten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10674, 'MAR-VERKORT', 'THIRDPARTY', '489', '10670', 'Andere diverse schulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10675, 'MAR-VERKORT', 'THIRDPARTY', '49', '10605', 'Overlopende rekeningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10676, 'MAR-VERKORT', 'THIRDPARTY', '490', '10675', 'Over te dragen kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10677, 'MAR-VERKORT', 'THIRDPARTY', '491', '10675', 'Verkregen opbrengsten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10678, 'MAR-VERKORT', 'THIRDPARTY', '492', '10675', 'Toe te rekenen kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10679, 'MAR-VERKORT', 'THIRDPARTY', '493', '10675', 'Over te dragen opbrengsten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10680, 'MAR-VERKORT', 'THIRDPARTY', '499', '10675', 'Wachtrekeningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10681, 'MAR-VERKORT', 'FINAN', '5', '0', 'Geldbeleggingen en liquide middelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10682, 'MAR-VERKORT', 'FINAN', '50', '10681', 'Eigen aandelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10683, 'MAR-VERKORT', 'FINAN', '51', '10681', 'Aandelen en geldbeleggingen andere dan vastrentende beleggingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10684, 'MAR-VERKORT', 'FINAN', '510', '10683', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10685, 'MAR-VERKORT', 'FINAN', '5100', '10684', 'Aandelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10686, 'MAR-VERKORT', 'FINAN', '5101', '10684', 'Geldbeleggingen andere dan vastrentende effecten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10687, 'MAR-VERKORT', 'FINAN', '511', '10683', 'Niet-opgevraagde bedragen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10688, 'MAR-VERKORT', 'FINAN', '5110', '10687', 'Aandelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10689, 'MAR-VERKORT', 'FINAN', '519', '10683', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10690, 'MAR-VERKORT', 'FINAN', '5190', '10689', 'Aandelen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10691, 'MAR-VERKORT', 'FINAN', '5191', '10689', 'Geldbeleggingen andere dan vastrentende effecten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10692, 'MAR-VERKORT', 'FINAN', '52', '10681', 'Vastrentende effecten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10693, 'MAR-VERKORT', 'FINAN', '520', '10692', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10694, 'MAR-VERKORT', 'FINAN', '529', '10692', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10695, 'MAR-VERKORT', 'FINAN', '53', '10681', 'Termijndeposito’s', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10696, 'MAR-VERKORT', 'FINAN', '530', '10695', 'Op meer dan één jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10697, 'MAR-VERKORT', 'FINAN', '531', '10695', 'Op meer dan een maand en op ten hoogste 1 jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10698, 'MAR-VERKORT', 'FINAN', '532', '10695', 'Op ten hoogste 1 maand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10699, 'MAR-VERKORT', 'FINAN', '539', '10695', 'Geboekte waardeverminderingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10700, 'MAR-VERKORT', 'FINAN', '54', '10681', 'Te incasseren vervallen waarden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10701, 'MAR-VERKORT', 'FINAN', '55', '10681', 'Kredietinstellingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10702, 'MAR-VERKORT', 'FINAN', '57', '10681', 'Kassen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10703, 'MAR-VERKORT', 'FINAN', '578', '10702', 'Kassen-zegels', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10704, 'MAR-VERKORT', 'FINAN', '58', '10681', 'Interne overboekingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10705, 'MAR-VERKORT', 'EXPENSE', '6', '0', 'Kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10706, 'MAR-VERKORT', 'EXPENSE', '60', '10705', 'Handelsgoederen, grond- en hulpstoffen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10707, 'MAR-VERKORT', 'EXPENSE', '600', '10706', 'Aankopen van grondstoffen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10708, 'MAR-VERKORT', 'EXPENSE', '601', '10706', 'Aankopen van hulpstoffen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10709, 'MAR-VERKORT', 'EXPENSE', '602', '10706', 'Aankopen van diensten, werken en studies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10710, 'MAR-VERKORT', 'EXPENSE', '603', '10706', 'Algemene onderaannemingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10711, 'MAR-VERKORT', 'EXPENSE', '604', '10706', 'Aankopen van handelsgoederen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10712, 'MAR-VERKORT', 'EXPENSE', '605', '10706', 'Aankopen van onroerende goederen bestemd voor verkoop', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10713, 'MAR-VERKORT', 'EXPENSE', '609', '10706', 'Voorraadwijzigingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10714, 'MAR-VERKORT', 'EXPENSE', '6090', '10713', 'van grondstoffen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10715, 'MAR-VERKORT', 'EXPENSE', '6091', '10713', 'van hulpstoffen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10716, 'MAR-VERKORT', 'EXPENSE', '6094', '10713', 'van handelsgoederen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10717, 'MAR-VERKORT', 'EXPENSE', '6095', '10713', 'van gekochte onroerende goederen bestemd voor verkoop', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10718, 'MAR-VERKORT', 'EXPENSE', '61', '10705', 'Diensten en diverse goederen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10719, 'MAR-VERKORT', 'EXPENSE', '617', '10718', 'Uitzendkrachten en personen ter beschikking gesteld van de onderneming', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10720, 'MAR-VERKORT', 'EXPENSE', '618', '10718', 'Bezoldigingen, premies voor buitenwettelijke verzekeringen, ouderdoms- en overlevingspensioenen van bestuurders, zaakvoerders en werkende vennoten, die niet worden toegekend uit hoofde van een arbeidsovereenkomst', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10721, 'MAR-VERKORT', 'EXPENSE', '62', '10705', 'Bezoldigingen, sociale lasten en pensioenen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10722, 'MAR-VERKORT', 'EXPENSE', '620', '10721', 'Rechtstreekse sociale voordelen en bezoldigingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10723, 'MAR-VERKORT', 'EXPENSE', '6200', '10722', 'Bestuurders of zaakvoerders', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10724, 'MAR-VERKORT', 'EXPENSE', '6201', '10722', 'Directiepersoneel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10725, 'MAR-VERKORT', 'EXPENSE', '6202', '10722', 'Bedienden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10726, 'MAR-VERKORT', 'EXPENSE', '6203', '10722', 'Arbeiders', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10727, 'MAR-VERKORT', 'EXPENSE', '6204', '10722', 'Andere personeelsleden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10728, 'MAR-VERKORT', 'EXPENSE', '621', '10721', 'Werkgeversbijdragen voor sociale verzekeringen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10729, 'MAR-VERKORT', 'EXPENSE', '622', '10721', 'Werkgeverspremies voor bovenwettelijke verzekeringen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10730, 'MAR-VERKORT', 'EXPENSE', '623', '10721', 'Andere personeelskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10731, 'MAR-VERKORT', 'EXPENSE', '624', '10721', 'Ouderdoms- en overlevingspensioenen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10732, 'MAR-VERKORT', 'EXPENSE', '6240', '10731', 'Bestuurders of zaakvoerders', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10733, 'MAR-VERKORT', 'EXPENSE', '6241', '10731', 'Personeel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10734, 'MAR-VERKORT', 'EXPENSE', '63', '10705', 'Afschrijvingen, waardeverminderingen en voorzieningen voor risico’s', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10735, 'MAR-VERKORT', 'EXPENSE', '630', '10734', 'Afschrijvingen en waardeverminderingen op vaste activa (toevoeging)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10736, 'MAR-VERKORT', 'EXPENSE', '631', '10734', 'Waardeverminderingen op voorraden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10737, 'MAR-VERKORT', 'EXPENSE', '6310', '10736', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10738, 'MAR-VERKORT', 'EXPENSE', '6311', '10736', 'Terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10739, 'MAR-VERKORT', 'EXPENSE', '632', '10734', 'Waardeverminderingen op bestellingen in uitvoering', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10740, 'MAR-VERKORT', 'EXPENSE', '6320', '10739', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10741, 'MAR-VERKORT', 'EXPENSE', '6321', '10739', 'Terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10742, 'MAR-VERKORT', 'EXPENSE', '633', '10734', 'Waardeverminderingen op handelsvorderingen op meer dan één jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10743, 'MAR-VERKORT', 'EXPENSE', '6330', '10742', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10744, 'MAR-VERKORT', 'EXPENSE', '6331', '10742', 'Terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10745, 'MAR-VERKORT', 'EXPENSE', '634', '10734', 'Waardeverminderingen op handelsvorderingen op ten hoogste één jaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10746, 'MAR-VERKORT', 'EXPENSE', '6340', '10745', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10747, 'MAR-VERKORT', 'EXPENSE', '6341', '10745', 'Terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10748, 'MAR-VERKORT', 'EXPENSE', '635', '10734', 'Voorzieningen voor pensioenen en soortgelijke verplichtingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10749, 'MAR-VERKORT', 'EXPENSE', '6350', '10748', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10750, 'MAR-VERKORT', 'EXPENSE', '6351', '10748', 'Besteding en terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10751, 'MAR-VERKORT', 'EXPENSE', '636', '10734', 'Voorzieningen voor grote herstellingswerken en grote onderhoudswerken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10752, 'MAR-VERKORT', 'EXPENSE', '6360', '10751', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10753, 'MAR-VERKORT', 'EXPENSE', '6361', '10751', 'Besteding en terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10754, 'MAR-VERKORT', 'EXPENSE', '637', '10734', 'Voorzieningen voor milieuverplichtingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10755, 'MAR-VERKORT', 'EXPENSE', '6370', '10754', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10756, 'MAR-VERKORT', 'EXPENSE', '6371', '10754', 'Besteding en terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10757, 'MAR-VERKORT', 'EXPENSE', '638', '10734', 'Voorzieningen voor andere risico’s en kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10758, 'MAR-VERKORT', 'EXPENSE', '6380', '10757', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10759, 'MAR-VERKORT', 'EXPENSE', '6381', '10757', 'Besteding en terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10760, 'MAR-VERKORT', 'EXPENSE', '64', '10705', 'Andere bedrijfskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10761, 'MAR-VERKORT', 'EXPENSE', '640', '10760', 'Bedrijfsbelastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10762, 'MAR-VERKORT', 'EXPENSE', '641', '10760', 'Minwaarden op de courante realisatie van vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10763, 'MAR-VERKORT', 'EXPENSE', '642', '10760', 'Minderwaarden op de realisatie van handelsvorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10764, 'MAR-VERKORT', 'EXPENSE', '649', '10760', 'Als herstructureringskosten geactiveerde bedrijfskosten (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10765, 'MAR-VERKORT', 'EXPENSE', '65', '10705', 'Financiële kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10766, 'MAR-VERKORT', 'EXPENSE', '650', '10765', 'Kosten van schulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10767, 'MAR-VERKORT', 'EXPENSE', '6500', '10766', 'Rente, commissies en kosten verbonden aan schulden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10768, 'MAR-VERKORT', 'EXPENSE', '6501', '10766', 'Afschrijving van kosten bij uitgifte van leningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10769, 'MAR-VERKORT', 'EXPENSE', '6502', '10766', 'Geactiveerde intercalaire intresten (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10770, 'MAR-VERKORT', 'EXPENSE', '651', '10765', 'Waardeverminderingen op vlottende activa (6)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10771, 'MAR-VERKORT', 'EXPENSE', '6510', '10770', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10772, 'MAR-VERKORT', 'EXPENSE', '6511', '10770', 'Terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10773, 'MAR-VERKORT', 'EXPENSE', '652', '10765', 'Minderwaarde op de realisatie van vlottende activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10774, 'MAR-VERKORT', 'EXPENSE', '653', '10765', 'Discontokost op vorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10775, 'MAR-VERKORT', 'EXPENSE', '654', '10765', 'Wisselresultaten (7)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10776, 'MAR-VERKORT', 'EXPENSE', '655', '10765', 'Resultaten uit de omrekening van vreemde valuta (7)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10777, 'MAR-VERKORT', 'EXPENSE', '656', '10765', 'Voorzieningen met financieel karakter (+)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10778, 'MAR-VERKORT', 'EXPENSE', '6560', '10777', 'Toevoeging', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10779, 'MAR-VERKORT', 'EXPENSE', '6561', '10777', 'Besteding en terugneming (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10780, 'MAR-VERKORT', 'EXPENSE', '659', '10765', 'Als herstructureringskosten geactiveerde financiële kosten (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10781, 'MAR-VERKORT', 'EXPENSE', '66', '10705', 'Niet-recurrente bedrijfs- of financiële kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10782, 'MAR-VERKORT', 'EXPENSE', '660', '10781', 'Niet-recurrente afschrijvingen en waardeverminderingen (toevoeging)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10783, 'MAR-VERKORT', 'EXPENSE', '6600', '10782', 'op oprichtingskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10784, 'MAR-VERKORT', 'EXPENSE', '6601', '10782', 'op immateriële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10785, 'MAR-VERKORT', 'EXPENSE', '6602', '10782', 'op materiële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10786, 'MAR-VERKORT', 'EXPENSE', '661', '10781', 'Waardeverminderingen op financiële vaste activa (toevoeging)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10787, 'MAR-VERKORT', 'EXPENSE', '662', '10781', 'Voorzieningen voor niet-recurrente risico’s en kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10788, 'MAR-VERKORT', 'EXPENSE', '6620', '10787', 'Voorzieningen voor niet-recurrente bedrijfsrisico’s en kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10789, 'MAR-VERKORT', 'EXPENSE', '6621', '10787', 'Voorzieningen voor niet-recurrente financiële risico’s en kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10790, 'MAR-VERKORT', 'EXPENSE', '663', '10781', 'Minderwaarden op realisatie van vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10791, 'MAR-VERKORT', 'EXPENSE', '668', '10781', 'Andere niet-recurrente financiële kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10792, 'MAR-VERKORT', 'EXPENSE', '67', '10705', 'Belastingen op het resultaat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10793, 'MAR-VERKORT', 'EXPENSE', '670', '10792', 'Belgische belastingen op het resultaat van het boekjaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10794, 'MAR-VERKORT', 'EXPENSE', '6700', '10793', 'Verschuldigde of gestorte belastingen en voorheffingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10795, 'MAR-VERKORT', 'EXPENSE', '6701', '10793', 'Geactiveerde overschotten van betaalde belastingen en voorheffingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10796, 'MAR-VERKORT', 'EXPENSE', '6702', '10793', 'Geraamde belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10797, 'MAR-VERKORT', 'EXPENSE', '671', '10792', 'Belgische belastingen op het resultaat van vorige boekjaren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10798, 'MAR-VERKORT', 'EXPENSE', '6710', '10797', 'Verschuldigde of gestorte belastingsupplementen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10799, 'MAR-VERKORT', 'EXPENSE', '6711', '10797', 'Geraamde belastingsupplementen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10800, 'MAR-VERKORT', 'EXPENSE', '6712', '10797', 'Gevormde fiscale voorzieningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10801, 'MAR-VERKORT', 'EXPENSE', '672', '10792', 'Buitenlandse belastingen op het resultaat van het boekjaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10802, 'MAR-VERKORT', 'EXPENSE', '673', '10792', 'Buitenlandse belastingen op het resultaat van vorige boekjaren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10803, 'MAR-VERKORT', 'EXPENSE', '68', '10705', 'Overboeking naar de uitgestelde belastingen en naar de belastingvrije reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10804, 'MAR-VERKORT', 'EXPENSE', '680', '10803', 'Overboeking naar de uitgestelde belastingen (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10805, 'MAR-VERKORT', 'EXPENSE', '689', '10803', 'Overboeking naar de belastingvrije reserves (-)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10806, 'MAR-VERKORT', 'EXPENSE', '69', '10705', 'Resultaatverwerking', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10807, 'MAR-VERKORT', 'EXPENSE', '690', '10806', 'Overgedragen verlies van het vorige boekjaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10808, 'MAR-VERKORT', 'EXPENSE', '691', '10806', 'Toevoeging aan het kapitaal en aan de uitgiftepremie', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10809, 'MAR-VERKORT', 'EXPENSE', '692', '10806', 'Toevoeging aan de reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10810, 'MAR-VERKORT', 'EXPENSE', '6920', '10809', 'Toevoeging aan de wettelijke reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10811, 'MAR-VERKORT', 'EXPENSE', '6921', '10809', 'Toevoeging aan de overige reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10812, 'MAR-VERKORT', 'EXPENSE', '693', '10806', 'Over te dragen winst', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10813, 'MAR-VERKORT', 'EXPENSE', '694', '10806', 'Vergoeding van het kapitaal', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10814, 'MAR-VERKORT', 'EXPENSE', '695', '10806', 'Bestuurders of zaakvoerders', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10815, 'MAR-VERKORT', 'EXPENSE', '696', '10806', 'Werknemers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10816, 'MAR-VERKORT', 'EXPENSE', '697', '10806', 'Andere rechthebbenden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10817, 'MAR-VERKORT', 'INCOME', '7', '0', 'Opbrengsten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10818, 'MAR-VERKORT', 'INCOME', '70', '10817', 'Omzet', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10819, 'MAR-VERKORT', 'INCOME', '708', '10818', 'Toegekende kortingen, ristorno’s en rabatten (-) (8)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10820, 'MAR-VERKORT', 'INCOME', '71', '10817', 'Wijzigingen in de voorraden en bestellingen in uitvoering', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10821, 'MAR-VERKORT', 'INCOME', '712', '10820', 'in de voorraad goederen in bewerking', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10822, 'MAR-VERKORT', 'INCOME', '713', '10820', 'in de voorraad gereed product', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10823, 'MAR-VERKORT', 'INCOME', '715', '10820', 'in de voorraad onroerende goederen bestemd voor verkoop', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10824, 'MAR-VERKORT', 'INCOME', '717', '10820', 'in de bestellingen in uitvoering', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10825, 'MAR-VERKORT', 'INCOME', '7170', '10824', 'Aanschaffingswaarde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10826, 'MAR-VERKORT', 'INCOME', '7171', '10824', 'Toegerekende winst', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10827, 'MAR-VERKORT', 'INCOME', '72', '10817', 'Geproduceerde vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10828, 'MAR-VERKORT', 'INCOME', '74', '10817', 'Andere bedrijfsopbrengsten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10829, 'MAR-VERKORT', 'INCOME', '740', '10828', 'Bedrijfssubsidies en compenserende bedragen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10830, 'MAR-VERKORT', 'INCOME', '741', '10828', 'Meerwaarde op de courante realisatie van materiële vast activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10831, 'MAR-VERKORT', 'INCOME', '742', '10828', 'Meerwaarde op de realisatie van handelsvorderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10832, 'MAR-VERKORT', 'INCOME', '75', '10817', 'Financiële opbrengsten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10833, 'MAR-VERKORT', 'INCOME', '750', '10832', 'Opbrengsten uit financiële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10834, 'MAR-VERKORT', 'INCOME', '751', '10832', 'Opbrengsten uit vlottende activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10835, 'MAR-VERKORT', 'INCOME', '752', '10832', 'Meerwaarde op de realisatie van vlottende activa (6)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10836, 'MAR-VERKORT', 'INCOME', '753', '10832', 'Kapitaal – en interestsubsidies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10837, 'MAR-VERKORT', 'INCOME', '754', '10832', 'Wisselresultaten (7)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10838, 'MAR-VERKORT', 'INCOME', '755', '10832', 'Resultaten uit de omrekening van vreemde valuta (7)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10839, 'MAR-VERKORT', 'INCOME', '76', '10817', 'Niet-recurrente bedrijfs- of financiële opbrengsten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10840, 'MAR-VERKORT', 'INCOME', '760', '10839', 'Terugneming van afschrijvingen en waardeverminderingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10841, 'MAR-VERKORT', 'INCOME', '7600', '10840', 'op immateriële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10842, 'MAR-VERKORT', 'INCOME', '7601', '10840', 'op materiële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10843, 'MAR-VERKORT', 'INCOME', '761', '10839', 'Terugneming van waardeverminderingen op financiële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10844, 'MAR-VERKORT', 'INCOME', '762', '10839', 'Terugneming van voorzieningen voor niet-recurrente risico’s en kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10845, 'MAR-VERKORT', 'INCOME', '7620', '10844', 'Terugneming van voorzieningen voor niet-recurrente bedrijfsrisico’s en kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10846, 'MAR-VERKORT', 'INCOME', '7621', '10844', 'Terugneming van voorzieningen voor niet-recurrente financiële risico’s en kosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10847, 'MAR-VERKORT', 'INCOME', '763', '10839', 'Meerwaarden op de realisatie van vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10848, 'MAR-VERKORT', 'INCOME', '7630', '10847', 'Meerwaarde op de realisatie van immateriële en materiële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10849, 'MAR-VERKORT', 'INCOME', '7631', '10847', 'Meerwaarde op de realisatie van financiële vaste activa', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10850, 'MAR-VERKORT', 'INCOME', '769', '10839', 'Andere niet-recurrente financiële opbrengsten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10851, 'MAR-VERKORT', 'INCOME', '77', '10817', 'Regularisering van belastingen en terugneming van fiscale voorzieningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10852, 'MAR-VERKORT', 'INCOME', '771', '10851', 'Belgische belastingen op het resultaat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10853, 'MAR-VERKORT', 'INCOME', '7710', '10852', 'Regularisering van verschuldigde of betaalde belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10854, 'MAR-VERKORT', 'INCOME', '7711', '10852', 'Regularisering van geraamde belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10855, 'MAR-VERKORT', 'INCOME', '7712', '10852', 'Terugneming van fiscale voorzieningen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10856, 'MAR-VERKORT', 'INCOME', '773', '10851', 'Buitenlandse belastingen op het resultaat', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10857, 'MAR-VERKORT', 'INCOME', '78', '10817', 'Onttrekking aan de belastingvrije reserves en de uitgestelde belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10858, 'MAR-VERKORT', 'INCOME', '780', '10857', 'Onttrekkingen aan de uitgestelde belastingen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10859, 'MAR-VERKORT', 'INCOME', '789', '10857', 'Onttrekkingen aan de belastingvrije reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10860, 'MAR-VERKORT', 'INCOME', '79', '10817', 'Resultaatverwerking', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10861, 'MAR-VERKORT', 'INCOME', '790', '10860', 'Overgedragen winst van het vorige boekjaar', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10862, 'MAR-VERKORT', 'INCOME', '791', '10860', 'Onttrekking aan het kapitaal en aan de uitgiftepremies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10863, 'MAR-VERKORT', 'INCOME', '792', '10860', 'Onttrekking aan de reserves', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10864, 'MAR-VERKORT', 'INCOME', '793', '10860', 'Over te dragen verlies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10865, 'MAR-VERKORT', 'INCOME', '794', '10860', 'Tussenkomst van vennoten (of van de eigenaar) in het verlies', 1); From 345668b2ca6746ce96f6f1ad940fb6e1f0a074e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 17:31:50 +0200 Subject: [PATCH 0744/1137] Default html for an url is no more a 'float' div --- htdocs/core/class/commonobject.class.php | 14 +++++++------- htdocs/core/lib/functions.lib.php | 3 ++- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/partnership/partnership_list.php | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f0f349bd3bd..c5b3011e3bb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7525,13 +7525,13 @@ abstract class CommonObject * Return HTML string to show a field into a page * Code very similar with showOutputField of extra fields * - * @param array $val Array of properties of field to show - * @param string $key Key of attribute - * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) - * @param string $moreparam To add more parametes on html input tag - * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @param mixed $morecss Value for css to define size. May also be a numeric. + * @param array $val Array of properties of field to show + * @param string $key Key of attribute + * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) + * @param string $moreparam To add more parameters on html tag + * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @param mixed $morecss Value for CSS to use (Old usage: May also be a numeric to define a size). * @return string */ public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '') diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 67fcd857293..710ad9f3dce 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3150,6 +3150,7 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor if ($target) { $linkstart .= ' target="'.$target.'"'; } + $linkstart .= ' title="'.$langs->trans("URL").': '.$url.'"'; $linkstart .= '>'; $link = ''; @@ -3163,7 +3164,7 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor if ($morecss == 'float') { // deprecated return '
'.($withpicto ?img_picto($langs->trans("Url"), 'globe').' ' : '').$link.'
'; } else { - return $linkstart.''.($withpicto ?img_picto($langs->trans("Url"), 'globe').' ' : '').$link.''.$linkend; + return $linkstart.''.($withpicto ?img_picto('', 'globe').' ' : '').$link.''.$linkend; } } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 972a2322a23..a174dc9ffad 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -756,7 +756,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { + if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) { print ' title="'.dol_escape_htmltag($object->$key).'"'; } print '>'; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 98d78e0a2b2..27821a2b799 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -914,7 +914,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { + if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) { print ' title="'.dol_escape_htmltag($object->$key).'"'; } print '>'; From 4d17c6441ac15fd87969ba27c90d30ccbb440675 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 17:36:23 +0200 Subject: [PATCH 0745/1137] CSS --- htdocs/partnership/class/partnership.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 6976cb8e587..871ddfaff2d 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -120,7 +120,7 @@ class Partnership extends CommonObject 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), 'date_partnership_start' => array('type'=>'date', 'label'=>'DatePartnershipStart', 'enabled'=>'1', 'position'=>52, 'notnull'=>1, 'visible'=>1,), 'date_partnership_end' => array('type'=>'date', 'label'=>'DatePartnershipEnd', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>1,), - 'url_to_check' => array('type'=>'url', 'label'=>'UrlToCheck', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflowmax100'), + 'url_to_check' => array('type'=>'url', 'label'=>'UrlToCheck', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflowmax150'), 'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',), 'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>-2,), 'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>73, 'notnull'=>0, 'visible'=>-2,), From 92fd69b84b771227d0baf49c830a2f3571743e07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 18:06:38 +0200 Subject: [PATCH 0746/1137] Fix warnings --- htdocs/bookmarks/class/bookmark.class.php | 5 ----- htdocs/don/class/don.class.php | 1 - htdocs/projet/class/project.class.php | 1 - 3 files changed, 7 deletions(-) diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 389603fb161..afac3563dee 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -49,11 +49,6 @@ class Bookmark extends CommonObject */ public $picto = 'bookmark'; - /** - * @var DoliDB Database handler. - */ - public $db; - /** * Last error code on a local method * @var int Error number diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index c730c7d0b08..aad080fad2b 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -443,7 +443,6 @@ class Don extends CommonObject } } else { $this->error = $this->db->lasterror(); - $this->errno = $this->db->lasterrno(); $error++; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 4466138e006..99f0f375b4f 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -495,7 +495,6 @@ class Project extends CommonObject } } else { $this->error = $this->db->lasterror(); - $this->errno = $this->db->lasterrno(); $error++; } From 3f25ff69bcaa26a6c796bcb07c6086af0e640899 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 18:09:32 +0200 Subject: [PATCH 0747/1137] Clean code --- htdocs/public/bookcal/booking.php | 5 ++--- htdocs/public/bookcal/index.php | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php index d478046d143..74972cfc8f0 100644 --- a/htdocs/public/bookcal/booking.php +++ b/htdocs/public/bookcal/booking.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/public/onlinesign/newonlinesign.php + * \file htdocs/public/bookcal/booking.php * \ingroup core * \brief File to offer a way to make an online signature for a particular Dolibarr entity * Example of URL: https://localhost/public/bookcal/booking.php?ref=PR... @@ -44,7 +44,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/class/calendar.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; -require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; $langs->loadLangs(array("main", "other", "dict", "agenda", "errors", "companies")); @@ -175,7 +174,7 @@ if ($action == 'add') { $user = new User($db); } - $booking = new Booking($db); + $booking = new ActionComm($db); $db->begin(); if (!GETPOST("lastname")) { diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php index 530f37fc91e..cd4db57da4d 100644 --- a/htdocs/public/bookcal/index.php +++ b/htdocs/public/bookcal/index.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/public/onlinesign/newonlinesign.php + * \file htdocs/public/bookcal/index.php * \ingroup core * \brief File to offer a way to make an online signature for a particular Dolibarr entity * Example of URL: https://localhost/public/bookcal/booking.php?ref=PR... @@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/class/calendar.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $langs->loadLangs(array("main", "other", "dict", "agenda", "errors", "bookcal")); From 3675ec0b426b5ed0cef6f4d14aae77e71b137147 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 18:51:34 +0200 Subject: [PATCH 0748/1137] Enhance look of apstats --- dev/tools/apstats.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 4bdf2fc45c3..271bd264270 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -237,7 +237,21 @@ th,td { padding: 20px; font-size: 1.2em; margin-top: 10px; - maring-bottom: 10px; + margin-bottom: 10px; + width: 200px; +} +.box.inline-box { + display: inline-block; + text-align: center; + margin-left: 10px; +} +.back1 { + background-color: #888800; + color: #FFF; +} +.back1 { + background-color: #880088; + color: #FFF; } '; @@ -312,14 +326,14 @@ $html .= ''; $html .= '
'; $html .= '

Project value


'; -$html .= '
'; +$html .= '
'; $html .= 'COCOMO (Basic organic model) value:
'; -$html .= '$'.formatNumber($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency'], 2); +$html .= '$'.formatNumber($arraycocomo['proj']['currency'] + $arraycocomo['dep']['currency'], 2).''; $html .= '
'; -$html .= '
'; +$html .= '
'; $html .= 'COCOMO (Basic organic model) effort
'; -$html .= formatNumber($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']); -$html .= ' monthes people
'; +$html .= ''.formatNumber($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']); +$html .= ' monthes people
'; $html .= '
'; $html .= '
'; From 3343a47244f03037136e448f3b35be21b0cf1feb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 21:38:11 +0200 Subject: [PATCH 0749/1137] NEW billing on shipment+reception. Can be done before or after delivery. --- ChangeLog | 3 +- htdocs/admin/workflow.php | 25 +++++++++- htdocs/commande/card.php | 6 +-- htdocs/commande/class/commande.class.php | 8 --- htdocs/commande/list.php | 2 +- htdocs/commande/list_det.php | 2 +- htdocs/core/lib/order.lib.php | 5 +- ...e_20_modWorkflow_WorkflowManager.class.php | 50 ++++++++++++++++++- htdocs/expedition/card.php | 31 +++++------- htdocs/expedition/class/expedition.class.php | 12 ++--- htdocs/expedition/list.php | 2 +- htdocs/langs/en_US/workflow.lang | 20 ++++---- htdocs/reception/card.php | 37 ++++++-------- htdocs/reception/class/reception.class.php | 20 +++++--- htdocs/reception/list.php | 2 +- 15 files changed, 138 insertions(+), 87 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41341fa2d45..82771d980ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,7 +19,8 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * The property ->brouillon has been removed from all classes. It was not reliable and was a duplicate of ->status == self::STATUS_DRAFT. * The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead. - +* Recheck setup of your module workflow to see if you need to enable the new setting to have shipment set to billed automatically + when an invoice from a shipment is validated (and if your process is to make invoice on shipment and not on order). ***** ChangeLog for 18.0.1 compared to 18.0.0 ***** diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 28d347bcabe..a6cb4ee62ca 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -153,20 +153,40 @@ $workflowcodes = array( ), // Automatic classification shipping + /* Replaced by next option 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array( 'family' => 'classify_shipping', 'position' => 90, 'enabled' => isModEnabled("expedition") && isModEnabled("facture"), + 'picto' => 'shipment', + 'deprecated' => 1 + ), + */ + + 'WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE' => array( + 'family' => 'classify_shipping', + 'position' => 91, + 'enabled' => isModEnabled("expedition") && isModEnabled("facture") && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0', 'picto' => 'shipment' ), // Automatic classification reception - 'WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE'=>array( + /* + 'WORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE'=>array( 'family'=>'classify_reception', 'position'=>95, 'enabled'=>(isModEnabled("reception") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), 'picto'=>'reception' ), + */ + + 'WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE' => array( + 'family' => 'classify_reception', + 'position' => 91, + 'enabled' => isModEnabled("reception") && isModEnabled("supplier_invoice") && getDolGlobalString('WORKFLOW_BILL_ON_RECEPTION') !== '0', + 'picto' => 'shipment' + ), + 'separator2'=>array('family'=>'separator', 'position'=>400, 'enabled' => (isModEnabled('ticket') && isModEnabled('contract'))), @@ -284,6 +304,9 @@ foreach ($workflowcodes as $key => $params) { if (!empty($params['warning'])) { print ' '.img_warning($langs->transnoentitiesnoconv($params['warning'])); } + if (!empty($params['deprecated'])) { + print ' '.img_warning($langs->transnoentitiesnoconv("Deprecated")); + } print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0134ac37e40..afe3818bab1 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2954,14 +2954,14 @@ if ($action == 'create' && $usercancreate) { // Note: Even if module invoice is not enabled, we should be able to use button "Classified billed" if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { if (isModEnabled('facture') && $user->hasRight('facture', 'creer') && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { - print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); + print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&token='.newToken().'&origin='.urlencode($object->element).'&originid='.$object->id.'&socid='.$object->socid, ''); } - if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { + if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) { print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&token='.newToken().'&id='.$object->id, ''); } } if ($object->statut > Commande::STATUS_DRAFT && $object->billed) { - if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { + if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) { print dolGetButtonAction('', $langs->trans('ClassifyUnBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifyunbilled&token='.newToken().'&id='.$object->id, ''); } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 250d6c49aa0..67fcbb55d29 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3729,14 +3729,6 @@ class Commande extends CommonOrder $labelTooltip .= ' - '.$langs->transnoentitiesnoconv("DateDeliveryPlanned").dol_print_date($this->delivery_date, 'day').$billedtext; } $statusType = 'status4'; - } elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { - $labelStatus = $langs->transnoentitiesnoconv('StatusOrderToBill'); // translated into Delivered - $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderToBillShort'); // translated into Delivered - $statusType = 'status4'; - } elseif ($status == self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { - $labelStatus = $langs->transnoentitiesnoconv('StatusOrderProcessed').$billedtext; - $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderProcessedShort').$billedtext; - $statusType = 'status6'; } elseif ($status == self::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { $labelStatus = $langs->transnoentitiesnoconv('StatusOrderDelivered'); $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderDeliveredShort'); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ae0fd4e3d05..137eea575cf 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -206,7 +206,7 @@ $arrayfields = array( 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>135), 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>140), 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("expedition")), 'position'=>990), - 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995), + 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) ); diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 9aa5aad7176..cc14aabf238 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -213,7 +213,7 @@ $arrayfields = array( 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135), 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140), 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled('expedition')), 'position'=>990), - 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995), + 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) ); diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 349e3179f93..100d5a8d93e 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -298,10 +298,7 @@ function getCustomerOrderPieChart($socid = 0) if ($status == Commande::STATUS_SHIPMENTONPROCESS) { $colorseries[$status] = $badgeStatus4; } - if ($status == Commande::STATUS_CLOSED && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { - $colorseries[$status] = $badgeStatus6; - } - if ($status == Commande::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { + if ($status == Commande::STATUS_CLOSED) { $colorseries[$status] = $badgeStatus6; } if ($status == Commande::STATUS_CANCELED) { diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 273da6a1752..03449f96f2a 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -189,6 +189,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } + // Set shipment to "Closed" if WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE is set (deprecated, WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE instead)) if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE)) { $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); if (!empty($object->linkedObjects)) { @@ -210,6 +211,27 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } + if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE)) { + $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); + if (!empty($object->linkedObjects)) { + $totalonlinkedelements = 0; + foreach ($object->linkedObjects['shipping'] as $element) { + if ($element->statut == Expedition::STATUS_VALIDATED || $element->statut == Expedition::STATUS_CLOSED) { + $totalonlinkedelements += $element->total_ht; + } + } + dol_syslog("Amount of linked shipment = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); + if ($totalonlinkedelements == $object->total_ht) { + foreach ($object->linkedObjects['shipping'] as $element) { + $ret = $element->setBilled(); + if ($ret < 0) { + return $ret; + } + } + } + } + } + return $ret; } @@ -262,8 +284,32 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } - // Then set reception to "Billed" if WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE is set - if (isModEnabled("reception") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE)) { + // Set reception to "Closed" if WORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE is set (deprecated, WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE instead)) + /* + if (isModEnabled("reception") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE)) { + $object->fetchObjectLinked('', 'reception', $object->id, $object->element); + if (!empty($object->linkedObjects)) { + $totalonlinkedelements = 0; + foreach ($object->linkedObjects['reception'] as $element) { + if ($element->statut == Reception::STATUS_VALIDATED || $element->statut == Reception::STATUS_CLOSED) { + $totalonlinkedelements += $element->total_ht; + } + } + dol_syslog("Amount of linked reception = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG); + if ($totalonlinkedelements == $object->total_ht) { + foreach ($object->linkedObjects['reception'] as $element) { + $ret = $element->setClosed(); + if ($ret < 0) { + return $ret; + } + } + } + } + } + */ + + // Then set reception to "Billed" if WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE is set + if (isModEnabled("reception") && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE)) { $object->fetchObjectLinked('', 'reception', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f34cc2d11a5..a13dec33985 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2573,7 +2573,6 @@ if ($action == 'create') { } // 0=draft, 1=validated/delivered, 2=closed/delivered - // If WORKFLOW_BILL_ON_SHIPMENT: 0=draft, 1=validated, 2=billed (no status delivered) if ($object->statut == Expedition::STATUS_VALIDATED && !getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) { if ($user->hasRight('expedition', 'creer')) { print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=setdraft&token='.newToken().'&id='.$object->id, ''); @@ -2581,11 +2580,7 @@ if ($action == 'create') { } if ($object->statut == Expedition::STATUS_CLOSED) { if ($user->hasRight('expedition', 'creer')) { - if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? - print dolGetButtonAction('', $langs->trans('ClassifyUnbilled'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); - } else { - print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); - } + print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); } } @@ -2603,9 +2598,9 @@ if ($action == 'create') { // Create bill if (isModEnabled('facture') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { if ($user->hasRight('facture', 'creer')) { - // TODO show button only if (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) - // If we do that, we must also make this option official. - print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); + if (getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') { + print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); + } } } @@ -2614,28 +2609,26 @@ if ($action == 'create') { if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->delivery->creer && empty($object->linkedObjectsIds['delivery'])) { print dolGetButtonAction('', $langs->trans('CreateDeliveryOrder'), 'default', $_SERVER["PHP_SELF"].'?action=create_delivery&token='.newToken().'&id='.$object->id, ''); } - // Close + + // Set Billed and Closed if ($object->statut == Expedition::STATUS_VALIDATED) { - if ($user->rights->expedition->creer && $object->statut > 0 && !$object->billed) { - $label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received - // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders - if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? - $label = "ClassifyBilled"; - $paramaction = 'classifybilled'; + if ($user->hasRight('expedition', 'creer') && $object->statut > 0) { + if (!$object->billed && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') { + print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&token='.newToken().'&id='.$object->id, ''); } - print dolGetButtonAction('', $langs->trans($label), 'default', $_SERVER["PHP_SELF"].'?action='. $paramaction .'&token='.newToken().'&id='.$object->id, ''); + print dolGetButtonAction('', $langs->trans("Close"), 'default', $_SERVER["PHP_SELF"].'?action='. $paramaction .'&token='.newToken().'&id='.$object->id, ''); } } // Cancel if ($object->statut == Expedition::STATUS_VALIDATED) { - if ($user->rights->expedition->supprimer) { + if ($user->hasRight('expedition', 'creer')) { print dolGetButtonAction('', $langs->trans('Cancel'), 'danger', $_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); } } // Delete - if ($user->rights->expedition->supprimer) { + if ($user->hasRight('expedition', 'supprimer')) { print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); } } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 967b4e9a4fb..e538f36bf18 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2108,13 +2108,13 @@ class Expedition extends CommonObject } /** - * Classify the shipping as closed. + * Classify the shipping as closed (this record also the stock movement) * * @return int <0 if KO, >0 if OK */ public function setClosed() { - global $conf, $langs, $user; + global $conf, $user; $error = 0; @@ -2280,7 +2280,7 @@ class Expedition extends CommonObject } /** - * Classify the shipping as invoiced (used when WORKFLOW_BILL_ON_SHIPMENT is on) + * Classify the shipping as invoiced (used for exemple by trigger when WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE is on) * * @return int <0 if ko, >0 if ok */ @@ -2291,17 +2291,17 @@ class Expedition extends CommonObject $this->db->begin(); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET fk_statut=2, billed=1'; // TODO Update only billed + $sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET billed = 1'; $sql .= " WHERE rowid = ".((int) $this->id).' AND fk_statut > 0'; $resql = $this->db->query($sql); if ($resql) { - $this->statut = self::STATUS_CLOSED; $this->billed = 1; // Call trigger $result = $this->call_trigger('SHIPPING_BILLED', $user); if ($result < 0) { + $this->billed = 0; $error++; } } else { @@ -2313,8 +2313,6 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } else { - $this->statut = self::STATUS_VALIDATED; - $this->billed = 0; $this->db->rollback(); return -1; } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 40c8191043a..5fe37b5c7ce 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -144,7 +144,7 @@ $arrayfields = array( 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), - 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) + 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>'getDolGlobalConst("WORKFLOW_BILL_ON_SHIPMENT") !== "0"') ); // Extra fields diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index a2b6b4c1f95..bc9d4b6fa8e 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -9,11 +9,11 @@ descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a sales order is closed (the new invoice will have same amount as the order) descWORKFLOW_TICKET_CREATE_INTERVENTION=On ticket creation, automatically create an intervention. # Autoclassify customer proposal or order -descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal as billed when sales order is set to billed (and if the amount of the order is the same as the total amount of the signed linked proposal) -descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposal as billed when customer invoice is validated (and if the amount of the invoice is the same as the total amount of the signed linked proposal) -descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order) -descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when customer invoice is set to paid (and if the amount of the invoice is the same as the total amount of the linked order) -descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source sales order as shipped when a shipment is validated (and if the quantity shipped by all shipments is the same as in the order to update) +descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposals as billed when a sales order is set to billed (and if the amount of the order is the same as the total amount of the signed linked proposal) +descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposals as billed when a customer invoice is validated (and if the amount of the invoice is the same as the total amount of the signed linked proposal) +descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source sales order as billed when a customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order) +descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source sales orders as billed when a customer invoice is set to paid (and if the amount of the invoice is the same as the total amount of the linked order) +descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source sales orders as shipped when a shipment is validated (and if the quantity shipped by all shipments is the same as in the order to update) descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED=Classify linked source sales order as shipped when a shipment is closed (and if the quantity shipped by all shipments is the same as in the order to update) # Autoclassify purchase proposal descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked proposal) @@ -21,8 +21,12 @@ descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vend descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order as billed when vendor invoice is validated (and if the amount of the invoice is the same as the total amount of the linked order) descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION=Classify linked source purchase order as received when a reception is validated (and if the quantity received by all receptions is the same as in the purchase order to update) descWORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED=Classify linked source purchase order as received when a reception is closed (and if the quantity received by all rceptions is the same as in the purchase order to update) -# Autoclassify purchase invoice -descWORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE=Classify receptions to "billed" when a linked purchase invoice is validated (and if the amount of the invoice is the same as the total amount of the linked receptions) +# Autoclassify shipment +descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE=Classify linked source shipment as closed when a customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked shipments) +descWORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE=Classify linked source shipment as billed when a customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked shipments) +# Autoclassify receptions +descWORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE=Classify linked source receptions as billed when a purchase invoice is validated (and if the amount of the invoice is the same as the total amount of the linked receptions) +descWORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE=Classify linked source receptions as billed when a purchase invoice is validated (and if the amount of the invoice is the same as the total amount of the linked receptions) # Automatically link ticket to contract descWORKFLOW_TICKET_LINK_CONTRACT=When creating a ticket, link available contracts of matching thirdparty descWORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS=When linking contracts, search among those of parents companies @@ -30,7 +34,5 @@ descWORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS=When linking contracts, search descWORKFLOW_TICKET_CLOSE_INTERVENTION=Close all interventions linked to the ticket when a ticket is closed AutomaticCreation=Automatic creation AutomaticClassification=Automatic classification -# Autoclassify shipment -descWORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE=Classify linked source shipment as closed when customer invoice is validated (and if the amount of the invoice is the same as the total amount of the linked shipments) AutomaticClosing=Automatic closing AutomaticLinking=Automatic linking diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 5c58c71f8e1..29ea1434b2e 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -2133,11 +2133,7 @@ if ($action == 'create') { // TODO add alternative status // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order) if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) { - if (isModEnabled('facture') && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? - print ''.$langs->trans("ClassifyUnbilled").''; - } else { - print ''.$langs->trans("ReOpen").''; - } + print ''.$langs->trans("ReOpen").''; } // Send @@ -2154,27 +2150,24 @@ if ($action == 'create') { // Create bill if (isModEnabled("supplier_invoice") && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { if ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')) { - // TODO show button only if (!empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) - // If we do that, we must also make this option official. - print ''.$langs->trans("CreateBill").''; - } - } - - - // Close - if ($object->statut == Reception::STATUS_VALIDATED) { - if ($user->rights->reception->creer && $object->statut > 0 && !$object->billed) { - $label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received - // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on receptions instead of orders - if (isModEnabled("supplier_order") && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? - $label = "ClassifyBilled"; - $paramaction = 'classifybilled'; + if (getDolGlobalString('WORKFLOW_BILL_ON_RECEPTION') !== '0') { + print ''.$langs->trans("CreateBill").''; } - print ''.$langs->trans($label).''; } } - if ($user->rights->reception->supprimer) { + + // Set Billed and Closed + if ($object->statut == Reception::STATUS_VALIDATED) { + if ($user->hasRight('reception', 'creer') && $object->statut > 0) { + if (!$object->billed && getDolGlobalString('WORKFLOW_BILL_ON_RECEPTION') !== '0') { + print ''.$langs->trans('ClassifyBilled').''; + } + print ''.$langs->trans("Close").''; + } + } + + if ($user->hasRight('reception', 'supprimer')) { print ''.$langs->trans("Delete").''; } } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 9fb6a0cb6a9..6369190efe9 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -370,7 +370,7 @@ class Reception extends CommonObject return -1; } - $sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_supplier, e.ref_ext, e.fk_user_author, e.fk_statut"; + $sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_supplier, e.ref_ext, e.fk_user_author, e.fk_statut as status"; $sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql .= ", e.date_reception as date_reception, e.model_pdf, e.date_delivery"; $sql .= ", e.fk_shipping_method, e.tracking_number"; @@ -404,7 +404,8 @@ class Reception extends CommonObject $this->socid = $obj->socid; $this->ref_supplier = $obj->ref_supplier; $this->ref_ext = $obj->ref_ext; - $this->statut = $obj->fk_statut; + $this->statut = $obj->status; + $this->status = $obj->status; $this->user_author_id = $obj->fk_user_author; $this->date_creation = $this->db->jdate($obj->date_creation); $this->date = $this->db->jdate($obj->date_reception); // TODO deprecated @@ -1530,9 +1531,14 @@ class Reception extends CommonObject $error = 0; + // Protection. This avoid to move stock later when we should not + if ($this->statut == self::STATUS_CLOSED) { + return 0; + } + $this->db->begin(); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET fk_statut='.self::STATUS_CLOSED; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET fk_statut = '.self::STATUS_CLOSED; $sql .= " WHERE rowid = ".((int) $this->id).' AND fk_statut > 0'; $resql = $this->db->query($sql); @@ -1562,7 +1568,7 @@ class Reception extends CommonObject } $this->statut = self::STATUS_CLOSED; - + $this->status = self::STATUS_CLOSED; // If stock increment is done on closing if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { @@ -1653,7 +1659,7 @@ class Reception extends CommonObject } /** - * Classify the reception as invoiced (used when WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE is on) + * Classify the reception as invoiced (used for exemple by trigger when WORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE is on) * * @return int <0 if ko, >0 if ok */ @@ -1666,17 +1672,17 @@ class Reception extends CommonObject $this->setClosed(); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET billed=1'; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET billed=1'; $sql .= " WHERE rowid = ".((int) $this->id).' AND fk_statut > 0'; $resql = $this->db->query($sql); if ($resql) { - $this->statut = 2; $this->billed = 1; // Call trigger $result = $this->call_trigger('RECEPTION_BILLED', $user); if ($result < 0) { + $this->billed = 0; $error++; } } else { diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index b06a11ef5b9..95180890233 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -129,7 +129,7 @@ $arrayfields = array( 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_RECEPTION))) + 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>'getDolGlobalConst("WORKFLOW_BILL_ON_RECEPTION") !== "0"') ); // Extra fields From d1ea2743158fbd3a6e5187ded503efdfb47eb5d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2023 23:06:48 +0200 Subject: [PATCH 0750/1137] Update upgrade2.php --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index f0aa54fd362..dfe1c7d9bc6 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4138,7 +4138,7 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/mailings/kiwi.modules.php', '/core/boxes/box_members.php', '/includes/restler/framework/Luracast/Restler/Data/Object.php', - + '/api/class/api_generic.class.php', '/asterisk/cidlookup.php', '/categories/class/api_category.class.php', From c3ee677256bb0f589fef916e808b2b2331bd471e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2023 02:29:15 +0200 Subject: [PATCH 0751/1137] Ignore rule --- .github/workflows/exakat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/exakat.yml b/.github/workflows/exakat.yml index 26ea74183e4..d1bdffc71a6 100644 --- a/.github/workflows/exakat.yml +++ b/.github/workflows/exakat.yml @@ -22,7 +22,7 @@ jobs: - name: Exakat uses: docker://exakat/exakat-ga with: - ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant' + ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/NestedTernary,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant' ignore_dirs: '/htdocs/includes/,/htdocs/install/doctemplates/,/build/,/dev/,/doc/,/scripts/,/test/' file_extensions: php project_reports: Perfile \ No newline at end of file From 59112707035bf4f1c691d5e8e5502f201b83fc7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2023 02:36:20 +0200 Subject: [PATCH 0752/1137] Dict must extends CommonDict --- .../compta/paiement/class/cpaiement.class.php | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index 683e9fc3679..7c7a275e8b6 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -25,17 +25,15 @@ * \brief This file is to manage CRUD function of type of payments */ +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT.'/core/class/commondict.class.php'; + /** * Class Cpaiement */ -class Cpaiement +class Cpaiement extends CommonDict { - /** - * @var DoliDB Database handler. - */ - public $db; - /** * @var string Id to identify managed objects */ @@ -46,18 +44,6 @@ class Cpaiement */ public $table_element = 'c_paiement'; - public $code; - - /** - * @var int ID - */ - public $id; - - /** - * @var string[] array of errors messages - */ - public $errors; - /** * @var string * @deprecated @@ -65,11 +51,6 @@ class Cpaiement */ public $libelle; - /** - * @var string - */ - public $label; - public $type; public $active; public $accountancy_code; From 246f381a078506fa8ed106ea2fc543aac9f4be3d Mon Sep 17 00:00:00 2001 From: David Pareja Rodriguez Date: Mon, 4 Sep 2023 08:23:16 +0200 Subject: [PATCH 0753/1137] Requested changes --- htdocs/accountancy/journal/purchasesjournal.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 07b558dd541..01f66dac48d 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -325,6 +325,12 @@ if ($result) { dol_print_error($db); } +// Check for too many invoices first. +if (count($tabfac) > 10000) { // Global config in htdocs/admin/const.php??? + $error++; + setEventMessages("TooManyInvoicesToProcessPleaseUseAMoreSelectiveFilter", null, 'errors'); +} + $errorforinvoice = array(); /* @@ -357,6 +363,7 @@ WHERE fd.product_type <= 2 AND fd.fk_code_ventilation <= 0 AND fd.total_ttc <> 0 + AND fk_facture_fourn IN (".$db->sanitize(join(",", array_keys($tabfac))).") GROUP BY fk_facture_fourn "; $resql = $db->query($sql); From 4b2a972902709b453fdae7a3e9c49f9436d25689 Mon Sep 17 00:00:00 2001 From: David Pareja Rodriguez Date: Mon, 4 Sep 2023 08:45:19 +0200 Subject: [PATCH 0754/1137] Requested changes --- htdocs/compta/prelevement/class/bonprelevement.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 5c2103e0ae2..f543a21d426 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -898,10 +898,10 @@ class BonPrelevement extends CommonObject $sql .= ", f.ref, sr.bic, sr.iban_prefix, sr.frstrecur"; if ($type != 'bank-transfer') { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_facture_demande as pfd ON f.rowid = pfd.fk_facture"; + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pfd ON f.rowid = pfd.fk_facture"; } else { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_facture_demande as pfd ON f.rowid = pfd.fk_facture_fourn"; + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pfd ON f.rowid = pfd.fk_facture_fourn"; } $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_rib as sr ON s.rowid = sr.fk_soc AND sr.default_rib = 1"; @@ -911,6 +911,7 @@ class BonPrelevement extends CommonObject $sql .= " AND pfd.traite = 0"; $sql .= " AND f.total_ttc > 0"; $sql .= " AND pfd.ext_payment_id IS NULL"; + $sql .= " AND sr.type = 'bank' "; if ($did > 0) { $sql .= " AND pfd.rowid = ".((int) $did); } From 59a20d9dff3fe3b3e886fe5b3926595695e6e75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Sep 2023 11:36:04 +0200 Subject: [PATCH 0755/1137] phpstan --- .../class/accountancysystem.class.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index 99f908e70e3..ddfa39c6309 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2023 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 @@ -46,6 +47,13 @@ class AccountancySystem /** * @var int ID */ + public $id; + + /** + * @var int ID + * @deprecated + * @see $id + */ public $rowid; /** @@ -53,6 +61,21 @@ class AccountancySystem */ public $fk_pcg_version; + /** + * @var int pcg version + */ + public $pcg_version; + + /** + * @var string ref + */ + public $ref; + + /** + * @var int active + */ + public $active; + /** * @var string pcg type */ @@ -156,6 +179,7 @@ class AccountancySystem $id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_system"); if ($id > 0) { + $this->id = $id; $this->rowid = $id; $result = $this->rowid; } else { From 2373ef1caa231e7f564256bf741695d95e74b9ce Mon Sep 17 00:00:00 2001 From: David Pareja Rodriguez Date: Mon, 4 Sep 2023 13:20:11 +0200 Subject: [PATCH 0756/1137] Replicate changes from PR 25763 --- htdocs/accountancy/journal/sellsjournal.php | 45 ++++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 6ee2ae461ed..e7d28308fba 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -186,6 +186,7 @@ if ($result) { $tablocaltax1 = array(); $tablocaltax2 = array(); $tabcompany = array(); + $vatdata_cache = array(); $num = $db->num_rows($result); @@ -211,7 +212,13 @@ if ($result) { //$compta_revenuestamp = getDolGlobalString('ACCOUNTING_REVENUESTAMP_SOLD_ACCOUNT', 'NotDefined'); - $vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), $mysoc, $mysoc, 0); + $tax_id = $obj->tva_tx . ($obj->vat_src_code ? ' (' . $obj->vat_src_code . ')' : ''); + if (array_key_exists($tax_id, $vatdata_cache)) { + $vatdata = $vatdata_cache[$tax_id]; + } else { + $vatdata = getTaxesFromId($tax_id, $mysoc, $mysoc, 0); + $vatdata_cache[$tax_id] = $vatdata; + } $compta_tva = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); $compta_localtax1 = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); $compta_localtax2 = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); @@ -338,8 +345,16 @@ if ($result) { dol_print_error($db); } +// Check for too many invoices first. +if (count($tabfac) > 10000) { + $error++; + setEventMessages("TooManyInvoicesToProcessPleaseUseAMoreSelectiveFilter", null, 'errors'); +} + $errorforinvoice = array(); +/* +// Old way, 1 query for each invoice // Loop on all invoices to detect lines without binded code (fk_code_ventilation <= 0) foreach ($tabfac as $key => $val) { // Loop on each invoice $sql = "SELECT COUNT(fd.rowid) as nb"; @@ -356,8 +371,34 @@ foreach ($tabfac as $key => $val) { // Loop on each invoice dol_print_error($db); } } -//var_dump($errorforinvoice);exit; +*/ +// New way, single query, load all unbound lines +$sql = " +SELECT + fk_facture, + COUNT(fd.rowid) as nb +FROM + ".MAIN_DB_PREFIX."facturedet as fd +WHERE + fd.product_type <= 2 + AND fd.fk_code_ventilation <= 0 + AND fd.total_ttc <> 0 + AND fk_facture IN (".$db->sanitize(join(",", array_keys($tabfac))).") +GROUP BY fk_facture +"; +$resql = $db->query($sql); + +$num = $db->num_rows($resql); +$i = 0; +while ($i < $num) { + $obj = $db->fetch_object($resql); + if ($obj->nb > 0) { + $errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound'; + } + $i++; +} +//var_dump($errorforinvoice);exit; // Bookkeeping Write if ($action == 'writebookkeeping') { From 39c46ec1622abbd735e8650f488f9c227be86184 Mon Sep 17 00:00:00 2001 From: David Pareja Rodriguez Date: Mon, 4 Sep 2023 13:24:32 +0200 Subject: [PATCH 0757/1137] Switch prelevement_demande alias from pfd to pd --- .../class/bonprelevement.class.php | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index f543a21d426..10075d0fbb9 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -730,25 +730,25 @@ class BonPrelevement extends CommonObject // phpcs:enable global $conf; - $sql = "SELECT sum(pfd.amount) as nb"; + $sql = "SELECT sum(pd.amount) as nb"; if ($mode != 'bank-transfer') { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f,"; } else { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; } - $sql .= " ".MAIN_DB_PREFIX."prelevement_demande as pfd"; + $sql .= " ".MAIN_DB_PREFIX."prelevement_demande as pd"; $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; } if ($mode != 'bank-transfer') { - $sql .= " AND f.rowid = pfd.fk_facture"; + $sql .= " AND f.rowid = pd.fk_facture"; } else { - $sql .= " AND f.rowid = pfd.fk_facture_fourn"; + $sql .= " AND f.rowid = pd.fk_facture_fourn"; } $sql .= " AND f.paye = 0"; - $sql .= " AND pfd.traite = 0"; - $sql .= " AND pfd.ext_payment_id IS NULL"; + $sql .= " AND pd.traite = 0"; + $sql .= " AND pd.ext_payment_id IS NULL"; $sql .= " AND f.total_ttc > 0"; $resql = $this->db->query($sql); @@ -796,18 +796,18 @@ class BonPrelevement extends CommonObject } else { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; } - $sql .= ", ".MAIN_DB_PREFIX."prelevement_demande as pfd"; + $sql .= ", ".MAIN_DB_PREFIX."prelevement_demande as pd"; $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; } if ($type == 'bank-transfer') { - $sql .= " AND f.rowid = pfd.fk_facture_fourn"; + $sql .= " AND f.rowid = pd.fk_facture_fourn"; } else { - $sql .= " AND f.rowid = pfd.fk_facture"; + $sql .= " AND f.rowid = pd.fk_facture"; } - $sql .= " AND pfd.traite = 0"; - $sql .= " AND pfd.ext_payment_id IS NULL"; + $sql .= " AND pd.traite = 0"; + $sql .= " AND pd.ext_payment_id IS NULL"; $sql .= " AND f.total_ttc > 0"; dol_syslog(get_class($this)."::NbFactureAPrelever"); @@ -891,29 +891,29 @@ class BonPrelevement extends CommonObject $factures_errors = array(); if (!$error) { - $sql = "SELECT f.rowid, pfd.rowid as pfdrowid, f.fk_soc"; + $sql = "SELECT f.rowid, pd.rowid as pfdrowid, f.fk_soc"; $sql .= ", pfd.code_banque, pfd.code_guichet, pfd.number, pfd.cle_rib"; $sql .= ", pfd.amount"; $sql .= ", s.nom as name"; $sql .= ", f.ref, sr.bic, sr.iban_prefix, sr.frstrecur"; if ($type != 'bank-transfer') { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pfd ON f.rowid = pfd.fk_facture"; + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pd ON f.rowid = pd.fk_facture"; } else { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pfd ON f.rowid = pfd.fk_facture_fourn"; + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "prelevement_demande as pd ON f.rowid = pd.fk_facture_fourn"; } $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_rib as sr ON s.rowid = sr.fk_soc AND sr.default_rib = 1"; $sql .= " WHERE f.entity IN (".getEntity('invoice').')'; $sql .= " AND f.fk_statut = 1"; // Invoice validated $sql .= " AND f.paye = 0"; - $sql .= " AND pfd.traite = 0"; + $sql .= " AND pd.traite = 0"; $sql .= " AND f.total_ttc > 0"; - $sql .= " AND pfd.ext_payment_id IS NULL"; + $sql .= " AND pd.ext_payment_id IS NULL"; $sql .= " AND sr.type = 'bank' "; if ($did > 0) { - $sql .= " AND pfd.rowid = ".((int) $did); + $sql .= " AND pd.rowid = ".((int) $did); } dol_syslog(__METHOD__." Read invoices,", LOG_DEBUG); From f413a7b6d8dd4897ede766c975bebbe1ea36a34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Sep 2023 13:59:28 +0200 Subject: [PATCH 0758/1137] can edit bomline workstation --- htdocs/bom/bom_card.php | 7 ++++++- htdocs/bom/class/bom.class.php | 6 +++++- htdocs/bom/tpl/objectline_edit.tpl.php | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 4c647c156ad..a447d64bffc 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -266,7 +266,12 @@ 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, $fk_unit, $array_options); + $fk_default_workstation = $bomline->fk_default_workstation; + if (isModEnabled('workstation') && GETPOSTISSET('idworkstations')) { + $fk_default_workstation = GETPOST('idworkstations', 'int'); + } + + $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index f6a5620c51c..a55be2898af 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -708,9 +708,10 @@ class BOM extends CommonObject * @param string $import_key Import Key * @param int $fk_unit Unit of line * @param array $array_options extrafields array + * @param int $fk_default_workstation Default workstation * @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 = 0, $array_options = 0) + public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null, $fk_unit = 0, $array_options = 0, $fk_default_workstation = null) { global $mysoc, $conf, $langs, $user; @@ -789,6 +790,9 @@ class BOM extends CommonObject $line->array_options[$key] = $array_options[$key]; } } + if ($line->fk_default_workstation != $fk_default_workstation) { + $line->fk_default_workstation = $fk_default_workstation; + } $result = $line->update($user); diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 45d0d281c33..6d7ab47a822 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -155,6 +155,7 @@ if ($filtertype != 1) { $coldisplay++; print ''; + print $formproduct->selectWorkstations($line->fk_default_workstation, 'idworkstations', 1); print ''; $coldisplay++; From 5871e8d457df6c304369d9b52e5c334aed900702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Sep 2023 14:01:14 +0200 Subject: [PATCH 0759/1137] can edit bomline workstation --- 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 a55be2898af..d2e7ab950d2 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -790,7 +790,7 @@ class BOM extends CommonObject $line->array_options[$key] = $array_options[$key]; } } - if ($line->fk_default_workstation != $fk_default_workstation) { + if ($fk_default_workstation > 0 && $line->fk_default_workstation != $fk_default_workstation) { $line->fk_default_workstation = $fk_default_workstation; } From 8e2d98ea9b49b7196001b7cf9d6e4244b390bb6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2023 14:38:43 +0200 Subject: [PATCH 0760/1137] 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 a447d64bffc..c82548c743e 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -268,7 +268,7 @@ if (empty($reshook)) { $fk_default_workstation = $bomline->fk_default_workstation; if (isModEnabled('workstation') && GETPOSTISSET('idworkstations')) { - $fk_default_workstation = GETPOST('idworkstations', 'int'); + $fk_default_workstation = GETPOSTINT('idworkstations'); } $result = $object->updateLine($lineid, $qty, (int) $qty_frozen, (int) $disable_stock_change, $efficiency, $bomline->position, $bomline->import_key, $fk_unit, $array_options, $fk_default_workstation); From 91c48e29bf20187c752ddc31eb95878bc29fb22b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2023 14:52:40 +0200 Subject: [PATCH 0761/1137] Include commit starting with PERF, SEC, QUAL --- build/makepack-dolibarr.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index b7586e3909f..b9bdaba4e86 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------- # \file build/makepack-dolibarr.pl # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps) -# \author (c)2004-2020 Laurent Destailleur +# \author (c)2004-2023 Laurent Destailleur # # This is list of constant you can set to have generated packages moved into a specific dir: #DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild' @@ -369,12 +369,12 @@ if ($nboftargetok) { } if (! $BUILD || $BUILD eq '0-rc') # For a major version { - print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|PERF\|SEC\|QUAL\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; } else # For a maintenance release { - #print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\'| sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; - print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + #print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|PERF\|SEC\|QUAL\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\'| sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|PERF\|SEC\|QUAL\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/CLOSE/NEW/g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; } print "\n"; if (! $ret) From 02a64325ebb3dd658b961d76a59618783d825921 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2023 15:13:46 +0200 Subject: [PATCH 0762/1137] Update commonobject.class.php --- 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 34469f25b44..b58990d6bec 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6187,7 +6187,7 @@ abstract class CommonObject // Similar code than into insertExtraFields if ($attributeRequired) { $v = $this->array_options[$key]; - if (ExtraFields::isEmptyValue($v,$attributeType)) { + if (ExtraFields::isEmptyValue($v, $attributeType)) { $langs->load("errors"); dol_syslog("Mandatory field '".$key."' is empty during create and set to required into definition of extrafields"); $this->errors[] = $langs->trans('ErrorFieldRequired', $attributeLabel); From 9f389415ceac219acbff970009d040a253f9e7a2 Mon Sep 17 00:00:00 2001 From: David Pareja Rodriguez Date: Mon, 4 Sep 2023 15:19:25 +0200 Subject: [PATCH 0763/1137] Fix typo, sr.type = 'bank' -> sr.type = 'ban' --- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 10075d0fbb9..41bce07b981 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -911,7 +911,7 @@ class BonPrelevement extends CommonObject $sql .= " AND pd.traite = 0"; $sql .= " AND f.total_ttc > 0"; $sql .= " AND pd.ext_payment_id IS NULL"; - $sql .= " AND sr.type = 'bank' "; + $sql .= " AND sr.type = 'ban' "; if ($did > 0) { $sql .= " AND pd.rowid = ".((int) $did); } From cb4d04734d9ed60dbe021ea414207d7842b44341 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 4 Sep 2023 15:23:11 +0200 Subject: [PATCH 0764/1137] fix travais --- htdocs/core/class/commonobject.class.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a665e7b18e2..ad8b4595b65 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5660,35 +5660,35 @@ abstract class CommonObject // Set the public "share" key $setsharekey = false; if ($this->element == 'propal' || $this->element == 'proposal') { - if (!empty(getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN"))) { + if (getDolGlobalInt("PROPOSAL_ALLOW_ONLINESIGN")) { $setsharekey = true; // feature to make online signature is not set or set to on (default) } - if (!empty(getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD"))) { + if (getDolGlobalInt("PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { $setsharekey = true; } } - if ($this->element == 'commande' && !empty(getDolGlobalInt("ORDER_ALLOW_EXTERNAL_DOWNLOAD"))) { + if ($this->element == 'commande' && getDolGlobalInt("ORDER_ALLOW_EXTERNAL_DOWNLOAD")) { $setsharekey = true; } - if ($this->element == 'facture' && !empty(getDolGlobalInt("INVOICE_ALLOW_EXTERNAL_DOWNLOAD"))) { + if ($this->element == 'facture' && getDolGlobalInt("INVOICE_ALLOW_EXTERNAL_DOWNLOAD")) { $setsharekey = true; } - if ($this->element == 'bank_account' && !empty(getDolGlobalInt("BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD"))) { + if ($this->element == 'bank_account' && getDolGlobalInt("BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD")) { $setsharekey = true; } - if ($this->element == 'product' && !empty(getDolGlobalInt("PRODUCT_ALLOW_EXTERNAL_DOWNLOAD"))) { + if ($this->element == 'product' && getDolGlobalInt("PRODUCT_ALLOW_EXTERNAL_DOWNLOAD")) { $setsharekey = true; } - if ($this->element == 'contrat' && !empty(getDolGlobalInt("CONTRACT_ALLOW_EXTERNAL_DOWNLOAD"))) { + if ($this->element == 'contrat' && getDolGlobalInt("CONTRACT_ALLOW_EXTERNAL_DOWNLOAD")) { $setsharekey = true; } - if ($this->element == 'fichinter' && !empty(getDolGlobalInt("FICHINTER_ALLOW_EXTERNAL_DOWNLOAD"))) { + if ($this->element == 'fichinter' && getDolGlobalInt("FICHINTER_ALLOW_EXTERNAL_DOWNLOAD")) { $setsharekey = true; } - if ($this->element == 'supplier_proposal' && !empty(getDolGlobalInt("SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD"))) { + if ($this->element == 'supplier_proposal' && getDolGlobalInt("SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD")) { $setsharekey = true; } - if ($this->element == 'societe_rib' && !empty(getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN"))) { + if ($this->element == 'societe_rib' && getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN")) { $setsharekey = true; } From 2a1a855b6a653a457edceb0176598628603c5d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Sep 2023 16:38:27 +0200 Subject: [PATCH 0765/1137] phpstan --- htdocs/core/class/html.formcontract.class.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index faa8251ad0a..33694e798e6 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -188,15 +188,13 @@ class FormContract * @param int $showempty Show empty line * @param int $showRef Show customer and supplier reference on each contract (when found) * @param int $noouput 1=Return the output instead of display - * @return int Nbr of project if OK, <0 if KO + * @return string|void html string */ public function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0) { global $langs; - $ret = ''; - - $ret .= '
'; + $ret = ''; $ret .= ''; $ret .= ''; $ret .= $this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty, $showRef, 1); @@ -208,7 +206,5 @@ class FormContract } print $ret; - - return $result; } } From 0263728d5b4fa2e8dc2df49c8d83586d4471bebe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2023 16:47:44 +0200 Subject: [PATCH 0766/1137] Enable phpcs for PR too --- .travis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 54feb351933..0450f41de81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -325,22 +325,24 @@ script: echo - | - echo "Checking coding style (only for Pull Requests builds and 1 version to not overload travis and avoid duplicate tests)" + echo "Checking coding style (only for 1 version to not overload travis and avoid duplicate tests)" # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file - if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then + #if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then + if [ "$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 echo - | - echo "Checking missing debug" + echo "Checking missing debug (only for 1 version to not overload travis and avoid duplicate tests)" # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file - if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then + #if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then + if [ "$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 0694c8224d725f57aeea932f21465dc18e0935b4 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 4 Sep 2023 19:35:33 +0200 Subject: [PATCH 0767/1137] review SQL for develop --- htdocs/core/lib/company.lib.php | 2 +- htdocs/install/mysql/migration/17.0.0-18.0.0.sql | 9 +-------- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 8 ++++++++ htdocs/societe/paymentmodes.php | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 826c03876d6..f988a82e407 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -188,7 +188,7 @@ function societe_prepare_head(Societe $object) } // Bank accounts - if (empty(getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT'))) { + if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT')) { $nbBankAccount = 0; $foundonexternalonlinesystem = 0; $langs->load("bills"); diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index 198daf1baef..3e44428b286 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -428,7 +428,7 @@ CREATE TABLE llx_c_invoice_subtype ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1, fk_country integer NOT NULL, - code varchar(3) NOT NULL, + code varchar(4) NOT NULL, label varchar(100), active tinyint DEFAULT 1 NOT NULL ) ENGINE=innodb; @@ -454,13 +454,6 @@ ALTER TABLE llx_element_time ADD COLUMN ref_ext varchar(32); ALTER TABLE llx_c_ziptown ADD COLUMN town_up varchar(180); -ALTER TABLE llx_societe_rib ADD COLUMN model_pdf varchar(255) AFTER currency_code; -ALTER TABLE llx_societe_rib ADD COLUMN last_main_doc varchar(255) AFTER model_pdf; -ALTER TABLE llx_societe_rib ADD COLUMN date_signature datetime AFTER stripe_account; -ALTER TABLE llx_societe_rib ADD COLUMN online_sign_ip varchar(48) AFTER date_signature; -ALTER TABLE llx_societe_rib ADD COLUMN online_sign_name varchar(64) AFTER online_sign_ip; - -INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PROPOSAL_ALLOW_ONLINESIGN', 1, '1', 'string', 0); -- Email Collector ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN imap_encryption varchar(16) DEFAULT 'ssl' AFTER hostcharset; diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index cdebd4fc7c4..b848afaf893 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -92,3 +92,11 @@ ALTER TABLE llx_actioncomm ADD COLUMN fk_bookcal_availability integer DEFAULT NU ALTER TABLE llx_product_lot ADD COLUMN qc_frequency integer DEFAULT NULL; ALTER TABLE llx_product_lot ADD COLUMN lifetime integer DEFAULT NULL; + +ALTER TABLE llx_societe_rib ADD COLUMN model_pdf varchar(255) AFTER currency_code; +ALTER TABLE llx_societe_rib ADD COLUMN last_main_doc varchar(255) AFTER model_pdf; +ALTER TABLE llx_societe_rib ADD COLUMN date_signature datetime AFTER stripe_account; +ALTER TABLE llx_societe_rib ADD COLUMN online_sign_ip varchar(48) AFTER date_signature; +ALTER TABLE llx_societe_rib ADD COLUMN online_sign_name varchar(64) AFTER online_sign_ip; + +INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PROPOSAL_ALLOW_ONLINESIGN', 1, '1', 'string', 0); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index aa10fffecac..c122d61c7d5 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1546,7 +1546,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print_liste_field_titre("WithdrawMode"); } print_liste_field_titre("Default", '', '', '', '', '', '', '', 'center '); - if (empty(getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT')) && !empty(getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN"))) { + if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT') && getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN")) { print_liste_field_titre('', '', '', '', '', '', '', '', 'center '); } print_liste_field_titre('', '', '', '', '', '', '', '', 'center '); @@ -1726,7 +1726,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (empty(getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT')) && !empty(getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN"))) { + if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT') && getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN")) { // Show online signature link print ''; $useonlinesignature = 1; From cd81c2e18d0f4266296545571f08441256a1ef47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Sep 2023 20:29:33 +0200 Subject: [PATCH 0768/1137] phpstan --- htdocs/compta/prelevement/class/bonprelevement.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 44cd2437195..455e1c7972c 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -87,6 +87,10 @@ class BonPrelevement extends CommonObject */ public $file; + /* + * @var string filename + */ + public $filename; const STATUS_DRAFT = 0; const STATUS_TRANSFERED = 1; From 56bb72c1af864610b1f0cf9af52b98515df98175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Sep 2023 20:39:00 +0200 Subject: [PATCH 0769/1137] phpstan --- htdocs/core/class/commondocgenerator.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index bfec5a6c199..ccb379ea531 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -150,6 +150,8 @@ abstract class CommonDocGenerator */ public $result; + public $posxlabel; + public $posxup; public $posxref; public $posxpicture; // For picture public $posxdesc; // For description From 4f1f9ec455818f17c286b5103b95778c2d75dc38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2023 21:23:07 +0200 Subject: [PATCH 0770/1137] NEW Add filter on status of line of a dictionary --- htdocs/admin/dict.php | 51 ++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index fb306b9b257..89765c55941 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -93,6 +93,7 @@ if (!GETPOSTISSET('search_country_id') && $search_country_id == '' && ($id == 2 $search_country_id = $mysoc->country_id; } $search_code = GETPOST('search_code', 'alpha'); +$search_active = GETPOST('search_active', 'alpha'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admin', 'dictionaryadmin')); @@ -702,6 +703,7 @@ if ($reshook < 0) { if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) { $search_country_id = ''; $search_code = ''; + $search_active = ''; } if (empty($reshook)) { @@ -1225,37 +1227,30 @@ if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } -/* - * Show a dictionary - */ +// Show a dictionary if ($id > 0) { // Complete search values request with sort criteria $sql = $tabsql[$id]; + $tableprefix = ''; + $tableprefixarray = array(28 => 'h.', 7 => 'a.', 32 => 'a.', 3 => 'r.', 8 => 't.', 10 => 't.', 1 => 'f.', 2 => 'd.', 14 => 'd.'); + if (!empty($tableprefixarray[$id])) { + $tableprefix = $tableprefixarray[$id]; + } + if (!preg_match('/ WHERE /', $sql)) { $sql .= " WHERE 1 = 1"; } if ($search_country_id > 0) { $sql .= " AND c.rowid = ".((int) $search_country_id); } - if ($search_code != '' && $id == 9) { - $sql .= natural_search("code_iso", $search_code); - } elseif ($search_code != '' && $id == 28) { - $sql .= natural_search("h.code", $search_code); - } elseif ($search_code != '' && ($id == 7 || $id == 32)) { - $sql .= natural_search("a.code", $search_code); - } elseif ($search_code != '' && $id == 3) { - $sql .= natural_search("r.code_region", $search_code); - } elseif ($search_code != '' && ($id == 8 || $id == 10)) { - $sql .= natural_search("t.code", $search_code); - } elseif ($search_code != '' && $id == 1) { - $sql .= natural_search("f.code", $search_code); - } elseif ($search_code != '' && $id == 2) { - $sql .= natural_search("d.code_departement", $search_code); - } elseif ($search_code != '' && $id == 14) { - $sql .= natural_search("e.code", $search_code); - } elseif ($search_code != '' && $id != 9) { - $sql .= natural_search("code", $search_code); + if ($search_code != '') { + $sql .= natural_search($tableprefix."code_iso", $search_code); + } + if ($search_active == 'yes') { + $sql .= " AND ".$tableprefix."active = 1"; + } elseif ($search_active == 'no') { + $sql .= " AND ".$tableprefix."active = 0"; } if ($sortfield) { @@ -1370,7 +1365,8 @@ if ($id > 0) { } if ($value == 'country') { if (in_array('region_id', $fieldlist)) { - print ' '; continue; + //print ' '; + continue; } // For region page, we do not show the country input $valuetoshow = $langs->trans("Country"); } @@ -1512,10 +1508,12 @@ if ($id > 0) { if ($id == 2) { // Special case for state page if ($value == 'region_id') { - $valuetoshow = ' '; $showfield = 1; + $valuetoshow = ' '; + $showfield = 1; } if ($value == 'region') { - $valuetoshow = $langs->trans("Country").'/'.$langs->trans("Region"); $showfield = 1; + $valuetoshow = $langs->trans("Country").'/'.$langs->trans("Region"); + $showfield = 1; } } @@ -1695,7 +1693,10 @@ if ($id > 0) { $colspan++; } - print ''; + // Active + print ''; + print $form->selectyesno('search_active', $search_active, 0, false, 1); + print ''; $colspan++; // Action button From f403558a8f110ec6230e8f26a62087b2bf930c94 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Sep 2023 22:49:55 +0200 Subject: [PATCH 0771/1137] QUAL: Standardize code and look and feel for dictionaries --- htdocs/admin/dict.php | 793 ++++++++++++++++-------------- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 423 insertions(+), 372 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 89765c55941..1f072db3cbb 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -54,6 +54,38 @@ $rowid = GETPOST('rowid', 'alpha'); $entity = GETPOST('entity', 'int'); $code = GETPOST('code', 'alpha'); +$acts = array(); $actl = array(); +$acts[0] = "activate"; +$acts[1] = "disable"; +$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"'); +$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"'); + +// Load variable for pagination +$listoffset = GETPOST('listoffset'); +$listlimit = GETPOST('listlimit') > 0 ?GETPOST('listlimit') : 1000; // To avoid too long dictionaries +$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 + $page = 0; +} +$offset = $listlimit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; + +$search_country_id = GETPOST('search_country_id', 'int'); +$search_code = GETPOST('search_code', 'alpha'); +$search_active = GETPOST('search_active', 'alpha'); + +// Special case to set a default value for country according to dictionary +if (!GETPOSTISSET('search_country_id') && $search_country_id == '' && ($id == 2 || $id == 3 || $id == 10)) { // Not a so good idea to force on current country for all dictionaries. Some tables have entries that are for all countries, we must be able to see them, so this is done for dedicated dictionaries only. + $search_country_id = $mysoc->country_id; +} + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('admin', 'dictionaryadmin')); + $allowed = $user->admin; if ($id == 7 && $user->hasRight('accounting', 'chartofaccount')) { $allowed = 1; // Tax page allowed to manager of chart account @@ -68,35 +100,8 @@ if (!$allowed) { accessforbidden(); } -$acts = array(); $actl = array(); -$acts[0] = "activate"; -$acts[1] = "disable"; -$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"'); -$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"'); +$permissiontoadd = $allowed; -$listoffset = GETPOST('listoffset'); -$listlimit = GETPOST('listlimit') > 0 ?GETPOST('listlimit') : 1000; // To avoid too long dictionaries -$active = 1; - -$sortfield = GETPOST('sortfield', 'aZ09comma'); -$sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { - $page = 0; -} // If $page is not defined, or '' or -1 -$offset = $listlimit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; - -$search_country_id = GETPOST('search_country_id', 'int'); -if (!GETPOSTISSET('search_country_id') && $search_country_id == '' && ($id == 2 || $id == 3 || $id == 10)) { // Not a so good idea to force on current country for all dictionaries. Some tables have entries that are for all countries, we must be able to see them, so this is done for dedicated dictionaries only. - $search_country_id = $mysoc->country_id; -} -$search_code = GETPOST('search_code', 'alpha'); -$search_active = GETPOST('search_active', 'alpha'); - -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('admin', 'dictionaryadmin')); // This page is a generic page to edit dictionaries // Put here declaration of dictionaries properties @@ -671,6 +676,7 @@ $localtax_typeList = array( ); + /* * Actions */ @@ -748,9 +754,9 @@ if (empty($reshook)) { && ($id != 10 || ($value != 'code' && $value != 'note')) // Field code and note is not mandatory for dictionary table 10 ) ) { - $ok = 0; - $fieldnamekey = $value; - // We take translate key of field + $ok = 0; + $fieldnamekey = $value; + // We take translate key of field if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) { $fieldnamekey = 'Label'; } @@ -1000,6 +1006,13 @@ if (empty($reshook)) { setEventMessages($db->error(), null, 'errors'); } } + + if (!$ok && GETPOST('actionadd')) { + $action = 'create'; + } + if (!$ok && GETPOST('actionmodify')) { + $action = 'edit'; + } } if ($action == 'confirm_delete' && $confirm == 'yes') { // delete @@ -1170,7 +1183,6 @@ if (empty($reshook)) { */ $form = new Form($db); -$formadmin = new FormAdmin($db); $title = $langs->trans("DictionarySetup"); @@ -1191,22 +1203,16 @@ if ($id == 7 && GETPOST('from') == 'accountancy') { $titlepicto = 'accountancy'; } -print load_fiche_titre($title, $linkback, $titlepicto); - -if (empty($id)) { - print ''.$langs->trans("DictionaryDesc"); - print " ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; - print '

'; -} - - $param = '&id='.urlencode($id); -if ($search_country_id > 0) { - $param .= '&search_country_id='.urlencode($search_country_id); +if ($search_country_id || GETPOSTISSET('page') || GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) { + $param .= '&search_country_id='.urlencode($search_country_id ? $search_country_id : -1); } if ($search_code != '') { $param .= '&search_code='.urlencode($search_code); } +if ($search_active != '') { + $param .= '&search_active='.urlencode($search_active); +} if ($entity != '') { $param .= '&entity='.(int) $entity; } @@ -1230,14 +1236,17 @@ if ($action == 'delete') { // Show a dictionary if ($id > 0) { // Complete search values request with sort criteria - $sql = $tabsql[$id]; + $sqlfields = $tabsql[$id]; + $tablecode = ''; $tableprefix = ''; - $tableprefixarray = array(28 => 'h.', 7 => 'a.', 32 => 'a.', 3 => 'r.', 8 => 't.', 10 => 't.', 1 => 'f.', 2 => 'd.', 14 => 'd.'); + $tableprefixarray = array(9 => 'code_iso', 28 => 'h.code', 7 => 'a.code', 32 => 'a.code', 3 => 'r.code_region', 8 => 't.code', 10 => 't.code', 1 => 'f.code', 2 => 'd.code_departement', 14 => 'e.code'); if (!empty($tableprefixarray[$id])) { - $tableprefix = $tableprefixarray[$id]; + $tablecode = $tableprefixarray[$id]; + $tableprefix = preg_replace('/\..*$/', '.', $tablecode); } + $sql = $sqlfields; if (!preg_match('/ WHERE /', $sql)) { $sql .= " WHERE 1 = 1"; } @@ -1245,13 +1254,35 @@ if ($id > 0) { $sql .= " AND c.rowid = ".((int) $search_country_id); } if ($search_code != '') { - $sql .= natural_search($tableprefix."code_iso", $search_code); + $sql .= natural_search($tablecode, $search_code); } if ($search_active == 'yes') { $sql .= " AND ".$tableprefix."active = 1"; } elseif ($search_active == 'no') { $sql .= " AND ".$tableprefix."active = 0"; } + //print $sql; + + // Count total nb of records + $nbtotalofrecords = ''; + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^.*\sFROM\s/', 'SELECT COUNT(*) as nbtotalofrecords FROM ', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 + $page = 0; + $offset = 0; + } + $db->free($resql); + } if ($sortfield) { // If sort order is "country", we use country_code instead @@ -1267,7 +1298,16 @@ if ($id > 0) { $sql .= " ORDER BY "; } $sql .= $tabsqlsort[$id]; + $sql .= $db->plimit($listlimit + 1, $offset); + + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + exit; + } + $num = $db->num_rows($resql); + //print $sql; if (empty($tabfield[$id])) { @@ -1280,330 +1320,12 @@ if ($id > 0) { print ''; print ''; + // Special warning for VAT dictionary if ($id == 10 && empty($conf->global->FACTURE_TVAOPTION)) { print info_admin($langs->trans("VATIsUsedIsOff", $langs->transnoentities("Setup"), $langs->transnoentities("CompanyFoundation"))); print "
\n"; } - // Form to add a new line - if ($tabname[$id]) { - $withentity = null; - - $fieldlist = explode(',', $tabfield[$id]); - - print '
'; - print ''; - - // Line for title - print ''; - $tdsoffields = ''; - foreach ($fieldlist as $field => $value) { - if ($value == 'entity') { - $withentity = getEntity($tabname[$id]); - continue; - } - - // Define field friendly name from its technical name - $valuetoshow = ucfirst($value); // Par defaut - $valuetoshow = $langs->trans($valuetoshow); // try to translate - $class = ''; - - if ($value == 'pos') { - $valuetoshow = $langs->trans("Position"); $class = 'right'; - } - if ($value == 'source') { - $valuetoshow = $langs->trans("Contact"); - } - if ($value == 'price') { - $valuetoshow = $langs->trans("PriceUHT"); - } - if ($value == 'taux') { - if ($tabname[$id] != "c_revenuestamp") { - $valuetoshow = $langs->trans("Rate"); - } else { - $valuetoshow = $langs->trans("Amount"); - } - $class = 'center'; - } - if ($value == 'localtax1_type') { - $valuetoshow = $langs->trans("UseLocalTax")." 2"; $class = "center"; $sortable = 0; - } - if ($value == 'localtax1') { - $valuetoshow = $langs->trans("RateOfTaxN", '2'); $class = "center"; - } - if ($value == 'localtax2_type') { - $valuetoshow = $langs->trans("UseLocalTax")." 3"; $class = "center"; $sortable = 0; - } - if ($value == 'localtax2') { - $valuetoshow = $langs->trans("RateOfTaxN", '3'); $class = "center"; - } - if ($value == 'organization') { - $valuetoshow = $langs->trans("Organization"); - } - if ($value == 'lang') { - $valuetoshow = $langs->trans("Language"); - } - if ($value == 'type') { - if ($tabname[$id] == "c_paiement") { - $valuetoshow = $form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, '')); - } else { - $valuetoshow = $langs->trans("Type"); - } - } - if ($value == 'code') { - $valuetoshow = $langs->trans("Code"); $class = 'maxwidth100'; - } - if ($value == 'libelle' || $value == 'label') { - $valuetoshow = $form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, '')); - } - if ($value == 'libelle_facture') { - $valuetoshow = $form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, '')); - } - if ($value == 'deposit_percent') { - $valuetoshow = $langs->trans('DepositPercent'); - $class = 'right'; - } - if ($value == 'country') { - if (in_array('region_id', $fieldlist)) { - //print ''; - continue; - } // For region page, we do not show the country input - $valuetoshow = $langs->trans("Country"); - } - if ($value == 'recuperableonly') { - $valuetoshow = $langs->trans("NPR"); $class = "center"; - } - if ($value == 'nbjour') { - $valuetoshow = $langs->trans("NbOfDays"); - $class = 'right'; - } - if ($value == 'type_cdr') { - $valuetoshow = $langs->trans("AtEndOfMonth"); $class = "center"; - } - if ($value == 'decalage') { - $valuetoshow = $langs->trans("Offset"); - $class = 'right'; - } - if ($value == 'width' || $value == 'nx') { - $valuetoshow = $langs->trans("Width"); - } - if ($value == 'height' || $value == 'ny') { - $valuetoshow = $langs->trans("Height"); - } - if ($value == 'unit' || $value == 'metric') { - $valuetoshow = $langs->trans("MeasuringUnit"); - } - if ($value == 'region_id' || $value == 'country_id') { - $valuetoshow = ''; - } - if ($value == 'accountancy_code') { - $valuetoshow = $langs->trans("AccountancyCode"); - } - if ($value == 'accountancy_code_sell') { - $valuetoshow = $langs->trans("AccountancyCodeSell"); - } - if ($value == 'accountancy_code_buy') { - $valuetoshow = $langs->trans("AccountancyCodeBuy"); - } - if ($value == 'pcg_version' || $value == 'fk_pcg_version') { - $valuetoshow = $langs->trans("Pcg_version"); - } - if ($value == 'account_parent') { - $valuetoshow = $langs->trans("Accountparent"); - } - if ($value == 'pcg_type') { - $valuetoshow = $langs->trans("Pcg_type"); - } - if ($value == 'pcg_subtype') { - $valuetoshow = $langs->trans("Pcg_subtype"); - } - if ($value == 'sortorder') { - $valuetoshow = $langs->trans("SortOrder"); - $class = 'center'; - } - if ($value == 'short_label') { - $valuetoshow = $langs->trans("ShortLabel"); - } - if ($value == 'fk_parent') { - $valuetoshow = $langs->trans("ParentID"); $class = 'center'; - } - if ($value == 'range_account') { - $valuetoshow = $langs->trans("Range"); - } - if ($value == 'sens') { - $valuetoshow = $langs->trans("Sens"); - } - if ($value == 'category_type') { - $valuetoshow = $langs->trans("Calculated"); - } - if ($value == 'formula') { - $valuetoshow = $langs->trans("Formula"); - } - if ($value == 'paper_size') { - $valuetoshow = $langs->trans("PaperSize"); - } - if ($value == 'orientation') { - $valuetoshow = $langs->trans("Orientation"); - } - if ($value == 'leftmargin') { - $valuetoshow = $langs->trans("LeftMargin"); - } - if ($value == 'topmargin') { - $valuetoshow = $langs->trans("TopMargin"); - } - if ($value == 'spacex') { - $valuetoshow = $langs->trans("SpaceX"); - } - if ($value == 'spacey') { - $valuetoshow = $langs->trans("SpaceY"); - } - if ($value == 'font_size') { - $valuetoshow = $langs->trans("FontSize"); - } - if ($value == 'custom_x') { - $valuetoshow = $langs->trans("CustomX"); - } - if ($value == 'custom_y') { - $valuetoshow = $langs->trans("CustomY"); - } - if ($value == 'percent') { - $valuetoshow = $langs->trans("Percentage"); - } - if ($value == 'affect') { - $valuetoshow = $langs->trans("WithCounter"); - } - if ($value == 'delay') { - $valuetoshow = $langs->trans("NoticePeriod"); - } - if ($value == 'newbymonth') { - $valuetoshow = $langs->trans("NewByMonth"); - } - if ($value == 'fk_tva') { - $valuetoshow = $langs->trans("VAT"); - } - if ($value == 'range_ik') { - $valuetoshow = $langs->trans("RangeIk"); - } - if ($value == 'fk_c_exp_tax_cat') { - $valuetoshow = $langs->trans("CarCategory"); - } - if ($value == 'revenuestamp_type') { - $valuetoshow = $langs->trans('TypeOfRevenueStamp'); - } - if ($value == 'use_default') { - $valuetoshow = $langs->trans('Default'); $class = 'center'; - } - if ($value == 'unit_type') { - $valuetoshow = $langs->trans('TypeOfUnit'); - } - if ($value == 'public' && $tablib[$id] == 'TicketDictCategory') { - $valuetoshow = $langs->trans('TicketGroupIsPublic'); $class = 'center'; - } - if ($value == 'block_if_negative') { - $valuetoshow = $langs->trans('BlockHolidayIfNegative'); - } - if ($value == 'type_duration') { - $valuetoshow = $langs->trans('Unit'); - } - - if ($id == 2) { // Special case for state page - if ($value == 'region_id') { - $valuetoshow = ' '; - $showfield = 1; - } - if ($value == 'region') { - $valuetoshow = $langs->trans("Country").'/'.$langs->trans("Region"); - $showfield = 1; - } - } - - if ($valuetoshow != '') { - $tooltiphelp = (isset($tabcomplete[$tabname[$id]]['help'][$value]) ? $tabcomplete[$tabname[$id]]['help'][$value] : ''); - - $tdsoffields .= ''; - if ($tooltiphelp && preg_match('/^http(s*):/i', $tooltiphelp)) { - $tdsoffields .= ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; - } elseif ($tooltiphelp) { - $tdsoffields .= $form->textwithpicto($valuetoshow, $tooltiphelp); - } else { - $tdsoffields .= $valuetoshow; - } - $tdsoffields .= ''; - } - } - - if ($id == 4) { - $tdsoffields .= ''; - $tdsoffields .= ''; - } - $tdsoffields .= ''; - $tdsoffields .= ''; - $tdsoffields .= ''; - $tdsoffields .= ''; - - print $tdsoffields; - - - // Line to enter new values - print ''; - print ''; - - $obj = new stdClass(); - // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd')) { - foreach ($fieldlist as $key => $val) { - if (GETPOST($val) != '') { - $obj->$val = GETPOST($val); - } - } - } - - $tmpaction = 'create'; - $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks - $error = $hookmanager->error; $errors = $hookmanager->errors; - - if ($id == 3) { - unset($fieldlist[2]); // Remove field ??? if dictionary Regions - } - - if (empty($reshook)) { - fieldList($fieldlist, $obj, $tabname[$id], 'add'); - } - - if ($id == 4) { - print ''; - print ''; - } - print ''; - - print ""; - - print '
 '; - $tdsoffields .= ''; - if (!is_null($withentity)) { - $tdsoffields .= ''; - } - $tdsoffields .= '
'; - if ($action != 'edit') { - print ''; - } else { - print ''; - } - print '
'; - print '
'; - } - - print ''; - - - print '
'; - - - print '
'; - print ''; - print ''; - // List of available record in database dol_syslog("htdocs/admin/dict", LOG_DEBUG); @@ -1612,12 +1334,336 @@ if ($id > 0) { $num = $db->num_rows($resql); $i = 0; - // There is several pages - if (($num > $listlimit) || $page) { - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); - print '
'; + $massactionbutton = $linkback; + + $newcardbutton = ''; + /*$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitleSeparator(); + */ + $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/admin/dict.php?action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'tools', 0, $newcardbutton, '', $listlimit, 1, 0, 1); + + + if ($action == 'create') { + // Form to add a new line + if ($tabname[$id]) { + $withentity = null; + + $fieldlist = explode(',', $tabfield[$id]); + + print '
'; + print ''; + + // Line for title + print ''; + $tdsoffields = ''; + foreach ($fieldlist as $field => $value) { + if ($value == 'entity') { + $withentity = getEntity($tabname[$id]); + continue; + } + + // Define field friendly name from its technical name + $valuetoshow = ucfirst($value); // Par defaut + $valuetoshow = $langs->trans($valuetoshow); // try to translate + $class = ''; + + if ($value == 'pos') { + $valuetoshow = $langs->trans("Position"); $class = 'right'; + } + if ($value == 'source') { + $valuetoshow = $langs->trans("Contact"); + } + if ($value == 'price') { + $valuetoshow = $langs->trans("PriceUHT"); + } + if ($value == 'taux') { + if ($tabname[$id] != "c_revenuestamp") { + $valuetoshow = $langs->trans("Rate"); + } else { + $valuetoshow = $langs->trans("Amount"); + } + $class = 'center'; + } + if ($value == 'localtax1_type') { + $valuetoshow = $langs->trans("UseLocalTax")." 2"; $class = "center"; $sortable = 0; + } + if ($value == 'localtax1') { + $valuetoshow = $langs->trans("RateOfTaxN", '2'); $class = "center"; + } + if ($value == 'localtax2_type') { + $valuetoshow = $langs->trans("UseLocalTax")." 3"; $class = "center"; $sortable = 0; + } + if ($value == 'localtax2') { + $valuetoshow = $langs->trans("RateOfTaxN", '3'); $class = "center"; + } + if ($value == 'organization') { + $valuetoshow = $langs->trans("Organization"); + } + if ($value == 'lang') { + $valuetoshow = $langs->trans("Language"); + } + if ($value == 'type') { + if ($tabname[$id] == "c_paiement") { + $valuetoshow = $form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, '')); + } else { + $valuetoshow = $langs->trans("Type"); + } + } + if ($value == 'code') { + $valuetoshow = $langs->trans("Code"); $class = 'maxwidth100'; + } + if ($value == 'libelle' || $value == 'label') { + $valuetoshow = $form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, '')); + } + if ($value == 'libelle_facture') { + $valuetoshow = $form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, '')); + } + if ($value == 'deposit_percent') { + $valuetoshow = $langs->trans('DepositPercent'); + $class = 'right'; + } + if ($value == 'country') { + if (in_array('region_id', $fieldlist)) { + //print ''; + continue; + } // For region page, we do not show the country input + $valuetoshow = $langs->trans("Country"); + } + if ($value == 'recuperableonly') { + $valuetoshow = $langs->trans("NPR"); $class = "center"; + } + if ($value == 'nbjour') { + $valuetoshow = $langs->trans("NbOfDays"); + $class = 'right'; + } + if ($value == 'type_cdr') { + $valuetoshow = $langs->trans("AtEndOfMonth"); $class = "center"; + } + if ($value == 'decalage') { + $valuetoshow = $langs->trans("Offset"); + $class = 'right'; + } + if ($value == 'width' || $value == 'nx') { + $valuetoshow = $langs->trans("Width"); + } + if ($value == 'height' || $value == 'ny') { + $valuetoshow = $langs->trans("Height"); + } + if ($value == 'unit' || $value == 'metric') { + $valuetoshow = $langs->trans("MeasuringUnit"); + } + if ($value == 'region_id' || $value == 'country_id') { + $valuetoshow = ''; + } + if ($value == 'accountancy_code') { + $valuetoshow = $langs->trans("AccountancyCode"); + } + if ($value == 'accountancy_code_sell') { + $valuetoshow = $langs->trans("AccountancyCodeSell"); + } + if ($value == 'accountancy_code_buy') { + $valuetoshow = $langs->trans("AccountancyCodeBuy"); + } + if ($value == 'pcg_version' || $value == 'fk_pcg_version') { + $valuetoshow = $langs->trans("Pcg_version"); + } + if ($value == 'account_parent') { + $valuetoshow = $langs->trans("Accountparent"); + } + if ($value == 'pcg_type') { + $valuetoshow = $langs->trans("Pcg_type"); + } + if ($value == 'pcg_subtype') { + $valuetoshow = $langs->trans("Pcg_subtype"); + } + if ($value == 'sortorder') { + $valuetoshow = $langs->trans("SortOrder"); + $class = 'center'; + } + if ($value == 'short_label') { + $valuetoshow = $langs->trans("ShortLabel"); + } + if ($value == 'fk_parent') { + $valuetoshow = $langs->trans("ParentID"); $class = 'center'; + } + if ($value == 'range_account') { + $valuetoshow = $langs->trans("Range"); + } + if ($value == 'sens') { + $valuetoshow = $langs->trans("Sens"); + } + if ($value == 'category_type') { + $valuetoshow = $langs->trans("Calculated"); + } + if ($value == 'formula') { + $valuetoshow = $langs->trans("Formula"); + } + if ($value == 'paper_size') { + $valuetoshow = $langs->trans("PaperSize"); + } + if ($value == 'orientation') { + $valuetoshow = $langs->trans("Orientation"); + } + if ($value == 'leftmargin') { + $valuetoshow = $langs->trans("LeftMargin"); + } + if ($value == 'topmargin') { + $valuetoshow = $langs->trans("TopMargin"); + } + if ($value == 'spacex') { + $valuetoshow = $langs->trans("SpaceX"); + } + if ($value == 'spacey') { + $valuetoshow = $langs->trans("SpaceY"); + } + if ($value == 'font_size') { + $valuetoshow = $langs->trans("FontSize"); + } + if ($value == 'custom_x') { + $valuetoshow = $langs->trans("CustomX"); + } + if ($value == 'custom_y') { + $valuetoshow = $langs->trans("CustomY"); + } + if ($value == 'percent') { + $valuetoshow = $langs->trans("Percentage"); + } + if ($value == 'affect') { + $valuetoshow = $langs->trans("WithCounter"); + } + if ($value == 'delay') { + $valuetoshow = $langs->trans("NoticePeriod"); + } + if ($value == 'newbymonth') { + $valuetoshow = $langs->trans("NewByMonth"); + } + if ($value == 'fk_tva') { + $valuetoshow = $langs->trans("VAT"); + } + if ($value == 'range_ik') { + $valuetoshow = $langs->trans("RangeIk"); + } + if ($value == 'fk_c_exp_tax_cat') { + $valuetoshow = $langs->trans("CarCategory"); + } + if ($value == 'revenuestamp_type') { + $valuetoshow = $langs->trans('TypeOfRevenueStamp'); + } + if ($value == 'use_default') { + $valuetoshow = $langs->trans('Default'); $class = 'center'; + } + if ($value == 'unit_type') { + $valuetoshow = $langs->trans('TypeOfUnit'); + } + if ($value == 'public' && $tablib[$id] == 'TicketDictCategory') { + $valuetoshow = $langs->trans('TicketGroupIsPublic'); $class = 'center'; + } + if ($value == 'block_if_negative') { + $valuetoshow = $langs->trans('BlockHolidayIfNegative'); + } + if ($value == 'type_duration') { + $valuetoshow = $langs->trans('Unit'); + } + + if ($id == 2) { // Special case for state page + if ($value == 'region_id') { + $valuetoshow = ' '; + $showfield = 1; + } + if ($value == 'region') { + $valuetoshow = $langs->trans("Country").'/'.$langs->trans("Region"); + $showfield = 1; + } + } + + if ($valuetoshow != '') { + $tooltiphelp = (isset($tabcomplete[$tabname[$id]]['help'][$value]) ? $tabcomplete[$tabname[$id]]['help'][$value] : ''); + + $tdsoffields .= ''; + if ($tooltiphelp && preg_match('/^http(s*):/i', $tooltiphelp)) { + $tdsoffields .= ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; + } elseif ($tooltiphelp) { + $tdsoffields .= $form->textwithpicto($valuetoshow, $tooltiphelp); + } else { + $tdsoffields .= $valuetoshow; + } + $tdsoffields .= ''; + } + } + + if ($id == 4) { + $tdsoffields .= ''; + $tdsoffields .= ''; + } + $tdsoffields .= ''; + $tdsoffields .= ''; + $tdsoffields .= ''; + $tdsoffields .= ''; + + print $tdsoffields; + + + // Line to enter new values + print ''; + print ''; + + $obj = new stdClass(); + // If data was already input, we define them in obj to populate input fields. + if (GETPOST('actionadd')) { + foreach ($fieldlist as $key => $val) { + if (GETPOST($val) != '') { + $obj->$val = GETPOST($val); + } + } + } + + $tmpaction = 'create'; + $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $error = $hookmanager->error; $errors = $hookmanager->errors; + + if ($id == 3) { + unset($fieldlist[2]); // Remove field ??? if dictionary Regions + } + + if (empty($reshook)) { + fieldList($fieldlist, $obj, $tabname[$id], 'add'); + } + + if ($id == 4) { + print ''; + print ''; + } + print ''; + + print ""; + + print '
 '; + $tdsoffields .= ''; + if (!is_null($withentity)) { + $tdsoffields .= ''; + } + $tdsoffields .= '
'; + if ($action != 'edit') { + print ''; + } else { + print ''; + } + print '
'; + print '
'; + } + + print '
'; + + print '
'; + print ''; + print ''; } + $filterfound = 0; foreach ($fieldlist as $field => $value) { if ($value == 'entity') { @@ -1671,7 +1717,7 @@ if ($id > 0) { if ($showfield) { if ($value == 'country') { print ''; - print $form->select_country($search_country_id, 'search_country_id', '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone'); + print $form->select_country($search_country_id, 'search_country_id', '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone', '', ' '); print ''; $colspan++; } elseif ($value == 'code') { @@ -2348,6 +2394,11 @@ if ($id > 0) { /* * Show list of dictionary to show */ + print load_fiche_titre($title, $linkback, $titlepicto); + + print ''.$langs->trans("DictionaryDesc"); + print " ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; + print '

'; $lastlineisempty = false; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 710ad9f3dce..a984ef485c7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5532,7 +5532,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict */ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', $sortorder = '', $morehtmlcenter = '', $num = -1, $totalnboflines = '', $picto = 'generic', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limit = -1, $hideselectlimit = 0, $hidenavigation = 0, $pagenavastextinput = 0, $morehtmlrightbeforearrow = '') { - global $conf, $langs; + global $conf; $savlimit = $limit; $savtotalnboflines = $totalnboflines; From 7a45f083a5de70be3791bc0da85f34bfefed954c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 5 Sep 2023 09:22:18 +0200 Subject: [PATCH 0772/1137] fix travais --- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 77d47756f92..7ebad740724 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -106,12 +106,11 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->xPosSignArea=120; - $this->heightforfreetext = (!empty(getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT')) ? getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') : 5); + $this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') > 0 ? getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') : 5); $this->heightforfooter = $this->marge_basse + 8; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Function to create pdf of company bank account sepa mandate From c340943f409918ecbc5737739524b19bfe8b1449 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:55:44 +0300 Subject: [PATCH 0773/1137] Fix translation --- htdocs/langs/en_US/companies.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 19b17a73dff..871d9a72809 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -1,5 +1,5 @@ # Dolibarr language file - Source file is en_US - companies -newSocieteAdded=Your contact has been recorded. We will go back to you soon... +newSocieteAdded=Your contact details have been recorded. We will get back to you soon... ContactUsDesc=This form allows you to send us a message for a first contact. ErrorCompanyNameAlreadyExists=Company name %s already exists. Choose another one. ErrorSetACountryFirst=Set the country first From 4be3933e5d3df57f98ad4aa8a5852c7d7266c918 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Sep 2023 13:36:55 +0200 Subject: [PATCH 0774/1137] Fix regression --- htdocs/website/class/website.class.php | 50 +++++++++++++------------- htdocs/website/index.php | 8 ++--- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 42798ae7bfa..b9e67356539 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -398,19 +398,20 @@ class Website extends CommonObject /** * Load all object in memory ($this->records) from the database * - * @param string $sortorder Sort Order - * @param string $sortfield Sort field - * @param int $limit offset limit - * @param int $offset offset limit - * @param array $filter filter array - * @param string $filtermode filter mode (AND or OR) - * - * @return int <0 if KO, >0 if OK + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit offset limit + * @param int $offset offset limit + * @param array $filter filter array + * @param string $filtermode filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); + $records = array(); + $sql = "SELECT"; $sql .= " t.rowid,"; $sql .= " t.entity,"; @@ -444,35 +445,34 @@ class Website extends CommonObject if (!empty($limit)) { $sql .= $this->db->plimit($limit, $offset); } - $this->lines = array(); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); while ($obj = $this->db->fetch_object($resql)) { - $line = new self($this->db); + $record = new self($this->db); - $line->id = $obj->rowid; + $record->id = $obj->rowid; - $line->entity = $obj->entity; - $line->ref = $obj->ref; - $line->description = $obj->description; - $line->lang = $obj->lang; - $line->otherlang = $obj->otherlang; - $line->status = $obj->status; - $line->fk_default_home = $obj->fk_default_home; - $line->virtualhost = $obj->virtualhost; - $this->fk_user_creat = $obj->fk_user_creat; - $this->fk_user_modif = $obj->fk_user_modif; - $line->date_creation = $this->db->jdate($obj->date_creation); - $line->date_modification = $this->db->jdate($obj->date_modification); + $record->entity = $obj->entity; + $record->ref = $obj->ref; + $record->description = $obj->description; + $record->lang = $obj->lang; + $record->otherlang = $obj->otherlang; + $record->status = $obj->status; + $record->fk_default_home = $obj->fk_default_home; + $record->virtualhost = $obj->virtualhost; + $record->fk_user_creat = $obj->fk_user_creat; + $record->fk_user_modif = $obj->fk_user_modif; + $record->date_creation = $this->db->jdate($obj->date_creation); + $record->date_modification = $this->db->jdate($obj->date_modification); - $this->lines[$line->id] = $line; + $records[$record->id] = $record; } $this->db->free($resql); - return $num; + return $records; } else { $this->errors[] = 'Error '.$this->db->lasterror(); dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ad484aec16e..e0b4d4c6c84 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -157,11 +157,11 @@ if (empty($action)) { $object = new Website($db); $objectpage = new WebsitePage($db); -$object->fetchAll('ASC', 'position'); // Init $object->lines with list of websites +$listofwebsites = $object->fetchAll('ASC', 'position'); // Init list of websites // If website not defined, we take first found if (!($websiteid > 0) && empty($websitekey) && $action != 'createsite') { - foreach ($object->lines as $key => $valwebsite) { + foreach ($listofwebsites as $key => $valwebsite) { $websitekey = $valwebsite->ref; break; } @@ -2873,13 +2873,13 @@ if (!GETPOST('hide_websitemenu')) { $out = ''; $out .= '  
'; + // Bookcal Calendar + if (isModEnabled("bookcal")) { + foreach ($bookcalcalendars["calendars"] as $key => $value) { + $label = $value['label']; + $s .= '
 
'; + } + } + // Calendars from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action); @@ -673,7 +714,7 @@ $sql .= ' a.datep2,'; $sql .= ' a.percent,'; $sql .= ' a.fk_user_author,a.fk_user_action,'; $sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,'; -$sql .= ' a.fk_soc, a.fk_contact, a.fk_project,'; +$sql .= ' a.fk_soc, a.fk_contact, a.fk_project, a.fk_bookcal_availability,'; $sql .= ' a.fk_element, a.elementtype,'; $sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color, ca.type as type_type, ca.picto as type_picto'; $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; @@ -862,6 +903,10 @@ if ($resql) { $event->socid = $obj->fk_soc; $event->contact_id = $obj->fk_contact; + $event->fk_bookcal_availability = $obj->fk_bookcal_availability; + if (!empty($event->fk_bookcal_availability)) { + $event->type = "bookcal_calendar"; + } // Defined date_start_in_calendar and date_end_in_calendar property // They are date start and end of action but modified to not be outside calendar view. @@ -1505,7 +1550,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month } //var_dump($todayarray['mday']."==".$tmpday." && ".$todayarray['mon']."==".$month." && ".$todayarray['year']."==".$year.' -> '.$style); echo ' '; - show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam); + show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam, 0, 60, 0, $bookcalcalendars); echo "\n"; } else { /* Show days after the current month (next month) */ @@ -1578,7 +1623,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month } echo ' '; - show_day_events($db, $tmpday, $tmpmonth, $tmpyear, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); + show_day_events($db, $tmpday, $tmpmonth, $tmpyear, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0, $bookcalcalendars); echo " \n"; } echo " \n"; @@ -1668,13 +1713,13 @@ if (empty($mode) || $mode == 'show_month') { // View by month echo '
'; - show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 1); + show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 1, $bookcalcalendars); print '
'; } else { print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table - show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0); + show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0, $bookcalcalendars); print '
'; } @@ -1703,9 +1748,10 @@ $db->close(); * @param int $showinfo Add extended information (used by day and week view) * @param int $minheight Minimum height for each event. 60px by default. * @param string $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button" + * @param string $bookcalcalendarsarray Used for Bookcal module array of calendar of bookcal * @return void */ -function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0) +function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0, $bookcalcalendarsarray = array()) { global $user, $conf, $langs; global $action, $mode, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form @@ -1817,6 +1863,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $colorindex = 2; $cssclass = 'family_birthday '; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); + } elseif ($event->type == 'bookcal_calendar') { + $numbirthday++; + $colorindex = 3; + $cssclass = 'family_bookcal_calendar_'.(!empty($bookcalcalendarsarray[$fk_bookcal_availability]) ? $bookcalcalendarsarray[$fk_bookcal_availability][$event->fk_bookcal_availability] : ""); + $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); } else { $numother++; $color = ($event->icalcolor ? $event->icalcolor : -1); @@ -1904,6 +1955,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->type == 'holiday' && !GETPOST('check_holiday')) { $morecss = 'hidden'; } + if ($event->type == 'bookcal_calendar' && !GETPOST('check_bookcal_calendar_'.$bookcalcalendarsarray["availabilitieslink"][$event->fk_bookcal_availability])) { + $morecss = 'hidden'; + } if ($morecss != 'hidden') { $itoshow++; } @@ -1911,8 +1965,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $ireallyshown++; } //var_dump($event->type.' - '.$morecss.' - '.$cssclass.' - '.$i.' - '.$ireallyshown.' - '.$itoshow); - - print '
type == 'bookcal_calendar') { + print '
fk_bookcal_availability].' '.$cssclass.($morecss ? ' '.$morecss : '').'"'; + } else { + print '
idate($datetocheckbooking)."'"; - $sql .= " AND b.start < '".$db->idate($datetocheckbooking_end)."'"; + $sql .= " AND b.datep >= '".$db->idate($datetocheckbooking)."'"; + $sql .= " AND b.datep < '".$db->idate($datetocheckbooking_end)."'"; $resql = $db->query($sql); if ($resql) { @@ -94,7 +94,7 @@ if ($action == 'verifyavailability') { $response["content"] = array(); while ($i < $num) { $obj = $db->fetch_object($resql); - $dateobject = $obj->start; + $dateobject = $obj->datep; $dateobject = explode(" ", $dateobject)[1]; $dateobject = explode(":", $dateobject); diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index fbbc4180423..07237b63d45 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -297,7 +297,7 @@ class modBookCal extends DolibarrModules $r = 0; // Add here entries to declare new menus /* BEGIN MODULEBUILDER TOPMENU */ - $this->menu[$r++] = array( + /*$this->menu[$r++] = array( 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', // This is a Top menu entry 'titre'=>'ModuleBookCalName', @@ -311,18 +311,33 @@ class modBookCal extends DolibarrModules 'perms'=>'$user->rights->bookcal->availabilities->read', // Use 'perms'=>'$user->rights->bookcal->availabilities->read' if you want your menu with a permission rules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); + );*/ /* END MODULEBUILDER TOPMENU */ /* BEGIN MODULEBUILDER LEFTMENU CALENDAR */ + $this->menu[$r++] = array( + 'fk_menu'=>'fk_mainmenu=agenda', + 'type'=>'left', + 'titre'=> 'MenuBookcalIndex', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em92"'), + 'mainmenu'=>'agenda', + 'leftmenu'=> 'bookcal', + 'url'=> '/bookcal/bookcalindex.php', + 'langs'=> 'bookcal', + 'position'=> 1100+$r, + 'enabled'=> '1', + 'perms'=> '$user->rights->bookcal->calendar->read', + 'user'=> 0 + ); + $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=bookcal', + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=bookcal', // This is a Left menu entry 'type'=>'left', - 'titre'=>'List Calendar', - 'mainmenu'=>'bookcal', - 'leftmenu'=>'bookcal_calendar', + 'titre'=>'Calendar', + 'mainmenu'=>'agenda', + 'leftmenu'=>'bookcal_calendar_list', 'url'=>'/bookcal/calendar_list.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'bookcal', @@ -337,12 +352,12 @@ class modBookCal extends DolibarrModules ); $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=bookcal,fk_leftmenu=bookcal_calendar', + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=bookcal_calendar_list', // This is a Left menu entry 'type'=>'left', - 'titre'=>'New Calendar', - 'mainmenu'=>'bookcal', - 'leftmenu'=>'bookcal_calendar', + 'titre'=>'NewCalendar', + 'mainmenu'=>'agenda', + 'leftmenu'=>'bookcal_new', 'url'=>'/bookcal/calendar_card.php?action=create', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'bookcal', @@ -405,11 +420,11 @@ class modBookCal extends DolibarrModules $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=bookcal', + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=bookcal', // This is a Left menu entry 'type'=>'left', - 'titre'=>'List Availabilities', - 'mainmenu'=>'bookcal', + 'titre'=>'Availabilities', + 'mainmenu'=>'agenda', 'leftmenu'=>'bookcal_availabilities', 'url'=>'/bookcal/availabilities_list.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. @@ -425,11 +440,11 @@ class modBookCal extends DolibarrModules ); $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=bookcal,fk_leftmenu=bookcal_availabilities', + 'fk_menu'=>'fk_mainmenu=agenda,fk_leftmenu=bookcal_availabilities', // This is a Left menu entry 'type'=>'left', - 'titre'=>'New Availabilities', - 'mainmenu'=>'bookcal', + 'titre'=>'NewAvailabilities', + 'mainmenu'=>'agenda', 'leftmenu'=>'bookcal_availabilities', 'url'=>'/bookcal/availabilities_card.php?action=create', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index abdbdbed6a1..07d97bb967f 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -180,4 +180,5 @@ BrowserPush=Browser Popup Notification Reminders=Reminders ActiveByDefault=Enabled by default Until=until -DataFromWasMerged=Data from %s was merged \ No newline at end of file +DataFromWasMerged=Data from %s was merged +AgendaShowBookcalCalendar=Booking calendar: %s \ No newline at end of file diff --git a/htdocs/public/bookcal/booking.php b/htdocs/public/bookcal/booking.php index 74972cfc8f0..0ddc53ebd6f 100644 --- a/htdocs/public/bookcal/booking.php +++ b/htdocs/public/bookcal/booking.php @@ -44,6 +44,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/class/calendar.class.php'; require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $langs->loadLangs(array("main", "other", "dict", "agenda", "errors", "companies")); @@ -169,13 +171,21 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ if ($action == 'add') { $error = 0; - $urlback = ''; + $idcontact = 0; + $calendar = new Calendar($db); + $contact = new Contact($db); + $actioncomm = new ActionComm($db); + + $res = $calendar->fetch($fk_calendar); + if ($res < 0) { + $error++; + $errmsg .= $calendar->error." ".join(',', $calendar->errors); + } + if (!is_object($user)) { $user = new User($db); } - $booking = new ActionComm($db); - $db->begin(); if (!GETPOST("lastname")) { $error++; @@ -191,21 +201,71 @@ if ($action == 'add') { } if (!$error) { - $booking->ref = $booking->getNextNumRef(); - $booking->lastname = GETPOST("lastname"); - $booking->firstname = GETPOST("firstname"); - $booking->email = GETPOST("email"); - $booking->description = GETPOST("description"); - $booking->duration = GETPOST("duration"); - $booking->start = GETPOST("datetimebooking", 'int'); - $booking->fk_bookcal_availability = GETPOST("id", 'int'); + $sql = "SELECT s.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as s"; + $sql .= " WHERE s.lastname = '".GETPOST("lastname")."'"; + $sql .= " AND s.firstname = '".GETPOST("firstname")."'"; + $sql .= " AND s.email = '".GETPOST("email")."'"; + $resql = $db->query($sql); - $result = $booking->create($user); - if ($result <= 0) { + if ($resql) { + $num = $db->num_rows($resql); + if ($num > 0) { + $obj = $db->fetch_object($resql); + $idcontact = $obj->rowid; + $contact->fetch($idcontact); + } else { + $contact->lastname = GETPOST("lastname"); + $contact->firstname = GETPOST("firstname"); + $contact->email = GETPOST("email"); + $result = $contact->create($user); + if ($result < 0) { + $error++; + $errmsg .= $contact->error." ".join(',', $contact->errors); + } + } + } else { $error++; - $errmsg = ($booking->error ? $booking->error.'
' : '').join('
', $booking->errors); + $errmsg .= $db->lasterror(); } } + + if (!$error) { + $dateend = dol_time_plus_duree(GETPOST("datetimebooking", 'int'), GETPOST("duration"), 'i'); + + $actioncomm->label = "test"; + $actioncomm->type = 'AC_RDV'; + $actioncomm->type_id = 5; + $actioncomm->datep = GETPOST("datetimebooking", 'int'); + $actioncomm->datef = $dateend; + $actioncomm->note_private = GETPOST("description"); + $actioncomm->percentage = -1; + $actioncomm->fk_bookcal_availability = GETPOST("id", 'int'); + $actioncomm->userownerid = $calendar->visibility; + $actioncomm->contact_id = $contact->id; + $actioncomm->socpeopleassigned = $contact->id; + $result = $actioncomm->create($user); + if ($result < 0) { + $error++; + $errmsg .= $actioncomm->error." ".join(',', $actioncomm->errors); + } + + if (!$error) { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources"; + $sql .= "(fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency"; + $sql .= ") VALUES ("; + $sql .= (int) $actioncomm->id; + $sql .= ", 'socpeople'"; + $sql .= ", ". (int) $contact->id; + $sql .= ", 0, 0, 0)"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $errmsg .= $db->lasterror(); + } + } + } + if (!$error) { $db->commit(); $action = 'afteradd'; diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php index cd4db57da4d..39d6b1f84da 100644 --- a/htdocs/public/bookcal/index.php +++ b/htdocs/public/bookcal/index.php @@ -180,7 +180,7 @@ print '
'; print '

'.(!empty($object->label) ? $object->label : $object->ref).'

'; -$sql = "SELECT b.rowid, b.ref, b.label, b.start, b.end, b.duration, b.startHour, b.endHour"; +$sql = "SELECT b.rowid, b.label, b.start, b.end, b.duration, b.startHour, b.endHour"; $sql .= " FROM ".MAIN_DB_PREFIX."bookcal_availabilities as b"; $sql .= " WHERE b.status = ".(int) $availabilities::STATUS_VALIDATED; $sql .= " AND b.fk_bookcal_calendar = ".(int) $id; @@ -193,7 +193,7 @@ if ($resql) { while ($i < $num) { $i++; $obj = $db->fetch_object($resql); - print ''; + print ''; } } print '
'; From 6459c862b883e1c3761893fda59b3751407dd8c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Sep 2023 16:50:23 +0200 Subject: [PATCH 0778/1137] Comment --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index d6bc0027da4..9d38e7fdb3d 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -371,7 +371,7 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '', //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft"); /*print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid; print ", dbtablename=".$tableandshare.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select; - print ", perm: user->right->".$features.($feature2 ? "->".$feature2 : "")."=".($user->hasRight($features, $feature2, 'lire'))."
"; + print ", perm: user->hasRight(".$features.($feature2 ? ",".$feature2 : "").", lire) = ".($feature2 ? $user->hasRight($features, $feature2, 'lire') : $user->hasRight($features, 'lire'))."
"; */ $parentfortableentity = ''; From c95c006810e3ad76ff7a64a890c58d0a8bb29d37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Sep 2023 17:01:04 +0200 Subject: [PATCH 0779/1137] Fix regression --- htdocs/product/list.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4028726096a..9c9f3e5f274 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -413,7 +413,9 @@ if (empty($reshook)) { */ $product_static = new Product($db); -$static_ws = new Workstation($db); +if (isModEnabled('workstation')) { + $workstation_static = new Workstation($db); +} $product_fourn = new ProductFournisseur($db); $title = $langs->trans("ProductsAndServices"); @@ -1844,12 +1846,12 @@ while ($i < $imaxinloop) { // Default Workstation if (!empty($arrayfields['p.fk_default_workstation']['checked'])) { print ''; - if (!empty($obj->fk_default_workstation)) { - $static_ws->id = $obj->fk_default_workstation; - $static_ws->ref = $obj->ref_workstation; - $static_ws->status = $obj->status_workstation; + if (isModEnabled('workstation') && !empty($obj->fk_default_workstation)) { + $workstation_static->id = $obj->fk_default_workstation; + $workstation_static->ref = $obj->ref_workstation; + $workstation_static->status = $obj->status_workstation; - print $static_ws->getNomUrl(1); + print $workstation_static->getNomUrl(1); } print ''; if (!$i) { From e9cb81ded83565d7e71100e301b69c1ffbb70acc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Sep 2023 17:40:09 +0200 Subject: [PATCH 0780/1137] Code comment --- 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 a984ef485c7..87fd9041207 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7561,6 +7561,7 @@ function dol_html_entity_decode($a, $b, $c = 'UTF-8', $keepsomeentities = 0) * @param string $encoding Encoding page code * @param bool $double_encode When double_encode is turned off, PHP will not encode existing html entities * @return string $ret Encoded string + * @see dol_htmlentitiesbr() */ function dol_htmlentities($string, $flags = ENT_QUOTES|ENT_SUBSTITUTE, $encoding = 'UTF-8', $double_encode = false) { From 6b2a8ae744885e89e668fbfd6857a0f194352d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 5 Sep 2023 18:27:30 +0200 Subject: [PATCH 0781/1137] phpstan --- htdocs/core/class/rssparser.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index fc3a8753a59..28da9f9a72d 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -52,6 +52,11 @@ class RssParser private $_rssarray = array(); private $current_namespace; + public $items = array(); + public $current_item = array(); + public $channel = array(); + public $textinput = array(); + public $image = array(); private $initem; private $intextinput; From b739b5b76d490b0300ce259b7482b73f32867729 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 5 Sep 2023 18:50:04 +0200 Subject: [PATCH 0782/1137] add badge for each tabs --- htdocs/core/lib/modulebuilder.lib.php | 28 +++++++++++++++++++++ htdocs/modulebuilder/index.php | 35 ++++++++++++++++++--------- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 7281936216a..9d1e7ebec97 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -1290,3 +1290,31 @@ function writeApiUrlsInDoc($file_api, $file_doc) } return -1; } + + +/** + * count directories or files in modulebuilder folder + * @param string $path path of directory + * @param int $type type of file 1= file,2=directory + * @return int|bool + */ +function countItemsInDirectory($path, $type = 1) +{ + if (!is_dir($path)) { + return false; + } + + $allFilesAndDirs = scandir($path); + $count = 0; + + foreach ($allFilesAndDirs as $item) { + if ($item != '.' && $item != '..') { + if ($type == 1 && is_file($path . DIRECTORY_SEPARATOR . $item) && strpos($item, '.back') === false) { + $count++; + } elseif ($type == 2 && is_dir($path . DIRECTORY_SEPARATOR . $item)) { + $count++; + } + } + } + return $count; +} diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d3f8ee41052..17b0d51d67f 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -3203,6 +3203,19 @@ if ($module == 'initmodule') { // Tabs for module if (!$error) { $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; + $destdir = $dirread.'/'.strtolower($module); + $objects = dolGetListOfObjectClasses($destdir); + $diroflang = dol_buildpath($modulelowercase, 0)."/langs"; + $countLangs = countItemsInDirectory($diroflang, 2); + $countDictionaries = count($moduleobj->dictionaries['tabname']); + $countRights = count($moduleobj->rights); + $countMenus = count($moduleobj->menu); + $countTriggers = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/core/triggers"); + $countWidgets = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/core/boxes"); + $countCss = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/css"); + $countJs = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/js"); + $countCLI = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/scripts"); + $hasDoc = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/doc"); $head2 = array(); $h = 0; @@ -3213,22 +3226,22 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Objects"); + $head2[$h][1] = (count($objects) <= 0 ? $langs->trans("Objects") : $langs->trans("Objects")." (".count($objects).")"); $head2[$h][2] = 'objects'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=languages&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Languages"); + $head2[$h][1] = ($countLangs <= 0 ? $langs->trans("Languages") : $langs->trans("Languages")." (".$countLangs.") "); $head2[$h][2] = 'languages'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Dictionaries"); + $head2[$h][1] = ($countDictionaries <= 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries')." (".$countDictionaries.")"); $head2[$h][2] = 'dictionaries'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=permissions&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Permissions"); + $head2[$h][1] = ($countRights <= 0 ? $langs->trans("Permissions") : $langs->trans("Permissions")." (".$countRights.")"); $head2[$h][2] = 'permissions'; $h++; @@ -3238,7 +3251,7 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=menus&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Menus"); + $head2[$h][1] = ($countMenus <= 0 ? $langs->trans("Menus") : $langs->trans("Menus")." (".$countMenus.")"); $head2[$h][2] = 'menus'; $h++; @@ -3248,12 +3261,12 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=triggers&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Triggers"); + $head2[$h][1] = ($countTriggers <= 0 ? $langs->trans("Triggers") : $langs->trans("Triggers")." (".$countTriggers.")"); $head2[$h][2] = 'triggers'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=widgets&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Widgets"); + $head2[$h][1] = ($countWidgets <= 0 ? $langs->trans("Widgets") : $langs->trans("Widgets")." (".$countWidgets.")"); $head2[$h][2] = 'widgets'; $h++; @@ -3263,17 +3276,17 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=css&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("CSS"); + $head2[$h][1] = ($countCss <= 0 ? $langs->trans("CSS") : $langs->trans("CSS")." (".$countCss.")"); $head2[$h][2] = 'css'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=js&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("JS"); + $head2[$h][1] = ($countJs <= 0 ? $langs->trans("JS") : $langs->trans("JS")." (".$countJs.")"); $head2[$h][2] = 'js'; $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=cli&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("CLI"); + $head2[$h][1] = ($countCLI <= 0 ? $langs->trans("CLI") : $langs->trans("CLI")." (".$countCLI.")"); $head2[$h][2] = 'cli'; $h++; @@ -3283,7 +3296,7 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=specifications&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = $langs->trans("Documentation"); + $head2[$h][1] = ($hasDoc <= 0 ? $langs->trans("Documentation") : $langs->trans("Documentation")." (".$hasDoc.")"); $head2[$h][2] = 'specifications'; $h++; From d8c51cb311f3c7e9bfe60ee77ae3a44338a70fe8 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 5 Sep 2023 18:54:08 +0200 Subject: [PATCH 0783/1137] check before each actions --- htdocs/modulebuilder/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 0dd5b15507b..b2d1350932d 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1290,7 +1290,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { } $rights = $moduleobj->rights; $moduledescriptorfile = $destdir.'/core/modules/mod'.$module.'.class.php'; - $checkComment = checkExistComment($moduledescriptorfile, 1); + $checkComment=checkExistComment($moduledescriptorfile, 1); if ($checkComment < 0) { setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings'); } else { From d0fb3839c338e344f644ce9ac5f14783c1660e6b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 5 Sep 2023 19:15:43 +0200 Subject: [PATCH 0784/1137] reveiw --- htdocs/projet/tasks/time.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 09fcb073156..9f3ac54f2ec 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1043,7 +1043,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Description print ''.$langs->trans("Description").''; - print nl2br($projectstatic->description); + print dol_htmlentitiesbr($projectstatic->description); print ''; // Categories @@ -2087,7 +2087,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) { - print ''; + print ''; print ''; print ' '; print ''; From baa386333449e5207734d389a6e46253fab87f01 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Sep 2023 22:41:17 +0200 Subject: [PATCH 0785/1137] css --- dev/tools/apstats.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 271bd264270..7b6b1f08cda 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -246,11 +246,11 @@ th,td { margin-left: 10px; } .back1 { - background-color: #888800; + background-color: #884466; color: #FFF; } -.back1 { - background-color: #880088; +.back2 { + background-color: #664488; color: #FFF; } '; From e2bf0315c39d75e0591d0a1d1b05467acaa53407 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Sep 2023 01:42:35 +0200 Subject: [PATCH 0786/1137] Fix fatal error on mod_contrat_olive. Missing getExample() --- .../core/modules/contract/mod_contract_magre.php | 2 +- .../core/modules/contract/mod_contract_olive.php | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index fd476eb2bc5..8deebdcffb5 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -102,7 +102,7 @@ class mod_contract_magre extends ModelNumRefContracts */ public function getExample() { - global $conf, $langs, $mysoc; + global $langs, $mysoc; $old_code_client = $mysoc->code_client; $mysoc->code_client = 'CCCCCCCCCC'; diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php index 4051ac7c779..2737899a65c 100644 --- a/htdocs/core/modules/contract/mod_contract_olive.php +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -78,6 +78,16 @@ class mod_contract_olive extends ModelNumRefContracts return $langs->trans("LeopardNumRefModelDesc"); } + /** + * Return numbering example + * + * @return string Example + */ + public function getExample() + { + return ''; + } + /** * Return an example of result returned by getNextValue * @@ -87,7 +97,6 @@ class mod_contract_olive extends ModelNumRefContracts */ public function getNextValue($objsoc, $contract) { - global $langs; return ''; } @@ -112,9 +121,9 @@ class mod_contract_olive extends ModelNumRefContracts $result = 0; $code = strtoupper(trim($code)); - if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) { + if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTRACT_CODE_ALWAYS_REQUIRED)) { $result = 0; - } elseif (empty($code) && (!$this->code_null || !empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED))) { + } elseif (empty($code) && (!$this->code_null || !empty($conf->global->MAIN_CONTRACT_CODE_ALWAYS_REQUIRED))) { $result = -2; } From 84d12cf591fe6bde9e2af47146c1b8b14e95b656 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Sep 2023 02:38:08 +0200 Subject: [PATCH 0787/1137] NEW Add option TAKEPOS_HIDE_PRODUCT_PRICES to hide prices in TakePOS --- htdocs/takepos/index.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 32d7301b6fe..3be9730e9cd 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1455,10 +1455,12 @@ if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) { //echo ''; print ''; } else { - if (getDolGlobalString('TAKEPOS_HIDE_PRODUCT_IMAGES')) { - echo ''; - } else { + if (!getDolGlobalString('TAKEPOS_HIDE_PRODUCT_PRICES')) { print '
'; + } + if (getDolGlobalString('TAKEPOS_HIDE_PRODUCT_IMAGES')) { + print ''; + } else { print ''; } } From 0d76c492446f9b96827fb54dda7b0f18a0193ee4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Sep 2023 03:19:38 +0200 Subject: [PATCH 0788/1137] Trans --- htdocs/langs/en_US/ecm.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index c10f3a088b7..941977b3e40 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -45,7 +45,7 @@ ExtraFieldsEcmFiles=Extrafields Ecm Files ExtraFieldsEcmDirectories=Extrafields Ecm Directories ECMSetup=ECM Setup GenerateImgWebp=Duplicate all images with another version with .webp format -ConfirmGenerateImgWebp=If you confirm, you will generate an image in .webp format for all images currently into this folder (subfolders are not included)... +ConfirmGenerateImgWebp=If you confirm, you will generate an image in .webp format for all images currently into this folder (subfolders are not included, webp images will not be generated if size is greater than original)... ConfirmImgWebpCreation=Confirm all images duplication GenerateChosenImgWebp=Duplicate chosen image with another version with .webp format ConfirmGenerateChosenImgWebp=If you confirm, you will generate an image in .webp format for the image %s From 37b43f97cec5289d324db0cefa597d7b64499b06 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 6 Sep 2023 08:32:13 +0200 Subject: [PATCH 0789/1137] fix getDol --- htdocs/core/lib/signature.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index f99f3c434b3..cd174655823 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -77,7 +77,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) $securekeyseed = ''; if ($type == 'proposal') { - $securekeyseed = isset($conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN : ''; + $securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN'); $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '' : ''); if ($mode == 1) { @@ -117,7 +117,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) } }*/ } elseif ($type == 'contract') { - $securekeyseed = isset($conf->global->CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN : ''; + $securekeyseed = getDolGlobalString('CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN'); $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=contract&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'contract_ref'; @@ -132,7 +132,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled('multicompany') ? (is_null($object) ? '' : $object->entity) : ''), '0'); } } elseif ($type == 'fichinter') { - $securekeyseed = isset($conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN : ''; + $securekeyseed = getDolGlobalString('FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN'); $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=fichinter&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'fichinter_ref'; @@ -147,7 +147,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(isModEnabled('multicompany') ? (is_null($object) ? '' : $object->entity) : ''), '0'); } } else { - $securekeyseed = getDolUserString(dol_strtoupper($type).'ONLINE_SIGNATURE_SECURITY_TOKEN'); + $securekeyseed = getDolGlobalString(dol_strtoupper($type).'ONLINE_SIGNATURE_SECURITY_TOKEN'); $out = $urltouse.'/public/onlinesign/newonlinesign.php?source='.$type.'&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= $type.'_ref'; From 68ba7d230002ba622ae2b59499b28918e794b897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Sep 2023 08:52:01 +0200 Subject: [PATCH 0790/1137] phpstan --- htdocs/comm/propal/class/propal.class.php | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b76ba76fb8d..c1bf1c04782 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -116,9 +116,22 @@ class Propal extends CommonObject /** * Ref from thirdparty * @var string + * @deprecated + * @see $ref_customer */ public $ref_client; + /** + * Ref from thirdparty + * @var string + */ + public $ref_customer; + + /** + * @var Propal oldcopy with propal properties + */ + public $oldcopy; + /** * Status of the quote * @var int @@ -240,7 +253,21 @@ class Propal extends CommonObject public $address_type; public $address; + /** + * @var int availabilty ID + */ public $availability_id; + + /** + * @var int availabilty ID + * @deprecated + * @see $availability_id + */ + public $fk_availability; + + /** + * @var string availabilty code + */ public $availability_code; public $duree_validite; @@ -256,6 +283,10 @@ class Propal extends CommonObject * @var PropaleLigne[] */ public $lines = array(); + + /** + * @var PropaleLigne + */ public $line; public $labelStatus = array(); From 9715d5fbc7110dcd6c5f694ffc9100c1573f23ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Sep 2023 08:57:00 +0200 Subject: [PATCH 0791/1137] phpstan --- htdocs/comm/propal/class/propal.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b76ba76fb8d..5e1989dd934 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -970,8 +970,9 @@ class Propal extends CommonObject $this->update_price(1, 'auto'); - $this->fk_propal = $this->id; - $this->rowid = $rowid; + // $this is Propal + // $this->fk_propal = $this->id; + // $this->rowid = $rowid; $this->db->commit(); return $result; From 3af376444eed2fad8ea489481277b74ceb747a58 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 6 Sep 2023 10:32:59 +0200 Subject: [PATCH 0792/1137] fix: inner jion always better to use index than where --- htdocs/comm/action/peruser.php | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index aaf9ae7d8ca..ffa4f833b82 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -549,11 +549,16 @@ if ($resourceid > 0) { } // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) { - $sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; -} -if ($usergroup > 0) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar"; + $sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type='user'"; + if ($filtert > 0) { + $sql .= " AND ar.fk_element = ".$filtert; + } + if ($usergroup > 0) { + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); + } } + $sql .= ' WHERE a.fk_action = ca.id'; $sql .= ' AND a.entity IN ('.getEntity('agenda').')'; // Condition on actioncode @@ -597,10 +602,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) { if ($socid > 0) { $sql .= ' AND a.fk_soc = '.((int) $socid); } -// We must filter on assignement table -if ($filtert > 0 || $usergroup > 0) { - $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'"; -} + if ($mode == 'show_day') { $sql .= " AND ("; $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; @@ -645,17 +647,6 @@ if ($status == 'done' || $status == '100') { if ($status == 'todo') { $sql .= " AND (a.percent >= 0 AND a.percent < 100)"; } -// We must filter on assignement table -if ($filtert > 0 || $usergroup > 0) { - $sql .= " AND ("; - if ($filtert > 0) { - $sql .= "ar.fk_element = ".$filtert; - } - if ($usergroup > 0) { - $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); - } - $sql .= ")"; -} // Sort on date $sql .= ' ORDER BY fk_user_action, datep'; //fk_user_action //print $sql; From cac1d7f617ef2eda48f5920b2459612f176484ee Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 6 Sep 2023 11:09:46 +0200 Subject: [PATCH 0793/1137] new: all in repair.php force_collation_from_conf_on_tables --- htdocs/install/repair.php | 59 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 8e0d3218df7..095feb995a8 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -97,6 +97,7 @@ print 'Option set_empty_time_spent_amount (\'test\' or \'confirmed\') is '.(GETP // Structure print 'Option force_utf8_on_tables (force utf8 + row=dynamic), for mysql/mariadb only (\'test\' or \'confirmed\') is '.(GETPOST('force_utf8_on_tables', 'alpha') ?GETPOST('force_utf8_on_tables', 'alpha') : 'undefined').'
'."\n"; print "Option force_utf8mb4_on_tables (force utf8mb4 + row=dynamic, EXPERIMENTAL!), for mysql/mariadb only ('test' or 'confirmed') is ".(GETPOST('force_utf8mb4_on_tables', 'alpha') ? GETPOST('force_utf8mb4_on_tables', 'alpha') : 'undefined')."
\n"; +print "Option force_collation_from_conf_on_tables (force ".$conf->db->character_set."/".$conf->db->dolibarr_main_db_collation." + row=dynamic), for mysql/mariadb only ('test' or 'confirmed') is ".(GETPOST('force_collation_from_conf_on_tables', 'alpha') ? GETPOST('force_collation_from_conf_on_tables', 'alpha') : 'undefined')."
\n"; // Rebuild sequence print 'Option rebuild_sequences, for postgresql only (\'test\' or \'confirmed\') is '.(GETPOST('rebuild_sequences', 'alpha') ?GETPOST('rebuild_sequences', 'alpha') : 'undefined').'
'."\n"; print '
'; @@ -178,7 +179,7 @@ $oneoptionset = (GETPOST('standard', 'alpha') || GETPOST('restore_thirdparties_l || GETPOST('clean_orphelin_dir', 'alpha') || GETPOST('clean_product_stock_batch', 'alpha') || GETPOST('set_empty_time_spent_amount', 'alpha') || GETPOST('rebuild_product_thumbs', 'alpha') || GETPOST('clean_perm_table', 'alpha') || GETPOST('force_disable_of_modules_not_found', 'alpha') - || GETPOST('force_utf8_on_tables', 'alpha') || GETPOST('force_utf8mb4_on_tables', 'alpha') + || GETPOST('force_utf8_on_tables', 'alpha') || GETPOST('force_utf8mb4_on_tables', 'alpha') || GETPOST('force_collation_from_conf_on_tables', 'alpha') || GETPOST('rebuild_sequences', 'alpha')); if ($ok && $oneoptionset) { @@ -1366,6 +1367,62 @@ if ($ok && GETPOST('force_utf8mb4_on_tables', 'alpha')) { } } +if ($ok && GETPOST('force_collation_from_conf_on_tables', 'alpha')) { + print '
*** Force page code and collation of tables into '.$conf->db->character_set.'/'.$conf->db->dolibarr_main_db_collation.' and row_format=dynamic (for mysql/mariadb only)'; + + if ($db->type == "mysql" || $db->type == "mysqli") { + $force_collation_from_conf_on_tables = GETPOST('force_collation_from_conf_on_tables', 'alpha'); + + $listoftables = $db->DDLListTablesFull($db->database_name); + + // Disable foreign key checking for avoid errors + if ($force_collation_from_conf_on_tables == 'confirmed') { + $sql = 'SET FOREIGN_KEY_CHECKS=0'; + print ''; + $resql = $db->query($sql); + } + + foreach ($listoftables as $table) { + // do not convert llx_const if mysql encrypt/decrypt is used + if ($conf->db->dolibarr_main_db_encryption != 0 && preg_match('/\_const$/', $table[0])) { + continue; + } + if ($table[1] == 'VIEW') { + print ''.$table[0].' is a '.$table[1].' (Skipped)'; + continue; + } + + print ''; + print $table[0]; + $sql1 = "ALTER TABLE ".$table[0]." ROW_FORMAT=dynamic"; + $sql2 = "ALTER TABLE ".$table[0]." CONVERT TO CHARACTER SET ".$conf->db->character_set." COLLATE ".$conf->db->dolibarr_main_db_collation; + print ''; + print ''; + if ($force_collation_from_conf_on_tables == 'confirmed') { + $resql1 = $db->query($sql1); + if ($resql1) { + $resql2 = $db->query($sql2); + } else { + $resql2 = false; + } + print ' - Done ('.(($resql1 && $resql2) ? 'OK' : 'KO').')'; + } else { + print ' - Disabled'; + } + print ''; + } + + // Enable foreign key checking + if ($force_collation_from_conf_on_tables == 'confirmed') { + $sql = 'SET FOREIGN_KEY_CHECKS=1'; + print ''; + $resql = $db->query($sql); + } + } else { + print 'Not available with database type '.$db->type.''; + } +} + // rebuild sequences for pgsql if ($ok && GETPOST('rebuild_sequences', 'alpha')) { print '
*** Force to rebuild sequences (for postgresql only)'; From 11986275ddfff602b98ef39bf3ae8a11854d681e Mon Sep 17 00:00:00 2001 From: Hystepik Date: Wed, 6 Sep 2023 12:27:36 +0200 Subject: [PATCH 0794/1137] Fix add bookcal extrafields --- ...bookcal_availabilities_extrafields.key.sql | 19 +++++++++++++++ ...llx_bookcal_availabilities_extrafields.sql | 23 +++++++++++++++++++ .../llx_bookcal_calendar_extrafields.key.sql | 19 +++++++++++++++ .../llx_bookcal_calendar_extrafields.sql | 23 +++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.key.sql create mode 100644 htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.sql create mode 100644 htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.key.sql create mode 100644 htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.sql diff --git a/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.key.sql b/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.key.sql new file mode 100644 index 00000000000..99538ef585c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.key.sql @@ -0,0 +1,19 @@ +-- Copyright (C) 2023 Alice Adminson +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_bookcal_availabilities_extrafields ADD INDEX idx_availabilities_fk_object(fk_object); +-- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.sql b/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.sql new file mode 100644 index 00000000000..d2d01e66d73 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.sql @@ -0,0 +1,23 @@ +-- Copyright (C) 2023 Alice Adminson +-- +-- 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 https://www.gnu.org/licenses/. + +create table llx_bookcal_availabilities_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + diff --git a/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.key.sql b/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.key.sql new file mode 100644 index 00000000000..668fdb5e863 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.key.sql @@ -0,0 +1,19 @@ +-- Copyright (C) 2023 Alice Adminson +-- +-- 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 https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_bookcal_calendar_extrafields ADD INDEX idx_calendar_fk_object(fk_object); +-- END MODULEBUILDER INDEXES diff --git a/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.sql b/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.sql new file mode 100644 index 00000000000..856fcdfdf2d --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.sql @@ -0,0 +1,23 @@ +-- Copyright (C) 2023 Alice Adminson +-- +-- 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 https://www.gnu.org/licenses/. + +create table llx_bookcal_calendar_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + From 9e789eaa0b142ecde794aa0c4d8e9fcabf9793d2 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Wed, 6 Sep 2023 12:46:13 +0200 Subject: [PATCH 0795/1137] fix extrafields --- .../mysql/tables/llx_bookcal_availabilities_extrafields.sql | 2 +- .../install/mysql/tables/llx_bookcal_calendar_extrafields.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.sql b/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.sql index d2d01e66d73..d7049e07453 100644 --- a/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_bookcal_availabilities_extrafields.sql @@ -16,7 +16,7 @@ create table llx_bookcal_availabilities_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, fk_object integer NOT NULL, import_key varchar(14) -- import key ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.sql b/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.sql index 856fcdfdf2d..37b5c3e60f0 100644 --- a/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_bookcal_calendar_extrafields.sql @@ -16,7 +16,7 @@ create table llx_bookcal_calendar_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, fk_object integer NOT NULL, import_key varchar(14) -- import key ) ENGINE=innodb; From 26dff90658131ec074e18022e949162a49423dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Sep 2023 13:58:08 +0200 Subject: [PATCH 0796/1137] deprecate set_as_client --- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/societe/class/societe.class.php | 18 ++++++++++++++++-- test/phpunit/SocieteTest.php | 2 +- 7 files changed, 22 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b76ba76fb8d..be4cff37295 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2702,7 +2702,7 @@ class Propal extends CommonObject // The connected company is classified as a client $soc=new Societe($this->db); $soc->id = $this->socid; - $result = $soc->set_as_client(); + $result = $soc->setAsCustomer(); if ($result < 0) { $this->error=$this->db->lasterror(); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 250d6c49aa0..6dedde25fc0 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -505,7 +505,7 @@ class Commande extends CommonOrder $soc->fetch($this->socid); // Class of company linked to order - $result = $soc->set_as_client(); + $result = $soc->setAsCustomer(); // Define new ref if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 0b20b4ddae8..b87ccdfe286 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3372,7 +3372,7 @@ class Facture extends CommonInvoice if (!$error) { // Define third party as a customer - $result = $this->thirdparty->set_as_client(); + $result = $this->thirdparty->setAsCustomer(); // If active we decrement the main product and its components at invoice validation if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index bf63fbf261d..1b3e60939e0 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -499,7 +499,7 @@ class Contrat extends CommonObject // A contract is validated so we can move thirdparty to status customer if (empty($conf->global->CONTRACT_DISABLE_AUTOSET_AS_CLIENT_ON_CONTRACT_VALIDATION)) { - $result = $this->thirdparty->set_as_client(); + $result = $this->thirdparty->setAsCustomer(); } // Define new ref diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 967b4e9a4fb..1171e0367b9 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -725,7 +725,7 @@ class Expedition extends CommonObject $soc->fetch($this->socid); // Class of company linked to order - $result = $soc->set_as_client(); + $result = $soc->setAsCustomer(); // Define new ref if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8f67f7567d1..19c6349e296 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2171,16 +2171,30 @@ class Societe extends CommonObject * Define third party as a customer * * @return int <0 if KO, >0 if OK + * @deprecated + * @see setAsCustomer() */ public function set_as_client() { // phpcs:enable + dol_syslog(get_class($this)."::set_as_client is deprecated use setAsCustomer instead", LOG_NOTICE); + return $this->setAsCustomer(); + } + + /** + * Define third party as a customer + * + * @return int <0 if KO, >0 if OK + * @since dolibarr v19 + */ + public function setAsCustomer() + { if ($this->id) { $newclient = 1; - if (($this->client == 2 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { + if (($this->client == 2 || $this->client == 3) && !getDolGlobalInt('SOCIETE_DISABLE_PROSPECTSCUSTOMERS')) { $newclient = 3; //If prospect, we keep prospect tag } - $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql .= " SET client = ".((int) $newclient); $sql .= " WHERE rowid = ".((int) $this->id); diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 9191a7e1d5c..96d2071ce7d 100644 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -337,7 +337,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $result=$localobject->set_as_client(); + $result=$localobject->setAsCustomer(); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); From d32f76b394e3cddb913756138929b39ba2f9f496 Mon Sep 17 00:00:00 2001 From: vmaury Date: Wed, 6 Sep 2023 14:54:40 +0200 Subject: [PATCH 0797/1137] Order by salary lastname in hollidays month report (instead of fk_user) --- htdocs/holiday/month_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index e73e83861c8..962ebc48a19 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -317,7 +317,7 @@ if (!empty($arrayfields['cp.fk_type']['checked'])) { print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', '', '', $sortfield, $sortorder); } if (!empty($arrayfields['cp.fk_user']['checked'])) { - print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'cp.fk_user', '', '', '', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'u.lastname', '', '', '', $sortfield, $sortorder); } if (!empty($arrayfields['ct.label']['checked'])) { print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder); From 9f53892fbe05bf111eb904255e84aa7040b59ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Sep 2023 16:57:50 +0200 Subject: [PATCH 0798/1137] fix loadlangs --- htdocs/core/boxes/box_last_knowledgerecord.php | 2 +- htdocs/core/boxes/box_last_modified_knowledgerecord.php | 2 +- htdocs/core/lib/asset.lib.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_last_knowledgerecord.php b/htdocs/core/boxes/box_last_knowledgerecord.php index 2cb4818d6ac..f1bbb3438bf 100644 --- a/htdocs/core/boxes/box_last_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_knowledgerecord.php @@ -78,7 +78,7 @@ class box_last_knowledgerecord extends ModeleBoxes public function __construct($db, $param = '') { global $langs; - $langs->load("boxes", "languages"); + $langs->loadLangs(array("boxes", "languages")); $this->db = $db; $this->boxlabel = $langs->transnoentitiesnoconv("BoxLastKnowledgerecord"); diff --git a/htdocs/core/boxes/box_last_modified_knowledgerecord.php b/htdocs/core/boxes/box_last_modified_knowledgerecord.php index 2c5319151fa..f15ed3d4d5c 100644 --- a/htdocs/core/boxes/box_last_modified_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_modified_knowledgerecord.php @@ -78,7 +78,7 @@ class box_last_modified_knowledgerecord extends ModeleBoxes public function __construct($db, $param = '') { global $langs; - $langs->load("boxes", "knowledgemanagement", "languages"); + $langs->loadLangs(array("boxes", "knowledgemanagement", "languages")); $this->db = $db; $this->boxlabel = $langs->transnoentitiesnoconv("BoxLastModifiedKnowledgerecord"); diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index be31f995657..bfa95ce9c0a 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -88,7 +88,7 @@ function assetPrepareHead(Asset $object) { global $db, $langs, $conf; - $langs->load("assets", "admin"); + $langs->loadLangs(array("assets", "admin")); $h = 0; $head = array(); @@ -184,7 +184,7 @@ function assetModelPrepareHead($object) { global $langs, $conf; - $langs->load("assets", "admin"); + $langs->loadLangs(array("assets", "admin")); $h = 0; $head = array(); From e6f249eaca143435ff5da2253f6245567c33ab76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 6 Sep 2023 17:00:19 +0200 Subject: [PATCH 0799/1137] fix loadlangs --- htdocs/asset/class/asset.class.php | 6 +++--- htdocs/asset/class/assetmodel.class.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index b3db4e087fb..05b1e4a2433 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -1433,7 +1433,7 @@ class Asset extends CommonObject // phpcs:enable if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("asset@asset"); + //$langs->load("assets"); $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('AssetInProgress'); $this->labelStatus[self::STATUS_DISPOSED] = $langs->transnoentitiesnoconv('AssetDisposed'); $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('AssetInProgress'); @@ -1516,7 +1516,7 @@ class Asset extends CommonObject public function getNextNumRef() { global $langs, $conf; - $langs->load("asset@asset"); + $langs->load("assets"); if (empty($conf->global->ASSET_ASSET_ADDON)) { $conf->global->ASSET_ASSET_ADDON = 'mod_asset_standard'; @@ -1581,7 +1581,7 @@ class Asset extends CommonObject // $result = 0; // $includedocgeneration = 1; // - // $langs->load("asset@asset"); + // $langs->load("assets"); // // if (!dol_strlen($modele)) { // $modele = 'standard_asset'; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index d31a68284fd..8f777144f6e 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -698,7 +698,7 @@ class AssetModel extends CommonObject // phpcs:enable if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("asset@asset"); + //$langs->load("assets"); $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); From 20162a6d1116eda7e3da371a3c24841e63c68c34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Sep 2023 17:11:30 +0200 Subject: [PATCH 0800/1137] Fix support of xlink:href links in website module. --- htdocs/core/lib/website.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 7f01c1f3902..ee77e7dd316 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -171,6 +171,7 @@ function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $c $content = str_replace('href="styles.css.php', 'href="!~!~!~styles.css.php', $content); $content = str_replace('src="javascript.js.php', 'src="!~!~!~javascript.js.php', $content); $content = str_replace('href="http', 'href="!~!~!~http', $content); + $content = str_replace('xlink:href="', 'xlink:href="!~!~!~', $content); $content = str_replace('href="//', 'href="!~!~!~//', $content); $content = str_replace('src="//', 'src="!~!~!~//', $content); $content = str_replace('src="viewimage.php', 'src="!~!~!~/viewimage.php', $content); @@ -311,6 +312,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '') $content = str_replace('href="styles.css.php', 'href="!~!~!~styles.css.php', $content); $content = str_replace('src="javascript.css.php', 'src="!~!~!~javascript.css.php', $content); $content = str_replace('href="http', 'href="!~!~!~http', $content); + $content = str_replace('xlink:href="', 'xlink:href="!~!~!~', $content); $content = str_replace('href="//', 'href="!~!~!~//', $content); $content = str_replace('src="//', 'src="!~!~!~//', $content); $content = str_replace(array('src="viewimage.php', 'src="/viewimage.php'), 'src="!~!~!~/viewimage.php', $content); From 94758009dd3afcfd2ffebf4bb2d4da4872b3b7b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Sep 2023 18:35:40 +0200 Subject: [PATCH 0801/1137] NEW Can see the favicon file into setup of properties of a website --- htdocs/viewimage.php | 5 ++++- htdocs/website/index.php | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index c531dbc09e0..e2adaa6700f 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -56,6 +56,8 @@ if (!defined('NOREQUIREAJAX')) { // Note that only directory logo is free to access without login. $needlogin = 1; if (isset($_GET["modulepart"])) { + // Some value of modulepart can be used to get resources that are public so no login are required. + // For logo of company if ($_GET["modulepart"] == 'mycompany' && preg_match('/^\/?logos\//', $_GET['file'])) { $needlogin = 0; @@ -64,10 +66,11 @@ if (isset($_GET["modulepart"])) { if ($_GET["modulepart"] == 'barcode') { $needlogin = 0; } - // Some value of modulepart can be used to get resources that are public so no login are required. + // Medias files if ($_GET["modulepart"] == 'medias') { $needlogin = 0; } + // User photo if ($_GET["modulepart"] == 'userphotopublic') { $needlogin = 0; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e0b4d4c6c84..997af5d8f2f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3731,6 +3731,13 @@ if ($action == 'editcss') { print ''; // MAX_FILE_SIZE must precede the field type=file } print ''; + + $uploadfolder = $conf->website->dir_output.'/'.$websitekey; + if (dol_is_file($uploadfolder.'/favicon.png')) { + print '
'; + print ''; + print '
'; + } print ''; // CSS file From 05b067283ab23cda2a7011261fb4010fd8fec3a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Sep 2023 03:27:39 +0200 Subject: [PATCH 0802/1137] Removed useless file --- htdocs/langs/en_US/link.lang | 11 ----------- htdocs/langs/en_US/main.lang | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 htdocs/langs/en_US/link.lang diff --git a/htdocs/langs/en_US/link.lang b/htdocs/langs/en_US/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/en_US/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d6f21c973a1..b20aee98e69 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1239,3 +1239,13 @@ DateOfPrinting=Date of printing ClickFullScreenEscapeToLeave=Click here to switch in Full screen mode. Press ESCAPE to leave Full screen mode. UserNotYetValid=Not yet valid UserExpired=Expired +LinkANewFile=Link a new file/document +LinkedFiles=Linked files and documents +NoLinkFound=No registered links +LinkComplete=The file has been linked successfully +ErrorFileNotLinked=The file could not be linked +LinkRemoved=The link %s has been removed +ErrorFailedToDeleteLink= Failed to remove link '%s' +ErrorFailedToUpdateLink= Failed to update link '%s' +URLToLink=URL to link +OverwriteIfExists=Overwrite if file exists From 0a853fe794e37e40be641e2ff0c6e8ebaa9d12f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Sep 2023 03:30:41 +0200 Subject: [PATCH 0803/1137] Removed files links.lang --- htdocs/core/actions_linkedfiles.inc.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/langs/am_ET/link.lang | 11 ----------- htdocs/langs/ar_DZ/link.lang | 11 ----------- htdocs/langs/ar_JO/link.lang | 11 ----------- htdocs/langs/ar_SA/link.lang | 11 ----------- htdocs/langs/ar_SY/link.lang | 11 ----------- htdocs/langs/az_AZ/link.lang | 11 ----------- htdocs/langs/bg_BG/link.lang | 11 ----------- htdocs/langs/bn_BD/link.lang | 11 ----------- htdocs/langs/bn_IN/link.lang | 11 ----------- htdocs/langs/bs_BA/link.lang | 11 ----------- htdocs/langs/ca_ES/link.lang | 11 ----------- htdocs/langs/cs_CZ/link.lang | 11 ----------- htdocs/langs/cy_GB/link.lang | 11 ----------- htdocs/langs/da_DK/link.lang | 11 ----------- htdocs/langs/de_CH/link.lang | 5 ----- htdocs/langs/de_DE/link.lang | 11 ----------- htdocs/langs/el_GR/link.lang | 11 ----------- htdocs/langs/es_AR/link.lang | 10 ---------- htdocs/langs/es_CL/link.lang | 10 ---------- htdocs/langs/es_CO/link.lang | 9 --------- htdocs/langs/es_CR/link.lang | 8 -------- htdocs/langs/es_CU/link.lang | 7 ------- htdocs/langs/es_EC/link.lang | 8 -------- htdocs/langs/es_ES/link.lang | 11 ----------- htdocs/langs/es_MX/link.lang | 10 ---------- htdocs/langs/et_EE/link.lang | 11 ----------- htdocs/langs/eu_ES/link.lang | 11 ----------- htdocs/langs/fa_IR/link.lang | 11 ----------- htdocs/langs/fi_FI/link.lang | 11 ----------- htdocs/langs/fr_CA/link.lang | 6 ------ htdocs/langs/fr_FR/link.lang | 11 ----------- htdocs/langs/gl_ES/link.lang | 11 ----------- htdocs/langs/he_IL/link.lang | 11 ----------- htdocs/langs/hi_IN/link.lang | 11 ----------- htdocs/langs/hr_HR/link.lang | 11 ----------- htdocs/langs/hu_HU/link.lang | 11 ----------- htdocs/langs/id_ID/link.lang | 11 ----------- htdocs/langs/is_IS/link.lang | 11 ----------- htdocs/langs/it_IT/link.lang | 11 ----------- htdocs/langs/ja_JP/link.lang | 11 ----------- htdocs/langs/ka_GE/link.lang | 11 ----------- htdocs/langs/kk_KZ/link.lang | 11 ----------- htdocs/langs/km_KH/link.lang | 11 ----------- htdocs/langs/kn_IN/link.lang | 11 ----------- htdocs/langs/ko_KR/link.lang | 11 ----------- htdocs/langs/lo_LA/link.lang | 11 ----------- htdocs/langs/lt_LT/link.lang | 11 ----------- htdocs/langs/lv_LV/link.lang | 11 ----------- htdocs/langs/mk_MK/link.lang | 11 ----------- htdocs/langs/mn_MN/link.lang | 11 ----------- htdocs/langs/ms_MY/link.lang | 11 ----------- htdocs/langs/my_MM/link.lang | 11 ----------- htdocs/langs/nb_NO/link.lang | 11 ----------- htdocs/langs/ne_NP/link.lang | 11 ----------- htdocs/langs/nl_NL/link.lang | 11 ----------- htdocs/langs/pl_PL/link.lang | 11 ----------- htdocs/langs/pt_BR/link.lang | 10 ---------- htdocs/langs/pt_MZ/link.lang | 10 ---------- htdocs/langs/pt_PT/link.lang | 11 ----------- htdocs/langs/ro_RO/link.lang | 11 ----------- htdocs/langs/ru_RU/link.lang | 11 ----------- htdocs/langs/sk_SK/link.lang | 11 ----------- htdocs/langs/sl_SI/link.lang | 11 ----------- htdocs/langs/sq_AL/link.lang | 11 ----------- htdocs/langs/sr_RS/link.lang | 11 ----------- htdocs/langs/sv_SE/link.lang | 11 ----------- htdocs/langs/sw_SW/link.lang | 11 ----------- htdocs/langs/ta_IN/link.lang | 11 ----------- htdocs/langs/tg_TJ/link.lang | 11 ----------- htdocs/langs/th_TH/link.lang | 11 ----------- htdocs/langs/tr_TR/link.lang | 11 ----------- htdocs/langs/uk_UA/link.lang | 11 ----------- htdocs/langs/ur_PK/link.lang | 11 ----------- htdocs/langs/uz_UZ/link.lang | 11 ----------- htdocs/langs/vi_VN/link.lang | 11 ----------- htdocs/langs/zh_CN/link.lang | 11 ----------- htdocs/langs/zh_HK/link.lang | 11 ----------- htdocs/langs/zh_TW/link.lang | 11 ----------- 80 files changed, 2 insertions(+), 832 deletions(-) delete mode 100644 htdocs/langs/am_ET/link.lang delete mode 100644 htdocs/langs/ar_DZ/link.lang delete mode 100644 htdocs/langs/ar_JO/link.lang delete mode 100644 htdocs/langs/ar_SA/link.lang delete mode 100644 htdocs/langs/ar_SY/link.lang delete mode 100644 htdocs/langs/az_AZ/link.lang delete mode 100644 htdocs/langs/bg_BG/link.lang delete mode 100644 htdocs/langs/bn_BD/link.lang delete mode 100644 htdocs/langs/bn_IN/link.lang delete mode 100644 htdocs/langs/bs_BA/link.lang delete mode 100644 htdocs/langs/ca_ES/link.lang delete mode 100644 htdocs/langs/cs_CZ/link.lang delete mode 100644 htdocs/langs/cy_GB/link.lang delete mode 100644 htdocs/langs/da_DK/link.lang delete mode 100644 htdocs/langs/de_CH/link.lang delete mode 100644 htdocs/langs/de_DE/link.lang delete mode 100644 htdocs/langs/el_GR/link.lang delete mode 100644 htdocs/langs/es_AR/link.lang delete mode 100644 htdocs/langs/es_CL/link.lang delete mode 100644 htdocs/langs/es_CO/link.lang delete mode 100644 htdocs/langs/es_CR/link.lang delete mode 100644 htdocs/langs/es_CU/link.lang delete mode 100644 htdocs/langs/es_EC/link.lang delete mode 100644 htdocs/langs/es_ES/link.lang delete mode 100644 htdocs/langs/es_MX/link.lang delete mode 100644 htdocs/langs/et_EE/link.lang delete mode 100644 htdocs/langs/eu_ES/link.lang delete mode 100644 htdocs/langs/fa_IR/link.lang delete mode 100644 htdocs/langs/fi_FI/link.lang delete mode 100644 htdocs/langs/fr_CA/link.lang delete mode 100644 htdocs/langs/fr_FR/link.lang delete mode 100644 htdocs/langs/gl_ES/link.lang delete mode 100644 htdocs/langs/he_IL/link.lang delete mode 100644 htdocs/langs/hi_IN/link.lang delete mode 100644 htdocs/langs/hr_HR/link.lang delete mode 100644 htdocs/langs/hu_HU/link.lang delete mode 100644 htdocs/langs/id_ID/link.lang delete mode 100644 htdocs/langs/is_IS/link.lang delete mode 100644 htdocs/langs/it_IT/link.lang delete mode 100644 htdocs/langs/ja_JP/link.lang delete mode 100644 htdocs/langs/ka_GE/link.lang delete mode 100644 htdocs/langs/kk_KZ/link.lang delete mode 100644 htdocs/langs/km_KH/link.lang delete mode 100644 htdocs/langs/kn_IN/link.lang delete mode 100644 htdocs/langs/ko_KR/link.lang delete mode 100644 htdocs/langs/lo_LA/link.lang delete mode 100644 htdocs/langs/lt_LT/link.lang delete mode 100644 htdocs/langs/lv_LV/link.lang delete mode 100644 htdocs/langs/mk_MK/link.lang delete mode 100644 htdocs/langs/mn_MN/link.lang delete mode 100644 htdocs/langs/ms_MY/link.lang delete mode 100644 htdocs/langs/my_MM/link.lang delete mode 100644 htdocs/langs/nb_NO/link.lang delete mode 100644 htdocs/langs/ne_NP/link.lang delete mode 100644 htdocs/langs/nl_NL/link.lang delete mode 100644 htdocs/langs/pl_PL/link.lang delete mode 100644 htdocs/langs/pt_BR/link.lang delete mode 100644 htdocs/langs/pt_MZ/link.lang delete mode 100644 htdocs/langs/pt_PT/link.lang delete mode 100644 htdocs/langs/ro_RO/link.lang delete mode 100644 htdocs/langs/ru_RU/link.lang delete mode 100644 htdocs/langs/sk_SK/link.lang delete mode 100644 htdocs/langs/sl_SI/link.lang delete mode 100644 htdocs/langs/sq_AL/link.lang delete mode 100644 htdocs/langs/sr_RS/link.lang delete mode 100644 htdocs/langs/sv_SE/link.lang delete mode 100644 htdocs/langs/sw_SW/link.lang delete mode 100644 htdocs/langs/ta_IN/link.lang delete mode 100644 htdocs/langs/tg_TJ/link.lang delete mode 100644 htdocs/langs/th_TH/link.lang delete mode 100644 htdocs/langs/tr_TR/link.lang delete mode 100644 htdocs/langs/uk_UA/link.lang delete mode 100644 htdocs/langs/ur_PK/link.lang delete mode 100644 htdocs/langs/uz_UZ/link.lang delete mode 100644 htdocs/langs/vi_VN/link.lang delete mode 100644 htdocs/langs/zh_CN/link.lang delete mode 100644 htdocs/langs/zh_HK/link.lang delete mode 100644 htdocs/langs/zh_TW/link.lang diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index b599480f583..de30b356b03 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -191,7 +191,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto } } elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && !empty($permissiontoadd)) { require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $langs->load('link'); + $link = new Link($db); $f = $link->fetch(GETPOST('linkid', 'int')); if ($f) { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 69ce183cc0d..44cbe0ec1e2 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1885,7 +1885,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess $linkObject->objectid = GETPOST('objectid', 'int'); $linkObject->label = GETPOST('label', 'alpha'); $res = $linkObject->create($user); - $langs->load('link'); + if ($res > 0) { setEventMessages($langs->trans("LinkComplete"), null, 'mesgs'); } else { diff --git a/htdocs/langs/am_ET/link.lang b/htdocs/langs/am_ET/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/am_ET/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ar_DZ/link.lang b/htdocs/langs/ar_DZ/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ar_DZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ar_JO/link.lang b/htdocs/langs/ar_JO/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ar_JO/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ar_SA/link.lang b/htdocs/langs/ar_SA/link.lang deleted file mode 100644 index 2e0aa65c6f3..00000000000 --- a/htdocs/langs/ar_SA/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=ربط ملف جديد/ وثيقة -LinkedFiles=الملفات والمستندات المرتبطة -NoLinkFound=لا يوجد روابط مسجلة -LinkComplete=تم ربط الملف بنجاح -ErrorFileNotLinked=لا يمكن ربط الملف -LinkRemoved= الرابط%sتم إزالتة -ErrorFailedToDeleteLink= فشل في إزالة الرابط ' %s ' -ErrorFailedToUpdateLink= فشل تحديث الرابط ' %s ' -URLToLink=عنوان URL للربط -OverwriteIfExists=إستبدال محتوى الملف إذا كان موجوداً diff --git a/htdocs/langs/ar_SY/link.lang b/htdocs/langs/ar_SY/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ar_SY/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/az_AZ/link.lang b/htdocs/langs/az_AZ/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/az_AZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/bg_BG/link.lang b/htdocs/langs/bg_BG/link.lang deleted file mode 100644 index c513bbfbbbe..00000000000 --- a/htdocs/langs/bg_BG/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Свързване на нов файл / документ -LinkedFiles=Свързани файлове и документи -NoLinkFound=Няма регистрирани връзки -LinkComplete=Файлът е успешно свързан -ErrorFileNotLinked=Файлът не може да бъде свързан -LinkRemoved=Връзката %s е премахната -ErrorFailedToDeleteLink= Премахването на връзката '%s' не е успешно -ErrorFailedToUpdateLink= Актуализацията на връзката '%s' не е успешна -URLToLink=URL адрес -OverwriteIfExists=Презаписване на файл, ако съществува diff --git a/htdocs/langs/bn_BD/link.lang b/htdocs/langs/bn_BD/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/bn_BD/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/bn_IN/link.lang b/htdocs/langs/bn_IN/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/bn_IN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/bs_BA/link.lang b/htdocs/langs/bs_BA/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/bs_BA/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ca_ES/link.lang b/htdocs/langs/ca_ES/link.lang deleted file mode 100644 index 60bb39b3786..00000000000 --- a/htdocs/langs/ca_ES/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Enllaça un nou arxiu/document -LinkedFiles=Arxius i documents enllaçats -NoLinkFound=No hi ha enllaços registrats -LinkComplete=L'arxiu s'ha enllaçat correctament -ErrorFileNotLinked=L'arxiu no s'ha enllaçat -LinkRemoved=L'enllaç %s s'ha eliminat -ErrorFailedToDeleteLink= Error en eliminar l'enllaç '%s' -ErrorFailedToUpdateLink= Error en actualitzar l'enllaç '%s' -URLToLink=URL a enllaçar -OverwriteIfExists=Sobreescriu el fitxer si existeix diff --git a/htdocs/langs/cs_CZ/link.lang b/htdocs/langs/cs_CZ/link.lang deleted file mode 100644 index 310b3935630..00000000000 --- a/htdocs/langs/cs_CZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Připojit nový soubor/dokument -LinkedFiles=Připojené soubory a dokumenty -NoLinkFound=Žádné odkazy -LinkComplete=Soubor byl úspěšně připojen -ErrorFileNotLinked=Soubor nemohl být připojen -LinkRemoved=Odkaz %s byl odstraněn -ErrorFailedToDeleteLink= Nepodařilo se odstranit odkaz '%s' -ErrorFailedToUpdateLink= Nepodařilo se aktualizovat odkaz '%s' -URLToLink=Připojit URL -OverwriteIfExists=Pokud existuje, přepište soubor diff --git a/htdocs/langs/cy_GB/link.lang b/htdocs/langs/cy_GB/link.lang deleted file mode 100644 index 2cdbc0e3d5b..00000000000 --- a/htdocs/langs/cy_GB/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Cysylltwch ffeil/dogfen newydd -LinkedFiles=Ffeiliau a dogfennau cysylltiedig -NoLinkFound=Dim dolenni cofrestredig -LinkComplete=Mae'r ffeil wedi'i chysylltu'n llwyddiannus -ErrorFileNotLinked=Nid oedd modd cysylltu'r ffeil -LinkRemoved=Mae'r cyswllt %s wedi'i ddileu -ErrorFailedToDeleteLink= Wedi methu tynnu dolen ' %s ' -ErrorFailedToUpdateLink= Wedi methu diweddaru'r ddolen ' %s ' -URLToLink=URL i'r ddolen -OverwriteIfExists=Trosysgrifo ffeil os yw'n bodoli diff --git a/htdocs/langs/da_DK/link.lang b/htdocs/langs/da_DK/link.lang deleted file mode 100644 index 8f538298baf..00000000000 --- a/htdocs/langs/da_DK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link en ny fil / et dokument -LinkedFiles=Sammenkædede filer og dokumenter -NoLinkFound=Ingen registrerede links -LinkComplete=Filen er blevet linket korrekt -ErrorFileNotLinked=Filen kunne ikke forbindes -LinkRemoved=Linket %s er blevet fjernet -ErrorFailedToDeleteLink= Kunne ikke fjerne linket ' %s ' -ErrorFailedToUpdateLink= Kunne ikke opdatere linket ' %s ' -URLToLink=URL til link -OverwriteIfExists=Overskriv fil, hvis den findes diff --git a/htdocs/langs/de_CH/link.lang b/htdocs/langs/de_CH/link.lang deleted file mode 100644 index db7e1395400..00000000000 --- a/htdocs/langs/de_CH/link.lang +++ /dev/null @@ -1,5 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Verknüpfe eine neue Datei /Dokument -LinkComplete=Die Datei wurde erfolgreich verlinkt -ErrorFileNotLinked=Die Datei konnte nicht verlinkt werden -URLToLink=URL zum Verlinken diff --git a/htdocs/langs/de_DE/link.lang b/htdocs/langs/de_DE/link.lang deleted file mode 100644 index e66eb1bdf6f..00000000000 --- a/htdocs/langs/de_DE/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Neue Verknüpfung erstellen -LinkedFiles=Verknüpfte Dateien -NoLinkFound=Keine verknüpften Links -LinkComplete=Die Datei wurde erfolgreich verlinkt. -ErrorFileNotLinked=Die Datei konnte nicht verlinkt werden. -LinkRemoved=Der Link %s wurde entfernt -ErrorFailedToDeleteLink= Fehler beim entfernen des Links '%s' -ErrorFailedToUpdateLink= Fehler beim aktualisieren des Link '%s' -URLToLink=zu verlinkende URL -OverwriteIfExists=Datei überschreiben, falls vorhanden diff --git a/htdocs/langs/el_GR/link.lang b/htdocs/langs/el_GR/link.lang deleted file mode 100644 index 1057e624b10..00000000000 --- a/htdocs/langs/el_GR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Συνδέστε ένα νέο αρχείο / έγγραφο -LinkedFiles=Συνδεδεμένα αρχεία και έγγραφα -NoLinkFound=Δεν υπάρχουν εγγεγραμμένοι σύνδεσμοι -LinkComplete=Το αρχείο έχει συνδεθεί με επιτυχία -ErrorFileNotLinked=Το αρχείο δεν μπορεί να συνδεθεί -LinkRemoved=Ο σύνδεσμος %s έχει αφαιρεθεί -ErrorFailedToDeleteLink= Απέτυχε η αφαίρεση του συνδέσμου '%s' -ErrorFailedToUpdateLink= Απέτυχε η ενημέρωση του σύνδεσμο '%s' -URLToLink=Διεύθυνση URL για σύνδεση -OverwriteIfExists=Επανεγγραφή αρχείου εάν υπάρχει diff --git a/htdocs/langs/es_AR/link.lang b/htdocs/langs/es_AR/link.lang deleted file mode 100644 index 3dbd72adba5..00000000000 --- a/htdocs/langs/es_AR/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Enlazar a un nuevo archivo/documento -LinkedFiles=Archivos y documentos enlazados -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha enlazado correctamente -ErrorFileNotLinked=El archivo no pudo ser enlazado -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace '%s' -ErrorFailedToUpdateLink=Error al actualizar enlace '%s' -URLToLink=URL del enlace diff --git a/htdocs/langs/es_CL/link.lang b/htdocs/langs/es_CL/link.lang deleted file mode 100644 index b3f562fac79..00000000000 --- a/htdocs/langs/es_CL/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Enlace un nuevo archivo / documento -LinkedFiles=Links archivos y documentos -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo ha sido vinculado exitosamente -ErrorFileNotLinked=El archivo no pudo ser vinculado -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace '%s' -ErrorFailedToUpdateLink=Error al actualizar el enlace '%s' -URLToLink=URL para enlazar diff --git a/htdocs/langs/es_CO/link.lang b/htdocs/langs/es_CO/link.lang deleted file mode 100644 index 3f1aa9375e2..00000000000 --- a/htdocs/langs/es_CO/link.lang +++ /dev/null @@ -1,9 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Vincular un nuevo archivo / documento -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha vinculado correctamente -ErrorFileNotLinked=El archivo no se pudo vincular -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace ' %s ' -ErrorFailedToUpdateLink=Error al actualizar el enlace ' %s ' -URLToLink=URL para vincular diff --git a/htdocs/langs/es_CR/link.lang b/htdocs/langs/es_CR/link.lang deleted file mode 100644 index 1c76a193ca7..00000000000 --- a/htdocs/langs/es_CR/link.lang +++ /dev/null @@ -1,8 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha vinculado con éxito. -ErrorFileNotLinked=No se pudo vincular el archivo -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace ' %s ' -ErrorFailedToUpdateLink=Error al actualizar el enlace ' %s ' -URLToLink=URL para vincular diff --git a/htdocs/langs/es_CU/link.lang b/htdocs/langs/es_CU/link.lang deleted file mode 100644 index 7740f83bf62..00000000000 --- a/htdocs/langs/es_CU/link.lang +++ /dev/null @@ -1,7 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkComplete=El archivo se ha vinculado con éxito. -ErrorFileNotLinked=No se pudo vincular el archivo -LinkRemoved=El enlace %s ha sido eliminado -ErrorFailedToDeleteLink=Error al eliminar el enlace ' %s ' -ErrorFailedToUpdateLink=Error al actualizar el enlace ' %s ' -URLToLink=URL para vincular diff --git a/htdocs/langs/es_EC/link.lang b/htdocs/langs/es_EC/link.lang deleted file mode 100644 index 0ad5de1e897..00000000000 --- a/htdocs/langs/es_EC/link.lang +++ /dev/null @@ -1,8 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkedFiles=Archivos enlazados y documentos -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha vinculado correctamente -ErrorFileNotLinked=No se pudo vincular el archivo. -LinkRemoved=Se ha eliminado el enlace %s -ErrorFailedToDeleteLink=No se pudo eliminar el vínculo '%s' -URLToLink=URL para vincular diff --git a/htdocs/langs/es_ES/link.lang b/htdocs/langs/es_ES/link.lang deleted file mode 100644 index feb76151fde..00000000000 --- a/htdocs/langs/es_ES/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Vincular un nuevo archivo/documento -LinkedFiles=Archivos y documentos vinculados -NoLinkFound=Sin enlaces registrados -LinkComplete=El archivo ha sido vinculado correctamente -ErrorFileNotLinked=El archivo no ha podido ser vinculado -LinkRemoved=El vínculo %s ha sido eliminado -ErrorFailedToDeleteLink= Error al eliminar el vínculo '%s' -ErrorFailedToUpdateLink= Error al actualizar el vínculo '%s' -URLToLink=URL a enlazar -OverwriteIfExists=Sobrescribir archivo si existe diff --git a/htdocs/langs/es_MX/link.lang b/htdocs/langs/es_MX/link.lang deleted file mode 100644 index b97dcbc1a69..00000000000 --- a/htdocs/langs/es_MX/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Vincular un nuevo archivo / documento -LinkedFiles=Archivos enlazados y documentos -NoLinkFound=No hay enlaces registrados -LinkComplete=El archivo se ha vinculado correctamente -ErrorFileNotLinked=No se pudo vincular el archivo. -LinkRemoved=Se ha eliminado el enlace %s -ErrorFailedToDeleteLink=No se pudo eliminar el vínculo ' %s ' -ErrorFailedToUpdateLink=Error al actualizar el vínculo ' %s ' -URLToLink=URL para vincular diff --git a/htdocs/langs/et_EE/link.lang b/htdocs/langs/et_EE/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/et_EE/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/eu_ES/link.lang b/htdocs/langs/eu_ES/link.lang deleted file mode 100644 index d3a0fc9370e..00000000000 --- a/htdocs/langs/eu_ES/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Fitxategi/dokumentu berria estekatu -LinkedFiles=Estekatutako fitxategi eta dokumentuak -NoLinkFound=Ez dago gordetako estekarik -LinkComplete=Fitxategia ondo estekatu da -ErrorFileNotLinked=Ezin izan da fitxategia estekatu -LinkRemoved=%s esteka ezabatua izan da -ErrorFailedToDeleteLink= Ezin izan da '%s' esteka ezabatu -ErrorFailedToUpdateLink= Ezin izan da '%s' esteka berritu -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/fa_IR/link.lang b/htdocs/langs/fa_IR/link.lang deleted file mode 100644 index 012040c2baa..00000000000 --- a/htdocs/langs/fa_IR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=پیوند یک فایل/سند -LinkedFiles=اسناد و فایل‌های مرتبط -NoLinkFound=پیوند ثبت‌شده‌ای وجود ندارد -LinkComplete=فایل با موفقیت پیوند شد -ErrorFileNotLinked=امکان پیوند فایل وجود ندارد -LinkRemoved=پیوند %s برداشته شد -ErrorFailedToDeleteLink= امکان حذف پیوند '%s' نبود -ErrorFailedToUpdateLink= امکان روزآمدسازی پیوند '%s' نبود -URLToLink=نشانی برای پیوند کردن -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/fi_FI/link.lang b/htdocs/langs/fi_FI/link.lang deleted file mode 100644 index 62802ede960..00000000000 --- a/htdocs/langs/fi_FI/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Luo uusi linkki tiedostoon/dokumenttiin -LinkedFiles=Linkitetyt tiedostot ja dokumentit -NoLinkFound=Rekisteröityjä linkkejä ei ole -LinkComplete=Tiedosto on linkitetty onnistuneesti -ErrorFileNotLinked=Tiedostoa ei voitu linkittää -LinkRemoved=%s linkki on poistettu -ErrorFailedToDeleteLink= Linkin '%s' poisto ei onnistunut -ErrorFailedToUpdateLink= Linkin '%s' päivitys ei onnistunut -URLToLink=URL linkiksi -OverwriteIfExists=Korvaa tiedosto jos olemassa diff --git a/htdocs/langs/fr_CA/link.lang b/htdocs/langs/fr_CA/link.lang deleted file mode 100644 index 8acd890c9a0..00000000000 --- a/htdocs/langs/fr_CA/link.lang +++ /dev/null @@ -1,6 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Relier un nouveau fichier / document -NoLinkFound=Pas de liens enregistrés -LinkComplete=Le fichier a été lié avec succès -ErrorFailedToDeleteLink=Impossible d'enlever le lien '%s' -ErrorFailedToUpdateLink=Impossible de mettre à jour le lien '%s' diff --git a/htdocs/langs/fr_FR/link.lang b/htdocs/langs/fr_FR/link.lang deleted file mode 100644 index 4534b8420e7..00000000000 --- a/htdocs/langs/fr_FR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Lier un nouveau fichier/document -LinkedFiles=Fichiers et documents liés -NoLinkFound=Aucun lien associé -LinkComplete=Le fichier a été correctement lié -ErrorFileNotLinked=Le fichier n'a pas pu être lié -LinkRemoved=Le lien %s a été supprimé -ErrorFailedToDeleteLink= Impossible de supprimer le lien '%s' -ErrorFailedToUpdateLink= Impossible de modifier le lien '%s' -URLToLink=URL à lier -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/gl_ES/link.lang b/htdocs/langs/gl_ES/link.lang deleted file mode 100644 index 4815cf15e64..00000000000 --- a/htdocs/langs/gl_ES/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Ligar un novo ficheiro/documento -LinkedFiles=Ficheiros e documentos ligados -NoLinkFound=Sen ligazóns registrados -LinkComplete=O ficheiro foi ligado correctamente -ErrorFileNotLinked=O ficheiro non puido ser ligado -LinkRemoved=A ligazón %s foi eliminada -ErrorFailedToDeleteLink= Erro ao eliminar a ligazón '%s' -ErrorFailedToUpdateLink= Erro ao actualizar a ligazón '%s' -URLToLink=URL a ligar -OverwriteIfExists=Sobrescribir ficheiro se existe diff --git a/htdocs/langs/he_IL/link.lang b/htdocs/langs/he_IL/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/he_IL/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/hi_IN/link.lang b/htdocs/langs/hi_IN/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/hi_IN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/hr_HR/link.lang b/htdocs/langs/hr_HR/link.lang deleted file mode 100644 index ee140b37440..00000000000 --- a/htdocs/langs/hr_HR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Poveži novu datoteku/dokument -LinkedFiles=Povezane datoteke i dokumenti -NoLinkFound=Nema registriranih veza -LinkComplete=Datoteka je uspješno povezana -ErrorFileNotLinked=Datoteku je nemoguće povezati -LinkRemoved=Veza %s je obrisana -ErrorFailedToDeleteLink= Neuspješno brisanje veze '%s' -ErrorFailedToUpdateLink= Neuspješna promjena veze '%s' -URLToLink=URL prema vezi -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/hu_HU/link.lang b/htdocs/langs/hu_HU/link.lang deleted file mode 100644 index 05653373fbd..00000000000 --- a/htdocs/langs/hu_HU/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Új fájl/dokumentum hivatkozása -LinkedFiles=Hivatkozott fájlok és dokumentumok -NoLinkFound=Nincs mentett hivatkozás -LinkComplete=A fájlra történt hivatkozás sikerült -ErrorFileNotLinked=A fájlra nem lehet hivatkozni -LinkRemoved=A %s hivatkozás törölve -ErrorFailedToDeleteLink= A '%s' hivakozás törlése sikertelen -ErrorFailedToUpdateLink= A '%s' hivakozás frissítése sikertelen -URLToLink=A hivatkozás címe -OverwriteIfExists=Fájl felülírása, ha létezik diff --git a/htdocs/langs/id_ID/link.lang b/htdocs/langs/id_ID/link.lang deleted file mode 100644 index 4b6d73e7c52..00000000000 --- a/htdocs/langs/id_ID/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Tautan untuk berkas/dokumen baru -LinkedFiles=Tautan berkas dan dokumen -NoLinkFound=Link tidak terdaftar -LinkComplete=Berkas telah berhasil ditautkan -ErrorFileNotLinked=Berkas tidak dapat ditautkan -LinkRemoved=Tautan %s telah dihapus -ErrorFailedToDeleteLink= gagal untuk menghapus tautan '%s' -ErrorFailedToUpdateLink= Gagal untuk memperbaharui tautan '%s' -URLToLink=URL untuk ditautkan -OverwriteIfExists=Timpa file jika ada diff --git a/htdocs/langs/is_IS/link.lang b/htdocs/langs/is_IS/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/is_IS/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/it_IT/link.lang b/htdocs/langs/it_IT/link.lang deleted file mode 100644 index 551802192d1..00000000000 --- a/htdocs/langs/it_IT/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Collega un nuovo file/documento -LinkedFiles=File e documenti collegati -NoLinkFound=Nessun collegamento registrato -LinkComplete=Il file è stato correttamente collegato -ErrorFileNotLinked=Il file non può essere collegato -LinkRemoved=Il collegamento %s è stato rimosso -ErrorFailedToDeleteLink= Impossibile rimuovere il collegamento '%s' -ErrorFailedToUpdateLink= Impossibile caricare il collegamento '%s' -URLToLink=Indirizzo del link -OverwriteIfExists=Sovrascrivi file se esiste diff --git a/htdocs/langs/ja_JP/link.lang b/htdocs/langs/ja_JP/link.lang deleted file mode 100644 index 71b9e42f923..00000000000 --- a/htdocs/langs/ja_JP/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=新規ファイル/ドキュメントをリンクする -LinkedFiles=ファイルとドキュメントをリンクした -NoLinkFound=リンクは登録されていない -LinkComplete=ファイルを正常にリンクした -ErrorFileNotLinked=ファイルをリンクできなかった -LinkRemoved=リンク %s が削除された -ErrorFailedToDeleteLink= リンク '%s' を削除できなかった -ErrorFailedToUpdateLink= リンク '%s' を更新できなかった -URLToLink=リンクの URL -OverwriteIfExists=存在する場合はファイルを上書きする diff --git a/htdocs/langs/ka_GE/link.lang b/htdocs/langs/ka_GE/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ka_GE/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/kk_KZ/link.lang b/htdocs/langs/kk_KZ/link.lang deleted file mode 100644 index 5ef5de861ec..00000000000 --- a/htdocs/langs/kk_KZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Жаңа файлды/құжатты байланыстырыңыз -LinkedFiles=Байланысты файлдар мен құжаттар -NoLinkFound=Тіркелген сілтемелер жоқ -LinkComplete=Файл сәтті байланыстырылды -ErrorFileNotLinked=Файлды байланыстыру мүмкін болмады -LinkRemoved=%s сілтемесі жойылды -ErrorFailedToDeleteLink= ' %s ' сілтемесі жойылмады -ErrorFailedToUpdateLink= ' %s ' сілтемесі жаңартылмады -URLToLink=Сілтеме үшін URL -OverwriteIfExists=Егер бар болса, файлды қайта жазыңыз diff --git a/htdocs/langs/km_KH/link.lang b/htdocs/langs/km_KH/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/km_KH/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/kn_IN/link.lang b/htdocs/langs/kn_IN/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/kn_IN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ko_KR/link.lang b/htdocs/langs/ko_KR/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ko_KR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/lo_LA/link.lang b/htdocs/langs/lo_LA/link.lang deleted file mode 100644 index 80f013d66bd..00000000000 --- a/htdocs/langs/lo_LA/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=ເຊື່ອມໂຍງໄຟລ//ເອກະສານໃ່ -LinkedFiles=ໄຟລ Linked ແລະເອກະສານທີ່ເຊື່ອມໂຍງ -NoLinkFound=ບໍ່ມີລິ້ງເຊື່ອມຕໍ່ທີ່ລົງທະບຽນ -LinkComplete=ໄຟລ has ໄດ້ຖືກເຊື່ອມຕໍ່ ສຳ ເລັດແລ້ວ -ErrorFileNotLinked=ບໍ່ສາມາດເຊື່ອມໂຍງໄຟລໄດ້ -LinkRemoved=ລິ້ງ %s ໄດ້ຖືກລຶບອອກແລ້ວ -ErrorFailedToDeleteLink= ລຶບລິ້ງ ' %s ບໍ່ ສຳ ເລັດ' -ErrorFailedToUpdateLink= ອັບເດດລິ້ງ ' %s ບໍ່ ສຳ ເລັດ' -URLToLink=URL ເພື່ອເຊື່ອມຕໍ່ -OverwriteIfExists=ຂຽນທັບໄຟລ if ຖ້າມີ diff --git a/htdocs/langs/lt_LT/link.lang b/htdocs/langs/lt_LT/link.lang deleted file mode 100644 index c9e19c70173..00000000000 --- a/htdocs/langs/lt_LT/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Susieti naują filą / dokumentą -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Nesėkmingas sąsajos '%s' atnaujinimas -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/lv_LV/link.lang b/htdocs/langs/lv_LV/link.lang deleted file mode 100644 index e649eb2874b..00000000000 --- a/htdocs/langs/lv_LV/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Salinkot jaunu failu/dokumentu -LinkedFiles=Salinkotie faili un dokumenti -NoLinkFound=Nav reģistrētas saites -LinkComplete=Fails veiksmīgi salinkots -ErrorFileNotLinked=Failu nevar salinkot -LinkRemoved=Saite %s tika dzēsta -ErrorFailedToDeleteLink= Kļūda dzēšot saiti '%s' -ErrorFailedToUpdateLink= Kļūda atjaunojot saiti '%s' -URLToLink=Saites uz URL -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/mk_MK/link.lang b/htdocs/langs/mk_MK/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/mk_MK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/mn_MN/link.lang b/htdocs/langs/mn_MN/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/mn_MN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ms_MY/link.lang b/htdocs/langs/ms_MY/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ms_MY/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/my_MM/link.lang b/htdocs/langs/my_MM/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/my_MM/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/nb_NO/link.lang b/htdocs/langs/nb_NO/link.lang deleted file mode 100644 index d8f4d669605..00000000000 --- a/htdocs/langs/nb_NO/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Koble en ny fil/dokument -LinkedFiles=Koblede filer og dokumenter -NoLinkFound=Ingen registrerte koblinger -LinkComplete=Filkoblingen ble opprettet -ErrorFileNotLinked=Filen kunne ikke kobles -LinkRemoved=Koblingen til %s ble fjernet -ErrorFailedToDeleteLink= Klarte ikke å fjerne kobling'%s' -ErrorFailedToUpdateLink= Klarte ikke å oppdatere koblingen til '%s' -URLToLink=URL til link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ne_NP/link.lang b/htdocs/langs/ne_NP/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/ne_NP/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/nl_NL/link.lang b/htdocs/langs/nl_NL/link.lang deleted file mode 100644 index 3b82167aab4..00000000000 --- a/htdocs/langs/nl_NL/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Koppel een nieuw bestand/document -LinkedFiles=Gekoppelde bestanden en documenten -NoLinkFound=Geen geregistreerde koppelingen -LinkComplete=Het bestand is succesvol gekoppeld -ErrorFileNotLinked=Het bestand kon niet gekoppeld worden -LinkRemoved=De koppeling %s is verwijderd -ErrorFailedToDeleteLink= Kon de verbinding '%s' niet verwijderen -ErrorFailedToUpdateLink= Kon verbinding '%s' niet bijwerken -URLToLink=URL naar link -OverwriteIfExists=Overschrijf bestand indien aanwezig diff --git a/htdocs/langs/pl_PL/link.lang b/htdocs/langs/pl_PL/link.lang deleted file mode 100644 index f067994f757..00000000000 --- a/htdocs/langs/pl_PL/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Podepnij nowy plik/dokument -LinkedFiles=Podpięte pliki i dokumenty -NoLinkFound=Brak zarejestrowanych linków -LinkComplete=Plik został podlinkowany poprawnie -ErrorFileNotLinked=Plik nie mógł zostać podlinkowany -LinkRemoved=Link %s został usunięty -ErrorFailedToDeleteLink= Niemożna usunąc linku '%s' -ErrorFailedToUpdateLink= Niemożna uaktualnić linku '%s' -URLToLink=Adres URL linka -OverwriteIfExists=Zastąp plik, jeśli istnieje diff --git a/htdocs/langs/pt_BR/link.lang b/htdocs/langs/pt_BR/link.lang deleted file mode 100644 index f86a13d83c3..00000000000 --- a/htdocs/langs/pt_BR/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Vincular um novo arquivo/documento -LinkedFiles=Arquivos vinculados e documentos -NoLinkFound=Não há links registrados -LinkComplete=O arquivo foi associada com sucesso -ErrorFileNotLinked=O arquivo não pôde ser vinculado -LinkRemoved=A ligação %s foi removida -ErrorFailedToDeleteLink=Falha ao remover link '%s' -ErrorFailedToUpdateLink=Falha ao atualizar link '%s' -URLToLink=URL para link diff --git a/htdocs/langs/pt_MZ/link.lang b/htdocs/langs/pt_MZ/link.lang deleted file mode 100644 index f86a13d83c3..00000000000 --- a/htdocs/langs/pt_MZ/link.lang +++ /dev/null @@ -1,10 +0,0 @@ -# Dolibarr language file - Source file is en_US - link -LinkANewFile=Vincular um novo arquivo/documento -LinkedFiles=Arquivos vinculados e documentos -NoLinkFound=Não há links registrados -LinkComplete=O arquivo foi associada com sucesso -ErrorFileNotLinked=O arquivo não pôde ser vinculado -LinkRemoved=A ligação %s foi removida -ErrorFailedToDeleteLink=Falha ao remover link '%s' -ErrorFailedToUpdateLink=Falha ao atualizar link '%s' -URLToLink=URL para link diff --git a/htdocs/langs/pt_PT/link.lang b/htdocs/langs/pt_PT/link.lang deleted file mode 100644 index 49a5aaaef43..00000000000 --- a/htdocs/langs/pt_PT/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Associar um novo ficheiro/documento -LinkedFiles=Ficheiros e documentos associados -NoLinkFound=Nenhumas ligações registadas -LinkComplete=Os ficheiros foram ligados com sucesso -ErrorFileNotLinked=Os ficheiros não puderam ser ligados -LinkRemoved=A hiperligação %s foi removida -ErrorFailedToDeleteLink= falhou a remoção da ligação '%s' -ErrorFailedToUpdateLink= Falha na atualização de ligação '%s' -URLToLink=URL para hiperligação -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/ro_RO/link.lang b/htdocs/langs/ro_RO/link.lang deleted file mode 100644 index 12147377aea..00000000000 --- a/htdocs/langs/ro_RO/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link fişier/document nou -LinkedFiles=Fişiere şi documente ataşate -NoLinkFound=Niciun link inregistrat -LinkComplete=Fişierul a fost ataşat cu succes -ErrorFileNotLinked=Fişierul nu a putut fi ataşat -LinkRemoved=Linkul %s a fost înlăturat -ErrorFailedToDeleteLink= Eşec la înlăturarea linkului '%s' -ErrorFailedToUpdateLink= Eşec la modificarea linkului '%s' -URLToLink=URL la link -OverwriteIfExists=Suprascrie dacă fişierul există diff --git a/htdocs/langs/ru_RU/link.lang b/htdocs/langs/ru_RU/link.lang deleted file mode 100644 index edfddc8994b..00000000000 --- a/htdocs/langs/ru_RU/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Создать ссылку на файл или документ -LinkedFiles=Ссылки на файлы и документы -NoLinkFound=Нет зарегистрированных ссылок -LinkComplete=Создана ссылка на файл -ErrorFileNotLinked=Не возможно создать ссылку на файл -LinkRemoved=Ссылка на файл %s удалена -ErrorFailedToDeleteLink= При удалении ссылки на файл '%s' возникла ошибка -ErrorFailedToUpdateLink= При обновлении ссылки на файл '%s' возникла ошибка -URLToLink=URL для ссылки -OverwriteIfExists=Перезаписать файл, если он существует diff --git a/htdocs/langs/sk_SK/link.lang b/htdocs/langs/sk_SK/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/sk_SK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/sl_SI/link.lang b/htdocs/langs/sl_SI/link.lang deleted file mode 100644 index 8ec7ff7d758..00000000000 --- a/htdocs/langs/sl_SI/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Poveži novo datoteko/dokument -LinkedFiles=Povezane datoteke in dokumenti -NoLinkFound=Ni registriranih povezav -LinkComplete=Datoteka je bila uspešno povezana -ErrorFileNotLinked=Datoteke ni možno povezati -LinkRemoved=Povezava %s je bila odstranjena -ErrorFailedToDeleteLink= Napaka pri odstranitvi povezave '%s'. -ErrorFailedToUpdateLink= Napaka pri posodobitvi povezave '%s'. -URLToLink=URL za povezavo -OverwriteIfExists=Prepiši datoteko, če obstaja diff --git a/htdocs/langs/sq_AL/link.lang b/htdocs/langs/sq_AL/link.lang deleted file mode 100644 index 1ffcd41a18b..00000000000 --- a/htdocs/langs/sq_AL/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link a new file/document -LinkedFiles=Linked files and documents -NoLinkFound=No registered links -LinkComplete=The file has been linked successfully -ErrorFileNotLinked=The file could not be linked -LinkRemoved=The link %s has been removed -ErrorFailedToDeleteLink= Failed to remove link '%s' -ErrorFailedToUpdateLink= Failed to update link '%s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/sr_RS/link.lang b/htdocs/langs/sr_RS/link.lang deleted file mode 100644 index 36e3aaf6aea..00000000000 --- a/htdocs/langs/sr_RS/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Link ka novom fajlu/dokumentu -LinkedFiles=Linkovani fajlovi i dokumenti -NoLinkFound=Nema registrovanih linkova -LinkComplete=Fajl je uspešno linkovan -ErrorFileNotLinked=Fajl nije mogao biti linkovan -LinkRemoved=Link %s je uklonjen -ErrorFailedToDeleteLink= Greška prilikom uklanjanja linka '%s' -ErrorFailedToUpdateLink= Greška prilikom ažuriranja linka '%s' -URLToLink=URL za link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/sv_SE/link.lang b/htdocs/langs/sv_SE/link.lang deleted file mode 100644 index da38186f5b8..00000000000 --- a/htdocs/langs/sv_SE/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Länka en ny fil/dokument -LinkedFiles=Länkade filer och dokument -NoLinkFound=Inga registrerade länkar -LinkComplete=Filen har länkats -ErrorFileNotLinked=Filen kunde inte länkas -LinkRemoved=Länken %s har tagits bort -ErrorFailedToDeleteLink= Det gick inte att ta bort länk %s -ErrorFailedToUpdateLink= Det gick inte att uppdatera länken %s -URLToLink=URL för länk -OverwriteIfExists=Skriv över fil om den existerar diff --git a/htdocs/langs/sw_SW/link.lang b/htdocs/langs/sw_SW/link.lang deleted file mode 100644 index 4a4c19cb49c..00000000000 --- a/htdocs/langs/sw_SW/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Unganisha faili/hati mpya -LinkedFiles=Faili na hati zilizounganishwa -NoLinkFound=Hakuna viungo vilivyosajiliwa -LinkComplete=Faili imeunganishwa kwa mafanikio -ErrorFileNotLinked=Faili haikuweza kuunganishwa -LinkRemoved=Kiungo %s imeondolewa -ErrorFailedToDeleteLink= Imeshindwa kuondoa kiungo ' %s ' -ErrorFailedToUpdateLink= Imeshindwa kusasisha kiungo ' %s ' -URLToLink=URL ya kuunganisha -OverwriteIfExists=Batilisha faili ikiwa ipo diff --git a/htdocs/langs/ta_IN/link.lang b/htdocs/langs/ta_IN/link.lang deleted file mode 100644 index 177caf7ef14..00000000000 --- a/htdocs/langs/ta_IN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=புதிய கோப்பு/ஆவணத்தை இணைக்கவும் -LinkedFiles=இணைக்கப்பட்ட கோப்புகள் மற்றும் ஆவணங்கள் -NoLinkFound=பதிவு செய்யப்பட்ட இணைப்புகள் இல்லை -LinkComplete=கோப்பு வெற்றிகரமாக இணைக்கப்பட்டது -ErrorFileNotLinked=கோப்பை இணைக்க முடியவில்லை -LinkRemoved=%s இணைப்பு அகற்றப்பட்டது -ErrorFailedToDeleteLink= ' %s ' இணைப்பை அகற்ற முடியவில்லை -ErrorFailedToUpdateLink= ' %s ' இணைப்பைப் புதுப்பிக்க முடியவில்லை -URLToLink=இணைக்க வேண்டிய URL -OverwriteIfExists=கோப்பு இருந்தால் மேலெழுதவும் diff --git a/htdocs/langs/tg_TJ/link.lang b/htdocs/langs/tg_TJ/link.lang deleted file mode 100644 index d9f2ddbfd93..00000000000 --- a/htdocs/langs/tg_TJ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Файл/ҳуҷҷати навро пайванд кунед -LinkedFiles=Ҳуҷҷатҳо ва файлҳои алоқаманд -NoLinkFound=Истинодҳои ба қайд гирифташуда вуҷуд надоранд -LinkComplete=Файл бомуваффақият пайваст карда шуд -ErrorFileNotLinked=Файлро пайванд кардан ғайриимкон буд -LinkRemoved=Истиноди %s хориҷ карда шуд -ErrorFailedToDeleteLink= Истиноди ' %s ' хориҷ карда нашуд -ErrorFailedToUpdateLink= Истиноди ' %s ' навсозӣ карда нашуд -URLToLink=URL барои пайванд -OverwriteIfExists=Агар мавҷуд бошад, файлро аз нав сабт кунед diff --git a/htdocs/langs/th_TH/link.lang b/htdocs/langs/th_TH/link.lang deleted file mode 100644 index 7a1e16ba362..00000000000 --- a/htdocs/langs/th_TH/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=เชื่อมโยงไฟล์ใหม่ / เอกสาร -LinkedFiles=แฟ้มที่เชื่อมโยงและเอกสาร -NoLinkFound=ไม่มีการเชื่อมโยงลงทะเบียน -LinkComplete=ไฟล์ที่ได้รับการประสบความสำเร็จในการเชื่อมโยง -ErrorFileNotLinked=ไฟล์ไม่สามารถเชื่อมโยง -LinkRemoved=การเชื่อมโยง% s ได้ถูกลบออก -ErrorFailedToDeleteLink= ล้มเหลวในการลบการเชื่อมโยง '% s' -ErrorFailedToUpdateLink= ล้มเหลวในการปรับปรุงการเชื่อมโยง '% s' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/tr_TR/link.lang b/htdocs/langs/tr_TR/link.lang deleted file mode 100644 index 646d610a408..00000000000 --- a/htdocs/langs/tr_TR/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Yeni bir dosya/belge bağlantıla -LinkedFiles=Bağlantılı dosyalar ve belgeler -NoLinkFound=Kayıtlı bağlantı yok -LinkComplete=Dosya bağlantısı başarılı -ErrorFileNotLinked=Dosya bağlantılanamadı -LinkRemoved=%s bağlantısı kaldırıldı -ErrorFailedToDeleteLink= '%s' bağlantısı kaldırılamadı -ErrorFailedToUpdateLink= '%s' bağlantısı güncellenemedi -URLToLink=Bağlantılanalıcak URL -OverwriteIfExists=Dosya varsa üzerine yaz diff --git a/htdocs/langs/uk_UA/link.lang b/htdocs/langs/uk_UA/link.lang deleted file mode 100644 index 8fde3beae63..00000000000 --- a/htdocs/langs/uk_UA/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Зв’язати новий файл/документ -LinkedFiles=Пов’язані файли та документи -NoLinkFound=Немає зареєстрованих посилань -LinkComplete=Файл успішно пов’язано -ErrorFileNotLinked=Не вдалося зв’язати файл -LinkRemoved=Посилання %s видалено -ErrorFailedToDeleteLink= Не вдалося видалити посилання " %s " -ErrorFailedToUpdateLink= Не вдалося оновити посилання " %s " -URLToLink=URL для посилання -OverwriteIfExists=Перезаписати файл, якщо він існує diff --git a/htdocs/langs/ur_PK/link.lang b/htdocs/langs/ur_PK/link.lang deleted file mode 100644 index 256f4dc462b..00000000000 --- a/htdocs/langs/ur_PK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=ایک نئی فائل/دستاویز سے لنک کریں۔ -LinkedFiles=منسلک فائلیں اور دستاویزات -NoLinkFound=کوئی رجسٹرڈ لنکس نہیں۔ -LinkComplete=فائل کو کامیابی سے جوڑ دیا گیا ہے۔ -ErrorFileNotLinked=فائل کو لنک نہیں کیا جا سکا -LinkRemoved=لنک %s ہٹا دیا گیا ہے۔ -ErrorFailedToDeleteLink= لنک ' %s ' کو ہٹانے میں ناکام -ErrorFailedToUpdateLink= لنک ' %s ' کو اپ ڈیٹ کرنے میں ناکام -URLToLink=لنک کرنے کے لیے URL -OverwriteIfExists=اگر موجود ہو تو فائل کو اوور رائٹ کریں۔ diff --git a/htdocs/langs/uz_UZ/link.lang b/htdocs/langs/uz_UZ/link.lang deleted file mode 100644 index e37e7f0be18..00000000000 --- a/htdocs/langs/uz_UZ/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Yangi fayl / hujjatni bog'lang -LinkedFiles=Bog'langan fayllar va hujjatlar -NoLinkFound=Ro'yxatdan o'tgan havolalar yo'q -LinkComplete=Fayl muvaffaqiyatli ulandi -ErrorFileNotLinked=Faylni ulab bo‘lmadi -LinkRemoved=%s havolasi o'chirildi -ErrorFailedToDeleteLink= ' %s ' havolasi o'chirilmadi -ErrorFailedToUpdateLink= ' %s ' havolasi yangilanmadi -URLToLink=Ulanish uchun URL -OverwriteIfExists=Agar mavjud bo'lsa, faylni qayta yozing diff --git a/htdocs/langs/vi_VN/link.lang b/htdocs/langs/vi_VN/link.lang deleted file mode 100644 index bacbeaf98e2..00000000000 --- a/htdocs/langs/vi_VN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=Liên kết một tập tin / tài liệu mới -LinkedFiles=Các tập tin và tài liệu được liên kết -NoLinkFound=Không có liên kết đã đăng ký -LinkComplete=Các tập tin đã được liên kết thành công -ErrorFileNotLinked=Các tập tin không thể được liên kết -LinkRemoved=Liên kết %s đã bị xóa -ErrorFailedToDeleteLink= Không thể xóa liên kết ' %s ' -ErrorFailedToUpdateLink= Không thể cập nhật liên kết ' %s ' -URLToLink=URL để liên kết -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/zh_CN/link.lang b/htdocs/langs/zh_CN/link.lang deleted file mode 100644 index 00f14808c56..00000000000 --- a/htdocs/langs/zh_CN/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=链接一份新文件/文档 -LinkedFiles=链接文件和文档 -NoLinkFound=无注册链接 -LinkComplete=文件链接成功 -ErrorFileNotLinked=文件无法链接 -LinkRemoved=链接 %s 已移除 -ErrorFailedToDeleteLink= 移除链接失败 '%s' -ErrorFailedToUpdateLink= 更新链接失败 '%s' -URLToLink=URL网址超链接 -OverwriteIfExists=如果存在就覆盖文件 diff --git a/htdocs/langs/zh_HK/link.lang b/htdocs/langs/zh_HK/link.lang deleted file mode 100644 index 3205abcd1be..00000000000 --- a/htdocs/langs/zh_HK/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=鏈接新文件/文檔 -LinkedFiles=鏈接的文件和文檔 -NoLinkFound=沒有註冊鏈接 -LinkComplete=文件已鏈接成功 -ErrorFileNotLinked=該文件無法鏈接 -LinkRemoved=鏈接%s 已被刪除 -ErrorFailedToDeleteLink= 無法刪除鏈接“”\n %s ' -ErrorFailedToUpdateLink= 無法更新鏈接“”\n %s ' -URLToLink=URL to link -OverwriteIfExists=Overwrite file if exists diff --git a/htdocs/langs/zh_TW/link.lang b/htdocs/langs/zh_TW/link.lang deleted file mode 100644 index 23949b86a29..00000000000 --- a/htdocs/langs/zh_TW/link.lang +++ /dev/null @@ -1,11 +0,0 @@ -# Dolibarr language file - Source file is en_US - languages -LinkANewFile=連接新文件/檔案 -LinkedFiles=連接新文件/檔案(複數) -NoLinkFound=沒有註冊連線 -LinkComplete=此文件已成功連接 -ErrorFileNotLinked=此文件無法連接 -LinkRemoved=此連線%s已被刪除 -ErrorFailedToDeleteLink= 無法刪除連線“ %s ” -ErrorFailedToUpdateLink= 無法更新連線' %s' -URLToLink=連線網址 -OverwriteIfExists=Overwrite file if exists From 8e328c58cb0e825e2c8cf9e6faef006de08267fe Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 7 Sep 2023 09:16:47 +0200 Subject: [PATCH 0804/1137] fix travis --- htdocs/comm/action/peruser.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index ffa4f833b82..a32097b729b 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -527,18 +527,18 @@ $eventarray = array(); // DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR -$sql = 'SELECT'; +$sql = "SELECT"; if ($usergroup > 0) { $sql .= " DISTINCT"; } -$sql .= ' a.id, a.label,'; -$sql .= ' a.datep,'; -$sql .= ' a.datep2,'; -$sql .= ' a.percent,'; -$sql .= ' a.fk_user_author,a.fk_user_action,'; -$sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,'; -$sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,'; -$sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto'; +$sql .= " a.id, a.label,"; +$sql .= " a.datep,"; +$sql .= " a.datep2,"; +$sql .= " a.percent,"; +$sql .= " a.fk_user_author,a.fk_user_action,"; +$sql .= " a.transparency, a.priority, a.fulldayevent, a.location,"; +$sql .= " a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,"; +$sql .= " ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto"; $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; @@ -559,8 +559,8 @@ if ($filtert > 0 || $usergroup > 0) { } } -$sql .= ' WHERE a.fk_action = ca.id'; -$sql .= ' AND a.entity IN ('.getEntity('agenda').')'; +$sql .= " WHERE a.fk_action = ca.id"; +$sql .= " AND a.entity IN (".getEntity('agenda').")"; // Condition on actioncode if (!empty($actioncode)) { if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { @@ -600,7 +600,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")"; } if ($socid > 0) { - $sql .= ' AND a.fk_soc = '.((int) $socid); + $sql .= " AND a.fk_soc = ".((int) $socid); } if ($mode == 'show_day') { @@ -613,7 +613,7 @@ if ($mode == 'show_day') { $sql .= " OR "; $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year, 'tzuserrel'))."'"; $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year, 'tzuserrel'))."')"; - $sql .= ')'; + $sql .= ")"; } else { // To limit array $sql .= " AND ("; @@ -648,7 +648,7 @@ if ($status == 'todo') { $sql .= " AND (a.percent >= 0 AND a.percent < 100)"; } // Sort on date -$sql .= ' ORDER BY fk_user_action, datep'; //fk_user_action +$sql .= $db->order("fk_user_action, datep'"); //print $sql; dol_syslog("comm/action/peruser.php", LOG_DEBUG); From b61998ec4b476904b3df11a20a790eb49700e383 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Sep 2023 12:13:10 +0200 Subject: [PATCH 0805/1137] Log --- htdocs/emailcollector/class/emailcollector.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index f20d21463af..8a3e2634699 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -3225,6 +3225,7 @@ class EmailCollector extends CommonObject } else { $langs->load("admin"); $output = $langs->trans('NoNewEmailToProcess'); + $output .= ' (defaultlang='.$langs->defaultlang.')'; } // Disconnect From 862f10f7fdda3f0eb750a007c16c7bad485589f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Sep 2023 17:28:51 +0200 Subject: [PATCH 0806/1137] Fix error management --- htdocs/compta/prelevement/class/bonprelevement.class.php | 7 +++++-- htdocs/compta/prelevement/create.php | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 455e1c7972c..da35df53876 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -895,6 +895,8 @@ class BonPrelevement extends CommonObject $factures_errors = array(); if (!$error) { + dol_syslog(__METHOD__." Read invoices for did=".((int) $did), LOG_DEBUG); + $sql = "SELECT f.rowid, pd.rowid as pfdrowid, f.fk_soc"; $sql .= ", pfd.code_banque, pfd.code_guichet, pfd.number, pfd.cle_rib"; $sql .= ", pfd.amount"; @@ -919,7 +921,6 @@ class BonPrelevement extends CommonObject if ($did > 0) { $sql .= " AND pd.rowid = ".((int) $did); } - dol_syslog(__METHOD__." Read invoices,", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -941,7 +942,9 @@ class BonPrelevement extends CommonObject dol_syslog(__METHOD__." Read invoices, ".$i." invoices to withdraw", LOG_DEBUG); } else { $error++; - dol_syslog(__METHOD__." Read invoices error ".$this->db->error(), LOG_ERR); + $this->error = $this->db->lasterror(); + dol_syslog(__METHOD__." Read invoices error ".$this->db->lasterror(), LOG_ERR); + return -1; } } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 62d84cd444c..2555ab9d37e 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -128,6 +128,7 @@ if (empty($reshook)) { if (!$error) { // getDolGlobalString('PRELEVEMENT_CODE_BANQUE') and getDolGlobalString('PRELEVEMENT_CODE_GUICHET') should be empty (we don't use them anymore) $result = $bprev->create(getDolGlobalString('PRELEVEMENT_CODE_BANQUE'), getDolGlobalString('PRELEVEMENT_CODE_GUICHET'), $mode, $format, $executiondate, 0, $type); + if ($result < 0) { setEventMessages($bprev->error, $bprev->errors, 'errors'); } elseif ($result == 0) { From 66a4433896d001bc461f82a0ba2b45d999f7b6ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Sep 2023 17:39:54 +0200 Subject: [PATCH 0807/1137] Fix regression --- htdocs/compta/prelevement/class/bonprelevement.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index da35df53876..724cf5ff8fc 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -898,8 +898,8 @@ class BonPrelevement extends CommonObject dol_syslog(__METHOD__." Read invoices for did=".((int) $did), LOG_DEBUG); $sql = "SELECT f.rowid, pd.rowid as pfdrowid, f.fk_soc"; - $sql .= ", pfd.code_banque, pfd.code_guichet, pfd.number, pfd.cle_rib"; - $sql .= ", pfd.amount"; + $sql .= ", pd.code_banque, pd.code_guichet, pd.number, pd.cle_rib"; + $sql .= ", pd.amount"; $sql .= ", s.nom as name"; $sql .= ", f.ref, sr.bic, sr.iban_prefix, sr.frstrecur"; if ($type != 'bank-transfer') { @@ -968,7 +968,7 @@ class BonPrelevement extends CommonObject if ($resfetch >= 0) { // Field 0 of $fac is rowid of invoice */ - // Check if $fac[8] s.nom is null + // Check if $fac[8] s.nom is null if ($fac[8] != null) { //$bac = new CompanyBankAccount($this->db); //$bac->fetch(0, $soc->id); From d3f3147de39f0e56a69ca46dae4263d56298a906 Mon Sep 17 00:00:00 2001 From: Can Arslan <138895927+mc2rcanarslan@users.noreply.github.com> Date: Thu, 7 Sep 2023 12:53:50 -0600 Subject: [PATCH 0808/1137] fix: unknown column error on generated product sql --- 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 ff3115ee40b..e31cce2234b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2817,7 +2817,7 @@ class Product extends CommonObject $sql .= " FROM ".$this->db->prefix()."mrp_mo as c"; $sql .= " INNER JOIN ".$this->db->prefix()."mrp_production as mp ON mp.fk_mo=c.rowid"; if (empty($user->rights->societe->client->voir) && !$socid) { - $sql .= "INNER JOIN ".$this->db->prefix()."societe_commerciaux as sc ON sc.fk_soc=c.fk_soc AND sc.fk_user = ".((int) $user->id); + $sql .= " INNER JOIN ".$this->db->prefix()."societe_commerciaux as sc ON sc.fk_soc=c.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " WHERE "; $sql .= " c.entity IN (".getEntity('mo').")"; From 9ed7bb77cd8f28931182993efcf56592f5aa5ff1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Sep 2023 01:36:26 +0200 Subject: [PATCH 0809/1137] Sec: Increase list of not allowed function in dol_eval --- htdocs/core/lib/functions.lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dbd31e984cf..43c6747300a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9255,8 +9255,11 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpstrings = array('$$'); $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST')); - $forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI", "verifCond", "base64_decode"); + $forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval"); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond")); // native dolibarr functions + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("base64_decode", "rawurldecode", "urldecode")); // decode string functions $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func")); $forbiddenphpregex = 'global\s+\$|\b('.implode('|', $forbiddenphpfunctions).')\b'; From 684c0b88b524ad4580fb68a83f9122538dc09fd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Sep 2023 01:57:47 +0200 Subject: [PATCH 0810/1137] Sec: More robust call for dol_eval (with param '2') for computed fields --- htdocs/core/class/commonobject.class.php | 10 +++++----- htdocs/core/lib/functions.lib.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 56fe182f10b..16df81f610b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6165,7 +6165,7 @@ abstract class CommonObject if (empty($conf->disable_compute)) { global $objectoffield; // We set a global variable to $objectoffield so $objectoffield = $this; // we can use it inside computed formula - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, ''); + $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); } } } @@ -6294,8 +6294,8 @@ abstract class CommonObject if (!empty($attrfieldcomputed)) { if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { - $value = dol_eval($attrfieldcomputed, 1, 0, ''); - dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG); + $value = dol_eval($attrfieldcomputed, 1, 0, '2'); + dol_syslog($langs->trans("Extrafieldcomputed")." on ".$attributeLabel."(".$value.")", LOG_DEBUG); $new_array_options[$key] = $value; } else { $new_array_options[$key] = null; @@ -6675,7 +6675,7 @@ abstract class CommonObject if (!empty($attrfieldcomputed)) { if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { - $value = dol_eval($attrfieldcomputed, 1, 0, ''); + $value = dol_eval($attrfieldcomputed, 1, 0, '2'); dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG); $this->array_options["options_".$key] = $value; } else { @@ -7597,7 +7597,7 @@ abstract class CommonObject if ($computed) { // Make the eval of compute string //var_dump($computed); - $value = dol_eval($computed, 1, 0, ''); + $value = dol_eval($computed, 1, 0, '2'); } if (empty($morecss)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 43c6747300a..74ca8626850 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9196,8 +9196,8 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' // Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing if ($onlysimplestring == '1') { // We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL' - // We must accept: '$conf->barcode->enabled || preg_match(\'/^AAA/\',$leftmenu)' - // We must accept: '$user->rights->cabinetmed->read && !$object->canvas=="patient@cabinetmed"' + // We must accept: 'isModEnabled("barcode") || preg_match(\'/^AAA/\',$leftmenu)' + // We must accept: '$user->hasRight("cabinetmed", "read") && !$object->canvas=="patient@cabinetmed"' if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) { if ($returnvalue) { return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s; @@ -9219,7 +9219,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' return ''; } // TODO - // We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled(' + // We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled(' and 'hasRight(' // ... } } From c2f8c4f47c7520d196101ecef1e9abe338e699e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Sep 2023 02:29:20 +0200 Subject: [PATCH 0811/1137] Sec: param onlysimplestring is always 1 or 2 --- htdocs/core/boxes/box_scheduled_jobs.php | 2 +- htdocs/core/lib/functions.lib.php | 6 +++++- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- htdocs/public/ticket/list.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index f0868036e9d..7073e886301 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -103,7 +103,7 @@ class box_scheduled_jobs extends ModeleBoxes while ($i < $num) { $objp = $this->db->fetch_object($result); - if (dol_eval($objp->test, 1, 1, '')) { + if (dol_eval($objp->test, 1, 1, '2')) { $nextrun = $this->db->jdate($objp->datenextrun); if (empty($nextrun)) { $nextrun = $this->db->jdate($objp->datestart); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 74ca8626850..6d5073aae58 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9175,7 +9175,7 @@ function verifCond($strToEvaluate) * @param string $s String to evaluate * @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)). * @param int $hideerrors 1=Hide errors - * @param string $onlysimplestring '0' (used for computed property of extrafields)=Accept all chars, '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', '2' (rarely used)=Accept also '[]' + * @param string $onlysimplestring '0' (deprecated, used for computed property of extrafields)=Accept all chars, '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', '2' (rarely used)=Accept also '[]' * @return mixed Nothing or return result of eval */ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1') @@ -9192,6 +9192,10 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object global $soc; // For backward compatibility + if (!in_array($onlysimplestring, array('0', '1', '2'))) { + return 'Bad call of dol_eval. Parameter onlysimplestring must be 0, 1 or 2'; + } + try { // Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing if ($onlysimplestring == '1') { diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index cf6a3b35648..0f0add8e9ae 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -35,7 +35,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield // If field is a computed field, we make computation to get value if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { $objectoffield = $object; //For compatibily with the computed formula - $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '0'); + $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '2'); if (is_numeric(price2num($value)) && $extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) { $obj->$tmpkey = price2num($value); } diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 954e2428cfe..ccf0b992e29 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -266,7 +266,7 @@ if ($action == "view_ticketlist") { if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate') { - $enabled = abs(dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, 0)); + $enabled = abs(dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, '2')); $enabled = (($enabled == 0 || $enabled == 3) ? 0 : $enabled); $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1, 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => $enabled && $extrafields->attributes[$object->table_element]['perms'][$key]); } From e9787451a82bd89727939a4f39e54a8faedffd28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Sep 2023 05:51:06 +0200 Subject: [PATCH 0812/1137] Disallow more use of parenthesis into dol_eval --- ChangeLog | 1 + htdocs/core/lib/functions.lib.php | 86 ++++++++++++++++++++++------ htdocs/core/lib/security.lib.php | 22 +++---- htdocs/core/modules/modApi.class.php | 1 - test/phpunit/SecurityTest.php | 18 +++++- 5 files changed, 96 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82771d980ab..0e57d0be48a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ Following changes may create regressions for some external modules, but were nec * The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead. * Recheck setup of your module workflow to see if you need to enable the new setting to have shipment set to billed automatically when an invoice from a shipment is validated (and if your process is to make invoice on shipment and not on order). +* It was possible to use a variable $soc or $right inside a php code condition of some extrafields properties, this is no more true (this vars are no more defined globaly). ***** ChangeLog for 18.0.1 compared to 18.0.0 ***** diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6d5073aae58..2ae73a96a64 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9145,6 +9145,33 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = } } +/** + * Check if a variable with name $var start with $text. + * Can be used to forge dol_eval() conditions. + * + * @param $var string Variable + * @param $regextext string Text that must be a valid regex string + * @param $matchrule int 1=Test if start with, 0=Test if equal + * @return boolean|string True or False, text if bad use. + */ +function isStringVarMatching($var, $regextext, $matchrule = 1) +{ + if ($matchrule == 1) { + if ($var == 'mainmenu') { + global $mainmenu; + return (preg_match('/^'.$regextext.'/', $mainmenu)); + } elseif ($var == 'leftmenu') { + global $leftmenu; + return (preg_match('/^'.$regextext.'/', $leftmenu)); + } else { + return 'This variable is not accessible with dol_eval'; + } + } else { + return 'This value for matchrule is not implemented'; + } +} + + /** * Verify if condition in string is ok or not * @@ -9153,15 +9180,15 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = */ function verifCond($strToEvaluate) { - global $user, $conf, $langs; + global $conf; // Read of const is done with getDolGlobalString() but we need $conf->currency for example + global $user, $langs; global $leftmenu; - global $rights; // To export to dol_eval function //print $strToEvaluate."
\n"; $rights = true; if (isset($strToEvaluate) && $strToEvaluate !== '') { //var_dump($strToEvaluate); - $rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition + $rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } @@ -9175,32 +9202,35 @@ function verifCond($strToEvaluate) * @param string $s String to evaluate * @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)). * @param int $hideerrors 1=Hide errors - * @param string $onlysimplestring '0' (deprecated, used for computed property of extrafields)=Accept all chars, '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', '2' (rarely used)=Accept also '[]' + * @param string $onlysimplestring '0' (deprecated, used for computed property of extrafields)=Accept all chars, + * '1' (most common use)=Accept only simple string with char 'a-z0-9\s^$_+-.*>&|=!?():"\',/@';', + * '2' (rarely used)=Accept also '[]' * @return mixed Nothing or return result of eval + * @see verifCond() */ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1') { - // Only global variables can be changed by eval function and returned to caller - global $db, $langs, $user, $conf, $website, $websitepage; + // Only this global variables can be read by eval function and returned to caller + global $conf; // Read of const is done with getDolGlobalString() but we need $conf->currency for example + global $db, $langs, $user, $website, $websitepage; global $action, $mainmenu, $leftmenu; global $mysoc; - global $objectoffield; + global $objectoffield; // To allow the use of $objectoffield in computed fields // Old variables used - global $rights; global $object; - global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object - global $soc; // For backward compatibility + global $obj; // To get $obj used into list when dol_eval() is used for computed fields and $obj is not yet $object + //global $rights; + //global $soc; // For backward compatibility if (!in_array($onlysimplestring, array('0', '1', '2'))) { - return 'Bad call of dol_eval. Parameter onlysimplestring must be 0, 1 or 2'; + return "Bad call of dol_eval. Parameter onlysimplestring must be '0' (deprecated), '1' or '2'"; } try { // Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing if ($onlysimplestring == '1') { - // We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL' - // We must accept: 'isModEnabled("barcode") || preg_match(\'/^AAA/\',$leftmenu)' + // We must accept: '1 && getDolGlobalInt("doesnotexist1") && getDolGlobalString("MAIN_FEATURES_LEVEL")' // We must accept: '$user->hasRight("cabinetmed", "read") && !$object->canvas=="patient@cabinetmed"' if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@', '/').']/i', $s)) { if ($returnvalue) { @@ -9209,10 +9239,21 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s); return ''; } - // TODO - // We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled(' - // ... } + $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $s); + $scheck = preg_replace('/\s[a-zA-Z0-9_]+\(/', ' __FUNCTION__', $scheck); + $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') + //print 'scheck='.$scheck." : ".strpos($scheck, '(')."\n"; + if (strpos($scheck, '(') !== false) { + if ($returnvalue) { + return 'Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s; + } else { + dol_syslog('Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s); + return ''; + } + } + // TODO + // We can exclude $ char that are not: $db, $langs, $leftmenu, $topmenu, $user, $langs, $objectoffield, $object..., } elseif ($onlysimplestring == '2') { // We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found" if (preg_match('/[^a-z0-9\s'.preg_quote('^$_+-.*>&|=!?():"\',/@[]', '/').']/i', $s)) { @@ -9222,10 +9263,17 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s); return ''; } - // TODO - // We can exclude all parenthesis ( that are not '($db' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match(' and 'isModEnabled(' and 'hasRight(' - // ... } + if (strpos($scheck, '(') !== false) { + if ($returnvalue) { + return 'Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s; + } else { + dol_syslog('Bad string syntax to evaluate (found call of a function or method without using direct name): '.$s); + return ''; + } + } + // TODO + // We can exclude $ char that are not: $db, $leftmenu, $topmenu, $user, $langs, $object..., } if (is_array($s) || $s === 'Array') { return 'Bad string syntax to evaluate (value is Array) '.var_export($s, true); diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 7818b9d2e7e..0a2d2572889 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -434,19 +434,21 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '', // Get more permissions checks from hooks $parameters = array('features'=>$features, 'originalfeatures'=>$originalfeatures, 'objectid'=>$objectid, 'dbt_select'=>$dbt_select, 'idtype'=>$dbt_select, 'isdraft'=>$isdraft); - $reshook = $hookmanager->executeHooks('restrictedArea', $parameters); + if (!empty($hookmanager)) { + $reshook = $hookmanager->executeHooks('restrictedArea', $parameters); - if (isset($hookmanager->resArray['result'])) { - if ($hookmanager->resArray['result'] == 0) { - if ($mode) { - return 0; - } else { - accessforbidden(); // Module returns 0, so access forbidden + if (isset($hookmanager->resArray['result'])) { + if ($hookmanager->resArray['result'] == 0) { + if ($mode) { + return 0; + } else { + accessforbidden(); // Module returns 0, so access forbidden + } } } - } - if ($reshook > 0) { // No other test done. - return 1; + if ($reshook > 0) { // No other test done. + return 1; + } } // Features/modules to check diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index acceaa822d1..9621904ebe6 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -163,7 +163,6 @@ class modApi extends DolibarrModules 'langs'=>'modulebuilder', 'position'=>100, 'perms'=>'1', - //'enabled'=>'isModEnabled("api") && preg_match(\'/^(devtools)/\',$leftmenu)', 'enabled'=>'isModEnabled("api")', 'target'=>'_apiexplorer', 'user'=>0); diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 545306f5734..cf9e223d737 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -960,7 +960,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase print "result = ".$result."\n"; $this->assertEquals('Parent project not found', $result); - $result=dol_eval('$a=function() { }; $a;', 1, 1, ''); + $result=dol_eval('$a=function() { }; $a;', 1, 1, '0'); print "result = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); @@ -999,12 +999,22 @@ class SecurityTest extends PHPUnit\Framework\TestCase print "result = ".$result."\n"; $this->assertTrue($result); - // Same with syntax error + // Same with a value that does not match $leftmenu = 'XXX'; $result=dol_eval('$conf->currency && preg_match(\'/^(AAA|BBB)/\',$leftmenu)', 1, 1, '1'); print "result = ".$result."\n"; $this->assertFalse($result); + $leftmenu = 'AAA'; + $result=dol_eval('$conf->currency && isStringVarMatching(\'leftmenu\', \'(AAA|BBB)\')', 1, 1, '1'); + print "result = ".$result."\n"; + $this->assertTrue($result); + + $leftmenu = 'XXX'; + $result=dol_eval('$conf->currency && isStringVarMatching(\'leftmenu\', \'(AAA|BBB)\')', 1, 1, '1'); + print "result = ".$result."\n"; + $this->assertFalse($result); + // Case with param onlysimplestring = 1 @@ -1015,6 +1025,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase $result=dol_eval("(\$a.'aa')", 1, 0); print "result = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); + + $result=dol_eval('$a="abs" && $a(5)', 1, 0); + print "result = a".$result."\n"; + $this->assertContains('Bad string syntax to evaluate', $result); } From 6f0e82f5d764cc72230941bc028cf26bdc750f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 8 Sep 2023 09:49:47 +0200 Subject: [PATCH 0813/1137] phpstan --- htdocs/product/class/product.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ff3115ee40b..a4b75da9f49 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -173,6 +173,7 @@ class Product extends CommonObject public $multiprices = array(); public $multiprices_ttc = array(); public $multiprices_base_type = array(); + public $multiprices_default_vat_code = array(); public $multiprices_min = array(); public $multiprices_min_ttc = array(); public $multiprices_tva_tx = array(); @@ -184,6 +185,11 @@ class Product extends CommonObject public $prices_by_qty_id = array(); public $prices_by_qty_list = array(); + /** + * @var int price level set after updateprice for trigger + */ + public $level; + //! Array for multilangs public $multilangs = array(); From 01232b721dc43a5c123a5af60242a35d9d0218f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 8 Sep 2023 11:25:54 +0200 Subject: [PATCH 0814/1137] do not trunc label but only use css overflowmax --- htdocs/core/class/html.formactions.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index ecedab797ac..2aab803bf17 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -306,7 +306,7 @@ class FormActions print ''; // Label - print ''.$actioncomm->getNomUrl(0, 36).''; + print ''.$actioncomm->getNomUrl(0).''; // Date print ''.dol_print_date($actioncomm->datep, 'dayhour', 'tzuserrel'); From 373424f8ed690d6571059f0cb4d8e2c90f485b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 8 Sep 2023 11:57:11 +0200 Subject: [PATCH 0815/1137] phpdoc --- htdocs/comm/action/class/actioncomm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 836562067f8..6e9af651656 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1321,7 +1321,7 @@ class ActionComm extends CommonObject * @param string $sortfield Sort on this field * @param string $sortorder ASC or DESC * @param string $limit Limit number of answers - * @return array|string Error string if KO, array with actions if OK + * @return ActionComm[]|string Error string if KO, array with actions if OK */ public function getActions($socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0) { From 5adf2ccf5b5678a1fac6b2985e896e847327c2c8 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Fri, 8 Sep 2023 12:11:52 +0200 Subject: [PATCH 0816/1137] fix problem --- htdocs/core/lib/modulebuilder.lib.php | 3 +- htdocs/modulebuilder/index.php | 378 +++++++++++++++----------- 2 files changed, 214 insertions(+), 167 deletions(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 32fd00752b6..0742ad15368 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -1203,7 +1203,7 @@ function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = nul $modulename = strtolower($modulename); if (empty($dictionnaires)) { - $dictionnaires = array('tabname' => array(), 'tablib' => array(), 'tabsql' => array(), 'tabsqlsort' => array(), 'tabfield' => array(), 'tabfieldvalue' => array(), 'tabfieldinsert' => array(), 'tabrowid' => array(), 'tabcond' => array(), 'tabhelp' => array()); + $dictionnaires = array('langs' => '', 'tabname' => array(), 'tablib' => array(), 'tabsql' => array(), 'tabsqlsort' => array(), 'tabfield' => array(), 'tabfieldvalue' => array(), 'tabfieldinsert' => array(), 'tabrowid' => array(), 'tabcond' => array(), 'tabhelp' => array()); } $columns = array( @@ -1243,6 +1243,7 @@ function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = nul } // rewrite dictionnary if + $dictionnaires['langs'] = $modulename.'@'.$modulename; $dictionnaires['tabname'][] = strtolower($namedic); $dictionnaires['tablib'][] = ucfirst(substr($namedic, 2)); $dictionnaires['tabsql'][] = 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.strtolower($namedic).' as f'; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 668991818b5..f77a82cfd3b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1568,11 +1568,19 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { } // Add a dictionary -if ($dirins && $action == 'initdic' && $module && $dicname) { +if ($dirins && $action == 'initdic' && $module && empty($cancel)) { $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; $destdir = $dirins.'/'.strtolower($module); $moduledescriptorfile = $dirins.'/'.strtolower($module).'/core/modules/mod'.$module.'.class.php'; + if (!GETPOST('dicname')) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Table")), null, 'errors'); + } + if (!GETPOST('label')) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lable")), null, 'errors'); + } if (!$error) { $newdicname = $dicname; if (!preg_match('/^c_/', $newdicname)) { @@ -2051,16 +2059,13 @@ if (($dirins && $action == 'confirm_deletedictionary' && $dicname) || ($dirins & $result = updateDictionaryInFile($module, $moduledescriptorfile, $dicts); if ($result > 0) { setEventMessages($langs->trans("DictionaryDeleted", ucfirst(substr($newdicname, 2))), null); - } elseif (!$result) { - setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Dictionaries"), "mod".$module."class.php"), null, 'warnings'); - } else { - if (function_exists('opcache_invalidate')) { - opcache_reset(); // remove the include cache hell ! - } - clearstatcache(true); - header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); - exit; } + if (function_exists('opcache_invalidate')) { + opcache_reset(); // remove the include cache hell ! + } + clearstatcache(true); + header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '')); + exit; } } if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) { @@ -3265,7 +3270,7 @@ if ($module == 'initmodule') { $objects = dolGetListOfObjectClasses($destdir); $diroflang = dol_buildpath($modulelowercase, 0)."/langs"; $countLangs = countItemsInDirectory($diroflang, 2); - $countDictionaries = count($moduleobj->dictionaries['tabname']); + $countDictionaries = (!empty($moduleobj->dictionaries) ? count($moduleobj->dictionaries['tabname']) : 0); $countRights = count($moduleobj->rights); $countMenus = count($moduleobj->menu); $countTriggers = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/core/triggers"); @@ -3274,7 +3279,7 @@ if ($module == 'initmodule') { $countJs = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/js"); $countCLI = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/scripts"); $hasDoc = countItemsInDirectory(dol_buildpath($modulelowercase, 0)."/doc"); - + //var_dump($moduleobj->dictionaries);exit; $head2 = array(); $h = 0; @@ -3294,7 +3299,7 @@ if ($module == 'initmodule') { $h++; $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''); - $head2[$h][1] = ($countDictionaries <= 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries')." (".$countDictionaries.")"); + $head2[$h][1] = ($countDictionaries == 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries')." (".$countDictionaries.")"); $head2[$h][2] = 'dictionaries'; $h++; @@ -4519,206 +4524,250 @@ if ($module == 'initmodule') { //$listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$'); $firstdicname = ''; - if (!empty($dicts['tabname'])) { - foreach ($dicts['tabname'] as $key => $dic) { - $dicname = $dic; - $diclabel = $dicts['tablib'][$key]; + // if (!empty($dicts['tabname'])) { + // foreach ($dicts['tabname'] as $key => $dic) { + // $dicname = $dic; + // $diclabel = $dicts['tablib'][$key]; - if (empty($firstdicname)) { - $firstdicname = $dicname; - } + // if (empty($firstdicname)) { + // $firstdicname = $dicname; + // } - $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic='.$dicname; - $head3[$h][1] = $diclabel; - $head3[$h][2] = $dicname; - $h++; - } - } + // $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic='.$dicname; + // $head3[$h][1] = $diclabel; + // $head3[$h][2] = $dicname; + // $h++; + // } + // } - if ($h > 1) { - $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic=deletedictionary'; - $head3[$h][1] = $langs->trans("DangerZone"); - $head3[$h][2] = 'deletedictionary'; - $h++; - } + // if ($h > 1) { + // $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic=deletedictionary'; + // $head3[$h][1] = $langs->trans("DangerZone"); + // $head3[$h][2] = 'deletedictionary'; + // $h++; + // } // If tabobj was not defined, then we check if there is one obj. If yes, we force on it, if no, we will show tab to create new objects. - if ($tabdic == 'newdicifnodic') { - if ($firstdicname) { - $tabdic = $firstdicname; - } else { - $tabdic = 'newdictionary'; - } - } + // if ($tabdic == 'newdicifnodic') { + // if ($firstdicname) { + // $tabdic = $firstdicname; + // } else { + // $tabdic = 'newdictionary'; + // } + // } + //print dol_get_fiche_head($head3, $tabdic, '', -1, ''); // Level 3 + $newdict = dolGetButtonTitle($langs->trans('NewDictionary'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.urlencode($module).'&tabdic=newdictionary'); print_barre_liste($langs->trans("ListOfDictionariesEntries"), '', $_SERVER["PHP_SELF"], '', '', '', '', '', '', '', 0, $newdict, '', '', 0, 0, 1); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + if ($tabdic != 'newdictionary') { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - print '
'; - print ''; + print '
'; + print '
'; - print ''; - print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'thsticky thstickygrey '); - print_liste_field_titre("Table", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("SQL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("SQLSort", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("FieldsView", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("FieldsEdit", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("FieldsInsert", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Rowid", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Condition", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print ''; + print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'thsticky thstickygrey '); + print_liste_field_titre("Table", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("SQL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("SQLSort", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("FieldsView", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("FieldsEdit", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("FieldsInsert", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Rowid", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Condition", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder); - print "\n"; + print "\n"; - if (!empty($dicts) && is_array($dicts) && !empty($dicts['tabname']) && is_array($dicts['tabname'])) { - $i = 0; - $maxi = count($dicts['tabname']); - while ($i < $maxi) { - if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int')-1) { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + if (!empty($dicts) && is_array($dicts) && !empty($dicts['tabname']) && is_array($dicts['tabname'])) { + $i = 0; + $maxi = count($dicts['tabname']); + while ($i < $maxi) { + if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int')-1) { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; - print ''; - } else { - print ''; + print ''; + print ''; + } else { + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; + } + $i++; } - $i++; + } else { + print ''; } - } else { - print ''; + + print '
'; - print ($i + 1); - print ''; + print ($i + 1); + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print '
'; - print ''; - print '
'; + print ''; + print '
'; + print ''; + print '
'; - print ($i + 1); - print ''; + print ($i + 1); + print ''; - print $dicts['tabname'][$i]; - print ''; + print $dicts['tabname'][$i]; + print ''; - print $dicts['tablib'][$i]; - print ''; + print $dicts['tablib'][$i]; + print ''; - print $dicts['tabsql'][$i]; - print ''; + print $dicts['tabsql'][$i]; + print ''; - print $dicts['tabsqlsort'][$i]; - print ''; + print $dicts['tabsqlsort'][$i]; + print ''; - print $dicts['tabfield'][$i]; - print ''; + print $dicts['tabfield'][$i]; + print ''; - print $dicts['tabfieldvalue'][$i]; - print ''; + print $dicts['tabfieldvalue'][$i]; + print ''; - print $dicts['tabfieldinsert'][$i]; - print ''; + print $dicts['tabfieldinsert'][$i]; + print ''; - print $dicts['tabrowid'][$i]; - print ''; + print $dicts['tabrowid'][$i]; + print ''; - print $dicts['tabcond'][$i]; - print ''; + print $dicts['tabcond'][$i]; + print ''; - print ''.img_edit().''; - print ''.img_delete().''; - print ''; + print ''.img_edit().''; + print ''.img_delete().''; + print '
'.$langs->trans("None").'
'.$langs->trans("None").'
'; + print '
'; + + print ''; } - print ''; - print '
'; - - print ''; - - print dol_get_fiche_head($head3, $tabdic, '', -1, ''); // Level 3 - if ($tabdic == 'newdictionary') { // New dic tab print '
'; print ''; print ''; print ''; + print ''; + print ''; print ''.$langs->trans("EnterNameOfDictionaryDesc").'

'; - print '
'; - // print '
'; - // print '
'; - print ''; + print dol_get_fiche_head(''); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("Table").'
'.$langs->trans("Label").'
'.$langs->trans("SQL").'
'.$langs->trans("SQLSort").'
'.$langs->trans("FieldsView").'
'.$langs->trans("FieldsEdit").'
'.$langs->trans("FieldsInsert").'
'.$langs->trans("Rowid").'
'; + print ''; + print ''; + print dol_get_fiche_end(); + print '
'; + print ''; + /*print '
'; print '
'; print '
'; @@ -4731,7 +4780,6 @@ if ($module == 'initmodule') { print ''; print '
'; */ - print ''; } elseif ($tabdic == 'deletedictionary') { // Delete dic tab print '
'; @@ -4745,8 +4793,6 @@ if ($module == 'initmodule') { print ''; print ''; print '
'; - } else { - print $langs->trans("FeatureNotYetAvailable"); } print dol_get_fiche_end(); @@ -5138,7 +5184,7 @@ if ($module == 'initmodule') { } }); }); - '; + '; // display permissions for each object } else { From ec71da27be6bef2fc0253cc1bc4da4c9b4e9a144 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:39:20 +0300 Subject: [PATCH 0817/1137] Update sendings.lang --- htdocs/langs/en_US/sendings.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index 6ed59b35e89..e3696f6c5ac 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -77,7 +77,7 @@ DetailWarehouseFormat= W:%s (Qty: %d) ShipmentDistribution=Shipment distribution -ErrorTooManyCombinationBatchcode=No dispatch for line %s as too many combination warehouse, product, batch code was found (%s). -ErrorNoCombinationBatchcode=No dispatch for line %s as no combination warehouse, product, batch code was found. +ErrorTooManyCombinationBatchcode=No dispatch for line %s as too many combinations of warehouse, product, batch code was found (%s). +ErrorNoCombinationBatchcode=No dispatch for line %s as no combination of warehouse, product, batch code was found. ErrorTooMuchShipped=Quantity shipped should not be greater than quantity ordered for line %s From ea1a1b8bad58a70fc00f04c72d68eaa78baa1110 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:41:59 +0300 Subject: [PATCH 0818/1137] Update hrm.lang --- htdocs/langs/en_US/hrm.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 227819b4037..771c5246b56 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -92,4 +92,4 @@ JobsExtraFields=Attributs supplémentaires (Job profile) EvaluationsExtraFields=Attributs supplémentaires (Evaluations) NeedBusinessTravels=Need business travels NoDescription=No description -TheJobProfileHasNoSkillsDefinedFixBefore=The evaluated job profile of this employee has not skill defined on it. Please fix this before, then delete and restart the evaluation. \ No newline at end of file +TheJobProfileHasNoSkillsDefinedFixBefore=The evaluated job profile of this employee has no skill defined on it. Please add skill(s), then delete and restart the evaluation. From bd970931c0fc8a321f133c9cdca41157f2efa16a Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:44:25 +0300 Subject: [PATCH 0819/1137] Update admin.lang --- htdocs/langs/en_US/admin.lang | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5efb9c00aba..0d4abd53335 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1773,15 +1773,15 @@ FreeLegalTextOnDeliveryReceipts=Free text on delivery receipts ##### FCKeditor ##### AdvancedEditor=Advanced editor ActivateFCKeditor=Activate advanced editor for: -FCKeditorForNotePublic=WYSIWIG creation/edition of the field "public notes" of elements -FCKeditorForNotePrivate=WYSIWIG creation/edition of the field "private notes" of elements -FCKeditorForCompany=WYSIWIG creation/edition of the field description of elements (except products/services) -FCKeditorForProductDetails=WYSIWIG creation/edition of products description or lines for objects (lines of proposals, orders, invoices, etc...). +FCKeditorForNotePublic=WYSIWYG creation/edition of the field "public notes" of elements +FCKeditorForNotePrivate=WYSIWYG creation/edition of the field "private notes" of elements +FCKeditorForCompany=WYSIWYG creation/edition of the field description of elements (except products/services) +FCKeditorForProductDetails=WYSIWYG creation/edition of products description or lines for objects (lines of proposals, orders, invoices, etc...). FCKeditorForProductDetails2=Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files. -FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) -FCKeditorForUserSignature=WYSIWIG creation/edition of user signature -FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing) -FCKeditorForTicket=WYSIWIG creation/edition for tickets +FCKeditorForMailing= WYSIWYG creation/edition for mass eMailings (Tools->eMailing) +FCKeditorForUserSignature=WYSIWYG creation/edition of user signature +FCKeditorForMail=WYSIWYG creation/edition for all mail (except Tools->eMailing) +FCKeditorForTicket=WYSIWYG creation/edition for tickets ##### Stock ##### StockSetup=Stock module setup IfYouUsePointOfSaleCheckModule=If you use the Point of Sale module (POS) provided by default or an external module, this setup may be ignored by your POS module. Most POS modules are designed by default to create an invoice immediately and decrease stock irrespective of the options here. So if you need or not to have a stock decrease when registering a sale from your POS, check also your POS module setup. From d153d7778fa5df6404e8a339b4f6c70434db0bc6 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:52:47 +0300 Subject: [PATCH 0820/1137] Update errors.lang --- htdocs/langs/en_US/errors.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 058dc422b81..02e6c2a27ff 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -4,7 +4,7 @@ NoErrorCommitIsDone=No error, we commit # Errors ErrorButCommitIsDone=Errors found but we validate despite this -ErrorBadEMail=Email %s is incorrect +ErrorBadEMail=Email address %s is incorrect ErrorBadMXDomain=Email %s seems incorrect (domain has no valid MX record) ErrorBadUrl=Url %s is incorrect ErrorBadValueForParamNotAString=Bad value for your parameter. It appends generally when translation is missing. From 704cbbe26630ff6240cd27201a81b3da2aba560d Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:59:21 +0300 Subject: [PATCH 0821/1137] Update main.lang --- htdocs/langs/en_US/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b20aee98e69..c25b445b2d8 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -60,7 +60,7 @@ ErrorFailedToSendMail=Failed to send mail (sender=%s, receiver=%s) ErrorFileNotUploaded=File was not uploaded. Check that size does not exceed maximum allowed, that free space is available on disk and that there is not already a file with same name in this directory. ErrorInternalErrorDetected=Error detected ErrorWrongHostParameter=Wrong host parameter -ErrorYourCountryIsNotDefined=Your country is not defined. Go to Home-Setup-Edit and post the form again. +ErrorYourCountryIsNotDefined=Your country is not defined. Go to Home-Setup-Company/Foundation and post the form again. ErrorRecordIsUsedByChild=Failed to delete this record. This record is used by at least one child record. ErrorWrongValue=Wrong value ErrorWrongValueForParameterX=Wrong value for parameter %s From ea64e69a4108944e66a5d2fa8a01a21027cbb997 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 8 Sep 2023 15:04:53 +0300 Subject: [PATCH 0822/1137] Update main.lang --- htdocs/langs/en_US/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index c25b445b2d8..7fc01613941 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -20,7 +20,7 @@ FormatDateShortJava=MM/dd/yyyy FormatDateShortJavaInput=MM/dd/yyyy FormatDateShortJQuery=mm/dd/yy FormatDateShortJQueryInput=mm/dd/yy -FormatHourShortJQuery=HH:MI +FormatHourShortJQuery=HH:MM FormatHourShort=%I:%M %p FormatHourShortDuration=%H:%M FormatDateTextShort=%b %d, %Y From 5b6b18e1158bcf23ab9cd969d505522b530fb749 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 8 Sep 2023 15:07:17 +0300 Subject: [PATCH 0823/1137] Update ticket.lang --- htdocs/langs/en_US/ticket.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index ed0e893b97c..a9960cc3deb 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -311,7 +311,7 @@ TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket TicketCloseEmailBodyInfosTrackUrlCustomer=You can consult the history of this ticket by clicking the following link TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this email! Use the link to reply into the interface. TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system. -TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe your question. Provide the most information possible to allow us to correctly identify your request. +TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe your request. Provide the most information possible to allow us to correctly identify your request. TicketPublicMsgViewLogIn=Please enter ticket tracking ID TicketTrackId=Public Tracking ID OneOfTicketTrackId=One of your tracking ID From c379420d8695e01f2366ebcdcc4a081538afab2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Sep 2023 14:12:12 +0200 Subject: [PATCH 0824/1137] Fix regression in dol_eval --- htdocs/core/lib/functions.lib.php | 4 ++- test/phpunit/SecurityTest.php | 44 ++++++++++++++++++------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2ae73a96a64..0b2e638d45e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9241,7 +9241,9 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' } } $scheck = preg_replace('/->[a-zA-Z0-9_]+\(/', '->__METHOD__', $s); - $scheck = preg_replace('/\s[a-zA-Z0-9_]+\(/', ' __FUNCTION__', $scheck); + $scheck = preg_replace('/^\(/', '__PARENTHESIS__', $scheck); + $scheck = preg_replace('/\s\(/', '__PARENTHESIS__', $scheck); + $scheck = preg_replace('/(|\s)[a-zA-Z0-9_]+\(/', '$1__FUNCTION__', $scheck); $scheck = preg_replace('/(\^|\')\(/', '__REGEXSTART__', $scheck); // To allow preg_match('/^(aaa|bbb)/'... or isStringVarMatching('leftmenu', '(aaa|bbb)') //print 'scheck='.$scheck." : ".strpos($scheck, '(')."\n"; if (strpos($scheck, '(') !== false) { diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index cf9e223d737..e22e7c8e2a1 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -940,11 +940,11 @@ class SecurityTest extends PHPUnit\Framework\TestCase $db=$this->savdb; $result=dol_eval('1==1', 1, 0); - print "result = ".$result."\n"; + print "result1 = ".$result."\n"; $this->assertTrue($result); $result=dol_eval('1==2', 1, 0); - print "result = ".$result."\n"; + print "result2 = ".$result."\n"; $this->assertFalse($result); include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -952,44 +952,48 @@ class SecurityTest extends PHPUnit\Framework\TestCase $s = '(($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"'; $result=dol_eval($s, 1, 1, '2'); - print "result = ".$result."\n"; + print "result3 = ".$result."\n"; $this->assertEquals('Parent project not found', $result); $s = '(($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : \'Parent project not found\''; $result=dol_eval($s, 1, 1, '2'); - print "result = ".$result."\n"; + print "result4 = ".$result."\n"; $this->assertEquals('Parent project not found', $result); $result=dol_eval('$a=function() { }; $a;', 1, 1, '0'); - print "result = ".$result."\n"; + print "result5 = ".$result."\n"; + $this->assertContains('Bad string syntax to evaluate', $result); + + $result=dol_eval('$a=function() { }; $a;', 1, 1, '1'); + print "result6 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); $result=dol_eval('$a=exec("ls");', 1, 1); - print "result = ".$result."\n"; + print "result7 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); $result=dol_eval('$a=exec ("ls")', 1, 1); - print "result = ".$result."\n"; + print "result8 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); $result=dol_eval('$a="test"; $$a;', 1, 0); - print "result = ".$result."\n"; + print "result9 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); $result=dol_eval('`ls`', 1, 0); - print "result = ".$result."\n"; + print "result10 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); $result=dol_eval("('ex'.'ec')('echo abc')", 1, 0); - print "result = ".$result."\n"; + print "result11 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); $result=dol_eval("sprintf(\"%s%s\", \"ex\", \"ec\")('echo abc')", 1, 0); - print "result = ".$result."\n"; + print "result12 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); $result=dol_eval("90402.38+267678+0", 1, 1, 1); - print "result = ".$result."\n"; + print "result13 = ".$result."\n"; $this->assertEquals('358080.38', $result); global $leftmenu; // Used into strings to eval @@ -1002,32 +1006,36 @@ class SecurityTest extends PHPUnit\Framework\TestCase // Same with a value that does not match $leftmenu = 'XXX'; $result=dol_eval('$conf->currency && preg_match(\'/^(AAA|BBB)/\',$leftmenu)', 1, 1, '1'); - print "result = ".$result."\n"; + print "result14 = ".$result."\n"; $this->assertFalse($result); $leftmenu = 'AAA'; $result=dol_eval('$conf->currency && isStringVarMatching(\'leftmenu\', \'(AAA|BBB)\')', 1, 1, '1'); - print "result = ".$result."\n"; + print "result15 = ".$result."\n"; $this->assertTrue($result); $leftmenu = 'XXX'; $result=dol_eval('$conf->currency && isStringVarMatching(\'leftmenu\', \'(AAA|BBB)\')', 1, 1, '1'); - print "result = ".$result."\n"; + print "result16 = ".$result."\n"; $this->assertFalse($result); + $string = '(isModEnabled("agenda") || isModEnabled("resource")) && getDolGlobalInt("MAIN_FEATURES_LEVEL") >= 0 && preg_match(\'/^(admintools|all|XXX)/\', $leftmenu)'; + $result=dol_eval($string, 1, 1, '1'); + print "result17 = ".$result."\n"; + $this->assertTrue($result); // Case with param onlysimplestring = 1 $result=dol_eval('1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL', 1, 0); // Should return false and not a 'Bad string syntax to evaluate ...' - print "result = ".$result."\n"; + print "result18 = ".$result."\n"; $this->assertFalse($result); $result=dol_eval("(\$a.'aa')", 1, 0); - print "result = ".$result."\n"; + print "result19 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); $result=dol_eval('$a="abs" && $a(5)', 1, 0); - print "result = a".$result."\n"; + print "result20 = ".$result."\n"; $this->assertContains('Bad string syntax to evaluate', $result); } From f2b72ec15a8356130de60f355ac8fe2ca3908144 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Fri, 8 Sep 2023 14:45:59 +0200 Subject: [PATCH 0825/1137] NEW functionality add section changeLog to Doc in MB --- htdocs/modulebuilder/index.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 668991818b5..a3d20c1179d 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -818,6 +818,27 @@ if ($dirins && $action == 'initdoc' && !empty($module)) { writeApiUrlsInDoc($apiFile, $destfile); } + // add ChangeLog in Doc + if (file_exists($dirins.'/'.strtolower($module).'/ChangeLog.md')) { + $changeLog = $dirins.'/'.strtolower($module).'/ChangeLog.md'; + $string = file_get_contents($changeLog); + + $replace = explode("\n", $string); + $strreplace = array(); + foreach ($replace as $line) { + if ($line === '') { + continue; + } + if (strpos($line, '##') !== false) { + $strreplace[$line] = str_replace('##', '', $line); + } else { + $strreplace[$line] = $line; + } + } + $stringLog = implode("\n", $strreplace); + dolREplaceInFile($destfile, array('//include::ChangeLog.md[]' => '','__CHANGELOG__' => $stringLog)); + } + // Delete old documentation files $FILENAMEDOC = $modulelowercase.'.html'; $FILENAMEDOCPDF = $modulelowercase.'.pdf'; From 803aca262e74f4a7dcbd3b6d0c2e3f7eaa9cd3dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Sep 2023 15:25:50 +0200 Subject: [PATCH 0826/1137] Fix edit colors with html5 component --- htdocs/comm/mailing/card.php | 4 ++-- htdocs/core/class/html.formother.class.php | 7 ++++--- htdocs/core/lib/functions.lib.php | 14 ++++++++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index aaa946fd2fe..27af9dc5149 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -547,7 +547,7 @@ if (empty($reshook)) { $object->title = (string) GETPOST("title"); $object->sujet = (string) GETPOST("sujet"); $object->body = (string) GETPOST("bodyemail", 'restricthtml'); - $object->bgcolor = (string) GETPOST("bgcolor"); + $object->bgcolor = preg_replace('/^#/', '', (string) GETPOST("bgcolor")); $object->bgimage = (string) GETPOST("bgimage"); if (!$object->title) { @@ -641,7 +641,7 @@ if (empty($reshook)) { $mesgs = array(); $object->sujet = (string) GETPOST("sujet"); $object->body = (string) GETPOST("bodyemail", 'restricthtml'); - $object->bgcolor = (string) GETPOST("bgcolor"); + $object->bgcolor = preg_replace('/^#/', '', (string) GETPOST("bgcolor")); $object->bgimage = (string) GETPOST("bgimage"); if (!$object->sujet) { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 8800d5a59fc..e1356fb5dec 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -825,11 +825,11 @@ class FormOther /** * Output a HTML code to select a color. Field will return an hexa color like '334455'. * - * @param string $set_color Pre-selected color + * @param string $set_color Pre-selected color with format '#......' * @param string $prefix Name of HTML field * @param string $form_name Deprecated. Not used. * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code - * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @param array $arrayofcolors Array of possible colors to choose in the selector. All colors are possible if empty. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @param string $morecss Add css style into input field * @param string $setpropertyonselect Set this property after selecting a color * @param string $default Default color @@ -917,7 +917,8 @@ class FormOther '; $out .= ''; } else { - $out .= ''; + $color = ($set_color !== '' ? $set_color : ($default !== '' ? $default : 'FFFFFF')); + $out .= ''; $out .= ''; print "\n"; $s .= '
'.$langs->trans("VATIntraCheck").''; @@ -1957,7 +1968,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } $modCodeClient = new $module($db); - // We verified if the tag prefix is used + // We check if the prefix tag is used if ($modCodeClient->code_auto) { $prefixCustomerIsUsed = $modCodeClient->verif_prefixIsUsed(); } @@ -1973,7 +1984,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } $modCodeFournisseur = new $module($db); - // On verifie si la balise prefix est utilisee + // We check if the prefix tag is used if ($modCodeFournisseur->code_auto) { $prefixSupplierIsUsed = $modCodeFournisseur->verif_prefixIsUsed(); } @@ -2500,7 +2511,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; print ''; print "\n"; @@ -2968,7 +2983,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; print ''; print "\n"; @@ -3339,3 +3358,47 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // End of page llxFooter(); $db->close(); + +?> + + From e3106915d379c40d389e21b1b9edd56016da0165 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Sep 2023 00:47:28 +0300 Subject: [PATCH 0902/1137] Update companies.lang --- htdocs/langs/en_US/companies.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 871d9a72809..ebf390741c3 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -510,3 +510,4 @@ ShowSocialNetworks=Show social networks HideSocialNetworks=Hide social networks ExternalSystemID=External system ID IDOfPaymentInAnExternalSystem=ID of the payment mode into an external system (like Stripe, Paypal, ...) +AADEWebserviceCredentials=AADE Webservice Credentials From ad323a6de8f5127baeee3df8006889e7cf189368 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Sep 2023 01:02:35 +0300 Subject: [PATCH 0903/1137] Update company.php --- htdocs/admin/company.php | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index a0c935413f3..e0c3b470344 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -6,6 +6,7 @@ * Copyright (C) 2011-2017 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht + * Copyright (C) 2023 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -233,6 +234,14 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2", 'aZ09'), 'chaine', 0, '', $conf->entity); } + // Credentials for AADE webservices, applicable only for Greece + if ($mysoc->country_code == 'GR') { + dolibarr_set_const($db, "MYDATA_AADE_USER", GETPOST("MYDATA_AADE_USER", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MYDATA_AADE_KEY", GETPOST("MYDATA_AADE_KEY", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "AADE_WEBSERVICE_USER", GETPOST("AADE_WEBSERVICE_USER", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "AADE_WEBSERVICE_KEY", GETPOST("AADE_WEBSERVICE_KEY", 'alpha'), 'chaine', 0, '', $conf->entity); + } + // Remove constant MAIN_INFO_SOCIETE_SETUP_TODO_WARNING dolibarr_del_const($db, "MAIN_INFO_SOCIETE_SETUP_TODO_WARNING", $conf->entity); @@ -847,6 +856,41 @@ if ($mysoc->useRevenueStamp()) { print ""; +// AADE webservices credentials, applicable only for Greece +if ($mysoc->country_code == 'GR') { + print load_fiche_titre($langs->trans("AADEKeys"), '', ''); + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + print ''; + + print ''; + + print ''; + + print ''; + + print '
'; + + print "
'.$langs->trans("AccountParameter").''.$langs->trans("Value").'
'; + print ''.$langs->trans("MYDATA_AADE_USER").''; + print '
'; + print ''.$langs->trans("MYDATA_AADE_KEY").''; + print 'global->MYDATA_AADE_KEY.'"'; + print '
'; + print ''.$langs->trans("AADE_WEBSERVICE_USER").''; + print '
'; + print ''.$langs->trans("AADE_WEBSERVICE_KEY").''; + print '
"; +} + print $form->buttonsSaveCancel("Save", ''); print ''; From b77e20b6bfb6cabd64d8a489da97595210f4c137 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Sep 2023 01:05:49 +0300 Subject: [PATCH 0904/1137] Request VAT details from the Greek Ministry of Finance GSIS SOAP web service --- htdocs/societe/checkvat/checkVatGr.php | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 htdocs/societe/checkvat/checkVatGr.php diff --git a/htdocs/societe/checkvat/checkVatGr.php b/htdocs/societe/checkvat/checkVatGr.php new file mode 100644 index 00000000000..9018081cf68 --- /dev/null +++ b/htdocs/societe/checkvat/checkVatGr.php @@ -0,0 +1,54 @@ +. + */ + +/** + * \file htdocs/societe/checkvat/checkVatGr.php + * \ingroup societe + * \brief Request VAT details from the Greek Ministry of Finance GSIS SOAP web service + */ + +$username = (isset($_REQUEST['u']) ? $_REQUEST['u'] : ''); // Get username from request +$password = (isset($_REQUEST['p']) ? $_REQUEST['p'] : ''); // Get password from request +$myafm = (isset($_REQUEST['myafm']) ? $_REQUEST['myafm'] : ''); // Get Vat from request +$afm = (isset($_REQUEST['afm']) ? $_REQUEST['afm'] : ''); // Get client Vat from request + +// Make call to check VAT for Greek client +$result = checkVATGR($username, $password, $myafm, $afm); + +echo json_encode($result); // Encode the result as JSON and output + +// Function to check VAT +function checkVATGR($username, $password, $AFMcalledby = '', $AFMcalledfor) +{ + $client = new SoapClient("https://www1.gsis.gr/webtax2/wsgsis/RgWsPublic/RgWsPublicPort?WSDL", array('trace' => true)); + $authHeader = new stdClass(); + $authHeader->UsernameToken = new stdClass(); + $authHeader->UsernameToken->Username = "$username"; + $authHeader->UsernameToken->Password = "$password"; + $Headers[] = new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $authHeader, true); + $client->__setSoapHeaders($Headers); + $result = $client->rgWsPublicAfmMethod( + array( + 'afmCalledBy' => "$AFMcalledby", + 'afmCalledFor' => "$AFMcalledfor", + ) + ); + + return $result; +} From f9e3c2873c150f761ab53ff2711b04771374ef11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Sep 2023 09:43:08 +0200 Subject: [PATCH 0905/1137] Typo trans --- htdocs/langs/en_US/accountancy.lang | 6 +++--- htdocs/langs/en_US/admin.lang | 18 +++++++++--------- htdocs/langs/en_US/companies.lang | 4 ++-- htdocs/langs/en_US/datapolicy.lang | 2 +- htdocs/langs/en_US/donations.lang | 2 +- htdocs/langs/en_US/errors.lang | 6 +++--- htdocs/langs/en_US/main.lang | 4 ++-- htdocs/langs/en_US/members.lang | 2 +- htdocs/langs/en_US/partnership.lang | 2 +- htdocs/langs/en_US/stripe.lang | 2 +- htdocs/langs/en_US/ticket.lang | 12 ++++++------ htdocs/langs/en_US/workflow.lang | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 66c614c0fda..7f73160e7d8 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -16,8 +16,8 @@ ThisService=This service ThisProduct=This product DefaultForService=Default for services DefaultForProduct=Default for products -ProductForThisThirdparty=Product for this thirdparty -ServiceForThisThirdparty=Service for this thirdparty +ProductForThisThirdparty=Product for this third party +ServiceForThisThirdparty=Service for this third party CantSuggest=Can't suggest AccountancySetupDoneFromAccountancyMenu=Most setup of the accountancy is done from the menu %s ConfigAccountingExpert=Configuration of the module accounting (double entry) @@ -420,7 +420,7 @@ SaleLocal=Local sale SaleExport=Export sale SaleEEC=Sale in EEC SaleEECWithVAT=Sale in EEC with a VAT not null, so we suppose this is NOT an intracommunautary sale and the suggested account is the standard product account. -SaleEECWithoutVATNumber=Sale in EEC with no VAT but the VAT ID of thirdparty is not defined. We fall back on the account for standard sales. You can fix the VAT ID of the thirdparty, or change the product account suggested for binding if needed. +SaleEECWithoutVATNumber=Sale in EEC with no VAT but the VAT ID of third party is not defined. We fall back on the account for standard sales. You can fix the VAT ID of the third party, or change the product account suggested for binding if needed. ForbiddenTransactionAlreadyExported=Forbidden: The transaction has been validated and/or exported. ForbiddenTransactionAlreadyValidated=Forbidden: The transaction has been validated. ## Dictionary diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6d767bf4a3d..9e7c703f528 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2150,7 +2150,7 @@ EmailCollectorExampleToCollectAnswersFromExternalEmailSoftwareDesc=Scan your mai EmailCollectorExampleToCollectAnswersFromExternalEmailSoftware=Example collecting e-mail answers sent from an external e-mail software EmailCollectorExampleToCollectDolibarrAnswersDesc=Collect all emails that are an answer of an email sent from your application. An event (Module Agenda must be enabled) with the email response will be recorded at the good place. For example, if you send a commercial proposal, order, invoice or message for a ticket by email from the application, and the recipient answers your email, the system will automatically catch the answer and add it into your ERP. EmailCollectorExampleToCollectDolibarrAnswers=Example collecting all ingoing messages being answers to messages sent from Dolibarr' -EmailCollectorExampleToCollectLeadsDesc=Collect emails that match some rules and create automatically a lead (Module Project must be enabled) with the email informations. You can use this collector if you want to follow your lead using the module Project (1 lead = 1 project), so your leads will be automatically generated. If the collector Collect_Responses is also enabled, when you send an email from your leads, proposals or any other object, you may also see answers of your customers or partners directly on the application.
Note: With this initial example, the title of the lead is generated including the email. If the thirdparty can't be found in database (new customer), the lead will be attached to the thirdparty with ID 1. +EmailCollectorExampleToCollectLeadsDesc=Collect emails that match some rules and create automatically a lead (Module Project must be enabled) with the email informations. You can use this collector if you want to follow your lead using the module Project (1 lead = 1 project), so your leads will be automatically generated. If the collector Collect_Responses is also enabled, when you send an email from your leads, proposals or any other object, you may also see answers of your customers or partners directly on the application.
Note: With this initial example, the title of the lead is generated including the email. If the third party can't be found in database (new customer), the lead will be attached to the third party with ID 1. EmailCollectorExampleToCollectLeads=Example collecting leads EmailCollectorExampleToCollectJobCandidaturesDesc=Collect emails applying to job offers (Module Recruitment must be enabled). You can complete this collector if you want to automatically create a candidature for a job request. Note: With this initial example, the title of the candidature is generated including the email. EmailCollectorExampleToCollectJobCandidatures=Example collecting job candidatures received by e-mail @@ -2192,7 +2192,7 @@ Protanopia=Protanopia Deuteranopes=Deuteranopes Tritanopes=Tritanopes ThisValueCanOverwrittenOnUserLevel=This value can be overwritten by each user from its user page - tab '%s' -DefaultCustomerType=Default thirdparty type for "New customer" creation form +DefaultCustomerType=Default third-party type for "New customer" creation form ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working. RootCategoryForProductsToSell=Root category of products to sell RootCategoryForProductsToSellDesc=If defined, only products inside this category or childs of this category will be available in the Point Of Sale @@ -2217,9 +2217,9 @@ InstanceUniqueID=Unique ID of the instance SmallerThan=Smaller than LargerThan=Larger than IfTrackingIDFoundEventWillBeLinked=Note that If a tracking ID of an object is found into email, or if the email is an answer of an email aready collected and linked to an object, the created event will be automatically linked to the known related object. -WithGMailYouCanCreateADedicatedPassword=With a GMail account, if you enabled the 2 steps validation, it is recommanded to create a dedicated second password for the application instead of using your own account passsword from https://myaccount.google.com/. +WithGMailYouCanCreateADedicatedPassword=With a GMail account, if you enabled the 2 steps validation, it is recommended to create a dedicated second password for the application instead of using your own account password from https://myaccount.google.com/. EmailCollectorTargetDir=It may be a desired behaviour to move the email into another tag/directory when it was processed successfully. Just set name of directory here to use this feature (Do NOT use special characters in name). Note that you must also use a read/write login account. -EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database (search will be done on the defined property among 'id','name','name_alias','email'). The found (or created) thirdparty will be used for following actions that need it.
For example, if you want to create a thirdparty with a name extracted from a string 'Name: name to find' present into the body, use the sender email as email, you can set the parameter field like this:
'email=HEADER:^From:(.*);name=EXTRACT:BODY:Name:\\s([^\\s]*);client=SET:2;'
+EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing third party in your database (search will be done on the defined property among 'id','name','name_alias','email'). The found (or created) third party will be used for following actions that need it.
For example, if you want to create a third party with a name extracted from a string 'Name: name to find' present into the body, use the sender email as email, you can set the parameter field like this:
'email=HEADER:^From:(.*);name=EXTRACT:BODY:Name:\\s([^\\s]*);client=SET:2;'
FilterSearchImapHelp=Warning: a lot of email servers (like Gmail) are doing full word searches when searching on a string and will not return a result if the string is only found partially into a word. For this reason too, use special characters into a search criteria will be ignored are they are not part of existing words.
To make an exclude search on a word (return email if word is not found), you can use the ! character before the word (may not work on some mail servers). EndPointFor=End point for %s : %s DeleteEmailCollector=Delete email collector @@ -2236,9 +2236,9 @@ EmailTemplate=Template for email EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax PDF_SHOW_PROJECT=Show project on document ShowProjectLabel=Project Label -PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME=Include alias in thirdparty name -THIRDPARTY_ALIAS=Name thirdparty - Alias thirdparty -ALIAS_THIRDPARTY=Alias thirdparty - Name thirdparty +PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME=Include alias in third-party name +THIRDPARTY_ALIAS=Third-party name - Third-party alias +ALIAS_THIRDPARTY=Third-party alias - Third-party name PDFIn2Languages=Show labels in the PDF in 2 different languages (this feature may not work for some couple of languages) PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF. PDF_USE_A=Gererate PDF documents with format PDF/A instead of defaut format PDF @@ -2360,7 +2360,7 @@ DoesNotWorkWithAllThemes=Will not work with all themes NoName=No name ShowAdvancedOptions= Show advanced options HideAdvancedoptions= Hide advanced options -CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a thirdparty or contact from its phone number. URL to use is: +CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a third party or contact from its phone number. URL to use is: OauthNotAvailableForAllAndHadToBeCreatedBefore=OAUTH2 authentication is not available for all hosts, and a token with the right permissions must have been created upstream with the OAUTH module MAIN_MAIL_SMTPS_OAUTH_SERVICE=OAUTH2 authentication service DontForgetCreateTokenOauthMod=A token with the right permissions must have been created upstream with the OAUTH module @@ -2370,7 +2370,7 @@ UseOauth=Use a OAUTH token Images=Images MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form MaxNumberOfPostOnPublicPagesByIP=Max number of posts on public pages with the same IP address in a month -CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a thirdparty or contact from its phone number. URL to use is: +CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a third party or contact from its phone number. URL to use is: ScriptIsEmpty=The script is empty ShowHideTheNRequests=Show/hide the %s SQL request(s) DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into %s diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 871d9a72809..37f073a2501 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -48,7 +48,7 @@ ParentCompany=Parent company Subsidiaries=Subsidiaries ReportByMonth=Report per month ReportByCustomers=Report per customer -ReportByThirdparties=Report per thirdparty +ReportByThirdparties=Report per third party ReportByQuarter=Report per rate CivilityCode=Civility code RegisteredOffice=Registered office @@ -502,7 +502,7 @@ InEEC=Europe (EEC) RestOfEurope=Rest of Europe (EEC) OutOfEurope=Out of Europe (EEC) CurrentOutstandingBillLate=Current outstanding bill late -BecarefullChangeThirdpartyBeforeAddProductToInvoice=Be carefull, depending on your product price settings, you should change thirdparty before adding product to POS. +BecarefullChangeThirdpartyBeforeAddProductToInvoice=Be carefull, depending on your product price settings, you should change the third party before adding product to POS. EmailAlreadyExistsPleaseRewriteYourCompanyName=email already exists please rewrite your company name TwoRecordsOfCompanyName=more than one record exists for this company, please contact us to complete your partnership request CompanySection=Company section diff --git a/htdocs/langs/en_US/datapolicy.lang b/htdocs/langs/en_US/datapolicy.lang index a870c3499a6..fae7573b14a 100644 --- a/htdocs/langs/en_US/datapolicy.lang +++ b/htdocs/langs/en_US/datapolicy.lang @@ -63,7 +63,7 @@ DATAPOLICY_opposition_prospection = Opposes the processing of his personal data # # Popup # -DATAPOLICY_POPUP_ANONYME_TITLE = Anonymize a thirdparty +DATAPOLICY_POPUP_ANONYME_TITLE = Anonymize a third party DATAPOLICY_POPUP_ANONYME_TEXTE = You can not delete this contact from Dolibarr because there are related items. In accordance with the GDPR, you will make all this data anonymous to respect your obligations. Would you like to continue ? # diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index 7661e9e1051..d5a25a771bb 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -32,4 +32,4 @@ DONATION_ART238=Show article 238 from CGI if you are concerned DONATION_ART978=Show article 978 from CGI if you are concerned DonationPayment=Donation payment DonationValidated=Donation %s validated -DonationUseThirdparties=Use an existing thirdparty as coordinates of donators +DonationUseThirdparties=Use an existing third party as coordinates of donors diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index c7d1e055617..289134f501f 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -132,7 +132,7 @@ ErrorLoginDoesNotExists=User with login %s could not be found. ErrorLoginHasNoEmail=This user has no email address. Process aborted. ErrorBadValueForCode=Bad value for security code. Try again with new value... ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative -ErrorFieldCantBeNegativeOnInvoice=Field %s cannot be negative on this type of invoice. If you need to add a discount line, just create the discount first (from field '%s' in thirdparty card) and apply it to the invoice. +ErrorFieldCantBeNegativeOnInvoice=Field %s cannot be negative on this type of invoice. If you need to add a discount line, just create the discount first (from field '%s' in third-party card) and apply it to the invoice. ErrorLinesCantBeNegativeForOneVATRate=Total of lines (net of tax) can't be negative for a given not null VAT rate (Found a negative total for VAT rate %s%%). ErrorLinesCantBeNegativeOnDeposits=Lines can't be negative in a deposit. You will face problems when you will need to consume the deposit in final invoice if you do so. ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative @@ -297,9 +297,9 @@ ErrorAjaxRequestFailed=Request failed ErrorThirpdartyOrMemberidIsMandatory=Third party or Member of partnership is mandatory ErrorFailedToWriteInTempDirectory=Failed to write in temp directory ErrorQuantityIsLimitedTo=Quantity is limited to %s -ErrorFailedToLoadThirdParty=Failed to find/load thirdparty from id=%s, email=%s, name=%s +ErrorFailedToLoadThirdParty=Failed to find/load third party from id=%s, email=%s, name=%s ErrorThisPaymentModeIsNotSepa=This payment mode is not a bank account -ErrorStripeCustomerNotFoundCreateFirst=Stripe customer is not set for this thirdparty (or set to a value deleted on Stripe side). Create (or re-attach) it first. +ErrorStripeCustomerNotFoundCreateFirst=Stripe customer is not set for this third party (or set to a value deleted on Stripe side). Create (or re-attach) it first. ErrorCharPlusNotSupportedByImapForSearch=IMAP search is not able to search into sender or recipient for a string containing the character + ErrorTableNotFound=Table %s not found ErrorValueForTooLow=Value for %s is too low diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index c25b445b2d8..42972e2fb75 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1123,7 +1123,7 @@ ContactDefault_project_task=Task ContactDefault_propal=Proposal ContactDefault_supplier_proposal=Supplier Proposal ContactDefault_ticket=Ticket -ContactAddedAutomatically=Contact added from contact thirdparty roles +ContactAddedAutomatically=Contact added from contact third-party roles More=More ShowDetails=Show details CustomReports=Custom reports @@ -1222,7 +1222,7 @@ UserAgent=User Agent InternalUser=Internal user ExternalUser=External user NoSpecificContactAddress=No specific contact or address -NoSpecificContactAddressBis=This tab is dedicated to force specific contacts or addresses for the current object. Use it only if you want to define one or several specific contacts or addresses for the object when the information on the thirdparty is not enough or not accurate. +NoSpecificContactAddressBis=This tab is dedicated to force specific contacts or addresses for the current object. Use it only if you want to define one or several specific contacts or addresses for the object when the information on the third party is not enough or not accurate. HideOnVCard=Hide %s AddToContacts=Add address to my contacts LastAccess=Last access diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index cc063bee7cc..277081d7ef3 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -236,7 +236,7 @@ XMembersClosed=%s member(s) closed XExternalUserCreated=%s external user(s) created ForceMemberNature=Force member nature (Individual or Corporation) CreateDolibarrLoginDesc=The creation of a user login for members allows them to connect to the application. Depending on the authorizations granted, they will be able, for example, to consult or modify their file themselves. -CreateDolibarrThirdPartyDesc=A thirdparty is the legal entity that will be used on the invoice if you decide to generate invoice for each contribution. You will be able to create it later during the process of recording the contribution. +CreateDolibarrThirdPartyDesc=A third party is the legal entity that will be used on the invoice if you decide to generate invoice for each contribution. You will be able to create it later during the process of recording the contribution. MemberFirstname=Member firstname MemberLastname=Member lastname MemberCodeDesc=Member Code, unique for all members diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang index 31e2f5000bb..93e3c421c0c 100644 --- a/htdocs/langs/en_US/partnership.lang +++ b/htdocs/langs/en_US/partnership.lang @@ -38,7 +38,7 @@ ListOfPartnerships=List of partnership PartnershipSetup=Partnership setup PartnershipAbout=About Partnership PartnershipAboutPage=Partnership about page -partnershipforthirdpartyormember=Partner status must be set on a 'thirdparty' or a 'member' +partnershipforthirdpartyormember=Partner status must be set on a 'third party' or a 'member' PARTNERSHIP_IS_MANAGED_FOR=Partnership managed for PARTNERSHIP_BACKLINKS_TO_CHECK=Backlinks to check PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancelling status of a partnership when a subscription has expired diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index 1b1bdac3664..0beab57f2e3 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -71,7 +71,7 @@ ToOfferALinkForTestWebhook=Link to setup Stripe WebHook to call the IPN (test mo ToOfferALinkForLiveWebhook=Link to setup Stripe WebHook to call the IPN (live mode) PaymentWillBeRecordedForNextPeriod=Payment will be recorded for the next period. ClickHereToTryAgain=Click here to try again... -CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s +CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe back office. You can click here to switch on Stripe customer record: %s STRIPE_CARD_PRESENT=Card Present for Stripe Terminals TERMINAL_LOCATION=Location (address) for Stripe Terminals RequestDirectDebitWithStripe=Request Direct Debit with Stripe diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index a9960cc3deb..ae5e96bb661 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -94,7 +94,7 @@ TicketSetupDictionaries=The type of ticket, severity and analytic codes are conf TicketParamModule=Module variable setup TicketParamMail=Email setup TicketEmailNotificationFrom=Sender e-mail for notification on answers -TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification email when an answer is provided inside the backoffice. For example noreply@example.com +TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification email when an answer is provided inside the back office. For example noreply@example.com TicketEmailNotificationTo=Notify ticket creation to this e-mail address TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation TicketNewEmailBodyLabel=Text message sent after creating a ticket @@ -105,7 +105,7 @@ TicketsEmailMustExistHelp=In the public interface, the email address should alre TicketsShowProgression=Display the ticket progress in the public interface TicketsShowProgressionHelp=Enable this option to hide the progress of the ticket in the public interface pages TicketCreateThirdPartyWithContactIfNotExist=Ask name and company name for unknown emails. -TicketCreateThirdPartyWithContactIfNotExistHelp=Check if a thirdparty or a contact exists for the email entered. If not, ask a name and a company name to create a third party with contact. +TicketCreateThirdPartyWithContactIfNotExistHelp=Check if a third party or a contact exists for the email entered. If not, ask a name and a company name to create a third party with contact. PublicInterface=Public interface TicketUrlPublicInterfaceLabelAdmin=Alternative URL for public interface TicketUrlPublicInterfaceHelpAdmin=It is possible to define an alias to the web server and thus make available the public interface with another URL (the server must act as a proxy on this new URL) @@ -145,14 +145,14 @@ TicketsPublicNotificationNewMessage=Send email(s) when a new message/comment is TicketsPublicNotificationNewMessageHelp=Send email(s) when a new message is added from public interface (to assigned user or the notifications email to (update) and/or the notifications email to) TicketPublicNotificationNewMessageDefaultEmail=Notifications email to (update) TicketPublicNotificationNewMessageDefaultEmailHelp=Send an email to this address for each new message notifications if the ticket doesn't have a user assigned to it or if the user doesn't have any known email. -TicketsAutoReadTicket=Automatically mark the ticket as read (when created from backoffice) -TicketsAutoReadTicketHelp=Automatically mark the ticket as read when created from backoffice. When ticket is create from the public interface, ticket remains with the status "Not Read". +TicketsAutoReadTicket=Automatically mark the ticket as read (when created from back office) +TicketsAutoReadTicketHelp=Automatically mark the ticket as read when created from back office. When ticket is create from the public interface, ticket remains with the status "Not Read". TicketsDelayBeforeFirstAnswer=A new ticket should receive a first answer before (hours): TicketsDelayBeforeFirstAnswerHelp=If a new ticket has not received an answer after this time period (in hours), an important warning icon will be displayed in the list view. TicketsDelayBetweenAnswers=An unresolved ticket should not be unactive during (hours): TicketsDelayBetweenAnswersHelp=If an unresolved ticket that has already received an answer has not had further interaction after this time period (in hours), a warning icon will be displayed in the list view. -TicketsAutoNotifyClose=Automatically notify thirdparty when closing a ticket -TicketsAutoNotifyCloseHelp=When closing a ticket, you will be proposed to send a message to one of thirdparty's contacts. On mass closing, a message will be sent to one contact of the thirdparty linked to the ticket. +TicketsAutoNotifyClose=Automatically notify the third party when closing a ticket +TicketsAutoNotifyCloseHelp=When closing a ticket, you will be proposed to send a message to one of third-party contacts. On mass closing, a message will be sent to one contact of the third party linked to the ticket. TicketWrongContact=Provided contact is not part of current ticket contacts. Email not sent. TicketChooseProductCategory=Product category for ticket support TicketChooseProductCategoryHelp=Select the product category of ticket support. This will be used to automatically link a contract to a ticket. diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index bc9d4b6fa8e..870ebeabf40 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -28,7 +28,7 @@ descWORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE=Classify linked source shipment as descWORKFLOW_RECEPTION_CLASSIFY_CLOSED_INVOICE=Classify linked source receptions as billed when a purchase invoice is validated (and if the amount of the invoice is the same as the total amount of the linked receptions) descWORKFLOW_RECEPTION_CLASSIFY_BILLED_INVOICE=Classify linked source receptions as billed when a purchase invoice is validated (and if the amount of the invoice is the same as the total amount of the linked receptions) # Automatically link ticket to contract -descWORKFLOW_TICKET_LINK_CONTRACT=When creating a ticket, link available contracts of matching thirdparty +descWORKFLOW_TICKET_LINK_CONTRACT=When creating a ticket, link all available contracts of matching third parties descWORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS=When linking contracts, search among those of parents companies # Autoclose intervention descWORKFLOW_TICKET_CLOSE_INTERVENTION=Close all interventions linked to the ticket when a ticket is closed From 84c742a6887f653a15b11d78ea6ed4903c535f3b Mon Sep 17 00:00:00 2001 From: Florent Poinsaut Date: Fri, 8 Sep 2023 16:53:49 +0200 Subject: [PATCH 0906/1137] add ORDER_SUPPLIER_SUBMIT notif --- htdocs/core/class/notify.class.php | 13 +++++++++++-- htdocs/fourn/commande/card.php | 6 ++++++ htdocs/langs/en_US/other.lang | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 74287b1bd0b..395d4950e2f 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -77,6 +77,7 @@ class Notify 'FICHINTER_ADD_CONTACT', 'ORDER_SUPPLIER_VALIDATE', 'ORDER_SUPPLIER_APPROVE', + 'ORDER_SUPPLIER_SUBMIT', 'ORDER_SUPPLIER_REFUSE', 'SHIPPING_VALIDATE', 'EXPENSE_REPORT_VALIDATE', @@ -561,6 +562,14 @@ class Notify $mesg .= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($outputlangs)); $mesg .= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; break; + case 'ORDER_SUPPLIER_SUBMIT': + $link = ''.$newref.''; + $dir_output = $conf->fournisseur->commande->dir_output; + $object_type = 'order_supplier'; + $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; + $mesg .= $outputlangs->transnoentitiesnoconv("EMailTextSupplierOrderSubmittedBy", $link, $user->getFullName($outputlangs)); + $mesg .= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n"; + break; case 'ORDER_SUPPLIER_REFUSE': $link = ''.$newref.''; $dir_output = $conf->fournisseur->commande->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object); @@ -829,12 +838,12 @@ class Notify $mesg .= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($langs)); $mesg .= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; break; - case 'ORDER_SUPPLIER_APPROVE2': + case 'ORDER_SUPPLIER_SUBMIT': $link = ''.$newref.''; $dir_output = $conf->fournisseur->commande->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object); $object_type = 'order_supplier'; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg .= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($langs)); + $mesg .= $langs->transnoentitiesnoconv("EMailTextSupplierOrderSubmittedBy", $link, $user->getFullName($langs)); $mesg .= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; break; case 'ORDER_SUPPLIER_REFUSE': diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index fca9363df25..890c9c21f9e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2011,6 +2011,12 @@ if ($action == 'create') { // Confirmation de l'envoi de la commande if ($action == 'commande') { $date_com = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); + if (!empty($conf->notification->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; + $notify = new Notify($db); + $text .= '
'; + $text .= $notify->confirmMessage('ORDER_SUPPLIER_SUBMIT', $object->socid, $object); + } $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".GETPOST("methodecommande")."&comment=".urlencode(GETPOST("comment")), $langs->trans("MakeOrder"), $langs->trans("ConfirmMakeOrder", dol_print_date($date_com, 'day')), "confirm_commande", '', 0, 2); } diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index e3927bd7a72..bb1b54a250b 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -45,6 +45,7 @@ Notify_ORDER_CLOSE=Sales order delivered Notify_ORDER_SUPPLIER_SENTBYMAIL=Purchase order sent by email Notify_ORDER_SUPPLIER_VALIDATE=Purchase order recorded Notify_ORDER_SUPPLIER_APPROVE=Purchase order approved +Notify_ORDER_SUPPLIER_SUBMIT=Purchase order submitted Notify_ORDER_SUPPLIER_REFUSE=Purchase order refused Notify_PROPAL_VALIDATE=Customer proposal validated Notify_PROPAL_CLOSE_SIGNED=Customer proposal closed signed @@ -210,6 +211,8 @@ EMailTextOrderClose=Order %s has been delivered. EMailTextOrderApproved=Order %s has been approved. EMailTextOrderValidatedBy=Order %s has been recorded by %s. EMailTextOrderApprovedBy=Order %s has been approved by %s. +EMailTextSupplierOrderSubmit=Order %s has been submitted. +EMailTextSupplierOrderSubmitBy=Order %s has been submitted by %s. EMailTextOrderRefused=Order %s has been refused. EMailTextOrderRefusedBy=Order %s has been refused by %s. EMailTextExpeditionValidated=Shipping %s has been validated. From ff8f4dda9f3b7a7028f950f73f2be92210b49324 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Sep 2023 12:25:57 +0300 Subject: [PATCH 0907/1137] Fix exported .csv translation --- htdocs/compta/accounting-files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index ed1f66a95b8..e4a6c5872e5 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -526,7 +526,7 @@ if ($result && $action == "dl" && !$error) { } } - $log .= '"'.$langs->trans($file['item']).'"'; + $log .= '"'.$langs->transnoentitiesnoconv($file['item']).'"'; if (isModEnabled('multicompany') && is_object($mc)) { $log .= ',"'.(empty($arrayofentities[$file['entity']]) ? $file['entity'] : $arrayofentities[$file['entity']]).'"'; } From 98388e3bd4bcee238c523851643f4fe9b960d0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 12 Sep 2023 12:28:53 +0200 Subject: [PATCH 0908/1137] phpstan --- .../mymodule/mod_myobject_advanced.php | 33 ++++++++++--------- .../mymodule/mod_myobject_standard.php | 6 ++-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index a31a63f0b14..967192deaab 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -54,22 +54,23 @@ class mod_myobject_advanced extends ModeleNumRefMyObject /** * Returns the description of the numbering model * - * @return string Descriptive text + * @param Translate $langs Translate Object + * @return string Text with description */ - public function info() + public function info($langs) { - global $conf, $langs, $db; + global $db; $langs->load("bills"); $form = new Form($db); - $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; - $texte .= '
'; - $texte .= ''; - $texte .= ''; - $texte .= ''; - $texte .= ''; + $text = $langs->trans('GenericNumRefModelDesc')."
\n"; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= '
'; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject")); $tooltip .= $langs->trans("GenericMaskCodes2"); @@ -78,15 +79,15 @@ class mod_myobject_advanced extends ModeleNumRefMyObject $tooltip .= $langs->trans("GenericMaskCodes5"); // Parametrage du prefix - $texte .= ''; - $texte .= ''; - $texte .= ''; - $texte .= ''; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= ''; - $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).' 
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).' 
'; - $texte .= '
'; + $text .= ''; + $text .= ''; - return $texte; + return $text; } /** diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php index f21ffe880d0..22877a3fd0e 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php @@ -52,11 +52,11 @@ class mod_myobject_standard extends ModeleNumRefMyObject /** * Return description of numbering module * - * @return string Text with description + * @param Translate $langs Translate Object + * @return string Text with description */ - public function info() + public function info($langs) { - global $langs; return $langs->trans("SimpleNumRefModelDesc", $this->prefix); } From 363ac9f926ab81aea6f82a2e3225b9ed95d329c9 Mon Sep 17 00:00:00 2001 From: atm-thibaultf Date: Tue, 12 Sep 2023 13:07:21 +0200 Subject: [PATCH 0909/1137] NEW CONF allow modify ticket classification even if closed --- htdocs/admin/ticket.php | 15 +++++++++++++++ htdocs/langs/en_US/ticket.lang | 2 ++ htdocs/langs/fr_FR/ticket.lang | 2 ++ htdocs/ticket/card.php | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 0d54c63af0e..03a7d5bb02d 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -600,6 +600,21 @@ print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBetweenAnswers print ''; print ''; +//Allow classification modification even if the ticket is closed +print ''.$langs->trans("TicketsAllowClassificationModificationIfClosed").''; +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKET_ALLOW_CLASSIFICATION_MODIFICATION_EVEN_IF_CLOSED'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $formcategory->selectarray("TICKET_ALLOW_CLASSIFICATION_MODIFICATION_EVEN_IF_CLOSED", $arrval, getDolGlobalString('TICKET_ALLOW_CLASSIFICATION_MODIFICATION_EVEN_IF_CLOSED')); +} +print ''; +print ''; +print $formcategory->textwithpicto('', $langs->trans("TicketsAllowClassificationModificationIfClosedHelp"), 1, 'help'); +print ''; +print ''; + print '
'; print $formcategory->buttonsSaveCancel("Save", '', array(), 0, 'reposition'); diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index ae5e96bb661..194dedf1f32 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -158,6 +158,8 @@ TicketChooseProductCategory=Product category for ticket support TicketChooseProductCategoryHelp=Select the product category of ticket support. This will be used to automatically link a contract to a ticket. TicketUseCaptchaCode=Use graphical code (CAPTCHA) when creating a ticket TicketUseCaptchaCodeHelp=Adds CAPTCHA verification when creating a new ticket. +TicketsAllowClassificationModificationIfClosed=Allow to modify classification of a closed ticket +TicketsAllowClassificationModificationIfClosed=Allow to modify classification (type, ticket group, severity) even if tickets are closed. # # Index & list page diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index 6e849456452..7a81691bdd9 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -158,6 +158,8 @@ TicketChooseProductCategory=Catégorie de produit pour les tickets TicketChooseProductCategoryHelp=Sélectionnez la catégorie de produit du support de ticket. Celui-ci sera utilisé pour lier automatiquement un contrat à un ticket. TicketUseCaptchaCode=Utiliser le code graphique (CAPTCHA) lors de la création d'un ticket TicketUseCaptchaCodeHelp=Ajoute la vérification CAPTCHA lors de la création d'un nouveau ticket. +TicketsAllowClassificationModificationIfClosed=Permettre la modification de la classification des tickets résolus. +TicketsAllowClassificationModificationIfClosed=Permettre la modification de la classification (type, groupe de ticket et sévérité) même si les tickets sont résolus. # # Index & list page diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 09473a8c617..1af7f382d30 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1245,7 +1245,7 @@ if ($action == 'create' || $action == 'presend') { print ''; } else { // Button to edit Properties - if (isset($object->status) && $object->status < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) { + if (isset($object->status) && ($object->status < $object::STATUS_NEED_MORE_INFO || !empty($conf->global->TICKET_ALLOW_CLASSIFICATION_MODIFICATION_EVEN_IF_CLOSED)) && $user->rights->ticket->write) { print ' '.img_edit($langs->trans('Modify')).''; } } From 7420d86073ed8c99bc17f5993ec07b93a89d7848 Mon Sep 17 00:00:00 2001 From: atm-thibaultf Date: Tue, 12 Sep 2023 13:15:14 +0200 Subject: [PATCH 0910/1137] Add help tooltip lang --- htdocs/langs/en_US/ticket.lang | 4 ++-- htdocs/langs/fr_FR/ticket.lang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 194dedf1f32..c58930d84f6 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -158,8 +158,8 @@ TicketChooseProductCategory=Product category for ticket support TicketChooseProductCategoryHelp=Select the product category of ticket support. This will be used to automatically link a contract to a ticket. TicketUseCaptchaCode=Use graphical code (CAPTCHA) when creating a ticket TicketUseCaptchaCodeHelp=Adds CAPTCHA verification when creating a new ticket. -TicketsAllowClassificationModificationIfClosed=Allow to modify classification of a closed ticket -TicketsAllowClassificationModificationIfClosed=Allow to modify classification (type, ticket group, severity) even if tickets are closed. +TicketsAllowClassificationModificationIfClosed=Allow to modify classification of closed tickets +TicketsAllowClassificationModificationIfClosedHelp=Allow to modify classification (type, ticket group, severity) even if tickets are closed. # # Index & list page diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index 7a81691bdd9..d90ed87cba8 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -158,8 +158,8 @@ TicketChooseProductCategory=Catégorie de produit pour les tickets TicketChooseProductCategoryHelp=Sélectionnez la catégorie de produit du support de ticket. Celui-ci sera utilisé pour lier automatiquement un contrat à un ticket. TicketUseCaptchaCode=Utiliser le code graphique (CAPTCHA) lors de la création d'un ticket TicketUseCaptchaCodeHelp=Ajoute la vérification CAPTCHA lors de la création d'un nouveau ticket. -TicketsAllowClassificationModificationIfClosed=Permettre la modification de la classification des tickets résolus. -TicketsAllowClassificationModificationIfClosed=Permettre la modification de la classification (type, groupe de ticket et sévérité) même si les tickets sont résolus. +TicketsAllowClassificationModificationIfClosed=Permettre la modification de la classification des tickets résolus +TicketsAllowClassificationModificationIfClosedHelp=Permettre la modification de la classification (type, groupe de ticket et sévérité) même si les tickets sont résolus. # # Index & list page From 553fba65e109f08d4dd78d2cd3f82cc169c69993 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Sep 2023 13:19:48 +0200 Subject: [PATCH 0911/1137] Fix #yogosha17587 --- htdocs/comm/action/rapport/index.php | 10 ++----- htdocs/core/modules/modAgenda.class.php | 40 ++++++++++++------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 987551422e4..4448ee573e1 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -57,13 +57,9 @@ if (!$sortfield) { } // Security check -$socid = GETPOST('socid', 'int'); -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'agenda', 0, '', 'myactions'); -if ($user->socid && $socid) { - $result = restrictedArea($user, 'societe', $socid); +//$result = restrictedArea($user, 'agenda', 0, '', 'myactions'); +if (!$user->hasRight("agenda", "allactions", "read")) { + accessForbidden(); } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 43a7128b1d0..3d451bd93d6 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -214,7 +214,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/index.php', 'langs'=>'agenda', 'position'=>86, - 'perms'=>'$user->rights->agenda->myactions->read || $user->rights->resource->read', + 'perms'=>'$user->hasRight("agenda", "myactions", "read") || $user->hasRight("resource", "read")', 'enabled'=>'isModEnabled("agenda") || isModEnabled("resource")', 'target'=>'', 'user'=>2, @@ -230,7 +230,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', 'position'=>100, - 'perms'=>'$user->rights->agenda->myactions->read', + 'perms'=>'$user->hasRight("agenda", "myactions", "read")', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2, @@ -244,7 +244,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', 'langs'=>'commercial', 'position'=>101, - 'perms'=>'($user->hasRight("agenda", "myactions", "create")||$user->hasRight("agenda", "allactions", "create"))', + 'perms'=>'($user->hasRight("agenda", "myactions", "create") || $user->hasRight("agenda", "allactions", "create"))', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 @@ -259,7 +259,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', 'position'=>140, - 'perms'=>'$user->rights->agenda->myactions->read', + 'perms'=>'$user->hasRight("agenda", "myactions", "read")', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 @@ -273,7 +273,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', 'langs'=>'agenda', 'position'=>141, - 'perms'=>'$user->rights->agenda->myactions->read', + 'perms'=>'$user->hasRight("agenda", "myactions", "read")', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 @@ -287,7 +287,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', 'langs'=>'agenda', 'position'=>142, - 'perms'=>'$user->rights->agenda->myactions->read', + 'perms'=>'$user->hasRight("agenda", "myactions", "read")', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 @@ -301,8 +301,8 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', 'langs'=>'agenda', 'position'=>143, - 'perms'=>'$user->rights->agenda->allactions->read', - 'enabled'=>'$user->rights->agenda->allactions->read', + 'perms'=>'$user->hasRight("agenda", "allactions", "read")', + 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 ); @@ -315,8 +315,8 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', 'langs'=>'agenda', 'position'=>144, - 'perms'=>'$user->rights->agenda->allactions->read', - 'enabled'=>'$user->rights->agenda->allactions->read', + 'perms'=>'$user->hasRight("agenda", "allactions", "read")', + 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 ); @@ -331,7 +331,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', 'position'=>110, - 'perms'=>'$user->rights->agenda->myactions->read', + 'perms'=>'$user->hasRight("agenda", "myactions", "read")', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 @@ -345,7 +345,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', 'langs'=>'agenda', 'position'=>111, - 'perms'=>'$user->rights->agenda->myactions->read', + 'perms'=>'$user->hasRight("agenda", "myactions", "read")', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 @@ -359,7 +359,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', 'langs'=>'agenda', 'position'=>112, - 'perms'=>'$user->rights->agenda->myactions->read', + 'perms'=>'$user->hasRight("agenda", "myactions", "read")', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 @@ -373,8 +373,8 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', 'langs'=>'agenda', 'position'=>113, - 'perms'=>'$user->rights->agenda->allactions->read', - 'enabled'=>'$user->rights->agenda->allactions->read', + 'perms'=>'$user->hasRight("agenda", "allactions", "read")', + 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 ); @@ -387,8 +387,8 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', 'langs'=>'agenda', 'position'=>114, - 'perms'=>'$user->rights->agenda->allactions->read', - 'enabled'=>'$user->rights->agenda->allactions->read', + 'perms'=>'$user->hasRight("agenda", "allactions", "read")', + 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 ); @@ -402,7 +402,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda', 'langs'=>'agenda', 'position'=>160, - 'perms'=>'$user->rights->agenda->allactions->read', + 'perms'=>'$user->hasRight("agenda", "allactions", "read")', 'enabled'=>'isModEnabled("agenda")', 'target'=>'', 'user'=>2 @@ -417,8 +417,8 @@ class modAgenda extends DolibarrModules 'url'=>'/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10', 'langs' => 'agenda', 'position' => 170, - 'perms' => '$user->rights->agenda->allactions->read', - 'enabled' => '$conf->categorie->enabled', + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("categorie")', 'target' => '', 'user' => 2 ); From da699ce3cda437c949c69807403118fa922b08f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Sep 2023 13:29:44 +0200 Subject: [PATCH 0912/1137] Typo --- 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 9e7c703f528..ea00ae32d8a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2411,6 +2411,6 @@ AllowOnLineSign=Allow On Line signature AtBottomOfPage=At bottom of page FailedAuth=failed authentications MaxNumberOfFailedAuth=Max number of failed authentication in 24h to deny login. -AllowPasswordResetBySendingANewPassByEmail=If a user A has this permission, and if the user A is not an "admin" user is allowed to reset the password of any other user B, the new password will be send to the email of the other user B but it won't be visible to A. If the user A has the "admin" flag, he will also be able to know what is the new generated password of B so he will be able to take control of the B user account. +AllowPasswordResetBySendingANewPassByEmail=If a user A has this permission, and even if the user A is not an "admin" user, A is allowed to reset the password of any other user B, the new password will be send to the email of the other user B but it won't be visible to A. If the user A has the "admin" flag, he will also be able to know what is the new generated password of B so he will be able to take control of the B user account. ThisValueCanBeReadBecauseInstanceIsNotInProductionMode=This value can be read because your instance is not set in production mode SeeConfFile=See inside conf.php file on the server \ No newline at end of file From 6fab00eba91c6b2ea3ee8246f627215d1db077f1 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 12 Sep 2023 14:28:05 +0200 Subject: [PATCH 0913/1137] NEW WebPortal SQL --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index d053441d38d..2ba6aee00e1 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -105,3 +105,7 @@ INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PROPOSAL_ALL ALTER TABLE llx_bookcal_availabilities ADD COLUMN fk_bookcal_calendar integer NOT NULL; ALTER TABLE llx_bookcal_calendar ADD COLUMN visibility integer NOT NULL DEFAULT 1; + +-- Update website type +UPDATE llx_societe_account SET site = 'dolibarr_website' WHERE fk_website > 0 AND site IS NULL; +ALTER TABLE llx_societe_account MODIFY COLUMN site varchar(128) NOT NULL; From f40cc4658f61c192cfc53a17fb04de05b1bd5081 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 12 Sep 2023 14:46:44 +0200 Subject: [PATCH 0914/1137] Fix PHP CS --- htdocs/core/lib/company.lib.php | 2 +- htdocs/societe/website.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 3b3cc15e5c4..b89e1d60729 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -261,7 +261,7 @@ function societe_prepare_head(Societe $object) $sql .= " FROM ".MAIN_DB_PREFIX."societe_account as n"; $sql .= " WHERE fk_soc = ".((int) $object->id); if (!empty($site_filter_list)) { - $sql .= " AND n.site IN (".$db->sanitize("'".implode("', '",$site_filter_list)."'", 1).")"; + $sql .= " AND n.site IN (".$db->sanitize("'".implode("','",$site_filter_list)."'", 1).")"; } $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 7c898b8cda0..2f725a55afa 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -296,7 +296,7 @@ if ($objectwebsiteaccount->ismultientitymanaged == 1) { } $sql .= " AND fk_soc = ".((int) $object->id); if (!empty($site_filter_list)) { - $sql .= " AND t.site IN (".$db->sanitize("'".implode("', '",$site_filter_list)."'", 1).")"; + $sql .= " AND t.site IN (".$db->sanitize("'".implode("','",$site_filter_list)."'", 1).")"; } foreach ($search as $key => $val) { $mode_search = (($objectwebsiteaccount->isInt($objectwebsiteaccount->fields[$key]) || $objectwebsiteaccount->isFloat($objectwebsiteaccount->fields[$key])) ? 1 : 0); From e06608d87f11fbcafff3a3f33774850b0ed0ee6b Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 12 Sep 2023 14:51:57 +0200 Subject: [PATCH 0915/1137] Fix PHP CS --- htdocs/core/lib/company.lib.php | 2 +- htdocs/societe/website.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index b89e1d60729..fada0897a2a 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -261,7 +261,7 @@ function societe_prepare_head(Societe $object) $sql .= " FROM ".MAIN_DB_PREFIX."societe_account as n"; $sql .= " WHERE fk_soc = ".((int) $object->id); if (!empty($site_filter_list)) { - $sql .= " AND n.site IN (".$db->sanitize("'".implode("','",$site_filter_list)."'", 1).")"; + $sql .= " AND n.site IN (".$db->sanitize("'".implode("','", $site_filter_list)."'", 1).")"; } $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 2f725a55afa..95bd6c14ea6 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -296,7 +296,7 @@ if ($objectwebsiteaccount->ismultientitymanaged == 1) { } $sql .= " AND fk_soc = ".((int) $object->id); if (!empty($site_filter_list)) { - $sql .= " AND t.site IN (".$db->sanitize("'".implode("','",$site_filter_list)."'", 1).")"; + $sql .= " AND t.site IN (".$db->sanitize("'".implode("','", $site_filter_list)."'", 1).")"; } foreach ($search as $key => $val) { $mode_search = (($objectwebsiteaccount->isInt($objectwebsiteaccount->fields[$key]) || $objectwebsiteaccount->isFloat($objectwebsiteaccount->fields[$key])) ? 1 : 0); From 836e22adcff68a7294cd30d319e779649bc33e94 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Sep 2023 15:45:20 +0200 Subject: [PATCH 0916/1137] Better help on administrator flag --- htdocs/core/class/html.form.class.php | 2 +- htdocs/langs/en_US/main.lang | 2 +- htdocs/langs/en_US/users.lang | 6 +++--- htdocs/user/card.php | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eecc41bd4eb..d5c55b48293 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -730,7 +730,7 @@ class Form } /** - * Show a text with a picto and a tooltip on picto + * Show a text with a picto and a tooltip on picto * * @param string $text Text to show * @param string $htmltext Content of tooltip diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 42972e2fb75..6fb76c7928f 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -103,7 +103,7 @@ RecordGenerated=Record generated LevelOfFeature=Level of features NotDefined=Not defined DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr authentication mode is set to %s in configuration file conf.php.
This means that the password database is external to Dolibarr, so changing this field may have no effect. -Administrator=Administrator +Administrator=System administrator Undefined=Undefined PasswordForgotten=Password forgotten? NoAccount=No account? diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 9c49da5066d..93947fccac2 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -32,9 +32,9 @@ CreateUser=Create user LoginNotDefined=Login is not defined. NameNotDefined=Name is not defined. ListOfUsers=List of users -SuperAdministrator=Super Administrator -SuperAdministratorDesc=Global administrator -AdministratorDesc=Administrator +SuperAdministrator=Multicompany Administrator +SuperAdministratorDesc=Multicompany system administrator (can change setup and users) +AdministratorDesc=System administrator (can administer user, permissions but also system setup and modules configuration) DefaultRights=Default Permissions DefaultRightsDesc=Define here the default permissions that are automatically granted to a new user (to modify permissions for existing users, go to the user card). DolibarrUsers=Dolibarr users diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8d0fbd578c0..3e6b8bb5591 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -962,7 +962,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Administrator if (!empty($user->admin)) { - print ''.$langs->trans("Administrator").''; + print ''.$form->textwithpicto($langs->trans("Administrator"), $langs->trans("AdministratorDesc"), 1, 'star').''; print ''; print $form->selectyesno('admin', GETPOST('admin'), 1, false, 0, 1); @@ -1497,7 +1497,7 @@ if ($action == 'create' || $action == 'adduserldap') { } /* - * Fiche en mode visu + * View mode */ if ($action != 'edit') { print dol_get_fiche_head($head, 'user', $title, -1, 'user'); @@ -2149,7 +2149,7 @@ if ($action == 'create' || $action == 'adduserldap') { } /* - * Card in edit mode + * Edit mode */ if ($action == 'edit' && ($canedituser || $caneditpasswordandsee)) { print '
'; @@ -2216,7 +2216,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; // Administrator - print ''.$langs->trans("Administrator").''; + print ''.$form->textwithpicto($langs->trans("Administrator"), $langs->trans("AdministratorDesc")).''; if ($object->socid > 0) { $langs->load("admin"); print ''; From 41240a075806bc18a2cba09b33860f8aeaf5e881 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Sep 2023 15:58:42 +0200 Subject: [PATCH 0917/1137] NEW More accurate tooltip on what admin permissions are --- htdocs/admin/tools/listevents.php | 4 ++-- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/users.lang | 1 - htdocs/user/class/user.class.php | 4 ++-- htdocs/user/group/card.php | 4 ++-- htdocs/user/hierarchy.php | 4 ++-- htdocs/user/home.php | 4 ++-- htdocs/user/list.php | 8 ++++---- htdocs/user/perms.php | 16 ++++++++++++---- 10 files changed, 28 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 437acf3561a..0d9bee50963 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -465,9 +465,9 @@ if ($result) { print $userstatic->getLoginUrl(1); if (isModEnabled('multicompany') && $userstatic->admin && !$userstatic->entity) { - print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); + print img_picto($langs->trans("SuperAdministratorDesc"), 'redstar', 'class="valignmiddle paddingleft"'); } elseif ($userstatic->admin) { - print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); + print img_picto($langs->trans("AdministratorDesc"), 'star', 'class="valignmiddle paddingleft"'); } } else { print ' '; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ea00ae32d8a..c95099af8eb 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2412,5 +2412,6 @@ AtBottomOfPage=At bottom of page FailedAuth=failed authentications MaxNumberOfFailedAuth=Max number of failed authentication in 24h to deny login. AllowPasswordResetBySendingANewPassByEmail=If a user A has this permission, and even if the user A is not an "admin" user, A is allowed to reset the password of any other user B, the new password will be send to the email of the other user B but it won't be visible to A. If the user A has the "admin" flag, he will also be able to know what is the new generated password of B so he will be able to take control of the B user account. +AllowAnyPrivileges=If a user A has this permission, he can create a user B with all privileges and use them or grant himself any other group of permission. So it means user A owns all business privileges (only system access to setup pages will be forbidden) ThisValueCanBeReadBecauseInstanceIsNotInProductionMode=This value can be read because your instance is not set in production mode SeeConfFile=See inside conf.php file on the server \ No newline at end of file diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 6fb76c7928f..f26d6793248 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -104,6 +104,7 @@ LevelOfFeature=Level of features NotDefined=Not defined DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr authentication mode is set to %s in configuration file conf.php.
This means that the password database is external to Dolibarr, so changing this field may have no effect. Administrator=System administrator +AdministratorDesc=System administrator (can administer user, permissions but also system setup and modules configuration) Undefined=Undefined PasswordForgotten=Password forgotten? NoAccount=No account? diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 93947fccac2..93bb0442de6 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -34,7 +34,6 @@ NameNotDefined=Name is not defined. ListOfUsers=List of users SuperAdministrator=Multicompany Administrator SuperAdministratorDesc=Multicompany system administrator (can change setup and users) -AdministratorDesc=System administrator (can administer user, permissions but also system setup and modules configuration) DefaultRights=Default Permissions DefaultRightsDesc=Define here the default permissions that are automatically granted to a new user (to modify permissions for existing users, go to the user card). DolibarrUsers=Dolibarr users diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8aa1df2e366..b7e5bd76297 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3125,9 +3125,9 @@ class User extends CommonObject $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(0, '', 0, 0, 24, 0, '', 'valignmiddle') : $this->ref); if (isModEnabled('multicompany') && $this->admin && !$this->entity) { - $return .= img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingright paddingleft"'); + $return .= img_picto($langs->trans("SuperAdministratorDesc"), 'redstar', 'class="valignmiddle paddingright paddingleft"'); } elseif ($this->admin) { - $return .= img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingright paddingleft"'); + $return .= img_picto($langs->trans("AdministratorDesc"), 'star', 'class="valignmiddle paddingright paddingleft"'); } $return .= ''; $return .= ''; diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 7f6a3c0eec2..c1e4cab934e 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -457,9 +457,9 @@ if ($action == 'create') { print ''; print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); if (isModEnabled('multicompany') && $useringroup->admin && empty($useringroup->entity)) { - print img_picto($langs->trans("SuperAdministrator"), 'redstar'); + print img_picto($langs->trans("SuperAdministratorDesc"), 'redstar'); } elseif ($useringroup->admin) { - print img_picto($langs->trans("Administrator"), 'star'); + print img_picto($langs->trans("AdministratorDesc"), 'star'); } print ''; print ''.$useringroup->lastname.''; diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 5857c6257ac..9dc7bffff3f 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -151,9 +151,9 @@ if (!is_array($user_arbo) && $user_arbo < 0) { $li = $userstatic->getNomUrl(-1, '', 0, 1); if (isModEnabled('multicompany') && $userstatic->admin && !$userstatic->entity) { - $li .= img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingright paddingleft"'); + $li .= img_picto($langs->trans("SuperAdministratorDesc"), 'redstar', 'class="valignmiddle paddingright paddingleft"'); } elseif ($userstatic->admin) { - $li .= img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingright paddingleft"'); + $li .= img_picto($langs->trans("AdministratorDesc"), 'star', 'class="valignmiddle paddingright paddingleft"'); } $li .= ' ('.$val['login'].($entitystring ? ' - '.$entitystring : '').')'; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index c93a22f5cfb..a27eb56776e 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -168,9 +168,9 @@ if ($resql) { $lastcreatedbox .= ''; $lastcreatedbox .= $fuserstatic->getNomUrl(-1); if (isModEnabled('multicompany') && $obj->admin && !$obj->entity) { - $lastcreatedbox .= img_picto($langs->trans("SuperAdministrator"), 'redstar'); + $lastcreatedbox .= img_picto($langs->trans("SuperAdministratorDesc"), 'redstar'); } elseif ($obj->admin) { - $lastcreatedbox .= img_picto($langs->trans("Administrator"), 'star'); + $lastcreatedbox .= img_picto($langs->trans("AdministratorDesc"), 'star'); } $lastcreatedbox .= ""; $lastcreatedbox .= ''.dol_escape_htmltag($obj->login).''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index f9d39c1ab42..dcbee7fb274 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -1046,9 +1046,9 @@ while ($i < $imaxinloop) { print ''; print $li; if (isModEnabled('multicompany') && $obj->admin && !$obj->entity) { - print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingright paddingleft"'); + print img_picto($langs->trans("SuperAdministratorDesc"), 'redstar', 'class="valignmiddle paddingright paddingleft"'); } elseif ($obj->admin) { - print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingright paddingleft"'); + print img_picto($langs->trans("AdministratorDesc"), 'star', 'class="valignmiddle paddingright paddingleft"'); } print ''; if (!$i) { @@ -1117,9 +1117,9 @@ while ($i < $imaxinloop) { $user2->statut = $obj->status2; $user2->status = $obj->status2; if (isModEnabled('multicompany') && $obj->admin2 && !$obj->entity2) { - print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingright"'); + print img_picto($langs->trans("SuperAdministratorDesc"), 'redstar', 'class="valignmiddle paddingright"'); } elseif ($obj->admin2) { - print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingright"'); + print img_picto($langs->trans("AdministratorDesc"), 'star', 'class="valignmiddle paddingright"'); } print $user2->getNomUrl(-1, '', 0, 0, 24, 0, '', '', 1); } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 2d4bd50f7bc..c0eece3111b 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -193,7 +193,7 @@ foreach ($modulesdir as $dir) { $db->commit(); -// Read permissions of user +// Read permissions of edited user $permsuser = array(); $sql = "SELECT DISTINCT ur.fk_id"; @@ -591,7 +591,7 @@ if ($result) { // Permission and tick (2 columns) if (!empty($object->admin) && !empty($objMod->rights_admin_allowed)) { // Permission granted because admin if ($caneditperms) { - print ''.img_picto($langs->trans("Administrator"), 'star').''; + print ''.img_picto($langs->trans("AdministratorDesc"), 'star').''; } else { print ' '; } @@ -675,14 +675,22 @@ if ($result) { print ' ('.$langs->trans("AdvancedModeOnly").')'; } } - // Special warning cas for the permission "Allow to modify other users password + // Special warning case for the permission "Allow to modify other users password" if ($obj->module == 'user' && $obj->perms == 'user' && $obj->subperms == 'password') { if ((!empty($object->admin) && !empty($objMod->rights_admin_allowed)) || - in_array($obj->id, $permsuser) || + in_array($obj->id, $permsuser) /* if edited user owns this permissions */ || (isset($permsgroupbyentitypluszero) && is_array($permsgroupbyentitypluszero) && in_array($obj->id, $permsgroupbyentitypluszero))) { print ' '.img_warning($langs->trans("AllowPasswordResetBySendingANewPassByEmail")); } } + // Special warning case for the permission "Create/modify other users, groups and permissions" + if ($obj->module == 'user' && $obj->perms == 'user' && ($obj->subperms == 'creer' || $obj->subperms == 'create')) { + if ((!empty($object->admin) && !empty($objMod->rights_admin_allowed)) || + in_array($obj->id, $permsuser) /* if edited user owns this permissions */ || + (isset($permsgroupbyentitypluszero) && is_array($permsgroupbyentitypluszero) && in_array($obj->id, $permsgroupbyentitypluszero))) { + print ' '.img_warning($langs->trans("AllowAnyPrivileges")); + } + } print ''; // Permission id From b98921fc80629fa8c8506b4b5b0ac33a4dda6872 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Sep 2023 16:05:55 +0200 Subject: [PATCH 0918/1137] 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 c95099af8eb..2fedf15baba 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2412,6 +2412,6 @@ AtBottomOfPage=At bottom of page FailedAuth=failed authentications MaxNumberOfFailedAuth=Max number of failed authentication in 24h to deny login. AllowPasswordResetBySendingANewPassByEmail=If a user A has this permission, and even if the user A is not an "admin" user, A is allowed to reset the password of any other user B, the new password will be send to the email of the other user B but it won't be visible to A. If the user A has the "admin" flag, he will also be able to know what is the new generated password of B so he will be able to take control of the B user account. -AllowAnyPrivileges=If a user A has this permission, he can create a user B with all privileges and use them or grant himself any other group of permission. So it means user A owns all business privileges (only system access to setup pages will be forbidden) +AllowAnyPrivileges=If a user A has this permission, he can create a user B with all privileges then use this user B, or grant himself any other group with any permission. So it means user A owns all business privileges (only system access to setup pages will be forbidden) ThisValueCanBeReadBecauseInstanceIsNotInProductionMode=This value can be read because your instance is not set in production mode SeeConfFile=See inside conf.php file on the server \ No newline at end of file From 1667a5a740f9e64714c1dcc95c9d8a9375766b8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Sep 2023 17:46:13 +0200 Subject: [PATCH 0919/1137] Add QUAL and PERF as possible key for commit description --- .github/CONTRIBUTING.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d7463d62172..280dc3a83cc 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -67,9 +67,12 @@ where In uppercase if you want to have the log comment appears into the generated ChangeLog file. The keyword can be ommitted if your commit does not fit in any of the following categories: + - Fix/FIX: for a bug fix - New/NEW: for an unreferenced new feature (Opening a feature request and using close is prefered) - Close/CLOSE: for closing a referenced feature request +- Perf/PERF: for performance enhancement +- Qual/QUAL: for quality code enhancement or re-engeneering #### Issuenum If your commit fixes a referenced bug or feature request. @@ -96,10 +99,10 @@ Try to keep lines under 120 characters.
 FIX|Fix #456 Short description (where #456 is number of bug fix, if it exists. In upper case to appear into ChangeLog)
 or
-NEW|New Short description (In upper case to appear into ChangeLog, use this if you add a feature not tracked, otherwise use CLOSE #456)
-or
 CLOSE|Close #456 Short description (where #456 is number of feature request, if it exists. In upper case to appear into ChangeLog)
 or
+NEW|New|QUAL|Qual|PERF|Perf Short description (In upper case to appear into ChangeLog, use this if you add a feature not tracked, otherwise use CLOSE #456)
+or
 Short description (when the commit is not introducing feature nor closing a bug)
 
 Long description (Can span accross multiple lines).
@@ -119,7 +122,7 @@ Also, some code changes need a prior approbation:
 
 * if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-jedi in your issue) to see if such a library can be accepted.
 
-* if you add a new tables or fields, you MUST first submit a standalone PR with the data structure changes you plan to add/modify (and only data structure changes). Start development only once this data structure has been accepted.
+* if you add new tables or fields, you MUST first submit a standalone PR with the data structure changes you plan to add/modify (and only data structure changes). Start development only once this data structure has been accepted.
 
 Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case).
 

From 22e08835a212eff903ff3b48039d2c16823a7e76 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur 
Date: Tue, 12 Sep 2023 17:53:28 +0200
Subject: [PATCH 0920/1137] Clean comment

---
 htdocs/expedition/dispatch.php | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php
index 8417699cb19..8c0338df660 100644
--- a/htdocs/expedition/dispatch.php
+++ b/htdocs/expedition/dispatch.php
@@ -701,10 +701,6 @@ if ($object->id > 0 || !empty($object->ref)) {
 						print ''; // Dispatch column
 						print ''; // Warehouse column
 
-						/*$sql = "SELECT cfd.rowid, cfd.qty, cfd.fk_entrepot, cfd.batch, cfd.eatby, cfd.sellby, cfd.fk_product";
-						$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd";
-						$sql .= " WHERE cfd.fk_commandefourndet = ".(int) $objp->rowid;*/
-
 						$sql = "SELECT ed.rowid, ed.qty, ed.fk_entrepot, eb.batch, eb.eatby, eb.sellby, cd.fk_product FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
 						$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as eb on ed.rowid = eb.fk_expeditiondet";
 						$sql .= " JOIN ".MAIN_DB_PREFIX."commandedet as cd on ed.fk_origin_line = cd.rowid";

From f2dbc418f1723abb43c26735d20730e8873ec705 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= 
Date: Tue, 12 Sep 2023 18:40:55 +0200
Subject: [PATCH 0921/1137] phpstan

---
 .../modules/import/import_csv.modules.php     | 12 -----
 .../modules/import/import_xlsx.modules.php    | 12 -----
 htdocs/core/modules/import/modules_import.php | 49 ++++++++++++++++---
 3 files changed, 43 insertions(+), 30 deletions(-)

diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 29cd8ca5a21..70371759c26 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -38,18 +38,6 @@ class ImportCsv extends ModeleImports
 	 */
 	public $db;
 
-	public $datatoimport;
-
-	/**
-	 * @var string Error code (or message)
-	 */
-	public $error = '';
-
-	/**
-	 * @var string[] Error codes (or messages)
-	 */
-	public $errors = array();
-
 	/**
 	 * @var string Code of driver
 	 */
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index c05fabc5968..2cc901bdda1 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -42,18 +42,6 @@ class ImportXlsx extends ModeleImports
 	 */
 	public $db;
 
-	public $datatoimport;
-
-	/**
-	 * @var string Error code (or message)
-	 */
-	public $error = '';
-
-	/**
-	 * @var string[] Error codes (or messages)
-	 */
-	public $errors = array();
-
 	/**
 	 * @var string Code of driver
 	 */
diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php
index 5b665c8e2cf..e7df2f9dd14 100644
--- a/htdocs/core/modules/import/modules_import.php
+++ b/htdocs/core/modules/import/modules_import.php
@@ -22,7 +22,7 @@
  *	\ingroup    export
  *	\brief      File of parent class for import file readers
  */
-require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
 
 
 /**
@@ -42,6 +42,16 @@ class ModeleImports
 	 */
 	public $error = '';
 
+	/**
+	 * @var string[] Error codes (or messages)
+	 */
+	public $errors = array();
+
+	/**
+	 * @var string[] warnings codes (or messages)
+	 */
+	public $warnings = array();
+
 	/**
 	 * @var string Code of driver
 	 */
@@ -75,8 +85,35 @@ class ModeleImports
 
 	public $libversion = array();
 
+	/**
+	 * @var string charset
+	 */
 	public $charset;
 
+	/**
+	 * @var string picto
+	 */
+	public $picto;
+
+	/**
+	 * @var string description
+	 */
+	public $desc;
+
+	/**
+	 * @var string escape
+	 */
+	public $escape;
+
+	/**
+	 * @var string enclosure
+	 */
+	public $enclosure;
+
+	/**
+	 * @var Societe thirdparty
+	 */
+	public $thirdpartyobject;
 
 	/**
 	 * @var	array	Element mapping from table name
@@ -206,9 +243,9 @@ class ModeleImports
 	 */
 	public function listOfAvailableImportFormat($db, $maxfilenamelength = 0)
 	{
-		dol_syslog(get_class($this)."::listOfAvailableImportFormat");
+		dol_syslog(get_class($this) . "::listOfAvailableImportFormat");
 
-		$dir = DOL_DOCUMENT_ROOT."/core/modules/import/";
+		$dir = DOL_DOCUMENT_ROOT . "/core/modules/import/";
 		$handle = opendir($dir);
 
 		// Recherche des fichiers drivers imports disponibles
@@ -219,8 +256,8 @@ class ModeleImports
 					$moduleid = $reg[1];
 
 					// Loading Class
-					$file = $dir."/import_".$moduleid.".modules.php";
-					$classname = "Import".ucfirst($moduleid);
+					$file = $dir . "/import_" . $moduleid . ".modules.php";
+					$classname = "Import" . ucfirst($moduleid);
 
 					require_once $file;
 					$module = new $classname($db, '');
@@ -318,7 +355,7 @@ class ModeleImports
 	 */
 	public function getElementFromTableWithPrefix($tableNameWithPrefix)
 	{
-		$tableElement = preg_replace('/^'.preg_quote($this->db->prefix(), '/').'/', '', $tableNameWithPrefix);
+		$tableElement = preg_replace('/^' . preg_quote($this->db->prefix(), '/') . '/', '', $tableNameWithPrefix);
 		$element = $tableElement;
 
 		if (isset(self::$mapTableToElement[$tableElement])) {

From 0672cafd78723a50da2e9a25b140560c16478269 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= 
Date: Tue, 12 Sep 2023 18:43:06 +0200
Subject: [PATCH 0922/1137] phpstan

---
 htdocs/core/modules/import/modules_import.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php
index e7df2f9dd14..e92143ca2f0 100644
--- a/htdocs/core/modules/import/modules_import.php
+++ b/htdocs/core/modules/import/modules_import.php
@@ -245,7 +245,7 @@ class ModeleImports
 	{
 		dol_syslog(get_class($this) . "::listOfAvailableImportFormat");
 
-		$dir = DOL_DOCUMENT_ROOT . "/core/modules/import/";
+		$dir = DOL_DOCUMENT_ROOT."/core/modules/import/";
 		$handle = opendir($dir);
 
 		// Recherche des fichiers drivers imports disponibles
@@ -256,8 +256,8 @@ class ModeleImports
 					$moduleid = $reg[1];
 
 					// Loading Class
-					$file = $dir . "/import_" . $moduleid . ".modules.php";
-					$classname = "Import" . ucfirst($moduleid);
+					$file = $dir."/import_".$moduleid.".modules.php";
+					$classname = "Import".ucfirst($moduleid);
 
 					require_once $file;
 					$module = new $classname($db, '');
@@ -355,7 +355,7 @@ class ModeleImports
 	 */
 	public function getElementFromTableWithPrefix($tableNameWithPrefix)
 	{
-		$tableElement = preg_replace('/^' . preg_quote($this->db->prefix(), '/') . '/', '', $tableNameWithPrefix);
+		$tableElement = preg_replace('/^'.preg_quote($this->db->prefix(), '/').'/', '', $tableNameWithPrefix);
 		$element = $tableElement;
 
 		if (isset(self::$mapTableToElement[$tableElement])) {

From 3931e23b7341884ca7253f06b0a5e134bafc2366 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= 
Date: Tue, 12 Sep 2023 18:43:46 +0200
Subject: [PATCH 0923/1137] phpstan

---
 htdocs/core/modules/import/modules_import.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php
index e92143ca2f0..8e24e1e3093 100644
--- a/htdocs/core/modules/import/modules_import.php
+++ b/htdocs/core/modules/import/modules_import.php
@@ -22,7 +22,7 @@
  *	\ingroup    export
  *	\brief      File of parent class for import file readers
  */
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
 
 
 /**
@@ -243,7 +243,7 @@ class ModeleImports
 	 */
 	public function listOfAvailableImportFormat($db, $maxfilenamelength = 0)
 	{
-		dol_syslog(get_class($this) . "::listOfAvailableImportFormat");
+		dol_syslog(get_class($this)."::listOfAvailableImportFormat");
 
 		$dir = DOL_DOCUMENT_ROOT."/core/modules/import/";
 		$handle = opendir($dir);

From 92c4d53fcac53ed810c86d152bdcc89bc96d6581 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= 
Date: Tue, 12 Sep 2023 18:51:40 +0200
Subject: [PATCH 0924/1137] phpstan

---
 .../generate/modGeneratePassNone.class.php    | 10 ----------
 .../generate/modGeneratePassPerso.class.php   |  9 ---------
 .../modGeneratePassStandard.class.php         | 10 ----------
 .../security/generate/modules_genpassword.php | 20 +++++++++++++++++++
 4 files changed, 20 insertions(+), 29 deletions(-)

diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php
index 3ec764c6ab2..66621512b54 100644
--- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php
+++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php
@@ -51,16 +51,6 @@ class modGeneratePassNone extends ModeleGenPassword
 	 */
 	public $length2;
 
-	/**
-	 * @var DoliDB Database handler.
-	 */
-	public $db;
-
-	public $conf;
-	public $lang;
-	public $user;
-
-
 	/**
 	 *	Constructor
 	 *
diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
index 491ab9757e8..b708404956b 100644
--- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
+++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
@@ -65,15 +65,6 @@ class modGeneratePassPerso extends ModeleGenPassword
 	 */
 	public $WithoutAmbi = 0;
 
-	/**
-	 * @var DoliDB Database handler.
-	 */
-	public $db;
-
-	public $conf;
-	public $lang;
-	public $user;
-
 	public $Maj;
 	public $Min;
 	public $Nb;
diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php
index b2d0b260ccb..0bab8e8b32b 100644
--- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php
+++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php
@@ -51,16 +51,6 @@ class modGeneratePassStandard extends ModeleGenPassword
 	 */
 	public $length2;
 
-	/**
-	 * @var DoliDB Database handler.
-	 */
-	public $db;
-
-	public $conf;
-	public $lang;
-	public $user;
-
-
 	/**
 	 *	Constructor
 	 *
diff --git a/htdocs/core/modules/security/generate/modules_genpassword.php b/htdocs/core/modules/security/generate/modules_genpassword.php
index bb1e02774c6..4f5aedc7684 100644
--- a/htdocs/core/modules/security/generate/modules_genpassword.php
+++ b/htdocs/core/modules/security/generate/modules_genpassword.php
@@ -43,6 +43,26 @@ abstract class ModeleGenPassword
 	 */
 	public $error = '';
 
+	/**
+	 * @var DoliDB Database handler.
+	 */
+	public $db;
+
+	/**
+	 * @var Conf dolibarr conf
+	 */
+	public $conf;
+
+	/**
+	 * @var Translate Translate Object
+	 */
+	public $langs;
+
+	/**
+	 * @var User user
+	 */
+	public $user;
+
 	/**
 	 * 		Return if a module can be used or not
 	 *

From 5cae3823fde9e234f1372fd58d2f3c86168909b9 Mon Sep 17 00:00:00 2001
From: sonikf <93765174+sonikf@users.noreply.github.com>
Date: Tue, 12 Sep 2023 20:25:17 +0300
Subject: [PATCH 0925/1137] fix PHPCS

---
 htdocs/admin/company.php | 64 ++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index e0c3b470344..daba5b00427 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -234,14 +234,14 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
 		dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2", 'aZ09'), 'chaine', 0, '', $conf->entity);
 	}
 
-	// Credentials for AADE webservices, applicable only for Greece 
+	// Credentials for AADE webservices, applicable only for Greece
 	if ($mysoc->country_code == 'GR') {
-	    dolibarr_set_const($db, "MYDATA_AADE_USER", GETPOST("MYDATA_AADE_USER", 'alpha'), 'chaine', 0, '', $conf->entity);	
-	    dolibarr_set_const($db, "MYDATA_AADE_KEY", GETPOST("MYDATA_AADE_KEY", 'alpha'), 'chaine', 0, '', $conf->entity);	
-	    dolibarr_set_const($db, "AADE_WEBSERVICE_USER", GETPOST("AADE_WEBSERVICE_USER", 'alpha'), 'chaine', 0, '', $conf->entity);	
-	    dolibarr_set_const($db, "AADE_WEBSERVICE_KEY", GETPOST("AADE_WEBSERVICE_KEY", 'alpha'), 'chaine', 0, '', $conf->entity);
+		dolibarr_set_const($db, "MYDATA_AADE_USER", GETPOST("MYDATA_AADE_USER", 'alpha'), 'chaine', 0, '', $conf->entity);
+		dolibarr_set_const($db, "MYDATA_AADE_KEY", GETPOST("MYDATA_AADE_KEY", 'alpha'), 'chaine', 0, '', $conf->entity);
+		dolibarr_set_const($db, "AADE_WEBSERVICE_USER", GETPOST("AADE_WEBSERVICE_USER", 'alpha'), 'chaine', 0, '', $conf->entity);
+		dolibarr_set_const($db, "AADE_WEBSERVICE_KEY", GETPOST("AADE_WEBSERVICE_KEY", 'alpha'), 'chaine', 0, '', $conf->entity);
 	}
-	
+
 	// Remove constant MAIN_INFO_SOCIETE_SETUP_TODO_WARNING
 	dolibarr_del_const($db, "MAIN_INFO_SOCIETE_SETUP_TODO_WARNING", $conf->entity);
 
@@ -856,39 +856,39 @@ if ($mysoc->useRevenueStamp()) {
 
 print "";
 
-// AADE webservices credentials, applicable only for Greece 
+// AADE webservices credentials, applicable only for Greece
 if ($mysoc->country_code == 'GR') {
-    print load_fiche_titre($langs->trans("AADEKeys"), '', '');	
-    print '';
-    print '';
-    print '';
-    print '';
-    print '';
-    print "\n";
+	print load_fiche_titre($langs->trans("AADEKeys"), '', '');
+	print '
'.$langs->trans("AccountParameter").''.$langs->trans("Value").'
'; + print ''; + print ''; + print ''; + print ''; + print "\n"; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print '
'; + print '
'; - print "
'.$langs->trans("AccountParameter").''.$langs->trans("Value").'
'; - print ''.$langs->trans("MYDATA_AADE_USER").''; - print '
'; + print ''.$langs->trans("MYDATA_AADE_USER").''; + print '
'; - print ''.$langs->trans("MYDATA_AADE_KEY").''; - print 'global->MYDATA_AADE_KEY.'"'; - print '
'; + print ''.$langs->trans("MYDATA_AADE_KEY").''; + print 'global->MYDATA_AADE_KEY.'"'; + print '
'; - print ''.$langs->trans("AADE_WEBSERVICE_USER").''; - print '
'; + print ''.$langs->trans("AADE_WEBSERVICE_USER").''; + print '
'; - print ''.$langs->trans("AADE_WEBSERVICE_KEY").''; - print '
'; + print ''.$langs->trans("AADE_WEBSERVICE_KEY").''; + print '
"; + print ""; } print $form->buttonsSaveCancel("Save", ''); From 3a44203ddf3ad75fa7073b6cb73e60f42ced14d9 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:26:00 +0300 Subject: [PATCH 0926/1137] fix PHPCS --- htdocs/societe/checkvat/checkVatGr.php | 35 ++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/htdocs/societe/checkvat/checkVatGr.php b/htdocs/societe/checkvat/checkVatGr.php index 9018081cf68..40d1eaccb9c 100644 --- a/htdocs/societe/checkvat/checkVatGr.php +++ b/htdocs/societe/checkvat/checkVatGr.php @@ -33,22 +33,25 @@ $result = checkVATGR($username, $password, $myafm, $afm); echo json_encode($result); // Encode the result as JSON and output -// Function to check VAT -function checkVATGR($username, $password, $AFMcalledby = '', $AFMcalledfor) +/** +* Request VAT details +* +*/ +function checkVATGR($username, $password, $AFMcalledfor, $AFMcalledby = '') { - $client = new SoapClient("https://www1.gsis.gr/webtax2/wsgsis/RgWsPublic/RgWsPublicPort?WSDL", array('trace' => true)); - $authHeader = new stdClass(); - $authHeader->UsernameToken = new stdClass(); - $authHeader->UsernameToken->Username = "$username"; - $authHeader->UsernameToken->Password = "$password"; - $Headers[] = new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $authHeader, true); - $client->__setSoapHeaders($Headers); - $result = $client->rgWsPublicAfmMethod( - array( - 'afmCalledBy' => "$AFMcalledby", - 'afmCalledFor' => "$AFMcalledfor", - ) - ); + $client = new SoapClient("https://www1.gsis.gr/webtax2/wsgsis/RgWsPublic/RgWsPublicPort?WSDL", array('trace' => true)); + $authHeader = new stdClass(); + $authHeader->UsernameToken = new stdClass(); + $authHeader->UsernameToken->Username = "$username"; + $authHeader->UsernameToken->Password = "$password"; + $Headers[] = new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $authHeader, true); + $client->__setSoapHeaders($Headers); + $result = $client->rgWsPublicAfmMethod( + array( + 'afmCalledBy' => "$AFMcalledby", + 'afmCalledFor' => "$AFMcalledfor", + ) + ); - return $result; + return $result; } From e7d8f041875d441e236976309862ab92a1d478ec Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Sep 2023 21:04:32 +0300 Subject: [PATCH 0927/1137] fix ci errors --- htdocs/societe/card.php | 88 ++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6b827571d80..ca92652ef09 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -66,9 +66,9 @@ if (isModEnabled('eventorganization')) { } if ($mysoc->country_code == 'GR') { - $u = $conf->global->AADE_WEBSERVICE_USER; - $p = $conf->global->AADE_WEBSERVICE_KEY; - $myafm = $mysoc->tva_intra; + $u = $conf->global->AADE_WEBSERVICE_USER; + $p = $conf->global->AADE_WEBSERVICE_KEY; + $myafm = $mysoc->tva_intra; } @@ -1737,10 +1737,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print "\n"; $s .= ''.$langs->trans("VATIntraCheck").''; @@ -2512,9 +2513,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; @@ -2983,11 +2984,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; print ''; print "\n"; @@ -3367,38 +3368,37 @@ function GRVAT(a, u, p, myafm) { var afm = a.replace(/\D/g, ""); // Remove non-digit characters from 'a' $.ajax({ - type: "GET", - url: "/societe/checkvat/checkVatGr.php", - data: { u: u, p: p, myafm: myafm, afm: afm }, // Set request parameters - success: function(data) { - var obj = JSON.parse(data); // Parse response data as JSON + type: "GET", + url: "/societe/checkvat/checkVatGr.php", + data: { u: u, p: p, myafm: myafm, afm: afm }, // Set request parameters + success: function(data) { + var obj = JSON.parse(data); // Parse response data as JSON - // Update form fields based on retrieved data - if (obj.RgWsPublicBasicRt_out.afm === null) { - alert(obj.pErrorRec_out.errorDescr); // Display error message if AFM is null - } else { - $("#name").val(obj.RgWsPublicBasicRt_out.onomasia); // Set 'name' field value - $("#address").val(obj.RgWsPublicBasicRt_out.postalAddress + " " + obj.RgWsPublicBasicRt_out.postalAddressNo); // Set 'address' field value - $("#zipcode").val(obj.RgWsPublicBasicRt_out.postalZipCode); // Set 'zipcode' field value - $("#town").val(obj.RgWsPublicBasicRt_out.postalAreaDescription); // Set 'town' field value - $("#idprof2").val(obj.RgWsPublicBasicRt_out.doyDescr); // Set 'idprof2' field value - $("#name_alias_input").val(obj.RgWsPublicBasicRt_out.commerTitle); // Set 'name_alias' field value + // Update form fields based on retrieved data + if (obj.RgWsPublicBasicRt_out.afm === null) { + alert(obj.pErrorRec_out.errorDescr); // Display error message if AFM is null + } else { + $("#name").val(obj.RgWsPublicBasicRt_out.onomasia); // Set 'name' field value + $("#zipcode").val(obj.RgWsPublicBasicRt_out.postalZipCode); // Set 'zipcode' field value + $("#town").val(obj.RgWsPublicBasicRt_out.postalAreaDescription); // Set 'town' field value + $("#idprof2").val(obj.RgWsPublicBasicRt_out.doyDescr); // Set 'idprof2' field value + $("#name_alias_input").val(obj.RgWsPublicBasicRt_out.commerTitle); // Set 'name_alias' field value - if (obj.arrayOfRgWsPublicFirmActRt_out.RgWsPublicFirmActRtUser) { - var firmActUser = obj.arrayOfRgWsPublicFirmActRt_out.RgWsPublicFirmActRtUser; - - if (Array.isArray(firmActUser)) { - var primaryFirmAct = firmActUser.find(item => item.firmActKindDescr === "ΚΥΡΙΑ"); // Find primary client activity - if (primaryFirmAct) { - $("#idprof1").val(primaryFirmAct.firmActDescr); // Set 'idprof1' field value - } - } else { - $("#idprof1").val(firmActUser.firmActDescr); // Set 'idprof1' field value - } - } + if (obj.arrayOfRgWsPublicFirmActRt_out.RgWsPublicFirmActRtUser) { + var firmActUser = obj.arrayOfRgWsPublicFirmActRt_out.RgWsPublicFirmActRtUser; + + if (Array.isArray(firmActUser)) { + var primaryFirmAct = firmActUser.find(item => item.firmActKindDescr === "ΚΥΡΙΑ"); // Find primary client activity + if (primaryFirmAct) { + $("#idprof1").val(primaryFirmAct.firmActDescr); // Set 'idprof1' field value + } + } else { + $("#idprof1").val(firmActUser.firmActDescr); // Set 'idprof1' field value + } } - } - }); + } + } + }); } From 4278b6629fb8e5eb38d90f1a364bef7604682422 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Sep 2023 21:04:38 +0300 Subject: [PATCH 0928/1137] fix PHPCS --- htdocs/societe/checkvat/checkVatGr.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/checkvat/checkVatGr.php b/htdocs/societe/checkvat/checkVatGr.php index 40d1eaccb9c..5c038800791 100644 --- a/htdocs/societe/checkvat/checkVatGr.php +++ b/htdocs/societe/checkvat/checkVatGr.php @@ -33,9 +33,13 @@ $result = checkVATGR($username, $password, $myafm, $afm); echo json_encode($result); // Encode the result as JSON and output -/** +/** * Request VAT details -* +* @param string $username Company AADE username +* @param string $password Company AADE password +* @param string $AFMcalledfor Company vat number +* @param string $AFMcalledby Client vat number +* @return string */ function checkVATGR($username, $password, $AFMcalledfor, $AFMcalledby = '') { From fc2673102592ea0aaa79d9f40791ad3cb166354d Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 12 Sep 2023 21:27:22 +0300 Subject: [PATCH 0929/1137] fix CI errors --- htdocs/societe/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ca92652ef09..2c55b0e070d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2514,9 +2514,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "function CheckVAT(a) {\n"; if ($mysoc->country_code == 'GR' && $object->country_code == 'GR') { print "GRVAT(a,'{$u}','{$p}','{$myafm}');\n"; - } - else { print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a, '".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."', ".$widthpopup.", ".$heightpopup.");\n"; - } + } else { + print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a, '".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."', ".$widthpopup.", ".$heightpopup.");\n"; + } print "}\n"; print ''; print "\n"; @@ -2986,8 +2986,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "function CheckVAT(a) {\n"; if ($mysoc->country_code == 'GR' && $object->country_code == 'GR') { print "GRVAT(a,'{$u}','{$p}','{$myafm}');\n"; - } - else { print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a, '".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."', ".$widthpopup.", ".$heightpopup.");\n"; + } else { + print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a, '".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."', ".$widthpopup.", ".$heightpopup.");\n"; } print "}\n"; print ''; From 69bf0821251d02de34d82c066de282b33bda1cc6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Sep 2023 03:04:22 +0200 Subject: [PATCH 0930/1137] Merge --- htdocs/expedition/js/lib_dispatch.js.php | 2 +- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 4 ++-- .../tables/llx_commande_fournisseur_dispatch.sql | 12 ++++++------ .../install/mysql/tables/llx_expeditiondet_batch.sql | 11 ++++++----- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/htdocs/expedition/js/lib_dispatch.js.php b/htdocs/expedition/js/lib_dispatch.js.php index 30b5cd7cc40..96ba2072e47 100644 --- a/htdocs/expedition/js/lib_dispatch.js.php +++ b/htdocs/expedition/js/lib_dispatch.js.php @@ -156,7 +156,7 @@ function addDispatchLine(index, type, mode) { $('tr[name="' + type + '_' + idrow + '"').remove(); $("tr[name^='" + type + "_'][name$='_" + index + "']:last .splitbutton").show(); } else { - console.log("Reset trigger for id = #qty_" + idrow); + console.log("fourn/js/lib_dispatch.js.php Reset trigger for id = #qty_" + idrow); $("#qty_" + idrow).val(""); } }); diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index d053441d38d..c7245553677 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -101,7 +101,7 @@ ALTER TABLE llx_societe_rib ADD COLUMN online_sign_name varchar(64) AFTER onlin INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PROPOSAL_ALLOW_ONLINESIGN', 1, '1', 'string', 0); - ALTER TABLE llx_bookcal_availabilities ADD COLUMN fk_bookcal_calendar integer NOT NULL; - ALTER TABLE llx_bookcal_calendar ADD COLUMN visibility integer NOT NULL DEFAULT 1; + +ALTER TABLE llx_expeditiondet_batch ADD COLUMN fk_warehouse DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql index 869225a534c..fa7cd92ba1f 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql @@ -26,19 +26,19 @@ create table llx_commande_fournisseur_dispatch ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_commande integer, fk_product integer, + fk_commande integer, fk_commandefourndet integer, fk_projet integer DEFAULT NULL, fk_reception integer DEFAULT NULL, - qty float, -- qty - fk_entrepot integer, - fk_user integer, - comment varchar(255), -- comment on movement - batch varchar(128) DEFAULT NULL, + qty float, -- qty to move + fk_entrepot integer, -- ID of warehouse to use for the stock change + comment varchar(255), -- comment on movement + batch varchar(128) DEFAULT NULL, -- serial/lot number eatby date DEFAULT NULL, sellby date DEFAULT NULL, status integer, + fk_user integer, datec datetime, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, cost_price double(24,8) DEFAULT 0 diff --git a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql index 6cedc0b5a32..e62c503af9a 100644 --- a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql +++ b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql @@ -14,16 +14,17 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -- --- Similar for supplier to llx_commande_fournisseur_dispatch=llx_receptiondet_batch +-- Similar for supplier with llx_commande_fournisseur_dispatch=llx_receptiondet_batch -- ============================================================================ CREATE TABLE llx_expeditiondet_batch ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_expeditiondet int NOT NULL, + fk_expeditiondet int NOT NULL, -- line ID in shipment line table eatby date DEFAULT NULL, sellby date DEFAULT NULL, - batch varchar(128) DEFAULT NULL, - qty double NOT NULL DEFAULT '0', - fk_origin_stock integer NOT NULL -- id into table llx_product_batch (llx_product_batch may be renamed into llx_product_stock_batch in another version). TODO We should add and use instead a fk_warehouse field + batch varchar(128) DEFAULT NULL, -- serial/lot number + qty double NOT NULL DEFAULT '0', -- qty to move + fk_origin_stock integer NOT NULL, -- Not useful. ID into table llx_product_batch (llx_product_batch may be renamed into llx_product_stock_batch in another version). TODO We should add and use instead a fk_warehouse field + fk_warehouse DEFAULT NULL -- ID of warehouse to use for the stock change ) ENGINE=innodb; From 50e45811168d64f07f47bb9de3baf9930343ce76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 13 Sep 2023 08:46:01 +0200 Subject: [PATCH 0931/1137] add comment --- htdocs/core/lib/oauth.lib.php | 64 ++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/oauth.lib.php b/htdocs/core/lib/oauth.lib.php index 1d3cb983e3e..055acf9256a 100644 --- a/htdocs/core/lib/oauth.lib.php +++ b/htdocs/core/lib/oauth.lib.php @@ -25,18 +25,66 @@ // 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/', - 'availablescopes'=> 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print,admin_directory_user,gmail_full,contact,https://www.googleapis.com/auth/contacts,https://www.googleapis.com/auth/calendar', 'returnurl'=>'/core/modules/oauth/google_oauthcallback.php'), + '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,contact,https://www.googleapis.com/auth/contacts,https://www.googleapis.com/auth/calendar', + 'returnurl' => '/core/modules/oauth/google_oauthcallback.php' + ), ); if (isModEnabled('stripe')) { - $supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'availablescopes'=>'read_write', 'returnurl'=>'/core/modules/oauth/stripetest_oauthcallback.php'); - $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'availablescopes'=>'read_write', 'returnurl'=>'/core/modules/oauth/stripelive_oauthcallback.php'); + $supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array( + 'callbackfile' => 'stripetest', + 'picto' => 'stripe', + 'urlforapp' => '', + 'name' => 'StripeTest', + 'urlforcredentials' => '', + 'availablescopes' => 'read_write', + 'returnurl' => '/core/modules/oauth/stripetest_oauthcallback.php' + ); + $supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array( + 'callbackfile' => 'stripelive', + 'picto' => 'stripe', + 'urlforapp' => '', + 'name' => 'StripeLive', + 'urlforcredentials' => '', + 'availablescopes' => 'read_write', + 'returnurl' => '/core/modules/oauth/stripelive_oauthcallback.php' + ); } -$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', 'returnurl'=>'/core/modules/oauth/github_oauthcallback.php'); -$supportedoauth2array['OAUTH_MICROSOFT_NAME'] = array('callbackfile' => 'microsoft', 'picto' => 'microsoft', 'urlforapp' => 'OAUTH_MICROSOFT_DESC', 'name'=>'Microsoft', 'urlforcredentials'=>'https://portal.azure.com/', 'availablescopes'=>'openid,offline_access,profile,email,User.Read,https://outlook.office365.com/IMAP.AccessAsUser.All,https://outlook.office365.com/SMTP.Send', 'returnurl'=>'/core/modules/oauth/microsoft_oauthcallback.php'); +$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', + 'returnurl' => '/core/modules/oauth/github_oauthcallback.php' +); +// See https://learn.microsoft.com/fr-fr/azure/active-directory/develop/quickstart-register-app#register-an-application +$supportedoauth2array['OAUTH_MICROSOFT_NAME'] = array( + 'callbackfile' => 'microsoft', + 'picto' => 'microsoft', + 'urlforapp' => 'OAUTH_MICROSOFT_DESC', + 'name' => 'Microsoft', + 'urlforcredentials' => 'https://portal.azure.com/', + // User.Read is a microsoftgraph scope, if it's not working, do not select it + 'availablescopes' => 'openid,offline_access,profile,email,User.Read,https://outlook.office365.com/IMAP.AccessAsUser.All,https://outlook.office365.com/SMTP.Send', + 'returnurl' => '/core/modules/oauth/microsoft_oauthcallback.php' +); if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { - $supportedoauth2array['OAUTH_OTHER_NAME'] = array('callbackfile' => 'generic', 'picto' => 'generic', 'urlforapp' => 'OAUTH_OTHER_DESC', 'name'=>'Other', 'urlforcredentials'=>'', 'availablescopes'=>'Standard', 'returnurl'=>'/core/modules/oauth/generic_oauthcallback.php'); - // See https://learn.microsoft.com/fr-fr/azure/active-directory/develop/quickstart-register-app#register-an-application + $supportedoauth2array['OAUTH_OTHER_NAME'] = array( + 'callbackfile' => 'generic', + 'picto' => 'generic', + 'urlforapp' => 'OAUTH_OTHER_DESC', + 'name' => 'Other', + 'urlforcredentials' => '', + 'availablescopes' => 'Standard', + 'returnurl' => '/core/modules/oauth/generic_oauthcallback.php' + ); } From 60a52d0bc6121ad8d4c1cbfb68d4dfcf37e604ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Sep 2023 10:46:18 +0200 Subject: [PATCH 0932/1137] Remove TODO --- .../expedition/class/expeditionlinebatch.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/expedition/class/expeditionlinebatch.class.php b/htdocs/expedition/class/expeditionlinebatch.class.php index 73f352ac21a..10f13d8439c 100644 --- a/htdocs/expedition/class/expeditionlinebatch.class.php +++ b/htdocs/expedition/class/expeditionlinebatch.class.php @@ -44,8 +44,8 @@ class ExpeditionLineBatch extends CommonObject public $qty; public $dluo_qty; // deprecated, use qty public $entrepot_id; - public $fk_origin_stock; // rowid in llx_product_batch table - public $fk_warehouse; // for future use in v19 + public $fk_origin_stock; // rowid in llx_product_batch table (not usefull) + public $fk_warehouse; // warehouse ID public $fk_expeditiondet; @@ -63,7 +63,7 @@ class ExpeditionLineBatch extends CommonObject * Fill object based on a product-warehouse-batch's record * * @param int $id_stockdluo Rowid in product_batch table - * @return int -1 if KO, 1 if OK + * @return int -1 if KO, 1 if OK */ public function fetchFromStock($id_stockdluo) { @@ -72,7 +72,6 @@ class ExpeditionLineBatch extends CommonObject $sql .= " pl.sellby,"; $sql .= " pl.eatby,"; $sql .= " ps.fk_entrepot"; - $sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; $sql .= " JOIN ".MAIN_DB_PREFIX."product_stock as ps on pb.fk_product_stock=ps.rowid"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."product_lot as pl on pl.batch = pb.batch AND pl.fk_product = ps.fk_product"; @@ -124,7 +123,7 @@ class ExpeditionLineBatch extends CommonObject $sql .= ", batch"; $sql .= ", qty"; $sql .= ", fk_origin_stock"; - // TODO Add fk_warehouse here + $sql .= ", fk_warehouse"; $sql .= ") VALUES ("; $sql .= $id_line_expdet.","; $sql .= " ".(!isset($this->sellby) || dol_strlen($this->sellby) == 0 ? 'NULL' : ("'".$this->db->idate($this->sellby))."'").","; @@ -132,6 +131,7 @@ class ExpeditionLineBatch extends CommonObject $sql .= " ".(!isset($this->batch) ? 'NULL' : ("'".$this->db->escape($this->batch)."'")).","; $sql .= " ".(!isset($this->qty) ? ((!isset($this->dluo_qty)) ? 'NULL' : $this->dluo_qty) : $this->qty).","; // dluo_qty deprecated, use qty $sql .= " ".(!isset($this->fk_origin_stock) ? 'NULL' : $this->fk_origin_stock); + $sql .= " ".(!isset($this->fk_warehouse) ? 'NULL' : $this->fk_warehouse); $sql .= ")"; dol_syslog(__METHOD__, LOG_DEBUG); @@ -201,7 +201,8 @@ class ExpeditionLineBatch extends CommonObject $sql .= " eb.eatby as oldeatby,"; // deprecated $sql .= " eb.batch,"; $sql .= " eb.qty,"; - $sql .= " eb.fk_origin_stock"; + $sql .= " eb.fk_origin_stock,"; + $sql .= " eb.fk_warehouse"; if ($fk_product > 0) { $sql .= ", pl.sellby"; $sql .= ", pl.eatby"; @@ -228,6 +229,7 @@ class ExpeditionLineBatch extends CommonObject $tmp->id = $obj->rowid; $tmp->fk_origin_stock = $obj->fk_origin_stock; $tmp->fk_expeditiondet = $obj->fk_expeditiondet; + $tmp->fk_warehouse = $obj->fk_warehouse; $tmp->dluo_qty = $obj->qty; // dluo_qty deprecated, use qty $tmp->qty = $obj->qty; From 85bfa4de358b7db7c434e01a82909b91e0032e4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Sep 2023 10:53:07 +0200 Subject: [PATCH 0933/1137] Fix warning --- htdocs/core/modules/movement/doc/pdf_standard.modules.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 271c00a63f9..ac53946bb06 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -685,6 +685,14 @@ class pdf_standard extends ModelePDFMovement dol_print_error($this->db); } + // Display notes + $notetoshow = empty($object->note_public) ? '' : $object->note_public; + // Extrafields in note + $extranote = $this->getExtrafieldsInHtml($object, $outputlangs); + if (!empty($extranote)) { + $notetoshow = dol_concatdesc($notetoshow, $extranote); + } + if ($notetoshow) { $substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object); From 4ed109bae178eb2811730597b1c704c5e3204249 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 13 Sep 2023 11:18:40 +0200 Subject: [PATCH 0934/1137] FIX missing price levels in product price export --- htdocs/core/modules/modProduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 9b0a3b1aa8b..560fd286c2b 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -356,7 +356,7 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity; // export prices only for the current entity $this->export_sql_end[$r] .= ' WHERE p.entity IN ('.getEntity('product').')'; // For product and service profile - $this->export_sql_end[$r] .= ' AND pr.date_price = (SELECT MAX(pr2.date_price) FROM '.MAIN_DB_PREFIX.'product_price as pr2 WHERE pr2.fk_product = pr.fk_product AND pr2.entity IN ('.getEntity('product').'))'; // export only latest prices not full history + $this->export_sql_end[$r] .= ' AND pr.date_price = (SELECT MAX(pr2.date_price) FROM '.MAIN_DB_PREFIX.'product_price as pr2 WHERE pr2.fk_product = pr.fk_product AND pr2.price_level = pr.price_level AND pr2.entity IN ('.getEntity('product').'))'; // export only latest prices not full history $this->export_sql_end[$r] .= ' ORDER BY p.ref, pr.price_level'; } From ceaefa5b09b7c03017052abba2778181f309a044 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:29:22 +0300 Subject: [PATCH 0935/1137] FIX use getDolGlobalString() --- htdocs/societe/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 2c55b0e070d..969eda60f2b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -66,9 +66,9 @@ if (isModEnabled('eventorganization')) { } if ($mysoc->country_code == 'GR') { - $u = $conf->global->AADE_WEBSERVICE_USER; - $p = $conf->global->AADE_WEBSERVICE_KEY; - $myafm = $mysoc->tva_intra; + $u = getDolGlobalString('AADE_WEBSERVICE_USER'); + $p = getDolGlobalString('AADE_WEBSERVICE_KEY'); + $myafm = getDolGlobalString('MAIN_INFO_TVAINTRA'); } @@ -3370,7 +3370,7 @@ function GRVAT(a, u, p, myafm) { $.ajax({ type: "GET", url: "/societe/checkvat/checkVatGr.php", - data: { u: u, p: p, myafm: myafm, afm: afm }, // Set request parameters + data: { u, p, myafm, afm }, // Set request parameters success: function(data) { var obj = JSON.parse(data); // Parse response data as JSON From 04dd93bb44d6e40dac5aeb92799e1f6cc81b5ae7 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:29:28 +0300 Subject: [PATCH 0936/1137] FIX use getDolGlobalString() --- htdocs/admin/company.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index daba5b00427..0a7770bcc3d 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -858,7 +858,7 @@ print ""; // AADE webservices credentials, applicable only for Greece if ($mysoc->country_code == 'GR') { - print load_fiche_titre($langs->trans("AADEKeys"), '', ''); + print load_fiche_titre($langs->trans("AADEWebserviceCredentials"), '', ''); print ''; print ''; print ''; @@ -868,22 +868,22 @@ if ($mysoc->country_code == 'GR') { print ''; print ''; print ''; print ''; print '
'; From b1da68c048a52f6d7edcd9065eca49738f4f7d4c Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:29:39 +0300 Subject: [PATCH 0937/1137] FIX use getDolGlobalString() and include main.inc.php --- htdocs/societe/checkvat/checkVatGr.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/checkvat/checkVatGr.php b/htdocs/societe/checkvat/checkVatGr.php index 5c038800791..c2be6305faa 100644 --- a/htdocs/societe/checkvat/checkVatGr.php +++ b/htdocs/societe/checkvat/checkVatGr.php @@ -23,9 +23,11 @@ * \brief Request VAT details from the Greek Ministry of Finance GSIS SOAP web service */ -$username = (isset($_REQUEST['u']) ? $_REQUEST['u'] : ''); // Get username from request -$password = (isset($_REQUEST['p']) ? $_REQUEST['p'] : ''); // Get password from request -$myafm = (isset($_REQUEST['myafm']) ? $_REQUEST['myafm'] : ''); // Get Vat from request +require "../../main.inc.php"; + +$username = getDolGlobalString('AADE_WEBSERVICE_USER'); // Get username from request +$password = getDolGlobalString('AADE_WEBSERVICE_KEY'); // Get password from request +$myafm = getDolGlobalString('MAIN_INFO_TVAINTRA'); // Get Vat from request $afm = (isset($_REQUEST['afm']) ? $_REQUEST['afm'] : ''); // Get client Vat from request // Make call to check VAT for Greek client From bc89f535b1c4c232d8a95c038907ede7e6fbdcf8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Sep 2023 11:36:44 +0200 Subject: [PATCH 0938/1137] Qual: Clean code --- .../commande/doc/pdf_eratosthene.modules.php | 112 +++++---- .../doc/pdf_standard_myobject.modules.php | 214 ++++++++++-------- 2 files changed, 167 insertions(+), 159 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 8c2612fa683..eb1f9c29f84 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -162,11 +162,13 @@ class pdf_eratosthene extends ModelePDFCommandes // phpcs:enable global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines; + dol_syslog("write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null')); + if (!is_object($outputlangs)) { $outputlangs = $langs; } // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO - if (!empty($conf->global->MAIN_USE_FPDF)) { + if (getDolGlobalInt('MAIN_USE_FPDF')) { $outputlangs->charset_output = 'ISO-8859-1'; } @@ -180,23 +182,23 @@ class pdf_eratosthene extends ModelePDFCommandes global $outputlangsbis; $outputlangsbis = null; - if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) { + if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) { $outputlangsbis = new Translate('', $conf); - $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE); + $outputlangsbis->setDefaultLang(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')); $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries")); } - $nblines = count($object->lines); + $nblines = (is_array($object->lines) ? count($object->lines) : 0); $hidetop = 0; - if (!empty($conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE)) { - $hidetop = $conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE; + if (getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE')) { + $hidetop = getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE'); } // Loop on each lines to detect if there is at least one image to show $realpatharray = array(); $this->atleastonephoto = false; - if (!empty($conf->global->MAIN_GENERATE_ORDERS_WITH_PICTURE)) { + if (getDolGlobalInt('MAIN_GENERATE_ORDERS_WITH_PICTURE')) { $objphoto = new Product($this->db); for ($i = 0; $i < $nblines; $i++) { @@ -282,8 +284,8 @@ class pdf_eratosthene extends ModelePDFCommandes global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblines with the new command lines content after hook - $nblines = count($object->lines); + // Set nblines with the new lines content after hook + $nblines = (is_array($object->lines) ? count($object->lines) : 0); // Create pdf instance $pdf = pdf_getInstance($this->format); @@ -300,12 +302,12 @@ class pdf_eratosthene extends ModelePDFCommandes } $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Set path to the background PDF File - if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { + if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { $logodir = $conf->mycompany->dir_output; if (!empty($conf->mycompany->multidir_output[$object->entity])) { $logodir = $conf->mycompany->multidir_output[$object->entity]; } - $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); } @@ -349,6 +351,8 @@ class pdf_eratosthene extends ModelePDFCommandes $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; + $nexY = $tab_top - 1; + // Incoterm $height_incoterms = 0; if (isModEnabled('incoterm')) { @@ -369,7 +373,7 @@ class pdf_eratosthene extends ModelePDFCommandes } } - // Displays notes + // Display notes $notetoshow = empty($object->note_public) ? '' : $object->note_public; if (!empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) { // Get first sale rep @@ -382,7 +386,6 @@ class pdf_eratosthene extends ModelePDFCommandes } } } - // Extrafields in note $extranote = $this->getExtrafieldsInHtml($object, $outputlangs); if (!empty($extranote)) { @@ -559,7 +562,7 @@ class pdf_eratosthene extends ModelePDFCommandes $curY = $tab_top_newpage; // Allows data in the first page if description is long enough to break in multiples pages - if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) { + if (getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE')) { $showpricebeforepagebreak = 1; } else { $showpricebeforepagebreak = 0; @@ -595,20 +598,18 @@ class pdf_eratosthene extends ModelePDFCommandes if (!empty($tplidx)) { $pdf->useTemplate($tplidx); } - //if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); $pdf->setPage($pageposafter + 1); } } else { // We found a page break // Allows data in the first page if description is long enough to break in multiples pages - if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) { + if (getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE')) { $showpricebeforepagebreak = 1; } else { $showpricebeforepagebreak = 0; } } - } else // No pagebreak - { + } else { // No pagebreak $pdf->commitTransaction(); } $posYAfterDescription = $pdf->GetY(); @@ -720,17 +721,6 @@ class pdf_eratosthene extends ModelePDFCommandes $localtax1_type = $object->lines[$i]->localtax1_type; $localtax2_type = $object->lines[$i]->localtax2_type; - // TODO remise_percent is an obsolete field for object parent - /*if ($object->remise_percent) { - $tvaligne -= ($tvaligne * $object->remise_percent) / 100; - } - if ($object->remise_percent) { - $localtax1ligne -= ($localtax1ligne * $object->remise_percent) / 100; - } - if ($object->remise_percent) { - $localtax2ligne -= ($localtax2ligne * $object->remise_percent) / 100; - }*/ - $vatrate = (string) $object->lines[$i]->tva_tx; // Retrieve type from database for backward compatibility with old records @@ -773,7 +763,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); // Add line - if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) { + if (getDolGlobalInt('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); @@ -786,9 +776,9 @@ class pdf_eratosthene extends ModelePDFCommandes while ($pagenb < $pageposafter) { $pdf->setPage($pagenb); if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; @@ -803,9 +793,9 @@ class pdf_eratosthene extends ModelePDFCommandes } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { if ($pagenb == $pageposafter) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis); } $this->_pagefoot($pdf, $object, $outputlangs, 1); // New page @@ -822,9 +812,9 @@ class pdf_eratosthene extends ModelePDFCommandes // Show square if ($pagenb == $pageposbeforeprintlines) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); } $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; @@ -834,7 +824,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Display total zone $posy = $this->drawTotalTable($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); - // Affiche zone versements + // Display payment area /* if ($deja_regle) { @@ -842,7 +832,7 @@ class pdf_eratosthene extends ModelePDFCommandes } */ - // Pied de page + // Pagefoot $this->_pagefoot($pdf, $object, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) { $pdf->AliasNbPages(); @@ -1368,7 +1358,7 @@ class pdf_eratosthene extends ModelePDFCommandes if (empty($hidetop)) { $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency)); - if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { + if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { $titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency)); } @@ -1376,7 +1366,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; - if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) { + if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); } } @@ -1406,7 +1396,7 @@ class pdf_eratosthene extends ModelePDFCommandes * @param Translate $outputlangs Object lang for output * @param Translate $outputlangsbis Object lang for output bis * @param string $titlekey Translation key to show as title of document - * @return int Return topshift value + * @return float|int Return topshift value */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null, $titlekey = "PdfOrderTitle") { @@ -1464,7 +1454,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities($titlekey); - if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { + if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { $title .= ' - '; $title .= $outputlangsbis->transnoentities($titlekey); } @@ -1500,7 +1490,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".dol_trunc($outputlangs->convToOutputCharset($object->ref_client), 65), '', 'R'); } - if (!empty($conf->global->PDF_SHOW_PROJECT_TITLE)) { + if (getDolGlobalInt('PDF_SHOW_PROJECT_TITLE')) { $object->fetch_projet(); if (!empty($object->project->ref)) { $posy += 3; @@ -1510,7 +1500,7 @@ class pdf_eratosthene extends ModelePDFCommandes } } - if (!empty($conf->global->PDF_SHOW_PROJECT)) { + if (getDolGlobalInt('PDF_SHOW_PROJECT')) { $object->fetch_projet(); if (!empty($object->project->ref)) { $outputlangs->load("projects"); @@ -1526,7 +1516,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("OrderDate"); - if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) { + if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { $title .= ' - '.$outputlangsbis->transnoentities("DateInvoice"); } $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); @@ -1539,7 +1529,7 @@ class pdf_eratosthene extends ModelePDFCommandes } // Get contact - if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) { + if (getDolGlobalInt('DOC_SHOW_FIRST_SALES_REP')) { $arrayidcontact = $object->getIdContact('internal', 'SALESREPFOLL'); if (count($arrayidcontact) > 0) { $usertmp = new User($this->db); @@ -1581,15 +1571,15 @@ class pdf_eratosthene extends ModelePDFCommandes $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); // Show sender - $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42; + $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; $posy += $top_shift; $posx = $this->marge_gauche; - if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) { + if (getDolGlobalInt('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->page_largeur - $this->marge_droite - 80; } - $hautcadre = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40; - $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82; + $hautcadre = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 38 : 40; + $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 82; // Show sender frame @@ -1626,26 +1616,28 @@ class pdf_eratosthene extends ModelePDFCommandes } //Recipient name - if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + if ($usecontact && $object->contact->socid != $object->thirdparty->id && getDolGlobalInt('MAIN_USE_COMPANY_NAME_OF_CONTACT')) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; } - $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); + if (is_object($thirdparty)) { + $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); + } $mode = 'target'; $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); // Show recipient - $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100; + $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; if ($this->page_largeur < 210) { $widthrecbox = 84; // To work with US executive format } - $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42; + $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42; $posy += $top_shift; $posx = $this->page_largeur - $this->marge_droite - $widthrecbox; - if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) { + if (getDolGlobalInt('MAIN_INVERT_SENDER_RECIPIENT')) { $posx = $this->marge_gauche; } @@ -1761,7 +1753,7 @@ class pdf_eratosthene extends ModelePDFCommandes $rank = $rank + 10; $this->cols['photo'] = array( 'rank' => $rank, - 'width' => (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH), // in mm + 'width' => (!getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH') ? 20 : getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')), // in mm 'status' => false, 'title' => array( 'textkey' => 'Photo', @@ -1773,7 +1765,7 @@ class pdf_eratosthene extends ModelePDFCommandes 'border-left' => false, // remove left line separator ); - if (!empty($conf->global->MAIN_GENERATE_ORDERS_WITH_PICTURE) && !empty($this->atleastonephoto)) { + if (getDolGlobalInt('MAIN_GENERATE_ORDERS_WITH_PICTURE') && !empty($this->atleastonephoto)) { $this->cols['photo']['status'] = true; } @@ -1788,7 +1780,7 @@ class pdf_eratosthene extends ModelePDFCommandes 'border-left' => true, // add left line separator ); - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) { + if (!getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) { $this->cols['vat']['status'] = true; } @@ -1857,7 +1849,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->cols['totalexcltax'] = array( 'rank' => $rank, 'width' => 26, // in mm - 'status' => empty($conf->global->PDF_PROPAL_HIDE_PRICE_EXCL_TAX) ? true : false, + 'status' => empty($conf->global->PDF_ORDER_HIDE_PRICE_EXCL_TAX) ? true : false, 'title' => array( 'textkey' => 'TotalHTShort' ), @@ -1868,7 +1860,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->cols['totalincltax'] = array( 'rank' => $rank, 'width' => 26, // in mm - 'status' => empty($conf->global->PDF_PROPAL_SHOW_PRICE_INCL_TAX) ? false : true, + 'status' => empty($conf->global->PDF_ORDER_SHOW_PRICE_INCL_TAX) ? false : true, 'title' => array( 'textkey' => 'TotalTTCShort' ), diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 9826936f8ab..d4836dc773e 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -48,6 +48,11 @@ class pdf_standard_myobject extends ModelePDFMyObject */ public $db; + /** + * @var int The environment ID when using a multicompany module + */ + public $entity; + /** * @var string model name */ @@ -86,12 +91,6 @@ class pdf_standard_myobject extends ModelePDFMyObject */ public $emetteur; - /** - * @var bool Situation invoice type - */ - public $situationinvoice; - - /** * @var array of document table columns */ @@ -141,11 +140,11 @@ class pdf_standard_myobject extends ModelePDFMyObject // Use new system for position of columns, view $this->defineColumnField() $this->tva = array(); + $this->tva_array = array(); $this->localtax1 = array(); $this->localtax2 = array(); $this->atleastoneratenotnull = 0; $this->atleastonediscount = 0; - $this->situationinvoice = false; } @@ -153,7 +152,7 @@ class pdf_standard_myobject extends ModelePDFMyObject /** * Function to build pdf onto disk * - * @param Object $object Object to generate + * @param MyObject $object Object to generate * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -179,8 +178,14 @@ class pdf_standard_myobject extends ModelePDFMyObject // Load translation files required by the page $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies")); + // Show Draft Watermark + if (getDolGlobalString('MYOBJECT_DRAFT_WATERMARK') && $object->statut == $object::STATUS_DRAFT) { + $this->watermark = getDolGlobalString('MYOBJECT_DRAFT_WATERMARK'); + } + + global $outputlangsbis; + $outputlangsbis = null; if (getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE') && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) { - global $outputlangsbis; $outputlangsbis = new Translate('', $conf); $outputlangsbis->setDefaultLang(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')); $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies")); @@ -200,10 +205,12 @@ class pdf_standard_myobject extends ModelePDFMyObject if (getDolGlobalInt('MAIN_GENERATE_MYOBJECT_WITH_PICTURE'))) { $objphoto = new Product($this->db); - for ($i = 0; $i < $nblines; $i++) - { - if (empty($object->lines[$i]->fk_product)) continue; + for ($i = 0; $i < $nblines; $i++) { + if (empty($object->lines[$i]->fk_product)) { + continue; + } + $objphoto->fetch($object->lines[$i]->fk_product); //var_dump($objphoto->ref);exit; if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; @@ -214,18 +221,17 @@ class pdf_standard_myobject extends ModelePDFMyObject } $arephoto = false; - foreach ($pdir as $midir) - { - if (!$arephoto) - { - $dir = $conf->product->dir_output.'/'.$midir; + foreach ($pdir as $midir) { + if (!$arephoto) { + if ($conf->entity != $objphoto->entity) { + $dir = $conf->product->multidir_output[$objphoto->entity].'/'.$midir; //Check repertories of current entities + } else { + $dir = $conf->product->dir_output.'/'.$midir; //Check repertory of the current product + } - foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) - { - if (!getDolGlobalInt('CAT_HIGH_QUALITY_IMAGES')) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo - { - if ($obj['photo_vignette']) - { + foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { + if (!getDolGlobalInt('CAT_HIGH_QUALITY_IMAGES')) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo + if ($obj['photo_vignette']) { $filename = $obj['photo_vignette']; } else { $filename = $obj['photo']; @@ -241,23 +247,25 @@ class pdf_standard_myobject extends ModelePDFMyObject } } - if ($realpath && $arephoto) $realpatharray[$i] = $realpath; + if ($realpath && $arephoto) { + $realpatharray[$i] = $realpath; + } } } */ //if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva; - if ($conf->mymodule->dir_output.'/myobject') { + if (getMultidirOutput($object)) { $object->fetch_thirdparty(); // Definition of $dir and $file if ($object->specimen) { - $dir = $conf->mymodule->dir_output.'/myobject'; + $dir = getMultidirOutput($object); $file = $dir."/SPECIMEN.pdf"; } else { $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->mymodule->dir_output.'/myobject/'.$objectref; + $dir = getMultidirOutput($object)."/".$objectref; $file = $dir."/".$objectref.".pdf"; } if (!file_exists($dir)) { @@ -269,12 +277,16 @@ class pdf_standard_myobject extends ModelePDFMyObject if (file_exists($dir)) { // Add pdfgeneration hook + if (!is_object($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($this->db); + } $hookmanager->initHooks(array('pdfgeneration')); $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - // Set nblines with the new facture lines content after hook + // Set nblines with the new lines content after hook $nblines = (is_array($object->lines) ? count($object->lines) : 0); // Create pdf instance @@ -294,7 +306,11 @@ class pdf_standard_myobject extends ModelePDFMyObject // Set path to the background PDF File if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); $tplidx = $pdf->importPage(1); } @@ -330,6 +346,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right + // New page $pdf->AddPage(); if (!empty($tplidx)) { @@ -344,7 +361,9 @@ class pdf_standard_myobject extends ModelePDFMyObject $tab_top = 90 + $top_shift; $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); - $tab_height = 130 - $top_shift; + + $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; + $tab_height_newpage = 150; if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $tab_height_newpage -= $top_shift; @@ -453,8 +472,8 @@ class pdf_standard_myobject extends ModelePDFMyObject } $height_note = $posyafter - $tab_top_newpage; $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); - } else // No pagebreak - { + } else { + // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $tab_top; @@ -514,6 +533,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $showpricebeforepagebreak = 1; $posYAfterImage = 0; + $posYAfterDescription = 0; if ($this->getColumnStatus('photo')) { // We start with Photo of product line @@ -535,7 +555,7 @@ class pdf_standard_myobject extends ModelePDFMyObject } if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) { - $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi + $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + 1, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi // $pdf->Image does not increase value return by getY, so we save it manually $posYAfterImage = $curY + $imglinesize['height']; } @@ -550,6 +570,7 @@ class pdf_standard_myobject extends ModelePDFMyObject if ($pageposafter > $pageposbefore) { // There is a pagebreak $pdf->rollbackTransaction(true); + $pageposafter = $pageposbefore; $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); @@ -574,13 +595,15 @@ class pdf_standard_myobject extends ModelePDFMyObject $showpricebeforepagebreak = 0; } } - } else // No pagebreak - { + } else { // No pagebreak $pdf->commitTransaction(); } + $posYAfterDescription = $pdf->GetY(); } - $nexY = $pdf->GetY(); + $nexY = max($pdf->GetY(), $posYAfterImage); + + $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); @@ -588,10 +611,11 @@ class pdf_standard_myobject extends ModelePDFMyObject // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + $pdf->setPage($pageposafter); + $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font // Quantity // Enough for 6 chars @@ -649,16 +673,6 @@ class pdf_standard_myobject extends ModelePDFMyObject $localtax1_type = $object->lines[$i]->localtax1_type; $localtax2_type = $object->lines[$i]->localtax2_type; - if ($object->remise_percent) { - $tvaligne -= ($tvaligne * $object->remise_percent) / 100; - } - if ($object->remise_percent) { - $localtax1ligne -= ($localtax1ligne * $object->remise_percent) / 100; - } - if ($object->remise_percent) { - $localtax2ligne -= ($localtax2ligne * $object->remise_percent) / 100; - } - $vatrate = (string) $object->lines[$i]->tva_tx; // Retrieve type from database for backward compatibility with old records @@ -688,10 +702,17 @@ class pdf_standard_myobject extends ModelePDFMyObject if (($object->lines[$i]->info_bits & 0x01) == 0x01) { $vatrate .= '*'; } + + // Fill $this->tva and $this->tva_array if (!isset($this->tva[$vatrate])) { $this->tva[$vatrate] = 0; } $this->tva[$vatrate] += $tvaligne; + $vatcode = $object->lines[$i]->vat_src_code; + if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; + } + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); $nexY = max($nexY, $posYAfterImage); @@ -746,11 +767,10 @@ class pdf_standard_myobject extends ModelePDFMyObject // Show square if ($pagenb == $pageposbeforeprintlines) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis); - $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } else { $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis); - $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } + $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Display infos area //$posy = $this->drawInfoTable($pdf, $object, $bottomlasttab, $outputlangs); @@ -760,7 +780,7 @@ class pdf_standard_myobject extends ModelePDFMyObject // Display payment area /* - if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && !getDolGlobalInt('INVOICE_NO_PAYMENT_DETAILS'))) + if ($deja_regle) { $posy = $this->drawPaymentsTable($pdf, $object, $posy, $outputlangs); } @@ -881,7 +901,7 @@ class pdf_standard_myobject extends ModelePDFMyObject * Show top header of page. * * @param TCPDF $pdf Object PDF - * @param Object $object Object to show + * @param MyObject $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @param Translate $outputlangsbis Object lang for output bis @@ -889,8 +909,12 @@ class pdf_standard_myobject extends ModelePDFMyObject */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null) { + // phpcs:enable global $conf, $langs; + $ltrdirection = 'L'; + if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; + // Load traductions files required by page $outputlangs->loadLangs(array("main", "bills", "propal", "companies")); @@ -899,7 +923,7 @@ class pdf_standard_myobject extends ModelePDFMyObject pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == $object::STATUS_DRAFT && getDolGlobalString('MYMODULE_DRAFT_WATERMARK')) { + if (getDolGlobalString('MYMODULE_DRAFT_WATERMARK') && $object->statut == $object::STATUS_DRAFT) { pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', dol_escape_htmltag(getDolGlobalString('MYMODULE_DRAFT_WATERMARK'))); } @@ -917,8 +941,8 @@ class pdf_standard_myobject extends ModelePDFMyObject if (!getDolGlobalInt('PDF_DISABLE_MYCOMPANY_LOGO')) { if ($this->emetteur->logo) { $logodir = $conf->mycompany->dir_output; - if (!empty($conf->mycompany->multidir_output[$object->entity])) { - $logodir = $conf->mycompany->multidir_output[$object->entity]; + if (!empty(getMultidirOutput($object, 'mycompany'))) { + $logodir = getMultidirOutput($object, 'mycompany'); } if (!getDolGlobalInt('MAIN_PDF_USE_LARGE_LOGO')) { $logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small; @@ -944,7 +968,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("PdfTitle"); - if (getDolGlobalInt('MAIN_ODT_AS_PDF') && is_object($outputlangsbis)) { + if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { $title .= ' - '; $title .= $outputlangsbis->transnoentities("PdfTitle"); } @@ -969,7 +993,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".dol_trunc($outputlangs->convToOutputCharset($object->ref_client), 65), '', 'R'); } if (getDolGlobalInt('PDF_SHOW_PROJECT_TITLE')) { @@ -978,7 +1002,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $posy += 3; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : ".(empty($object->project->title) ? '' : $object->projet->title), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("Project")." : ".(empty($object->project->title) ? '' : $object->project->title), '', 'R'); } } @@ -1001,9 +1025,9 @@ class pdf_standard_myobject extends ModelePDFMyObject if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) { $title .= ' - '.$outputlangsbis->transnoentities("Date"); } - $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R'); + $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if (empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 3; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); @@ -1050,27 +1074,31 @@ class pdf_standard_myobject extends ModelePDFMyObject // Show sender frame - $pdf->SetTextColor(0, 0, 0); - $pdf->SetFont('', '', $default_font_size - 2); - $pdf->SetXY($posx, $posy - 5); - $pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); - $pdf->SetXY($posx, $posy); - $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); - $pdf->SetTextColor(0, 0, 60); + if (empty($conf->global->MAIN_PDF_NO_SENDER_FRAME)) { + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFont('', '', $default_font_size - 2); + $pdf->SetXY($posx, $posy - 5); + $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom").":", 0, $ltrdirection); + $pdf->SetXY($posx, $posy); + $pdf->SetFillColor(230, 230, 230); + $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->SetTextColor(0, 0, 60); + } // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); $pdf->SetFont('', '', $default_font_size - 1); - $pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0, 'L'); + $pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0, $ltrdirection); - // If BILLING contact defined on invoice, we use it + // If BILLING contact defined, we use it $usecontact = false; $arrayidcontact = $object->getIdContact('external', 'BILLING'); if (count($arrayidcontact) > 0) { @@ -1079,7 +1107,7 @@ class pdf_standard_myobject extends ModelePDFMyObject } // Recipient name - if ($object->contact->socid != $object->thirdparty->id && getDolGlobalInt('MAIN_USE_COMPANY_NAME_OF_CONTACT')) { + if ($usecontact && $object->contact->socid != $object->thirdparty->id && getDolGlobalInt('MAIN_USE_COMPANY_NAME_OF_CONTACT')) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; @@ -1089,7 +1117,8 @@ class pdf_standard_myobject extends ModelePDFMyObject $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); } - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $mode = 'target'; + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); // Show recipient $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; @@ -1104,23 +1133,25 @@ class pdf_standard_myobject extends ModelePDFMyObject } // Show recipient frame - $pdf->SetTextColor(0, 0, 0); - $pdf->SetFont('', '', $default_font_size - 2); - $pdf->SetXY($posx + 2, $posy - 5); - $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":", 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + if (empty($conf->global->MAIN_PDF_NO_RECIPENT_FRAME)) { + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFont('', '', $default_font_size - 2); + $pdf->SetXY($posx + 2, $posy - 5); + $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("To").":", 0, $ltrdirection); + $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + } // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L'); + $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); - $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); + $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection); } $pdf->SetTextColor(0, 0, 0); @@ -1264,21 +1295,6 @@ class pdf_standard_myobject extends ModelePDFMyObject 'border-left' => true, // add left line separator ); - $rank = $rank + 10; - $this->cols['progress'] = array( - 'rank' => $rank, - 'width' => 19, // in mm - 'status' => false, - 'title' => array( - 'textkey' => 'Progress' - ), - 'border-left' => true, // add left line separator - ); - - if ($this->situationinvoice) { - $this->cols['progress']['status'] = true; - } - $rank = $rank + 10; $this->cols['unit'] = array( 'rank' => $rank, @@ -1313,7 +1329,7 @@ class pdf_standard_myobject extends ModelePDFMyObject 'width' => 26, // in mm 'status' => true, 'title' => array( - 'textkey' => 'TotalHT' + 'textkey' => 'TotalHTShort' ), 'border-left' => true, // add left line separator ); From 257f927a849f380f860a07741bda5b8ce758cf57 Mon Sep 17 00:00:00 2001 From: Alessandro Forte Date: Wed, 13 Sep 2023 12:36:30 +0200 Subject: [PATCH 0939/1137] New: Update Ticket translation for it_IT --- htdocs/langs/it_IT/ticket.lang | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/htdocs/langs/it_IT/ticket.lang b/htdocs/langs/it_IT/ticket.lang index 79694b95fa9..8236e73e482 100644 --- a/htdocs/langs/it_IT/ticket.lang +++ b/htdocs/langs/it_IT/ticket.lang @@ -168,7 +168,7 @@ TicketAssignedToMeInfos=Questa pagina visualizza l'elenco dei ticket creati o as NoTicketsFound=Nessun ticket trovato NoUnreadTicketsFound=Nessun ticket non letto trovato TicketViewAllTickets=Visualizza tutti i ticket -TicketViewNonClosedOnly=View only open tickets +TicketViewNonClosedOnly=Visualizza solo i ticket aperti TicketStatByStatus=Ticket per stato OrderByDateAsc=Ordina per data crescente OrderByDateDesc=Ordina per data decrescente @@ -188,46 +188,46 @@ TicketsManagement=Gestione dei ticket CreatedBy=Creato da NewTicket=Nuovo Ticket SubjectAnswerToTicket=Risposta al ticket -TicketTypeRequest=Request type +TicketTypeRequest=Tipo di richiesta TicketCategory=Gruppo di ticket -SeeTicket=See ticket -TicketMarkedAsRead=Ticket has been marked as read -TicketReadOn=Read on +SeeTicket=Visualizza ticket +TicketMarkedAsRead=Ticket contrassegnato come letto +TicketReadOn=Continuare a leggere TicketCloseOn=Data di chiusura -MarkAsRead=Mark ticket as read -TicketHistory=Ticket history +MarkAsRead=Contrassegna il Ticket come letto +TicketHistory=Storia Ticket AssignUser=Assegna all'utente -TicketAssigned=Ticket is now assigned -TicketChangeType=Change type +TicketAssigned=Ticket assegnato +TicketChangeType=Cambia tipo TicketChangeCategory=Change analytic code TicketChangeSeverity=Cambia gravità -TicketAddMessage=Add or send a message -TicketAddPrivateMessage=Add a private message -MessageSuccessfullyAdded=Ticket added +TicketAddMessage=Aggiungi o invia un messaggio +TicketAddPrivateMessage=Aggiungi un messaggio privato +MessageSuccessfullyAdded=Ticket aggiunto TicketMessageSuccessfullyAdded=Messaggio aggiunto con successo -TicketMessagesList=Message list -NoMsgForThisTicket=No message for this ticket -TicketProperties=Classification -LatestNewTickets=Latest %s newest tickets (not read) +TicketMessagesList=Lista Messaggi +NoMsgForThisTicket=Nessun messaggio per questo ticket +TicketProperties=Classificazione +LatestNewTickets=Ultimi %s ticket più recenti (non letti) TicketSeverity=Gravità -ShowTicket=See ticket +ShowTicket=Vedi ticket RelatedTickets=Ticket correlati TicketAddIntervention=Crea intervento CloseTicket=Chiudi|Risolvi AbandonTicket=Abbandona CloseATicket=Chiudi|Risolvi un ticket -ConfirmCloseAticket=Confirm ticket closing -ConfirmAbandonTicket=Confermi la chiusura del biglietto allo stato 'Abbandonato' -ConfirmDeleteTicket=Please confirm ticket deleting -TicketDeletedSuccess=Ticket deleted with success -TicketMarkedAsClosed=Ticket marked as closed -TicketDurationAuto=Calculated duration -TicketDurationAutoInfos=Duration calculated automatically from intervention related -TicketUpdated=Ticket updated -SendMessageByEmail=Send message by email -TicketNewMessage=New message +ConfirmCloseAticket=Conferma la chiusura del ticket +ConfirmAbandonTicket=Confermi la chiusura del ticket allo stato 'Abbandonato' +ConfirmDeleteTicket=Conferma l'eliminazione del ticket +TicketDeletedSuccess=Ticket eliminato con successo +TicketMarkedAsClosed=Ticket contrassegnato come chiuso +TicketDurationAuto=Durata calcolata +TicketDurationAutoInfos=Durata calcolata automaticamente dall'intervento correlato +TicketUpdated=Ticket aggiornato +SendMessageByEmail=Invia messaggio tramite e-mail +TicketNewMessage=Nuovo messaggio ErrorMailRecipientIsEmptyForSendTicketMessage=Il destinatario è vuoto. Nessuna email inviata -TicketGoIntoContactTab=Please go into "Contacts" tab to select them +TicketGoIntoContactTab=Vai alla scheda "Contatti" per selezionarli TicketMessageMailIntro=Intestazione del messaggio TicketMessageMailIntroHelp=Questo testo viene aggiunto solo all'inizio dell'email e non verrà salvato TicketMessageMailIntroText=Ciao,
Una nuova risposta è stata aggiunta a un ticket che segui. Ecco il messaggio:
From efcf2e25fedb5a762d054127d627b2e52c1e146f Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 13 Sep 2023 14:41:12 +0200 Subject: [PATCH 0940/1137] Add index to commande_fournisseur_dispatch --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 1 + .../mysql/tables/llx_commande_fournisseur_dispatch.key.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index 31cdc975ccf..bf6b1aecc2e 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -110,3 +110,4 @@ ALTER TABLE llx_expeditiondet_batch ADD COLUMN fk_warehouse DEFAULT NULL; UPDATE llx_societe_account SET site = 'dolibarr_website' WHERE fk_website > 0 AND site IS NULL; ALTER TABLE llx_societe_account MODIFY COLUMN site varchar(128) NOT NULL; +ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_commandefourndet (fk_commandefourndet); diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.key.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.key.sql index 62d62a2ec38..98cb3db837f 100644 --- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.key.sql +++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.key.sql @@ -20,3 +20,4 @@ ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_reception (fk_reception); ALTER TABLE llx_commande_fournisseur_dispatch ADD CONSTRAINT fk_commande_fournisseur_dispatch_fk_reception FOREIGN KEY (fk_reception) REFERENCES llx_reception (rowid); ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_product (fk_product); +ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX idx_commande_fournisseur_dispatch_fk_commandefourndet (fk_commandefourndet); From d8ad2afc4fba54127620a4c33607baf12fd34290 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 13 Sep 2023 14:41:44 +0200 Subject: [PATCH 0941/1137] Fix migration --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_expeditiondet_batch.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index bf6b1aecc2e..e3638b1e732 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -104,7 +104,7 @@ INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PROPOSAL_ALL ALTER TABLE llx_bookcal_availabilities ADD COLUMN fk_bookcal_calendar integer NOT NULL; ALTER TABLE llx_bookcal_calendar ADD COLUMN visibility integer NOT NULL DEFAULT 1; -ALTER TABLE llx_expeditiondet_batch ADD COLUMN fk_warehouse DEFAULT NULL; +ALTER TABLE llx_expeditiondet_batch ADD COLUMN fk_warehouse integer DEFAULT NULL; -- Update website type UPDATE llx_societe_account SET site = 'dolibarr_website' WHERE fk_website > 0 AND site IS NULL; diff --git a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql index e62c503af9a..32d2b8f1b37 100644 --- a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql +++ b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql @@ -25,6 +25,6 @@ CREATE TABLE llx_expeditiondet_batch ( batch varchar(128) DEFAULT NULL, -- serial/lot number qty double NOT NULL DEFAULT '0', -- qty to move fk_origin_stock integer NOT NULL, -- Not useful. ID into table llx_product_batch (llx_product_batch may be renamed into llx_product_stock_batch in another version). TODO We should add and use instead a fk_warehouse field - fk_warehouse DEFAULT NULL -- ID of warehouse to use for the stock change + fk_warehouse integer DEFAULT NULL -- ID of warehouse to use for the stock change ) ENGINE=innodb; From 94c8a41917c18e42c51c530cea24de85f2dd09fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 13 Sep 2023 16:36:46 +0200 Subject: [PATCH 0942/1137] fix sql --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 3 +-- htdocs/install/mysql/tables/llx_expeditiondet_batch.sql | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index 31cdc975ccf..1845426bdc5 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -104,9 +104,8 @@ INSERT INTO llx_const (name, entity, value, type, visible) VALUES ('PROPOSAL_ALL ALTER TABLE llx_bookcal_availabilities ADD COLUMN fk_bookcal_calendar integer NOT NULL; ALTER TABLE llx_bookcal_calendar ADD COLUMN visibility integer NOT NULL DEFAULT 1; -ALTER TABLE llx_expeditiondet_batch ADD COLUMN fk_warehouse DEFAULT NULL; +ALTER TABLE llx_expeditiondet_batch ADD COLUMN fk_warehouse integer DEFAULT NULL; -- Update website type UPDATE llx_societe_account SET site = 'dolibarr_website' WHERE fk_website > 0 AND site IS NULL; ALTER TABLE llx_societe_account MODIFY COLUMN site varchar(128) NOT NULL; - diff --git a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql index e62c503af9a..a8111e67cb9 100644 --- a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql +++ b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql @@ -25,6 +25,5 @@ CREATE TABLE llx_expeditiondet_batch ( batch varchar(128) DEFAULT NULL, -- serial/lot number qty double NOT NULL DEFAULT '0', -- qty to move fk_origin_stock integer NOT NULL, -- Not useful. ID into table llx_product_batch (llx_product_batch may be renamed into llx_product_stock_batch in another version). TODO We should add and use instead a fk_warehouse field - fk_warehouse DEFAULT NULL -- ID of warehouse to use for the stock change + fk_warehouse integer DEFAULT NULL -- ID of warehouse to use for the stock change ) ENGINE=innodb; - From 6c5bef8294d1e65f5e2cfbb7039f06b292e74a09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Sep 2023 18:16:31 +0200 Subject: [PATCH 0943/1137] FIX #25894 --- htdocs/core/lib/project.lib.php | 14 ++++++++------ htdocs/projet/tasks/time.php | 14 +++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 32b113623c1..de8a8af47db 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1111,13 +1111,15 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } // Check if Extrafields is totalizable - foreach ($extrafields->attributes['projet_task']['totalizable'] as $key => $value) { - if (!empty($arrayfields['ef.'.$key]['checked']) && $arrayfields['ef.'.$key]['checked'] == 1) { - print '
'; } - print ''; } } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index ca231b418d3..00598eab4a9 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1278,8 +1278,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1); } $arrayfields['t.element_duration'] = array('label'=>$langs->trans("Duration"), 'checked'=>1); - $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>(empty($conf->salaries->enabled) ? 0 : 1)); - $arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((!empty($conf->global->PROJECT_HIDE_TASKS) || empty($conf->global->PROJECT_BILL_TIME_SPENT)) ? 0 : 1) && $projectstatic->usage_bill_time)); + $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries")); + $arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); // Extra fields include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -1407,7 +1407,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Form to convert time spent into invoice if ($massaction == 'generateinvoice') { - if ($projectstatic->thirdparty->id > 0) { + if (!empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0) { print '
'.$langs->trans("AccountParameter").'
'; print ''.$langs->trans("MYDATA_AADE_USER").''; - print '
'; print ''.$langs->trans("MYDATA_AADE_KEY").''; - print 'global->MYDATA_AADE_KEY.'"'; + print '
'; print ''.$langs->trans("AADE_WEBSERVICE_USER").''; - print '
'; print ''.$langs->trans("AADE_WEBSERVICE_KEY").''; - print '
'; - if ($value == 1) { - print empty($totalarray['totalizable'][$key]['total']) ? '' : $totalarray['totalizable'][$key]['total']; + if (!empty($extrafields->attributes['projet_task']['totalizable'])) { + foreach ($extrafields->attributes['projet_task']['totalizable'] as $key => $value) { + if (!empty($arrayfields['ef.'.$key]['checked']) && $arrayfields['ef.'.$key]['checked'] == 1) { + print ''; + if ($value == 1) { + print empty($totalarray['totalizable'][$key]['total']) ? '' : $totalarray['totalizable'][$key]['total']; + } + print '
'; print ''; print '
'; @@ -1497,7 +1497,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Form to convert time spent into invoice print ''; - if ($projectstatic->thirdparty->id > 0) { + if (!empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0) { print '
'; print ''; print ''; @@ -1719,7 +1719,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser /* * Form to add a new line of time spent */ - if ($action == 'createtime' && $user->rights->projet->time) { + if ($action == 'createtime' && $user->hasRight('projet', 'time')) { print '' . "\n"; if (!empty($id)) { print ''; @@ -1743,7 +1743,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { print ''; - if (isModEnabled("service") && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { + if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { print ''; } } @@ -1822,7 +1822,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; - if (isModEnabled("service") && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { + if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { print ''."\n"; From 86ab16b6977eb83bb90502cf8743c299a5b02106 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Sep 2023 18:29:58 +0200 Subject: [PATCH 0945/1137] Fix bad name convetion for intervention --- htdocs/core/lib/functions.lib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3c5b5c5c0f9..e77226eb5df 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -123,12 +123,18 @@ if (!function_exists('str_contains')) { function getMultidirOutput($object, $module = '') { global $conf; + if (!is_object($object) && empty($module)) { return null; } if (empty($module) && !empty($object->element)) { $module = $object->element; } + // Special case for backward compatibility + if ($module == 'fichinter') { + $module = 'ficheinter'; + } + return $conf->$module->multidir_output[(!empty($object->entity) ? $object->entity : $conf->entity)]; } From 154ce1329f361b07a80142696bf3a7ef196cf768 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Wed, 13 Sep 2023 22:58:36 +0200 Subject: [PATCH 0946/1137] adding mariadb and mariadb-dump to the list of restricted os commands --- htdocs/admin/system/security.php | 2 +- htdocs/conf/conf.php.example | 4 ++-- htdocs/install/step1.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b268c27c98c..cf07784e436 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -323,7 +323,7 @@ if (empty($dolibarr_main_restrict_os_commands)) { } else { print $dolibarr_main_restrict_os_commands; } -print ' ('.$langs->trans("RecommendedValueIs", 'mysqldump, mysql, pg_dump, pgrestore, clamdscan').')'; +print ' ('.$langs->trans("RecommendedValueIs", 'mysqldump, mysql, pg_dump, pgrestore, mariadb, mariadb-dump, clamdscan').')'; print '
'; if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) { diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index f186080a2a2..d1eedc42427 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -284,11 +284,11 @@ $dolibarr_main_prod='1'; // ================================== // To restrict commands you can execute by the backup feature, enter allowed command here. // Note: If you can, defining permission on OS linux (using SELinux for example) may be a better choice. -// Default value: 'mysqldump, mysql, pg_dump, pgrestore' +// Default value: 'mysqldump, mysql, pg_dump, pgrestore, mariadb, mariadb-dump' // Examples: // $dolibarr_main_restrict_os_commands='mysqldump, /usr/local/bin/otherdumptool'; // -$dolibarr_main_restrict_os_commands='mysqldump, mysql, pg_dump, pgrestore'; +$dolibarr_main_restrict_os_commands='mysqldump, mysql, pg_dump, pgrestore, mariadb, mariadb-dump'; // dolibarr_main_restrict_ip // ========================= diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 043ffa30c7a..c0b737eed09 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -920,7 +920,7 @@ function write_conf_file($conffile) fputs($fp, '$dolibarr_main_force_https=\''.$main_force_https.'\';'); fputs($fp, "\n"); - fputs($fp, '$dolibarr_main_restrict_os_commands=\'mysqldump, mysql, pg_dump, pgrestore, clamdscan, clamscan.exe\';'); + fputs($fp, '$dolibarr_main_restrict_os_commands=\'mysqldump, mysql, pg_dump, pgrestore, mariadb, mariadb-dump, clamdscan, clamscan.exe\';'); fputs($fp, "\n"); fputs($fp, '$dolibarr_nocsrfcheck=\'0\';'); From 3257b9f2f27c45984cdf705be372db7e2f5232f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Sep 2023 23:02:17 +0200 Subject: [PATCH 0947/1137] Doc --- htdocs/comm/action/list.php | 1 + htdocs/comm/action/peruser.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index e67d2bdc89c..6db3365d407 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -79,6 +79,7 @@ $search_id = GETPOST('search_id', 'alpha'); $search_title = GETPOST('search_title', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); +// $dateselect is a day including inside the event range $dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'), 'tzuserrel'); $datestart_dtstart = dol_mktime(0, 0, 0, GETPOST('datestart_dtstartmonth', 'int'), GETPOST('datestart_dtstartday', 'int'), GETPOST('datestart_dtstartyear', 'int'), 'tzuserrel'); $datestart_dtend = dol_mktime(23, 59, 59, GETPOST('datestart_dtendmonth', 'int'), GETPOST('datestart_dtendday', 'int'), GETPOST('datestart_dtendyear', 'int'), 'tzuserrel'); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 56523acc8d2..aac2d0c6ee7 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -1042,6 +1042,8 @@ print "\n"; print ''; +$html = ''."\n"; +$html .= ''."\n"; +$html .= ''."\n"; +$html .= ''."\n"; +$html .= ''."\n"; $html .= ' '; + +div.fiche>form>div.div-table-responsive { + min-height: 392px; +} +div.fiche>form>div.div-table-responsive, div.fiche>form>div.div-table-responsive-no-min { + overflow-x: auto; +} +.div-table-responsive { + line-height: 120%; +} +.div-table-responsive, .div-table-responsive-no-min { + overflow-x: auto; + min-height: 0.01%; +} + + +/* Force values for small screen 767 */ +@media only screen and (max-width: 767px) +{ + body { + margin: 5px; + margin-left: 5px; + margin-right: 5px; + } +} + + +'."\n"; $html .= ''."\n"; @@ -265,6 +297,8 @@ $html .= ''."\n"; $html .= '
'."\n"; $html .= '

Lines of code

'."\n"; + +$html .= '
'."\n"; $html .= '
'.$langs->trans("Product").''; print ''; print img_picto('', 'product'); print $form->select_produits('', 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); From 076b024b1faae3a1bba74c84cb189ac280850550 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Sep 2023 18:23:05 +0200 Subject: [PATCH 0944/1137] Code comment --- htdocs/comm/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index c70c9fc1354..aeb862541e1 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1294,7 +1294,7 @@ if ($object->id > 0) { print $formfile->showPreview($file_list, $fichinter_static->element, $relativepath, 0); } // $filename = dol_sanitizeFileName($objp->ref); - // $filedir = $conf->fichinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); + // $filedir = getMultidirOutput($fichinter_static).'/'.dol_sanitizeFileName($objp->ref); // $urlsource = '/fichinter/card.php?id='.$objp->cid; // print $formfile->getDocumentsLink($fichinter_static->element, $filename, $filedir); print '
'; $html .= ''; $html .= ''; $html .= ''; $html .= ''; - $html .= ''; + $html .= ''; $html .= ''; if (!empty($arrayoflineofcode[$source])) { foreach ($arrayoflineofcode[$source] as $key => $val) { $html .= ''; $html .= ''; $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; //$html .= ''; - $html .= ''; + $html .= ''; $html .= ''; } } @@ -311,16 +345,17 @@ foreach (array('proj', 'dep') as $source) { $html .= ''; $html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; -$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; //$html .= ''; $html .= ''; $html .= ''; $html .= '
Language'; @@ -290,20 +324,20 @@ foreach (array('proj', 'dep') as $source) { $html .= ''.formatNumber($arrayofmetrics[$source]['Blanks']).''.formatNumber($arrayofmetrics[$source]['Comments']).''.formatNumber($arrayofmetrics[$source]['Code']).'TODO graph here...
Total'.formatNumber($arrayofmetrics['proj']['Bytes'] + $arrayofmetrics['dep']['Bytes']).''.formatNumber($arrayofmetrics['proj']['Files'] + $arrayofmetrics['dep']['Files']).''.formatNumber($arrayofmetrics['proj']['Lines'] + $arrayofmetrics['dep']['Lines']).''.formatNumber($arrayofmetrics['proj']['Blanks'] + $arrayofmetrics['dep']['Blanks']).''.formatNumber($arrayofmetrics['proj']['Comments'] + $arrayofmetrics['dep']['Comments']).''.formatNumber($arrayofmetrics['proj']['Code'] + $arrayofmetrics['dep']['Code']).''.formatNumber($arrayofmetrics['proj']['Bytes'] + $arrayofmetrics['dep']['Bytes']).''.formatNumber($arrayofmetrics['proj']['Files'] + $arrayofmetrics['dep']['Files']).''.formatNumber($arrayofmetrics['proj']['Lines'] + $arrayofmetrics['dep']['Lines']).''.formatNumber($arrayofmetrics['proj']['Blanks'] + $arrayofmetrics['dep']['Blanks']).''.formatNumber($arrayofmetrics['proj']['Comments'] + $arrayofmetrics['dep']['Comments']).''.formatNumber($arrayofmetrics['proj']['Code'] + $arrayofmetrics['dep']['Code']).''.$arrayofmetrics['Complexity'].'
'; +$html .= ''; $html .= ''."\n"; @@ -338,7 +373,7 @@ $html .= ''."\n"; $html .= '
'."\n"; $html .= '

Technical debt ('.count($output_arrtd).')


'."\n"; -$html .= '
'."\n"; +$html .= '
'."\n"; $html .= ''."\n"; $html .= ''."\n"; foreach ($output_arrtd as $line) { From 7cf93529a83de371035b88ee071ce9ade36d5481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Sep 2023 09:03:27 +0200 Subject: [PATCH 1035/1137] phpstan --- htdocs/compta/facture/class/facture.class.php | 12 ------------ htdocs/core/class/commoninvoice.class.php | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9d7970031a8..96882f51d4f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -228,18 +228,6 @@ class Facture extends CommonInvoice public $date_pointoftax; - // Multicurrency - /** - * @var int ID - */ - public $fk_multicurrency; - - public $multicurrency_code; - public $multicurrency_tx; - public $multicurrency_total_ht; - public $multicurrency_total_tva; - public $multicurrency_total_ttc; - /** * @var int Situation cycle reference number */ diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 31e412f700e..e133a9127ae 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -75,6 +75,18 @@ abstract class CommonInvoice extends CommonObject public $sumcreditnote_multicurrency; public $remaintopay; + // Multicurrency + /** + * @var int ID + */ + public $fk_multicurrency; + + public $multicurrency_code; + public $multicurrency_tx; + public $multicurrency_total_ht; + public $multicurrency_total_tva; + public $multicurrency_total_ttc; + /** * ! Closing after partial payment: discount_vat, badsupplier, abandon * ! Closing when no payment: replaced, abandoned From daf2f06ac8457b03d3a5c65fe082254f32035a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Sep 2023 09:07:04 +0200 Subject: [PATCH 1036/1137] phpstan --- htdocs/core/class/commoninvoice.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index e133a9127ae..b1ab25fb00e 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -48,6 +48,8 @@ abstract class CommonInvoice extends CommonObject */ public $socid; + public $paye; + /** * Invoice date (date) * From 560489e4a6e0e86e3c71deac8db537f4576941ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Sep 2023 09:28:56 +0200 Subject: [PATCH 1037/1137] phpstan --- htdocs/compta/facture/class/paymentterm.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 0e34e97d3d5..df9153d4407 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -51,6 +51,12 @@ class PaymentTerm // extends CommonObject */ public $id; + + /** + * @var int Entity ID + */ + public $entity; + public $code; public $sortorder; public $active; @@ -397,11 +403,6 @@ class PaymentTerm // extends CommonObject // Load source object $object->fetch($fromid); $object->id = 0; - $object->statut = 0; - $object->status = 0; - - // Clear fields - // ... // Create clone $object->context['createfromclone'] = 'createfromclone'; From 6864de475efba77637a4fc82f1ff7d3a788f8385 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:12:45 +0300 Subject: [PATCH 1038/1137] remove ! operator --- htdocs/accountancy/admin/productaccount.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 58d32e7b147..18a85ca923c 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -85,7 +85,7 @@ if (empty($accounting_product_mode)) { $accounting_product_mode = 'ACCOUNTANCY_SELL'; } -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : !getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -727,7 +727,7 @@ if ($resql) { // TODO ADJUST DESCRIPTION SIZE // print ''; // TODO: we should set a user defined value to adjust user square / wide screen size - $trunclength = !getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32); + $trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32); print ''; } From faee21b0d39d609ff1df9007980df12fb75e9ca7 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:53:41 +0300 Subject: [PATCH 1039/1137] Use GETPOST instead of $_REQUEST --- htdocs/societe/checkvat/checkVatGr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/checkvat/checkVatGr.php b/htdocs/societe/checkvat/checkVatGr.php index c2be6305faa..0b4cece0661 100644 --- a/htdocs/societe/checkvat/checkVatGr.php +++ b/htdocs/societe/checkvat/checkVatGr.php @@ -28,7 +28,7 @@ require "../../main.inc.php"; $username = getDolGlobalString('AADE_WEBSERVICE_USER'); // Get username from request $password = getDolGlobalString('AADE_WEBSERVICE_KEY'); // Get password from request $myafm = getDolGlobalString('MAIN_INFO_TVAINTRA'); // Get Vat from request -$afm = (isset($_REQUEST['afm']) ? $_REQUEST['afm'] : ''); // Get client Vat from request +$afm = GETPOST('afm'); // Get client Vat from request // Make call to check VAT for Greek client $result = checkVATGR($username, $password, $myafm, $afm); From 9199bce9da0b51c2427b2a3f256a84984c0f2fc7 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:56:40 +0300 Subject: [PATCH 1040/1137] Add test on !empty($u) --- htdocs/societe/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 969eda60f2b..ad5e90f9614 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1736,7 +1736,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; print ''; print ''; } - print ''; + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } print ''; } } @@ -1388,6 +1410,21 @@ if ($resql) { print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Ref if (!empty($arrayfields['b.rowid']['checked'])) { print ''; + if (!$i) { + $totalarray['nbfield']++; } - print ''; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; } print "\n"; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1144ad2f618..1adb79e2ed0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9965,10 +9965,10 @@ class Form { $out = '
'; if ($pos == 'left') { - $out .= ''; + $out .= ''; $out .= ''; } else { - $out .= ''; + $out .= ''; $out .= ''; } $out .= '
'; From 7f0eb701d729b0634ef7b69294aa4e062adb820b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Oct 2023 11:48:28 +0200 Subject: [PATCH 1108/1137] Fix decrypt --- htdocs/core/lib/security.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index de6013a41f9..32891e4b825 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -195,7 +195,8 @@ function dolDecrypt($chain, $key = '') $ciphering = $reg[1]; if (function_exists('openssl_decrypt')) { if (empty($key)) { - return 'Error dolDecrypt decrypt key is empty'; + dol_syslog("Error dolDecrypt decrypt key is empty", LOG_ERR); + return $chain; } $tmpexplode = explode(':', $reg[2]); if (!empty($tmpexplode[1]) && is_string($tmpexplode[0])) { @@ -204,7 +205,8 @@ function dolDecrypt($chain, $key = '') $newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, 0, null); } } else { - $newchain = 'Error dolDecrypt function openssl_decrypt() not available'; + dol_syslog("Error dolDecrypt decrypt key is empty", LOG_ERR); + return $chain; } return $newchain; } else { From 669386d45c9b442d53eda2b0051b6b09ea4f056c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Oct 2023 12:53:50 +0200 Subject: [PATCH 1109/1137] Fix error message --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 32891e4b825..7eaa7a14fdb 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -205,7 +205,7 @@ function dolDecrypt($chain, $key = '') $newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, 0, null); } } else { - dol_syslog("Error dolDecrypt decrypt key is empty", LOG_ERR); + dol_syslog("Error dolDecrypt openssl_decrypt is not available", LOG_ERR); return $chain; } return $newchain; From 4cf1dc1a2fe832e953d99a417953052f6225be97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Oct 2023 13:21:09 +0200 Subject: [PATCH 1110/1137] Fix picto clear search --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1adb79e2ed0..68d19a23ac4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9966,10 +9966,10 @@ class Form $out = '
'; if ($pos == 'left') { $out .= ''; - $out .= ''; + $out .= ''; } else { $out .= ''; - $out .= ''; + $out .= ''; } $out .= '
'; From 3d96b66664c47da8e483c91307dff45c0a3c280c Mon Sep 17 00:00:00 2001 From: Thomas Couacault Date: Mon, 2 Oct 2023 14:22:11 +0200 Subject: [PATCH 1111/1137] FIX: Delete use of unassigned product_description member in ContratLigne class --- htdocs/contrat/class/contrat.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 673410067de..13c3a15aa2b 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3307,7 +3307,6 @@ class ContratLigne extends CommonObjectLine $this->statut = $obj->statut; $this->product_ref = $obj->product_ref; $this->product_label = $obj->product_label; - $this->product_description = $obj->product_description; $this->product_type = $obj->product_type; $this->label = $obj->label; // deprecated. We do not use this field. Only ref and label of product, and description of contract line $this->description = $obj->description; From 3028bd37841fd2efb241ceea262b91bf3436c6ef Mon Sep 17 00:00:00 2001 From: Thomas Couacault Date: Mon, 2 Oct 2023 14:42:58 +0200 Subject: [PATCH 1112/1137] FIX typo $tva_tx instead of $txtva --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 13c3a15aa2b..ccd8947fdf3 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3443,7 +3443,7 @@ class ContratLigne extends CommonObjectLine // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $localtaxes_type = getLocalTaxesFromRate($this->txtva, 0, $this->thirdparty, $mysoc); + $localtaxes_type = getLocalTaxesFromRate($this->tva_tx, 0, $this->thirdparty, $mysoc); $tabprice = calcul_price_total($this->qty, $this->price_ht, $this->remise_percent, $this->tva_tx, $this->localtax1_tx, $this->localtax2_tx, 0, 'HT', 0, 1, $mysoc, $localtaxes_type); $this->total_ht = $tabprice[0]; From 042ce496c79f7d761270bc6a295c565bf01a391b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Oct 2023 15:38:38 +0200 Subject: [PATCH 1113/1137] Fix phpcs --- htdocs/core/ajax/bankconciliate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index 805d8f48b92..d7931444b23 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -84,7 +84,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ $al = new AccountLine($db); $al->dateo_next(GETPOST('rowid', 'int')); $al->fetch(GETPOST('rowid', 'int')); - var_dump($al); + print ''.dol_print_date($al->dateo, "day").''; exit; From 34fc0f14d20abde4f953455b8a2e380bec2e791d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Oct 2023 15:41:14 +0200 Subject: [PATCH 1114/1137] Fix warnings --- htdocs/core/ajax/bankconciliate.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index d7931444b23..c67f1455b42 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -57,7 +57,7 @@ top_httphead(); //print ''."\n"; -if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvnext') { +if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'dvnext') { // Increase date $al = new AccountLine($db); $al->datev_next(GETPOST('rowid', 'int')); @@ -68,7 +68,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ exit; } -if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev') { +if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'dvprev') { // Decrease date $al = new AccountLine($db); $al->datev_previous(GETPOST('rowid', 'int')); @@ -79,7 +79,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ exit; } -if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') { +if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'donext') { // Increase date $al = new AccountLine($db); $al->dateo_next(GETPOST('rowid', 'int')); @@ -90,7 +90,7 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ exit; } -if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') { +if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'doprev') { // Decrease date $al = new AccountLine($db); $al->dateo_previous(GETPOST('rowid', 'int')); From ee921ab540ac1e1720ad2a54e9f1880d1bea2cb8 Mon Sep 17 00:00:00 2001 From: Kamel Khelifa Date: Mon, 2 Oct 2023 15:52:44 +0200 Subject: [PATCH 1115/1137] NEW: Add trigger when delete a bank account line --- htdocs/compta/bank/class/account.class.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index db24c2641c7..916a12d0564 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2175,10 +2175,11 @@ class AccountLine extends CommonObjectLine /** * Delete bank transaction record * - * @param User|null $user User object that delete - * @return int <0 if KO, >0 if OK + * @param User|null $user User object that delete + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int <0 if KO, >0 if OK */ - public function delete(User $user = null) + public function delete(User $user = null, $notrigger = 0) { global $conf; @@ -2192,6 +2193,16 @@ class AccountLine extends CommonObjectLine $this->db->begin(); + if (!$notrigger) { + // Call trigger + $result = $this->call_trigger('BANKACCOUNTLINE_DELETE', $user); + if ($result < 0) { + $this->db->rollback(); + return -1; + } + // End call triggers + } + // Protection to avoid any delete of accounted lines. Protection on by default if (empty($conf->global->BANK_ALLOW_TRANSACTION_DELETION_EVEN_IF_IN_ACCOUNTING)) { $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE doc_type = 'bank' AND fk_doc = ".((int) $this->id); From 17f8bc6c1f7a6b6093532355cfc60680f726c18f Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:44:44 +0200 Subject: [PATCH 1116/1137] Reduce unnecessary complexity --- htdocs/core/class/notify.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index aef501b4fe0..0c32af287f9 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -752,6 +752,8 @@ class Notify $reg = array(); if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) { continue; + } else { + $sendto = $val; } $threshold = (float) $reg[1]; @@ -760,9 +762,6 @@ class Notify continue; } - $param = 'NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_'.$reg[1]; - - $sendto = $conf->global->$param; $notifcodedefid = dol_getIdFromCode($this->db, $notifcode, 'c_action_trigger', 'code', 'rowid'); if ($notifcodedefid <= 0) { dol_print_error($this->db, 'Failed to get id from code'); @@ -973,7 +972,7 @@ class Notify if ($mailfile->sendfile()) { $sql = "INSERT INTO ".$this->db->prefix()."notify (daten, fk_action, fk_soc, fk_contact, type, type_target, objet_type, objet_id, email)"; - $sql .= " VALUES ('".$this->db->idate(dol_now())."', ".((int) $notifcodedefid).", ".($object->socid > 0 ? ((int) $object->socid) : 'null').", null, 'email', 'tofixedemail', '".$this->db->escape($object_type)."', ".((int) $object->id).", '".$this->db->escape($conf->global->$param)."')"; + $sql .= " VALUES ('".$this->db->idate(dol_now())."', ".((int) $notifcodedefid).", ".($object->socid > 0 ? ((int) $object->socid) : 'null').", null, 'email', 'tofixedemail', '".$this->db->escape($object_type)."', ".((int) $object->id).", '".$this->db->escape($sendto)."')"; if (!$this->db->query($sql)) { dol_print_error($this->db); } From 25bd19d7e58ffb230c1c2c2c750ce1e987cec47e Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:58:28 +0200 Subject: [PATCH 1117/1137] Unneccesary else --- htdocs/core/class/notify.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 0c32af287f9..374f228516f 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -752,9 +752,9 @@ class Notify $reg = array(); if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) { continue; - } else { - $sendto = $val; } + + $sendto = $val; $threshold = (float) $reg[1]; if (!empty($object->total_ht) && $object->total_ht <= $threshold) { From ffee2af4789d140a596e95ba6ea634fd7746c8e2 Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:01:53 +0200 Subject: [PATCH 1118/1137] FiX CI --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 374f228516f..0a67f0450d7 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -753,7 +753,7 @@ class Notify if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) { continue; } - + $sendto = $val; $threshold = (float) $reg[1]; From 0040ff24e1115884341d13a55279aace304c8c21 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 2 Oct 2023 21:26:27 +0200 Subject: [PATCH 1119/1137] FIX field entity is DEFAULT 1 NOT NULL --- .../mysql/data/llx_c_invoice_subtype.sql | 42 +++++++++---------- .../install/mysql/migration/18.0.0-19.0.0.sql | 1 + .../mysql/tables/llx_c_invoice_subtype.sql | 16 +++---- 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_invoice_subtype.sql b/htdocs/install/mysql/data/llx_c_invoice_subtype.sql index 70862fdd422..d17097e592e 100644 --- a/htdocs/install/mysql/data/llx_c_invoice_subtype.sql +++ b/htdocs/install/mysql/data/llx_c_invoice_subtype.sql @@ -20,24 +20,24 @@ -- -- -- Greece (102) -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.1', 'Τιμολόγιο Πώλησης', 1); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.2', 'Τιμολόγιο Πώλησης / Ενδοκοινοτικές Παραδόσεις', 1); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.3', 'Τιμολόγιο Πώλησης / Παραδόσεις Τρίτων Χωρών', 1); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.4', 'Τιμολόγιο Πώλησης / Πώληση για Λογαριασμό Τρίτων', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.5', 'Τιμολόγιο Πώλησης / Εκκαθάριση Πωλήσεων Τρίτων - Αμοιβή από Πωλήσεις Τρίτων', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '1.6', 'Τιμολόγιο Πώλησης / Συμπληρωματικό Παραστατικό', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.1', 'Τιμολόγιο Παροχής', 1); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.2', 'Τιμολόγιο Παροχής / Ενδοκοινοτική Παροχή Υπηρεσιών', 1); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.3', 'Τιμολόγιο Παροχής / Παροχή Υπηρεσιών σε λήπτη Τρίτης Χώρας', 1); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '2.4', 'Τιμολόγιο Παροχής / Συμπληρωματικό Παραστατικό', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '3.1', 'Τίτλος Κτήσης (μη υπόχρεος Εκδότης)', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '3.2', 'Τίτλος Κτήσης (άρνηση έκδοσης από υπόχρεο Εκδότη)', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '6.1', 'Στοιχείο Αυτοπαράδοσης', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '6.2', 'Στοιχείο Ιδιοχρησιμοποίησης', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '7.1', 'Συμβόλαιο - Έσοδο', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '8.1', 'Ενοίκια - Έσοδο', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '8.2', 'Ειδικό Στοιχείο – Απόδειξης Είσπραξης Φόρου Διαμονής', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.1', 'ΑΛΠ', 1); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.2', 'ΑΠΥ', 1); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.3', 'Απλοποιημένο Τιμολόγιο', 0); -insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALUES (1, 102, '11.5', 'Απόδειξη Λιανικής Πώλησης για Λογ/σμό Τρίτων', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '1.1', 'Τιμολόγιο Πώλησης', 1); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '1.2', 'Τιμολόγιο Πώλησης / Ενδοκοινοτικές Παραδόσεις', 1); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '1.3', 'Τιμολόγιο Πώλησης / Παραδόσεις Τρίτων Χωρών', 1); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '1.4', 'Τιμολόγιο Πώλησης / Πώληση για Λογαριασμό Τρίτων', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '1.5', 'Τιμολόγιο Πώλησης / Εκκαθάριση Πωλήσεων Τρίτων - Αμοιβή από Πωλήσεις Τρίτων', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '1.6', 'Τιμολόγιο Πώλησης / Συμπληρωματικό Παραστατικό', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '2.1', 'Τιμολόγιο Παροχής', 1); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '2.2', 'Τιμολόγιο Παροχής / Ενδοκοινοτική Παροχή Υπηρεσιών', 1); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '2.3', 'Τιμολόγιο Παροχής / Παροχή Υπηρεσιών σε λήπτη Τρίτης Χώρας', 1); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '2.4', 'Τιμολόγιο Παροχής / Συμπληρωματικό Παραστατικό', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '3.1', 'Τίτλος Κτήσης (μη υπόχρεος Εκδότης)', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '3.2', 'Τίτλος Κτήσης (άρνηση έκδοσης από υπόχρεο Εκδότη)', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '6.1', 'Στοιχείο Αυτοπαράδοσης', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '6.2', 'Στοιχείο Ιδιοχρησιμοποίησης', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '7.1', 'Συμβόλαιο - Έσοδο', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '8.1', 'Ενοίκια - Έσοδο', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '8.2', 'Ειδικό Στοιχείο – Απόδειξης Είσπραξης Φόρου Διαμονής', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '11.1', 'ΑΛΠ', 1); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '11.2', 'ΑΠΥ', 1); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '11.3', 'Απλοποιημένο Τιμολόγιο', 0); +insert into llx_c_invoice_subtype (fk_country, code, label, active) VALUES (102, '11.5', 'Απόδειξη Λιανικής Πώλησης για Λογ/σμό Τρίτων', 0); diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index cb408b7cd3d..a6313921669 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -120,4 +120,5 @@ ALTER TABLE llx_accounting_account MODIFY COLUMN pcg_type varchar(32); -- VPGSQL8.2 DROP INDEX uk_links; ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid, objecttype,label); +ALTER TABLE llx_c_invoice_subtype MODIFY COLUMN entity integer DEFAULT 1 NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql b/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql index 2e8911d3daa..741f8bd2766 100644 --- a/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql +++ b/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql @@ -16,12 +16,14 @@ -- -- ======================================================================== -CREATE TABLE llx_c_invoice_subtype ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - entity integer DEFAULT 1, - fk_country integer NOT NULL, - code varchar(4) NOT NULL, - label varchar(100), - active tinyint DEFAULT 1 NOT NULL +CREATE TABLE llx_c_invoice_subtype +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_country integer NOT NULL, + code varchar(4) NOT NULL, + label varchar(100), + active tinyint DEFAULT 1 NOT NULL + ) ENGINE=innodb; From d3dc6615db42246be08c761627721f2c728a3057 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Oct 2023 21:49:08 +0200 Subject: [PATCH 1120/1137] Remove deprecated use of ->modelpdf (good is ->model_pdf) --- htdocs/comm/action/class/api_agendaevents.class.php | 1 - htdocs/comm/propal/class/propal.class.php | 1 - htdocs/commande/class/commande.class.php | 3 --- htdocs/compta/facture/class/facture-rec.class.php | 1 - htdocs/compta/facture/class/facture.class.php | 4 ---- htdocs/compta/payment_vat/card.php | 2 +- htdocs/contrat/card.php | 3 +-- htdocs/contrat/class/contrat.class.php | 3 --- htdocs/core/class/commonobject.class.php | 6 ------ htdocs/delivery/class/delivery.class.php | 1 - htdocs/don/class/don.class.php | 1 - htdocs/expedition/class/expedition.class.php | 3 --- htdocs/expensereport/class/expensereport.class.php | 2 -- htdocs/fichinter/class/fichinter.class.php | 3 --- htdocs/fichinter/class/fichinterrec.class.php | 3 +-- htdocs/fourn/class/fournisseur.commande.class.php | 1 - htdocs/fourn/class/fournisseur.facture-rec.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 1 - .../stock/stocktransfer/class/stocktransfer.class.php | 4 ++-- htdocs/projet/class/project.class.php | 1 - htdocs/projet/class/task.class.php | 2 -- htdocs/reception/class/reception.class.php | 1 - htdocs/societe/class/societe.class.php | 1 - htdocs/supplier_proposal/class/supplier_proposal.class.php | 1 - htdocs/user/class/user.class.php | 5 +++++ 25 files changed, 12 insertions(+), 46 deletions(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index eef28e3516b..16fcf9d9d4e 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -406,7 +406,6 @@ class AgendaEvents extends DolibarrApi unset($object->region_id); unset($object->actions); unset($object->lines); - unset($object->modelpdf); return $object; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 9676c352e44..af9221b3d8e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1667,7 +1667,6 @@ class Propal extends CommonObject $this->project = null; // Clear if another value was already set by fetch_projet $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->last_main_doc = $obj->last_main_doc; $this->note = $obj->note_private; // TODO deprecated $this->note_private = $obj->note_private; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ec4456abfba..fc3dcc13af8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1949,7 +1949,6 @@ class Commande extends CommonOrder $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->last_main_doc = $obj->last_main_doc; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; @@ -4144,8 +4143,6 @@ class Commande extends CommonOrder if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->COMMANDE_ADDON_PDF)) { $modele = $conf->global->COMMANDE_ADDON_PDF; } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 32d8d141206..160f54e5ece 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -606,7 +606,6 @@ class FactureRec extends CommonInvoice $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->user_author = $obj->fk_user_author; - $this->modelpdf = $obj->model_pdf; // deprecated $this->model_pdf = $obj->model_pdf; //$this->special_code = $obj->special_code; $this->frequency = $obj->frequency; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c07dc2c59a2..65cd10fb58d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1154,7 +1154,6 @@ class Facture extends CommonInvoice $facture->note_public = $this->note_public; $facture->note_private = $this->note_private; $facture->ref_client = $this->ref_client; - $facture->modelpdf = $this->model_pdf; // deprecated $facture->model_pdf = $this->model_pdf; $facture->fk_project = $this->fk_project; $facture->cond_reglement_id = $this->cond_reglement_id; @@ -2222,7 +2221,6 @@ class Facture extends CommonInvoice $this->fk_user_valid = $obj->fk_user_valid; $this->fk_user_modif = $obj->fk_user_modif; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->last_main_doc = $obj->last_main_doc; $this->situation_cycle_ref = $obj->situation_cycle_ref; $this->situation_counter = $obj->situation_counter; @@ -5214,8 +5212,6 @@ class Facture extends CommonInvoice if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->$thisTypeConfName)) { $modele = $conf->global->$thisTypeConfName; } elseif (!empty($conf->global->FACTURE_ADDON_PDF)) { diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index bd431f65dae..c170d15cd72 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -102,7 +102,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char $outputlangs->setDefaultLang($_REQUEST['lang_id']); } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $fac->generateDocument($fac->modelpdf, $outputlangs); + $fac->generateDocument($fac->model_pdf, $outputlangs); } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 15b36b6a71c..ca2a1a686ba 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -182,7 +182,6 @@ if (empty($reshook)) { } } - // Si ajout champ produit predefini if (GETPOST('mode') == 'predefined') { $date_start = ''; $date_end = ''; @@ -897,7 +896,7 @@ if (empty($reshook)) { if ($ret < 0) { $error++; } - + var_dump($object);exit; if (!$error) { $result = $object->insertExtraFields('CONTRACT_MODIFY'); if ($result < 0) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2ae01b2fc3a..ba85ee103b7 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -726,7 +726,6 @@ class Contrat extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->fk_projet = $obj->fk_project; // deprecated $this->fk_project = $obj->fk_project; @@ -2537,8 +2536,6 @@ class Contrat extends CommonObject if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->CONTRACT_ADDON_PDF)) { $modele = $conf->global->CONTRACT_ADDON_PDF; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 35440444842..685fb74a464 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -480,11 +480,6 @@ abstract class CommonObject */ public $fk_account; - /** - * @var string Open ID - */ - public $openid; - /** * @var string Public note * @see update_note() @@ -2979,7 +2974,6 @@ abstract class CommonObject $resql = $this->db->query($sql); if ($resql) { $this->model_pdf = $modelpdf; - $this->modelpdf = $modelpdf; // For bakward compatibility return 1; } else { dol_print_error($this->db); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index e188526ef58..fb92c912aff 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -349,7 +349,6 @@ class Delivery extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->origin = $obj->origin; // May be 'shipping' $this->origin_id = $obj->origin_id; // May be id of shipping diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 0d9a9e043fd..5f6a699915d 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -687,7 +687,6 @@ class Don extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated // Retrieve all extrafield // fetch optionals attributes and labels diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 412f192ac54..18761de10b6 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -616,7 +616,6 @@ class Expedition extends CommonObject $this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed $this->fk_delivery_address = $obj->fk_address; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->shipping_method_id = $obj->fk_shipping_method; $this->shipping_method = $obj->shipping_method; $this->tracking_number = $obj->tracking_number; @@ -2475,8 +2474,6 @@ class Expedition extends CommonObject if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->EXPEDITION_ADDON_PDF)) { $modele = $conf->global->EXPEDITION_ADDON_PDF; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 68a8ba1910b..1947470adf9 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2431,8 +2431,6 @@ class ExpenseReport extends CommonObject if (!dol_strlen($modele)) { if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->EXPENSEREPORT_ADDON_PDF)) { $modele = $conf->global->EXPENSEREPORT_ADDON_PDF; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 86d936416e0..d0b1f4295da 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -475,7 +475,6 @@ class Fichinter extends CommonObject $this->note_public = $obj->note_public; $this->note_private = $obj->note_private; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->fk_contrat = $obj->fk_contrat; $this->entity = $obj->entity; @@ -711,8 +710,6 @@ class Fichinter extends CommonObject if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->FICHEINTER_ADDON_PDF)) { $modele = $conf->global->FICHEINTER_ADDON_PDF; } diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index f29e1e17eec..8d6b65b5c6b 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -302,8 +302,7 @@ class FichinterRec extends Fichinter $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->user_author = $obj->fk_user_author; - $this->model_pdf = !empty($obj->model_pdf) ? $obj->model_pdf : ""; - $this->modelpdf = !empty($obj->model_pdf) ? $obj->model_pdf : ""; // deprecated + $this->model_pdf = empty($obj->model_pdf) ? "" : $obj->model_pdf; $this->rang = !empty($obj->rang) ? $obj->rang : ""; $this->special_code = !empty($obj->special_code) ? $obj->special_code : ""; $this->frequency = $obj->frequency; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 73ddde7d896..6f251175786 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -468,7 +468,6 @@ class CommandeFournisseur extends CommonOrder $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated //Incoterms $this->fk_incoterms = $obj->fk_incoterms; diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 940b3bf169d..3ded6e8fc61 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -581,7 +581,7 @@ class FactureFournisseurRec extends CommonInvoice $sql .= ', f.fk_mode_reglement, p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql .= ', f.fk_cond_reglement, c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql .= ', f.date_lim_reglement'; - $sql .= ', f.note_private, f.note_public, f.modelpdf'; + $sql .= ', f.note_private, f.note_public, f.modelpdf as model_pdf'; $sql .= ', f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc'; $sql .= ', f.usenewprice, f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.auto_validate'; $sql .= ', f.generate_pdf'; @@ -635,7 +635,7 @@ class FactureFournisseurRec extends CommonInvoice $this->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement); $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; - $this->model_pdf = $obj->modelpdf; + $this->model_pdf = $obj->model_pdf; // Multicurrency $this->fk_multicurrency = $obj->fk_multicurrency; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 5dbf7b179e7..0ee31784a16 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -960,7 +960,6 @@ class FactureFournisseur extends CommonInvoice $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->import_key = $obj->import_key; //Incoterms diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index 6d29d5e34e6..71fef05f245 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -975,8 +975,8 @@ class StockTransfer extends CommonObject if (!dol_strlen($modele)) { $modele = 'eagle'; - if ($this->modelpdf) { - $modele = $this->modelpdf; + if ($this->model_pdf) { + $modele = $this->model_pdf; } elseif (!empty($conf->global->STOCKTRANSFER_ADDON_PDF)) { $modele = $conf->global->STOCKTRANSFER_ADDON_PDF; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b5e7bf8af29..271269fa837 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -736,7 +736,6 @@ class Project extends CommonObject $this->opp_percent = $obj->opp_percent; $this->budget_amount = $obj->budget_amount; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->usage_opportunity = (int) $obj->usage_opportunity; $this->usage_task = (int) $obj->usage_task; $this->usage_bill_time = (int) $obj->usage_bill_time; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index b8e449f0748..1581ca82d7e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2222,8 +2222,6 @@ class Task extends CommonObjectLine if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->PROJECT_TASK_ADDON_PDF)) { $modele = $conf->global->PROJECT_TASK_ADDON_PDF; } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 76bf825ce83..3445af305c6 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -412,7 +412,6 @@ class Reception extends CommonObject $this->date_reception = $this->db->jdate($obj->date_reception); // Date real $this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->shipping_method_id = $obj->fk_shipping_method; $this->tracking_number = $obj->tracking_number; $this->origin = ($obj->origin ? $obj->origin : 'commande'); // For compatibility diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 676e91857f4..7bda2fe4280 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1988,7 +1988,6 @@ class Societe extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->default_lang = $obj->default_lang; $this->logo = $obj->logo; $this->logo_squarred = $obj->logo_squarred; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 72a4f663cc7..1cf59d79001 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1251,7 +1251,6 @@ class SupplierProposal extends CommonObject $this->socid = $obj->fk_soc; $this->fk_project = $obj->fk_project; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->note = $obj->note_private; // TODO deprecated $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index cee6eb07465..13d7c8c3f14 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -90,6 +90,11 @@ class User extends CommonObject public $status; + /** + * @var string Open ID + */ + public $openid; + public $ldap_sid; public $search_sid; public $employee; From 16a0025e9397ab791443a54c6bab1e9702eb0f88 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 2 Oct 2023 22:57:53 +0200 Subject: [PATCH 1121/1137] NEW Project - List - use select2 multiselect for status --- htdocs/core/class/html.formprojet.class.php | 40 ++++++++++++++++++++- htdocs/projet/list.php | 24 ++++++------- 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index ad1299c91c1..39cb3590db5 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -23,11 +23,12 @@ * \brief Class file for html component project */ +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; /** * Class to manage building of HTML components */ -class FormProjets +class FormProjets extends Form { /** * @var DoliDB Database handler. @@ -756,6 +757,43 @@ class FormProjets } } + /** + * Return combo list of differents status of a orders + * + * @param string $selected Preselected value + * @param int $short Use short labels + * @param string $hmlname Name of HTML select element + * @return void + */ + public function selectProjectsStatus($selected = '', $short = 0, $hmlname = 'order_status') + { + $options = array(); + + // 7 is same label than 6. 8 does not exists (billed is another field) + $statustohow = array( + '0' => '0', + '1' => '1', + '2' => '2', + ); + + $tmpproject = new Project($this->db); + + foreach ($statustohow as $key => $value) { + $tmpproject->statut = $key; + $options[$value] = $tmpproject->getLibStatut($short); + } + + if (is_array($selected)) { + $selectedarray = $selected; + } elseif ($selected == 99) { + $selectedarray = array(0,1); + } else { + $selectedarray = explode(',', $selected); + } + + print Form::multiselectarray($hmlname, $options, $selectedarray, 0, 0, 'minwidth100'); + } + /** * Output a combo list with invoices and lines qualified for a project * diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 3d4904c272c..b0c9983a0d8 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -98,7 +98,6 @@ $search_ref = GETPOST("search_ref", 'alpha'); $search_label = GETPOST("search_label", 'alpha'); $search_societe = GETPOST("search_societe", 'alpha'); $search_societe_alias = GETPOST("search_societe_alias", 'alpha'); -$search_status = GETPOST("search_status", 'int'); $search_opp_status = GETPOST("search_opp_status", 'alpha'); $search_opp_percent = GETPOST("search_opp_percent", 'alpha'); $search_opp_amount = GETPOST("search_opp_amount", 'alpha'); @@ -163,8 +162,10 @@ if (isModEnabled('categorie')) { $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); } -if ($search_status == '') { - $search_status = -1; // -1 or 1 +if (GETPOSTISARRAY('search_status')) { + $search_status = join(',', GETPOST('search_status', 'array:intcomma')); +} else { + $search_status = (GETPOST('search_status', 'intcomma') != '' ? GETPOST('search_status', 'intcomma') : '0,1'); } @@ -528,11 +529,11 @@ if ($search_date_end_end) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } -if ($search_status >= 0) { +if ($search_status != '' && $search_status != '-1') { if ($search_status == 99) { - $sql .= " AND p.fk_statut <> 2"; + $sql .= " AND p.fk_statut IN (0,1)"; } else { - $sql .= " AND p.fk_statut = ".((int) $search_status); + $sql .= " AND p.fk_statut IN (".$db->sanitize($db->escape($search_status)).")"; } } if ($search_opp_status) { @@ -843,8 +844,8 @@ if ($search_societe != '') { if ($search_societe_alias != '') { $param .= '&search_societe_alias='.urlencode($search_societe_alias); } -if ($search_status >= 0) { - $param .= '&search_status='.urlencode($search_status); +if ($search_status != '' && $search_status != '-1') { + $param .= "&search_status=".urlencode($search_status); } if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array('all', 'openedopp', 'notopenedopp', 'none'))) { $param .= '&search_opp_status='.urlencode($search_opp_status); @@ -1245,12 +1246,7 @@ if (!empty($arrayfields['p.import_key']['checked'])) { } if (!empty($arrayfields['p.fk_statut']['checked'])) { print '
'; } // Action column From 5537ccede25aa8b1af94791db2da17d67734f9bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Oct 2023 00:07:37 +0200 Subject: [PATCH 1122/1137] FIX update_extras must use updateExtraFields --- htdocs/contrat/card.php | 24 +++-- htdocs/contrat/class/contrat.class.php | 5 +- htdocs/core/actions_addupdatedelete.inc.php | 9 +- htdocs/core/class/commonobject.class.php | 101 +++++++++++++------- 4 files changed, 90 insertions(+), 49 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index ca2a1a686ba..e3cd8d35aee 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -102,6 +102,7 @@ $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->statut == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer'); $permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontoedit = $permissiontoadd; +$permissiontoactivate = $user->hasRight('contrat', 'activer'); $error = 0; @@ -144,7 +145,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once - if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) { + if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) { $date_start = ''; $date_end = ''; if (GETPOST('startmonth') && GETPOST('startday') && GETPOST('startyear')) { @@ -162,7 +163,7 @@ if (empty($reshook)) { } else { setEventMessages($object->error, $object->errors, 'errors'); } - } elseif ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) { + } elseif ($action == 'confirm_closeline' && $confirm == 'yes' && $permissiontoactivate) { $date_end = ''; if (GETPOST('endmonth') && GETPOST('endday') && GETPOST('endyear')) { $date_end = dol_mktime(GETPOST('endhour'), GETPOST('endmin'), 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); @@ -888,17 +889,20 @@ if (empty($reshook)) { } else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors'); } - } elseif ($action == 'update_extras') { + } elseif ($action == 'update_extras' && $permissiontoadd) { $object->oldcopy = dol_clone($object); + $attribute = GETPOST('attribute', 'alphanohtml'); + // Fill array 'array_options' with data from update form - $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); + $ret = $extrafields->setOptionalsFromPost(null, $object, $attribute); if ($ret < 0) { + setEventMessages($extrafields->error, $object->errors, 'errors'); $error++; } - var_dump($object);exit; + if (!$error) { - $result = $object->insertExtraFields('CONTRACT_MODIFY'); + $result = $object->updateExtraField($attribute, 'CONTRACT_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -908,7 +912,7 @@ if (empty($reshook)) { if ($error) { $action = 'edit_extras'; } - } elseif ($action == 'setref_supplier') { + } elseif ($action == 'setref_supplier' && $permissiontoadd) { if (!$cancel) { $object->oldcopy = dol_clone($object); @@ -924,7 +928,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } - } elseif ($action == 'setref_customer') { + } elseif ($action == 'setref_customer' && $permissiontoadd) { if (!$cancel) { $object->oldcopy = dol_clone($object); @@ -940,7 +944,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } - } elseif ($action == 'setref') { + } elseif ($action == 'setref' && $permissiontoadd) { if (!$cancel) { $result = $object->fetch($id); if ($result < 0) { @@ -968,7 +972,7 @@ if (empty($reshook)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } - } elseif ($action == 'setdate_contrat') { + } elseif ($action == 'setdate_contrat' && $permissiontoadd) { if (!$cancel) { $result = $object->fetch($id); if ($result < 0) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index ba85ee103b7..96bf7eda63b 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1370,8 +1370,7 @@ class Contrat extends CommonObject } //if (isset($this->extraparams)) $this->extraparams=trim($this->extraparams); - // Check parameters - // Put here code to add a control on parameters values + // $this->oldcopy should have been set by the caller of update // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET"; @@ -1400,7 +1399,7 @@ class Contrat extends CommonObject } if (!$error) { - $result = $this->insertExtraFields(); + $result = $this->insertExtraFields(); // This delete and reinsert extrafields if ($result < 0) { $error++; } diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 5d36a6fbd82..d9127a6a27c 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -350,15 +350,20 @@ if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOST('id', 'int') > 0 && !em if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) { $object->fetch(GETPOST('id', 'int')); + $object->oldcopy = dol_clone($object); + + $attribute = GETPOST('attribute', 'alphanohtml'); + $error = 0; - $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); + // Fill array 'array_options' with data from update form + $ret = $extrafields->setOptionalsFromPost(null, $object, $attribute); if ($ret < 0) { $error++; setEventMessages($extrafields->error, $object->errors, 'errors'); $action = 'edit_extras'; } else { - $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user); + $result = $object->updateExtraField($attribute, empty($triggermodname) ? '' : $triggermodname, $user); if ($result > 0) { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); $action = 'view'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 685fb74a464..16a85536a8a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6358,26 +6358,42 @@ abstract class CommonObject //global $action; // $action may be 'create', 'update', 'update_extras'... //var_dump($action); //var_dump($this->oldcopy);exit; - if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value - //var_dump($this->oldcopy->array_options[$key]); var_dump($this->array_options[$key]); - if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. - $new_array_options[$key] = $this->array_options[$key]; // Value is kept - } else { + if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value + //var_dump('iii'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); + if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { + // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. if ($algo == 'dolcrypt') { // dolibarr reversible encryption if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master } else { $new_array_options[$key] = $this->array_options[$key]; // Value is kept } } else { - $newvalue = dol_hash($this->array_options[$key], $algo); - $new_array_options[$key] = $newvalue; + $new_array_options[$key] = $this->array_options[$key]; // Value is kept + } + } else { + // If value has changed + if ($algo == 'dolcrypt') { // dolibarr reversible encryption + if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master + } else { + $new_array_options[$key] = $this->array_options[$key]; // Value is kept + } + } else { + $new_array_options[$key] = dol_hash($this->array_options[$key], $algo); } } } else { - $new_array_options[$key] = $this->array_options[$key]; // Value is kept + //var_dump('jjj'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); + // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value + if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options[$key])) { // dolibarr reversible encryption + $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master + } else { + $new_array_options[$key] = $this->array_options[$key]; // Value is kept + } } } else { + // No encryption $new_array_options[$key] = $this->array_options[$key]; // Value is kept } } else { // Common usage @@ -6700,7 +6716,6 @@ abstract class CommonObject //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); - if (!empty($attrfieldcomputed)) { if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { $value = dol_eval($attrfieldcomputed, 1, 0, '2'); @@ -6744,7 +6759,7 @@ abstract class CommonObject case 'password': $new_array_options = array(); $algo = ''; - if ($this->array_options[$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options'])) { + if ($this->array_options["options_".$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options'])) { // If there is an encryption choice, we use it to crypt data before insert $tmparrays = array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']); $algo = reset($tmparrays); @@ -6752,32 +6767,46 @@ abstract class CommonObject //global $action; // $action may be 'create', 'update', 'update_extras'... //var_dump($action); //var_dump($this->oldcopy);exit; + //var_dump($key.' '.$this->array_options["options_".$key].' '.$algo); if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value - //var_dump($this->oldcopy->array_options[$key]); var_dump($this->array_options[$key]); - if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. - $new_array_options[$key] = $this->array_options[$key]; // Value is kept - } else { + //var_dump($this->oldcopy->array_options["options_".$key]); var_dump($this->array_options["options_".$key]); + if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value crypted in database is same than submited new value, it means we don't change it, so we don't update. if ($algo == 'dolcrypt') { // dolibarr reversible encryption - if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { - $new_array_options[$key] = dolEncrypt($this->array_options[$key]); + if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master } else { - $new_array_options[$key] = $this->array_options[$key]; // Value is kept + $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept } } else { - $newvalue = dol_hash($this->array_options[$key], $algo); - $new_array_options[$key] = $newvalue; + $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept + } + } else { + if ($algo == 'dolcrypt') { // dolibarr reversible encryption + if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); + } else { + $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept + } + } else { + $new_array_options["options_".$key] = dol_hash($this->array_options["options_".$key], $algo); } } } else { - $new_array_options[$key] = $this->array_options[$key]; // Value is kept + if ($algo == 'dolcrypt' && !preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { // dolibarr reversible encryption + $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master + } else { + $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept + } } } else { - $new_array_options[$key] = $this->array_options[$key]; // Value is kept + // No encryption + $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept } } else { // Common usage - $new_array_options[$key] = $this->array_options[$key]; // Value is kept + $new_array_options["options_".$key] = $this->array_options["options_".$key]; // Value is kept } - $this->array_options["options_".$key] = $new_array_options[$key]; + + $this->array_options["options_".$key] = $new_array_options["options_".$key]; break; case 'date': case 'datetime': @@ -6835,11 +6864,14 @@ abstract class CommonObject */ case 'checkbox': case 'chkbxlst': - if (is_array($this->array_options[$key])) { - $new_array_options[$key] = implode(',', $this->array_options[$key]); + $new_array_options = array(); + if (is_array($this->array_options["options_".$key])) { + $new_array_options["options_".$key] = implode(',', $this->array_options["options_".$key]); } else { - $new_array_options[$key] = $this->array_options[$key]; + $new_array_options["options_".$key] = $this->array_options["options_".$key]; } + + $this->array_options["options_".$key] = $new_array_options["options_".$key]; break; } @@ -6857,6 +6889,7 @@ abstract class CommonObject } } + //var_dump('linealreadyfound='.$linealreadyfound.' sql='.$sql); if ($linealreadyfound) { if ($this->array_options["options_".$key] === null) { $sql = "UPDATE ".$this->db->prefix().$this->table_element."_extrafields SET ".$key." = null"; @@ -6864,6 +6897,12 @@ abstract class CommonObject $sql = "UPDATE ".$this->db->prefix().$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; } $sql .= " WHERE fk_object = ".((int) $this->id); + + $resql = $this->db->query($sql); + if (!$resql) { + $error++; + $this->error = $this->db->lasterror(); + } } else { $result = $this->insertExtraFields('', $user); if ($result < 0) { @@ -6871,11 +6910,6 @@ abstract class CommonObject } } - $resql = $this->db->query($sql); - if (!$resql) { - $error++; - $this->error = $this->db->lasterror(); - } if (!$error && $trigger) { // Call trigger $this->context = array('extrafieldupdate'=>1); @@ -9647,7 +9681,6 @@ abstract class CommonObject */ public function updateCommon(User $user, $notrigger = false) { - global $conf, $langs; dol_syslog(get_class($this)."::updateCommon update", LOG_DEBUG); $error = 0; @@ -9715,7 +9748,7 @@ abstract class CommonObject // Update extrafield if (!$error) { - $result = $this->insertExtraFields(); + $result = $this->insertExtraFields(); // This delete and reinsert extrafields if ($result < 0) { $error++; } From 6fe66999f84af471976c911e45934e3270482f4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Oct 2023 00:31:13 +0200 Subject: [PATCH 1123/1137] Fix include of example --- dev/examples/code/create_invoice.php | 2 +- dev/examples/code/create_order.php | 2 +- dev/examples/code/create_product.php | 2 +- dev/examples/code/create_user.php | 2 +- dev/examples/code/get_contracts.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php index 1d231a7fd7a..0278f0c3bef 100755 --- a/dev/examples/code/create_invoice.php +++ b/dev/examples/code/create_invoice.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once $path."../../htdocs/master.inc.php"; +require_once $path."../../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php index a851ac3cbc5..6d43e323191 100755 --- a/dev/examples/code/create_order.php +++ b/dev/examples/code/create_order.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once $path."../../htdocs/master.inc.php"; +require_once $path."../../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php index 8f742065f2f..e3c8c3c9d76 100755 --- a/dev/examples/code/create_product.php +++ b/dev/examples/code/create_product.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once $path."../../htdocs/master.inc.php"; +require_once $path."../../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index e374fec531d..fb24c6aa39a 100755 --- a/dev/examples/code/create_user.php +++ b/dev/examples/code/create_user.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once $path."../../htdocs/master.inc.php"; +require_once $path."../../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs diff --git a/dev/examples/code/get_contracts.php b/dev/examples/code/get_contracts.php index 40bee133d11..1b30e6b2e17 100755 --- a/dev/examples/code/get_contracts.php +++ b/dev/examples/code/get_contracts.php @@ -40,7 +40,7 @@ $error=0; // -------------------- START OF YOUR CODE HERE -------------------- // Include Dolibarr environment -require_once $path."../../htdocs/master.inc.php"; +require_once $path."../../../htdocs/master.inc.php"; // After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. //$langs->setDefaultLang('en_US'); // To change default language of $langs From 4fe2c674f13a16440d7175e6d0dc9f3d880809f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Oct 2023 00:50:50 +0200 Subject: [PATCH 1124/1137] Set log as a warning --- htdocs/core/lib/security.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 7eaa7a14fdb..817b3c79939 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -190,12 +190,13 @@ function dolDecrypt($chain, $key = '') $key = $conf->file->instance_unique_id; } + //var_dump('key='.$key); $reg = array(); if (preg_match('/^dolcrypt:([^:]+):(.+)$/', $chain, $reg)) { $ciphering = $reg[1]; if (function_exists('openssl_decrypt')) { if (empty($key)) { - dol_syslog("Error dolDecrypt decrypt key is empty", LOG_ERR); + dol_syslog("Error dolDecrypt decrypt key is empty", LOG_WARNING); return $chain; } $tmpexplode = explode(':', $reg[2]); From 6e18d1b7abfd1d8837ff4fd5a797b8ccdc84a3cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Oct 2023 02:00:00 +0200 Subject: [PATCH 1125/1137] Start to introduce dolibarr_main_dolcrypt_key --- htdocs/conf/conf.php.example | 13 ++++++++++++- htdocs/core/lib/security.lib.php | 6 +++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index d1eedc42427..fa88bf20504 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -186,7 +186,7 @@ $dolibarr_main_db_readonly=0; // dolibarr_main_instance_unique_id // ================================ // An secret ID that is unique for each installation. -// This value is also visible and never propagated outside of Dolibarr, so it can be used as a salt / key for some encryption (For example to get +// This value is also never visible and never propagated outside of Dolibarr, so it can be used as a salt / key for some encryption (For example to get // a unique hashed key, application will hash the value concatenated with a string. Example: md5('dolibarr'+dolibarr_main_instance_unique_id) // WARNING: Changing this value will also make some sensitive values encrypted in database wrong. // Default value: randomly defined during installation @@ -196,6 +196,17 @@ $dolibarr_main_db_readonly=0; $dolibarr_main_instance_unique_id='84b5bc91f83b56e458db71e0adac2b62'; +// dolibarr_main_dolcrypt_key +// ========================== +// An secret key to encrypt/decrypt data with dolcrypt() method, for reversible encryption. +// This value is also never visible and never propagated outside of Dolibarr, it is used as key for the dolcrypt encryption. +// WARNING: Changing this value will also make some sensitive values encrypted in database wrong. +// Default value: ''. When not defined, the $dolibarr_main_instance_unique_id will be used instead. +// Examples: +// $dolibarr_main_dolcrypt_key=''; +// +$dolibarr_main_dolcrypt_key=''; + //################## // Login diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 817b3c79939..824f36f9dba 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -187,7 +187,11 @@ function dolDecrypt($chain, $key = '') } if (empty($key)) { - $key = $conf->file->instance_unique_id; + if (!empty($conf->file->dolcrypt_key)) { + $key = $conf->file->dolcrypt_key; + } else { + $key = $conf->file->instance_unique_id; + } } //var_dump('key='.$key); From 3b6f4f717c56de99149a989deb3fce6a60d8431d Mon Sep 17 00:00:00 2001 From: Guillaume Wauquier Date: Tue, 3 Oct 2023 19:37:43 +0200 Subject: [PATCH 1126/1137] FIX : Update api_supplier_orders.class.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Constat : L'api ne renvoie pas le même resultat que l'interface dolibarr. la construction de la requete est incorrecte. Requete obtenu avant correctif: SELECT t.rowid, sc.fk_soc, sc.fk_user, t.fk_soc FROM llx_commande_fournisseur as t, llx_societe_commerciaux as sc WHERE t.entity IN (1) AND t.fk_soc = sc.fk_soc AND t.rowid = sc.fk_soc AND sc.fk_user = 4 ORDER BY t.rowid ASC LIMIT 101 Le t.rowid = sc.fk_soc compare des endives et des parpaings. => suppression de la ligne 143 à 145. Et ensuite correction des conditionnelles pour construire une requete correcte. --- htdocs/fourn/class/api_supplier_orders.class.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index dcf5856340c..3dad6ca8a9e 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -113,17 +113,17 @@ class SupplierOrders extends DolibarrApi // If the internal user must only see his customers, force searching by him $search_sale = 0; - if (!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") && !$socids) { + if (!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") && !empty($socids)) { $search_sale = DolibarrApiAccess::$user->id; } $sql = "SELECT t.rowid"; - if ((!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") && !$socids) || $search_sale > 0) { + if ((!DolibarrApiAccess::$user->hasRight("societe", "client", "voir")) || $search_sale > 0) { $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) } $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur AS t LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields - if ((!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") && !$socids) || $search_sale > 0) { + if ((!DolibarrApiAccess::$user->hasRight("societe", "client", "voir")) || $search_sale > 0) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale } @@ -132,7 +132,7 @@ class SupplierOrders extends DolibarrApi } $sql .= ' WHERE t.entity IN ('.getEntity('supplier_order').')'; - if ((!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") && !$socids) || $search_sale > 0) { + if ((!DolibarrApiAccess::$user->hasRight("societe", "client", "voir")) || $search_sale > 0) { $sql .= " AND t.fk_soc = sc.fk_soc"; } if (!empty($product_ids)) { @@ -141,9 +141,6 @@ class SupplierOrders extends DolibarrApi if ($socids) { $sql .= " AND t.fk_soc IN (".$this->db->sanitize($socids).")"; } - if ($search_sale > 0) { - $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale - } // Filter by status if ($status == 'draft') { From 5bcd89d66cb4a3e9a37898732a7f80ae04b5f5e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Oct 2023 19:39:22 +0200 Subject: [PATCH 1127/1137] Debug v19 --- htdocs/core/lib/functions.lib.php | 21 +++++++++++++-------- htdocs/modulebuilder/index.php | 4 ++-- htdocs/user/virtualcard.php | 12 +++--------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 23559409136..52728245c6d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4219,23 +4219,28 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $pictowithouttext = str_replace('object_', '', $pictowithouttext); $pictowithouttext = str_replace('_nocolor', '', $pictowithouttext); - if (strpos($pictowithouttext, 'fontawesome_') !== false || preg_match('/^fa-/', $pictowithouttext)) { - // This is a font awesome image 'fonwtawesome_xxx' or 'fa-xxx' + if (strpos($pictowithouttext, 'fontawesome_') === 0 || strpos($pictowithouttext, 'fa-') === 0) { + // This is a font awesome image 'fontawesome_xxx' or 'fa-xxx' $pictowithouttext = str_replace('fontawesome_', '', $pictowithouttext); $pictowithouttext = str_replace('fa-', '', $pictowithouttext); + // Compatibility with old fontawesome versions + if ($pictowithouttext == 'file-o') { + $pictowithouttext = 'file'; + } + $pictowithouttextarray = explode('_', $pictowithouttext); $marginleftonlyshort = 0; if (!empty($pictowithouttextarray[1])) { // Syntax is 'fontawesome_fakey_faprefix_facolor_fasize' or 'fa-fakey_faprefix_facolor_fasize' $fakey = 'fa-'.$pictowithouttextarray[0]; - $fa = empty($pictowithouttextarray[1]) ? 'fa' : $pictowithouttextarray[1]; + $faprefix = empty($pictowithouttextarray[1]) ? 'fas' : $pictowithouttextarray[1]; $facolor = empty($pictowithouttextarray[2]) ? '' : $pictowithouttextarray[2]; $fasize = empty($pictowithouttextarray[3]) ? '' : $pictowithouttextarray[3]; } else { $fakey = 'fa-'.$pictowithouttext; - $fa = 'fa'; + $faprefix = 'fas'; $facolor = ''; $fasize = ''; } @@ -4254,7 +4259,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } $moreatt = trim($moreatt); - $enabledisablehtml = ''; /*if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $enabledisablehtml .= $titlealt; @@ -4274,7 +4279,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice', 'edit', 'ellipsis-h', 'email', 'entity', 'envelope', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt', 'eye', - 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus', 'font', + 'filter', 'file', 'file-o', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus', 'font', 'gears', 'generate', 'generic', 'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group', 'hands-helping', 'help', 'holiday', 'id-card', 'images', 'incoterm', 'info', 'intervention', 'inventory', 'intracommreport', 'jobprofile', @@ -4302,7 +4307,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $facolor = ''; $fasize = ''; $fa = getDolGlobalString('MAIN_FONTAWESOME_ICON_STYLE', 'fas'); - if (in_array($pictowithouttext, array('card', 'bell', 'clock', 'establishment', 'generic', 'minus-square', 'object_generic', 'pdf', 'plus-square', 'timespent', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) { + if (in_array($pictowithouttext, array('card', 'bell', 'clock', 'establishment', 'file', 'file-o', 'generic', 'minus-square', 'object_generic', 'pdf', 'plus-square', 'timespent', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) { $fa = 'far'; } if (in_array($pictowithouttext, array('black-tie', 'github', 'google', 'microsoft', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'stripe', 'stripe-s', 'youtube', 'google-plus-g', 'whatsapp'))) { @@ -4319,7 +4324,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accounting'=>'search-dollar', 'category'=>'tag', 'dollyrevert'=>'dolly', - 'generate'=>'plus-square', 'hrm'=>'user-tie', 'incoterm'=>'truck-loading', + 'file-o'=>'file', 'generate'=>'plus-square', 'hrm'=>'user-tie', 'incoterm'=>'truck-loading', 'margin'=>'calculator', 'members'=>'user-friends', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', 'email'=>'at', 'establishment'=>'building', 'edit'=>'pencil-alt', 'entity'=>'globe', 'graph'=>'chart-line', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle', diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 86aa539fa05..0d77c2ac814 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2019 Nicolas ZABOURI +/* Copyright (C) 2004-2023 Laurent Destailleur + * Copyright (C) 2018-2019 Nicolas ZABOURI * Copyright (C) 2023 Alexandre Janniaux * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/user/virtualcard.php b/htdocs/user/virtualcard.php index 0df9d037de0..b7a8f65d263 100644 --- a/htdocs/user/virtualcard.php +++ b/htdocs/user/virtualcard.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2023 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -129,10 +129,6 @@ print '
'; print '
'; -if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) { - print ''.$langs->trans("UserPublicPageDesc").'

'; -} - $param = '&id='.((int) $object->id); $param .= '&dol_openinpopup=1'; @@ -142,6 +138,8 @@ if (!getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) { $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; + + $enabledisablehtml .= '

'.$langs->trans("UserPublicPageDesc").'

'; } else { // Button on, click to disable $enabledisablehtml .= ''; @@ -160,10 +158,6 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) { print ''; print ''; - - print '
'; - - //print $langs->trans('FollowingLinksArePublic').'
'; print img_picto('', 'globe').' '.$langs->trans('PublicVirtualCardUrl').'
'; From 73bdb715076c8a101bc7507a0a35a686d919e389 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Oct 2023 19:54:06 +0200 Subject: [PATCH 1128/1137] Fix bom --- htdocs/bom/bom_list.php | 12 +++++++++++- htdocs/bom/class/bom.class.php | 6 ++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 07f0879589a..40983f8a22e 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; // Load translation files required by the page $langs->loadLangs(array('mrp', 'other')); @@ -687,8 +688,17 @@ while ($i < $imaxinloop) { print '
'; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index bf942c7ad86..3cc3b6c6770 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1617,9 +1617,6 @@ class BOM extends CommonObject $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); - $prod = new Product($db); - $prod->fetch($this->fk_product); - $return = '
'; $return .= '
'; $return .= ''; @@ -1636,7 +1633,8 @@ class BOM extends CommonObject $return .= ''.$this->fields['bomtype']['arrayofkeyval'][1].''; } } - if (property_exists($this, 'fk_product') && !is_null($this->fk_product)) { + if (!empty($arraydata['prod'])) { + $prod = $arraydata['prod']; $return .= '
'.$prod->getNomUrl(1).''; } if (method_exists($this, 'getLibStatut')) { From df097d74bd79ffa34ead78e11b5f7244b3a0cb72 Mon Sep 17 00:00:00 2001 From: tnegre Date: Wed, 4 Oct 2023 09:42:53 +0200 Subject: [PATCH 1129/1137] fix ticket card: set origin_email to null --- htdocs/ticket/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index adf2561cbd4..6f3e43bfb65 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -236,7 +236,8 @@ if (empty($reshook)) { $object->category_label = $langs->trans($langs->getLabelFromKey($db, $object->category_code, 'c_ticket_category', 'code', 'label')); $object->severity_code = GETPOST("severity_code", 'alpha'); $object->severity_label = $langs->trans($langs->getLabelFromKey($db, $object->severity_code, 'c_ticket_severity', 'code', 'label')); - $object->email_from = $object->origin_email = $user->email; + $object->email_from = $user->email; + $object->origin_email = null; $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1; $fk_user_assign = GETPOST("fk_user_assign", 'int'); From f59a0f5eba1fbcf86c44d85e2bc804f0964211a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:17:02 +0200 Subject: [PATCH 1130/1137] warning error and duplicate --- htdocs/fichinter/document.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 32495a8b9ad..51e97cb7bfe 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -129,7 +129,7 @@ if ($object->id) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; - if ($usercancreate && 0) { + if ($permissiontoadd && 0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; @@ -164,7 +164,6 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'ficheinter'; - $permissiontoadd = $user->rights->ficheinter->creer; $permtoedit = $user->rights->ficheinter->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; From bf1437ff8be350459987265e24e6b0a3014b0760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:17:56 +0200 Subject: [PATCH 1131/1137] Update note.php --- htdocs/fichinter/note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index aa2f452bbd0..471c5c64485 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -94,7 +94,7 @@ if ($id > 0 || !empty($ref)) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'; - if ($usercancreate && 0) { + if ($permissionnote && 0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; From 1b8c72f30d398736dd1a175ef7293b72a0e720b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Oct 2023 11:08:19 +0200 Subject: [PATCH 1132/1137] fix html typo --- htdocs/install/fileconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 86cd4af0f5c..ed6c8e8b33e 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -483,7 +483,7 @@ if (!empty($force_install_noedit)) {
'; } else { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS' - || $db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' - || $db->errno() == 'DB_ERROR_USER_ALREADY_EXISTS') { - dolibarr_install_syslog("step1: user already exists"); - print ''; - print ''; + || $db->errno() == 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' + || $db->errno() == 'DB_ERROR_USER_ALREADY_EXISTS') { + dolibarr_install_syslog("step1: user already exists"); + print ''; + print ''; } else { dolibarr_install_syslog("step1: failed to create user", LOG_ERR); print '
FileLineType
' . $obj->description . ''.nl2br(dol_trunc($obj->description, $trunclength)).''; + print ''; print ' '; print '
'; @@ -1780,16 +1817,18 @@ if ($resql) { } // Action column - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
'; - $arrayofstatus = array(); - foreach ($object->statuts_short as $key => $val) { - $arrayofstatus[$key] = $langs->trans($val); - } - $arrayofstatus['99'] = $langs->trans("NotClosed").' ('.$langs->trans('Draft').' + '.$langs->trans('Opened').')'; - print $form->selectarray('search_status', $arrayofstatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1); + $formproject->selectProjectsStatus($search_status, 1, 'search_status'); print '
'; print '
'; } + + // TODO Use a cache for product + if (!empty($obj->fk_product)) { + $prod = new Product($db); + $prod->fetch($obj->fk_product); + } else { + $prod = null; + } + // Output kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $object->getKanbanView('', array('prod'=>$prod, 'selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print '
- unescapeslashquot = true; - + // To say that SQL we pass to query are already escaped for mysql, so we need to unescape them + if (property_exists($db, 'unescapeslashquot')) { + $db->unescapeslashquot = true; + } /************************************************************************************** * From 553776a77a444ffa47c4fa0647a1c2a5407bff5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Oct 2023 12:58:44 +0200 Subject: [PATCH 1134/1137] Enhance error message when set character set failed --- htdocs/core/db/mysqli.class.php | 85 +++++++++++++++++++-------------- htdocs/install/step1.php | 26 +++++----- 2 files changed, 64 insertions(+), 47 deletions(-) diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index c5a4a4104e2..77b339f4fc2 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -117,8 +117,21 @@ class DoliDBMysqli extends DoliDB $clientmustbe = 'utf8'; } - if ($this->db->character_set_name() != $clientmustbe) { - $this->db->set_charset($clientmustbe); // This set charset, but with a bad collation + $disableforcecharset = 0; // Set to 1 to test without charset forcing + if (empty($disableforcecharset) && $this->db->character_set_name() != $clientmustbe) { + try { + //print "You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name(); + dol_syslog(get_class($this)."::DoliDBMysqli You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name(), LOG_WARNING); + $this->db->set_charset($clientmustbe); // This set charset, but with a bad collation + } catch (Exception $e) { + print 'Failed to force character set to '.$clientmustbe." according to setup to match the one of the server database.
\n"; + print $e->getMessage(); + print "
\n"; + if ($clientmustbe != 'utf8') { + print 'Edit conf/conf.php file to set a charset "utf8" instead of "'.$clientmustbe.'".'."\n"; + } + exit; + } $collation = (empty($conf) ? 'utf8_unicode_ci' : $conf->db->dolibarr_main_db_collation); if (preg_match('/latin1/', $collation)) { @@ -137,7 +150,7 @@ class DoliDBMysqli extends DoliDB dol_syslog(get_class($this)."::DoliDBMysqli : Select_db error ".$this->error, LOG_ERR); } } else { - // Pas de selection de base demandee, ok ou ko + // No selection of database done. We may only be connected or not (ok or ko) to the server. $this->database_selected = false; if ($this->connected) { @@ -504,35 +517,35 @@ class DoliDBMysqli extends DoliDB } else { // Constants to convert a MySql error code to a generic Dolibarr error code $errorcode_map = array( - 1004 => 'DB_ERROR_CANNOT_CREATE', - 1005 => 'DB_ERROR_CANNOT_CREATE', - 1006 => 'DB_ERROR_CANNOT_CREATE', - 1007 => 'DB_ERROR_ALREADY_EXISTS', - 1008 => 'DB_ERROR_CANNOT_DROP', - 1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS', - 1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP', - 1044 => 'DB_ERROR_ACCESSDENIED', - 1046 => 'DB_ERROR_NODBSELECTED', - 1048 => 'DB_ERROR_CONSTRAINT', - 1050 => 'DB_ERROR_TABLE_ALREADY_EXISTS', - 1051 => 'DB_ERROR_NOSUCHTABLE', - 1054 => 'DB_ERROR_NOSUCHFIELD', - 1060 => 'DB_ERROR_COLUMN_ALREADY_EXISTS', - 1061 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS', - 1062 => 'DB_ERROR_RECORD_ALREADY_EXISTS', - 1064 => 'DB_ERROR_SYNTAX', - 1068 => 'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS', - 1075 => 'DB_ERROR_CANT_DROP_PRIMARY_KEY', - 1091 => 'DB_ERROR_NOSUCHFIELD', - 1100 => 'DB_ERROR_NOT_LOCKED', - 1136 => 'DB_ERROR_VALUE_COUNT_ON_ROW', - 1146 => 'DB_ERROR_NOSUCHTABLE', - 1215 => 'DB_ERROR_CANNOT_ADD_FOREIGN_KEY_CONSTRAINT', - 1216 => 'DB_ERROR_NO_PARENT', - 1217 => 'DB_ERROR_CHILD_EXISTS', - 1396 => 'DB_ERROR_USER_ALREADY_EXISTS', // When creating a user that already existing - 1451 => 'DB_ERROR_CHILD_EXISTS', - 1826 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' + 1004 => 'DB_ERROR_CANNOT_CREATE', + 1005 => 'DB_ERROR_CANNOT_CREATE', + 1006 => 'DB_ERROR_CANNOT_CREATE', + 1007 => 'DB_ERROR_ALREADY_EXISTS', + 1008 => 'DB_ERROR_CANNOT_DROP', + 1022 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS', + 1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP', + 1044 => 'DB_ERROR_ACCESSDENIED', + 1046 => 'DB_ERROR_NODBSELECTED', + 1048 => 'DB_ERROR_CONSTRAINT', + 1050 => 'DB_ERROR_TABLE_ALREADY_EXISTS', + 1051 => 'DB_ERROR_NOSUCHTABLE', + 1054 => 'DB_ERROR_NOSUCHFIELD', + 1060 => 'DB_ERROR_COLUMN_ALREADY_EXISTS', + 1061 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS', + 1062 => 'DB_ERROR_RECORD_ALREADY_EXISTS', + 1064 => 'DB_ERROR_SYNTAX', + 1068 => 'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS', + 1075 => 'DB_ERROR_CANT_DROP_PRIMARY_KEY', + 1091 => 'DB_ERROR_NOSUCHFIELD', + 1100 => 'DB_ERROR_NOT_LOCKED', + 1136 => 'DB_ERROR_VALUE_COUNT_ON_ROW', + 1146 => 'DB_ERROR_NOSUCHTABLE', + 1215 => 'DB_ERROR_CANNOT_ADD_FOREIGN_KEY_CONSTRAINT', + 1216 => 'DB_ERROR_NO_PARENT', + 1217 => 'DB_ERROR_CHILD_EXISTS', + 1396 => 'DB_ERROR_USER_ALREADY_EXISTS', // When creating a user that already existing + 1451 => 'DB_ERROR_CHILD_EXISTS', + 1826 => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS' ); if (isset($errorcode_map[$this->db->errno])) { @@ -1076,7 +1089,7 @@ class DoliDBMysqli extends DoliDB */ public function getDefaultCharacterSetDatabase() { - $resql = $this->query('SHOW VARIABLES LIKE \'character_set_database\''); + $resql = $this->query("SHOW VARIABLES LIKE 'character_set_database'"); if (!$resql) { // version Mysql < 4.1.1 return $this->forcecharset; @@ -1119,7 +1132,7 @@ class DoliDBMysqli extends DoliDB */ public function getDefaultCollationDatabase() { - $resql = $this->query('SHOW VARIABLES LIKE \'collation_database\''); + $resql = $this->query("SHOW VARIABLES LIKE 'collation_database'"); if (!$resql) { // version Mysql < 4.1.1 return $this->forcecollate; @@ -1162,7 +1175,7 @@ class DoliDBMysqli extends DoliDB { $fullpathofdump = '/pathtomysqldump/mysqldump'; - $resql = $this->query('SHOW VARIABLES LIKE \'basedir\''); + $resql = $this->query("SHOW VARIABLES LIKE 'basedir'"); if ($resql) { $liste = $this->fetch_array($resql); $basedir = $liste['Value']; @@ -1180,7 +1193,7 @@ class DoliDBMysqli extends DoliDB { $fullpathofimport = '/pathtomysql/mysql'; - $resql = $this->query('SHOW VARIABLES LIKE \'basedir\''); + $resql = $this->query("SHOW VARIABLES LIKE 'basedir'"); if ($resql) { $liste = $this->fetch_array($resql); $basedir = $liste['Value']; diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index c0b737eed09..397fe75bcd7 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -335,12 +335,16 @@ if (!$error && $db->connected) { $defaultCharacterSet = $db->forcecharset; $defaultDBSortingCollation = $db->forcecollate; - } else // If already created, we take current value - { + } else { // If already created, we take current value $defaultCharacterSet = $db->getDefaultCharacterSetDatabase(); $defaultDBSortingCollation = $db->getDefaultCollationDatabase(); } + // It seems some PHP driver mysqli does not support utf8mb3 + if ($defaultCharacterSet == 'utf8mb3' || $defaultDBSortingCollation == 'utf8mb3_unicode_ci') { + $defaultCharacterSet = 'utf8'; + $defaultDBSortingCollation = 'utf8_unicode_ci'; + } // Force to avoid utf8mb4 because index on field char 255 reach limit of 767 char for indexes (example with mysql 5.6.34 = mariadb 10.0.29) // TODO Remove this when utf8mb4 is supported if ($defaultCharacterSet == 'utf8mb4' || $defaultDBSortingCollation == 'utf8mb4_unicode_ci') { @@ -578,14 +582,14 @@ if (!$error && $db->connected && $action == "set") { print '
Ok
'; - print $langs->trans("UserCreation").' : '; - print $dolibarr_main_db_user; - print ''.$langs->trans("LoginAlreadyExists").'
'; + print $langs->trans("UserCreation").' : '; + print $dolibarr_main_db_user; + print ''.$langs->trans("LoginAlreadyExists").'
'; @@ -920,7 +924,7 @@ function write_conf_file($conffile) fputs($fp, '$dolibarr_main_force_https=\''.$main_force_https.'\';'); fputs($fp, "\n"); - fputs($fp, '$dolibarr_main_restrict_os_commands=\'mysqldump, mysql, pg_dump, pgrestore, mariadb, mariadb-dump, clamdscan, clamscan.exe\';'); + fputs($fp, '$dolibarr_main_restrict_os_commands=\'mariadb-dump, mariadb, mysqldump, mysql, pg_dump, pgrestore, clamdscan, clamscan.exe\';'); fputs($fp, "\n"); fputs($fp, '$dolibarr_nocsrfcheck=\'0\';'); From a2b6532c5a5467a88778ced9d854ae2dfbf1268d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Oct 2023 16:32:38 +0200 Subject: [PATCH 1135/1137] Debug v19 --- htdocs/compta/facture/card-rec.php | 4 +++- htdocs/compta/facture/class/facture-rec.class.php | 6 +++--- htdocs/compta/facture/class/facture.class.php | 9 +++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index caed8177b3b..5181608fd50 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -243,7 +243,9 @@ if (empty($reshook)) { $oldinvoice = new Facture($db); $oldinvoice->fetch(GETPOST('facid', 'int')); - $result = $object->create($user, $oldinvoice->id); + $onlylines = GETPOST('toselect', 'array'); + + $result = $object->create($user, $oldinvoice->id, 0, $onlylines); if ($result > 0) { $result = $oldinvoice->delete($user, 1); if ($result < 0) { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 160f54e5ece..ad9b55d328d 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -232,9 +232,10 @@ class FactureRec extends CommonInvoice * @param User $user User object * @param int $facid Id of source invoice * @param int $notrigger No trigger + * @param array $onlylines Only the lines of the array * @return int <0 if KO, id of invoice created if OK */ - public function create($user, $facid, $notrigger = 0) + public function create($user, $facid, $notrigger = 0, $onlylines = array()) { global $conf; @@ -336,12 +337,11 @@ class FactureRec extends CommonInvoice $this->multicurrency_tx = $facsrc->multicurrency_tx; // Add lines - $selectedLines = GETPOST('toselect', 'array'); $fk_parent_line = 0; $num = count($facsrc->lines); for ($i = 0; $i < $num; $i++) { - if (!in_array($facsrc->lines[$i]->id, $selectedLines)) { + if (!empty($onlylines) && !in_array($facsrc->lines[$i]->id, $onlylines)) { continue; // Skip unselected lines } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 65cd10fb58d..76fdb80f966 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -519,7 +519,7 @@ class Facture extends CommonInvoice $nextdatewhen = null; $previousdaynextdatewhen = null; - // Create invoice from a template recurring invoice + // Erase some properties of the invoice to create with the one of the recurring invoice if ($this->fac_rec > 0) { $this->fk_fac_rec_source = $this->fac_rec; @@ -796,7 +796,7 @@ class Facture extends CommonInvoice if (!$error && empty($this->fac_rec) && count($this->lines) && is_object($this->lines[0])) { // If this->lines is array of InvoiceLines (preferred mode) $fk_parent_line = 0; - dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects"); + dol_syslog("There is ".count($this->lines)." lines into ->lines that are InvoiceLines"); foreach ($this->lines as $i => $val) { $newinvoiceline = $this->lines[$i]; @@ -884,7 +884,7 @@ class Facture extends CommonInvoice } elseif (!$error && empty($this->fac_rec)) { // If this->lines is an array of invoice line arrays $fk_parent_line = 0; - dol_syslog("There is ".count($this->lines)." lines that are array lines"); + dol_syslog("There is ".count($this->lines)." lines into ->lines as a simple array"); foreach ($this->lines as $i => $val) { $line = $this->lines[$i]; @@ -969,9 +969,10 @@ class Facture extends CommonInvoice } /* - * Insert lines of template invoices + * Insert lines coming from the template invoice */ if (!$error && $this->fac_rec > 0) { + dol_syslog("There is ".count($_facrec->lines)." lines from recurring invoice"); $fk_parent_line = 0; foreach ($_facrec->lines as $i => $val) { From 0f448389d18aec72ddf5db17d6c2ff975c7a94e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Oct 2023 20:40:24 +0200 Subject: [PATCH 1136/1137] Update actions_ticket.class.php --- htdocs/ticket/class/actions_ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 1ade13d61e6..4d157caceca 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -357,7 +357,7 @@ class ActionsTicket $filePath = DOL_DATA_ROOT.'/'.$doc->filepath.'/'.$doc->filename; $mime = dol_mimetype($filePath); $thumb = $arraymsgs['id'].'/thumbs/'.substr($doc->filename, 0, strrpos($doc->filename, '.')).'_mini'.substr($doc->filename, strrpos($doc->filename, '.')); - $doclink = dol_buildpath('document.php', 1)."?hashp=$doc->share"; + $doclink = DOL_URL_ROOT.'/document.php?hashp='.urlencode($doc->share); $mimeAttr = ' mime="'.$mime.'" '; $class = ''; From 955439a6734c37a36e19d38b0701caa72c48abc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Oct 2023 21:09:55 +0200 Subject: [PATCH 1137/1137] SEC: Add action confirm_... as sensitive to need a CSRF token --- htdocs/main.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e3ec0b60b18..0e4aca46920 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -529,14 +529,14 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) { } } -//dol_syslog("aaaa - ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha')); +//dol_syslog("CSRF info: ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha')); // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set into page if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN')) || defined('CSRFCHECK_WITH_TOKEN')) { // Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request) $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. + // All GET actions (except the listed exception) and mass actions are processed as sensitive. if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude some action that are legitimate $sensitiveget = true; } @@ -551,8 +551,8 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) { $sensitiveget = true; } - // We also match for value with just a simple string that must match - if (preg_match('/^(add|classify|close|confirm|copy|del|disable|enable|remove|set|unset|update|save|sepa)/', GETPOST('action', 'aZ09'))) { + // We also need a valid token for actions matching one of these values + if (preg_match('/^(confirm_)?(add|classify|close|confirm|copy|del|disable|enable|remove|set|unset|update|save)/', GETPOST('action', 'aZ09'))) { $sensitiveget = true; } }