dbXapp
2.0
RAD, CMS, Module und Runtime-IDE fuer dbXapp
Toggle main menu visibility
Loading...
Searching...
No Matches
myLKW_dayset.class.php
Go to the documentation of this file.
1
<?php
2
namespace
dbx\myLKW;
3
4
class
myLKW_dayset
{
5
6
7
public
function
run
() {
8
dbx
()->debug(
"myLKWD_dayset"
);
9
10
11
$today = (new \DateTime())->format(
'Y-m-d'
);
12
$date =
dbx
()->get_config(
'myLKW'
,
'shiftdate'
);
// ALTEN shiftdate holen
13
$data[
'setdate'
]=$date;
14
15
$oForm=
dbx
()->get_system_obj(
'dbxForm'
);
16
$oForm->init(
'form-dayset'
);
17
$oForm->_action=
'?dbx_modul=myLKW&dbx_run1=dayset'
;
18
$oForm->_data=$data;
19
$oForm->add_module_bar(
'Establecer la fecha'
,
'bi-calendar-date'
);
20
21
$oForm->add_fld(
'setdate'
,
'date-label'
,rules:
'date'
,label:
'Datum'
,errormsg:
'Ingrese una fecha válida'
);
//#+
22
23
$oForm->_msg_info =
"Establecer la fecha actual para el bloque de hoy"
;
24
$oForm->_msg_error =
"Introduzca una fecha válida"
;
25
$oForm->_msg_success =
"Fecha establecida correctamente"
;
26
27
if
($oForm->submit()) {
28
//dbx_debug("Login-Submit",$oForm->_errors,$oForm->_warnings);
29
if
(!$oForm->errors()) {
// submit && no errors
30
$config
=
dbx
()->get_config(
'myLKW'
);
31
$dateString = $oForm->get_post_data(
'setdate'
,$today,
'date'
);
32
$dateObj = new \DateTime($dateString);
33
$config
[
'shiftdate'
] = $dateObj->format(
'Y-m-d'
);
34
dbx
()->set_config(
'myLKW'
,
$config
);
35
}
36
37
}
// submit()
38
$content= $oForm->run();
39
return
$content;
40
}
41
42
}
dbx\myLKW\myLKW_dayset
Definition
myLKW_dayset.class.php:4
dbx\myLKW\myLKW_dayset\run
run()
Definition
myLKW_dayset.class.php:7
$config
$config['version']
Definition
config.php:2
dbx
DBX schema administration.
dbx
modules
myLKW
include
myLKW_dayset.class.php
Generated by
1.17.0