diff --git a/ChangeLog b/ChangeLog index 777be335d62..57714680554 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,10 +4,12 @@ English Dolibarr ChangeLog ***** ChangeLog for 10.0.0 compared to 9.0.0 ***** For Users: -NEW: Module ticket is available as a stable module -NEW: Experimental module "Vendor receptions" +NEW: Module Ticket is available as a stable module. +NEW: Experimental module "Vendor receptions". +NEW: Experimental module "BOM". For Developers: +NEW: Module DebugBar is available as a stable module. WARNING: @@ -21,6 +23,7 @@ Following changes may create regressions for some external modules, but were nec * All methods set_draft() were renamed into setDraft(). * Removed deprecated function function test_sql_and_script_inject that was replaced with testSqlAndScriptInject. * Method load_measuring_units were renamed into selectMeasuringUnits and select_measuring_units was deprecated. +* Hidden option CHANGE_ORDER_CONCAT_DESCRIPTION were renamed into MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION ***** ChangeLog for 9.0.1 compared to 9.0.0 ***** diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index e0b8c6f70c2..089c156eb04 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -247,7 +247,7 @@ if ($resql) print ''; print ''; - $newcardbutton = '' . $langs->trans("Addanaccount").''; + $newcardbutton = '' . $langs->trans("Addanaccount").''; $newcardbutton.= ''; $newcardbutton.= ''; diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 795edda5f4c..16c5b508b1c 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -113,11 +113,11 @@ if ($result) if (! empty($user->rights->accounting->fiscalyear)) { - $addbutton = '' . $langs->trans("NewFiscalYear") .''; + $addbutton = '' . $langs->trans("NewFiscalYear") .''; } else { - $addbutton = '' . $langs->trans("NewFiscalYear") .''; + $addbutton = '' . $langs->trans("NewFiscalYear") .''; } $title = $langs->trans('AccountingPeriods'); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 790a71f96f4..207ea3464d8 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -451,7 +451,7 @@ $button.= ''; $groupby = ' ' . $langs->trans("GroupByAccountAccounting") . ''; -$newcardbutton = '' . $langs->trans("NewAccountingMvt").''; +$newcardbutton = ''.$langs->trans("NewAccountingMvt").''; $newcardbutton.= ''; $newcardbutton.= ''; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 8988491c927..38dc49c5bf6 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -257,7 +257,7 @@ if ($action == 'delbookkeepingyear') { print '
'; $viewflat = ' ' . $langs->trans("ViewFlatList") . ''; -$newcardbutton = '' . $langs->trans("NewAccountingMvt").''; +$newcardbutton = ''.$langs->trans("NewAccountingMvt").''; $newcardbutton.= ''; $newcardbutton.= ''; diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 3869afccf6d..f6c178f2e4d 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -151,7 +151,7 @@ if ($object->id > 0) $newcardbutton = ''; if (! empty($conf->agenda->enabled)) { - $newcardbutton.=''.$langs->trans("AddAction").''; + $newcardbutton.=''.$langs->trans("AddAction").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 1d16f82ec04..bafd24b0ff5 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -365,7 +365,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->adherent->creer) { - $newcardbutton=''.$langs->trans('NewMember').''; + $newcardbutton=''.$langs->trans('NewMember').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 3c4632f3a85..26293f8a4ac 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -247,7 +247,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->adherent->cotisation->creer) { - $newcardbutton=''.$langs->trans('NewSubscription').''; + $newcardbutton=''.$langs->trans('NewSubscription').''; $newcardbutton.= ''; $newcardbutton.= ''; } @@ -284,7 +284,7 @@ $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfiel if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); print '
'; -print ''."\n"; +print '
'."\n"; // Line for filters fields diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 18c0ba28348..72ea99ff18d 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -232,7 +232,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') $newcardbutton=''; if ($user->rights->adherent->configurer) { - $newcardbutton=''.$langs->trans('NewMemberType').''; + $newcardbutton=''.$langs->trans('NewMemberType').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 34cc06c5f08..b6002d1a4df 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2019 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2013 Juanjo Menent @@ -47,8 +47,9 @@ if ($action == 'set') { $db->begin(); - $result = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOST('DEBUGBAR_LOGS_LINES_NUMBER', 'int'), 'chaine', 0, '', 0); - if ($result < 0) + $result1 = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOST('DEBUGBAR_LOGS_LINES_NUMBER', 'int'), 'chaine', 0, '', 0); + $result2 = dolibarr_set_const($db, "DEBUGBAR_USE_LOG_FILE", GETPOST('DEBUGBAR_USE_LOG_FILE', 'int'), 'chaine', 0, '', 0); + if ($result1 < 0 || $result2 < 0) { $error++; } @@ -61,7 +62,7 @@ if ($action == 'set') else { $db->rollback(); - setEventMessages($error, $errors, 'errors'); + setEventMessages($error, null, 'errors'); } } @@ -96,6 +97,12 @@ print ''; +print ''; +print ''; + print '
'.$langs->trans("DEBUGBAR_USE_LOG_FILE").''; +print $form->selectyesno('DEBUGBAR_USE_LOG_FILE', $conf->global->DEBUGBAR_USE_LOG_FILE, 1); +print ' '.$langs->trans("UsingLogFileShowAllRecordOfSubrequestButIsSlower"); +print '
'; print "\n"; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index c2559e0e2bf..8e4334c6214 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -207,7 +207,7 @@ else print load_fiche_titre($langs->trans("DefaultValues"), $enabledisablehtml, 'title_setup'); -print $langs->trans("DefaultValuesDesc")."
\n"; +print ''.$langs->trans("DefaultValuesDesc")."
\n"; print "
\n"; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index e8dbc07654c..a5c167f08e8 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -321,7 +321,7 @@ print ''; $newcardbutton=''; //if ($user->rights->emailcollector->creer) //{ -$newcardbutton=''.$langs->trans('New').''; +$newcardbutton=''.$langs->trans('New').''; $newcardbutton.= ''; $newcardbutton.= ''; //} diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 612883dac38..0d6ac348413 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -217,7 +217,7 @@ $formadmin=new FormAdmin($db); print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup'); -print $langs->trans("DisplayDesc")."
\n"; +print ''.$langs->trans("DisplayDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index bce8c560d7c..62f5443d693 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -37,11 +37,11 @@ $hookmanager->initHooks(array('homesetup')); * View */ +$form = new Form($db); + $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('', $langs->trans("Setup"), $wikihelp); -$form = new Form($db); - print load_fiche_titre($langs->trans("SetupArea"), '', 'title_setup.png'); @@ -68,7 +68,7 @@ if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) } } -print $langs->trans("SetupDescription1").' '; +print $langs->trans("SetupDescription1"); print $langs->trans("AreaForAdminOnly").' '; print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."

