* Code for task #7121.

This commit is contained in:
Yagami
2020-05-08 08:51:32 +08:00
parent 9c7b057c43
commit 27fc29b764
11 changed files with 123 additions and 15 deletions
+30 -6
View File
@@ -10,7 +10,9 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<?php js::set('status', $status);?>
<?php js::set('orderBy', $orderBy);?>
<?php if($programType == 'bygrid'):?>
<style>
#mainMenu{padding-left: 10px; padding-right: 10px;}
@@ -31,6 +33,7 @@
<?php echo html::a('javascript:setProgramType("bygrid")', "<i class='icon icon-cards-view'></i>", '', "title={$lang->program->bygrid} class='btn btn-icon " . ($programType == 'bygrid' ? 'text-primary' : '') . "'");?>
<?php echo html::a('javascript:setProgramType("bylist")', "<i class='icon icon-bars'></i>", '', "title={$lang->program->bylist} class='btn btn-icon " . ($programType == 'bylist' ? 'text-primary' : '') . "'");?>
</div>
<?php common::printLink('program', 'export', "status=$status&orderBy=$orderBy", "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export'")?>
<?php echo $lang->pageActions;?>
</div>
</div>
@@ -78,15 +81,22 @@
</div>
<?php endforeach;?>
<?php else:?>
<div class='main-table'>
<table class='table has-sort-head table-fixed' id='projectList'>
<?php $canOrder = (common::hasPriv('project', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<form class='main-table' id='programForm' method='post' data-ride='table'>
<table class='table has-sort-head table-fixed' id='programList'>
<?php $vars = "status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-id w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
<th class='c-id w-80px'>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
<label></label>
</div>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th class='w-120px'><?php common::printOrderLink('code', $orderBy, $vars, $lang->program->code);?></th>
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->program->name);?></th>
<th class='w-100px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->project->status);?></th>
<th class='w-100px'><?php common::printOrderLink('category', $orderBy, $vars, $lang->program->category);?></th>
<th class='w-100px'><?php common::printOrderLink('type', $orderBy, $vars, $lang->program->type);?></th>
<th class='w-100px'><?php common::printOrderLink('begin', $orderBy, $vars, $lang->program->begin);?></th>
<th class='w-100px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->program->end);?></th>
@@ -94,17 +104,27 @@
<th class='w-100px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->program->PM);?></th>
<th class='w-200px text-left'><?php echo $lang->program->desc;?></th>
<th class='text-center w-200px'><?php echo $lang->actions;?></th>
<?php if($canOrder):?>
<th class='w-60px sort-default'><?php common::printOrderLink('order', $orderBy, $vars, $lang->project->orderAB);?></th>
<?php endif;?>
</tr>
</thead>
<tbody class='sortable' id='projectTableList'>
<tbody class='sortable' id='programTableList'>
<?php foreach($projectList as $project):?>
<tr data-id='<?php echo $project->id ?>' data-order='<?php echo $project->order ?>'>
<td class='c-id'><?php printf('%03d', $project->id);?></td>
<td class='c-id'>
<div class="checkbox-primary">
<input type='checkbox' name='projectIDList[<?php echo $project->id;?>]' value='<?php echo $project->id;?>' />
<label></label>
</div>
<?php printf('%03d', $project->id);?>
</td>
<td class='text-left'><?php echo $project->code;?></td>
<td class='text-left' title='<?php echo $project->name?>'>
<?php echo html::a($this->createLink('project', 'task', 'projectID=' . $project->id), $project->name);?>
</td>
<td class='c-status'><span class="status-project status-<?php echo $project->status?>"><?php echo zget($lang->project->statusList, $project->status, '');?></span></td>
<td class='text-left'><?php echo zget($lang->program->categoryList, $project->category, '');?></td>
<td class='text-left'><?php echo zget($lang->program->typeList, $project->type, '');?></td>
<td class='text-center'><?php echo $project->begin;?></td>
<td class='text-center'><?php echo $project->end;?></td>
@@ -119,14 +139,18 @@
<?php common::printIcon('program', 'close', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "projectID=$project->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
</td>
<?php if($canOrder):?>
<td class='sort-handler'><i class="icon icon-move"></i></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<div class='table-footer'>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<?php $pager->show('right', 'pagerjs');?>
</div>
</div>
</form>
<?php endif;?>
</div>
<?php endif;?>