diff --git a/dbd/qq/SYS_SAIMOD_CRON_ADD.php b/dbd/qq/SYS_SAIMOD_CRON_ADD.php new file mode 100644 index 0000000..703e62a --- /dev/null +++ b/dbd/qq/SYS_SAIMOD_CRON_ADD.php @@ -0,0 +1,11 @@ + -
| ID | -Group | -Type | -ParentID | -ParentValue | -Name | -Verify | +class | +min | +hour | +day | +day_week | +month |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ${ID} | -${group} | -${type} | -${parentID} | -${parentValue} | -${name} | -${verify} | +${class} | +${min} | +${hour} | +${day} | +${day_week} | +${month} |
Api call deleted!
'); - $('#del_api_del').hide(); + console.log("cron call deleted"); + $('#cron_deletedialog').html('Api call deleted!
'); + $('#del_cron_del').hide(); }});});}});}); - $('#addcall').click(function() { - var id = $('#new_call_id').val(); - var group = $('#new_call_group').val(); - var type = $('#new_call_type').val(); - var parentid = $('#new_call_parentid').val(); - var parentvalue = $('#new_call_parentvalue').val(); - var name = $('#new_call_name').val(); - var verify = $('#new_call_verify').val(); + $('#addcron').click(function() { + var cls = $('#new_cron_class').val(); + var min = $('#new_cron_min').val(); + var hour = $('#new_cron_hour').val(); + var day = $('#new_cron_day').val(); + var day_week = $('#new_cron_day_week').val(); + var month = $('#new_cron_month').val(); $.ajax({ url: SAI_ENDPOINT, - data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', - action: 'addcall', - ID: id, - group: group, - type: type, - parentID: parentid, - parentValue : parentvalue, - name: name, - verify: verify}, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_cron', + action: 'add', + cls: cls, + min: min, + hour: hour, + day: day, + day_week: day_week, + month: month}, type: 'GET', success: function(data) { - console.log("new api call added"); - saimod_sys_api_loadcontent(); + console.log("new cronjob added"); } }); }); - $('#del_api_close').click(function() { + $('#del_cron_close').click(function() { console.log("olenski"); - $('#del_api_description').hide(); - $('#del_api_del').show(); - saimod_sys_api_loadcontent(); - }); - $('#localetab a').click(function (e) {e.preventDefault(); $(this).tab('show');}); -} - -function saimod_sys_api_tree(){ - $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch'); - $('.tree li.parent_li > span').on('click', function (e) { - var children = $(this).parent('li.parent_li').find(' > ul > li'); - if (children.is(":visible")) { - children.hide('fast'); - $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign'); - } else { - children.show('fast'); - $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign'); - } - e.stopPropagation(); + $('#del_cron_description').hide(); + $('#del_cron_del').show(); }); } \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/saimod_sys_cron.php b/sai/modules/saimod_sys_cron/saimod_sys_cron.php index 698b6ea..db24caa 100644 --- a/sai/modules/saimod_sys_cron/saimod_sys_cron.php +++ b/sai/modules/saimod_sys_cron/saimod_sys_cron.php @@ -4,48 +4,33 @@ namespace SYSTEM\SAI; class saimod_sys_cron extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saimod_sys_cron(){ $vars = array(); - $vars['tabopts'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tabopt.tpl'), array()); $vars['content'] = ''; - $res = \SYSTEM\DBD\SYS_SAIMOD_CRON::QQ(); while($r = $res->next()){ $vars['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/list_entry.tpl'), $r);} - - $vars['tabs'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tab.tpl'), $vars); return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tabs.tpl'), $vars); } - public static function sai_mod__system_sai_saimod_sys_api_action_deletedialog($ID){ - $res = \SYSTEM\DBD\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/delete_dialog.tpl'), $res); - } + public static function sai_mod__system_sai_saimod_sys_cron_action_deldialog($cls){ + $res = \SYSTEM\DBD\SYS_SAIMOD_CRON_SINGLE_SELECT::Q1(array($cls)); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/delete_dialog.tpl'), $res);} - public static function sai_mod__system_sai_saimod_sys_api_action_addcall($ID,$group,$type,$parentID,$parentValue,$name,$verify){ - if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ + public static function sai_mod__system_sai_saimod_sys_cron_action_add($cls,$min,$hour,$day,$day_week,$month){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} - \SYSTEM\DBD\SYS_SAIMOD_API_ADD::QI(array($ID,$group,$type,$parentID,$parentValue,$name,$verify)); + \SYSTEM\DBD\SYS_SAIMOD_CRON_ADD::QI(array($cls,$min,$hour,$day,$day_week,$month)); return \SYSTEM\LOG\JsonResult::ok(); } - public static function sai_mod__system_sai_saimod_sys_api_action_deletecall($ID){ - if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ + public static function sai_mod__system_sai_saimod_sys_cron_action_del($cls){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} - \SYSTEM\DBD\SYS_SAIMOD_API_DEL::QI(array($ID)); - return \SYSTEM\LOG\JsonResult::ok(); - } - - private static function tablerow_class($flag){ - switch($flag){ - case 0: return 'info'; - case 1: return ''; - case 4: return 'warning'; - default: return 'success'; - } - } + \SYSTEM\DBD\SYS_SAIMOD_CRON_DEL::QI(array($cls)); + return \SYSTEM\LOG\JsonResult::ok();} public static function html_li_menu(){return '| class | -min | -hour | -day | -day_week | -month | -last_run | -status | -
|---|
| class | +min | +hour | +day | +day_week | +month | +last_run | +status | +
|---|---|---|---|---|---|---|---|
| + | + | + | + | + | + | + | + |
| class | -min | -hour | -day | -day_week | -month | -last_run | -status | -
|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | - | - |