30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
48$action =
GETPOST(
'action',
'aZ09');
57 'code' =>
'MAIN_DELAY_ACTIONS_TODO',
63 'code' =>
'MAIN_DELAY_PROJECT_TO_CLOSE',
67 'code' =>
'MAIN_DELAY_TASKS_TODO',
68 'img' =>
'projecttask'
73 'code' =>
'MAIN_DELAY_PROPALS_TO_CLOSE',
77 'code' =>
'MAIN_DELAY_PROPALS_TO_BILL',
83 'code' =>
'MAIN_DELAY_ORDERS_TO_PROCESS',
89 'code' =>
'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',
93 'fournisseur' => array(
95 'code' =>
'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',
99 'code' =>
'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',
105 'code' =>
'MAIN_DELAY_NOT_ACTIVATED_SERVICES',
109 'code' =>
'MAIN_DELAY_RUNNING_SERVICES',
115 'code' =>
'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',
119 'code' =>
'MAIN_DELAY_CHEQUES_TO_DEPOSIT',
125 'code' =>
'MAIN_DELAY_MEMBERS',
129 'expensereport' => array(
131 'code' =>
'MAIN_DELAY_EXPENSEREPORTS',
142 'code' =>
'MAIN_DELAY_HOLIDAYS',
148$labelmeteo = array(0 => $langs->trans(
"No"), 1 => $langs->trans(
"Yes"), 2 => $langs->trans(
"OnMobileOnly"));
150if (!isset(
$conf->global->MAIN_DELAY_MEMBERS)) {
151 $conf->global->MAIN_DELAY_MEMBERS = 0;
153if (!isset(
$conf->global->MAIN_DELAY_ACTIONS_TODO)) {
154 $conf->global->MAIN_DELAY_ACTIONS_TODO = 7;
156if (!isset(
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
157 $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
159if (!isset(
$conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS)) {
160 $conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS = 7;
162if (!isset(
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
163 $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
165if (!isset(
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
166 $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
168if (!isset(
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
169 $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
178if ($action ==
'update') {
179 foreach ($modules as $module => $delays) {
180 if (isModEnabled($module)) {
181 foreach ($delays as $delay) {
182 if (
GETPOST($delay[
'code']) !=
'') {
195 $plus =
'_PERCENTAGE';
198 for ($i = 0; $i < 4; $i++) {
199 if (GETPOSTISSET(
'MAIN_METEO'.$plus.
'_LEVEL'.$i)) {
214$form =
new Form($db);
216llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-delais');
218print
load_fiche_titre($langs->trans(
"DelaysOfToleranceBeforeWarning"),
'',
'title_setup');
220print
'<span class="opacitymedium">'.$langs->transnoentities(
"DelaysOfToleranceDesc",
img_warning(
'default',
'',
'pictowarning nopaddingleft'));
221print
" ".$langs->trans(
"OnlyActiveElementsAreShown", DOL_URL_ROOT.
'/admin/modules.php').
"</span><br>\n";
225if ($action ==
'edit') {
226 print
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'" name="form_index">';
227 print
'<input type="hidden" name="token" value="'.newToken().
'">';
228 print
'<input type="hidden" name="action" value="update">';
230 print
'<table class="noborder centpercent">';
231 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"DelaysOfToleranceBeforeWarning").
'</td>';
232 print
'<td class="right">'.$langs->trans(
"LateWarningAfter").
'</td></tr>';
234 foreach ($modules as $module => $delays) {
235 if (isModEnabled($module)) {
236 foreach ($delays as $delay) {
238 print
'<tr class="oddeven">';
239 print
'<td width="20px">' .
img_object(
'', $delay[
'img']) .
'</td>';
240 print
'<td>' . $langs->trans(
'Delays_' . $delay[
'code']) .
'</td><td class="nowraponall right">';
241 print
'<input class="right maxwidth75" type="number" name="' . $delay[
'code'] .
'" value="' . $value .
'"> ' . $langs->trans(
"days") .
'</td></tr>';
251 print
'<table class="noborder centpercent">';
252 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Option").
'</td><td class="right">'.$langs->trans(
"Value").
'</td></tr>';
254 print
'<tr class="oddeven">';
255 print
'<td>'.$langs->trans(
"MAIN_DISABLE_METEO").
'</td><td class="right">';
256 print $form->selectarray(
'MAIN_DISABLE_METEO', $labelmeteo, (!
getDolGlobalString(
'MAIN_DISABLE_METEO') ? 0 :
$conf->global->MAIN_DISABLE_METEO));
265 print
'<table class="noborder centpercent">';
266 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"DelaysOfToleranceBeforeWarning").
'</td><td class="right">'.$langs->trans(
"Value").
'</td></tr>';
268 foreach ($modules as $module => $delays) {
269 if (isModEnabled($module)) {
270 foreach ($delays as $delay) {
272 print
'<tr class="oddeven">';
273 print
'<td width="20px">' .
img_object(
'', $delay[
'img']) .
'</td>';
274 print
'<td>' . $langs->trans(
'Delays_' . $delay[
'code']) .
'</td>';
275 print
'<td class="right">' . $value .
' ' . $langs->trans(
"days") .
'</td></tr>';
285 print
'<table class="noborder centpercent">';
286 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Option").
'</td><td class="right">'.$langs->trans(
"Value").
'</td></tr>';
288 print
'<tr class="oddeven">';
289 print
'<td>'.$langs->trans(
"MAIN_DISABLE_METEO").
'</td><td class="center">';
300$str_mode_percentage =
null;
304 print
'<span class="opacitymedium">'.$langs->trans(
"DescWeather").
'</span> ';
306 if ($action ==
'edit') {
307 $str_mode_std = $langs->trans(
'MeteoStdModEnabled').
' : '.$langs->trans(
'MeteoUseMod', $langs->transnoentitiesnoconv(
'MeteoPercentageMod'));
308 $str_mode_percentage = $langs->trans(
'MeteoPercentageModEnabled').
' : '.$langs->trans(
'MeteoUseMod', $langs->transnoentitiesnoconv(
'MeteoStdMod'));
310 $str_mode_enabled = $str_mode_std;
312 $str_mode_enabled = $str_mode_percentage;
314 print
'<br><a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.
'</a>';
315 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 :
'').
'" />';
320 print $langs->trans(
'MeteoStdModEnabled');
322 print $langs->trans(
'MeteoPercentageModEnabled');
335 $level1 = $offset + $cursor;
339 $level2 = $offset + 2 * $cursor;
343 $level3 = $offset + 3 * $cursor;
348 $options =
'class="valignmiddle" height="60px"';
351 if ($action ==
'edit') {
352 print
'<div id="standard" '.(!
getDolGlobalString(
'MAIN_USE_METEO_WITH_PERCENTAGE') ?
'' :
'style="display:none;"').
'>';
355 print
'<div class="inline-block" style="padding-right: 20px">';
357 print
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.
'"/></td>';
358 print
'</div><div class="inline-block" style="padding-right: 20px">';
360 print
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.
'"/></td>';
361 print
'</div><div class="inline-block" style="padding-right: 20px">';
363 print
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.
'"/></td>';
364 print
'</div><div class="inline-block" style="padding-right: 20px">';
366 print
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.
'"/></td>';
372 print
'<div id="percentage" '.(!
getDolGlobalString(
'MAIN_USE_METEO_WITH_PERCENTAGE') ?
'style="display:none;"' :
'').
'>';
375 print
'<div class="inline-block" style="padding-right: 20px">';
377 print
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL0').
'"/> %</td>';
378 print
'</div><div class="inline-block" style="padding-right: 20px">';
380 print
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL1').
'"/> %</td>';
381 print
'</div><div class="inline-block" style="padding-right: 20px">';
383 print
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL2').
'"/> %</td>';
384 print
'</div><div class="inline-block" style="padding-right: 20px">';
386 print
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL3').
'"/> %</td>';
392 <script
type=
"text/javascript">
394 $(document).ready(
function() {
396 $(
"#change_mode").click(
function() {
397 var use_percent = $(
"#MAIN_USE_METEO_WITH_PERCENTAGE");
398 var str_mode_std =
"<?php print $str_mode_std; ?>";
399 var str_mode_percentage =
"<?php print $str_mode_percentage; ?>";
401 if(use_percent.val() == 1) {
403 $(
"#standard").show();
404 $(
"#percentage").hide();
405 $(
this).html(str_mode_std);
408 $(
"#standard").hide();
409 $(
"#percentage").show();
410 $(
this).html(str_mode_percentage);
422 print
'<div class="inline-block" style="padding-right: 20px">';
425 print
'</div><div class="inline-block" style="padding-right: 20px">';
428 print
'</div><div class="inline-block" style="padding-right: 20px">';
431 print
'</div><div class="inline-block" style="padding-right: 20px">';
434 print
'</div><div class="inline-block" style="padding-right: 20px">';
441 print
'<div class="inline-block" style="padding-right: 20px">';
443 print
' <= '.$level0;
444 print
'</div><div class="inline-block" style="padding-right: 20px">';
446 print
' <= '.$level1;
447 print
'</div><div class="inline-block" style="padding-right: 20px">';
449 print
' <= '.$level2;
450 print
'</div><div class="inline-block" style="padding-right: 20px">';
452 print
' <= '.$level3;
453 print
'</div><div class="inline-block" style="padding-right: 20px">';
455 print
' > '.$level3;
463if ($action ==
'edit') {
464 print $form->buttonsSaveCancel(
"Save",
'');
467 print
'<br><br><div class="tabsAction">';
468 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
img_weather($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $morecss='')
Show weather picto.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.