diff --git a/extension/lite/workflow/ext/view/ui.flow.html.hook.php b/extension/lite/workflow/ext/view/ui.flow.html.hook.php new file mode 100644 index 0000000000..c7a346d076 --- /dev/null +++ b/extension/lite/workflow/ext/view/ui.flow.html.hook.php @@ -0,0 +1,11 @@ +visions == ',lite,'):?> +dao->select('id')->from(TABLE_WORKFLOWDATASOURCE)->where('code')->like('litefeedback%')->andWhere('vision')->eq('lite')->fetchPairs('id', 'id');?> + + + + diff --git a/module/action/model.php b/module/action/model.php index 92c83c05b4..98b6cfe56c 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -989,39 +989,43 @@ class actionModel extends model if($projectID == 'all') $authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? $this->app->user->view->projects : '0'; if($executionID == 'all') $authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? $this->app->user->view->sprints : '0'; + if(empty($authedProducts)) $authedProducts = '0'; + if($productID == 'all' and $projectID == 'all') { $productCondition = ''; - foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "(execution = '0' and project = '0' and (product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + $productCondition .= '))'; - $projectCondition = "project " . helper::dbIN($authedProjects); - $executionCondition = isset($authedExecutions) ? "execution " . helper::dbIN($authedExecutions) : ''; + $projectCondition = "(execution = '0' and project != '0' and project " . helper::dbIN($authedProjects) . ')'; + $executionCondition = isset($authedExecutions) ? "(execution != 0 and execution " . helper::dbIN($authedExecutions) . ')' : ''; } elseif($productID == 'all' and is_numeric($projectID)) { $products = $this->loadModel('product')->getProductPairsByProject($projectID); - $executions = $this->loadModel('execution')->getPairs($projectID); + $executions = $this->loadModel('execution')->getPairs($projectID) + array(0 => 0); $authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions); $productCondition = ''; - foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "(execution = '0' and project = '0' and (product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + $productCondition .= '))'; - $projectCondition = "project = $projectID"; - $executionCondition = "execution " . helper::dbIN($authedExecutions); + $projectCondition = "(execution = '0' and project = '$projectID')"; + $executionCondition = "(execution != '0' and execution " . helper::dbIN($authedExecutions) . ')'; } elseif(is_numeric($productID) and $projectID == 'all') { $this->loadModel('product'); $projects = $this->product->getProjectPairsByProduct($productID); - $executions = $this->product->getExecutionPairsByProduct($productID); + $executions = $this->product->getExecutionPairsByProduct($productID) + array(0 => 0); $authedProjects = array_intersect(array_keys($projects), explode(',', $authedProjects)); $authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions); $productCondition = "product like '%,$productID,%'"; - $projectCondition = 'project ' . helper::dbIN($authedProjects); - $executionCondition = 'execution ' . helper::dbIN($authedExecutions); + $projectCondition = "(execution = '0' and project != '0' and project " . helper::dbIN($authedProjects) . ')'; + $executionCondition = "(execution != '0' and execution " . helper::dbIN($authedExecutions) . ')'; } $condition = "((product =',0,' or product = '0' or product=',,') AND project = '0' AND execution = '0')"; @@ -1222,17 +1226,8 @@ class actionModel extends model $relatedProjects = $relatedData['relatedProjects']; $requirements = $relatedData['requirements']; - $aclViews = isset($this->app->user->rights['acls']['views']) ? $this->app->user->rights['acls']['views'] : array(); - $authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? ",{$this->app->user->view->projects}," : ''; - $authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? ",{$this->app->user->view->sprints},": ''; - foreach($actions as $i => $action) { - if(($action->execution != '0' and strpos($authedExecutions, ",$action->execution,") === false) or ($action->execution == '0' and $action->project != '0' and strpos($authedProjects, ",$action->project,") === false)) - { - unset($actions[$i]); - continue; - } /* Add name field to the actions. */ $action->objectName = isset($objectNames[$action->objectType][$action->objectID]) ? $objectNames[$action->objectType][$action->objectID] : ''; diff --git a/module/execution/model.php b/module/execution/model.php index 5c441b0f47..14d8e21126 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -100,7 +100,7 @@ class executionModel extends model include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; } - if(isset($execution->cal) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist); + if(isset($execution->acl) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist); if($execution and $execution->lifetime == 'ops') { diff --git a/module/file/view/viewfiles.html.php b/module/file/view/viewfiles.html.php index a1534e45d3..9848291995 100644 --- a/module/file/view/viewfiles.html.php +++ b/module/file/view/viewfiles.html.php @@ -114,7 +114,6 @@ data: postData, success: function(data) { - console.log(data['title']); $('#fileTitle' + fileID).html("  " + data['title']); $('#renameFile' + fileID).closest('li').removeClass('hidden'); $('#renameBox' + fileID).addClass('hidden'); diff --git a/module/port/control.php b/module/port/control.php index decc297470..0725f3a71a 100644 --- a/module/port/control.php +++ b/module/port/control.php @@ -104,13 +104,11 @@ class port extends control $file = $this->loadModel('file')->getUpload('file'); $file = $file[0]; $shortName = $this->file->getSaveName($file['pathname']); - if(empty($shortName)) - { - die(js::alert($this->lang->excel->emptyFileName)); - } - $extension = $file['extension']; - $fileName = $this->file->savePath . $shortName; + if(empty($shortName)) die(js::alert($this->lang->excel->emptyFileName)); + + $extension = $file['extension']; + $fileName = $this->file->savePath . $shortName; move_uploaded_file($file['tmpname'], $fileName); diff --git a/module/port/model.php b/module/port/model.php index 91a7d79a7a..7dae8978f5 100644 --- a/module/port/model.php +++ b/module/port/model.php @@ -401,10 +401,8 @@ class portModel extends model $dataList = array(); $sysDataFields = explode(',', $this->portConfig->sysDataFields); - foreach($sysDataFields as $field) - { - $dataList[$field] = $this->loadModel($field)->getPairs(); - } + + foreach($sysDataFields as $field) $dataList[$field] = $this->loadModel($field)->getPairs(); return $dataList; } @@ -523,8 +521,7 @@ class portModel extends model */ public function getSourceByLang($lang) { - $lang = isset($this->modelLang->$lang) ? $this->modelLang->$lang : ''; - return $lang; + return isset($this->modelLang->$lang) ? $this->modelLang->$lang : ''; } /** @@ -733,10 +730,7 @@ class portModel extends model } /* Deal children datas and multiple tasks .*/ - if($modelDatas) - { - $modelDatas = $this->updateChildDatas($modelDatas); - } + if($modelDatas) $modelDatas = $this->updateChildDatas($modelDatas); return $modelDatas; } @@ -790,10 +784,7 @@ class portModel extends model $relatedObjectIdList = array(); $relatedObjects = array(); - foreach($datas as $data) - { - $relatedObjectIdList[$data->$object] = $data->$object; - } + foreach($datas as $data) $relatedObjectIdList[$data->$object] = $data->$object; if($object == 'openedBuild') $object = 'build'; diff --git a/module/task/control.php b/module/task/control.php index 905ee7cdc3..eb7277686d 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -438,10 +438,16 @@ class task extends control $customFields[$field] = $this->lang->task->$field; } - if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review') unset($customFields['story']); + $showFields = $this->config->task->custom->batchCreateFields; + if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review') + { + unset($customFields['story']); + $showFields = str_replace(',story,', ',', ",$showFields,"); + $showFields = trim($showFields, ','); + } $this->view->customFields = $customFields; - $this->view->showFields = $this->config->task->custom->batchCreateFields; + $this->view->showFields = $showFields; if($execution->type == 'kanban') { diff --git a/module/user/model.php b/module/user/model.php index 4e366ef854..7fec646510 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -796,6 +796,7 @@ class userModel extends model } $this->dao->update(TABLE_USER)->data($user)->autoCheck()->where('id')->eq((int)$userID)->exec(); + $_SESSION['user']->password = $user->password; $this->app->user->password = $user->password; $this->app->user->modifyPassword = false; if(!dao::isError())