7 public function run() {
8 dbx()->debug(
"myLKWD_dayset");
11 $today = (new \DateTime())->format(
'Y-m-d');
12 $date =
dbx()->get_config(
'myLKW',
'shiftdate');
13 $data[
'setdate']=$date;
15 $oForm=
dbx()->get_system_obj(
'dbxForm');
16 $oForm->init(
'form-dayset');
17 $oForm->_action=
'?dbx_modul=myLKW&dbx_run1=dayset';
19 $oForm->add_module_bar(
'Establecer la fecha',
'bi-calendar-date');
21 $oForm->add_fld(
'setdate',
'date-label' ,rules:
'date',label:
'Datum',errormsg:
'Ingrese una fecha válida');
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";
27 if($oForm->submit()) {
29 if(!$oForm->errors()) {
31 $dateString = $oForm->get_post_data(
'setdate',$today,
'date');
32 $dateObj = new \DateTime($dateString);
33 $config[
'shiftdate'] = $dateObj->format(
'Y-m-d');