"; @@ -115,7 +115,7 @@ print $hookmanager->resPrint; if (empty($reshook)) { // Show into other - print $langs->trans("SetupDescription5")."
"; + print ''.$langs->trans("SetupDescription5")."
"; print "
"; // Show logo diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 5283d9a3aca..310322aa44c 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -256,7 +256,7 @@ if ($action == 'delete') $newcardbutton=''; if ($user->admin) { - $newcardbutton=''.$langs->trans('New').''; + $newcardbutton=''.$langs->trans('New').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 3c9611ca7f0..0bbdf9eefdf 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -115,7 +115,7 @@ $arraydetailsforpdffoot = array( print load_fiche_titre($langs->trans("PDF"), '', 'title_setup'); -print $langs->trans("PDFDesc")."
\n"; +print ''.$langs->trans("PDFDesc")."
\n"; print "
\n"; $noCountryCode = (empty($mysoc->country_code) ? true : false); diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index cea8c4b5174..2a9983d95b1 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -224,14 +224,12 @@ else print load_fiche_titre($langs->trans("Translation"), $enabledisablehtml, 'title_setup'); -//print ''; -print $langs->trans("TranslationDesc")."
\n"; -//print '
'; -print "
\n"; +//print ''.$langs->trans("TranslationDesc")."
\n"; +//print "
\n"; $current_language_code=$langs->defaultlang; $s=picto_from_langcode($current_language_code); -print $langs->trans("CurrentUserLanguage").': '.$s.' '.$current_language_code.'
'; +print $form->textwithpicto($langs->trans("CurrentUserLanguage").': '.$s.' '.$current_language_code.'', $langs->trans("TranslationDesc")).'
'; print '
'; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index baa2ced0c4a..3b3b5ac9e15 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -316,13 +316,13 @@ print ''; $newcardbutton=''; //if ($user->rights->bom->creer) //{ - $newcardbutton=''.$langs->trans('New').''; + $newcardbutton=''.$langs->trans('New').''; $newcardbutton.= ''; $newcardbutton.= ''; //} //else //{ -// $newcardbutton=''.$langs->trans('New'); +// $newcardbutton=''.$langs->trans('New').''; // $newcardbutton.= ''; // $newcardbutton.= ''; //} diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index fba3e58baeb..17e23f0cadb 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -84,7 +84,7 @@ llxHeader('', $langs->trans("ListOfBookmarks")); $newcardbutton=''; if ($user->rights->bookmark->creer) { - $newcardbutton=''.$langs->trans('NewBookmark').''; + $newcardbutton=''.$langs->trans('NewBookmark').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index ce98dcbb6fc..971fcd30f0c 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -65,7 +65,7 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css') llxHeader('', $title, '', '', 0, 0, $arrayofjs, $arrayofcss); -$newcardbutton = ''.$langs->trans("NewCategory").''; +$newcardbutton = ''.$langs->trans("NewCategory").''; $newcardbutton.= ''; $newcardbutton.= ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index c6a4c3d225c..5654b3cb37f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -903,7 +903,7 @@ if ($action == 'create') $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:-1), $projectid, 'projectid', 0, 0, 1, 1); - print '   '.$langs->trans("AddProject").' '; + print '   '.$langs->trans("AddProject").''; $urloption='?action=create'; $url = dol_buildpath('comm/action/card.php', 2).$urloption; @@ -1301,7 +1301,7 @@ if ($id > 0) $numprojet=$formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0); if ($numprojet==0) { - print '   '.$langs->trans("AddProject").' '; + print '   '.$langs->trans("AddProject").''; } print ''; } diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index ded7d4fd238..9869248a760 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -435,7 +435,7 @@ if ($resql) //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; - $newcardbutton = ''.$langs->trans("AddAction").''; + $newcardbutton = ''.$langs->trans("AddAction").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 2ed25c9dd55..e5ade3fdf55 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -367,7 +367,7 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; - $newcardbutton = ''.$langs->trans("AddAction").''; + $newcardbutton = ''.$langs->trans("AddAction").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index c4ec266d454..384727d60b0 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -110,7 +110,7 @@ if (empty($reshook)) if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } - // conditions de reglement + // terms of the settlement if ($action == 'setconditions' && $user->rights->societe->creer) { $object->fetch($id); @@ -317,7 +317,7 @@ if ($object->id > 0) print $object->tva_intra; print ''; - // Conditions de reglement par defaut + // default terms of the settlement $langs->load('bills'); print ''; print ''; } print '' . "\n"; @@ -1677,7 +1678,7 @@ if ($action == 'create') print ''; print ''; print ''; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 0b3179bd239..2a1d1b5b577 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -438,7 +438,7 @@ if ($resql) $newcardbutton=''; if ($user->rights->propal->creer) { - $newcardbutton=''.$langs->trans('NewPropal').''; + $newcardbutton=''.$langs->trans('NewPropal').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php old mode 100644 new mode 100755 index f85870bd6f1..bdd17ad217f --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2018 Philippe Grand + * Copyright (C) 2011-2019 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012-2016 Marcos GarcĂ­a * Copyright (C) 2012 Cedric Salvador @@ -868,7 +868,8 @@ if (empty($reshook)) $desc = $prod->description; } - $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); + if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc; + else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { @@ -1636,7 +1637,7 @@ if ($action == 'create' && $user->rights->commande->creer) }); '; } - print ' '.$langs->trans("AddThirdParty").' '; + print ' '.$langs->trans("AddThirdParty").''; print ''; } print '' . "\n"; @@ -1674,7 +1675,7 @@ if ($action == 'create' && $user->rights->commande->creer) print $form->selectDate($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1); print ""; - // Conditions de reglement + // terms of the settlement print ''; @@ -1727,7 +1728,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; print ''; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c20abf44fe2..f42289c1c4b 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent @@ -441,7 +441,7 @@ if ($resql) $newcardbutton=''; if ($contextpage == 'orderlist' && $user->rights->commande->creer) { - $newcardbutton=''.$langs->trans('NewOrder').''; + $newcardbutton=''.$langs->trans('NewOrder').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 68354d1961f..1304c3ce75d 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -757,11 +757,11 @@ if ($resql) if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments { if ($user->rights->banque->modifier) { - $newcardbutton = ''.$langs->trans("AddBankRecord").''; + $newcardbutton = ''.$langs->trans("AddBankRecord").''; $newcardbutton.= ''; $newcardbutton.= ''; } else { - $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton = ''.$langs->trans("AddBankRecord").''; $newcardbutton.= ''; $newcardbutton.= ''; } @@ -769,11 +769,11 @@ if ($resql) else // If direct entries is not done using miscellaneous payments { if ($user->rights->banque->modifier) { - $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton = ''.$langs->trans("AddBankRecord").''; $newcardbutton.= ''; $newcardbutton.= ''; } else { - $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton = ''.$langs->trans("AddBankRecord").''; $newcardbutton.= ''; $newcardbutton.= ''; } @@ -781,7 +781,7 @@ if ($resql) } else { - $newcardbutton = ''.$langs->trans("AddBankRecord"); + $newcardbutton = ''.$langs->trans("AddBankRecord").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index b0a7f546297..8cc396f3bc1 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -227,7 +227,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->banque->configurer) { - $newcardbutton.=''.$langs->trans("NewFinancialAccount").''; + $newcardbutton.=''.$langs->trans("NewFinancialAccount").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index b3624e274f2..8be0b075e40 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -157,7 +157,7 @@ if ($result) $newcardbutton=''; if ($user->rights->banque->modifier) { - $newcardbutton=''.$langs->trans('MenuNewVariousPayment').''; + $newcardbutton=''.$langs->trans('MenuNewVariousPayment').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 89b66531eec..71be539f974 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -337,7 +337,7 @@ print ''; $newcardbutton=''; //if ($user->rights->monmodule->creer) //{ -$newcardbutton=''.$langs->trans('New').''; +$newcardbutton=''.$langs->trans('New').''; $newcardbutton.= ''; $newcardbutton.= ''; //} diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php old mode 100644 new mode 100755 index ce6a8610a1f..2f4116e938f --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1844,7 +1844,8 @@ if (empty($reshook)) $desc = $prod->description; } - $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); + if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc; + else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { @@ -2697,7 +2698,7 @@ if ($action == 'create') }); '; } - print ' '.$langs->trans("AddThirdParty").' '; + print ' '.$langs->trans("AddThirdParty").''; print ''; } print '' . "\n"; @@ -3093,7 +3094,7 @@ if ($action == 'create') $langs->load('projects'); print ''; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 39978cd82d1..749a0b28cfb 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -594,7 +594,7 @@ if ($resql) $newcardbutton=''; if($user->rights->facture->creer) { - $newcardbutton=''.$langs->trans('NewBill').''; + $newcardbutton=''.$langs->trans('NewBill').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index 8d02d8390dd..184c9600926 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -45,7 +45,7 @@ $localtax_static = new Localtax($db); $newcardbutton=''; if ($user->rights->tax->charges->creer) { - $newcardbutton=''.$langs->trans('NewLocalTaxPayment', ($ltt+1)).''; + $newcardbutton=''.$langs->trans('NewLocalTaxPayment', ($ltt+1)).''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 6e86ecf14b6..0107ba60383 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -138,7 +138,7 @@ if ($resql) $newcardbutton=''; if ($user->rights->banque->cheque) { - $newcardbutton = ''.$langs->trans('NewCheckDeposit').''; + $newcardbutton = ''.$langs->trans('NewCheckDeposit').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index fcd48a6a305..49f44af1702 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -108,7 +108,7 @@ if ($result) $newcardbutton=''; if ($user->rights->prelevement->bons->creer) { - $newcardbutton = ''.$langs->trans('NewStandingOrder').''; + $newcardbutton = ''.$langs->trans('NewStandingOrder').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/salaries/list.php b/htdocs/compta/salaries/list.php index e0fb1b38636..6ce49536d20 100644 --- a/htdocs/compta/salaries/list.php +++ b/htdocs/compta/salaries/list.php @@ -150,7 +150,7 @@ if ($result) $newcardbutton=''; if (! empty($user->rights->salaries->write)) { - $newcardbutton=''.$langs->trans('NewSalaryPayment').''; + $newcardbutton=''.$langs->trans('NewSalaryPayment').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 8a8cc1f61b8..f5e88c7fb29 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -152,7 +152,7 @@ if ($resql) $newcardbutton=''; if($user->rights->tax->charges->creer) { - $newcardbutton=''.$langs->trans('MenuNewSocialContribution'); + $newcardbutton=''.$langs->trans('MenuNewSocialContribution').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index e3539620351..e0775313dd3 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -47,36 +47,36 @@ $langs->loadLangs(array("other","compta","banks","bills","companies","product"," $year=GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); - $year_start = $year_current; + $year_current = strftime("%Y", dol_now()); + $year_start = $year_current; } else { - $year_current = $year; - $year_start = $year; + $year_current = $year; + $year_start = $year; } $date_start=dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); $date_end=dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); // Quarter if (empty($date_start) || empty($date_end)) // We define date_start and date_end { - $q=GETPOST("q"); - if (empty($q)) - { - if (GETPOST("month")) { $date_start=dol_get_first_day($year_start, GETPOST("month"), false); $date_end=dol_get_last_day($year_start, GETPOST("month"), false); } - else - { - $date_start=dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START, false); - if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1; - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; - } - } - else - { - if ($q==1) { $date_start=dol_get_first_day($year_start, 1, false); $date_end=dol_get_last_day($year_start, 3, false); } - if ($q==2) { $date_start=dol_get_first_day($year_start, 4, false); $date_end=dol_get_last_day($year_start, 6, false); } - if ($q==3) { $date_start=dol_get_first_day($year_start, 7, false); $date_end=dol_get_last_day($year_start, 9, false); } - if ($q==4) { $date_start=dol_get_first_day($year_start, 10, false); $date_end=dol_get_last_day($year_start, 12, false); } - } + $q=GETPOST("q"); + if (empty($q)) + { + if (GETPOST("month", 'int')) { $date_start=dol_get_first_day($year_start, GETPOST("month", 'int'), false); $date_end=dol_get_last_day($year_start, GETPOST("month", 'int'), false); } + else + { + $date_start=dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START, false); + if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; + } + } + else + { + if ($q==1) { $date_start=dol_get_first_day($year_start, 1, false); $date_end=dol_get_last_day($year_start, 3, false); } + if ($q==2) { $date_start=dol_get_first_day($year_start, 4, false); $date_end=dol_get_last_day($year_start, 6, false); } + if ($q==3) { $date_start=dol_get_first_day($year_start, 7, false); $date_end=dol_get_last_day($year_start, 9, false); } + if ($q==4) { $date_start=dol_get_first_day($year_start, 10, false); $date_end=dol_get_last_day($year_start, 12, false); } + } } $min = price2num(GETPOST("min", "alpha")); @@ -113,12 +113,12 @@ $morequerystring=''; $listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday'); foreach ($listofparams as $param) { - if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); + if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param); } $special_report = false; if (isset($_REQUEST['extra_report']) && $_REQUEST['extra_report'] == 1) { - $special_report = true; + $special_report = true; } llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring); @@ -141,7 +141,7 @@ $period=$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$f $prevyear=$year_start; $prevquarter=$q; if ($prevquarter > 1) { - $prevquarter--; + $prevquarter--; } else { $prevquarter=4; $prevyear--; @@ -149,7 +149,7 @@ if ($prevquarter > 1) { $nextyear=$year_start; $nextquarter=$q; if ($nextquarter < 4) { - $nextquarter++; + $nextquarter++; } else { $nextquarter=1; $nextyear++; @@ -161,7 +161,7 @@ if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->tra if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') $description.='
'.$langs->trans("RulesVATDueServices"); if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.='
'.$langs->trans("RulesVATInServices"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $description.='
'.$langs->trans("DepositsAreNotIncluded"); + $description.='
'.$langs->trans("DepositsAreNotIncluded"); } if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
'.$langs->trans("ThisIsAnEstimatedValue"); @@ -169,15 +169,15 @@ if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
'.$langs- $description.=$fsearch; if (! empty($conf->global->TAX_REPORT_EXTRA_REPORT)) { - $description.='
' - . ' ' - . $langs->trans('SimpleReport') - . '' - . '
' - . ' ' - . $langs->trans('AddExtraReport') - . '' - . '
'; + $description.='
' + . ' ' + . $langs->trans('SimpleReport') + . '' + . '
' + . ' ' + . $langs->trans('AddExtraReport') + . '' + . '
'; } $elementcust=$langs->trans("CustomersInvoices"); @@ -185,13 +185,13 @@ $productcust=$langs->trans("Description"); $namerate=$langs->trans("VATRate"); $amountcust=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; + $vatcust.=' ('.$langs->trans("ToPay").')'; } $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("Description"); $amountsup=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { - $vatsup.=' ('.$langs->trans("ToGetBack").')'; + $vatsup.=' ('.$langs->trans("ToGetBack").')'; } report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); @@ -214,546 +214,536 @@ $x_paye = tax_by_thirdparty('vat', $db, 0, $date_start, $date_end, $modetax, 'bu if (! is_array($x_coll) || ! is_array($x_paye)) { - $langs->load("errors"); - if ($x_coll == -1) { - print ''; - } elseif ($x_coll == -2) { - print ''; - } else { - print ''; - } + $langs->load("errors"); + if ($x_coll == -1) { + print ''; + } elseif ($x_coll == -2) { + print ''; + } else { + print ''; + } } else { - $x_both = array(); - //now, from these two arrays, get another array with one rate per line - foreach(array_keys($x_coll) as $my_coll_thirdpartyid) - { - $x_both[$my_coll_thirdpartyid]['coll']['totalht'] = $x_coll[$my_coll_thirdpartyid]['totalht']; - $x_both[$my_coll_thirdpartyid]['coll']['vat'] = $x_coll[$my_coll_thirdpartyid]['vat']; - $x_both[$my_coll_thirdpartyid]['paye']['totalht'] = 0; - $x_both[$my_coll_thirdpartyid]['paye']['vat'] = 0; - $x_both[$my_coll_thirdpartyid]['coll']['links'] = ''; - $x_both[$my_coll_thirdpartyid]['coll']['detail'] = array(); - foreach($x_coll[$my_coll_thirdpartyid]['facid'] as $id=>$dummy) { - $invoice_customer->id=$x_coll[$my_coll_thirdpartyid]['facid'][$id]; - $invoice_customer->ref=$x_coll[$my_coll_thirdpartyid]['facnum'][$id]; - $invoice_customer->type=$x_coll[$my_coll_thirdpartyid]['type'][$id]; - $company_static->fetch($x_coll[$my_coll_thirdpartyid]['company_id'][$id]); - $x_both[$my_coll_thirdpartyid]['coll']['detail'][] = array( - 'id' =>$x_coll[$my_coll_thirdpartyid]['facid'][$id], - 'descr' =>$x_coll[$my_coll_thirdpartyid]['descr'][$id], - 'pid' =>$x_coll[$my_coll_thirdpartyid]['pid'][$id], - 'pref' =>$x_coll[$my_coll_thirdpartyid]['pref'][$id], - 'ptype' =>$x_coll[$my_coll_thirdpartyid]['ptype'][$id], - 'payment_id'=>$x_coll[$my_coll_thirdpartyid]['payment_id'][$id], - 'payment_amount'=>$x_coll[$my_coll_thirdpartyid]['payment_amount'][$id], - 'ftotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['ftotal_ttc'][$id], - 'dtotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['dtotal_ttc'][$id], - 'dtype' =>$x_coll[$my_coll_thirdpartyid]['dtype'][$id], - 'drate' =>$x_coll[$my_coll_thirdpartyid]['drate'][$id], - 'datef' =>$x_coll[$my_coll_thirdpartyid]['datef'][$id], - 'datep' =>$x_coll[$my_coll_thirdpartyid]['datep'][$id], - 'company_link'=>$company_static->getNomUrl(1, '', 20), - 'ddate_start'=>$x_coll[$my_coll_thirdpartyid]['ddate_start'][$id], - 'ddate_end' =>$x_coll[$my_coll_thirdpartyid]['ddate_end'][$id], - 'totalht' =>$x_coll[$my_coll_thirdpartyid]['totalht_list'][$id], - 'vat' =>$x_coll[$my_coll_thirdpartyid]['vat_list'][$id], - 'link' =>$invoice_customer->getNomUrl(1, '', 12) - ); - } - } - // tva paid - foreach (array_keys($x_paye) as $my_paye_thirdpartyid) { - $x_both[$my_paye_thirdpartyid]['paye']['totalht'] = $x_paye[$my_paye_thirdpartyid]['totalht']; - $x_both[$my_paye_thirdpartyid]['paye']['vat'] = $x_paye[$my_paye_thirdpartyid]['vat']; - if (!isset($x_both[$my_paye_thirdpartyid]['coll']['totalht'])) { - $x_both[$my_paye_thirdpartyid]['coll']['totalht'] = 0; - $x_both[$my_paye_thirdpartyid]['coll']['vat'] = 0; - } - $x_both[$my_paye_thirdpartyid]['paye']['links'] = ''; - $x_both[$my_paye_thirdpartyid]['paye']['detail'] = array(); + $x_both = array(); + //now, from these two arrays, get another array with one rate per line + foreach(array_keys($x_coll) as $my_coll_thirdpartyid) + { + $x_both[$my_coll_thirdpartyid]['coll']['totalht'] = $x_coll[$my_coll_thirdpartyid]['totalht']; + $x_both[$my_coll_thirdpartyid]['coll']['vat'] = $x_coll[$my_coll_thirdpartyid]['vat']; + $x_both[$my_coll_thirdpartyid]['paye']['totalht'] = 0; + $x_both[$my_coll_thirdpartyid]['paye']['vat'] = 0; + $x_both[$my_coll_thirdpartyid]['coll']['links'] = ''; + $x_both[$my_coll_thirdpartyid]['coll']['detail'] = array(); + foreach($x_coll[$my_coll_thirdpartyid]['facid'] as $id=>$dummy) { + $invoice_customer->id=$x_coll[$my_coll_thirdpartyid]['facid'][$id]; + $invoice_customer->ref=$x_coll[$my_coll_thirdpartyid]['facnum'][$id]; + $invoice_customer->type=$x_coll[$my_coll_thirdpartyid]['type'][$id]; + $company_static->fetch($x_coll[$my_coll_thirdpartyid]['company_id'][$id]); + $x_both[$my_coll_thirdpartyid]['coll']['detail'][] = array( + 'id' =>$x_coll[$my_coll_thirdpartyid]['facid'][$id], + 'descr' =>$x_coll[$my_coll_thirdpartyid]['descr'][$id], + 'pid' =>$x_coll[$my_coll_thirdpartyid]['pid'][$id], + 'pref' =>$x_coll[$my_coll_thirdpartyid]['pref'][$id], + 'ptype' =>$x_coll[$my_coll_thirdpartyid]['ptype'][$id], + 'payment_id'=>$x_coll[$my_coll_thirdpartyid]['payment_id'][$id], + 'payment_amount'=>$x_coll[$my_coll_thirdpartyid]['payment_amount'][$id], + 'ftotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['ftotal_ttc'][$id], + 'dtotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['dtotal_ttc'][$id], + 'dtype' =>$x_coll[$my_coll_thirdpartyid]['dtype'][$id], + 'drate' =>$x_coll[$my_coll_thirdpartyid]['drate'][$id], + 'datef' =>$x_coll[$my_coll_thirdpartyid]['datef'][$id], + 'datep' =>$x_coll[$my_coll_thirdpartyid]['datep'][$id], + 'company_link'=>$company_static->getNomUrl(1, '', 20), + 'ddate_start'=>$x_coll[$my_coll_thirdpartyid]['ddate_start'][$id], + 'ddate_end' =>$x_coll[$my_coll_thirdpartyid]['ddate_end'][$id], + 'totalht' =>$x_coll[$my_coll_thirdpartyid]['totalht_list'][$id], + 'vat' =>$x_coll[$my_coll_thirdpartyid]['vat_list'][$id], + 'link' =>$invoice_customer->getNomUrl(1, '', 12) + ); + } + } + // tva paid + foreach (array_keys($x_paye) as $my_paye_thirdpartyid) { + $x_both[$my_paye_thirdpartyid]['paye']['totalht'] = $x_paye[$my_paye_thirdpartyid]['totalht']; + $x_both[$my_paye_thirdpartyid]['paye']['vat'] = $x_paye[$my_paye_thirdpartyid]['vat']; + if (!isset($x_both[$my_paye_thirdpartyid]['coll']['totalht'])) { + $x_both[$my_paye_thirdpartyid]['coll']['totalht'] = 0; + $x_both[$my_paye_thirdpartyid]['coll']['vat'] = 0; + } + $x_both[$my_paye_thirdpartyid]['paye']['links'] = ''; + $x_both[$my_paye_thirdpartyid]['paye']['detail'] = array(); - foreach ($x_paye[$my_paye_thirdpartyid]['facid'] as $id=>$dummy) - { - // ExpenseReport - if ($x_paye[$my_paye_thirdpartyid]['ptype'][$id] == 'ExpenseReportPayment') - { - $expensereport->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id]; - $expensereport->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id]; - $expensereport->type=$x_paye[$my_paye_thirdpartyid]['type'][$id]; + foreach ($x_paye[$my_paye_thirdpartyid]['facid'] as $id=>$dummy) + { + // ExpenseReport + if ($x_paye[$my_paye_thirdpartyid]['ptype'][$id] == 'ExpenseReportPayment') + { + $expensereport->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id]; + $expensereport->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id]; + $expensereport->type=$x_paye[$my_paye_thirdpartyid]['type'][$id]; - $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array( - 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id], - 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id], - 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id], - 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id], - 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id], - 'payment_id' =>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id], - 'payment_amount' =>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id], - 'ftotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]), - 'dtotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]), - 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id], - 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id], - 'ddate_start' =>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id], - 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id], - 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]), - 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id], - 'link' =>$expensereport->getNomUrl(1) - ); - } - else - { - $invoice_supplier->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id]; - $invoice_supplier->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id]; - $invoice_supplier->type=$x_paye[$my_paye_thirdpartyid]['type'][$id]; - $company_static->fetch($x_paye[$my_paye_thirdpartyid]['company_id'][$id]); - $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array( - 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id], - 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id], - 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id], - 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id], - 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id], - 'payment_id'=>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id], - 'payment_amount'=>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id], - 'ftotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]), - 'dtotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]), - 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id], - 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id], - 'datef' =>$x_paye[$my_paye_thirdpartyid]['datef'][$id], - 'datep' =>$x_paye[$my_paye_thirdpartyid]['datep'][$id], - 'company_link'=>$company_static->getNomUrl(1, '', 20), - 'ddate_start'=>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id], - 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id], - 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]), - 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id], - 'link' =>$invoice_supplier->getNomUrl(1, '', 12) - ); - } - } - } - //now we have an array (x_both) indexed by rates for coll and paye + $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id], + 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id], + 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id], + 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id], + 'payment_id' =>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id], + 'payment_amount' =>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id], + 'ftotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]), + 'dtotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id], + 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id], + 'ddate_start' =>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id], + 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id], + 'link' =>$expensereport->getNomUrl(1) + ); + } + else + { + $invoice_supplier->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id]; + $invoice_supplier->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id]; + $invoice_supplier->type=$x_paye[$my_paye_thirdpartyid]['type'][$id]; + $company_static->fetch($x_paye[$my_paye_thirdpartyid]['company_id'][$id]); + $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array( + 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id], + 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id], + 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id], + 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id], + 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id], + 'payment_id'=>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id], + 'payment_amount'=>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id], + 'ftotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]), + 'dtotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]), + 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id], + 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id], + 'datef' =>$x_paye[$my_paye_thirdpartyid]['datef'][$id], + 'datep' =>$x_paye[$my_paye_thirdpartyid]['datep'][$id], + 'company_link'=>$company_static->getNomUrl(1, '', 20), + 'ddate_start'=>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id], + 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id], + 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]), + 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id], + 'link' =>$invoice_supplier->getNomUrl(1, '', 12) + ); + } + } + } + //now we have an array (x_both) indexed by rates for coll and paye - //print table headers for this quadri - incomes first + //print table headers for this quadri - incomes first - $x_coll_sum = 0; - $x_coll_ht = 0; - $x_paye_sum = 0; - $x_paye_ht = 0; + $x_coll_sum = 0; + $x_coll_ht = 0; + $x_paye_sum = 0; + $x_paye_ht = 0; - $span=$columns; - if ($modetax != 1) $span+=2; + $span=$columns; + if ($modetax != 1) $span+=2; - //print ''; + //print ''; - // Customers invoices - print ''; - print ''; - print ''; - if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print ''; - else print ''; - print ''; - print ''; - if ($modetax != 1) - { - print ''; - print ''; - } - print ''; - print ''; - print ''; + // Customers invoices + print ''; + print ''; + print ''; + if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print ''; + else print ''; + print ''; + print ''; + if ($modetax != 1) + { + print ''; + print ''; + } + print ''; + print ''; + print ''; - $action = "tvadetail"; - $parameters["mode"] = $modetax; - $parameters["start"] = $date_start; - $parameters["end"] = $date_end; - $parameters["type"] = 'vat'; + $action = "tvadetail"; + $parameters["mode"] = $modetax; + $parameters["start"] = $date_start; + $parameters["end"] = $date_end; + $parameters["type"] = 'vat'; - $object = array(&$x_coll, &$x_paye, &$x_both); - // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array - $hookmanager->initHooks(array('externalbalance')); - $reshook=$hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + $object = array(&$x_coll, &$x_paye, &$x_both); + // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array + $hookmanager->initHooks(array('externalbalance')); + $reshook=$hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - foreach (array_keys($x_coll) as $thirdparty_id) { - $subtot_coll_total_ht = 0; - $subtot_coll_vat = 0; + foreach (array_keys($x_coll) as $thirdparty_id) { + $subtot_coll_total_ht = 0; + $subtot_coll_vat = 0; - if (is_array($x_both[$thirdparty_id]['coll']['detail'])) - { + if ($min == 0 || ($min > 0 && $x_both[$thirdparty_id]['coll']['totalht'] > $min)) + { + if (is_array($x_both[$thirdparty_id]['coll']['detail'])) + { + // VAT Rate + print ""; + print ''; + print '' . "\n"; - // VAT Rate - print ""; - print ''; - print ''."\n"; + foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) { + // Define type + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (!empty($fields['ddate_start'])) { + $type = 1; + } + if (!empty($fields['ddate_end'])) { + $type = 1; + } - foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) { - // Define type - // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. - $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (!empty($fields['ddate_start'])) { - $type=1; - } - if (!empty($fields['ddate_end'])) { - $type=1; - } + print ''; + + // Ref + print ''; + + // Invoice date + print ''; + + // Payment date + if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') { + print ''; + } else { + print ''; + } + + // Rate + print ''; + + // Description + print ''; + + // Total HT + if ($modetax != 1) { + print ''; + } + + // Payment + $ratiopaymentinvoice = 1; + if ($modetax != 1) { + print ''; + } + + // Total collected + print ''; + + // VAT + print ''; + print ''; + + $subtot_coll_total_ht += $temp_ht; + $subtot_coll_vat += $temp_vat; + $x_coll_sum += $temp_vat; + } + } + // Total customers for this vat rate + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; + } + } + + if (count($x_coll) == 0) // Show a total ine if nothing shown + { + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; + } + + // Blank line + print ''; + + // Print table headers for this quadri - expenses now + print ''; + print ''; + print ''; + if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print ''; + else print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''."\n"; + + foreach (array_keys($x_paye) as $thirdparty_id) + { + $subtot_paye_total_ht = 0; + $subtot_paye_vat = 0; + + if ($min == 0 || ($min > 0 && $x_both[$thirdparty_id]['paye']['totalht'] > $min)) { + + if (is_array($x_both[$thirdparty_id]['paye']['detail'])) { + print ""; + print ''; + print '' . "\n"; + + foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index => $fields) { + // Define type + // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. + $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']); + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (!empty($fields['ddate_start'])) { + $type = 1; + } + if (!empty($fields['ddate_end'])) { + $type = 1; + } - print ''; + print ''; - // Ref - print ''; + // Ref + print ''; - // Invoice date - print ''; + // Invoice date + print ''; - // Payment date - if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print ''; - else print ''; + // Payment date + if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') { + print ''; + } else { + print ''; + } - // Rate - print ''; + // Company name + print ''; - // Description - print ''; + // Show range + print_date_range($fields['ddate_start'], $fields['ddate_end']); + } + print ''; - // Total HT - if ($modetax != 1) - { - print ''; - } + // Total HT + if ($modetax != 1) { + print ''; + } - // Payment - $ratiopaymentinvoice=1; - if ($modetax != 1) - { - print ''; - } + // Payment + $ratiopaymentinvoice = 1; + if ($modetax != 1) + { + print ''; + if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice') + || ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice')) + { + print $langs->trans("NA"); + } + else + { + if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { + $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); + } + print price(price2num($fields['payment_amount'], 'MT')); + if (isset($fields['payment_amount'])) { + print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)'; + } + } + print ''; + } - // VAT - print ''; - print ''; + // VAT paid + print ''; - $subtot_coll_total_ht += $temp_ht; - $subtot_coll_vat += $temp_vat; - $x_coll_sum += $temp_vat; - } - } - // Total customers for this vat rate - print ''; - print ''; - print ''; - if ($modetax != 1) { - print ''; - print ''; - } - print ''; - print ''; - print ''; - } + // VAT + print ''; + print ''; - if (count($x_coll) == 0) // Show a total ine if nothing shown - { - print ''; - print ''; - print ''; - if ($modetax != 1) { - print ''; - print ''; - } - print ''; - print ''; - print ''; - } + $subtot_paye_total_ht += $temp_ht; + $subtot_paye_vat += $temp_vat; + $x_paye_sum += $temp_vat; + } + } + // Total suppliers for this vat rate + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; + } + } - // Blank line - print ''; + if (count($x_paye) == 0) { // Show a total line if nothing shown + print ''; + print ''; + print ''; + if ($modetax != 1) { + print ''; + print ''; + } + print ''; + print ''; + print ''; + } - // Print table headers for this quadri - expenses now - print ''; - print ''; - print ''; - if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print ''; - else print ''; - print ''; - print ''; - if ($modetax != 1) { - print ''; - print ''; - } - print ''; - print ''; - print ''."\n"; + print '
'; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 4e49b7bbbbd..54fdaef111b 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -156,7 +156,7 @@ if ($result) $newcardbutton=''; if ($user->rights->mailing->creer) { - $newcardbutton=''.$langs->trans('NewMailing').''; + $newcardbutton=''.$langs->trans('NewMailing').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 75fa9117230..4a0a9afce95 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1039,7 +1039,8 @@ if (empty($reshook)) $desc = $prod->description; } - $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); + if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc; + else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); // Add dimensions into product description /*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM)) @@ -1590,7 +1591,7 @@ if ($action == 'create') }); '; } - print ' '.$langs->trans("AddThirdParty").' '; + print ' '.$langs->trans("AddThirdParty").''; print '
' . $langs->trans("Project") . ''; $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id).'">' . $langs->trans("AddProject") . ' '; + print '   id).'">' . $langs->trans("AddProject") . ''; print '
' . $langs->trans('PaymentConditionsShort') . ''; $form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1); print '
' . $langs->trans("Project") . ''; $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0); - print '   id).'">' . $langs->trans("AddProject") . ' '; + print '   id).'">' . $langs->trans("AddProject") . ''; print '
' . $langs->trans('Project') . ''; $numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id.($fac_rec?'&fac_rec='.$fac_rec:'')).'">' . $langs->trans("AddProject") . ' '; + print '   id.($fac_rec?'&fac_rec='.$fac_rec:'')).'">' . $langs->trans("AddProject") . ''; print '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
'..')
'..')
'.$elementcust.''.$langs->trans("DateInvoice").''.$langs->trans("DatePayment").''.$namerate.''.$productcust.''.$amountcust.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'.$langs->trans("AmountHTVATRealReceived").''.$vatcust.'
'.$elementcust.''.$langs->trans("DateInvoice").''.$langs->trans("DatePayment").''.$namerate.''.$productcust.''.$amountcust.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'.$langs->trans("AmountHTVATRealReceived").''.$vatcust.'
'; + if (is_numeric($thirdparty_id)) { + $company_static->fetch($thirdparty_id); + print $langs->trans("ThirdParty") . ': ' . $company_static->getNomUrl(1); + } else { + $tmpid = preg_replace('/userid_/', '', $thirdparty_id); + $user_static->fetch($tmpid); + print $langs->trans("User") . ': ' . $user_static->getNomUrl(1); + } + print '
'; - if (is_numeric($thirdparty_id)) - { - $company_static->fetch($thirdparty_id); - print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1); - } - else - { - $tmpid = preg_replace('/userid_/', '', $thirdparty_id); - $user_static->fetch($tmpid); - print $langs->trans("User").': '.$user_static->getNomUrl(1); - } - print '
' . $fields['link'] . '' . dol_print_date($fields['datef'], 'day') . '' . dol_print_date($fields['datep'], 'day') . '' . $fields['drate'] . ''; + if ($fields['pid']) { + $product_static->id = $fields['pid']; + $product_static->ref = $fields['pref']; + $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered + print $product_static->getNomUrl(1); + if (dol_string_nohtmltag($fields['descr'])) { + print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); + } + } else { + if ($type) { + $text = img_object($langs->trans('Service'), 'service'); + } else { + $text = img_object($langs->trans('Product'), 'product'); + } + if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) { + if ($reg[1] == 'DEPOSIT') { + $fields['descr'] = $langs->transnoentitiesnoconv('Deposit'); + } elseif ($reg[1] == 'CREDIT_NOTE') { + $fields['descr'] = $langs->transnoentitiesnoconv('CreditNote'); + } else { + $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]); + } + } + print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); + + // Show range + print_date_range($fields['ddate_start'], $fields['ddate_end']); + } + print ''; + print price($fields['totalht']); + if (price2num($fields['ftotal_ttc'])) { + //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; + $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']); + //print ' ('.round($ratiolineinvoice*100,2).'%)'; + } + print ''; + //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc']; + if ($fields['payment_amount'] && $fields['ftotal_ttc']) { + $payment_static->id = $fields['payment_id']; + print $payment_static->getNomUrl(2); + } + if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') + || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) { + print $langs->trans("NA"); + } else { + if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { + $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); + } + print price(price2num($fields['payment_amount'], 'MT')); + if (isset($fields['payment_amount'])) { + print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)'; + } + } + print ''; + $temp_ht = $fields['totalht'] * $ratiopaymentinvoice; + print price(price2num($temp_ht, 'MT'), 1); + print ''; + $temp_vat = $fields['vat'] * $ratiopaymentinvoice; + print price(price2num($temp_vat, 'MT'), 1); + //print price($fields['vat']); + print '
' . $langs->trans("Total") . ':  ' . price(price2num($subtot_coll_total_ht, 'MT')) . '' . price(price2num($subtot_coll_vat, 'MT')) . '
'.$langs->trans("Total").':  '.price(price2num(0, 'MT')).''.price(price2num(0, 'MT')).'
 
