diff --git a/ChangeLog b/ChangeLog index da1efec9138..891b27ba78f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,7 +19,7 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must - relace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for + replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for modulepart=mycompany that now works like others). @@ -242,7 +242,8 @@ Following changes may create regressions for some external modules, but were nec * Remove method Categorie:get_nb_categories() that was not used. * Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip are now replaced with hook getNomUrl. - +* The substitution key __CONTACTCIVNAME__ is no longer present, it has been replaced by __CONTACT_NAME_{TYPE}__ + where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary). ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** diff --git a/README.md b/README.md index b68e8b65558..dfd9d70ab7c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # DOLIBARR ERP & CRM -![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) + +|6|7|8|develop| +|----------|----------|----------|----------| +|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/6.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg)| Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 7e8532e5225..20d0a5200a5 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -128,16 +128,16 @@ complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort, // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact") $elementList = array(); - // Must match ids defined into eldy.lib.php - $sourceList = array( - '1' => $langs->trans('AccountingJournalType1'), - '2' => $langs->trans('AccountingJournalType2'), - '3' => $langs->trans('AccountingJournalType3'), - '4' => $langs->trans('AccountingJournalType4'), - '5' => $langs->trans('AccountingJournalType5'), - '8' => $langs->trans('AccountingJournalType8'), - '9' => $langs->trans('AccountingJournalType9') - ); +// Must match ids defined into eldy.lib.php +$sourceList = array( + '1' => $langs->trans('AccountingJournalType1'), + '2' => $langs->trans('AccountingJournalType2'), + '3' => $langs->trans('AccountingJournalType3'), + '4' => $langs->trans('AccountingJournalType4'), + '5' => $langs->trans('AccountingJournalType5'), + '8' => $langs->trans('AccountingJournalType8'), + '9' => $langs->trans('AccountingJournalType9'), +); /* * Actions @@ -294,10 +294,10 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition } -if (GETPOST('actioncancel')) -{ - //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition -} +//if (GETPOST('actioncancel')) +//{ +// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition +//} if ($action == 'confirm_delete' && $confirm == 'yes') // delete { diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index fec51f84cee..b0c3adb7edd 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -195,18 +195,18 @@ class AccountancyCategory // extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_accounting_category"); - if (! $notrigger) - { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action call a trigger. + // Uncomment this and change MYOBJECT to your own tag if you + // want this action call a trigger. + //if (! $notrigger) + //{ - //// Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } - //// End call triggers - } + // // Call triggers + // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + // $interface=new Interfaces($this->db); + // $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); + // if ($result < 0) { $error++; $this->errors=$interface->errors; } + // // End call triggers + //} } // Commit or rollback @@ -334,18 +334,17 @@ class AccountancyCategory // extends CommonObject if (! $error) { - if (! $notrigger) - { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action call a trigger. - - //// Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } - //// End call triggers - } + // Uncomment this and change MYOBJECT to your own tag if you + // want this action call a trigger. + //if (! $notrigger) + //{ + // // Call triggers + // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + // $interface=new Interfaces($this->db); + // $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); + // if ($result < 0) { $error++; $this->errors=$interface->errors; } + // // End call triggers + //} } // Commit or rollback @@ -390,18 +389,17 @@ class AccountancyCategory // extends CommonObject if (! $error) { - if (! $notrigger) - { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action call a trigger. - - //// Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } - //// End call triggers - } + // Uncomment this and change MYOBJECT to your own tag if you + // want this action call a trigger. + //if (! $notrigger) + //{ + // // Call triggers + // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + // $interface=new Interfaces($this->db); + // $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); + // if ($result < 0) { $error++; $this->errors=$interface->errors; } + // // End call triggers + //} } // Commit or rollback diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index cacf9b0a641..86835eb2c26 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -335,18 +335,15 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); } - if (! $error) { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action to call a trigger. + //if (! $error && ! $notrigger) { - if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action to call a trigger. - - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_CREATE',$user); - // if ($result < 0) $error++; - // // End call triggers - } - } + // // Call triggers + // $result=$this->call_trigger('MYOBJECT_CREATE',$user); + // if ($result < 0) $error++; + // // End call triggers + //} // Commit or rollback if ($error) { @@ -566,15 +563,15 @@ class BookKeeping extends CommonObject if (! $error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode); - if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action to call a trigger. + // Uncomment this and change MYOBJECT to your own tag if you + // want this action to call a trigger. + //if (! $notrigger) { - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_CREATE',$user); - // if ($result < 0) $error++; - // // End call triggers - } + // // Call triggers + // $result=$this->call_trigger('MYOBJECT_CREATE',$user); + // if ($result < 0) $error++; + // // End call triggers + //} } // Commit or rollback @@ -1131,15 +1128,15 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); } - if (! $error && ! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + //if (! $error && ! $notrigger) { - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_MODIFY',$user); - // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - // // End call triggers - } + // // Call triggers + // $result=$this->call_trigger('MYOBJECT_MODIFY',$user); + // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + // // End call triggers + //} // Commit or rollback if ($error) { @@ -1205,17 +1202,15 @@ class BookKeeping extends CommonObject $this->db->begin(); - if (! $error) { - if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + //if (! $error && ! $notrigger) { - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_DELETE',$user); - // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - // // End call triggers - } - } + // // Call triggers + // $result=$this->call_trigger('MYOBJECT_DELETE',$user); + // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + // // End call triggers + //} if (! $error) { $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.$mode; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 45387722719..4f4932fe08f 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -153,7 +153,7 @@ $y = $year_current; $buttonbind = '' . $langs->trans("ValidateHistory") . ''; print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); -//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; print ''; @@ -229,7 +229,7 @@ print '
'; print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); -//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; print '
'; @@ -309,7 +309,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); - //print_fiche_titre($langs->trans("OtherInfo"), '', ''); + //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; print '
'; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 7f906e93879..837a8c36630 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -150,7 +150,7 @@ $buttonbind = 'trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; print '
'; @@ -221,7 +221,7 @@ print '
'; print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); -//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; @@ -297,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); - //print_fiche_titre($langs->trans("OtherInfo"), '', ''); + //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; print '
'; diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 53ba48ff9d9..ac674eb95e0 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -55,7 +55,7 @@ if ($conf->accounting->enabled) print $langs->trans("AccountancyAreaDescIntro")."
\n"; print "
\n";print "
\n"; - print_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."
\n"; + print load_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."
\n"; print '
'; print "
\n"; @@ -131,7 +131,7 @@ if ($conf->accounting->enabled) print "
\n"; - print_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionFreq"), '', ''); + print load_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionFreq"), '', ''); print '
'; print "
\n"; $step = 0; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 3e6a6991f6c..d0ee7579f3b 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -150,7 +150,7 @@ $buttonbind = '
trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); print '
'; print '
'; @@ -221,7 +221,7 @@ print '
'; print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); -//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); +//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', ''); print '
'; print '
'; @@ -295,7 +295,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); - //print_fiche_titre($langs->trans("OtherInfo"), '', ''); + //print load_fiche_titre($langs->trans("OtherInfo"), '', ''); print '
'; print '
'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index fdb0a03aa00..7a4df8ec390 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2624,6 +2624,7 @@ class Adherent extends CommonObject $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); + dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang); $arraydefaultmessage=null; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 4e0c683a73f..519f2b42938 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -306,7 +306,7 @@ if (! empty($conf->product->enabled)) print ''; print ''; print ''; } @@ -317,7 +317,7 @@ if (! empty($conf->societe->enabled)) print ''; print ''; print ''; } diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index e2d1cfca145..f6306f787c3 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -1,8 +1,7 @@ - * Copyright (C) 2011-2015 Philippe Grand - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2011-2018 Philippe Grand + * Copyright (C) 2018 Charlene Benke * * 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 @@ -30,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php'; -$langs->load("admin"); -$langs->load("errors"); -$langs->load("holiday"); +// Load translation files required by the page +$langs->loadLangs(array("admin", "errors", "holiday")); if (!$user->admin) accessforbidden(); @@ -341,7 +339,6 @@ print "\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) @@ -379,7 +376,6 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - $var = !$var; print ''; print ''; print ''; print "\n"; -$var=true; $substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2); $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); @@ -482,7 +477,6 @@ $htmltext = ''.$langs->trans("AvailableVariables").':
'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; $htmltext.='
'; -$var=! $var; print '
'.$langs->trans("SetDefaultBarcodeTypeProducts").''; - $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1); + print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1); print '
'.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; - print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1); + print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); print '
'; print (empty($module->name)?$name:$module->name); print "\n"; @@ -474,7 +470,6 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp'); print '
'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 71656475e6f..89f0f028e1e 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -598,17 +598,18 @@ if ($mode == 'common') } // Print a separator if we change family - if ($familykey!=$oldfamily) - { - if ($oldfamily) print '

