* Fix program and project btn.

This commit is contained in:
Yagami
2020-09-22 10:53:23 +08:00
parent c321a1181c
commit cec65da271
4 changed files with 20 additions and 5 deletions
+1 -1
View File
@@ -289,7 +289,7 @@ class programModel extends model
public function getPGMList($status = 'all', $orderBy = 'id_desc', $pager = NULL)
{
return $this->dao->select('*')->from(TABLE_PROGRAM)
->where('type')->eq('program')
->where('type')->in('program,project')
->andWhere('deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
->beginIF($status != 'all')->andWhere('status')->eq($status)->fi()
+17 -2
View File
@@ -51,8 +51,11 @@
<td class='text-left'><?php echo $program->code;?></td>
<td class='c-name text-left pgm-title table-nest-title' title='<?php echo $program->name?>'>
<span class="table-nest-icon icon<?php if($program->type == 'program') echo ' table-nest-toggle' ?>"></span>
<?php $link = $program->type == 'program' ? $this->createLink('program', 'pgmview', "programID=$program->id", '', '', $program->id) : $this->createLink('program', 'prjindex', "programID=$program->id", '', '', $program->id);?>
<?php echo html::a($link, "<i class='icon icon-stack'></i> " . $program->name);?>
<?php if($program->type == 'program'):?>
<?php echo html::a($this->createLink('program', 'pgmview', "programID=$program->id", '', '', $program->id), "<i class='icon icon-stack'></i> " . $program->name);?>
<?php else:?>
<?php echo html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), "<i class='icon icon-menu-doc'></i> " . $program->name);?>
<?php endif;?>
</td>
<td class='c-status'><span class="status-program status-<?php echo $program->status?>"><?php echo zget($lang->project->statusList, $program->status, '');?></span></td>
<td class='text-center'><?php echo $program->begin;?></td>
@@ -60,6 +63,7 @@
<td class='text-left'><?php echo $program->budget . ' ' . zget($lang->program->unitList, $program->budgetUnit);?></td>
<td><?php echo zget($users, $program->PM);?></td>
<td class='text-center c-actions'>
<?php if($program->type == 'program'):?>
<?php common::printIcon('program', 'pgmgroup', "programID=$program->id", $program, 'list', 'group');?>
<?php common::printIcon('program', 'pgmmanageMembers', "programID=$program->id", $program, 'list', 'persons');?>
<?php common::printIcon('program', 'prjstart', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true);?>
@@ -69,6 +73,17 @@
<?php if(common::hasPriv('program', 'pgmedit')) echo html::a($this->createLink("program", "pgmedit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'pgmcreate', "programID=$program->id", '', 'list', 'treemap-alt', '', '', '', '', $this->lang->program->PGMChildren);?>
<?php if(common::hasPriv('program', 'pgmdelete')) echo html::a($this->createLink("program", "pgmdelete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
<?php else:?>
<?php common::printIcon('program', 'prjgroup', "programID=$program->id", $program, 'list', 'group');?>
<?php common::printIcon('program', 'prjmanageMembers', "programID=$program->id", $program, 'list', 'persons');?>
<?php common::printIcon('program', 'prjstart', "programID=$program->id", $program, 'list', 'play', '', 'iframe', true);?>
<?php common::printIcon('program', 'prjactivate', "programID=$program->id", $program, 'list', 'magic', '', 'iframe', true);?>
<?php common::printIcon('program', 'prjsuspend', "programID=$program->id", $program, 'list', 'pause', '', 'iframe', true);?>
<?php common::printIcon('program', 'prjclose', "programID=$program->id", $program, 'list', 'off', '', 'iframe', true);?>
<?php if(common::hasPriv('program', 'prjedit')) echo html::a($this->createLink("program", "prjedit", "programID=$program->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
<?php common::printIcon('program', 'prjcreate', "programID=$program->id", '', 'list', 'treemap-alt', '', 'disabled', '', '', $this->lang->program->PGMChildren);?>
<?php if(common::hasPriv('program', 'prjdelete')) echo html::a($this->createLink("program", "prjdelete", "programID=$program->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn' title='{$lang->delete}'");?>
<?php endif;?>
</td>
<?php if($canOrder):?>
<td class='sort-handler text-center'><i class="icon icon-move"></i></td>
+1 -1
View File
@@ -102,7 +102,7 @@
</tr>
<tr>
<th><?php echo $lang->program->auth;?></th>
<td colspan='3'><?php echo html::radio('privway', $lang->program->PRJAuthList, $project->privway, '', 'block');?></td>
<td colspan='3'><?php echo html::radio('auth', $lang->program->PRJAuthList, $project->auth, '', 'block');?></td>
</tr>
<tr>
<th><?php echo $lang->project->acl;?></th>