'.$elementsup.''.$langs->trans("DateInvoice").''.$langs->trans("DatePayment").''.$namesup.''.$productsup.''.$amountsup.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'.$langs->trans("AmountHTVATRealPaid").''.$vatsup.'
'; + if (is_numeric($thirdparty_id)) { + $company_static->fetch($thirdparty_id); + print $langs->trans("ThirdParty") . ': ' . $company_static->getNomUrl(1); + } else { + $tmpid = preg_replace('/userid_/', '', $thirdparty_id); + $user_static->fetch($tmpid); + print $langs->trans("User") . ': ' . $user_static->getNomUrl(1); + } + print '
'.$fields['link'].'' . $fields['link'] . '' . dol_print_date($fields['datef'], 'day') . '' . dol_print_date($fields['datef'], 'day') . '' . dol_print_date($fields['datep'], 'day') . '' . dol_print_date($fields['datep'], 'day') . '' . $fields['drate'] . '' . $fields['company_link'] . ''; - if ($fields['pid']) - { - $product_static->id=$fields['pid']; - $product_static->ref=$fields['pref']; - $product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered - print $product_static->getNomUrl(1); - if (dol_string_nohtmltag($fields['descr'])) { - print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); - } - } - else - { - if ($type) { - $text = img_object($langs->trans('Service'), 'service'); - } else { - $text = img_object($langs->trans('Product'), 'product'); - } - if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) { - if ($reg[1]=='DEPOSIT') { - $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); - } elseif ($reg[1]=='CREDIT_NOTE') { - $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); - } else { - $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); - } - } - print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); + // Description + print ''; + if ($fields['pid']) { + $product_static->id = $fields['pid']; + $product_static->ref = $fields['pref']; + $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered + print $product_static->getNomUrl(1); + if (dol_string_nohtmltag($fields['descr'])) { + print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); + } + } else { + if ($type) { + $text = img_object($langs->trans('Service'), 'service'); + } else { + $text = img_object($langs->trans('Product'), 'product'); + } + if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) { + if ($reg[1] == 'DEPOSIT') { + $fields['descr'] = $langs->transnoentitiesnoconv('Deposit'); + } elseif ($reg[1] == 'CREDIT_NOTE') { + $fields['descr'] = $langs->transnoentitiesnoconv('CreditNote'); + } else { + $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]); + } + } + print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24); - // Show range - print_date_range($fields['ddate_start'], $fields['ddate_end']); - } - print ''; - print price($fields['totalht']); - if (price2num($fields['ftotal_ttc'])) - { - //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; - $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); - //print ' ('.round($ratiolineinvoice*100,2).'%)'; - } - print ''; + print price($fields['totalht']); + if (price2num($fields['ftotal_ttc'])) { + //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; + $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']); + //print ' ('.round($ratiolineinvoice*100,2).'%)'; + } + print ''; - //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc']; - if ($fields['payment_amount'] && $fields['ftotal_ttc']) - { - $payment_static->id=$fields['payment_id']; - print $payment_static->getNomUrl(2); - } - if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') - || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) - { - print $langs->trans("NA"); - } else { - if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) { - $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); - } - print price(price2num($fields['payment_amount'], 'MT')); - if (isset($fields['payment_amount'])) { - print ' ('.round($ratiopaymentinvoice*100, 2).'%)'; - } - } - print ''; + if ($fields['payment_amount'] && $fields['ftotal_ttc']) + { + $paymentfourn_static->id = $fields['payment_id']; + print $paymentfourn_static->getNomUrl(2); + } - // Total collected - print ''; - $temp_ht=$fields['totalht']*$ratiopaymentinvoice; - print price(price2num($temp_ht, 'MT'), 1); - print ''; - $temp_vat=$fields['vat']*$ratiopaymentinvoice; - print price(price2num($temp_vat, 'MT'), 1); - //print price($fields['vat']); - print '
'; + $temp_ht = $fields['totalht'] * $ratiopaymentinvoice; + print price(price2num($temp_ht, 'MT'), 1); + print '
'.$langs->trans("Total").':  '.price(price2num($subtot_coll_total_ht, 'MT')).''.price(price2num($subtot_coll_vat, 'MT')).'
'; + $temp_vat = $fields['vat'] * $ratiopaymentinvoice; + print price(price2num($temp_vat, 'MT'), 1); + //print price($fields['vat']); + print '
'.$langs->trans("Total").':  '.price(price2num(0, 'MT')).''.price(price2num(0, 'MT')).'
' . $langs->trans("Total") . ':  ' . price(price2num($subtot_paye_total_ht, 'MT')) . '' . price(price2num($subtot_paye_vat, 'MT')) . '
 
