From b3ecff2a83a94237570f645863eee128aadd6804 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 18:12:48 +0100 Subject: [PATCH 01/26] update with html5 compliant code --- htdocs/accountancy/admin/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 45ecb5cd6e6..067ba21af70 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -298,7 +298,7 @@ if ($resql) if (! empty($arrayfields['aa.pcg_type']['checked'])) print ''; if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print ''; if (! empty($arrayfields['aa.active']['checked'])) print ' '; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); print $searchpicto; print ''; From 19cfb563cff0eefc36f6ca192f373facc5d99c93 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 18:19:29 +0100 Subject: [PATCH 02/26] update with html5 compliant code --- htdocs/accountancy/admin/accountmodel.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 0d1d5625958..822c7ea789b 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -517,7 +517,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { @@ -573,7 +573,7 @@ if ($id) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add'); } - print ''; + print ''; print ''; print ''; print ""; @@ -606,7 +606,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; + print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print ''; } @@ -634,7 +634,7 @@ if ($id) } } print ''; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -647,7 +647,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; /* @@ -702,7 +702,7 @@ if ($id) if (empty($reshook)) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'edit'); - print ' '; + print ' '; print ' '; } else @@ -719,7 +719,7 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($value == 'type_template') { From f0067be9ee29a39d800864db6b66c8afb8153cc5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 18:21:20 +0100 Subject: [PATCH 03/26] update with html5 compliant code --- htdocs/accountancy/admin/categories_list.php | 10 +++++----- htdocs/accountancy/admin/journals_list.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index ebd8011469e..b268f83381e 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -467,7 +467,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='type') { if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); else $valuetoshow=$langs->trans("Type"); @@ -531,7 +531,7 @@ if ($id) fieldListAccountingCategories($fieldlist,$obj,$tabname[$id],'add'); } - print ''; + print ''; print ''; print ''; print ""; @@ -559,7 +559,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; + print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print ''; } @@ -607,7 +607,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; @@ -693,7 +693,7 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($value == 'category_type') { diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index f26aba437e5..706d7bfddd2 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -429,7 +429,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { @@ -480,7 +480,7 @@ if ($id) fieldListJournal($fieldlist,$obj,$tabname[$id],'add'); } - print ''; + print ''; print ''; print ''; print ""; @@ -508,7 +508,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; + print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print ''; } @@ -537,7 +537,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; /* @@ -606,7 +606,7 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); From 8d4005047bdd7375f2eaccdfc5aa64f215ac5249 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 18:25:46 +0100 Subject: [PATCH 04/26] update with html5 compliant code --- htdocs/accountancy/bookkeeping/balance.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 6a323121a6e..df593d3e274 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -235,7 +235,7 @@ if ($action != 'export_csv') print $langs->trans('to'); print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, ''); print ''; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -245,9 +245,9 @@ if ($action != 'export_csv') print ''; print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; @@ -274,7 +274,7 @@ if ($action != 'export_csv') { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; + print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; print " \n"; print ''; } @@ -305,11 +305,11 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; + print '' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ''; print " \n"; print ''; - print '' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_credit - $total_debit)) . ''; + print '' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_credit - $total_debit)) . ''; print " \n"; print ''; From 9fe41041e6edd0c43c797d5fa5ce81a96e5c6f88 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 18:39:53 +0100 Subject: [PATCH 05/26] update with html5 compliant code --- .../bookkeeping/balancebymonth.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index a01c42b285a..05b7b2bb9f9 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -117,19 +117,19 @@ if ($resql) { $row = $db->fetch_row($resql); print '' . length_accountg($row[0]) . ''; - print '' . price($row[1]) . ''; - print '' . price($row[2]) . ''; - print '' . price($row[3]) . ''; - print '' . price($row[4]) . ''; - print '' . price($row[5]) . ''; - print '' . price($row[6]) . ''; - print '' . price($row[7]) . ''; - print '' . price($row[8]) . ''; - print '' . price($row[9]) . ''; - print '' . price($row[10]) . ''; - print '' . price($row[11]) . ''; - print '' . price($row[12]) . ''; - print '' . price($row[13]) . ''; + print '' . price($row[1]) . ''; + print '' . price($row[2]) . ''; + print '' . price($row[3]) . ''; + print '' . price($row[4]) . ''; + print '' . price($row[5]) . ''; + print '' . price($row[6]) . ''; + print '' . price($row[7]) . ''; + print '' . price($row[8]) . ''; + print '' . price($row[9]) . ''; + print '' . price($row[10]) . ''; + print '' . price($row[11]) . ''; + print '' . price($row[12]) . ''; + print '' . price($row[13]) . ''; print ''; $i ++; From 71ce7ecc9990077d0007de82bae5be0b7cb0b81a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 19:02:35 +0100 Subject: [PATCH 06/26] update with html5 compliant code --- htdocs/accountancy/bookkeeping/list.php | 8 +++---- .../accountancy/bookkeeping/listbyaccount.php | 22 +++++++++---------- .../thirdparty_lettering_customer.php | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 509dcd88abe..c39c725deb7 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -546,14 +546,14 @@ if (! empty($arrayfields['t.label_operation']['checked'])) // Debit if (! empty($arrayfields['t.debit']['checked'])) { - print ''; + print ''; print ''; print ''; } // Credit if (! empty($arrayfields['t.credit']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -611,8 +611,8 @@ if (! empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($a if (! empty($arrayfields['t.numero_compte']['checked'])) print_liste_field_titre($arrayfields['t.numero_compte']['label'], $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_titre($arrayfields['t.subledger_account']['label'], $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); -if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index c2991ce2598..7f1ae7496c0 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -295,22 +295,22 @@ print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1); print ''; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; -print ''; +print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; print ''; print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label"); -print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); -print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); +print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; @@ -340,7 +340,7 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total par compte comptable if (isset($displayed_account_number)) { - print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; + print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print " \n"; print " \n"; print ''; @@ -401,7 +401,7 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total du dernier compte comptable affiché print ''; -print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; +print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print " \n"; print " \n"; print ''; @@ -409,11 +409,11 @@ print ''; // Affiche le Total print ''; -print ''.$langs->trans("Total").':'; -print ''; +print ''.$langs->trans("Total").':'; +print ''; print price($total_debit); print ''; -print ''; +print ''; print price($total_credit); print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 19e0dcbaaac..3b1c67378aa 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -249,7 +249,7 @@ if ($resql) { } print ''; - print ''.$langs->trans("Total").':' . "\n"; + print ''.$langs->trans("Total").':' . "\n"; print '' . price($debit) . ''; print '' . price($credit) . ''; print ''; From fe8dee4899fd146b42c48aed4a8ea14f4a54c426 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 19:05:07 +0100 Subject: [PATCH 07/26] update with html5 compliant code --- htdocs/accountancy/customer/lines.php | 8 ++++---- htdocs/accountancy/customer/list.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 4a4cfa928ac..28ad57b266c 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -316,8 +316,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -336,8 +336,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index a6818ecdfd1..6768e94ce02 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -383,8 +383,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -405,8 +405,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); @@ -504,7 +504,7 @@ if ($result) { // Vat rate if ($objp->vat_tx_l != $objp->vat_tx_p) $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; - print ''; + print ''; print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')); print ''; From d7fe291422003afcd836a0357c93e41e2d84113d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 19:07:10 +0100 Subject: [PATCH 08/26] update with html5 compliant code --- htdocs/accountancy/expensereport/lines.php | 8 ++++---- htdocs/accountancy/expensereport/list.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index c6fa1202171..096dc6464aa 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -269,11 +269,11 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -285,7 +285,7 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); print_liste_field_titre(''); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 078a91bc96e..30ac32bb45b 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -315,8 +315,8 @@ if ($result) { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -331,8 +331,8 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"', $sortfield, $sortorder); print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"', $sortfield, $sortorder); $checkpicto=''; From dfd188a863cfe7dcb3740fb6079036b238e685cc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 27 Jan 2019 19:08:43 +0100 Subject: [PATCH 09/26] update with html5 compliant code --- htdocs/accountancy/supplier/lines.php | 8 ++++---- htdocs/accountancy/supplier/list.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 585c8400680..10d66236664 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -321,8 +321,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); // print ''; @@ -343,8 +343,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 1a315897f02..1c5ecc520bf 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -383,8 +383,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -406,8 +406,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); From e0af2a35971cde42d25cd4d451fc654997a6d65a Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 27 Jan 2019 21:49:48 +0100 Subject: [PATCH 10/26] Subcategories --- htdocs/takepos/takepos.php | 56 ++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index c8d9b3f07bc..9366d2c7ab3 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -63,8 +63,23 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); get_full_arbo('product'); + +$maincategories = array_filter($categories, function ($item) { + if (($item['level']==1) !== false) { + return true; + } + return false; +}); + +$subcategories = array_filter($categories, function ($item) { + if (($item['level']!=1) !== false) { + return true; + } + return false; +}); ?> -var categories = JSON.parse( '' ); +var categories = JSON.parse( '' ); +var subcategories = JSON.parse( '' ); var currentcat; var pageproducts=0; var pagecategories=0; @@ -109,15 +124,27 @@ function MoreCategories(moreorless){ } } -function LoadProducts(position){ +function LoadProducts(position, issubcat=false){ $('#catimg'+position).animate({opacity: '0.5'}, 1); $('#catimg'+position).animate({opacity: '1'}, 100); - currentcat=$('#catdiv'+position).data('rowid'); + if (issubcat==true) currentcat=$('#prodiv'+position).data('rowid'); + else currentcat=$('#catdiv'+position).data('rowid'); if (currentcat=="") return; pageproducts=0; + ishow=0; //product to show counter + + jQuery.each(subcategories, function(i, val) { + if (currentcat==val.fk_parent){ + $("#prodesc"+ishow).text(val.label); + $("#proimg"+ishow).attr("src","genimg/?query=cat&w=55&h=50&id="+val.rowid); + $("#prodiv"+ishow).data("rowid",val.rowid); + $("#prodiv"+ishow).data("iscat",1); + ishow++; + } + }); + + idata=0; //product data counter $.getJSON('./ajax.php?action=getProducts&category='+currentcat, function(data) { - idata=0; //product data counter - ishow=0; //product to show counter while (idata < 30) { if (typeof (data[idata]) == "undefined") { $("#prodesc"+ishow).text(""); @@ -130,6 +157,7 @@ function LoadProducts(position){ $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); + $("#prodiv"+ishow).data("iscat",0); ishow++; //Next product to show after print data product } idata++; //Next data everytime @@ -168,6 +196,7 @@ function MoreProducts(moreorless){ $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); + $("#prodiv"+ishow).data("iscat",0); ishow++; //Next product to show after print data product } idata++; //Next data everytime @@ -178,12 +207,16 @@ function MoreProducts(moreorless){ function ClickProduct(position){ $('#proimg'+position).animate({opacity: '0.5'}, 1); $('#proimg'+position).animate({opacity: '1'}, 100); - idproduct=$('#prodiv'+position).data('rowid'); - if (idproduct=="") return; - $("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct, function() { - $('#poslines').scrollTop($('#poslines')[0].scrollHeight); - }); - + if ($('#prodiv'+position).data('iscat')==1){ + LoadProducts(position, true); + } + else{ + idproduct=$('#prodiv'+position).data('rowid'); + if (idproduct=="") return; + $("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct, function() { + $('#poslines').scrollTop($('#poslines')[0].scrollHeight); + }); + } } function deleteline(){ @@ -233,6 +266,7 @@ function Search2(){ $("#prodesc"+i).text(data[parseInt(i)]['label']); $("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i]['rowid']); $("#prodiv"+i).data("rowid",data[i]['rowid']); + $("#prodiv"+ishow).data("iscat",0); } }); } From 06055ed586cd8f31dab6564e008a1de4b4c805c2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Jan 2019 19:32:08 +0100 Subject: [PATCH 11/26] update with html5 compliant code --- htdocs/accountancy/bookkeeping/list.php | 10 ++++----- .../accountancy/bookkeeping/listbyaccount.php | 22 +++++++++---------- .../thirdparty_lettering_customer.php | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 41939ffd0ce..d61b3c991e4 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -546,14 +546,14 @@ if (! empty($arrayfields['t.label_operation']['checked'])) // Debit if (! empty($arrayfields['t.debit']['checked'])) { - print ''; + print ''; print ''; print ''; } // Credit if (! empty($arrayfields['t.credit']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -611,9 +611,9 @@ if (! empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($a if (! empty($arrayfields['t.numero_compte']['checked'])) print_liste_field_titre($arrayfields['t.numero_compte']['label'], $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_titre($arrayfields['t.subledger_account']['label'], $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); -if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'align="center"', $sortfield, $sortorder); +if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'class="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 34481d7680d..30019885281 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -295,22 +295,22 @@ print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1); print ''; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; -print ''; +print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; print ''; print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label"); -print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); -print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); +print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; @@ -340,7 +340,7 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total par compte comptable if (isset($displayed_account_number)) { - print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; + print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print " \n"; print " \n"; print ''; @@ -401,7 +401,7 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total du dernier compte comptable affiché print ''; -print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; +print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print " \n"; print " \n"; print ''; @@ -409,11 +409,11 @@ print ''; // Affiche le Total print ''; -print ''.$langs->trans("Total").':'; -print ''; +print ''.$langs->trans("Total").':'; +print ''; print price($total_debit); print ''; -print ''; +print ''; print price($total_credit); print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 7ca432bbbc1..843ab21e901 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -249,7 +249,7 @@ if ($resql) { } print ''; - print ''.$langs->trans("Total").':' . "\n"; + print ''.$langs->trans("Total").':' . "\n"; print '' . price($debit) . ''; print '' . price($credit) . ''; print ''; From e12f66e3d9259f6bf9ffd1a9af9a19ed26e46786 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Jan 2019 19:34:33 +0100 Subject: [PATCH 12/26] update with html5 compliant code --- htdocs/accountancy/customer/lines.php | 8 ++++---- htdocs/accountancy/customer/list.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 0a4065762aa..076c1d7b3c8 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -316,8 +316,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -336,8 +336,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index a6818ecdfd1..6768e94ce02 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -383,8 +383,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -405,8 +405,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); @@ -504,7 +504,7 @@ if ($result) { // Vat rate if ($objp->vat_tx_l != $objp->vat_tx_p) $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; - print ''; + print ''; print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')); print ''; From a0e87fbfd2b4040def37889faf4f286601efc059 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Jan 2019 19:38:04 +0100 Subject: [PATCH 13/26] update with html5 compliant code --- htdocs/accountancy/expensereport/lines.php | 8 ++++---- htdocs/accountancy/expensereport/list.php | 8 ++++---- htdocs/accountancy/supplier/lines.php | 8 ++++---- htdocs/accountancy/supplier/list.php | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 12182bdaa43..5d1c4ba7fc3 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -269,11 +269,11 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -285,7 +285,7 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); print_liste_field_titre(''); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index c0d77fc753a..bf6f597924d 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -315,8 +315,8 @@ if ($result) { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -331,8 +331,8 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"', $sortfield, $sortorder); print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"', $sortfield, $sortorder); $checkpicto=''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index cf5d36d6e80..247c2db93cd 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -321,8 +321,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); // print ''; @@ -343,8 +343,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index e04be12df3b..99f0fb30ae5 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -383,8 +383,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -406,8 +406,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); @@ -498,7 +498,7 @@ if ($result) { // Vat rate if ($objp->vat_tx_l != $objp->vat_tx_p) $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; - print ''; + print ''; print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')); print ''; From d9ce99a314ff47ecb019109bbaf3edc8dda983cb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Jan 2019 19:41:56 +0100 Subject: [PATCH 14/26] update with html5 compliant code --- htdocs/adherents/list.php | 6 +++--- htdocs/adherents/subscription.php | 2 +- htdocs/adherents/subscription/list.php | 6 +++--- htdocs/adherents/type.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d27c2365f47..79841823d08 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -566,7 +566,7 @@ if (! empty($arrayfields['d.tms']['checked'])) // Status if (! empty($arrayfields['d.statut']['checked'])) { - print ''; + print ''; $liststatus=array( '-1'=>$langs->trans("Draft"), '1'=>$langs->trans("Validated"), @@ -613,7 +613,7 @@ $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // No print $hookmanager->resPrint; if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'],$_SERVER["PHP_SELF"],"d.statut","",$param,'align="right"',$sortfield,$sortorder); +if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'],$_SERVER["PHP_SELF"],"d.statut","",$param,'class="right"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -842,7 +842,7 @@ while ($i < min($num, $limit)) // Status if (! empty($arrayfields['d.statut']['checked'])) { - print ''; + print ''; print $memberstatic->LibStatut($obj->statut,$obj->subscription,$datefin,5); print ''; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 0c5618ca1d9..da35a182f24 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -570,7 +570,7 @@ if ($rowid > 0) print ''; - if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; + if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; print '
'; print $langs->trans("LinkedToDolibarrThirdParty"); print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'
'; print ''; if ($action == 'editthirdparty') diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index b6e3afc8a19..7e97752af5d 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -355,7 +355,7 @@ if (! empty($arrayfields['d.date_fin']['checked'])) if (! empty($arrayfields['d.amount']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -380,7 +380,7 @@ if (! empty($arrayfields['d.tms']['checked'])) } // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -427,7 +427,7 @@ if (! empty($arrayfields['d.date_fin']['checked'])) } if (! empty($arrayfields['d.amount']['checked'])) { - print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"c.subscription",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"c.subscription",$param,"",'class="right"',$sortfield,$sortorder); } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 499f41dce3e..e7c71d06e40 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -602,7 +602,7 @@ if ($rowid > 0) print ' '; - print ''; + print ''; print ''; print '  '; print ''; From ff46a0ee3079ae811f6b1d10db3b953ec733b17d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 31 Jan 2019 12:33:01 +0100 Subject: [PATCH 15/26] update with html5 compliant code --- htdocs/admin/agenda_extsites.php | 2 +- htdocs/admin/tools/listevents.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 66f18308931..3fe540a2baf 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -220,7 +220,7 @@ while ($i <= $MAXAGENDA) // Offset TZ print ''; // Color (Possible colors are limited by Google) - print ''; + print ''; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key)?GETPOST("AGENDA_EXT_COLOR".$key):$conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print ''; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 4558af0baae..e00e2c6a98e 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -255,7 +255,7 @@ if ($result) //print ''; print ''; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; From 2a9c378c1fecc2232b6194496b39097346d42ede Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 31 Jan 2019 12:35:49 +0100 Subject: [PATCH 16/26] update with html5 compliant code --- htdocs/admin/agenda.php | 4 ++-- htdocs/admin/barcode.php | 4 ++-- htdocs/admin/company.php | 2 +- htdocs/admin/const.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 1c6e5c16fcf..27dad04dc32 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -144,7 +144,7 @@ print ''; print ''; print ''; // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -179,7 +179,7 @@ if (! empty($triggers)) print ''; print ''.$trigger['code'].''; print ''.$trigger['label'].''; - print ''; + print ''; $key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; $value=$conf->global->$key; print ''; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 6cf9c84d265..45b908487a3 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -333,7 +333,7 @@ if (! empty($conf->product->enabled)) print ''; print ''.$langs->trans("SetDefaultBarcodeTypeProducts").''; - print ''; + print ''; print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1); print ''; } @@ -344,7 +344,7 @@ if (! empty($conf->societe->enabled)) print ''; print ''.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; - print ''; + print ''; print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); print ''; } diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index c0599a666dc..16b57ab1e74 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -417,7 +417,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ''; print ''; - print ''; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 12703d5d38a..a5cb2d8b396 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -356,7 +356,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index ab79bfec0fa..844fe093315 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -621,7 +621,7 @@ if ($resql) // There is several pages if ($num > $listlimit) { - print ''; } @@ -657,7 +657,7 @@ if ($resql) } if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print ''; // Action column - print ''; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index c70d8c08a91..acb4ab2166e 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -79,7 +79,7 @@ print ''; print '
'; print ''; - print ''; + print ''; if (! empty($mysoc->logo_mini)) { print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index fedccb49642..bc48425017b 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -304,10 +304,10 @@ print ''; if ($conf->use_javascript_ajax) { print '
'; - print '
'; + print '
'; print ''; print '
'; - print '
'; + print '
'; print ''; print '
'; } From 1cda3106b230d8e1a18155ba8e2fcaa591d98a55 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 31 Jan 2019 12:40:50 +0100 Subject: [PATCH 17/26] update with html5 compliant code --- htdocs/admin/dict.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/mails_templates.php | 4 ++-- htdocs/admin/resource.php | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 8a52a4346f8..ee3083410dd 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1246,7 +1246,7 @@ if ($id) } if ($id == 4) print '
'; + print ''; if ($filterfound) { $searchpicto=$form->showFilterAndCheckAddButtons(0); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index f388cea8b55..bb6fa4bdd87 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -385,7 +385,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'; + print '
'; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print '
'; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; @@ -88,13 +88,13 @@ print ''; print ''; if (empty($conf->use_javascript_ajax)) { - print ''; } else { - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").''.$langs->trans("Value").'
'.$langs->trans("UseSearchToSelectResource").''; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print ''; + print ''; $arrval=array( '0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",1).')', From 0cc805370808d5821ea2d6cc09e2c9a9467cbcc5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 31 Jan 2019 12:42:38 +0100 Subject: [PATCH 18/26] update with html5 compliant code --- htdocs/admin/security.php | 2 +- htdocs/admin/syslog.php | 2 +- htdocs/admin/taxes.php | 2 +- htdocs/admin/translation.php | 2 +- htdocs/admin/website.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 7a4581ac8ec..91973ea22c3 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -330,7 +330,7 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ print '
'; print '
'; - print ''; + print '
'; print ''; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 9c857964a3c..e212ee8b949 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -202,7 +202,7 @@ print ''; print '
'; print ''.$langs->trans("Save").''; print '
'; print ''; print ''; -print ''; +print ''; print "\n"; foreach ($syslogModules as $moduleName) diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index b3fd9ef4359..723cf4e33a0 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -147,7 +147,7 @@ else print ''; if (! $conf->use_javascript_ajax) { - print '"; } diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index f857ab7ed11..a791cdde4ed 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -500,7 +500,7 @@ if ($mode == 'searchkey') //} print ''; // Action column - print ''; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 3f52896b631..4abcaed9b6a 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -502,7 +502,7 @@ if ($id) fieldListWebsites($fieldlist,$obj,$tabname[$id],'add'); - print ''; } else From 6c6a8db2df33833b82a5490b74cce4291b1f5e45 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 31 Jan 2019 13:29:34 +0100 Subject: [PATCH 19/26] update with html5 compliant code --- htdocs/asset/list.php | 2 +- htdocs/blockedlog/admin/blockedlog.php | 2 +- htdocs/blockedlog/admin/blockedlog_list.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index c6710f290cc..262b203f26e 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -364,7 +364,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 8c2835d856c..36ac6615efa 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -116,7 +116,7 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) { // Example with a yes / no select print ''; print ''; - print '\n"; @@ -182,7 +182,7 @@ if ($resql) print '"; // Actions - print ''; print '
'.$langs->trans("NbOfUniqueEMails").'
'; //print ''; - print '
'.$langs->trans("Filter").'
'; + print '
'.$langs->trans("Filter").'
'; //print ''; print '
 
'; //print "\n"; @@ -363,7 +363,7 @@ if ($object->fetch($id) >= 0) } print ''; - print '
'; + print '
'; if ($allowaddtarget) { try { @@ -378,7 +378,7 @@ if ($object->fetch($id) >= 0) } print '
'; - print '
'; + print '
'; if ($allowaddtarget) { print ''; @@ -501,11 +501,11 @@ if ($object->fetch($id) >= 0) print ' '; print ''; //Statut - print '
'; // Action column - print ''; @@ -526,7 +526,7 @@ if ($object->fetch($id) >= 0) { print_liste_field_titre("DateSending",$_SERVER["PHP_SELF"],"mc.date_envoi",$param,'','align="center"',$sortfield,$sortorder); } - print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder); + print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"mc.statut",$param,'','class="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print ''; @@ -590,13 +590,13 @@ if ($object->fetch($id) >= 0) if ($obj->statut == 0) { print ''; - print ''; } else { print ''; - print ''; } From 7cf51a5e3534d9527401ea6317e4efe491d8fa0f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 31 Jan 2019 14:05:55 +0100 Subject: [PATCH 21/26] fix translation --- htdocs/adherents/class/adherent_type.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 263012df782..dd9da927c25 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -164,7 +164,7 @@ class AdherentType extends CommonObject } /** - * Met a jour en base donnees du type + * Updating the type in the database * * @param User $user Object user making change * @param int $notrigger 1=do not execute triggers, 0 otherwise @@ -234,9 +234,9 @@ class AdherentType extends CommonObject } /** - * Fonction qui permet de supprimer le status de l'adherent + * Function to delete the member's status * - * @return int >0 if OK, 0 if not found, < 0 if KO + * @return int > 0 if OK, 0 if not found, < 0 if KO */ function delete() { @@ -267,7 +267,7 @@ class AdherentType extends CommonObject } /** - * Fonction qui permet de recuperer le status de l'adherent + * Function that retrieves the status of the member * * @param int $rowid Id of member type to load * @return int <0 if KO, >0 if OK From c5bbaa4aa3f5f5ad9b4c1b3397492ac2ba8de26b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 31 Jan 2019 15:15:18 +0100 Subject: [PATCH 22/26] fix translation --- htdocs/adherents/class/adherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 959dacba2c1..f5cb86304d5 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2520,7 +2520,7 @@ class Adherent extends CommonObject /** - * Charge les informations d'ordre info dans l'objet adherent + * Load type info information in the member object * * @param int $id Id of member to load * @return void From b89b0e683a6eccc565097f217e941e283a14fa87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 31 Jan 2019 18:32:39 +0100 Subject: [PATCH 23/26] remove psr2 else if warning --- htdocs/takepos/takepos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index b7d4cb8f32f..abed261e1ed 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -446,7 +446,7 @@ foreach($menus as $menu) { while ($count<16) { ?> -
id='catdiv'> +
id='catdiv'> width="98%" id='catimg'/>
From f432a874e606a79bf14f0ae9236315a5dcc366f9 Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Fri, 1 Feb 2019 10:44:13 +0100 Subject: [PATCH 24/26] NEW : Contact related items tab --- htdocs/contact/consumption.php | 657 ++++++++++++++++++++++++++++++++ htdocs/core/lib/contact.lib.php | 9 + 2 files changed, 666 insertions(+) create mode 100644 htdocs/contact/consumption.php diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php new file mode 100644 index 00000000000..5c8dd23a332 --- /dev/null +++ b/htdocs/contact/consumption.php @@ -0,0 +1,657 @@ + + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2013-2015 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015-2017 Ferran Marcet + * + * 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/societe/consumption.php + * \ingroup societe + * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty + */ + +require "../main.inc.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + +// Security check +$id = GETPOST('id', 'int'); + +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); +$object = new Contact($db); +if ($id > 0) $object->fetch($id); +if(empty($object->thirdparty)) $object->fetch_thirdparty(); +$socid = $object->thirdparty->id; + +// Sort & Order fields +$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 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder='DESC'; +if (! $sortfield) $sortfield='dateprint'; + +// Search fields +$sref=GETPOST("sref"); +$sprod_fulldescr=GETPOST("sprod_fulldescr"); +$month = GETPOST('month','int'); +$year = GETPOST('year','int'); + +// Clean up on purge search criteria ? +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers +{ + $sref=''; + $sprod_fulldescr=''; + $year=''; + $month=''; +} +// Customer or supplier selected in drop box +$thirdTypeSelect = GETPOST("third_select_id"); +$type_element = GETPOST('type_element')?GETPOST('type_element'):''; + +// Load translation files required by the page +$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('consumptioncontact')); + + +/* + * Actions + */ + +$parameters=array('id'=>$id); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + +/* + * View + */ +$form = new Form($db); +$formother = new FormOther($db); +$productstatic=new Product($db); +$objsoc = new Societe($db); + +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$title,$help_url); + +if (empty($id)) +{ + dol_print_error($db); + exit; +} + +$head = contact_prepare_head($object); +dol_fiche_head($head, 'consumption', $langs->trans("ContactsAddresses"), -1, 'contact'); + +$linkback = ''.$langs->trans("BackToList").''; + +$morehtmlref='
'; +if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) +{ + $objsoc->fetch($socid); + // Thirdparty + $morehtmlref.=$langs->trans('ThirdParty') . ' : '; + if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1, 'contact'); + else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany"); +} +$morehtmlref.='
'; + +dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', $morehtmlref); + +print '
'; + +print '
'; +print '
'.$langs->trans("Type").''.$langs->trans("Value").'
'; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "'; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); print $searchpicto; print ''; + print ''; if ($action != 'edit') { print ''; @@ -585,7 +585,7 @@ if ($id) if (empty($reshook)) fieldListWebsites($fieldlist,$obj,$tabname[$id],'edit'); - print ' '; + print ' '; print ' '; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'.$langs->trans("BlockedLogAuthorityUrl").img_info($langs->trans('BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote')).''; + print ''; print '
'; print ''; print ''; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index c899e9d78c2..e100371e965 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -327,7 +327,7 @@ if (GETPOST('withtab','alpha')) $param.='&withtab='.urlencode(GETPOST('withtab', print ''; -print '
'; +print '
'; print $langs->trans("RestrictYearToExport").': '; $smonth=GETPOST('monthtoexport','int'); // Month @@ -430,7 +430,7 @@ print getTitleFieldOfList($langs->trans('Author'), 0, $_SERVER["PHP_SELF"],'user print getTitleFieldOfList($langs->trans('Action'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('Ref'), 0, $_SERVER["PHP_SELF"],'ref_object','',$param,'',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n"; -print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder,'')."\n"; +print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"],'','',$param,'class="right"',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('Status'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n"; From 1501ce2c9f06f389ad7d47af6789e3894b164a33 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 31 Jan 2019 13:34:32 +0100 Subject: [PATCH 20/26] update with html5 compliant code --- htdocs/bookmarks/list.php | 4 ++-- htdocs/categories/index.php | 2 +- htdocs/comm/mailing/cibles.php | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 5cbd07393e3..a721170f628 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -121,7 +121,7 @@ if ($resql) 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,'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Position",$_SERVER["PHP_SELF"],"b.position","", $param,'class="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "
'.$obj->position."'; + print ''; if ($user->rights->bookmark->creer) { print "rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()." "; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 273a23f5b1e..42f136d0aa3 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -169,7 +169,7 @@ foreach($fulltree as $key => $val) 'fk_menu'=>$val['fk_parent'], 'entry'=>''. //''. - ''. + ''. '
color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>'.$li.''.dolGetFirstLineOfText($desc).''.img_view().''.img_view().'
' ); } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 0cb414be421..e755bbcf2b6 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -263,7 +263,7 @@ if ($object->fetch($id) >= 0) //print '
'.$langs->trans("NbOfUniqueEMails").''.$langs->trans("Filter").' 
'; + print ''; print $formmailing->selectDestinariesStatus($search_dest_status,'search_dest_status',1); print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); print $searchpicto; print '
 '.$langs->trans("MailingStatusNotSent"); + print ''.$langs->trans("MailingStatusNotSent"); print ''.$obj->date_envoi.''; + print ''; print $object::libStatutDest($obj->statut, 2, $obj->error_text); print '
'; + +// Civility +print ''; + +if ($object->thirdparty->client) +{ + $thirdTypeArray['customer']=$langs->trans("customer"); + if ($conf->propal->enabled && $user->rights->propal->lire) $elementTypeArray['propal']=$langs->transnoentitiesnoconv('Proposals'); + if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->transnoentitiesnoconv('Orders'); + if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices'); + if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray['contract']=$langs->transnoentitiesnoconv('Contracts'); +} + +if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeArray['fichinter']=$langs->transnoentitiesnoconv('Interventions'); + +if ($object->thirdparty->fournisseur) +{ + $thirdTypeArray['supplier']=$langs->trans("supplier"); + if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $elementTypeArray['supplier_invoice']=$langs->transnoentitiesnoconv('SuppliersInvoices'); + if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->transnoentitiesnoconv('SuppliersOrders'); + + // There no contact type for supplier proposals +// if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals'); +} + +print '
'.$langs->trans("UserTitle").''; +print $object->getCivilityLabel(); +print '
'; + +print ''; + +dol_fiche_end(); +print '
'; + + +print ''; +print ''; + +$sql_select=''; +if ($type_element == 'fichinter') +{ // Customer : show products from invoices + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + $documentstatic=new Fichinter($db); + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'fichinterdet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'fichinter as f ON d.fk_fichinter=f.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='fichinter' and tc.source='external' and tc.active=1)"; + $where = ' WHERE f.entity IN ('.getEntity('ficheinter').')'; + $dateprint = 'f.datec'; + $doc_number='f.ref'; +} +if ($type_element == 'invoice') +{ // Customer : show products from invoices + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $documentstatic=new Facture($db); + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'facturedet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture as f ON d.fk_facture=f.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='facture' and tc.source='external' and tc.active=1)"; + $where = " WHERE f.entity IN (".getEntity('invoice').")"; + $dateprint = 'f.datef'; + $doc_number='f.ref'; + $thirdTypeSelect='customer'; +} +if ($type_element == 'propal') +{ + require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; + $documentstatic=new Propal($db); + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'propaldet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propal as c ON d.fk_propal=c.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='propal' and tc.source='external' and tc.active=1)"; + $where = ' WHERE c.entity IN ('.getEntity('propal').')'; + $datePrint = 'c.datep'; + $doc_number='c.ref'; + $thirdTypeSelect='customer'; +} +if ($type_element == 'order') +{ + require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $documentstatic=new Commande($db); + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'commandedet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande as c ON d.fk_commande=c.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='commande' and tc.source='external' and tc.active=1)"; + $where = ' WHERE c.entity IN ('.getEntity('order').')'; + $dateprint = 'c.date_commande'; + $doc_number='c.ref'; + $thirdTypeSelect='customer'; +} +if ($type_element == 'supplier_invoice') +{ // Supplier : Show products from invoices. + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $documentstatic=new FactureFournisseur($db); + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'facture_fourn_det d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn as f ON d.fk_facture_fourn=f.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='invoice_supplier' and tc.source='external' and tc.active=1)"; + $where = ' WHERE f.entity IN ('.getEntity($documentstatic->element).')'; + $dateprint = 'f.datef'; + $doc_number='f.ref'; + $thirdTypeSelect='supplier'; +} +//if ($type_element == 'supplier_proposal') +//{ +// require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; +// $documentstatic=new SupplierProposal($db); +// $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, '; +// $tables_from = MAIN_DB_PREFIX."supplier_proposal as c,".MAIN_DB_PREFIX."supplier_proposaldet as d"; +// $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; +// $where.= " AND d.fk_supplier_proposal = c.rowid"; +// $where.= " AND c.entity = ".$conf->entity; +// $dateprint = 'c.date_valid'; +// $doc_number='c.ref'; +// $thirdTypeSelect='supplier'; +//} +if ($type_element == 'supplier_order') +{ // Supplier : Show products from orders. + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + $documentstatic=new CommandeFournisseur($db); + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'commande_fournisseurdet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur as c ON d.fk_commande=c.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='order_supplier' and tc.source='external' and tc.active=1)"; + $where = ' WHERE c.entity IN ('.getEntity($documentstatic->element).')'; + $dateprint = 'c.date_valid'; + $doc_number='c.ref'; + $thirdTypeSelect='supplier'; +} +if ($type_element == 'contract') +{ // Order + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; + $documentstatic=new Contrat($db); + $documentstaticline=new ContratLigne($db); + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'contratdet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'contrat as c ON d.fk_contrat=c.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='contrat' and tc.source='external' and tc.active=1)"; + $where = ' WHERE c.entity IN ('.getEntity('contrat').')'; + $dateprint = 'c.date_valid'; + $doc_number='c.ref'; + $thirdTypeSelect='customer'; +} + +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook + +if (!empty($sql_select)) +{ + $sql = $sql_select; + $sql.= ' d.description as description'; + if ($type_element != 'fichinter' && $type_element != 'contract' && $type_element != 'supplier_proposal') $sql.= ', d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_start, d.date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, '; + if ($type_element == 'supplier_proposal') $sql.= ', d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.qty, d.qty as prod_qty, d.total_ht as total_ht, '; + if ($type_element == 'contract') $sql.= ', d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_ouverture as date_start, d.date_cloture as date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, '; + if ($type_element != 'fichinter') $sql.= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity'; + $sql.= " "; + if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label"; + $sql.= " FROM "/*.MAIN_DB_PREFIX."societe as s, "*/.$tables_from; +// if ($type_element != 'fichinter') $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid '; + $sql.= $where; + if ($month > 0) { + if ($year > 0) { + $start = dol_mktime(0, 0, 0, $month, 1, $year); + $end = dol_time_plus_duree($start,1,'m') - 1; + $sql.= " AND ".$dateprint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; + } else { + $sql.= " AND date_format(".$dateprint.", '%m') = '".sprintf('%02d',$month)."'"; + } + } elseif ($year > 0) { + $start = dol_mktime(0, 0, 0, 1, 1, $year); + $end = dol_time_plus_duree($start,1,'y') - 1; + $sql.= " AND ".$dateprint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; + } + if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'"; + if ($sprod_fulldescr) + { + $sql.= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%'"; + if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'"; + if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.label LIKE '%".$db->escape($sprod_fulldescr)."%'"; + $sql.=")"; + } + $sql.= $db->order($sortfield,$sortorder); +//print ($sql);exit; + $resql=$db->query($sql); + $totalnboflines = $db->num_rows($resql); + + $sql.= $db->plimit($limit + 1, $offset); + //print $sql; +} + +$disabled=0; +$showempty=2; +if (empty($elementTypeArray) && ! $object->client && ! $object->fournisseur) +{ + $showempty=$langs->trans("ThirdpartyNotCustomerNotSupplierSoNoRef"); + $disabled=1; +} + +// Define type of elements +$typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPOST('type_element'), $showempty, 0, 0, '', 0, 0, $disabled, '', 'maxwidth150onsmartphone'); +$button = ''; + +$param=''; +$param.="&sref=".urlencode($sref); +$param.="&month=".urlencode($month); +$param.="&year=".urlencode($year); +$param.="&sprod_fulldescr=".urlencode($sprod_fulldescr); +$param.="&socid=".urlencode($socid); +$param.="&type_element=".urlencode($type_element); + +$total_qty=0; + +if ($sql_select) +{ + $resql=$db->query($sql); + if (!$resql) dol_print_error($db); + + $num = $db->num_rows($resql); + + $param="&socid=".$socid."&type_element=".$type_element; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($sprod_fulldescr) $param.= "&sprod_fulldescr=".urlencode($sprod_fulldescr); + if ($sref) $param.= "&sref=".urlencode($sref); + if ($month) $param.= "&month=".$month; + if ($year) $param.= "&year=".$year; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + + print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $totalnboflines, '', 0, '', '', $limit); + + print '
'; + print ''."\n"; + + // Filters + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + // Titles with sort buttons + print ''; + print_liste_field_titre('Ref',$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('Date',$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder); + print_liste_field_titre('Status',$_SERVER['PHP_SELF'],'fk_statut','',$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre('Product',$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('ContactType',$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('Quantity',$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre('TotalHT',$_SERVER['PHP_SELF'],'total_ht','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre('UnitPrice',$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); + print "\n"; + + + $i = 0; + while (($objp = $db->fetch_object($resql)) && $i < min($num, $limit)) + { + $documentstatic->id=$objp->doc_id; + $documentstatic->ref=$objp->doc_number; + $documentstatic->type=$objp->doc_type; + $documentstatic->fk_statut=$objp->status; + $documentstatic->fk_status=$objp->status; + $documentstatic->statut=$objp->status; + $documentstatic->status=$objp->status; + $documentstatic->paye=$objp->paid; + + if (is_object($documentstaticline)) $documentstaticline->statut=$objp->status; + + print ''; + print ''; + print ''; + + // Status + print ''; + + print ''; + + //print ''; + print ''; + + print ''; + $total_qty+=$objp->prod_qty; + + print ''; + $total_ht+=$objp->total_ht; + + print ''; + + print "\n"; + $i++; + } + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "
'; + print ''; + print ''; // date + print $formother->select_month($month?$month:-1, 'month', 1, 0, 'valignmiddle'); + $formother->select_year($year?$year:-1,'year',1, 20, 1); + print ''; + print ''; + print ''; + print ''; // TODO: Add filters ! + print ''; + print ''; + print ''; + $searchpicto=$form->showFilterAndCheckAddButtons(0); + print $searchpicto; + print '
'; + print $documentstatic->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->dateprint),'day').''; + if ($type_element == 'contract') + { + print $documentstaticline->getLibStatut(2); + } + else + { + print $documentstatic->getLibStatut(2); + } + print ''; + + // Define text, description and type + $text=''; $description=''; $type=0; + + // Code to show product duplicated from commonobject->printObjectLine + if ($objp->fk_product > 0) + { + $product_static = new Product($db); + + $product_static->type=$objp->fk_product_type; + $product_static->id=$objp->fk_product; + $product_static->ref=$objp->ref; + $product_static->entity=$objp->pentity; + $text=$product_static->getNomUrl(1); + } + + // Product + if ($objp->fk_product > 0) + { + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $prod = new Product($db); + $prod->fetch($objp->fk_product); + + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); + if (empty($newlang)) $newlang=$object->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; + } + else + { + $label = $objp->product_label; + } + + $text.= ' - '.(! empty($objp->label)?$objp->label:$label); + $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description)); + } + + if (($objp->info_bits & 2) == 2) { ?> + + trans("ShowReduc"),'reduc').' '; + if ($objp->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); + elseif ($objp->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); + elseif ($objp->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); + //else $txt=$langs->trans("Discount"); + print $txt; + ?> + + description) + { + if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + if ($objp->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); + } + elseif ($objp->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); + } + elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); + // Add date of deposit + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; + } + else + { + echo ($txt?' - ':'').dol_htmlentitiesbr($objp->description); + } + } + } + else + { + if ($objp->fk_product > 0) { + + echo $form->textwithtooltip($text,$description,3,'','',$i,0,''); + + // Show range + echo get_date_range($objp->date_start, $objp->date_end); + + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + print (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + } + } else { + + if (! empty($objp->label) || ! empty($objp->description)) + { + if ($type==1) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + + if (! empty($objp->label)) { + $text.= ' '.$objp->label.''; + echo $form->textwithtooltip($text,dol_htmlentitiesbr($objp->description),3,'','',$i,0,''); + } else { + echo $text.' '.dol_htmlentitiesbr($objp->description); + } + } + + // Show range + echo get_date_range($objp->date_start,$objp->date_end); + } + } + + /* + $prodreftxt=''; + if ($objp->prod_id > 0) + { + $productstatic->id = $objp->prod_id; + $productstatic->ref = $objp->prod_ref; + $productstatic->status = $objp->prod_type; + $prodreftxt = $productstatic->getNomUrl(0); + if(!empty($objp->product_label)) $prodreftxt .= ' - '.$objp->product_label; + } + // Show range + $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + $prodreftxt .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + } + */ + print '
'.$prodreftxt.''.$objp->libelle.''.$objp->prod_qty.''.price($objp->total_ht).''.price($objp->total_ht/(empty($objp->prod_qty)?1:$objp->prod_qty)).'
' . $langs->trans('Total') . '' . $total_qty . '' . price($total_ht) . '' . price($total_ht/(empty($total_qty)?1:$total_qty)) . '
"; + print '
'; + + if ($num > $limit) { + print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); + } + $db->free($resql); +} +elseif (empty($type_element) || $type_element == -1) +{ + print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', ''); + + print ''."\n"; + // Titles with sort buttons + print ''; + print_liste_field_titre('Ref',$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('Date',$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder); + print_liste_field_titre('Status',$_SERVER['PHP_SELF'],'fk_status','',$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre('Product',$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('Quantity',$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); + print "\n"; + + print ''; + + print "
'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'
"; +} +else { + print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', ''); + + print ''."\n"; + + print ''; + + print "
'.$langs->trans("FeatureNotYetAvailable").'
"; +} + +print ""; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 3c61410230f..98a0065ae00 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -58,6 +58,15 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'perso'; $tab++; + // Related items + if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled)) + { + $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; + $head[$tab][1] = $langs->trans("Referers"); + $head[$tab][2] = 'consumption'; + $tab++; + } + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab From 2c5623c53e73a99ab8850a62541fbed25f4fce92 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 1 Feb 2019 11:37:46 +0100 Subject: [PATCH 25/26] check if price already logged, if not first log current price --- .../fourn/class/fournisseur.product.class.php | 56 +++++++++++++++---- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index d721a4a9254..2373ab18289 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -73,6 +73,11 @@ class ProductFournisseur extends Product public $fourn_remise; // discount for quantity (amount) public $product_fourn_id; // product-supplier id + /** + * @var int ID user_id - user who created/updated supplier price + */ + public $user_id; + /** * @var int ID availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) */ @@ -294,7 +299,32 @@ class ProductFournisseur extends Product if ($this->product_fourn_price_id > 0) { - $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; + // check if price already logged, if not first log current price + $logPrices = $this->listProductFournisseurPriceLog($this->product_fourn_price_id); + if (is_array($logPrices) && count($logPrices) == 0) + { + $currentPfp = new self($this->db); + $result = $currentPfp->fetch_product_fournisseur_price($this->product_fourn_price_id); + if ($result > 0 && $currentPfp->fourn_price != 0) + { + $currentPfpUser = new User($this->db); + $result = $currentPfpUser->fetch($currentPfp->user_id); + if ($result > 0) { + $currentPfp->logPrice( + $currentPfpUser, + $currentPfp->date_creation, + $currentPfp->fourn_price, + $currentPfp->fourn_qty, + $currentPfp->fourn_multicurrency_price, + $currentPfp->fourn_multicurrency_unitprice, + $currentPfp->fourn_multicurrency_tx, + $currentPfp->fourn_multicurrency_id, + $currentPfp->fourn_multicurrency_code + ); + } + } + } + $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql.= " SET fk_user = " . $user->id." ,"; $sql.= " ref_fourn = '" . $this->db->escape($ref_fourn) . "',"; $sql.= " desc_fourn = '" . $this->db->escape($desc_fourn) . "',"; @@ -332,7 +362,8 @@ class ProductFournisseur extends Product $result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_UPDATE',$user); if ($result < 0) $error++; // End call triggers - if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { + if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) + { $result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrenc, $multicurrency_code); if ($result < 0) { $error++; @@ -457,7 +488,7 @@ class ProductFournisseur extends Product $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.default_vat_code, pfp.info_bits as fourn_tva_npr, pfp.fk_availability,"; $sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product, pfp.charges, pfp.fk_supplier_price_expression, pfp.delivery_time_days,"; - $sql.= " pfp.supplier_reputation"; + $sql.= " pfp.supplier_reputation, pfp.fk_user, pfp.datec"; $sql.= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE pfp.rowid = ".$rowid; @@ -491,7 +522,8 @@ class ProductFournisseur extends Product $this->fk_supplier_price_expression = $obj->fk_supplier_price_expression; $this->supplier_reputation = $obj->supplier_reputation; $this->default_vat_code = $obj->default_vat_code; - + $this->user_id = $obj->fk_user; + $this->date_creation = $this->db->jdate($obj->datec); $this->fourn_multicurrency_price = $obj->multicurrency_price; $this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice; $this->fourn_multicurrency_tx = $obj->multicurrency_tx; @@ -881,14 +913,14 @@ class ProductFournisseur extends Product /** * List supplier prices log of a supplier price * - * @param int $fourn_id Id of supplier price - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Limit - * @param int $offset Offset - * @return array Array of Log prices + * @param int $product_fourn_price_id Id of supplier price + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit + * @param int $offset Offset + * @return array Array of Log prices */ - function listProductFournisseurPriceLog($fourn_id, $sortfield='', $sortorder='', $limit=0, $offset=0) + function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield='', $sortorder='', $limit=0, $offset=0) { global $conf; @@ -901,7 +933,7 @@ class ProductFournisseur extends Product $sql.= " WHERE pfp.entity IN (".getEntity('productprice').")"; $sql.= " AND pfpl.fk_user = u.rowid"; $sql.= " AND pfp.rowid = pfpl.fk_product_fournisseur"; - $sql.= " AND pfpl.fk_product_fournisseur = ".$fourn_id; + $sql.= " AND pfpl.fk_product_fournisseur = ".$product_fourn_price_id; if (empty($sortfield)) $sql.= " ORDER BY pfpl.datec"; else $sql.= $this->db->order($sortfield, $sortorder); $sql.=$this->db->plimit($limit, $offset); From cf9d87df4a0a65ab997cfe4148c47428ef3cf5d7 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 1 Feb 2019 15:40:56 +0100 Subject: [PATCH 26/26] Fix travis --- htdocs/fourn/class/fournisseur.product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 38f2e98d3da..aafa14bf894 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -362,7 +362,7 @@ class ProductFournisseur extends Product $result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_UPDATE', $user); if ($result < 0) $error++; // End call triggers - if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) + if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { $result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrenc, $multicurrency_code); if ($result < 0) { @@ -921,7 +921,7 @@ class ProductFournisseur extends Product * @param int $offset Offset * @return array Array of Log prices */ - function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield='', $sortorder='', $limit=0, $offset=0) + function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0) { global $conf;