diff --git a/.stickler.yml b/.stickler.yml index b68804448b2..642dec27412 100644 --- a/.stickler.yml +++ b/.stickler.yml @@ -8,3 +8,7 @@ linters: fixers: enable: true + +files: + ignore: + - 'htdocs/includes/*' diff --git a/COPYRIGHT b/COPYRIGHT index 1af09e6fdaf..fe707c1d63d 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -2,7 +2,7 @@ License ------- -Dolibarr is released under the terms of the GNU General Public License as +Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version (GPL-3+). More information: https://www.gnu.org/licenses/gpl-3.0.txt @@ -15,13 +15,13 @@ PHP libraries: AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package) CKEditor 4.12.1 LGPL-2.1+ Yes Editor WYSIWYG EvalMath 1.0 BSD Yes Safe math expressions evaluation -Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers +Escpos-php 2.2 MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) Mobiledetect 2.8.33 MIT License Yes Detect mobile devices browsers NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency ParseDown 1.6 MIT License Yes Markdown parser -PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers +PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP @@ -37,7 +37,7 @@ TCPDF 6.3.2 LGPL-3+ Yes TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement JS libraries: -Ace 1.4.6 BSD Yes JS library to get code syntaxique coloration in a textarea. +Ace 1.4.6 BSD Yes JS library to get code syntaxique coloration in a textarea. jQuery 3.4.1 MIT License Yes JS library jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI jQuery select2 4.0.5 GPL and Apache License Yes JS library plugin for sexier multiselect diff --git a/ChangeLog b/ChangeLog index 2d398c83535..1ce34b5e87a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,7 +24,7 @@ Following changes may create regressions for some external modules, but were nec * Removed function dol_micro_time. Use native PHP microtime instead. * The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE. * The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS. -* If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu. +* If your logo is no more visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible again. * All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'. * All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. * All properties 'type_libelle' were renamed into 'type_label'. diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index d5af14f9171..8a3096ef72a 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -164,7 +164,7 @@ foreach ($files as $filetmp) { if (filetype($file)=="file") { $md5=md5_file($file); $checksumconcat[]=$md5; - fputs($fp, ' '.$md5.''."\n"); + fputs($fp, ' '.$md5.''."\n"); } } fputs($fp, ' '."\n"); @@ -207,7 +207,7 @@ foreach ($files as $filetmp) { if (filetype($file)=="file") { $md5=md5_file($file); $checksumconcat[]=$md5; - fputs($fp, ' '.$md5.''."\n"); + fputs($fp, ' '.$md5.''."\n"); } } fputs($fp, ' '."\n"); diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index e34cd54863b..10a65cab2fe 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -138,7 +138,7 @@ if (empty($reshook)) if ($result > 0) { - setEventMessages($langs->trans("ChartLoaded"), null); + setEventMessages($langs->trans("ChartLoaded"), null, 'mesgs'); } else { diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 6f30f5ac7ec..da726597345 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -456,7 +456,7 @@ if ($id) print ''; print '
'; - print ''; + print '
'; // Form to add a new line if ($tabname[$id]) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index f54c477ff52..faab333890b 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -220,7 +220,7 @@ if ($action == 'create') { dol_fiche_head(); - print '
'; + print '
'; // Chart of account print ''; @@ -291,7 +291,7 @@ elseif ($id > 0 || $ref) { print ''; print ''; - print '
' . $langs->trans("Chartofaccounts") . '
'; + print '
'; // Account number print ''; @@ -348,7 +348,7 @@ elseif ($id > 0 || $ref) { print '
'; print '
'; - print '
' . $langs->trans("AccountNumber") . '
'; + print '
'; // Label print ''; diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 5fdd43eb020..8313a45a504 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -104,7 +104,7 @@ print ''; dol_fiche_head(); -print '
' . $langs->trans("Label") . '
'; +print '
'; // Select the category print ''; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 852349d0516..f3f3efa572c 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -449,7 +449,7 @@ if ($id) print ''; print '
'; - print '
' . $langs->trans("AccountingCategory") . '
'; + print '
'; // Form to add a new line if ($tabname[$id]) diff --git a/htdocs/accountancy/admin/closure.php b/htdocs/accountancy/admin/closure.php index a9199959905..cc69462d893 100644 --- a/htdocs/accountancy/admin/closure.php +++ b/htdocs/accountancy/admin/closure.php @@ -96,7 +96,7 @@ print '' print ''; // Define main accounts for closure -print '
'; +print '
'; foreach ($list_account_main as $key) { print ''; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 6b47578761c..78d438aa4da 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -140,7 +140,7 @@ print ''; // Define main accounts for thirdparty -print '
'; +print '
'; foreach ($list_account_main as $key) { print ''; @@ -167,7 +167,7 @@ print '
'; // Define default accounts -print '
'; +print '
'; foreach ($list_account as $key) { print ''; diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index e506f5bf512..8cda5284ba8 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -195,7 +195,7 @@ print ''; * Main Options */ -print '
'; +print '
'; print ''; print ''; print "\n"; @@ -223,7 +223,7 @@ print "
\n"; /* * Export model */ -print '
' . $langs->trans('Options') . '
'; +print '
'; print ''; print ''; @@ -254,7 +254,7 @@ print "
\n"; $num2 = count($model_option); if ($num2) { - print '
' . $langs->trans("Modelcsv") . '
'; + print '
'; print ''; print ''; print "\n"; diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 5b1fa9df4ec..6d321e60756 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -120,7 +120,7 @@ if ($result) // Load attribute_label print '
'; - print '
' . $langs->trans('OtherOptions') . '
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 42b9d231fe3..31000b8ec8a 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -163,7 +163,7 @@ if ($action == 'create') dol_fiche_head(); - print '
' . $langs->trans("Ref") . '' . $langs->trans("Label") . '
'; + print '
'; // Label print ''; @@ -211,7 +211,7 @@ if ($action == 'create') print ''; print ''; - print '
' . $langs->trans("Label") . '
'; + print '
'; // Ref print ""; @@ -261,7 +261,7 @@ if ($action == 'create') dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); - print '
'; + print '
'; $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 0460f31af30..dcc2e608f0b 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -172,7 +172,7 @@ print ''; // Default mode for calculating turnover (parameter ACCOUNTING_MODE) /* -print '
'; +print '
'; print ''; print ''; @@ -202,7 +202,7 @@ print '
'; // Others params -print '
' . $langs->trans('OptionMode') . '' . $langs->trans('Description') . '
'; +print '
'; print ''; print ''; print "\n"; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 44fe3e936cd..b0eaff04494 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -412,7 +412,7 @@ if ($id) print ''; print '
'; - print '
' . $langs->trans('OtherOptions') . '
'; + print '
'; // Form to add a new line if ($tabname[$id]) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 091018dc909..0ed3254f484 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -325,7 +325,7 @@ if ($result) print '
'; // Select mode - print '
'; + print '
'; print ''; print ''; print "\n"; diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index bdc78911513..1d77a9a2186 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -70,7 +70,7 @@ if ($result) { $y = $year_current; -print '
' . $langs->trans('Options') . '' . $langs->trans('Description') . '
'; +print '
'; print ''; print ''; for($i = 1; $i <= 12; $i++) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index ca6403279e1..80c9ffb7792 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -354,7 +354,7 @@ if ($action == 'create') dol_fiche_head(); - print '
' . $langs->trans("Label") . '
'; + print '
'; /*print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 5158e12ebb6..f449a99c8bf 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -922,8 +922,8 @@ while ($i < min($num, $limit)) { print ''; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totaldebitfield']=$totalarray['nbfield']; - $totalarray['totaldebit'] += $line->debit; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='totaldebit'; + $totalarray['val']['totaldebit'] += $line->debit; } // Amount credit @@ -931,8 +931,8 @@ while ($i < min($num, $limit)) { print ''; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalcreditfield']=$totalarray['nbfield']; - $totalarray['totalcredit'] += $line->credit; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='totalcredit'; + $totalarray['val']['totalcredit'] += $line->credit; } // Lettering code @@ -998,29 +998,7 @@ while ($i < min($num, $limit)) } // Show total line -if (isset($totalarray['totaldebitfield']) || isset($totalarray['totalcreditfield'])) -{ - $i=0; - print ''; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totaldebitfield'] == $i) print ''; - elseif ($totalarray['totalcreditfield'] == $i) print ''; - else print ''; - } - $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print ''; -} - +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; print "
' . $langs->trans("NumPiece") . '' . ($line->debit ? price($line->debit) : ''). '' . ($line->credit ? price($line->credit) : '') . '
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totaldebit']).''.price($totalarray['totalcredit']).'
"; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 2ed9eb4c2bd..4e96bf64602 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -197,6 +197,7 @@ if ($resql) { $param="&socid=".$socid; print '
'; + print ''; print ''; $letteringbutton = ''; @@ -204,7 +205,7 @@ if ($resql) { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit); print '
'; - print ''."\n"; + print '
'."\n"; /* print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index b381fc597ce..d35eba34963 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -195,6 +195,7 @@ if ($resql) { $param="&socid=".$socid; print ''; + print ''; print ''; $letteringbutton = ''; @@ -202,7 +203,7 @@ if ($resql) { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit); print '
'; - print '
'."\n"; + print '
'."\n"; /* print ''; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 0cfc0d24826..b244d8be123 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -154,7 +154,7 @@ class AccountingAccount extends CommonObject * @param int $rowid Id * @param string $account_number Account number * @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active char of account - * @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC'. + * @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code). * @return int <0 if KO, 0 if not found, Id of record if OK and found */ public function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0, $limittoachartaccount = '') diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 599742460ae..35c556807f8 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -86,7 +86,7 @@ $buttonbind = '' . $langs->trans("Val print_barre_liste($langs->trans("OverviewOfMovementsNotValidated"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); print '
'; -print '
'; +print '
'; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; diff --git a/htdocs/accountancy/closure/validate.php b/htdocs/accountancy/closure/validate.php index 0498e5e2dec..0b079c57b20 100644 --- a/htdocs/accountancy/closure/validate.php +++ b/htdocs/accountancy/closure/validate.php @@ -106,7 +106,7 @@ $y = $year_current; print_barre_liste($langs->trans("SelectMonthAndValidate"), '', '', '', '', '', '', -1, '', '', 0, '', 'class="right"', 0, 1, 1); print '
'; -print '
'; +print '
'; print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 62ae458d283..6b64d969518 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -123,7 +123,7 @@ if (! empty($id)) { dol_fiche_head(); - print '
'; + print '
'; // Ref facture print ''; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index b3ef45c1feb..2aa6072f2c2 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -225,7 +225,7 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; -print '
' . $langs->trans("Invoice") . '
'; +print '
'; print ''; print ''; for($i = 1; $i <= 12; $i ++) { @@ -300,7 +300,7 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; -print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '
'; +print '
'; print ''; print ''; for($i = 1; $i <= 12; $i ++) { @@ -379,7 +379,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; - print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '
'; + print '
'; print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; @@ -431,7 +431,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. if (! empty($conf->margin->enabled)) { print "
\n"; print '
'; - print '
' . $langs->trans("TotalVente") . '
'; + print '
'; print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 2969f2ff0a1..f08b4e8d42d 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -129,8 +129,8 @@ if (empty($reshook)) // Mass actions $objectclass='AccountingAccount'; - $permtoread = $user->rights->accounting->read; - $permtodelete = $user->rights->accounting->delete; + $permissiontoread = $user->rights->accounting->read; + $permissiontodelete = $user->rights->accounting->delete; $uploaddir = $conf->accounting->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -406,6 +406,8 @@ if ($result) { $isSellerInEEC = isInEEC($mysoc); + $accountingaccount_codetotid_cache = array(); + while ($i < min($num_lines, $limit)) { $objp = $db->fetch_object($result); @@ -474,8 +476,8 @@ if ($result) { } } - if (! empty($objp->code_sell)) { - //$objp->code_sell_p = $objp->code_sell; // Code on product + if (! empty($objp->code_sell_p)) { + // Value was defined previously } else { $code_sell_p_notset = 'color:orange'; } @@ -547,11 +549,26 @@ if ($result) { print ''; // Suggested accounting account + // $objp->code_sell_l = default (it takes the country into consideration), $objp->code_sell_p is value for product (it takes the country into consideration too) print ''; diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index 8ee9f9c625d..0d0e6509769 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -125,7 +125,7 @@ if (! empty($id)) { dol_fiche_head(); - print '
' . $langs->trans("TotalMarge") . ''; $suggestedid = $objp->aarowid_suggest; - if (empty($suggestedid) && empty($objp->code_sell_p) && ! empty($objp->code_sell_l) && ! empty($conf->global->ACCOUNTANCY_AUTOFILL_ACCOUNT_WITH_GENERIC)) + /*var_dump($suggestedid); + var_dump($objp->code_sell_p); + var_dump($objp->code_sell_l);*/ + if (empty($suggestedid) && empty($objp->code_sell_p) && ! empty($objp->code_sell_l) && empty($conf->global->ACCOUNTANCY_DO_NOT_AUTOFILL_ACCOUNT_WITH_GENERIC)) { - //$suggestedid = // id of $objp->code_sell_l + if (empty($accountingaccount_codetotid_cache[$objp->code_sell_l])) + { + $tmpaccount = new AccountingAccount($db); + $tmpaccount->fetch(0, $objp->code_sell_l, 1); + if ($tmpaccount->id > 0) { + $suggestedid = $tmpaccount->id; + } + $accountingaccount_codetotid_cache[$objp->code_sell_l] = $tmpaccount->id; + } + else { + $suggestedid = $accountingaccount_codetotid_cache[$objp->code_sell_l]; + } } print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); print '
'; + print '
'; // Ref print ''; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 4efc8a15ba4..29fe4a7aea3 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -152,7 +152,7 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; -print '
' . $langs->trans("ExpenseReport") . '
'; +print '
'; print ''; print ''; for($i = 1; $i <= 12; $i ++) { @@ -223,7 +223,7 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', print '
'; -print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '
'; +print '
'; print ''; print ''; for($i = 1; $i <= 12; $i ++) { @@ -297,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; - print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '
'; + print '
'; print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index f0e545f7853..a1c354f010b 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -112,8 +112,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' // Mass actions $objectclass='ExpenseReport'; $objectlabel='ExpenseReport'; -$permtoread = $user->rights->expensereport->read; -$permtodelete = $user->rights->expensereport->delete; +$permissiontoread = $user->rights->expensereport->read; +$permissiontodelete = $user->rights->expensereport->delete; $uploaddir = $conf->expensereport->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 63bce528ccb..e39decd7c57 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -125,7 +125,7 @@ if (! empty($id)) { dol_fiche_head(); - print '
' . $langs->trans("Total") . '
'; + print '
'; // ref invoice print ''; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a1eb1ce4a45..945c5567b0b 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -223,7 +223,7 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; -print '
' . $langs->trans("BillsSuppliers") . '
'; +print '
'; print ''; print ''; for($i = 1; $i <= 12; $i ++) { @@ -293,7 +293,7 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; -print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '
'; +print '
'; print ''; print ''; for($i = 1; $i <= 12; $i ++) { @@ -366,7 +366,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; - print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '
'; + print '
'; print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 27cd97dfea3..249cb920c47 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -133,8 +133,8 @@ if (empty($reshook)) // Mass actions $objectclass='AccountingAccount'; - $permtoread = $user->rights->accounting->read; - $permtodelete = $user->rights->accounting->delete; + $permissiontoread = $user->rights->accounting->read; + $permissiontodelete = $user->rights->accounting->delete; $uploaddir = $conf->accounting->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 526b325c7ac..d7d78184e6f 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -154,7 +154,7 @@ print ''; print ''; print load_fiche_titre($langs->trans("MemberMainOptions"), '', ''); -print '
' . $langs->trans("Total") . '
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 97392b902bc..f0dd8ac58d7 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -163,7 +163,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print '
'; - print '
'.$langs->trans("Description").''.$langs->trans("Value").'
'; + print '
'; print ''; print ''; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 76556feb4ee..417d4cd2c99 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -70,6 +70,8 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +$socialnetworks = getArrayOfSocialNetworks(); + // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $object->getCanvas($id); $canvas = $object->canvas?$object->canvas:GETPOST("canvas"); @@ -302,10 +304,16 @@ if (empty($reshook)) $object->phone_perso = trim(GETPOST("phone_perso", 'alpha')); $object->phone_mobile= trim(GETPOST("phone_mobile", 'alpha')); $object->email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha')); - $object->skype = trim(GETPOST("skype", 'alpha')); - $object->twitter = trim(GETPOST("twitter", 'alpha')); - $object->facebook = trim(GETPOST("facebook", 'alpha')); - $object->linkedin = trim(GETPOST("linkedin", 'alpha')); + $object->socialnetworks = array(); + foreach ($socialnetworks as $key => $value) { + if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') { + $object->socialnetworks[$key] = trim(GETPOST($key, 'alphanohtml')); + } + } + //$object->skype = trim(GETPOST("skype", 'alpha')); + //$object->twitter = trim(GETPOST("twitter", 'alpha')); + //$object->facebook = trim(GETPOST("facebook", 'alpha')); + //$object->linkedin = trim(GETPOST("linkedin", 'alpha')); $object->birth = $birthdate; $object->typeid = GETPOST("typeid", 'int'); @@ -448,10 +456,10 @@ if (empty($reshook)) $phone=GETPOST("phone", 'alpha'); $phone_perso=GETPOST("phone_perso", 'alpha'); $phone_mobile=GETPOST("phone_mobile", 'alpha'); - $skype=GETPOST("member_skype", 'alpha'); - $twitter=GETPOST("member_twitter", 'alpha'); - $facebook=GETPOST("member_facebook", 'alpha'); - $linkedin=GETPOST("member_linkedin", 'alpha'); + // $skype=GETPOST("member_skype", 'alpha'); + // $twitter=GETPOST("member_twitter", 'alpha'); + // $facebook=GETPOST("member_facebook", 'alpha'); + // $linkedin=GETPOST("member_linkedin", 'alpha'); $email=preg_replace('/\s+/', '', GETPOST("member_email", 'alpha')); $login=GETPOST("member_login", 'alpha'); $pass=GETPOST("password", 'alpha'); @@ -478,11 +486,19 @@ if (empty($reshook)) $object->phone = $phone; $object->phone_perso = $phone_perso; $object->phone_mobile= $phone_mobile; + $object->socialnetworks = array(); + if (! empty($conf->socialnetworks->enabled)) { + foreach ($socialnetworks as $key => $value) { + if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml')!='') { + $object->socialnetworks[$key] = GETPOST("member_".$key, 'alphanohtml'); + } + } + } - $object->skype = $skype; - $object->twitter = $twitter; - $object->facebook = $facebook; - $object->linkedin = $linkedin; + // $object->skype = $skype; + // $object->twitter = $twitter; + // $object->facebook = $facebook; + // $object->linkedin = $linkedin; $object->email = $email; $object->login = $login; @@ -802,7 +818,7 @@ if (empty($reshook)) // Actions to build doc $upload_dir = $conf->adherent->dir_output; - $permissioncreate=$user->rights->adherent->creer; + $permissiontoadd=$user->rights->adherent->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Actions to send emails @@ -922,7 +938,7 @@ else dol_fiche_head(''); - print '
'.$langs->trans("Parameter").'
'; + print '
'; print ''; // Login @@ -1028,29 +1044,12 @@ else // Mobile phone print ''; - // Skype - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - } - - // Twitter - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - } - - // Facebook - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - } - - // LinkedIn - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - } + if (! empty($conf->socialnetworks->enabled)) { + foreach ($socialnetworks as $key => $value) { + if (!$value['active']) break; + print ''; + } + } // Birth Date print "
'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'
'.$langs->trans("Skype").'
'.$langs->trans("Twitter").'
'.$langs->trans("Facebook").'
'.$langs->trans("LinkedIn").'
'.$langs->trans($value['label']).'
".$langs->trans("DateToBirth")."\n"; @@ -1183,7 +1182,7 @@ else dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user'); - print ''; + print '
'; // Ref print ''; @@ -1297,29 +1296,12 @@ else // Mobile phone print ''; - // Skype - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - } - - // Twitter - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - } - - // Facebook - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - } - - // LinkedIn - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - } + if (! empty($conf->socialnetworks->enabled)) { + foreach ($socialnetworks as $key => $value) { + if (!$value['active']) break; + print ''; + } + } // Birth Date print "
'.$langs->trans("Ref").''.$object->id.'
'.img_picto('', 'object_phoning_mobile').' '.$langs->trans("PhoneMobile").'phone_mobile).'">
'.$langs->trans("Skype").'skype).'">
'.$langs->trans("Twitter").'twitter).'">
'.$langs->trans("Facebook").'facebook).'">
'.$langs->trans("LinkedIn").'linkedin).'">
'.$langs->trans($value['label']).'
".$langs->trans("DateToBirth")."\n"; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 177e2eef18f..e7686a0a055 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -259,6 +259,7 @@ print '
'; print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; +print ''; print ''; print ''; print ''; @@ -278,6 +279,7 @@ print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print ''; +print ''; print ''; print ''; print $langs->trans("DescADHERENT_CARD_TYPE").' '; @@ -297,6 +299,7 @@ print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; print ''; +print ''; print ''; print ''; print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' '; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f7278f9007a..ff2e5082736 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -124,23 +124,32 @@ class Adherent extends CommonObject */ public $email; + /** + * @var array array of socialnetworks + */ + public $socialnetworks; + /** * @var string skype account + * @deprecated */ public $skype; /** * @var string twitter account + * @deprecated */ public $twitter; /** * @var string facebook account + * @deprecated */ public $facebook; /** * @var string linkedin account + * @deprecated */ public $linkedin; @@ -566,10 +575,7 @@ class Adherent extends CommonObject $sql.= ", country = ".($this->country_id>0?$this->db->escape($this->country_id):"null"); $sql.= ", state_id = ".($this->state_id>0?$this->db->escape($this->state_id):"null"); $sql.= ", email = '".$this->db->escape($this->email)."'"; - $sql.= ", skype = '".$this->db->escape($this->skype)."'"; - $sql.= ", twitter = '".$this->db->escape($this->twitter)."'"; - $sql.= ", facebook = '".$this->db->escape($this->facebook)."'"; - $sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'"; + $sql.= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; $sql.= ", phone = ".($this->phone?"'".$this->db->escape($this->phone)."'":"null"); $sql.= ", phone_perso = ".($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null"); $sql.= ", phone_mobile = ".($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null"); @@ -694,10 +700,7 @@ class Adherent extends CommonObject $luser->state_id=$this->state_id; $luser->email=$this->email; - $luser->skype=$this->skype; - $luser->twitter=$this->twitter; - $luser->facebook=$this->facebook; - $luser->linkedin=$this->linkedin; + $luser->socialnetworks=$this->socialnetworks; $luser->office_phone=$this->phone; $luser->user_mobile=$this->phone_mobile; @@ -736,10 +739,7 @@ class Adherent extends CommonObject $lthirdparty->zip=$this->zip; $lthirdparty->town=$this->town; $lthirdparty->email=$this->email; - $lthirdparty->skype=$this->skype; - $lthirdparty->twitter=$this->twitter; - $lthirdparty->facebook=$this->facebook; - $lthirdparty->linkedin=$this->linkedin; + $lthirdparty->socialnetworks=$this->socialnetworks; $lthirdparty->phone=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; @@ -1228,7 +1228,7 @@ class Adherent extends CommonObject $sql = "SELECT d.rowid, d.ref_ext, d.civility as civility_code, d.gender, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,"; $sql.= " d.note_public,"; - $sql.= " d.email, d.skype, d.twitter, d.facebook, d.linkedin, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,"; + $sql.= " d.email, d.socialnetworks, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,"; $sql.= " d.datec as datec,"; $sql.= " d.tms as datem,"; @@ -1307,10 +1307,7 @@ class Adherent extends CommonObject $this->phone_mobile = $obj->phone_mobile; $this->email = $obj->email; - $this->skype = $obj->skype; - $this->twitter = $obj->twitter; - $this->facebook = $obj->facebook; - $this->linkedin = $obj->linkedin; + $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); $this->photo = $obj->photo; $this->statut = $obj->statut; @@ -2385,10 +2382,12 @@ class Adherent extends CommonObject $this->country = 'France'; $this->morphy = 'mor'; $this->email = 'specimen@specimen.com'; - $this->skype = 'skypepseudo'; - $this->twitter = 'twitterpseudo'; - $this->facebook = 'facebookpseudo'; - $this->linkedin = 'linkedinpseudo'; + $this->socialnetworks = array( + 'skype' => 'skypepseudo', + 'twitter' => 'twitterpseudo', + 'facebook' => 'facebookpseudo', + 'linkedin' => 'linkedinpseudo', + ); $this->phone = '0999999999'; $this->phone_perso = '0999999998'; $this->phone_mobile = '0999999997'; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b4bdb119b29..5d992b168d4 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -71,6 +71,18 @@ class AdherentType extends CommonObject */ public $morphy; + public $duration; + + /* + * type expiration + */ + public $duration_value; + + /** + * Expiration unit + */ + public $duration_unit; + /** * @var int Subsription required (0 or 1) * @since 5.0 @@ -373,8 +385,9 @@ class AdherentType extends CommonObject $sql.= "SET "; $sql.= "statut = ".$this->statut.","; $sql.= "libelle = '".$this->db->escape($this->label) ."',"; - $sql.= "morphy = '".$this->db->escape($this->morphy) ."',"; + $sql.= "morphy = '".$this->db->escape($this->morphy) ."',"; $sql.= "subscription = '".$this->db->escape($this->subscription)."',"; + $sql.= "duration = '" . $this->db->escape($this->duration_value . $this->duration_unit) ."',"; $sql.= "note = '".$this->db->escape($this->note)."',"; $sql.= "vote = ".(integer) $this->db->escape($this->vote).","; $sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'"; @@ -476,7 +489,7 @@ class AdherentType extends CommonObject { global $langs, $conf; - $sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote"; + $sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.duration, d.subscription, d.mail_valid, d.note, d.vote"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; $sql .= " WHERE d.rowid = ".(int) $rowid; @@ -494,6 +507,9 @@ class AdherentType extends CommonObject $this->label = $obj->label; $this->morphy = $obj->morphy; $this->statut = $obj->statut; + $this->duration = $obj->duration; + $this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration)-1); + $this->duration_unit = substr($obj->duration, -1); $this->subscription = $obj->subscription; $this->mail_valid = $obj->mail_valid; $this->note = $obj->note; diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index a0dc9b81a86..67adb031427 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -167,7 +167,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele if ($conf->use_javascript_ajax) { print '
'; - print ''; + print '
'; print ''; print '
'.$langs->trans("Statistics").'
'; @@ -249,7 +249,7 @@ if ($result) } print '
'; -print ''; +print '
'; print ''; print ''; print ''; @@ -311,7 +311,7 @@ $resql=$db->query($sql); if ($resql) { print '
'; - print '
'.$langs->trans("Year").''.$langs->trans("Subscriptions").'
'; + print '
'; print ''; print ''; @@ -374,7 +374,7 @@ $resql=$db->query($sql); if ($resql) { print '
'; - print '
'.$langs->trans("LastMembersModified", $max).'
'; + print '
'; print ''; print ''; @@ -420,7 +420,7 @@ else // Summary of members by type print '
'; -print '
'.$langs->trans("LastSubscriptionsModified", $max).'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 0bcc11bf351..81d6b7625b7 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -232,8 +232,8 @@ if (empty($reshook)) // Mass actions $objectclass='Adherent'; $objectlabel='Members'; - $permtoread = $user->rights->adherent->lire; - $permtodelete = $user->rights->adherent->supprimer; + $permissiontoread = $user->rights->adherent->lire; + $permissiontodelete = $user->rights->adherent->supprimer; $uploaddir = $conf->adherent->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -919,26 +919,8 @@ while ($i < min($num, $limit)) } // Show total line -if (isset($totalarray['pos'])) -{ - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found if ($num == 0) diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index b2f302fea45..e75e1a61e70 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -117,7 +117,7 @@ else } // Print array -print '
'.$langs->trans("MembersTypes").''.$langs->trans("MembersStatusToValid").'
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 3c469e658e5..956a71112cb 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -294,7 +294,7 @@ if (count($arrayjs) && $mode == 'memberbycountry') if ($mode) { // Print array / Affiche le tableau - print '
'.$langs->trans("Nature").''.$langs->trans("NbOfMembers").'
'; + print '
'; print ''; print ''; if ($label2) print ''; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index d89a8a4a8c0..f02c012a48e 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -145,7 +145,7 @@ print '
'; // Show filter box /*print ''; -print '
'.$label.''.$label2.'
'; +print '
'; print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("Member").''; print $form->select_company($id,'memberid','',1); @@ -211,7 +211,7 @@ print '
'; // Show graphs -print '
'; +print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 415efdc8570..f2250af5790 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -689,7 +689,7 @@ if ($rowid > 0) $num = $db->num_rows($result); $i = 0; - print ''."\n"; + print '
'."\n"; print ''; print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder); diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 0a40f441e92..aa203ffca42 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -197,7 +197,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') $linkback = ''.$langs->trans("BackToList").''; print "\n"; - print '
'; + print '
'; // Ref print ''; @@ -307,7 +307,7 @@ if ($rowid && $action != 'edit') print '
'; - print '
'.$langs->trans("Ref").'
'; + print '
'; // Member $adh->ref=$adh->getFullName($langs); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index dbc14e2999e..c66dce0e8fd 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -588,26 +588,8 @@ while ($i < min($num, $limit)) } // Show total line -if (isset($totalarray['pos'])) -{ - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found if ($num == 0) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 94978e7f8a9..68d82c5d12a 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.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/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $langs->load("members"); @@ -61,6 +62,8 @@ $label=GETPOST("label", "alpha"); $morphy=GETPOST("morphy", "alpha"); $statut=GETPOST("statut", "int"); $subscription=GETPOST("subscription", "int"); +$duration_value = GETPOST('duration_value', 'int'); +$duration_unit = GETPOST('duration_unit', 'alpha'); $vote=GETPOST("vote", "int"); $comment=GETPOST("comment", 'alphanohtml'); $mail_valid=GETPOST("mail_valid", 'none'); @@ -104,9 +107,11 @@ if ($cancel) { if ($action == 'add' && $user->rights->adherent->configurer) { $object->label = trim($label); - $object->morphy = trim($morphy); + $object->morphy = trim($morphy); $object->statut = (int) $statut; $object->subscription = (int) $subscription; + $object->duration_value = $duration_value; + $object->duration_unit = $duration_unit; $object->note = trim($comment); $object->mail_valid = trim($mail_valid); $object->vote = (int) $vote; @@ -159,9 +164,11 @@ if ($action == 'update' && $user->rights->adherent->configurer) $object->oldcopy = clone $object; $object->label = trim($label); - $object->morphy = trim($morphy); + $object->morphy = trim($morphy); $object->statut = (int) $statut; $object->subscription = (int) $subscription; + $object->duration_value = $duration_value; + $object->duration_unit = $duration_unit; $object->note = trim($comment); $object->mail_valid = trim($mail_valid); $object->vote = (boolean) trim($vote); @@ -209,6 +216,7 @@ if ($action == 'confirm_delete' && $user->rights->adherent->configurer) */ $form=new Form($db); +$formproduct = new FormProduct($db); llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); @@ -329,7 +337,7 @@ if ($action == 'create') dol_fiche_head(''); - print '
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; + print '
'; print ''; print ''; @@ -354,6 +362,11 @@ if ($action == 'create') print $form->selectyesno("vote", 0, 1); print ''; + print ''; + print ''; @@ -417,7 +430,7 @@ if ($rowid > 0) print '
'; print '
'; - print '
'.$langs->trans("Label").'
'.$langs->trans("Duration").''; + print ' '; + print $formproduct->selectMeasuringUnits("duration_unit", "time", $_POST["duration_unit"], 0, 1); + print '
'.$langs->trans("Description").''; print '
'; + print '
'; print ''; + print ''; + print '"; @@ -592,6 +617,7 @@ if ($rowid > 0) } print ''; + print ''; print ''; print '
'; @@ -761,7 +787,7 @@ if ($rowid > 0) dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group'); - print '
'.$langs->trans("Status").''; if ( !empty($object->statut) ) { @@ -439,6 +452,18 @@ if ($rowid > 0) print yn($object->vote); print '
'.$langs->trans("Duration").''.$object->duration_value.' '; + if ($object->duration_value > 1) + { + $dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years")); + } + elseif ($object->duration_value > 0) + { + $dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); + } + print (! empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." "; + print '
'.$langs->trans("Description").''; print nl2br($object->note)."
'; + print '
'; print ''; @@ -787,6 +813,11 @@ if ($rowid > 0) print $form->selectyesno("vote", $object->vote, 1); print ''; + print ''; + print ''; @@ -796,9 +827,12 @@ if ($rowid > 0) $doleditor->Create(); print ""; + // Other attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; + // Other attributes $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $act, $action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { @@ -807,33 +841,6 @@ if ($rowid > 0) print '
'.$langs->trans("Ref").''.$object->id.'
'.$langs->trans("Duration").''; + print ' '; + print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1); + print '
'.$langs->trans("Description").''; print '
'; - // Extra field - if (empty($reshook)) - { - print '

