diff --git a/ChangeLog b/ChangeLog index 76ec4faf452..00fbde60b91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,10 +24,10 @@ For users: --------------- NEW: Minimal PHP version is now PHP 7.0 instead of PHP 5.6 -NEW: #21780 Add pid field to Cronjob class and store PID on job execution NEW: #19680 Add option PRODUCT_ALLOW_EXTERNAL_DOWNLOAD to automatically have uploaded files shared publicly by a link NEW: #20650 can move the checkbox column on left (experimental option MAIN_CHECKBOX_LEFT_COLUMN) NEW: #21000 Added columns 'alias_name' on project, supplier invoice, supplier order, supplier proposals and task list +NEW: #21780 Add pid field to Cronjob class and store PID on job execution NEW: #21395 Added option for dark theme mode in display - color and theme NEW: #21397 added option to auto define barcode numbers for third-parties in barcode module setup NEW: #21399 @@ -46,15 +46,11 @@ NEW: #22676 massaction for updating product prices NEW: #22735 Massaction to affect users on projects NEW: #25594 can chose if VAT ID is unique or not for third parties NEW: #4482 adding js to hide/show advanced option on the export data page + NEW: Add a constant to disallow modification of the product reference. -NEW: Add a method doAutoRenewContracts that can be used as a cron task. -NEW: Add " as enclosure by default for CSV export. Keep removing CR/LF. NEW: add attached file in presend email form of thirdparty card NEW: Add a way to enter LICENSE file content in property of website -NEW: add constant PROPAL_BYPASS_VALIDATED_STATUS NEW: Add employment anniversary in birthday box -NEW: Add fail2ban rules examples to limit access to /public pages -NEW: Add filter "Product subject to lot/Serial" in stock per lot/serial NEW: Add hidden option MAIN_EMAIL_SUPPORT_ACK to restore Email ack checkbox (feature abandonned by mailers) NEW: Add link to create an element from the category page NEW: Add max size send for "backup and link to mail" option @@ -63,43 +59,58 @@ NEW: Add more advices into the Setup security page NEW: Add new global variable for keeping the previous signature information on proposale (case of reopen a proposale) NEW: Add objectLink on expedition NEW: Add oldcopy to Ticket so triggers intercepting TICKET_MODIFY have access to old values of the updated properties -NEW: Add option FICHINTER_ALLOW_EXTERNAL_DOWNLOAD NEW: Add option --force on CLI cron_run_jobs.php NEW: Add option "Show price on the generated documents for receptions" -NEW: Add performance index (name for company and contact) and llx_bank_url(url_id) -NEW: Add picto property on sub-module for password generation +NEW: invoice export : add accounting affectation +NEW: label on products categories filter +NEW: manage no email with thirdparties (better for GDPR) +NEW: Manage VAT on all lines on purchases cycle +NEW: On a bank reconciled line, we can modify the bank receipt +NEW: parent company column and filter in invoice and order list +NEW: possibility to select scopes with checkbox for Oauth tokens +NEW: private and public note on user, thirdparty and contact list +NEW: Public counters feature +NEW: Saved token of OAUTH module are now encrypted into llx_oauth_token +NEW: Save one click to select on delivery ack, on emails. +NEW: scheduled job to send unpaid invoice reminder can now use the cc and bcc from email template +NEW: experimental SMTP using PhpImap allowing OAuth2 authentication (need to add option MAIN_IMAP_USE_PHPIMAP) +NEW: can substitue project title in mail template +NEW: The purge of files can purge only if older than a number of seconds +NEW: Update ActionComm type_code on email message ticket +NEW: Finance - VAT - Admin - Add information on deadline day for submission of VAT declaration +NEW: Add the target to select attendees of event for emailings NEW: add redirect on action confirm addconsumedline and addproduceline -NEW: Add a new advanced permission "read price" -NEW: Add substitution key __SENDEREMAIL_SIGNATURE__ NEW: Add the referrer-policy to "same-origin" by default on all public pages. -NEW: Add the SMTP header References on ticket email created by email NEW: Add trigger to record the event of sending an email from a project #20912 -NEW: Allow download link option in module configuration (propal,invoice,supplier proposal, order) -NEW: Can enter the unit price including the vat +NEW: Allow download link option in module configuration (propal, order, invoice, supplier proposal) +NEW: Can enter the unit price including the VAT NEW: Can invoice task time per different services -NEW: Can join several files by default on email form NEW: Can set a commercial discount by entering amount including VAT -NEW: Can set a monthly frequency (or multiple) in cron tasks. NEW: Can set start and end dates and comment on button "Activate all services" NEW: can sort and preselected best supplier price -NEW: Can use products categories to make inventory -NEW: Change filter type on tickets list into a multiselect combo NEW: show date delivery planned on orders linked to company and product -NEW: Encrypt all sensitive constants in llx_const NEW: filter on reception dates (from / to) in cheque paiement card + NEW: Accountancy - Add a graphic option to enable lettering function - FPC21 NEW: Accountancy - Add a way to clean some words when you generate thirdparty accounting account NEW: Accountancy - Added an option during export to export or not the lettering FPC21 NEW: Accountancy - Manage supplier deposit with specific account NEW: Accountancy - Model Digitaria - Add a way to clean some words when you generate thirdparty accounting account FPC22 +NEW: Agenda - start a simple support of recurrent events on agenda NEW: Bank - add salaries & VAT in tab planned entries -NEW: Contracts - Default template of contract is not mandatory +NEW: Contracts - add a method doAutoRenewContracts that can be used as a cron task +NEW: Contracts - default template of contract is not mandatory NEW: Contracts - Manage Position (Rank) on Contract Lines NEW: EMail - can copy/paste images into emails sent NEW: EMail - can edit label of an emailing even once sent +NEW: EMail - can join several files by default on email form NEW: EMail - can send an email on scheduled job error +NEW: EMail - on a form to send an email, we show all emails of all contacts of object +NEW: EMail - add the SMTP header References on ticket email created by email +NEW: EMail - add substitution key __SENDEREMAIL_SIGNATURE__ NEW: EMail-Collector - add IMAP port setting NEW: EMail-Collector - add a button "Test collect" +NEW: Export - Add " as enclosure by default for CSV export. Keep removing CR/LF. NEW: Event-Organization - add date event (!= date project) and location on event organization NEW: Extrafields - add badge in admin extrafields setup NEW: Extrafields - can edit property css, cssview, csslist on extrafields @@ -111,8 +122,10 @@ NEW: Invoice - Add french mention on pdf when vat debit option is on NEW: Members - default_lang for members NEW: Members - Table of membership types NEW: Members - add free membership amounts at the membership type level +NEW: Orders - resize parent company column in order list +NEW: Products supplier price - autofill default supplier VAT NEW: Projects - add author on list -NEW: Projects - add the thirdparty column to the time list (projet/tasks/time.php) +NEW: Projects - add thirdparty column to the time list (projet/tasks/time.php) NEW: Proposals - show delivery mode on PDF for proposals NEW: Proposals - skip accept/refuse process for proposals (option PROPAL_SKIP_ACCEPT_REFUSE) NEW: Reception - add a from/to on search on date field @@ -120,64 +133,55 @@ NEW: Stock - page for mass stock transfer can be used with no source stock NEW: Stock - product categories filter on inventory list NEW: Stock - show product label on inventory NEW: Stock - manage virtual stock at a future date +NEW: Stock Inventory - add filter "Product subject to lot/Serial" in stock per lot/serial +NEW: Stock Inventory - can use products categories to make inventory +NEW: Supplier Order List - add column private and public note NEW: TakePOS - add margin infos to TakePOS invoice lines -NEW: TakePOS - display currency in TakePOS menu -NEW: TakePOS - Header Scroll in TakePOS NEW: TakePOS - add price to product box in TakePOS NEW: TakePOS - add setup parameters, can setup terminal name -NEW: TakePOS - support of Stripe Terminal with TakePOS -NEW: TakePOS - Receipt preview in TakePOS setup NEW: TakePOS - different product list on smartphone +NEW: TakePOS - display currency in TakePOS menu +NEW: TakePOS - Header Scroll in TakePOS +NEW: TakePOS - Receipt preview in TakePOS setup +NEW: TakePOS - support of Stripe Terminal with TakePOS NEW: Thirdparty - set thirdparty type with company modify trigger +NEW: Tickets - change filter type on tickets list into a multiselect combo NEW: Website - can delete a whole website if disabled NEW: Website - can remove a website template NEW: Website - can set header "Strict-Transport-Security" in web sites. NEW: Website - can switch status of website and page from the website toolbar NEW: Website - Templates of websites are now directories and not zip into core repo NEW: Website - add 4 other templates in website module -NEW: General - Bulk action to remove a category in list/search website pages -NEW: General - If we select another view list mode, we keep it -NEW: General - Introduce dolEncrypt and dolDecrypt to be able to encrypt data in db -NEW: invoice export : add accounting affectation -NEW: label on products categories filter -NEW: The link "add to bookmark" is always on top in the bookmark popup -NEW: manage no email with thirdparties (better for GDPR) -NEW: Manage VAT on all lines on purchases cycle -NEW: On a bank reconciled line, we can modify the bank receipt -NEW: On a form to send an email, we show all emails of all contacts of object -NEW: parent company column and filter in invoice and order list -NEW: Add show "Sales rep" option for PDF -NEW: Picto for shared link is clickable -NEW: possibility to select scopes with checkbox for Oauth tokens -NEW: private and public note on user, thirdparty and contact list -NEW: Product supplier price: autofill default supplier VAT -NEW: Public counters feature -NEW: Start a simple support of recurrent events on agenda -NEW: Resize parent company column in order list -NEW: Saved token of OAUTH module are now encrypted into llx_oauth_token -NEW: Save one click to select on delivery ack, on emails. -NEW: scheduled job to send unpaid invoice reminder can now use the cc and bcc from email template -NEW: Show also scheduled task never finished in scheduled task widget -NEW: show badge with number of extrafields in setup -NEW: show category tree in sellist and chkbxlst for common object -NEW: Show picto and color into combo for selection of tags -NEW: show sell-by and eat-by dates only if not empty -NEW: show SellBy/EatBy dates for each batch product in shipment card -NEW: experimental SMTP using PhpImap allowing OAuth2 authentication (need to add option MAIN_IMAP_USE_PHPIMAP) -NEW: can substitue project title in mail template -NEW: Supplier order list - Add column private and public note -NEW: The purge of files can purge only if older than a number of seconds -NEW: Update ActionComm type_code on email message ticket -NEW: VAT - Admin - Add information on deadline day for submission of VAT declaration -NEW: expand/collapse permissions on user permission page -NEW: Add the target to select attendees of event for emailings + +General: +NEW: Actions: Bulk action to remove a category in list/search website pages +NEW: Cronjobs: can set a monthly frequency (or multiple) in cron tasks +NEW: Database: Encrypt all sensitive constants in llx_const +NEW: Database: Add performance index (name for company and contact) and llx_bank_url(url_id) +NEW: Database: Introduce dolEncrypt and dolDecrypt to be able to encrypt data in db +NEW: GUI: If we select another view list mode, we keep it +NEW: GUI: the link "add to bookmark" is always on top in the bookmark popup +NEW: GUI: Picto for shared link is clickable +NEW: GUI: add picto property on sub-module for password generation +NEW: GUI: show also scheduled task never finished in scheduled task widget +NEW: GUI: show badge with number of extrafields in setup +NEW: GUI: show category tree in sellist and chkbxlst for common object +NEW: GUI: show picto and color into combo for selection of tags +NEW: GUI: show sell-by and eat-by dates only if not empty +NEW: GUI: show SellBy/EatBy dates for each batch product in shipment card +NEW: GUI/Permissions: expand/collapse permissions on user permission page +NEW: Permissions: add a new advanced permission "read price" +NEW: Print: add show "Sales rep" option for PDF +NEW: Security: add fail2ban rules examples to limit access to /public pages Option / Const for System: -NEW: MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS const to show category customer filter -NEW: PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT showing warehouse on PDF -NEW: PRODUIT_DESC_IN_FORM accept (desktop only or +smartphone) +NEW: FICHINTER_ALLOW_EXTERNAL_DOWNLOAD +NEW: MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS - const to show category customer filter +NEW: PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT - showing warehouse on PDF +NEW: PRODUIT_DESC_IN_FORM accept - desktop only or +smartphone +NEW: PROPAL_BYPASS_VALIDATED_STATUS NEW: PROPAL_NEW_AS_SIGNED -NEW: TIMESPENT_ALWAYS_UPDATE_THM, when it's on we always check current thm of user to update it in task time line +NEW: TIMESPENT_ALWAYS_UPDATE_THM - when it's on we always check current thm of user to update it in task time line Localisation: NEW: adding JAPAN Chart-of-Account and regions/departments @@ -207,7 +211,7 @@ NEW: support multilang in Civilities API Hooks: NEW: Actioncomm - add new hooks for actioncomm -NEW: Actioncomm - hook formConfirm on action comm card +NEW: Actioncomm - hook formConfirm on actioncomm card NEW: Agenda - hook on agenda pages NEW: Help - hook "changeHelpURL" to modify target of the help button NEW: Product - add hook to show virtual stock details on product stock card diff --git a/doc/images/dolibarr_screenshot12_1280x800.jpg b/doc/images/dolibarr_screenshot12_1280x800.jpg new file mode 100644 index 00000000000..bdc3a137228 Binary files /dev/null and b/doc/images/dolibarr_screenshot12_1280x800.jpg differ diff --git a/doc/images/dolibarr_screenshot1_1280x800.jpg b/doc/images/dolibarr_screenshot1_1280x800.jpg index ac238d39c1f..6d2c4312394 100644 Binary files a/doc/images/dolibarr_screenshot1_1280x800.jpg and b/doc/images/dolibarr_screenshot1_1280x800.jpg differ diff --git a/doc/images/dolibarr_screenshot2_1280x800.jpg b/doc/images/dolibarr_screenshot2_1280x800.jpg index 2956a55d36a..7f5319942c2 100644 Binary files a/doc/images/dolibarr_screenshot2_1280x800.jpg and b/doc/images/dolibarr_screenshot2_1280x800.jpg differ diff --git a/doc/images/dolibarr_screenshot4_1280x800.jpg b/doc/images/dolibarr_screenshot4_1280x800.jpg new file mode 100644 index 00000000000..d6705363129 Binary files /dev/null and b/doc/images/dolibarr_screenshot4_1280x800.jpg differ diff --git a/doc/images/dolibarr_screenshot5_1280x800.jpg b/doc/images/dolibarr_screenshot5_1280x800.jpg index 6eea0a2f029..f9ddd1d1f77 100644 Binary files a/doc/images/dolibarr_screenshot5_1280x800.jpg and b/doc/images/dolibarr_screenshot5_1280x800.jpg differ diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index ecd5668beb5..23bb513a85b 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -493,7 +493,7 @@ if (empty($reshook)) { if ($conf->global->ACCOUNTING_REEXPORT == 1) { setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'mesgs'); } else { - setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'mesgs'); + setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'warnings'); } } else { setEventMessages($langs->trans("Error"), null, 'errors'); @@ -1002,11 +1002,14 @@ $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; if (empty($reshook)) { // Button re-export if (!empty($conf->global->ACCOUNTING_REEXPORT)) { - $newcardbutton .= ''.img_picto($langs->trans("Activated"), 'switch_on').' '; + $newcardbutton .= ''.img_picto($langs->trans("ClickToHideAlreadyExportedLines"), 'switch_off', 'class="small size15x valignmiddle"'); + $newcardbutton .= ''.$langs->trans("ClickToHideAlreadyExportedLines").''; + $newcardbutton .= ''; } else { - $newcardbutton .= ''.img_picto($langs->trans("Disabled"), 'switch_off').' '; + $newcardbutton .= ''.img_picto($langs->trans("DocsAlreadyExportedAreExcluded"), 'switch_on', 'class="warning size15x valignmiddle"').''; + $newcardbutton .= ''.$langs->trans("DocsAlreadyExportedAreExcluded").''; + $newcardbutton .= ''; } - $newcardbutton .= ''.$langs->trans("IncludeDocsAlreadyExported").''; if ($user->hasRight('accounting', 'mouvements', 'export')) { $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : ''), $user->hasRight('accounting', 'mouvements', 'export')); @@ -1040,7 +1043,7 @@ if ($massaction == 'preunletteringauto') { include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields if ($massactionbutton && $contextpage != 'poslist') { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } @@ -1066,7 +1069,7 @@ print $moreforfilter; print ''; print '
| '.dol_print_date($facture_static->date, 'day').' | '; // Ref Product - print ''; + print ' | '; if ($product_static->id > 0) { print $product_static->getNomUrl(1); } @@ -649,7 +648,7 @@ if ($result) { } print ' | '; - // Description + // Description of line print ''; $text = dolGetFirstLineOfText(dol_string_nohtmltag($facture_static_det->desc, 1)); $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; @@ -683,15 +682,22 @@ if ($result) { // Found accounts print ' | ';
+ // First show default account for any products
$s = '1. '.(($facture_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
- $shelp = '';
+ $shelp = ''; $ttype = 'help';
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
$shelp .= $langs->trans("SaleEEC");
+ } elseif ($suggestedaccountingaccountbydefaultfor == 'eecwithvat') {
+ $shelp = $langs->trans("SaleEECWithVAT");
+ } elseif ($suggestedaccountingaccountbydefaultfor == 'eecwithoutvatnumber') {
+ $shelp = $langs->trans("SaleEECWithoutVATNumber");
+ $ttype = 'warning';
} elseif ($suggestedaccountingaccountbydefaultfor == 'export') {
$shelp .= $langs->trans("SaleExport");
}
$s .= ($code_sell_l > 0 ? length_accountg($code_sell_l) : ''.$langs->trans("NotDefined").'');
- print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
+ print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1);
+ // Now show account for product
if ($product_static->id > 0) {
print ' '; $s = '2. '.(($facture_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 0929c9c9e24..339ffe68b96 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -58,6 +58,8 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); +$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); + // Security check if (!isModEnabled('accounting')) { accessforbidden(); @@ -65,7 +67,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } @@ -74,7 +76,7 @@ if (empty($user->rights->accounting->mouvements->lire)) { * Actions */ -if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) { +if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) { // Clean database $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd"; @@ -110,8 +112,7 @@ if ($action == 'validatehistory') { $sql1 = "SELECT erd.rowid, accnt.rowid as suggestedid"; $sql1 .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd"; $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as t ON erd.fk_c_type_fees = t.id"; - $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as accnt ON t.accountancy_code = accnt.account_number AND accnt.active = 1 AND accnt.entity =".((int) $conf->entity); - $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as syst ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) $conf->global->CHARTOFACCOUNTS).' AND syst.active = 1,'; + $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as accnt ON t.accountancy_code = accnt.account_number AND accnt.active = 1 AND accnt.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND accnt.entity =".((int) $conf->entity); $sql1 .= " ".MAIN_DB_PREFIX."expensereport as er"; $sql1 .= " WHERE erd.fk_expensereport = er.rowid AND er.entity = ".((int) $conf->entity); $sql1 .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0"; @@ -182,6 +183,7 @@ llxHeader('', $langs->trans("ExpenseReportsVentilation")); $textprevyear = ''.img_previous().''; $textnextyear = ' '.img_next().''; + print load_fiche_titre($langs->trans("ExpenseReportsVentilation")." ".$textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, '', 'title_accountancy'); print ''.$langs->trans("DescVentilExpenseReport").' '; @@ -253,7 +255,7 @@ $sql .= " AND aa.account_number IS NULL"; $sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label"; $sql .= ' ORDER BY aa.account_number'; -dol_syslog('/accountancy/expensereport/index.php:: sql='.$sql); +dol_syslog('/accountancy/expensereport/index.php', LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 25b86a8d527..1cf9149024a 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -40,10 +40,9 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'expensereportlist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancyexpensereportlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -419,8 +418,8 @@ if ($result) { print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall '); - print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', ''); + print_liste_field_titre("DataUsedToSuggestAccount", '', '', '', '', '', '', '', 'nowraponall '); + print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', ''); $checkpicto = ''; if ($massactionbutton) { $checkpicto = $form->showCheckAddButtons('checkforselect', 1); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 3b8e93cb54b..aae34a51e03 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -44,10 +44,11 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancysupplierlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); + $default_account = GETPOST('default_account', 'int'); // Select Box @@ -75,8 +76,6 @@ $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_en $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); -$btn_ventil = GETPOST('ventil', 'alpha'); - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -112,7 +111,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (empty($user->rights->accounting->mouvements->lire)) { +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { accessforbidden(); } @@ -532,8 +531,8 @@ if ($result) { print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall '); - print_liste_field_titre("IntoAccount", '', '', '', '', '', '', '', 'center '); + print_liste_field_titre("DataUsedToSuggestAccount", '', '', '', '', '', '', '', 'nowraponall '); + print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'center '); $checkpicto = ''; if ($massactionbutton) { $checkpicto = $form->showCheckAddButtons('checkforselect', 1); @@ -712,14 +711,19 @@ if ($result) { // Found accounts print ' | ';
$s = '1. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
- $shelp = '';
+ $shelp = ''; $ttype = 'help';
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
$shelp .= $langs->trans("SaleEEC");
+ } elseif ($suggestedaccountingaccountbydefaultfor == 'eecwithvat') {
+ $shelp = $langs->trans("SaleEECWithVAT");
+ } elseif ($suggestedaccountingaccountbydefaultfor == 'eecwithoutvatnumber') {
+ $shelp = $langs->trans("SaleEECWithoutVATNumber");
+ $ttype = 'warning';
} elseif ($suggestedaccountingaccountbydefaultfor == 'export') {
$shelp .= $langs->trans("SaleExport");
}
$s .= ($code_buy_l > 0 ? length_accountg($code_buy_l) : ''.$langs->trans("NotDefined").'');
- print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
+ print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1);
if ($product_static->id > 0) {
print ' '; $s = '2. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 72db71d07bd..ed2fa05cf51 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -171,4 +171,82 @@ class AdherentStats extends Stats return $this->_getAllByYear($sql); } + + + + /** + * Return count of member by status group by adh type, total and average + * + * @param int $numberYears Years to scan + * @return array Array with total of draft, pending, uptodate, expired, resiliated for each member tag + */ + public function countMembersByTagAndStatus($numberYears = 2) + { + global $user; + + $now = dol_now(); + $endYear = date('Y'); + $startYear = $endYear - $numberYears; + + $sql = "SELECT c.rowid as fk_categorie, c.label as label"; + $sql .= ", COUNT(".$this->db->ifsql("d.statut = ".Adherent::STATUS_DRAFT, "'members_draft'", 'NULL').") as members_draft"; + $sql .= ", COUNT(".$this->db->ifsql("d.statut = ".Adherent::STATUS_VALIDATED." AND (d.datefin IS NULL AND t.subscription = '1')", "'members_pending'", 'NULL').") as members_pending"; + $sql .= ", COUNT(".$this->db->ifsql("d.statut = ".Adherent::STATUS_VALIDATED." AND (d.datefin >= '".$this->db->idate($now)."' OR t.subscription = 0)", "'members_uptodate'", 'NULL').") as members_uptodate"; + $sql .= ", COUNT(".$this->db->ifsql("d.statut = ".Adherent::STATUS_VALIDATED." AND (d.datefin < '".$this->db->idate($now)."' AND t.subscription = 1)", "'members_expired'", 'NULL').") as members_expired"; + $sql .= ", COUNT(".$this->db->ifsql("d.statut = ".Adherent::STATUS_EXCLUDED, "'members_excluded'", 'NULL').") as members_excluded"; + $sql .= ", COUNT(".$this->db->ifsql("d.statut = ".Adherent::STATUS_RESILIATED, "'members_resiliated'", 'NULL').") as members_resiliated"; + $sql .= " FROM ".MAIN_DB_PREFIX."categorie as c"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as ct ON c.rowid = ct.fk_categorie"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as d ON d.rowid = ct.fk_member"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_type as t ON t.rowid = d.fk_adherent_type"; + $sql .= " WHERE c.entity IN (".getEntity('member_type').")"; + $sql .= " AND d.entity IN (" . getEntity('adherent') . ")"; + $sql .= " AND t.entity IN (" . getEntity('adherent') . ")"; + $sql .= " AND d.datefin > '".$this->db->idate(dol_get_first_day($startYear))."'"; + $sql .= " AND c.fk_parent = 0"; + $sql .= " GROUP BY c.rowid"; + + dol_syslog("box_members_by_type::select nb of members per type", LOG_DEBUG); + $result = $this->db->query($sql); + + if ($result) { + $num = $this->db->num_rows($result); + $i = 0; + $MembersCountArray = []; + $totalstatus = array( + 'label' => 'Total', + 'members_draft' => 0, + 'members_pending' => 0, + 'members_uptodate' => 0, + 'members_expired' => 0, + 'members_excluded' => 0, + 'members_resiliated' => 0 + ); + while ($i < $num) { + $objp = $this->db->fetch_object($result); + $MembersCountArray[$objp->fk_categorie] = array( + 'label' => $objp->label, + 'members_draft' => (int) $objp->members_draft, + 'members_pending' => (int) $objp->members_pending, + 'members_uptodate' => (int) $objp->members_uptodate, + 'members_expired' => (int) $objp->members_expired, + 'members_excluded' => (int) $objp->members_excluded, + 'members_resiliated' => (int) $objp->members_resiliated + ); + $totalrow = 0; + foreach ($MembersCountArray[$objp->fk_categorie] as $key=>$nb) { + if ($key!='label') { + $totalrow += $nb; + $totalstatus[$key] += $nb; + } + } + $MembersCountArray[$objp->fk_categorie]['total_adhtype'] = $totalrow; + $i++; + } + $this->db->free($result); + $MembersCountArray['total'] = $totalstatus; + $MembersCountArray['total']['all'] = array_sum($totalstatus); + } + return $MembersCountArray; + } } diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d06d91cbea6..2e04aba9167 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -30,9 +30,9 @@ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.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.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -41,47 +41,51 @@ $langs->loadLangs(array("members", "companies")); // Get parameters -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); -$confirm = GETPOST('confirm', 'alpha'); -$toselect = GETPOST('toselect', 'array'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search -$mode = GETPOST('mode', 'alpha'); - +$backtopage = GETPOST('backtopage', 'alpha'); +$optioncss = GETPOST('optioncss', 'aZ'); +$mode = GETPOST('mode', 'alpha'); // Search fields -$search = GETPOST("search", 'alpha'); -$search_ref = GETPOST("search_ref", 'alpha'); -$search_lastname = GETPOST("search_lastname", 'alpha'); -$search_firstname = GETPOST("search_firstname", 'alpha'); -$search_gender = GETPOST("search_gender", 'alpha'); -$search_civility = GETPOST("search_civility", 'alpha'); -$search_company = GETPOST('search_company', 'alphanohtml'); -$search_login = GETPOST("search_login", 'alpha'); -$search_address = GETPOST("search_address", 'alpha'); -$search_zip = GETPOST("search_zip", 'alpha'); -$search_town = GETPOST("search_town", 'alpha'); -$search_state = GETPOST("search_state", 'alpha'); -$search_country = GETPOST("search_country", 'alpha'); -$search_phone = GETPOST("search_phone", 'alpha'); +$search = GETPOST("search", 'alpha'); +$search_ref = GETPOST("search_ref", 'alpha'); +$search_lastname = GETPOST("search_lastname", 'alpha'); +$search_firstname = GETPOST("search_firstname", 'alpha'); +$search_gender = GETPOST("search_gender", 'alpha'); +$search_civility = GETPOST("search_civility", 'alpha'); +$search_company = GETPOST('search_company', 'alphanohtml'); +$search_login = GETPOST("search_login", 'alpha'); +$search_address = GETPOST("search_address", 'alpha'); +$search_zip = GETPOST("search_zip", 'alpha'); +$search_town = GETPOST("search_town", 'alpha'); +$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state +$search_country = GETPOST("search_country", 'alpha'); +$search_phone = GETPOST("search_phone", 'alpha'); $search_phone_perso = GETPOST("search_phone_perso", 'alpha'); $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); -$search_type = GETPOST("search_type", 'alpha'); -$search_email = GETPOST("search_email", 'alpha'); -$search_categ = GETPOST("search_categ", 'int'); -$search_filter = GETPOST("search_filter", 'alpha'); -$search_status = GETPOST("search_status", 'intcomma'); -$search_morphy = GETPOST("search_morphy", 'alpha'); +$search_type = GETPOST("search_type", 'alpha'); +$search_email = GETPOST("search_email", 'alpha'); +$search_categ = GETPOST("search_categ", 'int'); +$search_morphy = GETPOST("search_morphy", 'alpha'); $search_import_key = trim(GETPOST("search_import_key", 'alpha')); -$catid = GETPOST("catid", 'int'); -$optioncss = GETPOST('optioncss', 'alpha'); -$socid = GETPOST('socid', 'int'); + +$catid = GETPOST("catid", 'int'); +$socid = GETPOST('socid', 'int'); + +$search_filter = GETPOST("search_filter", 'alpha'); +$search_status = GETPOST("search_status", 'intcomma'); // statut $filter = GETPOST("filter", 'alpha'); if ($filter) { $search_filter = $filter; // For backward compatibility } + $statut = GETPOST("statut", 'alpha'); if ($statut != '') { $search_status = $statut; // For backward compatibility @@ -93,6 +97,7 @@ if ($search_status < -2) { $search_status = ''; } +// Pagination parameters $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 79c42f6e2db..b366ea928ef 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -117,7 +117,7 @@ if ($action == 'updateMask') { } elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->COMMANDE_ADDON_PDF == "$value") { + if (getDolGlobalString('COMMANDE_ADDON_PDF') == $value) { dolibarr_del_const($db, 'COMMANDE_ADDON_PDF', $conf->entity); } } @@ -461,7 +461,7 @@ foreach ($dirmodels as $reldir) { // Default print ' | '; - if ($conf->global->COMMANDE_ADDON_PDF == $name) { + if (getDolGlobalString('COMMANDE_ADDON_PDF') == $name) { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index e9171431187..fb496c1dce1 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -84,6 +84,8 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))) { * View */ +$form = new Form($db); + $wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('', $langs->trans("Setup"), $wikihelp); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index b6ce3d8b9a5..5a5c2f25c0e 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -165,14 +165,14 @@ if (empty($conf->use_javascript_ajax)) { $constante = 'FCKEDITOR_ENABLE_'.$const; print ''."\n"; print ' | ||||||||||||||||||||||||||||||||||||||||||||
| '.img_object("", $picto[$const]).' | '; + print ''.img_object("", $picto[$const]).' | '; print '';
print $langs->trans($desc);
if ($const == 'DETAILS') {
print ' '.$langs->trans("FCKeditorForProductDetails2").''; } print ' | ';
- print ''; + print ' | '; $value = (isset($conf->global->$constante) ? $conf->global->$constante : 0); if ($value == 0) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 217dfd63cc9..8c082d674db 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -48,6 +48,8 @@ $action = GETPOST('action', 'aZ09'); $provider = GETPOST('provider', 'aZ09'); $label = GETPOST('label', 'aZ09'); +$servicetoeditname = GETPOST('servicetoeditname', 'aZ09'); + $error = 0; @@ -72,15 +74,24 @@ if ($action == 'update') { foreach ($conf->global as $key => $val) { if (!empty($val) && preg_match('/^OAUTH_.+_ID$/', $key)) { $constvalue = str_replace('_ID', '', $key); - if (!dolibarr_set_const($db, $constvalue.'_ID', GETPOST($constvalue.'_ID'), 'chaine', 0, '', $conf->entity)) { - $error++; + $newconstvalue = $constvalue; + if (GETPOSTISSET($constvalue.'_NAME')) { + $newconstvalue = preg_replace('/-.*$/', '', $constvalue).'-'.GETPOST($constvalue.'_NAME'); + } + + if (GETPOSTISSET($constvalue.'_ID')) { + if (!dolibarr_set_const($db, $newconstvalue.'_ID', GETPOST($constvalue.'_ID'), 'chaine', 0, '', $conf->entity)) { + $error++; + } } // If we reset this provider, we also remove the secret - if (!dolibarr_set_const($db, $constvalue.'_SECRET', GETPOST($constvalue.'_ID') ? GETPOST($constvalue.'_SECRET') : '', 'chaine', 0, '', $conf->entity)) { - $error++; + if (GETPOSTISSET($constvalue.'_SECRET')) { + if (!dolibarr_set_const($db, $newconstvalue.'_SECRET', GETPOST($constvalue.'_ID') ? GETPOST($constvalue.'_SECRET') : '', 'chaine', 0, '', $conf->entity)) { + $error++; + } } if (GETPOSTISSET($constvalue.'_URLAUTHORIZE')) { - if (!dolibarr_set_const($db, $constvalue.'_URLAUTHORIZE', GETPOST($constvalue.'_URLAUTHORIZE'), 'chaine', 0, '', $conf->entity)) { + if (!dolibarr_set_const($db, $newconstvalue.'_URLAUTHORIZE', GETPOST($constvalue.'_URLAUTHORIZE'), 'chaine', 0, '', $conf->entity)) { $error++; } } @@ -90,14 +101,46 @@ if ($action == 'update') { } else { $scopestring = GETPOST($constvalue.'_SCOPE'); } - if (!dolibarr_set_const($db, $constvalue.'_SCOPE', $scopestring, 'chaine', 0, '', $conf->entity)) { + if (!dolibarr_set_const($db, $newconstvalue.'_SCOPE', $scopestring, 'chaine', 0, '', $conf->entity)) { $error++; } - } else { - if (!dolibarr_set_const($db, $constvalue.'_SCOPE', '', 'chaine', 0, '', $conf->entity)) { + } elseif ($newconstvalue !== $constvalue) { + if (!dolibarr_set_const($db, $newconstvalue.'_SCOPE', '', 'chaine', 0, '', $conf->entity)) { $error++; } } + + // If name changed, we have to delete old const and proceed few other changes + if ($constvalue !== $newconstvalue) { + dolibarr_del_const($db, $constvalue.'_ID', $conf->entity); + dolibarr_del_const($db, $constvalue.'_SECRET', $conf->entity); + dolibarr_del_const($db, $constvalue.'_URLAUTHORIZE', $conf->entity); + dolibarr_del_const($db, $constvalue.'_SCOPE', $conf->entity); + + // Update name of token + $oldname = preg_replace('/^OAUTH_/', '', $constvalue); + $oldprovider = ucfirst(strtolower(preg_replace('/-.*$/', '', $oldname))); + $oldlabel = preg_replace('/^.*-/', '', $oldname); + $newlabel = preg_replace('/^.*-/', '', $newconstvalue); + + + $sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token"; + $sql.= " SET service = '".$db->escape($oldprovider."-".$newlabel)."'"; + $sql.= " WHERE service = '".$db->escape($oldprovider."-".$oldlabel)."'"; + + + $resql = $db->query($sql); + if (!$resql) { + $error++; + } + + // Update const where the token was used, might not be exhaustive + if (getDolGlobalString('MAIN_MAIL_SMTPS_OAUTH_SERVICE') == $oldname) { + if (!dolibarr_set_const($db, 'MAIN_MAIL_SMTPS_OAUTH_SERVICE', strtoupper($oldprovider).'-'.$newlabel, 'chaine', 0, '', $conf->entity)) { + $error++; + } + } + } } } @@ -270,11 +313,16 @@ if (count($listinsetup) > 0) { } else { print $label; } - if ($keyforprovider) { + if ($servicetoeditname == $key[0]) { + print ' ()'; + } elseif ($keyforprovider) { print ' ('.$keyforprovider.')'; } else { print ' ('.$langs->trans("NoName").')'; } + if (!($servicetoeditname == $key[0])) { + print ''.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; + } print ' | '; print '';
if (!empty($supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials'])) {
diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php
index e06cdeb0312..c79a3e63653 100644
--- a/htdocs/api/class/api_setup.class.php
+++ b/htdocs/api/class/api_setup.class.php
@@ -1682,6 +1682,68 @@ class Setup extends DolibarrApi
return $list;
}
+ /**
+ * Get the list of incoterms.
+ *
+ * @param string $sortfield Sort field
+ * @param string $sortorder Sort order
+ * @param int $limit Number of items per page
+ * @param int $page Page number (starting from zero)
+ * @param int $active Payment term is active or not {@min 0} {@max 1}
+ * @param string $lang Code of the language the label of the type must be translated to
+ * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
+ * @return array List of incoterm types
+ *
+ * @url GET dictionary/incoterms
+ *
+ * @throws RestException
+ */
+ public function getListOfIncoterms($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
+ {
+ $list = array();
+
+ $sql = "SELECT rowid, code, active";
+ $sql .= " FROM ".MAIN_DB_PREFIX."c_incoterms as t";
+ $sql .= " WHERE 1=1";
+
+ // Add sql filters
+ if ($sqlfilters) {
+ $errormessage = '';
+ if (!DolibarrApi::_checkFilters($sqlfilters, $errormessage)) {
+ throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
+ }
+ $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^\(\)]+)\)';
+ $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
+ }
+
+
+ $sql .= $this->db->order($sortfield, $sortorder);
+
+ if ($limit) {
+ if ($page < 0) {
+ $page = 0;
+ }
+ $offset = $limit * $page;
+
+ $sql .= $this->db->plimit($limit, $offset);
+ }
+
+ $result = $this->db->query($sql);
+
+ if ($result) {
+ $num = $this->db->num_rows($result);
+ $min = min($num, ($limit <= 0 ? $num : $limit));
+ for ($i = 0; $i < $min; $i++) {
+ $type =$this->db->fetch_object($result);
+ $list[] = $type;
+ }
+ } else {
+ throw new RestException(503, 'Error when retrieving list of incoterm types : '.$this->db->lasterror());
+ }
+
+ return $list;
+ }
+
/**
* Get properties of company
*
diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php
index 373effecbe8..56361b948f0 100644
--- a/htdocs/barcode/printsheet.php
+++ b/htdocs/barcode/printsheet.php
@@ -226,7 +226,7 @@ if ($action == 'builddoc') {
'code'=>$code,
'encoding'=>$encoding,
'is2d'=>$is2d,
- 'photo'=>$barcodeimage // Photo must be a file that exists with format supported by TCPDF
+ 'photo'=>!empty($barcodeimage) ? $barcodeimage : '' // Photo must be a file that exists with format supported by TCPDF
);
}
} else {
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 333b6232f9f..fbced8e6773 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -358,11 +358,11 @@ if (empty($reshook)) {
// Confirmation to delete
if ($action == 'delete') {
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBillOfMaterials'), $langs->trans('ConfirmDeleteBillOfMaterials'), 'confirm_delete', '', 0, 1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteBillOfMaterials'), $langs->trans('ConfirmDeleteBillOfMaterials'), 'confirm_delete', '', 0, 1);
}
// Confirmation to delete line
if ($action == 'deleteline') {
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
}
// Confirmation of validation
@@ -393,13 +393,13 @@ if (empty($reshook)) {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
}
$formquestion = array(
- // 'text' => $langs->trans("ConfirmClone"),
- // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
- // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
+ // 'text' => $langs->trans("ConfirmClone"),
+ // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
+ // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
);
}
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Validate'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Validate'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
}
// Confirmation of closing
@@ -421,13 +421,13 @@ if (empty($reshook)) {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
}
$formquestion = array(
- // 'text' => $langs->trans("ConfirmClone"),
- // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
- // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
+ // 'text' => $langs->trans("ConfirmClone"),
+ // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
+ // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
);
}
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Close'), $text, 'confirm_close', $formquestion, 0, 1, 220);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Close'), $text, 'confirm_close', $formquestion, 0, 1, 220);
}
// Confirmation of reopen
@@ -444,26 +444,26 @@ if (empty($reshook)) {
$formquestion = array();
if (isModEnabled('bom')) {
$langs->load("mrp");
- require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$forcecombo = 0;
if ($conf->browser->name == 'ie') {
$forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
}
$formquestion = array(
- // 'text' => $langs->trans("ConfirmClone"),
- // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
- // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
+ // 'text' => $langs->trans("ConfirmClone"),
+ // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
+ // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
);
}
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $text, 'confirm_reopen', $formquestion, 0, 1, 220);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $text, 'confirm_reopen', $formquestion, 0, 1, 220);
}
// Clone confirmation
if ($action == 'clone') {
// Create an array for form
$formquestion = array();
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneBillOfMaterials', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneBillOfMaterials', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
}
// Confirmation of action xxxx
@@ -471,7 +471,7 @@ if (empty($reshook)) {
$text = $langs->trans('ConfirmSetToDraft', $object->ref);
$formquestion = array();
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetToDraft'), $text, 'confirm_setdraft', $formquestion, 0, 1, 220);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetToDraft'), $text, 'confirm_setdraft', $formquestion, 0, 1, 220);
}
// Call Hook formConfirm
@@ -489,7 +489,7 @@ if (empty($reshook)) {
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = '' . $langs->trans("BackToList") . '';
$morehtmlref = ' ';
/*
@@ -538,17 +538,17 @@ if (empty($reshook)) {
print ' ';
print ' ';
print '';
- print '
';
@@ -602,7 +601,7 @@ if (empty($reshook)) {
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
- $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
+ $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
}
}
@@ -652,7 +651,7 @@ if (empty($reshook)) {
$reshook = $hookmanager->executeHooks('formAddObjectServiceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
- $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
+ $object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
}
}
}
@@ -665,146 +664,146 @@ if (empty($reshook)) {
print "\n";
mrpCollapseBomManagement();
- }
- $res = $object->fetchLines();
+ $res = $object->fetchLines();
- // Buttons for actions
+ // Buttons for actions
- if ($action != 'presend' && $action != 'editline') {
- print ' '."\n";
- $parameters = array();
- $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- if ($reshook < 0) {
- setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- }
-
- if (empty($reshook)) {
- // Send
- //if (empty($user->socid)) {
- // print 'id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . ''."\n";
- //}
-
- // Back to draft
- if ($object->status == $object::STATUS_VALIDATED) {
- if ($permissiontoadd) {
- print ''.$langs->trans("SetToDraft").''."\n";
- }
+ if ($action != 'presend' && $action != 'editline') {
+ print ' '."\n";
+
+
+ // Select mail models is same action as presend
+ if (GETPOST('modelselected')) {
+ $action = 'presend';
+ }
+
+ if ($action != 'presend') {
+ print '' . "\n";
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
- // Modify
- if ($object->status == $object::STATUS_DRAFT) {
- if ($permissiontoadd) {
- print 'id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").''."\n";
- } else {
- print ''.$langs->trans('Modify').''."\n";
- }
- }
+ if (empty($reshook)) {
+ // Send
+ //if (empty($user->socid)) {
+ // print 'id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . ''."\n";
+ //}
- // Validate
- if ($object->status == $object::STATUS_DRAFT) {
- if ($permissiontoadd) {
- if (is_array($object->lines) && count($object->lines) > 0) {
- print ''.$langs->trans("Validate").''."\n";
- } else {
- $langs->load("errors");
- print ''.$langs->trans("Validate").''."\n";
+ // Back to draft
+ if ($object->status == $object::STATUS_VALIDATED) {
+ if ($permissiontoadd) {
+ print '' . $langs->trans("SetToDraft") . '' . "\n";
}
}
- }
- // Re-open
- if ($permissiontoadd && $object->status == $object::STATUS_CANCELED) {
- print ''.$langs->trans("ReOpen").''."\n";
- }
-
- // Create MO
- if (isModEnabled('mrp')) {
- if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write)) {
- print 'id).'">'.$langs->trans("CreateMO").''."\n";
+ // Modify
+ if ($object->status == $object::STATUS_DRAFT) {
+ if ($permissiontoadd) {
+ print 'id . '&action=edit&token=' . newToken() . '">' . $langs->trans("Modify") . '' . "\n";
+ } else {
+ print '' . $langs->trans('Modify') . '' . "\n";
+ }
}
- }
- // Clone
- if ($permissiontoadd) {
- print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : "").'&action=clone&object=bom', 'clone', $permissiontoadd);
- }
+ // Validate
+ if ($object->status == $object::STATUS_DRAFT) {
+ if ($permissiontoadd) {
+ if (is_array($object->lines) && count($object->lines) > 0) {
+ print '' . $langs->trans("Validate") . '' . "\n";
+ } else {
+ $langs->load("errors");
+ print '' . $langs->trans("Validate") . '' . "\n";
+ }
+ }
+ }
- // Close / Cancel
- if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED) {
- print ''.$langs->trans("Disable").''."\n";
- }
+ // Re-open
+ if ($permissiontoadd && $object->status == $object::STATUS_CANCELED) {
+ print '' . $langs->trans("ReOpen") . '' . "\n";
+ }
- /*
- if ($user->rights->bom->write)
- {
- if ($object->status == 1)
- {
- print 'id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").''."\n";
- }
- else
- {
- print 'id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").''."\n";
- }
- }
- */
+ // Create MO
+ if (isModEnabled('mrp')) {
+ if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write)) {
+ print 'id) . '">' . $langs->trans("CreateMO") . '' . "\n";
+ }
+ }
- // Delete
- print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
+ // Clone
+ if ($permissiontoadd) {
+ print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . (!empty($object->socid) ? '&socid=' . $object->socid : "") . '&action=clone&object=bom', 'clone', $permissiontoadd);
+ }
+
+ // Close / Cancel
+ if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED) {
+ print '' . $langs->trans("Disable") . '' . "\n";
+ }
+
+ /*
+ if ($user->rights->bom->write)
+ {
+ if ($object->status == 1)
+ {
+ print 'id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").''."\n";
+ }
+ else
+ {
+ print 'id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").''."\n";
+ }
+ }
+ */
+
+ // Delete
+ print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $permissiontodelete);
+ }
+ print ' ' . "\n";
}
- print '';
+ print ''; // ancre
+
+ // Documents
+ $objref = dol_sanitizeFileName($object->ref);
+ $relativepath = $objref . '/' . $objref . '.pdf';
+ $filedir = $conf->bom->dir_output . '/' . $objref;
+ $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
+ $genallowed = $user->rights->bom->read; // If you can read, you can build the PDF to read content
+ $delallowed = $user->rights->bom->write; // If you can create/edit, you can remove a file on card
+ print $formfile->showdocuments('bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
+
+ // Show links to link elements
+ $linktoelem = $form->showLinkToObjectBlock($object, null, array('bom'));
+ $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
+
+
+ print ' ';
+
+ $MAXEVENT = 10;
+
+ $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/bom/bom_agenda.php?id=' . $object->id);
+
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
+ $formactions = new FormActions($db);
+ $somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlcenter);
+
+ print ' ';
- print ''; // ancre
-
- // Documents
- $objref = dol_sanitizeFileName($object->ref);
- $relativepath = $objref.'/'.$objref.'.pdf';
- $filedir = $conf->bom->dir_output.'/'.$objref;
- $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = $user->rights->bom->read; // If you can read, you can build the PDF to read content
- $delallowed = $user->rights->bom->write; // If you can create/edit, you can remove a file on card
- print $formfile->showdocuments('bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
-
- // Show links to link elements
- $linktoelem = $form->showLinkToObjectBlock($object, null, array('bom'));
- $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
-
-
- print ' ';
-
- $MAXEVENT = 10;
-
- $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id);
-
- // List of actions on element
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
- $formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlcenter);
-
- print ' '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).' '."\n";
}
diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php
index 26d66ce0ca4..414faf2dc5a 100644
--- a/htdocs/bookcal/availabilities_list.php
+++ b/htdocs/bookcal/availabilities_list.php
@@ -470,7 +470,7 @@ if ($search_all) {
$fieldstosearchall[$key] = $langs->trans($val);
$setupstring .= $key."=".$val.";";
}
- print ''."\n";
+ print ''."\n";
print ''.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).' '."\n";
}
diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php
index 2e4fbfccd16..3c78ffea120 100644
--- a/htdocs/bookcal/booking_list.php
+++ b/htdocs/bookcal/booking_list.php
@@ -470,7 +470,7 @@ if ($search_all) {
$fieldstosearchall[$key] = $langs->trans($val);
$setupstring .= $key."=".$val.";";
}
- print ''."\n";
+ print ''."\n";
print ''.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).' '."\n";
}
diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php
index 2adef615a70..3eae08bb60a 100644
--- a/htdocs/bookmarks/list.php
+++ b/htdocs/bookmarks/list.php
@@ -29,15 +29,18 @@ require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
$langs->loadLangs(array('bookmarks', 'admin'));
// Get Parameters
-$action = GETPOST('action', 'aZ09');
+$id = GETPOST("id", 'int');
+
+$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
-$confirm = GETPOST('confirm', 'alpha');
-$toselect = GETPOST('toselect', 'array');
+$confirm = GETPOST('confirm', 'alpha');
+$cancel = GETPOST('cancel', 'alpha');
+$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
-$id = GETPOST("id", 'int');
-$optioncss = GETPOST('optioncss', 'alpha');
-$mode = GETPOST('mode', 'aZ09');
+$backtopage = GETPOST('backtopage', 'alpha');
+$optioncss = GETPOST('optioncss', 'alpha');
+$mode = GETPOST('mode', 'aZ09');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index e730243bfbf..9d84e205f2b 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -2048,7 +2048,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
}
if (!empty($contact_id) && $contact_id > 0) {
- if (!is_object($cachecontacts[$contact_id])) {
+ if (empty($cachecontacts[$contact_id]) || !is_object($cachecontacts[$contact_id])) {
$contact = new Contact($db);
$contact->fetch($contact_id);
$cachecontacts[$contact_id] = $contact;
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index 8807ccd4764..a0176ca18b0 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -33,18 +33,22 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
-include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
+
// Load translation files required by the page
$langs->loadLangs(array("users", "companies", "agenda", "commercial", "other", "orders", "bills"));
-$action = GETPOST('action', 'aZ09');
+// Get Parameters
+$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
+$confirm = GETPOST('confirm', 'alpha');
+$cancel = GETPOST('cancel', 'alpha');
+$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search
-$optioncss = GETPOST('optioncss', 'alpha');
-$toselect = GETPOST('toselect', 'array');
-$confirm = GETPOST('confirm', 'alpha');
+$optioncss = GETPOST('optioncss', 'alpha');
+
$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int');
@@ -70,6 +74,7 @@ if (GETPOST('search_actioncode', 'array')) {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
+// Search Fields
$search_id = GETPOST('search_id', 'alpha');
$search_title = GETPOST('search_title', 'alpha');
$search_note = GETPOST('search_note', 'alpha');
@@ -106,6 +111,7 @@ if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) {
$filtert = $user->id;
}
+// Pagination parameters
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index e6162b45b52..9c848883332 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -1419,7 +1419,7 @@ if ($object->id > 0) {
$sql .= ', f.total_tva';
$sql .= ', f.total_ttc';
$sql .= ', f.entity';
- $sql .= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as status';
+ $sql .= ', f.datef as df, f.date_lim_reglement as dl, f.datec as dc, f.paye as paye, f.fk_statut as status';
$sql .= ', s.nom, s.rowid as socid';
$sql .= ', SUM(pf.amount) as am';
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
@@ -1493,7 +1493,12 @@ if ($object->id > 0) {
//print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '';
if ($objp->df > 0) {
- print ''.dol_print_date($db->jdate($objp->df), 'day').' | ';
+ print ''.$langs->trans('DateInvoice').": ".dol_print_date($db->jdate($objp->df), 'day').' | ';
+ } else {
+ print '!!! | ';
+ }
+ if ($objp->dl > 0) {
+ print ''.$langs->trans('DateMaxPayment').": ".dol_print_date($db->jdate($objp->dl), 'day').' | ';
} else {
print '!!! | ';
}
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 67af97cfe12..b748cac3df4 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -65,7 +65,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$now = dol_now();
// Security check
-$socid = GETPOST("socid", 'int');
+//$socid = GETPOST("socid", 'int');
if ($user->socid > 0) {
$action = '';
$id = $user->socid;
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index dde6e3204d6..c39e4fbf834 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -675,7 +675,7 @@ if ($object->fetch($id) >= 0) {
// Date last update
print '';
- print dol_print_date($obj->tms, 'dayhour');
+ print dol_print_date(dol_stringtotime($obj->tms), 'dayhour');
print ' | ';
// Status of recipient sending email (Warning != status of emailing)
diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index d3ebc379b55..cf3d18adbac 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -101,7 +101,7 @@ if (is_resource($handle)) {
$qualified = 1;
foreach ($mailmodule->require_module as $key) {
- if (!$conf->$key->enabled || (!$user->admin && $mailmodule->require_admin)) {
+ if (empty($conf->$key->enabled) || (!$user->admin && $mailmodule->require_admin)) {
$qualified = 0;
//print "Les pr�requis d'activation du module mailing ne sont pas respect�s. Il ne sera pas actif";
break;
@@ -176,7 +176,7 @@ if ($result) {
print ''.$mailstatic->getNomUrl(1).' | ';
- print ''.dol_trunc($obj->title, 38).' | ';
+ print ''.(!empty($obj->title) ? dol_trunc($obj->title, 38) : '').' | ';
print ''.dol_print_date($db->jdate($obj->date_creat), 'day').' | ';
print ''.($obj->nbemail ? $obj->nbemail : "0").' | ';
print ''.$mailstatic->LibStatut($obj->statut, 5).' | ';
diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php
index 6916a2dfe5d..501de4c11cf 100644
--- a/htdocs/comm/mailing/list.php
+++ b/htdocs/comm/mailing/list.php
@@ -27,20 +27,24 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
// Load translation files required by the page
-$langs->load("mails");
+$langs->load('mails');
-$sortfield = GETPOST('sortfield', 'aZ09comma');
-$sortorder = GETPOST('sortorder', 'aZ09comma');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
-$optioncss = GETPOST('optioncss', 'alpha');
+// Get Parameters
$massaction = GETPOST('massaction', 'alpha');
-$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+$optioncss = GETPOST('optioncss', 'alpha');
+
+// Pagination
+$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$sortfield = GETPOST('sortfield', 'aZ09comma');
+$sortorder = GETPOST('sortorder', 'aZ09comma');
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
$page = 0;
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
+
if (!$sortorder) {
$sortorder = "DESC";
}
@@ -48,10 +52,12 @@ if (!$sortfield) {
$sortfield = "m.date_creat";
}
+// Search Fields
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_ref = GETPOST("search_ref", "alpha") ? GETPOST("search_ref", "alpha") : GETPOST("sref", "alpha");
$filteremail = GETPOST('filteremail', 'alpha');
+// Initialize objects
$object = new Mailing($db);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -128,7 +134,9 @@ if (empty($reshook)) {
* View
*/
-llxHeader('', $langs->trans("Mailing"), 'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing');
+// Page Header
+$help_url = 'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing';
+llxHeader('', $langs->trans("Mailing"), $help_url);
$form = new Form($db);
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index cc5872abb25..cc507041ac6 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -62,21 +62,23 @@ if (isModEnabled("expedition")) {
$langs->loadLangs(array('sendings'));
}
+// Get Parameters
$socid = GETPOST('socid', 'int');
-$action = GETPOST('action', 'aZ09');
+$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
-$confirm = GETPOST('confirm', 'alpha');
-$toselect = GETPOST('toselect', 'array');
+$confirm = GETPOST('confirm', 'alpha');
+$cancel = GETPOST('cancel', 'alpha');
+$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'proposallist';
-$mode = GETPOST('mode', 'alpha');
+$mode = GETPOST('mode', 'alpha');
-$search_user = GETPOST('search_user', 'int');
-$search_sale = GETPOST('search_sale', 'int');
-$search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
+// Search Fields
+$search_user = GETPOST('search_user', 'int');
+$search_sale = GETPOST('search_sale', 'int');
+$search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
$search_refcustomer = GETPOST('search_refcustomer', 'alpha');
-
$search_refproject = GETPOST('search_refproject', 'alpha');
$search_project = GETPOST('search_project', 'alpha');
@@ -140,15 +142,15 @@ $search_date_signature_endyear = GETPOST('search_date_signature_endyear', 'int')
$search_date_signature_start = dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear);
$search_date_signature_end = dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear);
-
$search_status = GETPOST('search_status', 'alpha');
+
$optioncss = GETPOST('optioncss', 'alpha');
$object_statut = GETPOST('search_statut', 'alpha');
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$mesg = (GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
-
+// Pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
@@ -263,6 +265,7 @@ foreach ($object->fields as $key => $val) {
$fieldstosearchall['t.'.$key] = $val['label'];
}
}*/
+
// Definition of array of fields for columns
/*$arrayfields = array();
foreach ($object->fields as $key => $val) {
@@ -278,9 +281,11 @@ foreach ($object->fields as $key => $val) {
);
}
}*/
+
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
+// Permissions
$permissiontoread = $user->rights->propal->lire;
$permissiontoadd = $user->rights->propal->creer;
$permissiontodelete = $user->rights->propal->supprimer;
diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php
index 2ef2d429900..d5b0336b95a 100644
--- a/htdocs/commande/list_det.php
+++ b/htdocs/commande/list_det.php
@@ -137,10 +137,10 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) {
- $sortfield = 'c.ref';
+ $sortfield = 'pr.ref';
}
if (!$sortorder) {
- $sortorder = 'DESC';
+ $sortorder = 'ASC';
}
$show_shippable_command = GETPOST('show_shippable_command', 'aZ09');
diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php
index a1e5dae0c91..05612f54166 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_list.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_list.php
@@ -423,7 +423,7 @@ if ($search_all) {
$fieldstosearchall[$key] = $langs->trans($val);
$setupstring .= $key."=".$val.";";
}
- print ''."\n";
+ print ''."\n";
print ''.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).' '."\n";
}
diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php
index 8b6119db13a..ad80b6d1b6d 100644
--- a/htdocs/compta/localtax/card.php
+++ b/htdocs/compta/localtax/card.php
@@ -144,9 +144,12 @@ $form = new Form($db);
$title = $langs->trans("LT".$object->ltt)." - ".$langs->trans("Card");
$help_url = '';
-llxHeader('', $title, $helpurl);
+llxHeader('', $title, $help_url);
if ($action == 'create') {
+ $datev = dol_mktime(12, 0, 0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear"));
+ $datep = dol_mktime(12, 0, 0, GETPOST("datepmonth"), GETPOST("datepday"), GETPOST("datepyear"));
+
print load_fiche_titre($langs->transcountry($lttype == 2 ? "newLT2Payment" : "newLT1Payment", $mysoc->country_code));
print '\n";
@@ -341,6 +346,9 @@ print ''; */ $sql = "SELECT f.ref, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,"; +if ($type == 'bank-transfer') { + $sql .= " f.ref_supplier,"; +} $sql .= " pfd.rowid as request_row_id, pfd.date_demande, pfd.amount"; if ($type == 'bank-transfer') { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; @@ -417,9 +425,13 @@ if ($resql) { $tradinvoice = "SupplierInvoice"; } + print ' ';
print ' ";
+
print "";
print "
\n"; } else { diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index cacc2280f53..3619ebfad7a 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -759,22 +759,24 @@ class ChargeSociales extends CommonObject */ public function getKanbanView($option = '', $arraydata = null) { - global $langs; + global $conf, $langs; + $return = ' ';
$return .= ' ';
$return .= '';
$return .= ' ';
- $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'';
- if (property_exists($this, 'fk_project') && !empty($this->fk_project)) {
- $return .= ' | '.$this->fk_project.'';
+ $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(0) : $this->ref).'';
+ if (property_exists($this, 'label')) {
+ $return .= ' '.$this->label.' ';
}
if (property_exists($this, 'date_ech')) {
- $return .= ''.$langs->trans("DateEnd").':'.dol_print_date($this->date_ech).''; + $return .= ' '.$langs->trans("DateEnd").' : '.dol_print_date($this->date_ech, 'day').''; } if (property_exists($this, 'amount')) { - $return .= ' '.$langs->trans("Amount").' : '.price($this->amount).''; + $return .= ' '; + $return .= ''.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).''; } if (method_exists($this, 'LibStatut')) { $return .= ' '.$this->LibStatut($this->paye, 5, $this->alreadypaid).' ';
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 66cdc1ed1aa..4fde1b75552 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -856,9 +856,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' | ';
- print ' | ';
- if (!empty($value['icon'])) {
- print '';
- }
- print '';
- print ' | ';
- print ' | ||||||||||||||||||||||||||||||