* Refact detail view of todo.

* Optimize codes.
This commit is contained in:
liugang
2018-04-20 14:15:21 +08:00
parent d8207915f3
commit 52e0a63267
8 changed files with 34 additions and 35 deletions
+3 -3
View File
@@ -32,15 +32,15 @@ $useGuest = $this->app->user->account == 'guest';
<?php endif;?>
<nav class='panel-actions nav nav-default'>
<?php if(!empty($block->moreLink)):?>
<?php echo '<li>' . html::a($block->moreLink, 'MORE', '', "title='{$lang->more}'") . '</li>'; ?>
<?php echo '<li>' . html::a($block->moreLink, 'MORE', '', "title='{$lang->more}'") . '</li>'; ?>
<?php endif; ?>
<li class='dropdown'>
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
<ul class='dropdown-menu pull-right'>
<?php if(!$useGuest):?>
<li><a data-toggle='modal' href="<?php echo $this->createLink("block", "admin", "id=$block->id&module=$module"); ?>" class='edit-block' data-title='<?php echo $block->title;?>' ><?php echo $lang->edit;?></a></li>
<li><a data-toggle='modal' href="<?php echo $this->createLink("block", "admin", "id=$block->id&module=$module");?>" class='edit-block' data-title='<?php echo $block->title;?>' ><?php echo $lang->edit;?></a></li>
<?php if(!$block->source and $block->block == 'html'):?>
<li><a href="javascript:hiddenBlock(<?php echo $index;?>)" class="hidden-panel"><?php echo $lang->block->hidden; ?></a></li>
<li><a href="javascript:hiddenBlock(<?php echo $index;?>)" class="hidden-panel"><?php echo $lang->block->hidden;?></a></li>
<?php endif;?>
<li><a href='javascript:deleteBlock(<?php echo $index;?>);' class='remove-panel'><?php echo $lang->block->remove;?></a></li>
<?php endif;?>
+3 -5
View File
@@ -74,12 +74,10 @@ js::set('confirmDelete', $lang->user->confirmDelete);
<tr>
<td class='cell-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary">
<input type='checkbox' name='users[]' value='<?php echo $user->id;?>'/>
<label></label>
</div>
<?php endif;?>
<?php echo html::checkbox('users', array($user->account => sprintf('%03d', $user->id)));?>
<?php else:?>
<?php printf('%03d', $user->id);?>
<?php endif;?>
</td>
<td><?php if(!common::printLink('user', 'view', "account=$user->account", $user->realname, '', "title='$user->realname'")) echo $user->realname;?></td>
<td><?php echo $user->account;?></td>
+2 -1
View File
@@ -31,7 +31,8 @@
</div>
<div class="btn-toolbar pull-right">
<?php if(common::hasPriv('todo', 'export')) echo html::a(helper::createLink('todo', 'export', "account=$account&orderBy=$orderBy", 'html', true), "<i class='icon-export muted'> </i> " . $lang->todo->export, '', "class='btn btn-link iframe'");?>
<?php common::printIcon('todo', 'batchCreate', '', '', 'button', 'plus', '', 'btn-primary iframe', 'true', "id='batchCreate' data-width='80%'");?>
<?php common::printLink('todo', 'batchCreate', '', "<i class='icon icon-plus'> </i>" . $lang->todo->batchCreate, '', "id='batchCreate' class='btn btn-secondary iframe' data-width='80%'", '', 'true');?>
<?php common::printLink('todo', 'create', '', "<i class='icon icon-plus'> </i>" . $lang->todo->create, '', "id='create' class='btn btn-primary iframe' data-width='80%'", '', 'true');?>
</div>
</div>
<div id="mainContent">
+3 -5
View File
@@ -91,12 +91,10 @@
<tr data-id='<?php echo $product->id ?>' data-order='<?php echo $product->code;?>'>
<td class='cell-id'>
<?php if($canBatchEdit):?>
<div class="checkbox-primary">
<input type='checkbox' name='productIDList[<?php echo $product->id;?>]' value='<?php echo $product->id;?>' />
<label></label>
</div>
<?php echo html::checkbox('productIDList', array($product->id => sprintf('%03d', $product->id)));?>
<?php else:?>
<?php printf('%03d', $product->id);?>
<?php endif;?>
<?php echo sprintf('%03d', $product->id);?>
</td>
<td title='<?php echo $product->name?>'><?php echo html::a($this->createLink('product', 'view', 'product=' . $product->id), $product->name);?></td>
<td><?php echo zget($lines, $product->line);?></td>
+3 -5
View File
@@ -62,12 +62,10 @@
<tr>
<td class='cell-id'>
<?php if(common::hasPriv('productplan', 'batchEdit')):?>
<div class="checkbox-primary">
<input type='checkbox' name='planIDList[<?php echo $plan->id;?>]' value='<?php echo $plan->id;?>' />
<label></label>
</div>
<?php endif;?>
<?php echo html::checkbox('planIDList', array($plan->id => sprintf('%03d', $plan->id)));?>
<?php else:?>
<?php echo sprintf('%03d', $plan->id);?>
<?php endif;?>
</td>
<td class='text-left' title="<?php echo $plan->title?>"><?php echo html::a(inlink('view', "id=$plan->id"), $plan->title);?></td>
<?php if($this->session->currentProductType != 'normal'):?>
+8 -4
View File
@@ -2106,10 +2106,14 @@ class taskModel extends model
switch($id)
{
case 'id':
echo "<div class='checkbox-primary'>";
if($mode == 'table' && $canBatchAction) echo "<input type='checkbox' name='taskIDList[{$task->id}]' value='{$task->id}'/><label></label>";
echo sprintf('%03d', $task->id);
echo '</div>';
if($mode == 'table' && $canBatchAction)
{
echo html::checkbox('taskIDList', array($task->id => sprintf('%03d', $task->id)));
}
else
{
printf('%03d', $task->id);
}
break;
case 'pri':
echo "<span class='label-pri label-pri-" . $task->pri . "'>";
+10 -10
View File
@@ -164,15 +164,15 @@
common::printRPN($browseLink);
?>
<div id='commentBox' class='hide'>
<h4 class='text-left'><?php echo $lang->comment;?></h2>
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=todo&objectID=$todo->id")?>' target='hiddenwin'>
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
<?php echo html::submitButton('', '', 'btn btn-wide btn-primary');?>
</form>
</div>
</div>
</div>
<fieldset id='commentBox' class='hide'>
<legend><?php echo $lang->comment;?></legend>
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=todo&objectID=$todo->id")?>' target='hiddenwin'>
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
<?php echo html::submitButton();?>
</form>
</fieldset>
<div class="modal fade" id="projectModal">
<div class="modal-dialog">
<div class="modal-content">
@@ -183,7 +183,7 @@
<div class="modal-body">
<div class='input-group'>
<?php echo html::select('project', $projects, '', "class='form-control chosen'");?>
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['task'], "id='toTaskButton'");?></span>
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['task'], "id='toTaskButton'", 'btn btn-primary');?></span>
</div>
</div>
</div>
@@ -199,8 +199,8 @@
<div class="modal-body">
<div class='input-group'>
<?php echo html::select('product', $products, '', "class='form-control chosen'");?>
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['story'], "id='toStoryButton'");?></span>
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['bug'], "id='toBugButton'");?></span>
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['story'], "id='toStoryButton'", 'btn btn-primary');?></span>
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['bug'], "id='toBugButton'", 'btn btn-primary');?></span>
</div>
</div>
</div>