* code for task#1368.

This commit is contained in:
zhujinyong
2013-06-06 02:21:59 +00:00
parent c43c3aebcd
commit 76f2c77cf9
2 changed files with 8 additions and 5 deletions

View File

@@ -78,7 +78,7 @@ class treeModel extends model
return $this->dao->select('*')->from(TABLE_MODULE)
->where("(root = $rootID and type = 'task') or (root in('$products') and type = 'story')")
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
->orderBy('type, grade desc, `order`')
->orderBy('grade desc, type, `order`')
->get();
}
@@ -351,10 +351,11 @@ class treeModel extends model
static $users;
if(empty($users)) $users = $this->loadModel('user')->getPairs('noletter');
$linkHtml = $module->name;
$linkHtml .= $module->type != 'story' ? ' [' . strtoupper(substr($module->type, 0, 1)) . ']' : '';
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', 'edit') and $type == 'bug') $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
@@ -434,8 +435,9 @@ class treeModel extends model
return $this->dao->select('*')->from(TABLE_MODULE)
->where('root')->eq((int)$rootID)
->andWhere('parent')->eq((int)$moduleID)
->andWhere('type')->eq($type)
->orderBy('`order`')
->beginIF($type == 'story')->andWhere('type')->eq($type)->fi()
->beginIF($type != 'story')->andWhere('type')->in("$type,story")->fi()
->orderBy('type,`order`')
->fetchAll();
}

View File

@@ -76,7 +76,8 @@
foreach($sons as $sonModule)
{
if($sonModule->order > $maxOrder) $maxOrder = $sonModule->order;
echo '<span>' . html::input("modules[id$sonModule->id]", $sonModule->name, 'class=text-3 style="margin-bottom:5px"') . '<br /></span>';
$disabled = $sonModule->type == $viewType ? '' : 'disabled="true"';
echo '<span>' . html::input("modules[id$sonModule->id]", $sonModule->name, 'class=text-3 style="margin-bottom:5px" ' . $disabled) . '<br /></span>';
}
for($i = 0; $i < TREE::NEW_CHILD_COUNT ; $i ++) echo '<span>' . html::input("modules[]", '', 'class=text-3 style="margin-bottom:5px"') . '<br /></span>';
?>