'; - if (is_array($extrafields->attributes['adherent_type']['label'])) - { - foreach($extrafields->attributes['adherent_type']['label'] as $key=>$label) - { - if (isset($_POST["options_" . $key])) { - if (is_array($_POST["options_" . $key])) { - // $_POST["options"] is an array but following code expects a comma separated string - $value = implode(",", $_POST["options_" . $key]); - } else { - $value = $_POST["options_" . $key]; - } - } else { - $value = $object->array_options["options_" . $key]; - } - - print '\n"; - } - } - print '
'.$label.''; - print $extrafields->showInputField($key, $value); - print "


'; - } - dol_fiche_end(); print '
'; diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 35704c592f9..847c259b6b2 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -99,7 +99,7 @@ dol_banner_tab($object, 'rowid', $linkback); print '
'; print '
'; -print ''; +print '
'; // LDAP DN print '\n"; diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 5a4f84868e1..673b6ef55b8 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -232,7 +232,7 @@ if ($action == 'edit') print "
".($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"')."
"; print '
'; - print '
LDAP '.$langs->trans("LDAPMemberTypeDn").''.$conf->global->LDAP_MEMBER_TYPE_DN."
'; + print '
'; print ''; print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found if ($num == 0) diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 7cc2e7dff44..d0c4e0dc542 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -203,7 +203,7 @@ dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending'); print load_fiche_titre($langs->trans("SendingsNumberingModules")); -print '
'.$langs->trans('Label').'
'.$langs->trans('Description').''; $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); @@ -264,7 +264,7 @@ elseif ($action != 'add') print '
'; print '
'; - print ''; + print '
'; print ''; print ''; print '
'.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'; @@ -293,7 +293,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) dol_fiche_head(); - print ''; + print '
'; print ''; diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index bfde50618cc..3f2e89f4f92 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -109,7 +109,7 @@ print '' print ''; print ''; -print '
'.$langs->trans('Language').''; print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1); print '
'; +print '
'; print ''."\n"; // Name diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index c253f6cbe91..0a87f4eda17 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -141,7 +141,7 @@ print ''.$langs->trans("AgendaAutoActionDesc")." ".$ print "
\n"; print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index beccc9e9d5a..970d8675873 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -221,7 +221,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print load_fiche_titre($langs->trans("AgendaModelModule"), '', ''); - print '
'."\n"; + print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; @@ -324,6 +324,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) } print ''; +print ''; print ''; print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 57a20b8bf42..614d4ef4407 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -180,6 +180,7 @@ $head=agenda_prepare_head(); dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action'); print ''; +print ''; print ''; print '
'."\n"; diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index f3c16941ebc..b5f3fbafdc3 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -87,7 +87,7 @@ dol_fiche_head($head, 'xcal', $langs->trans("Agenda"), -1, 'action'); print ''.$langs->trans("AgendaSetupOtherDesc")."
\n"; print "
\n"; -print '
'; +print '
'; print ''; print ""; @@ -121,7 +121,7 @@ print '
".$langs->trans("Parameter")."
'; print '
'; -print ''; +print '
'; print ''; print '"; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 70b273e2fcc..c0150ce5111 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -233,7 +233,7 @@ dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account' //Show bank account order print load_fiche_titre($langs->trans("BankOrderShow"), '', ''); -print '
'.$langs->trans("Parameter")."
'; +print '
'; print ''; print ''; print ''; @@ -431,7 +431,7 @@ print '
' . $langs->trans("Name") . '' . $langs->trans("Description") . '
'; print '

'; print load_fiche_titre($langs->trans("BankColorizeMovement"), '', ''); -print ''; +print '
'; print "\n"; print ''; print ''."\n"; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index a209a5f5590..873f14ea68e 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -200,7 +200,7 @@ if (empty($conf->use_javascript_ajax)) print ''; } -print '
' . $langs->trans("Name") . ''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; @@ -309,7 +309,7 @@ print ""; print ''; print ""; -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -366,7 +366,7 @@ if ($conf->product->enabled) { print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', ''); - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 43f3fe0584a..52a468b878d 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -209,7 +209,7 @@ dol_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom'); print load_fiche_titre($langs->trans("BOMsNumberingModules"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -464,7 +464,7 @@ print "
"; */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 1e158bc7a7f..10bfa0030a8 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -456,7 +456,7 @@ print load_fiche_titre($langs->trans("Other")); print ''; print ''; print ''; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 629018ba998..c4c6e4506d9 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -111,7 +111,7 @@ dol_fiche_head($head, 'checkreceipts', $langs->trans("BankSetupModule"), -1, 'ac print load_fiche_titre($langs->trans("ChequeReceiptsNumberingModule"), '', ''); -print '
'.$langs->trans("Parameter").'
'; +print '
'; print ''; print ''; print ''; @@ -240,7 +240,7 @@ print ''; print ''; print ''; -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 0c3514015f2..fbf8bc63b6d 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -73,7 +73,7 @@ print ''; print ''; print ''; -print '
'.$langs->trans("Parameters").' 
'; +print '
'; print ''; print ''; print ''; @@ -119,6 +119,7 @@ if (! empty($conf->global->CLICKTODIAL_URL)) if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest'); print ''; + print ''; print $langs->trans("LinkToTestClickToDial", $user->login).' : '; print ''; print ''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 10955b5e8bd..764db492959 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -262,7 +262,7 @@ dol_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order'); print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; @@ -521,7 +521,7 @@ print "
"; */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -659,7 +659,7 @@ print '
'; */ print load_fiche_titre($langs->trans("Notifications"), '', ''); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 09a4e95c0ae..bdfb783ce12 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -403,7 +403,7 @@ print ''; print ''; -print '
'.$langs->trans("Parameter").'
'; +print '
'; print ''."\n"; // Name @@ -519,7 +519,7 @@ print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; print '
'; // IDs of the company (country-specific) -print ''; +print '
'; print ''; $langs->load("companies"); @@ -658,7 +658,7 @@ print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; // Fiscal year start print '
'; -print ''; +print '
'; print ''; print ''; print "\n"; @@ -671,7 +671,7 @@ print "
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
"; // Fiscal options print '
'; -print ''; +print '
'; print ''; print ''; print ''; @@ -704,7 +704,7 @@ if ($mysoc->useLocalTax(1)) { // Local Tax 1 print '
'; - print '
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; + print '
'; print ''; print ''; print ''; @@ -747,7 +747,7 @@ if ($mysoc->useLocalTax(2)) { // Local Tax 2 print '
'; - print '
'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 0955d7c6d17..25cf1df9a11 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -110,7 +110,7 @@ print ''; print ''; print ''; -print '
'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
'; +print '
'; // case of the parameter ACCOUNTING_MODE @@ -138,7 +138,7 @@ print "
\n"; print "
\n"; -print ''; +print '
'; print ''; print ''; print "\n"; diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index 06cf38c71cc..29940f95d56 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -97,7 +97,7 @@ dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending'); // Miscellaneous parameters -print '
'.$langs->trans('OtherOptions').'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 795a38c867d..b3b1637e4fd 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -198,7 +198,7 @@ print ''; print ''; print '
'; -print '
'.$langs->trans("Feature").' 
'; +print '
'; print ''; print getTitleFieldOfList('Name', 0, $_SERVER['PHP_SELF'], 'name', '', $param, '', $sortfield, $sortorder, '')."\n"; print ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 7f123c0f367..2938f97feef 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -199,7 +199,7 @@ dol_fiche_head($head, 'contract', $langs->trans("Contracts"), -1, 'contract'); print load_fiche_titre($langs->trans("ContractsNumberingModules"), '', ''); -print '
'.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; @@ -323,7 +323,7 @@ else } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -460,7 +460,7 @@ print ''; print ''; print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 1d187c57e17..a531a9c870c 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -77,7 +77,7 @@ if ($action == 'edit') print ''; print ''; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) @@ -116,7 +116,7 @@ if ($action == 'edit') } else { - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 6f2b4cea089..77969820598 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -93,7 +93,7 @@ print ''; print ''; print ''; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 40ffed80e60..f4922a33bbb 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -245,7 +245,7 @@ print ''; print ''; print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; // Page $texthelp=$langs->trans("PageUrlForDefaultValues"); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 7e724c52280..23a9aa4b3b1 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -186,7 +186,7 @@ if ($action == 'edit') print ''; print ''; - print '
'; + print '
'; print ''; foreach($modules as $module => $delays) @@ -209,7 +209,7 @@ if ($action == 'edit') print '
'; // Show if meteo is enabled - print '
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'; + print '
'; print ''; print ''; @@ -225,7 +225,7 @@ else * Show parameters */ - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; foreach($modules as $module => $delays) @@ -248,7 +248,7 @@ else print '
'; // Show if meteo is enabled - print '
'.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
'; + print '
'; print ''; print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index af61dd1c09f..8254c5931b8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -11,6 +11,7 @@ * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,7 +89,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,32,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0); +$taborder=array(9,0,4,3,2,0,1,8,19,16,27,38,0,5,11,0,32,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0); // Name of SQL tables of dictionaries $tabname=array(); @@ -130,6 +131,7 @@ $tabname[34]= MAIN_DB_PREFIX."c_hrm_function"; $tabname[35]= MAIN_DB_PREFIX."c_exp_tax_cat"; $tabname[36]= MAIN_DB_PREFIX."c_exp_tax_range"; $tabname[37]= MAIN_DB_PREFIX."c_units"; +$tabname[38]= MAIN_DB_PREFIX."c_socialnetworks"; // Dictionary labels $tablib=array(); @@ -170,6 +172,7 @@ $tablib[34]= "DictionaryFunction"; $tablib[35]= "DictionaryExpenseTaxCat"; $tablib[36]= "DictionaryExpenseTaxRange"; $tablib[37]= "DictionaryMeasuringUnits"; +$tablib[38]= "DictionarySocialNetworks"; // Requests to extract data $tabsql=array(); @@ -210,6 +213,7 @@ $tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PRE $tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c"; $tabsql[36]= "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r"; $tabsql[37]= "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r"; +$tabsql[38]= "SELECT rowid, entity, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks"; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -250,6 +254,7 @@ $tabsqlsort[34]="code ASC"; $tabsqlsort[35]="c.label ASC"; $tabsqlsort[36]="r.fk_c_exp_tax_cat ASC, r.range_ik ASC"; $tabsqlsort[37]="r.unit_type ASC, r.scale ASC, r.code ASC"; +$tabsqlsort[38]="rowid, code ASC"; // Field names in select result for dictionary display $tabfield=array(); @@ -290,6 +295,7 @@ $tabfield[34]= "code,label"; $tabfield[35]= "label"; $tabfield[36]= "range_ik,fk_c_exp_tax_cat"; $tabfield[37]= "code,label,short_label,unit_type,scale"; +$tabfield[38]= "code,label,url,icon,entity"; // Edit field names for editing a record $tabfieldvalue=array(); @@ -330,6 +336,7 @@ $tabfieldvalue[34]= "code,label"; $tabfieldvalue[35]= "label"; $tabfieldvalue[36]= "range_ik,fk_c_exp_tax_cat"; $tabfieldvalue[37]= "code,label,short_label,unit_type,scale"; +$tabfieldvalue[38]= "code,label,url,icon"; // Field names in the table for inserting a record $tabfieldinsert=array(); @@ -371,6 +378,7 @@ $tabfieldinsert[34]= "code,label"; $tabfieldinsert[35]= "label"; $tabfieldinsert[36]= "range_ik,fk_c_exp_tax_cat"; $tabfieldinsert[37]= "code,label,short_label,unit_type,scale"; +$tabfieldinsert[38]= "code,label,url,icon,entity"; // Rowid name of field depending if field is autoincrement on or off.. // Use "" if id field is "rowid" and has autoincrement on @@ -413,6 +421,7 @@ $tabrowid[34]= "rowid"; $tabrowid[35]= ""; $tabrowid[36]= ""; $tabrowid[37]= ""; +$tabrowid[38]= ""; // Condition to show dictionary in setup page $tabcond=array(); @@ -453,6 +462,7 @@ $tabcond[34]= ! empty($conf->hrm->enabled); $tabcond[35]= ! empty($conf->expensereport->enabled); $tabcond[36]= ! empty($conf->expensereport->enabled); $tabcond[37]= ! empty($conf->product->enabled); +$tabcond[38]= ! empty($conf->socialnetworks->enabled); // List of help for fields $tabhelp=array(); @@ -493,6 +503,7 @@ $tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[35] = array(); $tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange')); $tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[38] = array('code'=>$langs->trans("EnterAnyCode"), 'url' => $langs->trans('UrlSocialNetworksDesc'), 'icon' => $langs->trans('FafaIconSocialNetworksDesc')); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); @@ -533,6 +544,7 @@ $tabfieldcheck[34] = array(); $tabfieldcheck[35] = array(); $tabfieldcheck[36] = array(); $tabfieldcheck[37] = array(); +$tabfieldcheck[38] = array(); // Complete all arrays with entries found into modules complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck); @@ -1048,7 +1060,7 @@ if ($id) $fieldlist=explode(',', $tabfield[$id]); print '
'; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; // Line for title print ''; @@ -1230,7 +1242,7 @@ if ($id) } print '
'; - print '
'; + print '
'; // Title line with search input fields print ''; @@ -1712,7 +1724,7 @@ else $lastlineisempty=false; print '
'; - print '
'; + print '
'; print ''; print ''; print ''; @@ -1999,9 +2011,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent'; print '
'.$langs->trans("Dictionary").''.$langs->trans("Table").''; $transfound=0; + $transkey=''; if (in_array($fieldlist[$field], array('label','libelle'))) // For label { - $transkey=''; // Special case for labels if ($tabname == MAIN_DB_PREFIX.'c_civility') { $transkey="Civility".strtoupper($obj->code); diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 067ed0ea353..2fcf3fe6422 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -74,7 +74,7 @@ $linkback=''; -print ''; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 04accc01bbf..43d0731c434 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -40,12 +40,12 @@ if (empty($conf->emailcollector->enabled)) accessforbidden(); $langs->loadLangs(array("admin", "mails", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); -$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectcard'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $operationid = GETPOST('operationid', 'int'); @@ -53,7 +53,7 @@ $operationid = GETPOST('operationid', 'int'); // Initialize technical objects $object = new EmailCollector($db); $extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->emailcollector->dir_output . '/temp/massgeneration/' . $user->id; +$diroutputmassaction = $conf->emailcollector->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('emailcollectorcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels @@ -65,14 +65,14 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen $search_all = trim(GETPOST("search_all", 'alpha')); $search = array(); foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (GETPOST('saveoperation2')) $action = 'updateoperation'; -if (empty($action) && empty($id) && empty($ref)) $action='view'; +if (empty($action) && empty($id) && empty($ref)) $action = 'view'; // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. // Security check - Protection if external user //if ($user->socid > 0) access_forbidden(); @@ -80,12 +80,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu //$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0); //$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); -$permissionnote=$user->rights->emailcollector->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink=$user->rights->emailcollector->write; // Used by the include of actions_dellink.inc.php -$permissionedit=$user->rights->emailcollector->write; // Used by the include of actions_lineupdown.inc.php -$permissiontoadd=$user->rights->emailcollector->write; // Used by the include of actions_addupdatedelete.inc.php +$permissionnote = $user->rights->emailcollector->write; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->emailcollector->write; // Used by the include of actions_dellink.inc.php +$permissiontoadd = $user->rights->emailcollector->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$debuginfo=''; +$debuginfo = ''; /* @@ -100,8 +99,8 @@ if (empty($reshook)) { $error = 0; - $permissiontoadd=1; - $permissiontodelete=1; + $permissiontoadd = 1; + $permissiontodelete = 1; if (empty($backtopage)) $backtopage = DOL_URL_ROOT.'/admin/emailcollector_card.php?id='.($id > 0 ? $id : '__ID__'); $backurlforlist = DOL_URL_ROOT.'/admin/emailcollector_list.php'; @@ -253,10 +252,10 @@ jQuery(document).ready(function() { if ($action == 'create') { print load_fiche_titre($langs->trans("NewEmailCollector", $langs->transnoentitiesnoconv("EmailCollector"))); - print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; dol_fiche_head(array(), ''); @@ -265,19 +264,19 @@ if ($action == 'create') { //unset($fields[]); // Common attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; print '
'.$langs->trans("Description").' 
'."\n"; dol_fiche_end(); print '
'; - print ''; + print ''; print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage + print ''; // Cancel for create does not post form if we don't know the backtopage print '
'; print ''; @@ -288,28 +287,28 @@ if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("EmailCollector")); - print '
'; - print ''; + print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; dol_fiche_head(); - print '' . "\n"; + print '
'."\n"; // Common attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; print '
'; dol_fiche_end(); - print '
'; - print '   '; + print '
'; + print '   '; print '
'; print ''; @@ -331,14 +330,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteEmailCollector'), $langs->trans('ConfirmDeleteEmailCollector'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteEmailCollector'), $langs->trans('ConfirmDeleteEmailCollector'), 'confirm_delete', '', 0, 1); } // Clone confirmation if ($action == 'clone') { // Create an array for form $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneEmailCollector', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneEmailCollector', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Confirmation of action process @@ -346,21 +345,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formquestion = array( 'text' => $langs->trans("EmailCollectorConfirmCollect"), ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('EmailCollectorConfirmCollectTitle'), $text, 'confirm_collect', $formquestion, 0, 1, 220); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('EmailCollectorConfirmCollectTitle'), $text, 'confirm_collect', $formquestion, 0, 1, 220); } // Call Hook formConfirm $parameters = array('lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; - elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; + if (empty($reshook)) $formconfirm .= $hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint; // Print form confirm print $formconfirm; // Object card // ------------------------------------------------------------ - $linkback = '
' . $langs->trans("BackToList") . ''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -409,7 +408,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtml = $langs->trans("NbOfEmailsInInbox").' : '; $sourcedir = $object->source_directory; - $targetdir = ($object->target_directory ? $object->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag' + $targetdir = ($object->target_directory ? $object->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag' $connection = null; $connectstringserver = ''; @@ -429,7 +428,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtml .= 'IMAP functions not available on your PHP'; } - if (! $connection) + if (!$connection) { $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; } @@ -452,19 +451,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Common attributes //$keyforbreak='fieldkeytoswithonsecondcolumn'; - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print '
'; - print '
'; - print ''; + print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; // Filters print ''; @@ -474,7 +473,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Add filter print ''; print ''; print ''; // List filters - foreach($object->filters as $rulefilter) + foreach ($object->filters as $rulefilter) { - $rulefilterobj=new EmailCollectorFilter($db); + $rulefilterobj = new EmailCollectorFilter($db); $rulefilterobj->fetch($rulefilter['id']); print ''; @@ -553,16 +552,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Add operation print ''; print ''; @@ -572,11 +571,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // List operations $nboflines = count($object->actions); $table_element_line = 'emailcollector_emailcollectoraction'; - $fk_element='position'; - $i=0; - foreach($object->actions as $ruleaction) + $fk_element = 'position'; + $i = 0; + foreach ($object->actions as $ruleaction) { - $ruleactionobj=new EmailcollectorAction($db); + $ruleactionobj = new EmailcollectorAction($db); $ruleactionobj->fetch($ruleaction['id']); print ''; @@ -605,7 +604,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print ''.img_up('default', 0, 'imgupforline').''; } - if ($i < count($object->actions)-1) { + if ($i < count($object->actions) - 1) { print ''.img_down('default', 0, 'imgdownforline').''; } print ''; @@ -621,15 +620,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print '
'; - $arrayoftypes=array( + $arrayoftypes = array( 'from'=>array('label'=>'MailFrom', 'data-placeholder'=>$langs->trans('SearchString')), 'to'=>array('label'=>'MailTo', 'data-placeholder'=>$langs->trans('SearchString')), 'cc'=>array('label'=>'Cc', 'data-placeholder'=>$langs->trans('SearchString')), @@ -510,10 +509,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea else { jQuery("#rulevalue").prop("disabled", false); } jQuery("#rulevalue").attr("placeholder", (jQuery("#filtertype option:selected").attr("data-placeholder"))); '; - $noparam=array(); - foreach($arrayoftypes as $key => $value) + $noparam = array(); + foreach ($arrayoftypes as $key => $value) { - if ($value['noparam']) $noparam[]=$key; + if ($value['noparam']) $noparam[] = $key; } print '})'; print ''."\n"; @@ -524,9 +523,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; - $arrayoftypes=array( + $arrayoftypes = array( 'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")), 'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")), 'recordevent'=>'RecordEvent'); - if ($conf->projet->enabled) $arrayoftypes['project']='CreateLeadAndThirdParty'; - if ($conf->ticket->enabled) $arrayoftypes['ticket']='CreateTicketAndThirdParty'; + if ($conf->projet->enabled) $arrayoftypes['project'] = 'CreateLeadAndThirdParty'; + if ($conf->ticket->enabled) $arrayoftypes['ticket'] = 'CreateTicketAndThirdParty'; print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300'); print ''; print ''; - $htmltext=$langs->transnoentitiesnoconv("OperationParamDesc"); + $htmltext = $langs->transnoentitiesnoconv("OperationParamDesc"); //var_dump($htmltext); print $form->textwithpicto('', $htmltext); print '
'; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { $urltorefreshaftermove = DOL_URL_ROOT.'/admin/emailcollector_card.php?id='.$id; - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } print '
'; print '
'; - print ''; // End
+ print '
'; // End
print '

'; @@ -638,26 +637,26 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Buttons for actions if ($action != 'presend' && $action != 'editline') { - print '
' . "\n"; + 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)) { - print ''; + print ''; // Clone - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; } - print '
' . "\n"; + print '
'."\n"; } - if (! empty($debuginfo)) + if (!empty($debuginfo)) { print info_admin($debuginfo); } diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index e8b2e280a7f..9cb83e3784b 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -156,8 +156,8 @@ if (empty($reshook)) // Mass actions $objectclass='EmailCollector'; $objectlabel='EmailCollector'; - $permtoread = $user->rights->emailcollector->read; - $permtodelete = $user->rights->emailcollector->delete; + $permissiontoread = $user->rights->emailcollector->read; + $permissiontodelete = $user->rights->emailcollector->delete; $uploaddir = $conf->emailcollector->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -497,26 +497,8 @@ while ($i < min($num, $limit)) } // Show total line -if (isset($totalarray['pos'])) -{ - print '
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; +print '
'; print ''; print ''; print ''; @@ -332,7 +332,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 8a5cef82ceb..3139de4849d 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -211,7 +211,7 @@ dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'tri print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -334,7 +334,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -466,7 +466,7 @@ print ''; print ''; print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index 4d10403c692..66897261207 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -110,7 +110,7 @@ if ($action == 'edit') echo ''; -echo '
'.$langs->trans("Parameter").'
'; +echo '
'; foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) { diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index a785d5f2927..610bd875c4f 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -161,7 +161,7 @@ if ($action != 'edit') echo ''; echo ''; - echo '
'; + echo '
'; echo ''; echo ''; @@ -204,7 +204,7 @@ if ($action == 'edit') echo ''; } -echo '
'.$langs->trans('ExpenseReportApplyTo').'
'; +echo '
'; echo ''; echo ''; diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index b12dcf4c530..4812b056e6a 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -72,7 +72,7 @@ $h++; dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "exports"); -print '
'.$langs->trans('ExpenseReportApplyTo').'
'; +print '
'; print ''; print ''."\n"; print ''; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 4bb2bf1c964..c73567a5745 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -200,7 +200,7 @@ print '
'; print ''; print ''; -print '
'.$langs->trans("Parameters").' 
'; +print '
'; print ''; print ''; print ''; @@ -254,7 +254,7 @@ if ($resql) print "
"; print ""; - print '
'.$langs->trans("NewRSS").''.$langs->trans("Example").'
'; + print '
'; print ''; print ""; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index dccfcdfdda1..6f1f621b90a 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -279,7 +279,7 @@ dol_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoice'); print load_fiche_titre($langs->trans("BillsNumberingModule"), '', ''); -print '
'; +print '
'; print ''; print ''; print ''; @@ -468,7 +468,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -607,7 +607,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf print ''; print ''; print ''; - print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; + print '
'; print ''; print ''; print ''; @@ -648,7 +648,7 @@ print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice print ''; print ''; -print '
'.$langs->trans("Type").''.$langs->trans("Name").'
'; +print '
'; print ''; print '
'; @@ -738,7 +738,7 @@ print ""; print "
"; print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print ''; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index 71fc1f8eac2..0378f5cf0d4 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -85,7 +85,7 @@ print ''; _updateBtn(); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; _printOnOff('INVOICE_USE_SITUATION', $langs->trans('UseSituationInvoices')); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index c2c49eb4943..efe8ca1117d 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -149,7 +149,7 @@ if (empty($conf->use_javascript_ajax)) } else { - print '
'; + print '
'; print ''; print ''; print ''; @@ -185,6 +185,7 @@ else print '
'."\n"; print ''."\n"; + print ''; // Skins show_skin(null, 1); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 876f4b90abb..14fc247a540 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -270,7 +270,7 @@ dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'interve print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', ''); -print '
'.$langs->trans("ActivateFCKeditor").''.$langs->trans("Action").'
'; +print '
'; print ''; print ''; print ''; @@ -395,7 +395,7 @@ else } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -519,7 +519,7 @@ print "
"; */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 7ed797b8618..0baf9a6cdc1 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -99,7 +99,7 @@ print ''; print ''; print ''; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 2d3f986e6a1..f0b0218c0e5 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -202,7 +202,7 @@ dol_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday'); print load_fiche_titre($langs->trans("HolidaysNumberingModules"), '', ''); print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; @@ -339,7 +339,7 @@ else print '
'; -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -479,7 +479,7 @@ print ''; print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'; -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index dfbb548f5e0..d2044436937 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -233,7 +233,7 @@ print ''; clearstatcache(); print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; @@ -259,7 +259,7 @@ showSkins(null, 1); print '
'; // Other -print '
'.$langs->trans("Language").' 
'; +print '
'; print ''; print ''; print ''; @@ -375,7 +375,7 @@ print '
'.$langs->trans("Miscellaneous").' 
'."\n"; print '
'; // Other -print ''; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index dba2cee41a5..00158dbb5e6 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -111,7 +111,7 @@ print ''; dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1); -print '
'.$langs->trans("LoginPage").' 
'; +print '
'; // Liste de synchro actives print ''; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index c466f4e6c1e..4e49bee1d44 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -116,7 +116,7 @@ print '
'; print ''; print ''; -print '
'; +print '
'; print ''; print ''; @@ -138,7 +138,7 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeContacts").'
'; print '
'; -print ''; +print '
'; print ''; print ''; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 17f156ca223..dc3f8638e10 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -109,7 +109,7 @@ print ''; $form=new Form($db); -print '
'.$langs->trans("LDAPDolibarrMapping").'
'; +print '
'; print ''; print ''; @@ -131,7 +131,7 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeGroups").'
'; print '
'; -print ''; +print '
'; print ''; print ''; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 618e5ac87d5..457e63d0330 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -133,7 +133,7 @@ dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescMembers").'
'; print '
'; -print '
'.$langs->trans("LDAPDolibarrMapping").'
'; +print '
'; print ''; print ''; @@ -162,7 +162,7 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeMembers").'
'; print '
'; -print ''; +print '
'; print ''; print ''; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 45d0d488c8a..2a2aff88507 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -107,7 +107,7 @@ print ''; $form=new Form($db); -print '
'.$langs->trans("LDAPDolibarrMapping").'
'; +print '
'; print ''; print ''; @@ -129,7 +129,7 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeMembersTypes").'
'; print '
'; -print ''; +print '
'; print ''; print ''; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 8d1f7d3279e..1b800612d62 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -129,7 +129,7 @@ print $langs->trans("LDAPDescUsers").'
'; print '
'; -print '
'.$langs->trans("LDAPDolibarrMapping").'
'; +print '
'; print ''; print ''; @@ -158,7 +158,7 @@ print ''; print '
'.$langs->trans("LDAPSynchronizeUsers").'
'; print '
'; -print ''; +print '
'; print ''; print ''; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 27f99ecb4f1..f7b32a2c5ef 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -101,7 +101,7 @@ if ($action == 'edit') clearstatcache(); - print '
'.$langs->trans("LDAPDolibarrMapping").'
'; + print '
'; print ''; @@ -135,7 +135,7 @@ if ($action == 'edit') } else { - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; + print '
'; print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 794020cfc95..ea9197a80bb 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -194,7 +194,7 @@ dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending'); print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"), '', ''); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; @@ -322,7 +322,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -440,7 +440,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; print "
"; print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print ''; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 46d104736b0..ccc33ab3cee 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -89,7 +89,7 @@ print ''; /* * Params */ -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print "\n"; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 6ff32e1d406..715633ca77e 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -105,7 +105,7 @@ print ''; print ''; print ''; -print '
' . $langs->trans('Options') . '
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 61fb0448c8b..d459de3707b 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -257,7 +257,7 @@ if ($action == 'edit') clearstatcache(); - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; // Disable @@ -520,7 +520,7 @@ else print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; // Disable diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 94f3820c5b9..ace92914c4b 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -225,7 +225,7 @@ if ($action == 'edit') clearstatcache(); - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; // Method @@ -398,7 +398,7 @@ else print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; // Method diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index eb432b0dc72..028de9a32a5 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -148,8 +148,8 @@ if (empty($reshook)) // Mass actions $objectclass='EmailSenderProfile'; $objectlabel='EmailSenderProfile'; - $permtoread = $user->admin; - $permtodelete = $user->admin; + $permissiontoread = $user->admin; + $permissiontodelete = $user->admin; $uploaddir = $conf->admin->dir_output.'/senderprofiles'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -461,26 +461,8 @@ while ($i < min($num, $limit)) } // Show total line -if (isset($totalarray['pos'])) -{ - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found if ($num == 0) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 7ac91d51c8d..aa8a7e79719 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -451,7 +451,7 @@ print ''; print ''; print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; +print '
'; // Line to enter new values (title) print ''; @@ -597,7 +597,7 @@ print ''; print ''; print '
'; -print '
'; +print '
'; // List of available record in database dol_syslog("htdocs/admin/dict", LOG_DEBUG); diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 4187c4d3eb4..fdbf34a5e13 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -162,7 +162,7 @@ print "
\n"; clearstatcache(); // Gestionnaires de menu -print '
'; +print '
'; print ''; print '
'.$langs->trans("Menu").''; print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc")); diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 5a54a9e5c9f..f0ebb0f7794 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -313,7 +313,7 @@ if ($action == 'create') dol_fiche_head(); - print ''; + print '
'; // Id $parent_rowid = GETPOST('menuId', 'int'); @@ -436,7 +436,7 @@ elseif ($action == 'edit') dol_fiche_head(); - print '
'; + print '
'; $menu = new Menubase($db); $result=$menu->fetch(GETPOST('menuId', 'int')); diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index e339b1854d8..b3df54ea265 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -81,7 +81,7 @@ dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1); // Other Options -print '
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 06c59338e58..359119e9091 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -210,7 +210,7 @@ dol_fiche_head($head, 'settings', $langs->trans("MOs"), -1, 'mrp'); print load_fiche_titre($langs->trans("MOsNumberingModules"), '', ''); -print '
'.$langs->trans("Parameters").''.$langs->trans("Status").'
'; +print '
'; print ''; print ''; print ''; @@ -465,7 +465,7 @@ print "
"; */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 63000d61c8b..515340efe89 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -186,7 +186,7 @@ $head = multicurrencyAdminPrepareHead(); dol_fiche_head($head, 'settings', $langs->trans("ModuleSetup"), -1, "multicurrency"); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''."\n"; print ''."\n"; @@ -270,7 +270,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print ''; print '
'; - print '
'.$langs->trans("Parameters").''.$langs->trans("Status").'
'; + print '
'; $urlforapilayer='https://currencylayer.com'; //https://apilayer.net @@ -309,7 +309,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) } print '
'; -print '
'; +print '
'; print ''; print ''."\n"; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 52de58b80b8..fb2be946169 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -123,7 +123,7 @@ print ''; print ''; print ''; -print '
'.$form->textwithpicto($langs->trans("CurrenciesUsed"), $langs->transnoentitiesnoconv("CurrenciesUsed_help_to_add")).'
'; +print '
'; print ''; print ''; print ''; @@ -146,7 +146,7 @@ $title=$langs->trans("ListOfNotificationsPerUser"); if (! empty($conf->societe->enabled)) $title=$langs->trans("ListOfNotificationsPerUserOrContact"); print load_fiche_titre($title, '', ''); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; /*print ''; @@ -192,7 +192,7 @@ print '

'; print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', ''); -print '
'.$langs->trans("Label").''.$langs->trans("Code").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index b0795152d05..780f22894e9 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -90,7 +90,7 @@ dol_fiche_head($head, 'services', '', -1, 'technic'); print $langs->trans("ListOfSupportedOauthProviders").'

'; -print '
'.$langs->trans("Module").''.$langs->trans("Code").'
'; +print '
'; $i=0; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index bb3c83c2ee2..125ef2458b7 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -221,7 +221,7 @@ if ($mode == 'setup' && $user->admin) print ''; - print '
'."\n"; + print '
'."\n"; print ''; print ''; @@ -339,7 +339,7 @@ if ($mode == 'test' && $user->admin) { print $langs->trans('PrintTestDesc'.$driver)."

\n"; - print '
'.$langs->trans($key[0]).'
'; + print '
'; if (! empty($driver)) { require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; @@ -366,7 +366,7 @@ if ($mode == 'userconf' && $user->admin) { print $langs->trans('PrintUserConfDesc'.$driver)."

\n"; - print '
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index c29f6816a05..f07d80a109b 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -89,7 +89,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') print ''; print ''; - print '
'.$langs->trans("User").''.$langs->trans("PrintModule").'
'; + print '
'; print ''."\n"; print ''; + print ''; + print ''; + print '
'; } else { print '
'; } print ''; print '

'; - print '
'.$langs->trans("Day").''.$langs->trans("Value").'
'; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 65b66636a10..4fcb3c84786 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -109,7 +109,7 @@ dol_fiche_head($head, 'payment', $langs->trans("Invoices"), -1, 'invoice'); print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', ''); -print ''; +print '
'; print ''; print ''; print ''; @@ -235,7 +235,7 @@ print ''; print ''; print ''; -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index e9346f49a3a..da04a88ac2c 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -134,7 +134,7 @@ clearstatcache(); print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', ''); print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; $selected=$conf->global->MAIN_PDF_FORMAT; @@ -169,7 +169,7 @@ print '
'; print load_fiche_titre($langs->trans("PDFAddressForging"), '', ''); print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; // Hide VAT Intra on address @@ -237,7 +237,7 @@ if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) print load_fiche_titre($title, '', ''); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; // Hide any information on Sale tax / VAT @@ -257,7 +257,7 @@ print '
'; print load_fiche_titre($langs->trans("Other"), '', ''); print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; //Desc @@ -307,7 +307,7 @@ print '
'; print load_fiche_titre($langs->trans("Library"), '', ''); print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'."\n"; +print '
'."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 8e1de4d83b6..23fa06887a9 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -124,7 +124,7 @@ dol_fiche_head($head, 'default', $langs->trans("Security"), -1); print info_admin(showModulesExludedForExternal($modules)).'
'."\n"; print '
'; -print '
'.$langs->trans("Name").'
'; +print '
'; // Show permissions lines $sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault"; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 7dd00938dc9..1d9b181b295 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -210,7 +210,7 @@ print '
'; print ''; print ''; -print '
'; +print '
'; print ''; print ''; @@ -489,7 +489,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) print ''; print ''; - print '
'.$langs->trans("Parameter").'
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index a0f817a40c1..dc58a2c4809 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -258,7 +258,7 @@ dol_fiche_head($head, 'general', $langs->trans("Proposals"), -1, 'propal'); */ print load_fiche_titre($langs->trans("ProposalsNumberingModules"), '', ''); -print '
'.$langs->trans("User").''.$langs->trans("Value").'
'; +print '
'; print ''; print '\n"; print '\n"; @@ -523,7 +523,7 @@ if (empty($conf->facture->enabled)) print ''; print ''; - print '
'.$langs->trans("Name")."'.$langs->trans("Description")."
'; + print '
'; print ''; print '
'; @@ -746,7 +746,7 @@ print "
\n
"; */ print load_fiche_titre($langs->trans("Notifications"), '', ''); -print ''; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 6184bebd97f..8a2b3078c7d 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -166,6 +166,29 @@ if ($action == 'testprinter' && $user->admin) { $action = ''; } +if ($action == 'testtemplate' && $user->admin) { + $error=0; + // if (empty($printerid)) { + // $error++; + // setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); + // } + + // if (! $error) { + // test + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $object = new Facture($db); + //$object->initAsSpecimen(); + $object->fetch(18); + //var_dump($object->lines); + $ret = $printer->sendToPrinter($object, $templateid, 1); + if ($ret == 0) { + setEventMessages($langs->trans("TestTemplateToPrinter", $printername), null); + } else { + setEventMessages($printer->error, $printer->errors, 'errors'); + } + //} + $action = ''; +} if ($action == 'updatetemplate' && $user->admin) { $error=0; @@ -190,6 +213,29 @@ if ($action == 'updatetemplate' && $user->admin) { $action = ''; } +if ($action == 'addtemplate' && $user->admin) { + $error=0; + $db->begin(); + if (empty($templatename)) { + $error++; + setEventMessages($langs->trans("TemplateNameEmpty"), null, 'errors'); + } + + if (! $error) { + $result= $printer->addTemplate($templatename, $template); + if ($result > 0) $error++; + + if (! $error) { + $db->commit(); + setEventMessages($langs->trans("TemplateAdded", $templatename), null); + } else { + $db->rollback(); + dol_print_error($db); + } + } + $action = ''; +} + /* * View @@ -217,15 +263,13 @@ if ($mode == 'config' && $user->admin) { print $langs->trans("ReceiptPrinterDesc")."

\n"; - print '
'.$langs->trans("Parameter").'
'."\n"; + print '
'."\n"; print ''; print ''; print ''; print ''; print ''; print ''; - print ''; - print ''; print "\n"; $ret = $printer->listprinters(); $nbofprinters = count($printer->listprinters); @@ -244,8 +288,6 @@ if ($mode == 'config' && $user->admin) { print ''; print ''; print ''; - print ''; - print ''; print ''; } else { print ''; @@ -255,13 +297,13 @@ if ($mode == 'config' && $user->admin) { // edit icon print ''; + print ''; // delete icon - print ''; + print ''; // test icon - print ''; print ''; @@ -269,7 +311,7 @@ if ($mode == 'config' && $user->admin) { } } - if ($action!='editprinter') { + if ($action != 'editprinter') { if ($nbofprinters > 0) { print ''; print ''; @@ -277,8 +319,6 @@ if ($mode == 'config' && $user->admin) { print ''; print ''; print ''; - print ''; - print ''; print "\n"; } @@ -310,7 +350,7 @@ if ($mode == 'config' && $user->admin) { dol_fiche_head(); print $langs->trans("ReceiptPrinterTypeDesc")."

\n"; - print '
'.$langs->trans("Name").''.$langs->trans("Type").''.$langs->trans("Profile").''.$langs->trans("Parameters").'
'.$printer->profileresprint.'
'.$printer->listprinters[$line]['name'].''; print img_picto($langs->trans("Edit"), 'edit'); - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); - print ''; + print ''; print img_picto($langs->trans("TestPrinter"), 'printer'); print '
'.$langs->trans("Name").''.$langs->trans("Profile").''.$langs->trans("Parameters").'
'."\n"; + print '
'."\n"; print ''; print ''; print ''; @@ -323,7 +363,7 @@ if ($mode == 'config' && $user->admin) { dol_fiche_head(); print $langs->trans("ReceiptPrinterProfileDesc")."

\n"; - print '
'.$langs->trans("CONNECTOR_DUMMY").':'.$langs->trans("CONNECTOR_DUMMY_HELP").'
'.$langs->trans("CONNECTOR_NETWORK_PRINT").':'.$langs->trans("CONNECTOR_NETWORK_PRINT_HELP").'
'.$langs->trans("CONNECTOR_FILE_PRINT").':'.$langs->trans("CONNECTOR_FILE_PRINT_HELP").'
'."\n"; + print '
'."\n"; print ''; print ''; print ''; @@ -345,7 +385,7 @@ if ($mode == 'template' && $user->admin) { dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic'); print $langs->trans("ReceiptPrinterTemplateDesc")."

\n"; - print '
'.$langs->trans("PROFILE_DEFAULT").':'.$langs->trans("PROFILE_DEFAULT_HELP").'
'.$langs->trans("PROFILE_SIMPLE").':'.$langs->trans("PROFILE_SIMPLE_HELP").'
'.$langs->trans("PROFILE_EPOSTEP").':'.$langs->trans("PROFILE_EPOSTEP_HELP").'
'."\n"; + print '
'."\n"; print ''; print ''; print ''; @@ -359,8 +399,7 @@ if ($mode == 'template' && $user->admin) { setEventMessages($printer->error, $printer->errors, 'errors'); } else { $max = count($printer->listprinterstemplates); - for ($line=0; $line < $max; $line++) - { + for ($line=0; $line < $max; $line++) { print ''; if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) { print ''; @@ -368,21 +407,19 @@ if ($mode == 'template' && $user->admin) { print ''; print ''; - print ''; - print ''; } else { print ''; print ''; // edit icon print ''; + print ''; // delete icon - print ''; + print ''; // test icon - print ''; } @@ -392,13 +429,19 @@ if ($mode == 'template' && $user->admin) { print '
'.$langs->trans("Name").''.$langs->trans("Template").'
'; print ''.$printer->listprinterstemplates[$line]['name'].''.nl2br(htmlentities($printer->listprinterstemplates[$line]['template'])).''; print img_picto($langs->trans("Edit"), 'edit'); - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); - print ''; + print ''; print img_picto($langs->trans("TestPrinterTemplate"), 'printer'); print '
'; if ($action!='edittemplate') { + print ''; + print '
'; + print '
'."\n"; + print '
'."\n"; print ''; print ''; print ''; @@ -414,18 +457,6 @@ if ($mode == 'template' && $user->admin) { dol_fiche_end(); } -// to remove after test -// $object=new stdClass(); -// $object->date_time = '2015-11-02 22:30:25'; -// $object->id = 1234; -// $object->customer_firstname = 'John'; -// $object->customer_lastname = 'Deuf'; -// $object->vendor_firstname = 'Jim'; -// $object->vendor_lastname = 'Big'; -// $object->barcode = '3700123862396'; -//$printer->sendToPrinter($object, 1, 16); -//setEventMessages($printer->error, $printer->errors, 'errors'); - // End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 27564d6b4e0..eacf0deaf68 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -208,7 +208,7 @@ dol_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'sending'); print load_fiche_titre($langs->trans("ReceptionsNumberingModules")); -print '
'.$langs->trans("Tag").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -337,7 +337,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index 44e4d1ae9de..4304007d830 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -76,7 +76,7 @@ print ''; print ''; print ''; -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 2089debcf04..9be75bf125b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -241,7 +241,7 @@ if (is_resource($handle)) } asort($arrayhandler); -print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; @@ -291,7 +291,7 @@ print ''; if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ $tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN); print '
'; - print '
'.$langs->trans("RuleForGeneratedPasswords").''.$langs->trans("Example").'
'; + print '
'; print ''; print ''; print ''; @@ -402,7 +402,7 @@ print ""; print ''; print ""; -print '
'.$langs->trans("PasswordPatternDesc").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 0bd2dcdb1be..181ecad5c6b 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -107,7 +107,7 @@ dol_fiche_head($head, 'file', $langs->trans("Security"), -1); $var=false; print '
'; -print '
'.$langs->trans("Parameters").''.$langs->trans("Activated").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index c9bf1ba4357..87cd8519449 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -103,7 +103,7 @@ dol_fiche_head($head, 'misc', $langs->trans("Security"), -1); // Other Options -print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 1f37a36ec4f..5536424e939 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -166,7 +166,7 @@ if ($action == 'edit') clearstatcache(); - print '
'.$langs->trans("Parameters").''.$langs->trans("Status").'
'; + print '
'; print ''; // Disable @@ -209,7 +209,7 @@ else { if (! count($listofmethods)) print '
'.$langs->trans("NoSmsEngine", 'DoliStore').'
'; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; // Disable diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 51bf959bb72..b36106b3e80 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -100,7 +100,7 @@ print '
'; //} // Title rule for stock decrease -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print "\n"; print ''."\n"; @@ -202,7 +202,7 @@ print '
".$langs->trans("RuleForStockManagementDecrease")."'.$langs->trans("Status").'
'; print '
'; // Title rule for stock increase -print ''; +print '
'; print ''; print "\n"; print ''."\n"; @@ -314,7 +314,7 @@ print '
".$langs->trans("RuleForStockManagementIncrease")."'.$langs->trans("Status").'
'; print '
'; -print ''; +print '
'; print ''; print "\n"; print ''."\n"; @@ -392,7 +392,7 @@ if ( if ($virtualdiffersfromphysical) { - print '
".$langs->trans("RuleForStockAvailability")."'.$langs->trans("Status").'
'; + print '
'; print ''; print "\n"; print ''."\n"; @@ -414,7 +414,7 @@ if ($virtualdiffersfromphysical) } -print '
".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."'.$langs->trans("Status").'
'; +print '
'; print ''; print "\n"; @@ -464,7 +464,7 @@ print '
".$langs->trans("Other")."
'; print '
'; if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - print ''; + print '
'; print ''; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 9cb387aedc9..f3f274e93dc 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -217,7 +217,7 @@ dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company'); print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel"), '', ''); -print '
'.$langs->trans("Inventory").''.$langs->trans("Status").'
'; +print '
'; print ''; print ''; print ''; @@ -346,7 +346,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'."\n"; +print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; @@ -465,7 +465,7 @@ print ''; print ''; print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -505,7 +505,7 @@ print ''; */ print load_fiche_titre($langs->trans("Notifications"), '', ''); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index c2a7a5d4077..d5a5d15eec3 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -247,7 +247,7 @@ dol_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company'); print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', ''); -print '
'.$langs->trans("Parameter").'
'; +print '
'; print ''; print ''; print ''; @@ -374,7 +374,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'."\n"; +print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; @@ -487,7 +487,7 @@ print ''; print ''; print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; @@ -590,7 +590,7 @@ print ''; */ print load_fiche_titre($langs->trans("Notifications"), '', ''); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 8da430a9fa1..a66c849d9c7 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -194,7 +194,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Parameter").'
'; +print '
'; print ''; print ''; print ''; @@ -318,7 +318,7 @@ print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; print '
'; print load_fiche_titre($langs->trans("PaymentsPDFModules"), '', ''); -print ''."\n"; +print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 30a85f2af3b..60cc5634c1b 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -227,7 +227,7 @@ dol_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_pr */ print load_fiche_titre($langs->trans("SupplierProposalNumberingModules"), '', ''); -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print '\n"; print '\n"; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index bd93d7a9fc5..96dd3d456b7 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -198,7 +198,7 @@ print load_fiche_titre($langs->trans("SyslogOutput")); print ''; print ''; print ''; -print '
'.$langs->trans("Name")."'.$langs->trans("Description")."
'; +print '
'; print ''; print ''; print ''; @@ -271,7 +271,7 @@ print load_fiche_titre($langs->trans("SyslogLevel")); print ''; print ''; print ''; -print '
'.$langs->trans("Type").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/system/browser.php b/htdocs/admin/system/browser.php index ef5ec419c8f..5035c6c4a7d 100644 --- a/htdocs/admin/system/browser.php +++ b/htdocs/admin/system/browser.php @@ -47,7 +47,7 @@ $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); // Browser print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 4e203a770f7..194c871958d 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -140,7 +140,7 @@ $configfilelib=array( 'Strict mode is on/off' ); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("UserAgent").''.$_SERVER['HTTP_USER_AGENT'].'
'.$langs->trans("BrowserName").''.$tmp['browsername'].'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 6ed657ba8cd..dfd05a7694e 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -43,7 +43,7 @@ print load_fiche_titre($langs->trans("InfoDatabase"), '', 'title_setup'); // Database print '
'; -print '
'.$langs->trans("Label").''.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''."\n"; print ''."\n"; print ''."\n"; @@ -60,7 +60,7 @@ print ''; // Tables print '
'; print '
'; -print '
'.$langs->trans("Database").'
'.$langs->trans("Version").''.$db::LABEL.' '.$db->getVersion().'
'.$langs->trans("DatabaseServer").''.$conf->db->host.'
'; +print '
'; print ''."\n"; print ''."\n"; print '
'.$langs->trans("Tables").'
'.$langs->trans("List").'
'; @@ -80,7 +80,7 @@ else { print '
'; print '
'; - print ''; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 5c55c668b1a..e822371bc4f 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -68,7 +68,7 @@ print load_fiche_titre($title, '', 'title_setup'); // Version print '
'; -print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; +print '
'; print ''."\n"; print '
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')'.DOL_VERSION; // If current version differs from last upgrade @@ -135,7 +135,7 @@ print '
'; // Session print '
'; -print ''; +print '
'; print ''."\n"; print ''."\n"; print ''."\n"; @@ -175,7 +175,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S $shmoparray=dol_listshmop(); print '
'; - print '
'.$langs->trans("Session").''.$langs->trans("Value").'
'.$langs->trans("SessionSavePath").''.session_save_path().'
'.$langs->trans("SessionName").''.session_name().'
'; + print '
'; print ''; print ''; print ''; @@ -198,7 +198,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S // Localisation print '
'; -print '
'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").''.$langs->trans("NbOfEntries").'
'; +print '
'; print ''."\n"; print ''."\n"; print ''."\n"; @@ -337,7 +337,7 @@ $configfileparameters=array( ); print '
'; -print '
'.$langs->trans("LocalisationDolibarrParameters").''.$langs->trans("Value").'
'.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").''.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'
'.$langs->trans("CurrentUserLanguage").''.$langs->getDefaultLang().'
'; +print '
'; print ''; print '
'.$langs->trans("Parameters").' '; print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')'; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 94864123220..b0da228e7a8 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -46,11 +46,11 @@ llxHeader(); print load_fiche_titre($langs->trans("FileCheckDolibarr"), '', 'title_setup'); -print $langs->trans("FileCheckDesc").'

