Merge branch 'zentaopms_9.8' of github.com:easysoft/zentaopms into zentaopms_9.8

This commit is contained in:
wumo
2018-03-22 16:53:52 +08:00
20 changed files with 209 additions and 74 deletions
+2 -2
View File
@@ -165,7 +165,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
$hasCustomSeverity = false;
foreach($lang->bug->severityList as $severityKey => $severityValue)
{
if(!empty($severityKey) and ($severityKey != $severityValue or strlen($severityKey) != strlen($severityValue)))
if(!empty($severityKey) and (string)$severityKey != (string)$severityValue)
{
$hasCustomSeverity = true;
break;
@@ -190,7 +190,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
$hasCustomPri = false;
foreach($lang->bug->priList as $priKey => $priValue)
{
if(!empty($priKey) and ($priKey != $priValue or strlen($priKey) != strlen($priValue)))
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
$hasCustomPri = true;
break;
+16 -10
View File
@@ -35,16 +35,8 @@ function computeEndDate(delta)
currentBeginDate = beginDate.toString('yyyy-MM-dd');
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
if(delta == 9999)
{
$('#begin').attr("disabled", "disabled");
$('#end').val('').attr("disabled", "disabled");
}
else
{
$('#begin').val(currentBeginDate).removeAttr('disabled')
$('#end').val(endDate).removeAttr('disabled');
}
$('#begin').val(currentBeginDate);
$('#end').val(endDate);
}
$('#begin').on('change', function()
@@ -57,3 +49,17 @@ $('#end').on('change', function()
{
$("input:radio[name='delta']").attr("checked", false);
});
$('#future').on('change', function()
{
if($(this).prop('checked'))
{
$('#begin').val('').attr('disabled', 'disabled');
$('#end').val('').parents('tr').hide();
}
else
{
$('#begin').removeAttr('disabled');
$('#end').val('').parents('tr').show();
}
});
+25 -24
View File
@@ -23,33 +23,34 @@ function convertStringToDate(dateString)
function computeEndDate(delta)
{
beginDate = $('#begin').val();
delta = parseInt(delta);
if(!beginDate) return;
if(delta == 9999)
delta = parseInt(delta);
beginDate = convertStringToDate(beginDate);
if((delta == 7 || delta == 14) && (beginDate.getDay() == 1))
{
$('#begin').attr("disabled", "disabled");
$('#end').val('').attr("disabled","disabled");
delta = (weekend == 2) ? (delta - 2) : (delta - 1);
}
currentBeginDate = beginDate.toString('yyyy-MM-dd');
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
$('#begin').val(currentBeginDate);
$('#end').val(endDate).datetimepicker('update');
}
$('#future').on('change', function()
{
if($(this).prop('checked'))
{
$('#begin').val('').attr('disabled', 'disabled');
$('#end').val('').parents('tr').hide();
}
else
{
if(beginDate)
{
beginDate = convertStringToDate(beginDate);
if((delta == 7 || delta == 14) && (beginDate.getDay() == 1))
{
delta = (weekend == 2) ? (delta - 2) : (delta - 1);
}
currentBeginDate = beginDate.toString('yyyy-MM-dd');
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
}
else
{
currentBeginDate = '';
endDate = '';
}
$('#begin').val(currentBeginDate).removeAttr('disabled')
$('#end').val(endDate).removeAttr('disabled').datetimepicker('update');
$('#begin').removeAttr('disabled');
$('#end').val('').parents('tr').show();
}
}
});
$('#future').change();
+7 -8
View File
@@ -52,14 +52,13 @@ $lang->productplan->bugs = 'Bug数';
$lang->productplan->hour = '工时';
$lang->productplan->project = $lang->projectCommon;
$lang->productplan->endList[7] = '一星期';
$lang->productplan->endList[14] = '两星期';
$lang->productplan->endList[31] = '一个月';
$lang->productplan->endList[62] = '两个月';
$lang->productplan->endList[93] = '三个月';
$lang->productplan->endList[186] = '半年';
$lang->productplan->endList[365] = '一年';
$lang->productplan->endList[9999] = '待定';
$lang->productplan->endList[7] = '一星期';
$lang->productplan->endList[14] = '两星期';
$lang->productplan->endList[31] = '一个月';
$lang->productplan->endList[62] = '两个月';
$lang->productplan->endList[93] = '三个月';
$lang->productplan->endList[186] = '半年';
$lang->productplan->endList[365] = '一年';
$lang->productplan->errorNoTitle = 'ID %s 标题不能为空';
$lang->productplan->errorNoBegin = 'ID %s 开始时间不能为空';
+13 -11
View File
@@ -117,16 +117,18 @@ class productplanModel extends model
->where('product')->in($product)
->andWhere('deleted')->eq(0)
->beginIF($branch)->andWhere("branch")->in("0,$branch")->fi()
->beginIF($expired == 'unexpired')->andWhere('end')->gt($date)->fi()
->beginIF($expired == 'unexpired')->andWhere('end')->ge($date)->fi()
->orderBy('begin desc')
->fetchPairs();
if($expired == 'unexpired' and empty($plans))
if($expired == 'unexpired')
{
$plans = $this->dao->select('id,CONCAT(title, " [", begin, " ~ ", end, "]") as title')->from(TABLE_PRODUCTPLAN)
$plans += $this->dao->select('id,CONCAT(title, " [", begin, " ~ ", end, "]") as title')->from(TABLE_PRODUCTPLAN)
->where('product')->in($product)
->andWhere('deleted')->eq(0)
->andWhere('end')->lt($date)
->beginIF($branch)->andWhere("branch")->in("0,$branch")->fi()
->beginIF($plans)->andWhere("id")->notIN(array_keys($plans))->fi()
->orderBy('begin desc')
->limit(5)
->fetchPairs();
@@ -159,16 +161,16 @@ class productplanModel extends model
public function create()
{
$plan = fixer::input('post')->stripTags($this->config->productplan->editor->create['id'], $this->config->allowedTags)
->setIF($this->post->delta == 9999 || empty($_POST['end']), 'end', '2030-01-01')
->setIF($this->post->delta == 9999 || empty($_POST['begin']), 'begin', '2030-01-01')
->remove('delta,uid')
->setIF($this->post->future || empty($_POST['begin']), 'begin', '2030-01-01')
->setIF($this->post->future || empty($_POST['end']), 'end', '2030-01-01')
->remove('delta,uid,future')
->get();
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->create['id'], $this->post->uid);
$this->dao->insert(TABLE_PRODUCTPLAN)
->data($plan)
->autoCheck()
->batchCheck($this->config->productplan->create->requiredFields, 'notempty')
->checkIF($this->post->delta != 9999 && !empty($_POST['begin']) && !empty($_POST['end']), 'end', 'gt', $plan->begin)
->checkIF(!$this->post->future && !empty($_POST['begin']) && !empty($_POST['end']), 'end', 'gt', $plan->begin)
->exec();
if(!dao::isError())
{
@@ -190,9 +192,9 @@ class productplanModel extends model
{
$oldPlan = $this->dao->findByID((int)$planID)->from(TABLE_PRODUCTPLAN)->fetch();
$plan = fixer::input('post')->stripTags($this->config->productplan->editor->edit['id'], $this->config->allowedTags)
->setIF($this->post->delta == 9999 || $this->post->end == '', 'end', '2030-01-01')
->setIF($this->post->delta == 9999 || empty($_POST['begin']), 'begin', '2030-01-01')
->remove('delta,uid')
->setIF($this->post->future || empty($_POST['begin']), 'begin', '2030-01-01')
->setIF($this->post->future || empty($_POST['end']), 'end', '2030-01-01')
->remove('delta,uid,future')
->get();
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->edit['id'], $this->post->uid);
@@ -200,7 +202,7 @@ class productplanModel extends model
->data($plan)
->autoCheck()
->batchCheck($this->config->productplan->edit->requiredFields, 'notempty')
->checkIF($this->post->delta != 9999 && !empty($_POST['begin']) && !empty($_POST['end']), 'end', 'gt', $plan->begin)
->checkIF(!$this->post->future && !empty($_POST['begin']) && !empty($_POST['end']), 'end', 'gt', $plan->begin)
->where('id')->eq((int)$planID)
->exec();
if(!dao::isError())
+10 -1
View File
@@ -43,7 +43,16 @@
</tr>
<tr>
<th><?php echo $lang->productplan->begin;?></th>
<td><?php echo html::input('begin', formatTime($begin), "class='form-control form-date'");?></td>
<td>
<div class='input-group'>
<?php echo html::input('begin', formatTime($begin), "class='form-control form-date'");?>
<span class='input-group-addon'>
<label class='checkbox-inline'>
<input type='checkbox' id='future' name='future' value='1'> <?php echo $lang->productplan->future;?>
</label>
</span>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->productplan->end;?></th>
+11 -1
View File
@@ -41,7 +41,17 @@
</tr>
<tr>
<th><?php echo $lang->productplan->begin;?></th>
<td><?php echo html::input('begin', $plan->begin != '2030-01-01' ? formatTime($plan->begin) : '', "class='form-control form-date'");?></td>
<td>
<div class='input-group'>
<?php echo html::input('begin', $plan->begin != '2030-01-01' ? formatTime($plan->begin) : '', "class='form-control form-date'");?>
<?php $checked = $plan->begin == '2030-01-01' || $plan->end == '2030-01-01' ? "checked='checked'" : '';?>
<span class='input-group-addon'>
<label class='checkbox-inline'>
<input type='checkbox' id='future' name='future' value='1' <?php echo $checked;?>> <?php echo $lang->productplan->future;?>
</label>
</span>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->productplan->end;?></th>
+4 -2
View File
@@ -20,7 +20,9 @@
<span class='prefix'><?php echo html::icon($lang->icons['plan']);?> <strong><?php echo $plan->id;?></strong></span>
<strong><?php echo $plan->title;?></strong>
<?php if($product->type !== 'normal') echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>" . $branches[$branch] . '</span>';?>
<span class='label label-info label-badge'><?php echo $plan->begin . '~' . $plan->end;?></span>
<span class='label label-info label-badge'>
<?php echo ($plan->begin == '2030-01-01' || $plan->end == '2030-01-01') ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?>
</span>
<?php if($plan->deleted):?>
<span class='label label-danger'><?php echo $lang->plan->deleted;?></span>
<?php endif; ?>
@@ -403,7 +405,7 @@
<?php endif;?>
<tr>
<th><?php echo $lang->productplan->begin;?></th>
<td><?php echo $plan->begin;?></td>
<td><?php echo $plan->begin == '2030-01-01' ? $lang->productplan->future : $plan->begin;?></td>
</tr>
<tr>
<th><?php echo $lang->productplan->end;?></th>
+1
View File
@@ -1081,6 +1081,7 @@ class projectModel extends model
$productType = $product->type;
if($product->branch)
{
if(!isset($branchGroups[$product->id][$product->branch])) continue;
$branchPairs[$product->branch] = (count($products) > 1 ? $product->name . '/' : '') . $branchGroups[$product->id][$product->branch];
}
else
+1 -1
View File
@@ -44,7 +44,7 @@ include '../../common/view/chosen.html.php';
#searchlite {line-height: 127px}
#searchform.showmore #searchmore, #searchform #searchlite {display: none;}
#searchform.showmore #searchlite, #searchform #searchmore {display: inline-block;}
#searchform .chosen-container[id^="field"] .chosen-drop{min-width: 120px;}
#searchform .chosen-container[id^="field"] .chosen-drop{min-width: 140px;}
#searchform [id^="valueBox"] .chosen-container .chosen-single{max-width: 170px;}
#searchform [id^="valueBox"] .chosen-container .chosen-drop{min-width: 400px;}
#searchform .chosen-container .chosen-drop ul.chosen-results li{white-space:normal}
+3 -3
View File
@@ -1615,8 +1615,8 @@ class storyModel extends model
->where($sql)
->beginIF($productID != 'all' and $productID != '')->andWhere('t1.`product`')->eq((int)$productID)->fi()
->andWhere('deleted')->eq(0)
->orderBy($orderBy, 't1.id')
->page($pager)
->orderBy($orderBy)
->page($pager, 't1.id')
->fetchAll('id');
if(!$tmpStories) return array();
@@ -1962,7 +1962,7 @@ class storyModel extends model
{
if($type == 'short')
{
$property = '[p' . $story->pri . ', ' . $story->estimate . 'h]';
$property = '[p' . (!empty($this->lang->story->priList[$story->pri]) ? $this->lang->story->priList[$story->pri] : 0) . ', ' . $story->estimate . 'h]';
}
else
{
+1 -1
View File
@@ -113,7 +113,7 @@
$hasCustomPri = false;
foreach($lang->story->priList as $priKey => $priValue)
{
if(!empty($priKey) and ($priKey != $priValue or strlen($priKey) != strlen($priValue)))
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
$hasCustomPri = true;
break;
+3 -1
View File
@@ -14,4 +14,6 @@
#taskPlanCol, #mailCol {width: 50%}
#planAndMailCell.has-mail-col #taskPlanCol {padding-right: 5px;}
#planAndMailCell.has-mail-col #taskPlanCol + #mailCol {padding-left: 5px;}
.input-group-addon input[type='checkBox']{}
.input-group-addon input[type='checkBox']{}
#modalTeam .modal-content{padding:8px 25px;}
+3
View File
@@ -3,3 +3,6 @@
#finishedDate.form-control.form-date {width: 218px!important}
#canceledDate.form-control.form-date {width: 218px!important}
#closedDate.form-control.form-date {width: 218px!important}
#modalTeam .modal-content{padding:8px 25px;}
#modalTeam .modal-content .table{border:none;}
+2 -2
View File
@@ -43,7 +43,7 @@
<?php echo html::select('assignedTo[]', $members, $task->assignedTo, "class='form-control chosen'");?>
<?php echo html::input('teamMember', '', "class='form-control team-group fix-border hidden' readonly='readonly'");?>
<span class="input-group-addon team-group hidden" data-toggle='modalTeam'><?php echo $lang->task->team;?></span>
<label class='input-group-addon affair'><input type='checkBox' name='multiple' id="multipleBox" value='1'/><?php echo $lang->task->multipleAB;?></label>
<label class='input-group-addon affair'><input type='checkBox' name='multiple' id="multipleBox" value='1'/> <?php echo $lang->task->multipleAB;?></label>
</div>
</td>
<td>
@@ -90,7 +90,7 @@
$hasCustomPri = false;
foreach($lang->task->priList as $priKey => $priValue)
{
if(!empty($priKey) and ($priKey != $priValue or strlen($priKey) != strlen($priValue)))
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
$hasCustomPri = true;
break;
+1 -1
View File
@@ -101,7 +101,7 @@
$hasCustomPri = false;
foreach($lang->testcase->priList as $priKey => $priValue)
{
if(!empty($priKey) and ($priKey != $priValue or strlen($priKey) != strlen($priValue)))
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
$hasCustomPri = true;
break;
+1 -1
View File
@@ -78,7 +78,7 @@
$hasCustomPri = false;
foreach($lang->testcase->priList as $priKey => $priValue)
{
if(!empty($priKey) and ($priKey != $priValue or strlen($priKey) != strlen($priValue)))
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
$hasCustomPri = true;
break;
+2
View File
@@ -16,3 +16,5 @@ $config->webhook->objectTypes['bug'] = array('opened', 'edited', 'commen
$config->webhook->objectTypes['case'] = array('opened', 'edited', 'commented', 'reviewed', 'confirmed');
$config->webhook->objectTypes['testtask'] = array('opened', 'edited', 'started', 'blocked', 'closed', 'activated');
$config->webhook->objectTypes['todo'] = array('opened', 'edited');
$config->webhook->needAssignTypes = array('story', 'task', 'bug', 'todo');
+8 -5
View File
@@ -227,13 +227,16 @@ class webhookModel extends model
$mobile = '';
$email = '';
foreach($users as $user)
if(in_array($objectType, $this->config->webhook->needAssignTypes) && !empty($object->assignedTo))
{
if($user->account == $object->assignedTo)
foreach($users as $user)
{
$mobile = $user->mobile;
$email = $user->email;
break;
if($user->account == $object->assignedTo)
{
$mobile = $user->mobile;
$email = $user->email;
break;
}
}
}
$action->text = $text;