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',
103 'code' =>
'MAIN_DELAY_SUPPLIER_PROPALS_TO_CLOSE',
107 'code' =>
'MAIN_DELAY_SUPPLIER_PROPALS_TO_BILL',
113 'code' =>
'MAIN_DELAY_NOT_ACTIVATED_SERVICES',
117 'code' =>
'MAIN_DELAY_RUNNING_SERVICES',
123 'code' =>
'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',
127 'code' =>
'MAIN_DELAY_CHEQUES_TO_DEPOSIT',
133 'code' =>
'MAIN_DELAY_MEMBERS',
137 'expensereport' => array(
139 'code' =>
'MAIN_DELAY_EXPENSEREPORTS',
150 'code' =>
'MAIN_DELAY_HOLIDAYS',
156 'code' =>
'MAIN_DELAY_MRP',
162$labelmeteo = array(0 => $langs->trans(
"No"), 1 => $langs->trans(
"Yes"), 2 => $langs->trans(
"OnMobileOnly"));
164if (!isset(
$conf->global->MAIN_DELAY_MEMBERS)) {
165 $conf->global->MAIN_DELAY_MEMBERS = 0;
167if (!isset(
$conf->global->MAIN_DELAY_ACTIONS_TODO)) {
168 $conf->global->MAIN_DELAY_ACTIONS_TODO = 7;
170if (!isset(
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
171 $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
173if (!isset(
$conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS)) {
174 $conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS = 7;
176if (!isset(
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
177 $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
179if (!isset(
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
180 $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
182if (!isset(
$conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
183 $conf->global->MAIN_DELAY_ORDERS_TO_PROCESS = 2;
192if ($action ==
'update') {
193 foreach ($modules as $module => $delays) {
194 if (isModEnabled($module)) {
195 foreach ($delays as $delay) {
196 if (
GETPOST($delay[
'code']) !=
'') {
208 $plus =
'_PERCENTAGE';
211 for ($i = 0; $i < 4; $i++) {
212 if (GETPOSTISSET(
'MAIN_METEO'.$plus.
'_LEVEL'.$i)) {
227$form =
new Form($db);
229llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-delais');
231print
load_fiche_titre($langs->trans(
"DelaysOfToleranceBeforeWarning"),
'',
'title_setup');
233print
'<span class="opacitymedium">'.$langs->transnoentities(
"DelaysOfToleranceDesc",
img_warning(
'default',
'',
'pictowarning nopaddingleft'));
234print
" ".$langs->trans(
"OnlyActiveElementsAreShown", DOL_URL_ROOT.
'/admin/modules.php').
"</span><br>\n";
238if ($action ==
'edit') {
239 print
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'" name="form_index">';
240 print
'<input type="hidden" name="token" value="'.newToken().
'">';
241 print
'<input type="hidden" name="action" value="update">';
243 print
'<table class="noborder centpercent">';
244 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"DelaysOfToleranceBeforeWarning").
'</td>';
245 print
'<td class="right">'.$langs->trans(
"LateWarningAfter").
'</td></tr>';
247 foreach ($modules as $module => $delays) {
248 if (isModEnabled($module)) {
249 foreach ($delays as $delay) {
251 print
'<tr class="oddeven">';
252 print
'<td width="20px">' .
img_object(
'', $delay[
'img']) .
'</td>';
253 print
'<td>' . $langs->trans(
'Delays_' . $delay[
'code']) .
'</td><td class="nowraponall right">';
254 print
'<input class="right maxwidth75" type="number" name="' . $delay[
'code'] .
'" value="' . $value .
'"> ' . $langs->trans(
"days") .
'</td></tr>';
264 print
'<table class="noborder centpercent">';
265 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Option").
'</td><td class="right"></td></tr>';
267 print
'<tr class="oddeven">';
268 print
'<td>'.$langs->trans(
"MAIN_DISABLE_METEO").
'</td><td class="right">';
269 print $form->selectarray(
'MAIN_DISABLE_METEO', $labelmeteo,
getDolGlobalInt(
'MAIN_DISABLE_METEO'));
278 print
'<table class="noborder centpercent">';
279 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"DelaysOfToleranceBeforeWarning").
'</td><td class="right"></td></tr>';
281 foreach ($modules as $module => $delays) {
282 if (isModEnabled($module)) {
283 foreach ($delays as $delay) {
285 print
'<tr class="oddeven">';
286 print
'<td width="20px">' .
img_object(
'', $delay[
'img']) .
'</td>';
287 print
'<td>' . $langs->trans(
'Delays_' . $delay[
'code']) .
'</td>';
288 print
'<td class="right">' . $value .
' ' . $langs->trans(
"days") .
'</td></tr>';
298 print
'<table class="noborder centpercent">';
299 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Option").
'</td><td class="right"></td></tr>';
301 print
'<tr class="oddeven">';
302 print
'<td>'.$langs->trans(
"MAIN_DISABLE_METEO").
'</td><td class="center">';
313$str_mode_percentage =
null;
317 print
'<span class="opacitymedium">'.$langs->trans(
"DescWeather").
'</span> ';
319 if ($action ==
'edit') {
320 $str_mode_std = $langs->trans(
'MeteoStdModEnabled').
' : '.$langs->trans(
'MeteoUseMod', $langs->transnoentitiesnoconv(
'MeteoPercentageMod'));
321 $str_mode_percentage = $langs->trans(
'MeteoPercentageModEnabled').
' : '.$langs->trans(
'MeteoUseMod', $langs->transnoentitiesnoconv(
'MeteoStdMod'));
323 $str_mode_enabled = $str_mode_std;
325 $str_mode_enabled = $str_mode_percentage;
327 print
'<br><a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.
'</a>';
328 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 :
'').
'" />';
333 print $langs->trans(
'MeteoStdModEnabled');
335 print $langs->trans(
'MeteoPercentageModEnabled');
346 $level1 = $offset + $cursor;
350 $level2 = $offset + 2 * $cursor;
354 $level3 = $offset + 3 * $cursor;
359 $options =
'class="valignmiddle" height="60px"';
362 if ($action ==
'edit') {
363 print
'<div id="standard" '.(!
getDolGlobalString(
'MAIN_USE_METEO_WITH_PERCENTAGE') ?
'' :
'style="display:none;"').
'>';
366 print
'<div class="inline-block" style="padding-right: 20px">';
368 print
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL0" value="'.$level0.
'"/></td>';
369 print
'</div><div class="inline-block" style="padding-right: 20px">';
371 print
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL1" value="'.$level1.
'"/></td>';
372 print
'</div><div class="inline-block" style="padding-right: 20px">';
374 print
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL2" value="'.$level2.
'"/></td>';
375 print
'</div><div class="inline-block" style="padding-right: 20px">';
377 print
' <= <input type="text" size="2" name="MAIN_METEO_LEVEL3" value="'.$level3.
'"/></td>';
383 print
'<div id="percentage" '.(!
getDolGlobalString(
'MAIN_USE_METEO_WITH_PERCENTAGE') ?
'style="display:none;"' :
'').
'>';
386 print
'<div class="inline-block" style="padding-right: 20px">';
388 print
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL0" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL0').
'"/> %</td>';
389 print
'</div><div class="inline-block" style="padding-right: 20px">';
391 print
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL1" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL1').
'"/> %</td>';
392 print
'</div><div class="inline-block" style="padding-right: 20px">';
394 print
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL2" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL2').
'"/> %</td>';
395 print
'</div><div class="inline-block" style="padding-right: 20px">';
397 print
' <= <input type="text" size="2" name="MAIN_METEO_PERCENTAGE_LEVEL3" value="'.getDolGlobalString(
'MAIN_METEO_PERCENTAGE_LEVEL3').
'"/> %</td>';
403 <script
type=
"text/javascript">
405 $(document).ready(
function() {
407 $(
"#change_mode").click(
function() {
408 var use_percent = $(
"#MAIN_USE_METEO_WITH_PERCENTAGE");
409 var str_mode_std =
"<?php print $str_mode_std; ?>";
410 var str_mode_percentage =
"<?php print $str_mode_percentage; ?>";
412 if(use_percent.val() == 1) {
414 $(
"#standard").show();
415 $(
"#percentage").hide();
416 $(
this).html(str_mode_std);
419 $(
"#standard").hide();
420 $(
"#percentage").show();
421 $(
this).html(str_mode_percentage);
433 print
'<div class="inline-block" style="padding-right: 20px">';
436 print
'</div><div class="inline-block" style="padding-right: 20px">';
439 print
'</div><div class="inline-block" style="padding-right: 20px">';
442 print
'</div><div class="inline-block" style="padding-right: 20px">';
445 print
'</div><div class="inline-block" style="padding-right: 20px">';
452 print
'<div class="inline-block" style="padding-right: 20px">';
454 print
' <= '.$level0;
455 print
'</div><div class="inline-block" style="padding-right: 20px">';
457 print
' <= '.$level1;
458 print
'</div><div class="inline-block" style="padding-right: 20px">';
460 print
' <= '.$level2;
461 print
'</div><div class="inline-block" style="padding-right: 20px">';
463 print
' <= '.$level3;
464 print
'</div><div class="inline-block" style="padding-right: 20px">';
466 print
' > '.$level3;
474if ($action ==
'edit') {
475 print $form->buttonsSaveCancel(
"Save",
'');
478 print
'<br><br><div class="tabsAction">';
479 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).
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
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.
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|dolcrypt):/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.