'; +print ''.$langs->trans("FileCheckDesc").'

'; // Version print '
'; -print ''; +print '
'; print ''."\n"; print ''."\n"; print ''."\n"; @@ -239,6 +239,7 @@ if (! $error && $xml) $out.=''; $out.=''; $out.=''; + $out.=''; $out.=''; $out.=''."\n"; $tmpfilelist = dol_sort_array($file_list['missing'], 'filename'); @@ -251,6 +252,9 @@ if (! $error && $xml) $out.=''; $out.='' . "\n"; $out.='' . "\n"; + $out.='' . "\n"; $out.='' . "\n"; $out.="\n"; } @@ -275,7 +279,8 @@ if (! $error && $xml) $out.=''; $out.=''; $out.=''; - $out.=''; + $out.=''; + $out.=''; $out.=''; $out.=''."\n"; $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename'); @@ -290,6 +295,9 @@ if (! $error && $xml) $out.='' . "\n"; $out.='' . "\n"; $out.='' . "\n"; + $out.='' . "\n"; $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $totalsize += $size; $out.='' . "\n"; @@ -301,6 +309,7 @@ if (! $error && $xml) $out.='' . "\n"; $out.='' . "\n"; $out.='' . "\n"; + $out.='' . "\n"; $out.='' . "\n"; $out.='' . "\n"; $out.="\n"; diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 928b193b1ee..cdb9e7dfcea 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -47,7 +47,7 @@ llxHeader(); print load_fiche_titre($langs->trans("SummarySystem"), '', 'title_setup'); -print '
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.'
'.$langs->trans("VersionLastUpgrade").''.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
#' . $langs->trans("Filename") . '' . $langs->trans("ExpectedSize") . '' . $langs->trans("ExpectedChecksum") . '
'.$i.''.$file['filename'].''; + if (! empty($file['expectedsize'])) $out.=dol_print_size($file['expectedsize']); + $out.=''.$file['expectedmd5'].'
' . $langs->trans("Filename") . '' . $langs->trans("ExpectedChecksum") . '' . $langs->trans("CurrentChecksum") . '' . $langs->trans("Size") . '' . $langs->trans("ExpectedSize") . '' . $langs->trans("CurrentSize") . '' . $langs->trans("DateModification") . '
'.$file['filename'].''.$file['expectedmd5'].''.$file['md5'].''; + if ($file['expectedsize']) $out.=dol_print_size($file['expectedsize']); + $out.=''.dol_print_size($size).''.$langs->trans("Total").''.dol_print_size($totalsize).'
'; +print '
'; print "\n"; $dolversion=version_dolibarr(); print "\n"; @@ -55,7 +55,7 @@ print '
Dolibarr
".$langs->trans("Version")."".$dolversion."
'; print "
\n"; -print ''; +print '
'; print "\n"; $osversion=version_os(); print "\n"; @@ -64,7 +64,7 @@ print '
".$langs->trans("OS")."
".$langs->trans("Version")."".$osversion."
'; print "
\n"; // Serveur web -print ''; +print '
'; print "\n"; $apacheversion=version_webserver(); print "\n"; @@ -73,7 +73,7 @@ print '
".$langs->trans("WebServer")."
".$langs->trans("Version")."".$apacheversion."
'; print "
\n"; // Php -print ''; +print '
'; print "\n"; $phpversion=version_php(); print "\n"; @@ -83,7 +83,7 @@ print '
".$langs->trans("PHP")."
".$langs->trans("Version")."".$phpversion."
'; print "
\n"; // Database -print ''; +print '
'; print "\n"; $dblabel=$db::LABEL; $dbversion=$db->getVersion(); @@ -102,7 +102,7 @@ if ($db->type == 'pgsql') print '
'; // Browser -print '
".$langs->trans("Database")."
'; +print '
'; print "\n"; print "\n"; print "\n"; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 9b6d33e5faa..7a53b95fcf2 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -40,7 +40,7 @@ llxHeader(); print load_fiche_titre($langs->trans("AvailableModules"), '', 'title_setup'); -print $langs->trans("ToActivateModule").'
'; +print ''.$langs->trans("ToActivateModule").'
'; print "
\n"; $modules = array(); @@ -103,7 +103,7 @@ foreach($modulesdir as $dir) } print '
'; -print '
".$langs->trans("Browser")."
".$langs->trans("UserAgent")."" .$_SERVER["HTTP_USER_AGENT"]."
".$langs->trans("Smartphone")."".(($conf->browser->layout != 'phone')?$langs->trans("No"):$langs->trans("Yes"))."
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index 33587f3c1c6..7399a218e9c 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -37,7 +37,7 @@ llxHeader(); print load_fiche_titre($langs->trans("InfoOS"), '', 'title_setup'); -print '
'.$langs->trans("Modules").''.$langs->trans("Version").'
'; +print '
'; print ''; print "\n"; diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index afed312cdbd..bcc3aba20d4 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -67,7 +67,7 @@ if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2) } -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print ''; print "\n"; diff --git a/htdocs/admin/system/web.php b/htdocs/admin/system/web.php index b5e8e2c3866..114a251c8f3 100644 --- a/htdocs/admin/system/web.php +++ b/htdocs/admin/system/web.php @@ -45,7 +45,7 @@ llxHeader('', $langs->trans("InfoWebServer")); print load_fiche_titre($langs->trans("InfoWebServer"), '', 'title_setup'); print '
'; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print '
'; print '\n"; print '\n"; print '\n"; diff --git a/htdocs/admin/system/xcache.php b/htdocs/admin/system/xcache.php index 3e0e087c424..5061305f2e2 100644 --- a/htdocs/admin/system/xcache.php +++ b/htdocs/admin/system/xcache.php @@ -39,10 +39,9 @@ print load_fiche_titre("XCache", '', 'title_setup'); print "
\n"; -//function_exists('apc_cache_info') || function_exists('eaccelerator_info') || function_exists('xcache_info')) if (!function_exists('xcache_info')) { - print 'XCache seems to be not installed. Function xcache_info not found.'; + print 'XCache seems to be not installed. Function xcache_info not found.'; llxFooter(); exit; } diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 99c67b038ae..8bab3b94ff5 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -137,7 +137,7 @@ else print ''; print ''; - print '
'.$langs->trans("Parameter")."".$langs->trans("Value")."
'.$langs->trans("Version")."".$_SERVER["SERVER_SOFTWARE"]."
'.$langs->trans("VirtualServerName")."" . $_SERVER["SERVER_NAME"] . "
'; + print '
'; print ''; print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; @@ -169,7 +169,7 @@ else print '
'; - print ''; + print '
'; // Cas des parametres TAX_MODE_SELL/BUY_SERVICE/PRODUCT print ''; @@ -195,7 +195,7 @@ else //print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')'; - print '
'; + print '
'; print ''; // Products diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 8bb39f0056b..fa6a558e444 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -197,7 +197,7 @@ dol_fiche_end(); print load_fiche_titre($langs->trans("TicketNumberingModules")); -print '
 '.$langs->trans("Buy").''.$langs->trans("Sell").'
'; +print '
'; print ''; print ''; print ''; @@ -296,7 +296,7 @@ if (!$conf->use_javascript_ajax) { } print load_fiche_titre($langs->trans("TicketParams")); -print '
' . $langs->trans("Name") . '' . $langs->trans("Description") . '
'; +print '
'; print ''; print ''; @@ -400,7 +400,7 @@ if (!$conf->use_javascript_ajax) { // Admin var of module print load_fiche_titre($langs->trans("Notification")); -print '
' . $langs->trans("Parameter") . '
'; +print '
'; print ''; print ''; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index c5cadac11c1..d6ab0d3830e 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -200,7 +200,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print ''; } - print '
'; + print '
'; print ''; print ''; @@ -288,7 +288,7 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) // Admin var of module print load_fiche_titre($langs->trans("TicketParamMail")); - print '
' . $langs->trans("Parameters") . ''; print '
'; + print '
'; print ''; print ''; diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php deleted file mode 100644 index 660c1647783..00000000000 --- a/htdocs/admin/tools/eaccelerator.php +++ /dev/null @@ -1,338 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/admin/tools/eaccelerator.php - * \brief Page administration de eaccelerator - */ - -require '../../main.inc.php'; - -$langs->load("admin"); - -if (!$user->admin) accessforbidden(); - - -/* - * View - */ - -llxHeader(); - - -if (!function_exists('eaccelerator_info')) { - print 'eAccelerator is not installed.'; - llxFooter(); - exit; -} - - -$info = eaccelerator_info(); -if (isset($_POST['caching'])) { - if ($info['cache']) { - eaccelerator_caching(false); - } else { - eaccelerator_caching(true); - } -} elseif (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) { - if ($info['optimizer']) { - eaccelerator_optimizer(false); - } else { - eaccelerator_optimizer(true); - } -} elseif (isset($_POST['clear'])) { - eaccelerator_clear(); -} elseif (isset($_POST['clean'])) { - eaccelerator_clean(); -} elseif (isset($_POST['purge'])) { - eaccelerator_purge(); -} -$info = eaccelerator_info(); -if (!is_array($info)) { - dol_print_error('', 'An error occured getting eAccelerator information, this is caused if eAccelerator isn\'t initalised properly'); - exit; -} - - -/** - * Compare revisions - * - * @param array $x Parts of version 1 - * @param array $y Parts of version 2 - * @return int -1 if 1<2, 0 if 1=2, 1 if 1>2 - */ -function compare($x, $y) -{ - global $sortby; - - if ( $x[$sortby] == $y[$sortby] ) { - return 0; - } elseif ($x[$sortby] < $y[$sortby]) { - return -1; - } else { - return 1; - } -} - -/** - * Compare revisions - * - * @param array $x Parts of version 1 - * @param array $y Parts of version 2 - * @return int 1 if 1<2, 0 if 1=2, -1 if 1>2 - */ -function revcompare($x, $y) -{ - global $sortby; - - if ($x[$sortby] == $y[$sortby]) { - return 0; - } elseif ($x[$sortby] < $y[$sortby]) { - return 1; - } else { - return -1; - } -} - -/** - * Output table - * - * @param array $list Array of records - * @return void - */ -function create_script_table($list) -{ - global $sortby,$langs; - - if (GETPOT('order', 'alpha') == "asc" || GETPOST('order', 'alpha') == "desc") { - $order = GETPOST('order', 'alpha'); - } else { - $order = "asc"; - } - - if (GETPOST('order', 'alpha')) { - switch (GETPOST('order', 'alpha')) { - case "mtime": - case "size": - case "reloads": - case "hits": - $sortby = GETPOST('sort'); - ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare')); - break; - default: - $sortby = "file"; - ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare')); - } - } - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - switch ($sortby) { - case "mtime": - case "size": - case "reloads": - case "hits": - ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare')); - break; - case "file": - default: - $sortby = "file"; - ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare')); - } - - foreach($list as $script) { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } - print '
'.$langs->trans("Filename").' '; - if($sortby == "file") - print ($order == "asc" ? "↓" : "↑").''.$langs->trans("Date").' '; - if($sortby == "mtime") - print ($order == "asc" ? "↓" : "↑").''.$langs->trans("Size").' '; - if($sortby == "size") - print ($order == "asc" ? "↓" : "↑").''.$langs->trans("Reloads").' '; - if($sortby == "reloads") - print ($order == "asc" ? "↓" : "↑").''.$langs->trans("Hits").' '; - if($sortby == "hits") - print ($order == "asc" ? "↓" : "↑").'
'.dol_trunc($script['file'], 80, 'left').''.dol_print_date($script['mtime'], 'dayhour').''.number_format($script['size'] / 1024, 2).'KB'.$script['reloads'].' ('.$script['usecount'].')'.$script['hits'].'
'; -} - -/** - * Output table - * - * @param array $list Array of records - * @return void - */ -function create_key_table($list) -{ - global $langs; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - foreach($list as $key) { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } - print '
NameCreated'.$langs->trans("Size").'ttl
'.dol_trunc($key['name'], 80, 'left').''.dol_print_date($key['created'], 'dayhour').''.number_format($key['size']/1024, 3).'KB'; - if ($key['ttl'] == -1) { - print 'expired'; - } elseif ($key['ttl'] == 0) { - print 'none'; - } else { - print dol_print_date($key['ttl'], 'dayhour'); - } - print '
'; -} - - -$form=new Form($db); -print load_fiche_titre('Dolibarr eAccelerator '.$info['version'].' control panel', '', 'title_setup'); - -print '
'; - -print ''; -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; -print ''; - -print ''; -print ''; -print ''; -print ''; -print '
Information
Caching enabled'.($info['cache']?'yes':'no').'
Optimizer enabled'.$info['optimizer']?'yes':'no'.'
Memory usage'.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB)
Free memory in reserved cache'.number_format($info['memoryAvailable']/(1024*1024), 2).'MB
Cached scripts'.$info['cachedScripts'].'
Removed scripts'.$info['removedScripts'].'
Cached keys'.(isset($info['cachedKeys'])?$info['cachedKeys']:'').'
'; - -$resCached = @eaccelerator_cached_scripts(); // If success return an array -$resRemoved = @eaccelerator_removed_scripts(); - -if (is_array($resCached) || is_array($resRemoved)) { - print "
"; - print ''; - print ''; - print ''; - print ''; - - if (is_array($resCached)) { - print ''; - print ""; - print ''; - print ""; - - print ''; - print ""; - print ''; - print ""; - } - - if (is_array($resRemoved)) { - print ''; - print ""; - print ''; - print ""; - - print ''; - print ""; - print ''; - print ""; - - print ''; - print ""; - print ''; - print "
Actions
Caching
Optimizer
Clear cache
Clean cache
Purge cache
"; - } - - if (is_array($resCached)) { - print "

"; - print "Cached scripts
"; - create_script_table($resCached); - } - - if (is_array($resRemoved)) { - print "

"; - print "Removed scripts
"; - create_script_table($resRemoved); - } -} else { - print "

"; - print "Check in your php.ini that eaccelerator.allowed_admin_path parameter is : "; - print "

"; - print "".$_SERVER["SCRIPT_FILENAME"].""; - print "

"; -} - -if (function_exists('eaccelerator_get')) { - print '

'; - print 'Cached keys
'; - $res=eaccelerator_list_keys(); - create_key_table($res); -} - -print "

"; - -// End of page -llxFooter(); -$db->close(); diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index c0d08f4b505..f2625104fd8 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -238,7 +238,7 @@ if ($result) } print '
'; - print ''; + print '
'; // Fields title search print ''; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 06bed7a3f3a..d909dc8610b 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -123,7 +123,7 @@ elseif ($action == 'lock') if ($savehandler == 'files') { - print '
'; + print '
'; print ''; print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "login", "", "", 'align="left"', $sortfield, $sortorder); print_liste_field_titre("SessionId", $_SERVER["PHP_SELF"], "id", "", "", 'align="left"', $sortfield, $sortorder); diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index f991bb5752e..91a03387f9c 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -86,7 +86,7 @@ print ''; print ''; print ''; -print '
'; +print '
'; print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine=0; -foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) -{ - if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object +if (is_array($extrafields->attributes[$object->table_element]['computed'])) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (preg_match('/\$object/', $val)) { + // There is at least one compute field that use $object + $needToFetchEachLine++; + } + } } diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 916939b378e..db8dfb60a2b 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -343,7 +343,7 @@ if ($action == 'create') dol_fiche_head(''); - print '
'; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 52ef490ceae..ffdecdecbd1 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -275,7 +275,7 @@ if ($mode == 'overwrite') print ''; print '
'; - print ''; + print '
'; print ''; print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); @@ -464,7 +464,7 @@ if ($mode == 'searchkey') print ''; print '
'; - print '
'; + print '
'; print ''; print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 819688ddcc1..bdc5ee5961d 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -49,7 +49,7 @@ $form = new Form($db); print load_fiche_titre($langs->trans("TriggersAvailable"), '', 'title_setup'); -print $langs->trans("TriggersDesc")."
"; +print ''.$langs->trans("TriggersDesc")."
"; print "
\n"; @@ -60,8 +60,8 @@ $param = ''; $align = ''; print '
'; print '
'; print ''; -print getTitleFieldOfList($langs->trans("File"), 0, $_SERVER["PHP_SELF"], 'file', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, '', $sortfield, $sortorder, '', 1)."\n"; +print getTitleFieldOfList($langs->trans("File"), 0, $_SERVER["PHP_SELF"], 'file', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print getTitleFieldOfList($langs->trans("Active"), 0, $_SERVER["PHP_SELF"], 'active', "", $param, 'align="center"', $sortfield, $sortorder, '', 1)."\n"; print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print ''; @@ -69,7 +69,7 @@ print ''; foreach ($triggers as $trigger) { print ''; - print ''; + print ''; print ''; print ''; print '
'.$trigger['picto'].''.$trigger['picto'].''.$trigger['file'].''.$trigger['status'].''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 1b4c59505db..cfc5a65cc54 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -145,7 +145,7 @@ $head=user_admin_prepare_head(); dol_fiche_head($head, 'card', $langs->trans("MenuUsersAndGroups"), -1, 'user'); -print ''; +print '
'; print ''; print ''; print ''; @@ -206,7 +206,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Description").' 
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index bd8ae3d5e92..fd7348bc603 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -153,7 +153,7 @@ else dol_print_error($db); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 5ea6ee66dd9..c759b0a8d8c 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -447,7 +447,7 @@ if ($id) print ''; print ''; - print '
'.$langs->trans("Name").''.$langs->trans("Description").'
'; + print '
'; // Form to add a new line if ($tabname[$id]) @@ -532,7 +532,7 @@ if ($id) print ''; print ''; - print '
'; + print '
'; // Title of lines print ''; diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index 610a83f302d..b72941cd6de 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -103,7 +103,7 @@ if ($action == 'edit') print ''; print ''; - print '
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) @@ -124,7 +124,7 @@ if ($action == 'edit') } else { - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 3c4232cbc0a..cb9e61e9da1 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -106,7 +106,7 @@ $workflowcodes = dol_sort_array($workflowcodes, 'position'); $nbqualified=0; $oldfamily=''; -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'."\n"; +print '
'."\n"; foreach($workflowcodes as $key => $params) { @@ -117,7 +117,7 @@ foreach($workflowcodes as $key => $params) if ($family == 'separator') { print '

'; - print ''."\n"; + print '
'."\n"; continue; } diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index f8a354683e0..e85b6571c62 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -103,7 +103,7 @@ print ''; print ''; print ''; -print '
'; +print '
'; print ''; print ""; diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index edeb32e8353..53139b0df8c 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -148,11 +148,13 @@ class DolibarrApiAccess implements iAuthenticate $fuser->getrights(); static::$user = $fuser; - if($fuser->societe_id) + if ($fuser->socid) { static::$role = 'external'; + } - if($fuser->admin) + if ($fuser->admin) { static::$role = 'admin'; + } } else { diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 50102b76b93..b32eea1f57f 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -45,6 +45,68 @@ class Setup extends DolibarrApi $this->db = $db; } + /** + * Get the list of ordering methods. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param int $active Payment type is active or not {@min 0} {@max 1} + * @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'CHQ')" + * + * @url GET dictionary/ordering_methods + * + * @return array [List of ordering methods] + * + * @throws 400 RestException + * @throws 200 OK + */ + public function getOrderingMethods($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + $list = array(); + + $sql = "SELECT rowid, code, libelle as label, module"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_input_method as t"; + $sql.= " WHERE t.active = ".$active; + // Add sql filters + if ($sqlfilters) + { + if (! DolibarrApi::_checkFilters($sqlfilters)) + { + throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters); + } + $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++) { + $list[] = $this->db->fetch_object($result); + } + } else { + throw new RestException(400, $this->db->lasterror()); + } + + return $list; + } + /** * Get the list of payments types. * @@ -963,7 +1025,7 @@ class Setup extends DolibarrApi * @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 int $active Measuring unit is active or not {@min 0} {@max 1} * @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 measuring unit * @@ -1016,6 +1078,67 @@ class Setup extends DolibarrApi return $list; } + /** + * Get the list of social networks. + * + * @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 Social network is active or not {@min 0} {@max 1} + * @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 social networks + * + * @url GET dictionary/socialnetworks + * + * @throws RestException + */ + public function getListOfsocialNetworks($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + $list = array(); + //TODO link with multicurrency module + $sql = "SELECT t.rowid, t.entity, t.code, t.label, t.url, t.icon, t.active"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_socialnetworks as t"; + $sql.= " WHERE t.entity IN (".getEntity('c_socialnetworks').")"; + $sql.= " AND t.active = ".$active; + // Add sql filters + if ($sqlfilters) + { + if (! DolibarrApi::_checkFilters($sqlfilters)) + { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $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++) { + $list[] = $this->db->fetch_object($result); + } + } else { + throw new RestException(503, 'Error when retrieving list of social networks: '.$this->db->lasterror()); + } + + return $list; + } + /** * Get the list of tickets categories. * diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 77d16820a43..f43093d0936 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -69,7 +69,7 @@ if ($action == 'edit') print ''; print ''; - print '
".$langs->trans("Parameter")."
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) @@ -90,7 +90,7 @@ if ($action == 'edit') } else { - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 7d49d253755..1f6966fcd15 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -39,25 +39,25 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new Asset($db); +$object = new Asset($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array +$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all=trim(GETPOST("search_all", 'alpha')); -$search=array(); -foreach($object->fields as $key => $val) +$search_all = trim(GETPOST("search_all", 'alpha')); +$search = array(); +foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); } -if (empty($action) && empty($id) && empty($ref)) $action='view'; +if (empty($action) && empty($id) && empty($ref)) $action = 'view'; // Security check - Protection if external user //if ($user->socid > 0) access_forbidden(); @@ -65,12 +65,11 @@ if (empty($action) && empty($id) && empty($ref)) $action='view'; //$result = restrictedArea($user, 'asset', $id); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. -$permissionnote=$user->rights->asset->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink=$user->rights->asset->write; // Used by the include of actions_dellink.inc.php -$permissionedit=$user->rights->asset->write; // Used by the include of actions_lineupdown.inc.php -$permissiontoadd=$user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php +$permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php +$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php /* @@ -79,13 +78,13 @@ $permissiontoadd=$user->rights->asset->write; // Used by the include of actions_ * Put here all code to do according to value of "action" parameter */ -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { - $error=0; + $error = 0; $permissiontoadd = $user->rights->asset->create; $permissiontodelete = $user->rights->asset->delete; @@ -98,9 +97,9 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to send emails - $trigger_name='ASSET_SENTBYMAIL'; - $autocopy='MAIN_MAIL_AUTOCOPY_ASSET_TO'; - $trackid='asset'.$object->id; + $trigger_name = 'ASSET_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO'; + $trackid = 'asset'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -113,11 +112,11 @@ if (empty($reshook)) * Put here all code to build page */ -$form=new Form($db); -$formfile=new FormFile($db); +$form = new Form($db); +$formfile = new FormFile($db); -$title=$langs->trans("Assets").' - '.$langs->trans("Card"); -$help_url=''; +$title = $langs->trans("Assets").' - '.$langs->trans("Card"); +$help_url = ''; llxHeader('', $title, $help_url); // Example : Adding jquery code @@ -151,10 +150,10 @@ if ($action == 'create') print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'."\n"; // Common attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; print '
'."\n"; @@ -163,7 +162,7 @@ if ($action == 'create') print '
'; print ''; print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage + print ''; // Cancel for create does not post form if we don't know the backtopage print '
'; print ''; @@ -185,10 +184,10 @@ if (($id || $ref) && $action == 'edit') print ''."\n"; // Common attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; print '
'; @@ -214,21 +213,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteAssets'), $langs->trans('ConfirmDeleteAssets'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteAssets'), $langs->trans('ConfirmDeleteAssets'), 'confirm_delete', '', 0, 1); } // Confirmation of action xxxx if ($action == 'xxx') { - $formquestion=array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); + $formquestion = array(); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); } // Call Hook formConfirm $parameters = array('lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; - elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; + if (empty($reshook)) $formconfirm .= $hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint; // Print form confirm print $formconfirm; @@ -236,9 +235,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref='
'; + $morehtmlref = '
'; /* // Ref bis $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->asset->creer, 'string', '', 0, 1); @@ -246,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); */ - $morehtmlref.='
'; + $morehtmlref .= '
'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -257,10 +256,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Common attributes //$keyforbreak='fieldkeytoswithonsecondcolumn'; - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print '
'; print '
'; @@ -275,14 +274,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // 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 + $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 - print '' . $langs->trans('SendMail') . ''."\n"; + print ''.$langs->trans('SendMail').''."\n"; if ($user->rights->asset->write) { @@ -336,11 +335,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; $morehtmlright = ''; - $morehtmlright.= $langs->trans("SeeAll"); - $morehtmlright.= ''; + $morehtmlright .= $langs->trans("SeeAll"); + $morehtmlright .= ''; // List of actions on element - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, 'asset', $socid, 1, '', $MAXEVENT, '', $morehtmlright); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 8ea4f46c89d..c43bd73eae8 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -152,8 +152,8 @@ if (empty($reshook)) // Mass actions $objectclass='Asset'; $objectlabel='Asset'; - $permtoread = $user->rights->asset->read; - $permtodelete = $user->rights->asset->delete; + $permissiontoread = $user->rights->asset->read; + $permissiontodelete = $user->rights->asset->delete; $uploaddir = $conf->asset->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -407,9 +407,13 @@ print '
'; + print '
'; print ''; print ''; @@ -449,7 +449,7 @@ if ($rowid > 0) print '
'; print '
'; - print '
'.$langs->trans("Label").'
'; + print '
'; print ''; print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found if ($num == 0) @@ -539,6 +634,7 @@ print ''."\n"; print ''."\n"; + if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty=1; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 4a623c3f36d..a95b6612d99 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -91,7 +91,7 @@ class BOM extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'), 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'), 'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'), 'duration' => array('type'=>'real', 'label'=>'EstimatedDuration', 'enabled'=>1, 'visible'=>-1, 'position'=>101, 'notnull'=>-1, 'css'=>'maxwidth50imp', 'help'=>'EstimatedDurationDesc'), @@ -103,7 +103,8 @@ class BOM extends CommonObject 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900, 'notnull'=>-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, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Enabled', 9=>'Disabled')), ); public $rowid; @@ -937,8 +938,7 @@ class BOM extends CommonObject $modelpath = "core/modules/bom/doc/"; - //return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); - return 1; + return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } /** diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index e78ef64b5c7..7da2c768b7f 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -90,7 +90,7 @@ function bomPrepareHead($object) if (!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -102,7 +102,7 @@ function bomPrepareHead($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index 1f227d7316f..5486a4887d1 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -69,7 +69,7 @@ print ''; print ''; print ''; -print '
'; @@ -553,7 +553,7 @@ if ($rowid > 0) dol_fiche_head($head, 'card', $langs->trans("AssetsType"), -1, 'setup'); - print ''; + print '
'; print ''; @@ -614,7 +614,7 @@ if ($rowid > 0) // Extra field if (empty($reshook)) { - print '