'.$langs->trans("Total").':  '.price(price2num(0, 'MT')).''.price(price2num(0, 'MT')).'
'.$elementsup.''.$langs->trans("DateInvoice").''.$langs->trans("DatePayment").''.$namesup.''.$productsup.''.$amountsup.''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'.$langs->trans("AmountHTVATRealPaid").''.$vatsup.'
'; - foreach (array_keys($x_paye) as $thirdparty_id) - { - $subtot_paye_total_ht = 0; - $subtot_paye_vat = 0; + // Total to pay + print '

'; + print ''; + $diff = $x_coll_sum - $x_paye_sum; + print ''; + print ''; + print '\n"; + print "\n"; - if (is_array($x_both[$thirdparty_id]['paye']['detail'])) - { - print ""; - print ''; - print ''."\n"; - - foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index=>$fields) { - // Define type - // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown. - $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']); - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (!empty($fields['ddate_start'])) { - $type=1; - } - if (!empty($fields['ddate_end'])) { - $type=1; - } - - - print ''; - - // Ref - print ''; - - // Invoice date - print ''; - - // Payment date - if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print ''; - else print ''; - - // Company name - print ''; - - // Description - print ''; - - // Total HT - if ($modetax != 1) - { - print ''; - } - - // Payment - $ratiopaymentinvoice=1; - if ($modetax != 1) - { - print ''; - } - - // VAT paid - print ''; - - // VAT - print ''; - print ''; - - $subtot_paye_total_ht += $temp_ht; - $subtot_paye_vat += $temp_vat; - $x_paye_sum += $temp_vat; - } - } - // Total suppliers for this vat rate - print ''; - print ''; - print ''; - if ($modetax != 1) { - print ''; - print ''; - } - print ''; - print ''; - print ''; - } - - if (count($x_paye) == 0) { // Show a total line if nothing shown - print ''; - print ''; - print ''; - if ($modetax != 1) { - print ''; - print ''; - } - print ''; - print ''; - print ''; - } - - print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff, 'MT'))."
'; - if (is_numeric($thirdparty_id)) - { - $company_static->fetch($thirdparty_id); - print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1); - } - else - { - $tmpid = preg_replace('/userid_/', '', $thirdparty_id); - $user_static->fetch($tmpid); - print $langs->trans("User").': '.$user_static->getNomUrl(1); - } - print '
'.$fields['link'].'' . dol_print_date($fields['datef'], 'day') . '' . dol_print_date($fields['datep'], 'day') . '' . $fields['company_link'] . ''; - if ($fields['pid']) - { - $product_static->id=$fields['pid']; - $product_static->ref=$fields['pref']; - $product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered - print $product_static->getNomUrl(1); - if (dol_string_nohtmltag($fields['descr'])) { - print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); - } - } - else - { - if ($type) { - $text = img_object($langs->trans('Service'), 'service'); - } else { - $text = img_object($langs->trans('Product'), 'product'); - } - if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) { - if ($reg[1]=='DEPOSIT') { - $fields['descr']=$langs->transnoentitiesnoconv('Deposit'); - } elseif ($reg[1]=='CREDIT_NOTE') { - $fields['descr']=$langs->transnoentitiesnoconv('CreditNote'); - } else { - $fields['descr']=$langs->transnoentitiesnoconv($reg[1]); - } - } - print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); - - // Show range - print_date_range($fields['ddate_start'], $fields['ddate_end']); - } - print ''; - print price($fields['totalht']); - if (price2num($fields['ftotal_ttc'])) - { - //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - "; - $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']); - //print ' ('.round($ratiolineinvoice*100,2).'%)'; - } - print ''; - if ($fields['payment_amount'] && $fields['ftotal_ttc']) - { - $paymentfourn_static->id=$fields['payment_id']; - print $paymentfourn_static->getNomUrl(2); - } - - if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice') - || ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice')) - { - print $langs->trans("NA"); - } - else - { - if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { - $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']); - } - print price(price2num($fields['payment_amount'], 'MT')); - if (isset($fields['payment_amount'])) { - print ' ('.round($ratiopaymentinvoice*100, 2).'%)'; - } - } - print ''; - $temp_ht=$fields['totalht']*$ratiopaymentinvoice; - print price(price2num($temp_ht, 'MT'), 1); - print ''; - $temp_vat=$fields['vat']*$ratiopaymentinvoice; - print price(price2num($temp_vat, 'MT'), 1); - //print price($fields['vat']); - print '
'.$langs->trans("Total").':  '.price(price2num($subtot_paye_total_ht, 'MT')).''.price(price2num($subtot_paye_vat, 'MT')).'
'.$langs->trans("Total").':  '.price(price2num(0, 'MT')).''.price(price2num(0, 'MT')).'
'; - - // Total to pay - print '

