* adjust for merge program.

This commit is contained in:
z
2020-06-15 16:24:00 +08:00
parent 44f9274c99
commit 70ed978c2d
9 changed files with 391 additions and 100 deletions
+9 -9
View File
@@ -185,12 +185,11 @@ class upgrade extends control
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
$programName = $this->post->programName;
if(empty($programName)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->program)));
if(empty($_POST['pgmAdmin'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram($programName, $linkedProducts, $linkedProjects, $this->post->pgmAdmin);
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmin);
if(dao::isError()) die(js::error(dao::getError()));
}
else
{
@@ -231,12 +230,11 @@ class upgrade extends control
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
$programName = $this->post->programName;
if(empty($programName)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->program)));
if(empty($_POST['pgmAdmin'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram($programName, $linkedProducts, $linkedProjects, $this->post->pgmAdmin);
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmin);
if(dao::isError()) die(js::error(dao::getError()));
}
else
{
@@ -259,12 +257,11 @@ class upgrade extends control
$linkedProjects = $this->post->projects;
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
$programName = $this->post->programName;
if(empty($programName)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->program)));
if(empty($_POST['pgmAdmin'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram($programName, array(), $linkedProjects, $this->post->pgmAdmin);
$programID = $this->upgrade->createProgram(array(), $linkedProjects, $this->post->pgmAdmin);
if(dao::isError()) die(js::error(dao::getError()));
}
else
{
@@ -307,6 +304,8 @@ class upgrade extends control
$this->view->noMergedProductCount = $noMergedProductCount;
$this->view->noMergedProjectCount = $noMergedProjectCount;
$this->app->loadLang('program');
$this->loadModel('project');
$this->view->type = $type;
if($type == 'productline')
{
@@ -420,6 +419,7 @@ class upgrade extends control
$this->view->programs = $this->dao->select('*')->from(TABLE_PROJECT)->where('program')->eq(0)->andWhere('deleted')->eq(0)->andWhere('template')->eq('scrum')->fetchPairs('id', 'name');
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
$this->view->groups = $this->loadModel('group')->getPairs();
$this->display();
}
+4 -1
View File
@@ -1,3 +1,6 @@
.modal-dialog{width:100%;}
#programName {border-left-color:#dcdcdc !important;}
.checkbox-primary{overflow:hidden;}
.pgmWidth{width:450px !important;}
#whitelistBox .checkbox-inline {display: inline-block !important; padding-left: 0px !important;}
#whitelistBox .checkbox-inline:first-child {margin-left: 10px !important;}
#budget {border-right:0px;}
+127 -7
View File
@@ -1,5 +1,8 @@
$(function()
{
pgmBegin = $('.pgmParams #begin').val();
setPgmBegin(pgmBegin);
$('[name^=lines]').change(function()
{
value = $(this).val();
@@ -11,6 +14,7 @@ $(function()
{
$('[data-line=' + value + ']').prop('checked', false)
}
setPgmBegin(pgmBegin);
})
$('[name^=products]').change(function()
@@ -27,6 +31,7 @@ $(function()
{
$('[data-product=' + value + ']').prop('checked', false)
}
setPgmBegin(pgmBegin);
})
$('[name^=projects]').change(function()
@@ -39,6 +44,7 @@ $(function()
var productID = $(this).attr('data-product');
if(productID && $('[data-productid=' + productID + ']').length > 0 && !$('[data-productid=' + productID + ']').prop('checked')) $('[data-productid=' + productID + ']').prop('checked', true);
}
setPgmBegin(pgmBegin);
})
toggleProgram($('form #newProgram0'));
@@ -46,17 +52,131 @@ $(function()
function toggleProgram(obj)
{
$obj = $(obj);
$programs = $obj.closest('.input-group').find('[id^=programs]');
$programName = $obj.closest('.input-group').find('[id^=programName]');
$obj = $(obj);
$programs = $obj.closest('table').find('#programs');
$pgmParams = $obj.closest('table').find('.pgmParams');
if($obj.prop('checked'))
{
$programs.addClass('hidden');
$programName.removeClass('hidden');
$programs.attr('disabled', 'disabled');
$pgmParams.removeClass('hidden');
}
else
{
$programs.removeClass('hidden');
$programName.addClass('hidden');
$programs.removeAttr('disabled');
$pgmParams.addClass('hidden');
}
}
function setPgmBegin(pgmBegin)
{
$(':checkbox:checked[data-begin]').each(function()
{
begin = $(this).attr('data-begin').substr(0, 10);
if(begin == '0000-00-00') return true;
if(begin < pgmBegin)
{
pgmBegin = begin;
$('.pgmParams #begin').val(pgmBegin);
}
});
}
function setWhite(acl)
{
acl == 'custom' ? $('#whitelistBox').removeClass('hidden') : $('#whitelistBox').addClass('hidden');
}
function convertStringToDate(dateString)
{
dateString = dateString.split('-');
return new Date(dateString[0], dateString[1] - 1, dateString[2]);
}
/**
* Compute delta of two days.
*
* @param string $date1
* @param string $date1
* @access public
* @return int
*/
function computeDaysDelta(date1, date2)
{
date1 = convertStringToDate(date1);
date2 = convertStringToDate(date2);
delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1;
weekEnds = 0;
for(i = 0; i < delta; i++)
{
if((weekend == 2 && date1.getDay() == 6) || date1.getDay() == 0) weekEnds ++;
date1 = date1.valueOf();
date1 += 1000 * 60 * 60 * 24;
date1 = new Date(date1);
}
return delta - weekEnds;
}
/**
* Compute work days.
*
* @access public
* @return void
*/
function computeWorkDays(currentID)
{
isBactchEdit = false;
if(currentID)
{
index = currentID.replace('begins[', '');
index = index.replace('ends[', '');
index = index.replace(']', '');
if(!isNaN(index)) isBactchEdit = true;
}
if(isBactchEdit)
{
beginDate = $('#begins\\[' + index + '\\]').val();
endDate = $('#ends\\[' + index + '\\]').val();
}
else
{
beginDate = $('#begin').val();
endDate = $('#end').val();
}
if(beginDate && endDate)
{
if(isBactchEdit) $('#dayses\\[' + index + '\\]').val(computeDaysDelta(beginDate, endDate));
if(!isBactchEdit) $('#days').val(computeDaysDelta(beginDate, endDate));
}
else if($('input[checked="true"]').val())
{
computeEndDate();
}
}
/**
* Compute the end date for project.
*
* @param int $delta
* @access public
* @return void
*/
function computeEndDate(delta)
{
beginDate = $('#begin').val();
if(!beginDate) return;
delta = parseInt(delta);
beginDate = convertStringToDate(beginDate);
if((delta == 7 || delta == 14) && (beginDate.getDay() == 1))
{
delta = (weekend == 2) ? (delta - 2) : (delta - 1);
}
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
$('#end').val(endDate).datetimepicker('update');
computeWorkDays();
}
+2 -1
View File
@@ -75,7 +75,8 @@ $lang->upgrade->to15Desc = <<<EOD
EOD;
$lang->upgrade->line = '产品线';
$lang->upgrade->program = '项目名称';
$lang->upgrade->program = '归并项目';
$lang->upgrade->existPGM = '已有项目';
$lang->upgrade->pgmAdmin = '项目管理员';
$lang->upgrade->product = $lang->productCommon;
$lang->upgrade->project = $lang->projectCommon;
+31 -36
View File
@@ -3754,53 +3754,48 @@ class upgradeModel extends model
/**
* Create program.
*
* @param string $programName
* @param array $productIdList
* @param array $projectIdList
* @access public
* @return int
*/
public function createProgram($programName, $productIdList = array(), $projectIdList = array(), $pgmAdmin = '')
public function createProgram($productIdList = array(), $projectIdList = array(), $pgmAdmin = '')
{
$data = fixer::input('post')->get();
$program = new stdclass();
$program->name = $programName;
$program->template = 'scrum';
$program->category = count($productIdList) > 1 ? 'multiple' : 'single';
$program->status = 'wait';
$program->openedBy = $this->app->user->account;
$program->openedDate = helper::now();
$program->acl = 'open';
$program->privway = 'extend';
$program->name = $data->name;
$program->code = $data->code;
$program->template = 'scrum';
$program->category = count($productIdList) > 1 ? 'multiple' : 'single';
$program->status = 'wait';
$program->begin = $data->begin;
$program->end = $data->end;
$program->days = $data->days;
$program->budget = $data->budget;
$program->budgetUnit = $data->budgetUnit;
$program->PM = $data->PM;
$program->privway = 'extend';
$program->openedBy = $this->app->user->account;
$program->openedDate = helper::now();
$program->openedVersion = $this->config->version;
$program->acl = $data->acl;
if(!empty($data->whitelist)) $program->whitelist = join(',', $data->whitelist);
$begin = helper::today();
$end = helper::today();
if($productIdList)
{
$products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in($productIdList)->fetchAll('id');
foreach($products as $product)
{
if(empty($begin)) $begin = $product->createdDate;
if($product->createdDate < $begin) $begin = $product->createdDate;
}
}
$this->app->loadLang('project');
$this->lang->upgrade->name = $this->lang->project->name;
$this->lang->upgrade->code = $this->lang->project->code;
$this->lang->upgrade->begin = $this->lang->project->begin;
$this->lang->upgrade->end = $this->lang->project->end;
if($projectIdList)
{
$projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($projectIdList)->fetchAll('id');
foreach($projects as $project)
{
if($begin > $project->begin) $begin = $project->begin;
if($end < $project->end) $end = $project->end;
}
}
if(empty($projectIdList)) $end = date('Y-m-d', '+1 year');
$program->begin = $begin;
$program->end = $end;
$this->dao->insert(TABLE_PROJECT)->data($program)->exec();
$this->dao->insert(TABLE_PROJECT)->data($program)
->batchcheck('name,code,begin,end', 'notempty')
->checkIF($program->end != '', 'end', 'gt', $program->begin)
->check('name', 'unique', "deleted='0'")
->check('code', 'unique', "deleted='0'")
->exec();
if(dao::isError()) return false;
$programID = $this->dao->lastInsertId();
$this->dao->update(TABLE_PROJECT)->set('code')->eq('pgm' . $programID)->where('id')->eq($programID)->exec();
if($pgmAdmin)
{
+73 -16
View File
@@ -4,8 +4,7 @@
<th><?php echo $lang->upgrade->line;?></th>
<th><?php echo $lang->upgrade->product;?></th>
<th><?php echo $lang->upgrade->project;?></th>
<th><?php echo $lang->upgrade->program;?></th>
<th class='w-150px'><?php echo $lang->upgrade->pgmAdmin;?></th>
<th class='pgmWidth'><?php echo $lang->upgrade->program;?></th>
</tr>
</thead>
<tbody>
@@ -19,33 +18,91 @@
<td class='text-top'>
<?php $projectHtml = '';?>
<?php foreach($lineGroups[$line->id] as $productID => $product):?>
<?php echo html::checkBox("products[$line->id]", array($productID => "{$lang->productCommon} #{$product->id} {$product->name}"), $i == 0 ? $product->id : 0, "data-productid='{$product->id}' data-line='{$line->id}'");?>
<?php echo html::checkBox("products[$line->id]", array($productID => "{$lang->productCommon} #{$product->id} {$product->name}"), $i == 0 ? $product->id : 0, "data-productid='{$product->id}' data-line='{$line->id}' data-begin='{$product->createdDate}'");?>
<?php echo html::hidden("productIdList[$line->id][$productID]", $productID);?>
<?php if(isset($productGroups[$productID])):?>
<?php foreach($productGroups[$productID] as $project):?>
<?php $projectHtml .= html::checkBox("projects[$line->id][$productID]", array($project->id => "{$lang->projectCommon} #{$project->id} {$project->name}"), $i == 0 ? $project->id : 0, "data-product='{$product->id}' data-line='{$line->id}'");?>
<?php $projectHtml .= html::checkBox("projects[$line->id][$productID]", array($project->id => "{$lang->projectCommon} #{$project->id} {$project->name}"), $i == 0 ? $project->id : 0, "data-product='{$product->id}' data-line='{$line->id}' data-begin='{$project->begin}'");?>
<?php $projectHtml .= html::hidden("projectIdList[$line->id][$productID][$project->id]", $project->id);?>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</td>
<td><?php echo $projectHtml;?></td>
<td class='text-top'><?php echo $projectHtml;?></td>
<?php if($i == 0):?>
<td class='text-top' rowspan='<?php echo count($productlines);?>'>
<div class='input-group'>
<?php if($programs) echo html::select("programs", $programs, '', "class='form-control chosen'");?>
<?php echo html::input("programName", $line->name, "class='form-control'");?>
<table class='table table-form'>
<?php if($programs):?>
<span class='input-group-addon'>
<div class="checkbox-primary">
<input type="checkbox" name="newProgram" value="0" checked onchange="toggleProgram(this)" id="newProgram0" />
<label for="newProgram0"><?php echo $lang->upgrade->newProgram;?></label>
</div>
</span>
<tr>
<th><?php echo $lang->upgrade->existPGM;?></th>
<td>
<div class='input-group'>
<?php echo html::select("programs", $programs, '', "class='form-control'");?>
<span class='input-group-addon'>
<div class="checkbox-primary">
<input type="checkbox" name="newProgram" value="0" checked onchange="toggleProgram(this)" id="newProgram0" />
<label for="newProgram0"><?php echo $lang->upgrade->newProgram;?></label>
</div>
</span>
</div>
</td>
</tr>
<?php endif;?>
</div>
<tr class='pgmParams'>
<th class='w-90px'><?php echo $lang->program->name;?></th>
<td class='required'><?php echo html::input("name", $line->name, "class='form-control'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->code;?></th>
<td class='required'><?php echo html::input("code", '', "class='form-control'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->upgrade->pgmAdmin;?></th>
<td class='required'><?php echo html::select('pgmAdmin', $users, '', "class='form-control chosen'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->PM;?></th>
<td><?php echo html::select('PM', $users, '', "class='form-control chosen'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->budget;?></th>
<td>
<div class='input-group'>
<?php echo html::input('budget', '', "class='form-control'");?>
<span class='input-group-addon'></span>
<?php echo html::select('budgetUnit', $lang->program->unitList, 'yuan', "class='form-control'");?>
</div>
</td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->dateRange;?></th>
<td>
<div class='input-group'>
<?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");?>
</div>
</td>
</tr>
<tr class='pgmParams'>
<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>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->project->acl;?></th>
<td><?php echo nl2br(html::radio('acl', $lang->program->aclList, 'open', "onclick='setWhite(this.value);'", 'block'));?></td>
</tr>
<tr class='hidden' id='whitelistBox'>
<th><?php echo $lang->project->whitelist;?></th>
<td><?php echo html::checkbox('whitelist', $groups, '', '', '', 'inline');?></td>
</tr>
</table>
</td>
<td class='text-top' rowspan='<?php echo count($productlines);?>'><?php echo html::select("pgmAdmin", $users, '', "class='form-control chosen'");?></td>
<?php endif;?>
</tr>
<?php $i ++;?>
+73 -16
View File
@@ -3,39 +3,96 @@
<tr>
<th><?php echo $lang->upgrade->product;?></th>
<th><?php echo $lang->upgrade->project;?></th>
<th><?php echo $lang->upgrade->program;?></th>
<th class='w-150px'><?php echo $lang->upgrade->pgmAdmin;?></th>
<th class='pgmWidth'><?php echo $lang->upgrade->program;?></th>
</tr>
</thead>
<tbody>
<?php $i = 0;?>
<?php foreach($noMergedProducts as $productID => $product):?>
<tr>
<td class='text-top'><?php echo html::checkBox("products", array($product->id => "{$lang->productCommon} #{$product->id} {$product->name}"), $product->id, "data-productid='{$product->id}'");?></td>
<td>
<td class='text-top'><?php echo html::checkBox("products", array($product->id => "{$lang->productCommon} #{$product->id} {$product->name}"), $product->id, "data-productid='{$product->id}' data-begin='{$product->createdDate}'");?></td>
<td class='text-top'>
<?php if(isset($productGroups[$productID])):?>
<?php foreach($productGroups[$productID] as $project):?>
<?php echo html::checkBox("projects[$productID]", array($project->id => "{$lang->projectCommon} #{$project->id} {$project->name}"), $project->id, "data-product='{$productID}'");?>
<?php echo html::checkBox("projects[$productID]", array($project->id => "{$lang->projectCommon} #{$project->id} {$project->name}"), $project->id, "data-product='{$productID}' data-begin='{$project->begin}'");?>
<?php echo html::hidden("projectIdList[$productID][$project->id]", $project->id);?>
<?php endforeach;?>
<?php endif;?>
</td>
<?php if($i == 0):?>
<td class='text-top' rowspan='<?php echo count($noMergedProducts);?>'>
<div class='input-group'>
<?php if($programs) echo html::select("programs", $programs, '', "class='form-control chosen'");?>
<?php echo html::input("programName", '', "class='form-control'");?>
<table class='table table-form'>
<?php if($programs):?>
<span class='input-group-addon'>
<div class="checkbox-primary">
<input type="checkbox" name="newProgram" value="0" checked onchange="toggleProgram(this)" id="newProgram0" />
<label for="newProgram0"><?php echo $lang->upgrade->newProgram;?></label>
</div>
</span>
<tr>
<th><?php echo $lang->upgrade->existPGM;?></th>
<td>
<div class='input-group'>
<?php echo html::select("programs", $programs, '', "class='form-control'");?>
<span class='input-group-addon'>
<div class="checkbox-primary">
<input type="checkbox" name="newProgram" value="0" checked onchange="toggleProgram(this)" id="newProgram0" />
<label for="newProgram0"><?php echo $lang->upgrade->newProgram;?></label>
</div>
</span>
</div>
</td>
</tr>
<?php endif;?>
</div>
<tr class='pgmParams'>
<th class='w-90px'><?php echo $lang->program->name;?></th>
<td class='required'><?php echo html::input("name", '', "class='form-control'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->code;?></th>
<td class='required'><?php echo html::input("code", '', "class='form-control'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->upgrade->pgmAdmin;?></th>
<td class='required'><?php echo html::select('pgmAdmin', $users, '', "class='form-control chosen'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->PM;?></th>
<td><?php echo html::select('PM', $users, '', "class='form-control chosen'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->budget;?></th>
<td>
<div class='input-group'>
<?php echo html::input('budget', '', "class='form-control'");?>
<span class='input-group-addon'></span>
<?php echo html::select('budgetUnit', $lang->program->unitList, 'yuan', "class='form-control'");?>
</div>
</td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->dateRange;?></th>
<td>
<div class='input-group'>
<?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");?>
</div>
</td>
</tr>
<tr class='pgmParams'>
<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>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->project->acl;?></th>
<td><?php echo nl2br(html::radio('acl', $lang->program->aclList, 'open', "onclick='setWhite(this.value);'", 'block'));?></td>
</tr>
<tr class='hidden' id='whitelistBox'>
<th><?php echo $lang->project->whitelist;?></th>
<td><?php echo html::checkbox('whitelist', $groups, '', '', '', 'inline');?></td>
</tr>
</table>
</td>
<td class='text-top' rowspan='<?php echo count($noMergedProducts);?>'><?php echo html::select("pgmAdmin", $users, '', "class='form-control chosen'");?></td>
<?php endif;?>
</tr>
<?php $i++;?>
+71 -14
View File
@@ -2,32 +2,89 @@
<thead>
<tr>
<th><?php echo $lang->upgrade->project;?></th>
<th><?php echo $lang->upgrade->program;?></th>
<th class='w-150px'><?php echo $lang->upgrade->pgmAdmin;?></th>
<th class='pgmWidth'><?php echo $lang->upgrade->program;?></th>
</tr>
</thead>
<tbody>
<?php $i = 0;?>
<?php foreach($noMergedProjects as $projectID => $project):?>
<tr>
<td><?php echo html::checkBox("projects", array($project->id => "{$lang->projectCommon} #{$project->id} {$project->name}"), $project->id);?></td>
<?php if($i == 0):?>
<td class='text-top' rowspan='<?php echo count($noMergedProjects);?>'>
<div class='input-group'>
<?php if($programs) echo html::select("programs", $programs, '', "class='form-control chosen'");?>
<?php echo html::input("programName", '', "class='form-control'");?>
<table class='table table-form'>
<?php if($programs):?>
<span class='input-group-addon'>
<div class="checkbox-primary">
<input type="checkbox" name="newProgram" value="0" checked onchange="toggleProgram(this)" id="newProgram0" />
<label for="newProgram0"><?php echo $lang->upgrade->newProgram;?></label>
</div>
</span>
<tr>
<th><?php echo $lang->upgrade->existPGM;?></th>
<td>
<div class='input-group'>
<?php echo html::select("programs", $programs, '', "class='form-control'");?>
<span class='input-group-addon'>
<div class="checkbox-primary">
<input type="checkbox" name="newProgram" value="0" checked onchange="toggleProgram(this)" id="newProgram0" />
<label for="newProgram0"><?php echo $lang->upgrade->newProgram;?></label>
</div>
</span>
</div>
</td>
</tr>
<?php endif;?>
</div>
<tr class='pgmParams'>
<th class='w-90px'><?php echo $lang->program->name;?></th>
<td class='required'><?php echo html::input("name", '', "class='form-control'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->code;?></th>
<td class='required'><?php echo html::input("code", '', "class='form-control'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->upgrade->pgmAdmin;?></th>
<td class='required'><?php echo html::select('pgmAdmin', $users, '', "class='form-control chosen'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->PM;?></th>
<td><?php echo html::select('PM', $users, '', "class='form-control chosen'");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->budget;?></th>
<td>
<div class='input-group'>
<?php echo html::input('budget', '', "class='form-control'");?>
<span class='input-group-addon'></span>
<?php echo html::select('budgetUnit', $lang->program->unitList, 'yuan', "class='form-control'");?>
</div>
</td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->dateRange;?></th>
<td>
<div class='input-group'>
<?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");?>
</div>
</td>
</tr>
<tr class='pgmParams'>
<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>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->project->acl;?></th>
<td><?php echo nl2br(html::radio('acl', $lang->program->aclList, 'open', "onclick='setWhite(this.value);'", 'block'));?></td>
</tr>
<tr class='hidden' id='whitelistBox'>
<th><?php echo $lang->project->whitelist;?></th>
<td><?php echo html::checkbox('whitelist', $groups, '', '', '', 'inline');?></td>
</tr>
</table>
</td>
<td class='text-top' rowspan='<?php echo count($noMergedProjects);?>'><?php echo html::select("pgmAdmin", $users, '', "class='form-control chosen'");?></td>
<?php endif;?>
<td><?php echo html::checkBox("projects", array($project->id => "{$lang->projectCommon} #{$project->id} {$project->name}"), $project->id);?></td>
</tr>
<?php $i++;?>
<?php endforeach;?>
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php js::set('weekend', $config->project->weekend);?>
<div class='container'>
<form method='post' target='hiddenwin'>
<div class='modal-dialog'>