'; + if ($familykey != $oldfamily) { + if ($oldfamily) { + print '
'; + } - $familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; - print_fiche_titre($familytext, '', ''); + $familytext = empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; + print load_fiche_titre($familytext, '', ''); print '
'; - print ''."\n"; + print '
'."\n"; - $atleastoneforfamily=0; + $atleastoneforfamily=0; } $atleastoneforfamily++; diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index fe09ee14378..9843c6a4fb0 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -171,7 +171,7 @@ llxHeader('', $langs->trans($page_name)); // Subheader $linkback = '' . $langs->trans("BackToModuleList") . ''; -print_fiche_titre($langs->trans($page_name), $linkback); +print load_fiche_titre($langs->trans($page_name), $linkback); // Configuration header $head = multicurrencyAdminPrepareHead(); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 52ffa53ad59..76b3cf76b57 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -32,11 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; // Load translation files required by the page -$langs->loadLangs(array('admin', 'languages', 'other')); - -$langs->load("companies"); -$langs->load("products"); -$langs->load("members"); +$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members')); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index c5ec770e393..a68a4bda5a6 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -75,7 +75,7 @@ if ($action == 'update') llxHeader('',$langs->trans('SalariesSetup')); $form = new Form($db); -if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); +if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup'); diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 65ce01a4faf..bbda698a778 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 Florian Henry - * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -32,17 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page -$langs->load("orders"); +$langs->loadLangs(array("admin", "other", "bills", "orders", "suppliers")); if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("bills"); -$langs->load("orders"); -$langs->load("suppliers"); - $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 65a9354a19f..0418830cce8 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -422,7 +422,7 @@ if (! $error && $xml) $outcurrentchecksum = ''.$checksumget.''; } - print_fiche_titre($langs->trans("GlobalChecksum")).'
'; + print load_fiche_titre($langs->trans("GlobalChecksum")).'
'; print $langs->trans("ExpectedChecksum").' = '. $outexpectedchecksum .'
'; print $langs->trans("CurrentChecksum").' = '. $outcurrentchecksum; @@ -438,4 +438,3 @@ llxFooter(); $db->close(); exit($error); - diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index aca900c1cbc..9dc3deec5ac 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -24,8 +24,8 @@ require '../../main.inc.php'; -$langs->load("admin"); -$langs->load("other"); +// Load translation files required by the page +$langs->loadLangs(array("other","admin")); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php index c5a05ef2136..aed25ae45a3 100644 --- a/htdocs/admin/tools/index.php +++ b/htdocs/admin/tools/index.php @@ -24,8 +24,8 @@ require '../../main.inc.php'; -$langs->load("admin"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array("companies","admin")); if (! $user->admin) accessforbidden(); diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index db5157789e1..1f5ecb4723e 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -40,10 +40,8 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } -$langs->load("admin"); -$langs->load("companies"); -$langs->load("users"); -$langs->load("other"); +// Load translation files required by the page +$langs->loadLangs(array("companies","admin","users","other")); // Load variable for pagination $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 13b99d92f6d..b1732e0883b 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -25,7 +25,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->load("install"); +// Load translation files required by the page +$langs->loadLangs(array("companies","install","users","other")); if (! $user->admin) accessforbidden(); @@ -40,10 +41,6 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } -$langs->load("companies"); -$langs->load("users"); -$langs->load("other"); - $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 41923aa068d..1ec7c98552e 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php'; -$langs->load("admin"); -$langs->load("other"); +// Load translation files required by the page +$langs->loadLangs(array("admin","other")); $action=GETPOST('action','alpha'); @@ -76,7 +76,7 @@ print $langs->trans("CurrentVersion").' : '.DOL_VERSION.'
'; if (function_exists('curl_init')) { $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; - + if ($action == 'getlastversion') { if ($sfurl) @@ -95,7 +95,7 @@ if (function_exists('curl_init')) } $i++; } - + // Show version print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
'; } diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 6dd578993ca..a1f3632fd2f 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -178,19 +178,19 @@ if ($action == 'builddoc') { // List of values to scan for a replacement $substitutionarray = array ( - '%LOGIN%'=>$user->login, - '%COMPANY%'=>$mysoc->name, - '%ADDRESS%'=>$mysoc->address, - '%ZIP%'=>$mysoc->zip, - '%TOWN%'=>$mysoc->town, - '%COUNTRY%'=>$mysoc->country, - '%COUNTRY_CODE%'=>$mysoc->country_code, - '%EMAIL%'=>$mysoc->email, - '%YEAR%'=>$year, - '%MONTH%'=>$month, - '%DAY%'=>$day, - '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, - '%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/" + '%LOGIN%' => $user->login, + '%COMPANY%' => $mysoc->name, + '%ADDRESS%' => $mysoc->address, + '%ZIP%' => $mysoc->zip, + '%TOWN%' => $mysoc->town, + '%COUNTRY%' => $mysoc->country, + '%COUNTRY_CODE%' => $mysoc->country_code, + '%EMAIL%' => $mysoc->email, + '%YEAR%' => $year, + '%MONTH%' => $month, + '%DAY%' => $day, + '%DOL_MAIN_URL_ROOT%' => DOL_MAIN_URL_ROOT, + '%SERVER%' => "http://".$_SERVER["SERVER_NAME"]."/", ); complete_substitutions_array($substitutionarray, $langs); @@ -416,7 +416,7 @@ print $langs->trans("BarcodeType").'   '; print '
'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); -$formbarcode->select_barcode_type($fk_barcode_type, 'fk_barcode_type', 1); +print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1); print '
'; // Barcode value diff --git a/htdocs/cashdesk/affIndex.php b/htdocs/cashdesk/affIndex.php index a2e467a35e3..9ff676531f1 100644 --- a/htdocs/cashdesk/affIndex.php +++ b/htdocs/cashdesk/affIndex.php @@ -36,9 +36,8 @@ if ( $_SESSION['uid'] <= 0 ) exit; } -$langs->load("companies"); -$langs->load("compta"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("companies","compta","cashdesk")); /* diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index de0324a97fe..d2ea5160ca8 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -28,8 +28,8 @@ require_once '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; -$langs->load("admin"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("admin","cashdesk")); // Test if user logged if ( $_SESSION['uid'] > 0 ) diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 238a73f6ef7..cd354293022 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -30,9 +30,8 @@ include '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php'; -$langs->load("main"); -$langs->load("admin"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","admin","cashdesk")); $username = GETPOST("txtUsername"); $password = GETPOST("pwdPassword"); @@ -119,7 +118,7 @@ if ( $retour >= 0 ) $_SESSION['firstname'] = $tab['firstname']; $_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : ''); $_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : ''); - + $_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : ''); @@ -135,8 +134,8 @@ if ( $retour >= 0 ) } else { - $langs->load("errors"); - $langs->load("other"); + // Load translation files required by the page + $langs->loadLangs(array("other","errors")); $retour=$langs->trans("ErrorBadLoginPassword"); header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 146ae3d40b6..880eb77b8af 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -26,10 +26,8 @@ if (empty($langs) || ! is_object($langs)) exit; } - -$langs->load("main"); -$langs->load("bills"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","bills","cashdesk")); // Object $form must de defined diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 65f48b0603c..266c5e5840b 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -28,9 +28,8 @@ if (empty($langs) || ! is_object($langs)) require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -$langs->load("main"); -$langs->load("bills"); -$langs->load("cashdesk"); +// Load translation files required by the page +$langs->loadLangs(array("main","bills","cashdesk")); ?> diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index 250aaa18cc2..afe2c0da4ec 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -63,9 +63,8 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled) $warehouseLink = $warehouse->getNomUrl(1); } - -$langs->load("cashdesk"); -$langs->load("main"); +// Load translation files required by the page +$langs->loadLangs(array("main","cashdesk")); print "\n".''."\n"; print '
'; - print ''; - print '
'; - $this->select_barcode_type($selected, $htmlname, 1); - print ''; - print '
'; + print $this->formBarcodeType($page, $selected, $htmlname); + } + + /** + * Return html form to select type of barcode + * + * @param string $page Page + * @param int $selected Id condition preselected + * @param string $htmlname Nom du formulaire select + * @return string + */ + function formBarcodeType($page, $selected='', $htmlname='barcodetype_id') + { + global $langs, $conf; + $out = ''; + if ($htmlname != "none") { + $out .= '
'; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= '
'; + $out .= $this->selectBarcodeType($selected, $htmlname, 1); + $out .= ''; + $out .= '
'; } + return $out; } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 595f3e5e81a..b67bdde3ea0 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -271,9 +271,8 @@ class FormMail extends Form if (! is_object($form)) $form=new Form($this->db); - $langs->load("other"); - $langs->load("mails"); - + // Load translation files required by the page + $langs->loadLangs(array('other', 'mails')); // Clear temp files. Must be done at beginning, before call of triggers if (GETPOST('mode','alpha') == 'init' || (GETPOST('modelmailselected','alpha') && GETPOST('modelmailselected','alpha') != '-1')) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index c0f4a3f75d2..5cad99b2a9f 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -126,9 +126,8 @@ class FormTicket { global $conf, $langs, $user, $hookmanager; - $langs->load("other"); - $langs->load("mails"); - $langs->load("ticket"); + // Load translation files required by the page + $langs->loadLangs(array('other', 'mails', 'ticket')); $form = new Form($this->db); $formcompany = new FormCompany($this->db); diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index 4be484e1aa4..e8a7dfcb0ff 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -33,8 +33,8 @@ function categories_prepare_head($object,$type) { global $langs, $conf, $user; - $langs->load("categories"); - $langs->load("products"); + // Load translation files required by the page + $langs->loadLangs(array('categories', 'products')); $h = 0; $head = array(); @@ -48,7 +48,7 @@ function categories_prepare_head($object,$type) $head[$h][1] = $langs->trans("Photos"); $head[$h][2] = 'photos'; $h++; - + if (! empty($conf->global->MAIN_MULTILANGS)) { $head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type; @@ -56,7 +56,7 @@ function categories_prepare_head($object,$type) $head[$h][2] = 'translation'; $h++; } - + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab @@ -87,7 +87,7 @@ function categoriesadmin_prepare_head() $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'setup'; $h++; - + $head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCategories"); $head[$h][2] = 'attributes_categories'; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 783e6a0cb35..8a22337cea8 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -194,9 +194,10 @@ function dol_print_file($langs,$filename,$searchalt=0) */ function dol_print_object_info($object, $usetable=0) { - global $langs,$db; - $langs->load("other"); - $langs->load("admin"); + global $langs, $db; + + // Load translation files required by the page + $langs->loadLangs(array('other', 'admin')); include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 0d46dc7eacc..ecbdfad82f5 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -62,7 +62,6 @@ function payment_prepare_head(Paiement $object) */ function payment_supplier_prepare_head(Paiement $object) { - global $langs, $conf; $h = 0; @@ -127,8 +126,9 @@ function showOnlinePaymentUrl($type,$ref) { global $conf, $langs; - $langs->load("payment"); - $langs->load("paybox"); + // Load translation files required by the page + $langs->loadLangs(array('payment', 'paybox')); + $servicename='Online'; $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'
'; @@ -236,6 +236,24 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo } } } + if ($type == 'donation') + { + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode?'':''); + if ($mode == 1) $out.='donation_ref'; + if ($mode == 0) $out.=urlencode($ref); + $out.=($mode?'':''); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + else + { + $out.='&securekey='.($mode?'':''); + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); + $out.=($mode?'':''); + } + } + } // For multicompany if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 731f8859eba..1c704392c6b 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -190,8 +190,9 @@ function product_prepare_head($object) function productlot_prepare_head($object) { global $db, $langs, $conf, $user; - $langs->load("products"); - $langs->load("productbatch"); + + // Load translation files required by the page + $langs->loadLangs(array("products","productbatch")); $h = 0; $head = array(); @@ -200,7 +201,7 @@ function productlot_prepare_head($object) $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; - + // Attachments require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 71c287f7119..c01026b445d 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -36,8 +36,8 @@ function shipping_prepare_head($object) { global $db, $langs, $conf, $user; - $langs->load("sendings"); - $langs->load("deliveries"); + // Load translation files required by the page + $langs->loadLangs(array("sendings","deliveries")); $h = 0; $head = array(); @@ -121,8 +121,8 @@ function delivery_prepare_head($object) { global $langs, $conf, $user; - $langs->load("sendings"); - $langs->load("deliveries"); + // Load translation files required by the page + $langs->loadLangs(array("sendings","deliveries")); $h = 0; $head = array(); diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index b11d809caf2..2790c80c8e0 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -28,8 +28,9 @@ function showOnlineSignatureUrl($type,$ref) { global $conf, $langs; - $langs->load("payment"); - $langs->load("paybox"); + // Load translation files required by the page + $langs->loadLangs(array("payment","paybox")); + $servicename='Online'; $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlineSignature",$servicename).'
'; diff --git a/htdocs/core/lib/supplier_proposal.lib.php b/htdocs/core/lib/supplier_proposal.lib.php index 1756c92a32a..a0f52d6de15 100644 --- a/htdocs/core/lib/supplier_proposal.lib.php +++ b/htdocs/core/lib/supplier_proposal.lib.php @@ -32,8 +32,9 @@ function supplier_proposal_prepare_head($object) { global $db, $langs, $conf, $user; - $langs->load("supplier_proposal"); - $langs->load("compta"); + + // Load translation files required by the page + $langs->loadLangs(array("supplier_proposal","compta")); $h = 0; $head = array(); diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 1957f2c820d..452a9da08c7 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -567,8 +567,9 @@ function dolSavePageAlias($filealias, $object, $objectpage) $aliascontent.= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n"; $aliascontent.= '?>'."\n"; $result = file_put_contents($filealias, $aliascontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filealias, octdec($conf->global->MAIN_UMASK)); + if (! empty($conf->global->MAIN_UMASK)) { + @chmod($filealias, octdec($conf->global->MAIN_UMASK)); + } return ($result?true:false); } @@ -646,7 +647,7 @@ function dolSavePageContent($filetpl, $object, $objectpage) * @param string $pathofwebsite Path of website root * @param string $fileindex Full path of file index.php * @param string $filetpl File tpl to index.php page redirect to - * @param string $fileindex Full path of file wrapper.php + * @param string $filewrapper Full path of file wrapper.php * @return boolean True if OK */ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper) @@ -826,5 +827,3 @@ function dolSaveHtaccessFile($filehtaccess, $htaccess) return true; } - - diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 039939aac55..12a7a24fe48 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -80,8 +80,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { - $langs->load("companies"); - $langs->load("suppliers"); + // Load translation files required by the page + $langs->loadLangs(array("companies","suppliers")); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -174,8 +174,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { - $langs->load("compta"); - $langs->load("banks"); + // Load translation files required by the page + $langs->loadLangs(array("compta","banks")); $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "bank") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } @@ -528,8 +528,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($usemenuhider || empty($leftmenu) || $leftmenu=="setup") { - $langs->load("admin"); - $langs->load("help"); + // Load translation files required by the page + $langs->loadLangs(array("admin","help")); $warnpicto=''; if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) @@ -1176,10 +1176,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu */ if ($mainmenu == 'bank') { - $langs->load("withdrawals"); - $langs->load("banks"); - $langs->load("bills"); - $langs->load('categories'); + // Load translation files required by the page + $langs->loadLangs(array("withdrawals","banks","bills","categories")); // Bank-Caisse if (! empty($conf->banque->enabled)) @@ -1402,8 +1400,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Leave/Holiday/Vacation module if (! empty($conf->holiday->enabled)) { - $langs->load("holiday"); - $langs->load("trips"); + // Load translation files required by the page + $langs->loadLangs(array("holiday","trips")); $newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm'); $newmenu->add("/holiday/card.php?action=request", $langs->trans("New"), 1,$user->rights->holiday->write); @@ -1499,8 +1497,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { if (! empty($conf->adherent->enabled)) { - $langs->load("members"); - $langs->load("compta"); + // Load translation files required by the page + $langs->loadLangs(array("members","compta")); $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members",$langs->trans("Members"),0,$user->rights->adherent->lire, '', $mainmenu, 'members'); $newmenu->add("/adherents/card.php?leftmenu=members&action=create",$langs->trans("NewMember"),1,$user->rights->adherent->creer); diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 8fb183a2446..0099d0561d2 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -68,8 +68,9 @@ class CommActionRapport function __construct($db, $month, $year) { global $conf,$langs; - $langs->load("commercial"); - $langs->load("projects"); + + // Load translation files required by the page + $langs->loadLangs(array("commercial","projects")); $this->db = $db; $this->description = ""; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 9143d87ea73..c8c5c4ad32a 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -47,10 +47,8 @@ class pdf_ban extends ModeleBankAccountDoc { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("bank"); - $langs->load("withdrawals"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","bank","withdrawals","companies")); $this->db = $db; $this->name = "ban"; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 166c7f389d1..5866e57233b 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -53,8 +53,8 @@ class doc_generic_order_odt extends ModelePDFCommandes { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; @@ -98,8 +98,8 @@ class doc_generic_order_odt extends ModelePDFCommandes { global $conf,$langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array("errors","companies")); $form = new Form($this->db); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index b58a67a2cb0..f19cafc3dcf 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -52,8 +52,8 @@ class doc_generic_contract_odt extends ModelePDFContract { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 9971c3acd81..41a5f2e992c 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -54,8 +54,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition { global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("companies"); + // Load translation files required by the page + $langs->loadLangs(array("main","companies")); $this->db = $db; $this->name = "ODT templates"; @@ -99,8 +99,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition { global $conf,$langs; - $langs->load("companies"); - $langs->load("errors"); + // Load translation files required by the page + $langs->loadLangs(array("errors","companies")); $form = new Form($this->db); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 45f404f276e..0ba38215c61 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -116,10 +116,9 @@ class mailing_contacts1 extends MailingTargets function formFilter() { global $langs; - $langs->load("companies"); - $langs->load("commercial"); - $langs->load("suppliers"); - $langs->load("categories"); + + // Load translation files required by the page + $langs->loadLangs(array("commercial","companies","suppliers","categories")); $s=''; diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index ab0cca6e0d4..aa57e954f04 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -109,9 +109,9 @@ class mailing_fraise extends MailingTargets function formFilter() { global $conf, $langs; - $langs->load("members"); - $langs->load("categories"); - $langs->load("companies"); + + // Load translation files required by the page + $langs->loadLangs(array("members","companies","categories")); $form=new Form($this->db); diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 15a6b361079..684472d82c4 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -90,7 +90,7 @@ class modAgenda extends DolibarrModules $resql = $this->db->query($sqlreadactions); if ($resql) { - while ($obj = $this->db->fetch_object($sqlreadactions)) + while ($obj = $this->db->fetch_object($resql)) { //if (preg_match('/_CREATE$/',$obj->code) && (! in_array($obj->code, array('COMPANY_CREATE','PRODUCT_CREATE','TASK_CREATE')))) continue; // We don't track such events (*_CREATE) by default, we prefer validation (except thirdparty/product/task creation because there is no validation). if (preg_match('/^TASK_/',$obj->code)) continue; // We don't track such events by default. diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index 0274eeb2e63..adefd37de9e 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -85,7 +85,7 @@ class modSyslog extends DolibarrModules // Cronjobs $this->cronjobs = array( - 0=>array('label'=>'CompressSyslogs', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'compressSyslogs', 'parameters'=>'', 'comment'=>'Compress and archive log files', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true), + 0=>array('label'=>'CompressSyslogs', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'compressSyslogs', 'parameters'=>'', 'comment'=>'Compress and archive log files. Warning, batch must be run with same account than your web server to avoid to get lof files with different owner than required by web server !', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true), ); } } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index e7166c14b28..848ac6dbf21 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -260,13 +260,13 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; special_code == 3) { ?> trans('Option'); ?> - total_ht); ?> + total_ht); ?> multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> multicurrency_total_ht); ?> - total_ttc); ?> + total_ttc); ?> diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index a425055135f..a5c5ce7cf11 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -1,4 +1,4 @@ - * * This program is free software; you can redistribute it and/or modify @@ -118,6 +118,28 @@ if (! empty($conf->adherent->enabled)) } print '
'; } +if (! empty($conf->don->enabled)) +{ + print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnDonation",$servicename).':
'; + print ''.getOnlinePaymentUrl(1,'donation')."
\n"; + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN) && ! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + $langs->load("members"); + print '
'; + print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Don")).': '; + print ''; + print ''; + if (GETPOST('generate_donation_ref')) + { + print '
-> '; + $url=getOnlinePaymentUrl(0,'donation',GETPOST('generate_donation_ref','alpha')); + print $url; + print "
\n"; + } + print '
'; + } + print '
'; +} if (! empty($conf->use_javascript_ajax)) { @@ -140,3 +162,4 @@ print info_admin($langs->trans("YouCanAddTagOnUrl")); print ''; + diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 5a9e439a9c7..727394cb5b3 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2018 Thibault FOUCART * * 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 @@ -26,13 +27,16 @@ */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/modules/dons/modules_don.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/donation.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; @@ -40,9 +44,7 @@ if (! empty($conf->projet->enabled)) } require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$langs->load("companies"); -$langs->load("donations"); -$langs->load("bills"); +$langs->loadLangs(array("bills","companies","donations")); // File with generic data $id=GETPOST('rowid')?GETPOST('rowid','int'):GETPOST('id','int'); $action=GETPOST('action','alpha'); @@ -326,38 +328,92 @@ if ($action == 'create') print ''; print ''; - // Date + // Ref + print ''; + + // Company + if (! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES)) + { + // Thirdparty + print ''; + if ($soc->id > 0 && ! GETPOST('fac_rec','alpha')) + { + print ''; + } + else + { + print ''; + } + print '' . "\n"; + + } + + // Date print ''; - // Amount - print "".''; + // Amount + print "".''; + // Public donation print '\n"; - print "".''; - print "".''; - print "".''; - print "".''; + if (empty($conf->societe->enabled) || empty($conf->global->DONATION_USE_THIRDPARTIES)) + { + print "".''; + print "".''; + print "".''; + print "".''; - // Zip / Town - print ''; + // Zip / Town + print ''; - // Country - print ''; + // Country + print ''; - print "".''; + print "".''; + } // Payment mode print "'; print ''; // Assign a Name diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index b7ce405b433..f53a9042fca 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -264,7 +264,7 @@ print '
'; * Last third parties modified */ $max=15; -$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur"; +$sql = "SELECT s.rowid, s.nom as name, s.email, s.client, s.fournisseur"; $sql.= ", s.code_client"; $sql.= ", s.code_fournisseur"; $sql.= ", s.logo"; @@ -313,6 +313,7 @@ if ($result) $thirdparty_static->code_client = $objp->code_client; $thirdparty_static->code_fournisseur = $objp->code_fournisseur; $thirdparty_static->canvas=$objp->canvas; + $thirdparty_static->email = $objp->email; print '
'; // Name diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 19d12a33005..6a4dd8713f7 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -3,6 +3,7 @@ * Copyright (C) 2017 Olivier Geffroy * Copyright (C) 2017 Saasprov * Copyright (C) 2018 ptibogxiv + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,10 +71,14 @@ if ($action == 'setvalue' && $user->admin) $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_PAYMENTS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 'int'), 'chaine', 0, '', $conf->entity); if (! $result > 0) $error ++; - $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 'int'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "STRIPE_USER_ACCOUNT_FOR_ACTIONS", GETPOST('STRIPE_USER_ACCOUNT_FOR_ACTIONS', 'int'), 'chaine', 0, '', $conf->entity); + if (! $result > 0) { + $error ++; + } + $result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOST('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS', 'int'), 'chaine', 0, '', $conf->entity); if (! $result > 0) $error ++; - $result = dolibarr_set_const($db, "STRIPE_MINIMAL_3DSECURE", GETPOST('STRIPE_MINIMAL_3DSECURE', 'int'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "STRIPE_MINIMAL_3DSECURE", GETPOST('STRIPE_MINIMAL_3DSECURE', 'int'), 'chaine', 0, '', $conf->entity); if (! $result > 0) $error ++; $result = dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity); @@ -116,10 +121,8 @@ if ($action == 'setvalue' && $user->admin) if ($action=="setlive") { $liveenable = GETPOST('value','int'); - $res = dolibarr_set_const($db, "STRIPE_LIVE", $liveenable,'yesno',0,'',$conf->entity); - if (! $res > 0) $error++; - if (! $error) - { + $res = dolibarr_set_const($db, "STRIPE_LIVE", $liveenable, 'yesno', 0, '', $conf->entity); + if ($res > 0) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else @@ -251,6 +254,11 @@ print 'name; print ''; +print ''; + print ''; - // Ref - print "\n"; + print ''; + // Ref + $url='https://dashboard.stripe.com/test/payments/'.$charge->id; + if ($servicestatus) + { + $url='https://dashboard.stripe.com/payments/'.$charge->id; + } + print "\n"; // Stripe customer print "\n"; // Link @@ -153,23 +162,26 @@ if (!$rowid) { print $societestatic->getNomUrl(1); } - if ($memberstatic->id > 0) + elseif ($memberstatic->id > 0) { print $memberstatic->getNomUrl(1); } print "\n"; // Origine print "\n"; // Date payment print '\n"; @@ -190,14 +202,16 @@ if (!$rowid) // Status print '\n"; diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index f0c950d85ac..6560d42d137 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -8,6 +8,7 @@ * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2018 ThibaultFOUCART * * 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 @@ -639,36 +640,24 @@ print ''; print '
' . $langs->trans('Ref') . '' . $langs->trans('Draft') . '
' . $langs->trans('Customer') . ''; + print $soc->getNomUrl(1); + print ''; + // Outstanding Bill + $outstandingBills = $soc->get_OutstandingBill(); + print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; + print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); + if ($soc->outstanding_limit != '') + { + if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + } + print ')'; + print ''; + print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + // Option to reload page to retrieve customer informations. Note, this clear other input + if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) + { + print ''; + } + print ' '.$langs->trans("AddThirdParty").''; + print '
'.$langs->trans("Date").''; $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); print '
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("PublicDonation").""; print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); print "
'.$langs->trans("Company").'
'.$langs->trans("Lastname").'
'.$langs->trans("Firstname").'
'.$langs->trans("Address").''; - print '
'.$langs->trans("Company").'
'.$langs->trans("Lastname").'
'.$langs->trans("Firstname").'
'.$langs->trans("Address").''; + print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); - print ' '; - print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); - print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); + print ' '; + print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); + print '
'; - print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - print '
'; + print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print '
'.$langs->trans("EMail").'
'.$langs->trans("EMail").'
".$langs->trans("PaymentMode")."\n"; @@ -791,6 +847,16 @@ if (! empty($id) && $action != 'edit') $linktoelem = $form->showLinkToObjectBlock($object, null, array('don')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show online payment link + $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); + + if ($useonlinepayment) //$object->statut != Facture::STATUS_DRAFT && + { + print '
'."\n"; + require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + print showOnlinePaymentUrl('donation', $object->ref).'
'; + } + print '
'; print '
'; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 1ed604b56f2..dc178e4a7d5 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -73,12 +73,6 @@ class Don extends CommonObject public $labelstatut; public $labelstatutshort; - /** - * @deprecated - * @see note_private, note_public - */ - public $commentaire; - /** * Constructor @@ -87,9 +81,7 @@ class Don extends CommonObject */ function __construct($db) { - global $langs; - - $this->db = $db; + $this->db = $db; } @@ -383,8 +375,8 @@ class Don extends CommonObject $sql.= ", '".$this->db->escape($this->address)."'"; $sql.= ", '".$this->db->escape($this->zip)."'"; $sql.= ", '".$this->db->escape($this->town)."'"; - $sql.= ", ".$this->country_id; - $sql.= ", ".$this->public; + $sql.= ", ".($this->country_id > 0 ? $this->country_id : '0'); + $sql.= ", ".((int) $this->public); $sql.= ", ".($this->fk_project > 0?$this->fk_project:"null"); $sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL"); $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); @@ -396,7 +388,6 @@ class Don extends CommonObject $sql.= ", '".$this->db->escape($this->phone_mobile)."'"; $sql.= ")"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -432,8 +423,8 @@ class Don extends CommonObject if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS)) { - $res = $this->setValid($user); - if ($res < 0) $error++; + //$res = $this->setValid($user); + //if ($res < 0) $error++; } if (!$error) @@ -687,7 +678,6 @@ class Don extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->modelpdf = $obj->model_pdf; - $this->commentaire = $obj->note; // deprecated // Retreive all extrafield // fetch optionals attributes and labels diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 502f7053106..ceaf1f5be90 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -466,6 +466,7 @@ new_pmp double DEFAULT 0 )ENGINE=InnoDB; ALTER TABLE llx_inventory ADD COLUMN datec datetime DEFAULT NULL; +ALTER TABLE llx_inventory ADD COLUMN tms timestamp; ALTER TABLE llx_inventory ADD INDEX idx_inventory_tms (tms); ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec); diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index bc5e828e903..724a3bbd813 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -31,4 +31,5 @@ OnlinePaymentSystem=Online payment system PaypalLiveEnabled=PayPal live enabled (otherwise test/sandbox mode) PaypalImportPayment=Import PayPal payments PostActionAfterPayment=Post actions after payments -ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary. \ No newline at end of file +ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary. +ValidationOfPaymentFailed=Validation of payment has failed \ No newline at end of file diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index ecd176a0ae7..ed3d24f4370 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -22,7 +22,7 @@ ToOfferALinkForOnlinePaymentOnContractLine=URL to offer a %s online payment user ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer a %s online payment user interface for a free amount ToOfferALinkForOnlinePaymentOnMemberSubscription=URL to offer a %s online payment user interface for a member subscription YouCanAddTagOnUrl=You can also add url parameter &tag=value to any of those URL (required only for free payment) to add your own payment comment tag. -SetupStripeToHavePaymentCreatedAutomatically=Setup your Stripe with url %s to have payment created automatically when validated by Stripe. +SetupStripeToHavePaymentCreatedAutomatically=Setup your Stripe with url %s to have payment created automatically when validated by Stripe. AccountParameter=Account parameters UsageParameter=Usage parameters InformationToFindParameters=Help to find your %s account information @@ -60,4 +60,5 @@ DeleteACard=Delete Card ConfirmDeleteCard=Are you sure you want to delete this Credit or Debit card? CreateCustomerOnStripe=Create customer on Stripe CreateCardOnStripe=Create card on Stripe -ShowInStripe=Show in Stripe \ No newline at end of file +ShowInStripe=Show in Stripe +StripeUserAccountForActions=User account to use for some emails notification of Stripe events (Stripe payouts) diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 08a16745621..6cd379c3cc2 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -116,7 +116,7 @@ SendingEmailOnCancelation=Envoie d'email à l'annulation # Topic of email templates YourMembershipRequestWasReceived=Votre demande d'adhésion a été reçue. YourMembershipWasValidated=Votre adhésion a été enregistrée -YourSubscriptionWasRecorded=Votre nouvel adhésion a été enregistrée +YourSubscriptionWasRecorded=Votre nouvelle adhésion a été enregistrée SubscriptionReminderEmail=Rappel de cotisation YourMembershipWasCanceled=Votre adhésion a été annulée CardContent=Contenu de votre fiche adhérent diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 42b604f03d5..1409a26da98 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -238,7 +238,7 @@ if (empty($reshook)) $form = new Form($db); $formproject = new FormProjets($db); -if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); +if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); $title = $langs->trans("Loan") . ' - ' . $langs->trans("Card"); $help_url = 'EN:Module_Loan|FR:Module_Emprunt'; diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index 80341e8df0c..b6d3100aba1 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -429,7 +429,7 @@ class LoanSchedule extends CommonObject { while($obj = $this->db->fetch_object($resql)) { - $line = New LoanSchedule($this->db); + $line = new LoanSchedule($this->db); $line->id = $obj->rowid; $line->ref = $obj->rowid; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1af3fc23d1e..d325e52a343 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1185,7 +1185,7 @@ elseif (! empty($module)) print '
'; print '
'; - print_fiche_titre($langs->trans("DescriptorFile")); + print load_fiche_titre($langs->trans("DescriptorFile")); if (! empty($moduleobj)) { @@ -1249,7 +1249,7 @@ elseif (! empty($module)) print '

'; // Readme file - print_fiche_titre($langs->trans("ReadmeFile")); + print load_fiche_titre($langs->trans("ReadmeFile")); print '
'; print '
'; @@ -1259,7 +1259,7 @@ elseif (! empty($module)) print '

'; // ChangeLog - print_fiche_titre($langs->trans("ChangeLog")); + print load_fiche_titre($langs->trans("ChangeLog")); print '
'; print '
'; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 1ac7af39193..821e161d57a 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -409,27 +409,27 @@ class MyObject extends CommonObject elseif ($mode == 2) { if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - if ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; } elseif ($mode == 3) { if ($status == 1) return img_picto($this->labelstatus[$status],'statut4'); - if ($status == 0) return img_picto($this->labelstatus[$status],'statut5'); + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5'); } elseif ($mode == 4) { if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; - if ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; + elseif ($status == 0) return img_picto($this->labelstatus[$status],'statut5').' '.$this->labelstatus[$status]; } elseif ($mode == 5) { if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - if ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); } elseif ($mode == 6) { if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); - if ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); + elseif ($status == 0) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut5'); } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 52815c1303d..d51a4fa494c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -977,7 +977,7 @@ else } require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); - print $formbarcode->select_barcode_type($fk_barcode_type, 'fk_barcode_type', 1); + print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1); print '
'.$langs->trans("BarcodeValue").''; $tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode; if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type); @@ -1343,7 +1343,7 @@ else } require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); - print $formbarcode->select_barcode_type($fk_barcode_type, 'fk_barcode_type', 1); + print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1); print ''.$langs->trans("BarcodeValue").''; $tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode; if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type); @@ -1639,7 +1639,7 @@ else } if ($action == 'editbarcodetype') { - $formbarcode->form_barcode_type($_SERVER['PHP_SELF'].'?id='.$object->id,$object->barcode_type,'fk_barcode_type'); + print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type'); } else { diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 70e30b171c8..b46f651f9b4 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -801,6 +801,11 @@ if ($ispaymentok) $content.="
\n"; $content.="tag=".$fulltag."
\ntoken=".$onlinetoken."
\npaymentType=".$paymentType."
\ncurrencycodeType=".$currencyCodeType."
\npayerId=".$payerID."
\nipaddress=".$ipaddress."
\nFinalPaymentAmt=".$FinalPaymentAmt."
\n"; + if (! empty($ErrorCode)) $content.="ErrorCode = ".$ErrorCode."
\n"; + if (! empty($ErrorShortMsg)) $content.="ErrorShortMsg = ".$ErrorShortMsg."
\n"; + if (! empty($ErrorLongMsg)) $content.="ErrorLongMsg = ".$ErrorLongMsg."
\n"; + if (! empty($ErrorSeverityCode)) $content.="ErrorSeverityCode = ".$ErrorSeverityCode."
\n"; + $ishtml=dol_textishtml($content); // May contain urls require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 1e6adb7ca51..72a43dcbc7b 100644 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -43,14 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paypal->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main","other","dict","bills","companies","paybox","paypal","stripe")); // Clean parameters $PAYPAL_API_USER=""; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index faca27f78c7..12420c81add 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2018 Thibault FOUCART + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT .'/core/class/CMailFile.class.php'; // You can find your endpoint's secret in your webhook settings if (isset($_GET['connect'])){ @@ -86,9 +88,12 @@ catch(\UnexpectedValueException $e) { // Do something with $event http_response_code(200); // PHP 5.4 or greater + $langs->load("main"); + +// TODO Do we really need a user in setup just to have an name to fill an email topic when it is a technical system notification email $user = new User($db); -$user->fetch(5); +$user->fetch($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS); $user->getrights(); if (! empty($conf->multicompany->enabled) && ! empty($conf->stripeconnect->enabled) && is_object($mc)) { @@ -126,12 +131,37 @@ if ($event->type == 'payout.created') { if ($result > 0) { - // TODO Use CMail and translation - $body = "Un virement de ".price2num($event->data->object->amount/100)." ".$event->data->object->currency." est attendu sur votre compte le ".date('d-m-Y H:i:s',$event->data->object->arrival_date); - $subject = '[NOTIFICATION] Virement programmée'; - $headers = 'From: "'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'" <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; // TODO convert in dolibarr standard - mail(''.$conf->global->MAIN_INFO_SOCIETE_MAIL.'', $subject, $body, $headers); - return 1; + $subject = '[NOTIFICATION] Virement programmée'; + if (!empty($user->email)) { + $sendto = dolGetFirstLastname($user->firstname, $user->lastname) . " <".$user->email.">"; + } else { + $sendto = $conf->global->MAIN_INFO_SOCIETE_MAIL.'" <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + } + $replyto = $sendto; + $sendtocc = ''; + if (!empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) { + $sendtocc = $conf->global->ONLINE_PAYMENT_SENDEMAIL.'" <'.$conf->global->ONLINE_PAYMENT_SENDEMAIL.'>'; + } + + $message = "Un virement de ".price2num($event->data->object->amount/100)." ".$event->data->object->currency." est attendu sur votre compte le ".date('d-m-Y H:i:s',$event->data->object->arrival_date); + + $mailfile = new CMailFile( + $subject, + $sendto, + $replyto, + $message, + array(), + array(), + array(), + $sendtocc, + '', + 0, + -1 + ); + + $ret = $mailfile->sendfile()) + + return 1; } else { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 5343c5509a1..427995254fc 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1962,7 +1962,7 @@ else // Capital print '
'.fieldLabel('Capital','capital').' '.$langs->trans("Currency".$conf->currency).'
'; +print $langs->trans("StripeUserAccountForActions").''; +print $form->select_dolusers($conf->global->STRIPE_USER_ACCOUNT_FOR_ACTIONS, 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); +print '
'; print $langs->trans("BankAccount").''; print $form->select_comptes($conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS, 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); @@ -357,4 +365,3 @@ if (! empty($conf->use_javascript_ajax)) // End of page llxFooter(); $db->close(); - diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 2f3d184fdb9..b5f0238e9a2 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -125,15 +125,19 @@ if (!$rowid) // Save into $tmparray all metadata $tmparray = dolExplodeIntoArray($FULLTAG,'.','='); // Load origin object according to metadata - if (! empty($tmparray['CUS'])) + if (! empty($tmparray['CUS']) && $tmparray['CUS'] > 0) { $societestatic->fetch($tmparray['CUS']); } + elseif (! empty($charge->metadata->dol_thirdparty_id) && $charge->metadata->dol_thirdparty_id > 0) + { + $societestatic->fetch($charge->metadata->dol_thirdparty_id); + } else { $societestatic->id = 0; } - if (! empty($tmparray['MEM'])) + if (! empty($tmparray['MEM']) && $tmparray['MEM'] > 0) { $memberstatic->fetch($tmparray['MEM']); } @@ -142,9 +146,14 @@ if (!$rowid) $memberstatic->id = 0; } - print '
".$charge->id."
".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id."".$charge->customer.""; - print $FULLTAG; - if ($charge->metadata->source=="order"){ + if ($charge->metadata->dol_type=="order"){ $object = new Commande($db); - $object->fetch($charge->metadata->idsource); - print "".img_picto('', 'object_order')." ".$object->ref.""; - } elseif ($charge->metadata->source=="invoice"){ + $object->fetch($charge->metadata->dol_id); + if ($object->id > 0) { + print "".img_picto('', 'object_order')." ".$object->ref.""; + } else print $FULLTAG; + } elseif ($charge->metadata->dol_type=="invoice"){ $object = new Facture($db); - $object->fetch($charge->metadata->idsource); - print "".img_picto('', 'object_invoice')." ".$object->ref.""; - } + $object->fetch($charge->metadata->dol_id); + if ($object->id > 0) { + print "".img_picto('', 'object_invoice')." ".$object->ref.""; + } else print $FULLTAG; + } else print $FULLTAG; print "'.dol_print_date($charge->created,'%d/%m/%Y %H:%M')."'; if ($charge->refunded=='1'){ - print $langs->trans("refunded"); + print img_picto($langs->trans("refunded"),'statut6'); } elseif ($charge->paid=='1'){ - print $langs->trans("".$charge->status.""); + + print img_picto($langs->trans("".$charge->status.""),'statut4'); + } else { $label="Message: ".$charge->failure_message."
"; $label.="Réseau: ".$charge->outcome->network_status."
"; $label.="Statut: ".$langs->trans("".$charge->outcome->seller_message.""); - print $form->textwithpicto($langs->trans("".$charge->status.""),$label,1); + print $form->textwithpicto(img_picto($langs->trans("".$charge->status.""),'statut8'),$label,1); } print "
id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) { print'class="opacitymedium"';} print' >'; -if ($src->object=='card'){ -if ($src->brand == 'Visa') {$brand='cc-visa';} -elseif ($src->brand == 'MasterCard') {$brand='cc-mastercard';} -elseif ($src->brand == 'American Express') {$brand='cc-amex';} -elseif ($src->brand == 'Discover') {$brand='cc-discover';} -elseif ($src->brand == 'JCB') {$brand='cc-jcb';} -elseif ($src->brand == 'Diners Club') {$brand='cc-diners-club';} -else {$brand='credit-card-alt';} -print ''; -} -elseif ($src->object=='source' && $src->type=='card'){ -if ($src->card->brand == 'Visa') {$brand='cc-visa';} -elseif ($src->card->brand == 'MasterCard') {$brand='cc-mastercard';} -elseif ($src->card->brand == 'American Express') {$brand='cc-amex';} -elseif ($src->card->brand == 'Discover') {$brand='cc-discover';} -elseif ($src->card->brand == 'JCB') {$brand='cc-jcb';} -elseif ($src->card->brand == 'Diners Club') {$brand='cc-diners-club';} -else {$brand='credit-card-alt';} - -print ''; -} -elseif ($src->object=='source' && $src->type=='sepa_debit'){ -print ''; -} + if ($src->object=='card') + { + print img_credit_card($src->brand); + } + elseif ($src->object=='source' && $src->type=='card') + { + print img_credit_card($src->card->brand); + } + elseif ($src->object=='source' && $src->type=='sepa_debit') + { + print ''; + } print 'id!=$source) or ($src->object=='source' && $src->card->three_d_secure=='required')) { print'class="opacitymedium"';} print' >'; if ($src->object=='card'){ -print '**** '.$src->last4.'
Exp. '.$src->exp_month.'/'.$src->exp_year.''; + print '....'.$src->last4.' - '.$src->exp_month.'/'.$src->exp_year.''; print '
'; if ($src->country) { @@ -679,7 +668,7 @@ print ''; else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; } elseif ($src->object=='source' && $src->type=='card'){ - print $src->owner->name.'
**** '.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; + print $src->owner->name.'
....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.''; print '
'; if ($src->card->country) { diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 7e04adab9a7..575af204618 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -188,7 +188,7 @@ if ($result > 0) // Add notification form - print_fiche_titre($langs->trans("AddNewNotification"),'',''); + print load_fiche_titre($langs->trans("AddNewNotification"),'',''); print '
'; print ''; @@ -276,7 +276,7 @@ if ($result > 0) } // List of active notifications - print_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')','',''); + print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')','',''); // Line with titles print ''; diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 9f3dafdc153..be73db1fff0 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -137,7 +137,7 @@ $var = false; llxHeader('', $title); -//print_fiche_titre($title); +//print load_fiche_titre($title); $h=0; $head[$h][0] = DOL_URL_ROOT.'/variants/card.php?id='.$object->id; @@ -243,7 +243,7 @@ if ($action == 'edit') { ?> trans("PossibleValues")); + print load_fiche_titre($langs->trans("PossibleValues")); if ($action == 'edit_value') { print ''; diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index 0e491be448d..4f2d53bb75f 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -66,7 +66,7 @@ $title = $langs->trans('NewProductAttribute'); llxHeader('', $title); -print_fiche_titre($title); +print load_fiche_titre($title); dol_fiche_head(); diff --git a/htdocs/variants/create_val.php b/htdocs/variants/create_val.php index 8213148327d..86372df9f59 100644 --- a/htdocs/variants/create_val.php +++ b/htdocs/variants/create_val.php @@ -118,7 +118,7 @@ print ''; print ''; print ''; -print_fiche_titre($langs->trans('NewProductAttributeValue')); +print load_fiche_titre($langs->trans('NewProductAttributeValue')); dol_fiche_head(); diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index 49265f25001..d07c8bf66d0 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -160,7 +160,7 @@ if (! empty($id) || ! empty($ref)) { dol_fiche_end(); } - print_fiche_titre($langs->trans('ProductCombinationGenerator')); + print load_fiche_titre($langs->trans('ProductCombinationGenerator')); $dictionary_attr = array(); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index e9d68e03034..590423de2e4 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2211,7 +2211,7 @@ if ($action == 'createsite') dol_fiche_head($head, 'card', $langs->trans("AddSite"), -1, 'globe'); */ - if ($action == 'createcontainer') print_fiche_titre($langs->trans("AddSite")); + if ($action == 'createcontainer') print load_fiche_titre($langs->trans("AddSite")); print ''."\n"; //print '
'; @@ -2273,7 +2273,7 @@ if ($action == 'importsite') print '
'; - print_fiche_titre($langs->trans("ImportSite")); + print load_fiche_titre($langs->trans("ImportSite")); dol_fiche_head(array(), '0', '', -1); @@ -2305,7 +2305,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') dol_fiche_head($head, 'card', $langs->trans("AddPage"), -1, 'globe'); */ - if ($action == 'createcontainer') print_fiche_titre($langs->trans("AddPage")); + if ($action == 'createcontainer') print load_fiche_titre($langs->trans("AddPage")); print ''."\n"; //print '
';