'; - print ''; - $diff = $x_coll_sum - $x_paye_sum; - print ''; - print ''; - print '\n"; - print "\n"; - - $i++; + $i++; } print '
'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''.price(price2num($diff, 'MT'))."
'; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 6d5f5ffbc13..061008f42a8 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -150,7 +150,7 @@ if ($result) $newcardbutton=''; if ($user->rights->tax->charges->creer) { - $newcardbutton=''.$langs->trans('NewVATPayment'); + $newcardbutton=''.$langs->trans('NewVATPayment').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index cf2c198d36e..5b9e84f2d16 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -261,7 +261,7 @@ else { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) { - $newcardbutton.=''.$langs->trans("AddAction").''; + $newcardbutton.=''.$langs->trans("AddAction").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 4419c087a3c..a5fe555151f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -453,7 +453,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->societe->contact->creer) { - $newcardbutton=''.$langs->trans('NewContactAddress').''; + $newcardbutton=''.$langs->trans('NewContactAddress').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 1b638849538..c61e2e6177a 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -540,7 +540,7 @@ if (empty($reshook)) } $desc=$prod->description; - $desc=dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); + $desc=dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); $fk_unit = $prod->fk_unit; } else @@ -1212,7 +1212,7 @@ if ($action == 'create') { print ''; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); - print ' '.$langs->trans("AddThirdParty").' '; + print ' '.$langs->trans("AddThirdParty").''; print ''; } print ''."\n"; @@ -1254,7 +1254,7 @@ if ($action == 'create') print ''.$langs->trans("Project").''; $formproject->select_projects(($soc->id>0?$soc->id:-1), $projectid, "projectid", 0, 0, 1, 1); - print '   id).'">' . $langs->trans("AddProject") . ' '; + print '   id).'">' . $langs->trans("AddProject") . ''; print ""; } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index d27460e4b6a..22e30466300 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 CĂ©dric Salvador * Copyright (C) 2014 Juanjo Menent @@ -25,7 +25,7 @@ /** * \file htdocs/contrat/list.php * \ingroup contrat - * \brief Page liste des contrats + * \brief Page to list contracts */ require '../main.inc.php'; @@ -375,7 +375,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->contrat->creer) { - $newcardbutton=''.$langs->trans('NewContractSubscription').''; + $newcardbutton=''.$langs->trans('NewContractSubscription').''; $newcardbutton.= ''; $newcardbutton.= ''; } @@ -549,11 +549,11 @@ if (! empty($arrayfields['lower_planned_end_date']['checked'])) { print ''; $arrayofoperators=array('0'=>'','='=>'=','<='=>'<=','>='=>'>='); - print $form->selectarray('search_op2df', $arrayofoperators, $search_op2df, 0); + print $form->selectarray('search_op2df', $arrayofoperators, $search_op2df, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth50imp'); print '
'; - print $formother->select_month($search_dfmonth, 'search_dfmonth', 1, 0, 'valignmiddle'); + print $formother->select_month($search_dfmonth, 'search_dfmonth', 1, 0); print ' '; - $formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5, 0, 0, '', 'valignmiddle'); + $formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5, 0, 0, ''); print ''; } // Status @@ -568,18 +568,18 @@ print ''; print "\n"; print ''; -if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", "$param", '', $sortfield, $sortorder); -if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer", "", "$param", '', $sortfield, $sortorder); -if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier", "", "$param", '', $sortfield, $sortorder); -if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", "$param", '', $sortfield, $sortorder); -if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", "$param", '', $sortfield, $sortorder); +if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer", "", $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier", "", $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", $param, '', $sortfield, $sortorder); if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); -if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder); -if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat", "", "$param", '', $sortfield, $sortorder, 'center '); +if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder); +if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat", "", $param, '', $sortfield, $sortorder, 'center '); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 03eab8be202..bddf190b62c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -616,6 +616,12 @@ if ($massaction == 'confirm_createbills') // Create bills from orders for ($i=0;$i<$num;$i++) { $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); + // If we build one invoice for several order, we must put the invoice of order on the line + if (! empty($createbills_onebythird)) + { + $desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs)); + } + if ($lines[$i]->subprice < 0) { // Negative line, we create a discount line diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 6e939a6278c..9dd49ea8864 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -598,6 +598,7 @@ abstract class CommonInvoice extends CommonObject // 2 : application de la règle, le N du mois courant ou suivant elseif ($cdr_type == 2 && !empty($cdr_decalage)) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $datelim = $this->date + ($cdr_nbjour * 3600 * 24); $date_piece = dol_mktime(0, 0, 0, date('m', $datelim), date('d', $datelim), date('Y', $datelim)); // Sans les heures minutes et secondes diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f7b0edaa0f1..32238ea4ef8 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1653,7 +1653,7 @@ class ExtraFields } elseif ($type == 'phone') { - $value=dol_print_phone($value, '', 0, 0, '', ' ', 1); + $value=dol_print_phone($value, '', 0, 0, '', ' ', 'phone'); } elseif ($type == 'price') { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9905cd1252a..2fb79ca56f2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6610,7 +6610,11 @@ class Form // Can complete the possiblelink array $hookmanager->initHooks(array('commonobject')); $parameters=array('listofidcompanytoscan' => $listofidcompanytoscan); - $reshook=$hookmanager->executeHooks('showLinkToObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + + if (! empty($listofidcompanytoscan)) // If empty, we don't have criteria to scan the object we can link to + { + $reshook=$hookmanager->executeHooks('showLinkToObjectBlock', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + } if (empty($reshook)) { diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 6afe7552187..c9c1bc3d782 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -205,7 +205,7 @@ class FormActions $newcardbutton=''; if (! empty($conf->agenda->enabled)) { - $newcardbutton = ''.$langs->trans("AddEvent").''; + $newcardbutton = ''.$langs->trans("AddEvent").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 5f6958ae206..10a91c3fb07 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1044,7 +1044,7 @@ class FormFile * @param int $disablemove 1=Disable move button, 0=Position move is possible. * @param int $addfilterfields Add line with filters * @return int <0 if KO, nb of files shown if OK - * @see list_of_autoecmfiles + * @see list_of_autoecmfiles() */ public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0) { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 1bb59077bec..922e25f7ecf 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -848,7 +848,7 @@ class FormOther * @param string $morecss More Css * @return string */ - public function select_month($selected = '', $htmlname = 'monthid', $useempty = 0, $longlabel = 0, $morecss = '') + public function select_month($selected = '', $htmlname = 'monthid', $useempty = 0, $longlabel = 0, $morecss = 'maxwidth50imp valignmiddle') { // phpcs:enable global $langs; @@ -895,7 +895,7 @@ class FormOther * @param string $morecss More CSS * @return string */ - public function select_year($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle widthauto') + public function select_year($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle maxwidth75imp') { // phpcs:enable print $this->selectyear($selected, $htmlname, $useempty, $min_year, $max_year, $offset, $invert, $option, $morecss); @@ -915,7 +915,7 @@ class FormOther * @param string $morecss More css * @return string */ - public function selectyear($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle widthauto') + public function selectyear($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle maxwidth75imp') { $out=''; diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 1e596209cdb..0c16deab43b 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -572,12 +572,13 @@ class Utils */ public function generateDoc($module) { - global $conf, $langs, $user; + global $conf, $langs, $user, $mysoc; global $dirins; $error = 0; $modulelowercase=strtolower($module); + $now=dol_now(); // Dir for module $dir = $dirins.'/'.$modulelowercase; @@ -688,16 +689,16 @@ class Utils //var_dump($phpfileval['fullname']); $arrayreplacement=array( - 'mymodule'=>strtolower($modulename), - 'MyModule'=>$modulename, - 'MYMODULE'=>strtoupper($modulename), - 'My module'=>$modulename, - 'my module'=>$modulename, - 'Mon module'=>$modulename, - 'mon module'=>$modulename, - 'htdocs/modulebuilder/template'=>strtolower($modulename), + 'mymodule'=>strtolower($module), + 'MyModule'=>$module, + 'MYMODULE'=>strtoupper($module), + 'My module'=>$module, + 'my module'=>$module, + 'Mon module'=>$module, + 'mon module'=>$module, + 'htdocs/modulebuilder/template'=>strtolower($module), '__MYCOMPANY_NAME__'=>$mysoc->name, - '__KEYWORDS__'=>$modulename, + '__KEYWORDS__'=>$module, '__USER_FULLNAME__'=>$user->getFullName($langs), '__USER_EMAIL__'=>$user->email, '__YYYY-MM-DD__'=>dol_print_date($now, 'dayrfc'), diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 4c95098813d..efffd5059c6 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -161,7 +161,7 @@ class DoliDBMssql extends DoliDB * @param string $name name of database (not used for mysql, used for pgsql) * @param int $port Port of database server * @return false|resource|true Database access handler - * @see close + * @see close() */ public function connect($host, $login, $passwd, $name, $port = 0) { @@ -216,7 +216,7 @@ class DoliDBMssql extends DoliDB * Close database connexion * * @return bool True if disconnect successfull, false otherwise - * @see connect + * @see connect() */ public function close() { @@ -511,7 +511,7 @@ class DoliDBMssql extends DoliDB * * @param resource $resultset Resulset of requests * @return int Nb of lines - * @see affected_rows + * @see affected_rows() */ public function num_rows($resultset) { @@ -527,7 +527,7 @@ class DoliDBMssql extends DoliDB * * @param resource $resultset Curseur de la requete voulue * @return int Nombre de lignes - * @see num_rows + * @see num_rows() */ public function affected_rows($resultset) { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 54ad9b2066b..6b546f5dfc3 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -191,7 +191,7 @@ class DoliDBMysqli extends DoliDB * @param string $name name of database (not used for mysql, used for pgsql) * @param integer $port Port of database server * @return mysqli Database access object - * @see close + * @see close() */ public function connect($host, $login, $passwd, $name, $port = 0) { @@ -228,7 +228,7 @@ class DoliDBMysqli extends DoliDB * Close database connexion * * @return bool True if disconnect successfull, false otherwise - * @see connect + * @see connect() */ public function close() { @@ -280,6 +280,7 @@ class DoliDBMysqli extends DoliDB if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR); + //var_dump(debug_print_backtrace()); } $this->lastquery=$query; $this->_results = $ret; @@ -324,7 +325,7 @@ class DoliDBMysqli extends DoliDB * Return datas as an array * * @param mysqli_result $resultset Resultset of request - * @return array|null|0 Array or null if KO or end of cursor or 0 if resultset is bool + * @return array|null|int Array or null if KO or end of cursor or 0 if resultset is bool */ public function fetch_row($resultset) { @@ -348,7 +349,7 @@ class DoliDBMysqli extends DoliDB * * @param mysqli_result $resultset Resulset of requests * @return int Nb of lines - * @see affected_rows + * @see affected_rows() */ public function num_rows($resultset) { @@ -364,7 +365,7 @@ class DoliDBMysqli extends DoliDB * * @param mysqli_result $resultset Curseur de la requete voulue * @return int Nombre de lignes - * @see num_rows + * @see num_rows() */ public function affected_rows($resultset) { @@ -952,7 +953,7 @@ class DoliDBMysqli extends DoliDB * Note: if we are connected to databasename, it is same result than using SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "databasename";) * * @return string Charset - * @see getDefaultCollationDatabase + * @see getDefaultCollationDatabase() */ public function getDefaultCharacterSetDatabase() { @@ -998,7 +999,7 @@ class DoliDBMysqli extends DoliDB * Return collation used in current database * * @return string Collation value - * @see getDefaultCharacterSetDatabase + * @see getDefaultCharacterSetDatabase() */ public function getDefaultCollationDatabase() { diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 42d419bd7d1..2777f2d0365 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -396,7 +396,7 @@ class DoliDBPgsql extends DoliDB * @param string $name Name of database (not used for mysql, used for pgsql) * @param integer $port Port of database server * @return false|resource Database access handler - * @see close + * @see close() */ public function connect($host, $login, $passwd, $name, $port = 0) { @@ -471,7 +471,7 @@ class DoliDBPgsql extends DoliDB * Close database connexion * * @return boolean True if disconnect successfull, false otherwise - * @see connect + * @see connect() */ public function close() { @@ -605,7 +605,7 @@ class DoliDBPgsql extends DoliDB * * @param resourse $resultset Resulset of requests * @return int Nb of lines, -1 on error - * @see affected_rows + * @see affected_rows() */ public function num_rows($resultset) { diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 5ed0a05ee2a..b7d06870ff5 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -321,7 +321,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $name name of database (not used for mysql, used for pgsql) * @param integer $port Port of database server * @return SQLite3 Database access handler - * @see close + * @see close() */ public function connect($host, $login, $passwd, $name, $port = 0) { @@ -377,7 +377,7 @@ class DoliDBSqlite3 extends DoliDB * Close database connexion * * @return bool True if disconnect successfull, false otherwise - * @see connect + * @see connect() */ public function close() { @@ -557,7 +557,7 @@ class DoliDBSqlite3 extends DoliDB * * @param SQLite3Result $resultset Resulset of requests * @return int Nb of lines - * @see affected_rows + * @see affected_rows() */ public function num_rows($resultset) { @@ -578,7 +578,7 @@ class DoliDBSqlite3 extends DoliDB * * @param SQLite3Result $resultset Resulset of requests * @return int Nb of lines - * @see affected_rows + * @see affected_rows() */ public function affected_rows($resultset) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 32ee83ae027..d6fe993aa2d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -730,7 +730,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $newcardbutton=''; if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { - $newcardbutton=''.$langs->trans("AddProject").''; + $newcardbutton=''.$langs->trans("AddProject").''; $newcardbutton.= ''; $newcardbutton.= ''; } @@ -934,7 +934,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if ($user->rights->societe->contact->creer) { $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); - $newcardbutton=''.$addcontact.''; + $newcardbutton=''.$addcontact.''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b2c7edf4590..d3a3ab08671 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1823,24 +1823,27 @@ function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded') * @param string $fileinput Input file name * @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided). * @param string $fileoutput Output filename + * @param string $page Page number if we convert a PDF into png * @return int <0 if KO, 0=Nothing done, >0 if OK */ -function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '') +function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '') { global $langs; - if (class_exists('Imagick')) { - $image=new Imagick(); + $image=new Imagick(); try { - $ret = $image->readImage($fileinput); + $filetoconvert=$fileinput.(($page != '')?'['.$page.']':''); + //var_dump($filetoconvert); + $ret = $image->readImage($filetoconvert); } catch(Exception $e) { - dol_syslog("Failed to read image using Imagick. Try to install package 'apt-get install ghostscript'.", LOG_WARNING); + $ext = pathinfo($fileinput, PATHINFO_EXTENSION); + dol_syslog("Failed to read image using Imagick (Try to install package 'apt-get install php-imagick ghostscript' and check there is no policy to disable ".$ext." convertion in /etc/ImageMagick*/policy.xml): ".$e->getMessage(), LOG_WARNING); return 0; } if ($ret) { - $ret = $image->setImageFormat($ext); + $ret = $image->setImageFormat($ext); if ($ret) { if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9160cf57933..f1c67429d95 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -982,7 +982,7 @@ function dol_strtoupper($utf8_string) */ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = '', $restricttologhandler = '') { - global $conf, $user; + global $conf, $user, $debugbar; // If syslog module enabled if (empty($conf->syslog->enabled)) return; @@ -998,8 +998,8 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = if (! empty($message)) { // Test log level - $logLevels = array(LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG); - if (!in_array($level, $logLevels, true)) + $logLevels = array(LOG_EMERG=>'EMERG', LOG_ALERT=>'ALERT', LOG_CRIT=>'CRITICAL', LOG_ERR=>'ERR', LOG_WARNING=>'WARN', LOG_NOTICE=>'NOTICE', LOG_INFO=>'INFO', LOG_DEBUG=>'DEBUG'); + if (! array_key_exists($level, $logLevels)) { throw new Exception('Incorrect log level'); } @@ -1008,9 +1008,10 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename = $message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log // If adding log inside HTML page is required - if (! empty($_REQUEST['logtohtml']) && (! empty($conf->global->MAIN_ENABLE_LOG_TO_HTML) || ! empty($conf->global->MAIN_LOGTOHTML))) // MAIN_LOGTOHTML kept for backward compatibility + if ((! empty($_REQUEST['logtohtml']) && ! empty($conf->global->MAIN_ENABLE_LOG_TO_HTML)) + || (! empty($user->rights->debugbar->read) && is_object($debugbar))) { - $conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".$message; + $conf->logbuffer[] = dol_print_date(time(), "%Y-%m-%d %H:%M:%S")." ".$logLevels[$level]." ".$message; } //TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output @@ -1381,53 +1382,46 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi $filepath = $dir_output . $subdir . "/"; - $file = $filepath . $objectref . ".pdf"; + $filepdf = $filepath . $objectref . ".pdf"; $relativepath = $subdir.'/'.$objectref.'.pdf'; // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") - $fileimage = $file.'_preview.png'; // If PDF has 1 page - $fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page + $fileimage = $filepdf.'_preview.png'; $relativepathimage = $relativepath.'_preview.png'; - // Si fichier PDF existe - if (file_exists($file)) + $pdfexists = file_exists($filepdf); + + // If PDF file exists + if ($pdfexists) { - $encfile = urlencode($file); // Conversion du PDF en image png si fichier png non existant - if ( (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($file))) - && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) - ) + if (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf))) { - if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. + if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experience trouble with pdf thumb generation and imagick, you can disable here. { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $ret = dol_convert_file($file, 'png', $fileimage); + $ret = dol_convert_file($filepdf, 'png', $fileimage, '0'); // Convert first page of PDF into a file _preview.png if ($ret < 0) $error++; } } + } + if ($pdfexists && ! $error) + { $heightforphotref=70; if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60; - // Si fichier png PDF d'1 page trouve + // If the preview file is found if (file_exists($fileimage)) { $phototoshow = '
'; $phototoshow.= ''; $phototoshow.= '
'; } - // Si fichier png PDF de plus d'1 page trouve - elseif (file_exists($fileimagebis)) - { - $preview = preg_replace('/\.png/', '', $relativepathimage) . "-0.png"; - $phototoshow = '
'; - $phototoshow.= '

'; - $phototoshow.= '

'; - } } } elseif (! $phototoshow) { - $phototoshow = $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos); + $phototoshow.= $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos); } if ($phototoshow) @@ -1440,7 +1434,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi if (! $phototoshow) // Show No photo link (picto of pbject) { - $morehtmlleft.='
'; + $morehtmlleft.='
'; if ($object->element == 'action') { $width=80; @@ -5760,7 +5754,7 @@ function dol_textishtml($msg, $option = 0) * @param string $text1 Text 1 * @param string $text2 Text 2 * @param bool $forxml false=Use
instead of \n if html content detected, true=Use
instead of \n if html content detected - * @param bool $invert invert order of description lines if CONF CHANGE_ORDER_CONCAT_DESCRIPTION is active + * @param bool $invert invert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter) * @return string Text 1 + new line + Text2 * @see dol_textishtml() */ @@ -7164,7 +7158,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, */ function printCommonFooter($zone = 'private') { - global $conf, $hookmanager, $user; + global $conf, $hookmanager, $user, $debugbar; global $action; global $micro_start_time; @@ -7328,11 +7322,17 @@ function printCommonFooter($zone = 'private') // Add Xdebug coverage of code if (defined('XDEBUGCOVERAGE')) { - print_r(xdebug_get_code_coverage()); + print_r(xdebug_get_code_coverage()); } - // If there is some logs in buffer to show - if (count($conf->logbuffer)) + // Add DebugBar data + if (! empty($user->rights->debugbar->read) && is_object($debugbar)) + { + $debugbar['time']->stopMeasure('pageaftermaster'); + print ''."\n"; + print $debugbar->getRenderer()->render(); + } + elseif (count($conf->logbuffer)) // If there is some logs in buffer to show { print "\n"; print " +
+ '.$userDropDownImage.' + +

+ '.$profilName.' +
'.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser').' +

