Merge remote-tracking branch 'upstream/develop' into camelCaps2

This commit is contained in:
Frédéric FRANCE 2018-09-12 18:32:15 +02:00
commit 998b67fa98
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
121 changed files with 762 additions and 601 deletions

View File

@ -15,6 +15,13 @@ For developers:
* Code changes to be more compatible with PSR2 * Code changes to be more compatible with PSR2
* Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that) * Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that)
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
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
modulepart=mycompany that now works like others).
***** ChangeLog for 8.0.1 compared to 8.0.0 ***** ***** ChangeLog for 8.0.1 compared to 8.0.0 *****
@ -235,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. * Remove method Categorie:get_nb_categories() that was not used.
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip * Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
are now replaced with hook getNomUrl. 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 ***** ***** ChangeLog for 7.0.3 compared to 7.0.2 *****

View File

@ -1,6 +1,10 @@
# DOLIBARR ERP & CRM # 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…). Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).

View File

@ -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") // Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
$elementList = array(); $elementList = array();
// Must match ids defined into eldy.lib.php // Must match ids defined into eldy.lib.php
$sourceList = array( $sourceList = array(
'1' => $langs->trans('AccountingJournalType1'), '1' => $langs->trans('AccountingJournalType1'),
'2' => $langs->trans('AccountingJournalType2'), '2' => $langs->trans('AccountingJournalType2'),
'3' => $langs->trans('AccountingJournalType3'), '3' => $langs->trans('AccountingJournalType3'),
'4' => $langs->trans('AccountingJournalType4'), '4' => $langs->trans('AccountingJournalType4'),
'5' => $langs->trans('AccountingJournalType5'), '5' => $langs->trans('AccountingJournalType5'),
'8' => $langs->trans('AccountingJournalType8'), '8' => $langs->trans('AccountingJournalType8'),
'9' => $langs->trans('AccountingJournalType9') '9' => $langs->trans('AccountingJournalType9'),
); );
/* /*
* Actions * Actions
@ -294,10 +294,10 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
} }
if (GETPOST('actioncancel')) //if (GETPOST('actioncancel'))
{ //{
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition // $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
} //}
if ($action == 'confirm_delete' && $confirm == 'yes') // delete if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{ {

View File

@ -195,18 +195,18 @@ class AccountancyCategory // extends CommonObject
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_accounting_category"); $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 //if (! $notrigger)
// want this action call a trigger. //{
//// Call triggers // // Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db); // $interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); // $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; } // if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers // // End call triggers
} //}
} }
// Commit or rollback // Commit or rollback
@ -334,18 +334,17 @@ class AccountancyCategory // extends CommonObject
if (! $error) if (! $error)
{ {
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 //if (! $notrigger)
// want this action call a trigger. //{
// // Call triggers
//// Call triggers // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; // $interface=new Interfaces($this->db);
//$interface=new Interfaces($this->db); // $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); // if ($result < 0) { $error++; $this->errors=$interface->errors; }
//if ($result < 0) { $error++; $this->errors=$interface->errors; } // // End call triggers
//// End call triggers //}
}
} }
// Commit or rollback // Commit or rollback
@ -390,18 +389,17 @@ class AccountancyCategory // extends CommonObject
if (! $error) if (! $error)
{ {
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 //if (! $notrigger)
// want this action call a trigger. //{
// // Call triggers
//// Call triggers // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; // $interface=new Interfaces($this->db);
//$interface=new Interfaces($this->db); // $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); // if ($result < 0) { $error++; $this->errors=$interface->errors; }
//if ($result < 0) { $error++; $this->errors=$interface->errors; } // // End call triggers
//// End call triggers //}
}
} }
// Commit or rollback // Commit or rollback

View File

@ -335,18 +335,15 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); 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) { // // Call triggers
// Uncomment this and change MYOBJECT to your own tag if you // $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// want this action to call a trigger. // 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 // Commit or rollback
if ($error) { if ($error) {
@ -566,15 +563,15 @@ class BookKeeping extends CommonObject
if (! $error) { if (! $error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode); $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
// Uncomment this and change MYOBJECT to your own tag if you // want this action to call a trigger.
// want this action to call a trigger. //if (! $notrigger) {
// // Call triggers // // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user); // $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++; // if ($result < 0) $error++;
// // End call triggers // // End call triggers
} //}
} }
// Commit or rollback // Commit or rollback
@ -1131,15 +1128,15 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
} }
if (! $error && ! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you
// Uncomment this and change MYOBJECT to your own tag if you // want this action calls a trigger.
// want this action calls a trigger. //if (! $error && ! $notrigger) {
// // Call triggers // // Call triggers
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user); // $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers // // End call triggers
} //}
// Commit or rollback // Commit or rollback
if ($error) { if ($error) {
@ -1205,17 +1202,15 @@ class BookKeeping extends CommonObject
$this->db->begin(); $this->db->begin();
if (! $error) { // Uncomment this and change MYOBJECT to your own tag if you
if (! $notrigger) { // want this action calls a trigger.
// Uncomment this and change MYOBJECT to your own tag if you //if (! $error && ! $notrigger) {
// want this action calls a trigger.
// // Call triggers // // Call triggers
// $result=$this->call_trigger('MYOBJECT_DELETE',$user); // $result=$this->call_trigger('MYOBJECT_DELETE',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers // // End call triggers
} //}
}
if (! $error) { if (! $error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.$mode; $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.$mode;

View File

@ -153,7 +153,7 @@ $y = $year_current;
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>'; $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -229,7 +229,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -309,7 +309,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>'; print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -150,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -221,7 +221,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
@ -297,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>'; print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -55,7 +55,7 @@ if ($conf->accounting->enabled)
print $langs->trans("AccountancyAreaDescIntro")."<br>\n"; print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
print "<br>\n";print "<br>\n"; print "<br>\n";print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n"; print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
print '<hr>'; print '<hr>';
print "<br>\n"; print "<br>\n";
@ -131,7 +131,7 @@ if ($conf->accounting->enabled)
print "<br>\n"; print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', ''); print load_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
print '<hr>'; print '<hr>';
print "<br>\n"; print "<br>\n";
$step = 0; $step = 0;

View File

@ -150,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -221,7 +221,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -295,7 +295,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>'; print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1); 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 '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -2636,6 +2636,7 @@ class Adherent extends CommonObject
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members"));
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang);
$arraydefaultmessage=null; $arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;

View File

@ -1,8 +1,7 @@
<?php <?php
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> /* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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.'/holiday/class/holiday.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
$langs->load("admin"); // Load translation files required by the page
$langs->load("errors"); $langs->loadLangs(array("admin", "errors", "holiday"));
$langs->load("holiday");
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();
@ -341,7 +339,6 @@ print "</tr>\n";
clearstatcache(); clearstatcache();
$var=true;
foreach ($dirmodels as $reldir) foreach ($dirmodels as $reldir)
{ {
foreach (array('','/doc') as $valdir) foreach (array('','/doc') as $valdir)
@ -379,7 +376,6 @@ foreach ($dirmodels as $reldir)
if ($modulequalified) if ($modulequalified)
{ {
$var = !$var;
print '<tr class="oddeven"><td width="100">'; print '<tr class="oddeven"><td width="100">';
print (empty($module->name)?$name:$module->name); print (empty($module->name)?$name:$module->name);
print "</td><td>\n"; print "</td><td>\n";
@ -474,7 +470,6 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>'; print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>'; print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=true;
$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2); $substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
@ -482,7 +477,6 @@ $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>'; $htmltext.='</i>';
$var=! $var;
print '<tr class="oddeven"><td colspan="2">'; print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp'); print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
print '<br>'; print '<br>';

View File

@ -598,17 +598,18 @@ if ($mode == 'common')
} }
// Print a separator if we change family // Print a separator if we change family
if ($familykey!=$oldfamily) if ($familykey != $oldfamily) {
{ if ($oldfamily) {
if ($oldfamily) print '</table></div><br>'; print '</table></div><br>';
}
$familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; $familytext = empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
print_fiche_titre($familytext, '', ''); print load_fiche_titre($familytext, '', '');
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste" summary="list_of_modules">'."\n"; print '<table class="tagtable liste" summary="list_of_modules">'."\n";
$atleastoneforfamily=0; $atleastoneforfamily=0;
} }
$atleastoneforfamily++; $atleastoneforfamily++;

View File

@ -171,7 +171,7 @@ llxHeader('', $langs->trans($page_name));
// Subheader // Subheader
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans($page_name), $linkback); print load_fiche_titre($langs->trans($page_name), $linkback);
// Configuration header // Configuration header
$head = multicurrencyAdminPrepareHead(); $head = multicurrencyAdminPrepareHead();

View File

@ -32,11 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('admin', 'languages', 'other')); $langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members'));
$langs->load("companies");
$langs->load("products");
$langs->load("members");
if (! $user->admin) accessforbidden(); if (! $user->admin) accessforbidden();

View File

@ -75,7 +75,7 @@ if ($action == 'update')
llxHeader('',$langs->trans('SalariesSetup')); llxHeader('',$langs->trans('SalariesSetup'));
$form = new Form($db); $form = new Form($db);
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup'); print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup');

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->load("orders"); $langs->loadLangs(array("admin", "other", "bills", "orders", "suppliers"));
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("bills");
$langs->load("orders");
$langs->load("suppliers");
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$form = new Form($db); $form = new Form($db);

View File

@ -422,7 +422,7 @@ if (! $error && $xml)
$outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>'; $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
} }
print_fiche_titre($langs->trans("GlobalChecksum")).'<br>'; print load_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
print $langs->trans("ExpectedChecksum").' = '. $outexpectedchecksum .'<br>'; print $langs->trans("ExpectedChecksum").' = '. $outexpectedchecksum .'<br>';
print $langs->trans("CurrentChecksum").' = '. $outcurrentchecksum; print $langs->trans("CurrentChecksum").' = '. $outcurrentchecksum;
@ -438,4 +438,3 @@ llxFooter();
$db->close(); $db->close();
exit($error); exit($error);

View File

@ -24,8 +24,8 @@
require '../../main.inc.php'; require '../../main.inc.php';
$langs->load("admin"); // Load translation files required by the page
$langs->load("other"); $langs->loadLangs(array("other","admin"));
if (! $user->admin) if (! $user->admin)
accessforbidden(); accessforbidden();

View File

@ -24,8 +24,8 @@
require '../../main.inc.php'; require '../../main.inc.php';
$langs->load("admin"); // Load translation files required by the page
$langs->load("companies"); $langs->loadLangs(array("companies","admin"));
if (! $user->admin) if (! $user->admin)
accessforbidden(); accessforbidden();

View File

@ -40,10 +40,8 @@ if ($user->societe_id > 0)
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$langs->load("admin"); // Load translation files required by the page
$langs->load("companies"); $langs->loadLangs(array("companies","admin","users","other"));
$langs->load("users");
$langs->load("other");
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;

View File

@ -25,7 +25,8 @@
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.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) if (! $user->admin)
accessforbidden(); accessforbidden();
@ -40,10 +41,6 @@ if ($user->societe_id > 0)
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$langs->load("companies");
$langs->load("users");
$langs->load("other");
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -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/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php';
$langs->load("admin"); // Load translation files required by the page
$langs->load("other"); $langs->loadLangs(array("admin","other"));
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
@ -76,7 +76,7 @@ print $langs->trans("CurrentVersion").' : <strong>'.DOL_VERSION.'</strong><br>';
if (function_exists('curl_init')) if (function_exists('curl_init'))
{ {
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
if ($action == 'getlastversion') if ($action == 'getlastversion')
{ {
if ($sfurl) if ($sfurl)
@ -95,7 +95,7 @@ if (function_exists('curl_init'))
} }
$i++; $i++;
} }
// Show version // Show version
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>'; print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
} }

View File

@ -36,9 +36,8 @@ if ( $_SESSION['uid'] <= 0 )
exit; exit;
} }
$langs->load("companies"); // Load translation files required by the page
$langs->load("compta"); $langs->loadLangs(array("companies","compta","cashdesk"));
$langs->load("cashdesk");
/* /*

View File

@ -28,8 +28,8 @@
require_once '../main.inc.php'; require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$langs->load("admin"); // Load translation files required by the page
$langs->load("cashdesk"); $langs->loadLangs(array("admin","cashdesk"));
// Test if user logged // Test if user logged
if ( $_SESSION['uid'] > 0 ) if ( $_SESSION['uid'] > 0 )

View File

@ -30,9 +30,8 @@ include '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php';
$langs->load("main"); // Load translation files required by the page
$langs->load("admin"); $langs->loadLangs(array("main","admin","cashdesk"));
$langs->load("cashdesk");
$username = GETPOST("txtUsername"); $username = GETPOST("txtUsername");
$password = GETPOST("pwdPassword"); $password = GETPOST("pwdPassword");
@ -119,7 +118,7 @@ if ( $retour >= 0 )
$_SESSION['firstname'] = $tab['firstname']; $_SESSION['firstname'] = $tab['firstname'];
$_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : ''); $_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : '');
$_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : ''); $_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : '');
$_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : '');
$_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : '');
$_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : ''); $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : '');
@ -135,8 +134,8 @@ if ( $retour >= 0 )
} }
else else
{ {
$langs->load("errors"); // Load translation files required by the page
$langs->load("other"); $langs->loadLangs(array("other","errors"));
$retour=$langs->trans("ErrorBadLoginPassword"); $retour=$langs->trans("ErrorBadLoginPassword");
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit; exit;

View File

@ -26,10 +26,8 @@ if (empty($langs) || ! is_object($langs))
exit; exit;
} }
// Load translation files required by the page
$langs->load("main"); $langs->loadLangs(array("main","bills","cashdesk"));
$langs->load("bills");
$langs->load("cashdesk");
// Object $form must de defined // Object $form must de defined

View File

@ -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.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("main"); // Load translation files required by the page
$langs->load("bills"); $langs->loadLangs(array("main","bills","cashdesk"));
$langs->load("cashdesk");
?> ?>

View File

@ -63,9 +63,8 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
$warehouseLink = $warehouse->getNomUrl(1); $warehouseLink = $warehouse->getNomUrl(1);
} }
// Load translation files required by the page
$langs->load("cashdesk"); $langs->loadLangs(array("main","cashdesk"));
$langs->load("main");
print "\n".'<!-- menu.tpl.php -->'."\n"; print "\n".'<!-- menu.tpl.php -->'."\n";
print '<div class="menu_bloc">'; print '<div class="menu_bloc">';

View File

@ -27,8 +27,8 @@ if (empty($langs) || ! is_object($langs))
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("main"); // Load translation files required by the page
$langs->load('cashdesk'); $langs->loadLangs(array("main","cashdesk"));
top_httphead('text/html'); top_httphead('text/html');

View File

@ -23,10 +23,8 @@ if (empty($langs) || ! is_object($langs))
exit; exit;
} }
// Load translation files required by the page
$langs->load("main"); $langs->loadLangs(array("main","bills","banks"));
$langs->load("bills");
$langs->load("banks");
// Object $form must de defined // Object $form must de defined

View File

@ -24,9 +24,8 @@ if (empty($langs) || ! is_object($langs))
exit; exit;
} }
// Load translation files required by the page
$langs->load("main"); $langs->loadLangs(array("main","bills"));
$langs->load("bills");
?> ?>

View File

@ -28,9 +28,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; 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/files.lib.php';
$langs->load("admin"); // Load translation files required by the page
$langs->load("other"); $langs->loadLangs(array("admin","other","website"));
$langs->load("website");
if (! $user->admin) accessforbidden(); if (! $user->admin) accessforbidden();

View File

@ -181,7 +181,7 @@ if (empty($reshook))
if ($action == 'setorder_min_amount') if ($action == 'setorder_min_amount')
{ {
$object->fetch($id); $object->fetch($id);
$object->order_min_amount=GETPOST('order_min_amount'); $object->order_min_amount=price2num(GETPOST('order_min_amount','alpha'));
$result=$object->update($object->id, $user); $result=$object->update($object->id, $user);
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
} }
@ -423,15 +423,21 @@ if ($object->id > 0)
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
}
print '<tr class="nowrap">'; if ($object->client)
print '<td>'; {
print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer); if (! empty($conf->commande->enabled) && ! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT))
print '</td><td>'; {
print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : '')); print '<!-- Minimim amount for orders -->'."\n";
print '<tr class="nowrap">';
print '</td>'; print '<td>';
print '</tr>'; print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer);
print '</td><td>';
print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : ''));
print '</td>';
print '</tr>';
}
} }

View File

@ -45,7 +45,7 @@ if ($user->societe_id > 0)
if ($_POST["action"] == 'setpricelevel') if ($_POST["action"] == 'setpricelevel')
{ {
$soc = New Societe($db); $soc = new Societe($db);
$soc->fetch($id); $soc->fetch($id);
$soc->set_price_level($_POST["price_level"],$user); $soc->set_price_level($_POST["price_level"],$user);

View File

@ -2388,7 +2388,7 @@ if ($action == 'create' && $user->rights->commande->creer)
// Total HT // Total HT
$alert = ''; $alert = '';
if($object->total_ht < $object->thirdparty->order_min_amount) { if (! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->order_min_amount) {
$alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); $alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
} }
print '<tr><td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; print '<tr><td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';

View File

@ -284,7 +284,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->
$form = new Form($db); $form = new Form($db);
$formbank = new FormBank($db); $formbank = new FormBank($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
$countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';

View File

@ -220,7 +220,7 @@ if (empty($reshook))
llxHeader("",$langs->trans("VariousPayment")); llxHeader("",$langs->trans("VariousPayment"));
$form = new Form($db); $form = new Form($db);
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db); if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db); if (! empty($conf->projet->enabled)) $formproject = new FormProjets($db);
if ($id) if ($id)

View File

@ -455,7 +455,7 @@ while($j<$numlt)
// Payment Salary // Payment Salary
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
{ {
if (! $mode || $mode != 'sconly') if (! $mode || $mode != 'sconly')
{ {

View File

@ -1004,8 +1004,8 @@ class FactureRec extends CommonInvoice
$error=0; $error=0;
$langs->load("bills"); // Load translation files required by the page
$langs->load('main'); $langs->loadLangs(array("main","bills"));
$nb_create=0; $nb_create=0;

View File

@ -3805,7 +3805,7 @@ class Facture extends CommonInvoice
$response = new WorkboardResponse(); $response = new WorkboardResponse();
$response->warning_delay=$conf->facture->client->warning_delay/60/60/24; $response->warning_delay=$conf->facture->client->warning_delay/60/60/24;
$response->label=$langs->trans("CustomerBillsUnpaid"); $response->label=$langs->trans("CustomerBillsUnpaid");
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=customers_bills'; $response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=billing&leftmenu=customers_bills';
$response->img=img_object('',"bill"); $response->img=img_object('',"bill");
$generic_facture = new Facture($this->db); $generic_facture = new Facture($this->db);

View File

@ -577,14 +577,14 @@ if ($resql)
if ($search_zip) $param.='&search_zip='.urlencode($search_zip); if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale); if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user); if ($search_user > 0) $param.='&search_user=' .urlencode($search_user);
if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category); if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category);
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat); if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1); if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2); if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc); if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_status != '') $param.='&search_status='.urlencode($search_status); if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode); if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
if ($show_files) $param.='&show_files='.urlencode($show_files); if ($show_files) $param.='&show_files='.urlencode($show_files);
if ($option) $param.="&search_option=".urlencode($option); if ($option) $param.="&search_option=".urlencode($option);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);

View File

@ -30,15 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('banks', 'categories')); $langs->loadLangs(array('banks', 'categories','bills','withdrawals'));
if (!$user->rights->prelevement->bons->lire) if (!$user->rights->prelevement->bons->lire)
accessforbidden(); accessforbidden();
$langs->load("bills");
$langs->load("withdrawals");
// Security check // Security check
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();

View File

@ -47,7 +47,7 @@ $projectid = (GETPOST('projectid','int') ? GETPOST('projectid', 'int') : GETPOST
// Security check // Security check
$socid = GETPOST("socid","int"); $socid = GETPOST("socid","int");
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'salaries', '', '', 'payment'); $result = restrictedArea($user, 'salaries', '', '', '');
$object = new PaymentSalary($db); $object = new PaymentSalary($db);

View File

@ -44,8 +44,9 @@ $action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha'); $confirm = GETPOST('confirm','alpha');
// Security check // Security check
$socid = GETPOST("socid","int");
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'salaries', $id, ''); $result = restrictedArea($user, 'salaries', '', '', '');
// Get parameters // Get parameters

View File

@ -148,7 +148,7 @@ if ($result)
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss; if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;
$newcardbutton=''; $newcardbutton='';
if ($user->rights->salaries->payment->write) if (! empty($user->rights->salaries->write))
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/salaries/card.php?action=create"><span class="valignmiddle">'.$langs->trans('NewSalaryPayment').'</span>'; $newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/salaries/card.php?action=create"><span class="valignmiddle">'.$langs->trans('NewSalaryPayment').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>'; $newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';

View File

@ -41,18 +41,6 @@ $socid = GETPOST("socid","int");
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'salaries', '', '', ''); $result = restrictedArea($user, 'salaries', '', '', '');
// Other security check
$childids = $user->getAllChildIds();
$childids[]=$user->id;
if ($userid > 0)
{
if (empty($user->rights->salaries->payment->readall) && ! in_array($userid, $childids))
{
accessforbidden();
exit;
}
}
$nowyear=strftime("%Y", dol_now()); $nowyear=strftime("%Y", dol_now());
$year = GETPOST('year')>0?GETPOST('year'):$nowyear; $year = GETPOST('year')>0?GETPOST('year'):$nowyear;
//$startyear=$year-2; //$startyear=$year-2;
@ -77,11 +65,6 @@ print load_fiche_titre($title, $mesg);
dol_mkdir($dir); dol_mkdir($dir);
$useridtofilter=$userid; // Filter from parameters $useridtofilter=$userid; // Filter from parameters
if (empty($useridtofilter))
{
$useridtofilter=$childids;
if (! empty($user->rights->salaries->payment->readall)) $useridtofilter=0;
}
$stats = new SalariesStats($db, $socid, $useridtofilter); $stats = new SalariesStats($db, $socid, $useridtofilter);

View File

@ -397,7 +397,7 @@ while($j<$numlt)
// Payment Salary // Payment Salary
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
{ {
if (! $mode || $mode != 'sconly') if (! $mode || $mode != 'sconly')
{ {

View File

@ -42,7 +42,7 @@ if (GETPOST('addfile','alpha'))
$vardir=$conf->user->dir_output."/".$user->id; $vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path $upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid); dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid, 0);
$action='presend'; $action='presend';
} }

View File

@ -93,8 +93,8 @@ if ($time >= $_SESSION['auto_check_events_not_before'])
while ($obj = $db->fetch_object($resql)) while ($obj = $db->fetch_object($resql))
{ {
$langs->load("agenda"); // Load translation files required by the page
$langs->load("commercial"); $langs->loadLangs(array('agenda', 'commercial'));
$actionmod->fetch($obj->id); $actionmod->fetch($obj->id);

View File

@ -34,12 +34,12 @@ class box_project extends ModeleBoxes
var $boximg="object_projectpub"; var $boximg="object_projectpub";
var $boxlabel; var $boxlabel;
//var $depends = array("projet"); //var $depends = array("projet");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; var $param;
var $info_box_head = array(); var $info_box_head = array();
@ -54,8 +54,9 @@ class box_project extends ModeleBoxes
function __construct($db,$param='') function __construct($db,$param='')
{ {
global $user, $langs; global $user, $langs;
$langs->load("boxes");
$langs->load("projects"); // Load translation files required by the page
$langs->loadLangs(array('boxes', 'projects'));
$this->db = $db; $this->db = $db;
$this->boxlabel="Projects"; $this->boxlabel="Projects";

View File

@ -31,21 +31,21 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
*/ */
class box_task extends ModeleBoxes class box_task extends ModeleBoxes
{ {
var $boxcode="projet"; public $boxcode="projet";
var $boximg="object_projecttask"; public $boximg="object_projecttask";
var $boxlabel; public $boxlabel;
//var $depends = array("projet"); //public $depends = array("projet");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param;
var $enabled = 0; // Disabled because bugged.
var $info_box_head = array(); public $param;
var $info_box_contents = array(); public $enabled = 0; // Disabled because bugged.
public $info_box_head = array();
public $info_box_contents = array();
/** /**
@ -57,8 +57,10 @@ class box_task extends ModeleBoxes
function __construct($db,$param='') function __construct($db,$param='')
{ {
global $user, $langs; global $user, $langs;
$langs->load("boxes");
$langs->load("projects"); // Load translation files required by the page
$langs->loadLangs(array('boxes', 'projects'));
$this->boxlabel="Tasks"; $this->boxlabel="Tasks";
$this->db = $db; $this->db = $db;
@ -131,7 +133,7 @@ class box_task extends ModeleBoxes
} }
// Add the sum à the bottom of the boxes // Add the sum at the bottom of the boxes
$this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => '', 'text' => $langs->trans("Total")."&nbsp;".$textHead); $this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => '', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks")); $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); $this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));

View File

@ -19,7 +19,7 @@
*/ */
/** /**
* \file resource/ctyperesource.class.php * \file htdocs/core/class/ctyperesource.class.php
* \ingroup resource * \ingroup resource
*/ */
@ -127,15 +127,15 @@ class Ctyperesource
if (!$error) { if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
if (!$notrigger) { // Uncomment this and change MYOBJECT to your own tag if you
// Uncomment this and change MYOBJECT to your own tag if you // want this action to call a trigger.
// want this action to call a trigger. //if (!$notrigger) {
//// Call triggers // // Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user); // $result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) $error++; // if ($result < 0) $error++;
//// End call triggers // // End call triggers
} //}
} }
// Commit or rollback // Commit or rollback
@ -331,15 +331,15 @@ class Ctyperesource
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR); dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
} }
if (!$error && !$notrigger) { // Uncomment this and change MYOBJECT to your own tag if you
// Uncomment this and change MYOBJECT to your own tag if you // want this action calls a trigger.
// want this action calls a trigger. //if (!$error && !$notrigger) {
//// Call triggers // // Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user); // $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers // // End call triggers
} //}
// Commit or rollback // Commit or rollback
if ($error) { if ($error) {
@ -369,17 +369,15 @@ class Ctyperesource
$this->db->begin(); $this->db->begin();
if (!$error) { // Uncomment this and change MYOBJECT to your own tag if you
if (!$notrigger) { // want this action calls a trigger.
// Uncomment this and change MYOBJECT to your own tag if you //if (!$error && !$notrigger) {
// want this action calls a trigger.
//// Call triggers // // Call triggers
//$result=$this->call_trigger('MYOBJECT_DELETE',$user); // $result=$this->call_trigger('MYOBJECT_DELETE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers // // End call triggers
} //}
}
// If you need to delete child tables to, you can insert them here // If you need to delete child tables to, you can insert them here

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015-2018 Frédéric France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -216,6 +216,7 @@ class dolReceiptPrinter extends Escpos
global $conf; global $conf;
$error = 0; $error = 0;
$line = 0; $line = 0;
$obj = array();
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter'; $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
$sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt'; $sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt';
$sql.= ' WHERE entity = '.$conf->entity; $sql.= ' WHERE entity = '.$conf->entity;
@ -283,6 +284,7 @@ class dolReceiptPrinter extends Escpos
global $conf; global $conf;
$error = 0; $error = 0;
$line = 0; $line = 0;
$obj = array();
$sql = 'SELECT rowid, name, template'; $sql = 'SELECT rowid, name, template';
$sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt_template'; $sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt_template';
$sql.= ' WHERE entity = '.$conf->entity; $sql.= ' WHERE entity = '.$conf->entity;

View File

@ -675,11 +675,22 @@ class ExtraFields
$params=''; $params='';
} }
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields"; if ($entity === '' || $entity != '0')
$sql_del.= " WHERE name = '".$attrname."'"; {
$sql_del.= " AND entity = ".($entity===''?$conf->entity:$entity); // We dont want on all entities, we delete all and current
$sql_del.= " AND elementtype = '".$elementtype."'"; $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
$sql_del.= " WHERE name = '".$attrname."'";
$sql_del.= " AND entity IN (0, ".($entity===''?$conf->entity:$entity).")";
$sql_del.= " AND elementtype = '".$elementtype."'";
}
else
{
// We want on all entities ($entities = '0'), we delete on all only (we keep setup specific to each entity)
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
$sql_del.= " WHERE name = '".$attrname."'";
$sql_del.= " AND entity = 0";
$sql_del.= " AND elementtype = '".$elementtype."'";
}
$resql1=$this->db->query($sql_del); $resql1=$this->db->query($sql_del);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(";

View File

@ -277,9 +277,8 @@ class FormMail extends Form
if (! is_object($form)) $form=new Form($this->db); if (! is_object($form)) $form=new Form($this->db);
$langs->load("other"); // Load translation files required by the page
$langs->load("mails"); $langs->loadLangs(array('other', 'mails'));
// Clear temp files. Must be done at beginning, before call of triggers // Clear temp files. Must be done at beginning, before call of triggers
if (GETPOST('mode','alpha') == 'init' || (GETPOST('modelmailselected','alpha') && GETPOST('modelmailselected','alpha') != '-1')) if (GETPOST('mode','alpha') == 'init' || (GETPOST('modelmailselected','alpha') && GETPOST('modelmailselected','alpha') != '-1'))
@ -960,6 +959,7 @@ class FormMail extends Form
if (count($validpaymentmethod) > 0 && $paymenturl) if (count($validpaymentmethod) > 0 && $paymenturl)
{ {
$langs->load('other');
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=str_replace('\n',"\n",$langs->transnoentities("PredefinedMailContentLink", $paymenturl)); $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=str_replace('\n',"\n",$langs->transnoentities("PredefinedMailContentLink", $paymenturl));
$this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl; $this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl;
} }

View File

@ -126,9 +126,8 @@ class FormTicket
{ {
global $conf, $langs, $user, $hookmanager; global $conf, $langs, $user, $hookmanager;
$langs->load("other"); // Load translation files required by the page
$langs->load("mails"); $langs->loadLangs(array('other', 'mails', 'ticket'));
$langs->load("ticket");
$form = new Form($this->db); $form = new Form($this->db);
$formcompany = new FormCompany($this->db); $formcompany = new FormCompany($this->db);

View File

@ -33,8 +33,8 @@ function categories_prepare_head($object,$type)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$langs->load("categories"); // Load translation files required by the page
$langs->load("products"); $langs->loadLangs(array('categories', 'products'));
$h = 0; $h = 0;
$head = array(); $head = array();
@ -48,7 +48,7 @@ function categories_prepare_head($object,$type)
$head[$h][1] = $langs->trans("Photos"); $head[$h][1] = $langs->trans("Photos");
$head[$h][2] = 'photos'; $head[$h][2] = 'photos';
$h++; $h++;
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS))
{ {
$head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&amp;type='.$type; $head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&amp;type='.$type;
@ -56,7 +56,7 @@ function categories_prepare_head($object,$type)
$head[$h][2] = 'translation'; $head[$h][2] = 'translation';
$h++; $h++;
} }
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // 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 // $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][1] = $langs->trans("Setup");
$head[$h][2] = 'setup'; $head[$h][2] = 'setup';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsCategories"); $head[$h][1] = $langs->trans("ExtraFieldsCategories");
$head[$h][2] = 'attributes_categories'; $head[$h][2] = 'attributes_categories';

View File

@ -6093,7 +6093,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
{ {
// Set the online payment url link into __ONLINE_PAYMENT_URL__ key // Set the online payment url link into __ONLINE_PAYMENT_URL__ key
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$outputlangs->load('paypal'); $outputlangs->loadLangs(array('paypal','other'));
$typeforonlinepayment='free'; $typeforonlinepayment='free';
if (is_object($object) && $object->element == 'commande') $typeforonlinepayment='order'; if (is_object($object) && $object->element == 'commande') $typeforonlinepayment='order';
if (is_object($object) && $object->element == 'facture') $typeforonlinepayment='invoice'; if (is_object($object) && $object->element == 'facture') $typeforonlinepayment='invoice';

View File

@ -194,9 +194,10 @@ function dol_print_file($langs,$filename,$searchalt=0)
*/ */
function dol_print_object_info($object, $usetable=0) function dol_print_object_info($object, $usetable=0)
{ {
global $langs,$db; global $langs, $db;
$langs->load("other");
$langs->load("admin"); // Load translation files required by the page
$langs->loadLangs(array('other', 'admin'));
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

View File

@ -62,7 +62,6 @@ function payment_prepare_head(Paiement $object)
*/ */
function payment_supplier_prepare_head(Paiement $object) function payment_supplier_prepare_head(Paiement $object)
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;
@ -127,8 +126,9 @@ function showOnlinePaymentUrl($type,$ref)
{ {
global $conf, $langs; global $conf, $langs;
$langs->load("payment"); // Load translation files required by the page
$langs->load("paybox"); $langs->loadLangs(array('payment', 'paybox'));
$servicename='Online'; $servicename='Online';
$out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>'; $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>';
@ -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?'<font color="#666666">':'');
if ($mode == 1) $out.='donation_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
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?'<font color="#666666">':'');
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?'</font>':'');
}
}
}
// For multicompany // 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 if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities

View File

@ -190,8 +190,9 @@ function product_prepare_head($object)
function productlot_prepare_head($object) function productlot_prepare_head($object)
{ {
global $db, $langs, $conf, $user; 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; $h = 0;
$head = array(); $head = array();
@ -200,7 +201,7 @@ function productlot_prepare_head($object)
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
// Attachments // Attachments
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';

View File

@ -36,8 +36,8 @@ function shipping_prepare_head($object)
{ {
global $db, $langs, $conf, $user; global $db, $langs, $conf, $user;
$langs->load("sendings"); // Load translation files required by the page
$langs->load("deliveries"); $langs->loadLangs(array("sendings","deliveries"));
$h = 0; $h = 0;
$head = array(); $head = array();
@ -121,8 +121,8 @@ function delivery_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$langs->load("sendings"); // Load translation files required by the page
$langs->load("deliveries"); $langs->loadLangs(array("sendings","deliveries"));
$h = 0; $h = 0;
$head = array(); $head = array();

View File

@ -28,8 +28,9 @@ function showOnlineSignatureUrl($type,$ref)
{ {
global $conf, $langs; global $conf, $langs;
$langs->load("payment"); // Load translation files required by the page
$langs->load("paybox"); $langs->loadLangs(array("payment","paybox"));
$servicename='Online'; $servicename='Online';
$out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlineSignature",$servicename).'<br>'; $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlineSignature",$servicename).'<br>';

View File

@ -32,8 +32,9 @@
function supplier_proposal_prepare_head($object) function supplier_proposal_prepare_head($object)
{ {
global $db, $langs, $conf, $user; 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; $h = 0;
$head = array(); $head = array();

View File

@ -150,11 +150,13 @@ function dolWebsiteOutput($content)
$nbrep=0; $nbrep=0;
if (! $symlinktomediaexists) if (! $symlinktomediaexists)
{ {
$content=preg_replace('/(<script[^>]*src=")[^\"]*document\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\document.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep); $content=preg_replace('/(<script[^>]*src=")[^\"]*document\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\wrapper.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep);
$content=preg_replace('/(<a[^>]*href=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/viewimage.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep); $content=preg_replace('/(<a[^>]*href=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep);
$content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/viewimage.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep); $content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep);
$content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1/viewimage.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep); $content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1/wrapper.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep);
$content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)modulepart=mycompany([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2modulepart=mycompany\3file=\4\5', $content, -1, $nbrep);
} }
else else
{ {
@ -163,6 +165,8 @@ function dolWebsiteOutput($content)
$content=preg_replace('/(<a[^>]*href=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1medias/\4\5', $content, -1, $nbrep); $content=preg_replace('/(<a[^>]*href=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1medias/\4\5', $content, -1, $nbrep);
$content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1medias/\4\5', $content, -1, $nbrep); $content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1medias/\4\5', $content, -1, $nbrep);
$content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1medias/\4\5', $content, -1, $nbrep); $content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1medias/\4\5', $content, -1, $nbrep);
$content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)modulepart=mycompany([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2modulepart=mycompany\3file=\4\5', $content, -1, $nbrep);
} }
} }
@ -516,6 +520,31 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
/**
* Save content of a page on disk
*
* @param string $filemaster Full path of filename master.inc.php for website to generate
* @return boolean True if OK
*/
function dolSaveMasterFile($filemaster)
{
global $conf;
// Now generate the master.inc.php page
dol_syslog("We regenerate the master file");
dol_delete_file($filemaster);
$mastercontent = '<?php'."\n";
$mastercontent.= '// File generated to link to the master file - DO NOT MODIFY - It is just an include'."\n";
$mastercontent.= "if (! defined('USEDOLIBARRSERVER')) require_once '".DOL_DOCUMENT_ROOT."/master.inc.php';\n";
$mastercontent.= '?>'."\n";
$result = file_put_contents($filemaster, $mastercontent);
if (! empty($conf->global->MAIN_UMASK))
@chmod($filemaster, octdec($conf->global->MAIN_UMASK));
return $result;
}
/** /**
* Save content of a page on disk * Save content of a page on disk
* *
@ -538,10 +567,11 @@ function dolSavePageAlias($filealias, $object, $objectpage)
$aliascontent.= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n"; $aliascontent.= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
$aliascontent.= '?>'."\n"; $aliascontent.= '?>'."\n";
$result = file_put_contents($filealias, $aliascontent); $result = file_put_contents($filealias, $aliascontent);
if (! empty($conf->global->MAIN_UMASK)) if (! empty($conf->global->MAIN_UMASK)) {
@chmod($filealias, octdec($conf->global->MAIN_UMASK)); @chmod($filealias, octdec($conf->global->MAIN_UMASK));
}
return ($result?true:false); return ($result?true:false);
} }
@ -585,9 +615,9 @@ function dolSavePageContent($filetpl, $object, $objectpage)
$tplcontent.= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n"; $tplcontent.= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n";
$tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n"; $tplcontent.= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n";
$tplcontent.= '<!-- Include link to CSS file -->'."\n"; $tplcontent.= '<!-- Include link to CSS file -->'."\n";
$tplcontent.= '<link rel="stylesheet" href="styles.css.php?websiteid='.$object->id.'" type="text/css" />'."\n"; $tplcontent.= '<link rel="stylesheet" href="styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
$tplcontent.= '<!-- Include HTML header from common file -->'."\n"; $tplcontent.= '<!-- Include HTML header from common file -->'."\n";
$tplcontent.= '<?php print preg_replace(\'/<\/?html>/ims\', \'\', file_get_contents(DOL_DATA_ROOT."/website/'.$object->ref.'/htmlheader.html")); ?>'."\n"; $tplcontent.= '<?php print preg_replace(\'/<\/?html>/ims\', \'\', file_get_contents(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")); ?>'."\n";
$tplcontent.= '<!-- Include HTML header from page header block -->'."\n"; $tplcontent.= '<!-- Include HTML header from page header block -->'."\n";
$tplcontent.= preg_replace('/<\/?html>/ims', '', $objectpage->htmlheader)."\n"; $tplcontent.= preg_replace('/<\/?html>/ims', '', $objectpage->htmlheader)."\n";
$tplcontent.= '</head>'."\n"; $tplcontent.= '</head>'."\n";
@ -612,22 +642,24 @@ function dolSavePageContent($filetpl, $object, $objectpage)
/** /**
* Save content of the index.php page * Save content of the index.php and wrapper.php page
* *
* @param string $pathofwebsite Path of website root * @param string $pathofwebsite Path of website root
* @param string $fileindex Full path of file index.php * @param string $fileindex Full path of file index.php
* @param string $filetpl File tpl to index.php page redirect to * @param string $filetpl File tpl to index.php page redirect to
* @param string $filewrapper Full path of file wrapper.php
* @return boolean True if OK * @return boolean True if OK
*/ */
function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl) function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper)
{ {
global $conf; global $conf;
$result=0; $result1=false;
$result2=false;
dol_mkdir($pathofwebsite); dol_mkdir($pathofwebsite);
dol_delete_file($fileindex);
dol_delete_file($fileindex);
$indexcontent = '<?php'."\n"; $indexcontent = '<?php'."\n";
$indexcontent.= "// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n"; $indexcontent.= "// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n";
$indexcontent.= '$websitekey=basename(dirname(__FILE__));'."\n"; $indexcontent.= '$websitekey=basename(dirname(__FILE__));'."\n";
@ -639,11 +671,25 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl)
$indexcontent.= "}\n"; $indexcontent.= "}\n";
$indexcontent.= "include_once './".basename($filetpl)."'\n"; $indexcontent.= "include_once './".basename($filetpl)."'\n";
$indexcontent.= '// END PHP ?>'."\n"; $indexcontent.= '// END PHP ?>'."\n";
$result = file_put_contents($fileindex, $indexcontent); $result1 = file_put_contents($fileindex, $indexcontent);
if (! empty($conf->global->MAIN_UMASK)) if (! empty($conf->global->MAIN_UMASK))
@chmod($fileindex, octdec($conf->global->MAIN_UMASK)); @chmod($fileindex, octdec($conf->global->MAIN_UMASK));
return $result; dol_delete_file($filewrapper);
$wrappercontent = '<?php'."\n";
$wrappercontent.= "// BEGIN PHP File generated to provide a wrapper.php - DO NOT MODIFY - It is just a generated wrapper.\n";
$wrappercontent.= '$websitekey=basename(dirname(__FILE__));'."\n";
$wrappercontent.= "if (! defined('USEDOLIBARRSERVER')) { require_once './master.inc.php'; } // Load master if not already loaded\n";
$wrappercontent.= '$original_file=str_replace("../","/", GETPOST("file","alpha"));'."\n";
$wrappercontent.= 'if ($_GET["modulepart"] == "mycompany" && preg_match(\'/^\/?logos\//\', $original_file)) readfile(dol_osencode($conf->mycompany->dir_output."/".$original_file));'."\n";
$wrappercontent.= "else print 'Bad value for modulepart or file';\n";
$wrappercontent.= 'if (is_object($db)) $db->close();'."\n";
$wrappercontent.= '// END PHP ?>'."\n";
$result2 = file_put_contents($filewrapper, $wrappercontent);
if (! empty($conf->global->MAIN_UMASK))
@chmod($filewrapper, octdec($conf->global->MAIN_UMASK));
return ($result1 && $result2);
} }
@ -781,5 +827,3 @@ function dolSaveHtaccessFile($filehtaccess, $htaccess)
return true; return true;
} }

