diff --git a/module/common/view/footer.lite.html.php b/module/common/view/footer.lite.html.php index 456b04cc74..413b70d9f9 100755 --- a/module/common/view/footer.lite.html.php +++ b/module/common/view/footer.lite.html.php @@ -1,5 +1,6 @@ getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> +loadModel('cron')->runable()) js::execute('startCron()');?> diff --git a/module/cron/control.php b/module/cron/control.php index f165a3e09c..b31b779efe 100644 --- a/module/cron/control.php +++ b/module/cron/control.php @@ -40,6 +40,17 @@ class cron extends control die(js::reload('parent')); } + /** + * Open cron process. + * + * @access public + * @return void + */ + public function openProcess() + { + $this->display(); + } + /** * Create cron. * diff --git a/module/cron/lang/en.php b/module/cron/lang/en.php index 5cc35ccea1..0404479879 100644 --- a/module/cron/lang/en.php +++ b/module/cron/lang/en.php @@ -1,12 +1,13 @@ cron->common = 'Cron'; -$lang->cron->index = 'Index'; -$lang->cron->list = 'List'; -$lang->cron->create = 'Create'; -$lang->cron->edit = 'Edit'; -$lang->cron->delete = 'Delete'; -$lang->cron->toggle = 'Activation/Disable'; -$lang->cron->turnon = 'Open/Close'; +$lang->cron->common = 'Cron'; +$lang->cron->index = 'Index'; +$lang->cron->list = 'List'; +$lang->cron->create = 'Create'; +$lang->cron->edit = 'Edit'; +$lang->cron->delete = 'Delete'; +$lang->cron->toggle = 'Activation/Disable'; +$lang->cron->turnon = 'Open/Close'; +$lang->cron->openProcess = 'Open process'; $lang->cron->m = 'Minute'; $lang->cron->h = 'Hour'; @@ -43,8 +44,9 @@ $lang->cron->confirmOpen = <<cron->notice = new stdclass(); -$lang->cron->notice->m = 'Range : 0-59,"*" express the range of numbers, "/" express "Every", "-" express digital range.'; -$lang->cron->notice->h = 'Range : 0-23'; -$lang->cron->notice->dom = 'Range : 1-31'; -$lang->cron->notice->mon = 'Range : 1-12'; -$lang->cron->notice->dow = 'Range : 0-6'; +$lang->cron->notice->m = 'Range : 0-59,"*" express the range of numbers, "/" express "Every", "-" express digital range.'; +$lang->cron->notice->h = 'Range : 0-23'; +$lang->cron->notice->dom = 'Range : 1-31'; +$lang->cron->notice->mon = 'Range : 1-12'; +$lang->cron->notice->dow = 'Range : 0-6'; +$lang->cron->notice->help = 'Note: if the server is restarted, or that the timing task is not normal, then the timing task has stopped. You need to click the [Open process] button or refresh page after a minute to open the scheduled tasks. If the last run time of first record is changed in cron list, then the task is turned on.'; diff --git a/module/cron/lang/zh-cn.php b/module/cron/lang/zh-cn.php index d8e1a4b248..fcf17a1030 100644 --- a/module/cron/lang/zh-cn.php +++ b/module/cron/lang/zh-cn.php @@ -1,12 +1,13 @@ cron->common = '定时任务'; -$lang->cron->index = '首页'; -$lang->cron->list = '任务列表'; -$lang->cron->create = '添加'; -$lang->cron->edit = '编辑'; -$lang->cron->delete = '删除'; -$lang->cron->toggle = '激活/禁用'; -$lang->cron->turnon = '打开/关闭'; +$lang->cron->common = '定时任务'; +$lang->cron->index = '首页'; +$lang->cron->list = '任务列表'; +$lang->cron->create = '添加'; +$lang->cron->edit = '编辑'; +$lang->cron->delete = '删除'; +$lang->cron->toggle = '激活/禁用'; +$lang->cron->turnon = '打开/关闭'; +$lang->cron->openProcess = '创建进程'; $lang->cron->m = '分'; $lang->cron->h = '小时'; @@ -43,8 +44,9 @@ $lang->cron->confirmOpen = <<cron->notice = new stdclass(); -$lang->cron->notice->m = '取值范围:0-59,"*"代表取值范围内的数字,"/"代表"每", "-"代表数字范围。'; -$lang->cron->notice->h = '取值范围:0-23'; -$lang->cron->notice->dom = '取值范围:1-31'; -$lang->cron->notice->mon = '取值范围:1-12'; -$lang->cron->notice->dow = '取值范围:0-6'; +$lang->cron->notice->m = '取值范围:0-59,"*"代表取值范围内的数字,"/"代表"每", "-"代表数字范围。'; +$lang->cron->notice->h = '取值范围:0-23'; +$lang->cron->notice->dom = '取值范围:1-31'; +$lang->cron->notice->mon = '取值范围:1-12'; +$lang->cron->notice->dow = '取值范围:0-6'; +$lang->cron->notice->help = '注:如果服务器重启,或者发现定时任务没有正常工作,那么定时任务已经停止工作。需要手动点击【创建进程】按钮,或者一分钟后刷新页面,来开启计划任务。如果任务列表中第一条记录的最后执行时间改变,说明任务开启成功。'; diff --git a/module/cron/view/index.html.php b/module/cron/view/index.html.php index 13360d947a..7931efc7e6 100644 --- a/module/cron/view/index.html.php +++ b/module/cron/view/index.html.php @@ -20,7 +20,10 @@
cron->list?> -
cron->create, '', "class='btn btn-primary btn-sm'")?>
+
+ cron->openProcess, 'hiddenwin', "class='btn btn-sm'")?> + cron->create, '', "class='btn btn-primary btn-sm'")?> +
@@ -61,6 +64,7 @@
+
cron->notice->help?>
diff --git a/module/cron/view/openprocess.html.php b/module/cron/view/openprocess.html.php new file mode 100644 index 0000000000..a51f9b2193 --- /dev/null +++ b/module/cron/view/openprocess.html.php @@ -0,0 +1,22 @@ + + * @package cron + * @version $Id$ + * @link http://www.zentao.net + */ +?> + + + + diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 7e33c65c4b..7a81aa9e34 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -856,6 +856,7 @@ $lang->resource->cron->create = 'create'; $lang->resource->cron->edit = 'edit'; $lang->resource->cron->toggle = 'toggle'; $lang->resource->cron->delete = 'delete'; +$lang->resource->cron->openProcess = 'openProcess'; $lang->cron->methodOrder[5] = 'index'; $lang->cron->methodOrder[10] = 'turnon'; @@ -863,6 +864,7 @@ $lang->cron->methodOrder[15] = 'create'; $lang->cron->methodOrder[20] = 'edit'; $lang->cron->methodOrder[25] = 'toggle'; $lang->cron->methodOrder[30] = 'delete'; +$lang->cron->methodOrder[35] = 'openProcess'; $lang->resource->dev = new stdclass(); $lang->resource->dev->api = 'api'; @@ -1085,3 +1087,4 @@ $lang->changelog['7.2'][] = 'project-updateOrder'; $lang->changelog['7.3'][] = 'project-fixFirst'; $lang->changelog['7.3'][] = 'productplan-batchEdit'; $lang->changelog['7.3'][] = 'admin-sso'; +$lang->changelog['7.3'][] = 'cron-openProcess'; diff --git a/www/js/my.full.js b/www/js/my.full.js index f9473b58ac..6227c7b0dd 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -40,7 +40,7 @@ function createLink(moduleName, methodName, vars, viewType, isOnlyBody) } /* if page has onlybody param then add this param in all link. the param hide header and footer. */ - if(onlybody == 'yes' || isOnlyBody) + if((typeof(onlybody) != 'undefined' && onlybody == 'yes') || isOnlyBody) { var onlybody = config.requestType == 'PATH_INFO' ? "?onlybody=yes" : '&onlybody=yes'; link = link + onlybody; @@ -1340,7 +1340,7 @@ needPing = true; /* When body's ready, execute these. */ $(document).ready(function() { - if(onlybody == 'yes') checkOnlybodyPage(); + if(typeof(onlybody) != 'undefined' && onlybody == 'yes') checkOnlybodyPage(); $('body').addClass('m-{currentModule}-{currentMethod}'.format(config)); setModal();