'.$langs->trans("Ref").''.$object->id.'
'; + print '

'; foreach($extrafields->attributes[$object->element]['label'] as $key=>$label) { if (isset($_POST["options_" . $key])) { diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index a0260cc6682..e5c089061eb 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -100,7 +100,7 @@ print ''.$langs->trans("BlockedLogDesc")."
'; -print '
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 6ce788a5790..63e94d00a47 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -361,7 +361,7 @@ print ''; print ''; print ''; -print '
'.$langs->trans("Key").''.$langs->trans("Value").'
'; +print '
'; // Line of filters print ''; diff --git a/htdocs/bom/admin/setup.php b/htdocs/bom/admin/setup.php index 3bcdd0cbd79..b8fc1f1c1c1 100644 --- a/htdocs/bom/admin/setup.php +++ b/htdocs/bom/admin/setup.php @@ -77,7 +77,7 @@ if ($action == 'edit') print ''; print ''; - print '
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) @@ -99,7 +99,7 @@ else { if (! empty($arrayofparameters)) { - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 231679f7b3a..941eb621e7c 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -72,14 +72,13 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu // Security check - Protection if external user //if ($user->socid > 0) access_forbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->statut == BillOfMaterials::STATUS_DRAFT) ? 1 : 0); +//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); //$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissionnote=$user->rights->bom->write; // Used by the include of actions_setnotes.inc.php $permissiondellink=$user->rights->bom->write; // Used by the include of actions_dellink.inc.php -$permissionedit=$user->rights->bom->write; // Used by the include of actions_lineupdown.inc.php -$permissiontoadd=$user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php -$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0); +$permissiontoadd=$user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); /* @@ -112,6 +111,12 @@ if (empty($reshook)) // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + // Action to move up and down lines of object + //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; + + // Action to build doc + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + // Actions to send emails $trigger_name='BOM_SENTBYMAIL'; $autocopy='MAIN_MAIL_AUTOCOPY_BOM_TO'; @@ -146,8 +151,8 @@ if (empty($reshook)) $bomline->fk_bom = $id; $bomline->fk_product = $idprod; $bomline->qty = $qty; - $bomline->qty_frozen = $qty_frozen; - $bomline->disable_stock_change = $disable_stock_change; + $bomline->qty_frozen = (int) $qty_frozen; + $bomline->disable_stock_change = (int) $disable_stock_change; $bomline->efficiency = $efficiency; $result = $bomline->create($user); @@ -184,8 +189,8 @@ if (empty($reshook)) $bomline = new BOMLine($db); $bomline->fetch($lineid); $bomline->qty = $qty; - $bomline->qty_frozen = $qty_frozen; - $bomline->disable_stock_change = $disable_stock_change; + $bomline->qty_frozen = (int) $qty_frozen; + $bomline->disable_stock_change = (int) $disable_stock_change; $bomline->efficiency = $efficiency; $result = $bomline->update($user); @@ -457,7 +462,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->bom->write) + if ($permissiontoadd) { if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; @@ -532,7 +537,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print '
'; - if (! empty($object->lines) || ($object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) + if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; } @@ -555,7 +560,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } - if (! empty($object->lines) || ($object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) + if (! empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print '
'; } @@ -565,8 +570,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } - // Buttons for actions + if ($action != 'presend' && $action != 'editline') { print '
'."\n"; $parameters=array(); @@ -584,7 +589,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Modify - if ($user->rights->bom->write) + if ($permissiontoadd) { print ''.$langs->trans("Modify").''."\n"; } @@ -619,7 +624,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - if ($user->rights->bom->write) + if ($permissiontoadd) { print '' . $langs->trans("ToClone") . ''; } @@ -638,7 +643,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } */ - if ($user->rights->bom->delete) + if ($permissiontodelete) { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 0775c2cc370..c61efc84591 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -1,6 +1,5 @@ - * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -114,6 +113,9 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$permissiontoread = $user->rights->bom->read; +$permissiontoadd = $user->rights->bom->write; +$permissiontodelete = $user->rights->bom->delete; /* @@ -151,13 +153,123 @@ if (empty($reshook)) // Mass actions $objectclass='BOM'; $objectlabel='BillOfMaterials'; - $permtoread = $user->rights->bom->read; - $permtodelete = $user->rights->bom->delete; + $permissiontoread = $user->rights->bom->read; + $permissiontodelete = $user->rights->bom->delete; $uploaddir = $conf->bom->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; -} + // Validate records + if (! $error && $massaction == 'disable' && $permissiontoadd) + { + $objecttmp=new $objectclass($db); + + if (! $error) + { + $db->begin(); + + $nbok = 0; + foreach($toselect as $toselectid) + { + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + if ($objecttmp->status != $objecttmp::STATUS_VALIDATED) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorObjectMustHaveStatusActiveToBeDisabled", $objecttmp->ref), null, 'errors'); + $error++; + break; + } + + // Can be 'cancel()' or 'close()' + $result = $objecttmp->cancel($user); + if ($result < 0) + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + else $nbok++; + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (! $error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } + //var_dump($listofobjectthirdparties);exit; + } + } + + // Validate records + if (! $error && $massaction == 'enable' && $permissiontoadd) + { + $objecttmp=new $objectclass($db); + + if (! $error) + { + $db->begin(); + + $nbok = 0; + foreach($toselect as $toselectid) + { + $result=$objecttmp->fetch($toselectid); + if ($result > 0) + { + if ($objecttmp->status != $objecttmp::STATUS_DRAFT && $objecttmp->status != $objecttmp::STATUS_CANCELED) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorObjectMustHaveStatusDraftOrDisabledToBeActivated", $objecttmp->ref), null, 'errors'); + $error++; + break; + } + + // Can be 'cancel()' or 'close()' + $result = $objecttmp->validate($user); + if ($result < 0) + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + else $nbok++; + } + else + { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (! $error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); + } + else + { + $db->rollback(); + } + //var_dump($listofobjectthirdparties);exit; + } + } +} + /* * View @@ -303,7 +415,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + 'enable'=>$langs->trans("Enable"), + 'disable'=>$langs->trans("Disable"), ); if ($user->rights->bom->delete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions=array(); @@ -498,26 +611,8 @@ while ($i < min($num, $limit)) } // Show total line -if (isset($totalarray['pos'])) -{ - print '
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 2a5758e61d2..670f8768e9a 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -70,7 +70,7 @@ function printBookmarksList() $ret.= '
'.$langs->trans("Name").''.$langs->trans("Value").'
'; + print '
'; print ''; dol_set_focus('#titlebookmark'); @@ -229,7 +229,7 @@ if ($id > 0 && ! preg_match('/^add/i', $action)) print '
'; print '
'; - print '
'.$langs->trans("BookmarkTitle").''.$langs->trans("SetHereATitleForLink").'
'; + print '
'; print '
'; if ($action == 'edit') { diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 7b5890d32b2..2c9189612f7 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -277,4 +277,69 @@ class Bookmark extends CommonObject { return ''; } + + /** + * Return a link to the object card (with optionaly the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + global $conf, $langs, $hookmanager; + + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips + + $result = ''; + + $label = '' . $langs->trans("Bookmark") . ''; + $label.= '
'; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; + + $url = DOL_URL_ROOT.'/bookmarks/card.php?id='.$this->id; + + if ($option != 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } + + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowBookmark"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } + else $linkclose = ($morecss?' class="'.$morecss.'"':''); + + $linkstart = ''; + $linkend=''; + + $result .= $linkstart; + if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + if ($withpicto != 2) $result.= $this->ref; + $result .= $linkend; + //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + + global $action,$hookmanager; + $hookmanager->initHooks(array('mybookmarkdao')); + $parameters=array('id'=>$this->id, 'getnomurl'=>$result); + $reshook=$hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) $result = $hookmanager->resPrint; + else $result .= $hookmanager->resPrint; + + return $result; + } } diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index bdd4f0b5429..2b34f673107 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -32,6 +32,7 @@ $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'):'myobjectlist'; // To manage different context of search // Security check if (! $user->rights->bookmark->lire) { @@ -39,11 +40,12 @@ if (! $user->rights->bookmark->lire) { } $optioncss = GETPOST('optioncss', 'alpha'); +// Load variable for pagination $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield", 'alpha'); -$sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOST("page", 'int'); -if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = 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; @@ -52,6 +54,12 @@ if (! $sortorder) $sortorder='ASC'; $id = GETPOST("id", 'int'); +$object=new Bookmark($db); + +$permissiontoread = $user->rights->bookmark->lire; +$permissiontoadd = $user->rights->bookmark->write; +$permissiontodelete = $user->rights->bookmark->delete; + /* * Actions @@ -59,8 +67,7 @@ $id = GETPOST("id", 'int'); if ($action == 'delete') { - $bookmark=new Bookmark($db); - $res=$bookmark->remove($id); + $res=$object->remove($id); if ($res > 0) { header("Location: ".$_SERVER["PHP_SELF"]); @@ -68,7 +75,7 @@ if ($action == 'delete') } else { - setEventMessages($bookmark->error, $bookmark->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -79,132 +86,182 @@ if ($action == 'delete') $userstatic=new User($db); -llxHeader('', $langs->trans("ListOfBookmarks")); +$title = $langs->trans("ListOfBookmarks"); -$newcardbutton=''; -$newcardbutton.= dolGetButtonTitle($langs->trans('NewBookmark'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer)); - - -print_barre_liste($langs->trans("ListOfBookmarks"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', -1, '', 'generic', 0, $newcardbutton); +llxHeader('', $title); $sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,"; $sql.= " u.login, u.lastname, u.firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid"; $sql.= " WHERE 1=1"; -$sql.= " AND b.entity = ".$conf->entity; +$sql.= " AND b.entity IN (".getEntity('bookmark').")"; if (! $user->admin) $sql.= " AND (b.fk_user = ".$user->id." OR b.fk_user is NULL OR b.fk_user = 0)"; -$sql.= $db->order($sortfield.", position", $sortorder); -$sql.= $db->plimit($limit, $offset); -$resql=$db->query($sql); -if ($resql) +$sql.=$db->order($sortfield.", position", $sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $num = $db->num_rows($resql); - $i = 0; - $param = ""; - if ($optioncss != '') $param ='&optioncss='.$optioncss; - - $moreforfilter=''; - - print '
'; - print ''."\n"; - - print ""; - //print ""; - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("Target", '', '', '', '', 'align="center"'); - print_liste_field_titre("Owner", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre(''); - print "\n"; - - while ($i < $num) + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0 { - $obj = $db->fetch_object($resql); - - print ''; - - // Id - print ''; - - $linkintern=0; - $title=$obj->title; - $link=$obj->url; - - // Title - print "\n"; - - // Url - print '\n"; - - // Target - print '\n"; - - // Author - print '\n"; - - // Date creation - print '"; - - // Position - print '"; - - // Actions - print '"; - print "\n"; - $i++; + $page = 0; + $offset = 0; } - print "
 
'; - print "rowid."\">".img_object($langs->trans("ShowBookmark"), "bookmark").' '.$obj->rowid.""; - print '"; - $linkintern=1; - if ($linkintern) print "url."\">"; - print $title; - if ($linkintern) print ""; - print "'; - if (! $linkintern) print 'target?' target="newlink"':'').'>'; - print $link; - if (! $linkintern) print ''; - print "'; - if ($obj->target == 0) print $langs->trans("BookmarkTargetReplaceWindowShort"); - if ($obj->target == 1) print $langs->trans("BookmarkTargetNewWindowShort"); - print "'; - if ($obj->fk_user) - { - $userstatic->id=$obj->fk_user; - $userstatic->lastname=$obj->login; - print $userstatic->getNomUrl(1); - } - else - { - print $langs->trans("Public"); - } - print "'.dol_print_date($db->jdate($obj->dateb), 'day')."'.$obj->position."'; - if ($user->rights->bookmark->creer) - { - print 'rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().""; - } - if ($user->rights->bookmark->supprimer) - { - print "rowid\">".img_delete().""; - } - else - { - print " "; - } - print "
"; - print '
'; - - $db->free($resql); +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) +{ + $num = $nbtotalofrecords; } else { - dol_print_error($db); + $sql.= $db->plimit($limit+1, $offset); + + $resql=$db->query($sql); + if (! $resql) + { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); } +$param = ""; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); +if ($optioncss != '') $param ='&optioncss='.urlencode($optioncss); + +$moreforfilter=''; + +// List of mass actions available +$arrayofmassactions = array( + //'validate'=>$langs->trans("Validate"), + //'generate_doc'=>$langs->trans("ReGeneratePDF"), + //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>$langs->trans("SendByMail"), +); +if ($permissiontodelete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); +$massactionbutton=$form->selectMassAction('', $arrayofmassactions); + +print ''; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$newcardbutton=''; +$newcardbutton.= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer)); + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit); + +print '
'; +print ''."\n"; + +print ""; +//print ""; +print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="left"', $sortfield, $sortorder); +print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder); +print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder); +print_liste_field_titre("Target", '', '', '', '', 'align="center"'); +print_liste_field_titre("Owner", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $sortfield, $sortorder); +print_liste_field_titre(''); +print "\n"; + +$i = 0; +while ($i < min($num, $limit)) +{ + $obj = $db->fetch_object($resql); + + $object->id = $obj->rowid; + $object->ref = $obj->rowid; + + print ''; + + // Id + print ''; + + $linkintern=0; + $title=$obj->title; + $link=$obj->url; + + // Title + print "\n"; + + // Url + print '\n"; + + // Target + print '\n"; + + // Author + print '\n"; + + // Date creation + print '"; + + // Position + print '"; + + // Actions + print '"; + print "\n"; + $i++; +} +print "
 
'; + print $object->getNomUrl(1); + print '"; + $linkintern=1; + if ($linkintern) print "url."\">"; + print $title; + if ($linkintern) print ""; + print "'; + if (! $linkintern) print 'target?' target="newlink"':'').'>'; + print $link; + if (! $linkintern) print ''; + print "'; + if ($obj->target == 0) print $langs->trans("BookmarkTargetReplaceWindowShort"); + if ($obj->target == 1) print $langs->trans("BookmarkTargetNewWindowShort"); + print "'; + if ($obj->fk_user) + { + $userstatic->id=$obj->fk_user; + $userstatic->lastname=$obj->login; + print $userstatic->getNomUrl(1); + } + else + { + print $langs->trans("Public"); + } + print "'.dol_print_date($db->jdate($obj->dateb), 'day')."'.$obj->position."'; + if ($user->rights->bookmark->creer) + { + print 'rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().""; + } + if ($user->rights->bookmark->supprimer) + { + print "rowid\">".img_delete().""; + } + else + { + print " "; + } + print "
"; +print '
'; + +$db->free($resql); + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 9f76343a69e..1602c02beaa 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -97,7 +97,7 @@ print ''; if (! empty($conf->service->enabled)) { - print ''; + print '
'; print ''; print ''; print "\n"; @@ -114,7 +114,7 @@ if (! empty($conf->service->enabled)) } -print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print "\n"; diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index ece7ed2fa5b..7d47724ddd3 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -87,7 +87,7 @@ $head=categoriesadmin_prepare_head(); dol_fiche_head($head, 'setup', $langs->trans("Categories"), -1, 'category'); -print '
'.$langs->trans("Terminal").' 0'.$langs->trans("Value").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 39db14a9613..9729e401632 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -146,7 +146,7 @@ print ''; dol_fiche_head(''); -print '
'.$langs->trans("Description").' 
'; +print '
'; // Ref print '
'; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 2ef44c51f4f..e0886da002c 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -87,7 +87,7 @@ print ''; print ''; -print ''; +print '
'; print ''; print ''; print ''; @@ -117,7 +117,7 @@ if ($catname || $id > 0) { $cats = $categstatic->rechercher($id, $catname, $typetext); - print '
'.$langs->trans("Search").'
'; + print '
'; print ''; foreach ($cats as $cat) diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 754b846576d..5dbd6e68c47 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -150,7 +150,7 @@ if ($object->id) print '
'; print '
'; - print '
'.$langs->trans("FoundCats").'
'; + print '
'; // Description print '
'; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 1c082dfe332..c898fef8be1 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -214,7 +214,7 @@ print '
'; print '
'; print '
'; -print ''; +print '
'; // Description print '
'; @@ -273,7 +273,7 @@ if ($action == 'edit') foreach ($object->multilangs as $key => $value) { print "
".$langs->trans('Language_'.$key)." :
"; - print ''; + print '
'; // Label $libelle = (GETPOST('libelle-'.$key, 'alpha') ? GETPOST('libelle-'.$key, 'alpha') : $object->multilangs[$key]['label']); @@ -309,7 +309,7 @@ elseif ($action != 'add') foreach ($object->multilangs as $key => $value) { $s=picto_from_langcode($key); - print '
'; + print '
'; print ''; print ''; print ''; @@ -340,7 +340,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print ''; - print '
'.($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'; + print '
'; print ''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 45926847df4..e109970ce33 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -369,7 +369,7 @@ if ($type == Categorie::TYPE_PRODUCT) print ''; print ''; print ''; - print '
'.$langs->trans('Translation').''; print $formadmin->select_language(GETPOST('forcelangprod', 'alpha'), 'forcelangprod', 0, $object->multilangs); print '
'; + print '
'; print '
'; print $langs->trans("AddProductServiceIntoCategory").'  '; print $form->select_produits('', 'elemid', '', 0, 0, -1, 2, '', 1); @@ -455,7 +455,7 @@ if ($type == Categorie::TYPE_SUPPLIER) $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = ''; print_barre_liste($langs->trans("Suppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); - print ''."\n"; + print '
'."\n"; print '\n"; if (count($socs) > 0) @@ -520,7 +520,7 @@ if($type == Categorie::TYPE_CUSTOMER) $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = ''; print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); - print '
'.$langs->trans("Name")."
'."\n"; + print '
'."\n"; print ''."\n"; if (count($socs) > 0) @@ -654,7 +654,7 @@ if ($type == Categorie::TYPE_CONTACT) $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($contacts); $nbtotalofrecords = ''; $newcardbutton = ''; print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); - print '
'.$langs->trans("Name").'
'."\n"; + print '
'."\n"; print ''."\n"; if (count($contacts) > 0) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6b75f5b4a50..09c8e344794 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -756,7 +756,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') // Actions to delete doc $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); -$permissioncreate = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); +$permissiontoadd = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 031918b194b..9b35f21a0b2 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1719,7 +1719,6 @@ function dol_color_minus($color, $minus, $minusunit = 16) return $newcolor; } - /** * Sort events by date * @@ -1729,24 +1728,52 @@ function dol_color_minus($color, $minus, $minusunit = 16) */ function sort_events_by_date($a, $b) { - if($a->datep != $b->datep) + // datep => Event start time + // datef => Event end time + + // Events have different start time + if ($a->datep !== $b->datep) { return $a->datep - $b->datep; } - // If both events have the same start time, longest first - - if(! is_numeric($b->datef)) + // Events have same start time and no end time + if ((! is_numeric($b->datef)) || (! is_numeric($a->datef))) { - // when event B have no end timestamp, event B should sort be before event A (All day events on top) - return 1; + return sort_events_by_percentage($a, $b); } - if(! is_numeric($a->datef)) + // Events have the same start time and same end time + if ($b->datef === $a->datef) + { + return sort_events_by_percentage($a, $b); + } + + // Events have the same start time, but have different end time -> longest event first + return $b->datef - $a->datef; +} + +/** + * Sort events by percentage + * + * @param object $a Event A + * @param object $b Event B + * @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same percentage + */ +function sort_events_by_percentage($a, $b) +{ + // Sort events with no percentage before each other + // (usefull to sort holidays, sick days or similar on the top) + + if ($a->percentage < 0) { - // when event A have no end timestamp , event A should sort be before event B (All day events on top) return -1; } - return $b->datef - $a->datef; + if ($b->percentage < 0) + { + return 1; + } + + return $b->percentage - $a->percentage; } diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 6c0aea2f935..8b3f4cf4894 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -128,7 +128,7 @@ if ($resql) print ''; - print '
'.$langs->trans("Ref").'
'; + print '
'; print ''; print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.name", $begin, $param, "", $sortfield, $sortorder); print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "p.firstname", $begin, $param, "", $sortfield, $sortorder); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 245d3874d92..d405d2526d3 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -165,7 +165,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $num = $db->num_rows($resql); print '
'; - print '
'; + print '
'; print ''; print ''; @@ -249,7 +249,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos $num = $db->num_rows($resql); print '
'; - print '
'.$langs->trans("ProposalsDraft").' '.$num.'
'; + print '
'; print ''; print ''; @@ -331,7 +331,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $num = $db->num_rows($resql); print '
'; - print '
'.$langs->trans("SupplierProposalsDraft").($num?' '.$num.'':'').'
'; + print '
'; print ''; print ''; @@ -420,7 +420,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande $num = $db->num_rows($resql); print '
'; - print '
'.$langs->trans("DraftOrders").($num?' '.$num.'':'').'
'; + print '
'; print ''; print ''; @@ -512,7 +512,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) $i = 0; print '
'; - print '
'.$langs->trans("DraftSuppliersOrders").($num?' '.$num.'':'').'
'; + print '
'; print ''; print '
'; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects", $max); @@ -576,7 +576,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) $i = 0; print '
'; - print ''; + print '
'; print ''; print ''; print ''; @@ -657,7 +657,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO if ($num > 0) { print '
'; - print '
'.$langs->trans("BoxTitleLastModifiedSuppliers", min($max, $num)).''.$langs->trans("FullList").'
'; + print '
'; print ''; $i = 0; @@ -717,7 +717,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) if ($num > 0) { print '
'; - print '
'.$langs->trans("LastContracts", 5).'
'; + print '
'; print ''; $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); @@ -821,7 +821,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) if ($num > 0) { print '
'; - print '
'.$langs->trans("ProposalsOpened").' '.$num.'
'; + print '
'; print ''; $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index d9fbd9a37b2..42c1f191a0a 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -419,7 +419,7 @@ if ($object->fetch($id) >= 0) { dol_fiche_head($head, 'advtargets', $langs->trans("Mailing"), 0, 'email'); - print '
'.$langs->trans("OrdersOpened").' '.$num.'
'; + print '
'; $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 714a84fe95a..f4a0e61095f 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -762,7 +762,7 @@ if ($action == 'create') print '
'; print '

'; - print ''; + print '
'; print ''; print '
'.$langs->trans("MailTopic").'
'.$langs->trans("BackgroundColorByDefault").''; print $htmlother->selectColor($_POST['bgcolor'], 'bgcolor', '', 0); @@ -1189,7 +1189,7 @@ else print '
'; print '
'; - print ''; + print '
'; /* print ''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 819e0acf562..f6e27fffaa3 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -297,7 +297,7 @@ if ($object->fetch($id) >= 0) { print load_fiche_titre($langs->trans("ToAddRecipientsChooseHere"), ($user->admin?info_admin($langs->trans("YouCanAddYourOwnPredefindedListHere"), 1):''), 'generic'); - //print '
'.$langs->trans("Ref").'
'; + //print '
'; print '
'; //print '
'; diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 701dd2d4716..1a15ac2ca64 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -61,7 +61,7 @@ print '
'; print ''; print ''; print '
'; - print '
'; + print '
'; print ''; print ''; @@ -74,7 +74,7 @@ print '
'; // Affiche stats de tous les modules de destinataires mailings -print '
'.$langs->trans("SearchAMailing").'
'; print $langs->trans("Ref").':
'; +print '
'; print ''; $dir=DOL_DOCUMENT_ROOT."/core/modules/mailings"; @@ -162,7 +162,7 @@ $sql.= " LIMIT ".$limit; $result=$db->query($sql); if ($result) { print '
'; - print '
'.$langs->trans("TargetsStatistics").'
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index ff69bd00c0c..0e3d7a7725e 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -102,8 +102,8 @@ if (empty($reshook)) // Mass actions /*$objectclass='MyObject'; $objectlabel='MyObject'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; + $permissiontoread = $user->rights->mymodule->read; + $permissiontodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; */ diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index c99048a8955..82bf49261a1 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -136,7 +136,7 @@ if ($_socid > 0) $resql=$db->query($sql); if ($resql) { - print '
'.$langs->trans("LastMailings", $limit).''.$langs->trans("DateCreation").'
'; + print '
'; $tag = !$tag; print ''; print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 8f28a65473c..11d57eabbfc 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1438,7 +1438,7 @@ if (empty($reshook)) // Actions to build doc $upload_dir = $conf->propal->multidir_output[$object->entity]; - $permissioncreate=$usercancreate; + $permissiontoadd=$usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -1551,7 +1551,7 @@ if ($action == 'create') dol_fiche_head(); - print '
'.$langs->trans("Date").'
'; + print '
'; // Reference print ''; @@ -1853,7 +1853,7 @@ if ($action == 'create') $title = $langs->trans('ProductsAndServices'); print load_fiche_titre($title); - print '
' . $langs->trans('Ref') . '' . $langs->trans("Draft") . '
'; + print '
'; $objectsrc->printOriginLinesList(); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index d802548ac6b..ed981d9488b 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -69,7 +69,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele { print ''; print ''; - print '
'; + print '
'; print ''; print ''; @@ -118,7 +118,7 @@ if ($resql) } $db->free($resql); - print '
'.$langs->trans("Search").'
'; print $langs->trans("Proposal").':
'; + print '
'; print ''."\n"; $listofstatus=array(0,1,2,3,4); foreach ($listofstatus as $status) @@ -181,7 +181,7 @@ if (! empty($conf->propal->enabled)) if ($num) { print '
'; - print '
'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'
'; + print '
'; print ''; $langs->load("propal"); print ''; @@ -248,7 +248,7 @@ $resql=$db->query($sql); if ($resql) { print '
'; - print '
'.$langs->trans("DraftPropals").' '.$num.'
'; + print '
'; print ''; print ''; @@ -332,7 +332,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) if ($num > 0) { print '
'; - print '
'.$langs->trans("LastModifiedProposals", $max).'
'; + print '
'; print ''; $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); @@ -419,7 +419,7 @@ if (! empty($conf->propal->enabled)) $num = $db->num_rows($resql); print '
'; - print '
'.$langs->trans("ProposalsOpened").' '.$num.'
'; + print '
'; print ''; print ''; @@ -492,7 +492,7 @@ if (! empty($conf->propal->enabled)) $num = $db->num_rows($resql); print '
'; - print '
'.$langs->trans("ProposalsToProcess").' '.$num.'
'; + print '
'; print ''; print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a83d7ee5161..bccc742aa8e 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -241,9 +241,9 @@ if (empty($reshook)) { $objectclass='Propal'; $objectlabel='Proposals'; - $permtoread = $user->rights->propal->lire; - $permtodelete = $user->rights->propal->supprimer; - $permtoclose = $user->rights->propal->cloturer; + $permissiontoread = $user->rights->propal->lire; + $permissiontodelete = $user->rights->propal->supprimer; + $permissiontoclose = $user->rights->propal->cloturer; $uploaddir = $conf->propal->multidir_output[$conf->entity]; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -947,24 +947,24 @@ if ($resql) { print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; - $totalarray['totalht'] += $obj->total_ht; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='p.total_ht'; + $totalarray['val']['p.total_ht'] += $obj->total_ht; } // Amount VAT if (! empty($arrayfields['p.total_vat']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; - $totalarray['totalvat'] += $obj->total_vat; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='p.total_vat'; + $totalarray['val']['p.total_vat'] += $obj->total_vat; } // Amount TTC if (! empty($arrayfields['p.total_ttc']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; - $totalarray['totalttc'] += $obj->total_ttc; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='p.total_ttc'; + $totalarray['val']['p.total_ttc'] += $obj->total_ttc; } // Amount invoiced if(! empty($arrayfields['p.total_ht_invoiced']['checked'])) { @@ -984,8 +984,8 @@ if ($resql) print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalhtinvoicedfield']=$totalarray['nbfield']; - $totalarray['totalhtinvoiced'] += $totalInvoiced; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='p.total_ht_invoiced'; + $totalarray['val']['p.total_ht_invoiced'] += $obj->total_ht_invoiced; } // Amount invoiced if(! empty($arrayfields['p.total_invoiced']['checked'])) { @@ -1005,8 +1005,8 @@ if ($resql) print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalinvoicedfield']=$totalarray['nbfield']; - $totalarray['totalinvoiced'] += $totalInvoiced; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='p.total_invoiced'; + $totalarray['val']['p.total_invoiced'] += $obj->total_invoiced; } $userstatic->id=$obj->fk_user_author; @@ -1120,45 +1120,7 @@ if ($resql) } // Show total line - if (isset($totalarray['totalhtfield']) - || isset($totalarray['totalvatfield']) - || isset($totalarray['totalttcfield']) - || isset($totalarray['totalamfield']) - || isset($totalarray['totalrtpfield']) - || isset($totalarray['totalizable']) - ) - { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totalhtfield'] == $i) print ''; - elseif ($totalarray['totalvatfield'] == $i) print ''; - elseif ($totalarray['totalttcfield'] == $i) print ''; - elseif ($totalarray['totalhtinvoicedfield'] == $i) print ''; - elseif ($totalarray['totalinvoicedfield'] == $i) print ''; - elseif ($totalarray['totalizable']) { - $printed = false; - foreach ($totalarray['totalizable'] as $totalizable) { - if ($totalizable['pos']==$i && ! $printed) { - print ''; - $printed = true; - } - } - if (! $printed) { - print ''; - } - } - else print ''; - } - print ''; - } + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; $db->free($resql); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index a37006d60fb..4c7b393c8db 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -243,7 +243,7 @@ print '
'; // Show filter box print ''; print ''; - print '
'.$langs->trans("OnProcessOrders").' '.$num.'
'.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_ttc)."'.price($totalInvoiced)."'.price($totalInvoiced)."
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).''.price($totalarray['totalhtinvoiced']).''.price($totalarray['totalinvoiced']).''.price($totalizable['total']).'
'; + print '
'; print ''; // Company print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; @@ -272,7 +272,7 @@ print '
'; //} print '
'; -print ''; +print '
'; print ''; print ''; print ''; @@ -320,7 +320,7 @@ print '
'; // Show graphs -print '
'.$langs->trans("Year").''.$langs->trans("NbOfProposals").'
'; +print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 485771939c4..b2cc1d8bbda 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -57,7 +57,7 @@ if (! empty($conf->propal->enabled)) $var=false; print ''; print ''; - print ''; + print '
'; print ''; print ''; @@ -89,7 +89,7 @@ if ($resql) $i = 0; if ($num > 0 ) { - print '
'.$langs->trans("SearchAProposal").'
'; print $langs->trans("Ref").':
'; + print '
'; print ''; print ''; while ($i < $num) @@ -193,7 +193,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $i = 0; if ($num > 0) { - print '
'.$langs->trans("ProspectsByStatus").'
'; + print '
'; print ''; while ($i < $num) @@ -250,7 +250,7 @@ if ($resql) $i = 0; if ($num > 0 ) { - print '
'.$langs->trans("ProposalsOpened").'
'; + print '
'; print ''; while ($i < $num) diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index 07741635bcc..f1e15a51ecc 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -62,7 +62,7 @@ if ($socid > 0) print "
'.$langs->trans("ProspectToContact").'
\n"; print '
'; - print ''; + print '
'; // Name print ''; diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 9605281d6ca..81e7446cff1 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -62,7 +62,7 @@ if ($socid > 0) print "
'.$langs->trans("Thirdpary").''.$societe->getNomUrl(1).'
\n"; print '
'; - print ''; + print '
'; // Name print ''; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 32c6869d576..229fca58d18 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -229,7 +229,7 @@ if ($socid > 0) $resql=$db->query($sql); if ($resql) { - print '
'.$langs->trans("ThirdParty").''.$societe->getNomUrl(1).'
'; + print '
'; $tag = !$tag; print ''; print ''; @@ -288,7 +288,7 @@ if ($socid > 0) $resql=$db->query($sql); if ($resql) { - print '
'.$langs->trans("Date").'
'; + print '
'; $tag = !$tag; print ''; print ''; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 523c6ebc7b1..b3d3140db09 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -356,7 +356,7 @@ if ($socid > 0) print ''; } - print '
'.$langs->trans("Date").'
'; + print '
'; if($isCustomer && $isSupplier) { print ''; print '
'.$langs->trans('DiscountType').' '; @@ -776,7 +776,7 @@ if ($socid > 0) if ($resql2) { print '
'; - print ''; + print '
'; print ''; print ''; // Need 120+ for format with AM/PM print ''; @@ -946,7 +946,7 @@ if ($socid > 0) if ($resql2) { print '
'; - print '
'.$langs->trans("Date").''.$langs->trans("ReasonDiscount").'
'; + print '
'; print ''; print ''; // Need 120+ for format with AM/PM print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index a6427dbd045..0daf73db702 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -110,7 +110,7 @@ $usercancreatepurchaseorder = $user->rights->fournisseur->commande->creer; $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php -$permissionedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php /* @@ -1411,7 +1411,7 @@ if (empty($reshook)) // Actions to build doc $upload_dir = $conf->commande->multidir_output[$object->entity]; - $permissioncreate = $usercancreate; + $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Actions to send emails @@ -1605,7 +1605,7 @@ if ($action == 'create' && $usercancreate) dol_fiche_head(''); - print '
'.$langs->trans("Date").''.$langs->trans("ReasonDiscount").'
'; + print '
'; // Reference print ''; @@ -1890,7 +1890,7 @@ if ($action == 'create' && $usercancreate) $title = $langs->trans('ProductsAndServices'); print load_fiche_titre($title); - print '
' . $langs->trans('Ref') . '' . $langs->trans("Draft") . '
'; + print '
'; $objectsrc->printOriginLinesList('', $selectedLines); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index bcb445c546c..f6594b5694a 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -123,7 +123,7 @@ if ($resql) print ''; - print '
'; + print '
'; print ''; print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", "", 'valign="center"', $sortfield, $sortorder); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index da1a4fc55df..6c5fb4701dd 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -74,7 +74,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele $var=false; print ''; print ''; - print '
'; + print '
'; print ''; print ''; @@ -123,7 +123,7 @@ if ($resql) $i++; } $db->free($resql); - print '
'.$langs->trans("Search").'
'; print $langs->trans("CustomerOrder").':
'; + print '
'; print ''."\n"; $listofstatus=array(0,1,2,3,-1); foreach ($listofstatus as $status) @@ -190,7 +190,7 @@ if (! empty($conf->commande->enabled)) $resql=$db->query($sql); if ($resql) { - print '
'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'
'; + print '
'; print ''; print ''; $langs->load("orders"); @@ -259,7 +259,7 @@ $sql.= $db->plimit($max, 0); $resql=$db->query($sql); if ($resql) { - print '
'.$langs->trans("DraftOrders").'
'; + print '
'; print ''; print ''; @@ -340,7 +340,7 @@ if (! empty($conf->commande->enabled)) { $num = $db->num_rows($resql); - print '
'.$langs->trans("LastModifiedOrders", $max).'
'; + print '
'; print ''; print ''; @@ -421,7 +421,7 @@ if (! empty($conf->commande->enabled)) { $num = $db->num_rows($resql); - print '
'.$langs->trans("OrdersToProcess").' '.$num.'
'; + print '
'; print ''; print ''; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5f9906b58dc..dadc25737b6 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -220,8 +220,8 @@ if (empty($reshook)) // Mass actions $objectclass='Commande'; $objectlabel='Orders'; - $permtoread = $user->rights->commande->lire; - $permtodelete = $user->rights->commande->supprimer; + $permissiontoread = $user->rights->commande->lire; + $permissiontodelete = $user->rights->commande->supprimer; $uploaddir = $conf->commande->multidir_output[$conf->entity]; $trigger_name='ORDER_SENTBYMAIL'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -1057,24 +1057,24 @@ if ($resql) { print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; - $totalarray['totalht'] += $obj->total_ht; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='c.total_ht'; + $totalarray['val']['c.total_ht'] += $obj->total_ht; } // Amount VAT if (! empty($arrayfields['c.total_vat']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; - $totalarray['totalvat'] += $obj->total_tva; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='c.total_tva'; + $totalarray['val']['c.total_tva'] += $obj->total_tva; } // Amount TTC if (! empty($arrayfields['c.total_ttc']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; - $totalarray['totalttc'] += $obj->total_ttc; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='c.total_ttc'; + $totalarray['val']['c.total_ttc'] += $obj->total_ttc; } // Extra fields @@ -1139,30 +1139,7 @@ if ($resql) } // Show total line - if (isset($totalarray['totalhtfield']) - || isset($totalarray['totalvatfield']) - || isset($totalarray['totalttcfield']) - || isset($totalarray['totalamfield']) - || isset($totalarray['totalrtpfield']) - ) - { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totalhtfield'] == $i) print ''; - elseif ($totalarray['totalvatfield'] == $i) print ''; - elseif ($totalarray['totalttcfield'] == $i) print ''; - else print ''; - } - print ''; - } + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; $db->free($resql); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 35756a56487..4cc5ce532e4 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -415,7 +415,7 @@ if ($action == 'create' && !$error) dol_fiche_head(); - print '
'.$langs->trans("OnProcessOrders").' '.$num.'
'.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_ttc)."
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).'
'; + print '
'; // Ref print ''; @@ -606,7 +606,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) } print '
'; - print '
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'; + print '
'; print ''; print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.ref', '', '&socid='.$socid, '', $sortfield, $sortorder); print_liste_field_titre('RefCustomerOrder', $_SERVER["PHP_SELF"], 'c.ref_client', '', '&socid='.$socid, '', $sortfield, $sortorder); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index bdf277bc375..e3413f5b927 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -256,7 +256,7 @@ print '
'; // Show filter box print ''; print ''; -print '
'; +print '
'; print ''; // Company print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; @@ -299,7 +299,7 @@ print '