View File

@ -198,11 +198,11 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&amp;mainmenu=billing', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?leftmenu=donations&amp;mainmenu=billing', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__);
-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&amp;mainmenu=billing', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?leftmenu=donations&amp;mainmenu=billing', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__);
-- Special expenses -- Special expenses
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&amp;mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax&amp;mainmenu=billing', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&amp;mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->payment->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary&amp;mainmenu=billing', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&amp;action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->payment->write', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/card.php?leftmenu=tax_salary&amp;action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->payment->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/index.php?leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/stats/index.php?leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->payment->read', '', 0, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/compta/salaries/stats/index.php?leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&amp;mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/index.php?leftmenu=tax_loan&amp;mainmenu=billing', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&amp;action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&amp;action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__);
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__);

View File

@ -80,8 +80,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
$showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal);
if ($showmode) if ($showmode)
{ {
$langs->load("companies"); // Load translation files required by the page
$langs->load("suppliers"); $langs->loadLangs(array("companies","suppliers"));
$classname=""; $classname="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "companies") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; }
@ -152,7 +152,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
if (! empty($conf->loan->enabled)) $menuqualified++; if (! empty($conf->loan->enabled)) $menuqualified++;
$tmpentry=array( $tmpentry=array(
'enabled'=>$menuqualified, 'enabled'=>$menuqualified,
'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)),
'module'=>'facture|supplier_invoice|don|tax|salaries|loan'); 'module'=>'facture|supplier_invoice|don|tax|salaries|loan');
$showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal);
if ($showmode) if ($showmode)
@ -174,8 +174,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
$showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal);
if ($showmode) if ($showmode)
{ {
$langs->load("compta"); // Load translation files required by the page
$langs->load("banks"); $langs->loadLangs(array("compta","banks"));
$classname=""; $classname="";
if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "bank") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } 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") if ($usemenuhider || empty($leftmenu) || $leftmenu=="setup")
{ {
$langs->load("admin"); // Load translation files required by the page
$langs->load("help"); $langs->loadLangs(array("admin","help"));
$warnpicto=''; $warnpicto='';
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY))
@ -883,7 +883,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{ {
global $mysoc; global $mysoc;
$permtoshowmenu=((! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)); $permtoshowmenu=((! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire));
$newmenu->add("/compta/charges/index.php?leftmenu=tax&amp;mainmenu=billing",$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); $newmenu->add("/compta/charges/index.php?leftmenu=tax&amp;mainmenu=billing",$langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax');
// Social contributions // Social contributions
@ -931,10 +931,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->salaries->enabled)) if (! empty($conf->salaries->enabled))
{ {
$langs->load("salaries"); $langs->load("salaries");
$newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&amp;mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->payment->read, '', $mainmenu, 'tax_salary'); $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary&amp;mainmenu=billing",$langs->trans("Salaries"),1,$user->rights->salaries->read, '', $mainmenu, 'tax_salary');
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->payment->write); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write);
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->payment->read); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read);
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->payment->read); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"),2,$user->rights->salaries->read);
} }
// Loan // Loan
@ -1176,10 +1176,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
*/ */
if ($mainmenu == 'bank') if ($mainmenu == 'bank')
{ {
$langs->load("withdrawals"); // Load translation files required by the page
$langs->load("banks"); $langs->loadLangs(array("withdrawals","banks","bills","categories"));
$langs->load("bills");
$langs->load('categories');
// Bank-Caisse // Bank-Caisse
if (! empty($conf->banque->enabled)) 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 // Leave/Holiday/Vacation module
if (! empty($conf->holiday->enabled)) if (! empty($conf->holiday->enabled))
{ {
$langs->load("holiday"); // Load translation files required by the page
$langs->load("trips"); $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/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); $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)) if (! empty($conf->adherent->enabled))
{ {
$langs->load("members"); // Load translation files required by the page
$langs->load("compta"); $langs->loadLangs(array("members","compta"));
$newmenu->add("/adherents/index.php?leftmenu=members&amp;mainmenu=members",$langs->trans("Members"),0,$user->rights->adherent->lire, '', $mainmenu, 'members'); $newmenu->add("/adherents/index.php?leftmenu=members&amp;mainmenu=members",$langs->trans("Members"),0,$user->rights->adherent->lire, '', $mainmenu, 'members');
$newmenu->add("/adherents/card.php?leftmenu=members&amp;action=create",$langs->trans("NewMember"),1,$user->rights->adherent->creer); $newmenu->add("/adherents/card.php?leftmenu=members&amp;action=create",$langs->trans("NewMember"),1,$user->rights->adherent->creer);

View File

@ -68,8 +68,9 @@ class CommActionRapport
function __construct($db, $month, $year) function __construct($db, $month, $year)
{ {
global $conf,$langs; 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->db = $db;
$this->description = ""; $this->description = "";

View File

@ -47,10 +47,8 @@ class pdf_ban extends ModeleBankAccountDoc
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
$langs->load("main"); // Load translation files required by the page
$langs->load("bank"); $langs->loadLangs(array("main","bank","withdrawals","companies"));
$langs->load("withdrawals");
$langs->load("companies");
$this->db = $db; $this->db = $db;
$this->name = "ban"; $this->name = "ban";

View File

@ -53,8 +53,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
$langs->load("main"); // Load translation files required by the page
$langs->load("companies"); $langs->loadLangs(array("main","companies"));
$this->db = $db; $this->db = $db;
$this->name = "ODT templates"; $this->name = "ODT templates";
@ -98,8 +98,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
{ {
global $conf,$langs; global $conf,$langs;
$langs->load("companies"); // Load translation files required by the page
$langs->load("errors"); $langs->loadLangs(array("errors","companies"));
$form = new Form($this->db); $form = new Form($this->db);

View File

@ -52,8 +52,8 @@ class doc_generic_contract_odt extends ModelePDFContract
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
$langs->load("main"); // Load translation files required by the page
$langs->load("companies"); $langs->loadLangs(array("main","companies"));
$this->db = $db; $this->db = $db;
$this->name = "ODT templates"; $this->name = "ODT templates";

View File

@ -54,8 +54,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
$langs->load("main"); // Load translation files required by the page
$langs->load("companies"); $langs->loadLangs(array("main","companies"));
$this->db = $db; $this->db = $db;
$this->name = "ODT templates"; $this->name = "ODT templates";
@ -99,8 +99,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
{ {
global $conf,$langs; global $conf,$langs;
$langs->load("companies"); // Load translation files required by the page
$langs->load("errors"); $langs->loadLangs(array("errors","companies"));
$form = new Form($this->db); $form = new Form($this->db);

View File

@ -116,10 +116,9 @@ class mailing_contacts1 extends MailingTargets
function formFilter() function formFilter()
{ {
global $langs; global $langs;
$langs->load("companies");
$langs->load("commercial"); // Load translation files required by the page
$langs->load("suppliers"); $langs->loadLangs(array("commercial","companies","suppliers","categories"));
$langs->load("categories");
$s=''; $s='';

View File

@ -109,9 +109,9 @@ class mailing_fraise extends MailingTargets
function formFilter() function formFilter()
{ {
global $conf, $langs; global $conf, $langs;
$langs->load("members");
$langs->load("categories"); // Load translation files required by the page
$langs->load("companies"); $langs->loadLangs(array("members","companies","categories"));
$form=new Form($this->db); $form=new Form($this->db);

View File

@ -50,7 +50,7 @@ class modSalaries extends DolibarrModules
$this->db = $db; $this->db = $db;
$this->numero = 510; // Perms from 501..519 $this->numero = 510; // Perms from 501..519
$this->family = "hr"; $this->family = "compta";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this)); $this->name = preg_replace('/^mod/i','',get_class($this));
// Module description used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) // Module description used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@ -99,55 +99,32 @@ class modSalaries extends DolibarrModules
$r=0; $r=0;
$r++; $r++;
$this->rights[$r][0] = 501; $this->rights[$r][0] = 511;
$this->rights[$r][1] = 'Read employee contracts/salaries'; $this->rights[$r][1] = 'Read payments of employee salaries';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'read'; $this->rights[$r][4] = 'read';
$this->rights[$r][5] = ''; $this->rights[$r][5] = '';
$r++; $r++;
$this->rights[$r][0] = 502; $this->rights[$r][0] = 512;
$this->rights[$r][1] = 'Create/modify employee contracts/salaries'; $this->rights[$r][1] = 'Create/modify payments of empoyee salaries';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'write'; $this->rights[$r][4] = 'write';
$this->rights[$r][5] = ''; $this->rights[$r][5] = '';
$r++;
$this->rights[$r][0] = 511;
$this->rights[$r][1] = 'Read payment of salaries';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'payment';
$this->rights[$r][5] = 'read';
$r++;
$this->rights[$r][0] = 512;
$this->rights[$r][1] = 'Create/modify payment of salaries';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'payment';
$this->rights[$r][5] = 'write';
$r++; $r++;
$this->rights[$r][0] = 514; $this->rights[$r][0] = 514;
$this->rights[$r][1] = 'Delete contracts/salaries'; $this->rights[$r][1] = 'Delete payments of employee salary';
$this->rights[$r][2] = 'd'; $this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'delete'; $this->rights[$r][4] = 'delete';
$this->rights[$r][5] = ''; $this->rights[$r][5] = '';
$this->rights[$r][0] = 515;
$this->rights[$r][1] = 'Read all salaries';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'payment';
$this->rights[$r][5] = 'readall';
$r++; $r++;
$this->rights[$r][0] = 517; $this->rights[$r][0] = 517;
$this->rights[$r][1] = 'Export employee contracts and salaries payments'; $this->rights[$r][1] = 'Export payments of employee salaries';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'export'; $this->rights[$r][4] = 'export';

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> /* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -16,18 +17,18 @@
*/ */
/** /**
* \defgroup Skype Module skype * \defgroup SocialNetworks Module SocialNetworks
* \brief Add a skype button. * \brief Add a SocialNetworks button.
* \file htdocs/core/modules/modSkype.class.php * \file htdocs/core/modules/modSocialNetworks.class.php
* \ingroup Skype * \ingroup socialnetworks
* \brief Description and activation file for module skype * \brief Description and activation file for module SocialNetworks
*/ */
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** /**
* Class to describe a Skype module * Class to describe a SocialNetworks module
*/ */
class modSkype extends DolibarrModules class modSocialNetworks extends DolibarrModules
{ {
/** /**
@ -40,29 +41,29 @@ class modSkype extends DolibarrModules
global $langs,$conf; global $langs,$conf;
$this->db = $db; $this->db = $db;
$this->numero = 3100; $this->numero = 3300;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page // It is used to group modules in module setup page
$this->family = "interface"; $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this)); $this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable Skype links into contacts"; $this->description = "Enable Social Networks fields into contacts";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr'; $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module. // Name of image file used for this module.
$this->picto='skype'; $this->picto='generic';
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array(); $this->dirs = array();
// Config pages // Config pages
$this->config_page_url = array(); $this->config_page_url = array("socialnetworks.php");
// Dependencies // Dependencies
$this->hidden = ! empty($conf->global->MODULE_SKYPE_DISABLED); // A condition to hide module $this->hidden = ! empty($conf->global->MODULE_SOCIALNETWORKS_DISABLED); // A condition to hide module
$this->depends = array('modSociete'); // List of module class names as string that must be enabled if this module is enabled $this->depends = array('modSociete'); // List of module class names as string that must be enabled if this module is enabled
$this->requiredby = array(); // List of module ids to disable if this one is disabled $this->requiredby = array(); // List of module ids to disable if this one is disabled
$this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->conflictwith = array(); // List of module class names as string this module is in conflict with

View File

@ -85,7 +85,7 @@ class modSyslog extends DolibarrModules
// Cronjobs // Cronjobs
$this->cronjobs = array( $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),
); );
} }
} }

View File

@ -78,7 +78,7 @@ $(document).ready(function () {
</script> </script>
<?php } ?> <?php } ?>
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.'), rgb(240,240,240));"':'' ?>> <div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.5), rgb(240,240,240));"':'' ?>>
<div class="login_vertical_align"> <div class="login_vertical_align">
<form id="login" name="login" method="post" action="<?php echo $php_self; ?>"> <form id="login" name="login" method="post" action="<?php echo $php_self; ?>">

View File

@ -260,13 +260,13 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php if ($line->special_code == 3) { ?> <?php if ($line->special_code == 3) { ?>
<td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td> <td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td>
<?php } else { ?> <?php } else { ?>
<td align="right" class="liencolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td> <td align="right" class="linecolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td>
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> <?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
<td align="right" class="linecolutotalht_currency nowrap"><?php $coldisplay++; ?><?php echo price($line->multicurrency_total_ht); ?></td> <td align="right" class="linecolutotalht_currency nowrap"><?php $coldisplay++; ?><?php echo price($line->multicurrency_total_ht); ?></td>
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
<?php if ($outputalsopricetotalwithtax) { ?> <?php if ($outputalsopricetotalwithtax) { ?>
<td align="right" class="liencolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ttc); ?></td> <td align="right" class="linecolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ttc); ?></td>
<?php } ?> <?php } ?>

View File

@ -1,4 +1,4 @@
<?php <<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr> /* Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -118,6 +118,28 @@ if (! empty($conf->adherent->enabled))
} }
print '<br>'; print '<br>';
} }
if (! empty($conf->don->enabled))
{
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnDonation",$servicename).':<br>';
print '<strong>'.getOnlinePaymentUrl(1,'donation')."</strong><br>\n";
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN) && ! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE))
{
$langs->load("members");
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Don")).': ';
print '<input type="text class="flat" id="generate_donation_ref" name="generate_donation_ref" value="'.GETPOST('generate_donation_ref','alpha').'" size="10">';
print '<input type="submit" class="none reposition button" value="'.$langs->trans("GetSecuredUrl").'">';
if (GETPOST('generate_donation_ref'))
{
print '<br> -> <strong>';
$url=getOnlinePaymentUrl(0,'donation',GETPOST('generate_donation_ref','alpha'));
print $url;
print "</strong><br>\n";
}
print '</form>';
}
print '<br>';
}
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
{ {
@ -140,3 +162,4 @@ print info_admin($langs->trans("YouCanAddTagOnUrl"));
print '<!-- END PHP TEMPLATE ONLINEPAYMENTLINKS -->'; print '<!-- END PHP TEMPLATE ONLINEPAYMENTLINKS -->';

View File

@ -66,7 +66,7 @@ $(document).ready(function () {
<?php } ?> <?php } ?>
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.'), rgb(240,240,240));"':'' ?>> <div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.5), rgb(240,240,240));"':'' ?>>
<div class="login_vertical_align"> <div class="login_vertical_align">
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>"> <form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Thibault FOUCART <support@ptibogxiv.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -26,13 +27,16 @@
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.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/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.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 . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.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 . '/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.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)) if (! empty($conf->projet->enabled))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; 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'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$langs->load("companies"); $langs->loadLangs(array("bills","companies","donations")); // File with generic data
$langs->load("donations");
$langs->load("bills");
$id=GETPOST('rowid')?GETPOST('rowid','int'):GETPOST('id','int'); $id=GETPOST('rowid')?GETPOST('rowid','int'):GETPOST('id','int');
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
@ -326,38 +328,92 @@ if ($action == 'create')
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tbody>'; print '<tbody>';
// Date // Ref
print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td colspan="2">' . $langs->trans('Draft') . '</td></tr>';
// Company
if (! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES))
{
// Thirdparty
print '<td>' . $langs->trans('Customer') . '</td>';
if ($soc->id > 0 && ! GETPOST('fac_rec','alpha'))
{
print '<td colspan="2">';
print $soc->getNomUrl(1);
print '<input type="hidden" name="socid" value="' . $soc->id . '">';
// 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 '</td>';
}
else
{
print '<td colspan="2">';
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 '<script type="text/javascript">
$(document).ready(function() {
$("#socid").change(function() {
var socid = $(this).val();
var fac_rec = $(\'#fac_rec\').val();
// reload page
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&fac_rec="+fac_rec;
});
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td>';
}
print '</tr>' . "\n";
}
// Date
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Date").'</td><td>'; print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Date").'</td><td>';
$form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
print '</td>'; print '</td>';
// Amount // Amount
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.dol_escape_htmltag(GETPOST("amount")).'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>'; print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.dol_escape_htmltag(GETPOST("amount")).'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Public donation
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>"; print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
print "</td></tr>\n"; print "</td></tr>\n";
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.dol_escape_htmltag(GETPOST("societe")).'" class="maxwidth200"></td></tr>'; if (empty($conf->societe->enabled) || empty($conf->global->DONATION_USE_THIRDPARTIES))
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.dol_escape_htmltag(GETPOST("lastname")).'" class="maxwidth200"></td></tr>'; {
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.dol_escape_htmltag(GETPOST("firstname")).'" class="maxwidth200"></td></tr>'; print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.dol_escape_htmltag(GETPOST("societe")).'" class="maxwidth200"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'; print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.dol_escape_htmltag(GETPOST("lastname")).'" class="maxwidth200"></td></tr>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="3">'.dol_escape_htmltag(GETPOST("address")).'</textarea></td></tr>'; print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.dol_escape_htmltag(GETPOST("firstname")).'" class="maxwidth200"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="3">'.dol_escape_htmltag(GETPOST("address")).'</textarea></td></tr>';
// Zip / Town // Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'; print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print ' '; print ' ';
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</tr>'; print '</tr>';
// Country // Country
print '<tr><td><label for="selectcountry_id">'.$langs->trans('Country').'</label></td><td class="maxwidthonsmartphone">'; print '<tr><td><label for="selectcountry_id">'.$langs->trans('Country').'</label></td><td class="maxwidthonsmartphone">';
print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id); print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id);
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print '</td></tr>'; print '</td></tr>';
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200"></td></tr>'; print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200"></td></tr>';
}
// Payment mode // Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n"; print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
@ -791,6 +847,16 @@ if (! empty($id) && $action != 'edit')
$linktoelem = $form->showLinkToObjectBlock($object, null, array('don')); $linktoelem = $form->showLinkToObjectBlock($object, null, array('don'));
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); $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 '<br><!-- Link to pay -->'."\n";
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('donation', $object->ref).'<br>';
}
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
print '</div></div></div>'; print '</div></div></div>';

View File

@ -73,12 +73,6 @@ class Don extends CommonObject
public $labelstatut; public $labelstatut;
public $labelstatutshort; public $labelstatutshort;
/**
* @deprecated
* @see note_private, note_public
*/
public $commentaire;
/** /**
* Constructor * Constructor
@ -87,9 +81,7 @@ class Don extends CommonObject
*/ */
function __construct($db) function __construct($db)
{ {
global $langs; $this->db = $db;
$this->db = $db;
} }
@ -384,8 +376,8 @@ class Don extends CommonObject
$sql.= ", '".$this->db->escape($this->address)."'"; $sql.= ", '".$this->db->escape($this->address)."'";
$sql.= ", '".$this->db->escape($this->zip)."'"; $sql.= ", '".$this->db->escape($this->zip)."'";
$sql.= ", '".$this->db->escape($this->town)."'"; $sql.= ", '".$this->db->escape($this->town)."'";
$sql.= ", ".$this->country_id; $sql.= ", ".($this->country_id > 0 ? $this->country_id : '0');
$sql.= ", ".$this->public; $sql.= ", ".((int) $this->public);
$sql.= ", ".($this->fk_project > 0?$this->fk_project:"null"); $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_private)?("'".$this->db->escape($this->note_private)."'"):"NULL");
$sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL");
@ -397,7 +389,6 @@ class Don extends CommonObject
$sql.= ", '".$this->db->escape($this->phone_mobile)."'"; $sql.= ", '".$this->db->escape($this->phone_mobile)."'";
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -433,8 +424,8 @@ class Don extends CommonObject
if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS)) if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS))
{ {
$res = $this->setValid($user); //$res = $this->setValid($user);
if ($res < 0) $error++; //if ($res < 0) $error++;
} }
if (!$error) if (!$error)
@ -688,7 +679,6 @@ class Don extends CommonObject
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;
$this->commentaire = $obj->note; // deprecated
// Retreive all extrafield // Retreive all extrafield
// fetch optionals attributes and labels // fetch optionals attributes and labels

View File

@ -109,7 +109,7 @@ if (empty($reshook))
if ($action == 'setsupplier_order_min_amount') if ($action == 'setsupplier_order_min_amount')
{ {
$object->fetch($id); $object->fetch($id);
$object->supplier_order_min_amount=GETPOST('supplier_order_min_amount'); $object->supplier_order_min_amount=price2num(GETPOST('supplier_order_min_amount','alpha'));
$result=$object->update($object->id, $user); $result=$object->update($object->id, $user);
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
} }
@ -298,15 +298,17 @@ if ($object->id > 0)
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr class="nowrap">'; if (! empty($conf->fournisseur->enabled) && ! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT))
print '<td>'; {
print $form->editfieldkey("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer); print '<tr class="nowrap">';
print '</td><td>'; print '<td>';
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; print $form->editfieldkey("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer);
print $form->editfieldval("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->supplier_order_min_amount != '' ? price($object->supplier_order_min_amount) : '')); print '</td><td>';
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
print '</td>'; print $form->editfieldval("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->supplier_order_min_amount != '' ? price($object->supplier_order_min_amount) : ''));
print '</tr>'; print '</td>';
print '</tr>';
}
// Categories // Categories
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))

View File

@ -2125,7 +2125,7 @@ class FactureFournisseur extends CommonInvoice
$response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24;
$response->label=$langs->trans("SupplierBillsToPay"); $response->label=$langs->trans("SupplierBillsToPay");
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=suppliers_bills'; $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=billing&leftmenu=suppliers_bills';
$response->img=img_object($langs->trans("Bills"),"bill"); $response->img=img_object($langs->trans("Bills"),"bill");
$facturestatic = new FactureFournisseur($this->db); $facturestatic = new FactureFournisseur($this->db);

View File

@ -2120,7 +2120,7 @@ elseif (! empty($object->id))
// Total // Total
$alert = ''; $alert = '';
if($object->total_ht < $object->thirdparty->supplier_order_min_amount) { if (! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->supplier_order_min_amount) {
$alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount)); $alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount));
} }
print '<tr><td class="titlefieldmiddle">'.$langs->trans("AmountHT").'</td>'; print '<tr><td class="titlefieldmiddle">'.$langs->trans("AmountHT").'</td>';

View File

@ -270,11 +270,11 @@ if (empty($user->societe_id))
DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products', DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products',
DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial&leftmenu=propals',
DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial&leftmenu=orders', DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial&leftmenu=orders',
DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy&leftmenu=customers_bills', DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills',
DOL_URL_ROOT.'/contrat/list.php?mainmenu=commercial&leftmenu=contracts', DOL_URL_ROOT.'/contrat/list.php?mainmenu=commercial&leftmenu=contracts',
DOL_URL_ROOT.'/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', DOL_URL_ROOT.'/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter',
DOL_URL_ROOT.'/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', DOL_URL_ROOT.'/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers',
DOL_URL_ROOT.'/fourn/facture/list.php?mainmenu=accountancy&leftmenu=suppliers_bills', DOL_URL_ROOT.'/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills',
DOL_URL_ROOT.'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=', DOL_URL_ROOT.'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=',
DOL_URL_ROOT.'/projet/list.php?mainmenu=project', DOL_URL_ROOT.'/projet/list.php?mainmenu=project',
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport',

View File

@ -466,6 +466,7 @@ new_pmp double DEFAULT 0
)ENGINE=InnoDB; )ENGINE=InnoDB;
ALTER TABLE llx_inventory ADD COLUMN datec datetime DEFAULT NULL; 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_tms (tms);
ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec); ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec);

View File

@ -70,3 +70,7 @@ ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after a
ALTER TABLE llx_categorie ADD COLUMN ref_ext varchar(255); ALTER TABLE llx_categorie ADD COLUMN ref_ext varchar(255);
ALTER TABLE llx_societe ADD COLUMN twitter varchar(255) after skype;
ALTER TABLE llx_societe ADD COLUMN facebook varchar(255) after skype;
ALTER TABLE llx_socpeople ADD COLUMN twitter varchar(255) after skype;
ALTER TABLE llx_socpeople ADD COLUMN facebook varchar(255) after skype;

View File

@ -51,6 +51,8 @@ create table llx_societe
url varchar(255), -- url varchar(255), --
email varchar(128), -- email varchar(128), --
skype varchar(255), -- skype varchar(255), --
twitter varchar(255), --
facebook varchar(255), --
fk_effectif integer DEFAULT 0, -- fk_effectif integer DEFAULT 0, --
fk_typent integer DEFAULT 0, -- fk_typent integer DEFAULT 0, --
fk_forme_juridique integer DEFAULT 0, -- juridical status fk_forme_juridique integer DEFAULT 0, -- juridical status

View File

@ -43,6 +43,8 @@ create table llx_socpeople
email varchar(255), email varchar(255),
jabberid varchar(255), jabberid varchar(255),
skype varchar(255), skype varchar(255),
twitter varchar(255), --
facebook varchar(255), --
photo varchar(255), photo varchar(255),
no_email smallint NOT NULL DEFAULT 0, no_email smallint NOT NULL DEFAULT 0,
priv smallint NOT NULL DEFAULT 0, priv smallint NOT NULL DEFAULT 0,

View File

@ -4444,6 +4444,7 @@ function migrate_delete_old_files($db,$langs,$conf)
DOL_DOCUMENT_ROOT.'/core/modules/modComptabiliteExpert.class.php', DOL_DOCUMENT_ROOT.'/core/modules/modComptabiliteExpert.class.php',
DOL_DOCUMENT_ROOT.'/core/modules/modCommercial.class.php', DOL_DOCUMENT_ROOT.'/core/modules/modCommercial.class.php',
DOL_DOCUMENT_ROOT.'/core/modules/modProduit.class.php', DOL_DOCUMENT_ROOT.'/core/modules/modProduit.class.php',
DOL_DOCUMENT_ROOT.'/core/modules/modSkype.class.php',
DOL_DOCUMENT_ROOT.'/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php', DOL_DOCUMENT_ROOT.'/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php',
DOL_DOCUMENT_ROOT.'/webcalendar/inc/triggers/interface_modWebcalendar_webcalsynchro.class.php', DOL_DOCUMENT_ROOT.'/webcalendar/inc/triggers/interface_modWebcalendar_webcalsynchro.class.php',
DOL_DOCUMENT_ROOT.'/core/triggers/interface_modWebcalendar_Webcalsynchro.class.php', DOL_DOCUMENT_ROOT.'/core/triggers/interface_modWebcalendar_Webcalsynchro.class.php',

View File

@ -791,11 +791,9 @@ Permission401=Read discounts
Permission402=Create/modify discounts Permission402=Create/modify discounts
Permission403=Validate discounts Permission403=Validate discounts
Permission404=Delete discounts Permission404=Delete discounts
Permission501=Read employee contracts/salaries Permission511=Read payments of salaries
Permission502=Create/modify employee contracts/salaries Permission512=Create/modify payments of salaries
Permission511=Read payment of salaries Permission514=Delete payments of salaries
Permission512=Create/modify payment of salaries
Permission514=Delete salaries
Permission517=Export salaries Permission517=Export salaries
Permission520=Read Loans Permission520=Read Loans
Permission522=Create/modify loans Permission522=Create/modify loans

View File

@ -31,4 +31,5 @@ OnlinePaymentSystem=Online payment system
PaypalLiveEnabled=PayPal live enabled (otherwise test/sandbox mode) PaypalLiveEnabled=PayPal live enabled (otherwise test/sandbox mode)
PaypalImportPayment=Import PayPal payments PaypalImportPayment=Import PayPal payments
PostActionAfterPayment=Post actions after 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. 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

View File

@ -88,4 +88,5 @@ AliasPageAlreadyExists=Alias page <strong>%s</strong> already exists
CorporateHomePage=Corporate Home page CorporateHomePage=Corporate Home page
EmptyPage=Empty page EmptyPage=Empty page
ExternalURLMustStartWithHttp=External URL must start with http:// or https:// ExternalURLMustStartWithHttp=External URL must start with http:// or https://
ZipOfWebsitePackageToImport=Zip file of website package ZipOfWebsitePackageToImport=Zip file of website package
ShowSubcontainers=Show included containers

View File

@ -116,7 +116,7 @@ SendingEmailOnCancelation=Envoie d'email à l'annulation
# Topic of email templates # Topic of email templates
YourMembershipRequestWasReceived=Votre demande d'adhésion a été reçue. YourMembershipRequestWasReceived=Votre demande d'adhésion a été reçue.
YourMembershipWasValidated=Votre adhésion a été enregistrée 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 SubscriptionReminderEmail=Rappel de cotisation
YourMembershipWasCanceled=Votre adhésion a été annulée YourMembershipWasCanceled=Votre adhésion a été annulée
CardContent=Contenu de votre fiche adhérent CardContent=Contenu de votre fiche adhérent

View File

@ -238,7 +238,7 @@ if (empty($reshook))
$form = new Form($db); $form = new Form($db);
$formproject = new FormProjets($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"); $title = $langs->trans("Loan") . ' - ' . $langs->trans("Card");
$help_url = 'EN:Module_Loan|FR:Module_Emprunt'; $help_url = 'EN:Module_Loan|FR:Module_Emprunt';

View File

@ -430,7 +430,7 @@ class LoanSchedule extends CommonObject
{ {
while($obj = $this->db->fetch_object($resql)) while($obj = $this->db->fetch_object($resql))
{ {
$line = New LoanSchedule($this->db); $line = new LoanSchedule($this->db);
$line->id = $obj->rowid; $line->id = $obj->rowid;
$line->ref = $obj->rowid; $line->ref = $obj->rowid;

View File

@ -1185,7 +1185,7 @@ elseif (! empty($module))
print '<br>'; print '<br>';
print '<br>'; print '<br>';
print_fiche_titre($langs->trans("DescriptorFile")); print load_fiche_titre($langs->trans("DescriptorFile"));
if (! empty($moduleobj)) if (! empty($moduleobj))
{ {
@ -1249,7 +1249,7 @@ elseif (! empty($module))
print '<br><br>'; print '<br><br>';
// Readme file // Readme file
print_fiche_titre($langs->trans("ReadmeFile")); print load_fiche_titre($langs->trans("ReadmeFile"));
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<div class="fichecenter">'; print '<div class="fichecenter">';
@ -1259,7 +1259,7 @@ elseif (! empty($module))
print '<br><br>'; print '<br><br>';
// ChangeLog // ChangeLog
print_fiche_titre($langs->trans("ChangeLog")); print load_fiche_titre($langs->trans("ChangeLog"));
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -410,27 +410,27 @@ class MyObject extends CommonObject
elseif ($mode == 2) elseif ($mode == 2)
{ {
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; 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) elseif ($mode == 3)
{ {
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4'); 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) elseif ($mode == 4)
{ {
if ($status == 1) return img_picto($this->labelstatus[$status],'statut4').' '.$this->labelstatus[$status]; 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) elseif ($mode == 5)
{ {
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); 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) elseif ($mode == 6)
{ {
if ($status == 1) return $this->labelstatus[$status].' '.img_picto($this->labelstatus[$status],'statut4'); 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');
} }
} }

Some files were not shown because too many files have changed in this diff Show More