diff --git a/framework/base/router.class.php b/framework/base/router.class.php index bc154790f7..15b02574ca 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2793,7 +2793,7 @@ class EndResponseException extends \Exception /** * @param string $content * - * @return sellf + * @return self */ public static function create($content = '') { diff --git a/module/action/model.php b/module/action/model.php index e83e3f2ba1..9cb6b0ca03 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1227,17 +1227,21 @@ class actionModel extends model if(!common::hasPriv($moduleName, $methodName) and !$isLoginOrLogout) return false; $action->objectLabel = $objectLabel; + $action->product = trim($action->product, ','); if(isset($this->config->maxVersion) and strpos($this->config->action->assetType, $action->objectType) !== false and empty($action->project) and empty($action->product) and empty($action->execution)) { - $method = $this->config->action->assetViewMethod[$action->objectType]; if($action->objectType == 'doc') { $assetLibType = $this->dao->select('assetLibType')->from(TABLE_DOC)->where('id')->eq($action->objectID)->fetch('assetLibType'); $method = $assetLibType == 'practice' ? 'practiceView' : 'componentView'; } + else + { + $method = $this->config->action->assetViewMethod[$action->objectType]; + } $action->objectLink = helper::createLink('assetlib', $method, sprintf($vars, $action->objectID)); } diff --git a/module/block/view/scrumoverviewblock.html.php b/module/block/view/scrumoverviewblock.html.php index 9d04315843..fcf990cc03 100644 --- a/module/block/view/scrumoverviewblock.html.php +++ b/module/block/view/scrumoverviewblock.html.php @@ -31,7 +31,7 @@ block->totalStory . ':';?> allStories;?> block->totalPeople . ':';?> - teamCount ? html::a($this->createLink('project', 'team', 'projectID=' . $projectID), $totalData[$projectID]->teamCount) : 0;?> + teamCount ? html::a($this->createLink('project', 'team', 'projectID=' . $projectID), $totalData[$projectID]->teamCount) : 0;?> block->estimatedHours . ':';?> estimate . $lang->execution->workHour;?> block->totalBug. ':';?> diff --git a/module/bug/model.php b/module/bug/model.php index 9d8e662703..dabf556e08 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -764,8 +764,8 @@ class bugModel extends model $bug->resolution = $data->resolutions[$bugID]; $bug->duplicateBug = $data->duplicateBugs[$bugID] ? $data->duplicateBugs[$bugID] : $oldBug->duplicateBug; - if($bug->assignedTo != $oldBug->assignedTo) $bug->assignedDate = $now; - if($bug->resolution != '') $bug->confirmed = 1; + if($bug->assignedTo != $oldBug->assignedTo) $bug->assignedDate = $now; + if($bug->resolution != '') $bug->confirmed = 1; if(($bug->resolvedBy != '' or $bug->resolution != '') and $oldBug->status != 'closed') { $bug->resolvedDate = $now; @@ -2694,6 +2694,8 @@ class bugModel extends model * @param array $stories * @param array $tasks * @param string $mode + * @param array $projectPairs + * * @access public * @return void */ diff --git a/module/doc/control.php b/module/doc/control.php index 53ac19ad54..81c6979113 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -805,8 +805,10 @@ class doc extends control return print(html::select('users[]', $users, $whitelist, "class='form-control chosen' multiple")); } - - return print(html::select('users[]', $users, $doclib->users, "class='form-control chosen' multiple")); + else + { + return print(html::select('users[]', $users, $doclib->users, "class='form-control chosen' multiple")); + } } /** diff --git a/module/doc/js/common.js b/module/doc/js/common.js index c64d0268ba..13d5973f69 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -7,7 +7,7 @@ */ function loadModules(libID) { - link = createLink('doc', 'ajaxGetModules', 'libID=' + libID); + var link = createLink('doc', 'ajaxGetModules', 'libID=' + libID); $('#moduleBox').load(link, function(){$('#moduleBox').find('select').chosen()}); } @@ -24,12 +24,12 @@ function toggleAcl(acl, type) if(acl == 'custom') { $('#whiteListBox').removeClass('hidden'); - $('#groupWhiteListBox').removeClass('hidden'); + $('#groupBox').removeClass('hidden'); } else if(acl == 'private') { $('#whiteListBox').removeClass('hidden'); - $('#groupWhiteListBox').addClass('hidden'); + $('#groupBox').addClass('hidden'); } else { @@ -46,9 +46,9 @@ function toggleAcl(acl, type) if(libType == 'project' && typeof(doclibID) != 'undefined') { - link = createLink('doc', 'ajaxGetWhitelist', 'doclibID=' + doclibID + '&acl=' + acl); + var link = createLink('doc', 'ajaxGetWhitelist', 'doclibID=' + doclibID + '&acl=' + acl); $.get(link, function(users) - { + { $('#users').replaceWith(users); $('#users_chosen').remove(); $('#users').chosen(); @@ -71,7 +71,7 @@ function toggleAcl(acl, type) */ function loadDocModule(libID) { - link = createLink('doc', 'ajaxGetChild', 'libID=' + libID); + var link = createLink('doc', 'ajaxGetChild', 'libID=' + libID); $.post(link, function(data) { $('#module').replaceWith(data); diff --git a/module/doc/model.php b/module/doc/model.php index 0de79d5815..3c4bf25661 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1333,7 +1333,7 @@ class docModel extends model /* Sort project. */ $orderedProjects = array(); - /* Project permissions for DocLib whitelist */ + /* Project permissions for DocLib whitelist. */ if($this->app->tab == 'doc') { $myObjects = $this->dao->select('t2.id, t2.name')->from(TABLE_DOCLIB)->alias('t1') @@ -2561,8 +2561,8 @@ EOT; { if(empty($type)) { - $doclib = $this->getLibById($libID); - $type = $doclib->type == 'execution' ? 'project' : $doclib->type; + $doclib = $this->getLibById($libID); + $type = $doclib->type == 'execution' ? 'project' : $doclib->type; $objectID = $type == 'custom' or $type == 'book' ? 0 : $doclib->$type; } diff --git a/module/doc/view/createlib.html.php b/module/doc/view/createlib.html.php index 0bce51f4cf..f9c701c3af 100644 --- a/module/doc/view/createlib.html.php +++ b/module/doc/view/createlib.html.php @@ -59,7 +59,7 @@ doc->whiteList;?> -
+
doclib->group?>
diff --git a/module/doc/view/editlib.html.php b/module/doc/view/editlib.html.php index b82f1e1cad..b7fbea8ac6 100644 --- a/module/doc/view/editlib.html.php +++ b/module/doc/view/editlib.html.php @@ -64,7 +64,7 @@ doc->whiteList?> -
+
doclib->group?> groups, "class='form-control chosen' multiple")?>
diff --git a/module/execution/control.php b/module/execution/control.php index b53b05cbcb..774d2fd3fe 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -239,6 +239,7 @@ class execution extends control $this->view->setModule = true; $this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable. $this->view->showBranch = $showBranch; + $this->view->projectName = $this->config->systemMode == 'new' ? $this->loadModel('project')->getById($execution->project)->name . ' / ' . $execution->name : $execution->name; $this->display(); } @@ -1972,10 +1973,10 @@ class execution extends control foreach($plans as $plan) $allPlans += $plan; } - $userList = $this->dao->select('account, realname name, avatar')->from(TABLE_USER)->where('deleted')->eq(0)->fetchAll('account'); - $userList['closed']['account'] = 'Closed'; - $userList['closed']['name'] = 'Closed'; - $userList['closed']['avatar'] = ''; + $userList = $this->dao->select('account, realname, avatar')->from(TABLE_USER)->where('deleted')->eq(0)->fetchAll('account'); + $userList['closed']['account'] = 'Closed'; + $userList['closed']['realname'] = 'Closed'; + $userList['closed']['avatar'] = ''; $this->view->title = $this->lang->execution->kanban; $this->view->position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name); diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 4be339dd2d..daf1724e18 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -39,7 +39,7 @@ function renderUserAvatar(user, objectType, objectID, size) if(objectType == 'story' && !priv.canAssignStory) return $noPrivAvatar; if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar; - return $('').avatar({user: user}); + return $('').avatar({user: user}); } /** diff --git a/module/execution/model.php b/module/execution/model.php index cfa7be48ae..f7d9f619dc 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1324,7 +1324,7 @@ class executionModel extends model $module = 'execution'; $method = 'testcase'; } - if($module == 'testtask' and ($method == 'view' || $method == 'create' || $method == 'edit' || $method == 'linkcase')) + if($module == 'testtask') { $module = 'execution'; $method = 'testtask'; diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index fd70afb68d..2fb95dbfc9 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -230,7 +230,7 @@
- fetch('my', 'buildContactLists', "dropdownName='whitelist'");?> + fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index b7ab279342..dfd74c8305 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -194,7 +194,7 @@
whitelist, 'class="form-control chosen" multiple');?> - fetch('my', 'buildContactLists', "dropdownName='whitelist'");?> + fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php index 0d96d08bc5..a45516db5d 100644 --- a/module/execution/view/task.html.php +++ b/module/execution/view/task.html.php @@ -182,8 +182,7 @@ body {margin-bottom: 25px;} app->getViewType() == 'xhtml'):?>
- config->systemMode == 'new' ? $this->project->getById($execution->project)->name . ' / ' : '';?> - execution->getByID($execution->id)->name);?> +
diff --git a/module/my/view/buildcontactlists.html.php b/module/my/view/buildcontactlists.html.php index 61630b6d4c..4500d2b2bd 100644 --- a/module/my/view/buildcontactlists.html.php +++ b/module/my/view/buildcontactlists.html.php @@ -21,7 +21,7 @@ else echo '"; echo ''; echo ''; - echo ''; + echo ''; echo ''; } ?> diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index 94d52e40dd..65a933dda1 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -104,10 +104,10 @@ whitelist;?> - +
- fetch('my', 'buildContactLists', "dropdownName='whitelist'");?> + fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
diff --git a/module/product/view/edit.html.php b/module/product/view/edit.html.php index b498923862..ab03001dbb 100644 --- a/module/product/view/edit.html.php +++ b/module/product/view/edit.html.php @@ -90,7 +90,7 @@
whitelist, 'class="form-control chosen" multiple');?> - fetch('my', 'buildContactLists', "dropdownName='whitelist'");?> + fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
diff --git a/module/productplan/config.php b/module/productplan/config.php index 3ce475e3ea..cab4dcb955 100644 --- a/module/productplan/config.php +++ b/module/productplan/config.php @@ -2,10 +2,8 @@ $config->productplan = new stdclass(); $config->productplan->create = new stdclass(); $config->productplan->edit = new stdclass(); -$config->productplan->start = new stdclass(); $config->productplan->create->requiredFields = 'title'; $config->productplan->edit->requiredFields = 'title'; -$config->productplan->start->requiredFields = 'begin,end'; $config->productplan->editor = new stdclass(); $config->productplan->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); diff --git a/module/productplan/control.php b/module/productplan/control.php index e2169be671..49525aa3d9 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -164,11 +164,11 @@ class productplan extends control return print(js::locate($this->session->productPlanList, 'parent')); } - $planIDList = $this->post->planIDList ? $this->post->planIDList : return print(js::locate($this->session->productPlanList, 'parent')); + if(!$this->post->planIDList) return print(js::locate($this->session->productPlanList, 'parent')); $this->commonAction($productID, $branch); - $plans = $this->productplan->getByIDList($planIDList); + $plans = $this->productplan->getByIDList($this->post->planIDList); $oldBranch = array(); foreach($plans as $plan) $oldBranch[$plan->id] = $plan->branch; @@ -401,37 +401,16 @@ class productplan extends control */ public function start($planID, $confirm = 'no') { - $plan = $this->productplan->getByID($planID); - - if($_POST) + if($confirm == 'no') { - $changes = $this->productplan->start($planID); - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - - $actionID = $this->loadModel('action')->create('productplan', $planID, 'started'); - $this->action->logHistory($actionID, $changes); - - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); - } - - if(!isonlybody()) - { - if($confirm == 'no') - { - die(js::confirm($this->lang->productplan->confirmStart, $this->createLink('productplan', 'start', "planID=$planID&confirm=yes"))); - } - else - { - $this->productplan->updateStatus($planID, 'doing', 'started'); - - if(dao::isError()) die(js::error(dao::getError())); - die(js::reload('parent')); - } + die(js::confirm($this->lang->productplan->confirmStart, $this->createLink('productplan', 'start', "planID=$planID&confirm=yes"))); } else { - $this->view->plan = $plan; - $this->display(); + $this->productplan->updateStatus($planID, 'doing', 'started'); + + if(dao::isError()) die(js::error(dao::getError())); + die(js::reload('parent')); } } diff --git a/module/productplan/js/batchedit.js b/module/productplan/js/batchedit.js index 5b8cf09d81..31118f219a 100644 --- a/module/productplan/js/batchedit.js +++ b/module/productplan/js/batchedit.js @@ -7,10 +7,10 @@ */ function changeDate(planID) { - if($("#future"+planID).prop('checked')) + if($("#future" + planID).prop('checked')) { - $("input[name='begin[" + planID + "]']").attr('disabled', 'disabled'); - $("input[name='end[" + planID + "]']").attr('disabled', 'disabled'); + $("input[name='begin[" + planID + "]']").attr('disabled', 'disabled').val(''); + $("input[name='end[" + planID + "]']").attr('disabled', 'disabled').val(''); } else { diff --git a/module/productplan/js/browse.js b/module/productplan/js/browse.js index 32c779883b..1f30442904 100644 --- a/module/productplan/js/browse.js +++ b/module/productplan/js/browse.js @@ -150,18 +150,7 @@ function createCardMenu(options) if(privs.includes('linkStory')) items.push({label: productplanLang.linkStory, icon: 'link', url: createLink('productplan', 'view', "planID=" + card.id + "&type=story&orderBy=id_desc&link=true")}); if(privs.includes('linkBug')) items.push({label: productplanLang.linkBug, icon: 'bug', url: createLink('productplan', 'view', "planID=" + card.id + "&type=bug&orderBy=id_desc&link=true")}); if(privs.includes('edit')) items.push({label: productplanLang.edit, icon: 'edit', url: createLink('productplan', 'edit', "planID=" + card.id)}); - if(privs.includes('start')) - { - if(card.begin == '2030-01-01' || card.end == '2030-01-01') - { - items.push({label: productplanLang.start, icon: 'start', url: createLink('productplan', 'start', "planID=" + card.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-id': card.id, 'data-width': '70%'}}); - } - else - { - items.push({label: productplanLang.start, icon: 'start', url: createLink('productplan', 'start', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); - } - } - + if(privs.includes('start')) items.push({label: productplanLang.start, icon: 'start', url: createLink('productplan', 'start', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); if(privs.includes('finish')) items.push({label: productplanLang.finish, icon: 'checked', url: createLink('productplan', 'finish', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); if(privs.includes('close')) items.push({label: productplanLang.close, icon: 'off', url: createLink('productplan', 'close', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); if(privs.includes('activate')) items.push({label: productplanLang.activate, icon: 'magic', url: createLink('productplan', 'activate', "planID=" + card.id), attrs: {'target': 'hiddenwin'}}); @@ -269,8 +258,8 @@ function changeCardColType(card, fromColType, toColType, kanbanID) { if(fromColType == 'wait' && privs.includes('start')) { - showIframe = (card.begin == '2030-01-01' || card.end == '2030-01-01') ? true : false; - link = createLink('productplan', 'start', 'planID=' + objectID, '', showIframe); + link = createLink('productplan', 'start', 'planID=' + objectID); + showIframe = false; } else if((fromColType == 'done' || fromColType == 'closed') && privs.includes('activate')) { diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js index 8aa184ecee..5f23f3e678 100644 --- a/module/productplan/js/edit.js +++ b/module/productplan/js/edit.js @@ -92,7 +92,7 @@ $('#future').on('change', function() { if($(this).prop('checked')) { - $('#begin').attr('disabled', 'disabled'); + $('#begin').attr('disabled', 'disabled').val(''); $('#end').parents('tr').hide(); } else diff --git a/module/productplan/model.php b/module/productplan/model.php index 3556823e43..596c73f0cd 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -516,43 +516,6 @@ class productplanModel extends model } } - /** - * Start a plan. - * - * @param int $planID - * @access public - * @return array - */ - public function start($planID) - { - $oldPlan = $this->getByID($planID); - $plan = fixer::input('post') - ->add('status', 'doing') - ->stripTags($this->config->productplan->editor->start['id'], $this->config->allowedTags) - ->remove('uid') - ->get(); - - $this->checkDate4Plan($oldPlan, $plan->begin, $plan->end); - if(dao::isError()) return false; - - $plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->start['id'], $this->post->uid); - - $this->dao->update(TABLE_PRODUCTPLAN) - ->data($plan) - ->autoCheck() - ->batchCheck($this->config->productplan->start->requiredFields, 'notempty') - ->checkIF(!empty($plan->begin) and !empty($plan->end), 'end', 'ge', $plan->begin) - ->where('id')->eq($planID) - ->exec(); - - if(dao::isError()) return false; - - if($oldPlan->parent > 0) $this->updateParentStatus($oldPlan->parent); - $this->file->updateObjectID($this->post->uid, $planID, 'productplan'); - - return common::createChanges($oldPlan, $plan); - } - /** * Update a plan's status. * diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index eab73ee039..8d0513cbdb 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -38,7 +38,7 @@ - begin == '2030-01-01' or $plan->end == '2030-01-01') ? 'checked="checked"' : '';?> + begin == $config->productplan->future and $plan->end == $config->productplan->future) ? 'checked="checked"' : '';?> id . html::hidden("id[$plan->id]", $plan->id);?> type != 'normal'):?> @@ -53,10 +53,10 @@ id]", array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen' disabled onchange='setPlanStatus($plan->id, this.value, $plan->parent)'");?> - begin == '2030-01-01' or $plan->end == '2030-01-01') and $plan->status == 'wait') ? 'disabled="disabled"' : '';?> - parent == -1 and ($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')) $disabled = 'disabled="disabled"';?> - begin == '2030-01-01') $plan->begin = '';?> - end == '2030-01-01') $plan->end = '';?> + begin == $config->productplan->future and $plan->end == $config->productplan->future) and $plan->status == 'wait') ? 'disabled="disabled"' : '';?> + parent == -1 and ($plan->begin == $config->productplan->future and $plan->end == $config->productplan->future)) $disabled = 'disabled="disabled"';?> + begin == $config->productplan->future) $plan->begin = '';?> + end == $config->productplan->future) $plan->end = '';?> id]", $plan->begin, "class='form-control form-date' $disabled");?> id]", $plan->end, "class='form-control form-date' $disabled");?> status != 'wait' and $plan->parent != -1) ? 'hidden' : '';?> diff --git a/module/productplan/view/browsebylist.html.php b/module/productplan/view/browsebylist.html.php index e5566c63bd..e49427f137 100644 --- a/module/productplan/view/browsebylist.html.php +++ b/module/productplan/view/browsebylist.html.php @@ -134,8 +134,8 @@ session->currentProductType != 'normal'):?> parent != '-1') echo $branchOption[$plan->branch];?> - begin == '2030-01-01' ? $lang->productplan->future : $plan->begin;?> - end == '2030-01-01' ? $lang->productplan->future : $plan->end;?> + begin == $config->productplan->future ? $lang->productplan->future : $plan->begin;?> + end == $config->productplan->future ? $lang->productplan->future : $plan->end;?> stories;?> bugs;?> hour;?> @@ -149,18 +149,10 @@ parent >= 0 ) { - $attr = "target='hiddenwin'"; - $isOnlyBody = false; - $class = ''; - if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01') - { - $class = 'iframe'; - $attr = "data-id='{$plan->id}' data-width='70%'"; - $isOnlyBody = true; - } - common::printIcon('productplan', 'start', "planID=$plan->id", $plan, 'list', 'play', '', $class, $isOnlyBody, $attr); - common::printIcon('productplan', 'finish', "planID=$plan->id", $plan, 'list', 'checked', '', $class, false, $attr); - common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', $class, false, $attr); + $attr = "target='hiddenwin'"; + common::printIcon('productplan', 'start', "planID=$plan->id", $plan, 'list', 'play', '', '', false, $attr); + common::printIcon('productplan', 'finish', "planID=$plan->id", $plan, 'list', 'checked', '', '', false, $attr); + common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', '', false, $attr); } $attr = $plan->expired ? "disabled='disabled'" : ''; diff --git a/module/productplan/view/edit.html.php b/module/productplan/view/edit.html.php index 580878bf26..4e2e899609 100644 --- a/module/productplan/view/edit.html.php +++ b/module/productplan/view/edit.html.php @@ -48,9 +48,9 @@ status != 'wait' ? 'hidden' : '';?> - begin == '2030-01-01' || $plan->end == '2030-01-01' ? "checked='checked'" : '';?> + begin == $config->productplan->future and $plan->end == $config->productplan->future ? "checked='checked'" : '';?> productplan->begin;?> - begin != '2030-01-01' ? formatTime($plan->begin) : '', "class='form-control form-date'");?> + begin != $config->productplan->future ? formatTime($plan->begin) : '', "class='form-control form-date'");?> status == 'wait'):?>
@@ -62,8 +62,8 @@ productplan->end;?> - end != '2030-01-01' ? formatTime($plan->end) : '', "class='form-control form-date'");?> - end == '2030-01-01' ? 0 : (strtotime($plan->end) - strtotime($plan->begin)) / 3600 / 24 + 1;?> + end != $config->productplan->future ? formatTime($plan->end) : '', "class='form-control form-date'");?> + end == $config->productplan->future ? 0 : (strtotime($plan->end) - strtotime($plan->begin)) / 3600 / 24 + 1;?> productplan->endList , $deltaValue, "onclick='computeEndDate(this.value)'");?> printExtendFields($plan, 'table', 'columns=3');?> diff --git a/module/productplan/view/start.html.php b/module/productplan/view/start.html.php index 5087c5207d..48e63d5ea0 100644 --- a/module/productplan/view/start.html.php +++ b/module/productplan/view/start.html.php @@ -21,11 +21,11 @@ - + - + diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index b22ff1090e..e842979fa6 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -29,7 +29,7 @@ title;?>type !== 'normal') echo "" . $branchOption[$branch] . '';?> - begin == '2030-01-01' || $plan->end == '2030-01-01') ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?> + begin == $config->productplan->future || $plan->end == $config->productplan->future) ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?> deleted):?> product->deleted;?> @@ -47,7 +47,7 @@ $attr = "target='hiddenwin'"; $isOnlyBody = false; $class = ''; - if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01') + if($plan->begin == $config->productplan->future or $plan->end == $config->productplan->future) { $class = 'iframe'; $attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'"; @@ -596,11 +596,11 @@ - + - + parent == '-1'):?> diff --git a/module/program/control.php b/module/program/control.php index 124b8a8f65..f8dfbac729 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -650,9 +650,9 @@ class program extends control /** * Ajax get program drop menu. * - * @param int $programID - * @param string $module - * @param string $method + * @param int $programID + * @param string $module + * @param string $method * @access public * @return void */ diff --git a/module/program/view/create.html.php b/module/program/view/create.html.php index da9cf417b5..04043a5196 100644 --- a/module/program/view/create.html.php +++ b/module/program/view/create.html.php @@ -117,7 +117,7 @@ diff --git a/module/program/view/edit.html.php b/module/program/view/edit.html.php index 71c144c8fa..397f6a5843 100644 --- a/module/program/view/edit.html.php +++ b/module/program/view/edit.html.php @@ -99,10 +99,10 @@ - diff --git a/module/project/control.php b/module/project/control.php index 7d338b57a5..a0645b14d4 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1217,11 +1217,11 @@ class project extends control } else { - if($project->model == 'scrum' and $module == 'projectstory') $this->config->project->removePriv[$module][] = 'track'; + if($project->model == 'scrum' and $module == 'projectstory') $this->config->project->excludedPriv[$module][] = 'track'; foreach($methods as $method => $label) { - if(isset($this->config->project->removePriv[$module]) and in_array($method, $this->config->project->removePriv[$module])) unset($this->lang->resource->$module->$method); + if(isset($this->config->project->excludedPriv[$module]) and in_array($method, $this->config->project->excludedPriv[$module])) unset($this->lang->resource->$module->$method); } } } @@ -1317,11 +1317,11 @@ class project extends control return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => $link)); } - $project = $this->project->getById($projectID); - $users = $this->user->getPairs('noclosed|nodeleted|devfirst|nofeedback'); - $roles = $this->user->getUserRoles(array_keys($users)); - $deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept); - $userInfos = $this->user->getUserDisplayInfos(array_keys($users), $dept); + $project = $this->project->getById($projectID); + $users = $this->user->getPairs('noclosed|nodeleted|devfirst|nofeedback'); + $roles = $this->user->getUserRoles(array_keys($users)); + $deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept); + $userInfoList = $this->user->getUserDisplayInfos(array_keys($users), $dept); $currentMembers = $this->project->getTeamMembers($projectID); $members2Import = $this->project->getMembers2Import($copyProjectID, array_keys($currentMembers)); @@ -1332,7 +1332,7 @@ class project extends control $this->view->project = $project; $this->view->users = $users; $this->view->deptUsers = $deptUsers; - $this->view->userInfos = $userInfos; + $this->view->userInfoList = $userInfoList; $this->view->roles = $roles; $this->view->dept = $dept; $this->view->depts = array('' => '') + $this->dept->getOptionMenu(); diff --git a/module/project/css/group.css b/module/project/css/group.css index 6375b99ceb..238fd83cb1 100644 --- a/module/project/css/group.css +++ b/module/project/css/group.css @@ -1,3 +1,3 @@ .c-id {width: 60px;} -.c-name {width: 130px;} +.c-name {width: 300px;} .c-desc {width: 300px;} diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 012b3042d7..fa116889ba 100644 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -162,7 +162,7 @@ diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 821d72f72a..e8f430a273 100644 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -176,10 +176,10 @@ - diff --git a/module/project/view/managemembers.html.php b/module/project/view/managemembers.html.php index f8637f3cf6..a1a18a052e 100644 --- a/module/project/view/managemembers.html.php +++ b/module/project/view/managemembers.html.php @@ -2,7 +2,7 @@ id);?> - +project->unlinkExecutionMembers);?> diff --git a/module/story/model.php b/module/story/model.php index d51bff9e8e..52c3b7c4e9 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2436,7 +2436,7 @@ class storyModel extends model * @param int $productID * @param string $type requirement|story * @param string $orderBy - * @param string $pager + * @param object $pager * @access public * @return array */ diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 1c101aafdf..16be21d237 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -482,7 +482,7 @@ if(!isset($executions[$task->execution])) continue; $executionName = $executions[$task->execution]; $taskInfo = $task->id . ' ' . $this->lang->task->statusList[$task->status] . ' ' . $task->name; - $class = isonlybody() ? 'showinonlybody' : 'iframe'; + $class = isonlybody() ? 'showinonlybody' : 'iframe'; echo "
  • " . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), $taskInfo, '', "class=$class data-width='80%'"); echo html::a($this->createLink('execution', 'browse', "executionID=$task->execution"), $executionName, '', "class='text-muted'") . '
  • '; } diff --git a/module/testreport/control.php b/module/testreport/control.php index 6960f3d3ae..ca1c40d2e4 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -299,8 +299,10 @@ class testreport extends control $this->view->reportTitle = date('Y-m-d') . " EXECUTION#{$execution->id} {$execution->name} {$this->lang->testreport->common}"; } - $cases = $this->testreport->getTaskCases($tasks, $begin, $end); - $bugInfo = $this->testreport->getBugInfo($tasks, $productIdList, $begin, $end, $builds); + $cases = $this->testreport->getTaskCases($tasks, $begin, $end); + + list($bugInfo, $bugSummary) = $this->testreport->getBug4Report($tasks, $productIdList, $begin, $end, $builds); + $this->view->begin = $begin; $this->view->end = $end; $this->view->members = $this->dao->select('DISTINCT lastRunner')->from(TABLE_TESTRUN)->where('task')->in(array_keys($tasks))->fetchPairs('lastRunner', 'lastRunner'); @@ -329,9 +331,9 @@ class testreport extends control $this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult); $this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner); - $this->view->legacyBugs = $bugInfo['legacyBugs']; - unset($bugInfo['legacyBugs']); - $this->view->bugInfo = $bugInfo; + $this->view->bugInfo = $bugInfo; + $this->view->legacyBugs = $bugSummary['legacyBugs']; + $this->view->bugSummary = $bugSummary; $this->view->objectID = $objectID; $this->view->objectType = $objectType; @@ -432,8 +434,9 @@ class testreport extends control $bugs = $this->testreport->getBugs4Test($builds, $productIdList, $begin, $end, 'execution'); } - $cases = $this->testreport->getTaskCases($tasks, $begin, $end); - $bugInfo = $this->testreport->getBugInfo($tasks, $productIdList, $begin, $end, $builds); + $cases = $this->testreport->getTaskCases($tasks, $begin, $end); + + list($bugInfo, $bugSummary) = $this->testreport->getBug4Report($tasks, $productIdList, $begin, $end, $builds); $this->view->title = $report->title . $this->lang->testreport->edit; @@ -458,9 +461,9 @@ class testreport extends control $this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult); $this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner); - $this->view->legacyBugs = $bugInfo['legacyBugs']; - unset($bugInfo['legacyBugs']); - $this->view->bugInfo = $bugInfo; + $this->view->legacyBugs = $bugSummary['legacyBugs']; + $this->view->bugInfo = $bugInfo; + $this->view->bugSummary = $bugSummary; $this->display(); } @@ -529,7 +532,8 @@ class testreport extends control $tasks = $report->tasks ? $this->testtask->getByList($report->tasks) : array();; $builds = $report->builds ? $this->build->getByList($report->builds) : array(); $cases = $this->testreport->getTaskCases($tasks, $report->begin, $report->end); - $bugInfo = $this->testreport->getBugInfo($tasks, $report->product, $report->begin, $report->end, $builds); + + list($bugInfo, $bugSummary) = $this->testreport->getBug4Report($tasks, $report->product, $report->begin, $report->end, $builds); /* save session .*/ $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false); @@ -566,9 +570,10 @@ class testreport extends control $this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult); $this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner); - $this->view->legacyBugs = $bugInfo['legacyBugs']; - unset($bugInfo['legacyBugs']); $this->view->bugInfo = $bugInfo; + $this->view->legacyBugs = $bugSummary['legacyBugs']; + $this->view->bugSummary = $bugSummary; + $this->display(); } diff --git a/module/testreport/lang/en.php b/module/testreport/lang/en.php index 2ed6bae529..ccc73a6406 100644 --- a/module/testreport/lang/en.php +++ b/module/testreport/lang/en.php @@ -78,7 +78,7 @@ $lang->testreport->exportNotice = "Exported By from(TABLE_BUG)->where('product')->in($productIdList)->andWhere('openedDate')->ge($begin)->andWhere('openedDate')->le("$end 23:59:59")->andWhere('deleted')->eq(0)->fetchAll(); $resolvedBugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->in($productIdList)->andWhere('resolvedDate')->ge($begin)->andWhere('resolvedDate')->le("$end 23:59:59")->andWhere('deleted')->eq(0)->fetchAll(); @@ -259,7 +259,6 @@ class testreportModel extends model } $resolvedBugs = 0; - $this->loadModel('action'); foreach($foundBugs as $bug) { $severityGroups[$bug->severity] = isset($severityGroups[$bug->severity]) ? $severityGroups[$bug->severity] + 1 : 1; @@ -273,14 +272,14 @@ class testreportModel extends model if($bug->status == 'resolved' or $bug->status == 'closed') $resolvedBugs ++; } - $bugInfo['foundBugs'] = count($foundBugs); - $bugInfo['legacyBugs'] = $legacyBugs; - $bugInfo['activatedBugs'] = $activatedBugs; - $bugInfo['countBugByTask'] = $byCaseNum; - $bugInfo['bugConfirmedRate'] = empty($resolvedBugs) ? 0 : round((zget($resolutionGroups, 'fixed', 0) + zget($resolutionGroups, 'postponed', 0)) / $resolvedBugs * 100, 2); - $bugInfo['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($foundBugs) * 100, 2); - $bugInfo['bugStageGroups'] = $isEmptyStage ? array() : $stageGroups; - $bugInfo['bugHandleGroups'] = $isEmptyHandle ? array() : $handleGroups; + $bugSummary['foundBugs'] = count($foundBugs); + $bugSummary['legacyBugs'] = $legacyBugs; + $bugSummary['activatedBugs'] = count($activatedBugs); + $bugSummary['countBugByTask'] = $byCaseNum; + $bugSummary['bugConfirmedRate'] = empty($resolvedBugs) ? 0 : round((zget($resolutionGroups, 'fixed', 0) + zget($resolutionGroups, 'postponed', 0)) / $resolvedBugs * 100, 2); + $bugSummary['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($foundBugs) * 100, 2); + $bugInfo['bugStageGroups'] = $isEmptyStage ? array() : $stageGroups; + $bugInfo['bugHandleGroups'] = $isEmptyHandle ? array() : $handleGroups; $this->app->loadLang('bug'); $users = $this->loadModel('user')->getPairs('noclosed|noletter|nodeleted'); @@ -351,7 +350,7 @@ class testreportModel extends model } $bugInfo['bugResolvedByGroups'] = $data; - return $bugInfo; + return array($bugInfo, $bugSummary); } /** diff --git a/module/testreport/view/create.html.php b/module/testreport/view/create.html.php index 4d4db722b0..353affdd93 100644 --- a/module/testreport/view/create.html.php +++ b/module/testreport/view/create.html.php @@ -83,8 +83,7 @@ ' . $storySummary . ''; echo '
    ' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '
    '; - echo '
    ' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
    '; - unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']); + echo '
    ' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '
    '; ?>
    diff --git a/module/testreport/view/edit.html.php b/module/testreport/view/edit.html.php index d25d7aafa4..9081388c71 100644 --- a/module/testreport/view/edit.html.php +++ b/module/testreport/view/edit.html.php @@ -71,8 +71,7 @@ ' . $storySummary . '

    '; echo '

    ' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '

    '; - echo '

    ' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '

    '; - unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']); + echo '

    ' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '

    '; ?>
    diff --git a/module/testreport/view/view.html.php b/module/testreport/view/view.html.php index a06c5f9117..fd1fb8bb56 100644 --- a/module/testreport/view/view.html.php +++ b/module/testreport/view/view.html.php @@ -78,8 +78,7 @@ ' . $storySummary . '

    '; echo '

    ' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '

    '; - echo '

    ' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '

    '; - unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']); + echo '

    ' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '

    '; ?>
    diff --git a/module/testtask/view/linkcase.html.php b/module/testtask/view/linkcase.html.php index 72a3ef474c..4b58c7ff0f 100644 --- a/module/testtask/view/linkcase.html.php +++ b/module/testtask/view/linkcase.html.php @@ -63,7 +63,7 @@ echo ""; ?> " . $lang->testtask->linkByBug . '', '', "class='btn btn-link {$bugActive}'");?> - {$lang->testcase->bySearch}";?> + {$lang->testcase->bySearch}";?>
    diff --git a/module/tree/model.php b/module/tree/model.php index a3c386fb50..9ca7e0eb97 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -242,8 +242,8 @@ class treeModel extends model public function getTaskOptionMenu($rootID, $productID = 0, $startModule = 0, $extra = '') { /* If createdVersion <= 4.1, go to getOptionMenu(). */ - $products = $this->loadModel('product')->getProductPairsByProject($rootID); - $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed'); + $products = $this->loadModel('product')->getProductPairsByProject($rootID); + $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed'); if(!$this->isMergeModule($rootID, 'task') or !$products) return $this->getOptionMenu($rootID, 'task', $startModule); @@ -282,7 +282,7 @@ class treeModel extends model { $modules = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = '" . (int)$rootID . "' and type = 'task' and parent != 0) OR (root = $id and type = 'story'))") ->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi() - ->beginIF(!empty($activeBranch))->andWhere('branch')->in($activeBranch)->fi() + ->andWhere('branch')->in($activeBranch)->fi() ->andWhere('deleted')->eq(0) ->orderBy('grade desc, branch, `order`, type') ->fetchAll('id'); diff --git a/module/user/control.php b/module/user/control.php index cefed1ae2a..40059c848f 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -1173,25 +1173,33 @@ class user extends control { $list = $contactListID ? $this->user->getContactListByID($contactListID) : ''; + $attr = $dropdownName == 'mailto' ? "data-placeholder='{$this->lang->chooseUsersToMail}'" : ''; + $users = $this->user->getPairs('devfirst|nodeleted', $list ? $list->userList : '', $this->config->maxCount); if(isset($this->config->user->moreLink)) $this->config->moreLinks[$dropdownName . "[]"] = $this->config->user->moreLink; - if(!$contactListID) return print(html::select($dropdownName . "[]", $users, '', "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'")); - - return print(html::select($dropdownName . "[]", $users, $list->userList, "class='form-control chosen' multiple data-placeholder='{$this->lang->chooseUsersToMail}'")); + if(!$contactListID) + { + return print(html::select($dropdownName . "[]", $users, '', "class='form-control chosen' multiple $attr")); + } + else + { + return print(html::select($dropdownName . "[]", $users, $list->userList, "class='form-control chosen' multiple $attr")); + } } /** * Ajax get contact list. * + * @param $dropdownName mailto|whitelist * @access public * @return string */ - public function ajaxGetContactList() + public function ajaxGetContactList($dropdownName = 'mailto') { $contactList = $this->user->getContactLists($this->app->user->account, 'withnote'); if(empty($contactList)) return false; - return print(html::select('', $contactList, '', "class='form-control' onchange=\"setMailto('mailto', this.value)\"")); + return print(html::select('', $contactList, '', "class='form-control' onchange=\"setMailto('$dropdownName', this.value)\"")); } /** diff --git a/www/js/my.full.js b/www/js/my.full.js index 7c91460e43..d8c2ca5693 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -162,13 +162,14 @@ function setMailto(mailto, contactListID) /** * Ajax get contacts. * - * @param obj $obj + * @param object $obj + * @param string $dropdownName mailto|whitelist * @access public * @return void */ -function ajaxGetContacts(obj) +function ajaxGetContacts(obj, dropdownName = 'mailto') { - link = createLink('user', 'ajaxGetContactList'); + link = createLink('user', 'ajaxGetContactList', 'dropdownName=' + dropdownName); $.get(link, function(contacts) { if(!contacts) return false;
    productplan->begin;?>begin != '2030-01-01' ? formatTime($plan->begin) : '', "class='form-control form-date'");?>begin != $config->productplan->future ? formatTime($plan->begin) : '', "class='form-control form-date'");?>
    productplan->end;?>end != '2030-01-01' ? formatTime($plan->end) : '', 'class="form-control form-date"');?>end != $config->productplan->future ? formatTime($plan->end) : '', 'class="form-control form-date"');?>
    productplan->desc;?>
    productplan->begin;?>begin == '2030-01-01' ? $lang->productplan->future : $plan->begin;?>begin == $config->productplan->future ? $lang->productplan->future : $plan->begin;?>
    productplan->end;?>end == '2030-01-01' ? $lang->productplan->future : $plan->end;?>end == $config->productplan->future ? $lang->productplan->future : $plan->end;?>
    - fetch('my', 'buildContactLists', "dropdownName='whitelist'");?> + fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
    whitelist;?> +
    whitelist, 'class="form-control chosen" multiple');?> - fetch('my', 'buildContactLists', "dropdownName='whitelist'");?> + fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
    - fetch('my', 'buildContactLists', "dropdownName='whitelist'");?> + fetch('my', 'buildContactLists', "dropdownName=whitelist");?>
    whitelist;?> +
    whitelist, 'class="form-control chosen" multiple');?> - fetch('my', 'buildContactLists', "dropdownName='whitelist'");?> + fetch('my', 'buildContactLists', "dropdownName=whitelist");?>