summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2020-03-06 14:26:23 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-05-19 18:15:30 +0200
commit6ee5cbff8386d50602ff7e50d53fc248e4baee6b (patch)
tree7127b6ba8cd77c24dacb7f94c98d48f2bf603a27
parentf28234a7176db39e4002aa115316dda8ba1dbe2d (diff)
#942 Add weeks and week_days to the webconsole schedule (web)
-rw-r--r--admin/WebConsole/gestores/gestor_programaciones.php4
-rw-r--r--admin/WebConsole/includes/restfunctions.php8
2 files changed, 8 insertions, 4 deletions
diff --git a/admin/WebConsole/gestores/gestor_programaciones.php b/admin/WebConsole/gestores/gestor_programaciones.php
index 5bd49b7c..8aa0078b 100644
--- a/admin/WebConsole/gestores/gestor_programaciones.php
+++ b/admin/WebConsole/gestores/gestor_programaciones.php
@@ -83,8 +83,8 @@ if($pswop!=$op_suspension){
switch($pswop){
case $op_alta:
$result = create_schedule($pidentificador,
- $pnombrebloque, $pannos, $pmeses, $pdiario,
- $phoras, $pampm, $pminutos);
+ $pnombrebloque, $pannos, $pmeses, $psemanas,
+ $pdias, $pdiario, $phoras, $pampm, $pminutos);
$swop=$op_alta;
$schedule = get_schedule($pidentificador);
$idr = max(array_column($schedule['schedule'], OG_REST_PARAM_ID));
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index 5c73d7b7..66af9d9f 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -68,6 +68,8 @@ define('OG_REST_PARAM_TASK', 'task');
define('OG_REST_PARAM_TIME_PARAMS', 'time_params');
define('OG_REST_PARAM_YEARS', 'years');
define('OG_REST_PARAM_MONTHS', 'months');
+define('OG_REST_PARAM_WEEKS', 'weeks');
+define('OG_REST_PARAM_WEEK_DAYS', 'week_days');
define('OG_REST_PARAM_DAYS', 'days');
define('OG_REST_PARAM_HOURS', 'hours');
define('OG_REST_PARAM_AM_PM', 'am_pm');
@@ -571,8 +573,8 @@ function run_task($task_id) {
return common_request(OG_REST_CMD_RUN_TASK, POST, $data);
}
-function create_schedule($task_id, $name, $years, $months, $days, $hours,
- $am_pm, $minutes) {
+function create_schedule($task_id, $name, $years, $months, $weeks, $week_days,
+ $days, $hours, $am_pm, $minutes) {
$data = array (
OG_REST_PARAM_TASK => $task_id,
@@ -580,6 +582,8 @@ function create_schedule($task_id, $name, $years, $months, $days, $hours,
OG_REST_PARAM_TIME_PARAMS => array (
OG_REST_PARAM_YEARS => intval($years),
OG_REST_PARAM_MONTHS => intval($months),
+ OG_REST_PARAM_WEEKS => intval($weeks),
+ OG_REST_PARAM_WEEK_DAYS => intval($week_days),
OG_REST_PARAM_DAYS => intval($days),
OG_REST_PARAM_HOURS => intval($hours),
OG_REST_PARAM_AM_PM => intval($am_pm),