* adjust for tree browsetask page.

This commit is contained in:
wangyidong
2018-04-28 11:28:53 +08:00
parent f963b360a2
commit fb3e2b370f
17 changed files with 111 additions and 249 deletions
+73 -67
View File
@@ -11,93 +11,104 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<div id='featurebar'>
<div class='heading'><?php echo $lang->tree->common;?></div>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php $backLink = $this->session->taskList ? $this->session->taskList : 'javascript:history.go(-1)';?>
<a href="<?php echo $backLink;?>" class="btn btn-link">
<i class="icon icon-back icon-sm"></i> <?php echo $lang->goback;?>
</a>
<div class="divider"></div>
<div class="page-title">
<span class='text'><?php echo $lang->tree->common . ':' . $root->name;?></span>
</div>
</div>
<div class='row'>
<div class='col-sm-4'>
<div id="mainContent" class="main-row">
<div class="side-col col-4">
<div class='panel'>
<div class='panel-heading'><i class='icon-cog'></i> <strong><?php echo $title;?></strong></div>
<div class='panel-heading'>
<div class='panel-title'><?php echo $title;?></div>
</div>
<div class='panel-body'>
<ul class='tree-lines' id='modulesTree' data-name='tree-task'></ul>
</div>
</div>
</div>
<div class='col-sm-8'>
<form id='childrenForm' class='form-condensed' method='post' target='hiddenwin' action='<?php echo $this->createLink('tree', 'manageChild', "root={$root->id}&viewType=task");?>'>
<div class="main-col col-8">
<form id='childrenForm' method='post' target='hiddenwin' action='<?php echo $this->createLink('tree', 'manageChild', "root={$root->id}&viewType=task");?>'>
<div class='panel'>
<div class='panel-heading'>
<i class='icon-sitemap'></i>
<?php $manageChild = 'manageTaskChild';?>
<?php echo $lang->tree->$manageChild;?>
<div class='panel-title'><?php echo $lang->tree->manageTaskChild;?></div>
</div>
<div class='panel-body'>
<table class='table table-form'>
<tr>
<td class='parentModule'>
<nobr>
<td class="text-middle text-nowrap text-right with-padding">
<?php
echo html::a($this->createLink('tree', 'browsetask', "root={$root->id}&productID=$productID&viewType=task"), $root->name);
echo $lang->arrow;
echo html::a($this->createLink('tree', 'browsetask', "root={$root->id}&productID=$productID&viewType=task"), $root->name) . "<i class='icon icon-angle-right muted'></i>";
foreach($parentModules as $module)
{
echo html::a($this->createLink('tree', 'browsetask', "root={$root->id}&productID=$productID&moduleID=$module->id"), $module->name);
echo $lang->arrow;
echo html::a($this->createLink('tree', 'browsetask', "root={$root->id}&productID=$productID&moduleID=$module->id"), $module->name) . " <i class='icon icon-angle-right muted'></i>";
}
?>
</nobr>
</td>
<td id='moduleBox'>
<?php
$maxOrder = 0;
if($newModule and !$productID)
{
foreach($products as $product)
{
echo '<span>' . html::input("products[id$product->id]", $product->name, 'class=form-control disabled="true" autocomplete="off"') . '</span>';
}
}
echo '<div id="sonModule">';
foreach($sons as $sonModule)
{
if($sonModule->order > $maxOrder) $maxOrder = $sonModule->order;
$disabled = $sonModule->type == 'task' ? '' : 'disabled';
echo "<div class='row-table' style='margin-bottom:5px;'>";
echo "<div class='col-table'>" . html::input("modules[id$sonModule->id]", $sonModule->name, "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}' " . $disabled) . '</div>';
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[id$sonModule->id]", $sonModule->short, "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}' " . $disabled) . html::hidden("order[id$sonModule->id]", $sonModule->order);
echo "<span class='input-group-btn' style='border-left:1px solid'><a href='javascript:;' onclick='insertItem(this)' class='btn btn-block'><i class='icon icon-plus'></i></a></span>";
echo "</div></div>";
echo "</div>";
}
for($i = 0; $i < TREE::NEW_CHILD_COUNT ; $i ++)
{
echo "<div class='row-table addedItem' style='margin-bottom:5px;'>";
echo "<div class='col-table'>" . html::input("modules[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}'") . '</div>';
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}'");
echo "<span class='input-group-btn'><a href='javascript:;' onclick='addItem(this)' class='btn btn-block'><i class='icon icon-plus'></i></a></span>";
echo "<span class='input-group-btn'><a href='javascript:;' onclick='deleteItem(this)' class='btn btn-block'><i class='icon icon-remove'></i></a></span>";
echo '</div></div>';
echo html::hidden('branch[]', empty($module) ? 0 : $module->branch) . '</div>';
}
echo "<div id='insertItemBox' class='hidden'>";
echo "<div class='row-table' style='margin-bottom:5px;'>";
echo "<div class='col-table'>" . html::input("modules[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}'") . '</div>';
echo "<div class='col-table' style='width:120px'><div class='input-group'>" . html::input("shorts[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}'") . html::hidden("order[]");
echo "<span class='input-group-btn' style='border-left:1px solid'><a href='javascript:;' onclick='deleteItem(this)' class='btn btn-block'><i class='icon icon-remove'></i></a></span>";
echo '</div></div>';
echo html::hidden('branch[]', empty($module) ? 0 : $module->branch) . '</div>';
echo '</div>';
echo '</div>';
?>
<td>
<div id='sonModule'>
<?php $maxOrder = 0;?>
<?php if($newModule and !$productID):?>
<?php foreach($products as $product):?>
<div class="table-row row-module">
<div class="table-col col-module"><?php echo html::input("products[id$product->id]", $product->name, 'class=form-control disabled="true" autocomplete="off"')?></div>
</div>
<?php endforeach;?>
<?php endif;?>
<?php foreach($sons as $sonModule):?>
<?php
if($sonModule->order > $maxOrder) $maxOrder = $sonModule->order;
$disabled = $sonModule->type == 'task' ? '' : 'disabled';
?>
<div class='table-row row-module'>
<div class='table-col col-module'><?php echo html::input("modules[id$sonModule->id]", $sonModule->name, "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}' $disabled")?></div>
<div class='table-col col-shorts'>
<?php
echo html::input("shorts[id$sonModule->id]", $sonModule->short, "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}' $disabled");
echo html::hidden("order[id$sonModule->id]", $sonModule->order);
?>
</div>
<div class="table-col col-actions">
<button type="button" class="btn btn-link btn-icon btn-add" onclick="addItem(this)"><i class="icon icon-plus"></i></button>
</div>
</div>
<?php endforeach;?>
<?php for($i = 0; $i < TREE::NEW_CHILD_COUNT ; $i ++):?>
<div class="table-row row-module row-module-new">
<div class='table-col col-module'><?php echo html::input("modules[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}'")?></div>
<div class='table-col col-shorts'><?php echo html::input("shorts[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}'")?></div>
<div class="table-col col-actions">
<button type="button" class="btn btn-link btn-icon btn-add" onclick="addItem(this)"><i class="icon icon-plus"></i></button>
<button type="button" class="btn btn-link btn-icon btn-delete" onclick="deleteItem(this)"><i class="icon icon-trash"></i></button>
</div>
<?php echo html::hidden('branch[]', empty($module) ? 0 : $module->branch);?>
</div>
<?php endfor;?>
</div>
<div id="insertItemBox" class="template">
<div class="table-row row-module row-module-new">
<div class="table-col col-module"><?php echo html::input("modules[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->name}'");?></div>
<div class="table-col col-shorts"><?php echo html::input("shorts[]", '', "class='form-control' autocomplete='off' placeholder='{$lang->tree->short}'");?></div>
<div class="table-col col-actions">
<button type="button" class="btn btn-link btn-icon btn-add" onclick="addItem(this)"><i class="icon icon-plus"></i></button>
<button type="button" class="btn btn-link btn-icon btn-delete" onclick="deleteItem(this)"><i class="icon icon-trash"></i></button>
</div>
<?php echo html::hidden('branch[]', empty($module) ? 0 : (int)$module->branch);?>
</div>
</div>
</td>
</tr>
<tr>
<td></td>
<td colspan='2'>
<?php
echo html::submitButton();
echo html::submitButton('', '', 'btn btn-primary btn-wide');
echo $this->session->taskList ? html::linkButton($this->lang->goback, $this->session->taskList) : html::backButton();
echo html::hidden('parentModuleID', $currentModuleID);
echo html::hidden('maxOrder', $maxOrder);
@@ -111,11 +122,6 @@
</form>
</div>
</div>
<style>
.story-item > .tree-actions > .tree-action[data-type='sort'],
.story-item > .tree-actions > .tree-action[data-type='edit'],
.story-item > .tree-actions > .tree-action[data-type='delete'] {display: none!important}
</style>
<script>
$(function()
{