diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index ff60a067420..51aaca26db7 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -10734,36 +10734,12 @@ parameters: count: 1 path: ../../../htdocs/core/customreports.php - - - message: '#^Variable \$gval might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/customreports.php - - message: '#^Variable \$page might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/core/customreports.php - - - message: '#^Variable \$search_graph might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/core/customreports.php - - - - message: '#^Variable \$search_groupby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/core/customreports.php - - - - message: '#^Variable \$search_xaxis might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../../htdocs/core/customreports.php - - message: '#^Variable \$search_yaxis might not be defined\.$#' identifier: variable.undefined @@ -10782,12 +10758,6 @@ parameters: count: 1 path: ../../../htdocs/core/customreports.php - - - message: '#^Variable \$tabfamily might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/core/customreports.php - - message: '#^Constructor of class DoliDBMysqli has an unused parameter \$type\.$#' identifier: constructor.unusedParameter @@ -10866,12 +10836,6 @@ parameters: count: 1 path: ../../../htdocs/core/db/sqlite3.class.php - - - message: '#^Method DoliDBSqlite3\:\:getListOfCollation\(\) should return array\\|null but returns array\{array\{charset\: ''UTF\-8'', description\: ''UTF\-8''\}\}\.$#' - identifier: return.type - count: 1 - path: ../../../htdocs/core/db/sqlite3.class.php - - message: '#^Cannot access property \$db on mixed\.$#' identifier: property.nonObject @@ -11424,12 +11388,6 @@ parameters: count: 3 path: ../../../htdocs/core/lib/images.lib.php - - - message: '#^Variable \$extImg might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/lib/images.lib.php - - message: '#^Loose comparison using \=\= between ''suppliers'' and ''fourn'' will always evaluate to false\.$#' identifier: equal.alwaysFalse @@ -12150,12 +12108,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php - - - message: '#^Variable \$carac_client_name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -12198,12 +12150,6 @@ parameters: count: 2 path: ../../../htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php - - - message: '#^Variable \$result might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/barcode/doc/phpbarcode.modules.php - - message: '#^Property modTcpdfbarcode\:\:\$is2d has no type specified\.$#' identifier: missingType.property @@ -12216,18 +12162,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/barcode/mod_barcode_product_standard.php - - - message: '#^Property mod_barcode_product_standard\:\:\$numbitcounter has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/barcode/mod_barcode_product_standard.php - - - - message: '#^Property mod_barcode_product_standard\:\:\$searchcode has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/barcode/mod_barcode_product_standard.php - - message: '#^Parameter \#2 \$type of method mod_barcode_thirdparty_standard\:\:literalBarcodeType\(\) expects int, string given\.$#' identifier: argument.type @@ -12336,12 +12270,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 1 - path: ../../../htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php - - message: '#^Property Commande\:\:\$availability \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -12450,18 +12378,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php - - - message: '#^Variable \$carac_client_name might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php - - - - message: '#^Variable \$realpath might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Contrat given\.$#' identifier: argument.type @@ -12498,12 +12414,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/delivery/doc/pdf_storm.modules.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 1 - path: ../../../htdocs/core/modules/delivery/doc/pdf_storm.modules.php - - message: '#^Parameter \#3 \$posy of method pdf_storm\:\:_tableau_info\(\) expects int, float given\.$#' identifier: argument.type @@ -12558,12 +12468,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/delivery/doc/pdf_storm.modules.php - - - message: '#^Variable \$realpath might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/delivery/doc/pdf_storm.modules.php - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -12582,24 +12486,6 @@ parameters: count: 2 path: ../../../htdocs/core/modules/delivery/doc/pdf_typhon.modules.php - - - message: '#^Property pdf_typhon\:\:\$posxcomm has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/delivery/doc/pdf_typhon.modules.php - - - - message: '#^Property pdf_typhon\:\:\$posxremainingqty has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/delivery/doc/pdf_typhon.modules.php - - - - message: '#^Property pdf_typhon\:\:\$posxweightvol has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/delivery/doc/pdf_typhon.modules.php - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -12720,24 +12606,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/expedition/doc/pdf_merou.modules.php - - - message: '#^Property pdf_merou\:\:\$destinataire has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/expedition/doc/pdf_merou.modules.php - - - - message: '#^Property pdf_merou\:\:\$expediteur has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/expedition/doc/pdf_merou.modules.php - - - - message: '#^Property pdf_merou\:\:\$livreur has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/expedition/doc/pdf_merou.modules.php - - message: '#^Parameter \#4 \$posy of method pdf_rouget\:\:_tableau_tot\(\) expects int, float given\.$#' identifier: argument.type @@ -12768,36 +12636,6 @@ parameters: count: 6 path: ../../../htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php - - - message: '#^Property pdf_standard_expensereport\:\:\$postotalttc has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php - - - - message: '#^Property pdf_standard_expensereport\:\:\$posxcomment has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php - - - - message: '#^Property pdf_standard_expensereport\:\:\$posxpiece has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php - - - - message: '#^Property pdf_standard_expensereport\:\:\$posxprojet has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php - - - - message: '#^Property pdf_standard_expensereport\:\:\$posxtype has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -12900,12 +12738,6 @@ parameters: count: 13 path: ../../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 1 - path: ../../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - message: '#^Parameter \#1 \$a of method pdf_octopus\:\:sumSituation\(\) expects array\\|float\|int\>, array\ given\.$#' identifier: argument.type @@ -13068,12 +12900,6 @@ parameters: count: 3 path: ../../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - - message: '#^Variable \$realpath might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/facture/doc/pdf_octopus.modules.php - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -13086,12 +12912,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/facture/doc/pdf_sponge.modules.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 1 - path: ../../../htdocs/core/modules/facture/doc/pdf_sponge.modules.php - - message: '#^Property CommonInvoice\:\:\$type \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -13212,12 +13032,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/facture/doc/pdf_sponge.modules.php - - - message: '#^Variable \$realpath might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/facture/doc/pdf_sponge.modules.php - - message: '#^Property mod_facture_mars\:\:\$prefixcreditnote has no type specified\.$#' identifier: missingType.property @@ -13296,12 +13110,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php - - - message: '#^Variable \$max might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/fichinter/mod_pacific.php - - message: '#^Property CommonObject\:\:\$entity \(int\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -14094,36 +13902,6 @@ parameters: count: 2 path: ../../../htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php - - - message: '#^Property pdf_standard_movementstock\:\:\$posxdatemouv has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php - - - - message: '#^Property pdf_standard_movementstock\:\:\$posxidref has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php - - - - message: '#^Property pdf_standard_movementstock\:\:\$wref has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php - - - - message: '#^Variable \$lastmovementdate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php - - - - message: '#^Variable \$result might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php - - message: '#^Parameter \#1 \$object of method CommonDocGenerator\:\:get_substitutionarray_each_var_object\(\) expects array\, Mo given\.$#' identifier: argument.type @@ -14526,12 +14304,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/propale/doc/pdf_azur.modules.php - - - message: '#^Variable \$filetomerge_dir might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/core/modules/propale/doc/pdf_azur.modules.php - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -14646,12 +14418,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/propale/doc/pdf_cyan.modules.php - - - message: '#^Variable \$filetomerge_dir might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/core/modules/propale/doc/pdf_cyan.modules.php - - message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#' identifier: function.alreadyNarrowedType diff --git a/dev/initdemo/mysqldump_dolibarr_21.0.0.sql b/dev/initdemo/mysqldump_dolibarr_21.0.0.sql index 8beb53eac6f..9b6c75e5123 100644 --- a/dev/initdemo/mysqldump_dolibarr_21.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_21.0.0.sql @@ -60051,15 +60051,6 @@ INSERT INTO `llx_const` VALUES (12776,'MAIN_VERSION_LAST_UPGRADE',0,'21.0.0','chaine',0,'Dolibarr version for last upgrade','2025-01-06 15:48:34'), (12777,'MAIN_FIRST_PING_OK_DATE',2,'20250106154835','chaine',0,'','2025-01-06 15:48:35'), (12778,'MAIN_FIRST_PING_OK_ID',2,'disabled','chaine',0,'','2025-01-06 15:48:35'), -(12781,'MAIN_MODULE_MULTICOMPANY',0,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\",\"lastactivationversion\":\"18.0.1\"}','2025-01-06 15:50:14'), -(12782,'MAIN_MODULE_MULTICOMPANY_LOGIN',0,'1','chaine',0,NULL,'2025-01-06 15:50:14'), -(12783,'MAIN_MODULE_MULTICOMPANY_TRIGGERS',0,'1','chaine',0,NULL,'2025-01-06 15:50:14'), -(12784,'MAIN_MODULE_MULTICOMPANY_HOOKS',0,'[\"login\",\"main\",\"mainloginpage\",\"upgrade\",\"upgrade2\",\"cashdeskloginpage\",\"passwordforgottenpage\",\"toprightmenu\",\"adminmodules\",\"admincompany\",\"commonobject\",\"thirdpartiesindex\",\"commercialindex\",\"globalcard\",\"thirdpartycard\",\"thirdpartycontact\",\"thirdpartylist\",\"customerlist\",\"prospectlist\",\"supplierlist\",\"usercard\",\"userperms\",\"groupcard\",\"groupperms\",\"userlist\",\"userhome\",\"userdao\",\"contactlist\",\"contactprospectlist\",\"contactcustomerlist\",\"contactsupplierlist\",\"contactotherlist\",\"productindex\",\"productcard\",\"productservicelist\",\"pricesuppliercard\",\"productreassortlist\",\"propalcard\",\"propallist\",\"ordercard\",\"orderlist\",\"invoicecard\",\"invoicelist\",\"warehousecard\",\"stocklist\",\"memberlist\",\"membercard\",\"projectlist\",\"projectcard\",\"accountancyadminaccount\"]','chaine',0,NULL,'2025-01-06 15:50:14'), -(12785,'MAIN_MODULE_MULTICOMPANY_CSS',0,'/multicompany/css/multicompany.css.php','chaine',0,NULL,'2025-01-06 15:50:14'), -(12786,'MAIN_MODULE_MULTICOMPANY_SUBSTITUTIONS',0,'/multicompany/core/substitutions/','chaine',0,NULL,'2025-01-06 15:50:14'), -(12787,'MULTICOMPANY_MAIN_VERSION',0,'18.0.1','chaine',0,NULL,'2025-01-06 15:50:14'), -(12788,'MULTICOMPANY_EXTERNAL_MODULES_SHARING',0,'','chaine',0,NULL,'2025-01-06 15:50:14'), -(12789,'MULTICOMPANY_PMP_PER_ENTITY_ENABLED',0,'1','chaine',0,NULL,'2025-01-06 15:50:14'), (12790,'MAIN_IHM_PARAMS_REV',2,'1','chaine',0,'','2025-01-06 15:50:15'), (12791,'MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT',2,'commonkanban','chaine',0,'','2025-01-06 15:50:15'), (12792,'MAIN_FIRST_PING_OK_DATE',1,'20250106155034','chaine',0,'','2025-01-06 15:50:34'), diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php index 36c10eb7429..68d24732235 100644 --- a/htdocs/adherents/class/api_memberstypes.class.php +++ b/htdocs/adherents/class/api_memberstypes.class.php @@ -1,6 +1,7 @@ - * Copyright (C) 2025 MDW + * Copyright (C) 2025 MDW + * Copyright (C) 2025 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 diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 3fcfa7c7b36..5ad30fc921f 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -490,6 +490,14 @@ print ''; print ajax_constantonoff('EXPEDITION_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); print ''; +// Pre fill shipment qty option +print ''; +print ''.$langs->trans("DontPrefillShipmentQty"); +print ''; +print ''; +print ajax_constantonoff('SHIPMENT_DONT_PREFILL_QTY', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, ''); +print ''; + print ''; print $form->buttonsSaveCancel("Modify", ''); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 7ec045037ad..71e27fc5729 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1269,7 +1269,9 @@ if ($mode == 'marketplace') { print '
'; - if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) { + $conf->global->MAIN_DISABLE_DOLISTORE_SEARCH = 1; // avoid warning with the new Dolistore website + + if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // $options is array with filter criteria if (getDolGlobalInt('MAIN_ENANLE_OLD_DOLISTORE')) { diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6e1b9083210..08a680c1e1b 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1466,12 +1466,13 @@ class Categorie extends CommonObject // phpcs:enable $ways = array(); - $all_ways = $this->get_all_ways(); // Load array of categories - foreach ($all_ways as $way) { + $all_ways = $this->get_all_ways(); // Load array of categories to reach this->id + + foreach ($all_ways as $way) { // It seems we always have 1 entry in this array. $w = array(); $i = 0; $forced_color = ''; - foreach ($way as $cat) { + foreach ($way as $cat) { // Loop on each successive categories to reach the target of current category $i++; if (empty($nocolor)) { @@ -1511,6 +1512,7 @@ class Categorie extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Returns an array containing the list of parent categories + * Note: A category can only have one parent but this method return an array to work the same way the get_filles is working. * * @return int|Categorie[] Return integer <0 KO, array OK */ @@ -1541,7 +1543,7 @@ class Categorie extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Returns in a table all possible paths to get to the category + * Returns in a array all possible paths to go to the category * starting with the major categories represented by Tables of categories * * @return Categorie[][] @@ -1554,7 +1556,7 @@ class Categorie extends CommonObject $parents = $this->get_meres(); if (is_array($parents)) { foreach ($parents as $parent) { - $all_ways = $parent->get_all_ways(); + $all_ways = $parent->get_all_ways(); // recursivity. TODO Add a protection for infinite loop foreach ($all_ways as $way) { $w = $way; $w[] = $this; @@ -1646,8 +1648,8 @@ class Categorie extends CommonObject } /** - * Returns categories whose id or name match - * add wildcards in the name unless $exact = true + * Returns categories whose id or name matches. + * It add wildcards in the name unless $exact = true * * @param int $id Id * @param string $nom Name diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 93ae98884a3..86b41f9d7ad 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -7,7 +7,7 @@ * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Open-DSI - * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -33,14 +33,13 @@ // Load Dolibarr environment require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (isModEnabled('project')) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -} +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; /** * @var Conf $conf @@ -50,14 +49,7 @@ if (isModEnabled('project')) { * @var User $user */ -if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) { - $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW = 3; -} - -if (!getDolGlobalString('AGENDA_EXT_NB')) { - $conf->global->AGENDA_EXT_NB = 5; -} -$MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB'); +$MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB', 5); $DELAYFORCACHE = 300; // 300 seconds $disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); @@ -122,10 +114,10 @@ $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); $month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m"); $week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W"); $day = GETPOSTINT("day") ? GETPOSTINT("day") : date("d"); -$pid = GETPOSTINT("search_projectid", 3) ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3); +$pid = GETPOSTISSET("search_projectid") ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3); $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); -$maxprint = GETPOSTISSET("maxprint") ? GETPOSTINT("maxprint") : getDolGlobalInt('AGENDA_MAX_EVENTS_DAY_VIEW'); +$maxprint = GETPOSTISSET("maxprint") ? GETPOSTINT("maxprint") : getDolGlobalInt('AGENDA_MAX_EVENTS_DAY_VIEW', 3); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear')); @@ -149,7 +141,7 @@ if (is_scalar($actioncode) && $actioncode == '-1') { } if ($status == '' && !GETPOSTISSET('search_status')) { - $status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); + $status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS')); } $defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month'); // default for app @@ -253,14 +245,14 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung'; -llxHeader('', $langs->trans("Agenda"), $help_url); - $form = new Form($db); $companystatic = new Societe($db); $contactstatic = new Contact($db); $userstatic = new User($db); +$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung'; +llxHeader('', $langs->trans("Agenda"), $help_url); + $now = dol_now(); $nowarray = dol_getdate($now); $nowyear = $nowarray['year']; @@ -407,9 +399,13 @@ if ($mode == 'show_day') { //print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour'); /*$title = $langs->trans("DoneAndToDoActions"); - if ($status == 'done') $title = $langs->trans("DoneActions"); - if ($status == 'todo') $title = $langs->trans("ToDoActions"); - */ +if ($status == 'done') { + $title = $langs->trans("DoneActions"); +} +if ($status == 'todo') { + $title = $langs->trans("ToDoActions"); +} +*/ $param = ''; if ($actioncode || GETPOSTISSET('search_actioncode')) { @@ -428,10 +424,10 @@ if ($status || GETPOSTISSET('status') || GETPOSTISSET('search_status')) { $param .= "&search_status=".urlencode($status); } if ($filter) { - $param .= "&search_filter=".urlencode($filter); + $param .= "&search_filter=".urlencode((string) $filter); } if ($filtert) { - $param .= "&search_filtert=".urlencode($filtert); + $param .= "&search_filtert=".urlencode((string) $filtert); } if ($usergroup > 0) { $param .= "&search_usergroup=".urlencode((string) ($usergroup)); @@ -624,8 +620,8 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on $s .= ''."\n"; - if (!empty($conf->use_javascript_ajax)) { - $s .= '
'.$langs->trans("LocalAgenda").'  
'; - if (is_array($showextcals) && count($showextcals) > 0) { - foreach ($showextcals as $val) { - $htmlname = md5($val['name']); - $s .= ''."\n"; - $s .= '
'.$val ['name'].'  
'; - } - } - - //$s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; - - // Calendars from hooks - $parameters = array(); - $reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action); - if (empty($reshook)) { - $s .= $hookmanager->resPrint; - } elseif ($reshook > 1) { - $s = $hookmanager->resPrint; - } - } +if ($optioncss != '') { + print ''; } +print ''; +print ''; + $mode = 'show_peruser'; $massactionbutton = ''; @@ -444,31 +465,31 @@ $massactionbutton = ''; $viewmode = '