programset->noProgramset;?> " . $lang->programset->create, '', "class='btn btn-info' data-toggle=modal");?>
-- ";
foreach($productGroup as $productID => $projects)
@@ -306,7 +306,7 @@ class projectModel extends model
$this->lang->project->team = $this->lang->project->teamname;
$project = fixer::input('post')
->setDefault('status', 'wait')
- ->setDefault('program', $this->session->program)
+ ->setDefault('program', $this->session->PRJ)
->setIF($this->post->acl != 'custom', 'whitelist', '')
->setDefault('openedBy', $this->app->user->account)
->setDefault('openedDate', helper::now())
@@ -718,8 +718,8 @@ class projectModel extends model
$mode .= $this->cookie->projectMode;
/* Order by status's content whether or not done */
$projects = $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)
- ->where('iscat')->eq(0)
- ->beginIF($programID)->andWhere('program')->eq($programID)->fi()
+ ->where('deleted')->eq(0)
+ ->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->orderBy($orderBy)
@@ -765,7 +765,7 @@ class projectModel extends model
*/
public function getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $programID = 0)
{
- $programID = $programID ? $programID : $this->session->programID;
+ $programID = $programID ? $programID : $this->session->PRJID;
if($status == 'involved') return $this->getInvolvedList($status, $limit, $productID, $branch);
if($productID != 0)
@@ -773,10 +773,9 @@ class projectModel extends model
return $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
+ ->andWhere('type')->in('sprint,stage')
->andWhere('t2.deleted')->eq(0)
- ->andWhere('t2.iscat')->eq(0)
- ->beginIF($programID)->andWhere('t2.program')->eq($programID)->fi()
- ->andWhere('t2.template')->eq('')
+ ->beginIF($programID)->andWhere('t2.parent')->eq($programID)->fi()
->beginIF($status == 'undone')->andWhere('t2.status')->notIN('done,closed')->fi()
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
@@ -787,13 +786,13 @@ class projectModel extends model
}
else
{
- return $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)->where('iscat')->eq(0)
+ return $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)
+ ->where('deleted')->eq(0)
+ ->andWhere('type')->in('sprint,stage')
->beginIF($status == 'undone')->andWhere('status')->notIN('done,closed')->fi()
->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
- ->andWhere('deleted')->eq(0)
- ->beginIF($programID)->andWhere('program')->eq($programID)->fi()
- ->andWhere('template')->eq('')
+ ->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
->orderBy('order_desc')
->beginIF($limit)->limit($limit)->fi()
->fetchAll('id');
@@ -819,7 +818,6 @@ class projectModel extends model
->leftJoin(TABLE_TEAM)->alias('t3')->on('t3.root=t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.deleted')->eq(0)
- ->andWhere('t2.iscat')->eq(0)
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi()
->andWhere('t2.openedBy', true)->eq($this->app->user->account)
@@ -834,12 +832,11 @@ class projectModel extends model
{
return $this->dao->select('t1.*, IF(INSTR(" done,closed", t1.status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_TEAM)->alias('t2')->on('t2.root=t1.id')
- ->where('t1.iscat')->eq(0)
+ ->where('t1.deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
->andWhere('t1.openedBy', true)->eq($this->app->user->account)
->orWhere('t2.account')->eq($this->app->user->account)
->markRight(1)
- ->andWhere('t1.deleted')->eq(0)
->andWhere('t2.type')->eq('project')
->orderBy('t1.order_desc')
->beginIF($limit)->limit($limit)->fi()
@@ -859,13 +856,12 @@ class projectModel extends model
$projects = $this->dao->select('t1.*, t3.name as productName')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.project')
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product = t3.id')
- ->where('t1.program')->eq((int)$program->id)
- ->andWhere('t1.template')->eq('')
+ ->where('t1.parent')->eq((int)$program->id)
->andWhere('t1.deleted')->eq('0')
->orderBy('t1.order desc')
->fetchAll('id');
- if($program->template == 'waterfall')
+ if($program->model == 'waterfall')
{
foreach($projects as $projectID => $project)
{
@@ -1972,7 +1968,7 @@ class projectModel extends model
$changedAccounts = array_merge($changedAccounts, array_diff($oldAccounts, $accounts));
$changedAccounts = array_unique($changedAccounts);
- $objectType = $project->template ? 'program' : 'project';
+ $objectType = $project->model ? 'program' : 'project';
$this->loadModel('user')->updateUserView($projectID, $objectType, $changedAccounts);
$products = $this->getProducts($projectID, false);
diff --git a/module/qa/control.php b/module/qa/control.php
index 430199cd47..59583e2acf 100644
--- a/module/qa/control.php
+++ b/module/qa/control.php
@@ -19,7 +19,7 @@ class qa extends control
*/
public function index($locate = 'auto', $productID = 0)
{
- $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program);
+ $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=qa")));
if($locate == 'yes') $this->locate($this->createLink('bug', 'browse'));
diff --git a/module/release/control.php b/module/release/control.php
index 1c0ffb4f66..289a75631b 100644
--- a/module/release/control.php
+++ b/module/release/control.php
@@ -28,7 +28,7 @@ class release extends control
$this->view->branch = $branch;
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id);
$this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$this->view->product->id}&branch=$branch"), $this->view->product->name);
- $this->product->setMenu($this->product->getPairs('', $this->session->program), $productID, $branch);
+ $this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $productID, $branch);
}
/**
diff --git a/module/release/model.php b/module/release/model.php
index 303edc7a36..971ae51bba 100644
--- a/module/release/model.php
+++ b/module/release/model.php
@@ -120,7 +120,7 @@ class releaseModel extends model
if($this->post->date > date('Y-m-d')) return dao::$errors[] = $this->lang->release->errorDate;
$release = fixer::input('post')
- ->add('program', $this->session->program)
+ ->add('program', $this->session->PRJ)
->add('product', (int)$productID)
->add('branch', (int)$branch)
->setDefault('stories', '')
@@ -147,7 +147,7 @@ class releaseModel extends model
else
{
$build = new stdclass();
- $build->program = $this->session->program;
+ $build->program = $this->session->PRJ;
$build->product = (int)$productID;
$build->branch = (int)$branch;
$build->name = $release->name;
diff --git a/module/repo/control.php b/module/repo/control.php
index 4290296723..9237a7ec79 100644
--- a/module/repo/control.php
+++ b/module/repo/control.php
@@ -28,7 +28,7 @@ class repo extends control
}
$this->scm = $this->app->loadClass('scm');
- $this->repos = $this->repo->getRepoPairs($this->session->program);
+ $this->repos = $this->repo->getRepoPairs($this->session->PRJ);
if(empty($this->repos) and $this->methodName != 'create') die(js::locate($this->repo->createLink('create')));
/* Unlock session for wait to get data of repo. */
@@ -54,7 +54,7 @@ class repo extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
- $this->view->repoList = $this->repo->getList($this->session->program, $orderBy, $pager);
+ $this->view->repoList = $this->repo->getList($this->session->PRJ, $orderBy, $pager);
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->browse;
$this->view->position[] = $this->lang->repo->common;
diff --git a/module/repo/view/create.html.php b/module/repo/view/create.html.php
index 576bd7b8a1..8196c8dfeb 100644
--- a/module/repo/view/create.html.php
+++ b/module/repo/view/create.html.php
@@ -26,7 +26,7 @@
| repo->program; ?> | -session->program, "class='form-control chosen' multiple"); ?> | +session->PRJ, "class='form-control chosen' multiple"); ?> | |
|---|---|---|---|
| repo->type; ?> | diff --git a/module/report/control.php b/module/report/control.php index 16b8aae1fe..e5d88b5a80 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -83,8 +83,8 @@ class report extends control $this->view->end = $end; $this->view->bugs = $this->report->getBugs($begin, $end, $product, $project); $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed|nodeleted'); - $this->view->projects = array('' => '') + $this->loadModel('project')->getPairs('', $this->session->program); - $this->view->products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->program); + $this->view->projects = array('' => '') + $this->loadModel('project')->getPairs('', $this->session->PRJ); + $this->view->products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->PRJ); $this->view->project = $project; $this->view->product = $product; $this->view->submenu = 'test'; diff --git a/module/risk/control.php b/module/risk/control.php index 1e81c0811e..c32cb823c1 100644 --- a/module/risk/control.php +++ b/module/risk/control.php @@ -40,7 +40,7 @@ class risk extends control $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->browse; $this->view->position[] = $this->lang->risk->browse; - $this->view->risks = $this->risk->getList($this->session->program, $browseType, $param, $orderBy, $pager); + $this->view->risks = $this->risk->getList($this->session->PRJ, $browseType, $param, $orderBy, $pager); $this->view->browseType = $browseType; $this->view->param = $param; $this->view->orderBy = $orderBy; diff --git a/module/risk/model.php b/module/risk/model.php index 21e74fcf89..5335a18a58 100644 --- a/module/risk/model.php +++ b/module/risk/model.php @@ -22,7 +22,7 @@ class riskModel extends model public function create() { $risk = fixer::input('post') - ->add('program', $this->session->program) + ->add('program', $this->session->PRJ) ->add('createdBy', $this->app->user->account) ->add('createdDate', helper::today()) ->stripTags($this->config->risk->editor->create['id'], $this->config->allowedTags) @@ -56,7 +56,7 @@ class riskModel extends model $risk->source = $data->source[$i]; $risk->category = $data->category[$i]; $risk->strategy = $data->strategy[$i]; - $risk->program = $this->session->program; + $risk->program = $this->session->PRJ; $risk->createdBy = $this->app->user->account; $risk->createdDate = helper::today(); diff --git a/module/search/model.php b/module/search/model.php index e3ea145572..47394a2f41 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -265,8 +265,8 @@ class searchModel extends model $users = $this->loadModel('user')->getPairs('realname|noclosed', $appendUsers, $this->config->maxCount); $users['$@me'] = $this->lang->search->me; } - if($hasProduct) $products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->program); - if($hasProject) $projects = array('' => '') + $this->loadModel('project')->getPairs('', $this->session->program); + if($hasProduct) $products = array('' => '') + $this->loadModel('product')->getPairs('', $this->session->PRJ); + if($hasProject) $projects = array('' => '') + $this->loadModel('project')->getPairs('', $this->session->PRJ); foreach($fields as $fieldName) { diff --git a/module/story/control.php b/module/story/control.php index 902d8a439d..15095da8eb 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -341,7 +341,7 @@ class story extends control /* Set products and module. */ $product = $this->product->getById($productID); - $products = $this->product->getPairs('', $this->session->program); + $products = $this->product->getPairs('', $this->session->PRJ); $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch); /* Set menu. */ @@ -429,7 +429,7 @@ class story extends control /* Get datas. */ $story = $this->story->getById($storyID); $product = $this->product->getById($story->product); - $products = $this->product->getPairs('', $this->session->program); + $products = $this->product->getPairs('', $this->session->PRJ); $moduleOptionMenu = $this->tree->getOptionMenu($product->id, $viewType = 'story', 0, $story->branch); /* Set menu. */ @@ -593,7 +593,7 @@ class story extends control /* The stories of a product. */ if($productID) { - $this->product->setMenu($this->product->getPairs('nodeleted', $this->session->program), $productID, $branch); + $this->product->setMenu($this->product->getPairs('nodeleted', $this->session->PRJ), $productID, $branch); $product = $this->product->getByID($productID); $branchProduct = $product->type == 'normal' ? false : true; @@ -615,7 +615,7 @@ class story extends control elseif($projectID) { $this->lang->story->menu = $this->lang->project->menu; - $this->project->setMenu($this->project->getPairs('nodeleted', $this->session->program), $projectID); + $this->project->setMenu($this->project->getPairs('nodeleted', $this->session->PRJ), $projectID); $this->lang->set('menugroup.story', 'project'); $this->lang->story->menuOrder = $this->lang->project->menuOrder; @@ -797,7 +797,7 @@ class story extends control $users = $this->user->getPairs('noletter'); /* Set the menu. */ - $this->product->setMenu($this->product->getPairs('', $this->session->program), $product->id, $story->branch); + $this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $product->id, $story->branch); if($from == 'project') { @@ -824,7 +824,7 @@ class story extends control $this->view->track = $this->story->getTrackByID($story->id); $this->view->users = $users; $this->view->relations = $this->story->getStoryRelation($story->id, $story->type); - $this->view->projects = $this->loadModel('project')->getPairs('nocode', $this->session->program); + $this->view->projects = $this->loadModel('project')->getPairs('nocode', $this->session->PRJ); $this->view->program = $this->project->getByID($story->program); $this->view->actions = $this->action->getList('story', $storyID); $this->view->storyModule = $storyModule; @@ -903,7 +903,7 @@ class story extends control $this->replaceURLang($story->type); /* Set menu. */ - $this->product->setMenu($this->product->getPairs('', $this->session->program), $product->id, $story->branch); + $this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $product->id, $story->branch); /* Set the review result options. */ if($story->status == 'draft' and $story->version == 1) unset($this->lang->story->reviewResultList['revert']); @@ -988,7 +988,7 @@ class story extends control $this->replaceURLang($story->type); /* Set menu. */ - $this->product->setMenu($this->product->getPairs('', $this->session->program), $product->id, $story->branch); + $this->product->setMenu($this->product->getPairs('', $this->session->PRJ), $product->id, $story->branch); /* Set the closed reason options. */ if($story->status == 'draft') unset($this->lang->story->reasonList['cancel']); @@ -1060,7 +1060,7 @@ class story extends control /* The stories of a product. */ if($productID) { - $this->product->setMenu($this->product->getPairs('nodeleted', $this->session->program), $productID); + $this->product->setMenu($this->product->getPairs('nodeleted', $this->session->PRJ), $productID); $product = $this->product->getByID($productID); $this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id"), $product->name); $this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchClose; @@ -1070,7 +1070,7 @@ class story extends control { $this->lang->story->menu = $this->lang->project->menu; $this->lang->story->menuOrder = $this->lang->project->menuOrder; - $this->project->setMenu($this->project->getPairs('nodeleted', $this->session->program), $projectID); + $this->project->setMenu($this->project->getPairs('nodeleted', $this->session->PRJ), $projectID); $this->lang->set('menugroup.story', 'project'); $project = $this->project->getByID($projectID); $this->view->position[] = html::a($this->createLink('project', 'story', "project=$project->id"), $project->name); @@ -1222,7 +1222,7 @@ class story extends control /* Get story and product. */ $story = $this->story->getById($storyID); - $products = $this->product->getPairs('', $this->session->program); + $products = $this->product->getPairs('', $this->session->PRJ); /* Set menu. */ $this->product->setMenu($products, $story->product, $story->branch); @@ -1266,7 +1266,7 @@ class story extends control */ public function track($productID) { - $products = $this->loadModel('product')->getPairs('', $this->session->program); + $products = $this->loadModel('product')->getPairs('', $this->session->PRJ); $productID = $this->product->saveState($productID, $products); $this->product->setMenu($products, $productID, 0, 0, ''); $tracks = $this->story->getTracks($productID); @@ -1337,7 +1337,7 @@ class story extends control public function zeroCase($productID, $orderBy = 'id_desc') { $this->session->set('productList', $this->app->getURI(true)); - $products = $this->loadModel('product')->getPairs('', $this->session->program); + $products = $this->loadModel('product')->getPairs('', $this->session->PRJ); $this->lang->set('menugroup.story', 'qa'); $this->lang->story->menu = $this->lang->testcase->menu; @@ -1391,7 +1391,7 @@ class story extends control /* Get story, product, products, and queryID. */ $story = $this->story->getById($storyID); - $products = $this->product->getPairs('', $this->session->program); + $products = $this->product->getPairs('', $this->session->PRJ); $queryID = 0; /* Build search form. */ @@ -1618,7 +1618,7 @@ class story extends control $this->view->datas[$chart] = $this->report->computePercent($chartData); } } - $this->products = $this->product->getPairs('', $this->session->program); + $this->products = $this->product->getPairs('', $this->session->PRJ); $this->product->setMenu($this->products, $productID, $branchID); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->story->reportChart; @@ -1707,7 +1707,7 @@ class story extends control /* Get users, products and projects. */ $users = $this->loadModel('user')->getPairs('noletter'); - $products = $this->loadModel('product')->getPairs('nocode', $this->session->program); + $products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ); /* Get related objects id lists. */ $relatedProductIdList = array(); diff --git a/module/story/model.php b/module/story/model.php index 0c4c0a23b5..203abac3c8 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -172,7 +172,7 @@ class storyModel extends model ->add('assignedDate', 0) ->add('version', 1) ->add('status', 'draft') - ->setDefault('program', $this->session->program) + ->setDefault('program', $this->session->PRJ) ->setDefault('plan,verify', '') ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', $now) @@ -334,7 +334,7 @@ class storyModel extends model $story->keywords = $stories->keywords[$i]; $story->sourceNote = $stories->sourceNote[$i]; $story->product = $productID; - $story->program = $this->session->program; + $story->program = $this->session->PRJ; $story->openedBy = $this->app->user->account; $story->openedDate = $now; $story->version = 1; @@ -1984,7 +1984,7 @@ class storyModel extends model } else { - $products = $this->loadModel('product')->getPairs('', $this->session->program); + $products = $this->loadModel('product')->getPairs('', $this->session->PRJ); } $query = $queryID ? $this->loadModel('search')->getQuery($queryID) : ''; @@ -2577,7 +2577,7 @@ class storyModel extends model ->where($this->reportCondition()) ->groupBy('product')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); - $products = $this->loadModel('product')->getPairs('', $this->session->program); + $products = $this->loadModel('product')->getPairs('', $this->session->PRJ); foreach($datas as $productID => $data) $data->name = isset($products[$productID]) ? $products[$productID] : $this->lang->report->undefined; return $datas; } @@ -3476,7 +3476,7 @@ class storyModel extends model { $requirement = $this->getByID($id); $data = new stdclass(); - $data->program = $this->session->program; + $data->program = $this->session->PRJ; $data->product = $this->session->product; $data->AType = 'requirement'; $data->BType = 'story'; diff --git a/module/task/control.php b/module/task/control.php index 5662119b6c..4dc16666a9 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -46,7 +46,7 @@ class task extends control die(js::locate($this->createLink('project', 'task', "projectID=$projectID"))); } - $program = $this->loadModel('project')->getByID($this->session->program); + $program = $this->loadModel('project')->getByID($this->session->PRJ); if($program->template == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; $task = new stdClass(); @@ -82,7 +82,7 @@ class task extends control $storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('project', 'story', "projectID=$projectID"); /* Set menu. */ - $this->project->setMenu($this->project->getPairs('', $this->session->program), $project->id); + $this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $project->id); if(!empty($_POST)) { @@ -201,7 +201,7 @@ class task extends control $this->view->title = $title; $this->view->position = $position; $this->view->project = $project; - $this->view->projects = $this->loadModel('project')->getPairs('', $this->session->program); + $this->view->projects = $this->loadModel('project')->getPairs('', $this->session->PRJ); $this->view->task = $task; $this->view->users = $users; $this->view->stories = $stories; @@ -232,7 +232,7 @@ class task extends control die(js::locate($this->createLink('project', 'task', "projectID=$projectID"))); } - $program = $this->loadModel('project')->getByID($this->session->program); + $program = $this->loadModel('project')->getByID($this->session->PRJ); if($program->template == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; $project = $this->project->getById($projectID); @@ -240,7 +240,7 @@ class task extends control $storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('project', 'story', "projectID=$projectID"); /* Set menu. */ - $this->project->setMenu($this->project->getPairs('', $this->session->program), $project->id); + $this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $project->id); if(!empty($_POST)) { @@ -300,7 +300,7 @@ class task extends control $this->view->actions = $this->loadModel('action')->getList('task', $taskID); /* Set menu. */ - $this->project->setMenu($this->project->getPairs('', $this->session->program), $this->view->project->id); + $this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $this->view->project->id); $this->view->position[] = html::a($this->createLink('project', 'browse', "project={$this->view->task->project}"), $this->view->project->name); } @@ -360,7 +360,7 @@ class task extends control } } - $noclosedProjects = $this->project->getPairs('noclosed,nocode', $this->session->program); + $noclosedProjects = $this->project->getPairs('noclosed,nocode', $this->session->PRJ); unset($noclosedProjects[$this->view->project->id]); $this->view->projects = array($this->view->project->id => $this->view->project->name) + $noclosedProjects; $tasks = $this->task->getParentTaskPairs($this->view->project->id, $this->view->task->parent); @@ -429,7 +429,7 @@ class task extends control if($projectID) { $project = $this->project->getById($projectID); - $this->project->setMenu($this->project->getPairs('', $this->session->program), $project->id); + $this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $project->id); /* Set modules and members. */ $showAllModule = isset($this->config->project->task->allModule) ? $this->config->project->task->allModule : ''; @@ -635,7 +635,7 @@ class task extends control /* Set menu. */ $project = $this->project->getById($task->project); - $this->project->setMenu($this->project->getPairs('', $this->session->program), $project->id); + $this->project->setMenu($this->project->getPairs('', $this->session->PRJ), $project->id); $this->executeHooks($taskID); @@ -1291,7 +1291,7 @@ class task extends control } } - $projects = $this->project->getPairs('', $this->session->program); + $projects = $this->project->getPairs('', $this->session->PRJ); $this->project->setMenu($projects, $projectID); $this->projects = $projects; @@ -1369,7 +1369,7 @@ class task extends control /* Get users and projects. */ $users = $this->loadModel('user')->getPairs('noletter'); - $projects = $this->loadModel('project')->getPairs('all|nocode', $this->session->program); + $projects = $this->loadModel('project')->getPairs('all|nocode', $this->session->PRJ); /* Get related objects id lists. */ $relatedStoryIdList = array(); diff --git a/module/task/model.php b/module/task/model.php index 6da447b233..3c0acaca23 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -36,7 +36,7 @@ class taskModel extends model ->setDefault('project', $projectID) ->setDefault('estimate,left,story', 0) ->setDefault('status', 'wait') - ->setDefault('program', $this->session->program) + ->setDefault('program', $this->session->PRJ) ->setIF($this->post->estimate != false, 'left', $this->post->estimate) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) ->setDefault('estStarted', '0000-00-00') @@ -300,7 +300,7 @@ class taskModel extends model $data[$i]->pri = $tasks->pri[$i]; $data[$i]->estimate = $tasks->estimate[$i]; $data[$i]->left = $tasks->estimate[$i]; - $data[$i]->program = $this->session->program; + $data[$i]->program = $this->session->PRJ; $data[$i]->project = $projectID; $data[$i]->estStarted = empty($tasks->estStarted[$i]) ? '0000-00-00' : $tasks->estStarted[$i]; $data[$i]->deadline = empty($tasks->deadline[$i]) ? '0000-00-00' : $tasks->deadline[$i]; @@ -2473,7 +2473,7 @@ class taskModel extends model $children = $this->dao->select('id,parent,project')->from(TABLE_TASK)->where('parent')->in(array_keys($tasks))->fetchAll('id'); $datas = $this->processData4Report($tasks, $children, 'project'); - $projects = $this->loadModel('project')->getPairs('all', $this->session->program); + $projects = $this->loadModel('project')->getPairs('all', $this->session->PRJ); foreach($datas as $projectID => $data) { $data->name = isset($projects[$projectID]) ? $projects[$projectID] : $this->lang->report->undefined; diff --git a/module/testcase/control.php b/module/testcase/control.php index 0c1092c738..f01a7a891f 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -25,7 +25,7 @@ class testcase extends control $this->loadModel('product'); $this->loadModel('tree'); $this->loadModel('user'); - $this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->program); + $this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->PRJ); if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testcase"))); } @@ -1173,7 +1173,7 @@ class testcase extends control /* Get users, products and projects. */ $users = $this->loadModel('user')->getPairs('noletter'); - $products = $this->loadModel('product')->getPairs('nocode', $this->session->program); + $products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ); $branches = $this->loadModel('branch')->getPairs($productID); /* Get related objects id lists. */ diff --git a/module/testcase/model.php b/module/testcase/model.php index 2780d115f6..c67cdd6fbf 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -133,7 +133,7 @@ class testcaseModel extends model ->add('status', $status) ->add('version', 1) ->add('fromBug', $bugID) - ->add('program', $this->session->program) + ->add('program', $this->session->PRJ) ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', $now) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story)) @@ -226,7 +226,7 @@ class testcaseModel extends model $data[$i] = new stdclass(); $data[$i]->product = $productID; - $data[$i]->program = $this->session->program; + $data[$i]->program = $this->session->PRJ; $data[$i]->branch = $cases->branch[$i]; $data[$i]->module = $cases->module[$i]; $data[$i]->type = $cases->type[$i]; diff --git a/module/testreport/control.php b/module/testreport/control.php index cfff70b454..0f1962bbfa 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -519,14 +519,14 @@ class testreport extends control { if($objectType == 'product') { - $this->products = $this->product->getPairs('nocode', $this->session->program); + $this->products = $this->product->getPairs('nocode', $this->session->PRJ); $productID = $this->product->saveState($objectID, $this->products); $this->testreport->setMenu($this->products, $productID); return $productID; } elseif($objectType == 'project') { - $this->projects = $this->project->getPairs('nocode', $this->session->program); + $this->projects = $this->project->getPairs('nocode', $this->session->PRJ); $projectID = $this->project->saveState($objectID, $this->projects); $this->project->setMenu($this->projects, $projectID); $this->lang->testreport->menu = $this->lang->project->menu; diff --git a/module/testreport/model.php b/module/testreport/model.php index c278cdb792..d99d863c4f 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -65,7 +65,7 @@ class testreportModel extends model { $data = fixer::input('post') ->stripTags($this->config->testreport->editor->create['id'], $this->config->allowedTags) - ->add('program', $this->session->program) + ->add('program', $this->session->PRJ) ->add('createdBy', $this->app->user->account) ->add('createdDate', helper::now()) ->join('stories', ',') diff --git a/module/testsuite/control.php b/module/testsuite/control.php index c720c55956..a937de27d1 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -41,7 +41,7 @@ class testsuite extends control $this->session->set('testsuiteList', $this->app->getURI(true)); /* Set menu. */ - $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program); + $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ); $productID = $this->product->saveState($productID, $this->products); $this->testsuite->setMenu($this->products, $productID); @@ -96,7 +96,7 @@ class testsuite extends control } /* Set menu. */ - $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program); + $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ); $productID = $this->product->saveState($productID, $this->products); $this->testsuite->setMenu($this->products, $productID); @@ -129,7 +129,7 @@ class testsuite extends control 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')); $productID = $suite->product; - $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program); + $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ); $this->testsuite->setMenu($this->products, $productID); /* Save session. */ @@ -198,7 +198,7 @@ class testsuite extends control 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')); /* Get suite info. */ - $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program); + $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ); $productID = $this->product->saveState($suite->product, $this->products); /* Set menu. */ @@ -278,7 +278,7 @@ class testsuite extends control $this->session->set('caseList', $this->app->getURI(true)); /* Get suite and product id. */ - $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->program); + $this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ); $suite = $this->testsuite->getById($suiteID); $productID = $this->product->saveState($suite->product, $this->products); diff --git a/module/testsuite/model.php b/module/testsuite/model.php index 818c4d69bc..12c6bdf3fc 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -111,7 +111,7 @@ class testsuiteModel extends model { $suite = fixer::input('post') ->stripTags($this->config->testsuite->editor->create['id'], $this->config->allowedTags) - ->add('program', $this->session->program) + ->add('program', $this->session->PRJ) ->add('product', (int)$productID) ->add('addedBy', $this->app->user->account) ->add('addedDate', helper::now()) diff --git a/module/testtask/control.php b/module/testtask/control.php index 2eeb2c65fe..e6c570b6b0 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -23,7 +23,7 @@ class testtask extends control { parent::__construct($moduleName, $methodName); $this->loadModel('product'); - $this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->program); + $this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->PRJ); if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testtask"))); } diff --git a/module/testtask/model.php b/module/testtask/model.php index 7441f0eb3b..067ab1c8a5 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -159,7 +159,7 @@ class testtaskModel extends model { $task = fixer::input('post') ->setDefault('build', '') - ->setDefault('program', $this->session->program) + ->setDefault('program', $this->session->PRJ) ->stripTags($this->config->testtask->editor->create['id'], $this->config->allowedTags) ->join('mailto', ',') ->remove('uid,contactListMenu') diff --git a/module/todo/control.php b/module/todo/control.php index 3fe1a52e41..205033d336 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -376,8 +376,8 @@ class todo extends control $this->view->users = $this->user->getPairs('noletter'); $this->view->actions = $this->loadModel('action')->getList('todo', $todoID); $this->view->from = $from; - $this->view->projects = $this->loadModel('project')->getPairs('', $this->session->program); - $this->view->products = $this->loadModel('product')->getPairs('', $this->session->program); + $this->view->projects = $this->loadModel('project')->getPairs('', $this->session->PRJ); + $this->view->products = $this->loadModel('product')->getPairs('', $this->session->PRJ); $this->display(); } diff --git a/module/tree/control.php b/module/tree/control.php index 5b553a2e9d..4b166c74bd 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -61,7 +61,7 @@ class tree extends control if($viewType == 'story') { - $products = $this->product->getPairs('', $this->session->program); + $products = $this->product->getPairs('', $this->session->PRJ); $this->lang->set('menugroup.tree', 'product'); $this->product->setMenu($products, $rootID, $branch, 'story', '', 'story'); @@ -81,7 +81,7 @@ class tree extends control } elseif($viewType == 'bug') { - $this->loadModel('bug')->setMenu($this->product->getPairs('', $this->session->program), $rootID); + $this->loadModel('bug')->setMenu($this->product->getPairs('', $this->session->PRJ), $rootID); $this->lang->tree->menu = $this->lang->bug->menu; $this->lang->tree->menuOrder = $this->lang->bug->menuOrder; $this->lang->set('menugroup.tree', 'qa'); @@ -104,7 +104,7 @@ class tree extends control } elseif($viewType == 'case') { - $this->loadModel('testcase')->setMenu($this->product->getPairs('', $this->session->program), $rootID); + $this->loadModel('testcase')->setMenu($this->product->getPairs('', $this->session->PRJ), $rootID); $this->lang->tree->menu = $this->lang->testcase->menu; $this->lang->tree->menuOrder = $this->lang->testcase->menuOrder; $this->lang->set('menugroup.tree', 'qa'); @@ -138,7 +138,7 @@ class tree extends control } elseif($viewType == 'line') { - $products = $this->product->getPairs('', $this->session->program); + $products = $this->product->getPairs('', $this->session->PRJ); $this->lang->set('menugroup.tree', 'product'); $this->product->setMenu($products, $rootID, $branch, 'line', '', 'line'); @@ -212,7 +212,7 @@ class tree extends control $products = $this->project->getProducts($rootID); $this->view->products = $products; - $projects = $this->project->getPairs('', $this->session->program); + $projects = $this->project->getPairs('', $this->session->PRJ); $this->lang->set('menugroup.tree', 'project'); $this->project->setMenu($projects, $rootID); $this->lang->tree->menu = $this->lang->project->menu; @@ -288,7 +288,7 @@ class tree extends control $product = $this->loadModel('product')->getById($module->root); if($product->type != 'normal') $this->view->branches = $this->loadModel('branch')->getPairs($module->root); $this->view->product = $product; - $this->view->products = $this->product->getPairs('', $this->session->program); + $this->view->products = $this->product->getPairs('', $this->session->PRJ); } /* Remove self and childs from the $optionMenu. Because it's parent can't be self or childs. */ diff --git a/module/upgrade/control.php b/module/upgrade/control.php index c381e0dd34..f7953ffa78 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -192,10 +192,10 @@ class upgrade extends control if(isset($_POST['newProgram']) or !isset($_POST['programs'])) { - if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin))); + if(empty($_POST['PRJadmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->PRJadmin))); /* Create Program. */ - $programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmins); + $programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->PRJadmins); if(dao::isError()) die(js::error(dao::getError())); } else @@ -237,10 +237,10 @@ class upgrade extends control if(isset($_POST['newProgram']) or !isset($_POST['programs'])) { - if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin))); + if(empty($_POST['PRJadmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->PRJadmin))); /* Create Program. */ - $programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmins); + $programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->PRJadmins); if(dao::isError()) die(js::error(dao::getError())); } else @@ -264,10 +264,10 @@ class upgrade extends control $linkedProjects = $this->post->projects; if(isset($_POST['newProgram']) or !isset($_POST['programs'])) { - if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin))); + if(empty($_POST['PRJadmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->PRJadmin))); /* Create Program. */ - $programID = $this->upgrade->createProgram(array(), $linkedProjects, $this->post->pgmAdmins); + $programID = $this->upgrade->createProgram(array(), $linkedProjects, $this->post->PRJadmins); if(dao::isError()) die(js::error(dao::getError())); } else diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php index 296ad4e2db..e2b30bc2c0 100644 --- a/module/upgrade/lang/zh-cn.php +++ b/module/upgrade/lang/zh-cn.php @@ -77,7 +77,7 @@ EOD; $lang->upgrade->line = '产品线'; $lang->upgrade->program = '归并项目'; $lang->upgrade->existPGM = '已有项目'; -$lang->upgrade->pgmAdmin = '项目管理员'; +$lang->upgrade->PRJadmin = '项目管理员'; $lang->upgrade->product = $lang->productCommon; $lang->upgrade->project = $lang->projectCommon; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 31800fd2df..27106e8c12 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -3851,7 +3851,7 @@ class upgradeModel extends model * @access public * @return int */ - public function createProgram($productIdList = array(), $projectIdList = array(), $pgmAdmins = '') + public function createProgram($productIdList = array(), $projectIdList = array(), $PRJadmins = '') { $data = fixer::input('post')->get(); $program = new stdclass(); @@ -3892,18 +3892,18 @@ class upgradeModel extends model $programID = $this->dao->lastInsertId(); $this->dao->update(TABLE_PROJECT)->set('grade')->eq(1)->set('path')->eq(",{$programID},")->where('id')->eq($programID)->exec(); - if($pgmAdmins) + if($PRJadmins) { - $groupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('pgmadmin')->fetch('id'); + $groupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('PRJadmin')->fetch('id'); if($groupID) { - foreach($pgmAdmins as $pgmAdmin) + foreach($PRJadmins as $PRJadmin) { - $userGroup = $this->dao->select('*')->from(TABLE_USERGROUP)->where('account')->eq($pgmAdmin)->andWhere('`group`')->eq($groupID)->fetch(); + $userGroup = $this->dao->select('*')->from(TABLE_USERGROUP)->where('account')->eq($PRJadmin)->andWhere('`group`')->eq($groupID)->fetch(); if(empty($userGroup)) { $userGroup = new stdclass(); - $userGroup->account = $pgmAdmin; + $userGroup->account = $PRJadmin; $userGroup->group = $groupID; $userGroup->program = ''; } @@ -4058,7 +4058,7 @@ class upgradeModel extends model */ public function setDefaultPriv() { - $groups = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->ne('limited')->andWhere('role')->ne('pgmadmin')->fetchPairs(); + $groups = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->ne('limited')->andWhere('role')->ne('PRJadmin')->fetchPairs(); foreach($groups as $groupID) { $data = new stdclass(); @@ -4071,11 +4071,11 @@ class upgradeModel extends model $this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec(); } - $pgmAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('pgmadmin')->fetch('id'); + $PRJadminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('PRJadmin')->fetch('id'); foreach($this->lang->resource->program as $method => $methodLang) { $data = new stdclass(); - $data->group = $pgmAdminGroupID; + $data->group = $PRJadminGroupID; $data->module = 'program'; $data->method = $method; $this->dao->replace(TABLE_GROUPPRIV)->data($data)->exec(); diff --git a/module/upgrade/view/createprogram.html.php b/module/upgrade/view/createprogram.html.php index 700c5ba561..505388ea55 100644 --- a/module/upgrade/view/createprogram.html.php +++ b/module/upgrade/view/createprogram.html.php @@ -25,8 +25,8 @@|||
| upgrade->pgmAdmin;?> | -+ | upgrade->PRJadmin;?> | +|
| program->PM;?> | diff --git a/module/user/model.php b/module/user/model.php index 6604699fa6..7c7081a530 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -823,7 +823,7 @@ class userModel extends model $groups = $this->dao->select('t1.acl, t1.program')->from(TABLE_GROUP)->alias('t1') ->leftJoin(TABLE_USERGROUP)->alias('t2')->on('t1.id=t2.group') ->where('t2.account')->eq($account) - ->andWhere('t1.role')->ne('pgmadmin') + ->andWhere('t1.role')->ne('PRJadmin') ->andWhere('t1.role')->ne('limited') ->fetchAll(); $acls = array(); @@ -901,8 +901,8 @@ class userModel extends model } /* Get can manage programs by user. */ - $pgmAdminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('pgmadmin')->fetch('id'); - $canManagePrograms = $this->dao->select('program')->from(TABLE_USERGROUP)->where('`group`')->eq($pgmAdminGroupID)->andWhere('account')->eq($account)->fetch('program'); + $PRJadminGroupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('PRJadmin')->fetch('id'); + $canManagePrograms = $this->dao->select('program')->from(TABLE_USERGROUP)->where('`group`')->eq($PRJadminGroupID)->andWhere('account')->eq($account)->fetch('program'); return array('rights' => $rights, 'acls' => $acls, 'programs' => $canManagePrograms); } @@ -955,10 +955,9 @@ class userModel extends model { $projects = $this->dao->select('t1.*,t2.*')->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.root = t2.id') - ->where('t1.type')->eq('project') + ->where('t1.type')->in('sprint,stage,kanban') ->andWhere('t1.account')->eq($account) ->andWhere('t2.deleted')->eq(0) - ->andWhere('t2.program')->ne(0) ->orderBy('t2.id_desc') ->fetchAll(); @@ -1371,7 +1370,7 @@ class userModel extends model $groups = ',' . join(',', $groups) . ','; static $allProducts, $allPrograms, $allProjects, $projectProducts, $teams; - if($allPrograms === null) $allPrograms = $this->dao->select('id,PO,PM,QD,RD,acl,whitelist')->from(TABLE_PROJECT)->where('template')->ne('')->andWhere('program')->eq(0)->fetchAll('id'); + if($allPrograms === null) $allPrograms = $this->dao->select('id,PO,PM,QD,RD,acl,whitelist')->from(TABLE_PROJECT)->where('type')->eq('project')->fetchAll('id'); if($teams === null) { $stmt = $this->dao->select('root,account')->from(TABLE_TEAM)->where('type')->eq('project')->query(); @@ -1397,7 +1396,7 @@ class userModel extends model } $allProducts = $this->dao->select('id,PO,QD,RD,createdBy,acl,whitelist')->from(TABLE_PRODUCT)->where('program')->in($programs)->fetchAll('id'); - $allProjects = $this->dao->select('id,PO,PM,QD,RD,acl,whitelist')->from(TABLE_PROJECT)->where('program')->in($programs)->fetchAll('id'); + $allProjects = $this->dao->select('id,PO,PM,QD,RD,acl,whitelist')->from(TABLE_PROJECT)->where('parent')->in($programs)->fetchAll('id'); if($projectProducts === null) { $stmt = $this->dao->select('project,product')->from(TABLE_PROJECTPRODUCT)->query(); @@ -1457,8 +1456,7 @@ class userModel extends model $openedPrograms = $this->dao->select('id')->from(TABLE_PROJECT) ->where('acl')->eq('open') - ->andWhere('program')->eq(0) - ->andWhere('template')->ne('') + ->andWhere('type')->eq('project') ->fetchAll('id'); $openedPrograms = join(',', array_keys($openedPrograms)); @@ -1480,11 +1478,7 @@ class userModel extends model $programIds = explode(',', $userView->programs); $openedProducts = $this->dao->select('id')->from(TABLE_PRODUCT)->where('acl')->eq('open')->andWhere('program')->in($programIds)->fetchAll('id'); - $openedProjects = $this->dao->select('id')->from(TABLE_PROJECT) - ->where('acl')->eq('open') - ->andWhere('program')->in($programIds) - ->andWhere('template')->eq('') - ->fetchAll('id'); + $openedProjects = $this->dao->select('id')->from(TABLE_PROJECT)->where('acl')->eq('open')->andWhere('parent')->in($programIds)->fetchAll('id'); $openedProducts = join(',', array_keys($openedProducts)); $openedProjects = join(',', array_keys($openedProjects)); diff --git a/module/weekly/control.php b/module/weekly/control.php index 6ba7e6029d..938b89f26f 100644 --- a/module/weekly/control.php +++ b/module/weekly/control.php @@ -34,7 +34,7 @@ class weekly extends control */ public function index($program = 0, $date = '') { - $program = $program ? $program : $this->session->program; + $program = $program ? $program : $this->session->PRJ; if(!$date) $date = helper::today(); $date = date('Y-m-d', strtotime($date)); diff --git a/module/workestimation/control.php b/module/workestimation/control.php index 55352fcf42..e619da2376 100644 --- a/module/workestimation/control.php +++ b/module/workestimation/control.php @@ -20,7 +20,7 @@ class workestimation extends control */ public function index($program = 0) { - $program = $program ? $program : $this->session->program; + $program = $program ? $program : $this->session->PRJ; if($_POST) { $result = $this->workestimation->save($program); diff --git a/www/theme/default/style.css b/www/theme/default/style.css index be6a812116..83bc5f4d95 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -46,3 +46,6 @@ a.showMoreImage:hover {opacity: 1;} .margin-l-50px{margin-left:50px;} #menu{width: 96px} +#menuNav>.nav>li>span{padding: 8px; line-height: 20px; cursor: pointer; color: #fff;} +#morePRJ{display:none; max-height: 420px; position: fixed; bottom: 0; left: 100px; z-index: 999; background: white; padding: 20px 10px; height: 420px; margin-bottom: 35px;} +#morePRJ .list-group{height: 400px; min-width: 150px; max-width:200px;} diff --git a/zdata/common/date/v1.yaml b/zdata/common/date/v1.yaml index d7363d38af..79bc7edd9f 100644 --- a/zdata/common/date/v1.yaml +++ b/zdata/common/date/v1.yaml @@ -1,9 +1,9 @@ -title: date +title: moreDate desc: 系统可用日期类型 author: ly version: 1.0 -field: date +field: moreDate instances: - instance: dateA fields: diff --git a/zdata/create.php b/zdata/create.php new file mode 100644 index 0000000000..27ab82fe52 --- /dev/null +++ b/zdata/create.php @@ -0,0 +1,74 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // 设置报错处理方式。 + $dbh->exec("SET GLOBAL sql_mode = '';"); + $dbh->beginTransaction(); + + foreach($sqlFilePath as $file) + { + if(strpos($file, '.sql')) + { + $tableName = basename($file, '.sql'); + + $truncate = 'truncate table ' . $tableName; + $dbh->exec($truncate); + + $sql = file_get_contents($sqlDir . $file); + $count = $dbh->exec($sql); + echo $tableName . '表影响行数:' . $count . PHP_EOL; + } + } + + $dbh->commit(); + $dbh = null; // 关闭连接。 +} +catch (PDOException $e) +{ + die('Error!: ' . $e->getMessage() . PHP_EOL); +} diff --git a/zdata/demo/story/common/date/v1.yaml b/zdata/demo/story/common/date/v1.yaml index 4455e08de2..79bc7edd9f 100644 --- a/zdata/demo/story/common/date/v1.yaml +++ b/zdata/demo/story/common/date/v1.yaml @@ -1,14 +1,14 @@ -title: date +title: moreDate desc: 系统可用日期类型 author: ly version: 1.0 -field: date +field: moreDate instances: - instance: dateA fields: - field: year - range: 2019-2020 + range: 2019-2022 postfix: "-" - field: month range: 1-12 @@ -33,7 +33,7 @@ instances: - instance: dateB fields: - field: year - range: 2019-2020 + range: 2019-2022 postfix: "-" - field: month range: 1-12 diff --git a/zdata/demo/story/manual.txt b/zdata/demo/story/config/config.yaml similarity index 100% rename from zdata/demo/story/manual.txt rename to zdata/demo/story/config/config.yaml diff --git a/zdata/demo/story/zt_action.yaml b/zdata/demo/story/zt_action.yaml index c717cd1a76..c373f289aa 100644 --- a/zdata/demo/story/zt_action.yaml +++ b/zdata/demo/story/zt_action.yaml @@ -20,15 +20,15 @@ fields: - field: product note: "产品" range: 1-100 - prefix: "" - postfix: "" + prefix: "," + postfix: "," loop: 0 format: "" - field: project note: "项目" range: 1-100 - prefix: "," - postfix: "," + prefix: "" + postfix: "" loop: 0 format: "" - field: actor @@ -44,13 +44,6 @@ fields: postfix: "" loop: 0 format: "" - - field: date - note: "日期" - range: 10-22 - prefix: "2020-09-09 " - postfix: ":11:24" - loop: 0 - format: "" - field: comment note: "备注" range: "1-10000" diff --git a/zdata/out.txt b/zdata/out.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/zdata/zt_action.yaml b/zdata/zt_action.yaml index f2537ca224..580cc8c24b 100644 --- a/zdata/zt_action.yaml +++ b/zdata/zt_action.yaml @@ -12,23 +12,23 @@ fields: format: "" - field: objectID note: "对象ID" - range: "1-10000" + range: "1-100000" prefix: "" postfix: "" loop: 0 format: "" - field: product note: "产品" - range: "1-10000" - prefix: "" - postfix: "" + range: "1-100000" + prefix: "," + postfix: "," loop: 0 format: "" - field: project note: "项目" - range: "1-10000" - prefix: "," - postfix: "," + range: "1-100000" + prefix: "" + postfix: "" loop: 0 format: "" - field: actor @@ -55,7 +55,7 @@ fields: format: "" - field: comment note: "备注" - range: "1-10000" + range: "1-100000" prefix: "这是一个系统日志测试备注" postfix: "" loop: 0