+
+ + +
'.$dropdownBody.'
+ + + + +
+
+ + '; + + + return $btnUser; +} + /** * Show left menu bar * diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4813aee6dd4..d652db91e70 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1238,7 +1238,7 @@ $head = array(); $h=0; $head[$h][0] = $_SERVER["PHP_SELF"].'?module=initmodule'; -$head[$h][1] = $langs->trans("NewModule").''; +$head[$h][1] = ''.$langs->trans("NewModule").''; $head[$h][2] = 'initmodule'; $h++; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 35c60248ccf..8e0a8e08bff 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -350,13 +350,13 @@ print ''; $newcardbutton=''; //if ($user->rights->mymodule->creer) //{ - $newcardbutton=''.$langs->trans('New').''; + $newcardbutton=''.$langs->trans('New').''; $newcardbutton.= ''; $newcardbutton.= ''; //} //else //{ -// $newcardbutton=''.$langs->trans('New'); +// $newcardbutton=''.$langs->trans('New').'; // $newcardbutton.= ''; // $newcardbutton.= ''; //} diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 713ade2f736..498717385c2 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -245,13 +245,13 @@ print ''; $newcardbutton=''; if (! empty($user->rights->opensurvey->write)) { - $newcardbutton=''.$langs->trans('NewSurvey').''; + $newcardbutton=''.$langs->trans('NewSurvey').''; $newcardbutton.= ''; $newcardbutton.= ''; } else { - $newcardbutton=''.$langs->trans('NewSurvey'); + $newcardbutton=''.$langs->trans('NewSurvey').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 961faf742cd..0d6a0f05174 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -176,11 +176,11 @@ if ($id > 0 || $ref) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) { - $morehtmlcenter.=''.$langs->trans("AddAction").''; + $morehtmlcenter.=''.$langs->trans("AddAction").''; } else { - $morehtmlcenter.=''.$langs->trans("AddAction").''; + $morehtmlcenter.=''.$langs->trans("AddAction").''; } } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d7b6fc14cf5..b02295c94e3 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -435,7 +435,7 @@ if ($resql) { $label='NewProduct'; if($type == Product::TYPE_SERVICE) $label='NewService'; - $newcardbutton=''.$langs->trans($label).''; + $newcardbutton=''.$langs->trans($label).''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 31bbfa4b701..442748ae935 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -115,8 +115,6 @@ $helpurl='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; $form=new Form($db); $htmlother=new FormOther($db); -$title=$langs->trans("ProductsAndServices"); - $sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,'; $sql.= ' p.fk_product_type, p.tms as datem,'; $sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,'; @@ -191,22 +189,22 @@ if ($resql) } else { $texte = $langs->trans("ProductsAndServices"); } - $texte.=' ('.$langs->trans("Stocks").')'; + $texte.=' ('.$langs->trans("MenuStocks").')'; $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($sall) $param.="&sall=".$sall; - if ($tosell) $param.="&tosell=".$tosell; - if ($tobuy) $param.="&tobuy=".$tobuy; - if ($type) $param.="&type=".$type; - if ($fourn_id) $param.="&fourn_id=".$fourn_id; - if ($snom) $param.="&snom=".$snom; - if ($sref) $param.="&sref=".$sref; - if ($search_sale) $param.="&search_sale=".$search_sale; - if ($search_categ) $param.="&search_categ=".$search_categ; - if ($toolowstock) $param.="&toolowstock=".$toolowstock; - if ($sbarcode) $param.="&sbarcode=".$sbarcode; - if ($catid) $param.="&catid=".$catid; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + if ($sall) $param.="&sall=".urlencode($sall); + if ($tosell) $param.="&tosell=".urlencode($tosell); + if ($tobuy) $param.="&tobuy=".urlencode($tobuy); + if ($type) $param.="&type=".urlencode($type); + if ($fourn_id) $param.="&fourn_id=".urlencode($fourn_id); + if ($snom) $param.="&snom=".urlencode($snom); + if ($sref) $param.="&sref=".urlencode($sref); + if ($search_sale) $param.="&search_sale=".urlencode($search_sale); + if ($search_categ) $param.="&search_categ=".urlencode($search_categ); + if ($toolowstock) $param.="&toolowstock=".urlencode($toolowstock); + if ($sbarcode) $param.="&sbarcode=".urlencode($sbarcode); + if ($catid) $param.="&catid=".urlencode($catid); llxHeader("", $texte, $helpurl); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 7db2dffc7db..e36312e196c 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -134,7 +134,7 @@ if ($result) $newcardbutton=''; if ($user->rights->stock->creer) { - $newcardbutton=''.$langs->trans('MenuNewWarehouse').''; + $newcardbutton=''.$langs->trans('MenuNewWarehouse').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 362359f0999..d55d8651642 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -556,7 +556,7 @@ if ($action == 'create' && $user->rights->projet->creer) print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1); } else print $text; - print ' '.$langs->trans("AddThirdParty").' '; + print ' '.$langs->trans("AddThirdParty").''; print ''; } diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 95d5e3dd229..8bed0a87adc 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -180,7 +180,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print ''; + print '
'; // Visibility print '
'.$langs->trans("Visibility").''; @@ -233,7 +233,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print ''; + print '
'; // Description print '
'.$langs->trans("Description").''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index dc737e8968c..0169d1d9018 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -157,7 +157,7 @@ print '
'; print '
'; print '
'; -print ''; +print '
'; // Visibility print '
'.$langs->trans("Visibility").''; @@ -210,7 +210,7 @@ print '
'; print '
'; print '
'; -print ''; +print '
'; // Description print '
'.$langs->trans("Description").''; @@ -776,9 +776,9 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform.='
'; - if ($testnew) $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' '; + if ($testnew) $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' '; + $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; } $addform.='
'; } diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index d9a9cc37ed8..18bb2931823 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -198,16 +198,16 @@ if ($user->rights->projet->all->creer || $user->rights->projet->creer) { if ($object->public || $userWrite > 0) { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } else { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } } else { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } $linktolist=''.$langs->trans("GoToListOfTasks").''; diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 040710b4136..eb6498a220f 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -163,7 +163,7 @@ if (! empty($conf->agenda->enabled)) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) { - $morehtmlcenter.=''.$langs->trans("AddAction").''; + $morehtmlcenter.=''.$langs->trans("AddAction").''; $morehtmlcenter.=''; $morehtmlcenter.=''; } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index c6daff2068b..7a2216df97f 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -452,7 +452,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->projet->creer) { - $newcardbutton = ''.$langs->trans('NewProject').''; + $newcardbutton = ''.$langs->trans('NewProject').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 068a26b5fe2..915ac8b9bd4 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -356,7 +356,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print ''; + print '
'; // Visibility print '
'.$langs->trans("Visibility").''; @@ -409,7 +409,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print ''; + print '
'; // Description print '
'.$langs->trans("Description").''; @@ -591,16 +591,16 @@ elseif ($id > 0 || ! empty($ref)) { if ($object->public || $userWrite > 0) { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } else { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } } else { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index af8dc9d39cf..3fe8abfa73b 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -220,7 +220,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print ''; + print '
'; // Visibility print '
'.$langs->trans("Visibility").''; @@ -254,7 +254,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print '
'; - print ''; + print '
'; // Description print '
'.$langs->trans("Description").''; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 066aebdde6a..2b2055fcd46 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -399,7 +399,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions); $newcardbutton=''; if ($user->rights->projet->creer) { - $newcardbutton = ''.$langs->trans('NewTask').''; + $newcardbutton = ''.$langs->trans('NewTask').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 37934aa0957..4f0567c51f3 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; // Load translation files required by the page -$langs->load('projects'); +$langs->loadLangs(array('projects','bills','orders')); $action = GETPOST('action', 'alpha'); $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) @@ -149,47 +149,61 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) if (! $error) { - if ($id || $ref) + if ($id || $ref) { $object->fetch($id, $ref); } else { - $object->fetch(GETPOST('taskid', 'int')); + if (! GETPOST('taskid', 'int') || GETPOST('taskid', 'int') < 0) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), null, 'errors'); + $action='createtime'; + $error++; + } + else + { + $object->fetch(GETPOST('taskid', 'int')); + } } - $object->fetch_projet(); - if (empty($object->project->statut)) + if (! $error) { - setEventMessages($langs->trans("ProjectMustBeValidatedFirst"), null, 'errors'); - $error++; - } - else - { - $object->timespent_note = $_POST["timespent_note"]; - if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value - $object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds - $object->timespent_duration+= ($_POST["timespent_durationmin"]?$_POST["timespent_durationmin"]:0)*60; // We store duration in seconds - if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) // If hour was entered - { - $object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); - $object->timespent_withhour = 1; - } - else - { - $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); - } - $object->timespent_fk_user = $_POST["userid"]; - $result=$object->addTimeSpent($user); - if ($result >= 0) - { - setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); - } - else - { - setEventMessages($langs->trans($object->error), null, 'errors'); - $error++; - } + $object->fetch_projet(); + + if (empty($object->project->statut)) + { + setEventMessages($langs->trans("ProjectMustBeValidatedFirst"), null, 'errors'); + $action='createtime'; + $error++; + } + else + { + $object->timespent_note = $_POST["timespent_note"]; + if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value + $object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds + $object->timespent_duration+= ($_POST["timespent_durationmin"]?$_POST["timespent_durationmin"]:0)*60; // We store duration in seconds + if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) // If hour was entered + { + $object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); + $object->timespent_withhour = 1; + } + else + { + $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); + } + $object->timespent_fk_user = $_POST["userid"]; + $result=$object->addTimeSpent($user); + if ($result >= 0) + { + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans($object->error), null, 'errors'); + $error++; + } + } } } else @@ -488,7 +502,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
'; print '
'; - print ''; + print '
'; // Visibility print '
'.$langs->trans("Visibility").''; @@ -522,7 +536,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
'; print '
'; - print ''; + print '
'; // Description print '
'.$langs->trans("Description").''; @@ -567,22 +581,22 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) if (! empty($projectidforalltimes)) // We are on tab 'Time Spent' of project { $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject?'&withproject=1':''); - $linktocreatetime = ''.$langs->trans('AddTimeSpent').''; + $linktocreatetime = ''.$langs->trans('AddTimeSpent').''; } else // We are on tab 'Time Spent' of task { $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject?'&withproject=1':''); - $linktocreatetime = ''.$langs->trans('AddTimeSpent').''; + $linktocreatetime = ''.$langs->trans('AddTimeSpent').''; } } else { - $linktocreatetime = ''.$langs->trans('AddTime').''; + $linktocreatetime = ''.$langs->trans('AddTime').''; } } else { - $linktocreatetime = ''.$langs->trans('AddTime').''; + $linktocreatetime = ''.$langs->trans('AddTime').''; } //} } @@ -809,7 +823,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) if (! empty($withproject) && $projectstatic->bill_time) { $arrayofmassactions = array( - 'generateinvoice'=>$langs->trans("GenerateInvoice"), + 'generateinvoice'=>$langs->trans("GenerateBill"), //'builddoc'=>$langs->trans("PDFMerge"), ); //if ($user->rights->projet->creer) $arrayofmassactions['predelete']=$langs->trans("Delete"); @@ -901,7 +915,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
'; print '
'; - print ' '; + print ' '; print ''; print '
'; print '
'; @@ -1109,7 +1123,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; - print ''."\n"; + print '
'."\n"; // Fields title search print ''; diff --git a/htdocs/public/ifttt/index.php b/htdocs/public/ifttt/index.php new file mode 100644 index 00000000000..a879dc1d41f --- /dev/null +++ b/htdocs/public/ifttt/index.php @@ -0,0 +1,88 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/ifttt/index.php + * \ingroup ifttt + * \brief Page to IFTTT endpoint agenda + * http://127.0.0.1/dolibarr/public/ifttt/index.php?securekey=... + */ + +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no menu to show +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +if (! defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged. +if (! defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. + +// This is a wrapper, so header is empty + +/** + * Header function + * + * @return void + */ +function llxHeaderVierge() +{ + print 'IFTTT API'; +} +/** + * Footer function + * + * @return void + */ +function llxFooterVierge() +{ + print ''; +} + + +require '../../main.inc.php'; + +// Security check +if (empty($conf->ifttt->enabled)) accessforbidden('', 0, 0, 1); + +// Check config +if (empty($conf->global->IFTTT_DOLIBARR_ENDPOINT_SECUREKEY)) +{ + $user->getrights(); + + llxHeaderVierge(); + print '
Module Agenda was not configured properly.
'; + llxFooterVierge(); + exit; +} + +// Check exportkey +if (empty($_GET["securekey"]) || $conf->global->IFTTT_DOLIBARR_ENDPOINT_SECUREKEY != $_GET["securekey"]) +{ + $user->getrights(); + + llxHeaderVierge(); + print '
Bad value for securekey.
'; + llxFooterVierge(); + exit; +} + + +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +$hookmanager->initHooks(array('iftttapi')); + + +llxHeaderVierge(); +print '
TODO
'; +llxFooterVierge(); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index d37509bb70f..7cbd77dd4da 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -805,7 +805,7 @@ if ($action == 'create') print '
'; print ''; print ''; } diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 800c5edcb06..45cf1e9d997 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -197,7 +197,7 @@ if($ret == -1) { $newcardbutton=''; if ($user->rights->resource->write) { - $newcardbutton=''.$langs->trans('MenuResourceAdd').''; + $newcardbutton=''.$langs->trans('MenuResourceAdd').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 44b4097eff7..18e1890c485 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -162,7 +162,7 @@ if ($socid > 0) { if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) { - $newcardbutton.=''.$langs->trans("AddAction").''; + $newcardbutton.=''.$langs->trans("AddAction").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d74681d3118..69f76cacab8 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2348,7 +2348,7 @@ else print ''; print ''; print ''; - print ''; + print ''; if($action == 'editRE') { print ''; + print ''; if($action == 'editIRPF'){ print ''; + print ''; if($action == 'editRE'){ print ''; + print ''; if($action == 'editIRPF'){ print ''; } print '' . "\n"; @@ -1165,7 +1165,7 @@ if ($action == 'create') print ''; print ''; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index e6dd96d3641..249620b5f53 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -388,7 +388,7 @@ if ($resql) $newcardbutton=''; if($user->rights->supplier_proposal->creer) { - $newcardbutton=''.$langs->trans('NewAskPrice').''; + $newcardbutton=''.$langs->trans('NewAskPrice').''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index c00fa060493..90cd3cb717c 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -64,6 +64,7 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ORDER_NOTES", GETPOST('TAKEPOS_ORDER_NOTES', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity); @@ -123,6 +124,13 @@ if (! empty($conf->service->enabled)) print $form->selectyesno("CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1); print "\n"; } +print '\n"; + + print '
' . $langs->trans("Project") . ''; $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0); - print '   id).'">' . $langs->trans("AddProject") . ' '; + print '   id).'">' . $langs->trans("AddProject") . ''; print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'.$langs->transcountry("Localtax1", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; @@ -2366,7 +2366,7 @@ else print ''; print ''; print ''; - print '
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'.$langs->transcountry("Localtax2", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); @@ -2387,7 +2387,7 @@ else print ''; print ''; print ''; - print '
'.$langs->transcountry("TypeLocaltax1", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'.$langs->transcountry("Localtax1", $mysoc->country_code).'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; $formcompany->select_localtax(1, $object->localtax1_value, "lt1"); @@ -2409,7 +2409,7 @@ else print ''; print ''; print ''; - print '
'.$langs->transcountry("TypeLocaltax2", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'
'.$langs->transcountry("Localtax2", $mysoc->country_code).' id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; $formcompany->select_localtax(2, $object->localtax2_value, "lt2"); diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 7e106f387ae..c716604fd7c 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -558,7 +558,7 @@ if ($user->rights->societe->creer) if($type == 'f') $label='NewSupplier'; } - $newcardbutton = ''.$langs->trans($label).''; + $newcardbutton = ''.$langs->trans($label).''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index ef1c169c768..f928658db3e 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -800,7 +800,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $morehtmlright=''; if (! empty($conf->global->STRIPE_ALLOW_LOCAL_CARD)) { - $morehtmlright=''.$langs->trans("Add").' '; + $morehtmlright=''.$langs->trans("Add").''; } print load_fiche_titre($langs->trans('StripePaymentModes').($stripeacc?' (Stripe connection with StripeConnect account '.$stripeacc.')':' (Stripe connection with keys from Stripe module setup)'), $morehtmlright, ''); @@ -1090,7 +1090,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // List of bank accounts print '
'; - $morehtmlright=''.$langs->trans("Add").' '; + $morehtmlright=''.$langs->trans("Add").''; print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, ''); diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 609cb8d4b90..75ca2b0fcd5 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -224,11 +224,11 @@ dol_fiche_end(); $newcardbutton = ''; if (! empty($conf->website->enabled)) { if (! empty($user->rights->societe->lire)) { - $newcardbutton .= '' . $langs->trans("AddWebsiteAccount").''; + $newcardbutton .= '' . $langs->trans("AddWebsiteAccount").''; $newcardbutton.= ''; $newcardbutton.= ''; } else { - $newcardbutton .= '' . $langs->trans("AddAction"); + $newcardbutton .= ''.$langs->trans("AddAction").''; $newcardbutton.= ''; $newcardbutton.= ''; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 0efd26f3d84..af04e15c2c2 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -630,7 +630,7 @@ if (empty($reshook)) $desc = $productsupplier->desc_supplier; } else $desc = $productsupplier->description; - if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION)); + if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION)); $pu_ht = $productsupplier->fourn_pu; @@ -1084,7 +1084,7 @@ if ($action == 'create') } else { print '
'; print $form->select_company('', 'socid', 's.fournisseur = 1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); - print ' '.$langs->trans("AddThirdParty").' '; + print ' '.$langs->trans("AddThirdParty").''; print '
' . $langs->trans("Project") . ''; $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id).'">' . $langs->trans("AddProject") . ' '; + print '   id).'">' . $langs->trans("AddProject") . ''; print '
'; +print $langs->trans("AutoPrintTickets"); +print ''; +print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AUTO_PRINT_TICKETS, 1); +print "
'; print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc")); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 45a65af3f94..e1a4b32d935 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -376,7 +376,8 @@ if ($action=="valid") { print '

'.$invoice->ref." ".$langs->trans('BillShortStatusValidated').'

'; if ($conf->global->TAKEPOSCONNECTOR) print '
'; - else print '
'; + else print '
'; + if($conf->global->TAKEPOS_AUTO_PRINT_TICKETS) print ''; } if ($action == "search") diff --git a/htdocs/theme/eldy/dropdown.css.php b/htdocs/theme/eldy/dropdown.css.php new file mode 100644 index 00000000000..b484ef255e2 --- /dev/null +++ b/htdocs/theme/eldy/dropdown.css.php @@ -0,0 +1,169 @@ + +/*