diff --git a/config/config.php b/config/config.php index 5832892fe4..0af47c222b 100644 --- a/config/config.php +++ b/config/config.php @@ -16,7 +16,7 @@ if(!class_exists('config')){class config{}} if(!function_exists('getWebRoot')){function getWebRoot(){}} /* 基本设置。Basic settings. */ -$config->version = '16.4'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. +$config->version = '16.5'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. $config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. $config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time. $config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php. diff --git a/db/update16.4.sql b/db/update16.4.sql index 2f2265fb9c..dfd7d07147 100644 --- a/db/update16.4.sql +++ b/db/update16.4.sql @@ -23,4 +23,4 @@ ALTER TABLE `zt_story` ADD `activatedDate` datetime NOT NULL AFTER `closedReason ALTER TABLE `zt_task` MODIFY `activatedDate` datetime NOT NULL AFTER `lastEditedDate`; ALTER TABLE `zt_user` ADD `visions` varchar(20) NOT NULL AFTER `visits`; -UPDATE `zt_user` SET `visions`='rnd,lite'; +UPDATE `zt_user` SET `visions`='rnd,lite'; \ No newline at end of file diff --git a/extension/lite/action/ext/lang/zh-cn/lite.php b/extension/lite/action/ext/lang/zh-cn/lite.php index 8bb9e00e85..bedbda2bb6 100644 --- a/extension/lite/action/ext/lang/zh-cn/lite.php +++ b/extension/lite/action/ext/lang/zh-cn/lite.php @@ -36,3 +36,61 @@ $lang->action->dynamicAction->task['unlinkparenttask'] = '从父任务取消 $lang->action->dynamicAction->task['deletechildrentask'] = '删除子任务'; $lang->action->dynamicAction->task['linkparenttask'] = '关联到父任务'; $lang->action->dynamicAction->task['linkchildtask'] = '关联子任务'; + +$lang->action->label->createchildrenstory = "创建子目标"; +$lang->action->label->linkchildstory = "关联子目标"; +$lang->action->label->unlinkchildrenstory = "取消关联子目标"; +$lang->action->label->linkparentstory = "关联到父目标"; +$lang->action->label->unlinkparentstory = "从父目标取消关联"; +$lang->action->label->deletechildrenstory = "删除子目标"; + +$lang->action->search->label = array(); +$lang->action->search->label[''] = ''; +$lang->action->search->label['created'] = $lang->action->label->created; +$lang->action->search->label['opened'] = $lang->action->label->opened; +$lang->action->search->label['changed'] = $lang->action->label->changed; +$lang->action->search->label['edited'] = $lang->action->label->edited; +$lang->action->search->label['assigned'] = $lang->action->label->assigned; +$lang->action->search->label['closed'] = $lang->action->label->closed; +$lang->action->search->label['deleted'] = $lang->action->label->deleted; +$lang->action->search->label['deletedfile'] = $lang->action->label->deletedfile; +$lang->action->search->label['editfile'] = $lang->action->label->editfile; +$lang->action->search->label['erased'] = $lang->action->label->erased; +$lang->action->search->label['undeleted'] = $lang->action->label->undeleted; +$lang->action->search->label['hidden'] = $lang->action->label->hidden; +$lang->action->search->label['commented'] = $lang->action->label->commented; +$lang->action->search->label['activated'] = $lang->action->label->activated; +$lang->action->search->label['reviewed'] = $lang->action->label->reviewed; +$lang->action->search->label['moved'] = $lang->action->label->moved; +$lang->action->search->label['confirmed'] = $lang->action->label->confirmed; +$lang->action->search->label['totask'] = $lang->action->label->totask; +$lang->action->search->label['changestatus'] = $lang->action->label->changestatus; +$lang->action->search->label['marked'] = $lang->action->label->marked; +$lang->action->search->label['linked2project'] = $lang->action->label->linked2project; +$lang->action->search->label['unlinkedfromproject'] = $lang->action->label->unlinkedfromproject; +$lang->action->search->label['linked2execution'] = $lang->action->label->linked2execution; +$lang->action->search->label['unlinkedfromexecution'] = $lang->action->label->unlinkedfromexecution; +$lang->action->search->label['started'] = $lang->action->label->started; +$lang->action->search->label['restarted'] = $lang->action->label->restarted; +$lang->action->search->label['recordestimate'] = $lang->action->label->recordestimate; +$lang->action->search->label['editestimate'] = $lang->action->label->editestimate; +$lang->action->search->label['canceled'] = $lang->action->label->canceled; +$lang->action->search->label['finished'] = $lang->action->label->finished; +$lang->action->search->label['paused'] = $lang->action->label->paused; +$lang->action->search->label['verified'] = $lang->action->label->verified; +$lang->action->search->label['login'] = $lang->action->label->login; +$lang->action->search->label['logout'] = $lang->action->label->logout; + +$lang->action->label->createchildrenstory = "创建子目标"; +$lang->action->label->linkchildstory = "关联子目标"; +$lang->action->label->unlinkchildrenstory = "取消关联子目标"; +$lang->action->label->linkparentstory = "关联到父目标"; +$lang->action->label->unlinkparentstory = "从父目标取消关联"; +$lang->action->label->deletechildrenstory = "删除子目标"; + +$lang->action->desc->createchildrenstory = '$date, 由 $actor 创建子目标 $extra。' . "\n"; +$lang->action->desc->linkchildstory = '$date, 由 $actor 关联子目标 $extra。' . "\n"; +$lang->action->desc->unlinkchildrenstory = '$date, 由 $actor 移除子目标 $extra。' . "\n"; +$lang->action->desc->linkparentstory = '$date, 由 $actor 关联到父目标 $extra。' . "\n"; +$lang->action->desc->unlinkparentstory = '$date, 由 $actor 从父目标$extra取消关联。' . "\n"; +$lang->action->desc->deletechildrenstory = '$date, 由 $actor 删除子目标$extra。' . "\n"; diff --git a/extension/lite/common/ext/lang/zh-cn/lite.php b/extension/lite/common/ext/lang/zh-cn/lite.php index 8f1fd98ac4..029f37b3c1 100644 --- a/extension/lite/common/ext/lang/zh-cn/lite.php +++ b/extension/lite/common/ext/lang/zh-cn/lite.php @@ -18,6 +18,7 @@ if($config->edition != 'open') { $lang->navIcons['feedback'] = ""; $lang->navIcons['oa'] = ""; + $lang->navIcons['workflow'] = ""; $lang->mainNav->feedback = $lang->navIcons['feedback'] . '反馈|feedback|browse|'; $lang->mainNav->oa = $lang->navIcons['oa'] . '办公|attend|personal|'; @@ -75,7 +76,7 @@ $lang->project->target = '目标'; $lang->kanban->menu = new stdclass(); $lang->kanban->menu->index = array('link' => "{$lang->dashboard}|project|index|project=%s"); $lang->kanban->menu->execution = array('link' => "$lang->executionKanban|project|execution|status=all&projectID=%s", 'subModule' => 'execution,task'); -$lang->kanban->menu->story = array('link' => "{$lang->project->target}|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track'); +$lang->kanban->menu->story = array('link' => "{$lang->project->target}|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree,story', 'alias' => 'story,track'); $lang->kanban->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=project&objectID=%s", 'subModule' => 'doc'); $lang->kanban->menu->dynamic = array('link' => "$lang->dynamic|project|dynamic|project=%s"); $lang->kanban->menu->settings = array('link' => "$lang->settings|project|view|project=%s", 'subModule' => 'stakeholder', 'alias' => 'edit,manageproducts,group,managemembers,manageview,managepriv,whitelist,addwhitelist,team'); diff --git a/extension/lite/datatable/ext/lang/zh-cn/lite.php b/extension/lite/datatable/ext/lang/zh-cn/lite.php new file mode 100644 index 0000000000..013fb74d20 --- /dev/null +++ b/extension/lite/datatable/ext/lang/zh-cn/lite.php @@ -0,0 +1,6 @@ +datatable->moduleSetting = '目录设置'; +$lang->datatable->showModule = '列表页是否显示目录名'; +$lang->datatable->showAllModule = '是否显示完整产品目录'; +$lang->datatable->showModuleList['base'] = '只显示一级目录'; +$lang->datatable->showModuleList['end'] = '只显示最后一级目录'; diff --git a/extension/lite/project/ext/css/edit/edit.css b/extension/lite/project/ext/css/edit/edit.css new file mode 100644 index 0000000000..adca7333b2 --- /dev/null +++ b/extension/lite/project/ext/css/edit/edit.css @@ -0,0 +1,5 @@ +#dataform table tbody tr:first-child{display:none!important;} +#dataform table tbody tr:nth-child(5){display:none!important;} +#dataform table tbody tr:nth-child(7){display:none!important;} +#dataform table tbody tr:nth-child(8){display:none!important;} +#dataform table tbody tr:nth-child(13){display:none!important;} diff --git a/extension/lite/project/ext/view/edit.lite.html.hook.php b/extension/lite/project/ext/view/edit.lite.html.hook.php deleted file mode 100644 index 46e8e1f046..0000000000 --- a/extension/lite/project/ext/view/edit.lite.html.hook.php +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/extension/lite/project/ext/view/execution.html.php b/extension/lite/project/ext/view/execution.html.php index ba68cfbab0..aeabeeebac 100644 --- a/extension/lite/project/ext/view/execution.html.php +++ b/extension/lite/project/ext/view/execution.html.php @@ -31,7 +31,7 @@

execution->noExecution;?> - createLink('execution', 'create', "projectID=$projectID"), " " . $lang->execution->createKanban, '', "class='btn btn-info' data-app='project'");?> + createLink('execution', 'create', "projectID=$projectID"), " " . $lang->project->createKanban, '', "class='btn btn-info' data-app='project'");?>

diff --git a/extension/lite/task/ext/view/batchcreate.html.php b/extension/lite/task/ext/view/batchcreate.html.php index 85a5fdb90b..8bf5d597eb 100644 --- a/extension/lite/task/ext/view/batchcreate.html.php +++ b/extension/lite/task/ext/view/batchcreate.html.php @@ -34,6 +34,7 @@ createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields')?> app->getModuleRoot() . '/common/view/customfield.html.php';?> +
+ + +';?> + + app->getModuleRoot() . '/common/view/pastetext.html.php';?> app->getModuleRoot() . '/common/view/footer.html.php';?> diff --git a/extension/lite/task/ext/view/create.html.php b/extension/lite/task/ext/view/create.html.php index 9ef19f6d53..6583ef2260 100644 --- a/extension/lite/task/ext/view/create.html.php +++ b/extension/lite/task/ext/view/create.html.php @@ -41,6 +41,16 @@ id, "class='form-control chosen' onchange='loadAll(this.value)' required");?> + 1 or count($lanes) > 1 or empty($extra)):?> + + task->region;?> + + + + task->lane;?> + + + task->type;?> task->typeList, $task->type, "class='form-control chosen' onchange='setOwners(this.value)' required");?> @@ -199,15 +209,6 @@ - 1 or count($lanes) > 1 or empty($extra)):?> - - task->region;?> - - - - task->lane;?> - - task->desc;?> @@ -215,7 +216,6 @@ desc), "rows='10' class='form-control'");?> - files;?> fetch('file', 'buildform');?> @@ -332,6 +332,20 @@ isINT) and class_exists('common')) ? common::convert2Pinyin($stories) : array());?> id);?> + + +';?> + + diff --git a/module/block/control.php b/module/block/control.php index 5c271ded29..d3f7eafb2d 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1396,7 +1396,8 @@ class block extends control { $sprints = $this->dao->select('status, count(*) as sprints')->from(TABLE_EXECUTION) ->where('deleted')->eq(0) - ->andWhere('type')->eq('sprint') + ->beginIF($this->config->vision == 'lite')->andWhere('type')->eq('kanban')->fi() + ->beginIF($this->config->vision == 'rnd')->andWhere('type')->eq('sprint')->fi() ->andWhere('parent')->eq($this->session->project) ->groupBy('status') ->fetchPairs(); diff --git a/module/bug/config.php b/module/bug/config.php index 4d51c0c15b..3a561f048d 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -169,6 +169,7 @@ $config->bug->datatable->fieldList['pri']['title'] = 'P'; $config->bug->datatable->fieldList['pri']['fixed'] = 'left'; $config->bug->datatable->fieldList['pri']['width'] = '50'; $config->bug->datatable->fieldList['pri']['required'] = 'no'; +$config->bug->datatable->fieldList['pri']['name'] = $lang->bug->pri; $config->bug->datatable->fieldList['confirmed']['title'] = 'confirmedAB'; $config->bug->datatable->fieldList['confirmed']['fixed'] = 'left'; diff --git a/module/bug/control.php b/module/bug/control.php index b9027f4e94..29c7483a65 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1768,7 +1768,7 @@ class bug extends control if(!$this->post->bugIDList) return print(js::locate($this->session->bugList, 'parent')); - $bugIDList = array_unique($$this->post->bugIDList); + $bugIDList = array_unique($this->post->bugIDList); $bugs = $this->dao->select('id, title, status, resolvedBy, openedBuild')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id'); $this->qa->setMenu($this->products, $productID, $branch); diff --git a/module/bug/view/linkbugs.html.php b/module/bug/view/linkbugs.html.php index b3ec18fa85..7ead53687b 100644 --- a/module/bug/view/linkbugs.html.php +++ b/module/bug/view/linkbugs.html.php @@ -32,7 +32,7 @@ idAB;?> - priAB;?> + pri;?>>priAB;?> bug->product;?> bug->title;?> bug->statusAB;?> diff --git a/module/build/view/linkbug.html.php b/module/build/view/linkbug.html.php index b4364e65d8..bdd39c2c5a 100644 --- a/module/build/view/linkbug.html.php +++ b/module/build/view/linkbug.html.php @@ -27,7 +27,7 @@ idAB;?> - priAB;?> + pri;?>> priAB;?> bug->title;?> openedByAB;?> bug->resolvedBy;?> diff --git a/module/build/view/linkstory.html.php b/module/build/view/linkstory.html.php index 3ce47e1e51..d874361a28 100644 --- a/module/build/view/linkstory.html.php +++ b/module/build/view/linkstory.html.php @@ -27,7 +27,7 @@ idAB;?> - priAB;?> + pri;?>>priAB;?> story->title;?> openedByAB;?> assignedToAB;?> diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index d10b01c3e0..d23b4ea3ae 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -89,7 +89,7 @@ tbody tr td:first-child input {display: none;} idAB);?> - priAB);?> + pri;?>>priAB);?> story->title);?> openedByAB);?> story->estimateAB);?> diff --git a/module/caselib/view/browse.html.php b/module/caselib/view/browse.html.php index e4e94f5217..5fc8f8174d 100644 --- a/module/caselib/view/browse.html.php +++ b/module/caselib/view/browse.html.php @@ -124,7 +124,7 @@ js::set('flow', $config->global->flow); idAB);?> - priAB);?> + pri;?>>priAB);?> testcase->title);?> typeAB);?> openedByAB);?> diff --git a/module/common/lang/en.php b/module/common/lang/en.php index cca6821996..0cb5fe57dd 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -146,6 +146,8 @@ $lang->assignedToAB = 'AssignedTo'; $lang->typeAB = 'Type'; $lang->nameAB = 'Name'; +$lang->pri = 'Priority'; + $lang->common->common = 'Common Module'; $lang->my->common = 'My'; $lang->program->common = 'Program'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index db0b35d8ca..bc0017d791 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -146,6 +146,8 @@ $lang->assignedToAB = '指派'; $lang->typeAB = '类型'; $lang->nameAB = '名称'; +$lang->pri = '优先级'; + $lang->common->common = '公有模块'; $lang->my->common = '地盘'; $lang->program->common = '项目集'; diff --git a/module/common/model.php b/module/common/model.php index c98df68a1c..60240e3547 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -359,7 +359,7 @@ class commonModel extends model { echo js::locate($denyLink); } - exit; + helper::end(); } /** diff --git a/module/execution/control.php b/module/execution/control.php index 65c887caee..d212039839 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1304,8 +1304,7 @@ class execution extends control $this->view->executionID = $executionID; $this->view->projectID = $projectID; $this->view->project = $project; - $this->display(); - exit; + return $this->display(); } $name = ''; @@ -2069,6 +2068,7 @@ class execution extends control $this->view->groupBy = $groupBy; $this->view->productID = $productID; $this->view->branchID = $branchID; + $this->view->projectID = $this->loadModel('task')->getProjectID($execution->id); $this->view->allPlans = $allPlans; $this->view->kanbanData = $kanbanData; $this->view->executionActions = $executionActions; @@ -2464,8 +2464,7 @@ class execution extends control include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; } - echo js::confirm($tips . sprintf($this->lang->execution->confirmDelete, $this->executions[$executionID]), $this->createLink('execution', 'delete', "executionID=$executionID&confirm=yes")); - exit; + return print(js::confirm($tips . sprintf($this->lang->execution->confirmDelete, $this->executions[$executionID]), $this->createLink('execution', 'delete', "executionID=$executionID&confirm=yes"))); } else { diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 95c7c9c0b3..ae7c567444 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -533,7 +533,7 @@ function renderBugItem(item, $item, col) if(scaleSize <= 1) { var $actions = $item.find('.actions'); - if(!$actions.length && item.menus && item.menus.length) + if(!$actions.length && (priv.canEditBug || priv.canResolveBug || priv.canConfirmBug || priv.canCopyBug || priv.canToStoryBug)) { $actions = $([ '
', @@ -597,7 +597,7 @@ function renderTaskItem(item, $item, col) if(scaleSize <= 1) { var $actions = $item.find('.actions'); - if(!$actions.length && item.menus && item.menus.length) + if(!$actions.length && (priv.canEditTask || priv.canRecordEstimateTask || priv.canCreateTask || priv.canCancelTask)) { $actions = $([ '
', @@ -1063,16 +1063,28 @@ function createTaskMenu(options) { var $card = options.$trigger.closest('.kanban-item'); var task = $card.data('item'); - var items = []; - $.each(task.menus, function() - { - var item = {label: this.label, icon: this.icon, url: this.url, attrs: {'data-toggle': 'modal', 'data-type': 'iframe'}}; - if(this.size) item.attrs['data-width'] = this.size; - - items.push(item); - }); + if(priv.canEditTask) items.push({label: taskLang.edit, icon: 'edit', url: createLink('task', 'edit', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canRecordEstimateTask) items.push({label: executionLang.effort, icon: 'time', url: createLink('task', 'recordEstimate', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canCreateTask) items.push({label: taskLang.copy, icon: 'copy', url: createLink('task', 'create', 'projectID=' + projectID + '&storyID=' + '0' + '&moduleID=' + '0' + '&taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canCancelTask && (task.$col.type == 'wait' || task.$col.type == 'developing' || task.$col.type == 'pause')) items.push({label: taskLang.cancel, icon: 'cancel', url: createLink('task', 'cancel', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + return items; +} + /** + * Create bug menu + * @returns {Object[]} + */ +function createBugMenu(options) +{ + var $card = options.$trigger.closest('.kanban-item'); + var bug = $card.data('item'); + var items = []; + if(priv.canEditBug) items.push({label: bugLang.edit, icon: 'edit', url: createLink('bug', 'edit', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canResolveBug && (bug.$col.type == 'unconfirmed' || bug.$col.type == 'confirmed' || bug.$col.type == 'fixing' || bug.$col.type == 'fixed')) items.push({label: bugLang.resolve, icon: 'checked', url: createLink('bug', 'resolve', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canConfirmBug && (bug.$col.type === 'unconfirmed')) items.push({label: bugLang.confirmBug, icon: 'ok', url: createLink('bug', 'confirmbug', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canCopyBug) items.push({label: bugLang.copy, icon: 'copy', url: createLink('bug', 'create', 'productID=' + productID + '&branch=' + '' + '&extras=bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canToStoryBug && (bug.$col.type != 'closed')) items.push({label: bugLang.toStory, icon: 'lightbulb', url: createLink('story', 'create', 'product=' + productID + '&branch=' + '0' + '&module=' + '0' + '&story=' + '0' + '&execution=' + '0' + '&bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); return items; } @@ -1084,6 +1096,7 @@ window.menuCreators = columnCreate: createColumnCreateMenu, task: createTaskMenu, story: createStoryMenu, + bug: createBugMenu, }; /** diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index d142e39081..7e7b45b102 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -271,6 +271,21 @@ function renderColumnCount($count, count, col) { var text = count + '/' + (col.limit < 0 ? '' : col.limit); $count.html(text + ''); + + if(col.limit != -1 && col.limit < count) + { + $count.parents('.title').parent('.kanban-header-col').css('background-color', '#F6A1A1'); + $count.parents('.title').find('.text').css('max-width', $count.parents('.title').width() - 200); + $count.css('color', '#E33030'); + if(!$count.parent().find('.error').length) $count.parent().find('.include-last').after(""); + } + else + { + $count.parents('.title').parent('.kanban-header-col').css('background-color', 'transparent'); + $count.parents('.title').find('.text').css('max-width', $count.parents('.title').width() - 120); + $count.css('color', '#8B91A2'); + $count.parent().find('.error').remove(); + } } /** diff --git a/module/execution/view/bug.html.php b/module/execution/view/bug.html.php index f55bda92a8..8a600fa219 100644 --- a/module/execution/view/bug.html.php +++ b/module/execution/view/bug.html.php @@ -80,7 +80,7 @@ idAB);?> bug->severityAB);?> - priAB);?> + execution->pri;?>>priAB);?> bug->title);?> openedByAB);?> bug->deadlineAB);?> diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 19c921774d..f1feb959f2 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -25,7 +25,7 @@
- + diff --git a/module/execution/view/grouptask.html.php b/module/execution/view/grouptask.html.php index 1b02351e56..870f20d676 100644 --- a/module/execution/view/grouptask.html.php +++ b/module/execution/view/grouptask.html.php @@ -112,7 +112,7 @@
task->id;?> - priAB;?> + execution->pri;?>>priAB;?> task->name;?> task->status;?> task->assignedTo;?> diff --git a/module/execution/view/importbug.html.php b/module/execution/view/importbug.html.php index b2fc7eafb1..4eaf81a875 100755 --- a/module/execution/view/importbug.html.php +++ b/module/execution/view/importbug.html.php @@ -38,7 +38,7 @@ var browseType = ''; idAB;?> bug->severityAB;?> - priAB;?> + execution->pri;?>>priAB;?> bug->title;?> bug->statusAB;?> '>task->pri;?> diff --git a/module/execution/view/importtask.html.php b/module/execution/view/importtask.html.php index 836c8f5f8d..5baf2ceadd 100644 --- a/module/execution/view/importtask.html.php +++ b/module/execution/view/importtask.html.php @@ -33,7 +33,7 @@ idAB;?> execution->name ?> - priAB;?> + execution->pri;?>>priAB;?> task->name;?> task->assignedTo;?> task->leftAB;?> diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 4ad84cd2e5..3e34b58562 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -46,6 +46,7 @@ js::set('displayCards', $execution->displayCards); js::set('fluidBoard', $execution->fluidBoard); js::set('colorListLang', $lang->kanbancard->colorList); js::set('colorList', $this->config->kanban->cardColorList); +js::set('projectID', $projectID); $canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1; $canEditRegion = commonModel::hasPriv('kanban', 'editRegion'); @@ -65,30 +66,34 @@ $hasBugButton = ($canCreateBug or $canBatchCreateBug); js::set('priv', array( - 'canCreateTask' => $canCreateTask, - 'canBatchCreateTask' => $canBatchCreateTask, - 'canCreateBug' => $canCreateBug, - 'canBatchCreateBug' => $canBatchCreateBug, - 'canCreateStory' => $canCreateStory, - 'canBatchCreateStory' => $canBatchCreateStory, - 'canLinkStory' => $canLinkStory, - 'canLinkStoryByPlan' => $canLinkStoryByPlan, - 'canAssignTask' => common::hasPriv('task', 'assignto'), - 'canAssignStory' => common::hasPriv('story', 'assignto'), - 'canFinishTask' => common::hasPriv('task', 'finish'), - 'canPauseTask' => common::hasPriv('task', 'pause'), - 'canCancelTask' => common::hasPriv('task', 'cancel'), - 'canCloseTask' => common::hasPriv('task', 'close'), - 'canActivateTask' => common::hasPriv('task', 'activate'), - 'canStartTask' => common::hasPriv('task', 'start'), - 'canAssignBug' => common::hasPriv('bug', 'assignto'), - 'canConfirmBug' => common::hasPriv('bug', 'confirmBug'), - 'canActivateBug' => common::hasPriv('bug', 'activate'), - 'canEditStory' => common::hasPriv('story', 'edit'), - 'canChangeStory' => common::hasPriv('story', 'change'), - 'canCreateTask' => common::hasPriv('task', 'create'), - 'canBatchCreateTask' => common::hasPriv('task', 'batchCreate'), - 'canUnlinkStory' => common::hasPriv('execution', 'unlinkStory'), + 'canCreateTask' => $canCreateTask, + 'canBatchCreateTask' => $canBatchCreateTask, + 'canCreateBug' => $canCreateBug, + 'canBatchCreateBug' => $canBatchCreateBug, + 'canCreateStory' => $canCreateStory, + 'canBatchCreateStory' => $canBatchCreateStory, + 'canLinkStory' => $canLinkStory, + 'canLinkStoryByPlan' => $canLinkStoryByPlan, + 'canAssignBug' => common::hasPriv('bug', 'assignto'), + 'canConfirmBug' => common::hasPriv('bug', 'confirmBug'), + 'canResolveBug' => common::hasPriv('bug', 'resolve'), + 'canCopyBug' => common::hasPriv('bug', 'create'), + 'canEditBug' => common::hasPriv('bug', 'edit'), + 'canActivateBug' => common::hasPriv('bug', 'activate'), + 'canAssignTask' => common::hasPriv('task', 'assignto'), + 'canFinishTask' => common::hasPriv('task', 'finish'), + 'canPauseTask' => common::hasPriv('task', 'pause'), + 'canCancelTask' => common::hasPriv('task', 'cancel'), + 'canCloseTask' => common::hasPriv('task', 'close'), + 'canActivateTask' => common::hasPriv('task', 'activate'), + 'canStartTask' => common::hasPriv('task', 'start'), + 'canEditTask' => common::hasPriv('task', 'edit'), + 'canRecordEstimateTask' => common::hasPriv('task', 'recordEstimate'), + 'canToStoryBug' => common::hasPriv('story', 'create'), + 'canAssignStory' => common::hasPriv('story', 'assignto'), + 'canEditStory' => common::hasPriv('story', 'edit'), + 'canChangeStory' => common::hasPriv('story', 'change'), + 'canUnlinkStory' => common::hasPriv('execution', 'unlinkStory'), ) ); js::set('hasStoryButton', $hasStoryButton); diff --git a/module/execution/view/linkstory.html.php b/module/execution/view/linkstory.html.php index 0a6d336e56..b19a0ad488 100644 --- a/module/execution/view/linkstory.html.php +++ b/module/execution/view/linkstory.html.php @@ -39,7 +39,7 @@ idAB;?> - priAB;?> + execution->pri;?>>priAB;?> story->title;?> story->product;?> story->module;?> diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 313eab805f..c394332710 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -199,7 +199,7 @@ execution->orderAB);?> - priAB);?> + execution->pri;?>>priAB);?> execution->storyTitle);?> story->category);?> openedByAB);?> diff --git a/module/execution/view/testcase.html.php b/module/execution/view/testcase.html.php index 2de4640de5..6ae9d094b1 100644 --- a/module/execution/view/testcase.html.php +++ b/module/execution/view/testcase.html.php @@ -24,7 +24,7 @@ idAB);?> - priAB);?> + execution->pri;?>> priAB);?> testcase->title);?> typeAB);?> openedByAB);?> diff --git a/module/extension/control.php b/module/extension/control.php index 2b4b8c1aca..9e33d8707d 100644 --- a/module/extension/control.php +++ b/module/extension/control.php @@ -30,7 +30,8 @@ class extension extends control $this->view->position[] = $this->lang->extension->browse; $this->view->error = sprintf($this->lang->extension->noticeOkFile, str_replace('\\', '/', $statusFile)); - return $this->display('extension', 'safe'); + $this->display('extension', 'safe'); + helper::end(); } } diff --git a/module/extension/view/obtain.html.php b/module/extension/view/obtain.html.php index 13e11ce216..740b08e67e 100644 --- a/module/extension/view/obtain.html.php +++ b/module/extension/view/obtain.html.php @@ -30,12 +30,12 @@ ?> -
-
extension->byCategory;?>
-
- extension->errorGetModules);?> + +
+
extension->byCategory;?>
+
-
+
@@ -49,8 +49,8 @@
- releaseVersion != $currentRelease->releaseVersion) + releaseVersion != $currentRelease->releaseVersion) { printf($lang->extension->latest, $latestRelease->viewLink, $latestRelease->releaseVersion, $latestRelease->zentaoCompatible); }?> @@ -67,7 +67,7 @@ echo "{$lang->extension->author}: {$extension->author} "; echo "{$lang->extension->downloads}: {$extension->downloads} "; echo "{$lang->extension->compatible}: {$lang->extension->compatibleList[$currentRelease->compatible]} "; - + echo " {$lang->extension->depends}: "; if(!empty($currentRelease->depends)) { diff --git a/module/git/control.php b/module/git/control.php index b0e8ee4733..efb83ec105 100644 --- a/module/git/control.php +++ b/module/git/control.php @@ -136,8 +136,7 @@ class git extends control $parsedObjects['tasks'] = array_unique($parsedObjects['tasks']); $parsedObjects['bugs'] = array_unique($parsedObjects['bugs']); $this->view->parsedObjects = $parsedObjects; - $this->display(); - exit; + return $this->display(); } } diff --git a/module/kanban/control.php b/module/kanban/control.php index 2d38f69ff4..b5d71d7d0c 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -74,12 +74,12 @@ class kanban extends control * @access public * @return void */ - public function editSpace($spaceID) + public function editSpace($spaceID, $type = '') { $this->loadModel('action'); if(!empty($_POST)) { - $changes = $this->kanban->updateSpace($spaceID); + $changes = $this->kanban->updateSpace($spaceID, $type); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); @@ -89,8 +89,27 @@ class kanban extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); } - $this->view->space = $this->kanban->getSpaceById($spaceID); - $this->view->users = $this->loadModel('user')->getPairs('noclosed'); + $space = $this->kanban->getSpaceById($spaceID); + + $typeList = $this->lang->kanbanspace->typeList; + if($space->type == 'cooperation' or $space->type == 'public') unset($typeList['private']); + + if($space->type == 'private' and ($type == 'cooperation' or $type == 'public')) + { + $team = $space->whitelist; + } + else + { + $team = $space->team; + } + + $this->view->spaceID = $spaceID; + $this->view->space = $space; + $this->view->users = $this->loadModel('user')->getPairs('noclosed'); + $this->view->typeList = $typeList; + $this->view->type = $type; + $this->view->team = $team; + $this->view->defaultType = $type == '' ? $space->type : $type; $this->display(); } diff --git a/module/kanban/js/editspace.js b/module/kanban/js/editspace.js new file mode 100644 index 0000000000..4ae84ccaf6 --- /dev/null +++ b/module/kanban/js/editspace.js @@ -0,0 +1,12 @@ +/** + * When type change. + * + * @param int spaceID + * @param string type + * @access public + * @return void + */ +function changeType(spaceID, type) +{ + location.href = createLink('kanban', 'editSpace', 'spaceID=' + spaceID + '&type=' + type); +} diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index 3a82c67fe1..3f78e41151 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -271,6 +271,10 @@ $lang->kanbanspace->featureBar['cooperation'] = 'Cooperation Space'; $lang->kanbanspace->featureBar['public'] = 'Public Space'; $lang->kanbanspace->featureBar['involved'] = 'Involved'; +$lang->kanbanspace->typeList['private'] = 'Private Space'; +$lang->kanbanspace->typeList['cooperation'] = 'Cooperation Space'; +$lang->kanbanspace->typeList['public'] = 'Public Space'; + $lang->kanbancolumn = new stdclass(); $lang->kanbancolumn->name = $lang->kanban->columnName; $lang->kanbancolumn->limit = $lang->kanban->WIPCount; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index ca8580188c..7ce89896c9 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -271,6 +271,10 @@ $lang->kanbanspace->featureBar['cooperation'] = '协作空间'; $lang->kanbanspace->featureBar['public'] = '公共空间'; $lang->kanbanspace->featureBar['involved'] = '我参与的'; +$lang->kanbanspace->typeList['private'] = '私人空间'; +$lang->kanbanspace->typeList['cooperation'] = '协作空间'; +$lang->kanbanspace->typeList['public'] = '公共空间'; + $lang->kanbancolumn = new stdclass(); $lang->kanbancolumn->name = $lang->kanban->columnName; $lang->kanbancolumn->limit = $lang->kanban->WIPCount; diff --git a/module/kanban/model.php b/module/kanban/model.php index 32c0db56eb..07e5bbea9d 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1754,7 +1754,7 @@ class kanbanModel extends model * @access public * @return array */ - public function updateSpace($spaceID) + public function updateSpace($spaceID, $type = '') { $spaceID = (int)$spaceID; $oldSpace = $this->getSpaceById($spaceID); @@ -1767,6 +1767,8 @@ class kanbanModel extends model ->remove('uid,contactListMenu') ->get(); + if($type == 'cooperation' or $type == 'public') $space->whitelist = ''; + $space = $this->loadModel('file')->processImgURL($space, $this->config->kanban->editor->editspace['id'], $this->post->uid); $this->dao->update(TABLE_KANBANSPACE)->data($space) @@ -1775,6 +1777,15 @@ class kanbanModel extends model ->where('id')->eq($spaceID) ->exec(); + if($oldSpace->type == 'private' and ($type == 'cooperation' or $type == 'public')) + { + $kanbanList = $this->dao->select('id,team,whitelist')->from(TABLE_KANBAN)->where('space')->eq($spaceID)->andWhere('deleted')->eq('0')->fetchAll('id'); + foreach($kanbanList as $id => $kanbanData) + { + $this->dao->update(TABLE_KANBAN)->set('team')->eq($kanbanData->whitelist)->set('whitelist')->eq('')->where('id')->eq($id)->andWhere('deleted')->eq('0')->exec(); + } + } + if(!dao::isError()) { $this->file->saveUpload('kanbanspace', $spaceID); diff --git a/module/kanban/view/editspace.html.php b/module/kanban/view/editspace.html.php index a354ae3447..59d7f58eec 100644 --- a/module/kanban/view/editspace.html.php +++ b/module/kanban/view/editspace.html.php @@ -18,12 +18,17 @@
+ + + + + - type != 'private'):?> + type != 'private' or $type == 'cooperation' or $type == 'public'):?> @@ -32,7 +37,7 @@ @@ -45,7 +50,7 @@ desc, "rows='10' class='form-control'");?> - type == 'private'):?> + type == 'private' and $type != 'cooperation' and $type != 'public'):?> diff --git a/module/kanban/view/importcard.html.php b/module/kanban/view/importcard.html.php index 15a8441a92..98c28ea56f 100644 --- a/module/kanban/view/importcard.html.php +++ b/module/kanban/view/importcard.html.php @@ -40,7 +40,7 @@ idAB;?> - + diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index 77ce3e480b..9d3f90dd7a 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -94,6 +94,7 @@ $lang->misc->feature->downloadFile = 'Download introduction'; $lang->misc->feature->tutorialDesc = '

ZenTao 15.0 has new functions, and you know how to use it through the "Tutorial".

Click your [Avatar-Theme-Young Blue] to set it.

'; $lang->misc->feature->themeDesc = '

ZenTao 15.0+ a new "Youth Blue" theme, the pages are more beautiful and the experience is more friendly.

Click your [Avatar-Theme-Young Blue] to set it.

'; +$lang->misc->releaseDate['16.5'] = '2022-02-22'; $lang->misc->releaseDate['16.4'] = '2022-02-15'; $lang->misc->releaseDate['16.3'] = '2022-01-26'; $lang->misc->releaseDate['16.2'] = '2022-01-17'; @@ -168,6 +169,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22'; $lang->misc->releaseDate['7.1.stable'] = '2015-03-07'; $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; +$lang->misc->feature->all['16.5'][] = array('title' => 'Fix bug, merge all code to one package', 'desc' => ''); $lang->misc->feature->all['16.4'][] = array('title' => 'Implement JIRA import function and improve plug-in extension mechanism.', 'desc' => ''); $lang->misc->feature->all['16.3'][] = array('title' => 'Kanban adds related plan/release/version/iteration functions, and the detail experience is optimized, fix bugs.', 'desc' => ''); $lang->misc->feature->all['16.2'][] = array('title' => 'Add kanban model project, fix bugs.', 'desc' => ''); diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index 3341512918..8180645d27 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -94,6 +94,7 @@ $lang->misc->feature->downloadFile = '下载新版本功能介绍文档'; $lang->misc->feature->tutorialDesc = "

禅道15系列新增了多项功能,您可以通过“新手引导教程”快速了解禅道的基本使用方法。

通过鼠标经过 [头像-新手引导],点击新手引导,即可进入新手引导教程。

"; $lang->misc->feature->themeDesc = "

禅道15系列上线了全新的“青春蓝”主题,页面呈现更加美观,体验更加友好。

通过鼠标经过 [头像-主题-青春蓝],点击青春蓝,即可设置成功。

"; +$lang->misc->releaseDate['16.5'] = '2022-02-22'; $lang->misc->releaseDate['16.4'] = '2022-02-15'; $lang->misc->releaseDate['16.3'] = '2022-01-26'; $lang->misc->releaseDate['16.2'] = '2022-01-17'; @@ -168,6 +169,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22'; $lang->misc->releaseDate['7.1.stable'] = '2015-03-07'; $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; +$lang->misc->feature->all['16.5'][] = array('title' => '实现一码多面,多个禅道版本集成到一个包中。', 'desc' => ''); $lang->misc->feature->all['16.4'][] = array('title' => '实现JIRA导入功能,完善插件扩展机制。', 'desc' => ''); $lang->misc->feature->all['16.3'][] = array('title' => '看板增加关联计划/发布/版本/迭代功能,细节体验优化。', 'desc' => ''); $lang->misc->feature->all['16.2'][] = array('title' => '新增专业研发看板,可以创建看板模型项目,修复Bug。', 'desc' => ''); diff --git a/module/mr/view/link.html.php b/module/mr/view/link.html.php index 65d7a17826..86411732ed 100644 --- a/module/mr/view/link.html.php +++ b/module/mr/view/link.html.php @@ -72,7 +72,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -215,7 +215,7 @@ - + diff --git a/module/mr/view/linkbug.html.php b/module/mr/view/linkbug.html.php index 49daaa7865..e070284cb2 100644 --- a/module/mr/view/linkbug.html.php +++ b/module/mr/view/linkbug.html.php @@ -27,7 +27,7 @@ idAB;?> - + diff --git a/module/mr/view/linkstory.html.php b/module/mr/view/linkstory.html.php index 9d334b9bdc..e12ac68d2f 100644 --- a/module/mr/view/linkstory.html.php +++ b/module/mr/view/linkstory.html.php @@ -27,7 +27,7 @@ idAB;?> - + diff --git a/module/mr/view/linktask.html.php b/module/mr/view/linktask.html.php index e231dee43e..a22da0aeec 100644 --- a/module/mr/view/linktask.html.php +++ b/module/mr/view/linktask.html.php @@ -27,7 +27,7 @@ idAB;?> - + diff --git a/module/my/lang/en.php b/module/my/lang/en.php index d40d1fe11a..b2cb72f428 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -41,6 +41,7 @@ $lang->my->requirement = "My {$lang->URCommon}"; $lang->my->testtask = 'My Test Task'; $lang->my->testcase = 'My Case'; $lang->my->storyConcept = 'Story Concept'; +$lang->my->pri = 'Priority'; $lang->my->indexAction = 'My Index'; $lang->my->calendarAction = 'My Calendar'; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index f0fa0775d2..5de4dcf78e 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -41,6 +41,7 @@ $lang->my->requirement = "我的{$lang->URCommon}"; $lang->my->testtask = '我的测试单'; $lang->my->testcase = '我的用例'; $lang->my->storyConcept = $config->URAndSR ? '默认需求概念组合' : '默认需求概念'; +$lang->my->pri = '优先级'; $lang->my->indexAction = '地盘仪表盘'; $lang->my->calendarAction = '我的日程'; diff --git a/module/my/view/requirement.html.php b/module/my/view/requirement.html.php index 891d7f6926..48e090ede7 100644 --- a/module/my/view/requirement.html.php +++ b/module/my/view/requirement.html.php @@ -58,7 +58,7 @@ idAB);?> - + diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index 029b2dfe62..d410598f76 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -58,7 +58,7 @@ idAB);?> - + diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index 4432aea57a..ca0ef8eade 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -48,7 +48,7 @@ idAB);?> - + systemMode == 'new'):?> diff --git a/module/my/view/testcase.html.php b/module/my/view/testcase.html.php index a46451540a..5fb935aa04 100644 --- a/module/my/view/testcase.html.php +++ b/module/my/view/testcase.html.php @@ -48,7 +48,7 @@ idAB);?> - + diff --git a/module/my/view/todo.html.php b/module/my/view/todo.html.php index de64d4e4bc..260d154b23 100644 --- a/module/my/view/todo.html.php +++ b/module/my/view/todo.html.php @@ -74,7 +74,7 @@ app->clientLang == 'en' ? "style='width:80px'" : '';?> - + diff --git a/module/productplan/model.php b/module/productplan/model.php index a8cd30660c..835e297dfa 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -626,8 +626,8 @@ class productplanModel extends model $plan->status = isset($data->status[$planID]) ? $data->status[$planID] : $oldPlans[$planID]->status; $plan->parent = $oldPlans[$planID]->parent; - if(empty($plan->title)) die(js::alter(sprintf($this->lang->productplan->errorNoTitle, $planID))); - if($plan->begin > $plan->end and !empty($plan->end)) die(js::alert(sprintf($this->lang->productplan->beginGeEnd, $planID))); + if(empty($plan->title)) return print(js::alter(sprintf($this->lang->productplan->errorNoTitle, $planID))); + if($plan->begin > $plan->end and !empty($plan->end)) return print(js::alert(sprintf($this->lang->productplan->beginGeEnd, $planID))); if($plan->begin == '') $plan->begin = $this->config->productplan->future; if($plan->end == '') $plan->end = $this->config->productplan->future; @@ -639,7 +639,7 @@ class productplanModel extends model $plan->{$extendField->field} = htmlSpecialString($plan->{$extendField->field}); $message = $this->checkFlowRule($extendField, $plan->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } $plans[$planID] = $plan; @@ -656,11 +656,11 @@ class productplanModel extends model $parent = isset($plans[$parentID]) ? $plans[$parentID] : $this->getByID($parentID); if($parent->begin != $this->config->productplan->future and $plan->begin != $this->config->productplan->future and $plan->begin < $parent->begin) { - die(js::alert(sprintf($this->lang->productplan->beginLetterParentTip, $planID, $plan->begin, $parent->begin))); + return print(js::alert(sprintf($this->lang->productplan->beginLetterParentTip, $planID, $plan->begin, $parent->begin))); } elseif($parent->end != $this->config->productplan->future and $plan->end != $this->config->productplan->future and $plan->end > $parent->end) { - die(js::alert(sprintf($this->lang->productplan->endGreaterParentTip, $planID, $plan->end, $parent->end))); + return print(js::alert(sprintf($this->lang->productplan->endGreaterParentTip, $planID, $plan->end, $parent->end))); } } elseif($parentID == -1 and $plan->begin != $this->config->productplan->future) @@ -674,8 +674,8 @@ class productplanModel extends model if($childPlan->begin < $minBegin and $minBegin != $this->config->productplan->future) $minBegin = $childPlan->begin; if($childPlan->end > $maxEnd and $maxEnd != $this->config->productplan->future) $maxEnd = $childPlan->end; } - if($minBegin < $plan->begin and $minBegin != $this->config->productplan->future) die(js::alert(sprintf($this->lang->productplan->beginGreaterChildTip, $planID, $plan->begin, $minBegin))); - if($maxEnd > $plan->end and $maxEnd != $this->config->productplan->future) die(js::alert(sprintf($this->lang->productplan->endLetterChildTip, $planID, $plan->end, $maxEnd))); + if($minBegin < $plan->begin and $minBegin != $this->config->productplan->future) return print(js::alert(sprintf($this->lang->productplan->beginGreaterChildTip, $planID, $plan->begin, $minBegin))); + if($maxEnd > $plan->end and $maxEnd != $this->config->productplan->future) return print(js::alert(sprintf($this->lang->productplan->endLetterChildTip, $planID, $plan->end, $maxEnd))); } $change = common::createChanges($oldPlans[$planID], $plan); @@ -683,7 +683,7 @@ class productplanModel extends model { if($parentID > 0 and !isset($parents[$parentID])) $parents[$parentID] = $parentID; $this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->where('id')->eq($planID)->exec(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $changes[$planID] = $change; } } diff --git a/module/productplan/view/linkbug.html.php b/module/productplan/view/linkbug.html.php index 2b235ca1f4..5468ec1fd4 100644 --- a/module/productplan/view/linkbug.html.php +++ b/module/productplan/view/linkbug.html.php @@ -27,7 +27,7 @@ idAB;?> - + diff --git a/module/productplan/view/linkstory.html.php b/module/productplan/view/linkstory.html.php index c026b12eef..b2c29697fc 100644 --- a/module/productplan/view/linkstory.html.php +++ b/module/productplan/view/linkstory.html.php @@ -27,7 +27,7 @@ idAB;?> - + diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index e842979fa6..e306c8034e 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -157,7 +157,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -452,7 +452,7 @@ - + @@ -464,7 +464,7 @@ idAB);?> - + diff --git a/module/program/control.php b/module/program/control.php index 6c8e8d9cf6..5404e5a6c8 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -243,10 +243,10 @@ class program extends control { /* Only when all subprograms and subprojects are closed can the program be closed. */ $hasUnfinished = $this->program->hasUnfinished($program); - if($hasUnfinished) die(js::error($this->lang->program->closeErrorMessage)); + if($hasUnfinished) return print(js::error($this->lang->program->closeErrorMessage)); $changes = $this->project->close($programID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -255,7 +255,7 @@ class program extends control } $this->executeHooks($programID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $this->view->title = $this->lang->program->close; @@ -281,7 +281,7 @@ class program extends control if(!empty($_POST)) { $changes = $this->project->start($programID, 'program'); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -291,7 +291,7 @@ class program extends control $this->loadModel('common')->syncPPEStatus($programID); $this->executeHooks($programID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $this->view->title = $this->lang->program->start; @@ -317,14 +317,14 @@ class program extends control if(!empty($_POST)) { $changes = $this->project->activate($programID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { $actionID = $this->action->create('program', $programID, 'Activated', $this->post->comment); $this->action->logHistory($actionID, $changes); } - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $newBegin = date('Y-m-d'); @@ -355,7 +355,7 @@ class program extends control if(!empty($_POST)) { $changes = $this->project->suspend($programID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -363,7 +363,7 @@ class program extends control $this->action->logHistory($actionID, $changes); } $this->executeHooks($programID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $this->view->title = $this->lang->program->suspend; @@ -389,19 +389,19 @@ class program extends control if($childrenCount) { if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => 'Cannot delete the program has children')); - die(js::alert($this->lang->program->hasChildren)); + return print(js::alert($this->lang->program->hasChildren)); } $productCount = $this->dao->select('count(*) as count')->from(TABLE_PRODUCT)->where('program')->eq($programID)->andWhere('deleted')->eq(0)->fetch('count'); - if($productCount) die(js::alert($this->lang->program->hasProduct)); + if($productCount) return print(js::alert($this->lang->program->hasProduct)); $program = $this->dao->select('*')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch(); - if($confirm == 'no') die(js::confirm($this->lang->program->confirmDelete, $this->createLink('program', 'delete', "programID=$programID&confirm=yes"))); + if($confirm == 'no') return print(js::confirm($this->lang->program->confirmDelete, $this->createLink('program', 'delete', "programID=$programID&confirm=yes"))); $this->dao->update(TABLE_PROGRAM)->set('deleted')->eq(1)->where('id')->eq($programID)->exec(); $this->loadModel('action')->create('program', $programID, 'deleted', '', ACTIONMODEL::CAN_UNDELETED); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -508,7 +508,7 @@ class program extends control { if($confirm == 'no') { - die(js::confirm($this->lang->program->confirmDelete, $this->inlink('unlinkStakeholder', "stakeholderID=$stakeholderID&programID=$programID&confirm=yes"))); + return print(js::confirm($this->lang->program->confirmDelete, $this->inlink('unlinkStakeholder', "stakeholderID=$stakeholderID&programID=$programID&confirm=yes"))); } else { @@ -518,7 +518,7 @@ class program extends control $this->loadModel('user')->updateUserView($programID, 'program', array($account)); $this->updateChildUserView($programID, $account); - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -537,7 +537,7 @@ class program extends control if($confirm == 'no') { - die(js::confirm($this->lang->program->confirmBatchUnlink, $this->inlink('batchUnlinkStakeholders', "programID=$programID&stakeholderIDList=$stakeholderIDList&confirm=yes"))); + return print(js::confirm($this->lang->program->confirmBatchUnlink, $this->inlink('batchUnlinkStakeholders', "programID=$programID&stakeholderIDList=$stakeholderIDList&confirm=yes"))); } else { @@ -547,7 +547,7 @@ class program extends control $this->loadModel('user')->updateUserView($programID, 'program', $account); $this->updateChildUserView($programID, $account); - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -723,7 +723,7 @@ class program extends control { $programID = (int)$programID; $program = $this->program->getByID($programID); - if(!$program) die(js::error($this->lang->notFound) . js::locate('back')); + if(!$program) return print(js::error($this->lang->notFound) . js::locate('back')); echo $this->fetch('program', 'product', "programID=$programID"); } diff --git a/module/program/model.php b/module/program/model.php index 6f886c80c2..455a2ef3d0 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -11,12 +11,12 @@ class programModel extends model { echo(js::alert($this->lang->program->accessDenied)); - if(!$this->server->http_referer) die(js::locate(helper::createLink('my', 'index'))); + if(!$this->server->http_referer) return print(js::locate(helper::createLink('my', 'index'))); $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; - if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(helper::createLink('my', 'index'))); + if(strpos($this->server->http_referer, $loginLink) !== false) return print(js::locate(helper::createLink('my', 'index'))); - die(js::locate('back')); + echo js::locate('back'); } /** diff --git a/module/program/view/create.html.php b/module/program/view/create.html.php index 04043a5196..578ad40fba 100644 --- a/module/program/view/create.html.php +++ b/module/program/view/create.html.php @@ -25,7 +25,7 @@ - + diff --git a/module/programplan/model.php b/module/programplan/model.php index e87070e9eb..387e554187 100644 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -627,7 +627,7 @@ class programplanModel extends model /* If child plans has milestone, update parent plan set milestone eq 0 . */ if($parentID and $milestone) $this->dao->update(TABLE_PROJECT)->set('milestone')->eq(0)->where('id')->eq($parentID)->exec(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); } } diff --git a/module/project/control.php b/module/project/control.php index a25329f7ee..2bf7da8198 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -178,7 +178,7 @@ class project extends control ->andWhere('t1.type')->eq('execution') ->andWhere('t1.account')->eq($account) ->fetchPairs(); - if(empty($executionMembers)) die(); + if(empty($executionMembers)) return; $executionNames = ''; $count = 0; @@ -198,7 +198,7 @@ class project extends control { $this->lang->project->unlinkExecutionMember = sprintf($this->lang->project->unlinkExecutionMember, count($executionMembers), $executionNames, $this->lang->project->etc); } - die($this->lang->project->unlinkExecutionMember); + echo $this->lang->project->unlinkExecutionMember; } /** @@ -238,7 +238,7 @@ class project extends control $this->project->setMenu($projectID); $project = $this->project->getByID($projectID); - if(empty($project) || $project->type != 'project') die(js::error($this->lang->notFound) . js::locate('back')); + if(empty($project) || $project->type != 'project') return print(js::error($this->lang->notFound) . js::locate('back')); if(!$projectID) $this->locate($this->createLink('project', 'browse')); setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true); @@ -355,7 +355,7 @@ class project extends control { $programTitle = $this->post->programTitle; $this->setting->setItem($this->app->user->account . '.project.programTitle', $programTitle); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $status = $this->setting->getItem('owner=' . $this->app->user->account . '&module=project&key=programTitle'); @@ -665,12 +665,13 @@ class project extends control $this->action->logHistory($actionID, $changes); } } - die(js::locate($this->session->projectList, 'parent')); + return print(js::locate($this->session->projectList, 'parent')); } if($this->app->tab == 'program') $this->loadModel('program')->setMenu(0); - $projectIdList = $this->post->projectIdList ? $this->post->projectIdList : die(js::locate($this->session->projectList, 'parent')); + if(!$this->post->projectIdList) return print(js::locate($this->session->projectList, 'parent')); + $projectIdList = $this->post->projectIdList; $projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($projectIdList)->fetchAll('id'); /* Get program list. */ @@ -709,7 +710,7 @@ class project extends control if(empty($project) || strpos('scrum,waterfall,kanban', $project->model) === false) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found')); - die(js::error($this->lang->notFound) . js::locate($this->createLink('project', 'browse'))); + return print(js::error($this->lang->notFound) . js::locate($this->createLink('project', 'browse'))); } $this->project->setMenu($projectID); @@ -791,9 +792,9 @@ class project extends control { $_POST['project'] = $projectID; $groupID = $this->group->create(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $groupID)); - die(js::closeModal('parent.parent')); + return print(js::closeModal('parent.parent')); } $this->view->title = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->create; @@ -1296,7 +1297,7 @@ class project extends control */ public function unlinkMember($projectID, $userID, $confirm = 'no', $removeExecution = 'no') { - if($confirm == 'no') die(js::confirm($this->lang->project->confirmUnlinkMember, $this->inlink('unlinkMember', "projectID=$projectID&userID=$userID&confirm=yes"))); + if($confirm == 'no') return print(js::confirm($this->lang->project->confirmUnlinkMember, $this->inlink('unlinkMember', "projectID=$projectID&userID=$userID&confirm=yes"))); $user = $this->loadModel('user')->getById($userID, 'id'); $account = $user->account; @@ -1319,7 +1320,7 @@ class project extends control } return $this->send($response); } - die(js::locate($this->inlink('team', "projectID=$projectID"), 'parent')); + echo js::locate($this->inlink('team', "projectID=$projectID"), 'parent'); } /** @@ -1388,8 +1389,8 @@ class project extends control if(!empty($_POST)) { $this->group->updateUser($groupID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); - die(js::locate($this->createLink('group', 'browse'), 'parent')); + if(isonlybody()) return print(js::closeModal('parent.parent', 'this')); + return print(js::locate($this->createLink('group', 'browse'), 'parent')); } $group = $this->group->getById($groupID); @@ -1432,8 +1433,8 @@ class project extends control $group = $this->group->getByID($groupID); $_POST['project'] = $group->project; $this->group->copy($groupID); - if(dao::isError()) die(js::error(dao::getError())); - die(js::closeModal('parent.parent', 'this')); + if(dao::isError()) return print(js::error(dao::getError())); + return print(js::closeModal('parent.parent', 'this')); } $this->view->title = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->copy; @@ -1456,7 +1457,7 @@ class project extends control if(!empty($_POST)) { $this->group->update($groupID); - die(js::closeModal('parent.parent', 'this')); + return print(js::closeModal('parent.parent', 'this')); } $this->view->title = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->edit; @@ -1481,7 +1482,7 @@ class project extends control if(!empty($_POST)) { $changes = $this->project->start($projectID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1501,7 +1502,7 @@ class project extends control if($project->status == 'wait' || $project->status == 'suspended') { $changes = $this->project->start($projectID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1514,7 +1515,7 @@ class project extends control $this->loadModel('common')->syncPPEStatus($projectID); $this->executeHooks($projectID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $this->view->title = $this->lang->project->start; @@ -1539,7 +1540,7 @@ class project extends control if(!empty($_POST)) { $changes = $this->project->suspend($projectID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1547,7 +1548,7 @@ class project extends control $this->action->logHistory($actionID, $changes); } $this->executeHooks($projectID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $this->view->title = $this->lang->project->suspend; @@ -1573,7 +1574,7 @@ class project extends control if(!empty($_POST)) { $changes = $this->project->close($projectID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1581,7 +1582,7 @@ class project extends control $this->action->logHistory($actionID, $changes); } $this->executeHooks($projectID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $this->view->title = $this->lang->project->close; @@ -1609,7 +1610,7 @@ class project extends control if(!empty($_POST)) { $changes = $this->project->activate($projectID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1617,7 +1618,7 @@ class project extends control $this->action->logHistory($actionID, $changes); } $this->executeHooks($projectID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $newBegin = date('Y-m-d'); @@ -1648,8 +1649,7 @@ class project extends control if($confirm == 'no') { $project = $this->project->getByID($projectID); - echo js::confirm(sprintf($this->lang->project->confirmDelete, $project->name), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes")); - die(); + return print(js::confirm(sprintf($this->lang->project->confirmDelete, $project->name), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes"))); } else { @@ -1669,7 +1669,7 @@ class project extends control if(empty($executionIdList)) { if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess)); - die(js::locate($url, 'parent')); + return print(js::locate($url, 'parent')); } $this->dao->update(TABLE_EXECUTION)->set('deleted')->eq(1)->where('id')->in(array_keys($executionIdList))->exec(); @@ -1679,7 +1679,7 @@ class project extends control if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess)); $this->session->set('project', ''); - die(js::locate($url, 'parent')); + return print(js::locate($url, 'parent')); } } @@ -1862,7 +1862,7 @@ class project extends control $oldTopPGM = $this->loadModel('program')->getTopByID($project->parent); $newTopPGM = $this->program->getTopByID($programID); - if($oldTopPGM == $newTopPGM) die(); + if($oldTopPGM == $newTopPGM) return; $response = array(); $response['result'] = true; @@ -1884,6 +1884,6 @@ class project extends control $response['message'] = $multiLinkedProducts; $response['multiLinkedProjects'] = $multiLinkedProjects; } - die(json_encode($response)); + echo json_encode($response); } } diff --git a/module/project/model.php b/module/project/model.php index 6d034a9093..5be1157e6a 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1223,10 +1223,10 @@ class projectModel extends model $projects[$projectID]->{$extendField->field} = htmlSpecialString($projects[$projectID]->{$extendField->field}); $message = $this->checkFlowRule($extendField, $projects[$projectID]->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) hepler::end(js::alert($message)); } } - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) helper::end(js::error(dao::getError())); foreach($projects as $projectID => $project) { @@ -1244,7 +1244,7 @@ class projectModel extends model ->where('id')->eq($projectID) ->exec(); - if(dao::isError()) die(js::error('project#' . $projectID . dao::getError(true))); + if(dao::isError()) helper::end(js::error('project#' . $projectID . dao::getError(true))); if(!dao::isError()) { $linkedProducts = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchPairs(); @@ -1941,7 +1941,7 @@ class projectModel extends model ->beginIF($status != 'all' and $status != 'undone')->andWhere('t2.status')->eq($status)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() ->andWhere('t2.deleted')->eq('0') - ->andWhere('t1.vision')->eq($this->config->vision) + ->andWhere('t2.vision')->eq($this->config->vision) ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index d4d985bfc6..bd0167764a 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -57,7 +57,7 @@ idAB);?> - + diff --git a/module/projectrelease/view/linkbug.html.php b/module/projectrelease/view/linkbug.html.php index a5b8652488..9ed6c81f62 100644 --- a/module/projectrelease/view/linkbug.html.php +++ b/module/projectrelease/view/linkbug.html.php @@ -31,7 +31,7 @@ $formID = $type == 'leftBug' ? 'unlinkedLeftBugsForm' : 'unlinkedBugsForm'; idAB;?> - + diff --git a/module/projectrelease/view/linkstory.html.php b/module/projectrelease/view/linkstory.html.php index f75c38af81..c6caa3ac06 100644 --- a/module/projectrelease/view/linkstory.html.php +++ b/module/projectrelease/view/linkstory.html.php @@ -27,7 +27,7 @@ idAB;?> - + diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index 0ebf95a796..3dc3c86f29 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -85,7 +85,7 @@ idAB);?> - + diff --git a/module/projectstory/control.php b/module/projectstory/control.php index 652b9de23b..4f5db62636 100644 --- a/module/projectstory/control.php +++ b/module/projectstory/control.php @@ -37,7 +37,7 @@ class projectStory extends control public function story($projectID = 0, $productID = 0, $branch = 0, $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->products = $this->loadModel('product')->getProductPairsByProject($projectID); - if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', 'moduleName=project&activeMenu=story&projectID=' . $projectID))); + if(empty($this->products)) return print($this->locate($this->createLink('product', 'showErrorNone', 'moduleName=project&activeMenu=story&projectID=' . $projectID))); echo $this->fetch('product', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&storyType=$storyType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID"); } @@ -140,7 +140,7 @@ ETO; } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die($html); + echo $html; } /** diff --git a/module/qa/control.php b/module/qa/control.php index b2b35c4e3e..f520f1c4d6 100644 --- a/module/qa/control.php +++ b/module/qa/control.php @@ -20,7 +20,7 @@ class qa extends control public function index($locate = 'auto', $productID = 0, $projectID = 0) { $products = $this->loadModel('product')->getProductPairsByProject($projectID, 'noclosed'); - if(empty($products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=index"))); + if(empty($products)) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=index"))); if($locate == 'yes') $this->locate($this->createLink('bug', 'browse')); $productID = $this->product->saveState($productID, $products); diff --git a/module/qa/model.php b/module/qa/model.php index f69a0797b7..92e8924375 100644 --- a/module/qa/model.php +++ b/module/qa/model.php @@ -26,7 +26,7 @@ class qaModel extends model if(!$this->app->user->admin and strpos(",{$this->app->user->view->products},", ",$productID,") === false and $productID != 0 and !defined('TUTORIAL')) { $this->app->loadLang('product'); - die(js::error($this->lang->product->accessDenied) . js::locate('back')); + return print(js::error($this->lang->product->accessDenied) . js::locate('back')); } $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; diff --git a/module/release/control.php b/module/release/control.php index 702c8f053c..d2c5d103f3 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -162,7 +162,7 @@ class release extends control { $releaseID = (int)$releaseID; $release = $this->release->getByID($releaseID, true); - if(!$release) die(js::error($this->lang->notFound) . js::locate($this->createLink('product', 'index'))); + if(!$release) return print(js::error($this->lang->notFound) . js::locate($this->createLink('product', 'index'))); if($type == 'story') $this->session->set('storyList', $this->app->getURI(true), 'product'); if($type == 'bug' or $type == 'leftBug') $this->session->set('bugList', $this->app->getURI(true), 'qa'); @@ -224,8 +224,8 @@ class release extends control /** * Notify for release. - * - * @param int $releaseID + * + * @param int $releaseID * @access public * @return void */ @@ -235,7 +235,7 @@ class release extends control { if(isset($_POST['notify'])) { - $notify = implode(',', $this->post->notify); + $notify = implode(',', $this->post->notify); $this->dao->update(TABLE_RELEASE)->set('notify')->eq($notify)->where('id')->eq($releaseID)->exec(); $this->release->sendmail($releaseID); @@ -244,7 +244,7 @@ class release extends control $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); } - + $this->view->release = $this->release->getById($releaseID); $this->view->actions = $this->loadModel('action')->getList('release', $releaseID); $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); @@ -263,7 +263,7 @@ class release extends control { if($confirm == 'no') { - die(js::confirm($this->lang->release->confirmDelete, $this->createLink('release', 'delete', "releaseID=$releaseID&confirm=yes"))); + return print(js::confirm($this->lang->release->confirmDelete, $this->createLink('release', 'delete', "releaseID=$releaseID&confirm=yes"))); } else { @@ -297,7 +297,7 @@ class release extends control if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess)); $locateLink = $this->session->releaseList ? $this->session->releaseList : inlink('browse', "productID={$release->product}"); - die(js::locate($locateLink, 'parent')); + return print(js::locate($locateLink, 'parent')); } } @@ -404,7 +404,7 @@ class release extends control } $html = "{$this->post->fileName}$html"; - die($this->fetch('file', 'sendDownHeader', array('fileName' => $this->post->fileName, 'html', $html))); + return print($this->fetch('file', 'sendDownHeader', array('fileName' => $this->post->fileName, 'html', $html))); } $this->display(); @@ -427,7 +427,7 @@ class release extends control if(!empty($_POST['stories'])) { $this->release->linkStory($releaseID); - die(js::locate(inlink('view', "releaseID=$releaseID&type=story"), 'parent')); + return print(js::locate(inlink('view', "releaseID=$releaseID&type=story"), 'parent')); } $this->session->set('storyList', inlink('view', "releaseID=$releaseID&type=story&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'product'); @@ -512,7 +512,7 @@ class release extends control } return $this->send($response); } - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -525,7 +525,7 @@ class release extends control public function batchUnlinkStory($releaseID) { $this->release->batchUnlinkStory($releaseID); - die(js::locate($this->createLink('release', 'view', "releaseID=$releaseID&type=story"), 'parent')); + echo js::locate($this->createLink('release', 'view', "releaseID=$releaseID&type=story"), 'parent'); } /** @@ -546,7 +546,7 @@ class release extends control if(!empty($_POST['bugs'])) { $this->release->linkBug($releaseID, $type); - die(js::locate(inlink('view', "releaseID=$releaseID&type=$type"), 'parent')); + return print(js::locate(inlink('view', "releaseID=$releaseID&type=$type"), 'parent')); } $this->session->set('bugList', inlink('view', "releaseID=$releaseID&type=$type&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'qa'); @@ -643,7 +643,7 @@ class release extends control } return $this->send($response); } - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -657,7 +657,7 @@ class release extends control public function batchUnlinkBug($releaseID, $type = 'bug') { $this->release->batchUnlinkBug($releaseID, $type); - die(js::locate($this->createLink('release', 'view', "releaseID=$releaseID&type=$type"), 'parent')); + echo js::locate($this->createLink('release', 'view', "releaseID=$releaseID&type=$type"), 'parent'); } /** @@ -671,8 +671,8 @@ class release extends control public function changeStatus($releaseID, $status) { $this->release->changeStatus($releaseID, $status); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $actionID = $this->loadModel('action')->create('release', $releaseID, 'changestatus', '', $status); - die(js::reload('parent')); + echo js::reload('parent'); } } diff --git a/module/release/view/linkbug.html.php b/module/release/view/linkbug.html.php index 874436fbd0..ac3effbfe9 100644 --- a/module/release/view/linkbug.html.php +++ b/module/release/view/linkbug.html.php @@ -31,7 +31,7 @@ $formID = $type == 'leftBug' ? 'unlinkedLeftBugsForm' : 'unlinkedBugsForm'; idAB;?> - + diff --git a/module/release/view/linkstory.html.php b/module/release/view/linkstory.html.php index c8d9ca1e8f..0b10f22482 100644 --- a/module/release/view/linkstory.html.php +++ b/module/release/view/linkstory.html.php @@ -27,7 +27,7 @@ idAB;?> - + diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index cb7b8bc7d0..1c41e9bc21 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -85,7 +85,7 @@ idAB);?> - + diff --git a/module/repo/control.php b/module/repo/control.php index 09d2d5b55b..dc39bad950 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -26,7 +26,7 @@ class repo extends control if(stripos(",$disFuncs,", ',exec,') !== false or stripos(",$disFuncs,", ',shell_exec,') !== false) { echo js::alert($this->lang->repo->error->useless); - die(js::locate('back')); + return print(js::locate('back')); } $this->projectID = $this->session->project ? $this->session->project : 0; @@ -61,7 +61,7 @@ class repo extends control $this->repo->setMenu($this->repos, $repoID); } - if(empty($this->repos) and $this->methodName != 'create') die($this->locate($this->repo->createLink('create', "objectID=$objectID"))); + if(empty($this->repos) and $this->methodName != 'create') return print($this->locate($this->repo->createLink('create', "objectID=$objectID"))); } /** @@ -216,7 +216,7 @@ class repo extends control */ public function delete($repoID, $objectID = 0, $confirm = 'no') { - if($confirm == 'no') die(js::confirm($this->lang->repo->notice->delete, $this->repo->createLink('delete', "repoID=$repoID&objectID=$objectID&confirm=yes"))); + if($confirm == 'no') return print(js::confirm($this->lang->repo->notice->delete, $this->repo->createLink('delete', "repoID=$repoID&objectID=$objectID&confirm=yes"))); $relationID = $this->dao->select('id')->from(TABLE_RELATION) ->where('extra')->eq($repoID) @@ -228,15 +228,15 @@ class repo extends control $jobs = $this->dao->select('*')->from(TABLE_JOB)->where('repo')->eq($repoID)->andWhere('deleted')->eq('0')->fetchAll(); if($jobs) $error .= ($error ? '\n' : '') . $this->lang->repo->error->linkedJob; - if($error) die(js::alert($error)); + if($error) return print(js::alert($error)); $this->dao->delete()->from(TABLE_REPO)->where('id')->eq($repoID)->exec(); $this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->exec(); $this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($repoID)->exec(); $this->dao->delete()->from(TABLE_REPOBRANCH)->where('repo')->eq($repoID)->exec(); - if(dao::isError()) die(js::error(dao::getError())); - die(js::reload('parent')); + if(dao::isError()) return print(js::error(dao::getError())); + echo js::reload('parent'); } /** @@ -907,8 +907,8 @@ class repo extends control { set_time_limit(0); $repo = $this->repo->getRepoByID($repoID); - if(empty($repo)) die(); - if($repo->synced) die('finish'); + if(empty($repo)) return; + if($repo->synced) return print('finish'); $this->commonAction($repoID); $this->scm->setEngine($repo); @@ -979,7 +979,7 @@ class repo extends control if(empty($branchID)) { $this->repo->markSynced($repoID); - die('finish'); + return print('finish'); } } } @@ -1000,8 +1000,8 @@ class repo extends control { set_time_limit(0); $repo = $this->repo->getRepoByID($repoID); - if(empty($repo)) die(); - if(strpos($repo->SCM, 'Git') === false) die('finish'); + if(empty($repo)) return; + if(strpos($repo->SCM, 'Git') === false) return print('finish'); if($branch) $branch = base64_decode($branch); $this->scm->setEngine($repo); @@ -1030,7 +1030,7 @@ class repo extends control setcookie("syncBranch", $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, true); $this->repo->markSynced($repoID); - die('finish'); + return print('finish'); } $this->dao->update(TABLE_REPO)->set('commits=commits + ' . $commitCount)->where('id')->eq($repoID)->exec(); @@ -1083,7 +1083,7 @@ class repo extends control public function ajaxGetSVNDirs($repoID, $path = '') { $repo = $this->repo->getRepoByID($repoID); - if($repo->SCM != 'Subversion') die(json_encode(array())); + if($repo->SCM != 'Subversion') return print(json_encode(array())); $path = $this->repo->decodePath($path); $dirs = array(); @@ -1099,7 +1099,7 @@ class repo extends control $dirs['/'] = $this->repo->encodePath($path); foreach($tags as $dirPath => $dirName) $dirs[$dirPath] = $this->repo->encodePath($dirPath); } - die(json_encode($dirs)); + return print(json_encode($dirs)); } /** @@ -1122,7 +1122,7 @@ class repo extends control } $reposHtml .= ''; - die($reposHtml); + return print($reposHtml); } /** @@ -1167,7 +1167,7 @@ class repo extends control $options .= ""; } - die($options); + return print($options); } /** @@ -1193,7 +1193,7 @@ class repo extends control } $branchesHtml .= ''; - die($branchesHtml); + return print($branchesHtml); } /** diff --git a/module/repo/model.php b/module/repo/model.php index 4a3245d85c..ab12ca3c29 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -46,13 +46,13 @@ class repoModel extends model if(empty($repo)) { echo(js::alert($this->lang->repo->error->noFound)); - die(js::locate('back')); + return print(js::locate('back')); } if(!$this->checkPriv($repo)) { echo(js::alert($this->lang->repo->error->accessDenied)); - die(js::locate('back')); + return print(js::locate('back')); } } diff --git a/module/report/control.php b/module/report/control.php index 984a13d518..a793b4ee35 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -369,6 +369,7 @@ class report extends control $this->view->dept = $dept; $this->view->userID = $userID; $this->view->months = $this->report->getYearMonths($year); - die($this->display()); + + $this->display(); } } diff --git a/module/report/model.php b/module/report/model.php index f5377e35a3..39f38c9610 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -311,8 +311,8 @@ class reportModel extends model $project[$execution->projectname]['execution'][$name]['count'] = 0; $project[$execution->projectname]['execution'][$name]['manhour'] = 0; - $workload[$member]['total']['count'] = 0; - $workload[$member]['total']['manhour'] = 0; + $workload[$member]['total']['count'] = 0; + $workload[$member]['total']['manhour'] = 0; } } $workload[$member]['task']['project'] = $project; @@ -390,6 +390,7 @@ class reportModel extends model $workload[$user]['total']['count'] = isset($workload[$user]['total']['count']) ? $workload[$user]['total']['count'] + 1 : 1; $workload[$user]['total']['manhour'] = isset($workload[$user]['total']['manhour']) ? $workload[$user]['total']['manhour'] + $task->left : $task->left; } + $workload[$user]['task']['project'] = $project; } } diff --git a/module/search/control.php b/module/search/control.php index 89673a6f17..75b12ab794 100644 --- a/module/search/control.php +++ b/module/search/control.php @@ -73,21 +73,21 @@ class search extends control $actionURL = $this->post->actionURL; $parsedURL = parse_url($actionURL); - if(isset($parsedURL['host'])) die(); + if(isset($parsedURL['host'])) return; if($this->config->requestType != 'GET') { $path = $parsedURL['path']; $path = str_replace($this->config->webRoot, '', $path); if(strpos($path, '.') !== false) $path = substr($path, 0, strpos($path, '.')); - if(preg_match("/^\w+{$this->config->requestFix}\w+/", $path) == 0) die(); + if(preg_match("/^\w+{$this->config->requestFix}\w+/", $path) == 0) return; } else { $query = $parsedURL['query']; - if(preg_match("/^{$this->config->moduleVar}=\w+\&{$this->config->methodVar}=\w+/", $query) == 0) die(); + if(preg_match("/^{$this->config->moduleVar}=\w+\&{$this->config->methodVar}=\w+/", $query) == 0) return; } - die(js::locate($actionURL, 'parent')); + echo js::locate($actionURL, 'parent'); } /** @@ -125,8 +125,8 @@ class search extends control public function deleteQuery($queryID) { $this->search->deleteQuery($queryID); - if(dao::isError()) die(js::error(dao::getError())); - die('success'); + if(dao::isError()) return print(js::error(dao::getError())); + echo 'success'; } /** @@ -149,7 +149,7 @@ class search extends control if(empty($queryID)) continue; $html .= '
  • ' . html::a("javascript:executeQuery({$queryID})", $queryName . (common::hasPriv('search', 'deleteQuery') ? '' : ''), '', "class='label user-query' data-query-id='$queryID'") . '
  • '; } - die($html); + echo $html; } /** diff --git a/module/search/model.php b/module/search/model.php index ceb44431d2..eaaa6dd92c 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -389,7 +389,7 @@ class searchModel extends model public function deleteQuery($queryID) { $this->dao->delete()->from(TABLE_USERQUERY)->where('id')->eq($queryID)->andWhere('account')->eq($this->app->user->account)->exec(); - die('success'); + echo 'success'; } /** diff --git a/module/setting/model.php b/module/setting/model.php index e6be2e7250..5bed4e70c5 100644 --- a/module/setting/model.php +++ b/module/setting/model.php @@ -183,7 +183,7 @@ class settingModel extends model $owner = 'system,' . ($account ? $account : ''); $records = $this->dao->select('*')->from(TABLE_CONFIG) ->where('owner')->in($owner) - ->andWhere('vision')->in(array('', $this->config->vision)) + ->beginIF(!defined('IN_UPGRADE'))->andWhere('vision')->in(array('', $this->config->vision))->fi() ->orderBy('id') ->fetchAll('id'); if(!$records) return array(); diff --git a/module/sonarqube/control.php b/module/sonarqube/control.php index 5f77e03a9c..02f617ed4e 100644 --- a/module/sonarqube/control.php +++ b/module/sonarqube/control.php @@ -210,7 +210,7 @@ class sonarqube extends control */ public function delete($sonarqubeID, $confirm = 'no') { - if($confirm != 'yes') die(js::confirm($this->lang->sonarqube->confirmDelete, inlink('delete', "sonarqubeID=$sonarqubeID&confirm=yes"))); + if($confirm != 'yes') return print(js::confirm($this->lang->sonarqube->confirmDelete, inlink('delete', "sonarqubeID=$sonarqubeID&confirm=yes"))); $oldSonarQube = $this->loadModel('pipeline')->getByID($sonarqubeID); $this->loadModel('action'); @@ -319,7 +319,7 @@ class sonarqube extends control */ public function deleteProject($sonarqubeID, $projectKey, $confirm = 'no') { - if($confirm != 'yes') die(js::confirm($this->lang->sonarqube->confirmDeleteProject, inlink('deleteProject', "sonarqubeID=$sonarqubeID&projectKey=$projectKey&confirm=yes"))); + if($confirm != 'yes') return print(js::confirm($this->lang->sonarqube->confirmDeleteProject, inlink('deleteProject', "sonarqubeID=$sonarqubeID&projectKey=$projectKey&confirm=yes"))); /* Fix error when request type is PATH_INFO and the tag name contains '-'.*/ $projectKey = str_replace('*', '-', $projectKey); diff --git a/module/sso/control.php b/module/sso/control.php index f813258261..9b744832a6 100644 --- a/module/sso/control.php +++ b/module/sso/control.php @@ -24,7 +24,7 @@ class sso extends control $locate = empty($referer) ? getWebRoot() : base64_decode($referer); $this->app->loadConfig('sso'); - if(!$this->config->sso->turnon) die($this->locate($locate)); + if(!$this->config->sso->turnon) return print($this->locate($locate)); $userIP = $this->server->remote_addr; $code = $this->config->sso->code; @@ -92,7 +92,7 @@ class sso extends control if($this->loadModel('user')->isLogon()) { - if($this->session->user && $this->session->user->account == $user->account) die($this->locate($locate)); + if($this->session->user && $this->session->user->account == $user->account) return print($this->locate($locate)); } $this->user->cleanLocked($user->account); @@ -116,7 +116,8 @@ class sso extends control $this->session->set('user', $user); $this->app->user = $this->session->user; $this->loadModel('action')->create('user', $user->id, 'login'); - die($this->locate($locate)); + + return print($this->locate($locate)); } } $this->locate($this->createLink('user', 'login', empty($referer) ? '' : "referer=$referer")); @@ -170,7 +171,7 @@ class sso extends control */ public function ajaxSetConfig() { - if(!$this->app->user->admin) die('deny'); + if(!$this->app->user->admin) return print('deny'); if($_POST) { @@ -181,8 +182,8 @@ class sso extends control $ssoConfig->key = trim($this->post->key); $this->loadModel('setting')->setItems('system.sso', $ssoConfig); - if(dao::isError()) die('fail'); - die('success'); + if(dao::isError()) return print('fail'); + echo 'success'; } } @@ -195,19 +196,19 @@ class sso extends control */ public function bind($referer = '') { - if(!$this->session->ssoData) die(); + if(!$this->session->ssoData) return; $ssoData = $this->session->ssoData; $userIP = $this->server->remote_addr; $code = $this->config->sso->code; $key = $this->config->sso->key; - if($ssoData->auth != md5($code . $userIP . $ssoData->token . $key))die(); + if($ssoData->auth != md5($code . $userIP . $ssoData->token . $key)) return; $this->loadModel('user'); if($_POST) { $user = $this->sso->bind(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); /* Authorize him and save to session. */ $user->rights = $this->user->authorize($user->account); @@ -219,7 +220,7 @@ class sso extends control $this->app->user = $this->session->user; $this->loadModel('action')->create('user', $user->id, 'login'); unset($_SESSION['ssoData']); - die(js::locate(helper::safe64Decode($referer), 'parent')); + return print(js::locate(helper::safe64Decode($referer), 'parent')); } $this->view->title = $this->lang->sso->bind; $this->view->users = $this->user->getPairs('noclosed|nodeleted'); @@ -237,7 +238,7 @@ class sso extends control { if(!$this->sso->checkKey()) return false; $users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); - die(json_encode($users)); + echo json_encode($users); } /** @@ -250,7 +251,7 @@ class sso extends control { if(!$this->sso->checkKey()) return false; $users = $this->sso->getBindUsers(); - die(json_encode($users)); + echo json_encode($users); } /** @@ -265,8 +266,8 @@ class sso extends control { $this->dao->update(TABLE_USER)->set('ranzhi')->eq('')->where('ranzhi')->eq($this->post->ranzhiAccount)->exec(); $this->dao->update(TABLE_USER)->set('ranzhi')->eq($this->post->ranzhiAccount)->where('account')->eq($this->post->zentaoAccount)->exec(); - if(dao::isError()) die(dao::getError()); - die('success'); + if(dao::isError()) return print(dao::getError()); + return print('success'); } } @@ -282,8 +283,8 @@ class sso extends control { $result = $this->sso->createUser(); if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $result['id'])); - if($result['status'] != 'success') die($result['data']); - die('success'); + if($result['status'] != 'success') return print($result['data']); + return print('success'); } } @@ -303,7 +304,7 @@ class sso extends control $datas = array(); $datas['task'] = $this->dao->select("id, name")->from(TABLE_TASK)->where('assignedTo')->eq($account)->andWhere('status')->in('wait,doing')->andWhere('deleted')->eq(0)->fetchPairs(); $datas['bug'] = $this->dao->select("id, title")->from(TABLE_BUG)->where('assignedTo')->eq($account)->andWhere('status')->eq('active')->andWhere('deleted')->eq(0)->fetchPairs(); - die(json_encode($datas)); + echo json_encode($datas); } /** @@ -426,6 +427,5 @@ class sso extends control $this->view->title = $this->lang->sso->deny; $this->view->message = $message; $this->display('sso', 'error'); - die(); } } diff --git a/module/sso/model.php b/module/sso/model.php index 80a73e9938..d49d26cfc8 100644 --- a/module/sso/model.php +++ b/module/sso/model.php @@ -48,10 +48,10 @@ class ssoModel extends model $data = fixer::input('post')->get(); if($data->bindType == 'bind') { - if(empty($data->bindPassword))die(js::alert($this->lang->sso->bindNoPassword)); + if(empty($data->bindPassword)) return print(js::alert($this->lang->sso->bindNoPassword)); $password = md5($data->bindPassword); $user = $this->dao->select('*')->from(TABLE_USER)->where('account')->eq($data->bindUser)->andWhere('password')->eq($password)->andWhere('deleted')->eq('0')->fetch(); - if(empty($user))die(js::alert($this->lang->sso->bindNoUser)); + if(empty($user)) return print(js::alert($this->lang->sso->bindNoUser)); $user->ranzhi = $this->session->ssoData->account; $this->dao->update(TABLE_USER)->set('ranzhi')->eq($user->ranzhi)->where('id')->eq($user->id)->exec(); } @@ -59,7 +59,7 @@ class ssoModel extends model { if(!$this->loadModel('user')->checkPassword()) return; $user = $this->dao->select('*')->from(TABLE_USER)->where('account')->eq($data->account)->fetch(); - if($user) die(js::alert($this->lang->sso->bindHasAccount)); + if($user) return print(js::alert($this->lang->sso->bindHasAccount)); $user = new stdclass(); $user->account = $data->account; diff --git a/module/stage/control.php b/module/stage/control.php index 6fa1d394ae..73eca224db 100644 --- a/module/stage/control.php +++ b/module/stage/control.php @@ -173,13 +173,13 @@ class stage extends control if($confirm == 'no') { - die(js::confirm($this->lang->stage->confirmDelete, inlink('delete', "stageID=$stageID&confirm=yes"))); + return print(js::confirm($this->lang->stage->confirmDelete, inlink('delete', "stageID=$stageID&confirm=yes"))); } else { $this->stage->delete(TABLE_STAGE, $stageID); - die(js::reload('parent')); + return print(js::reload('parent')); } } } diff --git a/module/stakeholder/control.php b/module/stakeholder/control.php index cb4a237340..b3d0e9afbd 100644 --- a/module/stakeholder/control.php +++ b/module/stakeholder/control.php @@ -105,7 +105,7 @@ class stakeholder extends control { $stakeholderList = $this->stakeholder->batchCreate($projectID); if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stakeholderList)); - die(js::locate($this->createLink('stakeholder', 'browse', "projectID=$projectID"), 'parent')); + return print(js::locate($this->createLink('stakeholder', 'browse', "projectID=$projectID"), 'parent')); } if($this->app->tab == 'program') @@ -206,7 +206,7 @@ class stakeholder extends control { $members = $this->loadModel('user')->getTeamMemberPairs($projectID, 'project'); } - die(html::select('user', $members, $user, "class='form-control chosen'")); + echo html::select('user', $members, $user, "class='form-control chosen'"); } /** @@ -232,7 +232,7 @@ class stakeholder extends control $users = $this->loadModel('user')->getPairs('noclosed'); $companyUsers = array('' => '') + array_diff($users, $members); - die(html::select('user', $companyUsers, $user, "class='form-control chosen'")); + echo html::select('user', $companyUsers, $user, "class='form-control chosen'"); } /** @@ -245,7 +245,7 @@ class stakeholder extends control { $users = $this->loadModel('user')->getPairs('noclosed|outside|noletter'); - die(html::select('user', $users, '', "class='form-control chosen' onchange=changeUser(this.value);")); + echo html::select('user', $users, '', "class='form-control chosen' onchange=changeUser(this.value);"); } /** @@ -288,7 +288,7 @@ class stakeholder extends control $partakeList = array_merge($insideList, $outsideList); - die(json_encode(array('begin' => $begin, 'realBegin' => $realBegin, 'status' => $status, 'situation' => $situation, 'partakeList' => $partakeList))); + echo json_encode(array('begin' => $begin, 'realBegin' => $realBegin, 'status' => $status, 'situation' => $situation, 'partakeList' => $partakeList)); } /** @@ -303,7 +303,7 @@ class stakeholder extends control { if($confirm == 'no') { - die(js::confirm($this->lang->stakeholder->confirmDelete, inLink('delete', "userID=$userID&confirm=yes"))); + return print(js::confirm($this->lang->stakeholder->confirmDelete, inLink('delete', "userID=$userID&confirm=yes"))); } else { @@ -316,7 +316,7 @@ class stakeholder extends control { $this->loadModel('project')->updateInvolvedUserView($stakeholder->objectID, $stakeholder->user); } - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -393,8 +393,8 @@ class stakeholder extends control if(!empty($_POST)) { $result = $this->stakeholder->communicate($userID); - if(dao::isError()) die(js::error(dao::getError())); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); + if(dao::isError()) return print(js::error(dao::getError())); + if(isonlybody()) return print(js::closeModal('parent.parent', 'this')); } $this->view->title = $this->lang->stakeholder->common . $this->lang->colon . $this->lang->stakeholder->communicate; @@ -418,9 +418,9 @@ class stakeholder extends control if(!empty($_POST)) { $expectID = $this->stakeholder->expect($user->id); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); - die(js::closeModal('parent.parent', 'this')); + return print(js::closeModal('parent.parent', 'this')); } $this->view->title = $this->lang->stakeholder->common . $this->lang->colon . $this->lang->stakeholder->communicate; diff --git a/module/story/config.php b/module/story/config.php index 6c6dc77ffb..e5ef2e0ff5 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -60,6 +60,7 @@ $config->story->datatable->fieldList['pri']['title'] = 'priAB'; $config->story->datatable->fieldList['pri']['fixed'] = 'left'; $config->story->datatable->fieldList['pri']['width'] = '50'; $config->story->datatable->fieldList['pri']['required'] = 'no'; +$config->story->datatable->fieldList['pri']['name'] = $this->lang->story->pri; $config->story->datatable->fieldList['title']['title'] = 'title'; $config->story->datatable->fieldList['title']['fixed'] = 'left'; diff --git a/module/story/control.php b/module/story/control.php index 21685129a8..ee195dc703 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -83,7 +83,7 @@ class story extends control if(isset($fromObjectID)) { $fromObject = $this->loadModel($fromObjectName)->getById($fromObjectID); - if(!$fromObject) die(js::error($this->lang->notFound) . js::locate('back', 'parent')); + if(!$fromObject) return print(js::error($this->lang->notFound) . js::locate('back', 'parent')); $this->view->$fromObjectIDKey = $fromObjectID; $this->view->$fromObjectName = $fromObject; @@ -222,7 +222,7 @@ class story extends control $users = $this->user->getPairs('pdfirst|noclosed|nodeleted'); $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch === 'all' ? 0 : $branch); - if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); + if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); /* Init vars. */ $source = ''; @@ -437,7 +437,7 @@ class story extends control if($storyID and !empty($mails)) { $this->story->subdivide($storyID, $stories); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); } if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stories)); @@ -644,7 +644,7 @@ class story extends control if(!empty($_POST)) { $changes = $this->story->update($storyID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { $action = !empty($changes) ? 'Edited' : 'Commented'; @@ -657,9 +657,9 @@ class story extends control $this->executeHooks($storyID); - if(isonlybody()) die(js::reload('parent.parent')); + if(isonlybody()) return print(js::reload('parent.parent')); if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'data' => $storyID)); - die(js::locate($this->createLink($this->app->rawModule, 'view', "storyID=$storyID"), 'parent')); + return print(js::locate($this->createLink($this->app->rawModule, 'view', "storyID=$storyID"), 'parent')); } $this->commonAction($storyID); @@ -791,10 +791,11 @@ class story extends control $this->action->logHistory($actionID, $changes); } } - die(js::locate($this->session->storyList, 'parent')); + return print(js::locate($this->session->storyList, 'parent')); } - $storyIdList = $this->post->storyIdList ? $this->post->storyIdList : die(js::locate($this->session->storyList, 'parent')); + if(!$this->post->storyIdList) return print(js::locate($this->session->storyList, 'parent')); + $storyIdList = $this->post->storyIdList; $storyIdList = array_unique($storyIdList); /* Get edited stories. */ @@ -934,7 +935,7 @@ class story extends control if(dao::isError()) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } $story = $this->story->getByID($storyID); $version = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch('version'); @@ -1011,7 +1012,7 @@ class story extends control if(!empty($_POST)) { $changes = $this->story->activate($storyID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($changes) { @@ -1065,7 +1066,7 @@ class story extends control $storyID = (int)$storyID; $story = $this->story->getById($storyID, $version, true); - if(!$story) die(js::error($this->lang->notFound) . js::locate($this->createLink('product', 'index'))); + if(!$story) return print(js::error($this->lang->notFound) . js::locate($this->createLink('product', 'index'))); $story = $this->story->mergeReviewer($story, true); @@ -1148,12 +1149,11 @@ class story extends control public function delete($storyID, $confirm = 'no') { $story = $this->story->getById($storyID); - if($story->parent < 0) die(js::alert($this->lang->story->cannotDeleteParent)); + if($story->parent < 0) return print(js::alert($this->lang->story->cannotDeleteParent)); if($confirm == 'no') { - echo js::confirm($this->lang->story->confirmDelete, $this->createLink('story', 'delete', "story=$storyID&confirm=yes"), ''); - exit; + return print(js::confirm($this->lang->story->confirmDelete, $this->createLink('story', 'delete', "story=$storyID&confirm=yes"), '')); } else { @@ -1169,7 +1169,7 @@ class story extends control if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); $locateLink = $this->session->storyList ? $this->session->storyList : $this->createLink('product', 'browse', "productID={$story->product}"); - die(js::locate($locateLink, 'parent')); + return print(js::locate($locateLink, 'parent')); } } @@ -1188,7 +1188,7 @@ class story extends control if(!empty($_POST)) { $changes = $this->story->review($storyID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($changes) { @@ -1199,10 +1199,10 @@ class story extends control $this->executeHooks($storyID); - if(isonlybody()) die(js::reload('parent.parent')); + if(isonlybody()) return print(js::reload('parent.parent')); $module = $from == 'project' ? 'projectstory' : 'story'; - die(js::locate($this->createLink($module, 'view', "storyID=$storyID"), 'parent')); + return print(js::locate($this->createLink($module, 'view', "storyID=$storyID"), 'parent')); } /* Get story and product. */ @@ -1266,13 +1266,14 @@ class story extends control */ public function batchReview($result, $reason = '') { - $storyIdList = $this->post->storyIdList ? $this->post->storyIdList : die(js::locate($this->session->storyList, 'parent')); + if(!$this->post->storyIdList) return print(js::locate($this->session->storyList, 'parent')); + $storyIdList = $this->post->storyIdList; $storyIdList = array_unique($storyIdList); $actions = $this->story->batchReview($storyIdList, $result, $reason); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -1289,7 +1290,7 @@ class story extends control $this->loadModel('action')->create('story', $storyID, 'Recalled'); $locateLink = $this->session->storyList ? $this->session->storyList : $this->createLink('product', 'browse', "productID={$story->product}"); - die(js::locate($locateLink, 'parent')); + echo js::locate($locateLink, 'parent'); } /** @@ -1393,10 +1394,11 @@ class story extends control } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::locate($this->session->storyList, 'parent')); + return print(js::locate($this->session->storyList, 'parent')); } - $storyIdList = $this->post->storyIdList ? $this->post->storyIdList : die(js::locate($this->session->storyList, 'parent')); + if(!$this->post->storyIdList) return print(js::locate($this->session->storyList, 'parent')); + $storyIdList = $this->post->storyIdList; $storyIdList = array_unique($storyIdList); /* Get edited stories. */ @@ -1488,17 +1490,18 @@ class story extends control */ public function batchChangeModule($moduleID) { - $storyIdList = !empty($_POST['storyIdList']) ? $this->post->storyIdList : die(js::locate($this->session->storyList, 'parent')); + if(empty($_POST['storyIdList'])) return print(js::locate($this->session->storyList, 'parent')); + $storyIdList = $this->post->storyIdList; $storyIdList = array_unique($storyIdList); $allChanges = $this->story->batchChangeModule($storyIdList, $moduleID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $storyID => $changes) { $actionID = $this->action->create('story', $storyID, 'Edited'); $this->action->logHistory($actionID, $changes); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::locate($this->session->storyList, 'parent')); + echo js::locate($this->session->storyList, 'parent'); } /** @@ -1539,17 +1542,18 @@ class story extends control */ public function batchChangePlan($planID, $oldPlanID = 0) { - $storyIdList = !empty($_POST['storyIdList']) ? $this->post->storyIdList : die(js::locate($this->session->storyList, 'parent')); + if(empty($_POST['storyIdList'])) return print(js::locate($this->session->storyList, 'parent')); + $storyIdList = $this->post->storyIdList; $storyIdList = array_unique($storyIdList); $allChanges = $this->story->batchChangePlan($storyIdList, $planID, $oldPlanID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $storyID => $changes) { $actionID = $this->action->create('story', $storyID, 'Edited'); $this->action->logHistory($actionID, $changes); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::locate($this->session->storyList, 'parent')); + echo js::locate($this->session->storyList, 'parent'); } /** @@ -1563,8 +1567,8 @@ class story extends control */ public function batchChangeBranch($branchID, $confirm = '', $storyIdList = '') { - if(!empty($_POST['storyIdList'])) $storyIdList = $_POST['storyIdList']; - $storyIdList = !empty($storyIdList) ? $storyIdList : die(js::locate($this->session->storyList, 'parent')); + if(empty($_POST['storyIdList'])) return print(js::locate($this->session->storyList, 'parent')); + $storyIdList = $this->post->storyIdList; $plans = $this->loadModel('productplan')->getPlansByStories($storyIdList); if(empty($confirm)) { @@ -1598,21 +1602,21 @@ class story extends control $storyIdList = implode(',', $storyIdList); $confirmURL = $this->createLink('story', 'batchChangeBranch', "branchID=$branchID&confirm=yes&storyIdList=$storyIdList"); $cancelURL = $this->createLink('story', 'batchChangeBranch', "branchID=$branchID&confirm=no&storyIdList=$normalStotyIdList"); - die(js::confirm(sprintf($this->lang->story->confirmChangeBranch, $conflictStoryIdList ), $confirmURL, $cancelURL)); + return print(js::confirm(sprintf($this->lang->story->confirmChangeBranch, $conflictStoryIdList ), $confirmURL, $cancelURL)); } } if(is_string($storyIdList)) $storyIdList = array_filter(explode(',', $storyIdList)); $storyIdList = array_unique($storyIdList); $allChanges = $this->story->batchChangeBranch($storyIdList, $branchID, $confirm, $plans); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $storyID => $changes) { $actionID = $this->action->create('story', $storyID, 'Edited'); $this->action->logHistory($actionID, $changes); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -1625,11 +1629,11 @@ class story extends control public function batchChangeStage($stage) { $storyIdList = $this->post->storyIdList; - if(empty($storyIdList)) die(js::locate($this->session->storyList, 'parent')); + if(empty($storyIdList)) return print(js::locate($this->session->storyList, 'parent')); $storyIdList = array_unique($storyIdList); $allChanges = $this->story->batchChangeStage($storyIdList, $stage); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $action = $stage == 'verified' ? 'Verified' : 'Edited'; foreach($allChanges as $storyID => $changes) @@ -1638,7 +1642,7 @@ class story extends control $this->action->logHistory($actionID, $changes); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::locate($this->session->storyList, 'parent')); + echo js::locate($this->session->storyList, 'parent'); } /** @@ -1653,7 +1657,7 @@ class story extends control if(!empty($_POST)) { $changes = $this->story->assign($storyID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($changes) { $actionID = $this->loadModel('action')->create('story', $storyID, 'Assigned', $this->post->comment, $this->post->assignedTo); @@ -1706,7 +1710,7 @@ class story extends control if(!empty($_POST) && isset($_POST['storyIdList'])) { $allChanges = $this->story->batchAssignTo(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $storyID => $changes) { $actionID = $this->action->create('story', $storyID, 'Assigned', '', $this->post->assignedTo); @@ -1714,7 +1718,7 @@ class story extends control } } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::locate($this->session->storyList, 'parent')); + echo js::locate($this->session->storyList, 'parent'); } /** @@ -1893,15 +1897,15 @@ class story extends control if($type == 'remove') { $result = $this->story->unlinkStory($storyID, $linkedStoryID); - die(js::reload('parent')); + return print(js::reload('parent')); } if($_POST) { $this->story->linkStories($storyID); - if(dao::isError()) die(js::error(dao::getError())); - die(js::closeModal('parent.parent', 'this')); + if(dao::isError()) return print(js::error(dao::getError())); + return print(js::closeModal('parent.parent', 'this')); } /* Get story, product, products, and queryID. */ @@ -1953,7 +1957,7 @@ class story extends control if($result == 'no') { $this->dao->update(TABLE_STORY)->set('URChanged')->eq(0)->where('id')->eq($storyID)->exec(); - die(js::reload('parent', 'this')); + return print(js::reload('parent', 'this')); } $this->view->changedStories = $this->story->getChangedStories($story); @@ -1983,16 +1987,16 @@ class story extends control $stories = $this->story->getExecutionStoryPairs($executionID, $productID, $branch, $moduleID, $type); if($this->app->getViewType() === 'json') { - die(json_encode($stories)); + return print(json_encode($stories)); } elseif($this->app->getViewType() == 'mhtml') { - die(html::select('story', empty($stories) ? array('' => '') : $stories, $storyID, 'onchange=setStoryRelated()')); + return print(html::select('story', empty($stories) ? array('' => '') : $stories, $storyID, 'onchange=setStoryRelated()')); } else { $storyName = $number === '' ? 'story' : "story[$number]"; - die(html::select($storyName, empty($stories) ? array('' => '') : $stories, $storyID, 'class=form-control onchange=setStoryRelated(' . $number . ');')); + return print(html::select($storyName, empty($stories) ? array('' => '') : $stories, $storyID, 'class=form-control onchange=setStoryRelated(' . $number . ');')); } } @@ -2044,8 +2048,8 @@ class story extends control $select = html::select('story' . $number, empty($stories) ? array('' => '') : $stories, $storyID, "class='form-control'"); /* If only need options, remove select wrap. */ - if($onlyOption == 'true') die(substr($select, strpos($select, '>') + 1, -10)); - die($select); + if($onlyOption == 'true') return print(substr($select, strpos($select, '>') + 1, -10)); + echo $select; } /** @@ -2093,7 +2097,7 @@ class story extends control $result['info'] = $this->lang->noResultsMatch; } - die(json_encode($result)); + echo json_encode($result); } /** @@ -2476,8 +2480,8 @@ class story extends control $user = $this->loadModel('user')->getById($userID, 'id'); $stories = $this->story->getUserStoryPairs($user->account); - if($id) die(html::select("stories[$id]", $stories, '', 'class="form-control"')); - die(html::select('story', $stories, '', 'class=form-control')); + if($id) return print(html::select("stories[$id]", $stories, '', 'class="form-control"')); + echo html::select('story', $stories, '', 'class=form-control'); } /** @@ -2513,6 +2517,6 @@ class story extends control $status = $oldStory->status; if($params['result'] == 'revert') $status = 'active'; } - die($status); + echo $status; } } diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 7a65f2ba99..9416b57890 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -126,6 +126,7 @@ $lang->story->rejectedReason = 'Reject Reason'; $lang->story->reviewedBy = 'ReviewedBy'; $lang->story->reviewers = 'Reviewers'; $lang->story->reviewedDate = 'ReviewedDate'; +$lang->story->activatedDate = 'Activated Date'; $lang->story->version = 'Version'; $lang->story->feedbackBy = 'From Name'; $lang->story->notifyEmail = 'From Email'; diff --git a/module/story/lang/zh-tw.php b/module/story/lang/zh-tw.php index e64733eaaf..723d3bbf03 100644 --- a/module/story/lang/zh-tw.php +++ b/module/story/lang/zh-tw.php @@ -126,6 +126,7 @@ $lang->story->rejectedReason = '拒絶原因'; $lang->story->reviewedBy = '由誰評審'; $lang->story->reviewers = '評審人員'; $lang->story->reviewedDate = '評審時間'; +$lang->story->activatedDate = '激活日期'; $lang->story->version = '版本號'; $lang->story->feedbackBy = '反饋者'; $lang->story->notifyEmail = '通知郵箱'; diff --git a/module/story/model.php b/module/story/model.php index 8f34c62857..b60f59d06b 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -477,6 +477,7 @@ class storyModel extends model $story->sourceNote = $stories->sourceNote[$i]; $story->product = $productID; $story->openedBy = $this->app->user->account; + $story->vision = $this->config->vision; $story->openedDate = $now; $story->version = 1; @@ -487,7 +488,7 @@ class storyModel extends model $story->{$extendField->field} = htmlSpecialString($story->{$extendField->field}); $message = $this->checkFlowRule($extendField, $story->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } foreach(explode(',', $this->config->story->create->requiredFields) as $field) @@ -514,7 +515,7 @@ class storyModel extends model if(dao::isError()) { echo js::error(dao::getError()); - die(js::reload('parent')); + return print(js::reload('parent')); } $storyID = $this->dao->lastInsertID(); @@ -1206,7 +1207,7 @@ class storyModel extends model $story->{$extendField->field} = htmlSpecialString($story->{$extendField->field}); $message = $this->checkFlowRule($extendField, $story->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } $stories[$storyID] = $story; @@ -1246,7 +1247,7 @@ class storyModel extends model } else { - die(js::error('story#' . $storyID . dao::getError(true))); + return print(js::error('story#' . $storyID . dao::getError(true))); } } } @@ -1263,8 +1264,8 @@ class storyModel extends model */ public function review($storyID) { - if($this->post->result == false) die(js::alert($this->lang->story->mustChooseResult)); - if($this->post->result == 'revert' and $this->post->preVersion == false) die(js::alert($this->lang->story->mustChoosePreVersion)); + if($this->post->result == false) return print(js::alert($this->lang->story->mustChooseResult)); + if($this->post->result == 'revert' and $this->post->preVersion == false) return print(js::alert($this->lang->story->mustChoosePreVersion)); if(strpos($this->config->story->review->requiredFields, 'comment') !== false and !$this->post->comment) { @@ -1457,11 +1458,11 @@ class storyModel extends model $this->dao->insert(TABLE_RELATION)->data($data)->autoCheck()->exec(); } - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $isonlybody = isonlybody(); unset($_GET['onlybody']); - die(js::locate(helper::createLink('product', 'browse', "productID=$oldStory->product&branch=0&browseType=unclosed&queryID=0&type=story"), $isonlybody ? 'parent.parent' : 'parent')); + return print(js::locate(helper::createLink('product', 'browse', "productID=$oldStory->product&branch=0&browseType=unclosed&queryID=0&type=story"), $isonlybody ? 'parent.parent' : 'parent')); } else { @@ -1591,7 +1592,7 @@ class storyModel extends model } else { - die(js::error('story#' . $storyID . dao::getError(true))); + return print(js::error('story#' . $storyID . dao::getError(true))); } if(!dao::isError()) $this->loadModel('score')->create('story', 'close', $storyID); } @@ -3984,7 +3985,7 @@ class storyModel extends model common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); common::printIcon('story', 'edit', $vars . "&from=$story->from", $story, 'list', '', '', '', false, "data-group=$story->from"); if($story->type != 'requirement' and $this->config->vision != 'lite') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', '', false, "data-app='qa'"); - if($this->app->rawModule != 'projectstory' OR $this->config->vision == 'lite') common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&storyID=$story->id", $story, 'list', 'split', '', '', '', '', $this->lang->story->subdivide); + if($this->app->rawModule != 'projectstory' OR $this->config->vision == 'lite') common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&storyID=$story->id&executionID={$this->session->project}", $story, 'list', 'split', '', '', '', '', $this->lang->story->subdivide); if($this->app->rawModule == 'projectstory' and $this->config->vision != 'lite') common::printIcon('projectstory', 'unlinkStory', "projectID={$this->session->project}&storyID=$story->id", '', 'list', 'unlink', 'hiddenwin'); } else diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index 09f99ddc88..4dc2268e8a 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -50,7 +50,7 @@ foreach(explode(',', $showFields) as $field) - + diff --git a/module/story/view/bugs.html.php b/module/story/view/bugs.html.php index 9edbb6ed71..8101b47228 100644 --- a/module/story/view/bugs.html.php +++ b/module/story/view/bugs.html.php @@ -12,7 +12,7 @@ - + diff --git a/module/story/view/cases.html.php b/module/story/view/cases.html.php index 154e24dcf9..d36a419aef 100644 --- a/module/story/view/cases.html.php +++ b/module/story/view/cases.html.php @@ -12,7 +12,7 @@ - + diff --git a/module/story/view/linkstory.html.php b/module/story/view/linkstory.html.php index 0260e58510..3c9d8effda 100644 --- a/module/story/view/linkstory.html.php +++ b/module/story/view/linkstory.html.php @@ -35,7 +35,7 @@ idAB;?> - + type == 'requirement'):?> diff --git a/module/story/view/tasks.html.php b/module/story/view/tasks.html.php index 64ef8d78a9..8f6d580a05 100644 --- a/module/story/view/tasks.html.php +++ b/module/story/view/tasks.html.php @@ -15,7 +15,7 @@ include '../../common/view/chart.html.php'; - + diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 16be21d237..553e702396 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -150,7 +150,7 @@ - + diff --git a/module/story/view/zerocase.html.php b/module/story/view/zerocase.html.php index e90d63132c..9694f36be8 100644 --- a/module/story/view/zerocase.html.php +++ b/module/story/view/zerocase.html.php @@ -33,7 +33,7 @@ idAB);?> - + diff --git a/module/svn/control.php b/module/svn/control.php index 2ffa0bab50..0cd0cc92a3 100644 --- a/module/svn/control.php +++ b/module/svn/control.php @@ -124,8 +124,7 @@ class svn extends control $parsedObjects['tasks'] = array_unique($parsedObjects['tasks']); $parsedObjects['bugs'] = array_unique($parsedObjects['bugs']); $this->view->parsedObjects = $parsedObjects; - $this->display(); - exit; + return $this->display(); } } @@ -144,7 +143,7 @@ class svn extends control $files = $this->post->files; /* Ignore git. */ - if(strpos($repoUrl, '://') === false) die(); + if(strpos($repoUrl, '://') === false) return; $parsedFiles = array(); $repoDirs = explode('/', trim($repoUrl, '/')); @@ -182,7 +181,6 @@ class svn extends control $log->files = $parsedFiles; $this->repo->saveAction2PMS($objects, $log, $repoUrl); } - die(); } /** @@ -194,6 +192,6 @@ class svn extends control public function ajaxGetRepos() { $repos = $this->svn->getRepos(); - die(json_encode($repos)); + echo json_encode($repos); } } diff --git a/module/task/config.php b/module/task/config.php index 317f4b44a3..bde80f683b 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -48,7 +48,7 @@ $config->task->custom->batchCreateFields = 'module,story,assignedTo,estimate,des $config->task->custom->batchEditFields = 'module,assignedTo,status,pri,estimate,record,left'; $config->task->datatable = new stdclass(); -$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'assignedTo', 'finishedBy', 'estimate', 'consumed', 'left', 'progress', 'deadline', 'actions'); +$config->task->datatable->defaultField = array('id', 'pri', 'name', 'status', 'assignedTo', 'lane', 'finishedBy', 'estimate', 'consumed', 'left', 'progress', 'deadline', 'actions'); global $lang; $config->task->datatable->fieldList['id']['title'] = 'idAB'; @@ -60,6 +60,7 @@ $config->task->datatable->fieldList['pri']['title'] = 'priAB'; $config->task->datatable->fieldList['pri']['fixed'] = 'left'; $config->task->datatable->fieldList['pri']['width'] = '50'; $config->task->datatable->fieldList['pri']['required'] = 'no'; +$config->task->datatable->fieldList['pri']['name'] = $lang->task->pri; $config->task->datatable->fieldList['name']['title'] = 'name'; $config->task->datatable->fieldList['name']['fixed'] = 'left'; @@ -128,6 +129,11 @@ $config->task->datatable->fieldList['assignedTo']['fixed'] = 'no'; $config->task->datatable->fieldList['assignedTo']['width'] = '100'; $config->task->datatable->fieldList['assignedTo']['required'] = 'no'; +$config->task->datatable->fieldList['lane']['title'] = 'lane'; +$config->task->datatable->fieldList['lane']['fixed'] = 'no'; +$config->task->datatable->fieldList['lane']['width'] = '90'; +$config->task->datatable->fieldList['lane']['required'] = 'no'; + $config->task->datatable->fieldList['assignedDate']['title'] = 'assignedDate'; $config->task->datatable->fieldList['assignedDate']['fixed'] = 'no'; $config->task->datatable->fieldList['assignedDate']['width'] = '110'; diff --git a/module/task/control.php b/module/task/control.php index e02ea9544d..8e92364246 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -53,7 +53,7 @@ class task extends control if(strpos(",{$limitedExecutions},", ",$executionID,") !== false) { echo js::alert($this->lang->task->createDenied); - die(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); + return print(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); } $task = new stdClass(); @@ -284,7 +284,7 @@ class task extends control if(strpos(",{$limitedExecutions},", ",$executionID,") !== false) { echo js::alert($this->lang->task->createDenied); - die(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); + return print(js::locate($this->createLink('execution', 'task', "executionID=$executionID"))); } $execution = $this->execution->getById($executionID); @@ -449,7 +449,7 @@ class task extends control { $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug"); $cancelURL = $this->server->HTTP_REFERER; - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent')); } } } @@ -476,7 +476,7 @@ class task extends control } else { - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } } @@ -525,7 +525,7 @@ class task extends control if($this->post->names) { $allChanges = $this->task->batchUpdate(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if(!empty($allChanges)) { @@ -560,7 +560,7 @@ class task extends control { $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug"); $cancelURL = $this->server->HTTP_REFERER; - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent')); } } } @@ -568,11 +568,12 @@ class task extends control } } $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::locate($this->session->taskList, 'parent')); + return print(js::locate($this->session->taskList, 'parent')); } - $taskIDList = $this->post->taskIDList ? $this->post->taskIDList : die(js::locate($this->session->taskList, 'parent')); - $taskIDList = array_unique($taskIDList); + if(!$this->post->taskIDList) return print(js::locate($this->session->taskList, 'parent')); + + $taskIDList = array_unique($this->post->taskIDList); /* The tasks of execution. */ if($executionID) @@ -658,7 +659,7 @@ class task extends control if(dao::isError()) { if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } $actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo); @@ -722,7 +723,7 @@ class task extends control $taskIDList = array_unique($taskIDList); unset($_POST['taskIDList']); $allChanges = $this->task->batchChangeModule($taskIDList, $moduleID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $taskID => $changes) { $this->loadModel('action'); @@ -731,7 +732,7 @@ class task extends control } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); } - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -749,7 +750,7 @@ class task extends control $taskIDList = $this->post->taskIDList; $taskIDList = array_unique($taskIDList); unset($_POST['taskIDList']); - if(!is_array($taskIDList)) die(js::locate($this->createLink('execution', 'task', "executionID=$execution"), 'parent')); + if(!is_array($taskIDList)) return print(js::locate($this->createLink('execution', 'task', "executionID=$execution"), 'parent')); $taskIDList = array_unique($taskIDList); $muletipleTasks = $this->dao->select('root , account')->from(TABLE_TEAM)->where('type')->eq('task')->andWhere('root')->in($taskIDList)->fetchGroup('root', 'account'); @@ -761,12 +762,12 @@ class task extends control if(isset($muletipleTasks[$taskID]) and !isset($muletipleTasks[$taskID][$this->post->assignedTo])) continue; $changes = $this->task->assign($taskID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo); $this->action->logHistory($actionID, $changes); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -788,7 +789,7 @@ class task extends control if(!$task) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found')); - die(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'all'))); + return print(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'all'))); } $this->session->project = $task->project; @@ -856,7 +857,7 @@ class task extends control $this->executeHooks($taskID); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -884,7 +885,7 @@ class task extends control if(dao::isError()) { if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } if($this->post->comment != '' or !empty($changes)) @@ -907,7 +908,7 @@ class task extends control $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug"); unset($_GET['onlybody']); $cancelURL = $this->createLink('task', 'view', "taskID=$taskID"); - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); } } } @@ -930,7 +931,7 @@ class task extends control return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); } } - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->task->start; @@ -956,7 +957,7 @@ class task extends control if(!empty($_POST)) { $changes = $this->task->recordEstimate($taskID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $this->loadModel('common')->syncPPEStatus($taskID); @@ -971,7 +972,7 @@ class task extends control $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug"); unset($_GET['onlybody']); $cancelURL = $this->createLink('task', 'view', "taskID=$taskID"); - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); } } } @@ -1016,13 +1017,13 @@ class task extends control if(!empty($_POST)) { $changes = $this->task->updateEstimate($estimateID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $actionID = $this->loadModel('action')->create('task', $estimate->task, 'EditEstimate', $this->post->work); $this->action->logHistory($actionID, $changes); $url = $this->session->estimateList ? $this->session->estimateList : inlink('record', "taskID={$estimate->task}"); - die(js::locate($url, 'parent')); + return print(js::locate($url, 'parent')); } $estimate = $this->task->getEstimateById($estimateID); @@ -1045,17 +1046,17 @@ class task extends control { if($confirm == 'no') { - die(js::confirm($this->lang->task->confirmDeleteEstimate, $this->createLink('task', 'deleteEstimate', "estimateID=$estimateID&confirm=yes"))); + return print(js::confirm($this->lang->task->confirmDeleteEstimate, $this->createLink('task', 'deleteEstimate', "estimateID=$estimateID&confirm=yes"))); } else { $estimate = $this->task->getEstimateById($estimateID); $changes = $this->task->deleteEstimate($estimateID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $actionID = $this->loadModel('action')->create('task', $estimate->task, 'DeleteEstimate'); $this->action->logHistory($actionID, $changes); - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -1081,7 +1082,7 @@ class task extends control if(dao::isError()) { if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } $files = $this->loadModel('file')->saveUpload('task', $taskID); @@ -1104,7 +1105,7 @@ class task extends control $confirmURL = $this->createLink('bug', 'view', "id=$task->fromBug", '', true); unset($_GET['onlybody']); $cancelURL = $this->createLink('task', 'view', "taskID=$taskID"); - die(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); + return print(js::confirm(sprintf($this->lang->task->remindBug, $task->fromBug), $confirmURL, $cancelURL, 'parent', 'parent.parent')); } } } @@ -1133,7 +1134,7 @@ class task extends control } else { - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } } @@ -1186,7 +1187,7 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->pause($taskID, $extra); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1241,7 +1242,7 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->start($taskID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1300,7 +1301,7 @@ class task extends control $this->loadModel('action'); $changes = $this->task->close($taskID, $extra); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1334,7 +1335,7 @@ class task extends control } else { - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } } @@ -1377,7 +1378,7 @@ class task extends control } } - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -1425,11 +1426,12 @@ class task extends control $skipTasks = join(',', $skipTasks); $confirmURL = $this->createLink('task', 'batchClose', "skipTaskIdList=$skipTasks"); $cancelURL = $this->server->HTTP_REFERER; - die(js::confirm(sprintf($this->lang->task->error->skipClose, $skipTasks), $confirmURL, $cancelURL, 'self', 'parent')); + return print(js::confirm(sprintf($this->lang->task->error->skipClose, $skipTasks), $confirmURL, $cancelURL, 'self', 'parent')); } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); } - die(js::reload('parent')); + + echo js::reload('parent'); } /** @@ -1451,7 +1453,7 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->cancel($taskID, $extra); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1478,7 +1480,7 @@ class task extends control return print(js::closeModal('parent.parent', 'this')); } } - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->task->cancel; @@ -1507,7 +1509,7 @@ class task extends control { $this->loadModel('action'); $changes = $this->task->activate($taskID, $extra); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($this->post->comment != '' or !empty($changes)) { @@ -1609,8 +1611,8 @@ class task extends control if(isset($suspendedTasks[$taskid])) unset($tasks[$taskid]); } - if($id) die(html::select("tasks[$id]", $tasks, '', 'class="form-control"')); - die(html::select('task', $tasks, '', 'class=form-control')); + if($id) return print(html::select("tasks[$id]", $tasks, '', 'class="form-control"')); + echo html::select('task', $tasks, '', 'class=form-control'); } /** @@ -1624,7 +1626,7 @@ class task extends control public function ajaxGetExecutionTasks($executionID, $taskID = 0) { $tasks = $this->task->getExecutionTaskPairs((int)$executionID); - die(html::select('task', empty($tasks) ? array('' => '') : $tasks, $taskID, "class='form-control'")); + echo html::select('task', empty($tasks) ? array('' => '') : $tasks, $taskID, "class='form-control'"); } /** @@ -1965,6 +1967,6 @@ class task extends control $stage = $this->dao->select('*')->from(TABLE_STORY)->where('id')->eq($task->story)->andWhere('version')->eq($task->storyVersion)->fetch('stage'); $task->storyStage = zget($this->lang->story->stageList, $stage); } - die(json_encode($task)); + echo json_encode($task); } } diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 12aa712844..3b669129b4 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -111,7 +111,6 @@ $lang->task->assignedDate = '指派日期'; $lang->task->openedBy = '由谁创建'; $lang->task->openedDate = '创建日期'; $lang->task->openedDateAB = '创建'; -$lang->task->activatedDate = '激活日期'; $lang->task->finishedBy = '由谁完成'; $lang->task->finishedByAB = '完成者'; $lang->task->finishedDate = '实际完成'; diff --git a/module/task/model.php b/module/task/model.php index 4482e1639f..4abeb523f7 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -866,7 +866,7 @@ class taskModel extends model { $taskConsumed = 0; $taskConsumed = $this->dao->select('consumed')->from(TABLE_TASK)->where('id')->eq($this->post->parent)->andWhere('parent')->eq(0)->fetch('consumed'); - if($taskConsumed > 0) die(js::error($this->lang->task->error->alreadyConsumed)); + if($taskConsumed > 0) return print(js::error($this->lang->task->error->alreadyConsumed)); } $now = helper::now(); @@ -915,7 +915,7 @@ class taskModel extends model ->remove('comment,files,labels,uid,multiple,team,teamEstimate,teamConsumed,teamLeft,contactListMenu') ->get(); - if($task->consumed < $oldTask->consumed) die(js::error($this->lang->task->error->consumedSmall)); + if($task->consumed < $oldTask->consumed) return print(js::error($this->lang->task->error->consumedSmall)); /* Fix bug#1388, Check children task executionID and moduleID. */ if(isset($task->execution) and $task->execution != $oldTask->execution) @@ -1166,7 +1166,7 @@ class taskModel extends model $task->{$extendField->field} = htmlSpecialString($task->{$extendField->field}); $message = $this->checkFlowRule($extendField, $task->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } if($data->consumeds[$taskID]) @@ -1245,9 +1245,9 @@ class taskModel extends model /* Check field not empty. */ foreach($tasks as $taskID => $task) { - if($task->status == 'done' and $task->consumed == false) die(js::error('task#' . $taskID . sprintf($this->lang->error->notempty, $this->lang->task->consumedThisTime))); + if($task->status == 'done' and $task->consumed == false) return print(js::error('task#' . $taskID . sprintf($this->lang->error->notempty, $this->lang->task->consumedThisTime))); if($task->status == 'cancel') continue; - if(!empty($task->deadline) and $task->estStarted > $task->deadline) die(js::error('task#' . $taskID . $this->lang->task->error->deadlineSmall)); + if(!empty($task->deadline) and $task->estStarted > $task->deadline) return print(js::error('task#' . $taskID . $this->lang->task->error->deadlineSmall)); foreach(explode(',', $this->config->task->edit->requiredFields) as $field) { $field = trim($field); @@ -1315,7 +1315,7 @@ class taskModel extends model } else { - die(js::error('task#' . $taskID . dao::getError(true))); + return print(js::error('task#' . $taskID . dao::getError(true))); } } if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchEdit'); @@ -1533,8 +1533,8 @@ class taskModel extends model if(!empty($record->work[$id]) or !empty($record->consumed[$id])) { - if(!$record->consumed[$id]) die(js::alert($this->lang->task->error->consumedThisTime)); - if($record->left[$id] === '') die(js::alert($this->lang->task->error->left)); + if(!$record->consumed[$id]) return print(js::alert($this->lang->task->error->consumedThisTime)); + if($record->left[$id] === '') return print(js::alert($this->lang->task->error->left)); $estimates[$id] = new stdclass(); $estimates[$id]->date = $record->dates[$id]; @@ -2118,6 +2118,26 @@ class taskModel extends model if($task->parent > 0) $parents[$task->parent] = $task->parent; } $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); + + $lanes = array(); + $cardsWhere = ''; + foreach($tasks as $task) + { + if(empty($cardsWhere)) + { + $cardsWhere = "cards like '%,{$task->id},%'"; + } + else + { + $cardsWhere .= " or cards like '%,{$task->id},%'"; + } + } + $lanes = $this->dao->select('t1.lane,t2.name,t1.cards') + ->from(TABLE_KANBANCELL)->alias('t1') + ->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.lane = t2.id') + ->where('t1.kanban')->eq($executionID) + ->andWhere("($cardsWhere)") + ->fetchAll('cards'); foreach($tasks as $task) { @@ -2134,6 +2154,15 @@ class taskModel extends model $task->parentName = $parent->name; } } + + $task->lane = ''; + if(!empty($lanes)) + { + foreach($lanes as $lane) + { + if(strpos($lane->cards, $task->id) !== false) $task->lane = $lane->name; + } + } } return $this->processTasks($tasks); @@ -2497,7 +2526,7 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($task->id)->exec(); if($task->parent > 0) $this->updateParentStatus($task->id); - if($task->story) $this->loadModel('story')->setStage($oldTask->story); + if($task->story) $this->loadModel('story')->setStage($task->story); $oldTask = new stdClass(); $oldTask->consumed = $task->consumed; @@ -3101,6 +3130,7 @@ class taskModel extends model if($id == 'deadline') $class .= ' text-center'; if($id == 'deadline' and isset($task->delay)) $class .= ' delayed'; if($id == 'assignedTo') $class .= ' has-btn text-left'; + if($id == 'lane') $class .= ' text-left'; if(strpos('progress', $id) !== false) $class .= ' text-right'; $title = ''; @@ -3182,6 +3212,9 @@ class taskModel extends model case 'assignedTo': $this->printAssignedHtml($task, $users); break; + case 'lane': + echo trim($task->lane); + break; case 'assignedDate': echo substr($task->assignedDate, 5, 11); break; diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 723c676fff..3611a5b4a1 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -33,6 +33,7 @@ createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields')?> +
    task->ditto);?> + + +';?> + diff --git a/module/testcase/config.php b/module/testcase/config.php index be18fd7b87..74c780eb55 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -87,6 +87,7 @@ $config->testcase->datatable->fieldList['pri']['title'] = 'priAB'; $config->testcase->datatable->fieldList['pri']['fixed'] = 'left'; $config->testcase->datatable->fieldList['pri']['width'] = '40'; $config->testcase->datatable->fieldList['pri']['required'] = 'no'; +$config->testcase->datatable->fieldList['pri']['name'] = $lang->testcase->pri; $config->testcase->datatable->fieldList['title']['title'] = 'title'; $config->testcase->datatable->fieldList['title']['fixed'] = 'left'; diff --git a/module/testcase/control.php b/module/testcase/control.php index a8607dfbc3..5ee331738e 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -61,7 +61,7 @@ class testcase extends control { $products = $this->product->getPairs(); } - if(empty($products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testcase&objectID=$objectID"))); + if(empty($products) and !helper::isAjaxRequest()) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testcase&objectID=$objectID"))); } else { @@ -537,7 +537,7 @@ class testcase extends control $currentModule = $this->app->tab == 'project' ? 'project' : 'testcase'; $currentMethod = $this->app->tab == 'project' ? 'testcase' : 'browse'; $projectParam = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : ''; - die(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all¶m=0&orderBy=id_desc"), 'parent')); + return print(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all¶m=0&orderBy=id_desc"), 'parent')); } if(empty($this->products)) $this->locate($this->createLink('product', 'create')); @@ -649,7 +649,7 @@ class testcase extends control $results = $this->testtask->getResults(0, $caseID); } - if(!$case) die(js::error($this->lang->notFound) . js::locate('back', 'parent')); + if(!$case) return print(js::error($this->lang->notFound) . js::locate('back', 'parent')); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->createBug; $this->view->runID = $runID; @@ -677,7 +677,7 @@ class testcase extends control if(!$case) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found')); - die(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); + return print(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); } if($case->auto == 'unit') { @@ -783,7 +783,7 @@ class testcase extends control if($comment == false) { $changes = $this->testcase->update($caseID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $files = $this->loadModel('file')->saveUpload('testcase', $caseID); } if($this->post->comment != '' or !empty($changes) or !empty($files)) @@ -804,12 +804,12 @@ class testcase extends control } else { - die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent')); + return print(js::locate($this->createLink('testcase', 'view', "caseID=$caseID"), 'parent')); } } $case = $this->testcase->getById($caseID); - if(!$case) die(js::error($this->lang->notFound) . js::locate('back')); + if(!$case) return print(js::error($this->lang->notFound) . js::locate('back')); if($case->auto == 'unit') { $this->lang->testcase->subMenu->testcase->feature['alias'] = ''; @@ -935,11 +935,11 @@ class testcase extends control } } - die(js::locate($this->session->caseList, 'parent')); + return print(js::locate($this->session->caseList, 'parent')); } - $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); - $caseIDList = array_unique($caseIDList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList)); + $caseIDList = array_unique($this->post->caseIDList); $branchProduct = false; if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project); @@ -1085,7 +1085,7 @@ class testcase extends control if($_POST) { $changes = $this->testcase->review($caseID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($changes or $this->post->comment != '') { @@ -1096,7 +1096,7 @@ class testcase extends control $this->executeHooks($caseID); - die(js::reload('parent.parent')); + return print(js::reload('parent.parent')); } $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); @@ -1114,12 +1114,12 @@ class testcase extends control */ public function batchReview($result) { - $caseIdList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList, 'parent')); - $caseIdList = array_unique($caseIdList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList, 'parent')); + $caseIdList = array_unique($this->post->caseIDList); $actions = $this->testcase->batchReview($caseIdList, $result); - if(dao::isError()) die(js::error(dao::getError())); - die(js::locate($this->session->caseList, 'parent')); + if(dao::isError()) return print(js::error(dao::getError())); + echo js::locate($this->session->caseList, 'parent'); } /** @@ -1134,7 +1134,7 @@ class testcase extends control { if($confirm == 'no') { - die(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID=$caseID&confirm=yes"))); + return print(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID=$caseID&confirm=yes"))); } else { @@ -1161,7 +1161,7 @@ class testcase extends control $locateLink = $this->session->caseList ? $this->session->caseList : inlink('browse', "productID={$case->product}"); if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - die(js::locate($locateLink, 'parent')); + return print(js::locate($locateLink, 'parent')); } } @@ -1174,11 +1174,11 @@ class testcase extends control */ public function batchDelete($productID = 0) { - $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); - $caseIDList = array_unique($caseIDList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList)); + $caseIDList = array_unique($this->post->caseIDList); foreach($caseIDList as $caseID) $this->testcase->delete(TABLE_CASE, $caseID); - die(js::locate($this->session->caseList)); + echo js::locate($this->session->caseList); } /** @@ -1196,7 +1196,7 @@ class testcase extends control $caseIDList = array_unique($caseIDList); unset($_POST['caseIDList']); $allChanges = $this->testcase->batchChangeBranch($caseIDList, $branchID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $caseID => $changes) { $this->loadModel('action'); @@ -1205,7 +1205,7 @@ class testcase extends control } } - die(js::locate($this->session->caseList, 'parent')); + echo js::locate($this->session->caseList, 'parent'); } /** @@ -1223,7 +1223,7 @@ class testcase extends control $caseIDList = array_unique($caseIDList); unset($_POST['caseIDList']); $allChanges = $this->testcase->batchChangeModule($caseIDList, $moduleID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); foreach($allChanges as $caseID => $changes) { $this->loadModel('action'); @@ -1232,7 +1232,7 @@ class testcase extends control } } - die(js::locate($this->session->caseList, 'parent')); + echo js::locate($this->session->caseList, 'parent'); } /** @@ -1244,12 +1244,12 @@ class testcase extends control */ public function batchCaseTypeChange($result) { - $caseIdList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList, 'parent')); + $caseIdList = $this->post->caseIDList ? $this->post->caseIDList : return print(js::locate($this->session->caseList, 'parent')); $caseIDList = array_unique($caseIDList); $this->testcase->batchCaseTypeChange($caseIdList, $result); - if(dao::isError()) die(js::error(dao::getError())); - die(js::locate($this->session->caseList, 'parent')); + if(dao::isError()) return print(js::error(dao::getError())); + echo js::locate($this->session->caseList, 'parent'); } /** @@ -1305,8 +1305,8 @@ class testcase extends control { $case = $this->testcase->getById($caseID); $this->dao->update(TABLE_TESTRUN)->set('version')->eq($case->version)->where('`case`')->eq($caseID)->exec(); - if($from == 'view') die(js::locate(inlink('view', "caseID=$caseID&version=$case->version&from=testtask&taskID=$taskID"), 'parent')); - die(js::reload('parent')); + if($from == 'view') return print(js::locate(inlink('view', "caseID=$caseID&version=$case->version&from=testtask&taskID=$taskID"), 'parent')); + echo js::reload('parent'); } /** @@ -1331,7 +1331,7 @@ class testcase extends control $step->version = $version; $this->dao->insert(TABLE_CASESTEP)->data($step)->exec(); } - die(js::locate($this->createLink('testcase', 'view', "caseID=$caseID&version=$version"), 'parent')); + echo js::locate($this->createLink('testcase', 'view', "caseID=$caseID&version=$version"), 'parent'); } /** @@ -1343,9 +1343,9 @@ class testcase extends control */ public function ignoreLibcaseChange($caseID) { - $case = $this->testcase->getById($caseID); + $case = $this->testcase->getById($caseID); $this->dao->update(TABLE_CASE)->set('fromCaseVersion')->eq($case->version)->where('id')->eq($caseID)->exec(); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -1360,7 +1360,7 @@ class testcase extends control $case = $this->testcase->getById($caseID); $this->dao->update(TABLE_CASE)->set('storyVersion')->eq($case->latestStoryVersion)->where('id')->eq($caseID)->exec(); $this->loadModel('action')->create('case', $caseID, 'confirmed', '', $case->latestStoryVersion); - if($reload) die(js::reload('parent')); + if($reload) return print(js::reload('parent')); } /** @@ -1372,11 +1372,11 @@ class testcase extends control */ public function batchConfirmStoryChange($productID = 0) { - $caseIDList = $this->post->caseIDList ? $this->post->caseIDList : die(js::locate($this->session->caseList)); - $caseIDList = array_unique($caseIDList); + if(!$this->post->caseIDList) return print(js::locate($this->session->caseList)); + $caseIDList = array_unique($this->post->caseIDList); foreach($caseIDList as $caseID) $this->confirmStoryChange($caseID,false); - die(js::locate($this->session->caseList)); + echo js::locate($this->session->caseList); } /** @@ -1741,13 +1741,14 @@ class testcase extends control if(!isset($fields[$title])) continue; $columnKey[] = $fields[$title]; } - if(count($columnKey) == 0) die(js::alert($this->lang->testcase->errorEncode)); + if(count($columnKey) == 0) return print(js::alert($this->lang->testcase->errorEncode)); } $this->session->set('fileImport', $fileName); - die(js::locate(inlink('showImport', "productID=$productID&branch=$branch"), 'parent.parent')); + return print(js::locate(inlink('showImport', "productID=$productID&branch=$branch"), 'parent.parent')); } + $this->display(); } @@ -1777,7 +1778,7 @@ class testcase extends control if($_POST) { $this->testcase->importFromLib($productID); - die(js::reload('parent')); + return print(js::reload('parent')); } $this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $branch); @@ -1786,7 +1787,7 @@ class testcase extends control if(empty($libraries)) { echo js::alert($this->lang->testcase->noLibrary); - die(js::locate($this->session->caseList)); + return print(js::locate($this->session->caseList)); } if(empty($libID) or !isset($libraries[$libID])) $libID = key($libraries); @@ -1854,16 +1855,16 @@ class testcase extends control if($this->app->tab == 'project') { - die(js::locate($this->createLink('project', 'testcase', "projectID={$this->session->project}&productID=$productID"), 'parent')); + return print(js::locate($this->createLink('project', 'testcase', "projectID={$this->session->project}&productID=$productID"), 'parent')); } else { - die(js::locate(inlink('browse', "productID=$productID"), 'parent')); + return print(js::locate(inlink('browse', "productID=$productID"), 'parent')); } } else { - die(js::locate(inlink('showImport', "productID=$productID&branch=$branch&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', '')), 'parent')); + return print(js::locate(inlink('showImport', "productID=$productID&branch=$branch&pagerID=" . ($this->post->pagerID + 1) . "&maxImport=$maxImport&insert=" . zget($_POST, 'insert', '')), 'parent')); } } @@ -2030,7 +2031,7 @@ class testcase extends control if(empty($caseData)) { echo js::alert($this->lang->error->noData); - die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"))); + return print(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"))); } $allCount = count($caseData); @@ -2043,13 +2044,13 @@ class testcase extends control $this->view->maxImport = $maxImport; $this->view->productID = $productID; $this->view->branch = $branch; - die($this->display()); + return print($this->display()); } $allPager = ceil($allCount / $maxImport); $caseData = array_slice($caseData, ($pagerID - 1) * $maxImport, $maxImport, true); } - if(empty($caseData)) die(js::locate(inlink('browse', "productID=$productID&branch=$branch"))); + if(empty($caseData)) return print(js::locate(inlink('browse', "productID=$productID&branch=$branch"))); /* Judge whether the editedCases is too large and set session. */ $countInputVars = count($caseData) * 12 + (isset($stepVars) ? $stepVars : 0); @@ -2105,7 +2106,7 @@ class testcase extends control { $story = $this->dao->select('module')->from(TABLE_STORY)->where('id')->eq($storyID)->fetch(); $moduleID = !empty($story) ? $story->module : 0; - die(json_encode(array('moduleID'=> $moduleID))); + echo json_encode(array('moduleID'=> $moduleID)); } /** @@ -2121,7 +2122,7 @@ class testcase extends control $case = $this->testcase->getByID($caseID); $status = $this->testcase->getStatus($methodName, $case); if($methodName == 'update') $status = zget($status, 1, ''); - die($status); + echo $status; } /** diff --git a/module/testcase/model.php b/module/testcase/model.php index d5d701742e..365372313a 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -115,7 +115,7 @@ class testcaseModel extends model foreach($cases->title as $i => $title) { - if(!empty($cases->title[$i]) and empty($cases->type[$i])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->type))); + if(!empty($cases->title[$i]) and empty($cases->type[$i])) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->type))); } $module = 0; @@ -176,13 +176,13 @@ class testcaseModel extends model $data[$i]->{$extendField->field} = htmlSpecialString($data[$i]->{$extendField->field}); $message = $this->checkFlowRule($extendField, $data[$i]->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } foreach(explode(',', $this->config->testcase->create->requiredFields) as $field) { $field = trim($field); - if($field and empty($data[$i]->$field)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->$field))); + if($field and empty($data[$i]->$field)) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->testcase->$field))); } } @@ -197,7 +197,7 @@ class testcaseModel extends model if(dao::isError()) { echo js::error(dao::getError()); - die(js::reload('parent')); + return print(js::reload('parent')); } $caseID = $this->dao->lastInsertID(); @@ -793,7 +793,7 @@ class testcaseModel extends model */ public function review($caseID) { - if($this->post->result == false) die(js::alert($this->lang->testcase->mustChooseResult)); + if($this->post->result == false) return print(js::alert($this->lang->testcase->mustChooseResult)); $oldCase = $this->getById($caseID); @@ -932,7 +932,7 @@ class testcaseModel extends model $case->{$extendField->field} = htmlSpecialString($case->{$extendField->field}); $message = $this->checkFlowRule($extendField, $case->{$extendField->field}); - if($message) die(js::alert($message)); + if($message) return print(js::alert($message)); } $cases[$caseID] = $case; @@ -964,7 +964,7 @@ class testcaseModel extends model } else { - die(js::error('case#' . $caseID . dao::getError(true))); + return print(js::error('case#' . $caseID . dao::getError(true))); } } @@ -1199,7 +1199,7 @@ class testcaseModel extends model $cases[$key] = $caseData; $line++; } - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $forceNotReview = $this->forceNotReview(); foreach($cases as $key => $caseData) @@ -1562,7 +1562,7 @@ class testcaseModel extends model else { $showBranch = isset($this->config->testcase->browse->showBranch) ? $this->config->testcase->browse->showBranch : 1; - } + } if(isset($branches[$case->branch]) and $showBranch) echo "{$branches[$case->branch]} "; if($modulePairs and $case->module and isset($modulePairs[$case->module])) echo "{$modulePairs[$case->module]} "; echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[#$fromCaseID]", '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "$case->title"; diff --git a/module/testcase/view/bugs.html.php b/module/testcase/view/bugs.html.php index 84da9259f5..93e36b1534 100644 --- a/module/testcase/view/bugs.html.php +++ b/module/testcase/view/bugs.html.php @@ -9,7 +9,7 @@ - + diff --git a/module/testcase/view/groupcase.html.php b/module/testcase/view/groupcase.html.php index e863be5027..e0f3adfddb 100644 --- a/module/testcase/view/groupcase.html.php +++ b/module/testcase/view/groupcase.html.php @@ -35,7 +35,7 @@ - + diff --git a/module/testcase/view/importfromlib.html.php b/module/testcase/view/importfromlib.html.php index df10fd4979..c0e7e814b8 100644 --- a/module/testcase/view/importfromlib.html.php +++ b/module/testcase/view/importfromlib.html.php @@ -36,8 +36,8 @@ type != 'normal'):?> - - + + diff --git a/module/testcase/view/linkcases.html.php b/module/testcase/view/linkcases.html.php index 0bd00d0d17..ab5e4db49f 100644 --- a/module/testcase/view/linkcases.html.php +++ b/module/testcase/view/linkcases.html.php @@ -32,7 +32,7 @@ idAB;?> - + diff --git a/module/testreport/control.php b/module/testreport/control.php index ca1c40d2e4..57e7b88168 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -64,7 +64,7 @@ class testreport extends control { $products = $this->product->getPairs(); } - if(empty($products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testreport&objectID=$objectID"))); + if(empty($products) and !helper::isAjaxRequest()) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testreport&objectID=$objectID"))); } else { @@ -88,7 +88,7 @@ class testreport extends control */ public function browse($objectID = 0, $objectType = 'product', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { - if(strpos('product|execution|project', $objectType) === false) die('Type Error!'); + if(strpos('product|execution|project', $objectType) === false) return print('Type Error!'); $objectID = $this->commonAction($objectID, $objectType); $object = $this->$objectType->getById($objectID); @@ -171,10 +171,10 @@ class testreport extends control if($_POST) { $reportID = $this->testreport->create(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $this->loadModel('action')->create('testreport', $reportID, 'Opened'); if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $reportID)); - die(js::locate(inlink('view', "reportID=$reportID"), 'parent')); + return print(js::locate(inlink('view', "reportID=$reportID"), 'parent')); } if($objectType == 'testtask') @@ -195,7 +195,7 @@ class testreport extends control if($testTask->build == 'trunk') continue; $taskPairs[$testTask->id] = $testTask->name; } - if(empty($taskPairs)) die(js::alert($this->lang->testreport->noTestTask) . js::locate('back')); + if(empty($taskPairs)) return print(js::alert($this->lang->testreport->noTestTask) . js::locate('back')); if(empty($objectID)) { @@ -209,10 +209,10 @@ class testreport extends control if($this->app->tab == 'project') $this->project->setMenu($task->project); } - if(empty($objectID)) die(js::alert($this->lang->testreport->noObjectID) . js::locate('back')); + if(empty($objectID)) return print(js::alert($this->lang->testreport->noObjectID) . js::locate('back')); if($objectType == 'testtask') { - if($productID != $task->product) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($productID != $task->product) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $productIdList[$productID] = $productID; $begin = !empty($begin) ? date("Y-m-d", strtotime($begin)) : $task->begin; @@ -222,7 +222,7 @@ class testreport extends control if($task->build == 'trunk') { echo js::alert($this->lang->testreport->errorTrunk); - die(js::locate('back')); + return print(js::locate('back')); } else { @@ -246,7 +246,7 @@ class testreport extends control elseif($objectType == 'execution') { $executionID = $this->commonAction($objectID, $objectType); - if($executionID != $objectID) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($executionID != $objectID) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $execution = $this->execution->getById($executionID); $tasks = $this->testtask->getExecutionTasks($executionID); @@ -270,7 +270,7 @@ class testreport extends control if(count($productIdList) > 1) { echo(js::alert($this->lang->testreport->moreProduct)); - die(js::locate('back')); + return print(js::locate('back')); } if($this->app->tab == 'qa') @@ -355,14 +355,14 @@ class testreport extends control if($_POST) { $changes = $this->testreport->update($reportID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $files = $this->loadModel('file')->saveUpload('testreport', $reportID); $fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : ''; $actionID = $this->loadModel('action')->create('testreport', $reportID, 'Edited', $fileAction); if(!empty($changes)) $this->action->logHistory($actionID, $changes); - die(js::locate(inlink('view', "reportID=$reportID"), 'parent')); + return print(js::locate(inlink('view', "reportID=$reportID"), 'parent')); } $report = $this->testreport->getById($reportID); @@ -374,7 +374,7 @@ class testreport extends control { $product = $this->product->getById($report->product); $productID = $this->commonAction($report->product, 'product'); - if($productID != $report->product) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($productID != $report->product) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $browseLink = inlink('browse', "objectID=$productID&objectType=product"); $this->view->position[] = html::a($browseLink, $product->name); @@ -385,12 +385,12 @@ class testreport extends control if($this->app->tab == 'execution') { $objectID = $this->commonAction($report->execution, 'execution'); - if($objectID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($objectID != $report->execution) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); } else { $objectID = $this->commonAction($report->project, 'project'); - if($objectID != $report->project) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($objectID != $report->project) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); } $browseLink = inlink('browse', "objectID=$objectID&objectType=execution"); @@ -408,7 +408,7 @@ class testreport extends control if($task->build == 'trunk') { echo js::alert($this->lang->testreport->errorTrunk); - die(js::locate('back')); + return print(js::locate('back')); } else { @@ -483,7 +483,7 @@ class testreport extends control { $reportID = (int)$reportID; $report = $this->testreport->getById($reportID); - if(!$report) die(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); + if(!$report) return print(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index'))); $this->session->project = $report->project; $browseLink = ''; @@ -492,7 +492,7 @@ class testreport extends control { $product = $this->product->getById($report->product); $productID = $this->commonAction($report->product, 'product'); - if($productID != $report->product) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($productID != $report->product) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $browseLink = inlink('browse', "objectID=$productID&objectType=product"); $this->view->position[] = html::a($browseLink, $product->name); @@ -502,12 +502,12 @@ class testreport extends control if($this->app->tab == 'execution') { $objectID = $this->commonAction($report->execution, 'execution'); - if($objectID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($objectID != $report->execution) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); } else { $objectID = $this->commonAction($report->project, 'project'); - if($objectID != $report->project) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($objectID != $report->project) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); } $browseLink = inlink('browse', "objectID=$objectID&objectType=execution"); @@ -589,7 +589,7 @@ class testreport extends control { if($confirm == 'no') { - die(js::confirm($this->lang->testreport->confirmDelete, inlink('delete', "reportID=$reportID&confirm=yes"))); + return print(js::confirm($this->lang->testreport->confirmDelete, inlink('delete', "reportID=$reportID&confirm=yes"))); } else { @@ -597,7 +597,7 @@ class testreport extends control $locateLink = $this->session->reportList ? $this->session->reportList : inlink('browse', "productID={$testreport->product}"); $this->testreport->delete(TABLE_TESTREPORT, $reportID); - die(js::locate($locateLink, 'parent')); + return print(js::locate($locateLink, 'parent')); } } diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 3f9b6e4c6f..7d826b7982 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -32,7 +32,7 @@ class testsuite extends control parent::__construct($moduleName, $methodName); $this->view->products = $this->products = $this->loadModel('product')->getPairs(); - if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=testsuite"))); + if(empty($this->products) and !helper::isAjaxRequest()) return print($this->locate($this->createLink('product', 'showErrorNone', "moduleName=qa&activeMenu=testsuite"))); } /** @@ -158,8 +158,8 @@ class testsuite extends control /* Get test suite, and set menu. */ $suite = $this->testsuite->getById($suiteID, true); - if(!$suite) die(js::error($this->lang->notFound) . js::locate('back')); - if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if(!$suite) return print(js::error($this->lang->notFound) . js::locate('back')); + if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); /* Set product session. */ $productID = $this->product->saveState($suite->product, $this->products); @@ -229,7 +229,7 @@ class testsuite extends control return $this->send($response); } - if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); /* Set product session. */ $productID = $this->product->saveState($suite->product, $this->products); @@ -256,12 +256,12 @@ class testsuite extends control { if($confirm == 'no') { - die(js::confirm($this->lang->testsuite->confirmDelete, inlink('delete', "suiteID=$suiteID&confirm=yes"))); + return print(js::confirm($this->lang->testsuite->confirmDelete, inlink('delete', "suiteID=$suiteID&confirm=yes"))); } else { $suite = $this->testsuite->getById($suiteID); - if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back')); + if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) return print(js::error($this->lang->error->accessDenied) . js::locate('back')); $this->testsuite->delete($suiteID); @@ -282,7 +282,7 @@ class testsuite extends control } return $this->send($response); } - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -358,7 +358,7 @@ class testsuite extends control { if($confirm == 'no') { - die(js::confirm($this->lang->testsuite->confirmUnlinkCase, $this->createLink('testsuite', 'unlinkCase', "rowID=$rowID&confirm=yes"))); + return print(js::confirm($this->lang->testsuite->confirmUnlinkCase, $this->createLink('testsuite', 'unlinkCase', "rowID=$rowID&confirm=yes"))); } else { @@ -392,6 +392,6 @@ class testsuite extends control ->exec(); } - die(js::locate($this->createLink('testsuite', 'view', "suiteID=$suiteID"))); + return print(js::locate($this->createLink('testsuite', 'view', "suiteID=$suiteID"))); } } diff --git a/module/testsuite/lang/en.php b/module/testsuite/lang/en.php index 0b64a3e23d..3171bf426d 100644 --- a/module/testsuite/lang/en.php +++ b/module/testsuite/lang/en.php @@ -24,6 +24,7 @@ $lang->testsuite->deleted = 'Deleted'; $lang->testsuite->successSaved = 'Saved'; $lang->testsuite->id = 'ID'; +$lang->testsuite->pri = 'Priority'; $lang->testsuite->common = 'Test Suite'; $lang->testsuite->project = 'Project'; $lang->testsuite->product = $lang->productCommon; diff --git a/module/testsuite/lang/zh-cn.php b/module/testsuite/lang/zh-cn.php index 1103d4f9eb..349fe18e86 100644 --- a/module/testsuite/lang/zh-cn.php +++ b/module/testsuite/lang/zh-cn.php @@ -24,6 +24,7 @@ $lang->testsuite->deleted = '已删除'; $lang->testsuite->successSaved = '保存成功'; $lang->testsuite->id = '编号'; +$lang->testsuite->pri = '优先级'; $lang->testsuite->common = '套件'; $lang->testsuite->project = '所属项目'; $lang->testsuite->product = '所属' . $lang->productCommon; diff --git a/module/testsuite/view/linkcase.html.php b/module/testsuite/view/linkcase.html.php index 1324d49758..67dced905a 100644 --- a/module/testsuite/view/linkcase.html.php +++ b/module/testsuite/view/linkcase.html.php @@ -40,7 +40,7 @@ idAB;?> - + diff --git a/module/testsuite/view/view.html.php b/module/testsuite/view/view.html.php index 7c5c3d60d5..f4962e9033 100644 --- a/module/testsuite/view/view.html.php +++ b/module/testsuite/view/view.html.php @@ -60,7 +60,7 @@ idAB);?> - + diff --git a/module/testtask/view/groupcase.html.php b/module/testtask/view/groupcase.html.php index b5af67b4ab..852b74292a 100644 --- a/module/testtask/view/groupcase.html.php +++ b/module/testtask/view/groupcase.html.php @@ -26,7 +26,7 @@ - + diff --git a/module/testtask/view/linkcase.html.php b/module/testtask/view/linkcase.html.php index 4b58c7ff0f..f2a0a97316 100644 --- a/module/testtask/view/linkcase.html.php +++ b/module/testtask/view/linkcase.html.php @@ -84,7 +84,7 @@ idAB;?> - + diff --git a/module/testtask/view/unitgroup.html.php b/module/testtask/view/unitgroup.html.php index 9b4bed3164..b27448e517 100644 --- a/module/testtask/view/unitgroup.html.php +++ b/module/testtask/view/unitgroup.html.php @@ -15,7 +15,7 @@ - + diff --git a/module/todo/control.php b/module/todo/control.php index 4cfe437bfd..710789c8f4 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -46,7 +46,7 @@ class todo extends control if(!empty($_POST)) { $todoID = $this->todo->create($date, $account); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $this->loadModel('action')->create('todo', $todoID, 'opened'); $date = str_replace('-', '', $this->post->date); @@ -69,9 +69,9 @@ class todo extends control } if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $todoID)); - if($this->viewType == 'xhtml') die(js::locate($this->createLink('todo', 'view', "todoID=$todoID", 'html'), 'parent')); - if(isonlybody()) die(js::closeModal('parent.parent')); - die(js::locate($this->createLink('my', 'todo', "type=all&userID=&status=all&orderBy=id_desc"), 'parent')); + if($this->viewType == 'xhtml') return print(js::locate($this->createLink('todo', 'view', "todoID=$todoID", 'html'), 'parent')); + if(isonlybody()) return print(js::closeModal('parent.parent')); + return print(js::locate($this->createLink('my', 'todo', "type=all&userID=&status=all&orderBy=id_desc"), 'parent')); } unset($this->lang->todo->typeList['cycle']); @@ -97,7 +97,7 @@ class todo extends control if(!empty($_POST)) { $todoIDList = $this->todo->batchCreate(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); /* Locate the browser. */ $date = str_replace('-', '', $this->post->date); @@ -111,8 +111,8 @@ class todo extends control } if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $todoIDList)); - if(isonlybody())die(js::reload('parent.parent')); - die(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent')); + if(isonlybody()) return print(js::reload('parent.parent')); + return print(js::locate($this->createLink('my', 'todo', "type=$date"), 'parent')); } /* Set Custom*/ @@ -146,7 +146,7 @@ class todo extends control if(dao::isError()) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => dao::getError())); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } if($changes) { @@ -155,12 +155,12 @@ class todo extends control } if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - die(js::locate($this->session->todoList, 'parent.parent')); + return print(js::locate($this->session->todoList, 'parent.parent')); } /* Judge a private todo or not, If private, die. */ $todo = $this->todo->getById($todoID); - if($todo->private and $this->app->user->account != $todo->account) die('private'); + if($todo->private and $this->app->user->account != $todo->account) return print('private'); unset($this->lang->todo->typeList['cycle']); $todo->date = date("Y-m-d", strtotime($todo->date)); @@ -271,7 +271,7 @@ class todo extends control $this->action->logHistory($actionID, $changes); } - die(js::locate($this->session->todoList, 'parent')); + return print(js::locate($this->session->todoList, 'parent')); } } @@ -295,10 +295,11 @@ class todo extends control if($todo->type == 'task') $app = 'execution'; if($todo->type == 'story') $app = 'product'; $cancelURL = $this->server->HTTP_REFERER; - die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); + return print(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); } - if(isonlybody())die(js::reload('parent.parent')); - die(js::reload('parent')); + + if(isonlybody())return print(js::reload('parent.parent')); + echo js::reload('parent'); } /** @@ -313,8 +314,8 @@ class todo extends control $todo = $this->todo->getById($todoID); if($todo->status == 'done' or $todo->status == 'closed') $this->todo->activate($todoID); if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - if(isonlybody()) die(js::reload('parent.parent')); - die(js::reload('parent')); + if(isonlybody()) return print(js::reload('parent.parent')); + echo js::reload('parent'); } /** @@ -329,8 +330,8 @@ class todo extends control { $todo = $this->todo->getById($todoID); if($todo->status == 'done') $this->todo->close($todoID); - if(isonlybody()) die(js::reload('parent.parent')); - die(js::reload('parent')); + if(isonlybody()) return print(js::reload('parent.parent')); + echo js::reload('parent'); } /** @@ -345,10 +346,10 @@ class todo extends control { if(!empty($_POST)) { - if(empty($_POST['assignedTo'])) die(js::error($this->lang->todo->noAssignedTo)); + if(empty($_POST['assignedTo'])) return print(js::error($this->lang->todo->noAssignedTo)); $this->todo->assignTo($todoID); - if(dao::isError()) die(js::error(dao::getError())); - die(js::reload('parent.parent')); + if(dao::isError()) return print(js::error(dao::getError())); + return print(js::reload('parent.parent')); } $this->view->todo = $this->todo->getById($todoID); @@ -373,7 +374,7 @@ class todo extends control if(!$todo) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => '404 Not found')); - die(js::error($this->lang->notFound) . js::locate('back')); + return print(js::error($this->lang->notFound) . js::locate('back')); } /* Save the session. */ if(!isonlybody()) @@ -426,8 +427,7 @@ class todo extends control { if($confirm == 'no') { - echo js::confirm($this->lang->todo->confirmDelete, $this->createLink('todo', 'delete', "todoID=$todoID&confirm=yes")); - exit; + return print(js::confirm($this->lang->todo->confirmDelete, $this->createLink('todo', 'delete', "todoID=$todoID&confirm=yes"))); } else { @@ -450,10 +450,10 @@ class todo extends control } if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - if(isonlybody()) die(js::reload('parent.parent')); + if(isonlybody()) return print(js::reload('parent.parent')); $browseLink = $this->session->todoList ? $this->session->todoList : $this->createLink('my', 'todo'); - die(js::locate($browseLink, 'parent')); + return print(js::locate($browseLink, 'parent')); } } @@ -478,11 +478,11 @@ class todo extends control if($todo->type == 'story') $app = 'product'; $cancelURL = $this->server->HTTP_REFERER; if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'message' => sprintf($this->lang->todo->$confirmNote, $todo->idvalue), 'locate' => $confirmURL)); - die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); + return print(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); } if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - if(isonlybody())die(js::reload('parent.parent')); - die(js::reload('parent')); + if(isonlybody()) return print(js::reload('parent.parent')); + echo js::reload('parent'); } /** @@ -500,7 +500,7 @@ class todo extends control $todo = $this->todo->getById($todoID); if($todo->status != 'done' && $todo->status != 'closed') $this->todo->finish($todoID); } - die(js::reload('parent')); + return print(js::reload('parent')); } } @@ -521,7 +521,7 @@ class todo extends control } if(!empty($waitIdList)) echo js::alert(sprintf($this->lang->todo->unfinishedTodo, implode(',', $waitIdList))); - die(js::reload('parent')); + echo js::reload('parent'); } /** @@ -654,7 +654,7 @@ class todo extends control { $table = $objectType == 'project' ? TABLE_PROJECT : TABLE_PRODUCT; $field = $objectType == 'project' ? 'parent' : 'program'; - die($this->dao->select($field)->from($table)->where('id')->eq($objectID)->fetch($field)); + echo $this->dao->select($field)->from($table)->where('id')->eq($objectID)->fetch($field); } /** @@ -671,7 +671,7 @@ class todo extends control $executions = $this->loadModel('execution')->getByProject($projectID, 'undone'); foreach($executions as $id => $execution) $executions[$id] = $execution->name; - die(html::select('execution', $executions, '', "class='form-control chosen'")); + echo html::select('execution', $executions, '', "class='form-control chosen'"); } /** @@ -686,7 +686,7 @@ class todo extends control $this->session->set('project', $projectID); $products = $this->loadModel('product')->getProductPairsByProject($projectID); - die(html::select('bugProduct', $products, '', "class='form-control chosen'")); + echo html::select('bugProduct', $products, '', "class='form-control chosen'"); } /** diff --git a/module/todo/js/common.js b/module/todo/js/common.js index e2a16621bf..c1cd87d92c 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -49,6 +49,18 @@ function loadList(type, id) { $(divClass).html($(divID).html()); } + + if(nameBoxLabel) + { + if(type == 'custom') + { + $('#nameBoxLabel').text(nameBoxLabel.custom); + } + else + { + $('#nameBoxLabel').text(nameBoxLabel.idvalue); + } + } } function selectNext() diff --git a/module/todo/model.php b/module/todo/model.php index d842163c4e..f863864f26 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -187,7 +187,7 @@ class todoModel extends model if(isset($object->title)) $todo->name = $object->title; } - if($todo->end < $todo->begin) die(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); + if($todo->end < $todo->begin) return print(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); $validTodos[] = $todo; } @@ -209,7 +209,7 @@ class todoModel extends model if(dao::isError()) { echo js::error(dao::getError()); - die(js::reload('parent')); + return print(js::reload('parent')); } $todoID = $this->dao->lastInsertID(); $todoIDList[] = $todoID; @@ -335,7 +335,7 @@ class todoModel extends model { $todo->idvalue = isset($data->{$this->config->todo->objectList[$todo->type]}[$todoID]) ? $data->{$this->config->todo->objectList[$todo->type]}[$todoID] : 0; } - if($todo->end < $todo->begin) die(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); + if($todo->end < $todo->begin) return print(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); $todos[$todoID] = $todo; } @@ -368,7 +368,7 @@ class todoModel extends model } else { - die(js::error('todo#' . $todoID . dao::getError(true))); + return print(js::error('todo#' . $todoID . dao::getError(true))); } } } diff --git a/module/todo/view/create.html.php b/module/todo/view/create.html.php index 67edfa0e2b..c7d6e4d4d4 100644 --- a/module/todo/view/create.html.php +++ b/module/todo/view/create.html.php @@ -16,6 +16,7 @@ todo->noTodo);?> todo->moduleList)?> todo->getUserObjectsMethod)?> + $lang->todo->name, 'idvalue' => $lang->todo->idvalue));?>
    @@ -115,7 +116,7 @@
    - + - + diff --git a/module/user/view/story.html.php b/module/user/view/story.html.php index 7f478fb0ec..c19414a157 100644 --- a/module/user/view/story.html.php +++ b/module/user/view/story.html.php @@ -42,7 +42,7 @@ - + config->vision == 'lite'):?> diff --git a/module/user/view/task.html.php b/module/user/view/task.html.php index 1c6f51ab38..c52df556c1 100644 --- a/module/user/view/task.html.php +++ b/module/user/view/task.html.php @@ -42,7 +42,7 @@ - + diff --git a/module/user/view/testcase.html.php b/module/user/view/testcase.html.php index dbecfbcd54..9e3cb8914f 100755 --- a/module/user/view/testcase.html.php +++ b/module/user/view/testcase.html.php @@ -35,7 +35,7 @@ - + diff --git a/module/user/view/todo.html.php b/module/user/view/todo.html.php index 6abf82aebc..2fd685e39a 100644 --- a/module/user/view/todo.html.php +++ b/module/user/view/todo.html.php @@ -38,7 +38,7 @@ - + diff --git a/module/webhook/control.php b/module/webhook/control.php index d9e9c14268..1cef0ff5c0 100644 --- a/module/webhook/control.php +++ b/module/webhook/control.php @@ -181,16 +181,16 @@ class webhook extends control if($_POST) { $this->webhook->bind($id); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); - die(js::reload('parent')); + return print(js::reload('parent')); } $webhook = $this->webhook->getById($id); if($webhook->type != 'dinguser' && $webhook->type != 'wechatuser' && $webhook->type != 'feishuuser') { echo js::alert($this->lang->webhook->note->bind); - die(js::locate($this->createLink('webhook', 'browse'))); + return print(js::locate($this->createLink('webhook', 'browse'))); } $webhook->secret = json_decode($webhook->secret); @@ -226,11 +226,11 @@ class webhook extends control if($response['message'] == 'nodept') { echo js::error($this->lang->webhook->error->noDept); - die(js::locate($this->createLink('webhook', 'chooseDept', "id=$id"))); + return print(js::locate($this->createLink('webhook', 'chooseDept', "id=$id"))); } echo js::error($response['message']); - die(js::locate($this->createLink('webhook', 'browse'))); + return print(js::locate($this->createLink('webhook', 'browse'))); } $oauthUsers = $response['data']; @@ -278,7 +278,7 @@ class webhook extends control if($webhook->type != 'dinguser' && $webhook->type != 'wechatuser' && $webhook->type != 'feishuuser') { echo js::alert($this->lang->webhook->note->bind); - die(js::locate($this->createLink('webhook', 'browse'))); + return print(js::locate($this->createLink('webhook', 'browse'))); } $webhook->secret = json_decode($webhook->secret); @@ -299,7 +299,7 @@ class webhook extends control if($response['result'] == 'fail') { echo js::error($response['message']); - die(js::locate($this->createLink('webhook', 'browse'))); + return print(js::locate($this->createLink('webhook', 'browse'))); } if($response['result'] == 'selected') @@ -307,7 +307,7 @@ class webhook extends control $locateLink = $this->createLink('webhook', 'bind', "id={$id}"); $locateLink .= strpos($locateLink, '?') !== false ? '&' : '?'; $locateLink .= 'selectedDepts=' . join(',', $response['data']); - die(js::locate($locateLink)); + return print(js::locate($locateLink)); } $this->view->title = $this->lang->webhook->chooseDept; diff --git a/module/webhook/model.php b/module/webhook/model.php index 2d596eba17..e8638e0df5 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -640,7 +640,7 @@ class webhookModel extends model */ public function fetchHook($webhook, $sendData, $actionID = 0) { - if(!extension_loaded('curl')) die(helper::jsonEncode($this->lang->webhook->error->curl)); + if(!extension_loaded('curl')) return print(helper::jsonEncode($this->lang->webhook->error->curl)); if($webhook->type == 'dinguser' || $webhook->type == 'wechatuser' || $webhook->type == 'feishuuser') {
    kanbanspace->type;?>
    kanbanspace->name;?> name, "class='form-control'");?>
    kanbanspace->owner;?> owner, "class='form-control chosen'");?>kanbanspace->team;?>
    - team, "class='form-control chosen' multiple data-drop_direction='down'");?> + fetch('my', 'buildContactLists');?>
    whitelist;?> whitelist, 'class="form-control chosen" multiple');?> kanban->name;?>priAB;?>pri;?>>priAB;?> kanbancard->name;?> kanbancard->assignedTo;?> kanbancard->end;?> productplan->updateOrder);?> priAB);?>pri;?>>priAB);?> story->module);?> story->title);?> openedByAB);?> idAB);?> priAB);?>pri;?>> priAB);?> bug->title);?> openedByAB);?> bug->assignedToAB);?> idAB);?> priAB);?>pri;?>> priAB);?> task->name);?> task->finishedByAB);?> task->assignedToAB);?> priAB;?>pri;?>>priAB;?> bug->title;?> openedByAB;?> bug->assignedToAB;?> priAB;?>pri;?>>priAB;?> story->plan;?> story->module;?> story->title;?> priAB;?>pri;?>>priAB;?> task->name;?> task->finishedByAB;?> task->assignedToAB;?> priAB);?>task->pri;?>>priAB);?> my->name);?> story->product);?> openedByAB);?> priAB);?>my->pri;?>>priAB);?> my->name);?> story->product);?> story->plan);?> priAB);?>task->pri;?>>priAB);?> task->name);?> my->projects);?> priAB);?>testcase->pri;?>> priAB);?> testcase->title);?> testtask->common);?> todo->date);?> todo->type);?> > priAB);?> title=todo->pri;?>> priAB);?> todo->name);?> todo->assignedBy);?> todo->beginAB);?> priAB;?>priAB;?> bug->title;?> openedByAB;?> bug->assignedToAB;?> priAB;?>priAB;?> story->plan;?> story->module;?> story->title;?> idAB);?> priAB);?> priAB);?> story->title);?> statusAB);?> productplan->updateOrder);?> priAB);?> priAB);?> story->module);?> story->title);?> openedByAB);?> idAB);?> priAB);?> priAB);?> bug->title);?> bug->status);?> priAB);?>priAB);?> bug->title);?> openedByAB);?> bug->assignedToAB);?> bug->severityAB);?>priAB);?>project->pri;?>>priAB);?> bug->title);?> openedByAB);?> assignedToAB);?> priAB;?>priAB;?> bug->title;?> openedByAB;?> bug->resolvedBy;?> priAB;?>priAB;?> story->title;?> openedByAB;?> assignedToAB;?> priAB);?>priAB);?> story->title);?> openedByAB);?> story->estimateAB);?> priAB;?>pri;?>>priAB;?> bug->title;?> openedByAB;?> bug->resolvedBy;?> priAB;?>pri;?>>priAB;?> story->title;?> openedByAB;?> assignedToAB;?> priAB);?>pri;?>>priAB);?> story->title);?> openedByAB);?> story->estimateAB);?>story->title;?> '> story->estimateAB;?> story->category;?>'> priAB;?>' title=story->pri;?>> priAB;?> '> story->assignedTo;?> '> story->source;?> '> story->sourceNote;?>
    idAB;?> bug->title;?> priAB;?>story->pri;?>>priAB;?> bug->type;?> statusAB;?> bug->assignedTo;?>
    idAB;?> testcase->title;?> priAB;?>story->pri;?>>priAB;?> testcase->type;?> statusAB;?> testcase->lastRunner;?> priAB;?>story->pri;?>>priAB;?> story->title;?> story->status;?>
    idAB;?> task->name;?> priAB;?>story->pri;?>>priAB;?> statusAB;?> task->assignedToAB;?> task->estimateAB;?>
    story->id;?> priAB;?>story->pri;?>>priAB;?> story->title;?> story->assignedTo;?> story->estimate;?> priAB);?>story->pri;?>>priAB);?> story->title);?> story->planAB);?> story->source);?>
    idAB;?> bug->title;?> priAB;?>pri;?>>priAB;?> bug->type;?> statusAB;?> bug->assignedTo;?> idAB;?> priAB;?>testcase->pri;?>> priAB;?> testcase->title;?> typeAB;?> testtask->lastRunAccount;?>testcase->branch ?> priAB);?> testcase->title);?>pri;?>>priAB);?>testcase->title);?> testcase->fromModule ?> testcase->module ?> testcase->type)?> priAB;?>pri;?>>priAB;?> testcase->product;?> testcase->title;?> testcase->type;?> testsuite->linkVersion;?>priAB;?>pri;?>>priAB;?> testcase->title;?> testcase->type;?> openedByAB;?> priAB);?>testsuite->pri;?>>priAB);?> testcase->module);?> testcase->title);?> testcase->type);?> idAB;?> priAB;?>priAB;?> testcase->title;?> typeAB;?> testtask->assignedTo;?> testtask->linkVersion;?>priAB;?>priAB;?> testcase->title;?> testcase->type;?> openedByAB;?> idAB;?> priAB;?> priAB;?> testcase->title;?> testtask->lastRunAccount;?> testtask->lastRunTime;?>todo->typeList, '', 'onchange="loadList(this.value);" class="form-control"');?>
    todo->name;?>todo->name;?>
    diff --git a/module/todo/view/edit.html.php b/module/todo/view/edit.html.php index 86fd440a79..8d8993222d 100644 --- a/module/todo/view/edit.html.php +++ b/module/todo/view/edit.html.php @@ -16,6 +16,7 @@ todo->moduleList)?> todo->getUserObjectsMethod)?> idvalue);?> + $lang->todo->name, 'idvalue' => $lang->todo->idvalue));?> @@ -127,7 +128,7 @@
    - +
    diff --git a/module/tree/control.php b/module/tree/control.php index 8fb10b00d0..878886378a 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -339,7 +339,7 @@ class tree extends control $childs = $this->tree->getAllChildId($moduleID); foreach($childs as $childModuleID) unset($this->view->optionMenu[$childModuleID]); - die($this->display()); + $this->display(); } /** @@ -353,7 +353,7 @@ class tree extends control public function fix($root, $type) { $this->tree->fixModulePath($root, $type); - die(js::alert($this->lang->tree->successFixed) . js::reload('parent')); + echo js::alert($this->lang->tree->successFixed) . js::reload('parent'); } /** @@ -417,7 +417,7 @@ class tree extends control else { $result = $this->tree->delete($moduleID); - if(!$result) die(); + if(!$result) return; die(js::reload('parent')); } @@ -543,7 +543,7 @@ class tree extends control $moduleName = $viewType == 'bug' ? "modules[$number]" : "module[$number]"; $modules = empty($modules) ? array('' => '') : $modules; - die(html::select($moduleName, $modules, $currentModuleID, 'class=form-control')); + echo html::select($moduleName, $modules, $currentModuleID, 'class=form-control'); } /** @@ -563,6 +563,6 @@ class tree extends control ->andWhere('type')->eq($type) ->andWhere('deleted')->eq(0) ->fetchAll('id'); - die(json_encode($modules)); + echo json_encode($modules); } } diff --git a/module/tree/model.php b/module/tree/model.php index f904af3b41..b8d9e1b586 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1565,7 +1565,7 @@ class treeModel extends model foreach($childs as $moduleID => $moduleName) { - if(preg_match('/(^\s+$)/', $moduleName)) die(js::alert($this->lang->tree->shouldNotBlank)); + if(preg_match('/(^\s+$)/', $moduleName)) return print(js::alert($this->lang->tree->shouldNotBlank)); } $module = new stdClass(); @@ -1573,7 +1573,7 @@ class treeModel extends model $module->type = $type; $module->parent = $parentModuleID; $repeatName = $this->checkUnique($module, $childs); - if($repeatName) die(js::alert(sprintf($this->lang->tree->repeatName, $repeatName))); + if($repeatName) return print(js::alert(sprintf($this->lang->tree->repeatName, $repeatName))); $parentModule = $this->getByID($parentModuleID); @@ -1651,7 +1651,7 @@ class treeModel extends model if(!isset($_POST['branch'])) $module->branch = $self->branch; $repeatName = $this->checkUnique($self, array("id{$self->id}" => $module->name), array("id{$self->id}" => $module->branch)); - if($repeatName) die(js::alert(sprintf($this->lang->tree->repeatName, $repeatName))); + if($repeatName) return print(js::alert(sprintf($this->lang->tree->repeatName, $repeatName))); $parent = $this->getById($this->post->parent); $childs = $this->getAllChildId($moduleID); diff --git a/module/tutorial/control.php b/module/tutorial/control.php index 91e1e8dde3..f09b4f00f4 100644 --- a/module/tutorial/control.php +++ b/module/tutorial/control.php @@ -73,7 +73,7 @@ class tutorial extends control $this->session->set('tutorialMode', false); $this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', 0); if(empty($referer)) $referer = helper::safe64Encode(helper::createLink('my', 'index', '', 'html')); - die(js::locate(helper::safe64Decode($referer), 'parent')); + echo js::locate(helper::safe64Decode($referer), 'parent'); } /** @@ -86,7 +86,7 @@ class tutorial extends control { $this->session->set('tutorialMode', false); $this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', 0); - die(json_encode(array('result' => 'success'))); + echo json_encode(array('result' => 'success')); } /** @@ -118,7 +118,7 @@ class tutorial extends control } } if(!$hasPriv and $module == 'my' and $method == 'index') $hasPriv = true; - if(!$hasPriv) die(js::locate('back')); + if(!$hasPriv) return print(js::locate('back')); $params = helper::safe64Decode($params); if($_POST) @@ -127,9 +127,9 @@ class tutorial extends control if(($module == 'story' or $module == 'task' or $module == 'bug') and $method == 'create') $target = 'self'; if($module == 'execution' and $method == 'linkStory') $target = 'self'; if($module == 'execution' and $method == 'managemembers') $target = 'self'; - die(js::locate(helper::createLink('tutorial', 'wizard', "module=$module&method=$method¶ms=" . helper::safe64Encode($params)), $target)); + return print(js::locate(helper::createLink('tutorial', 'wizard', "module=$module&method=$method¶ms=" . helper::safe64Encode($params)), $target)); } - die($this->fetch($module, $method, $params)); + echo $this->fetch($module, $method, $params); } /** @@ -144,7 +144,7 @@ class tutorial extends control public function ajaxSaveNovice($novice = 'true', $reload = 'false') { $this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', $novice == true ? 1 : 0); - if($reload == 'true') die(js::reload('parent')); + if($reload == 'true') return print(js::reload('parent')); } /** diff --git a/module/upgrade/config.php b/module/upgrade/config.php index 3f1b722dc8..bf1b7baff3 100644 --- a/module/upgrade/config.php +++ b/module/upgrade/config.php @@ -1,4 +1,171 @@ maxVersion = array(); +$config->maxVersion['max2_0_rc1'] = '15_0_rc3'; +$config->maxVersion['max2_0'] = '15_0'; +$config->maxVersion['max2_1'] = '15_3'; +$config->maxVersion['max2_2'] = '15_5'; +$config->maxVersion['max2_3'] = '15_7'; +$config->maxVersion['max2_3_1'] = '15_7_1'; +$config->maxVersion['max2_4_beta1'] = '16_0_beta1'; +$config->maxVersion['max2_4'] = '16_0'; +$config->maxVersion['max2_5'] = '16_1'; +$config->maxVersion['max2_6'] = '16_2'; +$config->maxVersion['max2_7'] = '16_3'; +$config->maxVersion['max2_8'] = '16_4'; + +$config->bizVersion = array(); +$config->bizVersion['biz1_0'] = '9_5_1'; +$config->bizVersion['biz1_1'] = '9_6_3'; +$config->bizVersion['biz1_1_1'] = '9_8'; +$config->bizVersion['biz1_1_2'] = '9_8_1'; +$config->bizVersion['biz1_1_3'] = '9_8_2'; +$config->bizVersion['biz1_1_4'] = '9_8_3'; +$config->bizVersion['biz2_0_beta'] = '10_0'; +$config->bizVersion['biz2_1'] = '10_3'; +$config->bizVersion['biz2_2'] = '10_4'; +$config->bizVersion['biz2_3'] = '10_5'; +$config->bizVersion['biz2_3_1'] = '10_6'; +$config->bizVersion['biz2_4'] = '10_6'; +$config->bizVersion['biz3_0'] = '11_1'; +$config->bizVersion['biz3_1'] = '11_2'; +$config->bizVersion['biz3_2'] = '11_3'; +$config->bizVersion['biz3_2_1'] = '11_4_1'; +$config->bizVersion['biz3_3'] = '11_5'; +$config->bizVersion['biz3_4'] = '11_6'; +$config->bizVersion['biz3_5_alpha'] = '11_6'; +$config->bizVersion['biz3_5_beta'] = '11_6_1'; +$config->bizVersion['biz3_5'] = '11_6_5'; +$config->bizVersion['biz3_5_1'] = '11_7'; +$config->bizVersion['biz3_6'] = '12_0'; +$config->bizVersion['biz3_6_1'] = '12_0_1'; +$config->bizVersion['biz3_7'] = '12_2'; +$config->bizVersion['biz3_7_1'] = '12_3_2'; +$config->bizVersion['biz3_7_2'] = '12_3_3'; +$config->bizVersion['biz4_0'] = '12_4'; +$config->bizVersion['biz4_0_1'] = '12_4_1'; +$config->bizVersion['biz4_0_2'] = '12_4_2'; +$config->bizVersion['biz4_0_3'] = '12_4_3'; +$config->bizVersion['biz4_0_4'] = '12_4_4'; +$config->bizVersion['biz4_1'] = '12_5'; +$config->bizVersion['biz4_1_1'] = '12_5_1'; +$config->bizVersion['biz4_1_2'] = '12_5_2'; +$config->bizVersion['biz4_1_3'] = '12_5_3'; +$config->bizVersion['biz5_0_rc1'] = '15_0_rc3'; +$config->bizVersion['biz5_0'] = '15_0'; +$config->bizVersion['biz5_0_1'] = '15_0_3'; +$config->bizVersion['biz5_1'] = '15_3'; +$config->bizVersion['biz5_2'] = '15_5'; +$config->bizVersion['biz5_3'] = '15_7'; +$config->bizVersion['biz5_3_1'] = '15_7_1'; +$config->bizVersion['biz6_0_beta1'] = '16_0_beta1'; +$config->bizVersion['biz6_0'] = '16_0'; +$config->bizVersion['biz6_1'] = '16_1'; +$config->bizVersion['biz6_2'] = '16_2'; +$config->bizVersion['biz6_3'] = '16_3'; +$config->bizVersion['biz6_4'] = '16_4'; + +$config->proVersion = array(); +$config->proVersion['pro1_0'] = '3_1'; +$config->proVersion['pro1_1'] = '3_2'; +$config->proVersion['pro1_1_1'] = '3_2_1'; +$config->proVersion['pro1_2'] = '3_3'; +$config->proVersion['pro1_3'] = '3_3'; +$config->proVersion['pro2_0'] = '4_0'; +$config->proVersion['pro2_0_1'] = '4_0_1'; +$config->proVersion['pro2_1'] = '4_1'; +$config->proVersion['pro2_2_beta'] = '4_2_beta'; +$config->proVersion['pro2_3_beta'] = '4_3_beta'; +$config->proVersion['pro3_0_beta1'] = '5_0_beta1'; +$config->proVersion['pro3_0_beta1'] = '5_0_beta2'; +$config->proVersion['pro3_0'] = '5_0'; +$config->proVersion['pro3_1'] = '5_1'; +$config->proVersion['pro3_2'] = '5_2'; +$config->proVersion['pro3_2_1'] = '5_2_1'; +$config->proVersion['pro3_3'] = '5_3'; +$config->proVersion['pro4_0_beta1'] = '6_0'; +$config->proVersion['pro4_0'] = '6_1'; +$config->proVersion['pro4_1_beta'] = '6_2'; +$config->proVersion['pro4_2'] = '6_3'; +$config->proVersion['pro4_3'] = '6_3'; +$config->proVersion['pro4_4'] = '7_0'; +$config->proVersion['pro4_5'] = '7_1'; +$config->proVersion['pro4_6'] = '7_2_4'; +$config->proVersion['pro4_7'] = '7_2_5'; +$config->proVersion['pro4_7_1'] = '7_3'; +$config->proVersion['pro5_0'] = '8_0'; +$config->proVersion['pro5_0_1'] = '8_0_1'; +$config->proVersion['pro5_1'] = '8_1'; +$config->proVersion['pro5_1_3'] = '8_1_3'; +$config->proVersion['pro5_2'] = '8_2'; +$config->proVersion['pro5_2_1'] = '8_2_1'; +$config->proVersion['pro5_3'] = '8_2_3'; +$config->proVersion['pro5_3_1'] = '8_2_4'; +$config->proVersion['pro5_3_2'] = '8_2_5'; +$config->proVersion['pro5_3_3'] = '8_2_6'; +$config->proVersion['pro5_4'] = '8_3'; +$config->proVersion['pro5_4_1'] = '8_3_1'; +$config->proVersion['pro5_5'] = '8_4'; +$config->proVersion['pro5_5_1'] = '8_4_1'; +$config->proVersion['pro6_0_beta'] = '9_0_beta'; +$config->proVersion['pro6_0'] = '9_0'; +$config->proVersion['pro6_0_1'] = '9_0_1'; +$config->proVersion['pro6_1'] = '9_1'; +$config->proVersion['pro6_2'] = '9_1_2'; +$config->proVersion['pro6_3'] = '9_2'; +$config->proVersion['pro6_3_1'] = '9_2_1'; +$config->proVersion['pro6_4'] = '9_4'; +$config->proVersion['pro6_5'] = '9_5'; +$config->proVersion['pro6_5_1'] = '9_5_1'; +$config->proVersion['pro6_6'] = '9_6_3'; +$config->proVersion['pro6_6_1'] = '9_7'; +$config->proVersion['pro6_7'] = '9_8'; +$config->proVersion['pro6_7_1'] = '9_8_1'; +$config->proVersion['pro6_7_2'] = '9_8_2'; +$config->proVersion['pro6_7_3'] = '9_8_3'; +$config->proVersion['pro7_0_beta'] = '10_0'; +$config->proVersion['pro7_1'] = '10_1'; +$config->proVersion['pro7_2'] = '10_3'; +$config->proVersion['pro7_3'] = '10_4'; +$config->proVersion['pro7_4'] = '10_5'; +$config->proVersion['pro7_5'] = '10_5_1'; +$config->proVersion['pro7_5_1'] = '10_6'; +$config->proVersion['pro8_0'] = '11_1'; +$config->proVersion['pro8_1'] = '11_2'; +$config->proVersion['pro8_2'] = '11_3'; +$config->proVersion['pro8_3'] = '11_4_1'; +$config->proVersion['pro8_3_1'] = '11_4_1'; +$config->proVersion['pro8_4'] = '11_5'; +$config->proVersion['pro8_5'] = '11_6'; +$config->proVersion['pro8_5_1'] = '11_6_1'; +$config->proVersion['pro8_5_2'] = '11_6_3'; +$config->proVersion['pro8_5_3'] = '11_6_5'; +$config->proVersion['pro8_6'] = '11_7'; +$config->proVersion['pro8_7'] = '12_0'; +$config->proVersion['pro8_7_1'] = '12_0_1'; +$config->proVersion['pro8_8'] = '12_2'; +$config->proVersion['pro8_8_1'] = '12_3_1'; +$config->proVersion['pro8_8_2'] = '12_3_2'; +$config->proVersion['pro8_8_3'] = '12_3_3'; +$config->proVersion['pro8_9'] = '12_4'; +$config->proVersion['pro8_9_1'] = '12_4_1'; +$config->proVersion['pro8_9_2'] = '12_4_2'; +$config->proVersion['pro8_9_3'] = '12_4_3'; +$config->proVersion['pro8_9_4'] = '12_4_4'; +$config->proVersion['pro9_0'] = '12_5'; +$config->proVersion['pro9_0_1'] = '12_5_1'; +$config->proVersion['pro9_0_2'] = '12_5_2'; +$config->proVersion['pro9_0_3'] = '12_5_3'; +$config->proVersion['pro10_0_rc1'] = '15_0_rc3'; +$config->proVersion['pro10_0'] = '15_0'; +$config->proVersion['pro10_0_1'] = '15_0_2'; +$config->proVersion['pro10_0_2'] = '15_0_3'; +$config->proVersion['pro10_1'] = '15_3'; +$config->proVersion['pro10_2'] = '15_5'; +$config->proVersion['pro10_3'] = '15_7'; +$config->proVersion['pro10_3_1'] = '15_7_1'; +$config->proVersion['pro11_0_beta1'] = '16_0_beta1'; +$config->proVersion['pro11_0'] = '16_0'; + $config->upgrade = new stdclass(); $config->upgrade->lowerTables = array(); $config->upgrade->lowerTables[$config->db->prefix . 'caseStep'] = $config->db->prefix . 'casestep'; @@ -50,3 +217,5 @@ $config->upgrade->discardedBugTypes['zh-tw']['trackthings'] = '事務跟蹤'; $config->delete['10.6'][] = 'module/chat/ext/control/extensions.php'; $config->delete['12.4.2'][] = 'www/js/ueditor'; + +$config->upgrade->PMSModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dept', 'design', 'dev', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'owt', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectrelease', 'projectstory', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation'); diff --git a/module/upgrade/control.php b/module/upgrade/control.php index fc29abaa09..8ac8473571 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -127,7 +127,7 @@ class upgrade extends control $this->view->result = 'fail'; $this->view->errors = $result; - die($this->display()); + return $this->display(); } $fromVersion = isset($_POST['fromVersion']) ? $this->post->fromVersion : $fromVersion; @@ -265,7 +265,7 @@ class upgrade extends control /* Create Program. */ list($programID, $projectList, $lineID) = $this->upgrade->createProgram($linkedProducts, $linkedSprints); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); /* Process merged products and projects. */ if($_POST['projectType'] == 'execution') @@ -317,7 +317,7 @@ class upgrade extends control /* Create Program. */ list($programID, $projectList, $lineID) = $this->upgrade->createProgram($linkedProducts, $linkedSprints); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); /* Process productline. */ $this->dao->delete()->from(TABLE_MODULE)->where('`root`')->eq(0)->andWhere('`type`')->eq('line')->exec(); @@ -347,7 +347,7 @@ class upgrade extends control /* Create Program. */ list($programID, $projectList, $lineID) = $this->upgrade->createProgram(array(), $linkedSprints); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($_POST['projectType'] == 'execution') { @@ -369,7 +369,7 @@ class upgrade extends control /* Create Program. */ list($programID, $projectList, $lineID) = $this->upgrade->createProgram(array(), $linkedSprints); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($_POST['projectType'] == 'execution') { @@ -401,7 +401,7 @@ class upgrade extends control } } - die(js::locate($this->createLink('upgrade', 'mergeProgram', "type=$type&programID=$programID&projectType=$projectType"), 'parent')); + return print(js::locate($this->createLink('upgrade', 'mergeProgram', "type=$type&programID=$programID&projectType=$projectType"), 'parent')); } /* Get no merged product and project count. */ @@ -423,7 +423,7 @@ class upgrade extends control /* Update sprints history. */ $sprints = $this->dao->select('id')->from(TABLE_PROJECT)->where('type')->eq('sprint')->fetchAll('id'); $this->dao->update(TABLE_ACTION)->set('objectType')->eq('execution')->where('objectID')->in(array_keys($sprints))->andWhere('objectType')->eq('project')->exec(); - die(js::locate($this->createLink('upgrade', 'mergeRepo'))); + return print(js::locate($this->createLink('upgrade', 'mergeRepo'))); } $this->view->noMergedProductCount = $noMergedProductCount; @@ -622,7 +622,7 @@ class upgrade extends control $this->dao->update(TABLE_PROJECT)->set('name')->eq($projectName)->where('id')->eq($projectID)->exec(); } - die(js::closeModal('parent.parent', '')); + return print(js::closeModal('parent.parent', '')); } $objectGroup = array(); @@ -649,7 +649,7 @@ class upgrade extends control if($_POST) { $this->upgrade->mergeRepo(); - die(js::locate($this->createLink('upgrade', 'mergeRepo'), 'parent')); + return print(js::locate($this->createLink('upgrade', 'mergeRepo'), 'parent')); } $repoes = $this->dao->select('id, name')->from(TABLE_REPO)->where('deleted')->eq(0)->andWhere('product')->eq('')->fetchPairs(); @@ -659,7 +659,7 @@ class upgrade extends control $this->dao->delete()->from(TABLE_BLOCK)->exec(); $this->dao->delete()->from(TABLE_CONFIG)->where('`key`')->eq('blockInited')->exec(); $this->loadModel('setting')->deleteItems('owner=system&module=common§ion=global&key=upgradeStep'); - die(js::locate($this->createLink('upgrade', 'afterExec', "fromVersion=&processed=no"))); + return print(js::locate($this->createLink('upgrade', 'afterExec', "fromVersion=&processed=no"))); } $this->view->title = $this->lang->upgrade->mergeRepo; @@ -680,7 +680,7 @@ class upgrade extends control public function ajaxGetProjectPairsByProgram($programID = 0) { $projects = array('' => '') + $this->upgrade->getProjectPairsByProgram($programID); - die(html::select('projects', $projects, '', 'class="form-control prj-exist" onchange="getProgramStatus(\'project\', this.value)"')); + echo html::select('projects', $projects, '', 'class="form-control prj-exist" onchange="getProgramStatus(\'project\', this.value)"'); } /** @@ -694,7 +694,7 @@ class upgrade extends control { $lines = array('' => ''); if((int)$programID) $lines += $this->loadModel('product')->getLinePairs($programID); - die(html::select('lines', $lines, '', 'class="form-control line-exist"')); + echo html::select('lines', $lines, '', 'class="form-control line-exist"'); } /** @@ -712,7 +712,7 @@ class upgrade extends control { $this->view->title = $this->lang->upgrade->consistency; $this->view->alterSQL = $alterSQL; - die($this->display('upgrade', 'consistency')); + return print($this->display('upgrade', 'consistency')); } unset($_SESSION['user']); @@ -837,7 +837,7 @@ class upgrade extends control $response['nextType'] = $result['type']; $response['message'] = zget($this->lang->searchObjects, $result['type']) . " 0"; } - die(json_encode($response)); + echo json_encode($response); } /** @@ -849,7 +849,7 @@ class upgrade extends control */ public function ajaxGetProductName($productID) { - die($this->dao->findByID($productID)->from(TABLE_PRODUCT)->fetch('name')); + echo $this->dao->findByID($productID)->from(TABLE_PRODUCT)->fetch('name'); } /** @@ -861,6 +861,20 @@ class upgrade extends control */ public function ajaxGetProgramStatus($programID) { - die($this->dao->select('status')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch('status')); + echo $this->dao->select('status')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch('status'); + } + + /** + * Move Extent files. + * + * @access public + * @return void + */ + public function moveEXTFiles() + { + if(!empty($_POST)) $this->upgrade->moveEXTFiles(); + + $this->view->files = $this->upgrade->getEXTFiles(); + $this->display(); } } diff --git a/module/upgrade/css/moveextfiles.css b/module/upgrade/css/moveextfiles.css new file mode 100644 index 0000000000..8c1e7088ce --- /dev/null +++ b/module/upgrade/css/moveextfiles.css @@ -0,0 +1,7 @@ +.modal-dialog {margin-top: 5px;} +.modal-body {overflow-y: scroll;} +@media screen and (max-width: 1920px) {.modal-body {height:550px}} +@media screen and (max-width: 1366px) {.modal-body {height:450px}} + +.modal-body .panel-heading {padding: 0px;} +.modal-body #collapseOne {margin-left: 20px;} diff --git a/module/upgrade/js/moveextfiles.js b/module/upgrade/js/moveextfiles.js new file mode 100644 index 0000000000..13c70891a2 --- /dev/null +++ b/module/upgrade/js/moveextfiles.js @@ -0,0 +1,28 @@ +$('#checkAll').click(function() +{ + if($(this).is(':checked')) + { + $("[name^='files']").prop('checked', true); + } + else + { + $("[name^='files']").prop('checked', false); + } +}) + +$("[name^='files']").click(function() +{ + if($(this).is(':checked')) + { + var checked = true; + $("[name^='files']").each(function() + { + if(!$(this).is(':checked')) checked = false; + }); + $('#checkAll').prop('checked', checked); + } + else + { + $('#checkAll').prop('checked', false); + } +}) diff --git a/module/upgrade/lang/en.php b/module/upgrade/lang/en.php index 42d691c634..f94fa42bfa 100644 --- a/module/upgrade/lang/en.php +++ b/module/upgrade/lang/en.php @@ -96,23 +96,26 @@ $lang->upgrade->to15Mode['new'] = 'Use the program mode'; $lang->upgrade->selectedModeTips['classic'] = 'You can also switch to the Program mode in the Admin-Custom-Custom later.'; $lang->upgrade->selectedModeTips['new'] = 'Switching to the program management mode requires merging the previous data, and the system will guide you to complete this operation.'; -$lang->upgrade->line = 'Product Line'; -$lang->upgrade->allLines = "All Product Lines"; -$lang->upgrade->program = 'Merge Project'; -$lang->upgrade->existProgram = 'Existing programs'; -$lang->upgrade->existProject = 'Existing projects'; -$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines'; -$lang->upgrade->product = $lang->productCommon; -$lang->upgrade->project = 'Iteration'; -$lang->upgrade->repo = 'Repo'; -$lang->upgrade->mergeRepo = 'Merge Repo'; -$lang->upgrade->setProgram = 'Set the project to which the program belongs'; -$lang->upgrade->dataMethod = 'Data migration method'; -$lang->upgrade->begin = 'Begin Date'; -$lang->upgrade->end = 'End Date'; -$lang->upgrade->selectProject = 'The target project'; -$lang->upgrade->programName = 'Program Name'; -$lang->upgrade->projectName = 'Project Name'; +$lang->upgrade->line = 'Product Line'; +$lang->upgrade->allLines = "All Product Lines"; +$lang->upgrade->program = 'Merge Project'; +$lang->upgrade->existProgram = 'Existing programs'; +$lang->upgrade->existProject = 'Existing projects'; +$lang->upgrade->existLine = 'Existing' . $lang->productCommon . ' lines'; +$lang->upgrade->product = $lang->productCommon; +$lang->upgrade->project = 'Iteration'; +$lang->upgrade->repo = 'Repo'; +$lang->upgrade->mergeRepo = 'Merge Repo'; +$lang->upgrade->setProgram = 'Set the project to which the program belongs'; +$lang->upgrade->dataMethod = 'Data migration method'; +$lang->upgrade->begin = 'Begin Date'; +$lang->upgrade->end = 'End Date'; +$lang->upgrade->selectProject = 'The target project'; +$lang->upgrade->programName = 'Program Name'; +$lang->upgrade->projectName = 'Project Name'; +$lang->upgrade->moveEXTFiles = 'Migrate Expansion Files'; +$lang->upgrade->fileName = 'File Name'; +$lang->upgrade->viewChargeFile = 'View Charge Version Files'; $lang->upgrade->newProgram = 'Create'; $lang->upgrade->editedName = 'New Name'; diff --git a/module/upgrade/lang/version.php b/module/upgrade/lang/version.php index 2a6a6a4447..182d920f4c 100644 --- a/module/upgrade/lang/version.php +++ b/module/upgrade/lang/version.php @@ -1,4 +1,5 @@ upgrade->fromVersions['0_3beta'] = '0.3 BETA'; $lang->upgrade->fromVersions['0_4beta'] = '0.4 BETA'; $lang->upgrade->fromVersions['0_5beta'] = '0.5 BETA'; @@ -152,3 +153,170 @@ $lang->upgrade->fromVersions['16_0'] = '16.0'; $lang->upgrade->fromVersions['16_1'] = '16.1'; $lang->upgrade->fromVersions['16_2'] = '16.2'; $lang->upgrade->fromVersions['16_3'] = '16.3'; +$lang->upgrade->fromVersions['16_4'] = '16.4'; + +/* Pro. */ +$lang->upgrade->fromVersions['pro1_0'] = 'Pro1.0'; +$lang->upgrade->fromVersions['pro1_1'] = 'Pro1.1'; +$lang->upgrade->fromVersions['pro1_1_1'] = 'Pro1.1.1'; +$lang->upgrade->fromVersions['pro1_2'] = 'Pro1.2'; +$lang->upgrade->fromVersions['pro1_3'] = 'Pro1.3'; +$lang->upgrade->fromVersions['pro2_0'] = 'Pro2.0'; +$lang->upgrade->fromVersions['pro2_0_1'] = 'Pro2.0.1'; +$lang->upgrade->fromVersions['pro2_1'] = 'Pro2.1'; +$lang->upgrade->fromVersions['pro2_2_beta'] = 'Pro2.2.beta'; +$lang->upgrade->fromVersions['pro2_3_beta'] = 'Pro2.3.beta'; +$lang->upgrade->fromVersions['pro3_0_beta1'] = 'Pro3.0.beta1'; +$lang->upgrade->fromVersions['pro3_0'] = 'Pro3.0'; +$lang->upgrade->fromVersions['pro3_1'] = 'Pro3.1'; +$lang->upgrade->fromVersions['pro3_2'] = 'Pro3.2'; +$lang->upgrade->fromVersions['pro3_2_1'] = 'Pro3.2.1'; +$lang->upgrade->fromVersions['pro3_3'] = 'Pro3.3'; +$lang->upgrade->fromVersions['pro4_0_beta1'] = 'Pro4.0.beta1'; +$lang->upgrade->fromVersions['pro4_0'] = 'Pro4.0'; +$lang->upgrade->fromVersions['pro4_1_beta'] = 'Pro4.1.beta'; +$lang->upgrade->fromVersions['pro4_2'] = 'Pro4.2'; +$lang->upgrade->fromVersions['pro4_3'] = 'Pro4.3'; +$lang->upgrade->fromVersions['pro4_4'] = 'Pro4.4'; +$lang->upgrade->fromVersions['pro4_5'] = 'Pro4.5'; +$lang->upgrade->fromVersions['pro4_6'] = 'Pro4.6'; +$lang->upgrade->fromVersions['pro4_7'] = 'Pro4.7'; +$lang->upgrade->fromVersions['pro4_7_1'] = 'Pro4.7.1'; +$lang->upgrade->fromVersions['pro5_0'] = 'Pro5.0'; +$lang->upgrade->fromVersions['pro5_0_1'] = 'Pro5.0.1'; +$lang->upgrade->fromVersions['pro5_1'] = 'Pro5.1'; +$lang->upgrade->fromVersions['pro5_1_3'] = 'Pro5.1.3'; +$lang->upgrade->fromVersions['pro5_2'] = 'Pro5.2'; +$lang->upgrade->fromVersions['pro5_2_1'] = 'Pro5.2.1'; +$lang->upgrade->fromVersions['pro5_3'] = 'Pro5.3'; +$lang->upgrade->fromVersions['pro5_3_1'] = 'Pro5.3.1'; +$lang->upgrade->fromVersions['pro5_3_2'] = 'Pro5.3.2'; +$lang->upgrade->fromVersions['pro5_3_3'] = 'Pro5.3.3'; +$lang->upgrade->fromVersions['pro5_4'] = 'Pro5.4'; +$lang->upgrade->fromVersions['pro5_4_1'] = 'Pro5.4.1'; +$lang->upgrade->fromVersions['pro5_5'] = 'Pro5.5'; +$lang->upgrade->fromVersions['pro5_5_1'] = 'Pro5.5.1'; +$lang->upgrade->fromVersions['pro6_0_beta'] = 'Pro6.0.beta'; +$lang->upgrade->fromVersions['pro6_0'] = 'Pro6.0'; +$lang->upgrade->fromVersions['pro6_0_1'] = 'Pro6.0.1'; +$lang->upgrade->fromVersions['pro6_1'] = 'Pro6.1'; +$lang->upgrade->fromVersions['pro6_2'] = 'Pro6.2'; +$lang->upgrade->fromVersions['pro6_3'] = 'Pro6.3'; +$lang->upgrade->fromVersions['pro6_3_1'] = 'Pro6.3.1'; +$lang->upgrade->fromVersions['pro6_4'] = 'Pro6.4'; +$lang->upgrade->fromVersions['pro6_5'] = 'Pro6.5'; +$lang->upgrade->fromVersions['pro6_5_1'] = 'Pro6.5.1'; +$lang->upgrade->fromVersions['pro6_6'] = 'Pro6.6'; +$lang->upgrade->fromVersions['pro6_6_1'] = 'Pro6.6.1'; +$lang->upgrade->fromVersions['pro6_7'] = 'Pro6.7'; +$lang->upgrade->fromVersions['pro6_7_1'] = 'Pro6.7.1'; +$lang->upgrade->fromVersions['pro6_7_2'] = 'Pro6.7.2'; +$lang->upgrade->fromVersions['pro6_7_3'] = 'Pro6.7.3'; +$lang->upgrade->fromVersions['pro7_0_beta'] = 'Pro7.0.beta'; +$lang->upgrade->fromVersions['pro7_1'] = 'Pro7.1'; +$lang->upgrade->fromVersions['pro7_2'] = 'Pro7.2'; +$lang->upgrade->fromVersions['pro7_3'] = 'Pro7.3'; +$lang->upgrade->fromVersions['pro7_4'] = 'Pro7.4'; +$lang->upgrade->fromVersions['pro7_5'] = 'Pro7.5'; +$lang->upgrade->fromVersions['pro7_5_1'] = 'Pro7.5.1'; +$lang->upgrade->fromVersions['pro8_0'] = 'Pro8.0'; +$lang->upgrade->fromVersions['pro8_1'] = 'Pro8.1'; +$lang->upgrade->fromVersions['pro8_2'] = 'Pro8.2'; +$lang->upgrade->fromVersions['pro8_3'] = 'Pro8.3'; +$lang->upgrade->fromVersions['pro8_3_1'] = 'Pro8.3.1'; +$lang->upgrade->fromVersions['pro8_4'] = 'Pro8.4'; +$lang->upgrade->fromVersions['pro8_5'] = 'Pro8.5'; +$lang->upgrade->fromVersions['pro8_5_1'] = 'Pro8.5.1'; +$lang->upgrade->fromVersions['pro8_5_2'] = 'Pro8.5.2'; +$lang->upgrade->fromVersions['pro8_5_3'] = 'Pro8.5.3'; +$lang->upgrade->fromVersions['pro8_6'] = 'Pro8.6'; +$lang->upgrade->fromVersions['pro8_7'] = 'Pro8.7'; +$lang->upgrade->fromVersions['pro8_7_1'] = 'Pro8.7.1'; +$lang->upgrade->fromVersions['pro8_8'] = 'Pro8.8'; +$lang->upgrade->fromVersions['pro8_8_1'] = 'Pro8.8.1'; +$lang->upgrade->fromVersions['pro8_8_2'] = 'Pro8.8.2'; +$lang->upgrade->fromVersions['pro8_8_3'] = 'Pro8.8.3'; +$lang->upgrade->fromVersions['pro8_9'] = 'Pro8.9'; +$lang->upgrade->fromVersions['pro8_9_1'] = 'Pro8.9.1'; +$lang->upgrade->fromVersions['pro8_9_2'] = 'Pro8.9.2'; +$lang->upgrade->fromVersions['pro8_9_3'] = 'Pro8.9.3'; +$lang->upgrade->fromVersions['pro8_9_4'] = 'Pro8.9.4'; +$lang->upgrade->fromVersions['pro9_0'] = 'Pro9.0'; +$lang->upgrade->fromVersions['pro9_0_1'] = 'Pro9.0.1'; +$lang->upgrade->fromVersions['pro9_0_2'] = 'Pro9.0.2'; +$lang->upgrade->fromVersions['pro9_0_3'] = 'Pro9.0.3'; +$lang->upgrade->fromVersions['pro10_0_rc1'] = 'Pro10.0.rc1'; +$lang->upgrade->fromVersions['pro10_0'] = 'Pro10.0'; +$lang->upgrade->fromVersions['pro10_0_1'] = 'Pro10.0.1'; +$lang->upgrade->fromVersions['pro10_0_2'] = 'Pro10.0.2'; +$lang->upgrade->fromVersions['pro10_1'] = 'Pro10.1'; +$lang->upgrade->fromVersions['pro10_2'] = 'Pro10.2'; +$lang->upgrade->fromVersions['pro10_3'] = 'Pro10.3'; +$lang->upgrade->fromVersions['pro10_3_1'] = 'Pro10.3.1'; +$lang->upgrade->fromVersions['pro11_0_beta1'] = 'Pro11.0.beta1'; + +/* Biz. */ +$lang->upgrade->fromVersions['biz1_0'] = 'Biz1.0'; +$lang->upgrade->fromVersions['biz1_1'] = 'Biz1.1'; +$lang->upgrade->fromVersions['biz1_1_1'] = 'Biz1.1.1'; +$lang->upgrade->fromVersions['biz1_1_2'] = 'Biz1.1.2'; +$lang->upgrade->fromVersions['biz1_1_3'] = 'Biz1.1.3'; +$lang->upgrade->fromVersions['biz1_1_4'] = 'Biz1.1.4'; +$lang->upgrade->fromVersions['biz2_0_beta'] = 'Biz2.0.beta'; +$lang->upgrade->fromVersions['biz2_1'] = 'Biz2.1'; +$lang->upgrade->fromVersions['biz2_2'] = 'Biz2.2'; +$lang->upgrade->fromVersions['biz2_3'] = 'Biz2.3'; +$lang->upgrade->fromVersions['biz2_3_1'] = 'Biz2.3.1'; +$lang->upgrade->fromVersions['biz2_4'] = 'Biz2.4'; +$lang->upgrade->fromVersions['biz3_0'] = 'Biz3.0'; +$lang->upgrade->fromVersions['biz3_1'] = 'Biz3.1'; +$lang->upgrade->fromVersions['biz3_2'] = 'Biz3.2'; +$lang->upgrade->fromVersions['biz3_2_1'] = 'Biz3.2.1'; +$lang->upgrade->fromVersions['biz3_3'] = 'Biz3.3'; +$lang->upgrade->fromVersions['biz3_4'] = 'Biz3.4'; +$lang->upgrade->fromVersions['biz3_5_alpha'] = 'Biz3.5.alpha'; +$lang->upgrade->fromVersions['biz3_5_beta'] = 'Biz3.5.beta'; +$lang->upgrade->fromVersions['biz3_5'] = 'Biz3.5'; +$lang->upgrade->fromVersions['biz3_5_1'] = 'Biz3.5.1'; +$lang->upgrade->fromVersions['biz3_6'] = 'Biz3.6'; +$lang->upgrade->fromVersions['biz3_6_1'] = 'Biz3.6.1'; +$lang->upgrade->fromVersions['biz3_7'] = 'Biz3.7'; +$lang->upgrade->fromVersions['biz3_7_1'] = 'Biz3.7.1'; +$lang->upgrade->fromVersions['biz3_7_2'] = 'Biz3.7.2'; +$lang->upgrade->fromVersions['biz4_0'] = 'Biz4.0'; +$lang->upgrade->fromVersions['biz4_0_1'] = 'Biz4.0.1'; +$lang->upgrade->fromVersions['biz4_0_2'] = 'Biz4.0.2'; +$lang->upgrade->fromVersions['biz4_0_3'] = 'Biz4.0.3'; +$lang->upgrade->fromVersions['biz4_0_4'] = 'Biz4.0.4'; +$lang->upgrade->fromVersions['biz4_1'] = 'Biz4.1'; +$lang->upgrade->fromVersions['biz4_1_1'] = 'Biz4.1.1'; +$lang->upgrade->fromVersions['biz4_1_2'] = 'Biz4.1.2'; +$lang->upgrade->fromVersions['biz4_1_3'] = 'Biz4.1.3'; +$lang->upgrade->fromVersions['biz5_0_rc1'] = 'Biz5.0.rc1'; +$lang->upgrade->fromVersions['biz5_0'] = 'Biz5.0'; +$lang->upgrade->fromVersions['biz5_0_1'] = 'Biz5.0.1'; +$lang->upgrade->fromVersions['biz5_1'] = 'Biz5.1'; +$lang->upgrade->fromVersions['biz5_2'] = 'Biz5.2'; +$lang->upgrade->fromVersions['biz5_3'] = 'Biz5.3'; +$lang->upgrade->fromVersions['biz5_3_1'] = 'Biz5.3.1'; +$lang->upgrade->fromVersions['biz6_0_beta1'] = 'Biz6.0.beta1'; +$lang->upgrade->fromVersions['biz6_0'] = 'Biz6.0'; +$lang->upgrade->fromVersions['biz6_1'] = 'Biz6.1'; +$lang->upgrade->fromVersions['biz6_2'] = 'Biz6.2'; +$lang->upgrade->fromVersions['biz6_3'] = 'Biz6.3'; +$lang->upgrade->fromVersions['biz6_4'] = 'Biz6.4'; + +/* Max. */ +$lang->upgrade->fromVersions['max2_0_beta4'] = 'Max2.0.beta4'; +$lang->upgrade->fromVersions['max2_0_rc1'] = 'Max2.0.rc1'; +$lang->upgrade->fromVersions['max2_0'] = 'Max2.0'; +$lang->upgrade->fromVersions['max2_1'] = 'Max2.1'; +$lang->upgrade->fromVersions['max2_2'] = 'Max2.2'; +$lang->upgrade->fromVersions['max2_3'] = 'Max2.3'; +$lang->upgrade->fromVersions['max2_3_1'] = 'Max2.3.1'; +$lang->upgrade->fromVersions['max2_4_beta1'] = 'Max2.4.beta1'; +$lang->upgrade->fromVersions['max2_4'] = 'Max2.4'; +$lang->upgrade->fromVersions['max2_5'] = 'Max2.5'; +$lang->upgrade->fromVersions['max2_6'] = 'Max2.6'; +$lang->upgrade->fromVersions['max2_7'] = 'Max2.7'; +$lang->upgrade->fromVersions['max2_8'] = 'Max2.8'; diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php index 5dd59ab9f9..ca9a8dccaa 100644 --- a/module/upgrade/lang/zh-cn.php +++ b/module/upgrade/lang/zh-cn.php @@ -96,23 +96,26 @@ $lang->upgrade->to15Mode['new'] = '全新项目集管理模式'; $lang->upgrade->selectedModeTips['classic'] = '后续您还可以在后台-自定义里面切换为全新项目集管理的模式。'; $lang->upgrade->selectedModeTips['new'] = '切换为项目集管理模式需要对之前的数据进行归并处理,系统会引导您完成这个操作。'; -$lang->upgrade->line = '产品线'; -$lang->upgrade->allLines = "所有{$lang->productCommon}线"; -$lang->upgrade->program = '目标项目集和项目'; -$lang->upgrade->existProgram = '已有项目集'; -$lang->upgrade->existProject = '已有项目'; -$lang->upgrade->existLine = '已有' . $lang->productCommon . '线'; -$lang->upgrade->product = $lang->productCommon; -$lang->upgrade->project = '迭代'; -$lang->upgrade->repo = '版本库'; -$lang->upgrade->mergeRepo = '归并版本库'; -$lang->upgrade->setProgram = '设置项目所属项目集'; -$lang->upgrade->dataMethod = '数据迁移方式'; -$lang->upgrade->begin = '开始日期'; -$lang->upgrade->end = '结束日期'; -$lang->upgrade->selectProject = '目标项目'; -$lang->upgrade->programName = '项目集名称'; -$lang->upgrade->projectName = '项目名称'; +$lang->upgrade->line = '产品线'; +$lang->upgrade->allLines = "所有{$lang->productCommon}线"; +$lang->upgrade->program = '目标项目集和项目'; +$lang->upgrade->existProgram = '已有项目集'; +$lang->upgrade->existProject = '已有项目'; +$lang->upgrade->existLine = '已有' . $lang->productCommon . '线'; +$lang->upgrade->product = $lang->productCommon; +$lang->upgrade->project = '迭代'; +$lang->upgrade->repo = '版本库'; +$lang->upgrade->mergeRepo = '归并版本库'; +$lang->upgrade->setProgram = '设置项目所属项目集'; +$lang->upgrade->dataMethod = '数据迁移方式'; +$lang->upgrade->begin = '开始日期'; +$lang->upgrade->end = '结束日期'; +$lang->upgrade->selectProject = '目标项目'; +$lang->upgrade->programName = '项目集名称'; +$lang->upgrade->projectName = '项目名称'; +$lang->upgrade->moveEXTFiles = '迁移插件文件'; +$lang->upgrade->fileName = '文件名称'; +$lang->upgrade->viewChargeFile = '查看收费版本文件'; $lang->upgrade->newProgram = '新建'; $lang->upgrade->editedName = '调整后名称'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 458aa13d3b..c0461c46a5 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -37,740 +37,534 @@ class upgradeModel extends model public function execute($fromVersion) { set_time_limit(0); - $executeXuanxuan = false; - switch($fromVersion) + + $openVersion = $fromVersion; + if(strpos($fromVersion, 'pro') !== false) { - case '0_3beta': - $this->saveLogs('Execute 0_3beta'); - $this->execSQL($this->getUpgradeFile('0.3')); - case '0_4beta': - $this->saveLogs('Execute 0_4beta'); - $this->execSQL($this->getUpgradeFile('0.4')); - case '0_5beta': - $this->saveLogs('Execute 0_5beta'); - $this->execSQL($this->getUpgradeFile('0.5')); - case '0_6beta': - $this->saveLogs('Execute 0_6beta'); - $this->execSQL($this->getUpgradeFile('0.6')); - case '1_0beta': - $this->saveLogs('Execute 1_0beta'); - $this->execSQL($this->getUpgradeFile('1.0.beta')); - $this->updateCompany(); - case '1_0rc1': - $this->saveLogs('Execute 1_0rc1'); - $this->execSQL($this->getUpgradeFile('1.0.rc1')); - case '1_0rc2': $this->saveLogs('Execute 1_0rc2'); - case '1_0': $this->saveLogs('Execute 1_0'); - case '1_0_1': - $this->saveLogs('Execute 1_0_1'); - $this->execSQL($this->getUpgradeFile('1.0.1')); - case '1_1': - $this->saveLogs('Execute 1_1'); - $this->execSQL($this->getUpgradeFile('1.1')); - case '1_2': - $this->saveLogs('Execute 1_2'); - $this->execSQL($this->getUpgradeFile('1.2')); - $this->updateUBB(); - $this->updateNL1_2(); - case '1_3': - $this->saveLogs('Execute 1_3'); - $this->execSQL($this->getUpgradeFile('1.3')); - $this->updateNL1_3(); - $this->updateTasks(); - case '1_4': - $this->saveLogs('Execute 1_4'); - $this->execSQL($this->getUpgradeFile('1.4')); - case '1_5': - $this->saveLogs('Execute 1_5'); - $this->execSQL($this->getUpgradeFile('1.5')); - case '2_0': - $this->saveLogs('Execute 2_0'); - $this->execSQL($this->getUpgradeFile('2.0')); - case '2_1': - $this->saveLogs('Execute 2_1'); - $this->execSQL($this->getUpgradeFile('2.1')); - case '2_2': - $this->saveLogs('Execute 2_2'); - $this->execSQL($this->getUpgradeFile('2.2')); - $this->updateCases(); - $this->updateActivatedCountOfBug(); - case '2_3': - $this->saveLogs('Execute 2_3'); - $this->execSQL($this->getUpgradeFile('2.3')); - case '2_4': - $this->saveLogs('Execute 2_4'); - $this->execSQL($this->getUpgradeFile('2.4')); - case '3_0_beta1': - $this->saveLogs('Execute 3_0_beta1'); - $this->execSQL($this->getUpgradeFile('3.0.beta1')); - $this->updateAction(); - $this->setOrderData(); - case '3_0_beta2': $this->saveLogs('Execute 3_0_beta2'); - case '3_0': $this->saveLogs('Execute 3_0'); - case '3_1': - $this->saveLogs('Execute 3_1'); - $this->execSQL($this->getUpgradeFile('3.1')); - $this->appendExec('3_1'); - case '3_2': - $this->saveLogs('Execute 3_2'); - $this->execSQL($this->getUpgradeFile('3.2')); - $this->appendExec('3_2'); - case '3_2_1': - $this->saveLogs('Execute 3_2_1'); - $this->execSQL($this->getUpgradeFile('3.2.1')); - $this->appendExec('3_2_1'); - case '3_3': - $this->saveLogs('Execute 3_3'); - $this->execSQL($this->getUpgradeFile('3.3')); - $this->updateTaskAssignedTo(); - $this->appendExec('3_3'); - case '4_0_beta1': - $this->saveLogs('Execute 4_0_beta1'); - $this->execSQL($this->getUpgradeFile('4.0.beta1')); - $this->appendExec('4_0_beta1'); - case '4_0_beta2': - $this->saveLogs('Execute 4_0_beta2'); - $this->execSQL($this->getUpgradeFile('4.0.beta2')); - $this->updateProjectType(); - $this->updateEstimatePriv(); - $this->appendExec('4_0_beta2'); - case '4_0': - $this->saveLogs('Execute 4_0'); - $this->execSQL($this->getUpgradeFile('4.0')); - $this->appendExec('4_0'); - case '4_0_1': - $this->saveLogs('Execute 4_0_1'); - $this->execSQL($this->getUpgradeFile('4.0.1')); - $this->addPriv4_0_1(); - $this->appendExec('4_0_1'); - case '4_1': - $this->saveLogs('Execute 4_1'); - $this->execSQL($this->getUpgradeFile('4.1')); - $this->addPriv4_1(); - $this->processTaskFinish(); - $this->deleteCompany(); - $this->appendExec('4_1'); - case '4_2_beta': - $this->saveLogs('Execute 4_2_beta'); - $this->execSQL($this->getUpgradeFile('4.2')); - $this->appendExec('4_2_beta'); - case '4_3_beta': - $this->saveLogs('Execute 4_3_beta'); - $this->execSQL($this->getUpgradeFile('4.3')); - $this->appendExec('4_3_beta'); - case '5_0_beta1': - $this->saveLogs('Execute 5_0_beta1'); - $this->appendExec('5_0_beta1'); - case '5_0_beta2': - $this->saveLogs('Execute 5_0_beta2'); - $this->appendExec('5_0_beta2'); - case '5_0': - $this->saveLogs('Execute 5_0'); - $this->appendExec('5_0'); - case '5_1': - $this->saveLogs('Execute 5_1'); - $this->appendExec('5_1'); - case '5_2': - $this->saveLogs('Execute 5_2'); - $this->appendExec('5_2'); - case '5_2_1': - $this->saveLogs('Execute 5_2_1'); - $this->mergeProjectGoalAndDesc(); - $this->execSQL($this->getUpgradeFile('5.2.1')); - $this->appendExec('5_2_1'); - case '5_3': - $this->saveLogs('Execute 5_3'); - $this->appendExec('5_3'); - case '6_0_beta1': - $this->saveLogs('Execute 6_0_beta'); - $this->execSQL($this->getUpgradeFile('6.0.beta1')); - $this->toLowerTable(); - $this->fixBugOSInfo(); - $this->fixTaskFinishedBy(); - $this->appendExec('6_0_beta1'); - case '6_0': - $this->saveLogs('Execute 6_0'); - $this->execSQL($this->getUpgradeFile('6.0')); - $this->fixDataIndex(); - $this->appendExec('6_0'); - case '6_1': - $this->saveLogs('Execute 6_1'); - $this->execSQL($this->getUpgradeFile('6.1')); - $this->appendExec('6_1'); - case '6_2': - $this->saveLogs('Execute 6_2'); - $this->appendExec('6_2'); - case '6_3': - $this->saveLogs('Execute 6_3'); - $this->appendExec('6_3'); - case '6_4': - $this->saveLogs('Execute 6_4'); - $this->appendExec('6_4'); - case '7_0': - $this->saveLogs('Execute 7_0'); - $this->execSQL($this->getUpgradeFile('7.0')); - $this->appendExec('7_0'); - case '7_1': - $this->saveLogs('Execute 7_1'); - $this->execSQL($this->getUpgradeFile('7.1')); - $this->initOrder(); - $this->appendExec('7_1'); - case '7_2': - $this->saveLogs('Execute 7_2'); - $this->appendExec('7_2'); - case '7_2_4': - $this->saveLogs('Execute 7_2_4'); - $this->execSQL($this->getUpgradeFile('7.2.4')); - $this->appendExec('7_2_4'); - case '7_2_5': - $this->saveLogs('Execute 7_2_5'); - $this->adjustOrder7_3(); - $this->appendExec('7_2_5'); - case '7_3': - $this->saveLogs('Execute 7_3'); - $this->execSQL($this->getUpgradeFile('7.3')); - $this->adjustPriv7_4_beta(); - $this->appendExec('7_3'); - case '7_4_beta': - $this->saveLogs('Execute 7_4_beta'); - $this->execSQL($this->getUpgradeFile('7.4.beta')); - $this->appendExec('7_4_beta'); - case '8_0': - $this->saveLogs('Execute 8_0'); - $this->appendExec('8_0'); - case '8_0_1': - $this->saveLogs('Execute 8_0_1'); - $this->execSQL($this->getUpgradeFile('8.0.1')); - $this->addPriv8_1(); - $this->appendExec('8_0_1'); - case '8_1': - $this->saveLogs('Execute 8_1'); - $this->execSQL($this->getUpgradeFile('8.1')); - $this->appendExec('8_1'); - case '8_1_3': - $this->saveLogs('Execute 8_1_3'); - $this->execSQL($this->getUpgradeFile('8.1.3')); - $this->addPriv8_2_beta(); - $this->adjustConfigSectionAndKey(); - $this->appendExec('8_1_3'); - case '8_2_beta': - $this->saveLogs('Execute 8_2_beta'); - $this->appendExec('8_2_beta'); - case '8_2': - $this->saveLogs('Execute 8_2'); - $this->appendExec('8_2'); - case '8_2_1': - $this->saveLogs('Execute 8_2_1'); - $this->execSQL($this->getUpgradeFile('8.2.1')); - $this->appendExec('8_2_1'); - case '8_2_2': - $this->saveLogs('Execute 8_2_2'); - $this->appendExec('8_2_2'); - case '8_2_3': - $this->saveLogs('Execute 8_2_3'); - $this->appendExec('8_2_3'); - case '8_2_4': - $this->saveLogs('Execute 8_2_4'); - $this->appendExec('8_2_4'); - case '8_2_5': - $this->saveLogs('Execute 8_2_5'); - $this->appendExec('8_2_5'); - case '8_2_6': - $this->saveLogs('Execute 8_2_6'); - $this->execSQL($this->getUpgradeFile('8.2.6')); - $this->adjustDocModule(); - $this->moveDocContent(); - $this->adjustPriv8_3(); - $this->appendExec('8_2_6'); - case '8_3': - $this->saveLogs('Execute 8_3'); - $this->appendExec('8_3'); - case '8_3_1': - $this->saveLogs('Execute 8_3_1'); - $this->execSQL($this->getUpgradeFile('8.3.1')); - $this->renameMainLib(); - $this->adjustPriv8_4(); - $this->appendExec('8_3_1'); - case '8_4': - $this->saveLogs('Execute 8_4'); - $this->appendExec('8_4'); - case '8_4_1': - $this->saveLogs('Execute 8_4_1'); - $this->execSQL($this->getUpgradeFile('8.4.1')); - $this->appendExec('8_4_1'); - case '9_0_beta': - $this->saveLogs('Execute 9_0_beta'); - $this->execSQL($this->getUpgradeFile('9.0.beta')); - $this->adjustPriv9_0(); - $this->appendExec('9_0_beta'); - case '9_0': - $this->saveLogs('Execute 9_0'); - $this->fixProjectProductData(); - $this->appendExec('9_0'); - case '9_0_1': - $this->saveLogs('Execute 9_0_1'); - $this->execSQL($this->getUpgradeFile('9.0.1')); - $this->addBugDeadlineToCustomFields(); - $this->adjustPriv9_0_1(); - $this->appendExec('9_0_1'); - case '9_1': - $this->saveLogs('Execute 9_1'); - $this->execSQL($this->getUpgradeFile('9.1')); - $this->appendExec('9_1'); - case '9_1_1': - $this->saveLogs('Execute 9_1_1'); - $this->execSQL($this->getUpgradeFile('9.1.1')); - $this->appendExec('9_1_1'); - case '9_1_2': - $this->saveLogs('Execute 9_1_2'); - $this->execSQL($this->getUpgradeFile('9.1.2')); - $this->processCustomMenus(); - $this->adjustPriv9_2(); - $this->appendExec('9_1_2'); - case '9_2': - $this->saveLogs('Execute 9_2'); - $this->appendExec('9_2'); - case '9_2_1': - $this->saveLogs('Execute 9_2_1'); - $this->appendExec('9_2_1'); - case '9_3_beta': - $this->saveLogs('Execute 9_3_beta'); - $this->execSQL($this->getUpgradeFile('9.3.beta')); - $this->appendExec('9_3_beta'); - case '9_4': - $this->saveLogs('Execute 9_4'); - $this->execSQL($this->getUpgradeFile('9.4')); - $this->adjustPriv9_4(); - $this->appendExec('9_4'); - case '9_5': - $this->saveLogs('Execute 9_5'); - $this->execSQL($this->getUpgradeFile('9.5')); - $this->appendExec('9_5'); - case '9_5_1': - $this->saveLogs('Execute 9_5_1'); - $this->execSQL($this->getUpgradeFile('9.5.1')); - $this->initProjectStoryOrder(); - $this->appendExec('9_5_1'); - case '9_6': - $this->saveLogs('Execute 9_6'); - $this->execSQL($this->getUpgradeFile('9.6')); - $this->fixDatatableColsConfig(); - $this->appendExec('9_6'); - case '9_6_1': - $this->saveLogs('Execute 9_6_1'); - $this->addLimitedGroup(); - $this->appendExec('9_6_1'); - case '9_6_2': - $this->saveLogs('Execute 9_6_2'); - $this->appendExec('9_6_2'); - case '9_6_3': - $this->saveLogs('Execute 9_6_3'); - $this->execSQL($this->getUpgradeFile('9.6.3')); - $this->changeLimitedName(); - $this->adjustPriv9_7(); - $this->changeStoryWidth(); - $this->appendExec('9_6_3'); - case '9_7': - $this->saveLogs('Execute 9_7'); - $this->execSQL($this->getUpgradeFile('9.7')); - $this->changeTeamFields(); - $this->moveData2Notify(); - $this->appendExec('9_7'); - case '9_8': - $this->saveLogs('Execute 9_8'); - $this->fixTaskFinishedInfo(); - $this->appendExec('9_8'); - case '9_8_1': - $this->saveLogs('Execute 9_8_1'); - $this->execSQL($this->getUpgradeFile('9.8.1')); - $this->fixTaskAssignedTo(); - $this->fixProjectClosedInfo(); - $this->resetProductLine(); - $this->appendExec('9_8_1'); - case '9_8_2': - $this->saveLogs('Execute 9_8_2'); - $this->execSQL($this->getUpgradeFile('9.8.2')); - $this->addUniqueKeyToTeam(); - $this->appendExec('9_8_2'); - case '9_8_3': - $this->saveLogs('Execute 9_8_3'); - $this->execSQL($this->getUpgradeFile('9.8.3')); - $this->adjustPriv10_0_alpha(); - $this->appendExec('9_8_3'); - case '10_0_alpha': - $this->saveLogs('Execute 10_0_alpha'); - $this->execSQL($this->getUpgradeFile('10.0.alpha')); - $this->fixProjectStatisticBlock(); - $this->appendExec('10_0_alpha'); - case '10_0_beta': - $this->saveLogs('Execute 10_0_beta'); - $this->execSQL($this->getUpgradeFile('10.0.beta')); - $this->appendExec('10_0_beta'); - case '10_0': - $this->saveLogs('Execute 10_0'); - $this->execSQL($this->getUpgradeFile('10.0')); - $this->fixStorySpecTitle(); - $this->removeUnlinkPriv();//Remove unlink privilege for story, bug and testcase module. - $this->appendExec('10_0'); - case '10_1': - $this->saveLogs('Execute 10_1'); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'xuanxuan.sql'; - $this->execSQL($xuanxuanSql); - $executeXuanxuan = true; - $this->appendExec('10_1'); - case '10_2': - $this->saveLogs('Execute 10_2'); - $this->appendExec('10_2'); - case '10_3': - $this->saveLogs('Execute 10_3'); - $this->appendExec('10_3'); - case '10_3_1': - $this->saveLogs('Execute 10_3_1'); - $this->execSQL($this->getUpgradeFile('10.3.1')); - $this->removeCustomMenu(); - $this->appendExec('10_3_1'); - case '10_4': - $this->saveLogs('Execute 10_4'); - $this->execSQL($this->getUpgradeFile('10.4')); - $this->changeTaskParentValue(); - $this->appendExec('10_4'); - case '10_5': - $this->saveLogs('Execute 10_5'); - $this->appendExec('10_5'); - case '10_5_1': - $this->saveLogs('Execute 10_5_1'); - $this->execSQL($this->getUpgradeFile('10.5.1')); - $this->appendExec('10_5_1'); - case '10_6': - $this->saveLogs('Execute 10_6'); - if(!$executeXuanxuan) + $openVersion = $this->config->proVersion[$fromVersion]; + } + elseif(strpos($fromVersion, 'biz') !== false) + { + $openVersion = $this->config->bizVersion[$fromVersion]; + } + elseif(strpos($fromVersion, 'max') !== false) + { + $openVersion = $this->config->maxVersion[$fromVersion]; + } + + $executeXuanxuan = false; + foreach($this->lang->upgrade->fromVersions as $version => $versionName) + { + if(!is_numeric($version[0])) continue; + if(version_compare(str_replace('_', '.', $version), str_replace('_', '.', $openVersion)) < 0) continue; + + $openVersion = $version; + if(str_replace('_', '.', $openVersion) == '10.1') $executeXuanxuan = true; + + $this->saveLogs("Execute $openVersion"); + $this->execSQL($this->getUpgradeFile(str_replace('_', '.', $openVersion))); + $this->executeOpen($openVersion, $fromVersion, $executeXuanxuan); + + $proVersions = array(); + foreach($this->config->proVersion as $pro => $open) { - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.1.0.sql'; + if($open == $openVersion) $proVersions[] = $pro; + } + + foreach($proVersions as $proVersion) + { + $this->saveLogs("Execute $proVersion"); + $this->execSQL($this->getUpgradeFile(str_replace('_', '.', $proVersion))); + $this->executePro($proVersion); + } + + $bizVersions = array(); + foreach($this->config->bizVersion as $biz => $open) + { + if($open == $openVersion) $bizVersions[] = $biz; + } + + foreach($bizVersions as $bizVersion) + { + $this->saveLogs("Execute $bizVersion"); + $this->execSQL($this->getUpgradeFile(str_replace('_', '.', $bizVersion))); + $this->executeBiz($bizVersion, $executeXuanxuan); + } + + $maxVersion = array_search($openVersion, $this->config->maxVersion); + $this->saveLogs("Execute $maxVersion"); + $this->execSQL($this->getUpgradeFile(str_replace('_', '.', $maxVersion))); + } + } + + /** + * Execute open source version. + * + * @param string $openVersion + * @param string $fromVersion + * @param bool $executeXuanxuan + * @access public + * @return void + */ + public function executeOpen($openVersion, $fromVersion, $executeXuanxuan) + { + switch($openVersion) + { + case '1_0beta': + $this->updateCompany(); + break; + case '1_2': + $this->updateUBB(); + $this->updateNL1_2(); + break; + case '1_3': + $this->updateNL1_3(); + $this->updateTasks(); + break; + case '2_2': + $this->updateCases(); + $this->updateActivatedCountOfBug(); + break; + case '3_0_beta1': + $this->updateAction(); + $this->setOrderData(); + break; + case '3_3': + $this->updateTaskAssignedTo(); + break; + case '4_0_beta2': + $this->updateProjectType(); + $this->updateEstimatePriv(); + break; + case '4_0_1': + $this->addPriv4_0_1(); + break; + case '4_1': + $this->addPriv4_1(); + $this->processTaskFinish(); + $this->deleteCompany(); + break; + case '5_2_1': + $this->mergeProjectGoalAndDesc(); + break; + case '6_0_beta1': + $this->toLowerTable(); + $this->fixBugOSInfo(); + $this->fixTaskFinishedBy(); + break; + case '6_0': + $this->fixDataIndex(); + break; + case '7_1': + $this->initOrder(); + break; + case '7_3': + $this->adjustPriv7_4_beta(); + break; + case '8_0_1': + $this->addPriv8_1(); + break; + case '8_1_3': + $this->addPriv8_2_beta(); + $this->adjustConfigSectionAndKey(); + break; + case '8_2_6': + $this->adjustDocModule(); + $this->moveDocContent(); + $this->adjustPriv8_3(); + break; + case '8_3_1': + $this->renameMainLib(); + $this->adjustPriv8_4(); + break; + case '9_0_beta': + $this->adjustPriv9_0(); + break; + case '9_0': + $this->fixProjectProductData(); + break; + case '9_0_1': + $this->addBugDeadlineToCustomFields(); + $this->adjustPriv9_0_1(); + break; + case '9_1_2': + $this->processCustomMenus(); + $this->adjustPriv9_2(); + break; + case '9_4': + $this->adjustPriv9_4(); + break; + case '9_5_1': + $this->initProjectStoryOrder(); + break; + case '9_6': + $this->fixDatatableColsConfig(); + break; + case '9_6_1': + $this->addLimitedGroup(); + break; + case '9_6_3': + $this->changeLimitedName(); + $this->adjustPriv9_7(); + $this->changeStoryWidth(); + break; + case '9_7': + $this->changeTeamFields(); + $this->moveData2Notify(); + break; + case '9_8': + $this->fixTaskFinishedInfo(); + break; + case '9_8_1': + $this->fixTaskAssignedTo(); + $this->fixProjectClosedInfo(); + $this->resetProductLine(); + break; + case '9_8_2': + $this->addUniqueKeyToTeam(); + break; + case '9_8_3': + $this->adjustPriv10_0_alpha(); + break; + case '10_0_alpha': + $this->fixProjectStatisticBlock(); + break; + case '10_0': + $this->fixStorySpecTitle(); + $this->removeUnlinkPriv();//Remove unlink privilege for story, bug and testcase module. + break; + case '10_1': + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'xuanxuan.sql'; $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.2.0.sql'; - $this->execSQL($xuanxuanSql); - } - $this->initXuanxuan(); - $this->appendExec('10_6'); - case '11_0': - $this->saveLogs('Execute 11_0'); - $this->appendExec('11_0'); - case '11_1': - $this->saveLogs('Execute 11_1'); - $this->execSQL($this->getUpgradeFile('11.1')); - if(empty($this->config->isINT)) - { + $executeXuanxuan = true; + case '10_3_1': + $this->removeCustomMenu(); + break; + case '10_4': + $this->changeTaskParentValue(); + break; + case '10_6': if(!$executeXuanxuan) { - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.3.0.sql'; + $this->saveLogs('Execute 10_6'); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.1.0.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.2.0.sql'; $this->execSQL($xuanxuanSql); } - $this->dao->update(TABLE_CONFIG)->set('value')->eq('off')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('0')->exec(); - $this->dao->update(TABLE_CONFIG)->set('value')->eq('on')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('1')->exec(); - } - $this->appendExec('11_1'); - case '11_2': - $this->saveLogs('Execute 11_2'); - $this->execSQL($this->getUpgradeFile('11.2')); - $this->processDocLibAcl(); - $this->appendExec('11_2'); - case '11_3': - $this->saveLogs('Execute 11_3'); - $this->execSQL($this->getUpgradeFile('11.3')); - $this->addPriv11_4(); - $this->appendExec('11_3'); - case '11_4': - $this->saveLogs('Execute 11_4'); - $this->execSQL($this->getUpgradeFile('11.4')); - $this->appendExec('11_4'); - case '11_4_1': - $this->saveLogs('Execute 11_4_1'); - $this->execSQL($this->getUpgradeFile('11.4.1')); - $this->addPriv11_5(); - if(empty($this->config->isINT)) - { - if(!$executeXuanxuan) + $this->initXuanxuan(); + break; + case '11_1': + if(empty($this->config->isINT)) { - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.4.0.sql'; - $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.5.0.sql'; - $this->execSQL($xuanxuanSql); + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.3.0.sql'; + $this->execSQL($xuanxuanSql); + } + $this->dao->update(TABLE_CONFIG)->set('value')->eq('off')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('0')->exec(); + $this->dao->update(TABLE_CONFIG)->set('value')->eq('on')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('1')->exec(); } - $this->updateXX_11_5(); - } - $this->appendExec('11_4_1'); - case '11_5': - $this->saveLogs('Execute 11_5'); - $this->execSQL($this->getUpgradeFile('11.5')); - $this->appendExec('11_5'); - case '11_5_1': - $this->saveLogs('Execute 11_5_1'); - $this->appendExec('11_5_1'); - case '11_5_2': - $this->saveLogs('Execute 11_5_2'); - $this->execSQL($this->getUpgradeFile('11.5.2')); - $this->appendExec('11_5_2'); - case '11_6': - $this->saveLogs('Execute 11_6'); - $this->execSQL($this->getUpgradeFile('11.6')); - $this->appendExec('11_6'); - case '11_6_1': - $this->saveLogs('Execute 11_6_1'); - $this->adjustWebhookType(); - $this->adjustPriv11_6_2(); - $this->appendExec('11_6_1'); - case '11_6_2': - $this->saveLogs('Execute 11_6_2'); - $this->appendExec('11_6_2'); - case '11_6_3': - $this->saveLogs('Execute 11_6_3'); - $this->adjustPriv11_6_4(); - $this->appendExec('11_6_3'); - case '11_6_4': - $this->saveLogs('Execute 11_6_4'); - $this->execSQL($this->getUpgradeFile('11.6.4')); - $this->appendExec('11_6_4'); - case '11_6_5': - $this->saveLogs('Execute 11_6_5'); - $this->execSQL($this->getUpgradeFile('11.6.5')); - $this->fixGroupAcl(); - $this->fixBugTypeList(); - $this->adjustPriv11_7(); - $this->rmEditorAndTranslateDir(); - $this->setConceptSetted(); + break; + case '11_2': + $this->processDocLibAcl(); + break; + case '11_3': + $this->addPriv11_4(); + break; + case '11_4_1': + $this->addPriv11_5(); + if(empty($this->config->isINT)) + { + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.4.0.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.5.0.sql'; + $this->execSQL($xuanxuanSql); + } + $this->updateXX_11_5(); + } + break; + case '11_6_1': + $this->adjustWebhookType(); + $this->adjustPriv11_6_2(); + break; + case '11_6_3': + $this->adjustPriv11_6_4(); + break; + case '11_6_5': + $this->fixGroupAcl(); + $this->fixBugTypeList(); + $this->adjustPriv11_7(); + $this->rmEditorAndTranslateDir(); + $this->setConceptSetted(); - if(empty($this->config->isINT)) - { - if(!$executeXuanxuan) + if(empty($this->config->isINT)) { - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.5.7.sql'; - $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.0.0-beta.1.sql'; - $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.0-beta3.sql'; - $this->execSQL($xuanxuanSql); + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.5.7.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.0.0-beta.1.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.0-beta3.sql'; + $this->execSQL($xuanxuanSql); + } + } + break; + case '11_7': + $this->adjustPriv12_0(); + $this->loadModel('setting')->setItem('system.common.global.showAnnual', '1'); + break; + case '12_0_1': + $this->importRepoFromConfig(); + break; + case '12_1': + if(empty($this->config->isINT)) + { + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.1.1.sql'; + $this->execSQL($xuanxuanSql); + } + } + break; + case '12_3_3': + $this->addPriv12_3_3(); + $this->processImport2TaskBugs(); //Code for task #7552 + break; + case '12_4_2': + $this->fixFromCaseVersion(); + $this->initStoryOfPlan(); + break; + case '12_4_4': + $this->adjustPriv12_5(); + break; + case '12_5_3': + $this->adjustWhitelistOfProject(); + $this->adjustWhitelistOfProduct(); + $this->adjustPriv15_0(); + break; + case '15_0_rc1': + $this->adjustUserView(); + break; + case '15_0_rc3': + if(empty($this->config->isINT)) + { + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.3.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.0.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.0.beta2.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.0.beta3.sql'; + $this->execSQL($xuanxuanSql); + } + } + $this->updateLibType(); + $this->updateRunCaseStatus(); + $this->fix4TaskLinkProject(); + $this->fixExecutionTeam(); + break; + case '15_0': + $this->adjustBugOfProject(); + $this->processBuildTable(); + $this->updateProductVersion(); + break; + case '15_0_2': + $this->uniqueProjectAdmin(); + break; + case '15_2': + $this->processGitlabRepo(); + $this->processStoryFileType(); + $this->processProductDoc(); + $this->adjustPriv15_3(); + break; + case '15_3': + $this->adjustBugRequired(); + $this->processTesttaskDate(); + $this->processDocTempContent(); + break; + case '15_4': + if(empty($this->config->isINT)) + { + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.2.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.4.sql'; + $this->execSQL($xuanxuanSql); + } + } + break; + case '15_7_1': + $this->updateObjectBranch(); + $this->updateProjectStories(); + $this->updateProjectLinkedBranch(); + break; + case '16_0_beta1': + $this->loadModel('api')->createDemoData($this->lang->api->zentaoAPI, 'http://' . $_SERVER['HTTP_HOST'] . $this->app->config->webRoot . 'api.php/v1', '16.0'); + break; + case '16_1': + $this->moveKanbanData(); + break; + case '16_2': + $this->updateSpaceTeam(); + $this->updateDocField(); + break; + case '16_4': + if(strpos($fromVersion, 'pro') === false and strpos($fromVersion, 'biz') === false and strpos($fromVersion, 'max') === false) + { + $this->upgradeFreeToPro(); } - } - $this->appendExec('11_6_5'); - case '11_7': - $this->saveLogs('Execute 11_7'); - $this->execSQL($this->getUpgradeFile('11.7')); - $this->adjustPriv12_0(); - $this->loadModel('setting')->setItem('system.common.global.showAnnual', '1'); - $this->appendExec('11_7'); - case '12_0': - $this->saveLogs('Execute 12_0'); - $this->appendExec('12_0'); - case '12_0_1': - $this->saveLogs('Execute 12_0_1'); - $this->execSQL($this->getUpgradeFile('12.0.1')); - $this->importRepoFromConfig(); - $this->appendExec('12_0_1'); - case '12_1': - $this->saveLogs('Execute 12_1'); - $this->execSQL($this->getUpgradeFile('12.1')); + if(strpos($fromVersion, 'biz') === false and strpos($fromVersion, 'max') === false) + { + $this->upgrade2Biz(); + } - if(empty($this->config->isINT)) - { - if(!$executeXuanxuan) - { - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.1.1.sql'; - $this->execSQL($xuanxuanSql); - } - } + if(strpos($fromVersion, 'max') === false) $this->upgrade2Max(); - $this->appendExec('12_1'); - case '12_2': - $this->saveLogs('Execute 12_2'); - $this->execSQL($this->getUpgradeFile('12.2')); - $this->appendExec('12_2'); - case '12_3': - $this->saveLogs('Execute 12_3'); - $this->appendExec('12_3'); - case '12_3_1': - $this->saveLogs('Execute 12_3_1'); - $this->appendExec('12_3_1'); - case '12_3_2': - $this->saveLogs('Execute 12_3_2'); - $this->execSQL($this->getUpgradeFile('12.3.2')); - $this->appendExec('12_3_2'); - case '12_3_3': - $this->saveLogs('Execute 12_3_3'); - $this->execSQL($this->getUpgradeFile('12.3.3')); - $this->addPriv12_3_3(); - $this->processImport2TaskBugs(); //Code for task #7552 - $this->appendExec('12_3_3'); - case '12_4': - $this->saveLogs('Execute 12_4'); - $this->execSQL($this->getUpgradeFile('12.4')); - $this->appendExec('12_4'); - case '12_4_1': - $this->saveLogs('Execute 12_4_1'); - $this->execSQL($this->getUpgradeFile('12.4.1')); - $this->appendExec('12_4_1'); - case '12_4_2': - $this->saveLogs('Execute 12_4_2'); - $this->execSQL($this->getUpgradeFile('12.4.2')); - $this->fixFromCaseVersion(); - $this->initStoryOfPlan(); - $this->appendExec('12_4_2'); - case '12_4_3': - $this->saveLogs('Execute 12_4_3'); - $this->appendExec('12_4_3'); - case '12_4_4': - $this->saveLogs('Execute 12_4_4'); - $this->execSQL($this->getUpgradeFile('12.4.4')); - $this->adjustPriv12_5(); - $this->appendExec('12_4_4'); - case '12_5': - $this->saveLogs('Execute 12_5'); - $this->appendExec('12_5'); - case '12_5_1': - $this->saveLogs('Execute 12_5_1'); - $this->appendExec('12_5_1'); - case '12_5_2': - $this->saveLogs('Execute 12_5_2'); - $this->appendExec('12_5_2'); - case '12_5_3': - $this->saveLogs('Execute 12_5_3'); - $this->execSQL($this->getUpgradeFile('12.5.3')); - $this->adjustWhitelistOfProject(); - $this->adjustWhitelistOfProduct(); - $this->adjustPriv15_0(); - $this->appendExec('12_5_3'); - case '15_0_rc1': - $this->saveLogs('Execute 15_0_rc1'); - $this->adjustUserView(); - $this->appendExec('15_0_rc1'); - case '15_0_rc2': - $this->saveLogs('Execute 15_0_rc2'); - $this->execSQL($this->getUpgradeFile('15.0.rc2')); - $this->appendExec('15_0_rc2'); - case '15_0_rc3': - $this->saveLogs('Execute 15_0_rc3'); - $this->execSQL($this->getUpgradeFile('15.0.rc3')); - if(empty($this->config->isINT)) - { - if(!$executeXuanxuan) - { - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.3.sql'; - $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.0.sql'; - $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.0.beta2.sql'; - $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.0.beta3.sql'; - $this->execSQL($xuanxuanSql); - } - } - $this->updateLibType(); - $this->updateRunCaseStatus(); - $this->fix4TaskLinkProject(); - $this->fixExecutionTeam(); - $this->appendExec('15_0_rc3'); - case '15_0': - $this->saveLogs('Execute 15_0'); - $this->execSQL($this->getUpgradeFile('15.0')); - $this->adjustBugOfProject(); - $this->processBuildTable(); - $this->updateProductVersion(); - $this->appendExec('15_0'); - case '15_0_1': - $this->saveLogs('Execute 15_0_1'); - $this->appendExec('15_0_1'); - case '15_0_2': - $this->saveLogs('Execute 15_0_2'); - $this->execSQL($this->getUpgradeFile('15.0.2')); - $this->uniqueProjectAdmin(); - $this->appendExec('15_0_2'); - case '15_0_3': - $this->saveLogs('Execute 15_0_3'); - $this->execSQL($this->getUpgradeFile('15.0.3')); - $this->appendExec('15_0_3'); - case '15_2': - $this->saveLogs('Execute 15_2'); - $this->execSQL($this->getUpgradeFile('15.2')); - $this->processGitlabRepo(); - $this->processStoryFileType(); - $this->processProductDoc(); - $this->adjustPriv15_3(); - $this->appendExec('15_2'); - case '15_3': - $this->saveLogs('Execute 15_3'); - $this->execSQL($this->getUpgradeFile('15.3')); - $this->adjustBugRequired(); - $this->processTesttaskDate(); - $this->processDocTempContent(); - $this->appendExec('15_3'); - case '15_4': - $this->saveLogs('Execute 15_4'); - $this->execSQL($this->getUpgradeFile('15.4')); - if(empty($this->config->isINT)) - { - if(!$executeXuanxuan) - { - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.2.sql'; - $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan4.4.sql'; - $this->execSQL($xuanxuanSql); - } - } - $this->appendExec('15_4'); - case '15_5': - $this->saveLogs('Execute 15_5'); - $this->execSQL($this->getUpgradeFile('15.5')); - $this->appendExec('15_5'); - case '15_6': - $this->saveLogs('Execute 15_6'); - $this->execSQL($this->getUpgradeFile('15.6')); - $this->appendExec('15_6'); - case '15_7': - $this->saveLogs('Execute 15_7'); - $this->execSQL($this->getUpgradeFile('15.7')); - $this->appendExec('15_7'); - case '15_7_1': - $this->saveLogs('Execute 15_7_1'); - $this->execSQL($this->getUpgradeFile('15.7.1')); - $this->updateObjectBranch(); - $this->updateProjectStories(); - $this->updateProjectLinkedBranch(); - $this->appendExec('15_7_1'); - case '16_0_beta1': - $this->saveLogs('Execute 16_0_beta1'); - $this->execSQL($this->getUpgradeFile('16.0.beta1')); - $this->loadModel('api')->createDemoData($this->lang->api->zentaoAPI, 'http://' . $_SERVER['HTTP_HOST'] . $this->app->config->webRoot . 'api.php/v1', '16.0'); - $this->appendExec('16_0_beta1'); - case '16_0': - $this->saveLogs('Execute 16_0'); - $this->execSQL($this->getUpgradeFile('16.0')); - $this->appendExec('16_0'); - case '16_1': - $this->saveLogs('Execute 16_1'); - $this->execSQL($this->getUpgradeFile('16.1')); - $this->moveKanbanData(); - $this->appendExec('16_1'); - case '16_2': - $this->saveLogs('Execute 16_2'); - $this->execSQL($this->getUpgradeFile('16.2')); - $this->updateSpaceTeam(); - $this->updateDocField(); - $this->appendExec('16_2'); - case '16_3': - $this->saveLogs('Execute 16_3'); - $this->execSQL($this->getUpgradeFile('16.3')); - $this->appendExec('16_3'); - case '16_4': - $this->saveLogs('Execute 16_4'); - $this->execSQL($this->getUpgradeFile('16.4')); - $this->updateActivatedDate(); - $this->appendExec('16_4'); + $this->updateActivatedDate(); + break; } $this->deletePatch(); return true; } + /** + * Execute pro version sql. + * + * @param string $proVersion + * @access public + * @return void + */ + public function executePro($proVersion) + { + switch($proVersion) + { + case 'pro1_1_1': + $this->execSQL($this->getUpgradeFile('pro1.1')); + break; + case 'pro3_2_1': + $this->recordFinished(); + break; + case 'pro3_3': + $this->toLowerTable('pro'); + break; + case 'pro4_0': + $this->fixRepo(); + break; + case 'pro7_0_beta': + $this->fixReport(); + break; + case 'pro8_3': + $this->execSQL($this->getUpgradeFile('pro8.2')); //Fix bug #1752. + break; + case 'pro8_8': + $this->checkURAndSR(); + break; + case 'pro10_0_2': + $this->fixReportLang(); + break; + } + } + + /** + * Execute biz upgrade program. + * + * @param int $bizVersion + * @param bool $executeXuanxuan + * @access public + * @return void + */ + public function executeBiz($bizVersion, $executeXuanxuan) + { + switch($bizVersion) + { + case 'biz2_3_1': + $this->adjustFeedbackViewData(); + break; + case 'biz3_0': + if(!empty($this->config->isINT) and !$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.3.0.sql'; + $this->execSQL($xuanxuanSql); + $this->dao->update(TABLE_CONFIG)->set('value')->eq('off')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('0')->exec(); + $this->dao->update(TABLE_CONFIG)->set('value')->eq('on')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('1')->exec(); + } + break; + case 'biz3_2_1': + if(!empty($this->config->isINT)) + { + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.4.0.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.5.0.sql'; + $this->execSQL($xuanxuanSql); + } + $this->updateXX_11_5(); + } + break; + case 'biz3_4': + $this->importBuildinModules(); + break; + case 'biz3_5_alpha': + $this->addSubStatus(); + case 'biz3_5_beta': + $this->processSubTables(); + break; + case 'biz3_6': + $this->addDefaultActions(); + $this->importCaseLibModule(); + $this->deleteBuildinFields(); + break; + case 'biz3_6_1': + $this->addWorkflowActions(); + $this->processWorkflowLayout(); + $this->processWorkflowLabel(); + $this->processWorkflowCondition(); + if(!empty($this->config->isINT) and !$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan3.1.1.sql'; + $this->execSQL($xuanxuanSql); + } + break; + case 'biz3_7': + $this->processWorkflowFields(); + break; + case 'biz3_7_2': + $this->processFlowStatus(); + break; + case 'biz4_0_1': + $this->addMailtoFields(); + break; + case 'biz4_0_3': + $this->updateAttendStatus(); + $this->initView4WorkflowDatasource(); + break; + case 'biz5_0': + $this->adjustPrivBiz5_0_1(); + break; + case 'biz5_0_1': + $this->updateWorkflow4Execution(); + break; + case 'biz5_3_1': + $this->processFeedbackField(); + $this->addFileFields(); + $this->addReportActions(); + break; + case 'biz6_2': + $this->importLiteModules(); + break; + } + } + /** * Create the confirm contents. * @@ -781,7 +575,49 @@ class upgradeModel extends model public function getConfirm($fromVersion) { $confirmContent = ''; - switch($fromVersion) + + $openVersion = $fromVersion; + if(strpos($fromVersion, 'pro') !== false) + { + $openVersion = $this->config->proVersion[$fromVersion]; + $confirmContent .= $this->getProConfirm($fromVersion); + } + elseif(strpos($fromVersion, 'biz') !== false) + { + $openVersion = $this->config->bizVersion[$fromVersion]; + $proVersion = array_search($openVersion, $this->config->proVersion); + + $confirmContent .= $this->getProConfirm($proVersion); + $confirmContent .= $this->getBizConfirm($fromVersion); + } + elseif(strpos($fromVersion, 'max') !== false) + { + $openVersion = $this->config->maxVersion[$fromVersion]; + $proVersion = array_search($openVersion, $this->config->proVersion); + $bizVersion = array_search($openVersion, $this->config->bizVersion); + + $confirmContent .= $this->getProConfirm($proVersion); + $confirmContent .= $this->getBizConfirm($bizVersion); + $confirmContent .= $this->getMaxConfirm($fromVersion); + } + + $confirmContent .= $this->getOpenConfirm($openVersion, $fromVersion); + + return str_replace('zt_', $this->config->db->prefix, $confirmContent); + } + + /** + * Get open source confirm contents. + * + * @param string $openVersion + * @param string $fromVersion + * @access public + * @return void + */ + public function getOpenConfirm($openVersion, $fromVersion) + { + $confirmContent = ''; + switch($openVersion) { case '0_3beta': $confirmContent .= file_get_contents($this->getUpgradeFile('0.3')); case '0_4beta': $confirmContent .= file_get_contents($this->getUpgradeFile('0.4')); @@ -976,8 +812,237 @@ class upgradeModel extends model case '16_1': $confirmContent .= file_get_contents($this->getUpgradeFile('16.1')); case '16_2': $confirmContent .= file_get_contents($this->getUpgradeFile('16.2')); case '16_3': $confirmContent .= file_get_contents($this->getUpgradeFile('16.3')); + case '16_4': + if(strpos($fromVersion, 'pro') === false and strpos($fromVersion, 'biz') === false and strpos($fromVersion, 'max') === false) + { + $confirmContent .= file_get_contents($this->getUpgradeFile('proinstall')); + } + + if(strpos($fromVersion, 'biz') === false and strpos($fromVersion, 'max') === false) + { + $confirmContent .= file_get_contents($this->getUpgradeFile('bizinstall')); + } + + if(strpos($fromVersion, 'max') === false) + { + $confirmContent .= file_get_contents($this->getUpgradeFile('maxinstall')); + $confirmContent .= file_get_contents($this->getUpgradeFile('functions')); + } + + $confirmContent .= file_get_contents($this->getUpgradeFile('16.4')); } - return str_replace('zt_', $this->config->db->prefix, $confirmContent); + + return $confirmContent; + } + + /** + * Get pro version confirm contents. + * + * @param string $fromVersion + * @access public + * @return void + */ + public function getProConfirm($fromVersion) + { + $confirmContent = ''; + switch($fromVersion) + { + case 'pro1_0': $confirmContent .= file_get_contents($this->getUpgradeFile('pro1.0')); + case 'pro1_1': + case 'pro1_1_1': $confirmContent .= file_get_contents($this->getUpgradeFile('pro1.1')); + case 'pro1_2': + case 'pro1_3': $confirmContent .= file_get_contents($this->getUpgradeFile('pro1.3')); + case 'pro2_0': + case 'pro2_0_1': + case 'pro2_1': $confirmContent .= file_get_contents($this->getUpgradeFile('pro2.1')); + case 'pro2_2_beta': + case 'pro2_3_beta': + case 'pro3_0_beta1': + case 'pro3_0': $confirmContent .= file_get_contents($this->getUpgradeFile('pro3.0')); + case 'pro3_1': + case 'pro3_2': + case 'pro3_2_1': + case 'pro3_3': + case 'pro4_0_beta1': + case 'pro4_0': $confirmContent .= file_get_contents($this->getUpgradeFile('pro4.0')); + case 'pro4_1_beta': + case 'pro4_2': $confirmContent .= file_get_contents($this->getUpgradeFile('pro4.2')); + case 'pro4_3': $confirmContent .= file_get_contents($this->getUpgradeFile('pro4.3')); + case 'pro4_4': $confirmContent .= file_get_contents($this->getUpgradeFile('pro4.4')); + case 'pro4_5': $confirmContent .= file_get_contents($this->getUpgradeFile('pro4.5')); + case 'pro4_6': $confirmContent .= file_get_contents($this->getUpgradeFile('pro4.6')); + case 'pro4_7': + case 'pro4_7_1': $confirmContent .= file_get_contents($this->getUpgradeFile('pro4.7.1')); + case 'pro5_0': + case 'pro5_0_1': $confirmContent .= file_get_contents($this->getUpgradeFile('pro5.0.1')); + case 'pro5_1': + case 'pro5_1_3': $confirmContent .= file_get_contents($this->getUpgradeFile('pro5.1.3')); + case 'pro5_2': + case 'pro5_2_1': + case 'pro5_3': + case 'pro5_3_1': + case 'pro5_3_2': + case 'pro5_3_3': + case 'pro5_4': + case 'pro5_4_1': + case 'pro5_5': + case 'pro5_5_1': + case 'pro6_0_beta': + case 'pro6_0': + case 'pro6_0_1': + case 'pro6_1': + case 'pro6_2': + case 'pro6_3': + case 'pro6_3_1': + case 'pro6_4': $confirmContent .= file_get_contents($this->getUpgradeFile('pro6.4')); + case 'pro6_5': + case 'pro6_5_1': $confirmContent .= file_get_contents($this->getUpgradeFile('pro6.5.1')); + case 'pro6_6': + case 'pro6_6_1': $confirmContent .= file_get_contents($this->getUpgradeFile('pro6.6.1')); + case 'pro6_7': + case 'pro6_7_1': + case 'pro6_7_2': + case 'pro6_7_3': + case 'pro7_0_beta': $confirmContent .= file_get_contents($this->getUpgradeFile('pro7.0.beta')); + case 'pro7_1': + case 'pro7_2': + case 'pro7_3': + case 'pro7_4': + case 'pro7_5': + case 'pro7_5_1': $confirmContent .= file_get_contents($this->getUpgradeFile('pro7.5.1')); + case 'pro8_0': + case 'pro8_1': + case 'pro8_2': $confirmContent .= file_get_contents($this->getUpgradeFile('pro8.2')); + case 'pro8_3': $confirmContent .= file_get_contents($this->getUpgradeFile('pro8.3')); + case 'pro8_3_1': + case 'pro8_4': $confirmContent .= file_get_contents($this->getUpgradeFile('pro8.4')); + case 'pro8_5': + case 'pro8_5_1': $confirmContent .= file_get_contents($this->getUpgradeFile('pro8.5.1')); + case 'pro8_5_2': + case 'pro8_5_3': + case 'pro8_6': $confirmContent .= file_get_contents($this->getUpgradeFile('pro8.6')); + case 'pro8_7': + case 'pro8_8': + case 'pro8_8_1': + case 'pro8_8_2': + case 'pro8_8_3': + case 'pro8_9': + case 'pro8_9_1': + case 'pro8_9_2': + case 'pro8_9_3': $confirmContent .= file_get_contents($this->getUpgradeFile('pro8.9.3')); + case 'pro8_9_4': + case 'pro9_0': + case 'pro9_0_1': + case 'pro9_0_2': + case 'pro9_0_3': $confirmContent .= file_get_contents($this->getUpgradeFile('pro9.0.3')); + case 'pro10_0_rc1': + case 'pro10_0': + case 'pro10_0_1': + case 'pro10_0_2': $confirmContent .= file_get_contents($this->getUpgradeFile('pro10.0.2')); + case 'pro10_1': + case 'pro10_2': + case 'pro10_3': + case 'pro10_3_1': + case 'pro11_0_beta1': + } + + return $confirmContent; + } + + /** + * Get biz version confirm contents. + * + * @param string $fromVersion + * @access public + * @return void + */ + public function getBizConfirm($fromVersion) + { + $confirmContent = ''; + switch($fromVersion) + { + case 'biz1_0': $confirmContent .= file_get_contents($this->getUpgradeFile('biz1.0')); + case 'biz1_1': + case 'biz1_1_1': + case 'biz1_1_2': + case 'biz1_1_3': + case 'biz1_1_4': + case 'biz2_0_beta': + case 'biz2_1': + case 'biz2_2': $confirmContent .= file_get_contents($this->getUpgradeFile('biz2.2')); + case 'biz2_3': + case 'biz2_3_1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz2.3.1')); + case 'biz2_4': $confirmContent .= file_get_contents($this->getUpgradeFile('biz2.4')); + case 'biz3_0': + if(!empty($this->config->isINT)) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.3.0.sql'; + $confirmContent .= file_get_contents($xuanxuanSql); + } + case 'biz3_1': + case 'biz3_2': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.2')); + case 'biz3_2_1': + case 'biz3_3': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.3')); + case 'biz3_4': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.4')); + case 'biz3_5_alpha': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.5.alpha')); + case 'biz3_5_beta': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.5.beta')); + case 'biz3_5': + case 'biz3_5_1': + case 'biz3_6': + case 'biz3_6_1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.6.1')); + case 'biz3_7': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.7')); + case 'biz3_7_1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.7.1')); + case 'biz3_7_2': $confirmContent .= file_get_contents($this->getUpgradeFile('biz3.7.2')); + case 'biz4_0': $confirmContent .= file_get_contents($this->getUpgradeFile('biz4.0')); + case 'biz4_0_1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz4.0.1')); + case 'biz4_0_2': $confirmContent .= file_get_contents($this->getUpgradeFile('biz4.0.2')); + case 'biz4_0_3': $confirmContent .= file_get_contents($this->getUpgradeFile('biz4.0.3')); + case 'biz4_0_4': $confirmContent .= file_get_contents($this->getUpgradeFile('biz4.0.4')); + case 'biz4_1': + case 'biz4_1_1': + case 'biz4_1_2': + case 'biz4_1_3': $confirmContent .= file_get_contents($this->getUpgradeFile('biz4.1.3')); + case 'biz5_0_rc1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz5.0.rc1')); + case 'biz5_0': + case 'biz5_0_1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz5.0.1')); + case 'biz5_1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz5.1')); + case 'biz5_2': + case 'biz5_3': + case 'biz5_3_1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz5.3.1')); + case 'biz6_0_beta1': $confirmContent .= file_get_contents($this->getUpgradeFile('biz6.0.beta1')); + case 'biz6_0': + case 'biz6_1': + } + + return $confirmContent; + } + + /** + * Get max version confirm contents. + * + * @param string $fromVersion + * @access public + * @return void + */ + public function getMaxConfirm($fromVersion) + { + $confirmContent = ''; + if($fromVersion == 'max2_0_beta4' && $this->config->version != 'max2.0.rc1') $fromVersion = 'max2_0_rc1'; + + switch($fromVersion) + { + case 'max2_0_rc1': + case 'max2_0_beta4': $confirmContent .= file_get_contents($this->getUpgradeFile('max2.0.beta4')); + case 'max2_0': $confirmContent .= file_get_contents($this->getUpgradeFile('max2.0')); + case 'max2_1': + case 'max2_2': $confirmContent .= file_get_contents($this->getUpgradeFile('max2.2')); + case 'max2_3': + case 'max2_3_1': $confirmContent .= file_get_contents($this->getUpgradeFile('max2.3.1')); + case 'max2_4_beta1': $confirmContent .= file_get_contents($this->getUpgradeFile('max2.4.beta1')); + case 'max2_4': + } + + return $confirmContent; } /** @@ -4364,9 +4429,9 @@ class upgradeModel extends model if(isset($data->newProgram)) { - if(!$this->post->longTime and !$this->post->end and isset($data->begin)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->end))); + if(!$this->post->longTime and !$this->post->end and isset($data->begin)) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->end))); - if(isset($data->projectName) and $data->projectType == 'execution' and empty($data->projectName)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->projectName))); + if(isset($data->projectName) and $data->projectType == 'execution' and empty($data->projectName)) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->projectName))); /* Insert program. */ $program = new stdclass(); @@ -4445,7 +4510,7 @@ class upgradeModel extends model if(isset($data->newProject)) { - if(!$this->post->longTime and !$this->post->end) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->end))); + if(!$this->post->longTime and !$this->post->end) return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->end))); /* Create a project. */ $this->loadModel('action'); @@ -4618,7 +4683,7 @@ class upgradeModel extends model /* No project is created when there are no sprints. */ if(!$sprintIdList) return; - if(!$projectID) die(js::alert($this->lang->upgrade->projectEmpty)); + if(!$projectID) return print(js::alert($this->lang->upgrade->projectEmpty)); $this->dao->update(TABLE_BUG)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec(); $this->dao->update(TABLE_TESTREPORT)->set('project')->eq($projectID)->where('product')->in($productIdList)->exec(); @@ -4961,17 +5026,6 @@ class upgradeModel extends model return true; } - /** - * Append execute for pro and biz. - * - * @param string $fromVersion - * @access public - * @return void - */ - public function appendExec($zentaoVersion) - { - } - /** * Init story sort of plan. * @@ -5633,4 +5687,163 @@ class upgradeModel extends model } return true; } + + /** + * Get extent files. + * + * @access public + * @return array + */ + public function getEXTFiles() + { + $files = array(); + $allModules = scandir($this->app->moduleRoot); + $skipModules = $this->getEncryptModules($allModules); + + foreach($allModules as $module) + { + if($module === '.' or $module === '..' or in_array($module, $skipModules)) continue; + + $dirPath = in_array($module, $this->config->upgrade->PMSModules) ? $this->app->moduleRoot . $module . DIRECTORY_SEPARATOR . 'ext' : $this->app->moduleRoot . $module; + $dirs = scandir($dirPath); + foreach($dirs as $dir) + { + if($dir === '.' or $dir === '..') continue; + + $realPath = is_file($dirPath . DIRECTORY_SEPARATOR . $dir) ? $dirPath : $dirPath . DIRECTORY_SEPARATOR . $dir; + $path = in_array($module, $this->config->upgrade->PMSModules) ? $module . DIRECTORY_SEPARATOR . 'ext' . DIRECTORY_SEPARATOR . $dir : $module . DIRECTORY_SEPARATOR . $dir; + if(is_dir($realPath)) + { + $extFiles = $this->getPluginFiles($module, $dir, $realPath, $path); + $files += $extFiles; + } + } + } + + return $files; + } + + /** + * Get encrypt modules. + * + * @param array $allModules + * @access public + * @return array + */ + public function getEncryptModules($allModules) + { + $encryptModules = array(); + foreach($allModules as $module) + { + if($module === '.' or $module === '..') continue; + + $customFiles = array(); + if(in_array($module, $this->config->upgrade->PMSModules)) + { + $extRoot = $this->app->moduleRoot . $module . DIRECTORY_SEPARATOR . 'ext'; + if(!is_dir($extRoot)) + { + $encryptModules[] = $module; + continue; + } + else + { + foreach(array('control', 'model') as $dir) + { + $realPath = $extRoot . DIRECTORY_SEPARATOR . $dir; + $path = $module . DIRECTORY_SEPARATOR . 'ext' . DIRECTORY_SEPARATOR . $dir; + if(!is_dir($realPath)) continue; + $customFiles += $this->getPluginFiles($module, $dir, $realPath, $path); + } + } + } + else + { + foreach(array('control.php', 'model.php') as $file) + { + $realPath = $this->app->moduleRoot . $module; + $filePath = $this->app->moduleRoot . $module . DIRECTORY_SEPARATOR . $file; + if(!is_file($filePath)) continue; + + $customFiles += $this->getPluginFiles($module, $file, $realPath, $module); + } + } + + if(empty($customFiles)) $encryptModules[] = $module; + } + return $encryptModules; + } + + /** + * Get plugin files. + * + * @param string $module + * @param string $dir + * @param string $realPath + * @param string $path + * @access public + * @return array + */ + public function getPluginFiles($module, $dir, $realPath, $path) + { + $files = array(); + $extFiles = is_file($realPath . DIRECTORY_SEPARATOR . $dir) ? array($dir) : scandir($realPath); + foreach($extFiles as $extFile) + { + if($extFile === '.' or $extFile === '..') continue; + + $filePath = $realPath . DIRECTORY_SEPARATOR . $extFile; + $fileName = is_file($realPath . DIRECTORY_SEPARATOR . $dir) ? $path : $path . DIRECTORY_SEPARATOR . $extFile; + + /* If the current point to a directory, traverse the files in the directory. */ + if(is_dir($filePath)) + { + $pluginFiles = $this->getPluginFiles($module, $dir, $filePath, $fileName); + $files += $pluginFiles; + } + else + { + $handle = fopen($filePath, 'r'); + $i = 0; + $line = ''; + while(!feof($handle)) + { + $line = fgets($handle); + if(++ $i > 1) break; + } + fclose($handle); + + /* Determine whether the current file is encrypted. */ + if(strpos($line, "extension_loaded('ionCube Loader')") === false) + { + $files[$fileName] = $fileName; + } + } + } + + return $files; + } + + /** + * Move extent files. + * + * @access public + * @return void + */ + public function moveEXTFiles() + { + $data = fixer::input('post')->get(); + $customRoot = $this->app->appRoot . 'extension' . DIRECTORY_SEPARATOR . 'custom'; + if(!is_dir($customRoot)) @mkdir($customRoot, 0777); + + foreach($data->files as $file) + { + $dirRoot = $customRoot . DIRECTORY_SEPARATOR . dirname($file); + $fileName = basename($file); + $fromPath = $this->app->getModuleRoot() . $file; + $toPath = $dirRoot . DIRECTORY_SEPARATOR . $fileName; + if(!is_dir($dirRoot)) @mkdir($dirRoot, 0777, true); + copy($fromPath, $toPath); + } + } } diff --git a/module/upgrade/view/moveextfiles.html.php b/module/upgrade/view/moveextfiles.html.php new file mode 100644 index 0000000000..51a9b7eb6d --- /dev/null +++ b/module/upgrade/view/moveextfiles.html.php @@ -0,0 +1,31 @@ + + * @package upgrade + * @version $Id: moveextfiles.html.php 5119 2022-02-21 13:22:42Z $ + */ +?> + +
    + + + +
    + diff --git a/module/user/control.php b/module/user/control.php index 21651689b9..066bd48f55 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -60,8 +60,8 @@ class user extends control { $userID = (int)$userID; $user = $this->user->getById($userID, 'id'); - if(empty($user)) die(js::error($this->lang->notFound) . js::locate($this->createLink('my', 'team'))); - if($user->deleted == 1) die(js::error($this->lang->user->noticeHasDeleted) . js::locate('back')); + if(empty($user)) return print(js::error($this->lang->notFound) . js::locate($this->createLink('my', 'team'))); + if($user->deleted == 1) return print(js::error($this->lang->user->noticeHasDeleted) . js::locate('back')); /* Set thie url to session. */ $uri = $this->app->getURI(true); @@ -81,7 +81,7 @@ class user extends control $todos = $this->todo->getList($type, $account, $status, 0, $pager, $sort); $date = (int)$type == 0 ? helper::today() : $type; $users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'id'); - if(!isset($users[$userID])) die(js::error($this->lang->user->error->noAccess) . js::locate('back')); + if(!isset($users[$userID])) return print(js::error($this->lang->user->error->noAccess) . js::locate('back')); /* set menus. */ $this->view->userList = $this->user->setUserList($users, $userID); @@ -524,7 +524,10 @@ class user extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('company', 'browse'))); } - $groups = $this->dao->select('id, name, role')->from(TABLE_GROUP)->fetchAll(); + $groups = $this->dao->select('id, name, role') + ->from(TABLE_GROUP) + ->where('vision')->eq($this->config->vision) + ->fetchAll(); $groupList = array('' => ''); $roleGroup = array(); foreach($groups as $group) @@ -556,7 +559,10 @@ class user extends control */ public function batchCreate($deptID = 0) { - $groups = $this->dao->select('id, name, role')->from(TABLE_GROUP)->fetchAll(); + $groups = $this->dao->select('id, name, role') + ->from(TABLE_GROUP) + ->where('vision')->eq($this->config->vision) + ->fetchAll(); $groupList = array('' => ''); $roleGroup = array(); foreach($groups as $group) @@ -573,7 +579,7 @@ class user extends control $userIDList = $this->user->batchCreate(); if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $userIDList)); - die(js::locate($this->createLink('company', 'browse'), 'parent')); + return print(js::locate($this->createLink('company', 'browse'), 'parent')); } /* Set custom. */ @@ -654,7 +660,7 @@ class user extends control elseif($_POST) { if($this->post->account) $this->user->batchEdit(); - die(js::locate($this->session->userList ? $this->session->userList : $this->createLink('company', 'browse', "deptID=$deptID"), 'parent')); + return print(js::locate($this->session->userList ? $this->session->userList : $this->createLink('company', 'browse', "deptID=$deptID"), 'parent')); } $this->lang->user->menu = $this->lang->company->menu; $this->lang->user->menuOrder = $this->lang->company->menuOrder; @@ -693,7 +699,7 @@ class user extends control if($this->app->user->admin and $this->app->user->account == $user->account) return; if($_POST) { - if($this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) die(js::alert($this->lang->user->error->verifyPassword)); + if($this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) return print(js::alert($this->lang->user->error->verifyPassword)); $this->user->delete(TABLE_USER, $userID); if(!dao::isError()) { @@ -716,7 +722,7 @@ class user extends control } return $this->send($response); } - die(js::locate($this->session->userList, 'parent.parent')); + return print(js::locate($this->session->userList, 'parent.parent')); } $this->view->rand = $this->user->updateSessionRandom(); @@ -734,11 +740,11 @@ class user extends control */ public function unlock($userID, $confirm = 'no') { - if($confirm == 'no') die(js::confirm($this->lang->user->confirmUnlock, $this->createLink('user', 'unlock', "userID=$userID&confirm=yes"))); + if($confirm == 'no') return print(js::confirm($this->lang->user->confirmUnlock, $this->createLink('user', 'unlock', "userID=$userID&confirm=yes"))); $user = $this->user->getById($userID, 'id'); $this->user->cleanLocked($user->account); - die(js::locate($this->session->userList ? $this->session->userList : $this->createLink('company', 'browse'), 'parent')); + return print(js::locate($this->session->userList ? $this->session->userList : $this->createLink('company', 'browse'), 'parent')); } /** @@ -751,11 +757,11 @@ class user extends control */ public function unbind($userID, $confirm = 'no') { - if($confirm == 'no') die(js::confirm($this->lang->user->confirmUnbind, $this->createLink('user', 'unbind', "userID=$userID&confirm=yes"))); + if($confirm == 'no') return print(js::confirm($this->lang->user->confirmUnbind, $this->createLink('user', 'unbind', "userID=$userID&confirm=yes"))); $user = $this->user->getById($userID, 'id'); $this->user->unbind($user->account); - die(js::locate($this->session->userList ? $this->session->userList : $this->createLink('company', 'browse'), 'parent')); + return print(js::locate($this->session->userList ? $this->session->userList : $this->createLink('company', 'browse'), 'parent')); } @@ -787,11 +793,11 @@ class user extends control { if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - die(sprintf($this->lang->user->mkdirWin, $floderPath, $floderPath)); + return print(sprintf($this->lang->user->mkdirWin, $floderPath, $floderPath)); } else { - die(sprintf($this->lang->user->mkdirLinux, $floderPath, $floderPath, $floderPath, $floderPath)); + return print(sprintf($this->lang->user->mkdirLinux, $floderPath, $floderPath, $floderPath, $floderPath)); } } @@ -813,7 +819,7 @@ class user extends control if($this->app->getViewType() == 'json') { $data = $this->user->getDataInJSON($this->app->user); - die(helper::removeUTF8Bom(json_encode(array('status' => 'success') + $data))); + return print(helper::removeUTF8Bom(json_encode(array('status' => 'success') + $data))); } $response['result'] = 'success'; @@ -847,7 +853,7 @@ class user extends control { $response['result'] = 'fail'; $response['message'] = sprintf($this->lang->user->loginLocked, $this->config->user->lockMinutes); - if($this->app->getViewType() == 'json') die(helper::removeUTF8Bom(json_encode(array('status' => 'failed', 'reason' => $failReason)))); + if($this->app->getViewType() == 'json') return print(helper::removeUTF8Bom(json_encode(array('status' => 'failed', 'reason' => $failReason)))); return $this->send($response); } @@ -871,7 +877,7 @@ class user extends control if($this->app->getViewType() == 'json') { $data = $this->user->getDataInJSON($user); - die(helper::removeUTF8Bom(json_encode(array('status' => 'success') + $data))); + return print(helper::removeUTF8Bom(json_encode(array('status' => 'success') + $data))); } /* Get the module and method of the referer. */ @@ -911,7 +917,7 @@ class user extends control if($this->app->getViewType() == 'json') { $data = $this->user->getDataInJSON($user); - die(helper::removeUTF8Bom(json_encode(array('status' => 'success') + $data))); + return print(helper::removeUTF8Bom(json_encode(array('status' => 'success') + $data))); } $response['locate'] = $this->config->webRoot; @@ -923,7 +929,7 @@ class user extends control { $response['result'] = 'fail'; $fails = $this->user->failPlus($account); - if($this->app->getViewType() == 'json') die(helper::removeUTF8Bom(json_encode(array('status' => 'failed', 'reason' => $this->lang->user->loginFailed)))); + if($this->app->getViewType() == 'json') return print(helper::removeUTF8Bom(json_encode(array('status' => 'failed', 'reason' => $this->lang->user->loginFailed)))); $remainTimes = $this->config->user->failTimes - $fails; if($remainTimes <= 0) { @@ -993,7 +999,7 @@ class user extends control $this->view->denyType = $denyType; - die($this->display()); + $this->display(); } /** @@ -1009,7 +1015,7 @@ class user extends control setcookie('za', false); setcookie('zp', false); - if($this->app->getViewType() == 'json') die(json_encode(array('status' => 'success'))); + if($this->app->getViewType() == 'json') return print(json_encode(array('status' => 'success'))); $vars = !empty($referer) ? "referer=$referer" : ''; $this->locate($this->createLink('user', 'login', $vars)); } @@ -1035,15 +1041,15 @@ class user extends control if($_POST) { - if($needCreateFile) die(js::reload('parent')); + if($needCreateFile) return print(js::reload('parent')); $result = $this->user->resetPassword(); - if(dao::isError()) die(js::error(dao::getError())); - if(!$result) die(js::alert($this->lang->user->resetFail)); + if(dao::isError()) return print(js::error(dao::getError())); + if(!$result) return print(js::alert($this->lang->user->resetFail)); echo js::alert($this->lang->user->resetSuccess); $referer = helper::safe64Encode($this->createLink('index', 'index')); - die(js::locate(inlink('logout', 'referer=' . $referer), 'parent')); + return print(js::locate(inlink('logout', 'referer=' . $referer), 'parent')); } /* Remove the real path for security reason. */ @@ -1229,7 +1235,7 @@ class user extends control { $this->user->saveUserTemplate($type); if(dao::isError()) echo js::error(dao::getError(), $full = false); - die($this->fetch('user', 'ajaxPrintTemplates', "type=$type")); + return print($this->fetch('user', 'ajaxPrintTemplates', "type=$type")); } /** @@ -1244,7 +1250,6 @@ class user extends control $this->dao->delete()->from(TABLE_USERTPL)->where('id')->eq($templateID) ->beginIF(!$this->app->user->admin)->andWhere('account')->eq($this->app->user->account)->fi() ->exec(); - die(); } /** @@ -1272,7 +1277,7 @@ class user extends control $newUsers[$account] = $realname; } - die(json_encode($newUsers)); + echo json_encode($newUsers); } /** @@ -1284,6 +1289,6 @@ class user extends control public function refreshRandom() { $rand = (string)$this->user->updateSessionRandom(); - die($rand); + echo $rand; } } diff --git a/module/user/model.php b/module/user/model.php index 0d09c394ec..b609bda207 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -375,7 +375,7 @@ class userModel extends model */ public function batchCreate() { - if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) die(js::alert($this->lang->user->error->verifyPassword)); + if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) return print(js::alert($this->lang->user->error->verifyPassword)); $users = fixer::input('post')->get(); $data = array(); @@ -385,24 +385,24 @@ class userModel extends model $users->account[$i] = trim($users->account[$i]); if($users->account[$i] != '') { - if(strtolower($users->account[$i]) == 'guest') die(js::error(sprintf($this->lang->user->error->reserved, $i + 1))); + if(strtolower($users->account[$i]) == 'guest') return print(js::error(sprintf($this->lang->user->error->reserved, $i + 1))); $account = $this->dao->select('account')->from(TABLE_USER)->where('account')->eq($users->account[$i])->fetch(); - if($account) die(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1))); - if(in_array($users->account[$i], $accounts)) die(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1))); - if(!validater::checkAccount($users->account[$i])) die(js::error(sprintf($this->lang->user->error->account, $i + 1))); - if($users->realname[$i] == '') die(js::error(sprintf($this->lang->user->error->realname, $i + 1))); - if($users->email[$i] and !validater::checkEmail($users->email[$i])) die(js::error(sprintf($this->lang->user->error->mail, $i + 1))); + if($account) return print(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1))); + if(in_array($users->account[$i], $accounts)) return print(js::error(sprintf($this->lang->user->error->accountDupl, $i + 1))); + if(!validater::checkAccount($users->account[$i])) return print(js::error(sprintf($this->lang->user->error->account, $i + 1))); + if($users->realname[$i] == '') return print(js::error(sprintf($this->lang->user->error->realname, $i + 1))); + if($users->email[$i] and !validater::checkEmail($users->email[$i])) return print(js::error(sprintf($this->lang->user->error->mail, $i + 1))); $users->password[$i] = (isset($prev['password']) and $users->ditto[$i] == 'on' and !$this->post->password[$i]) ? $prev['password'] : $this->post->password[$i]; - if(!validater::checkReg($users->password[$i], '|(.){6,}|')) die(js::error(sprintf($this->lang->user->error->password, $i + 1))); + if(!validater::checkReg($users->password[$i], '|(.){6,}|')) return print(js::error(sprintf($this->lang->user->error->password, $i + 1))); $role = $users->role[$i] == 'ditto' ? (isset($prev['role']) ? $prev['role'] : '') : $users->role[$i]; $visions = in_array('ditto', $users->visions[$i]) ? (isset($prev['visions']) ? $prev['visions'] : array()) : $users->visions[$i]; /* Check weak and common weak password. */ - if(isset($this->config->safe->mode) and $this->computePasswordStrength($users->password[$i]) < $this->config->safe->mode) die(js::error(sprintf($this->lang->user->error->weakPassword, $i + 1))); + if(isset($this->config->safe->mode) and $this->computePasswordStrength($users->password[$i]) < $this->config->safe->mode) return print(js::error(sprintf($this->lang->user->error->weakPassword, $i + 1))); if(!empty($this->config->safe->changeWeak)) { if(!isset($this->config->safe->weak)) $this->app->loadConfig('admin'); - if(strpos(",{$this->config->safe->weak},", ",{$users->password[$i]},") !== false) die(js::error(sprintf($this->lang->user->error->dangerPassword, $i + 1, $this->config->safe->weak))); + if(strpos(",{$this->config->safe->weak},", ",{$users->password[$i]},") !== false) return print(js::error(sprintf($this->lang->user->error->dangerPassword, $i + 1, $this->config->safe->weak))); } $data[$i] = new stdclass(); @@ -438,7 +438,7 @@ class userModel extends model if(!isset($data[$i]->$field)) continue; if(!empty($data[$i]->$field)) continue; - die(js::error(sprintf($this->lang->error->notempty, $this->lang->user->$field))); + return print(js::error(sprintf($this->lang->error->notempty, $this->lang->user->$field))); } /* Change for append field, such as feedback. */ @@ -485,7 +485,7 @@ class userModel extends model if(dao::isError()) { echo js::error(dao::getError()); - die(js::reload('parent')); + return print(js::reload('parent')); } else { @@ -638,7 +638,7 @@ class userModel extends model public function batchEdit() { $data = fixer::input('post')->get(); - if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) die(js::alert($this->lang->user->error->verifyPassword)); + if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) return print(js::alert($this->lang->user->error->verifyPassword)); $oldUsers = $this->dao->select('id, account, email')->from(TABLE_USER)->where('id')->in(array_keys($data->account))->fetchAll('id'); $accountGroup = $this->dao->select('id, account')->from(TABLE_USER)->where('account')->in($data->account)->fetchGroup('account', 'id'); @@ -675,7 +675,7 @@ class userModel extends model if(!isset($users[$id][$field])) continue; if(!empty($users[$id][$field])) continue; - die(js::error(sprintf($this->lang->error->notempty, $this->lang->user->$field))); + return print(js::error(sprintf($this->lang->error->notempty, $this->lang->user->$field))); } if(!empty($this->config->user->batchAppendFields)) @@ -690,11 +690,11 @@ class userModel extends model } } - if(isset($accountGroup[$account]) and count($accountGroup[$account]) > 1) die(js::error(sprintf($this->lang->user->error->accountDupl, $id))); - if(in_array($account, $accounts)) die(js::error(sprintf($this->lang->user->error->accountDupl, $id))); - if(!validater::checkAccount($users[$id]['account'])) die(js::error(sprintf($this->lang->user->error->account, $id))); - if($users[$id]['realname'] == '') die(js::error(sprintf($this->lang->user->error->realname, $id))); - if($users[$id]['email'] and !validater::checkEmail($users[$id]['email'])) die(js::error(sprintf($this->lang->user->error->mail, $id))); + if(isset($accountGroup[$account]) and count($accountGroup[$account]) > 1) return print(js::error(sprintf($this->lang->user->error->accountDupl, $id))); + if(in_array($account, $accounts)) return print(js::error(sprintf($this->lang->user->error->accountDupl, $id))); + if(!validater::checkAccount($users[$id]['account'])) return print(js::error(sprintf($this->lang->user->error->account, $id))); + if($users[$id]['realname'] == '') return print(js::error(sprintf($this->lang->user->error->realname, $id))); + if($users[$id]['email'] and !validater::checkEmail($users[$id]['email'])) return print(js::error(sprintf($this->lang->user->error->mail, $id))); $accounts[$id] = $account; $prev['dept'] = $users[$id]['dept']; @@ -1406,13 +1406,13 @@ class userModel extends model if(empty($data->listName)) { dao::$errors['listName'][] = sprintf($this->lang->error->notempty, $this->lang->user->contacts->listName); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } $this->dao->insert(TABLE_USERCONTACT)->data($data) ->autoCheck() ->exec(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); return $this->dao->lastInsertID(); } @@ -1435,13 +1435,13 @@ class userModel extends model if(empty($data->listName)) { dao::$errors['listName'][] = sprintf($this->lang->error->notempty, $this->lang->user->contacts->listName); - die(js::error(dao::getError())); + return print(js::error(dao::getError())); } $this->dao->update(TABLE_USERCONTACT)->data($data) ->where('id')->eq($listID) ->exec(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); } /** diff --git a/module/user/view/bug.html.php b/module/user/view/bug.html.php index 7543feadf9..08d097a804 100644 --- a/module/user/view/bug.html.php +++ b/module/user/view/bug.html.php @@ -40,7 +40,7 @@
    idAB);?> bug->severityAB);?> priAB);?>priAB);?> typeAB);?> bug->title);?> openedByAB);?>
    idAB);?> priAB);?>priAB);?> story->project);?>
    idAB;?>priAB);?>priAB);?> task->execution);?> task->name);?> task->estimateAB;?>
    idAB);?> priAB);?>priAB);?> testcase->title);?> typeAB);?> openedByAB);?> idAB);?> todo->date);?> todo->type);?> priAB);?> priAB);?> todo->name);?> todo->beginAB);?> todo->endAB);?>