diff --git a/ChangeLog b/ChangeLog index e1030fa18de..4ca56665cee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ NEW Minimal PHP version is now PHP 7.0 instead of PHP 5.6 For developers or integrators: ------------------------------ +NEW Minimal PHP version is now PHP 7.0 instead of PHP 5.6 + ... @@ -25,6 +27,7 @@ Following changes may create regressions for some external modules, but were nec * Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead. + ***** ChangeLog for 16.0.0 compared to 15.0.0 ***** For users: @@ -49,28 +52,24 @@ NEW: ACE Editor is restored at same cursor position after a save. NEW: Add "addMoreActionsButtons" hook to subscription form NEW: Add an option in GUI to show a Quick add button into top menu bar NEW: Add a workflow to auto link contract on a ticket -NEW: Add column date of Signature on proposal list NEW: Add column template invoice in invoice list NEW: Add column "Total HT" to products array on document creation card NEW: Add configuration for text color of button action -NEW: Add entity filter in exports NEW: Show the event block on recurring invoices #20870 NEW: Add firstname, lastname and max number of attendees for module "Event Organization" NEW: Add margin info in proposal and order list -NEW: Add massaction "Edit Extrafield" for Product NEW: Add more fields to detect duplicate during import of thirdparties NEW: Add option to foce delivery on email for purchase order receipt to yes NEW: Add possibility to create contract from invoice NEW: Add possibility with constant MAIN_LOGIN_BADCHARUNAUTHORIZED to define bad character unauthorized into login name -NEW: Add private and public notes on tax files. +NEW: Add private and public notes on tax files NEW: Add substitutions "user numbers" -NEW: allow a ticket to be automatically marked as read when created from backend. NEW: allow cut&paste as real numeric value to excel NEW: A public form to send a message and create a lead is available NEW: automatically set totally received status in reception NEW: Auto set invoice paid when adding credit not and remain to pay is 0 +NEW: Backup tool has an "lowmemory" option for mysqldump on large database NEW: Can enter price with tax for predefined products on purchase objects -NEW: Can filter on a thirdparty on product statistics NEW: Can removed doc templates from setup page of thirdparty NEW: Can use ! to make a search that exclude a string NEW: clean values and amount in FEC import @@ -86,12 +85,13 @@ NEW: Dictionaries - Availibility dictionnary has a new column unit and number NEW: Display errors in a message box after generating documents NEW: Enhance the import. Can use 'auto' for the ref (import of orders) NEW: Events on Proposal to Return to Draft +NEW: Exports - add entity filter in exports NEW: Page to list expense report payments NEW: JS inventory autocalc input NEW: language support for more emailing target selectors NEW: leave requests: add field into type dictionary to block request if balance is negative NEW: Mass action "Close shipments" -NEW: Module BOM - add tabs for nets Bom +NEW: Module BOM - add tabs for nets BOM NEW: Module BOM - add the possibility to add sub-BOMs to BOM NEW: Module Recruitment - Add a public page with list of all open job positions. NEW: Module Recruitment - Add a tab with list of application on the jobposition file. @@ -105,14 +105,18 @@ NEW: Knowledge Management - add status "Obsolete" to KM articles NEW: MRP - split consumption line on MO NEW: MRP - display physical and virtual stock of the products when creating OF from a BOM NEW: MRP - display product ref in "Object link" product tab for BOM +NEW: Orders - support user_modif in order +NEW: Products - add massaction "Edit Extrafield" for Product +NEW: Products - List - add thumbnail field in product list +NEW: Products - Statistics - can filter on a thirdparty NEW: Projects - add filter "opportunity status" on statistics of projects. NEW: Proposals - option update prices on proposal cloning +NEW: Proposals - List - add column date of Signature on proposal list NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level NEW: Stocks - stock filter in reassort lists NEW: Stocks - stock limit in stock export CSV NEW: Stocks - Inventory - can change value of AWP during the inventory NEW: Supplier order - Show ref supplier of reception in linked object block -NEW: support user_modif in order NEW: Surveys - Show number of votes into the label of tab "Results" of a survey NEW: TakePOS - barcode rule to insert product in TakePOS NEW: TakePOS - pagination on search results @@ -122,19 +126,18 @@ NEW: TakePOS - add constant to show category description NEW: TakePOS - add constant to show only the products in stock NEW: Themes - add param color button action NEW: Themes - Change in theme colors does not need to use the refresh button -NEW: Themes - more mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) +NEW: Themes - more modes for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) NEW: Themes - MD - add param border table for md theme -NEW: Third-Parties - Add rules "customer accountancy code" is mandatory to validate invoice -NEW: Third-Parties - Can set the parent company during the creation of thirdparty (action=add of societe/card.php) +NEW: Third-Parties - add rules "customer accountancy code" is mandatory to validate invoice +NEW: Third-Parties - can set the parent company during the creation of thirdparty (action=add of societe/card.php) +NEW: Tickets - allow a Ticket to be automatically marked as read when created from backend NEW: Tickets - create Third-party with contact if not found on public ticket NEW: Tickets - option to default check "notify tier at creation" NEW: Tickets - Trigger: allow to automatically send messages on new tickets NEW: Tickets - optional display warning icons on ticket list NEW: Websites Module - supports now the multicompany module NEW: Websites Module - on redirect of page in website module, GET parameters are kept. -NEW: The backup tools has an "lowmemory" option for mysqldump on large database NEW: The 'reposition' class works on ajax constantonoff that make redirects -NEW: thumbnail field in product list NEW: total mark rate in list NEW: uncheck "send message" by default on a ticket when private messages has been checked NEW: VAT Report by month - Show detail by rate and also by code @@ -142,8 +145,8 @@ NEW: Added MMK currency (Myanmar Kyat) NEW: On a form to send an email, we show all emails of contacts of object Modules state -NEW: Module Partnership Management -NEW: Module Event Organization Management +NEW: Module Partnership Management - stable +NEW: Module Event Organization Management - stable For developers or integrators: diff --git a/dev/examples/zapier/triggers/action.js b/dev/examples/zapier/triggers/action.js index 0e152473869..86e4b747185 100644 --- a/dev/examples/zapier/triggers/action.js +++ b/dev/examples/zapier/triggers/action.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -84,7 +84,7 @@ const getFallbackRealAction = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/actions', +// url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/actions', // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/contact.js b/dev/examples/zapier/triggers/contact.js index 2ba3bd226f8..ef83970e0b5 100644 --- a/dev/examples/zapier/triggers/contact.js +++ b/dev/examples/zapier/triggers/contact.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -76,7 +76,7 @@ const getFallbackRealContact = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -94,7 +94,7 @@ const getFallbackRealContact = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/member.js b/dev/examples/zapier/triggers/member.js index 3385cdca625..68f80b30009 100644 --- a/dev/examples/zapier/triggers/member.js +++ b/dev/examples/zapier/triggers/member.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -76,7 +76,7 @@ const getFallbackRealMember = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -94,7 +94,7 @@ const getFallbackRealMember = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/order.js b/dev/examples/zapier/triggers/order.js index 061ce218d10..2265c4da288 100644 --- a/dev/examples/zapier/triggers/order.js +++ b/dev/examples/zapier/triggers/order.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -74,7 +74,7 @@ const getFallbackRealOrder = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/orders', +// url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/orders', // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/thirdparty.js b/dev/examples/zapier/triggers/thirdparty.js index 76194acbc9a..6c477b1174f 100644 --- a/dev/examples/zapier/triggers/thirdparty.js +++ b/dev/examples/zapier/triggers/thirdparty.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -83,7 +83,7 @@ const getFallbackRealThirdparty = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -102,7 +102,7 @@ const getFallbackRealThirdparty = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/ticket.js b/dev/examples/zapier/triggers/ticket.js index c642099bd55..ee5a3f8efd7 100644 --- a/dev/examples/zapier/triggers/ticket.js +++ b/dev/examples/zapier/triggers/ticket.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -76,7 +76,7 @@ const getFallbackRealTicket = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -97,7 +97,7 @@ const getFallbackRealTicket = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/dev/examples/zapier/triggers/user.js b/dev/examples/zapier/triggers/user.js index 92209bb8651..a706bb9a3d6 100644 --- a/dev/examples/zapier/triggers/user.js +++ b/dev/examples/zapier/triggers/user.js @@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => { action: bundle.inputData.action }; - const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + const url = bundle.authData.url + '/api/index.php/zapier/hook'; // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. @@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => { // You can build requests and our client will helpfully inject all the variables // you need to complete. You can also register middleware to control this. const options = { - url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id, method: 'DELETE', }; @@ -73,7 +73,7 @@ const getFallbackRealUser = (z, bundle) => { // const getModulesChoices = (z/*, bundle*/) => { // // For the test poll, you should get some real data, to aid the setup process. // const options = { -// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices', // }; // return z.request(options).then((response) => JSON.parse(response.content)); @@ -93,7 +93,7 @@ const getFallbackRealUser = (z, bundle) => { // // For the test poll, you should get some real data, to aid the setup process. // const module = bundle.inputData.module; // const options = { -// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`, // }; // return z.request(options).then((response) => JSON.parse(response.content)); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index ef1daf0b6c8..e13211fb239 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -21,24 +21,26 @@ */ /** - * \file htdocs/adherents/agenda.php - * \ingroup member - * \brief Page of members events + * \file htdocs/adherents/agenda.php + * \ingroup member + * \brief Page of members events */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; // Load translation files required by the page -$langs->loadLangs(array("companies", "members")); +$langs->loadLangs(array('companies', 'members')); +// Get Parameters $id = GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('rowid', 'int'); +// Pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -72,6 +74,7 @@ $objcanvas = null; // Security check $result = restrictedArea($user, 'adherent', $id); +// Initialize technical objects $object = new Adherent($db); $result = $object->fetch($id); if ($result > 0) { @@ -116,9 +119,7 @@ $contactstatic = new Contact($db); $form = new Form($db); -/* - * Customer and/or supplier category sheet - */ + if ($object->id > 0) { require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 10e9b90ccd6..926f988567b 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -139,7 +139,7 @@ $formldap = new FormLdap($db); print '
'; print ''; -print dol_get_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'ldap', '', -1); print ''; @@ -245,7 +245,8 @@ print ''; print '
'.$langs->trans // Pass print ''; print '
'.$langs->trans("LDAPPassword").''; -print ''; +print ''; +print showValueWithClipboardCPButton(getDolGlobalString('LDAP_ADMIN_PASS'), 0, ' '); print ''.$langs->trans('Password').' (ex: secret)
'; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 0f8fec1cecc..6ee7b38e0b8 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -140,7 +140,7 @@ if (!function_exists("ldap_connect")) { setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } -print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'contacts', '', -1); print ''.$langs->trans("LDAPDescContact").'
'; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 23a4103bc75..5079d6d2d29 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -114,7 +114,7 @@ if (!function_exists("ldap_connect")) { setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } -print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'groups', '', -1); print ''.$langs->trans("LDAPDescGroups").'
'; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index b7783c99ca0..b9461430bf9 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -188,7 +188,7 @@ if (!function_exists("ldap_connect")) { print ''; print ''; -print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'members', '', -1); print ''.$langs->trans("LDAPDescMembers").'
'; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index abb017ea037..7b3ac57192f 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -106,7 +106,7 @@ if (!function_exists("ldap_connect")) { setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } -print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'memberstypes', '', -1); print ''.$langs->trans("LDAPDescMembersTypes").'
'; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 2ec3ef169d8..ad84a5889ed 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -178,7 +178,7 @@ print ''; -print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'users', '', -1); print ''.$langs->trans("LDAPDescUsers").'
'; print '
'; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 80efc0a9891..86c76ca1604 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -411,7 +411,7 @@ foreach ($configfileparameters as $key => $value) { } elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) { print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); } elseif ($newkey == 'dolibarr_main_document_root_alt') { - $tmparray = explode(',', ${$newkey}); + $tmparray = explode(',', $dolibarr_main_document_root_alt); $i = 0; foreach ($tmparray as $value2) { if ($i > 0) { @@ -429,7 +429,7 @@ foreach ($configfileparameters as $key => $value) { global $dolibarr_main_cookie_cryptkey, $dolibarr_main_instance_unique_id; $valuetoshow = $dolibarr_main_instance_unique_id ? $dolibarr_main_instance_unique_id : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey if (empty($dolibarr_main_prod)) { - print ''; + print ''; print showValueWithClipboardCPButton($valuetoshow, 0, '********'); } else { print '**********'; diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index aa09cf0a27c..d8a0b384971 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -36,7 +36,6 @@ if (!$user->admin) { } - /* * View */ @@ -218,6 +217,14 @@ print "".$name.""; print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; +$functions = array(); +$name = "zip"; + +print ""; +print "".$name.""; +print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); +print ""; + $functions = array(); $name = "xDebug"; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 76c4a42ddce..a5d85633bee 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1900,7 +1900,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht'; } - $totalarray['val']['p.total_ht'] += $obj->total_ht; + if (empty($totalarray['val']['p.total_ht'])) { + $totalarray['val']['p.total_ht'] = $obj->total_ht; + } else { + $totalarray['val']['p.total_ht'] += $obj->total_ht; + } } // Amount VAT if (!empty($arrayfields['p.total_tva']['checked'])) { @@ -1911,7 +1915,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'p.total_tva'; } - $totalarray['val']['p.total_tva'] += $obj->total_tva; + if (empty($totalarray['val']['p.total_tva'])) { + $totalarray['val']['p.total_tva'] = $obj->total_tva; + } else { + $totalarray['val']['p.total_tva'] += $obj->total_tva; + } } // Amount TTC if (!empty($arrayfields['p.total_ttc']['checked'])) { @@ -1922,7 +1930,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ttc'; } - $totalarray['val']['p.total_ttc'] += $obj->total_ttc; + if (empty($totalarray['val']['p.total_ttc'])) { + $totalarray['val']['p.total_ttc'] = $obj->total_ttc; + } else { + $totalarray['val']['p.total_ttc'] += $obj->total_ttc; + } } // Amount invoiced HT if (!empty($arrayfields['p.total_ht_invoiced']['checked'])) { @@ -1933,7 +1945,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'p.total_ht_invoiced'; } - $totalarray['val']['p.total_ht_invoiced'] += $totalInvoicedHT; + if (empty($totalarray['val']['p.total_ht_invoiced'])) { + $totalarray['val']['p.total_ht_invoiced'] = $totalInvoicedHT; + } else { + $totalarray['val']['p.total_ht_invoiced'] += $totalInvoicedHT; + } } // Amount invoiced TTC if (!empty($arrayfields['p.total_invoiced']['checked'])) { @@ -1944,7 +1960,11 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced'; } - $totalarray['val']['p.total_invoiced'] += $totalInvoicedTTC; + if (empty($totalarray['val']['p.total_invoiced'])) { + $totalarray['val']['p.total_invoiced'] = $totalInvoicedTTC; + } else { + $totalarray['val']['p.total_invoiced'] += $totalInvoicedTTC; + } } // Currency if (!empty($arrayfields['p.multicurrency_code']['checked'])) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 58a6ce70f0f..67473ebcd68 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1283,9 +1283,9 @@ if ($resql) { if ($massaction == 'createbills') { print ''; - print ''; + print '
'; print ''; - print ''; print ''; print '
'; + print ''; print $langs->trans('DateInvoice'); print ''; @@ -1320,12 +1320,11 @@ if ($resql) { print '
'; - print '
'; print '
'; print ' '; print ''; print '
'; - print '
'; + print '

'; } if ($sall) { diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index ea371e804f3..e9a7bdf2ee1 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -451,87 +451,86 @@ if (empty($dirfortmpfile)) { if ($result && $action == "dl" && !$error) { if (!extension_loaded('zip')) { setEventMessages('PHPZIPExtentionNotLoaded', null, 'errors'); - exit; - } + } else { + dol_mkdir($dirfortmpfile); - dol_mkdir($dirfortmpfile); - - $log = $langs->transnoentitiesnoconv("Type"); - if (isModEnabled('multicompany') && is_object($mc)) { - $log .= ','.$langs->transnoentitiesnoconv("Entity"); - } - $log .= ','.$langs->transnoentitiesnoconv("Date"); - $log .= ','.$langs->transnoentitiesnoconv("DateDue"); - $log .= ','.$langs->transnoentitiesnoconv("Ref"); - $log .= ','.$langs->transnoentitiesnoconv("TotalHT"); - $log .= ','.$langs->transnoentitiesnoconv("TotalTTC"); - $log .= ','.$langs->transnoentitiesnoconv("TotalVAT"); - $log .= ','.$langs->transnoentitiesnoconv("Paid"); - $log .= ','.$langs->transnoentitiesnoconv("Document"); - $log .= ','.$langs->transnoentitiesnoconv("ItemID"); - $log .= ','.$langs->transnoentitiesnoconv("ThirdParty"); - $log .= ','.$langs->transnoentitiesnoconv("Code"); - $log .= ','.$langs->transnoentitiesnoconv("Country"); - $log .= ','.$langs->transnoentitiesnoconv("VATIntra"); - $log .= ','.$langs->transnoentitiesnoconv("Sens")."\n"; - $zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc', 'tzuserrel')."-".dol_print_date($date_stop, 'dayrfc', 'tzuserrel'); - if (!empty($projectid)) { - $project = new Project($db); - $project->fetch($projectid); - if ($project->ref) { - $zipname .= '_'.$project->ref; + $log = $langs->transnoentitiesnoconv("Type"); + if (isModEnabled('multicompany') && is_object($mc)) { + $log .= ','.$langs->transnoentitiesnoconv("Entity"); } - } - $zipname .='_export.zip'; - - dol_delete_file($zipname); - - $zip = new ZipArchive; - $res = $zip->open($zipname, ZipArchive::OVERWRITE | ZipArchive::CREATE); - if ($res) { - foreach ($filesarray as $key => $file) { - if (!empty($file['files'])) { - foreach ($file['files'] as $filecursor) { - if (file_exists($filecursor["fullname"])) { - $zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]); - } - } + $log .= ','.$langs->transnoentitiesnoconv("Date"); + $log .= ','.$langs->transnoentitiesnoconv("DateDue"); + $log .= ','.$langs->transnoentitiesnoconv("Ref"); + $log .= ','.$langs->transnoentitiesnoconv("TotalHT"); + $log .= ','.$langs->transnoentitiesnoconv("TotalTTC"); + $log .= ','.$langs->transnoentitiesnoconv("TotalVAT"); + $log .= ','.$langs->transnoentitiesnoconv("Paid"); + $log .= ','.$langs->transnoentitiesnoconv("Document"); + $log .= ','.$langs->transnoentitiesnoconv("ItemID"); + $log .= ','.$langs->transnoentitiesnoconv("ThirdParty"); + $log .= ','.$langs->transnoentitiesnoconv("Code"); + $log .= ','.$langs->transnoentitiesnoconv("Country"); + $log .= ','.$langs->transnoentitiesnoconv("VATIntra"); + $log .= ','.$langs->transnoentitiesnoconv("Sens")."\n"; + $zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc', 'tzuserrel')."-".dol_print_date($date_stop, 'dayrfc', 'tzuserrel'); + if (!empty($projectid)) { + $project = new Project($db); + $project->fetch($projectid); + if ($project->ref) { + $zipname .= '_'.$project->ref; } - - $log .= '"'.$langs->trans($file['item']).'"'; - if (isModEnabled('multicompany') && is_object($mc)) { - $log .= ',"'.(empty($arrayofentities[$file['entity']]) ? $file['entity'] : $arrayofentities[$file['entity']]).'"'; - } - $log .= ','.dol_print_date($file['date'], 'dayrfc'); - $log .= ','.dol_print_date($file['date_due'], 'dayrfc'); - $log .= ',"'.$file['ref'].'"'; - $log .= ','.$file['amount_ht']; - $log .= ','.$file['amount_ttc']; - $log .= ','.$file['amount_vat']; - $log .= ','.$file['paid']; - $log .= ',"'.$file["name"].'"'; - $log .= ','.$file['fk']; - $log .= ',"'.$file['thirdparty_name'].'"'; - $log .= ',"'.$file['thirdparty_code'].'"'; - $log .= ',"'.$file['country_code'].'"'; - $log .= ',"'.$file['vatnum'].'"'; - $log .= ',"'.$file['sens'].'"'; - $log .= "\n"; } - $zip->addFromString('transactions.csv', $log); - $zip->close(); - - // Then download the zipped file. - header('Content-Type: application/zip'); - header('Content-disposition: attachment; filename='.basename($zipname)); - header('Content-Length: '.filesize($zipname)); - readfile($zipname); + $zipname .='_export.zip'; dol_delete_file($zipname); - exit(); - } else { - setEventMessages($langs->trans("FailedToOpenFile", $zipname), null, 'errors'); + $zip = new ZipArchive; + $res = $zip->open($zipname, ZipArchive::OVERWRITE | ZipArchive::CREATE); + if ($res) { + foreach ($filesarray as $key => $file) { + if (!empty($file['files'])) { + foreach ($file['files'] as $filecursor) { + if (file_exists($filecursor["fullname"])) { + $zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]); + } + } + } + + $log .= '"'.$langs->trans($file['item']).'"'; + if (isModEnabled('multicompany') && is_object($mc)) { + $log .= ',"'.(empty($arrayofentities[$file['entity']]) ? $file['entity'] : $arrayofentities[$file['entity']]).'"'; + } + $log .= ','.dol_print_date($file['date'], 'dayrfc'); + $log .= ','.dol_print_date($file['date_due'], 'dayrfc'); + $log .= ',"'.$file['ref'].'"'; + $log .= ','.$file['amount_ht']; + $log .= ','.$file['amount_ttc']; + $log .= ','.$file['amount_vat']; + $log .= ','.$file['paid']; + $log .= ',"'.$file["name"].'"'; + $log .= ','.$file['fk']; + $log .= ',"'.$file['thirdparty_name'].'"'; + $log .= ',"'.$file['thirdparty_code'].'"'; + $log .= ',"'.$file['country_code'].'"'; + $log .= ',"'.$file['vatnum'].'"'; + $log .= ',"'.$file['sens'].'"'; + $log .= "\n"; + } + $zip->addFromString('transactions.csv', $log); + $zip->close(); + + // Then download the zipped file. + header('Content-Type: application/zip'); + header('Content-disposition: attachment; filename='.basename($zipname)); + header('Content-Length: '.filesize($zipname)); + readfile($zipname); + + dol_delete_file($zipname); + + exit(); + } else { + setEventMessages($langs->trans("FailedToOpenFile", $zipname), null, 'errors'); + } } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1465b60b2f6..74e063e8664 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4453,7 +4453,7 @@ if ($action == 'create') { if ($result > 0) { print ' '; $s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}'); - $s = str_replace('{s1}', $object->getLibType(1), $s); + $s = str_replace('{s1}', $object->getLibType(0), $s); $s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s); print $s; print '
'; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 3b9019868ec..37b3540a0f5 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -612,7 +612,7 @@ class ChargeSociales extends CommonObject } $linkclose = ''; - if (empty($notooltip) && $user->rights->facture->lire) { + if (empty($notooltip) && $user->hasRight("facture", "read")) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label = $langs->trans("SocialContribution"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 1ce6bed212b..d6efb35ef2f 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -345,8 +345,8 @@ class Tva extends CommonObject $this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_modif = $obj->fk_user_modif; $this->fk_account = $obj->fk_account; - $this->fk_type = $obj->fk_type; - $this->rappro = $obj->rappro; + $this->fk_type = empty($obj->fk_type) ? "" : $obj->fk_type; + $this->rappro = empty($obj->rappro) ? "" : $obj->rappro; } $this->db->free($resql); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 309ea1e4a87..ffc2ef8ca68 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -55,6 +55,7 @@ $search_type = GETPOST('search_type', 'int'); $search_account = GETPOST('search_account', 'int'); $search_amount = GETPOST('search_amount', 'alpha'); $search_status = GETPOST('search_status', 'int'); +$ltt = GETPOST("ltt", "int"); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -278,6 +279,13 @@ if (!empty($search_amount)) { if ($search_status != '' && $search_status != '-1') { $param .= '&search_status='.urlencode($search_status); } +$arrayofmassactions = array( + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), +); +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +$moreforfilter = ''; print ''; if ($optioncss != '') { @@ -294,7 +302,7 @@ $url = DOL_URL_ROOT.'/compta/tva/card.php?action=create'; if (!empty($socid)) { $url .= '&socid='.$socid; } -$newcardbutton = dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer); +$newcardbutton = dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer); print_barre_liste($langs->trans("VATDeclarations"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); $varpage = empty($contextpage) ? $_SERVER['PHP_SELF'] : $contextpage; @@ -429,6 +437,9 @@ print ''; $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; +$total = 0; + while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -523,7 +534,11 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } $totalarray['pos'][$totalarray['nbfield']] = 'amount'; - $totalarray['val']['amount'] += $obj->amount; + if (empty($totalarray['val']['amount'])) { + $totalarray['val']['amount'] = $obj->amount; + } else { + $totalarray['val']['amount'] += $obj->amount; + } } if (!empty($arrayfields['t.status']['checked'])) { diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 38a5884da1c..33d5b5716bc 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -42,6 +42,7 @@ $langs->loadLangs(array('compta', 'bills')); $mode = GETPOST("mode", 'alpha'); $year = GETPOST("year", 'int'); $filtre = GETPOST("filtre", 'alpha'); +$optioncss = GETPOST('optioncss', 'alpha'); if (!$year && $mode != 'tvaonly') { $year = date("Y", time()); } @@ -113,6 +114,8 @@ print ''; print ''; print ''; +$center = ''; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit); if ($year) { diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 4090130bc36..05c29459ee2 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -2,9 +2,9 @@ // Dolibarr example for conf.php file // // Do not edit this file without changing its name. -// This file is an example of empty config file for Dolibarr than can be used to create "conf.php". +// This file is an example of empty config file for Dolibarr that can be used to create "conf.php". // -// Warning: Be sure to not add line feed or spaces after closing php tag. +// Warning: Be sure not to add line feed or spaces after closing php tag! //################### @@ -12,12 +12,14 @@ //################### // dolibarr_main_url_root +// ====================== // This parameter defines the root URL of your Dolibarr index.php page without ending "/". -// It must link to the directory htdocs. +// It must link to the directory htdocs // In most cases, this is autodetected but it's still required // * to show full url bookmarks for some services (ie: agenda rss export url, ...) // * or when using Apache dir aliases (autodetect fails) // * or when using nginx (autodetect fails) +// // Examples: // $dolibarr_main_url_root='http://localhost'; // $dolibarr_main_url_root='http://mydolibarrvirtualhost'; @@ -28,8 +30,9 @@ $dolibarr_main_url_root=''; // dolibarr_main_document_root -// This parameter contains absolute file system directory of Dolibarr -// htdocs directory +// =========================== +// This parameter contains absolute file system path of Dolibarr htdocs directory +// // Examples: // $dolibarr_main_document_root='/var/www/dolibarr/htdocs'; // $dolibarr_main_document_root='C:/My web sites/dolibarr/htdocs'; @@ -38,10 +41,12 @@ $dolibarr_main_document_root=''; // dolibarr_main_url_root_alt +// ========================== // This parameter defines the relative sub URLs to add to $dolibarr_main_url_root to // forge alternative root directories (used by modules developers). // You can put several values, separated by a coma, but number of entries must match // number of entries into $dolibarr_main_document_root_alt. +// // Examples: // $dolibarr_main_url_root_alt='/custom'; // $dolibarr_main_url_root_alt='/extensions1,/extensions2'; @@ -50,10 +55,11 @@ $dolibarr_main_document_root=''; // dolibarr_main_document_root_alt -// This parameter contains absolute alternative root file system directories (used by -// modules developers). +// =============================== +// This parameter contains absolute alternative root file system directories (used by modules developers). // You can put several values, separated by a coma, but number of entries must match // number of entries into $dolibarr_main_url_root_alt. +// // Examples: // $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom'; // $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/extensions1,C:/My web sites/dolibarr/htdocs/extensions2'; @@ -62,8 +68,10 @@ $dolibarr_main_document_root=''; // dolibarr_main_data_root +// ======================= // This parameter contains absolute file system directory of Dolibarr // directory used to store uploaded and generated physical files. +// // Examples: // $dolibarr_main_data_root='/var/www/dolibarr/documents'; // $dolibarr_main_data_root='E:/My web sites/dolibarr/documents'; @@ -72,8 +80,9 @@ $dolibarr_main_data_root=''; // dolibarr_main_db_host -// This parameter contains host name or ip address of Dolibarr database -// server. +// ===================== +// This parameter contains host name or ip address of Dolibarr database server. +// // Examples: // $dolibarr_main_db_host='localhost'; // $dolibarr_main_db_host='127.0.0.1'; @@ -84,7 +93,9 @@ $dolibarr_main_db_host=''; // dolibarr_main_db_port +// ===================== // This parameter contains the port of the Dolibarr database. +// // Default value: none // Examples: // $dolibarr_main_db_host='3306'; @@ -93,7 +104,9 @@ $dolibarr_main_db_port=''; // dolibarr_main_db_name +// ===================== // This parameter contains name of Dolibarr database. +// // Examples: // $dolibarr_main_db_name='dolibarr'; // $dolibarr_main_db_name='mydatabase'; @@ -102,8 +115,9 @@ $dolibarr_main_db_name=''; // dolibarr_main_db_user -// This parameter contains user name used to read and write into -// Dolibarr database. +// ===================== +// This parameter contains user name used to read and write into Dolibarr database. +// // Examples: // $dolibarr_main_db_user='admin'; // $dolibarr_main_db_user='dolibarruser'; @@ -112,8 +126,9 @@ $dolibarr_main_db_user=''; // dolibarr_main_db_pass -// This parameter contains password used to read and write into -// Dolibarr database. +// ===================== +// This parameter contains password used to read and write into Dolibarr database. +// // Examples: // $dolibarr_main_db_pass='myadminpass'; // $dolibarr_main_db_pass='myuserpassword'; @@ -122,8 +137,9 @@ $dolibarr_main_db_pass=''; // dolibarr_main_db_type -// This parameter contains the name of the driver used to access your -// Dolibarr database. +// ===================== +// This parameter contains the name of the driver used to access your Dolibarr database. +// // Default value: none // Possible values: mysqli, pgsql // Examples: @@ -134,7 +150,9 @@ $dolibarr_main_db_type=''; // dolibarr_main_db_character_set +// ============================== // Database character set used to store data (forced during database creation. value of database is then used). +// // Default value: depends on database driver // Examples: // dolibarr_main_db_character_set='utf8'; @@ -143,7 +161,9 @@ $dolibarr_main_db_character_set='utf8'; // dolibarr_main_db_collation +// ========================== // Database character set used to sort data (forced during database creation. value of database is then used). +// // Default value: depends on database driver // Examples: // $dolibarr_main_db_collation='utf8_unicode_ci'; @@ -152,7 +172,8 @@ $dolibarr_main_db_collation='utf8_unicode_ci'; // dolibarr_main_db_readonly -// Set this to 1 to have the application working in readonly mode. All sql access INSERT/UPDATE/DELETE/CREATE/ALTER/TRUNCATE/DROP will be disabled. +// ========================= +// Set this to 1 to have the application working in readonly mode. All SQL commands INSERT/UPDATE/DELETE/CREATE/ALTER/TRUNCATE/DROP will be disabled. // Default value: 0 // Examples: // $dolibarr_main_db_readonly='0'; @@ -161,6 +182,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 // a unique hashed key, application will hash the value concatenated with a string. Example: md5('dolibarr'+dolibarr_main_instance_unique_id) @@ -178,6 +200,7 @@ $dolibarr_main_instance_unique_id='84b5bc91f83b56e458db71e0adac2b62'; //################## // dolibarr_main_authentication +// ============================ // This parameter contains the way authentication is done. // If value "ldap" is used, you must also set parameters dolibarr_main_auth_ldap_* // Default value: 'dolibarr' @@ -186,28 +209,29 @@ $dolibarr_main_instance_unique_id='84b5bc91f83b56e458db71e0adac2b62'; // values using a ",". In this case, Dolibarr will check login/pass for each value in // order defined into value. However, note that this can't work with all values. // Examples: -// $dolibarr_main_authentication='dolibarr'; // Use the password defined into application on user file (default). -// $dolibarr_main_authentication='http'; // Use the HTTP Basic authentication -// $dolibarr_main_authentication='ldap'; // Check the password into a LDAP server -// $dolibarr_main_authentication='ldap,dolibarr'; // You can set several mode using a comma as a separator. -// $dolibarr_main_authentication='forceuser'; // This need to add also $dolibarr_auto_user='loginforuser'; -// $dolibarr_main_authentication='twofactor'; // To use Google Authenticator. This need the non official external module "Two Factor" available on www.dolistore.com +// $dolibarr_main_authentication='dolibarr'; // Use the password defined into application on user file (default). +// $dolibarr_main_authentication='http'; // Use the HTTP Basic authentication +// $dolibarr_main_authentication='ldap'; // Check the password into a LDAP server +// $dolibarr_main_authentication='ldap,dolibarr'; // You can set several mode using a comma as a separator. +// $dolibarr_main_authentication='forceuser'; // This need to add also $dolibarr_auto_user='loginforuser'; +// $dolibarr_main_authentication='twofactor'; // To use Google Authenticator. This need the non official external module "Two Factor" available on www.dolistore.com // $dolibarr_main_authentication='dolibarr'; -// Parameters used to setup LDAP authentication. +// Parameters used to setup LDAP authentication +// -------------------------------------------- // Uncomment them if dolibarr_main_authentication = 'ldap' // // $dolibarr_main_auth_ldap_host='127.0.0.1'; // You can define several servers here separated with a comma. // $dolibarr_main_auth_ldap_port='389'; // Port -// $dolibarr_main_auth_ldap_version='3'; -// $dolibarr_main_auth_ldap_servertype='openldap'; // openldap, activedirectory or egroupware -// $dolibarr_main_auth_ldap_login_attribute='loginfield'; // Ex: uid or samaccountname for active directory +// $dolibarr_main_auth_ldap_version='3'; // Version of LDAP +// $dolibarr_main_auth_ldap_servertype='openldap'; // openldap, activedirectory or egroupware +// $dolibarr_main_auth_ldap_login_attribute='loginfield'; // Ex: uid or samaccountname for active directory // $dolibarr_main_auth_ldap_dn='ou=users,dc=my-domain,dc=com'; // Ex: ou=users,dc=my-domain,dc=com // $dolibarr_main_auth_ldap_filter = ''; // If defined, the two previous parameters (dolibarr_main_auth_ldap_login_attribute and dolibarr_main_auth_ldap_dn) are not used to find a user into LDAP. Instead we use this search string. Ex: (uid=%1%) or &(uid=%1%)(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com). -// $dolibarr_main_auth_ldap_admin_login=''; // Required only if anonymous bind disabled. Ex: cn=admin,dc=example,dc=com -// $dolibarr_main_auth_ldap_admin_pass=''; // Required only if anonymous bind disabled. Ex: secret +// $dolibarr_main_auth_ldap_admin_login=''; // Required only if anonymous bind disabled. Ex: cn=admin,dc=example,dc=com +// $dolibarr_main_auth_ldap_admin_pass=''; // Required only if anonymous bind disabled. Ex: secret // $dolibarr_main_auth_ldap_debug='false'; @@ -224,6 +248,7 @@ $dolibarr_main_authentication='dolibarr'; //################## // dolibarr_main_force_https +// ========================= // This parameter allows to force the HTTPS mode. // 0 = No forced redirect // 1 = Force redirect to https, until SCRIPT_URI start with https into response @@ -241,6 +266,7 @@ $dolibarr_main_authentication='dolibarr'; $dolibarr_main_force_https='0'; // dolibarr_main_prod +// ================== // When this parameter is defined, all errors messages are not reported. // This feature exists for production usage to avoid to give any information to hackers. // Default value: 1 @@ -250,7 +276,8 @@ $dolibarr_main_force_https='0'; // $dolibarr_main_prod='1'; -// $dolibarr_main_restrict_os_commands +// dolibarr_main_restrict_os_commands +// ================================== // 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' @@ -259,7 +286,8 @@ $dolibarr_main_prod='1'; // $dolibarr_main_restrict_os_commands='mysqldump, mysql, pg_dump, pgrestore'; -// $dolibarr_main_restrict_ip +// dolibarr_main_restrict_ip +// ========================= // To restrict access to backoffice to some ip addresses only. Use a comma to separate values. // Note: Pages that does not need login (like public pages, web site) are not protected with this. // Default value: '' @@ -269,6 +297,7 @@ $dolibarr_main_restrict_os_commands='mysqldump, mysql, pg_dump, pgrestore'; $dolibarr_main_restrict_ip=''; // dolibarr_nocsrfcheck +// ==================== // This parameter can be used to disable CSRF protection. // This might be required if you access Dolibarr behind a proxy that make bad URL rewriting, to avoid false alarms. // In most cases, you should always keep this to 0. @@ -280,6 +309,7 @@ $dolibarr_main_restrict_ip=''; $dolibarr_nocsrfcheck='0'; // dolibarr_cron_allow_cli +// ======================= // If set to 1, you will be able to define some command line in the internale Job scheduler module. // Default value: '0' // Examples: '1' @@ -287,6 +317,7 @@ $dolibarr_nocsrfcheck='0'; $dolibarr_cron_allow_cli='0'; // dolibarr_mailing_limit_sendbyweb +// ================================ // Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on system level. // Default value: '25' // Examples: '-1' (sending by web is forbidden) @@ -294,6 +325,7 @@ $dolibarr_cron_allow_cli='0'; // $dolibarr_mailing_limit_sendbyweb='25'; // dolibarr_mailing_limit_sendbycli +// ================================ // Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on system level. // Default value: '0' (no hard limit, use soft database value if exists) // Examples: '-1' (sending by cli is forbidden) @@ -301,18 +333,21 @@ $dolibarr_cron_allow_cli='0'; // $dolibarr_mailing_limit_sendbycli='0'; // MAIN_ANTIVIRUS_COMMAND (as a constant) +// ====================== // Force a value for the antivirus command line tool so setup for admin user interface has no effect. // Default value: '' // Example: '/usr/bin/clamdscan'; // define('MAIN_ANTIVIRUS_COMMAND', '/usr/bin/clamdscan'); // MAIN_ANTIVIRUS_PARAM (as a constant) +// ==================== // Force a value for the antivirus parameters on command line so setup for admin user interface has no effect. // Default value: '' // Example: '--fdpass'; // define('MAIN_ANTIVIRUS_PARAM', '--fdpass'); // php_session_save_handler +// ======================== // Try to use the Dolibarr internal session handler that uses a database instead of the PHP handler (experimental). // If you enable this feature to 'db', you may also want to enable the following constants: // $dolibarr_session_db_type, $dolibarr_session_db_host, $dolibarr_session_db_user, $dolibarr_session_db_pass @@ -323,6 +358,7 @@ $dolibarr_cron_allow_cli='0'; // $php_session_save_handler=''; // force_install_lockinstall +// ========================= // If this value is set to a value, it forces the creation of a file install.lock once an upgrade process into a new version end. // The value is the octal value of permission to set on created file. // The file install.lock prevents the use of the migration process another time. You will have to delete it manually for @@ -338,11 +374,14 @@ $dolibarr_cron_allow_cli='0'; //################## // dolibarr_main_db_prefix -// This parameter contains prefix of Dolibarr database. 'llx_' if not defined. +// ======================= +// This parameter contains prefix of Dolibarr database. +// Default value: 'llx_' if not defined // Examples: // $dolibarr_main_db_prefix='llx_'; // dolibarr_main_limit_users +// ========================= // Can set a limit on the number of users it will be possible to create // (the superadmin not included). Can be used for a restricted mode. // Default value: 0 (unlimited) @@ -350,12 +389,14 @@ $dolibarr_cron_allow_cli='0'; // $dolibarr_main_limit_users='0'; // dolibarr_strict_mode +// ==================== // Set this to 1 to enable the PHP strict mode. For dev environment only. // Default value: 0 (use database value if exist) // Examples: // $dolibarr_strict_mode=0; // dolibarr_allow_download_external_modules +// ======================================== // Provide a link to download the zip of an external modules installed into custom directory from the web admin. // Default value: 0 // Examples: @@ -376,17 +417,19 @@ $dolibarr_cron_allow_cli='0'; //$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$dolibarr_lib_ODTPHP_PATH=''; //$dolibarr_lib_ODTPHP_PATHTOPCLZIP="/usr/share/php/libphp-pclzip"; + // Value to overwrite path to use shared javascript instead of embedded one //$dolibarr_js_CKEDITOR='/javascript/ckeditor'; //$dolibarr_js_JQUERY='/javascript/jquery'; //$dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; + // Value to overwrite some path to use font instead of embedded one //$dolibarr_font_DOL_DEFAULT_TTF="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf"; //$dolibarr_font_DOL_DEFAULT_TTF_BOLD="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf"; //############################## -// External module +// External modules //############################## diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 78a2616058a..6401437ac15 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -300,8 +300,34 @@ if ($action == 'update' && !empty($permissiontoadd)) { } } +// Action to update one modulebuilder field +$reg = array(); +if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) { + $object->fetch(GETPOST('id', 'int')); + + $keyforfield = $reg[1]; + if (property_exists($object, $keyforfield)) { + if (!empty($object->fields[$keyforfield]) && in_array($object->fields[$keyforfield]['type'], array('date', 'datetime', 'timestamp'))) { + $object->$keyforfield = dol_mktime(GETPOST($keyforfield.'hour'), GETPOST($keyforfield.'min'), GETPOST($keyforfield.'sec'), GETPOST($keyforfield.'month'), GETPOST($keyforfield.'day'), GETPOST($keyforfield.'year')); + } else { + $object->$keyforfield = GETPOST($keyforfield); + } + + $result = $object->update($user); + + if ($result > 0) { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + $action = 'view'; + } else { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'edit'.$reg[1]; + } + } +} + // Action to update one extrafield -if ($action == "update_extras" && !empty($permissiontoadd)) { +if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) { $object->fetch(GETPOST('id', 'int')); $attributekey = GETPOST('attribute', 'alpha'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c43f4b53f34..e4dd475606c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -211,7 +211,21 @@ class Form // Check parameters if (empty($typeofdata)) { - return 'ErrorBadParameter'; + return 'ErrorBadParameter typeofdata is empty'; + } + // Clean paramater $typeofdata + if ($typeofdata == 'datetime') { + $typeofdata = 'dayhour'; + } + $reg = array(); + if (preg_match('/^(\w+)\((\d+)\)$/', $typeofdata, $reg)) { + if ($reg[1] == 'varchar') { + $typeofdata = 'string'; + } elseif ($reg[1] == 'int') { + $typeofdata = 'numeric'; + } else { + return 'ErrorBadParameter '.$typeofdata; + } } // When option to edit inline is activated diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 675300169e4..80cd8bb79e2 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1782,6 +1782,8 @@ class FormFile $result = 0; if (is_object($object_instance)) { + $object_instance->id = 0; + $object_instance->ref = ''; if ($id) { $result = $object_instance->fetch($id); } else { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 0ad7f6d6eb6..3be3c4c24f7 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2970,7 +2970,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = 1; } $original_file = $conf->resource->dir_output.'/'.$original_file; - } elseif ($modulepart == 'remisecheque' && !empty($conf->bank->dir_output)) { + } elseif (($modulepart == 'remisecheque' || $modulepart == 'chequereceipt') && !empty($conf->bank->dir_output)) { // Wrapping pour les remises de cheques if ($fuser->rights->banque->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 11cbcad7b85..498e587a328 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -95,7 +95,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = // Edit class files $contentclass = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r'); - // Update ->fields (add or remove entries) + // Update ->fields (to add or remove entries defined into $addfieldentry) if (count($object->fields)) { if (is_array($addfieldentry) && count($addfieldentry)) { $name = $addfieldentry['name']; @@ -133,6 +133,9 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = if (!empty($val['noteditable'])) { $texttoinsert .= " 'noteditable'=>'".$val['noteditable']."',"; } + if (!empty($val['alwayseditable'])) { + $texttoinsert .= " 'alwayseditable'=>'".$val['alwayseditable']."',"; + } if (!empty($val['default']) || (isset($val['default']) && $val['default'] === '0')) { $texttoinsert .= " 'default'=>'".$val['default']."',"; } @@ -189,6 +192,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = } $texttoinsert .= "),\n"; + //print $texttoinsert; } } @@ -212,14 +216,16 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = $texttoinsert .= "\t".'// END MODULEBUILDER PROPERTIES'; - //print($texttoinsert);exit; + //print($texttoinsert); $contentclass = preg_replace('/\/\/ BEGIN MODULEBUILDER PROPERTIES.*END MODULEBUILDER PROPERTIES/ims', $texttoinsert, $contentclass); + //print $contentclass; dol_mkdir(dirname($pathoffiletoedittarget)); //file_put_contents($pathoffiletoedittmp, $contentclass); $result = file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass); + if ($result) { @chmod($pathoffiletoedittarget, octdec($newmask)); } else { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 04629b4dee0..87291071162 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -62,7 +62,7 @@ function product_prepare_head($object) if (!empty($object->status_buy) || (isModEnabled('margin') && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase if ((((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->rights->fournisseur->lire) - || (isModEnabled('margin') && $user->rights->margin->liretous) + || (isModEnabled('margin') && $user->hasRight("margin", "liretous")) ) { if ($usercancreadprice) { $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 2076c6a348e..763973ac031 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -333,7 +333,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ public $phpmin; diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php index 5faf853d7d7..b11e2a7e563 100644 --- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php +++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_asset_odt extends ModelePDFAsset /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document 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 14815f169f2..1e289930cf0 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -70,9 +70,9 @@ class pdf_standard_asset extends ModelePDFAsset /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 514a6c162fd..2dcf5512dc1 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_bom_odt extends ModelePDFBom /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index b9ff88c4fe6..9239ec0ed4b 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_order_odt extends ModelePDFCommandes /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 51994fb3e42..4b0a370f50c 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -74,9 +74,9 @@ class pdf_einstein extends ModelePDFCommandes /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index e0c8425073d..426a98994db 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -74,9 +74,9 @@ class pdf_eratosthene extends ModelePDFCommandes /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index df584348e5e..222286d5592 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -46,9 +46,9 @@ class doc_generic_contract_odt extends ModelePDFContract /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 5b45d0014be..c395b51df7e 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -67,9 +67,9 @@ class pdf_strato extends ModelePDFContract /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 8ec59774cc3..591c720c5d7 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -66,9 +66,9 @@ class pdf_storm extends ModelePDFDeliveryOrder /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 060d74d650a..d5f6f7fdd56 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -65,9 +65,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 8d6e980bdc5..cfb23269ca9 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index ba81cf03544..ee53f846bab 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -63,9 +63,9 @@ class pdf_espadon extends ModelePdfExpedition /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 781d581aaf7..1c457595e93 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -64,9 +64,9 @@ class pdf_merou extends ModelePdfExpedition /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 17b369b788c..af971b99023 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -64,9 +64,9 @@ class pdf_rouget extends ModelePdfExpedition /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index fae58f49419..411bc009b8e 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -71,9 +71,9 @@ class pdf_standard extends ModeleExpenseReport /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 13967843a08..fba0dfa1c4a 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -85,7 +85,7 @@ class ExportExcel2007 extends ModeleExports $this->extension = 'xlsx'; // Extension for generated file by this driver $this->picto = 'mime/xls'; // Picto $this->version = '1.30'; // Driver version - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->disabled = 0; 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 f255fa52474..061f18e5442 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 @@ -47,9 +47,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index c742642079f..9445b81f860 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -70,9 +70,9 @@ class pdf_crabe extends ModelePDFFactures /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index f2e9bf838c4..dd2dc6b4456 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -70,9 +70,9 @@ class pdf_sponge extends ModelePDFFactures /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 2d3e89a6316..097870e21bc 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -66,9 +66,9 @@ class pdf_soleil extends ModelePDFFicheinter /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 9f5a31109a8..594ab96d955 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -726,7 +726,7 @@ class ImportCsv extends ModeleImports } // Define $listfields and $listvalues to build SQL request - if ($conf->socialnetworks->enabled && strpos($fieldname, "socialnetworks") !== false) { + if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; } @@ -840,7 +840,7 @@ class ImportCsv extends ModeleImports foreach ($updatekeys as $key) { $col = $objimport->array_import_updatekeys[0][$key]; $key = preg_replace('/^.*\./i', '', $key); - if ($conf->socialnetworks->enabled && strpos($key, "socialnetworks") !== false) { + if (isModEnabled("socialnetworks") && strpos($key, "socialnetworks") !== false) { $tmp = explode("_", $key); $key = $tmp[0]; $socialnetwork = $tmp[1]; diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 0a196b49ae3..2ab951147b9 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -43,9 +43,9 @@ class doc_generic_member_odt extends ModelePDFMember /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 4e84f3bd3a0..e5cff7e9301 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -66,7 +66,7 @@ class modAccounting extends DolibarrModules $this->depends = array("modFacture", "modBanque", "modTax"); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 9); // Minimum version of Dolibarr required by module $this->langfiles = array("accountancy", "compta"); diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 2db6311b172..2422cead7bb 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -74,7 +74,7 @@ class modAdherent extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array('modMailmanSpip'); // List of module class names as string this module is in conflict with $this->langfiles = array("members", "companies"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Constants $this->const = array(); diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index cac9047e56e..d9858a017e0 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -73,7 +73,7 @@ class modAgenda extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("companies"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Module parts $this->module_parts = array(); diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 6ad632c944e..48420a264d3 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -83,7 +83,7 @@ class modApi extends DolibarrModules $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array('modZapier'); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index a217cb8d72c..fbe6134c797 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -90,7 +90,7 @@ class modAsset extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("assets"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index 2e92d3baeaf..d39affa4d78 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -109,7 +109,7 @@ class modBom extends DolibarrModules $this->requiredby = array('modMrp'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - //$this->phpmin = array(5, 6)); // Minimum version of PHP required by module + //$this->phpmin = array(7, 0)); // Minimum version of PHP required by module $this->need_dolibarr_version = array(9, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 89081551ddc..8154c3f8902 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -162,17 +162,17 @@ class modContrat extends DolibarrModules $this->export_icon[$r] = 'contract'; $this->export_permission[$r] = array(array("contrat", "export")); $this->export_fields_array[$r] = array('s.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', - 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', + 's.email'=>'Email', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'co.rowid'=>"Id", 'co.ref'=>"Ref", 'co.datec'=>"DateCreation", 'co.date_contrat'=>"DateContract", - 'co.fin_validite'=>"ContractEndDate", 'co.date_cloture'=>"Closing", 'co.note_private'=>"NotePrivate", 'co.note_public'=>"NotePublic", + 'co.fin_validite'=>"ContractEndDate", 'co.date_cloture'=>"DateClosing", 'co.note_private'=>"NotePrivate", 'co.note_public'=>"NotePublic", 'cod.rowid'=>'LineId', 'cod.label'=>"LineLabel", 'cod.description'=>"LineDescription", 'cod.price_ht'=>"LineUnitPrice", 'cod.tva_tx'=>"LineVATRate", 'cod.qty'=>"LineQty", 'cod.total_ht'=>"LineTotalHT", 'cod.total_tva'=>"LineTotalVAT", 'cod.total_ttc'=>"LineTotalTTC", 'cod.date_ouverture'=>"DateStart", 'cod.date_ouverture_prevue'=>"DateStartPlanned", 'cod.date_fin_validite'=>"DateEndPlanned", 'cod.date_cloture'=>"DateEnd", 'p.rowid'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel'); $this->export_entities_array[$r] = array('s.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', - 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', + 's.town'=>'company', 'c.code'=>'company', 's.email'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', 'co.rowid'=>"contract", 'co.ref'=>"contract", 'co.datec'=>"contract", 'co.date_contrat'=>"contract", 'co.fin_validite'=>"contract", 'co.date_cloture'=>"contract", 'co.note_private'=>"contract", 'co.note_public'=>"contract", @@ -182,7 +182,7 @@ class modContrat extends DolibarrModules 'p.rowid'=>'product', 'p.ref'=>'product', 'p.label'=>'product'); $this->export_TypeFields_array[$r] = array('s.rowid'=>"Numeric", 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', - 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', + 's.email'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'co.ref'=>"Text", 'co.datec'=>"Date", 'co.date_contrat'=>"Date", 'co.fin_validite'=>"Date", 'co.date_cloture'=>"Date", 'co.note_private'=>"Text", 'co.note_public'=>"Text", diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 9145b689f51..2768e7d1d7a 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -107,7 +107,7 @@ class modDataPolicy extends DolibarrModules { $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("datapolicy"); $this->phpmin = array(5, 3); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module + $this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) //$this->automatic_activation = array('FR'=>'datapolicyWasAutomaticallyActivatedBecauseOfYourCountryChoice'); diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index 685158141e4..aeea231fd1e 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -91,7 +91,7 @@ class modDav extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("admin"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index ef823856a57..03c668910ce 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -91,7 +91,7 @@ class modEmailCollector extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("admin"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(7, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index c2c9309cd44..6708eb4192a 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -123,7 +123,7 @@ class modEventOrganization extends DolibarrModules $this->langfiles = array("eventorganization"); // Prerequisites - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(13, -3); // Minimum version of Dolibarr required by module // Messages at activation diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index 53708ece3dd..698a3f4a141 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -65,7 +65,7 @@ class modExpenseReport extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled // $this->conflictwith = array("modDeplacement"); // Deactivate for access on old information $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7); // Minimum version of Dolibarr required by module $this->langfiles = array("companies", "trips"); diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php index 278a70e6339..357e280f9f6 100644 --- a/htdocs/core/modules/modExport.class.php +++ b/htdocs/core/modules/modExport.class.php @@ -62,7 +62,7 @@ class modExport extends DolibarrModules // Dependencies $this->depends = array(); $this->requiredby = array(); - $this->phpmin = array(4, 2, 0); + $this->phpmin = array(7, 0); $this->phpmax = array(); // Constants diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php index d7710687ca6..e60c79e2deb 100644 --- a/htdocs/core/modules/modExternalRss.class.php +++ b/htdocs/core/modules/modExternalRss.class.php @@ -63,7 +63,7 @@ class modExternalRss extends DolibarrModules // Dependencies $this->depends = array(); $this->requiredby = array(); - $this->phpmin = array(4, 2, 0); + $this->phpmin = array(7, 0); $this->phpmax = array(); // Constants diff --git a/htdocs/core/modules/modGeoIPMaxmind.class.php b/htdocs/core/modules/modGeoIPMaxmind.class.php index 41c3d8517d8..092315f65f2 100644 --- a/htdocs/core/modules/modGeoIPMaxmind.class.php +++ b/htdocs/core/modules/modGeoIPMaxmind.class.php @@ -69,7 +69,7 @@ class modGeoIPMaxmind extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); + $this->phpmin = array(7, 0); $this->phpmax = array(); $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module $this->need_javascript_ajax = 1; diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 25163a766bd..b39d4921918 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -77,7 +77,7 @@ class modGravatar extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 7); // Minimum version of Dolibarr required by module $this->langfiles = array(); diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 7df3bcc6dcf..0da5663d452 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -105,7 +105,7 @@ class modHRM extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("hrm"); diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 429e511de48..61bdc0e8f98 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -87,7 +87,7 @@ class modHoliday extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("holiday"); diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index b70806af82a..ad0f33c8da2 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -64,7 +64,7 @@ class modImport extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module - Need auto_detect_line_endings php option to solve MAC pbs. + $this->phpmin = array(7, 0); // Minimum version of PHP required by module - Need auto_detect_line_endings php option to solve MAC pbs. $this->phpmax = array(); $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module $this->need_javascript_ajax = 1; diff --git a/htdocs/core/modules/modIncoterm.class.php b/htdocs/core/modules/modIncoterm.class.php index 110afe442c2..1a4717e9d44 100644 --- a/htdocs/core/modules/modIncoterm.class.php +++ b/htdocs/core/modules/modIncoterm.class.php @@ -68,7 +68,7 @@ class modIncoterm extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("incoterm"); diff --git a/htdocs/core/modules/modIntracommreport.class.php b/htdocs/core/modules/modIntracommreport.class.php index 4a9de11109a..4df6a50183e 100644 --- a/htdocs/core/modules/modIntracommreport.class.php +++ b/htdocs/core/modules/modIntracommreport.class.php @@ -65,7 +65,7 @@ class modIntracommreport extends DolibarrModules $this->depends = array("modFacture", "modTax", "modCategorie"); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(13, 0, -5); // Minimum version of Dolibarr required by module $this->langfiles = array("intracommreport"); diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index 0df2f20992f..634f36406a2 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -140,7 +140,7 @@ class modKnowledgeManagement extends DolibarrModules $this->langfiles = array("knowledgemanagement"); // Prerequisites - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module // Messages at activation diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 8c8756c60c7..dff42653c3c 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -61,7 +61,7 @@ class modLabel extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Config pages // $this->config_page_url = array("label.php"); diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php index 0774f71a583..2b02a1b58c1 100644 --- a/htdocs/core/modules/modLdap.class.php +++ b/htdocs/core/modules/modLdap.class.php @@ -67,7 +67,7 @@ class modLdap extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Constants $this->const = array( diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php index 8f9de88b83f..7f2850b075a 100644 --- a/htdocs/core/modules/modLoan.class.php +++ b/htdocs/core/modules/modLoan.class.php @@ -67,7 +67,7 @@ class modLoan extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("loan"); // Constants diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index 7e3d4b6aeb1..bb0a409ae36 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -66,7 +66,7 @@ class modMailing extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("mails"); // Config pages diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php index 2a8d97484e7..86061608d33 100644 --- a/htdocs/core/modules/modMailmanSpip.class.php +++ b/htdocs/core/modules/modMailmanSpip.class.php @@ -66,7 +66,7 @@ class modMailmanSpip extends DolibarrModules $this->depends = array('modAdherent'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Config pages $this->config_page_url = array('mailman.php'); diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index cb7b4d5e602..55f2a5ed927 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -72,7 +72,7 @@ class modMargin extends DolibarrModules $this->depends = array("modPropale", "modProduct"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 2); // Minimum version of Dolibarr required by module $this->langfiles = array("margins"); diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 1fd806bdc56..f93ce224662 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -122,7 +122,7 @@ class modMrp extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(8, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 28f2f7cdd16..54297d5e77c 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -88,7 +88,7 @@ class modMultiCurrency extends DolibarrModules $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("multicurrency"); diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index 072e0607b60..63086fd9112 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -63,7 +63,7 @@ class modNotification extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("mails"); // Config pages diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index f66ba404c7e..d93a715f1e7 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -71,7 +71,7 @@ class modOauth extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("oauth"); diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 04a8cd54082..26a49337888 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -76,7 +76,7 @@ class modOpenSurvey extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 4, 0); // Minimum version of Dolibarr required by module // Constants diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index 7ba10ca4536..ccd67542830 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -147,7 +147,7 @@ class modPartnership extends DolibarrModules $this->langfiles = array("partnership"); // Prerequisites - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module // Messages at activation diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index 24af8a3c953..cf6ef512873 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -73,7 +73,7 @@ class modPayBox extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 6); // Minimum version of Dolibarr required by module $this->langfiles = array("paybox"); diff --git a/htdocs/core/modules/modPaymentByBankTransfer.class.php b/htdocs/core/modules/modPaymentByBankTransfer.class.php index 6b51e25cdc2..27c43a9b3da 100644 --- a/htdocs/core/modules/modPaymentByBankTransfer.class.php +++ b/htdocs/core/modules/modPaymentByBankTransfer.class.php @@ -68,7 +68,7 @@ class modPaymentByBankTransfer extends DolibarrModules $this->depends = array("modFournisseur", "modBanque"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("paymentbybanktransfer.php"); diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index a1e979715fe..02caa6c3388 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -74,7 +74,7 @@ class modPaypal extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array('modPaypalPlus'); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("paypal"); diff --git a/htdocs/core/modules/modPrelevement.class.php b/htdocs/core/modules/modPrelevement.class.php index a42d3c8b5a0..dd6ccd484fa 100644 --- a/htdocs/core/modules/modPrelevement.class.php +++ b/htdocs/core/modules/modPrelevement.class.php @@ -67,7 +67,7 @@ class modPrelevement extends DolibarrModules $this->depends = array("modFacture", "modBanque"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("prelevement.php"); diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index c9e99b3d933..6638d16e201 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -69,7 +69,7 @@ class modPrinting extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 7, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("printing"); diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 09b0a4818f5..1ca960860d3 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -70,7 +70,7 @@ class modProduct extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modStock", "modBarcode", "modProductBatch", "modVariants"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("product.php@product"); diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 4b508d79d7c..6bebb7af25d 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -72,7 +72,7 @@ class modProductBatch extends DolibarrModules $this->depends = array("modProduct", "modStock", "modExpedition", "modFournisseur"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("productbatch"); diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 5f1ad7d2099..89e57be51bb 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -68,7 +68,7 @@ class modProjet extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array('modEventOrganization'); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array('projects'); // Constants diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 524aa0086ea..68900bfa993 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -68,7 +68,7 @@ class modPropale extends DolibarrModules $this->depends = array("modSociete"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->config_page_url = array("propal.php"); $this->langfiles = array("propal", "bills", "companies", "deliveries", "products"); diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index 1e26de93bcb..4741bc48197 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -71,7 +71,7 @@ class modReceiptPrinter extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 9, -2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("receiptprinter"); diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index ed67430bce5..f1fe6f2072c 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -122,7 +122,7 @@ class modRecruitment extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("recruitment"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 1d1d37ac240..ab73c8828b4 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -95,7 +95,7 @@ class modResource extends DolibarrModules // List of modules id to disable if this one is disabled $this->requiredby = array('modPlace'); // Minimum version of PHP required by module - $this->phpmin = array(5, 6); + $this->phpmin = array(7, 0); $this->langfiles = array("resource"); // langfiles@resource // Constants diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 3464a5e14b3..bfb99e34de4 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -75,7 +75,7 @@ class modSalaries extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("salaries", "bills"); // Constants diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 86b167d154c..868303c231b 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -68,7 +68,7 @@ class modService extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Config pages $this->config_page_url = array("product.php@product"); diff --git a/htdocs/core/modules/modSocialNetworks.class.php b/htdocs/core/modules/modSocialNetworks.class.php index 3949de6c691..e2b110a383a 100644 --- a/htdocs/core/modules/modSocialNetworks.class.php +++ b/htdocs/core/modules/modSocialNetworks.class.php @@ -69,7 +69,7 @@ class modSocialNetworks extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array(); // Constants diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index f5d26ed03ae..b5dc6e71ab8 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -71,7 +71,7 @@ class modSociete extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modExpedition", "modFacture", "modFournisseur", "modFicheinter", "modPropale", "modContrat", "modCommande"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("companies", 'bills', "compta", "admin", "banks"); // Constants diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 87ea6303742..e99742a14c4 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -69,7 +69,7 @@ class modStock extends DolibarrModules $this->depends = array("modProduct"); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array("modProductBatch"); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("stocks"); // Constants diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php index 4f99039f8f7..a90b28be5aa 100644 --- a/htdocs/core/modules/modStockTransfer.class.php +++ b/htdocs/core/modules/modStockTransfer.class.php @@ -124,7 +124,7 @@ class modStockTransfer extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("stocktransfer@stocktransfer"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 2677d3e3fa3..4c5d3deea44 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -72,7 +72,7 @@ class modStripe extends DolibarrModules $this->hidden = false; // A condition to hide module $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(5, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("stripe"); diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 36df0dd27bd..c775744c6e7 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -70,7 +70,7 @@ class modSupplierProposal extends DolibarrModules $this->depends = array('modFournisseur'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("supplier_proposal"); // Constants diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 1d85dc2115d..0fa0da9dcdb 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -71,7 +71,7 @@ class modSyslog extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Constants $this->const = array(); diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index e0ee972e7ca..8096629c9a4 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -102,7 +102,7 @@ class modTakePos extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("cashdesk"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module $this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text') $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index 222b1c775c1..3f3b5730564 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -71,7 +71,7 @@ class modTax extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("compta", "bills"); // Constants diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 22e2bed3ee9..f0de03c311a 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -97,7 +97,7 @@ class modTicket extends DolibarrModules $this->depends = array('modAgenda'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("ticket"); // Constants diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index dc0da3e0ac3..6b14d797f15 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -68,7 +68,7 @@ class modUser extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("main", "users", "companies", "members", "salaries", "hrm"); $this->always_enabled = true; // Can't be disabled diff --git a/htdocs/core/modules/modVariants.class.php b/htdocs/core/modules/modVariants.class.php index 8c330044cb0..9dda6194b32 100644 --- a/htdocs/core/modules/modVariants.class.php +++ b/htdocs/core/modules/modVariants.class.php @@ -83,7 +83,7 @@ class modVariants extends DolibarrModules $this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3, 0); // Minimum version of Dolibarr required by module $this->langfiles = array("products"); diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php index a88db3dee26..6f2e8e21c3e 100644 --- a/htdocs/core/modules/modWebServices.class.php +++ b/htdocs/core/modules/modWebServices.class.php @@ -63,7 +63,7 @@ class modWebServices extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php index f2b75119523..8acd5647c76 100644 --- a/htdocs/core/modules/modWebServicesClient.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -63,7 +63,7 @@ class modWebServicesClient extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index ef4bced304d..b1aaea23929 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -139,7 +139,7 @@ class modWebhook extends DolibarrModules $this->langfiles = array(); // Prerequisites - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module // Messages at activation diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index 6e0dc80e41c..bf229791ff3 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -68,7 +68,7 @@ class modWebsite extends DolibarrModules $this->depends = array('modFckeditor'); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->langfiles = array("website"); // Constants diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index 248d3c006ce..cc7e478e379 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -72,7 +72,7 @@ class modWorkflow extends DolibarrModules $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2, 8); // Minimum version of Dolibarr required by module $this->langfiles = array("@workflow"); diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index da1aca4f770..51094439df0 100644 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -124,7 +124,7 @@ class modWorkstation extends DolibarrModules $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("mrp"); - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php index b0a1daf642e..6d05aa7b283 100644 --- a/htdocs/core/modules/modZapier.class.php +++ b/htdocs/core/modules/modZapier.class.php @@ -125,7 +125,7 @@ class modZapier extends DolibarrModules $this->conflictwith = array(); $this->langfiles = array("zapier"); // Minimum version of PHP required by module - //$this->phpmin = array(5, 6); + //$this->phpmin = array(7, 0); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(10, 0); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index eb57e7c5453..596a29c1e2d 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -64,9 +64,9 @@ class pdf_standard extends ModelePDFMovement /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 1c08dd7228d..42b3c529fe4 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_mo_odt extends ModelePDFMo /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 1a61a588ae3..20fd7b0472b 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -69,9 +69,9 @@ class pdf_vinci extends ModelePDFMo /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index c4167847986..94d511367e2 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -45,9 +45,9 @@ class doc_generic_product_odt extends ModelePDFProduct /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 92cf586f848..df1122a5748 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -58,9 +58,9 @@ class pdf_standard extends ModelePDFProduct /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 8a8a4e373b7..0bfdbb0988d 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -82,9 +82,9 @@ class doc_generic_project_odt extends ModelePDFProjects /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 3bae695f511..876249ba228 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -65,9 +65,9 @@ class pdf_baleine extends ModelePDFProjects /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index c3ce64e3df7..c3e673abf25 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -81,9 +81,9 @@ class pdf_beluga extends ModelePDFProjects /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 02f3f0c8cfb..02f728b5208 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -64,9 +64,9 @@ class pdf_timespent extends ModelePDFProjects /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 73d1d4e3d12..ba386eedfe7 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -83,9 +83,9 @@ class doc_generic_task_odt extends ModelePDFTask /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index dfcc9273505..6715b2e39a5 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -46,9 +46,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 8f16c1e527e..67d52d88d77 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -70,9 +70,9 @@ class pdf_azur extends ModelePDFPropales /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 59ac5a2ee7e..148282e5258 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -68,9 +68,9 @@ class pdf_cyan extends ModelePDFPropales /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 18afd4fd054..4d8edca7f64 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -43,9 +43,9 @@ class doc_generic_reception_odt extends ModelePdfReception /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 4a63e9c91f6..d6804c3a397 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -44,9 +44,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index c5a6ae75389..0f5adc3fc7d 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -45,9 +45,9 @@ class doc_generic_stock_odt extends ModelePDFStock /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 6231fb492b0..c61fb5a5ff3 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -60,9 +60,9 @@ class pdf_standard extends ModelePDFStock /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 2971741f078..d658ee77069 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -63,7 +63,7 @@ class pdf_eagle extends ModelePdfStockTransfer * @var array Minimum version of PHP required by module. * e.g.: PHP ≥ 5.5 = array(5, 5) */ - public $phpmin = array(5, 5); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document 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 493dd0f2f6f..8be1b5e0d9c 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -72,7 +72,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes * @var array Minimum version of PHP required by module. * e.g.: PHP ≥ 5.5 = array(5, 5) */ - public $phpmin = array(5, 5); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 23d7407fb4b..90483351212 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -65,9 +65,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 4e577795ceb..f3177233589 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -49,9 +49,9 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document 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 24e295afa01..c109ab89287 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -68,9 +68,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document 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 e4ea143d39d..62d1dd62998 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -68,9 +68,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index a6a272d6274..8b131c4e0f2 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -66,9 +66,9 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index b8148a35c5d..fc75445123a 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -46,9 +46,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document 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 b1129bbb1ed..041a10c2f6d 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -65,9 +65,9 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index 706977f72e6..ff6359be5ce 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -43,9 +43,9 @@ class doc_generic_ticket_odt extends ModelePDFTicket /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 505d68f0441..d129c80f126 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -43,9 +43,9 @@ class doc_generic_user_odt extends ModelePDFUser /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index df3804670ad..4bbb39c0086 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -46,9 +46,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 42ead1573f4..9b7e3cd4df1 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -64,15 +64,23 @@ foreach ($object->fields as $key => $val) { print ' tdtop'; } print '">'; + + $labeltoshow = ''; if (!empty($val['help'])) { - print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); + $labeltoshow .= $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); } else { if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 1) { - print showValueWithClipboardCPButton($value, 0, $langs->transnoentitiesnoconv($val['label'])); + $labeltoshow .= showValueWithClipboardCPButton($value, 0, $langs->transnoentitiesnoconv($val['label'])); } else { - print $langs->trans($val['label']); + $labeltoshow .= $langs->trans($val['label']); } } + if (empty($val['alwayseditable'])) { + print $labeltoshow; + } else { + print $form->editfieldkey($labeltoshow, $key, $value, $object, 1, $val['type']); + } + print ''; print ''; - if (in_array($val['type'], array('text', 'html'))) { - print '
'; - } - if ($key == 'lang') { - $langs->load("languages"); - $labellang = ($value ? $langs->trans('Language_'.$value) : ''); - print picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"'); - print $labellang; - } else { - if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 2) { - $out = $object->showOutputField($val, $key, $value, '', '', '', 0); - print showValueWithClipboardCPButton($out, 0, $out); - } else { - print $object->showOutputField($val, $key, $value, '', '', '', 0); + if (empty($val['alwayseditable'])) { + if (in_array($val['type'], array('text', 'html'))) { + print '
'; } - } - //print dol_escape_htmltag($object->$key, 1, 1); - if (in_array($val['type'], array('text', 'html'))) { - print '
'; + if ($key == 'lang') { + $langs->load("languages"); + $labellang = ($value ? $langs->trans('Language_'.$value) : ''); + print picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"'); + print $labellang; + } else { + if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 2) { + $out = $object->showOutputField($val, $key, $value, '', '', '', 0); + print showValueWithClipboardCPButton($out, 0, $out); + } else { + print $object->showOutputField($val, $key, $value, '', '', '', 0); + } + } + //print dol_escape_htmltag($object->$key, 1, 1); + if (in_array($val['type'], array('text', 'html'))) { + print '
'; + } + } else { + print $form->editfieldval($labeltoshow, $key, $value, $object, 1, $val['type']); } print ''; print ''; @@ -144,10 +156,20 @@ foreach ($object->fields as $key => $val) { $rightpart .= ' tdtop'; } $rightpart.= '">'; + $labeltoshow = ''; if (!empty($val['help'])) { - $rightpart .= $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); + $labeltoshow .= $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help'])); } else { - $rightpart .= $langs->trans($val['label']); + if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 1) { + $labeltoshow .= showValueWithClipboardCPButton($value, 0, $langs->transnoentitiesnoconv($val['label'])); + } else { + $labeltoshow .= $langs->trans($val['label']); + } + } + if (empty($val['alwayseditable'])) { + $rightpart .= $labeltoshow; + } else { + $rightpart .= $form->editfieldkey($labeltoshow, $key, $value, $object, 1, $val['type']); } $rightpart .= ''; $rightpart .= ''; - if (in_array($val['type'], array('text', 'html'))) { - $rightpart .= '
'; - } - $rightpart .= $object->showOutputField($val, $key, $value, '', '', '', 0); - //$rightpart .= dol_escape_htmltag($object->$key, 1, 1); - if (in_array($val['type'], array('text', 'html'))) { - $rightpart .= '
'; + + if (empty($val['alwayseditable'])) { + if (in_array($val['type'], array('text', 'html'))) { + $rightpart .= '
'; + } + if ($key == 'lang') { + $langs->load("languages"); + $labellang = ($value ? $langs->trans('Language_'.$value) : ''); + $rightpart .= picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"'); + $rightpart .= $labellang; + } else { + if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 2) { + $out = $object->showOutputField($val, $key, $value, '', '', '', 0); + $rightpart .= showValueWithClipboardCPButton($out, 0, $out); + } else { + $rightpart.= $object->showOutputField($val, $key, $value, '', '', '', 0); + } + } + if (in_array($val['type'], array('text', 'html'))) { + $rightpart .= '
'; + } + } else { + $rightpart .= $form->editfieldval($labeltoshow, $key, $value, $object, 1, $val['type']); } + $rightpart .= ''; $rightpart .= ''; } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 7c18073907e..a0a795e9c8b 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -494,7 +494,9 @@ if ($action == 'create') { print ''; print ''.$langs->trans('NotePublic').''; print ''; - + if (!isset($note_public)) { + $note_public = $object->getDefaultCreateValueFor('note_public'); + } $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print ''; @@ -504,7 +506,9 @@ if ($action == 'create') { print ''; print ''.$langs->trans('NotePrivate').''; print ''; - + if (!isset($note_private)) { + $note_private = $object->getDefaultCreateValueFor('note_private'); + } $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print ''; @@ -672,6 +676,7 @@ if (!empty($id) && $action == 'edit') { /* */ /* ************************************************************ */ if (!empty($id) && $action != 'edit') { + $formconfirm = ""; // Confirmation delete if ($action == 'delete') { $text = $langs->trans("ConfirmDeleteADonation"); @@ -802,7 +807,7 @@ if (!empty($id) && $action != 'edit') { $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $i = 0; $total = 0; + $i = 0; $total = 0; $totalpaid = 0; print ''; print ''; print ''; @@ -832,7 +837,7 @@ if (!empty($id) && $action != 'edit') { $remaintopay = $object->amount - $totalpaid; print ""; - print '\n"; + print '\n"; } print "
'.$langs->trans("RefPayment").'
".$langs->trans("RemainderToPay")." :'.price($remaintopay)."
'.price($remaintopay)."
"; $db->free($resql); diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 080ac3b9540..b52e0974b9a 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -406,9 +406,9 @@ class Don extends CommonObject $sql .= ", ".((int) $user->id); $sql .= ", null"; $sql .= ", '".$this->db->idate($this->date)."'"; - $sql .= ", '".$this->db->escape(trim($this->email))."'"; - $sql .= ", '".$this->db->escape(trim($this->phone))."'"; - $sql .= ", '".$this->db->escape(trim($this->phone_mobile))."'"; + $sql .= ", '".(!empty($this->email) ? $this->db->escape(trim($this->email)) : "")."'"; + $sql .= ", '".(!empty($this->phone) ? $this->db->escape(trim($this->phone)) : "")."'"; + $sql .= ", '".(!empty($this->phone_mobile) ? $this->db->escape(trim($this->phone_mobile)) : "")."'"; $sql .= ")"; $resql = $this->db->query($sql); @@ -989,7 +989,7 @@ class Don extends CommonObject $this->user_creation_id = $obj->fk_user_author; $this->user_validation_id = $obj->fk_user_valid; $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->tms); + $this->date_modification = (!empty($obj->tms) ? $this->db->jdate($obj->tms) : ""); } $this->db->free($result); } else { diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 219a5116658..b6b7e6a24d3 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -78,7 +78,7 @@ if (!$sortfield) { $object = new Don($db); $object->fetch($id, $ref); -$upload_dir = $conf->don->dir_output.'/'.get_exdir($filename, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref); +$upload_dir = $conf->don->dir_output.'/'.get_exdir($id, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref); $modulepart = 'don'; $permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 1ab7220d894..c3cb4d9ce58 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -41,6 +41,7 @@ $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'); +$type = GETPOST('type', 'aZ'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -61,7 +62,7 @@ $search_company = GETPOST('search_company', 'alpha'); $search_name = GETPOST('search_name', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); - +$moreforfilter = GETPOST('moreforfilter', 'alpha'); if (!$user->rights->don->lire) { accessforbidden(); } @@ -198,7 +199,7 @@ if ($resql) { } print '
'; - print ''."\n"; + print '
'."\n"; // Filters lines print ''; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index c325aae4854..bb4f41861ec 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -155,6 +155,9 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o /* * Actions */ +$value_unit_ht = price2num(GETPOST('value_unit_ht', 'alpha'), 'MU'); +$value_unit = price2num(GETPOST('value_unit', 'alpha'), 'MU'); +$qty = price2num(GETPOST('qty', 'alpha')); $parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -2370,14 +2373,14 @@ if ($action == 'create') { print ''; // VAT - $selectedvat = price2num($line->vatrate).($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''); + $selectedvat = price2num($line->vatrate).(!empty($line->vat_src_code) ? ' ('.$line->vat_src_code.')' : ''); print ''; // Unit price print ''; // Unit price with tax @@ -2521,19 +2524,19 @@ if ($action == 'create') { // Select date print ''; // Select project if (isModEnabled('project')) { print ''; } // Select type print ''; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { @@ -2545,7 +2548,7 @@ if ($action == 'create') { // Add comments print ''; // Select VAT @@ -2554,22 +2557,22 @@ if ($action == 'create') { if (!empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) { $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; } - print $form->load_tva('vatrate', ($vatrate != '' ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1); + print $form->load_tva('vatrate', (!empty($vatrate) ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1); print ''; // Unit price net print ''; // Unit price with tax print ''; // Quantity print ''; // Picture diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index e0799a46f73..a1afcef74a2 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -771,6 +771,7 @@ class ExpenseReport extends CommonObject $sql .= " f.date_valid as datev,"; $sql .= " f.date_approve as datea,"; $sql .= " f.fk_user_creat as fk_user_creation,"; + $sql .= " f.fk_user_author as fk_user_author,"; $sql .= " f.fk_user_modif as fk_user_modification,"; $sql .= " f.fk_user_valid,"; $sql .= " f.fk_user_approve"; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 38a9f051288..770276e96b8 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -836,7 +836,7 @@ class CommandeFournisseur extends CommonOrder $label = ''; - if ($user->rights->fournisseur->commande->lire) { + if ($user->hasRight("fournisseur", "commande", "read")) { $label = ''.$langs->trans("SupplierOrder").''; if (isset($this->statut)) { $label .= ' '.$this->getLibStatut(5); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 3db5ef13ef5..15e1ea41c2b 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1857,7 +1857,7 @@ if ($step == 5 && $datatoimport) { //dol_syslog("line ".$sourcelinenb.' - '.$nboflines.' - '.$excludefirstline.' - '.$endatlinenb); $arrayrecord = $obj->import_read_record(); if ($arrayrecord === false) { - $arrayofwarnings[$sourcelinenb][0] = array('lib'=>'File has '.$nboflines.' lines. However we reach end of file after record '.$sourcelinenb.'. This may occurs when some records are split onto several lines. Ensure the complete string is delimited correctly when there is a separator character in the text string.', 'type'=>'EOF_RECORD_ON_SEVERAL_LINES'); + $arrayofwarnings[$sourcelinenb][0] = array('lib'=>'File has '.$nboflines.' lines. However we reach the end of file or an empty line at record '.$sourcelinenb.'. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.', 'type'=>'EOF_RECORD_ON_SEVERAL_LINES'); $endoffile++; continue; } @@ -1910,8 +1910,8 @@ if ($step == 5 && $datatoimport) { print '
'; print '
'; print '
'.$langs->trans("ResultOfSimulationNoError").'
'; - print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'
'; - print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'
'; + print $langs->trans("NbInsertSim", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'
'; + print $langs->trans("NbUpdateSim", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'
'; print '
'; print '
'; } else { @@ -2242,7 +2242,7 @@ if ($step == 6 && $datatoimport) { $sourcelinenb++; $arrayrecord = $obj->import_read_record(); if ($arrayrecord === false) { - $arrayofwarnings[$sourcelinenb][0] = array('lib'=>'File has '.$nboflines.' lines. However we reach end of file after record '.$sourcelinenb.'. This may occurs when some records are split onto several lines.', 'type'=>'EOF_RECORD_ON_SEVERAL_LINES'); + $arrayofwarnings[$sourcelinenb][0] = array('lib'=>'File has '.$nboflines.' lines. However we reach the end of file or an empty line at record '.$sourcelinenb.'. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.', 'type'=>'EOF_RECORD_ON_SEVERAL_LINES'); $endoffile++; continue; } diff --git a/htdocs/install/doctemplates/websites/website_template-style02.zip b/htdocs/install/doctemplates/websites/website_template-style02.zip new file mode 100644 index 00000000000..4a5a0a7eacb Binary files /dev/null and b/htdocs/install/doctemplates/websites/website_template-style02.zip differ diff --git a/htdocs/install/doctemplates/websites/website_template-style03.zip b/htdocs/install/doctemplates/websites/website_template-style03.zip index f2a7684cc4e..18266bd18d9 100644 Binary files a/htdocs/install/doctemplates/websites/website_template-style03.zip and b/htdocs/install/doctemplates/websites/website_template-style03.zip differ diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 84cd1b5665c..874dcb66f1b 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -178,3 +178,8 @@ ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid); INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144); + +ALTER TABLE llx_socpeople ADD INDEX idx_socpeople_lastname (lastname); + +ALTER TABLE llx_societe ADD INDEX idx_societe_nom(nom); + diff --git a/htdocs/install/mysql/tables/llx_societe.key.sql b/htdocs/install/mysql/tables/llx_societe.key.sql index 3a2c9540229..58701e4a7f9 100644 --- a/htdocs/install/mysql/tables/llx_societe.key.sql +++ b/htdocs/install/mysql/tables/llx_societe.key.sql @@ -23,6 +23,8 @@ ALTER TABLE llx_societe ADD UNIQUE INDEX uk_societe_code_fournisseur(code_fourni ALTER TABLE llx_societe ADD UNIQUE INDEX uk_societe_barcode (barcode, fk_barcode_type, entity); +ALTER TABLE llx_societe ADD INDEX idx_societe_nom(nom); + ALTER TABLE llx_societe ADD INDEX idx_societe_user_creat(fk_user_creat); ALTER TABLE llx_societe ADD INDEX idx_societe_user_modif(fk_user_modif); diff --git a/htdocs/install/mysql/tables/llx_socpeople.key.sql b/htdocs/install/mysql/tables/llx_socpeople.key.sql index 4d2a453e0fa..36e2b7b7d1c 100644 --- a/htdocs/install/mysql/tables/llx_socpeople.key.sql +++ b/htdocs/install/mysql/tables/llx_socpeople.key.sql @@ -20,5 +20,7 @@ ALTER TABLE llx_socpeople ADD INDEX idx_socpeople_fk_soc (fk_soc); ALTER TABLE llx_socpeople ADD INDEX idx_socpeople_fk_user_creat (fk_user_creat); +ALTER TABLE llx_socpeople ADD INDEX idx_socpeople_lastname (lastname); + ALTER TABLE llx_socpeople ADD CONSTRAINT fk_socpeople_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); ALTER TABLE llx_socpeople ADD CONSTRAINT fk_socpeople_user_creat_user_rowid FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index daa0d7b148d..d9fc25fa1fe 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -246,9 +246,6 @@ $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } -if (!empty($searchCategoryKnowledgemanagementList) || !empty($catid)) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_knowledgemanagement as ck ON t.rowid = ck.fk_knowledgemanagement"; // We'll need this table joined to the select in order to filter by categ -} // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook @@ -287,29 +284,29 @@ foreach ($search as $key => $val) { } } } -//Search for tag/category -$searchCategoryKnowledgemanagementSqlList = array(); -if ($searchCategoryKnowledgemanagementOperator == 1) { + +// Search for tag/category ($searchCategoryKnowledgemanagementList is an array of ID) +if (!empty($searchCategoryKnowledgemanagementList)) { + $searchCategoryKnowledgemanagementSqlList = array(); + $listofcategoryid = ''; foreach ($searchCategoryKnowledgemanagementList as $searchCategoryKnowledgemanagement) { if (intval($searchCategoryKnowledgemanagement) == -2) { - $searchCategoryKnowledgemanagementSqlList[] = "ck.fk_categorie IS NULL"; + $searchCategoryKnowledgemanagementSqlList[] = "NOT EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement)"; } elseif (intval($searchCategoryKnowledgemanagement) > 0) { - $searchCategoryKnowledgemanagementSqlList[] = "ck.fk_categorie = ".$db->escape($searchCategoryKnowledgemanagement); + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement); } } - if (!empty($searchCategoryKnowledgemanagementSqlList)) { - $sql .= " AND (".implode(' OR ', $searchCategoryKnowledgemanagementSqlList).")"; + if ($listofcategoryid) { + $searchCategoryKnowledgemanagementSqlList[] = " EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; } -} else { - foreach ($searchCategoryKnowledgemanagementList as $searchCategoryKnowledgemanagement) { - if (intval($searchCategoryKnowledgemanagement) == -2) { - $searchCategoryKnowledgemanagementSqlList[] = "ck.fk_categorie IS NULL"; - } elseif (intval($searchCategoryKnowledgemanagement) > 0) { - $searchCategoryKnowledgemanagementSqlList[] = "t.rowid IN (SELECT fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement WHERE fk_categorie = ".((int) $searchCategoryKnowledgemanagement).")"; + if ($searchCategoryKnowledgemanagementOperator == 1) { + if (!empty($searchCategoryKnowledgemanagementSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryKnowledgemanagementSqlList).")"; + } + } else { + if (!empty($searchCategoryKnowledgemanagementSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryKnowledgemanagementSqlList).")"; } - } - if (!empty($searchCategoryKnowledgemanagementSqlList)) { - $sql .= " AND (".implode(' AND ', $searchCategoryKnowledgemanagementSqlList).")"; } } diff --git a/htdocs/langs/HOWTO-Translation.txt b/htdocs/langs/HOWTO-Translation.txt index 0a05133fdb8..7e7d3c68af1 100644 --- a/htdocs/langs/HOWTO-Translation.txt +++ b/htdocs/langs/HOWTO-Translation.txt @@ -3,7 +3,8 @@ An instruction guide for translating Dolibarr in a new language is available on Dolibarr wiki: -English: https://wiki.dolibarr.org/index.php/Translator_documentation -French: https://wiki.dolibarr.org/index.php/Documentation_traducteur -Spanish: https://wiki.dolibarr.org/index.php/Documentaci%C3%B3n_traductores -German: https://wiki.dolibarr.org/index.php/Dokumentation_Uebersetzung +English: https://wiki.dolibarr.org/index.php/Translator_documentation +French: https://wiki.dolibarr.org/index.php/Documentation_traducteur +Spanish: https://wiki.dolibarr.org/index.php/Documentaci%C3%B3n_traductores +German: https://wiki.dolibarr.org/index.php/Dokumentation_Uebersetzung +Chinese: https://wiki.dolibarr.org/index.php/%E7%BF%BB%E8%AF%91%E6%96%87%E6%A1%A3 diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index e53220e661d..d0e32e480d9 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -294,6 +294,7 @@ ErrorFailedToLoadThirdParty=Failed to find/load thirdparty from id=%s, email=%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. ErrorCharPlusNotSupportedByImapForSearch=IMAP search is not able to search into sender or recipient for a string containing the character + +ErrorTableNotFound=Table %s not found # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index c4c629c9a87..668b5dd7c9d 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -134,7 +134,9 @@ FormatControlRule=Format control rule ## imports updates KeysToUseForUpdates=Key (column) to use for updating existing data NbInsert=Number of inserted lines: %s +NbInsertSim=Number of lines that will be inserted: %s NbUpdate=Number of updated lines: %s +NbUpdateSim=Number of lines that will be updated : %s MultipleRecordFoundWithTheseFilters=Multiple records have been found with these filters: %s StocksWithBatch=Stocks and location (warehouse) of products with batch/serial number WarningFirstImportedLine=The first line(s) will not be imported with the current selection diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index c7ca26ee149..0e11bef2bf1 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -133,11 +133,11 @@ UseSpecificEditorURL = Use a specific editor URL UseSpecificFamily = Use a specific family UseSpecificAuthor = Use a specific author UseSpecificVersion = Use a specific initial version -IncludeRefGeneration=The reference of object must be generated automatically by custom numbering rules +IncludeRefGeneration=The reference of this object must be generated automatically by custom numbering rules IncludeRefGenerationHelp=Check this if you want to include code to manage the generation of the reference automatically using custom numbering rules -IncludeDocGeneration=I want to generate some documents from templates for the object +IncludeDocGeneration=I want the feature to generate some documents (PDF, ODT) from templates for this object IncludeDocGenerationHelp=If you check this, some code will be generated to add a "Generate document" box on the record. -ShowOnCombobox=Show value into combobox +ShowOnCombobox=Show value into combo boxes KeyForTooltip=Key for tooltip CSSClass=CSS for edit/create form CSSViewClass=CSS for read form @@ -156,4 +156,7 @@ LinkToParentMenu=Parent menu (fk_xxxxmenu) ListOfTabsEntries=List of tab entries TabsDefDesc=Define here the tabs provided by your module TabsDefDescTooltip=The tabs provided by your module/application are defined into the array $this->tabs into the module descriptor file. You can edit manually this file or use the embedded editor. -BadValueForType=Bad value for type %s \ No newline at end of file +BadValueForType=Bad value for type %s +DefinePropertiesFromExistingTable=Define properties from an existing table +DefinePropertiesFromExistingTableDesc=If a table in the database (for the object to create) already exists, you can use it to define the properties of the object. +DefinePropertiesFromExistingTableDesc2=Keep empty if the table does not exist yet. The code generator will use different kinds of fields to build an example of table that you can edit later. diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index 9210ede360c..9f51df0bf56 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -38,39 +38,6 @@ TripSociete=Information company TripNDF=Informations expense report PDFStandardExpenseReports=Standard template to generate a PDF document for expense report ExpenseReportLine=Expense report line -TF_OTHER=Other -TF_TRIP=Transportation -TF_LUNCH=Lunch -TF_METRO=Metro -TF_TRAIN=Train -TF_BUS=Bus -TF_CAR=Car -TF_PEAGE=Toll -TF_ESSENCE=Fuel -TF_HOTEL=Hotel -TF_TAXI=Taxi -EX_KME=Mileage costs -EX_FUE=Fuel CV -EX_HOT=Hotel -EX_PAR=Parking CV -EX_TOL=Toll CV -EX_TAX=Various Taxes -EX_IND=Indemnity transportation subscription -EX_SUM=Maintenance supply -EX_SUO=Office supplies -EX_CAR=Car rental -EX_DOC=Documentation -EX_CUR=Customers receiving -EX_OTR=Other receiving -EX_POS=Postage -EX_CAM=CV maintenance and repair -EX_EMM=Employees meal -EX_GUM=Guests meal -EX_BRE=Breakfast -EX_FUE_VP=Fuel PV -EX_TOL_VP=Toll PV -EX_PAR_VP=Parking PV -EX_CAM_VP=PV maintenance and repair DefaultCategoryCar=Default transportation mode DefaultRangeNumber=Default range number UploadANewFileNow=Upload a new document now @@ -148,3 +115,38 @@ CarCategory=Vehicle category ExpenseRangeOffset=Offset amount: %s RangeIk=Mileage range AttachTheNewLineToTheDocument=Attach the line to an uploaded document + +## Dictionary +EX_BRE=Breakfast +EX_CAM=CV maintenance and repair +EX_CAM_VP=PV maintenance and repair +EX_CAR=Car rental +EX_CUR=Customers receiving +EX_DOC=Documentation +EX_EMM=Employees meal +EX_FUE=Fuel CV +EX_FUE_VP=Fuel PV +EX_GUM=Guests meal +EX_HOT=Hotel +EX_IND=Indemnity transportation subscription +EX_KME=Mileage costs +EX_OTR=Other receiving +EX_PAR=Parking CV +EX_PAR_VP=Parking PV +EX_POS=Postage +EX_SUM=Maintenance supply +EX_SUO=Office supplies +EX_TAX=Various Taxes +EX_TOL=Toll CV +EX_TOL_VP=Toll PV +TF_BUS=Bus +TF_CAR=Car +TF_ESSENCE=Fuel +TF_HOTEL=Hotel +TF_LUNCH=Lunch +TF_METRO=Metro +TF_OTHER=Other +TF_PEAGE=Toll +TF_TAXI=Taxi +TF_TRAIN=Train +TF_TRIP=Transportation diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6865e4b8bf4..6f010215df3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -850,7 +850,7 @@ if (!defined('NOLOGIN')) { // End test login / passwords if (!$login || (in_array('ldap', $authmode) && empty($passwordtotest))) { // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success. // No data to test login, so we show the login page. - dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." - action=".GETPOST('action', 'aZ09')." - actionlogin=".GETPOST('actionlogin', 'aZ09')." - showing the login form and exit", LOG_INFO); + dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." - action=".GETPOST('action', 'aZ09')." - actionlogin=".GETPOST('actionlogin', 'aZ09')." - showing the login form and exit", LOG_NOTICE); if (defined('NOREDIRECTBYMAINTOLOGIN')) { // When used with NOREDIRECTBYMAINTOLOGIN set, the http header must already be set when including the main. // See example with selectsearchbox.php. This case is reserverd for the selectesearchbox.php so we can diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 2a4b1072e87..107189e5181 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -74,7 +74,9 @@ if (empty($user->rights->margins->liretous)) { $invoicestatic = new Facture($db); $form = new Form($db); - +$totalMargin = 0; +$marginRate = 0; +$markRate = 0; if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); @@ -136,7 +138,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->facture->lire) { + if ($user->hasRight("facture", "read")) { $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client,"; $sql .= " f.rowid as facid, f.ref, f.total_ht,"; $sql .= " f.datef, f.paye, f.fk_statut as statut, f.type,"; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 8441dd530ee..1c30d709576 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -202,10 +202,10 @@ foreach ($dirsrootforscan as $dirread) { } $textforlistofdirs .= ''.$dirread.''; if ($dirread == DOL_DOCUMENT_ROOT) { - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $textforlistofdirs .= $form->textwithpicto('', $langs->trans("ConstantIsOn", "MAIN_FEATURES_LEVEL")); } - if (!empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT)) { + if (getDolGlobalString('MODULEBUILDER_ADD_DOCUMENT_ROOT')) { $textforlistofdirs .= $form->textwithpicto('', $langs->trans("ConstantIsOn", "MODULEBUILDER_ADD_DOCUMENT_ROOT")); } } @@ -317,7 +317,6 @@ if ($dirins && $action == 'initmodule' && $modulename) { dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.key.sql'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.key.sql'); - dol_delete_file($destdir.'/img/object_myobject.png'); dol_delete_file($destdir.'/class/myobject.class.php'); dol_delete_dir($destdir.'/class', 1); @@ -895,237 +894,7 @@ if ($dirins && $action == 'confirm_removefile' && !empty($module)) { } } - -// Build the $fields array from SQL table (initfromtablename) -if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', 'alpha')) { - $tablename = GETPOST('initfromtablename', 'alpha'); - $_results = $db->DDLDescTable($tablename); - if (empty($_results)) { - setEventMessages($langs->trans("ErrorTableNotFound", $tablename), null, 'errors'); - } else { - /** - * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') - * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" - * 'label' the translation key. - * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '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) - * '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' 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) - */ - - /*public $fields=array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text'), - 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>'LinkToThirdparty'), - 'description' =>array('type'=>'text', 'label'=>'Descrption', 'enabled'=>1, 'visible'=>0, 'position'=>60), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62), - 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), - //'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), - //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), - );*/ - - $string = 'public $fields=array('."\n"; - $string .= "
"; - $i = 10; - while ($obj = $db->fetch_object($_results)) { - // fieldname - $fieldname = $obj->Field; - // type - $type = $obj->Type; - if ($type == 'int(11)') { - $type = 'integer'; - } - if ($type == 'float') { - $type = 'real'; - } - if (strstr($type, 'tinyint')) { - $type = 'integer'; - } - if ($obj->Field == 'fk_soc') { - $type = 'integer:Societe:societe/class/societe.class.php'; - } - if (preg_match('/^fk_proj/', $obj->Field)) { - $type = 'integer:Project:projet/class/project.class.php:1:fk_statut=1'; - } - if (preg_match('/^fk_prod/', $obj->Field)) { - $type = 'integer:Product:product/class/product.class.php:1'; - } - if ($obj->Field == 'fk_warehouse') { - $type = 'integer:Entrepot:product/stock/class/entrepot.class.php'; - } - if (preg_match('/^(fk_user|fk_commercial)/', $obj->Field)) { - $type = 'integer:User:user/class/user.class.php'; - } - - // notnull - $notnull = ($obj->Null == 'YES' ? 0 : 1); - if ($fieldname == 'fk_user_modif') { - $notnull = -1; - } - // label - $label = preg_replace('/_/', '', ucfirst($fieldname)); - if ($fieldname == 'rowid') { - $label = 'TechnicalID'; - } - if ($fieldname == 'import_key') { - $label = 'ImportId'; - } - if ($fieldname == 'fk_soc') { - $label = 'ThirdParty'; - } - if ($fieldname == 'tms') { - $label = 'DateModification'; - } - if ($fieldname == 'datec') { - $label = 'DateCreation'; - } - if ($fieldname == 'date_valid') { - $label = 'DateValidation'; - } - if ($fieldname == 'datev') { - $label = 'DateValidation'; - } - if ($fieldname == 'note_private') { - $label = 'NotePublic'; - } - if ($fieldname == 'note_public') { - $label = 'NotePrivate'; - } - if ($fieldname == 'fk_user_creat') { - $label = 'UserAuthor'; - } - if ($fieldname == 'fk_user_modif') { - $label = 'UserModif'; - } - if ($fieldname == 'fk_user_valid') { - $label = 'UserValidation'; - } - // visible - $visible = -1; - if ($fieldname == 'entity') { - $visible = -2; - } - if ($fieldname == 'import_key') { - $visible = -2; - } - if ($fieldname == 'fk_user_creat') { - $visible = -2; - } - if ($fieldname == 'fk_user_modif') { - $visible = -2; - } - if (in_array($fieldname, array('ref_ext', 'model_pdf', 'note_public', 'note_private'))) { - $visible = 0; - } - // enabled - $enabled = 1; - // default - $default = ''; - if ($fieldname == 'entity') { - $default = 1; - } - // position - $position = $i; - if (in_array($fieldname, array('status', 'statut', 'fk_status', 'fk_statut'))) { - $position = 500; - } - if ($fieldname == 'import_key') { - $position = 900; - } - // index - $index = 0; - if ($fieldname == 'entity') { - $index = 1; - } - // css, cssview, csslist - $css = ''; - $cssview = ''; - $csslist = ''; - if (preg_match('/^fk_/', $fieldname)) { - $css = 'maxwidth500 widthcentpercentminusxx'; - } - if ($fieldname == 'label') { - $css = 'minwidth300'; - $cssview = 'wordbreak'; - } - if (in_array($fieldname, array('note_public', 'note_private'))) { - $cssview = 'wordbreak'; - } - - // type - $picto = $obj->Picto; - if ($obj->Field == 'fk_soc') { - $picto = 'company'; - } - if (preg_match('/^fk_proj/', $obj->Field)) { - $picto = 'project'; - } - - // Build the property string - $string .= "'".$obj->Field."'=>array('type'=>'".$type."', 'label'=>'".$label."',"; - if ($default != '') { - $string .= " 'default'=>".$default.","; - } - $string .= " 'enabled'=>".$enabled.","; - $string .= " 'visible'=>".$visible; - if ($notnull) { - $string .= ", 'notnull'=>".$notnull; - } - if ($fieldname == 'ref' || $fieldname == 'code') { - $string .= ", 'showoncombobox'=>1"; - } - $string .= ", 'position'=>".$position; - if ($index) { - $string .= ", 'index'=>".$index; - } - if ($picto) { - $string .= ", 'picto'=>'".$picto."'"; - } - if ($css) { - $string .= ", 'css'=>".$css; - } - if ($cssview) { - $string .= ", 'cssview'=>".$cssview; - } - if ($csslist) { - $string .= ", 'csslist'=>".$csslist; - } - $string .= "),\n"; - $string .= "
"; - $i += 5; - } - $string .= ');'."\n"; - $string .= "
"; - print $string; - exit; - } -} - +// Init an object if ($dirins && $action == 'initobject' && $module && $objectname) { $objectname = ucfirst($objectname); @@ -1169,6 +938,247 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { } } + // If we must reuse a table for properties, define $stringforproperties + $stringforproperties = ''; + $tablename = GETPOST('initfromtablename', 'alpha'); + if ($tablename) { + $_results = $db->DDLDescTable($tablename); + if (empty($_results)) { + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorTableNotFound", $tablename), null, 'errors'); + } else { + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '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' 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) + */ + + /*public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), + 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), + 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'alwayseditable'=>'1'), + 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>'LinkToThirdparty'), + 'description' =>array('type'=>'text', 'label'=>'Descrption', 'enabled'=>1, 'visible'=>0, 'position'=>60), + 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), + 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62), + 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), + //'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510), + 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), + //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), + 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), + );*/ + + $stringforproperties = '// BEGIN MODULEBUILDER PROPERTIES'."\n"; + $stringforproperties .= 'public $fields=array('."\n"; + $i = 10; + while ($obj = $db->fetch_object($_results)) { + // fieldname + $fieldname = $obj->Field; + // type + $type = $obj->Type; + if ($type == 'int(11)') { + $type = 'integer'; + } + if ($type == 'float') { + $type = 'real'; + } + if (strstr($type, 'tinyint')) { + $type = 'integer'; + } + if ($obj->Field == 'fk_soc') { + $type = 'integer:Societe:societe/class/societe.class.php'; + } + if (preg_match('/^fk_proj/', $obj->Field)) { + $type = 'integer:Project:projet/class/project.class.php:1:fk_statut=1'; + } + if (preg_match('/^fk_prod/', $obj->Field)) { + $type = 'integer:Product:product/class/product.class.php:1'; + } + if ($obj->Field == 'fk_warehouse') { + $type = 'integer:Entrepot:product/stock/class/entrepot.class.php'; + } + if (preg_match('/^(fk_user|fk_commercial)/', $obj->Field)) { + $type = 'integer:User:user/class/user.class.php'; + } + + // notnull + $notnull = ($obj->Null == 'YES' ? 0 : 1); + if ($fieldname == 'fk_user_modif') { + $notnull = -1; + } + // label + $label = preg_replace('/_/', '', ucfirst($fieldname)); + if ($fieldname == 'rowid') { + $label = 'TechnicalID'; + } + if ($fieldname == 'import_key') { + $label = 'ImportId'; + } + if ($fieldname == 'fk_soc') { + $label = 'ThirdParty'; + } + if ($fieldname == 'tms') { + $label = 'DateModification'; + } + if ($fieldname == 'datec') { + $label = 'DateCreation'; + } + if ($fieldname == 'date_valid') { + $label = 'DateValidation'; + } + if ($fieldname == 'datev') { + $label = 'DateValidation'; + } + if ($fieldname == 'note_private') { + $label = 'NotePublic'; + } + if ($fieldname == 'note_public') { + $label = 'NotePrivate'; + } + if ($fieldname == 'fk_user_creat') { + $label = 'UserAuthor'; + } + if ($fieldname == 'fk_user_modif') { + $label = 'UserModif'; + } + if ($fieldname == 'fk_user_valid') { + $label = 'UserValidation'; + } + // visible + $visible = -1; + if ($fieldname == 'entity') { + $visible = -2; + } + if ($fieldname == 'import_key') { + $visible = -2; + } + if ($fieldname == 'fk_user_creat') { + $visible = -2; + } + if ($fieldname == 'fk_user_modif') { + $visible = -2; + } + if (in_array($fieldname, array('ref_ext', 'model_pdf', 'note_public', 'note_private'))) { + $visible = 0; + } + // enabled + $enabled = 1; + // default + $default = ''; + if ($fieldname == 'entity') { + $default = 1; + } + // position + $position = $i; + if (in_array($fieldname, array('status', 'statut', 'fk_status', 'fk_statut'))) { + $position = 500; + } + if ($fieldname == 'import_key') { + $position = 900; + } + // $alwayseditable + if ($fieldname == 'label') { + $alwayseditable = 1; + } + // index + $index = 0; + if ($fieldname == 'entity') { + $index = 1; + } + // css, cssview, csslist + $css = ''; + $cssview = ''; + $csslist = ''; + if (preg_match('/^fk_/', $fieldname)) { + $css = 'maxwidth500 widthcentpercentminusxx'; + } + if ($fieldname == 'label') { + $css = 'minwidth300'; + $cssview = 'wordbreak'; + } + if (in_array($fieldname, array('note_public', 'note_private'))) { + $cssview = 'wordbreak'; + } + if (in_array($fieldname, array('ref', 'label')) || preg_match('/integer:/', $type)) { + $csslist = 'tdoverflowmax150'; + } + + // type + $picto = $obj->Picto; + if ($obj->Field == 'fk_soc') { + $picto = 'company'; + } + if (preg_match('/^fk_proj/', $obj->Field)) { + $picto = 'project'; + } + + // Build the property string + $stringforproperties .= "'".$obj->Field."'=>array('type'=>'".$type."', 'label'=>'".$label."',"; + if ($default != '') { + $stringforproperties .= " 'default'=>".$default.","; + } + $stringforproperties .= " 'enabled'=>".$enabled.","; + $stringforproperties .= " 'visible'=>".$visible; + if ($notnull) { + $stringforproperties .= ", 'notnull'=>".$notnull; + } + if ($alwayseditable) { + $stringforproperties .= ", 'alwayseditable'=>1"; + } + if ($fieldname == 'ref' || $fieldname == 'code') { + $stringforproperties .= ", 'showoncombobox'=>1"; + } + $stringforproperties .= ", 'position'=>".$position; + if ($index) { + $stringforproperties .= ", 'index'=>".$index; + } + if ($picto) { + $stringforproperties .= ", 'picto'=>'".$picto."'"; + } + if ($css) { + $stringforproperties .= ", 'css'=>'".$css."'"; + } + if ($cssview) { + $stringforproperties .= ", 'cssview'=>'".$cssview."'"; + } + if ($csslist) { + $stringforproperties .= ", 'csslist'=>'".$csslist."'"; + } + $stringforproperties .= "),\n"; + $i += 5; + } + $stringforproperties .= ');'."\n"; + $stringforproperties .= '// END MODULEBUILDER PROPERTIES'."\n"; + } + } + if (!$error) { // Copy some files $filetogenerate = array( @@ -1186,7 +1196,6 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', 'sql/llx_mymodule_myobject_extrafields.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.key.sql', //'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php', - 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php', ); @@ -1210,20 +1219,33 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { ); } - foreach ($filetogenerate as $srcfile => $destfile) { - $result = dol_copy($srcdir.'/'.$srcfile, $destdir.'/'.$destfile, $newmask, 0); - if ($result <= 0) { - if ($result < 0) { - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFailToCopyFile", $srcdir.'/'.$srcfile, $destdir.'/'.$destfile), null, 'errors'); - } else { - // $result == 0 - setEventMessages($langs->trans("FileAlreadyExists", $destfile), null, 'warnings'); + + if (!$error) { + foreach ($filetogenerate as $srcfile => $destfile) { + $result = dol_copy($srcdir.'/'.$srcfile, $destdir.'/'.$destfile, $newmask, 0); + if ($result <= 0) { + if ($result < 0) { + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFailToCopyFile", $srcdir.'/'.$srcfile, $destdir.'/'.$destfile), null, 'errors'); + } else { + // $result == 0 + setEventMessages($langs->trans("FileAlreadyExists", $destfile), null, 'warnings'); + } } } } + // Replace property section with $stringforproperties + if (!$error && $stringforproperties) { + //var_dump($stringforproperties);exit; + $arrayreplacement = array( + '/\/\/ BEGIN MODULEBUILDER PROPERTIES.*\/\/ END MODULEBUILDER PROPERTIES/ims' => $stringforproperties + ); + + dolReplaceInFile($destdir.'/class/'.strtolower($objectname).'.class.php', $arrayreplacement, '', 0, 0, 1); + } + // Edit the class 'class/'.strtolower($objectname).'.class.php' if (GETPOST('includerefgeneration', 'aZ09')) { // Replace 'visible'=>1, 'noteditable'=>0, 'default'=>'' @@ -1386,14 +1408,19 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { if (!$error) { // Edit the class file to write properties $object = rebuildObjectClass($destdir, $module, $objectname, $newmask); - if (is_numeric($object) && $object < 0) { + + if (is_numeric($object) && $object <= 0) { + $pathoffiletoeditsrc = $destdir.'/class/'.strtolower($objectname).'.class.php'; + setEventMessages($langs->trans('ErrorFailToCreateFile', $pathoffiletoeditsrc), null, 'errors'); $error++; } } if (!$error) { // Edit sql with new properties $result = rebuildObjectSql($destdir, $module, $objectname, $newmask, '', $object); - if ($result < 0) { + + if ($result <= 0) { + setEventMessages($langs->trans('ErrorFailToCreateFile', '.sql'), null); $error++; } } @@ -1401,6 +1428,8 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { if (!$error) { setEventMessages($langs->trans('FilesForObjectInitialized', $objectname), null); $tabobj = $objectname; + } else { + $tabobj = 'newobject'; } } @@ -1485,25 +1514,26 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && if (!$error && !GETPOST('regenerateclasssql')&& !GETPOST('regeneratemissing')) { $addfieldentry = array( - 'name'=>GETPOST('propname', 'aZ09'), - 'label'=>GETPOST('proplabel', 'alpha'), - 'type'=>GETPOST('proptype', 'alpha'), - 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' - 'visible'=>GETPOST('propvisible', 'int'), - 'enabled'=>GETPOST('propenabled', 'int'), - 'position'=>GETPOST('propposition', 'int'), - 'notnull'=>GETPOST('propnotnull', 'int'), - 'index'=>GETPOST('propindex', 'int'), - 'searchall'=>GETPOST('propsearchall', 'int'), - 'isameasure'=>GETPOST('propisameasure', 'int'), - 'comment'=>GETPOST('propcomment', 'alpha'), - 'help'=>GETPOST('prophelp', 'alpha'), - 'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example - 'cssview'=>GETPOST('propcssview', 'alpha'), - 'csslist'=>GETPOST('propcsslist', 'alpha'), - 'default'=>GETPOST('propdefault', 'restricthtml'), - 'noteditable'=>intval(GETPOST('propnoteditable', 'int')), - 'validate' => GETPOST('propvalidate', 'int') + 'name'=>GETPOST('propname', 'aZ09'), + 'label'=>GETPOST('proplabel', 'alpha'), + 'type'=>GETPOST('proptype', 'alpha'), + 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' + 'visible'=>GETPOST('propvisible', 'int'), + 'enabled'=>GETPOST('propenabled', 'int'), + 'position'=>GETPOST('propposition', 'int'), + 'notnull'=>GETPOST('propnotnull', 'int'), + 'index'=>GETPOST('propindex', 'int'), + 'searchall'=>GETPOST('propsearchall', 'int'), + 'isameasure'=>GETPOST('propisameasure', 'int'), + 'comment'=>GETPOST('propcomment', 'alpha'), + 'help'=>GETPOST('prophelp', 'alpha'), + 'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example + 'cssview'=>GETPOST('propcssview', 'alpha'), + 'csslist'=>GETPOST('propcsslist', 'alpha'), + 'default'=>GETPOST('propdefault', 'restricthtml'), + 'noteditable'=>intval(GETPOST('propnoteditable', 'int')), + 'alwayseditable'=>intval(GETPOST('propalwayseditable', 'int')), + 'validate' => GETPOST('propvalidate', 'int') ); @@ -1528,6 +1558,8 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && $object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype); if (is_numeric($object) && $object <= 0) { + $pathoffiletoeditsrc = $destdir.'/class/'.strtolower($objectname).'.class.php'; + setEventMessages($langs->trans('ErrorFailToCreateFile', $pathoffiletoeditsrc), null, 'errors'); $error++; } } @@ -1537,6 +1569,7 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && $result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object, $moduletype); if ($result <= 0) { + setEventMessages($langs->trans('ErrorFailToCreateFile', '.sql'), null, 'errors'); $error++; } } @@ -1568,7 +1601,10 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey) { // Edit the class file to write properties if (!$error) { $object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, array(), $propertykey); + if (is_numeric($object) && $object <= 0) { + $pathoffiletoeditsrc = $destdir.'/class/'.strtolower($objectname).'.class.php'; + setEventMessages($langs->trans('ErrorFailToCreateFile', $pathoffiletoeditsrc), null, 'errors'); $error++; } } @@ -1576,7 +1612,9 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey) { // Edit sql with new properties if (!$error) { $result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object); + if ($result <= 0) { + setEventMessages($langs->trans('ErrorFailToCreateFile', '.sql'), null, 'errors'); $error++; } } @@ -1655,7 +1693,6 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) { 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql', 'sql/llx_mymodule_myobject_extrafields.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.key.sql', 'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php', - 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', 'class/api_myobject.class.php'=>'class/api_'.strtolower($module).'.class.php', 'core/modules/mymodule/mod_myobject_advanced.php'=>'core/modules/'.strtolower($module).'/mod_'.strtolower($objectname).'_advanced.php', @@ -1934,7 +1971,7 @@ if ($message) { } //print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).'
'; -$infomodulesfound = '
'.$form->textwithpicto(''.$langs->trans("ModuleBuilderDesc3", count($listofmodules)).'', $langs->trans("ModuleBuilderDesc4", $FILEFLAG).'
'.$textforlistofdirs).'
'; +$infomodulesfound = '
'.$form->textwithpicto('', $langs->trans("ModuleBuilderDesc3", count($listofmodules)).'

'.$langs->trans("ModuleBuilderDesc4", $FILEFLAG).'
'.$textforlistofdirs).'
'; // Load module descriptor @@ -2013,8 +2050,10 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { } $urltomodulesetup = ''.$langs->trans('Home').'-'.$langs->trans("Setup").'-'.$langs->trans("Modules").''; - if (!empty($conf->global->$const_name)) { // If module is already activated - $linktoenabledisable .= ''; + + // Define $linktoenabledisable to show after module title + if (isModEnabled($modulelowercase)) { // If module is already activated + $linktoenabledisable .= ''; $linktoenabledisable .= img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', '', 1); $linktoenabledisable .= ''; @@ -2074,7 +2113,7 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { } $head[$h][0] = $_SERVER["PHP_SELF"].'?module=deletemodule'; -$head[$h][1] = $langs->trans("DangerZone"); +$head[$h][1] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("DangerZone"); $head[$h][2] = 'deletemodule'; $h++; @@ -2271,6 +2310,8 @@ if ($module == 'initmodule') { $head2[$h][2] = 'buildpackage'; $h++; + $MAXTABFOROBJECT = 15; + print ''; // Note module is inside $dirread @@ -2282,7 +2323,7 @@ if ($module == 'initmodule') { $pathtochangelog = $modulelowercase.'/ChangeLog.md'; if ($action != 'editfile' || empty($file)) { - print dol_get_fiche_head($head2, $tab, '', -1, '', 0, '', '', 0, 'formodulesuffix'); // Description - level 2 + print dol_get_fiche_head($head2, $tab, '', -1, '', 0, '', '', $MAXTABFOROBJECT, 'formodulesuffix'); // Description - level 2 print ''.$langs->trans("ModuleBuilderDesc".$tab).''; $infoonmodulepath = ''; @@ -2442,7 +2483,7 @@ if ($module == 'initmodule') { print ''; } } else { - print dol_get_fiche_head($head2, $tab, '', -1, '', 0, '', '', 0, 'formodulesuffix'); // Level 2 + print dol_get_fiche_head($head2, $tab, '', -1, '', 0, '', '', $MAXTABFOROBJECT, 'formodulesuffix'); // Level 2 } if ($tab == 'languages') { @@ -2563,7 +2604,7 @@ if ($module == 'initmodule') { if ($h > 1) { $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabobj=deleteobject'; - $head3[$h][1] = $langs->trans("DangerZone"); + $head3[$h][1] =img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("DangerZone"); $head3[$h][2] = 'deleteobject'; $h++; } @@ -2589,12 +2630,38 @@ if ($module == 'initmodule') { print ''.$langs->trans("EnterNameOfObjectDesc").'

'; - print '
'; - print '
'; + print '
'; + + print '
'; + print ''.$langs->trans("ObjectKey").'   '; + print '
'; + print '
'; + print '
'; + + print '
'; + print ''.$langs->trans("Picto").'   '; + print '
'; + print ''; + print $form->textwithpicto('', $langs->trans("Example").': fa-generic, fa-globe, ... any font awesome code.
Advanced syntax is fa-fakey[_faprefix[_facolor[_fasize]]]'); + print '
'; + + print '
'; + print ''.$langs->trans("DefinePropertiesFromExistingTable").'   '; + print '
'; + print ''; + print $form->textwithpicto('', $langs->trans("DefinePropertiesFromExistingTableDesc").'
'.$langs->trans("DefinePropertiesFromExistingTableDesc2")); + print '
'; + + print '
'; + + print '
'; + print '
'; print '
'; - print ''; + print '
'; + print ''; print '
'; print '
'; + /* print '
'; print ''.$langs->trans("or").''; print '
'; @@ -2604,6 +2671,7 @@ if ($module == 'initmodule') { print ''; print ''; print '
'; + */ print ''; } elseif ($tabobj == 'deleteobject') { @@ -2665,7 +2733,7 @@ if ($module == 'initmodule') { } if (class_exists($tabobj)) { try { - $tmpobjet = @new $tabobj($db); + $tmpobject = @new $tabobj($db); } catch (Exception $e) { dol_syslog('Failed to load Constructor of class: '.$e->getMessage(), LOG_WARNING); } @@ -2738,13 +2806,22 @@ if ($module == 'initmodule') { $urlofcard = dol_buildpath('/'.$pathtocard, 1); - - - + print ''; print '
'; // Main DAO class file print ' '.$langs->trans("ClassFile").' : '.(dol_is_file($realpathtoclass) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).(dol_is_file($realpathtoclass) ? '' : '').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
'; + // Image + if (dol_is_file($realpathtopicto)) { + print ' '.$langs->trans("Image").' : '.(dol_is_file($realpathtopicto) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).(dol_is_file($realpathtopicto) ? '' : '').''; + //print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
'; + } elseif (!empty($tmpobject)) { + print ' '.$langs->trans("Image").' : '.img_picto('', $tmpobject->picto, 'class="pictofixedwidth"'); + print '
'; + } + // API file print '
'; print ' '.$langs->trans("ApiClassFile").' : '.(dol_is_file($realpathtoapi) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi)?'':'').''; @@ -2781,9 +2858,6 @@ if ($module == 'initmodule') { print ' '.$langs->trans("PageForObjLib").' : '.(dol_is_file($realpathtoobjlib) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoobjlib).(dol_is_file($realpathtoobjlib) ? '' : '').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("Image").' : '.(dol_is_file($realpathtopicto) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).(dol_is_file($realpathtopicto) ? '' : '').''; - //print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; print '
'; print ' '.$langs->trans("SqlFile").' : '.(dol_is_file($realpathtosql) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosql).(dol_is_file($realpathtosql) ? '' : '').''; @@ -2871,7 +2945,7 @@ if ($module == 'initmodule') { print '


'; - if (!empty($tmpobjet)) { + if (!empty($tmpobject)) { $reflector = new ReflectionClass($tabobj); $reflectorproperties = $reflector->getProperties(); // Can also use get_object_vars $reflectorpropdefault = $reflector->getDefaultProperties(); // Can also use get_object_vars @@ -2911,6 +2985,7 @@ if ($module == 'initmodule') { print '
'; print ''; print ''; + print ''; print ''; print ''; print ''; @@ -2924,9 +2999,9 @@ if ($module == 'initmodule') { print ''; print ''; - // We must use $reflectorpropdefault['fields'] to get list of fields because $tmpobjet->fields may have been + // We must use $reflectorpropdefault['fields'] to get list of fields because $tmpobject->fields may have been // modified during the constructor and we want value into head of class before constructor is called. - //$properties = dol_sort_array($tmpobjet->fields, 'position'); + //$properties = dol_sort_array($tmpobject->fields, 'position'); $properties = dol_sort_array($reflectorpropdefault['fields'], 'position'); if (!empty($properties)) { @@ -2944,6 +3019,7 @@ if ($module == 'initmodule') { print ''; print ''; print ''; + print ''; print ''; print ''; print ''; @@ -2965,7 +3041,7 @@ if ($module == 'initmodule') { { $propname=$propval->getName(); $comment=$propval->getDocComment(); - $type=gettype($tmpobjet->$propname); + $type=gettype($tmpobject->$propname); $default=$propdefault[$propname]; // Discard generic properties if (in_array($propname, array('element', 'childtables', 'table_element', 'table_element_line', 'class_element_line', 'ismultientitymanaged'))) continue; @@ -2986,6 +3062,7 @@ if ($module == 'initmodule') { $propenabled = $propval['enabled']; $propvisible = $propval['visible']; $propnoteditable = !empty($propval['noteditable'])?$propval['noteditable']:0; + $propalwayseditable = !empty($propval['alwayseditable'])?$propval['alwayseditable']:0; $propsearchall = !empty($propval['searchall'])?$propval['searchall']:0; $propisameasure = !empty($propval['isameasure'])?$propval['isameasure']:0; $propcss = !empty($propval['css'])?$propval['css']:''; @@ -3044,6 +3121,9 @@ if ($module == 'initmodule') { print ''; print ''; print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; @@ -154,7 +154,7 @@ if ($id > 0) { print '
'; print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $selectedvat), $mysoc, '', 0, 0, '', false, 1); print ''; - print ''; + print ''; print ''; - print $form->selectDate($date ? $date : -1, 'date', 0, 0, 0, '', 1, 1); + print $form->selectDate(!empty($date) ? $date : -1, 'date', 0, 0, 0, '', 1, 1); print ''; - $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); + $formproject->select_projects(-1, !empty($fk_project) ? $fk_project : 0, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print ''; - print $formexpensereport->selectTypeExpenseReport($fk_c_type_fees, 'fk_c_type_fees', 1); + print $formexpensereport->selectTypeExpenseReport(!empty($fk_c_type_fees) ? $fk_c_type_fees : "", 'fk_c_type_fees', 1); print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; // We must be able to enter decimal qty + print ''; // We must be able to enter decimal qty print ' '.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$langs->trans("NotEditable").''.$langs->trans("AlwaysEditable").''.$form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")).''.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).''.$langs->trans("CSSClass").'
'; + print ''; + print ''; print ''; print ''; @@ -3110,6 +3190,9 @@ if ($module == 'initmodule') { print $propnoteditable ? dol_escape_htmltag($propnoteditable) : ''; print ''; + print $propalwayseditable ? dol_escape_htmltag($propalwayseditable) : ''; + print ''; print $propsearchall ? '1' : ''; print ''; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 8265bbadaf8..b30391becc7 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -89,6 +89,7 @@ class MyObject extends CommonObject * '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_...). @@ -115,19 +116,19 @@ class MyObject extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>10), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object', 'validate'=>1), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2, 'validate'=>1), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2, 'validate'=>1, 'alwayseditable'=>1), 'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1), 'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'OrganizationEventLinkToThirdParty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'OrganizationEventLinkToThirdParty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1, 'cssview'=>'wordbreak'), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'validate'=>1, 'cssview'=>'wordbreak'), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 0, 'position'=>501), //'date_validation ' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'user.rowid'), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax150'), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511, 'csslist'=>'tdoverflowmax150'), //'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'notnull'=>0, 'position'=>600), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 169d764b80b..212f02aa4b3 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -144,7 +144,7 @@ class modMyModule extends DolibarrModules $this->langfiles = array("mymodule@mymodule"); // Prerequisites - $this->phpmin = array(5, 6); // Minimum version of PHP required by module + $this->phpmin = array(7, 0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module // Messages at activation diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 3011c932171..46967d6e4fa 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_myobject_odt extends ModelePDFMyObject /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document 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 382b5a0f0ab..312f1215406 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 @@ -70,9 +70,9 @@ class pdf_standard_myobject extends ModelePDFMyObject /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/modulebuilder/template/img/README.md b/htdocs/modulebuilder/template/img/README.md new file mode 100644 index 00000000000..2fcb4afc087 --- /dev/null +++ b/htdocs/modulebuilder/template/img/README.md @@ -0,0 +1,14 @@ + +Directory for module image files +-------------------------------- + +You can put here the .png files of your module: + + +If the picto of your module is an image (property $picto has been set to 'mymodule.png@mymodule', you can put into this +directory a .png file called *object_mymodule.png* (16x16 or 32x32 pixels) + + +If the picto of an object is an image (property $picto of the object.class.php has been set to 'myobject.png@mymodule', then you can put into this +directory a .png file called *object_myobject.png* (16x16 or 32x32 pixels) + diff --git a/htdocs/modulebuilder/template/img/object_mymodule.png b/htdocs/modulebuilder/template/img/object_mymodule.png deleted file mode 100644 index b421fe3c9e0..00000000000 Binary files a/htdocs/modulebuilder/template/img/object_mymodule.png and /dev/null differ diff --git a/htdocs/modulebuilder/template/img/object_mymodule_over.png b/htdocs/modulebuilder/template/img/object_mymodule_over.png deleted file mode 100644 index 7831c3025d7..00000000000 Binary files a/htdocs/modulebuilder/template/img/object_mymodule_over.png and /dev/null differ diff --git a/htdocs/modulebuilder/template/img/object_myobject.png b/htdocs/modulebuilder/template/img/object_myobject.png deleted file mode 100644 index b421fe3c9e0..00000000000 Binary files a/htdocs/modulebuilder/template/img/object_myobject.png and /dev/null differ diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index b58c7169f25..8624713c689 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -105,7 +105,7 @@ class Mo extends CommonObject 'mrptype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>34, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>'$conf->product->enabled', 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax100', 'picto'=>'product'), 'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2', 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2', 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200', 'alwayseditable'=>1), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax150'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400', 'csslist'=>'tdoverflowmax100'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>'$conf->stock->enabled', 'visible'=>1, 'position'=>52, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax200'), @@ -116,8 +116,8 @@ class Mo extends CommonObject 'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'), - 'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'), - 'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,), + 'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap', 'alwayseditable'=>1), + 'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1, 'alwayseditable'=>1), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')), @@ -613,11 +613,9 @@ class Mo extends CommonObject } if (!$error) { - setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); $this->db->commit(); return 1; } else { - setEventMessages($this->error, $this->errors, 'errors'); $this->db->rollback(); return -1; } @@ -636,8 +634,9 @@ class Mo extends CommonObject $role = ""; if ($this->status != self::STATUS_DRAFT) { - $this->error = 'BadStatus'; - return -1; + //$this->error = 'BadStatusForUpdateProduction'; + //return -1; + return 1; } $this->db->begin(); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 373dd7b6410..fde5811547a 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -136,7 +136,7 @@ if (empty($reshook)) { } $triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record - //Create MO with Childs + // Create MO with Childs if ($action == 'add' && empty($id) && !empty($TBomLineId)) { $noback = 1; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -165,7 +165,7 @@ if (empty($reshook)) { $res = $object->add_object_linked('mo', $mo_parent->id); } - header("Location: ".dol_buildpath('/mrp/mo_card.php?id='.$moline->fk_mo, 1)); + header("Location: ".dol_buildpath('/mrp/mo_card.php?id='.((int) $moline->fk_mo), 1)); exit; } diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 53414a0a608..034fa97f86f 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -76,7 +76,7 @@ if ($user->socid) { $socid = $user->socid; } -if (empty($user->rights->fournisseur->lire)) { +if (empty($user->rights->fournisseur->lire) && (empty($conf->margin->enabled) && !$user->hasRight("margin", "liretous"))) { accessforbidden(); } @@ -919,7 +919,7 @@ END; print "\n"; - if ($user->rights->fournisseur->lire) { // Duplicate ? this check is already in the head of this file + if ($user->hasRight("fournisseur", "read")) { // Duplicate ? this check is already in the head of this file $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index ba35cb0ba3f..c86713ffb93 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -48,9 +48,9 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * @var string Dolibarr version of the loaded document diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index bf267a475c6..007333dfd5d 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -70,9 +70,9 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio /** * @var array Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.6 = array(5, 6) + * e.g.: PHP ≥ 7.0 = array(7, 0) */ - public $phpmin = array(5, 6); + public $phpmin = array(7, 0); /** * Dolibarr version of the loaded document diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index a0299ef3fec..5cb7cf69ef8 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -1016,7 +1016,7 @@ if ($resql) { // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print ''; - if (count($typenArray) == 0) { + if (empty($typenArray) || !is_array($typenArray) || count($typenArray) == 0) { $typenArray = $formcompany->typent_array(1); } print $typenArray[$obj->typent_code]; diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index bfde88726e9..b3f91901575 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -183,7 +183,7 @@ div#topmenu-quickadd-dropdown a::after, div#topmenu-bookmark-dropdown a::after { border-top-left-radius: 0; padding: 1px 0 0 0; border-top-width: 0; - width: 300px; + width: 360px; } .topnav .user-menu .dropdown-menu { top: 50px; @@ -522,6 +522,9 @@ div.quickaddblock:focus { max-width: 360px; } + .side-nav-vert .user-menu .dropdown-menu, .topnav .user-menu .dropdown-menu { + width: 300px; + } .dropdown-menu { border: none; -webkit-box-shadow: none; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index cf30cc2bb99..9ba58cd069b 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1000,18 +1000,18 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; $valuetoshow = ''; if (preg_match('/ldap/', $dolibarr_main_authentication)) { - $valuetoshow .= ($valuetoshow ? ', ' : '').$langs->trans("PasswordOfUserInLDAP"); + $valuetoshow .= ($valuetoshow ? ' + ' : '').$langs->trans("PasswordOfUserInLDAP").' (hidden)'; } if (preg_match('/http/', $dolibarr_main_authentication)) { - $valuetoshow .= ($valuetoshow ? ', ' : '').$langs->trans("HTTPBasicPassword"); + $valuetoshow .= ($valuetoshow ? ' + ' : '').$langs->trans("HTTPBasicPassword"); } if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if (!empty($ldap_pass)) { // For very old system comaptibilty. Now clear password can't be viewed from LDAP read - $valuetoshow .= ($valuetoshow ? ', ' : '').''; // Dolibarr password is preffiled with LDAP known password + $valuetoshow .= ($valuetoshow ? ' + ' : '').''; // Dolibarr password is preffiled with LDAP known password $valuetoshow .= preg_replace('/./i', '*', $ldap_pass); } else { // We do not use a field password but a field text to show new password to use. - $valuetoshow .= ($valuetoshow ? ', ' : '').''; + $valuetoshow .= ($valuetoshow ? ' + '.$langs->trans("DolibarrPassword") : '').''; } } diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 2302b6e7681..562ab081ab8 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -127,7 +127,7 @@ if ($id > 0) { $langs->load("errors"); print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).''; } else { - print '     '.$form->textwithpicto($langs->trans("KeepEmptyToUseDefault").': '.$conf->global->CLICKTODIAL_URL, $langs->trans("ClickToDialUrlDesc")); + print '
'.$form->textwithpicto(''.$langs->trans("KeepEmptyToUseDefault").':
'.$conf->global->CLICKTODIAL_URL, $langs->trans("ClickToDialUrlDesc")); } print '
'; if (!empty($user->admin)) { - print ''; + print ''; print ''; } - print ''; + print ''; print ''; print ""; diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index dd12669980a..d93ec7851e4 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -108,7 +108,7 @@ dol_banner_tab($object, 'id', $linkback, (!empty($user->rights->user->user->lire print '
'; print '
'; -print '
ClickToDial URL
ClickToDial URL'; if (!empty($conf->global->CLICKTODIAL_URL)) { $url = $conf->global->CLICKTODIAL_URL; @@ -172,7 +172,7 @@ if ($id > 0) { print '
ClickToDial '.$langs->trans("IdPhoneCaller").'
ClickToDial '.$langs->trans("IdPhoneCaller").''.(!empty($object->clicktodial_poste) ? $object->clicktodial_poste : '').'
'; +print '
'; // Name (already in dol_banner, we keep it to have the GlobalGroup picto, but we should move it in dol_banner) if (!empty($conf->mutlicompany->enabled)) { diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index f065a165a54..56ab923435d 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/zapier/class/hook.class.php'; * @access protected * @class DolibarrApiAccess {@requires user,external} */ -class ZapierApi extends DolibarrApi +class Zapier extends DolibarrApi { /** * @var array $FIELDS Mandatory fields, checked when create and update object diff --git a/phpstan.neon b/phpstan.neon index 02e47e753d7..129ca462921 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -103,6 +103,7 @@ parameters: - %currentWorkingDirectory%/htdocs/core/lib/donation.lib.php - %currentWorkingDirectory%/htdocs/core/lib/ecm.lib.php - %currentWorkingDirectory%/htdocs/core/lib/emailing.lib.php + #- %currentWorkingDirectory%/htdocs/core/lib/eventorganization.lib.php - %currentWorkingDirectory%/htdocs/core/lib/expedition.lib.php - %currentWorkingDirectory%/htdocs/core/lib/expensereport.lib.php - %currentWorkingDirectory%/htdocs/core/lib/fichinter.lib.php @@ -110,13 +111,17 @@ parameters: - %currentWorkingDirectory%/htdocs/core/lib/fiscalyear.lib.php #- %currentWorkingDirectory%/htdocs/core/lib/format_cards.lib.php - %currentWorkingDirectory%/htdocs/core/lib/fourn.lib.php + #- %currentWorkingDirectory%/htdocs/core/lib/ftp.lib.php - %currentWorkingDirectory%/htdocs/core/lib/functions.lib.php - %currentWorkingDirectory%/htdocs/core/lib/functions2.lib.php + #- %currentWorkingDirectory%/htdocs/core/lib/functions_ch.lib.php + #- %currentWorkingDirectory%/htdocs/core/lib/functionsnumtoword.lib.php - %currentWorkingDirectory%/htdocs/core/lib/geturl.lib.php - %currentWorkingDirectory%/htdocs/core/lib/holiday.lib.php - %currentWorkingDirectory%/htdocs/core/lib/hrm.lib.php - %currentWorkingDirectory%/htdocs/core/lib/images.lib.php - %currentWorkingDirectory%/htdocs/core/lib/import.lib.php + #- %currentWorkingDirectory%/htdocs/core/lib/intracommreport.lib.php - %currentWorkingDirectory%/htdocs/core/lib/invoice.lib.php - %currentWorkingDirectory%/htdocs/core/lib/invoice2.lib.php - %currentWorkingDirectory%/htdocs/core/lib/json.lib.php @@ -132,11 +137,13 @@ parameters: - %currentWorkingDirectory%/htdocs/core/lib/parsemd.lib.php - %currentWorkingDirectory%/htdocs/core/lib/payments.lib.php - %currentWorkingDirectory%/htdocs/core/lib/pdf.lib.php + #- %currentWorkingDirectory%/htdocs/core/lib/phpsessionindb.lib.php - %currentWorkingDirectory%/htdocs/core/lib/prelevement.lib.php - %currentWorkingDirectory%/htdocs/core/lib/price.lib.php - %currentWorkingDirectory%/htdocs/core/lib/product.lib.php - %currentWorkingDirectory%/htdocs/core/lib/project.lib.php - %currentWorkingDirectory%/htdocs/core/lib/propal.lib.php + #- %currentWorkingDirectory%/htdocs/core/lib/receiptprinter.lib.php - %currentWorkingDirectory%/htdocs/core/lib/reception.lib.php - %currentWorkingDirectory%/htdocs/core/lib/report.lib.php - %currentWorkingDirectory%/htdocs/core/lib/resource.lib.php @@ -155,6 +162,7 @@ parameters: - %currentWorkingDirectory%/htdocs/core/lib/usergroups.lib.php - %currentWorkingDirectory%/htdocs/core/lib/vat.lib.php - %currentWorkingDirectory%/htdocs/core/lib/website.lib.php + #- %currentWorkingDirectory%/htdocs/core/lib/website2.lib.php - %currentWorkingDirectory%/htdocs/core/lib/ws.lib.php - %currentWorkingDirectory%/htdocs/core/lib/xcal.lib.php featureToggles: