humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
лог изменений
edit
edit($num_task,$path,$type=0,$date="",$time="",$count=-1,$active=true,$comments="",$add_params=""); - изменить данные задачи с заданным номером в расписании скриптовФункция на вход принимает параметры:
- 0 - Один раз
- 1 - Раз в час
- 2 - Раз в день
- 3 - Раз в неделю
- 4 - Раз в месяц
- 5 - Раз в год
- 6 - По выбору
- 7 - Раз в минуту
- 8 - Раз в 5 минут
- 9 - Раз в 10 минут
- 10 - Раз в полчаса
- 11 - N раз
- 12 - бесконечно
После отработки функция возвращает результат своей работы в скрипт :
Пример использования
<?php // Scenario: Edit existing scheduled tasks $xhe_host = "localhost:7010"; if (!isset($path)){ // Path to the init.php file for connecting to the XHE API $path = "../../../Templates/init.php"; // Including init.php grants access to all classes and functionality for working with the XHE API require($path); } echo "\n<span>scheduler->" . basename(__FILE__) . "</span>\n"; // Step: Prepare variables to store task parameters $taskPath = ""; $taskType = ""; $taskDate = ""; $taskTime = ""; $taskCount = ""; $taskActive = ""; $taskComments = ""; $taskAddParam = ""; // Step: Prepare task index for editing $taskIndex = 0; // Step: Get the zero task echo "Step: Get the zero task\n"; $getResult = WINDOW::$scheduler->get($taskIndex, $taskPath, $taskType, $taskDate, $taskTime, $taskCount, $taskActive, $taskComments, $taskAddParam); if ($getResult) { echo "Task retrieved successfully\n"; echo "Path: " . $taskPath . "\n"; echo "Type: " . $taskType . "\n"; echo "Date: " . $taskDate . "\n"; echo "Time: " . $taskTime . "\n"; echo "Count: " . $taskCount . "\n"; echo "Active: " . $taskActive . "\n"; echo "Comments: " . $taskComments . "\n"; echo "Additional parameters: " . $taskAddParam . "\n"; } else { echo "Failed to retrieve task\n"; } // Step: Prepare new task parameters $nextTime = date("H:i:s", time() + 200); $newDate = date("Y-m-d"); $newAddParam = 15; // Example 1: Edit the zero task echo "\nExample 1: Edit the zero task\n"; $editResult = WINDOW::$scheduler->edit($taskIndex, $taskPath, $taskType, $newDate, $nextTime, $taskCount, true, $taskComments, $newAddParam); if ($editResult) echo "Task edited successfully\n"; else echo "Failed to edit task\n"; // Quit the application WINDOW::$app->quit(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7010" from xweb_human_emulator import * # начало echo("<hr><font color=blue>scheduler.xxxxxxxxx</font><hr>") # 1 echo("1. Получим нулевую заадчу : ") path,type,date,time,count,active,comments,add_param = scheduler.get(0) echo(scheduler.get(0),"<br>") # 2 echo("2. Отредактируем нулевую задчу : ") add_param=15 comments=comments+"edited" echo(scheduler.edit(0,path,type, date,time,count, true,comments,add_param)) #app.restart('','',app.get_port())) # конец echo("<hr><br>") # Quit app.quit()
#region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program:XHEScript { static void Main(string[] args) { // init XHE server = "localhost:7010"; InitXHE(); // начало echo("<hr><font color=blue>scheduler.clear_tab_content</font><hr>"); // 1 шаг echo("1. Отредактируем нулевую задчу : "); echo(scheduler.edit(0,"test 0.php",0,"2015.07.10","10:2:3",-1,true,"task 10")); // конец echo("\n\n"); app.quit(); } }
// подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7010"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>window.edit</font><hr>"); // 1 шаг echo("1. Получим нулевую заадчу : "); var task=new Array(7); echo(scheduler.get(0,task)+"<br>"); // получим из массива - данные задачи var path_,type,date,time,count,active,comments; path_=task[0]; type=task[1]; date=task[2]; time=task[3]; count=task[4]; active=task[5]; comments=task[6]; // выведем данные задачи echo("path = "+path_); echo("\ntype = "+type); echo("\ndate = "+date); echo("\ntime = "+time); echo("\ncount = "+count); echo("\nactive = "+active); echo("\ncomments = "+comments); // 2 шаг echo("\n2. Отредактируем нулевую задчу : "); var timeInMs = new Date(Date.now()+900000); // now + 90 second var new_date= timeInMs.getFullYear()+"-"+timeInMs.getDate()+"-"+timeInMs.getMonth(); var new_time = timeInMs.getHours()+":"+timeInMs.getMinutes()+":"+timeInMs.getSeconds(); console.log(new_date); console.log(new_time ); echo(scheduler.edit(0,"path","type", new_date,new_time,count, false,"comments")); // конец echo("\n"); // Quit app.quit();
=============================================
Scheduler Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.