* Project add edit method.
This commit is contained in:
@@ -79,13 +79,14 @@ class program extends control
|
||||
$programs = $this->program->getPGMList($status, $orderBy, $pager, true);
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->program->PGMBrowse;
|
||||
$this->view->position[] = $this->lang->program->PGMBrowse;
|
||||
|
||||
$this->view->programs = $programs;
|
||||
$this->view->status = $status;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->title = $this->lang->program->PGMBrowse;
|
||||
$this->view->position[] = $this->lang->program->PGMBrowse;
|
||||
$this->view->programType = $programType;
|
||||
$this->display();
|
||||
}
|
||||
@@ -96,8 +97,9 @@ class program extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createGuide()
|
||||
public function createGuide($programID = 0)
|
||||
{
|
||||
$this->view->programID = $programID;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1017,8 +1019,8 @@ class program extends control
|
||||
if(empty($template)) $template = $copyProgram->template;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->program->PRJCreate;
|
||||
$this->view->position[] = $this->lang->program->PRJCreate;
|
||||
$this->view->title = $this->lang->program->PRJCreate;
|
||||
$this->view->position[] = $this->lang->program->PRJCreate;
|
||||
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst');
|
||||
@@ -1037,6 +1039,45 @@ class program extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function PRJEdit($projectID = 0)
|
||||
{
|
||||
$this->lang->navGroup->program = 'project';
|
||||
$project = $this->program->getPRJByID($projectID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->program->update($projectID);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->processErrors(dao::getError())));
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('program', $projectID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
$url = $this->session->PRJList ? $this->session->PRJList : inlink('browse');
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $url));
|
||||
}
|
||||
|
||||
$parents = $this->program->getParentPairs();
|
||||
unset($parents[$projectID]);
|
||||
|
||||
$this->view->title = $this->lang->program->PRJEdit;
|
||||
$this->view->position[] = $this->lang->program->PRJEdit;
|
||||
|
||||
$this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $project->PM);
|
||||
$this->view->project = $project;
|
||||
$this->view->parents = $parents;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Project browse groups.
|
||||
*
|
||||
|
||||
@@ -1208,7 +1208,7 @@ class programModel extends model
|
||||
$this->dao->insert(TABLE_USERGROUP)->data($groupPriv)->exec();
|
||||
}
|
||||
|
||||
if($project->template == 'waterfall')
|
||||
if($project->model == 'waterfall')
|
||||
{
|
||||
$product = new stdclass();
|
||||
$product->name = $project->name;
|
||||
|
||||
@@ -35,13 +35,14 @@
|
||||
<button type='button' class='btn btn-default btn-wide' data-dismiss='modal'><?php echo $lang->cancel; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo js::set('programID', $programID)?>
|
||||
<script>
|
||||
$('#guideDialog').on('click', '.program-type-img', function()
|
||||
{
|
||||
var $this = $(this);
|
||||
$('#guideDialog .program-type.active').removeClass('active');
|
||||
$this.parent().addClass('active');
|
||||
$('#guideBtn').removeClass('disabled').attr('href', createLink('program', 'create', 'type=' + $this.data('type')));
|
||||
$('#guideBtn').removeClass('disabled').attr('href', createLink('program', 'PRJCreate', 'type=' + $this.data('type') + '&programID=' + programID));
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -32,10 +32,10 @@ js::set('browseType', $browseType);
|
||||
<?php echo html::checkbox('PRJMine', array('1' => $lang->program->mine), '', $this->cookie->PRJMine ? 'checked=checked' : '');?>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php echo html::commonButton('<i class="icon icon-plus"></i>' . $lang->program->PRJCreate, 'data-toggle="modal" data-target="#guideDialog"', 'btn btn-primary');?>
|
||||
<?php common::printLink('program', 'createGuide', '', '<i class="icon icon-plus"></i>' . $lang->program->PRJCreate, '', 'class="btn btn-primary" data-toggle="modal" data-target="#guideDialog"');?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class="main-row fade">
|
||||
<div id='mainContent' class="main-row">
|
||||
<div id="sidebar" class="side-col">
|
||||
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
|
||||
<div class="cell">
|
||||
@@ -83,7 +83,7 @@ js::set('browseType', $browseType);
|
||||
<?php common::printIcon('program', 'PRJActivate', "programID=$project->id", $project, 'list', 'magic', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'PRJSuspend', "programID=$project->id", $project, 'list', 'pause', '', 'iframe', true);?>
|
||||
<?php common::printIcon('program', 'PRJClose', "programID=$project->id", $project, 'list', 'off', '', 'iframe', true);?>
|
||||
<?php if(common::hasPriv('program', 'PRJEdit')) echo html::a($this->createLink("program", "edit", "programID=$project->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
|
||||
<?php if(common::hasPriv('program', 'PRJEdit')) echo html::a($this->createLink("program", "PRJEdit", "programID=$project->id"), "<i class='icon-edit'></i>", '', "class='btn' title='{$lang->edit}'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
@@ -97,5 +97,4 @@ js::set('browseType', $browseType);
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'prjcreateguide.html.php';?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/**
|
||||
* The prjedit view file of program 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 program
|
||||
* @version $Id
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::import($jsRoot . 'misc/date.js');?>
|
||||
<?php js::set('weekend', $config->project->weekend);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->program->PRJEdit;?></h2>
|
||||
</div>
|
||||
<form class='form-indicator main-form form-ajax' method='post' target='hiddenwin' id='dataform'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-120px'><?php echo $lang->program->PRJTemplate;?></th>
|
||||
<td><?php echo zget($lang->program->templateList, $project->model, '');?></td><td></td><td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PGMParent;?></th>
|
||||
<td><?php echo html::select('parent', $parents, $project->parent, "class='form-control chosen'");?></td><td></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PRJName;?></th>
|
||||
<td class="col-main"><?php echo html::input('name', $project->name, "class='form-control' required");?></td><td></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PRJCode;?></th>
|
||||
<td><?php echo html::input('code', $project->code, "class='form-control' required");?></td><td></td><td></td>
|
||||
</tr>
|
||||
<?php if($project->model == 'waterfall'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PRJCategory;?></th>
|
||||
<td><?php echo html::select('category', $lang->program->PRJCategoryList, $project->category, "class='form-control'");?></td><td></td><td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PRJPM;?></th>
|
||||
<td><?php echo html::select('PM', $pmUsers, $project->PM, "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PRJBudget;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('budget', $project->budget, "class='form-control'");?>
|
||||
<span class='input-group-addon'></span>
|
||||
<?php echo html::select('budgetUnit', $lang->program->unitList, $project->budgetUnit, "class='form-control'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td class='muted'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->dateRange;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('begin', $project->begin, "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->program->begin . "' required");?>
|
||||
<span class='input-group-addon'><?php echo $lang->program->to;?></span>
|
||||
<?php echo html::input('end', $project->end, "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->program->end . "' required");?>
|
||||
<?php if(empty($parentProgram) or $parentProgram->end == '0000-00-00'):?>
|
||||
<span class='input-group-addon hidden' id='longTimeBox'>
|
||||
<div class="checkbox-primary">
|
||||
<input type="checkbox" name="longTime" value="1" id="longTime">
|
||||
<label for="longTime"><?php echo $lang->program->longTime;?></label>
|
||||
</div>
|
||||
</span>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td class='muted'></td>
|
||||
</tr>
|
||||
<?php if($project->model == 'scrum'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->days;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('days', '', "class='form-control'");?>
|
||||
<span class='input-group-addon'><?php echo $lang->project->day;?></span>
|
||||
</div>
|
||||
</td><td></td><td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->teamname;?></th>
|
||||
<td><?php echo html::input('team', $project->team, "class='form-control'");?></td><td></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->PRJDesc;?></th>
|
||||
<td colspan='3'>
|
||||
<?php echo $this->fetch('user', 'ajaxPrintTemplates', 'type=project&link=desc');?>
|
||||
<?php echo html::textarea('desc', $project->desc, "rows='6' class='form-control kindeditor' hidefocus='true'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->program->auth;?></th>
|
||||
<td colspan='3'><?php echo html::radio('privway', $lang->program->PRJAuthList, $project->privway, '', 'block');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->project->acl;?></th>
|
||||
<td colspan='3'><?php echo nl2br(html::radio('acl', $lang->program->PRJAclList, $project->acl, "onclick='setWhite(this.value);'", 'block'));?></td>
|
||||
</tr>
|
||||
<tr id='whitelistBox' <?php if($project->acl != 'custom') echo "class='hidden'";?>>
|
||||
<th><?php echo $lang->project->whitelist;?></th>
|
||||
<td colspan='3'><?php echo html::checkbox('whitelist', $groups, $project->whitelist, '', '', 'inline');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
<?php
|
||||
echo html::hidden('model', $project->model);
|
||||
echo html::submitButton();
|
||||
echo html::backButton();
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user