* Fix common menu and program list.
This commit is contained in:
+21
-6
@@ -594,20 +594,35 @@ class commonModel extends model
|
||||
{
|
||||
if($subMenuItem->hidden) continue;
|
||||
|
||||
$subActive = '';
|
||||
$subModule = '';
|
||||
$subMethod = '';
|
||||
$subParams = '';
|
||||
$subLabel = $subMenuItem->text;
|
||||
$subActive = '';
|
||||
$subModule = '';
|
||||
$subMethod = '';
|
||||
$subParams = '';
|
||||
$subProgram = '';
|
||||
$subLabel = $subMenuItem->text;
|
||||
if(isset($subMenuItem->link['module'])) $subModule = $subMenuItem->link['module'];
|
||||
if(isset($subMenuItem->link['method'])) $subMethod = $subMenuItem->link['method'];
|
||||
if(isset($subMenuItem->link['vars'])) $subParams = $subMenuItem->link['vars'];
|
||||
|
||||
$subLink = helper::createLink($subModule, $subMethod, $subParams);
|
||||
if($subMenuItem->name == 'program')
|
||||
{
|
||||
global $dbh;
|
||||
$program = $dbh->query("SELECT * FROM " . TABLE_PROJECT . " WHERE `id` = '{$app->session->program}'")->fetch();
|
||||
$subActive .= 'dropdown-submenu';
|
||||
$subLink = 'javascript:;';
|
||||
$subProgram .= "<ul class='dropdown-menu'>";
|
||||
$subProgram .= '<li>' . self::buildIconButton('program', 'group', "projectID={$app->session->program}", $program, 'button', 'group', '', '', '', '', $lang->program->group) . '</li>';
|
||||
$subProgram .= '<li>' . self::buildIconButton('program', 'manageMembers', "projectID={$app->session->program}", $program, 'button', 'persons', '', '', '', '', $lang->program->manageMembers) . '</li>';
|
||||
$subProgram .= '<li>' . self::buildIconButton('program', 'start', "projectID={$app->session->program}", $program, 'button', 'play', '', 'iframe', true, '', $lang->program->start) . '</li>';
|
||||
$subProgram .= '<li>' . self::buildIconButton('program', 'activate', "projectID={$app->session->program}", $program, 'button', 'magic', '', 'iframe', true, '', $lang->program->activate) . '</li>';
|
||||
$subProgram .= '<li>' . self::buildIconButton('program', 'suspend', "projectID={$app->session->program}", $program, 'button', 'pause', '', 'iframe', true, '', $lang->program->suspend) . '</li>';
|
||||
$subProgram .= '</ul>';
|
||||
}
|
||||
|
||||
if($config->global->flow != 'onlyTest' && $currentModule == strtolower($subModule) && $currentMethod == strtolower($subMethod)) $subActive = 'active';
|
||||
|
||||
$subMenu .= "<li class='$subActive' data-id='$subMenuItem->name'>" . html::a($subLink, $subLabel) . '</li>';
|
||||
$subMenu .= "<li class='$subActive' data-id='$subMenuItem->name'>" . html::a($subLink, $subLabel) . $subProgram . '</li>';
|
||||
}
|
||||
|
||||
if(empty($subMenu)) continue;
|
||||
|
||||
@@ -409,40 +409,6 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finish project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function finish($projectID)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->project->finish($projectID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
{
|
||||
$actionID = $this->action->create('project', $projectID, 'Finished', $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->executeHooks($projectID);
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->program->finish;
|
||||
$this->view->position[] = $this->lang->program->finish;
|
||||
$this->view->project = $project;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->actions = $this->loadModel('action')->getList('project', $project->id);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function delete($projectID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<li><?php if(common::hasPriv('program', 'edit')) echo html::a($this->createLink("program", "edit", "projectID=$project->id"), "<i class='icon-edit'></i> " . $lang->edit, '', "");?></li>
|
||||
<li><?php common::printIcon('program', 'start', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php common::printIcon('program', 'suspend', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php common::printIcon('program', 'finish', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php common::printIcon('program', 'close', "projectID=$project->id", $project, 'button', '', '', 'iframe', true);?></li>
|
||||
<li><?php if(common::hasPriv('program', 'delete')) echo html::a($this->createLink("project", "delete", "projectID=$project->id"), "<i class='icon-trash'></i> " . $lang->delete, 'hiddenwin', "");?></li>
|
||||
</ul>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<th class='w-100px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->program->end);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('budget', $orderBy, $vars, $lang->program->budget);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->program->PM);?></th>
|
||||
<th class='text-center w-210px'><?php echo $lang->actions;?></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;?>
|
||||
@@ -41,7 +41,6 @@
|
||||
<?php common::printIcon('program', 'start', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'activate', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'suspend', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'finish', "projectID=$project->id", $project, 'list', '', '', 'iframe', true);?>
|
||||
<?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>
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='prefix label-id'><strong><?php echo $project->id;?></strong></span>
|
||||
<?php echo isonlybody() ? ("<span title='$project->name'>" . $project->name . '</span>') : html::a($this->createLink('project', 'view', 'project=' . $project->id), $project->name, '_blank');?>
|
||||
<?php if(!isonlybody()):?>
|
||||
<small><?php echo $lang->arrow . $lang->project->finish;?></small>
|
||||
<?php endif;?>
|
||||
</h2>
|
||||
</div>
|
||||
<form class='load-indicator main-form' method='post' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='w-100px'><?php echo $lang->program->realFinished;?></th>
|
||||
<td><?php echo html::input('realFinished', helper::today(), "class='form-control form-date'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-40px'><?php echo $lang->comment;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('comment', '', "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton($lang->program->finish); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<hr class='small' />
|
||||
<div class='main'>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user