* Code for program index.
This commit is contained in:
@@ -132,7 +132,7 @@ $lang->dividerMenu = ',admin,';
|
||||
|
||||
/* Scrum menu. */
|
||||
$lang->menu = new stdclass();
|
||||
//$lang->menu->program = '主页|program|index';
|
||||
$lang->menu->program = '仪表盘|program|index|';
|
||||
$lang->menu->product = $lang->productCommon . '|product|index|locate=no';
|
||||
$lang->menu->project = "$lang->projectCommon|project|index|locate=no";
|
||||
$lang->menu->doc = '文档|doc|index|';
|
||||
@@ -1104,6 +1104,7 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest')
|
||||
|
||||
/* Cmmi menu. */
|
||||
$lang->menu->cmmi = new stdclass();
|
||||
$lang->menu->cmmi->programindex = array('link' => '仪表盘|program|index|program={PROGRAM}');
|
||||
$lang->menu->cmmi->programplan = array('link' => '计划|programplan|browse|program={PROGRAM}', 'subModule' => 'programplan');
|
||||
$lang->menu->cmmi->project = array('link' => $lang->projectCommon . '|project|task|projectID={PROJECT}', 'subModule' => ',project,task,');
|
||||
$lang->menu->cmmi->weekly = array('link' => '报告|weekly|index|program={PROGRAM}', 'subModule' => ',milestone,');
|
||||
|
||||
@@ -532,7 +532,7 @@ class commonModel extends model
|
||||
global $app, $lang, $config;
|
||||
|
||||
/* If program, return.*/
|
||||
if($moduleName == 'program') return;
|
||||
if($moduleName == 'program' and $methodName != 'index') return;
|
||||
|
||||
/* Set the main main menu. */
|
||||
$mainMenu = $moduleName;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* The project view file of dashboard module of ZenTaoPMS.
|
||||
* The program view file of dashboard module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package dashboard
|
||||
* @version $Id: project.html.php 5095 2013-07-11 06:03:40Z chencongzhi520@gmail.com $
|
||||
* @version $Id: program.html.php 5095 2013-07-11 06:03:40Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
@@ -21,13 +21,13 @@
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->program->noProgram;?></span>
|
||||
<?php if(common::hasPriv('program', 'create')):?>
|
||||
<?php echo html::a($this->createLink('program', 'create'), "<i class='icon icon-plus'></i> " . $lang->my->createProgram, '', "class='btn btn-info'");?>
|
||||
<?php if(common::hasPriv('program', 'createGuide')):?>
|
||||
<?php echo html::a($this->createLink('program', 'createGuide'), "<i class='icon icon-plus'></i> " . $lang->my->createProgram, '', "class='btn btn-info' data-toggle=modal");?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<table class="table has-sort-head table-fixed" id='projectList'>
|
||||
<table class="table has-sort-head table-fixed" id='programList'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
@@ -39,19 +39,19 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($programs as $project):?>
|
||||
<?php foreach($programs as $program):?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $project->id;?></td>
|
||||
<td class='text-left'><?php echo $project->code;?></td>
|
||||
<td class='text-left'><?php echo html::a("javascript:void(0)", $project->name, '', "class='transfer' data-id={$project->id}");?></td>
|
||||
<td><?php echo $project->begin;?></td>
|
||||
<td><?php echo $project->end;?></td>
|
||||
<td><?php echo $program->id;?></td>
|
||||
<td class='text-left'><?php echo $program->code;?></td>
|
||||
<td class='text-left'><?php echo html::a($this->createLink('program', 'index', "programID=$program->id"), $program->name, '', "class='transfer' data-id={$program->id}");?></td>
|
||||
<td><?php echo $program->begin;?></td>
|
||||
<td><?php echo $program->end;?></td>
|
||||
<td class="c-status">
|
||||
<?php if(isset($project->delay)):?>
|
||||
<?php if(isset($program->delay)):?>
|
||||
<span class="status-project status-delayed" title='<?php echo $lang->project->delayed;?>'> <?php echo $lang->project->delayed;?></span>
|
||||
<?php else:?>
|
||||
<?php $statusName = $this->processStatus('project', $project);?>
|
||||
<span class="status-project status-<?php echo $project->status?>" title='<?php echo $statusName;?>'> <?php echo $statusName;?></span>
|
||||
<?php $statusName = $this->processStatus('program', $program);?>
|
||||
<span class="status-project status-<?php echo $program->status?>" title='<?php echo $statusName;?>'> <?php echo $statusName;?></span>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -9,6 +9,37 @@ class program extends control
|
||||
$this->programs = $this->program->getPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Program index view.
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index($programID = 0)
|
||||
{
|
||||
if(!$programID) $programID = $this->session->program;
|
||||
$this->session->set('program', $programID);
|
||||
$this->lang->navGroup->program = 'program';
|
||||
|
||||
|
||||
$this->view->title = $this->lang->program->common . $this->lang->colon . $this->lang->program->index;
|
||||
$this->view->position[] = $this->lang->program->index;
|
||||
$this->view->program = $this->project->getByID($programID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Program list.
|
||||
*
|
||||
* @param varchar $status
|
||||
* @param varchar $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($status = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
{
|
||||
if(common::hasPriv('program', 'createGuide')) $this->lang->pageActions = html::a($this->createLink('program', 'createGuide'), "<i class='icon icon-sm icon-plus'></i> " . $this->lang->program->create, '', "class='btn btn-primary' data-toggle=modal");
|
||||
@@ -42,11 +73,25 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Program create guide.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createGuide()
|
||||
{
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a program.
|
||||
*
|
||||
* @param varchar $template
|
||||
* @param int $copyProgramID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($template = 'cmmi', $copyProgramID = '')
|
||||
{
|
||||
if($_POST)
|
||||
@@ -93,6 +138,37 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($projectID = 0)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->project->update($projectID);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('project', $projectID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
}
|
||||
|
||||
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM);
|
||||
$this->view->title = $this->lang->project->edit;
|
||||
$this->view->position[] = $this->lang->project->edit;
|
||||
$this->view->project = $project;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse groups.
|
||||
*
|
||||
@@ -316,30 +392,14 @@ class program extends control
|
||||
$this->display('group', 'manageMember');
|
||||
}
|
||||
|
||||
public function edit($projectID = 0)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->project->update($projectID);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('project', $projectID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
}
|
||||
|
||||
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM);
|
||||
$this->view->title = $this->lang->project->edit;
|
||||
$this->view->position[] = $this->lang->project->edit;
|
||||
$this->view->project = $project;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage program members.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param int $dept
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function manageMembers($projectID, $dept = '')
|
||||
{
|
||||
$this->session->set('program', $projectID);
|
||||
@@ -409,6 +469,14 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param varchar $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($projectID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
@@ -423,6 +491,13 @@ class program extends control
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Suspend a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function suspend($projectID)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
@@ -450,6 +525,13 @@ class program extends control
|
||||
$this->display('project', 'suspend');
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($projectID)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
@@ -484,6 +566,13 @@ class program extends control
|
||||
$this->display('project', 'activate');
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a program.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close($projectID)
|
||||
{
|
||||
$project = $this->project->getByID($projectID);
|
||||
@@ -562,6 +651,13 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process program errors.
|
||||
*
|
||||
* @param array $errors
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function processErrors($errors)
|
||||
{
|
||||
foreach($errors as $field => $error)
|
||||
@@ -572,10 +668,18 @@ class program extends control
|
||||
return $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get program drop menu.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param varchar $module
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetDropMenu($programID, $module, $method, $extra)
|
||||
{
|
||||
$this->loadModel('project');
|
||||
$this->view->link = "javascript:void(0)";
|
||||
$this->view->link = $this->createLink('program', 'index', "programID=$programID");
|
||||
$this->view->programID = $programID;
|
||||
$this->view->module = $module;
|
||||
$this->view->method = $method;
|
||||
@@ -596,7 +700,6 @@ class program extends control
|
||||
*/
|
||||
public function ajaxGetEnterLink($programID = 0)
|
||||
{
|
||||
$this->session->set('program', $programID);
|
||||
$program = $this->project->getByID($programID);
|
||||
$programProjects = $this->project->getPairs();
|
||||
$programProject = key($programProjects);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$lang->program->index = '项目主页';
|
||||
$lang->program->index = '仪表盘';
|
||||
$lang->program->browse = '项目列表';
|
||||
$lang->program->common = '项目';
|
||||
$lang->program->stage = '阶段';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class='row cell' id='cards'>
|
||||
<?php foreach ($projectList as $projectID => $project):?>
|
||||
<div class='col' data-id='<?php echo $projectID?>'>
|
||||
<div class='panel' data-url='<?php echo $this->createLink('program', 'transfer', "projectID=$project->id");?>'>
|
||||
<div class='panel' data-url='<?php echo $this->createLink('program', 'index', "projectID=$project->id");?>'>
|
||||
<div class='panel-heading'>
|
||||
<strong class='project-name' title='<?php echo $project->name;?>'><?php echo $project->name;?></strong>
|
||||
<?php if($project->template === 'cmmi'): ?>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</td>
|
||||
<td class='text-left'><?php echo $project->code;?></td>
|
||||
<td class='text-left pgm-title' title='<?php echo $project->name?>'>
|
||||
<?php echo html::a('javascript:void(0)', $project->name, '', "data-id=$project->id class=transfer");?>
|
||||
<?php echo html::a(inlink('index', "programID=$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-center'><?php echo $project->begin;?></td>
|
||||
|
||||
2
module/program/view/index.html.php
Normal file
2
module/program/view/index.html.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user