* Merge code.

This commit is contained in:
Yagami
2020-11-13 11:38:22 +08:00
parent 13c924c5f5
commit 3a00d645ec
11 changed files with 66 additions and 12 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ class program extends control
* @access public
* @return void
*/
public function PGMBrowse($status = 'all', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 50, $pageID = 1)
public function PGMBrowse($status = 'all', $orderBy = 'id_asc,order_desc', $recTotal = 0, $recPerPage = 50, $pageID = 1)
{
$this->lang->navGroup->program = 'program';
$this->lang->program->switcherMenu = $this->program->getPGMCommonAction();
+15 -1
View File
@@ -1,4 +1,18 @@
$(function(){$('#parent').change();})
$(function()
{
$('#parent').change();
$('#longTime').change(function()
{
if($(this).prop('checked'))
{
$('#end').attr('disabled', 'disabled');
}
else
{
$('#end').removeAttr('disabled');
}
});
})
function setAclList(programID)
{
+15
View File
@@ -9,3 +9,18 @@ function setAclList(programID)
$('.aclBox').html($('#PGMAcl').html());
}
}
$(function()
{
$('#longTime').change(function()
{
if($(this).prop('checked'))
{
$('#end').attr('disabled', 'disabled');
}
else
{
$('#end').removeAttr('disabled');
}
});
})
+1 -2
View File
@@ -5,8 +5,7 @@ $(function()
{
if($(this).prop('checked'))
{
$('#end').val('').attr('disabled', 'disabled');
$('#days').val('');
$('#end').attr('disabled', 'disabled');
}
else
{
+5
View File
@@ -115,6 +115,11 @@ $lang->program->statusList['doing'] = 'Doing';
$lang->program->statusList['suspended'] = 'Suspended';
$lang->program->statusList['closed'] = 'Closed';
$lang->program->endList[31] = '一个月';
$lang->program->endList[93] = '三个月';
$lang->program->endList[186] = '半年';
$lang->program->endList[365] = '一年';
$lang->program->noPRJ = 'No project.';
$lang->program->accessDenied = 'Access denied!';
$lang->program->chooseProgramType = 'Select a method';
+5
View File
@@ -117,6 +117,11 @@ $lang->program->statusList['doing'] = '进行中';
$lang->program->statusList['suspended'] = '已挂起';
$lang->program->statusList['closed'] = '已关闭';
$lang->program->endList[31] = '一个月';
$lang->program->endList[93] = '三个月';
$lang->program->endList[186] = '半年';
$lang->program->endList[365] = '一年';
$lang->program->noPRJ = '暂时没有项目';
$lang->program->accessDenied = '您无权访问该项目!';
$lang->program->chooseProgramType = '选择项目管理方式';
+7 -5
View File
@@ -201,7 +201,7 @@ class programModel extends model
* @access public
* @return array
*/
public function getPGMList($status = 'all', $orderBy = 'id_desc', $pager = NULL)
public function getPGMList($status = 'all', $orderBy = 'id_asc', $pager = NULL)
{
return $this->dao->select('*')->from(TABLE_PROGRAM)
->where('type')->in('program,project')
@@ -252,10 +252,12 @@ class programModel extends model
->setDefault('parent', 0)
->setDefault('openedDate', helper::now())
->setIF($this->post->acl == 'open', 'whitelist', '')
->setIF($this->post->longTime == 1, 'end', '2059-00-00')
->add('type', 'program')
->join('whitelist', ',')
->cleanInt('budget')
->stripTags($this->config->program->editor->pgmcreate['id'], $this->config->allowedTags)
->remove('delta,longTime')
->get();
if($program->parent)
@@ -276,7 +278,6 @@ class programModel extends model
}
}
$this->lang->project->name = $this->lang->program->PGMName;
$this->lang->project->code = $this->lang->program->PGMCode;
$program = $this->loadModel('file')->processImgURL($program, $this->config->program->editor->pgmcreate['id'], $this->post->uid);
$this->dao->insert(TABLE_PROGRAM)->data($program)
@@ -342,9 +343,10 @@ class programModel extends model
->setIF($this->post->begin == '0000-00-00', 'begin', '')
->setIF($this->post->end == '0000-00-00', 'end', '')
->setIF($this->post->acl == 'open', 'whitelist', '')
->setIF($this->post->longTime == 1, 'end', '2059-00-00')
->join('whitelist', ',')
->stripTags($this->config->program->editor->pgmedit['id'], $this->config->allowedTags)
->remove('uid')
->remove('uid,delta,longTime')
->get();
$program = $this->loadModel('file')->processImgURL($program, $this->config->program->editor->pgmedit['id'], $this->post->uid);
@@ -1114,7 +1116,7 @@ class programModel extends model
->join('whitelist', ',')
->cleanInt('budget')
->stripTags($this->config->program->editor->prjcreate['id'], $this->config->allowedTags)
->remove('longTime,products,branch,plans')
->remove('longTime,products,branch,plans,delta')
->get();
if($project->parent)
@@ -1240,7 +1242,7 @@ class programModel extends model
->setIF($this->post->acl == 'open', 'whitelist', '')
->join('whitelist', ',')
->stripTags($this->config->program->editor->prjedit['id'], $this->config->allowedTags)
->remove('longTime,products,branch,plans')
->remove('longTime,products,branch,plans,delta')
->get();
if($project->parent)
+1 -1
View File
@@ -55,7 +55,7 @@
</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>
<td class='text-center'><?php echo $program->end == '0000-00-00' ? '' : $program->end;?></td>
<td class='text-center'><?php echo $program->end == '2059-00-00' ? '' : $program->end;?></td>
<td class='text-left'><?php echo $program->budget . ' ' . zget($lang->program->unitList, $program->budgetUnit);?></td>
<td><?php echo zget($users, $program->PM);?></td>
<td class='text-right c-actions'>
+7
View File
@@ -81,8 +81,15 @@
<?php echo html::input('begin', date('Y-m-d'), "class='form-control form-date' 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' placeholder='" . $lang->program->end . "' required");?>
<span class='input-group-addon' id='longTimeBox'>
<div class="checkbox-primary">
<input type="checkbox" name="longTime" value="1" id="longTime">
<label for="longTime"><?php echo $lang->program->PRJLongTime;?></label>
</div>
</span>
</div>
</td>
<td colspan='2'><?php echo html::radio('delta', $lang->program->endList , '', "onclick='computeEndDate(this.value)'");?></td>
</tr>
<tr class='hide'>
<th><?php echo $lang->project->status;?></th>
+8 -1
View File
@@ -53,7 +53,14 @@
<div class='input-group'>
<?php echo html::input('begin', $program->begin, "class='form-control form-date' placeholder='" . $lang->program->begin . "' required");?>
<span class='input-group-addon'><?php echo $lang->program->to;?></span>
<?php echo html::input('end', $program->end == '0000-00-00' ? '' : $program->end, "class='form-control form-date' placeholder='" . $lang->program->end . "' required");?>
<?php $disabledEnd = $program->end == '2059-00-00' ? 'disabled' : '';?>
<?php echo html::input('end', $program->end == '2059-00-00' ? '' : $program->end, "class='form-control form-date' $disabledEnd placeholder='" . $lang->program->end . "' required");?>
<span class='input-group-addon' id='longTimeBox'>
<div class="checkbox-primary">
<input type="checkbox" name="longTime" value="1" id="longTime" <?php echo $program->end == '2059-00-00' ? 'checked' : '';?>>
<label for="longTime"><?php echo $lang->program->PRJLongTime;?></label>
</div>
</span>
</div>
</td>
<td colspan='2'></td>
+1 -1
View File
@@ -134,7 +134,7 @@
</span>
</div>
</td>
<td class='muted'></td>
<td colspan='2'><?php echo html::radio('delta', $lang->program->endList , '', "onclick='computeEndDate(this.value)'");?></td>
</tr>
<?php if($model == 'scrum'):?>
<tr>