'; print '
'; -print ''; +print '
'; print ''; print ''; print ''; @@ -350,7 +350,7 @@ print '
'; // Show graphs -print '
'.$langs->trans("Year").''.$langs->trans("NbOfOrders").'
'; +print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index f9d7e44794c..eec09bb94cc 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -423,7 +423,7 @@ if (!empty($date_start) && !empty($date_stop)) print '
'; print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table - print ''; + print '
'; print ''; print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'nowrap '); print_liste_field_titre($arrayfields['date']['label'], $_SERVER["PHP_SELF"], "date", "", $param, '', $sortfield, $sortorder, 'center nowrap '); diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php new file mode 100644 index 00000000000..bc260a4e527 --- /dev/null +++ b/htdocs/compta/bank/account_statement_document.php @@ -0,0 +1,156 @@ + + * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2019 Nicolas ZABOURI + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/compta/bank/document.php + * \ingroup banque + * \brief Page de gestion des documents attaches a un compte bancaire + */ +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT . "/core/lib/bank.lib.php"; +require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php"; +require_once DOL_DOCUMENT_ROOT . "/core/lib/images.lib.php"; +require_once DOL_DOCUMENT_ROOT . "/core/class/html.formfile.class.php"; +require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; + +global $conf,$db,$langs; +// Load translation files required by the page +$langs->loadLangs(array('banks', 'companies', 'other')); + +$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('account', 'int')); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); +$num = (GETPOST('num', 'alpha') ? GETPOST('num', 'alpha') : GETPOST('sectionid', 'alpha')); + +$mesg = ''; +if (isset($_SESSION['DolMessage'])) { + $mesg = $_SESSION['DolMessage']; + unset($_SESSION['DolMessage']); +} + +// Security check +if ($user->socid) { + $action = ''; + $socid = $user->socid; +} +if ($user->socid) + $socid = $user->socid; + +// Get parameters +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); +if (empty($page) || $page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortorder) + $sortorder = "ASC"; +if (!$sortfield) + $sortfield = "name"; + +$object = new Account($db); +if ($id > 0 || ! empty($ref)) $object->fetch($id, $ref); + +$result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', ''); + + +/* + * Actions + */ + +if (!empty($num)) +{ + $object->fetch_thirdparty(); + $upload_dir = $conf->bank->dir_output . "/".$id."/statement/" . dol_sanitizeFileName($num); +} +$backtopage = $_SERVER['PHP_SELF']."?account=".$id."&num=".$num; +include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; + + +/* + * View + */ + +$title = $langs->trans("FinancialAccount").' - '.$langs->trans("Documents"); +$helpurl = ""; +llxHeader('', $title, $helpurl); + +$form = new Form($db); + +if ($id > 0 || !empty($ref)) { + if ($object->fetch($id, $ref)) { + $upload_dir = $conf->bank->dir_output . "/".$id."/statement/" . dol_sanitizeFileName($num); + + // Onglets + $head = account_statement_prepare_head($object, $num); + dol_fiche_head($head, 'document', $langs->trans("FinancialAccount"), -1, 'account'); + + + // Build file list + $filearray = dol_dir_list($upload_dir, "files", 0, '', '\.meta$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { + $totalsize+=$file['size']; + } + + $morehtmlref = ''; + + + $title=$langs->trans("AccountStatement").' '.$num.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); + print load_fiche_titre($title, '', 'title_bank.png'); + + + print '
'; + print '
'; + + print '
'; + print ''; + print ''; + print "
' . $langs->trans("NbOfAttachedFiles") . '' . count($filearray) . '
' . $langs->trans("TotalSizeOfAttachedFiles") . '' .dol_print_size($totalsize, 1, 1).'
\n"; + + print '
'; + + dol_fiche_end(); + + + $modulepart = 'bank'; + $permission = $user->rights->banque->modifier; + $permtoedit = $user->rights->banque->modifier; + $param = '&id=' . $object->id.'&num='.$num; + $uri = '&num='.$num; + $relativepathwithnofile = $id."/statement/".$num."/"; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; + } + else { + dol_print_error($db); + } +} +else { + Header('Location: index.php'); + exit; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index b5839db2200..d10374e4c8d 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -183,7 +183,7 @@ dol_fiche_end(); print load_fiche_titre('', $link, ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print ''; +print '
'; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) @@ -262,7 +262,7 @@ else { dol_print_error($db); } -print '
'.$langs->trans("Month").'
'; +print '
'; print '"; print ''; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 773ee1e9255..0912dfaba0a 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -209,8 +209,8 @@ if (empty($reshook)) { $objectclass='Account'; $objectlabel='BankTransaction'; - $permtoread = $user->rights->banque->lire; - $permtodelete = $user->rights->banque->supprimer; + $permissiontoread = $user->rights->banque->lire; + $permissiontodelete = $user->rights->banque->supprimer; $uploaddir = $conf->bank->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -690,7 +690,7 @@ if ($resql) { print load_fiche_titre($langs->trans("AddBankRecordLong"), '', ''); - print '
'.$langs->trans("CurrentBalance")."'.price($balance).'
'; + print '
'; print ''; print ''; @@ -919,13 +919,13 @@ if ($resql) if (! empty($arrayfields['b.debit']['checked'])) { print ''; } if (! empty($arrayfields['b.credit']['checked'])) { print ''; } if (! empty($arrayfields['balancebefore']['checked'])) @@ -1085,6 +1085,7 @@ if ($resql) if ($tmpnbfieldbeforebalance) { print ''; } @@ -1110,6 +1111,7 @@ if ($resql) '; print ''; print ''; print ''; } @@ -1529,7 +1531,6 @@ if ($resql) print ' '.img_warning($langs->trans("ReconciliationLate")); } } - print ' '; if ($user->rights->banque->modifier) { print 'rowid.'&id='.$objp->bankid.'&page='.$page.'">'; diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index c9c5a0f77fe..967227f9e89 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -46,7 +46,7 @@ llxHeader(); // List movements bu category for bank transactions print load_fiche_titre($langs->trans("BankTransactionByCategories"), '', 'title_bank.png'); -print '
'.$langs->trans("Description").''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; + print ' '; print ''; + print ' '; print '
'; +print '
'; print ""; print ''; print ''; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 702d3bbc113..4e58684b876 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -346,7 +346,7 @@ if ($action == 'create') dol_fiche_head(''); - print '
'.$langs->trans("Rubrique").''.$langs->trans("Nb").'
'; + print '
'; // Ref print ''; @@ -450,7 +450,7 @@ if ($action == 'create') print '
'; - print '
'.$langs->trans("Ref").'
'; + print '
'; // Sold print ''; @@ -472,7 +472,7 @@ if ($action == 'create') if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT) { - print '
'.$langs->trans("InitialBankBalance").'
'; + print '
'; // If bank account print ''; @@ -532,7 +532,7 @@ if ($action == 'create') print '
'; } - print '
'.$langs->trans("BankName").'
'; + print '
'; // Accountancy code $fieldrequired=''; if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) $fieldrequired='fieldrequired '; @@ -833,7 +833,7 @@ else //print '
'; - print '
'; + print '
'; // Ref print ''; @@ -951,7 +951,7 @@ else //print '
'; - print '
'.$langs->trans("Ref").'
'; + print '
'; // Accountancy code $tdextra = ' class="titlefieldcreate"'; @@ -986,7 +986,7 @@ else //print '
'; - print '
'; + print '
'; // If bank account print ''; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 683f04bc84c..377feaa0cae 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -93,7 +93,7 @@ print ''; */ print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
'.$langs->trans("BankName").'
'; +print '
'; print ''; print ''; print "\n"; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 7e96ddf31be..cdab5006ef9 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -314,7 +314,7 @@ if ($result) print '
'; print '
'; - print '
'.$langs->trans("Ref").''.$langs->trans("Label").'
'; + print '
'; $i++; @@ -639,7 +639,7 @@ if ($result) print '
'; - print '
'; + print '
'; print '"; if ($user->rights->banque->consolidate) diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 524e3f44cbc..2244a73b02a 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Ferran Marcet @@ -512,8 +512,7 @@ foreach ($accounts as $key=>$type) } else { print ''.$result->nbtodo.''; if ($result->nbtodolate) { - print ' '; - print ''; + print ''; print ' '.$result->nbtodolate; print ''; } @@ -564,8 +563,8 @@ foreach ($accounts as $key=>$type) print ''.price($solde, 0, $langs, 0, -1, -1, $objecttmp->currency_code).''; print ''; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield']; - $totalarray['totalbalance'] += $solde; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='balance'; + $totalarray['val']['balance'] += $solde; } // Action column @@ -595,22 +594,10 @@ if (! $found) } // Show total line -if (isset($totalarray['totalbalancefield']) && $lastcurrencycode != 'various') // If there is several currency, $lastcurrencycode is set to 'various' before +if ($lastcurrencycode != 'various') // If there is several currency, $lastcurrencycode is set to 'various' before { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totalbalancefield'] == $i) print ''; - else print ''; - } - print ''; + // Show total line + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; } print '
'.$langs->trans("Conciliation")."
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalbalance'], 0, $langs, 0, -1, -1, $lastcurrencycode).'
'; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index cb029902372..d267f55f640 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2017 Patrick Delcroix + * Copyright (C) 2019 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -270,7 +271,7 @@ if (empty($numref)) print ''; print ''; - print ''; + print '
'; print ''; print ''; print ''; @@ -360,7 +361,12 @@ else * Show list of bank statements */ - $mesprevnext=''; + // Onglets + $head=account_statement_prepare_head($object, $numref); + dol_fiche_head($head, 'statement', $langs->trans("FinancialAccount"), 0, 'account'); + + + $mesprevnext=''; $mesprevnext.='
'.$langs->trans("Ref").''.$langs->trans("InitialBankBalance").'
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 30472729d92..9066d0ef581 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -267,7 +267,7 @@ if ($action == 'create') dol_fiche_head('', ''); - print '
'.$langs->trans("TransferFrom").''.$langs->trans("TransferTo").''.$langs->trans("Date").''.$langs->trans("Description").''.$langs->trans("Amount").'
'; + print '
'; // Date payment print '
'; @@ -459,7 +459,7 @@ if ($id) print '
'; print '
'; - print ''; + print '
'; // Label print ''; diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index cad88367aa0..d73d6d8a391 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -256,15 +256,19 @@ if ($result) // Ref print "\n"; + if (! $i) $totalarray['nbfield']++; // Label payment print "\n"; + if (! $i) $totalarray['nbfield']++; // Date payment print '\n"; + if (! $i) $totalarray['nbfield']++; // Type print ''; + if (! $i) $totalarray['nbfield']++; // Account if (! empty($conf->banque->enabled)) @@ -289,6 +293,7 @@ if ($result) } else print ' '; print ''; + if (! $i) $totalarray['nbfield']++; } // Accounting account @@ -297,6 +302,7 @@ if ($result) $accountingaccount->fetch('', $obj->accountancy_code, 1); print ''; + if (! $i) $totalarray['nbfield']++; } // Debit @@ -304,8 +310,10 @@ if ($result) if ($obj->sens == 0) { print price($obj->amount); - $totalarray['totaldeb'] += $obj->amount; + $totalarray['val']['total_deb'] += $obj->amount; } + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='total_deb'; print ""; // Credit @@ -313,8 +321,10 @@ if ($result) if ($obj->sens == 1) { print price($obj->amount); - $totalarray['totalcred'] += $obj->amount; + $totalarray['val']['total_cred'] += $obj->amount; } + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='total_cred'; print ""; print ""; @@ -326,12 +336,8 @@ if ($result) if (! empty($conf->banque->enabled)) $colspan++; if (! empty($conf->accounting->enabled)) $colspan++; - print ''; - print ''; - print '"; - print '"; - print ''; - print ''; + // Show total line + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; print "
'.$langs->trans("Label").''.$object->label.'
".$variousstatic->getNomUrl(1)."".dol_trunc($obj->label, 40)."'.dol_print_date($db->jdate($obj->datep), 'day')."'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'
'.$langs->trans("Total").''.price($totalarray['totaldeb'])."'.price($totalarray['totalcred'])."
"; print '
'; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index aef5c0573f9..602cd9142cf 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -318,6 +318,7 @@ if ($action=="create" || $action=="start") print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register'); print ''; + print ''; if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1') { print ''; @@ -326,7 +327,7 @@ if ($action=="create" || $action=="start") { print ''; } - print ''; + print '
'; print ''; print ''; print ''; @@ -406,7 +407,7 @@ if ($action=="create" || $action=="start") print '
'; - print '
'.$langs->trans("Module").''.$langs->trans("CashDesk").' ID
'; + print '
'; print ''; print ''; diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index e0461d35368..7a40d6638ee 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -168,8 +168,8 @@ if (empty($reshook)) // Mass actions $objectclass='CashControl'; $objectlabel='CashControl'; - $permtoread = ($user->rights->cashdesk->use || $user->rights->takepos->use); - $permtodelete = ($user->rights->cashdesk->use || $user->rights->takepos->use); + $permissiontoread = ($user->rights->cashdesk->use || $user->rights->takepos->use); + $permissiontodelete = ($user->rights->cashdesk->use || $user->rights->takepos->use); //$uploaddir = ''; //include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -516,26 +516,8 @@ while ($i < min($num, $limit)) } // Show total line -if (isset($totalarray['pos'])) -{ - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found if ($num == 0) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 8af3495afc8..2a2477fce5e 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -216,22 +216,22 @@ if ($resql) if ($objp->amount < 0) { print price($objp->amount * -1); - $totalarray['totaldeb'] += $objp->amount; + $totalarray['val']['totaldebfield'] += $objp->amount; } print "\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totaldebfield']=$totalarray['nbfield']; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='totaldebfield'; // Credit print '\n"; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalcredfield']=$totalarray['nbfield']; + if (! $i) $totalarray['pos'][$totalarray['nbfield']]='totalcredfield'; print ""; @@ -239,24 +239,7 @@ if ($resql) } // Show total line - if (isset($totalarray['totaldebfield']) || isset($totalarray['totalcredfield'])) - { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if ($i == 1) - { - if ($num < $limit && empty($offset)) print ''; - else print ''; - } - elseif ($totalarray['totaldebfield'] == $i) print ''; - elseif ($totalarray['totalcredfield'] == $i) print ''; - else print ''; - } - print ''; - } + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; print "
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; if ($objp->amount > 0) { print price($objp->amount); - $totalarray['totalcred'] += $objp->amount; + $totalarray['val']['totalcredfield'] += $objp->amount; } print "
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price(-1 * $totalarray['totaldeb']).''.price($totalarray['totalcred']).'
"; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 5fe9853ec54..bd333110e51 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -125,7 +125,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print load_fiche_titre($langs->trans("SocialContributionsPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); } - print ''; + print '
'; print ''; print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="140px"', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder); @@ -281,7 +281,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $num = $db->num_rows($result); $i = 0; $total = 0 ; - print '
'; + print '
'; print ''; print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="140px"', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder); @@ -414,7 +414,7 @@ while($j<$numlt) $num = $db->num_rows($result); $i = 0; $total = 0 ; - print '
'; + print '
'; print ''; print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder); @@ -495,7 +495,7 @@ if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $num = $db->num_rows($result); $i = 0; $total = 0 ; - print '
'; + print '
'; print ''; print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "s.dateep", "", $param, 'width="140px"', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, '', $sortfield, $sortorder); diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 15f3504268b..8cfeeda613e 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -141,7 +141,7 @@ if ($resql) print ''; - print '
'; + print '
'; print ''; print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", "", 'valign="center"', $sortfield, $sortorder); diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index dd56e611545..488a5a86cf7 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -250,7 +250,7 @@ if ($action == 'create') print ''; print ''; - print '
'; + print '
'; print ""; print '
'.$langs->trans("Type").''; @@ -339,7 +339,7 @@ elseif ($id) print ''; print ''; - print ''; + print '
'; // Ref print ""; @@ -426,7 +426,7 @@ elseif ($id) $soc = new Societe($db); if ($object->socid) $soc->fetch($object->socid); - print '
'; + print '
'; $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 659744a2ba0..fde600aff8f 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -97,7 +97,7 @@ print '
'; // Statistics -print '
'; +print '
'; print ''; print ''; print "\n"; @@ -160,7 +160,7 @@ if ($result) $i = 0; - print '
'.$langs->trans("Statistics").'
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 6d5d952d104..3f92e9127da 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -120,7 +120,7 @@ if ($resql) $i = 0; print ''."\n"; - print '
'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).''.$langs->trans("FeesKilometersOrAmout").'
'; + print '
'; print ""; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", "", "&socid=$socid", '', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "d.type", "", "&socid=$socid", '', $sortfield, $sortorder); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index ccb2ecb60fe..d313224cf53 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -228,7 +228,7 @@ print '
'; // Show filter box print ''; print ''; -print '
'; +print '
'; print ''; // Company print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; @@ -253,7 +253,7 @@ print ''; print '

