29require 
'../main.inc.php';
 
   30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
 
   39$action = 
GETPOST(
'action', 
'aZ09');
 
   48      'code' => 
'MAIN_DELAY_ACTIONS_TODO',
 
   54      'code' => 
'MAIN_DELAY_PROJECT_TO_CLOSE',
 
   58      'code' => 
'MAIN_DELAY_TASKS_TODO',
 
   59      'img' => 
'projecttask' 
   64      'code' => 
'MAIN_DELAY_PROPALS_TO_CLOSE',
 
   68      'code' => 
'MAIN_DELAY_PROPALS_TO_BILL',
 
   74      'code' => 
'MAIN_DELAY_ORDERS_TO_PROCESS',
 
   80      'code' => 
'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',
 
   84  'fournisseur' => array(
 
   86      'code' => 
'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',
 
   90      'code' => 
'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',
 
   96      'code' => 
'MAIN_DELAY_NOT_ACTIVATED_SERVICES',
 
  100      'code' => 
'MAIN_DELAY_RUNNING_SERVICES',
 
  106      'code' => 
'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',
 
  110      'code' => 
'MAIN_DELAY_CHEQUES_TO_DEPOSIT',
 
  116      'code' => 
'MAIN_DELAY_MEMBERS',
 
  120  'expensereport' => array(
 
  122      'code' => 
'MAIN_DELAY_EXPENSEREPORTS',
 
  133      'code' => 
'MAIN_DELAY_HOLIDAYS',
 
  139$labelmeteo = array(0=>$langs->trans(
"No"), 1=>$langs->trans(
"Yes"), 2=>$langs->trans(
"OnMobileOnly"));
 
  141if (!isset($conf->global->MAIN_DELAY_MEMBERS)) {
 
  142  $conf->global->MAIN_DELAY_MEMBERS = 0; 
 
  144if (!isset($conf->global->MAIN_DELAY_ACTIONS_TODO)) {
 
  145  $conf->global->MAIN_DELAY_ACTIONS_TODO = 7; 
 
  147if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
 
  148  $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
 
  150if (!isset($conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS)) {
 
  151  $conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS = 7;
 
  153if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
 
  154  $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
 
  156if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
 
  157  $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
 
  159if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
 
  160  $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
 
  169if ($action == 
'update') {
 
  170  foreach ($modules as $module => $delays) {
 
  171    if (isModEnabled($module)) {
 
  172      foreach ($delays as $delay) {
 
  173        if (
GETPOST($delay[
'code']) != 
'') {
 
  181  dolibarr_set_const($db, 
"MAIN_USE_METEO_WITH_PERCENTAGE", 
GETPOST(
"MAIN_USE_METEO_WITH_PERCENTAGE"), 
'chaine', 0, 
'', $conf->entity);
 
  186    $plus = 
'_PERCENTAGE';
 
  189  for ($i = 0; $i < 4; $i++) {
 
  190    if (GETPOSTISSET(
'MAIN_METEO'.$plus.
'_LEVEL'.$i)) {
 
  191      dolibarr_set_const($db, 
'MAIN_METEO'.$plus.
'_LEVEL'.$i, 
GETPOST(
'MAIN_METEO'.$plus.
'_LEVEL'.$i, 
'int'), 
'chaine', 0, 
'', $conf->entity);
 
  205$form = 
new Form($db);
 
  209print 
load_fiche_titre($langs->trans(
"DelaysOfToleranceBeforeWarning"), 
'', 
'title_setup');
 
  211print 
'<span class="opacitymedium">'.$langs->transnoentities(
"DelaysOfToleranceDesc", 
img_warning(
'default', 
'', 
'pictowarning nopaddingleft'));
 
  212print 
" ".$langs->trans(
"OnlyActiveElementsAreShown", DOL_URL_ROOT.
'/admin/modules.php').
"</span><br>\n";
 
  215if ($action == 
'edit') {
 
  216  print 
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'" name="form_index">';
 
  217  print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  218  print 
'<input type="hidden" name="action" value="update">';
 
  220  print 
'<table class="noborder centpercent">';
 
  221  print 
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"DelaysOfToleranceBeforeWarning").
'</td>';
 
  222  print 
'<td class="right">'.$langs->trans(
"LateWarningAfter").
'</td></tr>';
 
  224  foreach ($modules as $module => $delays) {
 
  225    if (isModEnabled($module)) {
 
  226      foreach ($delays as $delay) {
 
  228        print 
'<tr class="oddeven">';
 
  229        print 
'<td width="20px">' . 
img_object(
'', $delay[
'img']) . 
'</td>';
 
  230        print 
'<td>' . $langs->trans(
'Delays_' . $delay[
'code']) . 
'</td><td class="nowraponall right">';
 
  231        print 
'<input class="right maxwidth75" type="number" name="' . $delay[
'code'] . 
'" value="' . $value . 
'"> ' . $langs->trans(
"days") . 
'</td></tr>';
 
  241  print 
'<table class="noborder centpercent">';
 
  242  print 
'<tr class="liste_titre"><td>'.$langs->trans(
"Option").
'</td><td class="right">'.$langs->trans(
"Value").
'</td></tr>';
 
  244  print 
'<tr class="oddeven">';
 
  245  print 
'<td>'.$langs->trans(
"MAIN_DISABLE_METEO").
'</td><td class="right">';
 
  246  print $form->selectarray(
'MAIN_DISABLE_METEO', $labelmeteo, (!
getDolGlobalString(
'MAIN_DISABLE_METEO') ? 0 : $conf->global->MAIN_DISABLE_METEO));
 
  255  print 
'<table class="noborder centpercent">';
 
  256  print 
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"DelaysOfToleranceBeforeWarning").
'</td><td class="right">'.$langs->trans(
"Value").
'</td></tr>';
 
  258  foreach ($modules as $module => $delays) {
 
  259    if (isModEnabled($module)) {
 
  260      foreach ($delays as $delay) {
 
  262        print 
'<tr class="oddeven">';
 
  263        print 
'<td width="20px">' . 
img_object(
'', $delay[
'img']) . 
'</td>';
 
  264        print 
'<td>' . $langs->trans(
'Delays_' . $delay[
'code']) . 
'</td>';
 
  265        print 
'<td class="right">' . $value . 
' ' . $langs->trans(
"days") . 
'</td></tr>';
 
  275  print 
'<table class="noborder centpercent">';
 
  276  print 
'<tr class="liste_titre"><td>'.$langs->trans(
"Option").
'</td><td class="right">'.$langs->trans(
"Value").
'</td></tr>';
 
  278  print 
'<tr class="oddeven">';
 
  279  print 
'<td>'.$langs->trans(
"MAIN_DISABLE_METEO").
'</td><td class="center">';
 
  291  print 
'<span class="opacitymedium">'.$langs->trans(
"DescWeather").
'</span> ';
 
  293  if ($action == 
'edit') {
 
  294    $str_mode_std = $langs->trans(
'MeteoStdModEnabled').
' : '.$langs->trans(
'MeteoUseMod', $langs->transnoentitiesnoconv(
'MeteoPercentageMod'));
 
  295    $str_mode_percentage = $langs->trans(
'MeteoPercentageModEnabled').
' : '.$langs->trans(
'MeteoUseMod', $langs->transnoentitiesnoconv(
'MeteoStdMod'));
 
  297      $str_mode_enabled = $str_mode_std;
 
  299      $str_mode_enabled = $str_mode_percentage;
 
  301    print 
'<br><a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.
'</a>';
 
  302    print 
'<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.(getDolGlobalString(
'MAIN_USE_METEO_WITH_PERCENTAGE') ? $conf->global->MAIN_USE_METEO_WITH_PERCENTAGE : 
'').
'" />';
 
  307      print $langs->trans(
'MeteoStdModEnabled');
 
  309      print $langs->trans(
'MeteoPercentageModEnabled');
 
  320    $level0 = $conf->global->MAIN_METEO_LEVEL0;
 
  322  $level1 = $offset + $cursor;
 
  324    $level1 = $conf->global->MAIN_METEO_LEVEL1;
 
  326  $level2 = $offset + 2 * $cursor;
 
  328    $level2 = $conf->global->MAIN_METEO_LEVEL2;
 
  330  $level3 = $offset + 3 * $cursor;
 
  332    $level3 = $conf->global->MAIN_METEO_LEVEL3;
 
  335  $options = 
'class="valignmiddle" height="60px"';
 
  338  if ($action == 
'edit') {
 
  339    print 
'<div id="standard" '.(!
getDolGlobalString(
'MAIN_USE_METEO_WITH_PERCENTAGE') ? 
'' : 
'style="display:none;"').
'>';
 
  342    print 
'<div class="inline-block" style="padding-right: 20px">';
 
  344    print 
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.
'"/></td>';
 
  345    print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  347    print 
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.
'"/></td>';
 
  348    print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  350    print 
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.
'"/></td>';
 
  351    print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  353    print 
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.
'"/></td>';
 
  359    print 
'<div id="percentage" '.(!
getDolGlobalString(
'MAIN_USE_METEO_WITH_PERCENTAGE') ? 
'style="display:none;"' : 
'').
'>';
 
  362    print 
'<div class="inline-block" style="padding-right: 20px">';
 
  364    print 
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL0').
'"/> %</td>';
 
  365    print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  367    print 
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL1').
'"/> %</td>';
 
  368    print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  370    print 
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL2').
'"/> %</td>';
 
  371    print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  373    print 
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL3').
'"/> %</td>';
 
  379    <script 
type=
"text/javascript">
 
  381      $(document).ready(
function() {
 
  383        $(
"#change_mode").click(
function() {
 
  384          var use_percent = $(
"#MAIN_USE_METEO_WITH_PERCENTAGE");
 
  385          var str_mode_std = 
"<?php print $str_mode_std; ?>";
 
  386          var str_mode_percentage = 
"<?php print $str_mode_percentage; ?>";
 
  388          if(use_percent.val() == 1) {
 
  390            $(
"#standard").show();
 
  391            $(
"#percentage").hide();
 
  392            $(
this).html(str_mode_std);
 
  395            $(
"#standard").hide();
 
  396            $(
"#percentage").show();
 
  397            $(
this).html(str_mode_percentage);
 
  409      print 
'<div class="inline-block" style="padding-right: 20px">';
 
  412      print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  415      print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  418      print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  421      print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  428      print 
'<div class="inline-block" style="padding-right: 20px">';
 
  430      print 
' <= '.$level0;
 
  431      print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  433      print 
' <= '.$level1;
 
  434      print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  436      print 
' <= '.$level2;
 
  437      print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  439      print 
' <= '.$level3;
 
  440      print 
'</div><div class="inline-block" style="padding-right: 20px">';
 
  442      print 
' > '.$level3;
 
  450if ($action == 
'edit') {
 
  451  print $form->buttonsSaveCancel(
"Save", 
'');
 
  454  print 
'<br><br><div class="tabsAction">';
 
  455  print 
'<a class="butAction reposition" href="delais.php?action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a>';
 
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
 
img_weather($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $morecss='')
Show weather picto.
 
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
 
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
 
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
 
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
 
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
 
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
 
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.