diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 493c9e62717..2587a58aef6 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -406,5 +406,6 @@ if ($resql) dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index f024f54c41c..2c7d92f3735 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -1004,7 +1004,7 @@ if ($id) print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 9643227da64..6a92a3f6080 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -397,6 +397,6 @@ else if ($id > 0 || $ref) { } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index aec34469559..735c5595ddc 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -184,6 +184,6 @@ if ($action == 'display' || $action == 'delete') { print ""; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 15a50e7b8e8..900205b7588 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -800,7 +800,7 @@ if ($id) print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index c33d4326836..8cd45c1cfda 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -190,5 +190,6 @@ print '
"; print ''; - llxFooter(); } +// End of page +llxFooter(); $db->close(); diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 03265e434f6..3a0a1f73308 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -140,5 +140,6 @@ if ($resql) { } print "\n"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 92c5713880c..e17cefd77bb 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -714,5 +714,6 @@ if ($action == 'create') dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index b0a91f7ce36..ee44b52ab7d 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -748,6 +748,6 @@ print '
'; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 80a4f0db5e8..55e9c8ab7ad 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -421,5 +421,6 @@ print ''; print ""; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 7e1387db951..677bc627c80 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -159,5 +159,6 @@ if (! empty($id)) { print "Error ID incorrect"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 4191243e412..45387722719 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -415,6 +415,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. } } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index cc0ced6b067..83ddd1bd888 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -400,6 +400,6 @@ if ($result) { print $db->lasterror(); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 69396131b02..b5fec4a0e7c 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -201,8 +201,9 @@ llxHeader('', $langs->trans("Ventilation")); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } @@ -524,5 +525,6 @@ jQuery(document).ready(function() { }); '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index d9b2137157d..b245e2539a7 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -167,5 +167,6 @@ if (! empty($id)) { print "Error ID incorrect"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 47a6f15e8c6..7f906e93879 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -345,5 +345,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print ''; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 473bc379057..ae368a20de1 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -349,6 +349,6 @@ if ($result) { print $db->lasterror(); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index a20f88f1c30..8057c9809f2 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -180,8 +180,9 @@ llxHeader('', $langs->trans("ExpenseReportsVentilation")); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } @@ -422,5 +423,6 @@ jQuery(document).ready(function() { }); '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 2881de98132..53ba48ff9d9 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -163,5 +163,6 @@ else print $langs->trans("Module10Desc")."
\n"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index f126d00f2e9..439b8625342 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -162,5 +162,6 @@ if (! empty($id)) { print "Error ID incorrect"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 3a6af92e41b..3e6a6991f6c 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -342,6 +342,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print ''; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index ef54dec564d..326d249f86d 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -406,7 +406,6 @@ if ($result) { print $db->lasterror(); } - - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 57fdf0ace48..18c9fa11a3c 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -202,8 +202,9 @@ llxHeader('', $langs->trans("SuppliersVentilation")); if (empty($chartaccountcode)) { print $langs->trans("ErrorChartOfAccountSystemNotSelected"); - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } @@ -532,5 +533,6 @@ jQuery(document).ready(function() { }); '; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 4511ee0e8a7..2abc3b10841 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -265,7 +265,6 @@ form_constantes($constantes, 0, $helptext); dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index 88514d83da3..76d40e57c17 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -160,7 +160,6 @@ form_constantes($constantes, 0, $helptext); dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index cfdea50538f..f47f92faa4c 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index 2c849628ab9..e78c4ef29e5 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -116,6 +116,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index b35df5f0083..31d9c43afbb 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -250,7 +250,6 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) print ''.$urlwithroot.'/public/members/new.php'.$entity_qr.''; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 2b663ecf2bc..8fb1851e021 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -175,8 +175,6 @@ if ($object->id > 0) } } - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 990c8349e33..bc09ac2c250 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1896,6 +1896,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index be3a13d8771..ff7e9c3be2e 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -310,6 +310,6 @@ print '
'; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 8e12dec056e..4c91efc265c 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -170,6 +170,6 @@ else print $langs->trans("ErrorRecordNotFound"); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index 5814ed3bf70..adc3d32eea4 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -86,7 +86,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index c9e3d1936c6..030700bb0f6 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -435,6 +435,6 @@ print ""; print ''; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index ff0bad063bd..b6bffd3d1bd 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -221,5 +221,6 @@ else print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 3a1dd04443f..db017d71f61 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -827,6 +827,6 @@ print ''; if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit, 1); - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 1b887406df3..ae278b5dbb5 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -120,6 +120,6 @@ if ($id) } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index ded3dec120e..7ae29a7eeb9 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -143,7 +143,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 1c6944c2a0a..9de537ed39a 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -309,8 +309,6 @@ if ($mode) dol_fiche_end(); - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 083d81d6db6..902c2d35359 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -229,7 +229,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3e4af5438c6..7e3dfe28b0e 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -1108,7 +1108,6 @@ else print $langs->trans("ErrorRecordNotFound"); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index f905225a396..34b58c5b04d 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -417,7 +417,6 @@ if ($rowid && $action != 'edit') print ''; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 05856c35f75..649a1e22996 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -76,5 +76,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 21ba01088e4..91e5b2f8837 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -381,6 +381,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 56363599c10..e9ad0b91498 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -787,7 +787,6 @@ if ($rowid > 0) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 7edb42e6c76..5d60beb2a4d 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -187,5 +187,6 @@ else print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 6fedfa6d2cb..7f41927b478 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -202,6 +202,6 @@ print "\n"; print "
"; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 69e834e22e2..887fba847e4 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -117,6 +117,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 906ecd8d092..236483f5ed4 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -238,7 +238,6 @@ print ''; print "\n"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 2d20d285720..842c8d01470 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -399,6 +399,6 @@ print ''; print "
"; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index e78a8e089ed..269880236cb 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -247,6 +247,6 @@ print ''; print "
"; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 481a850790e..d76d95da47a 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -198,6 +198,6 @@ if (! empty($conf->use_javascript_ajax)) print ''; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 5c9be79e848..497d4748da8 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -432,6 +432,6 @@ print "\n"; print ''; dol_fiche_end(); +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index 99b8d09f277..3b95c158f27 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -114,6 +114,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index a7a863c4725..4e0c683a73f 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -405,5 +405,6 @@ if ($conf->produit->enabled) print "
"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 04fd76e96fc..9f3453f7587 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -488,7 +488,6 @@ print '
'."\n"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index df628ecc87f..82b0ed3848c 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -280,6 +280,6 @@ dol_fiche_end(); print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index c2cfaf9f72a..34a641137dc 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -140,6 +140,6 @@ if (! empty($conf->global->CLICKTODIAL_URL)) } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index cee12e4b08e..64df9194197 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -679,7 +679,6 @@ print "\n"; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 949038b4413..4a006c56268 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -1153,7 +1153,6 @@ else print '
'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 8e17541bfef..214c30dc544 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -164,5 +164,6 @@ print "\n"; print '

'; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index e4691a42e78..9e6745e6c29 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -147,5 +147,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 9dd68c16326..be5f785f9e4 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -314,7 +314,6 @@ if ($conf->use_javascript_ajax) print "\n"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 74f7acb04f3..60be9e062ba 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -509,7 +509,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index ea4bbf97af0..e882a56e2b8 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -143,6 +143,6 @@ $message.=img_picto('','object_globe.png').' '.$langs->trans("WebDavServer",'Web $message.='
'; print $message; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 84271cff38f..984ddfbefd7 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -412,7 +412,6 @@ dol_fiche_end(); print "\n"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index ae3c43c5b24..14dfb9922f6 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -415,5 +415,6 @@ if($action == 'edit') { } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 32995bce38f..0c25f3a5bd8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1735,7 +1735,7 @@ else print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index dc2f3e489f7..3126f432938 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -109,5 +109,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index d249def1401..dd3b1c5bff7 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -114,6 +114,6 @@ print ""; print "\n"; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index eb18f904229..c851010635e 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -507,5 +507,6 @@ print '
$(function() { }); '; dol_fiche_end(); -llxFooter(); +// End of page +llxFooter(); $db->close(); diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index b6f12a723ff..292c3604799 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * * 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 @@ -32,9 +32,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page -$langs->loadLangs(array('admin', 'exports')); - -$langs->load('other'); +$langs->loadLangs(array('admin', 'exports', 'other')); if (! $user->admin) accessforbidden(); @@ -73,7 +71,7 @@ dol_fiche_head( // Setup page goes here $form=new Form($db); -$var=false; + print ''; print ''; print ''."\n"; @@ -82,8 +80,7 @@ print ''."\n"; // Example with a yes / no select -$var=!$var; -print ''; +print ''; print ''; print ''; print ''; - print '
'.$langs->trans("ExportModel").'
'.$langs->trans("set_EXPORTS_SHARE_MODELS").' '; @@ -94,9 +91,8 @@ echo ajax_constantonoff('EXPORTS_SHARE_MODELS'); print ''; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index e8683dfc4ee..e0f3f72f927 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -325,6 +325,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index f00d125a4d5..6c28081e6fc 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -782,7 +782,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 19d4a4cc772..bed1d4d9bcb 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -234,6 +234,6 @@ else */ } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index a216f2d4ab7..c714c0c6c1b 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2017 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * * 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 @@ -560,7 +560,6 @@ print "\n"; print ''; //Use draft Watermark - print "
"; print ''; print ""; @@ -635,12 +634,10 @@ print ''; print ''; print '
'; - - - print ''; print '
'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 9c944324527..9f154591f0f 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -153,6 +153,6 @@ if ($geoip) $geoip->close(); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index b199505d214..e2d1cfca145 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -517,5 +517,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 62f17d5cb1d..355f5ae44fd 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -578,6 +578,6 @@ else // Show print '
'; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 6542cec1174..2f64793c28b 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -114,7 +114,6 @@ if (empty($reshook)) print '
'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 6776cfb1480..052b2f38988 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -340,5 +340,6 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 3188bf6e58a..dd85a998383 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -318,6 +318,7 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 4ae6ce9ad97..2650fe4fe6e 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -251,5 +251,6 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 616eb99a8da..240901ec04d 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -442,7 +442,6 @@ if (function_exists("ldap_connect")) } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index e45857f2f38..e845fd37adc 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -241,5 +241,6 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 8b11069fc61..513aa63f035 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -470,5 +470,6 @@ if (function_exists("ldap_connect")) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index e9389b0271d..d24891f80f6 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -306,7 +306,6 @@ else */ } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 88ce717f005..91fb9f964e4 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -478,6 +478,7 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php index c9fed1c6554..55fe6f10362 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/livraison_extrafields.php @@ -119,6 +119,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/livraisondet_extrafields.php index 921e9cfee41..e70b4f2d09b 100644 --- a/htdocs/admin/livraisondet_extrafields.php +++ b/htdocs/admin/livraisondet_extrafields.php @@ -120,6 +120,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 3349ac0056a..419f6efbee9 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -122,5 +122,6 @@ print "\n"; print '
'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 32fbdd4aeb6..d5b866d9d20 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -152,6 +152,6 @@ print '
\n"; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 87a89f5d99b..9490a291729 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -205,5 +205,6 @@ print '
'; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 209fd9b3583..b250bf28a87 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -447,7 +447,7 @@ if ($mode == 'template' && $user->admin) //$printer->sendToPrinter($object, 1, 16); //setEventMessages($printer->error, $printer->errors, 'errors'); +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index e8f8bdba204..566e57e587b 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -137,6 +137,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index 722e5d88a9c..b8ea860ac25 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -116,6 +116,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index 6c5281173c3..c5ec770e393 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -127,5 +127,6 @@ print '
'; - // Form to test upload print '
'; $formfile=new FormFile($db); @@ -188,5 +187,6 @@ $formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestF $filearray=dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1); $formfile->list_of_documents($filearray, null, 'admin_temp', ''); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 6503ab10f77..0e3da947fa8 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -206,6 +206,6 @@ print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 64bb04af945..9c4338416f6 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -331,7 +331,6 @@ else } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index b9892fdf2a9..d179c66d58d 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -163,6 +163,6 @@ else dol_fiche_end(); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 74870b69fc3..2e62f6f49e7 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -566,7 +566,6 @@ if ($conf->global->PRODUIT_SOUSPRODUITS) } */ - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 75a917dd185..367d1fe0d36 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -516,7 +516,6 @@ print "\n"; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 695d25a963c..72050867dfa 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -589,7 +589,6 @@ print "\n"; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index c1f3a7cb25d..55fb311ccda 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -430,7 +430,6 @@ print ''; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 99069447e81..eeb148e9d99 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -582,6 +582,7 @@ print "\n"; print "\n ".$langs->trans("PathDirectory")."\n ".$conf->supplier_proposal->dir_output."\n\n"; print "\n
"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 16da8bf7a5c..65ce01a4faf 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -123,6 +123,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index 4ca9fd516d7..cdf128871fd 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -119,6 +119,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 58c0408510d..640b6375c57 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -117,6 +117,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 7dfaa02545e..65fe0537ba7 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -118,6 +118,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 45dc91a8b95..e163fc83de5 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -302,6 +302,6 @@ if(! empty($conf->loghandlers['mod_syslog_file']) && ! empty($conf->cron->enable print ''; print "\n"; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 61780d51386..e9ea61ac944 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -214,7 +214,6 @@ if ($showpromotemessage) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/browser.php b/htdocs/admin/system/browser.php index 4f2a53de88d..c5aeff70b88 100644 --- a/htdocs/admin/system/browser.php +++ b/htdocs/admin/system/browser.php @@ -66,7 +66,6 @@ print ''; print '
'; print '
'; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 82e8481c2dd..9d4c4fc3cec 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -249,7 +249,6 @@ if ($resql) print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 556961cb565..17d72edf20a 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -212,5 +212,6 @@ else } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 45ce3c087e6..d5a7bbcdbfd 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -126,6 +126,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index cef493c95f8..392c083c382 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -138,6 +138,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 4b02e7941d2..4dd4ef9dc9b 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -453,7 +453,6 @@ if ($resql) print ''; print '
'; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 9a9e2297cba..65a9354a19f 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -433,11 +433,8 @@ if (! $error && $xml) print $out; } - - - +// End of page llxFooter(); - $db->close(); exit($error); diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 3d473640618..7ffef739993 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -25,9 +25,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -$langs->load("admin"); -$langs->load("user"); -$langs->load("install"); +// Load translation files required by the page +$langs->loadLangs(array("admin", "user", "install")); if (! $user->admin) accessforbidden(); @@ -114,6 +113,6 @@ print '
'; //print "
\n"; print info_admin($langs->trans("SystemInfoDesc")).'
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 5027066a37b..65e19fb9d83 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -159,5 +159,6 @@ foreach($rights_ids as $right_id) $old = $right_id; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index 01d48f2444d..251025a4c9e 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -49,6 +49,6 @@ $osversion=version_os(); print "".$langs->trans("Version")."".$osversion."\n"; print ''; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 1e757b72f63..85ac2aea006 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -491,7 +491,6 @@ print ''.$langs->trans("DatabaseStatistics").': '; print '
'; */ - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index 8664a28b28a..aa502cde421 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -116,7 +116,6 @@ foreach($phparray as $key => $value) print '
'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/system/xcache.php b/htdocs/admin/system/xcache.php index 53eaeec085f..b582e61619b 100644 --- a/htdocs/admin/system/xcache.php +++ b/htdocs/admin/system/xcache.php @@ -76,6 +76,6 @@ if ($action == 'clear') } */ +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 7c4bf64909f..304f9b79bd0 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -273,6 +273,6 @@ if (! empty($conf->accounting->enabled)) print '

'.$langs->trans("AccountingAccountForSalesTaxAreDefinedInto", $langs->transnoentitiesnoconv("MenuAccountancy"), $langs->transnoentitiesnoconv("Setup")).''; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index c9d650f781d..5cf72b302c9 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -641,6 +641,6 @@ print ''; print '
'; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 0687a33c52b..07ace9fea0c 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -109,6 +109,6 @@ if ($action == 'edit' && !empty($attrname)) { include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 1c985e23090..c9ef19dae98 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -522,6 +522,6 @@ print $langs->trans("BackupDescX").'

'; close(); diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index f390c192159..aca900c1cbc 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -212,6 +212,6 @@ else if (in_array($type, array('pgsql'))) close(); diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index d3253c02514..9999734a8f8 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -335,7 +335,6 @@ if (function_exists('eaccelerator_get')) { print "

"; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php index 98a490550ca..c5a05ef2136 100644 --- a/htdocs/admin/tools/index.php +++ b/htdocs/admin/tools/index.php @@ -56,6 +56,6 @@ print '

'; //print '
'; print '
'; // For a reason I don't know, the div class="center does not works, we must keep the
- +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 48d3ef57fd5..db5157789e1 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -339,6 +339,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 70b0987732b..13b99d92f6d 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -208,5 +208,6 @@ print ''; print '
'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index f415ed1692c..097fc507240 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -119,7 +119,6 @@ if (preg_match('/^confirm/i',$choice)) print $form->formconfirm($_SERVER["PHP_SELF"].'?choice=allfiles', $langs->trans('Purge'), $langs->trans('ConfirmPurge').img_warning().' ', 'purge', $formquestion, 'no', 2); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index d0802d6b473..41923aa068d 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -142,7 +142,6 @@ print '
'; print $langs->trans("GoModuleSetupArea", DOL_URL_ROOT.'/admin/modules.php?mode=deploy', $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules")); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index cc21a8ff717..4c215e9ae52 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -584,6 +584,6 @@ if (! empty($langcode)) dol_set_focus('#transvalue'); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 1a1893e2eb0..cd2f33b4cb0 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -84,6 +84,6 @@ foreach ($triggers as $trigger) print ''; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index f888c8410bb..2cf8fc5b6f3 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -337,5 +337,6 @@ print "
"; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 28f1ad6af2f..c1b55dcec6a 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -282,5 +282,6 @@ print "
"; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 80ca0b29c0a..fcdeee79249 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -646,9 +646,7 @@ if ($id) dol_fiche_end(); -//print '
'; - - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index c688da0e550..9d724b86390 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -143,9 +143,8 @@ else dol_fiche_end(); -//print '
'; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index b5bdec73f3e..24a39ce827a 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -187,7 +187,6 @@ if ($nbqualified == 0) } print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index 1cdf78df4bf..109b0f1e94f 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -109,6 +109,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php index d828bffa4de..e8f1d71370b 100644 --- a/htdocs/asset/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -107,6 +107,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index c240f350590..1168fd3ada3 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -107,9 +107,8 @@ else print ''; } - -// Page end dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 66baaae196c..6427befd03e 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -148,6 +148,6 @@ else accessforbidden('',0,0); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index 71460f31a2c..e8820ee5cfa 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -79,5 +79,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index cf0166df96f..775b3e8747e 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -144,6 +144,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index f4409ee5417..001912f7de3 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -851,7 +851,6 @@ if ($rowid > 0) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 8cd5ff979a0..66ff541d499 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -190,5 +190,6 @@ else { print 'Bad parameters in URL. Must be '.$_SERVER['PHP_SELF'].'?caller=99999&called=99999&login=xxxxx&password=xxxxx'; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 26386052480..7086af7f17e 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -319,6 +319,6 @@ if ($conf->product->enabled || $conf->product->service) print ''; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 7dfec76b39e..6dd578993ca 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -441,6 +441,6 @@ print '
'; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 326fea79c5d..8c2835d856c 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -178,5 +178,6 @@ if (GETPOST('withtab','alpha')) print '

'; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 8f5d47bf704..6bb1876b926 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -587,5 +587,6 @@ if (GETPOST('withtab','alpha')) print '

'; +// End of page llxFooter(); -$db->close(); +$db->close(); \ No newline at end of file diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index 25fa032902f..ed20f619b25 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -81,5 +81,6 @@ print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index d450e476506..b82c2b11b6c 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -336,7 +336,6 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index ac5a89c66f3..10ce877c7e0 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -209,7 +209,7 @@ else dol_print_error($db); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index f4af16b3739..62867d855cb 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -185,5 +185,6 @@ print '
\n"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index 92e23a2199a..03adfdbb41e 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -122,5 +122,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 3fbd29a640b..abea3f41eeb 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -111,6 +111,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index db56902347b..ce3324505eb 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -288,7 +288,6 @@ if ($user->rights->categorie->creer) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index b420847f6fd..cdfac54fb9d 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -192,7 +192,6 @@ print '
'; - - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index e57e51caf62..e634da4fe80 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -202,6 +202,6 @@ print ""; print '
'; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 472a8eb9b95..095c0c611c5 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -273,6 +273,6 @@ else print $langs->trans("ErrorUnknown"); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 7d71b43a81b..dbcfca198d2 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -334,5 +334,6 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print '
'; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 24e70e7d587..ba3580cea87 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -697,6 +697,6 @@ if ($type == Categorie::TYPE_PROJECT) } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index 2c056cd0e07..d7d5e9a8bbd 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -456,9 +456,6 @@ if ($action == 'editcontent') print "
\n\n"; - - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 1d6a0286b68..dae5fb70617 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1611,7 +1611,6 @@ if ($id > 0) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 43e5b89f115..7fc12129cc5 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -268,7 +268,6 @@ else print $langs->trans("ErrorUnknown"); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c361d275882..178e4bfb6d7 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1250,8 +1250,8 @@ else // View by day print "\n".''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 9a043a13690..2582e9b6b32 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -114,5 +114,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 2c11a1de977..319499d65fd 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -672,7 +672,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 2fdfa180319..9350de8f85c 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -730,10 +730,8 @@ jQuery(document).ready(function() { }); '; - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 0cf056ef3a9..58690dc512b 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -865,10 +865,8 @@ jQuery(document).ready(function() { }); '; - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 7e4108b470b..ff1c7746afa 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -209,5 +209,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 6a6aa12862a..becfabc949c 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -111,6 +111,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 0816a4c035c..7172c0e5b7c 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -118,6 +118,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 83db0e0f1d2..d7d5a3f4f5a 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1346,5 +1346,4 @@ else // End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index aa8dae43140..b6d9f0922aa 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -176,6 +176,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index e90a821b5e3..92757dcac36 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -884,6 +884,6 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index e0b451b1290..72058578db7 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -471,5 +471,6 @@ if ($object->fetch($id) >= 0) { } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 97746ad9d82..469db6f2a54 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1358,5 +1358,6 @@ else } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 08ed54d2fc3..6caa262500e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -649,7 +649,6 @@ if ($object->fetch($id) >= 0) } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 17693a1a73c..9cd1e8546d0 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -210,7 +210,6 @@ if ($langs->file_exists("html/spam.html",0)) { print '
'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index b4f2eaeb6f3..3c1e6e2cffa 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -75,5 +75,6 @@ if ($object->fetch($id) >= 0) dol_fiche_end(); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 87a390d4006..5087698b9ab 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -224,6 +224,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index 1e8c5c82cf4..e9ddee12b22 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -177,5 +177,6 @@ if ($_socid > 0) } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 5e21f493c64..4e017ff13d9 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -212,6 +212,6 @@ if ($object->id > 0) } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 1c8d494214d..2f16cd54864 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -179,5 +179,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 0dbe2fb855e..b47a4506412 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -530,7 +530,6 @@ if (! empty($conf->propal->enabled)) //print ''; print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 317c9902d52..7879612b099 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -127,5 +127,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1a23c0b8728..45ca1c5212d 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -310,7 +310,7 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country). if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')'; if ($search_ref) $sql .= natural_search('p.ref', $search_ref); if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer); -if ($search_refproject) $sql .= natural_search('pr.ref', $search_refprojet); +if ($search_refproject) $sql .= natural_search('pr.ref', $search_refproject); if ($search_availability) $sql .= " AND p.fk_availability IN (".$db->escape($search_availability).')'; if ($search_societe) $sql .= natural_search('s.nom', $search_societe); @@ -432,7 +432,7 @@ if ($resql) if ($search_year) $param.='&search_year='.urlencode($search_year); if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_refcustomer) $param.='&search_refcustomer='.urlencode($search_refcustomer); - if ($search_refprojet) $param.='&search_refprojet='.urlencode($search_refprojet); + if ($search_refproject) $param.='&search_refproject='.urlencode($search_refproject); if ($search_societe) $param.='&search_societe='.urlencode($search_societe); if ($search_user > 0) $param.='&search_user='.urlencode($search_user); if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale); @@ -988,27 +988,40 @@ if ($resql) } // Show total line - if (isset($totalarray['totalhtfield']) + if (isset($totalarray['totalhtfield']) || isset($totalarray['totalvatfield']) || isset($totalarray['totalttcfield']) || isset($totalarray['totalamfield']) || isset($totalarray['totalrtpfield']) + || isset($totalarray['totalizable']) ) { print ''; $i=0; while ($i < $totalarray['nbfield']) { - $i++; - if ($i == 1) - { + $i++; + if ($i == 1) + { if ($num < $limit && empty($offset)) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; - } - elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).''; - elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).''; - elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).''; - else print ''; + } + elseif ($totalarray['totalhtfield'] == $i) print ''.price($totalarray['totalht']).''; + elseif ($totalarray['totalvatfield'] == $i) print ''.price($totalarray['totalvat']).''; + elseif ($totalarray['totalttcfield'] == $i) print ''.price($totalarray['totalttc']).''; + elseif ($totalarray['totalizable']) { + $printed = false; + foreach ($totalarray['totalizable'] as $totalizable) { + if ($totalizable['pos']==$i && ! $printed) { + print ''.price($totalizable['total']).''; + $printed = true; + } + } + if (! $printed) { + print ''; + } + } + else print ''; } print ''; } diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 607cff245d9..a346f8df18f 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -144,6 +144,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index ac6b42c45d8..00db6264377 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -344,7 +344,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 2273012696f..6d7e93af4be 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -275,6 +275,6 @@ if ($resql) //print ''; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index 50127d719c8..93cfada8860 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -89,5 +89,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 6cd41c6c658..86c1bad0521 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -89,5 +89,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 6f3287b8831..f045e570c6e 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -129,8 +129,9 @@ if ($socid > 0) print ''; - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } @@ -324,5 +325,6 @@ if ($socid > 0) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 3eec109e6b3..78e4643d5e3 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -998,5 +998,6 @@ if ($socid > 0) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3bdab169f6d..016d6a28c04 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2678,5 +2678,6 @@ if ($action == 'create' && $user->rights->commande->creer) } } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4202f44720b..605be7e9b3f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3424,7 +3424,7 @@ class Commande extends CommonOrder if (!$user->rights->commande->lire) $option = 'nolink'; - + if ($option !== 'nolink') { // Add param to save lastsearch_values or not @@ -3468,11 +3468,11 @@ class Commande extends CommonOrder $linkstart.=$linkclose.'>'; $linkend=''; - if ($option == 'nolink') { + if ($option === 'nolink') { $linkstart = ''; $linkend = ''; } - + $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); if ($withpicto != 2) $result.= $this->ref; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 7669239134a..bd00116e026 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -214,5 +214,6 @@ if ($id > 0 || ! empty($ref)) } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 9263ceb3f45..42def36ee28 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -190,7 +190,7 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index ffebbaa260a..e7d0514a022 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -189,6 +189,6 @@ else } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 5cfb87c7a25..4c596620c6c 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -479,6 +479,6 @@ if (! empty($conf->commande->enabled)) print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 4bac4a3a447..6c0b5f42ec6 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -128,5 +128,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 2b86ad2f18a..98c2333793f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1160,5 +1160,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 6cff3bfb3bc..bf02c9b993c 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -142,5 +142,6 @@ if ($id > 0 || ! empty($ref)) } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 03d379270b1..37768ade393 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -739,5 +739,6 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 8f259808357..49e7d5cfb60 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -369,7 +369,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 82dcfe76d60..5e1a10390e2 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -494,5 +494,6 @@ else print "\n
\n"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index b198b54dfc8..6c2ad4ef302 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1529,6 +1529,6 @@ if ($_POST["action"] == "search" && ! $num) print '
'.$langs->trans("NoRecordFound").'
'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index 7c04c409bed..99856a2dea2 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -92,5 +92,6 @@ print "".$langs->trans("BankBalance").""; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index a319f6de6a4..ccec902bf7c 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -96,5 +96,6 @@ else } print ""; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index c091d2ac298..461d193d1fe 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -1034,5 +1034,6 @@ else } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 8760852592f..7ef798103d5 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -144,4 +144,6 @@ if ($action != 'edit') print ''; +// End of page llxFooter(); +$db->close(); diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 314ab074c19..d41bbd77bbe 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -147,7 +147,6 @@ else { exit; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index c163c0e421e..7dad720139a 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -864,7 +864,6 @@ if ($mode == 'showalltime') print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index 0b622154137..7eaeb515aa9 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -71,5 +71,6 @@ print ''; print ''; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 78759f40cf0..e75250a830c 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'compta', 'bills')); +$langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other')); if (! empty($conf->adherent->enabled)) $langs->load("members"); if (! empty($conf->don->enabled)) $langs->load("donations"); if (! empty($conf->loan->enabled)) $langs->load("loan"); @@ -688,6 +688,6 @@ if ($result) } else dol_print_error($db); +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 909785f2fba..1f01355050c 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -604,7 +604,6 @@ print ""; print ""; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index af352035bbe..3f1bede8e20 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -813,7 +813,6 @@ else } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 0c8d3ea2b87..7ad8bc2ad96 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -265,5 +265,6 @@ print '
"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 0fb8880ce87..2389d1fec77 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -330,5 +330,6 @@ else print $langs->trans("ErrorBankAccountNotFound"); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 1b4d7579892..9c30dfe3cd8 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -499,8 +499,6 @@ if ($id) print "
"; } - - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index cf596860a4b..e11a608c7d0 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -154,6 +154,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index 6535e0c0082..6e4060bbeb1 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -344,5 +344,6 @@ else } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index bb66871d6c0..c39a6379000 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -58,6 +58,6 @@ print ''; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 6d369b696b9..50e5285cb14 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -568,7 +568,6 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 05d509e268d..1e8fa358929 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -577,7 +577,6 @@ else if ($id) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 59d92140c86..c2b3595b476 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -129,6 +129,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index a390023e280..98c939965a3 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -204,7 +204,6 @@ else dol_print_error($db); print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/info.php b/htdocs/compta/deplacement/info.php index 6a62484323f..f63b1765efb 100644 --- a/htdocs/compta/deplacement/info.php +++ b/htdocs/compta/deplacement/info.php @@ -59,5 +59,6 @@ if ($id) print ''; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index bdbdad0a712..20d300d9da4 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -212,6 +212,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index cf652948a6e..193e2c7e9a9 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -312,7 +312,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 4e44774e0c4..1fe26e82a54 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -114,6 +114,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php index 54d3da8e18a..23c0d79a33c 100644 --- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php @@ -115,6 +115,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index c2490da4f42..0947f788719 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index 28c70ea9024..46d9ed28335 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -113,6 +113,6 @@ if ($action == 'edit' && ! empty($attrname)) require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b5d04062693..e411f8c5b1b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4886,5 +4886,6 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index af872a174ca..ab96700fc53 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -215,6 +215,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 161804d8a34..1fd8c40bf1f 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -191,6 +191,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 35ce40a6316..a46b79d7d1b 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1734,6 +1734,6 @@ else } } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 4eba0ba65fc..aff7cb362a8 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -122,5 +122,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 13db00a02c2..0cfb0347a2d 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -709,6 +709,6 @@ else dol_print_error($db); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 75dce3c01a3..7d989e4b63e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1245,5 +1245,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 58fc26030b7..c46d3ed690e 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -142,7 +142,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index ecde973bd3b..d7766268989 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -696,6 +696,6 @@ if ($object->id > 0) print ''; } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 0416e04f7b0..04603076b07 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -347,7 +347,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 45fee127642..30b4164e81b 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2018 Alexandre Spangaro * Copyright (C) 2014 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Charlie BENKE @@ -29,12 +29,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; +if (! empty($conf->projet->enabled)) +{ + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} // Load translation files required by the page $langs->loadLangs(array("compta","banks","bills","users","salaries","hrm")); +if (! empty($conf->projet->enabled)) $langs->load("projects"); $id=GETPOST("id",'int'); $action=GETPOST('action','aZ09'); +$cancel= GETPOST('cancel', 'aZ09'); +$projectid = (GETPOST('projectid','int') ? GETPOST('projectid', 'int') : GETPOST('fk_project','int')); // Security check $socid = GETPOST("socid","int"); @@ -52,20 +60,27 @@ $hookmanager->initHooks(array('salarycard','globalcard')); * Actions */ -if ($_POST["cancel"] == $langs->trans("Cancel")) +if ($cancel) { header("Location: index.php"); exit; } -if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) +// Link to a project +if ($action == 'classin' && $user->rights->banque->modifier) +{ + $object->fetch($id); + $object->setProject(GETPOST('projectid')); +} + +if ($action == 'add' && empty($cancel)) { $error=0; - $datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]); - $datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); - $datesp=dol_mktime(12,0,0, $_POST["datespmonth"], $_POST["datespday"], $_POST["datespyear"]); - $dateep=dol_mktime(12,0,0, $_POST["dateepmonth"], $_POST["dateepday"], $_POST["dateepyear"]); + $datep=dol_mktime(12,0,0, GETPOST("datepmonth",'int'), GETPOST("datepday",'int'), GETPOST("datepyear",'int')); + $datev=dol_mktime(12,0,0, GETPOST("datevmonth",'int'), GETPOST("datevday",'int'), GETPOST("datevyear",'int')); + $datesp=dol_mktime(12,0,0, GETPOST("datespmonth",'int'), GETPOST("datespday",'int'), GETPOST("datespyear",'int')); + $dateep=dol_mktime(12,0,0, GETPOST("dateepmonth",'int'), GETPOST("dateepday",'int'), GETPOST("dateepyear",'int')); if (empty($datev)) $datev=$datep; $type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1); @@ -82,6 +97,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $object->type_payment=($type_payment > 0 ? $type_payment : 0); $object->num_payment=GETPOST("num_payment"); $object->fk_user_author=$user->id; + $object->fk_project= GETPOST('fk_project','int'); // Set user current salary as ref salaray for the payment $fuser=new User($db); @@ -187,6 +203,7 @@ if ($action == 'delete') llxHeader("",$langs->trans("SalaryPayment")); $form = new Form($db); +if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db); if ($id) { @@ -278,6 +295,18 @@ if ($action == 'create') print ''; print ''; + // Project + if (! empty($conf->projet->enabled)) + { + $formproject=new FormProjets($db); + + print ''.$langs->trans("Project").''; + + $numproject=$formproject->select_projects(-1, $projectid,'fk_project',0,0,1,1); + + print ''; + } + // Bank if (! empty($conf->banque->enabled)) { @@ -335,14 +364,46 @@ if ($id) dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='
'; + // Employee $userstatic=new User($db); $userstatic->fetch($object->fk_user); - $morehtmlref.=$langs->trans('Employee') . ' : ' . $userstatic->getNomUrl(1); + + // Project + if (! empty($conf->projet->enabled)) + { + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->salaries->write) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } $morehtmlref.='
'; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 3a3f34b85b4..31c616ac00d 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Juanjo Menent +/* Copyright (C) 2011-2018 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -17,9 +17,9 @@ */ /** - * \file htdocs/compta/salaries/class/paymentsalary.class.php - * \ingroup salaries - * \brief Class for salaries module payment + * \file htdocs/compta/salaries/class/paymentsalary.class.php + * \ingroup salaries + * \brief Class for salaries module payment */ // Put here all includes required by your class file @@ -40,6 +40,7 @@ class PaymentSalary extends CommonObject public $datep; public $datev; public $amount; + public $fk_project; public $type_payment; public $num_payment; public $label; @@ -102,6 +103,7 @@ class PaymentSalary extends CommonObject $sql.= " datep='".$this->db->idate($this->datep)."',"; $sql.= " datev='".$this->db->idate($this->datev)."',"; $sql.= " amount=".price2num($this->amount).","; + $sql.= " fk_projet='".$this->db->escape($this->fk_project)."',"; $sql.= " fk_typepayment=".$this->fk_typepayment."',"; $sql.= " num_payment='".$this->db->escape($this->num_payment)."',"; $sql.= " label='".$this->db->escape($this->label)."',"; @@ -161,6 +163,7 @@ class PaymentSalary extends CommonObject $sql.= " s.datep,"; $sql.= " s.datev,"; $sql.= " s.amount,"; + $sql.= " s.fk_projet as fk_project,"; $sql.= " s.fk_typepayment,"; $sql.= " s.num_payment,"; $sql.= " s.label,"; @@ -186,25 +189,26 @@ class PaymentSalary extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; - $this->ref = $obj->rowid; - $this->tms = $this->db->jdate($obj->tms); - $this->fk_user = $obj->fk_user; - $this->datep = $this->db->jdate($obj->datep); - $this->datev = $this->db->jdate($obj->datev); - $this->amount = $obj->amount; - $this->type_payement = $obj->fk_typepayment; - $this->num_payment = $obj->num_payment; - $this->label = $obj->label; - $this->datesp = $this->db->jdate($obj->datesp); - $this->dateep = $this->db->jdate($obj->dateep); - $this->note = $obj->note; - $this->fk_bank = $obj->fk_bank; - $this->fk_user_author = $obj->fk_user_author; - $this->fk_user_modif = $obj->fk_user_modif; - $this->fk_account = $obj->fk_account; - $this->fk_type = $obj->fk_type; - $this->rappro = $obj->rappro; + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + $this->tms = $this->db->jdate($obj->tms); + $this->fk_user = $obj->fk_user; + $this->datep = $this->db->jdate($obj->datep); + $this->datev = $this->db->jdate($obj->datev); + $this->amount = $obj->amount; + $this->fk_project = $obj->fk_project; + $this->type_payement = $obj->fk_typepayment; + $this->num_payment = $obj->num_payment; + $this->label = $obj->label; + $this->datesp = $this->db->jdate($obj->datesp); + $this->dateep = $this->db->jdate($obj->dateep); + $this->note = $obj->note; + $this->fk_bank = $obj->fk_bank; + $this->fk_user_author = $obj->fk_user_author; + $this->fk_user_modif = $obj->fk_user_modif; + $this->fk_account = $obj->fk_account; + $this->fk_type = $obj->fk_type; + $this->rappro = $obj->rappro; } $this->db->free($resql); @@ -276,12 +280,12 @@ class PaymentSalary extends CommonObject $this->fk_user_modif=''; } - /** - * Create in database - * - * @param User $user User that create - * @return int <0 if KO, >0 if OK - */ + /** + * Create in database + * + * @param User $user User that create + * @return int <0 if KO, >0 if OK + */ function create($user) { global $conf,$langs; @@ -331,6 +335,7 @@ class PaymentSalary extends CommonObject $sql.= ", datep"; $sql.= ", datev"; $sql.= ", amount"; + $sql.= ", fk_projet"; $sql.= ", salary"; $sql.= ", fk_typepayment"; $sql.= ", num_payment"; @@ -348,6 +353,7 @@ class PaymentSalary extends CommonObject $sql.= ", '".$this->db->idate($this->datep)."'"; $sql.= ", '".$this->db->idate($this->datev)."'"; $sql.= ", ".$this->amount; + $sql.= ", ".($this->fk_project > 0? $this->fk_project : 0); $sql.= ", ".($this->salary > 0 ? $this->salary : "null"); $sql.= ", ".$this->db->escape($this->type_payment); $sql.= ", '".$this->db->escape($this->num_payment)."'"; @@ -502,13 +508,11 @@ class PaymentSalary extends CommonObject global $langs; $result=''; - $label=$langs->trans("ShowSalaryPayment").': '.$this->ref; + $label=$langs->trans("ShowSalaryPayment").': '.$this->ref; - $linkstart = ''; + $linkstart = ''; $linkend=''; - $picto='payment'; - $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); if ($withpicto != 2) $result.= $this->ref; diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 599b847b49e..6b6d4b7a176 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -181,7 +181,9 @@ if ($action == 'add') GETPOST('help','alpha'), GETPOST('computed_value','alpha'), (GETPOST('entitycurrentorall', 'alpha')?0:''), - GETPOST('langfile', 'alpha') + GETPOST('langfile', 'alpha'), + 1, + (GETPOST('totalizable', 'alpha')?1:0) ); if ($result > 0) { @@ -331,7 +333,7 @@ if ($action == 'update') $visibility = GETPOST('list', 'alpha'); if ($type == 'separate') $visibility=3; - $result=$extrafields->update( + $result=$extrafields->update( GETPOST('attrname', 'alpha'), GETPOST('label', 'alpha'), $type, @@ -348,7 +350,9 @@ if ($action == 'update') GETPOST('default_value','alpha'), GETPOST('computed_value','alpha'), (GETPOST('entitycurrentorall', 'alpha')?0:''), - GETPOST('langfile') + GETPOST('langfile'), + 1, + (GETPOST('totalizable', 'alpha')?1:0) ); if ($result > 0) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 7d481463294..4798861ac2d 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -703,7 +703,7 @@ if ($massaction == 'confirm_createbills') if (! $error) { $db->commit(); - setEventMessage($langs->trans('BillCreated', $nb_bills_created)); + setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); // Make a redirect to avoid to bill twice if we make a refresh or back $param=''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index cd3e6c90fb5..9d8d718993b 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2015 Charles-Fr BENKE * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2017 Nicolas ZABOURI + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -516,14 +517,15 @@ class ExtraFields * @param string $entity Entity of extrafields * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not + * @param int $totalizable Is extrafield totalizable on list * @return int >0 if OK, <=0 if KO */ - function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $help='', $default='', $computed='', $entity='', $langfile='', $enabled='1') + function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $help='', $default='', $computed='', $entity='', $langfile='', $enabled='1', $totalizable=0) { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; - $table=$elementtype.'_extrafields'; + $table=$elementtype.'_extrafields'; if ($elementtype == 'categorie') $table='categories_extrafields'; if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) @@ -568,7 +570,7 @@ class ExtraFields { if ($label) { - $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$help,$default,$computed,$entity,$langfile,$enabled); + $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$help,$default,$computed,$entity,$langfile,$enabled, $totalizable); } if ($result > 0) { @@ -625,12 +627,13 @@ class ExtraFields * @param string $entity Entity of extrafields * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not - * @return int <=0 if KO, >0 if OK + * @param int $totalizable Is extrafield totalizable on list + * @return int <=0 if KO, >0 if OK */ - private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1') + private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1', $totalizable=0) { global $conf, $user; - dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled); + dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable); // Clean parameters if ($elementtype == 'thirdparty') $elementtype='societe'; @@ -638,6 +641,9 @@ class ExtraFields if (empty($pos)) $pos=0; if (empty($list)) $list='0'; + if (empty($totalizable)) { + $totalizable = 0; + } if (empty($required)) $required=0; if (empty($unique)) $unique=0; if (empty($alwayseditable)) $alwayseditable=0; @@ -681,6 +687,7 @@ class ExtraFields $sql.= " alwayseditable,"; $sql.= " param,"; $sql.= " list,"; + $sql.= " totalizable,"; $sql.= " fielddefault,"; $sql.= " fieldcomputed,"; $sql.= " fk_user_author,"; @@ -703,6 +710,7 @@ class ExtraFields $sql.= " '".$this->db->escape($alwayseditable)."',"; $sql.= " '".$this->db->escape($params)."',"; $sql.= " '".$this->db->escape($list)."', "; + $sql.= " ".$totalizable.","; $sql.= " ".(($default!='')?"'".$this->db->escape($default)."'":"null").","; $sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").","; $sql .= " " . $user->id . ","; @@ -773,7 +781,7 @@ class ExtraFields // We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management. dol_syslog("fetch_name_optionals_label elementtype=".$elementtype); - $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,fielddefault,fieldcomputed,entity,enabled,help"; + $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,totalizable,fielddefault,fieldcomputed,entity,enabled,help"; $sql.= " FROM ".MAIN_DB_PREFIX."extrafields"; $sql.= " WHERE entity IN (0,".$conf->entity.")"; if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'"; // Filed with object->table_element @@ -807,6 +815,7 @@ class ExtraFields $this->attribute_perms[$tab->name]=(strlen($tab->perms) == 0 ? 1 : $tab->perms); $this->attribute_langfile[$tab->name]=$tab->langs; $this->attribute_list[$tab->name]=$tab->list; + $this->attribute_totalizable[$tab->name]=$tab->totalizable; $this->attribute_entityid[$tab->name]=$tab->entity; $this->attribute_entitylabel[$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]); @@ -825,6 +834,7 @@ class ExtraFields $this->attributes[$tab->elementtype]['perms'][$tab->name]=(strlen($tab->perms) == 0 ? 1 : $tab->perms); $this->attributes[$tab->elementtype]['langfile'][$tab->name]=$tab->langs; $this->attributes[$tab->elementtype]['list'][$tab->name]=$tab->list; + $this->attributes[$tab->elementtype]['totalizable'][$tab->name]=$tab->totalizable; $this->attributes[$tab->elementtype]['entityid'][$tab->name]=$tab->entity; $this->attributes[$tab->elementtype]['entitylabel'][$tab->name]=(empty($labelmulticompany[$tab->entity])?'Entity'.$tab->entity:$labelmulticompany[$tab->entity]); $this->attributes[$tab->elementtype]['enabled'][$tab->name]=$tab->enabled; @@ -886,6 +896,7 @@ class ExtraFields $perms=dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1); $langfile=$this->attributes[$extrafieldsobjectkey]['langfile'][$key]; $list=dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1); + $totalizable=$this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; $help=$this->attributes[$extrafieldsobjectkey]['help'][$key]; $hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) } @@ -902,6 +913,7 @@ class ExtraFields $param=$this->attribute_param[$key]; $langfile=$this->attribute_langfile[$key]; $list=$this->attribute_list[$key]; + $totalizable=$this->attribute_totalizable[$key]; $hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) } @@ -1753,7 +1765,7 @@ class ExtraFields $align=''; - if ($type == 'date') + if ($type == 'date') { $align="center"; } @@ -1781,6 +1793,10 @@ class ExtraFields { $align="center"; } + elseif ($type == 'price') + { + $align="right"; + } return $align; } diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index f437920caf9..dcc282794b9 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -468,9 +468,10 @@ class FormProjets * @param string $socid If of thirdparty to use as filter or 'id1,id2,...' * @param string $morecss More CSS * @param int $limitonstatus Add filters to limit length of list to opened status (for example to avoid ERR_RESPONSE_HEADERS_TOO_BIG on project/element.php page). TODO To implement + * @param string $projectkey Equivalent key to fk_projet for actual table_element * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ - function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2) + function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet") { global $conf, $langs; @@ -480,7 +481,7 @@ class FormProjets if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true; $sqlfilter=''; - $projectkey="fk_projet"; + //print $table_element; switch ($table_element) { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index eb3ef3698a4..0e7203ba748 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1201,7 +1201,7 @@ function activateModulesRequiredByCountry($country_code) { activateModule($modName); - setEventMessage($objMod->automatic_activation[$country_code],'warnings'); + setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings'); } } diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 5e1e300520c..28584b60e32 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -356,9 +356,9 @@ function checkES($IentOfi, $InumCta) $sum = 0; for ($i = 0; $i < 11; $i++) { - $sum += $values[$i] * substr($InumCta, $i, 1); + $sum += $values[$i] * (int) substr($InumCta, $i, 1);//int to cast result of substr to a number } - + $key = 11 - $sum % 11; if ($key == 10) diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 9e319c8bf41..e17035eda3d 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2014 Alexandre Spangaro * * 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 @@ -23,11 +23,11 @@ */ /** - * \defgroup salaries Module salaries - * \brief Module to include salaries management - * \file htdocs/core/modules/modSalaries.class.php - * \ingroup salaries - * \brief File to activate module salaries + * \defgroup salaries Module salaries + * \brief Module to include salaries management + * \file htdocs/core/modules/modSalaries.class.php + * \ingroup salaries + * \brief File to activate module salaries */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; @@ -184,7 +184,7 @@ class modSalaries extends DolibarrModules * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories * - * @param string $options Options when enabling module ('', 'noboxes') + * @param string $options Options when enabling module ('', 'noboxes') * @return int 1 if OK, 0 if KO */ function init($options='') diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index e80685154fc..2c971c7a553 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2017 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,6 +53,7 @@ $langs->load("modulebuilder"); var required = jQuery("#required"); var alwayseditable = jQuery("#alwayseditable"); var list = jQuery("#list"); + var totalizable = jQuery("#totalizable"); load("modulebuilder"); textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> + +trans("Totalizable"); ?>> textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> multicompany->enabled) { ?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index cb5ef26bc57..d4dc2776fde 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,6 +52,7 @@ $langs->load("modulebuilder"); var required = jQuery("#required"); var alwayseditable = jQuery("#alwayseditable"); var list = jQuery("#list"); + var totalizable = jQuery("#totalizable"); attributes[$elementtype]['param'][$attrname]; $perms=$extrafields->attributes[$elementtype]['perms'][$attrname]; $langfile=$extrafields->attributes[$elementtype]['langfile'][$attrname]; $list=$extrafields->attributes[$elementtype]['list'][$attrname]; +$totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname]; $help=$extrafields->attributes[$elementtype]['help'][$attrname]; $entitycurrentorall=$extrafields->attributes[$elementtype]['entityid'][$attrname]; @@ -251,6 +254,7 @@ else trans("AlwaysEditable"); ?>> textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?> +textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?>> textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?> multicompany->enabled) { ?> diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index a03c06f2d1d..ebe7a49877d 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2012-2017 Regis Houssin + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -61,6 +62,7 @@ print ''.$langs->trans("Unique").''; print ''.$langs->trans("Required").''; print ''.$langs->trans("AlwaysEditable").''; print ''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''; +print ''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''; if ($conf->multicompany->enabled) { print ''.$langs->trans("Entities").''; } @@ -88,6 +90,7 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel print ''.yn($extrafields->attributes[$elementtype]['required'][$key])."\n"; print ''.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."\n"; print ''.$extrafields->attributes[$elementtype]['list'][$key]."\n"; + print ''.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."\n"; if (! empty($conf->multicompany->enabled)) { print ''.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).''; } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index e59f50501ab..b506bda0793 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -40,6 +40,14 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey); print ''; if (! $i) $totalarray['nbfield']++; + + if ($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) { + if (! $i) { + // we keep position for the first line + $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; + } + $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; + } if (! empty($val['isameasure'])) { if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 56bbd897f3d..3e28ea3e4ef 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -152,9 +152,12 @@ class InterfaceTicketEmail extends DolibarrTriggers } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index eb932f76c51..d56134b7726 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -276,7 +276,7 @@ if (empty($reshook)) // We try to set an amount // Case we dont use the list of available qty for each warehouse/lot // GUI does not allow this yet - setEventMessage('StockIsRequiredToChooseWhichLotToUse', 'errors'); + setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse"), null, 'errors'); } } } @@ -2594,7 +2594,6 @@ else if ($id || $ref) include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 3f557059600..acc2b5e1142 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -268,6 +268,6 @@ if ($id > 0 || ! empty($ref)) } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 4f9616df5ed..5d76a5f4918 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -185,7 +185,6 @@ else{ exit; } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 042d107b58e..8dde7bf0125 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -291,6 +291,6 @@ else dol_print_error($db); print ''; - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 14f9eb41f44..327a9394b77 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -632,5 +632,6 @@ else dol_print_error($db); } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index fafaf10fe1f..f276b2d0cb4 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -152,7 +152,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index cb058e44598..0d3111d9f12 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -926,7 +926,6 @@ if ($id > 0 || ! empty($ref)) } } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 651be627b78..a167a447d7d 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -358,6 +358,6 @@ print ''; print '
'; print ''.$langs->trans("StatsOnShipmentsOnlyValidated").''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php index b7d217217c2..27b01cc6f55 100644 --- a/htdocs/expedition/stats/month.php +++ b/htdocs/expedition/stats/month.php @@ -71,6 +71,6 @@ print $px->show(); print ''; print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 141260d36f3..75285bf35cf 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1450,8 +1450,9 @@ else print $langs->trans('NotUserRightToView'); print ''; - llxFooter(); - $db->close(); + // End of page + llxFooter(); + $db->close(); exit; } diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index f0d61d0f80d..0ac498ca775 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -139,6 +139,6 @@ else print $langs->trans("ErrorUnknown"); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/export_csv.php b/htdocs/expensereport/export_csv.php index 4bc461b4d13..8ea72191b1d 100644 --- a/htdocs/expensereport/export_csv.php +++ b/htdocs/expensereport/export_csv.php @@ -195,6 +195,6 @@ if (isset($_POST['action'])) print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 0d988e4850d..758dd89afe2 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -231,6 +231,6 @@ else dol_print_error($db); print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/info.php b/htdocs/expensereport/info.php index 6babfcd647c..67f70f3a984 100644 --- a/htdocs/expensereport/info.php +++ b/htdocs/expensereport/info.php @@ -79,6 +79,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index d3e5bc6fabd..d328cd21de2 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -861,7 +861,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php index baa0c174fc1..deb38abe8d6 100644 --- a/htdocs/expensereport/note.php +++ b/htdocs/expensereport/note.php @@ -97,6 +97,6 @@ if ($id > 0 || ! empty($ref)) dol_fiche_end(); } - +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 2876d512c52..2c053d5cc35 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -310,6 +310,6 @@ if ($action == '') print ''; +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/expensereport/payment/info.php b/htdocs/expensereport/payment/info.php index 97098ef2340..6c7f8dd99c6 100644 --- a/htdocs/expensereport/payment/info.php +++ b/htdocs/expensereport/payment/info.php @@ -77,5 +77,6 @@ print ''; dol_fiche_end(); +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index 23959c06e67..dc78b933055 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -336,5 +336,6 @@ if ($action == 'create' || empty($action)) print "\n"; } +// End of page llxFooter(); $db->close(); diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index b4f0327cd39..b97129a5779 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -305,7 +305,6 @@ print '
'; dol_fiche_end(); - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index bccf25f1be8..81027882b6b 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -145,7 +145,6 @@ print ''; //print ''; - +// End of page llxFooter(); - $db->close(); diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 55236c86d44..d084f9be546 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -404,8 +404,7 @@ if ($action == 'create') { $var=true; while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; - print ""; + print ''; // Show product and description @@ -733,9 +732,7 @@ if ($action == 'create') { $num = count($object->lines); $i = 0; - $var=true; while ($i < $num) { - $var=!$var; // Show product and description if (isset($object->lines[$i]->product_type)) @@ -748,7 +745,7 @@ if ($action == 'create') { if (! empty($objp->date_end)) $type=1; // Show line - print ""; + print ''; print ''; $text = img_object($langs->trans('Service'), 'service'); print $text.' '.nl2br($object->lines[$i]->desc); @@ -879,12 +876,10 @@ if ($action == 'create') { // les filtres à faire ensuite if ($num > 0) { - $var=true; while ($i < min($num, $limit)) { $objp = $db->fetch_object($resql); - $var=!$var; - print ""; + print ''; print ''; print img_object($langs->trans("ShowIntervention"), "intervention").' '.$objp->titre; print "\n"; @@ -959,7 +954,7 @@ if ($action == 'create') { } } } else - print ''.$langs->trans("NoneF").''; + print ''.$langs->trans("NoneF").''; print ""; $db->free($resql); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e1670e0c4d0..bab095fe6fa 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2010-2015 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ion Agorria @@ -350,8 +350,10 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } else { - setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); + } + else + { + setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 971f99717f4..25f3118ad14 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -425,7 +425,7 @@ if (empty($reshook)) if (! $error) { $db->commit(); - setEventMessage($langs->trans('BillCreated', $nb_bills_created)); + setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index d409ba35b86..aefd04914ad 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1160,8 +1160,10 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } else { - setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors'); + } + else + { + setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } } diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 87ada98390b..be072b8bacb 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -1,7 +1,7 @@ -- -- Be carefull to requests order. -- This file must be loaded by calling /install/index.php page --- when current version is 8.0.0 or higher. +-- when current version is 9.0.0 or higher. -- -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y @@ -28,8 +28,8 @@ -- Note: fields with type BLOB/TEXT can't have default value. - ALTER TABLE llx_extrafields ADD COLUMN help text NULL; +ALTER TABLE llx_extrafields ADD COLUMN totalizable boolean DEFAULT FALSE after list; ALTER TABLE llx_user ADD COLUMN dateemploymentend date after dateemployment; @@ -49,3 +49,4 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention is deleted','Executed when a intervention is deleted','ficheinter',35); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',204); +ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after amount; diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql index 1a85fc28a5a..9f37383957a 100644 --- a/htdocs/install/mysql/tables/llx_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_extrafields.sql @@ -36,6 +36,7 @@ create table llx_extrafields alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status param text, -- extra parameters to define possible values of field list varchar(255) DEFAULT '1', -- visibility of field. 0=Never visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing + totalizable boolean DEFAULT FALSE, -- is extrafield totalizable on list langs varchar(64), -- example: fileofmymodule@mymodule help text, -- to store help tooltip fk_user_author integer, -- user making creation diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql index e3bcd0a9c4a..4fcbc233f33 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary.sql +++ b/htdocs/install/mysql/tables/llx_payment_salary.sql @@ -26,11 +26,12 @@ create table llx_payment_salary datev date, -- value date (this field should not be here, only into bank tables) salary double(24,8), -- salary of user when payment was done amount double(24,8) NOT NULL DEFAULT 0, + fk_projet integer DEFAULT NULL, fk_typepayment integer NOT NULL, num_payment varchar(50), -- ref label varchar(255), datesp date, -- date start period - dateep date, -- date end period + dateep date, -- date end period entity integer DEFAULT 1 NOT NULL, -- multi company id note text, fk_bank integer, diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 72725d3d634..8b47c46cef9 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -733,6 +733,8 @@ Result=Result ToTest=Test ValidateBefore=Card must be validated before using this feature Visibility=Visibility +Totalizable=Totalizable +TotalizableDesc=This field is totalizable in list Private=Private Hidden=Hidden Resources=Resources diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 058fdee0637..9ab397f190c 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -91,6 +91,7 @@ ListFichinterAssociatedProject=List of interventions associated with the project ListExpenseReportsAssociatedProject=List of expense reports associated with the project ListDonationsAssociatedProject=List of donations associated with the project ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project +ListSalariesAssociatedProject=List of salaries associated with the project ListActionsAssociatedProject=List of events associated with the project ListTaskTimeUserProject=List of time consumed on tasks of project ListTaskTimeForTask=List of time consumed on task diff --git a/htdocs/langs/en_US/salaries.lang b/htdocs/langs/en_US/salaries.lang index 1efb877673d..2ba84f19514 100644 --- a/htdocs/langs/en_US/salaries.lang +++ b/htdocs/langs/en_US/salaries.lang @@ -5,6 +5,7 @@ SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accounting account by default for wage paymen Salary=Salary Salaries=Salaries NewSalaryPayment=New salary payment +AddSalaryPayment=Add salary payment SalaryPayment=Salary payment SalariesPayments=Salaries payments ShowSalaryPayment=Show salary payment diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index cbf47bbcd21..9b32720a9a8 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -180,13 +180,13 @@ if ($action == 'specimen') // For products } else { - setEventMessage($obj->error,'errors'); + setEventMessages($obj->error, $obj->errors, 'errors'); dol_syslog($obj->error, LOG_ERR); } } else { - setEventMessage($langs->trans("ErrorModuleNotFound"),'errors'); + setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b01aa8bc3f1..adb127d67f8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -689,7 +689,7 @@ if (empty($reshook)) if (($result = $propal->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); - setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors'); + setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -732,7 +732,7 @@ if (empty($reshook)) if (($result = $commande->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); - setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors'); + setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { @@ -775,7 +775,7 @@ if (empty($reshook)) if (($result = $facture->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0) { dol_syslog($langs->trans('FailedToGetCostPrice')); - setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors'); + setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors'); } else { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 70e09114669..e68730acf64 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -6,7 +6,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2014 Florian Henry * Copyright (C) 2014-2016 Juanjo Menent - * Copyright (C) 2014-2015 Philippe Grand + * Copyright (C) 2014-2018 Philippe Grand * Copyright (C) 2014 Ion agorria * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García @@ -46,7 +46,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } // Load translation files required by the page -$langs->loadLangs(array('products', 'bills', 'companies')); +$langs->loadLangs(array('products', 'bills', 'companies', 'other')); $mesg=''; $error=0; $errors=array(); @@ -464,8 +464,10 @@ if (empty($reshook)) $sql .= " WHERE rowid = " . $rowid; $result = $db->query($sql); - } else { - setEventMessage('delete_price_by_qty Missing Ids','errors'); + } + else + { + setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); } } @@ -477,8 +479,10 @@ if (empty($reshook)) $sql .= " WHERE fk_product_price = " . $priceid; $result = $db->query($sql); - } else { - setEventMessage('delete_all_price_by_qty Missing Ids','errors'); + } + else + { + setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); } } diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 2e59e90a280..8ec07ca393c 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -135,7 +135,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer) // Update $pse->seuil_stock_alerte = $seuil_stock_alerte; $pse->desiredstock = $desiredstock; - if($pse->update($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseUpdated')); + if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs'); } else { @@ -144,7 +144,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer) $pse->fk_product = $id; $pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $pse->desiredstock = GETPOST('desiredstock'); - if($pse->create($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseCreated')); + if($pse->create($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseCreated'), null, 'mesgs'); } @@ -160,7 +160,7 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c $pse = new ProductStockEntrepot($db); $pse->fetch(GETPOST('fk_productstockwarehouse')); - if($pse->delete($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseDeleted')); + if($pse->delete($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseDeleted'), null, 'mesgs'); $action = ''; @@ -176,7 +176,7 @@ if ($action == 'setseuil_stock_alerte' && !empty($user->rights->produit->creer)) if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); //else - // setEventMessage($lans->trans("SavedRecordSuccessfully")); + // setEventMessages($lans->trans("SavedRecordSuccessfully"), null, 'mesgs'); $action=''; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 210ff9e09a9..e117dc3eb39 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -523,9 +523,10 @@ class Project extends CommonObject * @param string $datefieldname name of date field for filter * @param int $dates Start date * @param int $datee End date + * @param string $projectkey Equivalent key to fk_projet for actual type * @return mixed Array list of object ids linked to project, < 0 or string if error */ - function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='') + function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='', $projectkey='fk_projet') { $elements = array(); @@ -555,7 +556,7 @@ class Project extends CommonObject } else { - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE fk_projet IN (". $ids .")"; + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE ".$projectkey." IN (". $ids .")"; } if ($dates > 0) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 5070c0a58d4..79b2be5b009 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012-2016 Juanjo Menent - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Josep Lluís Amador * @@ -43,7 +43,7 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; +if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; if (! empty($conf->expensereport->enabled)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -52,17 +52,19 @@ if (! empty($conf->loan->enabled)) require_once DOL_DOCUMENT_ROOT.'/loan/class if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; +if (! empty($conf->salaries->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); -if (! empty($conf->facture->enabled)) $langs->load("bills"); -if (! empty($conf->commande->enabled)) $langs->load("orders"); -if (! empty($conf->propal->enabled)) $langs->load("propal"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); +if (! empty($conf->commande->enabled)) $langs->load("orders"); +if (! empty($conf->propal->enabled)) $langs->load("propal"); if (! empty($conf->ficheinter->enabled)) $langs->load("interventions"); if (! empty($conf->deplacement->enabled)) $langs->load("trips"); if (! empty($conf->expensereport->enabled)) $langs->load("trips"); if (! empty($conf->don->enabled)) $langs->load("donations"); if (! empty($conf->loan->enabled)) $langs->load("loan"); +if (! empty($conf->salaries->enabled)) $langs->load("salaries"); $id=GETPOST('id','int'); $ref=GETPOST('ref','alpha'); @@ -438,6 +440,19 @@ $listofreferent=array( 'datefieldname'=>'datem', 'disableamount'=>0, 'test'=>($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))), +'salaries'=>array( + 'name'=>"Salaries", + 'title'=>"ListSalariesAssociatedProject", + 'class'=>'PaymentSalary', + 'table'=>'payment_salary', + 'datefieldname'=>'datev', + 'margin'=>'minus', + 'disableamount'=>0, + 'urlnew'=>DOL_URL_ROOT.'/compta/salaries/card.php?action=create&projectid='.$id, + 'lang'=>'salaries', + 'buttonnew'=>'AddSalariesPayment', + 'testnew'=>$user->rights->salaries->write, + 'test'=>$conf->salaries->enabled && $user->rights->salaries->read), 'variouspayment'=>array( 'name'=>"VariousPayments", 'title'=>"ListVariousPaymentsAssociatedProject", @@ -560,11 +575,12 @@ foreach ($listofreferent as $key => $value) $datefieldname=$value['datefieldname']; $qualified=$value['test']; $margin = $value['margin']; + $project_field = $value['project_field']; if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus') { $element = new $classname($db); - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field)?$project_field:'fk_projet'); if (count($elementarray)>0 && is_array($elementarray)) { @@ -695,6 +711,7 @@ foreach ($listofreferent as $key => $value) $urlnew=$value['urlnew']; $buttonnew=$value['buttonnew']; $testnew=$value['testnew']; + $project_field=$value['project_field']; if ($qualified) { @@ -717,7 +734,7 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, array('payment_various'))) { - $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300'); + $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300',-2,!empty($project_field)?$project_field:'fk_projet'); if (! $selectList || ($selectList<0)) { setEventMessages($formproject->error,$formproject->errors,'errors'); @@ -768,7 +785,7 @@ foreach ($listofreferent as $key => $value) print ''; if (in_array($tablename, array('projet_task')) && $key == 'project_task') print ''; // if $key == 'project_task', we don't want details per user elseif (in_array($tablename, array('payment_various'))) print ''; // if $key == 'payment_various', we don't have any thirdparty - elseif (in_array($tablename, array('expensereport_det','don','projet_task','stock_mouvement'))) print $langs->trans("User"); + elseif (in_array($tablename, array('expensereport_det','don','projet_task','stock_mouvement','payment_salary'))) print $langs->trans("User"); else print $langs->trans("ThirdParty"); print ''; // Amount HT @@ -785,7 +802,7 @@ foreach ($listofreferent as $key => $value) else print ''.$langs->trans("Status").''; print ''; - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee,!empty($project_field)?$project_field:'fk_projet'); if (is_array($elementarray) && count($elementarray)>0) { $total_ht = 0; @@ -866,7 +883,7 @@ foreach ($listofreferent as $key => $value) } else { - // Show ref with link + // Show ref with link if ($element instanceof Task) { print $element->getNomUrl(1,'withproject','time'); @@ -901,6 +918,7 @@ foreach ($listofreferent as $key => $value) $date=''; $total_time_by_line = null; if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines elseif ($tablename == 'stock_mouvement') $date = $element->datem; + elseif ($tablename == 'payment_salary') $date = $element->datev; elseif ($tablename == 'payment_various') $date = $element->datev; elseif ($tablename == 'chargesociales') $date = $element->date_ech; elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status)) @@ -946,6 +964,12 @@ foreach ($listofreferent as $key => $value) $tmpuser->fetch($expensereport->fk_user_author); print $tmpuser->getNomUrl(1,'',48); } + else if ($tablename == 'payment_salary') + { + $tmpuser=new User($db); + $tmpuser->fetch($element->fk_user); + print $tmpuser->getNomUrl(1,'',48); + } else if ($tablename == 'don' || $tablename == 'stock_mouvement') { if ($element->fk_user_author > 0) @@ -967,7 +991,7 @@ foreach ($listofreferent as $key => $value) { $total_ht_by_line=null; $othermessage=''; - if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ht_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ht_by_line=$element->amount; else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty); elseif (in_array($tablename, array('projet_task'))) @@ -1008,7 +1032,7 @@ foreach ($listofreferent as $key => $value) if (empty($value['disableamount'])) { $total_ttc_by_line=null; - if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various') $total_ttc_by_line=$element->amount; + if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ttc_by_line=$element->amount; else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount(); elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty); elseif ($tablename == 'projet_task') diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 066471fddff..c3c4979a843 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -177,7 +177,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $action = "infos_success"; } else { $object->db->rollback(); - setEventMessage($object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action = 'create_ticket'; } @@ -226,9 +226,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error || $mailfile->errors) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { @@ -287,9 +290,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error || $mailfile->errors) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { @@ -308,10 +314,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $formmail->remove_attached_files($i); } - setEventMessage($langs->trans('YourTicketSuccessfullySaved')); + setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); } - } else { - setEventMessage($object->errors, 'errors'); + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index d8290849f55..fe1dacbbbc7 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -121,8 +121,9 @@ if ($action == "view_ticketlist") { } } - if ($error) { - setEventMessage($object->errors, 'errors'); + if ($error || $errors) + { + setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } } diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 5383133c42e..38fcb3c4991 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -112,8 +112,9 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | } } - if ($error) { - setEventMessage($object->errors, 'errors'); + if ($error || $errors) + { + setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } } diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index 981a07d7e73..e350c746c12 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007-2009 Laurent Destailleur * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2016 Gilles Poirier + * Copyright (C) 2016 Gilles Poirier * * This program is free software; you can redistribute it and/or modify @@ -47,7 +47,7 @@ $result = $object->fetch($id,$ref); /* - * Ajout d'un nouveau contact + * Add a new contact */ if ($action == 'addcontact' && $user->rights->resource->write) @@ -72,17 +72,17 @@ if ($action == 'addcontact' && $user->rights->resource->write) $mesg = $object->error; } - setEventMessage($mesg, 'errors'); + setEventMessages($mesg, null, 'errors'); } } -// bascule du statut d'un contact +// Toggle the status of a contact else if ($action == 'swapstatut' && $user->rights->resource->write) { $result=$object->swapContactStatus(GETPOST('ligne','int')); } -// Efface un contact +// Erase a contact else if ($action == 'deletecontact' && $user->rights->resource->write) { $result = $object->delete_contact(GETPOST('lineid','int')); diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index c61de994874..7aa22678d7a 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -54,4 +54,5 @@ else } \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); -\Stripe\Stripe::setAppInfo("Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setApiVersion("2018-07-27"); // force version API diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index bf561c15f83..1fde15c5b29 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1614,9 +1614,12 @@ class Ticket extends CommonObject } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { + if ($mailfile->error || $mailfile->errors) + { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } + else + { $result = $mailfile->sendfile(); if ($result > 0) { $nb_sent++; @@ -1627,7 +1630,7 @@ class Ticket extends CommonObject } } - setEventMessage($langs->trans('TicketNotificationNumberEmailSent', $nb_sent)); + setEventMessages($langs->trans('TicketNotificationNumberEmailSent', $nb_sent), null, 'mesgs'); } return $nb_sent; diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index dd4e60e4617..77e7f338e1a 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -231,38 +231,48 @@ class Users extends DolibarrApi * * @param int $id User ID * @param int $group Group ID + * @param int $entity Entity ID (valid only for superadmin in multicompany transverse mode) * @return int 1 if success * * @url GET {id}/setGroup/{group} */ - function setGroup($id, $group) { + function setGroup($id, $group, $entity = 1) { global $conf; //if (!DolibarrApiAccess::$user->rights->user->user->supprimer) { //throw new RestException(401); //} - $result = $this->useraccount->fetch($id); - if (!$result) - { - throw new RestException(404, 'User not found'); - } + $result = $this->useraccount->fetch($id); + if (!$result) + { + throw new RestException(404, 'User not found'); + } - if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) - { - throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); - } + if (!DolibarrApi::_checkAccessToResource('user', $this->useraccount->id, 'user')) + { + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); + } - // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to - // hack the security by giving himself permissions on another entity. - $result = $this->useraccount->SetInGroup($group, DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity); - if (! ($result > 0)) - { - throw new RestException(500, $this->useraccount->error); - } + if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && ! empty(DolibarrApiAccess::$user->admin) && empty(DolibarrApiAccess::$user->entity)) + { + $entity = (! empty($entity) ? $entity : $conf->entity); + } + else + { + // When using API, action is done on entity of logged user because a user of entity X with permission to create user should not be able to + // hack the security by giving himself permissions on another entity. + $entity = (DolibarrApiAccess::$user->entity > 0 ? DolibarrApiAccess::$user->entity : $conf->entity); + } - return 1; - } + $result = $this->useraccount->SetInGroup($group, $entity); + if (! ($result > 0)) + { + throw new RestException(500, $this->useraccount->error); + } + + return 1; + } /** * Delete account diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 307b8ae5bc9..e8914298ac3 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Abbes Bahfir * @@ -67,7 +67,7 @@ if ($action == 'add') if ($actionid <= 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), null, 'errors'); $error++; } diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index dc039bf6d5f..57db7c49f20 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -31,15 +31,15 @@ if ($_POST) { $value = GETPOST('PRODUIT_ATTRIBUTES_HIDECHILD'); if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_HIDECHILD', $value, 'chaine', 0, '', $conf->entity)) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SEPARATOR', GETPOST('PRODUIT_ATTRIBUTES_SEPARATOR'), 'chaine', 0, '', $conf->entity)) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } } diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 547a82d0f63..3addef7ddf9 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -50,9 +50,9 @@ if ($_POST) { $object->label = $label; if ($object->update($user) < 1) { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } else { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/card.php?id='.$id, 2)); exit(); } @@ -77,9 +77,9 @@ if ($_POST) { if (! $error) { if ($objectval->update($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } else { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessage($langs->trans('CoreErrorMessage'), null, 'errors'); } } } @@ -99,11 +99,11 @@ if ($confirm == 'yes') { if ($res < 1 || ($object->delete() < 1)) { $db->rollback(); - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); } else { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/list.php', 2)); } exit(); @@ -113,9 +113,9 @@ if ($confirm == 'yes') { if ($objectval->fetch($valueid) > 0) { if ($objectval->delete() < 1) { - setEventMessage($langs->trans('CoreErrorMessage'), 'errors'); + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } else { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index dbc413542c4..b741fef40bb 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -104,7 +104,7 @@ if ($_POST) { $features = $_SESSION['addvariant_'.$object->id]; if (!$features) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { @@ -147,7 +147,7 @@ if ($_POST) { $result = $prodcomb->createProductCombination($object, $sanit_features, array(), $price_impact_percent, $price_impact, $weight_impact); if ($result > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); unset($_SESSION['addvariant_'.$object->id]); $db->commit(); @@ -214,7 +214,7 @@ if ($_POST) { } else { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } } @@ -230,7 +230,7 @@ if ($_POST) { $prodcomb->variation_weight = $weight_impact; if ($prodcomb->update($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2)); exit(); } else { @@ -250,13 +250,13 @@ if ($action === 'confirm_deletecombination') { if ($prodcomb->delete($user) > 0 && $prodstatic->fetch($prodcomb->fk_product_child) > 0 && $prodstatic->delete($user) > 0) { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$object->id, 2)); exit(); } $db->rollback(); - setEventMessage($langs->trans('ProductCombinationAlreadyUsed'), 'errors'); + setEventMessages($langs->trans('ProductCombinationAlreadyUsed'), null, 'errors'); $action = ''; } } elseif ($action === 'edit') { @@ -284,12 +284,12 @@ if ($action === 'confirm_deletecombination') { header('Location: '.dol_buildpath('/variants/combinations.php?id='.$prodstatic->id, 2)); exit(); } else { - setEventMessage($langs->trans('ErrorCopyProductCombinations'), 'errors'); + setEventMessages($langs->trans('ErrorCopyProductCombinations'), null, 'errors'); } } } else { - setEventMessage($langs->trans('ErrorDestinationProductNotFound'), 'errors'); + setEventMessages($langs->trans('ErrorDestinationProductNotFound'), null, 'errors'); } } diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index f1a34a835b6..c4d775f3d50 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -29,7 +29,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); if ($_POST) { if (empty($ref) || empty($label)) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { $prodattr = new ProductAttribute($db); @@ -38,7 +38,7 @@ if ($_POST) { $resid = $prodattr->create($user); if ($resid > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); if ($backtopage) { header('Location: '.$backtopage); diff --git a/htdocs/variants/create_val.php b/htdocs/variants/create_val.php index b290182a042..f0dd8e9cb74 100644 --- a/htdocs/variants/create_val.php +++ b/htdocs/variants/create_val.php @@ -58,7 +58,7 @@ if ($cancel) if ($action == 'add') { if (empty($ref) || empty($value)) { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } else { $objectval->fk_product_attribute = $object->id; @@ -66,11 +66,11 @@ if ($action == 'add') $objectval->value = $value; if ($objectval->create($user) > 0) { - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$object->id); exit(); } else { - setEventMessage($langs->trans('ErrorCreatingProductAttributeValue'), 'errors'); + setEventMessages($langs->trans('ErrorCreatingProductAttributeValue'), null, 'errors'); } } } diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index 468b04ac392..c2883d577aa 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -115,18 +115,18 @@ if ($_POST) { if ($res > 0) { $db->commit(); - setEventMessage($langs->trans('RecordSaved')); + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2)); exit; } } else { - setEventMessage($langs->trans('ErrorDeletingGeneratedProducts'), 'errors'); + setEventMessages($langs->trans('ErrorDeletingGeneratedProducts'), null, 'errors'); } $db->rollback(); } else { - setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors'); + setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } }