* adjust for merge program style.

This commit is contained in:
z
2020-06-16 10:39:01 +08:00
parent 70ed978c2d
commit 79db80e3b4
8 changed files with 222 additions and 329 deletions
+7 -7
View File
@@ -185,10 +185,10 @@ class upgrade extends control
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
if(empty($_POST['pgmAdmin'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmin);
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmins);
if(dao::isError()) die(js::error(dao::getError()));
}
else
@@ -230,10 +230,10 @@ class upgrade extends control
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
if(empty($_POST['pgmAdmin'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmin);
$programID = $this->upgrade->createProgram($linkedProducts, $linkedProjects, $this->post->pgmAdmins);
if(dao::isError()) die(js::error(dao::getError()));
}
else
@@ -257,10 +257,10 @@ class upgrade extends control
$linkedProjects = $this->post->projects;
if(isset($_POST['newProgram']) or !isset($_POST['programs']))
{
if(empty($_POST['pgmAdmin'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
if(empty($_POST['pgmAdmins'])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->upgrade->pgmAdmin)));
/* Create Program. */
$programID = $this->upgrade->createProgram(array(), $linkedProjects, $this->post->pgmAdmin);
$programID = $this->upgrade->createProgram(array(), $linkedProjects, $this->post->pgmAdmins);
if(dao::isError()) die(js::error(dao::getError()));
}
else
@@ -418,7 +418,7 @@ class upgrade extends control
$this->view->title = $this->lang->upgrade->mergeProgram;
$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->users = $this->loadModel('user')->getPairs('noclosed|noempty');
$this->view->groups = $this->loadModel('group')->getPairs();
$this->display();
}
+3 -1
View File
@@ -1,6 +1,8 @@
.modal-dialog{width:100%;}
.checkbox-primary{overflow:hidden;}
.pgmWidth{width:450px !important;}
.pgmWidth{width:48% !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;}
.divider{background:#f1f1f1 !important; width:20px !important; padding:1px !important;}
.gray{background:#f1f1f1 !important}
+17 -13
View File
@@ -3759,7 +3759,7 @@ class upgradeModel extends model
* @access public
* @return int
*/
public function createProgram($productIdList = array(), $projectIdList = array(), $pgmAdmin = '')
public function createProgram($productIdList = array(), $projectIdList = array(), $pgmAdmins = '')
{
$data = fixer::input('post')->get();
$program = new stdclass();
@@ -3775,6 +3775,7 @@ class upgradeModel extends model
$program->budgetUnit = $data->budgetUnit;
$program->PM = $data->PM;
$program->privway = 'extend';
$program->team = substr($data->name, 0, 30);
$program->openedBy = $this->app->user->account;
$program->openedDate = helper::now();
$program->openedVersion = $this->config->version;
@@ -3797,24 +3798,27 @@ class upgradeModel extends model
$programID = $this->dao->lastInsertId();
if($pgmAdmin)
if($pgmAdmins)
{
$groupID = $this->dao->select('id')->from(TABLE_GROUP)->where('role')->eq('prgadmin')->fetch('id');
if($groupID)
{
$userGroup = $this->dao->select('*')->from(TABLE_USERGROUP)->where('account')->eq($pgmAdmin)->andWhere('`group`')->eq($groupID)->fetch();
if(empty($userGroup))
foreach($pgmAdmins as $pgmAdmin)
{
$userGroup = new stdclass();
$userGroup->account = $pgmAdmin;
$userGroup->group = $groupID;
$userGroup->program = '';
$userGroup = $this->dao->select('*')->from(TABLE_USERGROUP)->where('account')->eq($pgmAdmin)->andWhere('`group`')->eq($groupID)->fetch();
if(empty($userGroup))
{
$userGroup = new stdclass();
$userGroup->account = $pgmAdmin;
$userGroup->group = $groupID;
$userGroup->program = '';
}
$userGroup->program .= ',' . $programID;
$userGroup->program = trim($userGroup->program, ',');
$this->dao->replace(TABLE_USERGROUP)->data($userGroup)->exec();
}
$userGroup->program .= ',' . $programID;
$userGroup->program = trim($userGroup->program, ',');
$this->dao->replace(TABLE_USERGROUP)->data($userGroup)->exec();
}
}
@@ -0,0 +1,72 @@
<table class='table table-form'>
<caption class='strong'><?php echo $lang->upgrade->program;?></caption>
<?php if($programs):?>
<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;?>
<tr class='pgmParams'>
<th class='w-90px'><?php echo $lang->program->name;?></th>
<td class='required'><?php echo html::input("name", isset($programName) ? $programName : '', "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('pgmAdmins[]', $users, '', "class='form-control chosen' multiple");?></td>
</tr>
<tr class='pgmParams'>
<th><?php echo $lang->program->PM;?></th>
<td><?php echo html::select('PM', array('' => '') + $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>
+58 -110
View File
@@ -1,111 +1,59 @@
<table class='table table-form'>
<thead>
<tr>
<th><?php echo $lang->upgrade->line;?></th>
<th><?php echo $lang->upgrade->product;?></th>
<th><?php echo $lang->upgrade->project;?></th>
<th class='pgmWidth'><?php echo $lang->upgrade->program;?></th>
</tr>
</thead>
<tbody>
<?php $i = 0;?>
<?php foreach($productlines as $line):?>
<?php if(!isset($lineGroups[$line->id])) continue;?>
<tr>
<td class='text-top'>
<?php echo html::checkBox("lines", array($line->id => "{$line->name}"), $i == 0 ? $line->id : 0, "data-lineid='{$line->id}'");?>
</td>
<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}' 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}' data-begin='{$project->begin}'");?>
<?php $projectHtml .= html::hidden("projectIdList[$line->id][$productID][$project->id]", $project->id);?>
<div class='table-row'>
<div class='table-col' id='source'>
<div class='alert alert-info'>
<?php
printf($lang->upgrade->mergeSummary, $noMergedProductCount, $noMergedProjectCount);
echo '<br />' . $lang->upgrade->mergeByProductLine;
?>
</div>
<table class='table table-form'>
<thead>
<tr>
<th class='w-150px'><?php echo $lang->upgrade->line;?></th>
<th><?php echo $lang->upgrade->product;?></th>
<th><?php echo $lang->upgrade->project;?></th>
</tr>
</thead>
<tbody>
<?php $i = 0;?>
<?php foreach($productlines as $line):?>
<?php
if(!isset($lineGroups[$line->id]))
{
unset($productlines[$line->id]);
continue;
}
?>
<tr>
<td class='text-top'>
<?php echo html::checkBox("lines", array($line->id => "{$line->name}"), $i == 0 ? $line->id : 0, "data-lineid='{$line->id}'");?>
</td>
<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}' 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}' data-begin='{$project->begin}'");?>
<?php $projectHtml .= html::hidden("projectIdList[$line->id][$productID][$project->id]", $project->id);?>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</td>
<td class='text-top'><?php echo $projectHtml;?></td>
</tr>
<?php $i ++;?>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
</td>
<td class='text-top'><?php echo $projectHtml;?></td>
<?php if($i == 0):?>
<td class='text-top' rowspan='<?php echo count($productlines);?>'>
<table class='table table-form'>
<?php if($programs):?>
<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;?>
<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>
<?php endif;?>
</tr>
<?php $i ++;?>
<?php endforeach;?>
</tbody>
</table>
</tbody>
</table>
</div>
<div class='table-col divider strong'></div>
<div class='table-col pgmWidth' id='programBox'>
<?php
$line = reset($productlines);
$programName = $line->name;
include "./createprogram.html.php";
?>
</div>
</div>
+32 -98
View File
@@ -1,101 +1,35 @@
<table class='table table-form'>
<thead>
<tr>
<th><?php echo $lang->upgrade->product;?></th>
<th><?php echo $lang->upgrade->project;?></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}' 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}' 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);?>'>
<table class='table table-form'>
<?php if($programs):?>
<div class='table-row'>
<div class='table-col' id='source'>
<div class='alert alert-info'>
<?php
printf($lang->upgrade->mergeSummary, $noMergedProductCount, $noMergedProjectCount);
echo '<br />' . $lang->upgrade->mergeByProduct;
?>
</div>
<table class='table table-form'>
<thead>
<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>
<th><?php echo $lang->upgrade->product;?></th>
<th><?php echo $lang->upgrade->project;?></th>
</tr>
</thead>
<tbody>
<?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}' 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}' data-begin='{$project->begin}'");?>
<?php echo html::hidden("projectIdList[$productID][$project->id]", $project->id);?>
<?php endforeach;?>
<?php endif;?>
</td>
</tr>
<?php endif;?>
<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>
<?php endif;?>
</tr>
<?php $i++;?>
<?php endforeach;?>
</tbody>
</table>
<?php endforeach;?>
</tbody>
</table>
</div>
<div class='table-col divider strong'></div>
<div class='table-col pgmWidth' id='programBox'><?php include "./createprogram.html.php";?></div>
</div>
+23 -89
View File
@@ -1,92 +1,26 @@
<table class='table table-form'>
<thead>
<tr>
<th><?php echo $lang->upgrade->project;?></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);?>'>
<table class='table table-form'>
<?php if($programs):?>
<div class='table-row'>
<div class='table-col' id='source'>
<div class='alert alert-info'>
<?php
printf($lang->upgrade->mergeSummary, $noMergedProductCount, $noMergedProjectCount);
echo '<br />' . $lang->upgrade->mergeByProject;
?>
</div>
<table class='table table-form'>
<thead>
<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>
<th><?php echo $lang->upgrade->project;?></th>
</tr>
<?php endif;?>
<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>
</thead>
<tbody>
<?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>
</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>
<?php endif;?>
</tr>
<?php $i++;?>
<?php endforeach;?>
</tbody>
</table>
<?php endforeach;?>
</tbody>
</table>
</div>
<div class='table-col divider strong'></div>
<div class='table-col pgmWidth' id='programBox'><?php include "./createprogram.html.php";?></div>
</div>
+10 -11
View File
@@ -19,15 +19,6 @@
<strong><?php echo $lang->upgrade->mergeProgram;?></strong>
</div>
<div class='modal-body'>
<div class='alert alert-info'>
<?php
printf($lang->upgrade->mergeSummary, $noMergedProductCount, $noMergedProjectCount);
if($type == 'productline') echo '<br />' . $lang->upgrade->mergeByProductLine;
if($type == 'product') echo '<br />' . $lang->upgrade->mergeByProduct;
if($type == 'project') echo '<br />' . $lang->upgrade->mergeByProject;
if($type == 'moreLink') echo '<br />' . $lang->upgrade->mergeByMoreLink;
?>
</div>
<?php if($type == 'productline'):?>
<?php include './mergebyline.html.php';?>
<?php elseif($type == 'product'):?>
@@ -35,17 +26,25 @@
<?php elseif($type == 'project'):?>
<?php include './mergebyproject.html.php';?>
<?php elseif($type == 'moreLink'):?>
<table class='table table-form'>
<div class='alert alert-info'>
<?php
printf($lang->upgrade->mergeSummary, $noMergedProductCount, $noMergedProjectCount);
echo '<br />' . $lang->upgrade->mergeByMoreLink;
?>
</div>
<table class='table table-hover table-form'>
<thead>
<tr>
<th><?php echo $lang->upgrade->project;?></th>
<th><?php echo $lang->upgrade->program;?></th>
<th class='divider'></th>
<th class='gray w-p50'><?php echo $lang->upgrade->program;?></th>
</tr>
</thead>
<tbody>
<?php foreach($noMergedProjects as $projectID => $project):?>
<tr>
<td><?php echo "{$lang->projectCommon} #{$project->id} {$project->name}" . html::hidden("projects[]", $project->id);?></td>
<td class='divider'><i class='icon icon-angle-double-right'></i></td>
<td><?php echo html::select("programs[]", $project->programs, '', "class='form-control chosen'");?></td>
</tr>
<?php endforeach;?>