| execution->project;?> | -+ | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| execution->type;?> | -- execution->lifeTimeList, '', "class='form-control' onchange='showLifeTimeTips()'"); - } - else - { - echo html::select('attribute', $lang->stage->typeList, '', "class='form-control'"); - } - ?> - | +execution->lifeTimeList, '', "class='form-control' onchange='showLifeTimeTips()'"); ?> | execution->typeDesc;?> |
||||||||
| programplan->percent;?> | -
-
-
- %
-
- |
- ||||||||||
| execution->status;?> | @@ -183,7 +160,6 @@ | ||||||||||
| - | diff --git a/module/my/control.php b/module/my/control.php index 4037593ae0..f731e53bb5 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -476,6 +476,37 @@ class my extends control $this->display(); } + public function doc($type = 'openedbyme', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + /* Save session, load lang. */ + if($this->app->viewType != 'json') $this->session->set('docList', $this->app->getURI(true)); + $this->loadModel('doc'); + + /* Load pager. */ + $this->app->loadClass('pager', $static = true); + $pager = pager::init($recTotal, $recPerPage, $pageID); + + /* Append id for secend sort. */ + $sort = $this->loadModel('common')->appendOrder($orderBy); + + $docs = $this->doc->getDocsByBrowseType(0, $type, 0, 0, $sort, $pager); + + /* Assign. */ + $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->doc; + $this->view->position[] = $this->lang->my->doc; + $this->view->docs = $docs; + $this->view->users = $this->user->getPairs('noletter'); + $this->view->type = $type; + $this->view->recTotal = $recTotal; + $this->view->recPerPage = $recPerPage; + $this->view->pageID = $pageID; + $this->view->orderBy = $orderBy; + $this->view->pager = $pager; + + $this->display(); + + } + /** * My projects. * diff --git a/module/my/js/doc.js b/module/my/js/doc.js new file mode 100644 index 0000000000..ef9e5db6f3 --- /dev/null +++ b/module/my/js/doc.js @@ -0,0 +1,19 @@ +$('.ajaxCollect').click(function (event) { + var obj = $(this); + var url = obj.data('url'); + $.get(url, function(response) + { + if(response.status == 'yes') + { + obj.children('i').removeClass().addClass('icon icon-star text-yellow'); + obj.parent().prev().children('.file-name').children('i').remove('.icon'); + obj.parent().prev().children('.file-name').prepend(' '); + } + else + { + obj.children('i').removeClass().addClass('icon icon-star-empty'); + obj.parent().prev().children('.file-name').children('i').remove(".icon"); + } + }, 'json'); + return false; +}); diff --git a/module/my/lang/de.php b/module/my/lang/de.php index dda1bbe311..f66f5d7066 100644 --- a/module/my/lang/de.php +++ b/module/my/lang/de.php @@ -14,6 +14,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->doc = "My Docs"; $lang->my->createProgram = 'Create Program'; $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; diff --git a/module/my/lang/en.php b/module/my/lang/en.php index dda1bbe311..f66f5d7066 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -14,6 +14,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->doc = "My Docs"; $lang->my->createProgram = 'Create Program'; $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; diff --git a/module/my/lang/fr.php b/module/my/lang/fr.php index dda1bbe311..f66f5d7066 100644 --- a/module/my/lang/fr.php +++ b/module/my/lang/fr.php @@ -14,6 +14,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->doc = "My Docs"; $lang->my->createProgram = 'Create Program'; $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; diff --git a/module/my/lang/vi.php b/module/my/lang/vi.php index dda1bbe311..f66f5d7066 100644 --- a/module/my/lang/vi.php +++ b/module/my/lang/vi.php @@ -14,6 +14,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->doc = "My Docs"; $lang->my->createProgram = 'Create Program'; $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 542889bddf..d376bd3230 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -14,6 +14,7 @@ $lang->my->bug = '我的Bug'; $lang->my->testTask = '我的版本'; $lang->my->testCase = '我的用例'; $lang->my->story = "我的{$lang->SRCommon}"; +$lang->my->doc = "我的文档"; $lang->my->createProgram = '添加项目'; $lang->my->project = "我的项目"; $lang->my->execution = "我的{$lang->executionCommon}"; diff --git a/module/my/view/doc.html.php b/module/my/view/doc.html.php new file mode 100644 index 0000000000..b584afeabd --- /dev/null +++ b/module/my/view/doc.html.php @@ -0,0 +1,73 @@ + + * @package my + * @version $Id + * @link http://www.zentao.net + */ +?> + + +|||||||||||
| program->common;?> | -+ | ||||||||||
| id);?> | -createLink('project', 'task', 'project=' . $project->id, '', false, $project->id), $project->name, '_parent');?> | +createLink('project', explode('-', $config->projectLink)[1], 'project=' . $project->id, '', false, $project->id), $project->name, '_parent');?> | programName) ? $project->programName : '';?> | PM]) ? $PMList[$project->PM]->id : ''?> diff --git a/module/productplan/js/browse.js b/module/productplan/js/browse.js index f52f31a236..d0727126a0 100644 --- a/module/productplan/js/browse.js +++ b/module/productplan/js/browse.js @@ -1,5 +1,5 @@ $(document).on('click', '.task-toggle', function(e) -{ +{ var $toggle = $(this); var id = $(this).data('id'); var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed'); @@ -24,7 +24,7 @@ $(function() { var PRJID = $('#project').val(); var planID = $('#planID').val(); - parent.location.href = createLink('project', 'create', 'productID=' + productID + '&projectID=©ProjectID=&planID=' + planID, '', '', PRJID); + parent.location.href = createLink('execution', 'create', 'productID=' + productID + '&executionID=©ExecutionID=&planID=' + planID + '&confirm=&projectID=' + PRJID, '', ''); }); }); $(document).on('click', 'td.content .more', function(e) diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 1fbe377f3c..963ec5c705 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -120,7 +120,7 @@ | stories;?> | bugs;?> | hour;?> | -projectID)) echo html::a(helper::createLink('project', 'task', 'projectID=' . $plan->projectID), '');?> | +projectID)) echo html::a(helper::createLink('execution', 'task', 'projectID=' . $plan->projectID), '');?> |
', ' ', ' ', ' '), "\n", str_replace(array("\n", "\r"), '', $plan->desc)), ' | ";?>
', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this)' class='btn' title='{$lang->productplan->createExecution}'");
+ if(common::hasPriv('execution', 'create', $plan)) echo html::a('#projects', '', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this)' class='btn' title='{$lang->productplan->createExecution}'");
if(common::hasPriv('productplan', 'linkStory', $plan) and $plan->parent >= 0) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkStory}'");
if(common::hasPriv('productplan', 'linkBug', $plan)) echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkBug}'");
common::printIcon('productplan', 'edit', "planID=$plan->id", $plan, 'list');
diff --git a/module/project/control.php b/module/project/control.php
index 1d56002c3f..af1ea80e39 100644
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -501,7 +501,6 @@ class project extends control
public function view($projectID = 0)
{
$this->app->loadLang('bug');
- $this->lang->navGroup->project = 'project';
$this->lang->project->menu = $this->lang->scrum->setMenu;
$moduleIndex = array_search('project', $this->lang->noMenuModule);
if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
@@ -546,7 +545,6 @@ class project extends control
*/
public function group($projectID = 0, $programID = 0)
{
- $this->lang->navGroup->project = 'project';
$this->lang->project->menu = $this->lang->scrum->setMenu;
$moduleIndex = array_search('project', $this->lang->noMenuModule);
if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
@@ -1214,7 +1212,6 @@ class project extends control
{
if($from == 'project')
{
- $this->lang->navGroup->project = 'project';
$this->lang->project->menu = $this->lang->scrum->setMenu;
$moduleIndex = array_search('project', $this->lang->noMenuModule);
if($moduleIndex !== false) unset($this->lang->noMenuModule[$moduleIndex]);
@@ -1378,9 +1375,6 @@ class project extends control
*/
public function adjustNavigation($from = '', $projectID = 0)
{
- if($from == 'browse') $this->lang->project->menu = $this->lang->project->menu;
- if($from == 'program') $this->lang->navGroup->project = 'project';
-
if($from == 'project')
{
$this->lang->navGroup->project = 'project';
diff --git a/module/project/js/create.js b/module/project/js/create.js
index 797ffd5a67..d85cf06508 100644
--- a/module/project/js/create.js
+++ b/module/project/js/create.js
@@ -27,12 +27,12 @@ $(function()
/**
* Set parent program.
*
+ * @param $parentProgram
* @access public
* @return void
*/
-function setParentProgram()
+function setParentProgram(parentProgram)
{
- var parentProgram = $("#parent").val();
location.href = createLink('project', 'create', 'model=' + model + '&programID=' + parentProgram);
}
diff --git a/module/projectbuild/control.php b/module/projectbuild/control.php
new file mode 100644
index 0000000000..2b068277cd
--- /dev/null
+++ b/module/projectbuild/control.php
@@ -0,0 +1,78 @@
+
+ * @package projectBuild
+ * @version $Id: control.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
+ * @link http://www.zentao.net
+ */
+class projectBuild extends control
+{
+ /**
+ * Browse builds of a project.
+ *
+ * @param int $projectID
+ * @param string $type all|product|bysearch
+ * @param int $param
+ * @access public
+ * @return void
+ */
+ public function browse($projectID = 0, $type = 'all', $param = 0)
+ {
+ $this->loadModel('project');
+ $this->loadModel('execution');
+ $this->loadModel('build');
+ $project = $this->project->getByID($projectID);
+
+ /* Get products' list. */
+ $products = $this->project->getProducts($projectID, false);
+ $products = array('' => '') + $products;
+
+ /* Build the search form. */
+ $type = strtolower($type);
+ $queryID = ($type == 'bysearch') ? (int)$param : 0;
+ $actionURL = $this->createLink('projectbuild', 'browse', "projectID=$projectID&type=bysearch&queryID=myQueryID");
+
+ $executions = $this->execution->getByProject($projectID, 'all', '', true);
+ $this->config->build->search['fields']['project'] = $this->project->lang->executionCommon;
+ $this->config->build->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $executions);
+
+ $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'project');
+ commonModel::setAppObjectID('project', $projectID);
+
+ if($type == 'bysearch')
+ {
+ $builds = $this->build->getProjectBuildsBySearch((int)$projectID, (int)$param);
+ }
+ else
+ {
+ $builds = $this->build->getProjectBuilds((int)$projectID, $type, $param);
+ }
+
+ /* Set project builds. */
+ $projectBuilds = array();
+ if(!empty($builds))
+ {
+ foreach($builds as $build) $projectBuilds[$build->product][] = $build;
+ }
+
+ /* Header and position. */
+ $this->view->title = $project->name . $this->lang->colon . $this->lang->execution->build;
+ $this->view->position[] = html::a(inlink('browse', "projectID=$projectID"), $project->name);
+ $this->view->position[] = $this->lang->execution->build;
+
+ $this->view->users = $this->loadModel('user')->getPairs('noletter');
+ $this->view->buildsTotal = count($builds);
+ $this->view->projectBuilds = $projectBuilds;
+ $this->view->projectID = $projectID;
+ $this->view->product = $type == 'product' ? $param : 'all';
+ $this->view->project = $project;
+ $this->view->products = $products;
+ $this->view->executions = $executions;
+ $this->view->type = $type;
+
+ $this->display();
+ }
+}
diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php
index a523c68643..00011d36f6 100644
--- a/module/projectrelease/control.php
+++ b/module/projectrelease/control.php
@@ -58,20 +58,23 @@ class projectrelease extends control
/**
* Browse releases.
*
+ * @param int $projectID
* @param string $type
* @access public
* @return void
*/
- public function browse($type = 'all')
+ public function browse($projectID, $type = 'all')
{
$this->session->set('releaseList', $this->app->getURI(true));
$execution = $this->loadModel('execution')->getById($this->session->PRJ);
+ commonModel::setAppObjectID('project', $projectID);
$this->view->title = $execution->name . $this->lang->colon . $this->lang->release->browse;
$this->view->position[] = $this->lang->release->browse;
$this->view->execution = $execution;
$this->view->products = $this->loadModel('product')->getProducts($this->session->PRJ);
- $this->view->releases = $this->projectrelease->getList($this->session->PRJ, $type);
+ $this->view->releases = $this->projectrelease->getList($projectID, $type);
+ $this->view->projectID = $projectID;
$this->view->type = $type;
$this->display();
}
@@ -79,10 +82,11 @@ class projectrelease extends control
/**
* Create a release.
*
+ * @param int $projectID
* @access public
* @return void
*/
- public function create()
+ public function create($projectID)
{
$this->app->loadConfig('release');
$this->config->projectrelease->create = $this->config->release->create;
@@ -105,7 +109,9 @@ class projectrelease extends control
foreach($releaseBuilds as $build) unset($builds[$build]);
unset($builds['trunk']);
+ commonModel::setAppObjectID('project', $projectID);
$this->commonAction();
+
$this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create;
$this->view->position[] = $this->lang->release->create;
$this->view->builds = $builds;
diff --git a/module/projectrelease/view/browse.html.php b/module/projectrelease/view/browse.html.php
index 033f4849c6..2cd8005432 100644
--- a/module/projectrelease/view/browse.html.php
+++ b/module/projectrelease/view/browse.html.php
@@ -16,14 +16,14 @@
-
repo->create; ?>+repo->createAction;?> |