'; print '
'; -print ''; +print '
'; print ''; print ''; print ''; @@ -291,7 +291,7 @@ print '
'; // Show graphs -print '
'.$langs->trans("Year").''.$langs->trans("Number").'
'; +print '
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 10eb2ac03c8..e13693e7411 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -146,8 +146,8 @@ if (empty($reshook)) // Mass actions /*$objectclass='MyObject'; $objectlabel='MyObject'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; + $permissiontoread = $user->rights->mymodule->read; + $permissiontodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/ @@ -999,7 +999,7 @@ if ($action == 'create') if (! empty($conf->projet->enabled)) $rowspan++; if ($object->fk_account > 0) $rowspan++; - print ''; + print '
'; $object->fetch_thirdparty(); @@ -1111,7 +1111,7 @@ if ($action == 'create') dol_fiche_head(null, '', '', 0); - print '
'; + print '
'; // Frequency + unit print ''; + + // Multicurrency rate + if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) + { + print ''; + print ''; - - // Multicurrency rate - if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) - { - print ''; - print ''; + if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { + if($action == 'actualizemulticurrencyrate') { + list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); + } + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate?'multicurrency_tx':'none'), $object->multicurrency_code); + } else { + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); + if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { + print '
        '; + print ''.$langs->trans("ActualizeCurrency").''; + print '
'; + } } + print ''; + } } // Help of substitution key @@ -1512,7 +1514,7 @@ else $title = $langs->trans("Recurrence"); //print load_fiche_titre($title, '', 'calendar'); - print '
'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')).""; @@ -1285,7 +1285,7 @@ else print '
'; print '
'; - print ''; + print '
'; print '"; @@ -1364,41 +1364,43 @@ else print '
'.$langs->trans("Author").''.$author->getFullName($langs)."
'; - if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon)) + if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon)) { print ''; + } + print '
'; print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; + print '
'; + $htmlname = (($usercancreate && $action == 'editmulticurrencycode')?'multicurrency_code':'none'); + $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname); + print '
'; + print ''; + if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { + print ''; + } print '
'; + print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); + print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; print '
'; - $htmlname = (($usercancreate && $action == 'editmulticurrencycode')?'multicurrency_code':'none'); - $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname); - print '
'; - print ''; - if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) - print ''; - print '
'; - print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); - print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; - print '
'; - if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { - if($action == 'actualizemulticurrencyrate') { - list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); - } - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate?'multicurrency_tx':'none'), $object->multicurrency_code); - } else { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); - if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { - print '
        '; - print ''.$langs->trans("ActualizeCurrency").''; - print '
