* code for task#1368.

This commit is contained in:
zhujinyong
2013-06-04 05:59:58 +00:00
parent 51257be1b0
commit c43c3aebcd
3 changed files with 13 additions and 9 deletions
+3 -1
View File
@@ -37,6 +37,7 @@ class tree extends control
$this->view->root = $project;
$this->view->projectModules = $this->tree->getOptionMenu($rootID, 'task');
}
/* The viewType is doc. */
elseif(strpos($viewType, 'doc') !== false)
{
@@ -162,7 +163,7 @@ class tree extends control
* @access public
* @return void
*/
public function edit($moduleID)
public function edit($moduleID, $type)
{
if(!empty($_POST))
{
@@ -176,6 +177,7 @@ class tree extends control
$module->owner = $this->loadModel('product')->getById($module->root)->QD;
}
$this->view->module = $module;
$this->view->type = $type;
$this->view->optionMenu = $this->tree->getOptionMenu($this->view->module->root, $this->view->module->type);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
+4 -3
View File
@@ -82,7 +82,7 @@ class treeModel extends model
->get();
}
/* $createdVersion > 4.1 or $type == 'story'*/
/* $createdVersion > 4.1 or $type == 'story' */
return $this->dao->select('*')->from(TABLE_MODULE)
->where('root')->eq((int)$rootID)
->andWhere('type')->eq($type)
@@ -351,14 +351,15 @@ class treeModel extends model
static $users;
if(empty($users)) $users = $this->loadModel('user')->getPairs('noletter');
$linkHtml = $module->name;
if($module->type == 'bug' and $module->owner) $linkHtml .= '<span class="owner">[' . $users[$module->owner] . ']</span>';
if($type == 'bug' and $module->owner) $linkHtml .= '<span class="owner">[' . $users[$module->owner] . ']</span>';
if($type != 'story' and $module->type == 'story')
{
if(common::hasPriv('tree', 'edit')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'edit', "module={$module->id}&type=$type"), $this->lang->tree->edit, '', 'class="iframe"');
if(common::hasPriv('tree', 'browse')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'browse', "root={$module->root}&type=$type&module={$module->id}"), $this->lang->tree->child);
}
else
{
if(common::hasPriv('tree', 'edit')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'edit', "module={$module->id}"), $this->lang->tree->edit, '', 'class="iframe"');
if(common::hasPriv('tree', 'edit')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'edit', "module={$module->id}&type=$type"), $this->lang->tree->edit, '', 'class="iframe"');
if(common::hasPriv('tree', 'browse') and strpos('productdoc,projectdoc', $module->type) === false and $module->type != 'webapp') $linkHtml .= ' ' . html::a(helper::createLink('tree', 'browse', "root={$module->root}&type=$type&module={$module->id}"), $this->lang->tree->child);
if(common::hasPriv('tree', 'delete')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'delete', "root={$module->root}&module={$module->id}"), $this->lang->delete, 'hiddenwin');
if(common::hasPriv('tree', 'updateorder')) $linkHtml .= ' ' . html::input("orders[$module->id]", $module->order, 'style="width:30px;text-align:center"');
+6 -5
View File
@@ -14,15 +14,16 @@
<form method='post' class='mt-10px' id='dataform'>
<table class='table-1'>
<caption><?php echo $lang->tree->edit;?></caption>
<tr>
<?php $hidden = ($type != 'story' and $module->type == 'story');?>
<tr <?php if($hidden) echo "style='display:none'";?>>
<th class='rowhead'><?php echo $lang->tree->parent;?></th>
<td><?php echo html::select('parent', $optionMenu, $module->parent, "class='select-1'");?></td>
</tr>
<tr>
</tr>
<tr <?php if($hidden) echo "style='display:none'";?>>
<th class='rowhead'><?php echo $lang->tree->name;?></th>
<td><?php echo html::input('name', $module->name, "class='text-1'");?></td>
</tr>
<?php if($module->type == 'bug'):?>
</tr>
<?php if($type == 'bug'):?>
<tr>
<th class='rowhead'><?php echo $lang->tree->owner;?></th>
<td><?php echo html::select('owner', $users, $module->owner, "class='select-1'", true);?></td>