summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-03-05 13:52:08 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-05-19 18:15:30 +0200
commitbdb5511e1e5d8fd2800a4cb0766ab1936f5d1950 (patch)
tree6b61ba3461c796ed91939396bd573b8ca5aa3292
parent319ce41906376b9ef811101eba559a9934674aae (diff)
#942 Adapt web to use /schedule get on /schedule/create (web)
-rw-r--r--admin/WebConsole/gestores/gestor_programaciones.php2
-rw-r--r--admin/WebConsole/includes/restfunctions.php11
2 files changed, 13 insertions, 0 deletions
diff --git a/admin/WebConsole/gestores/gestor_programaciones.php b/admin/WebConsole/gestores/gestor_programaciones.php
index 2edbe373..814f98a1 100644
--- a/admin/WebConsole/gestores/gestor_programaciones.php
+++ b/admin/WebConsole/gestores/gestor_programaciones.php
@@ -86,6 +86,8 @@ if($pswop!=$op_suspension){
$pnombrebloque, $pannos, $pmeses, $pdiario,
$phoras, $pampm, $pminutos);
$swop=$op_alta;
+ $schedule = get_schedule($pidentificador);
+ $idr = max(array_keys($schedule));
break;
case $op_eliminacion:
$result = delete_schedule($pidprogramacion);
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index b6729345..a748ef9a 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -30,6 +30,7 @@ define('OG_REST_CMD_RUN_TASK', 'task/run');
define('OG_REST_CMD_CREATE_SCHEDULE', 'schedule/create');
define('OG_REST_CMD_DELETE_SCHEDULE', 'schedule/delete');
define('OG_REST_CMD_UPDATE_SCHEDULE', 'schedule/update');
+define('OG_REST_CMD_SCHEDULE', 'schedule');
define('OG_REST_PARAM_CLIENTS', 'clients');
define('OG_REST_PARAM_ADDR', 'addr');
@@ -618,6 +619,16 @@ function update_schedule($schedule_id, $task_id, $name, $years, $months, $days,
return common_request(OG_REST_CMD_UPDATE_SCHEDULE, POST, $data);
}
+function get_schedule($task_id = null) {
+ if (isset($task_id))
+ $data = array(OG_REST_PARAM_TASK => strval($task_id));
+ else
+ $data = null;
+
+ $result = common_request(OG_REST_CMD_SCHEDULE, POST, $data);
+ return $result;
+}
+
/*
* @function multiRequest.
* @param URLs array (may include header and POST data), cURL options array.