'; - } - } - print '
'; + print '
'; print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index fce1fb7cb25..10f54e538a2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1151,7 +1151,7 @@ if (empty($reshook)) } // Standard invoice or Deposit invoice, created from a Predefined template invoice - if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec') > 0) + if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec', 'int') > 0) { $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) @@ -1661,6 +1661,7 @@ if (empty($reshook)) $object->date_pointoftax = $date_pointoftax; $object->note_public = trim(GETPOST('note_public', 'none')); $object->note = trim(GETPOST('note', 'none')); + $object->note_private = trim(GETPOST('note', 'none')); $object->ref_client = GETPOST('ref_client', 'alpha'); $object->ref_int = GETPOST('ref_int', 'alpha'); $object->modelpdf = GETPOST('model', 'alpha'); @@ -2488,7 +2489,7 @@ if (empty($reshook)) // Actions to build doc $upload_dir = $conf->facture->multidir_output[$object->entity]; - $permissioncreate=$usercancreate; + $permissiontoadd=$usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; @@ -2747,15 +2748,23 @@ if ($action == 'create') dol_fiche_head(''); - print '
'.$title.'
'; + print '
'; // Ref print ''; - // Thirdparty - print ''; - if ($soc->id > 0 && ! GETPOST('fac_rec', 'int')) + $exampletemplateinvoice=new FactureRec($db); + $invoice_predefined = new FactureRec($db); + if (empty($origin) && empty($originid) && GETPOST('fac_rec', 'int') > 0) { + $invoice_predefined->fetch(GETPOST('fac_rec', 'int')); + } + + // Thirdparty + if ($soc->id > 0 && (! GETPOST('fac_rec', 'int') || ! empty($invoice_predefined->frequency))) + { + // If thirdparty known and not a predefined invoiced without a recurring rule + print ''; print ''; + print '' . "\n"; } else { + print ''; print ''; + print '' . "\n"; } - print '' . "\n"; - - $exampletemplateinvoice=new FactureRec($db); // Overwrite some values if creation of invoice is from a predefined invoice if (empty($origin) && empty($originid) && GETPOST('fac_rec', 'int') > 0) { - $invoice_predefined = new FactureRec($db); $invoice_predefined->fetch(GETPOST('fac_rec', 'int')); $dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later @@ -2827,13 +2835,14 @@ if ($action == 'create') if ($num > 0) { print '
' . $langs->trans('Ref') . '' . $langs->trans('Draft') . '
' . $langs->trans('Customer') . '
' . $langs->trans('Customer') . ''; print $soc->getNomUrl(1); print ''; @@ -2771,9 +2780,11 @@ if ($action == 'create') } print ')'; print '
' . $langs->trans('Customer') . ''; print $form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // Option to reload page to retrieve customer informations. Note, this clear other input @@ -2790,17 +2801,14 @@ if ($action == 'create') }); '; } - print ' '.$langs->trans("AddThirdParty").''; + if (! GETPOST('fac_rec', 'int')) print ' '.$langs->trans("AddThirdParty").''; print '
' . $langs->trans('CreateFromRepeatableInvoice') . ''; - print ''; + print 'id > 0) $text .= ' disabled'; $text .= '>'; if ($options) { @@ -3057,7 +3067,7 @@ if ($action == 'create') print '
'; $tmp='global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp.=' disabled'; + if ((! $optionsav && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) || $invoice_predefined->id > 0) $tmp.=' disabled'; $tmp.= '> '; // Show credit note options only if we checked credit note print ''; } - /* * View */ @@ -532,6 +541,12 @@ if ($action == "search") { }); +function SendTicket(id) +{ + console.log("Open box to select the Print/Send form"); + $.colorbox({href:"send.php?facid="+id, width:"90%", height:"50%", transition:"none", iframe:"true", title:"trans("SendTicket");?>"}); +} + function Print(id){ $.colorbox({href:"receipt.php?facid="+id, width:"40%", height:"90%", transition:"none", iframe:"true", title:"trans("PrintTicket"); ?>"}); @@ -548,6 +563,13 @@ function TakeposPrinting(id){ }); }); } +function DolibarrTakeposPrinting(id) { + console.log('Printing invoice ticket ' + id) + $.ajax({ + type: "GET", + url: "" + id, + }); +} + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/takepos/printsend.php + * \ingroup takepos + * \brief Page with the content of the popup to enter payments + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); + +require '../main.inc.php'; // Load $user and permissions +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + +$invoiceid = GETPOST('facid', 'int'); + +/* + * View + */ + +$invoice = new Facture($db); +if ($invoiceid > 0) +{ + $invoice->fetch($invoiceid); +} +else +{ + $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $resql = $db->query($sql); + $obj = $db->fetch_object($resql); + if ($obj) + { + $invoiceid = $obj->rowid; + } + if (! $invoiceid) + { + $invoiceid=0; // Invoice does not exist yet + } + else + { + $invoice->fetch($invoiceid); + } +} + +$langs->loadLangs(array("main", "bills", "cashdesk")); + +?> + + + + + + +
+
+
+
+
+
+
+ + + +
+ + + diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 001fd842165..8966c575f9f 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -539,10 +539,18 @@ function TakeposPrintingTemp(){ function OpenDrawer(){ console.log("OpenDrawer"); $.ajax({ - type: "POST", - url: 'http://global->TAKEPOS_PRINT_SERVER;?>:8111/print', - data: "opendrawer" - }); + type: "POST", + url: 'http://global->TAKEPOS_PRINT_SERVER;?>:8111/print', + data: "opendrawer" + }); +} + +function DolibarrOpenDrawer() { + console.log("DolibarrOpenDrawer"); + $.ajax({ + type: "GET", + url: "", + }); } function MoreActions(totalactions){ @@ -701,8 +709,11 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) //add temp ticket button if ($conf->global->TAKEPOS_BAR_RESTAURANT) { - if ($conf->global->TAKEPOSCONNECTOR) $menus[$r++]=array('title'=>'
'.$langs->trans("Receipt").'
','action'=>'TakeposPrinting(placeid);'); - else $menus[$r++]=array('title'=>'
'.$langs->trans("Receipt").'
','action'=>'Print(placeid);'); + if ($conf->global->TAKEPOSCONNECTOR) { + $menus[$r++]=array('title'=>'
'.$langs->trans("Receipt").'
','action'=>'TakeposPrinting(placeid);'); + } else { + $menus[$r++]=array('title'=>'
'.$langs->trans("Receipt").'
','action'=>'Print(placeid);'); + } } if ($conf->global->TAKEPOSCONNECTOR && $conf->global->TAKEPOS_ORDER_NOTES==1) { @@ -713,6 +724,12 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) if ($conf->global->TAKEPOSCONNECTOR) { $menus[$r++]=array('title'=>'
'.$langs->trans("DOL_OPEN_DRAWER").'
', 'action'=>'OpenDrawer();'); } +if ($conf->global->TAKEPOS_DOLIBARR_PRINTER) { + $menus[$r++] = array( + 'title' => '
'.$langs->trans("DOL_OPEN_DRAWER").'
', + 'action' => 'DolibarrOpenDrawer();', + ); +} $hookmanager->initHooks(array('takeposfrontend')); $reshook=$hookmanager->executeHooks('ActionButtons'); diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index 27fc142d991..75dcde0c2e4 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -44,7 +44,7 @@ a.badge:focus, a.badge:hover { text-decoration: none; } -.liste_titre .badge { +.liste_titre .badge:not(.nochangebackground) { background-color: ; color: #fff; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 8cab8f2cf5f..37fbcbad115 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2074,7 +2074,7 @@ div.login_block_other { padding-top: 0; text-align: right; margin-right: 8px; } float: right; vertical-align: top; padding: 0px 3px 0px 4px !important; - line-height: px; + line-height: px; height: px; } .atoplogin, .atoplogin:hover { diff --git a/htdocs/theme/md/badges.inc.php b/htdocs/theme/md/badges.inc.php index 11536240ee0..9f53a631ee4 100644 --- a/htdocs/theme/md/badges.inc.php +++ b/htdocs/theme/md/badges.inc.php @@ -44,7 +44,7 @@ a.badge:focus, a.badge:hover { text-decoration: none; } -.liste_titre .badge { +.liste_titre .badge:not(.nochangebackground) { background-color: ; color: #fff; } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 6aa6d42e590..779a3667c9e 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -588,7 +588,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be inc // Actions to build doc $upload_dir = $conf->ticket->dir_output; -$permissioncreate = $user->rights->ticket->write; +$permissiontoadd = $user->rights->ticket->write; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Actions to send emails @@ -689,7 +689,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd /* * Projet synthese pour rappel */ - print ''; + print '
'; $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 494d6b351b8..d606fc1716c 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -181,13 +181,13 @@ class Ticket extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>''), 'track_id' => array('type'=>'varchar(255)', 'label'=>'TicketTrackId', 'visible'=>-2, 'enabled'=>1, 'position'=>11, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"), - 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'css'=>'nowraponall'), + 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>-2, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth75'), 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth100'), 'category_code' => array('type'=>'varchar(32)', 'label'=>'TicketGroup', 'visible'=>-1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), - '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'=>"LinkToThirparty"), + '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'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), 'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), @@ -306,7 +306,7 @@ class Ticket extends CommonObject } if (empty($this->ref)) { - $this->errors[] = 'ErrorBadRef'; + $this->errors[] = 'ErrorTicketRefRequired'; dol_syslog(get_class($this) . "::create error -1 ref null", LOG_ERR); $result = -1; } diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index d749aa25f02..88e895435a7 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -211,7 +211,7 @@ $stringtoshow .= ''; $stringtoshow .= ''; print '
'; -print '
'; +print '
'; print ''; print '
' . $langs->trans("Statistics") . ' ' . img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"') . '
'; @@ -261,7 +261,7 @@ print '
'; print '
'; // Build graphic number of object -$data = $stats->getNbByMonth($endyear, $startyear); +$data = $stats->getNbByMonthWithPrevYear($endyear, $startyear); print '
'; @@ -309,7 +309,7 @@ if ($result) { $transRecordedType = $langs->trans("LatestNewTickets", $max); print '
'; - print ''; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 7c6f525a0c4..1360dc6efcd 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2018 Regis Houssin * Copyright (C) 2019 Juanjo Menent + * Copyright (C) 2019 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -175,8 +176,8 @@ if (empty($reshook)) // Mass actions $objectclass='Ticket'; $objectlabel='Ticket'; - $permtoread = $user->rights->ticket->read; - $permtodelete = $user->rights->ticket->delete; + $permissiontoread = $user->rights->ticket->read; + $permissiontodelete = $user->rights->ticket->delete; $uploaddir = $conf->ticket->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -686,26 +687,8 @@ while ($i < min($num, $limit)) } // Show total line -if (isset($totalarray['pos'])) -{ - print ''; - $i=0; - while ($i < $totalarray['nbfield']) - { - $i++; - if (! empty($totalarray['pos'][$i])) print ''; - else - { - if ($i == 1) - { - if ($num < $limit) print ''; - else print ''; - } - else print ''; - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found if ($num == 0) diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index a6baeef7c06..588b645710a 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -230,7 +230,7 @@ print ''; print ''; -print '
' . $transRecordedType . ''.$langs->trans("FullList").'
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; +print '
'; print ''; // Company print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 284c88a867b..fd7de709fe4 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -305,10 +305,10 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco { $num = $db->num_rows($resql); - print ''; + print '
'; print ''; - print '
'; + print ''; print ''; @@ -362,7 +362,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco print '
'.$langs->trans("LastSalaries", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSalaries").' '.$num.''; print '
'.$langs->trans("LastSalaries", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllSalaries").''.$num.'
'; print ''; - print '
'; + print ''; print ''; @@ -418,7 +418,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco print '
'.$langs->trans("LastHolidays", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllHolidays").' '.$num.''; print '
'.$langs->trans("LastHolidays", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllHolidays").''.$num.'
'; print ''; - print '
'; + print ''; print ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c924aae08bf..7c4c3bc0ef1 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -99,6 +99,8 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +$socialnetworks = getArrayOfSocialNetworks(); + // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('usercard', 'globalcard')); @@ -107,7 +109,6 @@ $hookmanager->initHooks(array('usercard', 'globalcard')); /** * Actions */ - $parameters=array('id' => $id, 'socid' => $socid, 'group' => $group, 'caneditgroup' => $caneditgroup); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -211,10 +212,16 @@ if (empty($reshook)) { $object->office_fax = GETPOST("office_fax", 'alphanohtml'); $object->user_mobile = GETPOST("user_mobile", 'alphanohtml'); - $object->skype = GETPOST("skype", 'alphanohtml'); - $object->twitter = GETPOST("twitter", 'alphanohtml'); - $object->facebook = GETPOST("facebook", 'alphanohtml'); - $object->linkedin = GETPOST("linkedin", 'alphanohtml'); + //$object->skype = GETPOST("skype", 'alphanohtml'); + //$object->twitter = GETPOST("twitter", 'alphanohtml'); + //$object->facebook = GETPOST("facebook", 'alphanohtml'); + //$object->linkedin = GETPOST("linkedin", 'alphanohtml'); + $object->socialnetworks = array(); + if (! empty($conf->socialnetworks->enabled)) { + foreach ($socialnetworks as $key => $value) { + $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); + } + } $object->email = preg_replace('/\s+/', '', GETPOST("email", 'alphanohtml')); $object->job = GETPOST("job", 'nohtml'); @@ -366,12 +373,16 @@ if (empty($reshook)) { $object->office_phone = GETPOST("office_phone", 'alphanohtml'); $object->office_fax = GETPOST("office_fax", 'alphanohtml'); $object->user_mobile = GETPOST("user_mobile", 'alphanohtml'); - - $object->skype = GETPOST("skype", 'alphanohtml'); - $object->twitter = GETPOST("twitter", 'alphanohtml'); - $object->facebook = GETPOST("facebook", 'alphanohtml'); - $object->linkedin = GETPOST("linkedin", 'alphanohtml'); - + //$object->skype = GETPOST("skype", 'alphanohtml'); + //$object->twitter = GETPOST("twitter", 'alphanohtml'); + //$object->facebook = GETPOST("facebook", 'alphanohtml'); + //$object->linkedin = GETPOST("linkedin", 'alphanohtml'); + $object->socialnetworks = array(); + if (! empty($conf->socialnetworks->enabled)) { + foreach ($socialnetworks as $key => $value) { + $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); + } + } $object->email = preg_replace('/\s+/', '', GETPOST("email", 'alphanohtml')); $object->job = GETPOST("job", 'nohtml'); $object->signature = GETPOST("signature", 'none'); @@ -630,10 +641,10 @@ if (empty($reshook)) { $ldap_phone = $attribute[$conf->global->LDAP_FIELD_PHONE]; $ldap_fax = $attribute[$conf->global->LDAP_FIELD_FAX]; $ldap_mobile = $attribute[$conf->global->LDAP_FIELD_MOBILE]; - $ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE]; - $ldap_twitter = $attribute[$conf->global->LDAP_FIELD_TWITTER]; - $ldap_facebook = $attribute[$conf->global->LDAP_FIELD_FACEBOOK]; - $ldap_linkedin = $attribute[$conf->global->LDAP_FIELD_LINKEDIN]; + $ldap_social['skype'] = $attribute[$conf->global->LDAP_FIELD_SKYPE]; + $ldap_social['twitter'] = $attribute[$conf->global->LDAP_FIELD_TWITTER]; + $ldap_social['facebook'] = $attribute[$conf->global->LDAP_FIELD_FACEBOOK]; + $ldap_social['linkedin'] = $attribute[$conf->global->LDAP_FIELD_LINKEDIN]; $ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL]; $ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID]; } @@ -654,7 +665,7 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->user->dir_output; - $permissioncreate=$user->rights->user->user->creer; + $permissiontoadd=$user->rights->user->user->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -1085,73 +1096,95 @@ if ($action == 'create' || $action == 'adduserldap') } print ''; - // Skype - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - print ''; + print ''; + } else { + // if social network is not active but value exist we do not want to loose it + if (! empty($ldap_social[$key])) { + print ''; + } else { + print ''; + } + } } - else - { - print ''; - } - print ''; } + // // Skype + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''; + // print ''; + // } - // Twitter - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - print ''; - } + // // Twitter + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''; + // print ''; + // } - // Facebook - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - print ''; - } + // // Facebook + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''; + // print ''; + // } - // LinkedIn - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - print ''; - } + // // LinkedIn + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''; + // print ''; + // } // Accountancy code if ($conf->accounting->enabled) @@ -1979,7 +2012,7 @@ else print ''; } - print '
'.$langs->trans("LastExpenseReports", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllExpenseReports").' '.$num.''; print '
'.$langs->trans("LastExpenseReports", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllExpenseReports").''.$num.'
'.$langs->trans("Skype").''; - if (! empty($ldap_skype)) - { - print ''; - print $ldap_skype; + if (! empty($conf->socialnetworks->enabled)) { + foreach ($socialnetworks as $key => $value) { + if ($value['active']) { + print '
'.$langs->trans($value['label']).''; + if (! empty($ldap_social[$key])) { + print ''; + print $ldap_social[$key]; + } else { + print ''; + } + print '
'.$langs->trans("Skype").''; + // if (! empty($ldap_skype)) + // { + // print ''; + // print $ldap_skype; + // } + // else + // { + // print ''; + // } + // print '
'.$langs->trans("Twitter").''; - if (! empty($ldap_twitter)) - { - print ''; - print $ldap_twitter; - } - else - { - print ''; - } - print '
'.$langs->trans("Twitter").''; + // if (! empty($ldap_twitter)) + // { + // print ''; + // print $ldap_twitter; + // } + // else + // { + // print ''; + // } + // print '
'.$langs->trans("Facebook").''; - if (! empty($ldap_facebook)) - { - print ''; - print $ldap_facebook; - } - else - { - print ''; - } - print '
'.$langs->trans("Facebook").''; + // if (! empty($ldap_facebook)) + // { + // print ''; + // print $ldap_facebook; + // } + // else + // { + // print ''; + // } + // print '
'.$langs->trans("LinkedIn").''; - if (! empty($ldap_linkedin)) - { - print ''; - print $ldap_linkedin; - } - else - { - print ''; - } - print '
'.$langs->trans("LinkedIn").''; + // if (! empty($ldap_linkedin)) + // { + // print ''; + // print $ldap_linkedin; + // } + // else + // { + // print ''; + // } + // print '
'."\n"; + print '
'."\n"; // Other form for add user to group $parameters=array('caneditgroup' => $caneditgroup, 'groupslist' => $groupslist, 'exclude' => $exclude); @@ -2431,73 +2464,92 @@ else } print ''; - // Skype - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - print ''; + print ''; + } else { + // if social network is not active but value exist we do not want to loose it + print ''; + } } - else - { - print ''; - print $object->skype; - } - print ''; } - // Twitter - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - print ''; - } + // // Skype + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''; + // print ''; + // } - // Facebook - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - print ''; - } + // // Twitter + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''; + // print ''; + // } - // LinkedIn - if (! empty($conf->socialnetworks->enabled)) - { - print ''; - print ''; - } + // // Facebook + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''; + // print ''; + // } + + // // LinkedIn + // if (! empty($conf->socialnetworks->enabled)) + // { + // print ''; + // print ''; + // } // OpenID url if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 76d4d431561..6702953878c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -74,9 +74,35 @@ class User extends CommonObject public $email; public $personal_email; + + /** + * @var array array of socialnetworks + */ + public $socialnetworks; + + /** + * Skype username + * @var string + * @deprecated + */ public $skype; + /** + * Twitter username + * @var string + * @deprecated + */ public $twitter; + /** + * Facebook username + * @var string + * @deprecated + */ public $facebook; + /** + * Linkedin username + * @var string + * @deprecated + */ public $linkedin; public $job; // job position @@ -255,7 +281,8 @@ class User extends CommonObject $login=trim($login); // Get user - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.personal_email, u.job, u.skype, u.twitter, u.facebook, u.linkedin,"; + $sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.personal_email, u.job,"; + $sql.= " u.socialnetworks,"; $sql.= " u.signature, u.office_phone, u.office_fax, u.user_mobile, u.personal_mobile,"; $sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,"; $sql.= " u.admin, u.login, u.note as note_private, u.note_public,"; @@ -366,11 +393,8 @@ class User extends CommonObject $this->user_mobile = $obj->user_mobile; $this->personal_mobile = $obj->personal_mobile; $this->email = $obj->email; - $this->personal_email = $obj->personal_email; - $this->skype = $obj->skype; - $this->twitter = $obj->twitter; - $this->facebook = $obj->facebook; - $this->linkedin = $obj->linkedin; + $this->personal_email = $obj->personal_email; + $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); $this->job = $obj->job; $this->signature = $obj->signature; $this->admin = $obj->admin; @@ -1292,10 +1316,7 @@ class User extends CommonObject $this->firstname = $contact->firstname; $this->gender = $contact->gender; $this->email = $contact->email; - $this->skype = $contact->skype; - $this->twitter = $contact->twitter; - $this->facebook = $contact->facebook; - $this->linkedin = $contact->linkedin; + $this->socialnetworks = $contact->socialnetworks; $this->office_phone = $contact->phone_pro; $this->office_fax = $contact->fax; $this->user_mobile = $contact->phone_mobile; @@ -1511,11 +1532,6 @@ class User extends CommonObject $this->email = trim($this->email); $this->personal_email = trim($this->personal_email); - $this->skype = trim($this->skype); - $this->twitter = trim($this->twitter); - $this->facebook = trim($this->facebook); - $this->linkedin = trim($this->linkedin); - $this->job = trim($this->job); $this->signature = trim($this->signature); $this->note_public = trim($this->note_public); @@ -1568,10 +1584,7 @@ class User extends CommonObject $sql.= ", personal_mobile = '".$this->db->escape($this->personal_mobile)."'"; $sql.= ", email = '".$this->db->escape($this->email)."'"; $sql.= ", personal_email = '".$this->db->escape($this->personal_email)."'"; - $sql.= ", skype = '".$this->db->escape($this->skype)."'"; - $sql.= ", twitter = '".$this->db->escape($this->twitter)."'"; - $sql.= ", facebook = '".$this->db->escape($this->facebook)."'"; - $sql.= ", linkedin = '".$this->db->escape($this->linkedin)."'"; + $sql.= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; $sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'"; $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; @@ -1661,10 +1674,7 @@ class User extends CommonObject $adh->email=$this->email; - $adh->skype=$this->skype; - $adh->twitter=$this->twitter; - $adh->facebook=$this->facebook; - $adh->linkedin=$this->linkedin; + $adh->socialnetworks=$this->socialnetworks; $adh->phone=$this->office_phone; $adh->phone_mobile=$this->user_mobile; @@ -1714,10 +1724,7 @@ class User extends CommonObject $tmpobj->email=$this->email; - $tmpobj->skype=$this->skype; - $tmpobj->twitter=$this->twitter; - $tmpobj->facebook=$this->facebook; - $tmpobj->linkedin=$this->linkedin; + $tmpobj->socialnetworks=$this->socialnetworks; $tmpobj->phone_pro=$this->office_phone; $tmpobj->phone_mobile=$this->user_mobile; @@ -2701,10 +2708,12 @@ class User extends CommonObject $this->note_private='This is a note private'; $this->email='email@specimen.com'; $this->personal_email='personalemail@specimen.com'; - $this->skype='skypepseudo'; - $this->twitter='twitterpseudo'; - $this->facebook='facebookpseudo'; - $this->linkedin='linkedinpseudo'; + $this->socialnetworks = array( + 'skype' => 'skypepseudo', + 'twitter' => 'twitterpseudo', + 'facebook' => 'facebookpseudo', + 'linkedin' => 'linkedinpseudo', + ); $this->office_phone='0999999999'; $this->office_fax='0999999998'; $this->user_mobile='0999999997'; diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 54f39625ad4..54a1b7dce88 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -32,17 +32,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Defini si peux lire/modifier utilisateurs et permisssions -$canreadperms=($user->admin || $user->rights->user->user->lire); -$caneditperms=($user->admin || $user->rights->user->user->creer); -$candisableperms=($user->admin || $user->rights->user->user->supprimer); +$canreadperms = ($user->admin || $user->rights->user->user->lire); +$caneditperms = ($user->admin || $user->rights->user->user->creer); +$candisableperms = ($user->admin || $user->rights->user->user->supprimer); $feature2 = 'user'; // Advanced permissions -if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS)) +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $canreadperms=($user->admin || $user->rights->user->group_advance->read); - $caneditperms=($user->admin || $user->rights->user->group_advance->write); - $candisableperms=($user->admin || $user->rights->user->group_advance->delete); + $canreadperms = ($user->admin || $user->rights->user->group_advance->read); + $caneditperms = ($user->admin || $user->rights->user->group_advance->write); + $candisableperms = ($user->admin || $user->rights->user->group_advance->delete); $feature2 = 'group_advance'; } @@ -53,7 +53,7 @@ $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$contextpage = GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'groupcard'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'groupcard'; // To manage different context of search $userid = GETPOST('user', 'int'); @@ -61,7 +61,7 @@ $userid = GETPOST('user', 'int'); $result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2); // Users/Groups management only in master entity if transverse mode -if (! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) +if (!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) { accessforbidden(); } @@ -78,7 +78,7 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array -$hookmanager->initHooks(array('groupcard','globalcard')); +$hookmanager->initHooks(array('groupcard', 'globalcard')); @@ -86,14 +86,14 @@ $hookmanager->initHooks(array('groupcard','globalcard')); * Actions */ -$parameters=array('id' => $id, 'userid' => $userid, 'caneditperms' => $caneditperms); -$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +$parameters = array('id' => $id, 'userid' => $userid, 'caneditperms' => $caneditperms); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { if ($cancel) { - if (! empty($backtopage)) + if (!empty($backtopage)) { header("Location: ".$backtopage); exit; @@ -103,7 +103,7 @@ if (empty($reshook)) { header("Location: ".DOL_URL_ROOT.'/user/group/list.php'); exit; } - $action=''; + $action = ''; } // Action remove group @@ -128,19 +128,19 @@ if (empty($reshook)) { { if ($caneditperms) { - if (! $_POST["nom"]) { + if (!$_POST["nom"]) { setEventMessages($langs->trans("NameNotDefined"), null, 'errors'); - $action="create"; // Go back to create page + $action = "create"; // Go back to create page } else { $object->name = trim(GETPOST("nom", 'nohtml')); - $object->nom = $object->name; // For backward compatibility + $object->nom = $object->name; // For backward compatibility $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none'))); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); if ($ret < 0) $error++; - if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $object->entity = 0; + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $object->entity = 0; else $object->entity = $_POST["entity"]; $db->begin(); @@ -160,7 +160,7 @@ if (empty($reshook)) { $langs->load("errors"); setEventMessages($langs->trans("ErrorGroupAlreadyExists", $object->name), null, 'errors'); - $action="create"; // Go back to create page + $action = "create"; // Go back to create page } } } @@ -172,7 +172,7 @@ if (empty($reshook)) { } // Add/Remove user into group - if ($action == 'adduser' || $action =='removeuser') + if ($action == 'adduser' || $action == 'removeuser') { if ($caneditperms) { @@ -183,8 +183,8 @@ if (empty($reshook)) { $edituser = new User($db); $edituser->fetch($userid); - if ($action == 'adduser') $result=$edituser->SetInGroup($object->id, $object->entity); - if ($action == 'removeuser') $result=$edituser->RemoveFromGroup($object->id, $object->entity); + if ($action == 'adduser') $result = $edituser->SetInGroup($object->id, $object->entity); + if ($action == 'removeuser') $result = $edituser->RemoveFromGroup($object->id, $object->entity); if ($result > 0) { @@ -216,19 +216,19 @@ if (empty($reshook)) { $object->oldcopy = clone $object; $object->name = trim(GETPOST("group", 'nohtml')); - $object->nom = $object->name; // For backward compatibility + $object->nom = $object->name; // For backward compatibility $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none'))); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); if ($ret < 0) $error++; - if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $object->entity = 0; + if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) $object->entity = 0; else $object->entity = $_POST["entity"]; - $ret=$object->update(); + $ret = $object->update(); - if ($ret >= 0 && ! count($object->errors)) + if ($ret >= 0 && !count($object->errors)) { setEventMessages($langs->trans("GroupModified"), null, 'mesgs'); $db->commit(); @@ -248,7 +248,7 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->usergroup->dir_output; - $permissioncreate=$user->rights->user->user->creer; + $permissiontoadd = $user->rights->user->user->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -283,9 +283,9 @@ if ($action == 'create') print ''; // Multicompany - if (! empty($conf->multicompany->enabled) && is_object($mc)) + if (!empty($conf->multicompany->enabled) && is_object($mc)) { - if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { print "".''; print "".'\n"; // Other attributes - $parameters=array('object' => $object, 'colspan' => ' colspan="2"'); - $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + $parameters = array('object' => $object, 'colspan' => ' colspan="2"'); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { @@ -364,7 +364,7 @@ else print '
'.$langs->trans("Skype").''; - if ($caneditfield && empty($object->ldap_sid)) - { - print ''; + if (! empty($conf->socialnetworks->enabled)) { + foreach ($socialnetworks as $key => $value) { + if ($value['active']) { + print '
'.$langs->trans($value['label']).''; + if ($caneditfield && empty($object->ldap_sid)) { + print ''; + } else { + print ''; + print $object->socialnetworks[$key]; + } + print '
'.$langs->trans("Twitter").''; - if ($caneditfield && empty($object->ldap_sid)) - { - print ''; - } - else - { - print ''; - print $object->twitter; - } - print '
'.$langs->trans("Skype").''; + // if ($caneditfield && empty($object->ldap_sid)) + // { + // print ''; + // } + // else + // { + // print ''; + // print $object->skype; + // } + // print '
'.$langs->trans("Facebook").''; - if ($caneditfield && empty($object->ldap_sid)) - { - print ''; - } - else - { - print ''; - print $object->facebook; - } - print '
'.$langs->trans("Twitter").''; + // if ($caneditfield && empty($object->ldap_sid)) + // { + // print ''; + // } + // else + // { + // print ''; + // print $object->twitter; + // } + // print '
'.$langs->trans("LinkedIn").''; - if ($caneditfield && empty($object->ldap_sid)) - { - print ''; - } - else - { - print ''; - print $object->linkedin; - } - print '
'.$langs->trans("Facebook").''; + // if ($caneditfield && empty($object->ldap_sid)) + // { + // print ''; + // } + // else + // { + // print ''; + // print $object->facebook; + // } + // print '
'.$langs->trans("LinkedIn").''; + // if ($caneditfield && empty($object->ldap_sid)) + // { + // print ''; + // } + // else + // { + // print ''; + // print $object->linkedin; + // } + // print '
'.$langs->trans("Entity").'".$mc->select_entities($conf->entity); @@ -299,13 +299,13 @@ if ($action == 'create') print "
'.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note', '', '', 240, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); + $doleditor = new DolEditor('note', '', '', 240, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); $doleditor->Create(); 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)) + if (!empty($conf->mutlicompany->enabled)) { print ''; print '".''; @@ -390,8 +390,8 @@ else print "\n"; // Other attributes - $parameters=array('colspan' => ' colspan="2"'); - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + $parameters = array('colspan' => ' colspan="2"'); + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print "
'.$langs->trans("Name").''.dol_escape_htmltag($object->name); @@ -376,7 +376,7 @@ else } // Multicompany - if (! empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + if (!empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { $mc->getInfo($object->entity); print "
'.$langs->trans("Entity").'
\n"; print ''; @@ -423,17 +423,17 @@ else // On selectionne les users qui ne sont pas deja dans le groupe $exclude = array(); - if (! empty($object->members)) + if (!empty($object->members)) { - foreach($object->members as $useringroup) + foreach ($object->members as $useringroup) { - $exclude[]=$useringroup->id; + $exclude[] = $useringroup->id; } } // Other form for add user to group - $parameters=array('caneditperms' => $caneditperms, 'exclude' => $exclude); - $reshook=$hookmanager->executeHooks('formAddUserToGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + $parameters = array('caneditperms' => $caneditperms, 'exclude' => $exclude); + $reshook = $hookmanager->executeHooks('formAddUserToGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) @@ -443,7 +443,7 @@ else print ''."\n"; print ''; print ''; - print ''."\n"; + print '
'."\n"; print ''."\n"; print ''; print "\n"; - if (! empty($object->members)) + if (!empty($object->members)) { - foreach($object->members as $useringroup) + foreach ($object->members as $useringroup) { print ''; print ''; print ''; print '\n"; // Multicompany - if (! empty($conf->multicompany->enabled) && is_object($mc)) + if (!empty($conf->multicompany->enabled) && is_object($mc)) { - if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { print "".''; print "'; print ''; print "\n"; // Other attributes - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index dc990497808..59e39058629 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -98,7 +98,7 @@ else $userstatic->statut=$val['statut']; $userstatic->email=$val['email']; $userstatic->gender=$val['gender']; - $userstatic->societe_id=$val['fk_soc']; + $userstatic->socid=$val['fk_soc']; $userstatic->admin=$val['admin']; $userstatic->entity=$val['entity']; $userstatic->photo=$val['photo']; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index ec742f3e6a9..8840ba698c9 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -144,7 +144,7 @@ if ($resql) $fuserstatic->admin = $obj->admin; $fuserstatic->email = $obj->email; $fuserstatic->skype = $obj->skype; - $fuserstatic->societe_id = $obj->fk_soc; + $fuserstatic->socid = $obj->fk_soc; $companystatic->id=$obj->fk_soc; $companystatic->name=$obj->name; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 31e5c5382de..8161ce9ae75 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -502,12 +502,13 @@ while ($i < min($num, $limit)) $obj = $db->fetch_object($result); $userstatic->id=$obj->rowid; + $userstatic->admin = $obj->admin; $userstatic->ref=$obj->label; $userstatic->login=$obj->login; $userstatic->statut=$obj->statut; $userstatic->email=$obj->email; $userstatic->gender=$obj->gender; - $userstatic->societe_id=$obj->fk_soc; + $userstatic->socid=$obj->fk_soc; $userstatic->firstname=$obj->firstname; $userstatic->lastname=$obj->lastname; $userstatic->employee=$obj->employee; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 736db8767ec..c9ddaaed4aa 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -261,7 +261,7 @@ if ($action == 'edit') clearstatcache(); - print '
'.$langs->trans("NonAffectedUsers").''; print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity, 0, 0, '', 0, '', 'maxwidth300'); @@ -467,14 +467,14 @@ else print ' 
'; print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); - if ($useringroup->admin && ! $useringroup->entity) { + if ($useringroup->admin && !$useringroup->entity) { print img_picto($langs->trans("SuperAdministrator"), 'redstar'); } elseif ($useringroup->admin) { print img_picto($langs->trans("Administrator"), 'star'); @@ -484,7 +484,7 @@ else print ''.$useringroup->firstname.''.$useringroup->getLibStatut(3).''; - if (! empty($user->admin)) { + if (!empty($user->admin)) { print ''; print img_picto($langs->trans("RemoveFromGroup"), 'unlink'); print ''; @@ -511,8 +511,8 @@ else * Documents generes */ $filename = dol_sanitizeFileName($object->ref); - $filedir = $conf->usergroup->dir_output . "/" . dol_sanitizeFileName($object->ref); - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; + $filedir = $conf->usergroup->dir_output."/".dol_sanitizeFileName($object->ref); + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $user->rights->user->user->creer; $delallowed = $user->rights->user->user->supprimer; @@ -550,9 +550,9 @@ else print "
'.$langs->trans("Entity").'".$mc->select_entities($object->entity); @@ -567,13 +567,13 @@ else print '
'.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note', $object->note, '', 240, 'dolibarr_notes', '', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); + $doleditor = new DolEditor('note', $object->note, '', 240, 'dolibarr_notes', '', true, false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8, '90%'); $doleditor->Create(); print '
'; + print '
'; print ''; // Landing page @@ -333,7 +333,7 @@ else dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); - print '
'.$langs->trans("Parameter").''.$langs->trans("DefaultValue").' '.$langs->trans("PersonalValue").'
'; + print '
'; print ''; // Landing page diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index da19bd88205..c4fd52f250c 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -110,7 +110,7 @@ $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; }); -
'.$langs->trans("Parameter").''.$langs->trans("DefaultValue").' '.$langs->trans("PersonalValue").'
+
diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index dbe3082b5de..b782c5dc5ed 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -70,7 +70,7 @@ print "
\n"; print ''; print ''; -print '
trans('Ref') ?> trans('Label') ?>
'; +print '
'; print ''; print ""; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e0e3378bf26..947336ab88c 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2619,7 +2619,7 @@ if ($action == 'editcss') dol_fiche_head(); print ''."\n"; - print '
".$langs->trans("Parameter")."
'; + print '
'; // Website print '
'; @@ -2752,7 +2752,7 @@ if ($action == 'createsite') print ''."\n"; //print '
'; - print ''; + print '
'; if (GETPOST('WEBSITE_REF')) $siteref=GETPOST('WEBSITE_REF', 'alpha'); if (GETPOST('WEBSITE_DESCRIPTION')) $sitedesc=GETPOST('WEBSITE_DESCRIPTION', 'alpha'); @@ -3280,7 +3280,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print ''."\n"; print '
'; - if ($action == 'replacesiteconfirm') + if ($action == 'replacesiteconfirm' && $conf->global->MAIN_FEATURES_LEVEL >= 2) { print '
'; print '
'; diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php index 3190c081a43..4c2048798a5 100644 --- a/htdocs/website/lib/websiteaccount.lib.php +++ b/htdocs/website/lib/websiteaccount.lib.php @@ -46,7 +46,7 @@ function websiteaccountPrepareHead($object) if(!empty($object->fields['note_public'])) $nbNote++; $head[$h][0] = dol_buildpath('/monmodule/websiteaccount_note.php', 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; }*/ @@ -59,7 +59,7 @@ function websiteaccountPrepareHead($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = dol_buildpath("/monmodule/websiteaccount_document.php", 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index db8c5b632f6..e6c5b0f7c3d 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -29,49 +29,48 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("website","other")); +$langs->loadLangs(array("website", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new SocieteAccount($db); +$object = new SocieteAccount($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->website->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array +$diroutputmassaction = $conf->website->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all=trim(GETPOST("search_all", 'alpha')); -$search=array(); -foreach($object->fields as $key => $val) +$search_all = trim(GETPOST("search_all", 'alpha')); +$search = array(); +foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha'); } -if (empty($action) && empty($id) && empty($ref)) $action='view'; +if (empty($action) && empty($id) && empty($ref)) $action = 'view'; // Security check - Protection if external user //if ($user->socid > 0) access_forbidden(); //if ($user->socid > 0) $socid = $user->socid; //$result = restrictedArea($user, 'website', $id); -$permissionnote=$user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink=$user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php -$permissionedit=$user->rights->websiteaccount->write; // Used by the include of actions_lineupdown.inc.php -$permissiontoadd=$user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php +$permissionnote = $user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php +$permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. @@ -79,13 +78,13 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu * Actions */ -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { - $error=0; + $error = 0; $permissiontoadd = $user->rights->website->write; $permissiontodelete = $user->rights->website->delete; @@ -98,9 +97,9 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; // Actions to send emails - $trigger_name='WEBSITEACCOUNT_SENTBYMAIL'; - $autocopy='MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO'; - $trackid='websiteaccount'.$object->id; + $trigger_name = 'WEBSITEACCOUNT_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO'; + $trackid = 'websiteaccount'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -109,8 +108,8 @@ if (empty($reshook)) * View */ -$form=new Form($db); -$formfile=new FormFile($db); +$form = new Form($db); +$formfile = new FormFile($db); llxHeader('', 'WebsiteAccount', ''); @@ -145,10 +144,10 @@ if ($action == 'create') print '
'."\n"; // Common attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; print '
'."\n"; @@ -157,7 +156,7 @@ if ($action == 'create') print '
'; print ''; print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage + print ''; // Cancel for create does not post form if we don't know the backtopage print '
'; print ''; @@ -178,10 +177,10 @@ if (($id || $ref) && $action == 'edit') print ''."\n"; // Common attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; print '
'; @@ -197,7 +196,7 @@ if (($id || $ref) && $action == 'edit') // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - if ($object->fk_soc >0 && empty($socid)) $socid = $object->fk_soc; + if ($object->fk_soc > 0 && empty($socid)) $socid = $object->fk_soc; $res = $object->fetch_optionals(); @@ -208,14 +207,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteWebsiteAccount'), $langs->trans('ConfirmDeleteWebsiteAccount'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteWebsiteAccount'), $langs->trans('ConfirmDeleteWebsiteAccount'), 'confirm_delete', '', 0, 1); } // Call Hook formConfirm $parameters = array('lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; - elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; + if (empty($reshook)) $formconfirm .= $hookmanager->resPrint; + elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint; // Print form confirm print $formconfirm; @@ -223,11 +222,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback=''; - if ($socid) $linkback = '' . $langs->trans("BackToListOfThirdParty") . ''; - if ($fk_website) $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = ''; + if ($socid) $linkback = ''.$langs->trans("BackToListOfThirdParty").''; + if ($fk_website) $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref='
'; + $morehtmlref = '
'; /* // Ref bis $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->website->creer, 'string', '', 0, 1); @@ -269,7 +268,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } */ - $morehtmlref.='
'; + $morehtmlref .= '
'; if ($socid > 0) $object->next_prev_filter = 'te.fk_soc = '.$socid; @@ -282,10 +281,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''."\n"; // Common attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Other attributes - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print '
'; print '
'; @@ -300,14 +299,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // 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 + $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 - print ''."\n"; + print ''."\n"; if ($user->rights->website->write) { @@ -377,8 +376,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Presend form - $modelmail='websiteaccount'; - $defaulttopic='Information'; + $modelmail = 'websiteaccount'; + $defaulttopic = 'Information'; $diroutput = $conf->website->dir_output; $trackid = 'websiteaccount'.$object->id; diff --git a/htdocs/zapier/admin/setup.php b/htdocs/zapier/admin/setup.php index b8b203b8ab1..0754f75bb3c 100644 --- a/htdocs/zapier/admin/setup.php +++ b/htdocs/zapier/admin/setup.php @@ -78,7 +78,7 @@ if ($action == 'edit') { print ''; print ''; - print ''; + print '
'; print ''; foreach($arrayofparameters as $key => $val) { @@ -96,7 +96,7 @@ if ($action == 'edit') { print '
'; } else { if (! empty($arrayofparameters)) { - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; print ''; foreach($arrayofparameters as $key => $val) { diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 5c79d68aefe..fdc7aba2bc9 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -633,39 +633,22 @@ class Hook extends CommonObject public function LibStatut($status, $mode = 0) { // phpcs:enable - if (empty($this->labelStatus)) { - global $langs; - //$langs->load("zapier@zapier"); - $this->labelStatus[1] = $langs->trans('Enabled'); - $this->labelStatus[0] = $langs->trans('Disabled'); - } + global $langs; - if ($mode == 0) { - return $this->labelStatus[$status]; - } elseif ($mode == 1) { - return $this->labelStatus[$status]; - } elseif ($mode == 2) { - if ($status == 1) { - return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; - } elseif ($status == 0) { - return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; - } - } elseif ($mode == 3) { - if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); - } elseif ($mode == 4) { - if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; - elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status]; - } elseif ($mode == 5) { - if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); - } elseif ($mode == 6) { - if ($status == 1) { - return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle'); - } elseif ($status == 0) { - return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle'); - } - } + if (empty($this->labelStatus) || empty($this->labelStatusShort)) + { + global $langs; + //$langs->load("mymodule"); + $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + } + + $statusType = 'status5'; + if ($status == self::STATUS_VALIDATED) $statusType = 'status4'; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } /** diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php index e622ce8bcff..21e9c991d07 100644 --- a/htdocs/zapier/hook_list.php +++ b/htdocs/zapier/hook_list.php @@ -191,8 +191,8 @@ if (empty($reshook)) { // Mass actions $objectclass='Hook'; $objectlabel='Hook'; - $permtoread = $user->rights->mymodule->read; - $permtodelete = $user->rights->mymodule->delete; + $permissiontoread = $user->rights->mymodule->read; + $permissiontodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -570,27 +570,8 @@ while ($i < min($num, $limit)) { } // Show total line -if (isset($totalarray['pos'])) { - print ''; - $i=0; - while ($i < $totalarray['nbfield']) { - $i++; - if (! empty($totalarray['pos'][$i])) { - print ''; - } else { - if ($i == 1) { - if ($num < $limit) { - print ''; - } else { - print ''; - } - } else { - print ''; - } - } - } - print ''; -} +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found if ($num == 0) { diff --git a/htdocs/zapier/lib/zapier_hook.lib.php b/htdocs/zapier/lib/zapier_hook.lib.php index e1af0259062..98c10786c32 100644 --- a/htdocs/zapier/lib/zapier_hook.lib.php +++ b/htdocs/zapier/lib/zapier_hook.lib.php @@ -48,7 +48,7 @@ function myobjectPrepareHead($object) if (!empty($object->note_public)) $nbNote++; $head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; + if ($nbNote > 0) $head[$h][1].= ''.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -60,7 +60,7 @@ function myobjectPrepareHead($object) $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = dol_buildpath("/mymodule/myobject_document.php", 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ''.($nbFiles+$nbLinks).''; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/zapier/zapierindex.php b/htdocs/zapier/zapierindex.php index 9bec765c35e..f9931a29d41 100644 --- a/htdocs/zapier/zapierindex.php +++ b/htdocs/zapier/zapierindex.php @@ -104,9 +104,9 @@ if (! empty($conf->zapierfordolibarr->enabled) && $user->rights->zapierfordoliba $total = 0; $num = $db->num_rows($resql); - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''.$langs->trans("Totalforthispage").'
'; + print '
'; print ''; - print ''; + print ''; $var = true; if ($num > 0) @@ -188,7 +188,7 @@ if (! empty($conf->zapierfordolibarr->enabled) && $user->rights->zapierfordoliba $num = $db->num_rows($resql); $i = 0; - print '
'.$langs->trans("DraftOrders").($num?' '.$num.'':'').'
'.$langs->trans("DraftOrders").($num?''.$num.'':'').'
'; + print '
'; print ''; print ''; print '
'; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max); diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index 4a55aa81376..29b8fb14d95 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -182,11 +182,11 @@ if ($resql) { print '

'; - print ''; + print '
'; print "
\n"; print '
'; - print ''; + print '
'; print ''; print ''; print ''; diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index f4b5fc71616..8fdaea0cbe7 100755 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -207,7 +207,7 @@ class ContactTest extends PHPUnit\Framework\TestCase $localobject->phone_mobile='New tel mobile'; $localobject->fax='New fax'; $localobject->email='newemail@newemail.com'; - $localobject->jabberid='New im id'; + $localobject->socialnetworks['jabber']='New im id'; $localobject->default_lang='es_ES'; $result=$localobject->update($localobject->id, $user); @@ -257,8 +257,8 @@ class ContactTest extends PHPUnit\Framework\TestCase $this->assertEquals($localobject->fax, $newobject->fax); print __METHOD__." old=".$localobject->email." new=".$newobject->email."\n"; $this->assertEquals($localobject->email, $newobject->email); - print __METHOD__." old=".$localobject->jabberid." new=".$newobject->jabberid."\n"; - $this->assertEquals($localobject->jabberid, $newobject->jabberid); + print __METHOD__." old=".$localobject->socialnetworks['jabber']." new=".$newobject->socialnetworks['jabber']."\n"; + $this->assertEquals($localobject->socialnetworks['jabber'], $newobject->socialnetworks['jabber']); print __METHOD__." old=".$localobject->default_lang." new=".$newobject->default_lang."\n"; $this->assertEquals($localobject->default_lang, $newobject->default_lang); diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index e46d1ac084a..3c89bd52d06 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -192,7 +192,7 @@ class UserTest extends PHPUnit\Framework\TestCase $newlocalobject=new User($this->savdb); $newlocalobject->initAsSpecimen(); $this->changeProperties($newlocalobject); - $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','socid','societe_id','ref','pass','pass_indatabase','pass_indatabase_crypted','datec','datem','datelastlogin','datepreviouslogin')), array()); // Actual, Expected + $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','socid','societe_id','note','ref','pass','pass_indatabase','pass_indatabase_crypted','datec','datem','datelastlogin','datepreviouslogin')), array()); // Actual, Expected return $localobject; } @@ -304,12 +304,12 @@ class UserTest extends PHPUnit\Framework\TestCase /** * Edit an object to test updates * - * @param mixed $localobject Object Facture + * @param mixed $localobject Object User * @return void */ public function changeProperties(&$localobject) { - $localobject->note='New note after update'; + $localobject->note_private='New note after update'; } /**
' . $langs->trans("ThirdParties") . '' . $langs->trans("AccountNumber") . '' . $langs->trans("RaisonSociale") . '