Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2018-04-27 10:18:40 +02:00
commit 489318d4db
30 changed files with 181 additions and 188 deletions

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2016 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) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
@ -657,7 +657,6 @@ if ($id)
{
$num = $db->num_rows($resql);
$i = 0;
$var=true;
$param = '&id='.$id;
if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id;
@ -1036,7 +1035,6 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
global $form;
global $region_id;
global $elementList,$sourceList;
global $bc;
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);

View File

@ -456,7 +456,6 @@ if ($id)
if ($tabname[$id])
{
$alabelisused=0;
$var=false;
$fieldlist=explode(',',$tabfield[$id]);
@ -550,7 +549,6 @@ if ($id)
{
$num = $db->num_rows($resql);
$i = 0;
$var=true;
$param = '&id='.$id;
if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id;

View File

@ -417,7 +417,6 @@ if ($id)
if ($tabname[$id])
{
$alabelisused=0;
$var=false;
$fieldlist=explode(',',$tabfield[$id]);
@ -497,7 +496,6 @@ if ($id)
{
$num = $db->num_rows($resql);
$i = 0;
$var=true;
$param = '&id='.$id;
if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id;

View File

@ -36,13 +36,12 @@ $langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("members");
$var=true;
$total=0;
foreach($linkedObjectBlock as $key => $objectlink)
{
?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> >
<tr class="oddeven" >
<td><?php echo $langs->trans("Subscription"); ?></td>
<td><?php echo $objectlink->getNomUrl(1); ?></td>
<td align="center"></td>

View File

@ -148,7 +148,6 @@ print "<br>\n";
$selectedvalue=$conf->global->AGENDA_DISABLE_EXT;
if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
$var=true;
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
@ -202,7 +201,6 @@ print '<td align="right">'.$langs->trans("Color").'</td>';
print "</tr>";
$i=1;
$var=true;
while ($i <= $MAXAGENDA)
{
$key=$i;

View File

@ -157,7 +157,6 @@ foreach($dirbarcode as $reldir)
/*
* CHOIX ENCODAGE
*/
$var=true;
print '<br>';
print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'','');
@ -185,7 +184,6 @@ if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$var=true;
while ($i < $num)
{
@ -277,7 +275,6 @@ print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -31,11 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
$langs->load("admin");
$langs->load("companies");
$langs->load("bills");
$langs->load("other");
$langs->load("banks");
// Load traductions files requiredby by page
$langs->loadLangs(array("admin","companies","bills","other","banks"));
if (!$user->admin)
accessforbidden();
@ -133,8 +130,6 @@ foreach ($dirmodels as $reldir)
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS'))
@ -166,7 +161,6 @@ foreach ($dirmodels as $reldir)
if ($module->isEnabled())
{
$var = !$var;
print '<tr class="oddeven"><td width="100">';
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
@ -254,9 +248,6 @@ print '<td>'.$langs->trans("Parameters").'</td>';
print '<td align="center" width="60">&nbsp;</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
$var=true;
$var=! $var;
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");

View File

@ -72,8 +72,6 @@ print '<form method="post" action="clicktodial.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setvalue">';
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';

View File

@ -286,7 +286,6 @@ foreach ($dirmodels as $reldir)
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
@ -406,7 +405,6 @@ print "</tr>\n";
clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
@ -537,7 +535,6 @@ print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print "<td>&nbsp;</td>\n";
print "</tr>\n";
$var=true;
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
@ -545,7 +542,6 @@ $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>';
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_ORDER_FREE_TEXT">';

View File

@ -1,6 +1,6 @@
<?php
/* 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>
*
* 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
@ -28,9 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
$langs->load("admin");
$langs->load("errors");
$langs->load("contracts");
// Load traductions files requiredby by page
$langs->loadLangs(array("admin","errors","contracts"));
if (!$user->admin) accessforbidden();
@ -220,7 +219,6 @@ foreach ($dirmodels as $reldir)
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
@ -339,7 +337,6 @@ print "</tr>\n";
clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
@ -377,7 +374,6 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
$var = !$var;
print '<tr class="oddeven"><td width="100">';
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
@ -472,7 +468,6 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=true;
$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
@ -480,7 +475,6 @@ $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>';
$var=! $var;
print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("FreeLegalTextOnContracts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
print '<br>';

View File

@ -144,7 +144,7 @@ if ($action == 'update')
$plus='';
if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE';
// Update values
for($i=0;$i<4;$i++) {
for($i=0; $i<4; $i++) {
if(isset($_POST['MAIN_METEO'.$plus.'_LEVEL'.$i])) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'),'chaine',0,'',$conf->entity);
}
@ -172,7 +172,6 @@ if ($action == 'edit')
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="form_index">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
@ -215,7 +214,6 @@ else
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
$var=true;
foreach($modules as $module => $delays)
{
@ -241,7 +239,6 @@ else
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
$var=false;
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';

View File

@ -80,7 +80,6 @@ print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
print '</tr>';
$var=true;
$form = new Form($db);
// Mail required for members

View File

@ -31,9 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("users");
$langs->load("admin");
$langs->load("other");
// Load traductions files requiredby by page
$langs->loadLangs(array("users","admin","other"));
$action=GETPOST('action','aZ09');
@ -42,7 +41,6 @@ $securityevent=new Events($db);
$eventstolog=$securityevent->eventstolog;
/*
* Actions
*/
@ -88,8 +86,6 @@ $head=security_prepare_head();
dol_fiche_head($head, 'audit', $langs->trans("Security"), -1);
$var=true;
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print "<td colspan=\"2\">".$langs->trans("LogEvents")."</td>";
@ -98,8 +94,7 @@ print "</tr>\n";
foreach ($eventstolog as $key => $arr)
{
if ($arr['id'])
{
{
print '<tr class="oddeven">';
print '<td>'.$arr['id'].'</td>';
print '<td>';

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* 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>
*
* 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
@ -233,8 +233,6 @@ foreach ($dirmodels as $reldir)
$handle = opendir($dir);
if (is_resource($handle))
{
$var=true;
while (($file = readdir($handle))!==false)
{
if (substr($file, 0, 18) == 'mod_expensereport_' && substr($file, dol_strlen($file)-3, 3) == 'php')
@ -351,7 +349,6 @@ print "</tr>\n";
clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/expensereport/doc");
@ -376,7 +373,6 @@ foreach ($dirmodels as $reldir)
if (file_exists($dir.'/'.$file))
{
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
@ -480,7 +476,6 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print "</tr>\n";
$var=true;
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
@ -488,7 +483,6 @@ $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>';
$var=! $var;
print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
$variablename='EXPENSEREPORT_FREE_TEXT';

View File

@ -30,11 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.php';
$langs->load('admin');
$langs->load('other');
$langs->load('trips');
$langs->load('errors');
$langs->load('dict');
// Load traductions files requiredby by page
$langs->loadLangs(array("admin","other","trips","errors","dict"));
if (!$user->admin) accessforbidden();
@ -176,8 +173,7 @@ if ($action != 'edit')
echo '<th>&nbsp;</th>';
echo '</tr>';
$var=true;
echo '<tr '.$bc[$var].'>';
echo '<tr class="oddeven">';
echo '<td>';
echo '<div class="float">'.$form->selectarray('apply_to', $tab_apply, '', 0).'</div>';
echo '<div id="user" class="float">'.$form->select_dolusers('', 'fk_user').'</div>';
@ -220,10 +216,9 @@ echo '<th>'.$langs->trans('ExpenseReportRestrictive').'</th>';
echo '<th>&nbsp;</th>';
echo '</tr>';
$var=true;
foreach ($rules as $rule)
{
echo '<tr '.$bc[$var].'>';
echo '<tr class="oddeven">';
echo '<td>';
if ($action == 'edit' && $object->id == $rule->id)
@ -260,7 +255,6 @@ foreach ($rules as $rule)
echo '</td>';
echo '<td>';
if ($action == 'edit' && $object->id == $rule->id)
{
@ -335,7 +329,6 @@ foreach ($rules as $rule)
echo '</td>';
echo '</tr>';
$var=!$var;
}

View File

@ -250,8 +250,6 @@ if ($resql)
$rssparser=new RssParser($db);
$result = $rssparser->parser($conf->global->$keyrssurl, 5, 300, $conf->externalrss->dir_temp);
$var=true;
print "<br>";
print "<form name=\"externalrssconfig\" action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">";

View File

@ -139,8 +139,6 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values
print load_fiche_titre($langs->trans("AdvancedEditor"),$linkback,'title_setup');
print '<br>';
$var=true;
if (empty($conf->use_javascript_ajax))
{
setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors');
@ -158,7 +156,6 @@ else
{
// Si condition non remplie, on ne propose pas l'option
if (! $conditions[$const]) continue;
print '<tr class="oddeven">';
print '<td width="16">'.img_object("",$picto[$const]).'</td>';

View File

@ -30,8 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php';
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("errors");
// Load traductions files requiredby by page
$langs->loadLangs(array("admin","errors"));
$action = GETPOST('action','aZ09');
@ -94,7 +94,6 @@ else
}
// Mode
$var=true;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set">';
@ -105,7 +104,6 @@ print '<td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n";
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("PathToGeoIPMaxmindCountryDataFile").'</td>';
print '<td colspan="2">';

View File

@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$langs->load("admin");
$langs->load("errors");
// Load traductions files requiredby by page
$langs->loadLangs(array("admin","errors"));
if (!$user->admin)
accessforbidden();
@ -117,15 +117,12 @@ print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" width="100%">';
$var=true;
print '<tr class="liste_titre">';
print '<td colspan="4">'.$langs->trans("LDAPSynchronizeContacts").'</td>';
print "</tr>\n";
// DN Pour les contacts
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPContactDn").'</span></td><td>';
print '<input size="48" type="text" name="contactdn" value="'.$conf->global->LDAP_CONTACT_DN.'">';
print '</td><td>'.$langs->trans("LDAPContactDnExample").'</td>';
@ -133,7 +130,6 @@ print '<td>&nbsp;</td>';
print '</tr>';
// List of object class used to define attributes in structure
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPContactObjectClassList").'</span></td><td>';
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_CONTACT_OBJECT_CLASS.'">';
print '</td><td>'.$langs->trans("LDAPContactObjectClassListExample").'</td>';
@ -143,7 +139,6 @@ print '</tr>';
print '</table>';
print '<br>';
print '<table class="noborder" width="100%">';
$var=true;
print '<tr class="liste_titre">';
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
@ -152,7 +147,6 @@ print '<td align="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
print "</tr>\n";
// Common name
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFullname").'</td><td>';
print '<input size="25" type="text" name="fieldfullname" value="'.$conf->global->LDAP_CONTACT_FIELD_FULLNAME.'">';
print '</td><td>'.$langs->trans("LDAPFieldFullnameExample").'</td>';
@ -160,7 +154,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Name
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldName").'</td><td>';
print '<input size="25" type="text" name="fieldname" value="'.$conf->global->LDAP_CONTACT_FIELD_NAME.'">';
print '</td><td>'.$langs->trans("LDAPFieldNameExample").'</td>';
@ -168,7 +161,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Firstname
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFirstName").'</td><td>';
print '<input size="25" type="text" name="fieldfirstname" value="'.$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME.'">';
print '</td><td>'.$langs->trans("LDAPFieldFirstNameExample").'</td>';
@ -176,7 +168,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Company
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCompany").'</td><td>';
print '<input size="25" type="text" name="fieldcompany" value="'.$conf->global->LDAP_CONTACT_FIELD_COMPANY.'">';
print '</td><td>'.$langs->trans("LDAPFieldCompanyExample").'</td>';
@ -184,7 +175,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Mail
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldMail").'</td><td>';
print '<input size="25" type="text" name="fieldmail" value="'.$conf->global->LDAP_CONTACT_FIELD_MAIL.'">';
print '</td><td>'.$langs->trans("LDAPFieldMailExample").'</td>';
@ -192,7 +182,6 @@ print '<td align="right"><input type="radio" name="key" value=">LDAP_CONTACT_FIE
print '</tr>';
// Phone pro
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPhone").'</td><td>';
print '<input size="25" type="text" name="fieldphone" value="'.$conf->global->LDAP_CONTACT_FIELD_PHONE.'">';
print '</td><td>'.$langs->trans("LDAPFieldPhoneExample").'</td>';
@ -200,7 +189,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Phone home
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldHomePhone").'</td><td>';
print '<input size="25" type="text" name="fieldhomephone" value="'.$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE.'">';
print '</td><td>'.$langs->trans("LDAPFieldHomePhoneExample").'</td>';
@ -208,7 +196,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Mobile
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldMobile").'</td><td>';
print '<input size="25" type="text" name="fieldmobile" value="'.$conf->global->LDAP_CONTACT_FIELD_MOBILE.'">';
print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td>';
@ -216,7 +203,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Skype
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldSkype").'</td><td>';
print '<input size="25" type="text" name="fieldskype" value="'.$conf->global->LDAP_CONTACT_FIELD_SKYPE.'">';
print '</td><td>'.$langs->trans("LDAPFieldSkypeExample").'</td>';
@ -224,7 +210,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Fax
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFax").'</td><td>';
print '<input size="25" type="text" name="fieldfax" value="'.$conf->global->LDAP_CONTACT_FIELD_FAX.'">';
print '</td><td>'.$langs->trans("LDAPFieldFaxExample").'</td>';
@ -232,7 +217,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// Address
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldAddress").'</td><td>';
print '<input size="25" type="text" name="fieldaddress" value="'.$conf->global->LDAP_CONTACT_FIELD_ADDRESS.'">';
print '</td><td>'.$langs->trans("LDAPFieldAddressExample").'</td>';
@ -240,7 +224,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// ZIP
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldZip").'</td><td>';
print '<input size="25" type="text" name="fieldzip" value="'.$conf->global->LDAP_CONTACT_FIELD_ZIP.'">';
print '</td><td>'.$langs->trans("LDAPFieldZipExample").'</td>';
@ -248,7 +231,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// TOWN
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldTown").'</td><td>';
print '<input size="25" type="text" name="fieldtown" value="'.$conf->global->LDAP_CONTACT_FIELD_TOWN.'">';
print '</td><td>'.$langs->trans("LDAPFieldTownExample").'</td>';
@ -256,7 +238,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_CONTACT_FIEL
print '</tr>';
// COUNTRY
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_CONTACT_FIELD_COUNTRY.'">';
print '</td><td>&nbsp;</td>';

View File

@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
$langs->load("admin");
$langs->load("errors");
// Load traductions files requiredby by page
$langs->loadLangs(array("admin","errors"));
if (!$user->admin)
accessforbidden();
@ -109,14 +109,12 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$form=new Form($db);
print '<table class="noborder" width="100%">';
$var=true;
print '<tr class="liste_titre">';
print '<td colspan="4">'.$langs->trans("LDAPSynchronizeGroups").'</td>';
print "</tr>\n";
// DN pour les groupes
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPGroupDn").'</span></td><td>';
print '<input size="48" type="text" name="group" value="'.$conf->global->LDAP_GROUP_DN.'">';
print '</td><td>'.$langs->trans("LDAPGroupDnExample").'</td>';
@ -124,7 +122,6 @@ print '<td>&nbsp;</td>';
print '</tr>';
// List of object class used to define attributes in structure
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPGroupObjectClassList").'</span></td><td>';
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_GROUP_OBJECT_CLASS.'">';
print '</td><td>'.$langs->trans("LDAPGroupObjectClassListExample").'</td>';
@ -134,7 +131,6 @@ print '</tr>';
print '</table>';
print '<br>';
print '<table class="noborder" width="100%">';
$var=true;
print '<tr class="liste_titre">';
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
@ -145,7 +141,6 @@ print "</tr>\n";
// Filtre
// Common name
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldName").'</td><td>';
print '<input size="25" type="text" name="fieldfullname" value="'.$conf->global->LDAP_GROUP_FIELD_FULLNAME.'">';
print '</td><td>'.$langs->trans("LDAPFieldCommonNameExample").'</td>';
@ -162,7 +157,6 @@ print '</tr>';
*/
// Description
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldDescription").'</td><td>';
print '<input size="25" type="text" name="fielddescription" value="'.$conf->global->LDAP_GROUP_FIELD_DESCRIPTION.'">';
print '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
@ -170,7 +164,6 @@ print '<td align="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_
print '</tr>';
// User group
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldGroupMembers").'</td><td>';
print '<input size="25" type="text" name="fieldgroupmembers" value="'.$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS.'">';
print '</td><td>'.$langs->trans("LDAPFieldGroupMembersExample").'</td>';

View File

@ -140,7 +140,7 @@ $configfilelib=array(
'Limit nb of email sent by page',
'Strict mode is on/off'
);
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="280">'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("Parameter").'</td>';

View File

@ -116,8 +116,7 @@ function revcompare($x, $y)
*/
function create_script_table($list)
{
global $sortby,$bc,$langs;
$var=true;
global $sortby,$langs;
if (GETPOT('order') == "asc" || GETPOST('order') =="desc") {
$order = GETPOST('order');
@ -173,7 +172,6 @@ function create_script_table($list)
}
foreach($list as $script) {
$var = ! $var;
print '<tr class="oddeven">';
print '<td>'.dol_trunc($script['file'],80,'left').'</td>';
print '<td align="center" class="nowrap">'.dol_print_date($script['mtime'],'dayhour').'</td>';
@ -194,8 +192,7 @@ function create_script_table($list)
*/
function create_key_table($list)
{
global $bc,$langs;
$var=true;
global $langs;
print '<table class="noborder">';
print '<tr class="liste_titre">';
@ -206,7 +203,6 @@ function create_key_table($list)
print '</tr>';
foreach($list as $key) {
$var = !$var;
print '<tr class="oddeven">';
print '<td>'.dol_trunc($key['name'],80,'left').'</td>';
print '<td align="center" class="nowrap">'.dol_print_date($key['created'],'dayhour').'</td>';
@ -229,54 +225,49 @@ function create_key_table($list)
$form=new Form($db);
print load_fiche_titre('Dolibarr eAccelerator '.$info['version'].' control panel','','title_setup');
$var=true;
print '<br>';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="2">Information</td>';
print '</tr>';
$var = !$var;
print '<tr class="oddeven">';
print '<td>Caching enabled</td>';
print '<td align="right">'.($info['cache']?'yes':'no').'</td>';
print '</tr>';
$var = !$var;
print '<tr class="oddeven">';
print '<td>Optimizer enabled</td>';
print '<td align="right">'.$info['optimizer']?'yes':'no'.'</td>';
print '</tr>';
$var = !$var;
print '<tr class="oddeven">';
print '<td>Memory usage</td>';
print '<td align="right">'.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB)</td>';
print '</tr>';
$var = ! $var;
print '<tr class="oddeven">';
print '<td>Free memory in reserved cache</td>';
print '<td align="right">'.number_format($info['memoryAvailable']/(1024*1024), 2).'MB</td>';
print '</tr>';
$var = ! $var;
print '<tr class="oddeven">';
print '<td>Cached scripts</td>';
print '<td align="right">'.$info['cachedScripts'].'</td>';
print '</tr>';
$var = ! $var;
print '<tr class="oddeven">';
print '<td>Removed scripts</td>';
print '<td align="right">'.$info['removedScripts'].'</td>';
print '</tr>';
$var = ! $var;
print '<tr class="oddeven">';
print '<td>Cached keys</td>';
print '<td align="right">'.(isset($info['cachedKeys'])?$info['cachedKeys']:'').'</td>';
print '</tr>';
print '</table>';
$var=true;
$resCached = @eaccelerator_cached_scripts(); // If success return an array
$resRemoved = @eaccelerator_removed_scripts();
@ -288,12 +279,11 @@ if (is_array($resCached) || is_array($resRemoved)) {
print '<tr class="liste_titre"><td colspan="2">Actions</td></tr>';
if (is_array($resCached)) {
$var = ! $var;
print '<tr class="oddeven">';
print "<td>Caching</td>";
print '<td align="right"><input type="submit" class="butAction" name="caching" value="'. ($info['cache']?'disable':'enable') .'" /></td>';
print "</tr>";
$var = ! $var;
print '<tr class="oddeven">';
print "<td>Optimizer</td>";
print '<td align="right"><input type="submit" class="butAction" name="optimizer" value="'. ($info['optimizer']?'disable':'enable') .'" /></td>';
@ -301,17 +291,16 @@ if (is_array($resCached) || is_array($resRemoved)) {
}
if (is_array($resRemoved)) {
$var = ! $var;
print '<tr class="oddeven">';
print "<td>Clear cache</td>";
print '<td align="right"><input type="submit" class="butAction" name="clear" value="clear" title="remove all unused scripts and data from shared memory and disk cache" /></td>';
print "</tr>";
$var = ! $var;
print '<tr class="oddeven">';
print "<td>Clean cache</td>";
print '<td align="right"><input type="submit" class="butAction" name="clean" value="clean" title=" remove all expired scripts and data from shared memory and disk cache" /></td>';
print "</tr>";
$var = ! $var;
print '<tr class="oddeven">';
print "<td>Purge cache</td>";
print '<td align="right"><input type="submit" class="butAction" name="purge" value="purge" title="remove all \'removed\' scripts from shared memory" /></td>';

View File

@ -983,15 +983,13 @@ if (empty($reshook))
// Add link between credit note and origin
if(! empty($object->fk_facture_source)) {
$facture_source->fetch($object->fk_facture_source);
}
$facture_source->fetchObjectLinked();
$facture_source->fetchObjectLinked();
if(! empty($facture_source->linkedObjectsIds)) {
$linkedObjectIds = $facture_source->linkedObjectsIds;
$sourcetype = key($linkedObjectIds);
$fk_origin = current($facture_source->linkedObjectsIds[$sourcetype]);
$object->add_object_linked($sourcetype, $fk_origin);
if(! empty($facture_source->linkedObjectsIds)) {
foreach($facture_source->linkedObjectsIds as $sourcetype => $TIds) {
$object->add_object_linked($sourcetype, current($TIds));
}
}
}
}
}

View File

@ -113,7 +113,7 @@ if ($modecompta=="CREANCES-DETTES")
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+$nbofyear-2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+$nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$description=$langs->trans("RulesCADue");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
else $description.= $langs->trans("DepositsAreIncluded");
@ -127,7 +127,7 @@ else if ($modecompta=="RECETTES-DEPENSES")
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+$nbofyear-2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+$nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$description=$langs->trans("RulesCAIn");
$description.= $langs->trans("DepositsAreIncluded");
$builddate=dol_now();
@ -140,7 +140,7 @@ else if ($modecompta=="BOOKKEEPING")
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+$nbofyear-2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+$nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$description=$langs->trans("RulesCATotalSaleJournal");
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");

View File

@ -5555,6 +5555,41 @@ abstract class CommonObject
// If prefix is 'search_', field is used as a filter, we use a common text field.
$out='<input type="'.($keyprefix=='search_'?'text':'password').'" class="flat '.$showsize.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
}
elseif ($type == 'array')
{
$newval = $val;
$newval['type'] = 'varchar(256)';
$out='';
$inputs = array();
if(! empty($value)) {
foreach($value as $option) {
$out.= '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> ';
$out.= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', $option, $moreparam, '', '', $showsize).'<br></span>';
}
}
$out.= '<a id="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_add" href="javascript:;"><span class="fa fa-plus-circle valignmiddle"></span></a>';
$newInput = '<span><a class="'.dol_escape_htmltag($keyprefix.$key.$keysuffix).'_del" href="javascript:;"><span class="fa fa-minus-circle valignmiddle"></span></a> ';
$newInput.= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', '', $moreparam, '', '', $showsize).'<br></span>';
if(! empty($conf->use_javascript_ajax)) {
$out.= '
<script type="text/javascript">
$(document).ready(function() {
$("a#'.dol_escape_js($keyprefix.$key.$keysuffix).'_add").click(function() {
$("'.dol_escape_js($newInput).'").insertBefore(this);
});
$(document).on("click", "a.'.dol_escape_js($keyprefix.$key.$keysuffix).'_del", function() {
$(this).parent().remove();
});
});
</script>';
}
}
if (!empty($hidden)) {
$out='<input type="hidden" value="'.$value.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'"/>';
}
@ -5926,6 +5961,10 @@ abstract class CommonObject
{
$value=preg_replace('/./i','*',$value);
}
elseif ($type == 'array')
{
$value = implode('<br>', $value);
}
//print $type.'-'.$size;
$out=$value;
@ -6614,7 +6653,14 @@ abstract class CommonObject
}
else if($this->isArray($info))
{
$queryarray[$field] = serialize($this->{$field});
if(! empty($this->{$field})) {
if(! is_array($this->{$field})) {
$this->{$field} = array($this->{$field});
}
$queryarray[$field] = serialize($this->{$field});
} else {
$queryarray[$field] = NULL;
}
}
else if($this->isInt($info))
{
@ -6658,9 +6704,13 @@ abstract class CommonObject
}
elseif($this->isArray($info))
{
$this->{$field} = @unserialize($obj->{$field});
// Hack for data not in UTF8
if($this->{$field } === false) @unserialize(utf8_decode($obj->{$field}));
if(! empty($obj->{$field})) {
$this->{$field} = @unserialize($obj->{$field});
// Hack for data not in UTF8
if($this->{$field } === false) @unserialize(utf8_decode($obj->{$field}));
} else {
$this->{$field} = array();
}
}
elseif($this->isInt($info))
{

View File

@ -583,56 +583,70 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $
{
$countryfound=1;
// Definition des dates feriees fixes
if($jour == 1 && $mois == 1) $ferie=true; // 1er janvier
if($jour == 1 && $mois == 5) $ferie=true; // 1er mai
if($jour == 8 && $mois == 5) $ferie=true; // 5 mai
if($jour == 14 && $mois == 7) $ferie=true; // 14 juillet
if($jour == 15 && $mois == 8) $ferie=true; // 15 aout
if($jour == 1 && $mois == 11) $ferie=true; // 1 novembre
if($jour == 11 && $mois == 11) $ferie=true; // 11 novembre
if($jour == 25 && $mois == 12) $ferie=true; // 25 decembre
// Definition of fixed working days
if($jour == 1 && $mois == 1) $ferie=true; // 1er january
if($jour == 1 && $mois == 5) $ferie=true; // 1er may
if($jour == 8 && $mois == 5) $ferie=true; // 5 may
if($jour == 14 && $mois == 7) $ferie=true; // 14 july
if($jour == 15 && $mois == 8) $ferie=true; // 15 august
if($jour == 1 && $mois == 11) $ferie=true; // 1 november
if($jour == 11 && $mois == 11) $ferie=true; // 11 november
if($jour == 25 && $mois == 12) $ferie=true; // 25 december
// Calcul du jour de paques
// Calculation for easter date
$date_paques = easter_date($annee);
$jour_paques = date("d", $date_paques);
$mois_paques = date("m", $date_paques);
if($jour_paques == $jour && $mois_paques == $mois) $ferie=true;
// Paques
// Pâques
// Calcul du jour de l ascension (38 jours apres Paques)
// Calculation for the monday of easter date
$date_lundi_paques = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 1,
date("Y", $date_paques)
);
$jour_lundi_ascension = date("d", $date_lundi_paques);
$mois_lundi_ascension = date("m", $date_lundi_paques);
if($jour_lundi_ascension == $jour && $mois_lundi_ascension == $mois) $ferie=true;
// Lundi de Pâques
// Calcul du jour de l'ascension (38 days after easter day)
$date_ascension = mktime(
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 38,
date("d", $date_paques) + 39,
date("Y", $date_paques)
);
$jour_ascension = date("d", $date_ascension);
$mois_ascension = date("m", $date_ascension);
if($jour_ascension == $jour && $mois_ascension == $mois) $ferie=true;
//Ascension
// Ascension
// Calcul de Pentecote (11 jours apres Paques)
// Calculation of "Pentecote" (11 days after easter day)
$date_pentecote = mktime(
date("H", $date_ascension),
date("i", $date_ascension),
date("s", $date_ascension),
date("m", $date_ascension),
date("d", $date_ascension) + 11,
date("Y", $date_ascension)
date("H", $date_paques),
date("i", $date_paques),
date("s", $date_paques),
date("m", $date_paques),
date("d", $date_paques) + 49,
date("Y", $date_paques)
);
$jour_pentecote = date("d", $date_pentecote);
$mois_pentecote = date("m", $date_pentecote);
if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true;
//Pentecote
// "Pentecote"
// Calul des samedis et dimanches
$jour_julien = unixtojd($timestampStart);
$jour_semaine = jddayofweek($jour_julien, 0);
if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true;
//Samedi (6) et dimanche (0)
// Samedi (6) et dimanche (0)
}
// Pentecoste and Ascensione in Italy go to the sunday after: isn't holiday.

View File

@ -97,7 +97,7 @@ function product_prepare_head($object)
$head[$h][2] = 'referers';
$h++;
if (!empty($conf->variants->enabled) && $object->isProduct()) {
if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) {
global $db;

View File

@ -62,6 +62,8 @@ if (empty($conf->stock->enabled)) {
accessforbidden();
}
$hookmanager->initHooks(array('ordersupplierdispatch'));
// Recuperation de l'id de projet
$projectid = 0;
if ($_GET["projectid"])
@ -85,6 +87,10 @@ if ($id > 0 || ! empty($ref)) {
* Actions
*/
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))))
{
$error=0;
@ -431,6 +437,9 @@ if ($id > 0 || ! empty($ref)) {
print '<td>' . $author->getNomUrl(1, '', 0, 0, 0) . '</td>';
print '</tr>';
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print "</table>";
print '</div>';

View File

@ -1771,7 +1771,7 @@ else
}
//Parent product.
if (!empty($conf->variants->enabled) && $object->isProduct()) {
if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) {
$combination = new ProductCombination($db);

View File

@ -71,7 +71,7 @@ if ($cancel) {
unset($_SESSION['addvariant_'.$object->id]);
}
if (! $object->isProduct()) {
if (! $object->isProduct() && ! $object->isService()) {
header('Location: '.dol_buildpath('/product/card.php?id='.$object->id, 2));
exit();
}
@ -327,11 +327,31 @@ if (! empty($id) || ! empty($ref))
if ($action == 'add') {
$title = $langs->trans('NewProductCombination');
print dol_fiche_head();
$features = $_SESSION['addvariant_'.$object->id];
//First, sanitize
print '<div id="parttoaddvariant">';
if (! empty($features)) {
foreach ($features as $feature) {
$explode = explode(':', $feature);
if ($prodattr->fetch($explode[0]) < 0) {
continue;
}
if ($prodattr_val->fetch($explode[1]) < 0) {
continue;
}
print '<i>' . $prodattr->label . '</i>:'. $prodattr_val->value . ' ';
}
}
print '</div>';
print dol_fiche_end();
} else {
$title = $langs->trans('EditProductCombination');
}
print '<div id="parttoaddvariant"></div>';
print_fiche_titre($title);
if ($action == 'add') {
@ -346,8 +366,8 @@ if (! empty($id) || ! empty($ref))
foreach ($prodattr_all as $each) {
$prodattr_alljson[$each->id] = $each;
}
?>
?>
<script type="text/javascript">
@ -523,12 +543,13 @@ if (! empty($id) || ! empty($ref))
<td><input type="text" id="price_impact" name="price_impact" value="<?php echo price($price_impact) ?>">
<input type="checkbox" id="price_impact_percent" name="price_impact_percent" <?php echo $price_impact_percent ? ' checked' : '' ?>> <label for="price_impact_percent"><?php echo $langs->trans('PercentageVariation') ?></label></td>
</tr>
<tr>
<td><label for="weight_impact"><?php echo $langs->trans('WeightImpact') ?></label></td>
<td><input type="text" id="weight_impact" name="weight_impact" value="<?php echo price($weight_impact) ?>"></td>
</tr>
</table>
<?php
<?php if ($object->isProduct()) {
print '<tr>';
print '<td><label for="weight_impact">'.$langs->trans('WeightImpact').'</label></td>';
print '<td><input type="text" id="weight_impact" name="weight_impact" value="'.price($weight_impact).'"></td>';
print '</tr>';
}
print '</table>';
}
print dol_fiche_end();
@ -678,7 +699,7 @@ if (! empty($id) || ! empty($ref))
<td class="liste_titre"><?php echo $langs->trans('Product') ?></td>
<td class="liste_titre"><?php echo $langs->trans('Combination') ?></td>
<td class="liste_titre right"><?php echo $langs->trans('PriceImpact') ?></td>
<td class="liste_titre right"><?php echo $langs->trans('WeightImpact') ?></td>
<?php if ($object->isProduct()) print'<td class="liste_titre right">'.$langs->trans('WeightImpact').'</td>'; ?>
<td class="liste_titre center"><?php echo $langs->trans('OnSell') ?></td>
<td class="liste_titre center"><?php echo $langs->trans('OnBuy') ?></td>
<td class="liste_titre"></td>
@ -714,7 +735,7 @@ if (! empty($id) || ! empty($ref))
} ?>
</td>
<td class="right"><?php echo ($currcomb->variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?></td>
<td class="right"><?php echo ($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight') ?></td>
<?php if ($object->isProduct()) print '<td class="right">'.($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight').'</td>'; ?>
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 0) ?></td>
<td style="text-align: center;"><?php echo $prodstatic->getLibStatut(2, 1) ?></td>
<td class="right">