Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -56,7 +56,7 @@ class design extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->loadModel('user')->getPairs();
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<th class="text-left w-150px"> <?php common::printOrderLink('commit', $orderBy, $vars, $lang->design->submission);?></th>
|
||||
<th class="text-left w-120px"> <?php common::printOrderLink('createdBy', $orderBy, $vars, $lang->design->createdBy);?></th>
|
||||
<th class="text-left w-150px"> <?php common::printOrderLink('createdDate', $orderBy, $vars, $lang->design->createdDate);?></th>
|
||||
<th class="text-left w-120px"> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->design->assignedTo);?></th>
|
||||
<th class="c-assignedTo w-120px"> <?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->design->assignedTo);?></th>
|
||||
<th class="text-center w-100px"><?php echo $lang->design->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -61,7 +61,7 @@
|
||||
<td style="overflow:hidden"><?php echo $design->commit;?></td>
|
||||
<td><?php echo $design->createdBy;?></td>
|
||||
<td><?php echo substr($design->createdDate, 0, 11);?></td>
|
||||
<td><?php echo $this->design->printAssignedHtml($design, $users);?></td>
|
||||
<td class="c-assignedTo"><?php echo $this->design->printAssignedHtml($design, $users);?></td>
|
||||
<td class='c-actions text-center'>
|
||||
<?php
|
||||
$vars = "design={$design->id}";
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
$(function()
|
||||
{
|
||||
$('#copyProjects a').click(function(){setCopyProject($(this).data('id')); $('#copyProjectModal').modal('hide')});
|
||||
$('#isCat').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#longTimeBox').removeClass('hidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#longTimeBox').addClass('hidden');
|
||||
$('#longTimeBox').find('#longTime').prop('checked', false).change();
|
||||
}
|
||||
});
|
||||
|
||||
$('#longTime').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#end').val('').attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#end').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function setCopyProject(copiedProgramID)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
$(function()
|
||||
{
|
||||
var endDate = $('#end').val();
|
||||
$('#isCat').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#longTimeBox').removeClass('hidden');
|
||||
$('#longTime').change();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#longTimeBox').addClass('hidden');
|
||||
$('#longTimeBox').find('#longTime').prop('checked', false).change();
|
||||
}
|
||||
});
|
||||
|
||||
$('#longTime').change(function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#end').val('').attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#end').val(endDate).removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
$('#isCat').change();
|
||||
});
|
||||
@@ -65,6 +65,7 @@ $lang->program->ac = 'AC';
|
||||
$lang->program->cv = 'CV%';
|
||||
$lang->program->pm = 'PM';
|
||||
$lang->program->teamCount = 'The Number Of Team';
|
||||
$lang->program->longTime = 'Long-term Project';
|
||||
|
||||
$lang->program->unitList[''] = '';
|
||||
$lang->program->unitList['yuan'] = 'Yuan';
|
||||
@@ -118,3 +119,4 @@ $lang->program->beginLetterParent = "Begin date of parent project: %s, Begin da
|
||||
$lang->program->endGreaterParent = "End date of parent project: %s, End date cannot be greater than the end date of parent project.";
|
||||
$lang->program->beginGreateChild = "Minimum begin date of child project: %s, the begin date of parent project cannot be greater than the minimum begin date of child project.";
|
||||
$lang->program->endLetterChild = "Maximum end date of child project: %s, the end date of parent project cannot be less than the maximum end date of child project.";
|
||||
$lang->program->childLongTime = "There are long-term projects in the sub project, and the parent project should also be a long-term project";
|
||||
|
||||
@@ -65,6 +65,7 @@ $lang->program->ac = 'AC';
|
||||
$lang->program->cv = 'CV%';
|
||||
$lang->program->pm = '项目负责人';
|
||||
$lang->program->teamCount = '项目成员';
|
||||
$lang->program->longTime = '长期项目';
|
||||
|
||||
$lang->program->unitList[''] = '';
|
||||
$lang->program->unitList['yuan'] = '元';
|
||||
@@ -118,3 +119,4 @@ $lang->program->beginLetterParent = "父项目的开始日期:%s,开始日
|
||||
$lang->program->endGreaterParent = "父项目的完成日期:%s,完成日期不能大于父项目的完成日期";
|
||||
$lang->program->beginGreateChild = "子项目的最小开始日期:%s,父项目的开始日期不能大于子项目的最小开始日期";
|
||||
$lang->program->endLetterChild = "子项目的最大完成日期:%s,父项目的完成日期不能小于子项目的最大完成日期";
|
||||
$lang->program->childLongTime = "子项目中有长期项目,父项目也应该是长期项目";
|
||||
|
||||
+43
-28
@@ -247,26 +247,38 @@ class programModel extends model
|
||||
->add('type', 'program')
|
||||
->setIF($this->post->acl != 'custom', 'whitelist', '')
|
||||
->setDefault('openedBy', $this->app->user->account)
|
||||
->setDefault('end', '')
|
||||
->setDefault('openedDate', helper::now())
|
||||
->setDefault('team', substr($this->post->name, 0, 30))
|
||||
->join('whitelist', ',')
|
||||
->cleanInt('budget')
|
||||
->stripTags($this->config->program->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('products, workDays, delta, branch, uid, plans')
|
||||
->remove('products, workDays, delta, branch, uid, plans, longTime')
|
||||
->get();
|
||||
|
||||
if($project->parent)
|
||||
{
|
||||
$parentProgram = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($project->parent)->fetch();
|
||||
if($project->begin < $parentProgram->begin) dao::$errors['begin'] = sprintf($this->lang->program->beginLetterParent, $parentProgram->begin);
|
||||
if($project->end > $parentProgram->end) dao::$errors['end'] = sprintf($this->lang->program->endGreaterParent, $parentProgram->end);
|
||||
if(dao::isError()) return false;
|
||||
if($parentProgram)
|
||||
{
|
||||
/* Child project begin cannot less than parent. */
|
||||
if($project->begin < $parentProgram->begin) dao::$errors['begin'] = sprintf($this->lang->program->beginLetterParent, $parentProgram->begin);
|
||||
/* When parent set end then child project end cannot greater than parent. */
|
||||
if($parentProgram->end != '0000-00-00' and $project->end > $parentProgram->end) dao::$errors['end'] = sprintf($this->lang->program->endGreaterParent, $parentProgram->end);
|
||||
/* When parent set end then child project cannot set longTime. */
|
||||
if(empty($project->end) and $this->post->longTime and $parentProgram->end != '0000-00-00') dao::$errors['end'] = sprintf($this->lang->program->endGreaterParent, $parentProgram->end);
|
||||
|
||||
if(dao::isError()) return false;
|
||||
}
|
||||
}
|
||||
|
||||
$requiredFields = $this->config->program->create->requiredFields;
|
||||
if($this->post->longTime) $requiredFields = trim(str_replace(',end,', ',', ",{$requiredFields},"), ',');
|
||||
|
||||
$project = $this->loadModel('file')->processImgURL($project, $this->config->program->editor->create['id'], $this->post->uid);
|
||||
$this->dao->insert(TABLE_PROJECT)->data($project)
|
||||
->autoCheck()
|
||||
->batchcheck($this->config->program->create->requiredFields, 'notempty')
|
||||
->batchcheck($requiredFields, 'notempty')
|
||||
->check('name', 'unique', "deleted='0'")
|
||||
->check('code', 'unique', "deleted='0'")
|
||||
->exec();
|
||||
@@ -343,15 +355,16 @@ class programModel extends model
|
||||
$oldProgram = $this->dao->findById($programID)->from(TABLE_PROJECT)->fetch();
|
||||
|
||||
$program = fixer::input('post')
|
||||
->setDefault('team', $this->post->name)
|
||||
->setDefault('end', '')
|
||||
->setDefault('isCat', 0)
|
||||
->setIF($this->post->begin == '0000-00-00', 'begin', '')
|
||||
->setIF($this->post->end == '0000-00-00', 'end', '')
|
||||
->setIF($this->post->acl != 'custom', 'whitelist', '')
|
||||
->setIF($this->post->acl == 'custom' and !isset($_POST['whitelist']), 'whitelist', '')
|
||||
->setDefault('team', $this->post->name)
|
||||
->setDefault('isCat', 0)
|
||||
->join('whitelist', ',')
|
||||
->stripTags($this->config->program->editor->edit['id'], $this->config->allowedTags)
|
||||
->remove('products, branch, uid, plans')
|
||||
->remove('products, branch, uid, plans, longTime')
|
||||
->get();
|
||||
$program = $this->loadModel('file')->processImgURL($program, $this->config->program->editor->edit['id'], $this->post->uid);
|
||||
|
||||
@@ -361,23 +374,33 @@ class programModel extends model
|
||||
if(!empty($program->isCat))
|
||||
{
|
||||
$minChildBegin = $this->dao->select('min(begin) as minBegin')->from(TABLE_PROJECT)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->fetch('minBegin');
|
||||
$maxChildEnd = $this->dao->select('max(end) as maxEnd')->from(TABLE_PROJECT)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->fetch('maxEnd');
|
||||
$maxChildEnd = $this->dao->select('max(end) as maxEnd')->from(TABLE_PROJECT)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->andWhere('end')->ne('0000-00-00')->fetch('maxEnd');
|
||||
|
||||
if($minChildBegin and $program->begin > $minChildBegin) dao::$errors['begin'] = sprintf($this->lang->program->beginGreateChild, $minChildBegin);
|
||||
if($maxChildEnd and $program->end < $maxChildEnd) dao::$errors['end'] = sprintf($this->lang->program->endLetterChild, $maxChildEnd);
|
||||
|
||||
$longTimeCount = $this->dao->select('count(*) as count')->from(TABLE_PROJECT)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->andWhere('end')->eq('0000-00-00')->fetch('count');
|
||||
if(!empty($program->end) and $longTimeCount != 0) dao::$errors['end'] = $this->lang->program->childLongTime;
|
||||
}
|
||||
|
||||
if($program->parent)
|
||||
{
|
||||
$parentProgram = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($program->parent)->fetch();
|
||||
if($parentProgram and $program->begin < $parentProgram->begin) dao::$errors['begin'] = sprintf($this->lang->program->beginLetterParent, $parentProgram->begin);
|
||||
if($parentProgram and $program->end > $parentProgram->end) dao::$errors['end'] = sprintf($this->lang->program->endGreaterParent, $parentProgram->end);
|
||||
if($parentProgram)
|
||||
{
|
||||
if($program->begin < $parentProgram->begin) dao::$errors['begin'] = sprintf($this->lang->program->beginLetterParent, $parentProgram->begin);
|
||||
if($parentProgram->end != '0000-00-00' and $project->end > $parentProgram->end) dao::$errors['end'] = sprintf($this->lang->program->endGreaterParent, $parentProgram->end);
|
||||
if(empty($project->end) and $this->post->longTime and $parentProgram->end != '0000-00-00') dao::$errors['end'] = sprintf($this->lang->program->endGreaterParent, $parentProgram->end);
|
||||
}
|
||||
}
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$requiredFields = $this->config->program->edit->requiredFields;
|
||||
if($this->post->longTime) $requiredFields = trim(str_replace(',end,', ',', ",{$requiredFields},"), ',');
|
||||
|
||||
$this->dao->update(TABLE_PROJECT)->data($program)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
->batchcheck($this->config->program->edit->requiredFields, 'notempty')
|
||||
->batchcheck($requiredFields, 'notempty')
|
||||
->checkIF($program->begin != '', 'begin', 'date')
|
||||
->checkIF($program->end != '', 'end', 'date')
|
||||
->checkIF($program->end != '', 'end', 'gt', $program->begin)
|
||||
@@ -447,6 +470,13 @@ class programModel extends model
|
||||
|
||||
if(empty($program)) return true;
|
||||
|
||||
if($program->isCat and $action == 'group') return false;
|
||||
if($program->isCat and $action == 'managemembers') return false;
|
||||
if($program->isCat and $action == 'start') return false;
|
||||
if($program->isCat and $action == 'activate') return false;
|
||||
if($program->isCat and $action == 'suspend') return false;
|
||||
if($program->isCat and $action == 'close') return false;
|
||||
|
||||
if($action == 'start') return $program->status == 'wait' or $program->status == 'suspended';
|
||||
if($action == 'finish') return $program->status == 'wait' or $program->status == 'doing';
|
||||
if($action == 'close') return $program->status != 'closed';
|
||||
@@ -466,23 +496,8 @@ class programModel extends model
|
||||
public function checkHasContent($programID)
|
||||
{
|
||||
$count = 0;
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_BUDGET)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_BUG)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_CASE)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_DESIGN)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_DOC)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_DURATIONESTIMATION)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_ISSUE)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_PROJECT)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_RELATION)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_RELEASE)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_REPO)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_RISK)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_STORY)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_TESTREPORT)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_TESTSUITE)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_TESTTASK)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_WORKESTIMATION)->where('program')->eq($programID)->fetch('count');
|
||||
$count += (int)$this->dao->select('count(*) as count')->from(TABLE_TASK)->where('program')->eq($programID)->fetch('count');
|
||||
|
||||
return $count > 0;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php $canOrder = (common::hasPriv('program', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
|
||||
<form class='main-table auto-fade-in fade' id='programForm' method='post' data-ride='table' data-nested='true' data-expand-nest-child='false' data-checkable='false'>
|
||||
<table class='table has-sort-head table-fixed' id='programList'>
|
||||
<form class='main-table' id='programForm' method='post' data-ride='table' data-nested='true' data-expand-nest-child='false' data-checkable='false'>
|
||||
<table class='table has-sort-head table-fixed table-nested' id='programList'>
|
||||
<?php $vars = "status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -22,13 +22,33 @@
|
||||
</thead>
|
||||
<tbody class='sortable' id='programTableList'>
|
||||
<?php foreach($programs as $program):?>
|
||||
<tr data-id='<?php echo $program->id ?>' data-order='<?php echo $program->order ?>'<?php if($program->isCat) echo " data-nested='true'";?><?php if($program->parent) echo " data-nest-parent='$program->parent' data-nest-path='$program->path'";?>>
|
||||
<?php
|
||||
$trClass = '';
|
||||
$trAttrs = "data-id='$program->id' data-order=$program->order";
|
||||
if($program->isCat)
|
||||
{
|
||||
$trAttrs .= " data-nested='true'";
|
||||
if($program->parent == '0') $trClass .= ' is-top-level table-nest-child-hide';
|
||||
else $trClass .= ' is-top-level table-nest-hide';
|
||||
}
|
||||
|
||||
if($program->parent)
|
||||
{
|
||||
if(!$program->isCat) $trClass .= ' is-nest-child';
|
||||
$trClass .= ' table-nest-hide';
|
||||
$trAttrs .= " data-nest-parent='$program->parent' data-nest-path='$program->path'";
|
||||
}
|
||||
else if(!$program->isCat) $trClass .= ' no-nest';
|
||||
$trAttrs .= " class='$trClass'";
|
||||
?>
|
||||
<tr <?php echo $trAttrs;?>>
|
||||
<td class='c-id'>
|
||||
<?php printf('%03d', $program->id);?>
|
||||
</td>
|
||||
<td class='text-left'><?php echo $program->code;?></td>
|
||||
<td class='text-left pgm-title table-nest-title' title='<?php echo $program->name?>'>
|
||||
<?php echo html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), $program->name);?>
|
||||
<span class="table-nest-icon icon<?php if($program->isCat) echo ' table-nest-toggle' ?>"></span>
|
||||
<?php echo $program->isCat ? $program->name : html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), $program->name);?>
|
||||
</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>
|
||||
|
||||
@@ -91,9 +91,17 @@
|
||||
<?php echo html::input('begin', date('Y-m-d'), "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', '', "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'><?php if($parentProgram) printf($lang->program->parentBeginEnd, $parentProgram->begin, $parentProgram->end);?></td>
|
||||
<td class='muted'><?php if($parentProgram) printf($lang->program->parentBeginEnd, $parentProgram->begin, $parentProgram->end == '0000-00-00' ? '' : $parentProgram->end);?></td>
|
||||
</tr>
|
||||
<?php if($template == 'scrum'):?>
|
||||
<tr>
|
||||
|
||||
@@ -60,7 +60,13 @@
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('begin', $program->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', $program->end, "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->program->end . "' required");?>
|
||||
<?php echo html::input('end', $program->end == '0000-00-00' ? '' : $program->end, "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->program->end . "' required");?>
|
||||
<span class='input-group-addon hidden' id='longTimeBox'>
|
||||
<div class="checkbox-primary">
|
||||
<input type="checkbox" name="longTime" value="1" id="longTime" <?php if($program->end == '0000-00-00') echo "checked";?>>
|
||||
<label for="longTime"><?php echo $lang->program->longTime;?></label>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan='2'></td>
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of stage currentModule 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 stage
|
||||
* @version $Id: control.php 5107 2013-07-12 01:46:12Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class stage extends control
|
||||
{
|
||||
/**
|
||||
* Browse designs
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($orderBy = "id_desc")
|
||||
{
|
||||
$this->view->stages = $this->stage->getStages($orderBy);
|
||||
@@ -12,11 +29,17 @@ class stage extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a stage
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$stageID = $this->stage->create();
|
||||
$stageID = $this->stage->create();
|
||||
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
@@ -39,11 +62,17 @@ class stage extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch create
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchCreate()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->stage->batchCreate();
|
||||
$this->stage->batchCreate();
|
||||
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
@@ -65,12 +94,19 @@ class stage extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a stage
|
||||
*
|
||||
* @param int $stageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($stageID = 0)
|
||||
{
|
||||
$stage = $this->stage->getByID($stageID);
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->stage->update($stageID);
|
||||
$changes = $this->stage->update($stageID);
|
||||
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = $this->lang->saveSuccess;
|
||||
@@ -95,6 +131,12 @@ class stage extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setType()
|
||||
{
|
||||
$this->loadModel('custom');
|
||||
@@ -103,9 +145,9 @@ class stage extends control
|
||||
$data = fixer::input('post')->get();
|
||||
$this->custom->deleteItems("lang=all&module=stage§ion=typeList");
|
||||
foreach($data->keys as $index => $key)
|
||||
{
|
||||
{
|
||||
$value = $data->values[$index];
|
||||
if(!$value or !$key) continue;
|
||||
if(!$value or !$key) continue;
|
||||
$this->custom->setItem("all.stage.typeList.{$key}", $value);
|
||||
}
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('stage', 'settype')));
|
||||
@@ -117,6 +159,14 @@ class stage extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a stage
|
||||
*
|
||||
* @param int $stageID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($stageID, $confirm = 'no')
|
||||
{
|
||||
$stage = $this->stage->getById($stageID);
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* The stage module English file 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 stage
|
||||
* @version $Id: en.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* Actions. */
|
||||
$lang->stage->browse = 'Stage List';
|
||||
$lang->stage->create = 'Create Stage';
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* The stage module zh-cn file 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 stage
|
||||
* @version $Id: zh-cn.php 4729 2013-05-03 07:53:55Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* Actions. */
|
||||
$lang->stage->browse = '浏览列表';
|
||||
$lang->stage->create = '新建';
|
||||
|
||||
+53
-2
@@ -1,6 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of stage 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 stage
|
||||
* @version $Id: model.php 5079 2013-07-10 00:44:34Z chencongzhi520@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class stageModel extends model
|
||||
{
|
||||
/**
|
||||
* Create a stage
|
||||
*
|
||||
* @access public
|
||||
* @return int|bool
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$stage = fixer::input('post')
|
||||
@@ -14,14 +32,20 @@ class stageModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch create
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function batchCreate()
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
$this->loadModel('action');
|
||||
foreach($data->name as $i => $name)
|
||||
{
|
||||
if(!$name) continue;
|
||||
if(!$name) continue;
|
||||
|
||||
$stage = new stdclass();
|
||||
$stage->name = $name;
|
||||
@@ -39,6 +63,13 @@ class stageModel extends model
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a stage
|
||||
*
|
||||
* @param int $stageID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function update($stageID)
|
||||
{
|
||||
$oldStage = $this->dao->select('*')->from(TABLE_STAGE)->where('id')->eq((int)$stageID)->fetch();
|
||||
@@ -54,11 +85,24 @@ class stageModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get stages
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStages($orderBy = 'id_desc')
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_STAGE)->where('deleted')->eq(0)->orderBy($orderBy)->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pairs
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPairs()
|
||||
{
|
||||
$stages = $this->getStages();
|
||||
@@ -72,6 +116,13 @@ class stageModel extends model
|
||||
return $pairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get by id
|
||||
*
|
||||
* @param int $stageID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByID($stageID)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_STAGE)->where('deleted')->eq(0)->andWhere('id')->eq((int)$stageID)->fetch();
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* The batchCreate view of stage 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 stage
|
||||
* @version $Id: batchCreate.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="main-header">
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view of stage 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 stage
|
||||
* @version $Id: browse.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toobar pull-left">
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view of stage 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 stage
|
||||
* @version $Id: create.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="center-block">
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view of stage 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 stage
|
||||
* @version $Id: edit.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="center-block">
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* The setType view of stage 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 stage
|
||||
* @version $Id: setType.html.php 4903 2013-06-26 05:32:59Z wyd621@gmail.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php
|
||||
$itemRow = <<<EOT
|
||||
|
||||
+6
-6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user