Merge branch 'sprint/229' into 'master'

Sprint/229

See merge request easycorp/zentaopms!5018
This commit is contained in:
王怡栋
2022-08-19 00:50:35 +00:00
24 changed files with 271 additions and 150 deletions
+3 -2
View File
@@ -3,6 +3,7 @@
.file-input .file-editbox{max-width:40%;}
.file-input-list .input-group-btn{float:left}
.fileAction {color: #0c64eb !important;}
.backgroundColor {background: #eff5ff; }
</style>
<?php js::set('dangerExtensions', ',' . $this->config->file->dangers . ',');?>
<?php js::set('maxUploadSize', $maxUploadSize);?>
@@ -26,8 +27,8 @@
<small class="file-size muted"></small>
</div>
<div class="input-group-btn">
<button type="button" class="fileAction btn btn-link file-input-rename"><?php echo $lang->file->edit;?></button>
<button type="button" class="fileAction btn btn-link file-input-delete"><?php echo $lang->delete;?></button>
<button type="button" class="fileAction btn btn-link file-input-rename" title="<?php echo $lang->file->edit;?>"><i class='icon icon-pencil-alt'></i></button>
<button type="button" class="fileAction btn btn-link file-input-delete" title="<?php echo $lang->delete;?>"><i class='icon icon-trash'></i></button>
</div>
</div>
<input type="file" name="<?php echo $filesName;?>[]" onchange="checkDangerExtension(this)" />
+132 -115
View File
@@ -5,122 +5,139 @@
<div class="detail-title"><?php echo $lang->file->common;?> <i class="icon icon-paper-clip icon-sm"></i></div>
<div class="detail-content">
<?php endif;?>
<style>
.file {padding-top: 2px;}
.files-list>li>a {display: inline; word-wrap: break-word;}
.files-list>li>.right-icon {opacity: 1;}
.fileAction {color: #0c64eb !important;}
.renameFile {display: flex;}
.renameFile .input-group {margin-left: 10px;}
.renameFile .icon {margin-top: 8px;}
.renameFile .input-group-addon {width: 60px;}
</style>
<script>
/**
* Delete a file.
*
* @param int $fileID
* @access public
* @return void
*/
function deleteFile(fileID)
{
if(!fileID) return;
hiddenwin.location.href = createLink('file', 'delete', 'fileID=' + fileID);
}
<style>
.file {padding-top: 2px;}
.files-list>li>a {display: inline; word-wrap: break-word;}
.files-list>li>.right-icon {opacity: 1;}
.fileAction {color: #0c64eb !important;}
.renameFile {display: flex;}
.renameFile .input-group {margin-left: 10px;}
.renameFile .icon {margin-top: 8px;}
.renameFile .input-group-addon {width: 60px;}
.backgroundColor {background: #eff5ff; }
.icon.icon-file-text {margin-left: 4px;}
</style>
<script>
$(document).ready(function()
{
$('li.file').mouseover(function()
{
$(this).children('span.right-icon').removeClass("hidden");
$(this).addClass('backgroundColor');
});
/**
* Download a file, append the mouse to the link. Thus we call decide to open the file in browser no download it.
*
* @param int $fileID
* @param int $extension
* @param int $imageWidth
* @param string $fileTitle
* @access public
* @return void
*/
function downloadFile(fileID, extension, imageWidth, fileTitle)
{
if(!fileID) return;
var fileTypes = 'txt,jpg,jpeg,gif,png,bmp';
var windowWidth = $(window).width();
var width = (windowWidth > imageWidth) ? ((imageWidth < windowWidth * 0.5) ? windowWidth * 0.5 : imageWidth) : windowWidth;
var checkExtension = fileTitle.lastIndexOf('.' + extension) == (fileTitle.length - extension.length - 1);
$('li.file').mouseout(function()
{
$(this).children('span.right-icon').addClass("hidden");
$(this).removeClass('backgroundColor');
});
});
var url = createLink('file', 'download', 'fileID=' + fileID + '&mouse=left');
url += url.indexOf('?') >= 0 ? '&' : '?';
url += '<?php echo $sessionString;?>';
/**
* Delete a file.
*
* @param int $fileID
* @access public
* @return void
*/
function deleteFile(fileID)
{
if(!fileID) return;
hiddenwin.location.href = createLink('file', 'delete', 'fileID=' + fileID);
}
if(fileTypes.indexOf(extension) >= 0 && checkExtension && config.onlybody != 'yes')
{
$('<a>').modalTrigger({url: url, type: 'iframe', width: width}).trigger('click');
}
else
{
url = url.replace('?onlybody=yes&', '?');
url = url.replace('?onlybody=yes', '?');
url = url.replace('&onlybody=yes', '');
/**
* Download a file, append the mouse to the link. Thus we call decide to open the file in browser no download it.
*
* @param int $fileID
* @param int $extension
* @param int $imageWidth
* @param string $fileTitle
* @access public
* @return void
*/
function downloadFile(fileID, extension, imageWidth, fileTitle)
{
if(!fileID) return;
var fileTypes = 'txt,jpg,jpeg,gif,png,bmp';
var windowWidth = $(window).width();
var width = (windowWidth > imageWidth) ? ((imageWidth < windowWidth * 0.5) ? windowWidth * 0.5 : imageWidth) : windowWidth;
var checkExtension = fileTitle.lastIndexOf('.' + extension) == (fileTitle.length - extension.length - 1);
window.open(url, '_blank');
}
return false;
}
var url = createLink('file', 'download', 'fileID=' + fileID + '&mouse=left');
url += url.indexOf('?') >= 0 ? '&' : '?';
url += '<?php echo $sessionString;?>';
/* Show edit box for editing file name. */
/**
* Show edit box for editing file name.
*
* @param int $fileID
* @access public
* @return void
*/
function showRenameBox(fileID)
{
$('#renameFile' + fileID).closest('li').addClass('hidden');
$('#renameBox' + fileID).removeClass('hidden');
}
if(fileTypes.indexOf(extension) >= 0 && checkExtension && config.onlybody != 'yes')
{
$('<a>').modalTrigger({url: url, type: 'iframe', width: width}).trigger('click');
}
else
{
url = url.replace('?onlybody=yes&', '?');
url = url.replace('?onlybody=yes', '?');
url = url.replace('&onlybody=yes', '');
/**
* Show File.
*
* @param int $fileID
* @access public
* @return void
*/
function showFile(fileID)
{
$('#renameBox' + fileID).addClass('hidden');
$('#renameFile' + fileID).closest('li').removeClass('hidden');
}
window.open(url, '_blank');
}
return false;
}
/**
* Smooth refresh file name.
*
* @param int $fileID
* @access public
* @return void
*/
function setFileName(fileID)
{
var fileName = $('#fileName' + fileID).val();
var extension = $('#extension' + fileID).val();
var postData = {'fileName' : fileName, 'extension' : extension};
$('#renameBox' + fileID ).addClass('hidden');
$.ajax(
{
url:createLink('file', 'edit', 'fileID=' + fileID),
dataType: 'json',
method: 'post',
data: postData,
success: function(data)
{
$('#fileTitle' + fileID).html("<i class='icon icon-file-text'></i> &nbsp;" + data['title']);
$('#renameFile' + fileID).closest('li').removeClass('hidden');
$('#renameBox' + fileID).addClass('hidden');
}
})
}
</script>
/* Show edit box for editing file name. */
/**
* Show edit box for editing file name.
*
* @param int $fileID
* @access public
* @return void
*/
function showRenameBox(fileID)
{
$('#renameFile' + fileID).closest('li').addClass('hidden');
$('#renameBox' + fileID).removeClass('hidden');
}
/**
* Show File.
*
* @param int $fileID
* @access public
* @return void
*/
function showFile(fileID)
{
$('#renameBox' + fileID).addClass('hidden');
$('#renameFile' + fileID).closest('li').removeClass('hidden');
}
/**
* Smooth refresh file name.
*
* @param int $fileID
* @access public
* @return void
*/
function setFileName(fileID)
{
var fileName = $('#fileName' + fileID).val();
var extension = $('#extension' + fileID).val();
var postData = {'fileName' : fileName, 'extension' : extension};
$('#renameBox' + fileID ).addClass('hidden');
$.ajax(
{
url:createLink('file', 'edit', 'fileID=' + fileID),
dataType: 'json',
method: 'post',
data: postData,
success: function(data)
{
$('#fileTitle' + fileID).html("<i class='icon icon-file-text'></i> &nbsp;" + data['title']);
$('#renameFile' + fileID).closest('li').removeClass('hidden');
$('#renameBox' + fileID).addClass('hidden');
}
})
}
</script>
<ul class="files-list">
<?php foreach($files as $file):?>
<?php if(common::hasPriv('file', 'download')):?>
@@ -165,7 +182,7 @@
$objectType = zget($this->config->file->objectType, $file->objectType);
if(common::hasPriv($objectType, 'edit', $object))
{
echo "<span class='right-icon'>&nbsp; ";
echo "<span class='right-icon hidden'>&nbsp; ";
/* Determines whether the file supports preview. */
if($file->extension == 'txt')
@@ -179,7 +196,7 @@
/* For the open source version of the file judgment. */
if(stripos('txt|jpg|jpeg|gif|png|bmp', $file->extension) !== false)
{
echo html::a($downloadLink, $lang->file->preview, '_blank', "class='fileAction btn btn-link text-primary' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\"");
echo html::a($downloadLink, "<i class='icon icon-eye'></i>", '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->preview}' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\"");
}
/* For the max version of the file judgment. */
@@ -188,13 +205,13 @@
$officeTypes = 'doc|docx|xls|xlsx|ppt|pptx|pdf';
if(stripos($officeTypes, $file->extension) !== false)
{
echo html::a($downloadLink, $lang->file->preview, '_blank', "class='fileAction btn btn-link text-primary' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\"");
echo html::a($downloadLink, "<i class='icon icon-eye'></i>", '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->preview}' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\"");
}
}
common::printLink('file', 'download', "fileID=$file->id", $lang->file->downloadFile, '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'");
if(common::hasPriv('file', 'edit')) echo html::a('###', $lang->file->edit, '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'");
if(common::hasPriv('file', 'delete')) echo html::a('###', $lang->delete, '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id)' title='$lang->delete'");
common::printLink('file', 'download', "fileID=$file->id", "<i class='icon icon-download'></i>", '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'");
if(common::hasPriv('file', 'edit')) echo html::a('###', "<i class='icon icon-pencil-alt'></i>", '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'");
if(common::hasPriv('file', 'delete')) echo html::a('###', "<i class='icon icon-trash'></i>", '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id)' title='$lang->delete'");
echo '</span>';
}
echo '</li>';?>
+2
View File
@@ -1,3 +1,5 @@
.future {display: inline-block;}
.c-number {overflow: hidden; text-align: right !important; text-overflow: ellipsis; white-space: nowrap;}
.text-remind {color: #ffa34d;}
.text-remind p{float: left; margin-right: 5px;}
#ignore {text-decoration: underline; cursor: pointer; color: #ef7b0f;}
+33 -7
View File
@@ -1,3 +1,8 @@
window.ignoreTips = {
'beyondBudgetTip' : false,
'dateTip' : false
};
/**
* Access rights are equal to private, and the white list settings are displayed.
*
@@ -331,6 +336,7 @@ function setBudgetTipsAndAclList(parentID)
*/
function compareChildDate()
{
if(window.ignoreTips['dateTip']) return;
if(page == 'create') return;
var end = $('#end').val();
@@ -356,15 +362,15 @@ function compareChildDate()
var dateTip = '';
if(programBegin > childBegin && programEnd >= childEnd)
{
dateTip = "<span id='dateTip' class='text-remind'>" + beginGreateChild + childInfo.minChildBegin + "</span>";
dateTip = "<span id='dateTip' class='text-remind'><p>" + beginGreateChild + childInfo.minChildBegin + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>";
}
else if(programEnd < childEnd && programBegin <= childBegin)
{
dateTip = "<span id='dateTip' class='text-remind'>" + endLetterChild + childInfo.maxChildEnd + "</span>";
dateTip = "<span id='dateTip' class='text-remind'><p>" + endLetterChild + childInfo.maxChildEnd + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>";
}
else
{
dateTip = "<span id='dateTip' class='text-remind'>" + dateExceedChild + childInfo.minChildBegin + "~" + childInfo.maxChildEnd + "</span>";
dateTip = "<span id='dateTip' class='text-remind'><p>" + dateExceedChild + childInfo.minChildBegin + "~" + childInfo.maxChildEnd + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>";
}
$('#dateBox').after(dateTip);
@@ -380,6 +386,8 @@ function compareChildDate()
*/
function outOfDateTip()
{
if(window.ignoreTips['dateTip']) return;
var end = $('#end').val();
var begin = $('#begin').val();
if($('#dateTip').length > 0) $('#dateTip').remove();
@@ -413,15 +421,15 @@ function outOfDateTip()
if(programBegin < parentBegin && programEnd <= parentEnd && programEnd >= parentBegin)
{
dateTip = "<span id='dateTip' class='text-remind'>" + beginLetterParent + data.selectedProgramBegin + "</span>";
dateTip = "<span id='dateTip' class='text-remind'><p>" + beginLetterParent + data.selectedProgramBegin + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>";
}
else if(programEnd > parentEnd && programBegin >= parentBegin && programBegin <= parentEnd)
{
dateTip = "<span id='dateTip' class='text-remind'>" + endGreaterParent + data.selectedProgramEnd + "</span>";
dateTip = "<span id='dateTip' class='text-remind'><p>" + endGreaterParent + data.selectedProgramEnd + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>";
}
else
{
dateTip = "<span id='dateTip' class='text-remind'>" + dateExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd + "</span>";
dateTip = "<span id='dateTip' class='text-remind'><p>" + dateExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>";
}
$('#dateBox').after(dateTip);
@@ -437,6 +445,8 @@ function outOfDateTip()
*/
function budgetOverrunTips()
{
if(window.ignoreTips['beyondBudgetTip']) return;
var selectedProgramID = $('#parent').val();
var budget = $('#budget').val();
if(selectedProgramID == 0)
@@ -451,8 +461,24 @@ function budgetOverrunTips()
var data = JSON.parse(data);
var tip = "";
if(budget !=0 && budget !== null && budget > data.availableBudget) var tip = "<span id='beyondBudgetTip' class='text-remind'>" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget + "</span>"
if(budget !=0 && budget !== null && budget > data.availableBudget) var tip = "<span id='beyondBudgetTip' class='text-remind'><p>" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>"
if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove();
$('#budgetBox').after(tip);
});
}
/**
* Make this prompt no longer appear.
*
* @param string $obj
* @access public
* @return void
*/
function ignoreTip(obj)
{
var parentID = obj.parentNode.id;
$('#' + parentID).addClass('hidden');
if(parentID == 'dateTip') window.ignoreTips['dateTip'] = true;
if(parentID == 'beyondBudgetTip') window.ignoreTips['beyondBudgetTip'] = true;
}
+1
View File
@@ -48,6 +48,7 @@ $lang->program->openedVersion = 'OpenedVersion';
$lang->program->lastEditedBy = 'LastEditedBy';
$lang->program->lastEditedDate = 'LastEditedDate';
$lang->program->childProgram = 'Child Program';
$lang->program->ignore = 'Ignore';
/* Actions. */
$lang->program->common = 'Program';
+1
View File
@@ -48,6 +48,7 @@ $lang->program->openedVersion = 'OpenedVersion';
$lang->program->lastEditedBy = 'LastEditedBy';
$lang->program->lastEditedDate = 'LastEditedDate';
$lang->program->childProgram = 'Child Program';
$lang->program->ignore = 'Ignore';
/* Actions. */
$lang->program->common = 'Program';
+1
View File
@@ -48,6 +48,7 @@ $lang->program->openedVersion = 'OpenedVersion';
$lang->program->lastEditedBy = 'LastEditedBy';
$lang->program->lastEditedDate = 'LastEditedDate';
$lang->program->childProgram = 'sous-programme';
$lang->program->ignore = 'Ignorer';
/* Actions. */
$lang->program->common = 'Program';
+1
View File
@@ -48,6 +48,7 @@ $lang->program->openedVersion = '创建版本';
$lang->program->lastEditedBy = '最后编辑人';
$lang->program->lastEditedDate = '最后编辑日期';
$lang->program->childProgram = '子项目集';
$lang->program->ignore = '忽略';
/* Actions. */
$lang->program->common = '项目集';
+1
View File
@@ -46,6 +46,7 @@
<?php js::set('beginLetterParent', $lang->program->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->program->endGreaterParent);?>
<?php js::set('dateExceedParent', $lang->program->dateExceedParent);?>
<?php js::set('ignore', $lang->program->ignore);?>
<?php js::set('page', $this->app->getMethodName());?>
<?php $aclList = $parentProgram ? $lang->program->subAclList : $lang->program->aclList;?>
<?php $requiredFields = $config->program->create->requiredFields;?>
+1
View File
@@ -36,6 +36,7 @@
<?php js::set('beginGreateChild', $lang->program->beginGreateChild);?>
<?php js::set('endLetterChild', $lang->program->endLetterChild);?>
<?php js::set('dateExceedChild', $lang->program->dateExceedChild);?>
<?php js::set('ignore', $lang->program->ignore);?>
<?php $aclList = $program->parent ? $lang->program->subAclList : $lang->program->aclList;?>
<?php $requiredFields = $config->program->edit->requiredFields;?>
<div id='mainContent' class='main-content'>
+1
View File
@@ -4,3 +4,4 @@
.c-name {width: 180px;}
.c-code {width: 160px;}
.c-acl {width: 125px;}
#dateTip {padding: 0 7px;}
+2
View File
@@ -1,4 +1,6 @@
.future {display: inline-block;}
.c-number {overflow: hidden; text-align: right !important;text-overflow: ellipsis; white-space: nowrap;}
.text-remind {color: #ffa34d;}
.text-remind p{float: left; margin-right: 5px;}
#ignore {text-decoration: underline; cursor: pointer; color: #ef7b0f;}
td.delayed {color: #fff; background: #e84e0f !important;}
+49 -11
View File
@@ -1,3 +1,8 @@
window.ignoreTips = {
'beyondBudgetTip' : false,
'dateTip' : false
};
/**
* Access rights are equal to private, and the white list settings are displayed.
*
@@ -95,7 +100,7 @@ function computeWorkDays(currentID)
{
computeEndDate();
}
outOfDateTip();
outOfDateTip(isBactchEdit ? index : 0);
}
/**
@@ -328,6 +333,8 @@ $(document).on('change', "#plansBox select[name^='plans']", function()
*/
function budgetOverrunTips()
{
if(window.ignoreTips['beyondBudgetTip']) return;
var selectedProgramID = $('#parent').val();
var budget = $('#budget').val();
@@ -344,7 +351,7 @@ function budgetOverrunTips()
if(typeof(data.availableBudget) == 'undefined') return;
var tip = "";
if(budget != 0 && budget !== null && budget > data.availableBudget) tip = "<span id='beyondBudgetTip' class='text-remind'>" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget.toFixed(2) + "</span>"
if(budget != 0 && budget !== null && budget > data.availableBudget) tip = "<span id='beyondBudgetTip' class='text-remind'><p>" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget.toFixed(2) + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>"
if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove();
$('#budgetBox').after(tip);
@@ -358,23 +365,27 @@ function budgetOverrunTips()
/**
*The date is out of the range of the parent project set, and a prompt is given.
*
* @param int $currentID
* @access public
* @return void
*/
function outOfDateTip()
function outOfDateTip(currentID = 0)
{
var end = $('#end').val();
var begin = $('#begin').val();
if($('#dateTip').length > 0) $('#dateTip').remove();
if(window.ignoreTips['dateTip']) return;
var end = currentID ? $('#ends\\[' + currentID + '\\]').val() : $('#end').val();
var begin = currentID ? $('#begins\\[' + currentID + '\\]').val() : $('#begin').val();
if($('#dateTip.text-remind').length > 0) $('#dateTip').remove();
if(currentID) $('#dateTip\\[' + currentID + '\\]').remove();
if(end == longTime) end = LONG_TIME;
if(end.length > 0 && begin.length > 0)
{
var selectedProgramID = $('#parent').val();
var selectedProgramID = currentID ? $("select[name='parents\[" + currentID + "\]']").val() : $('#parent').val();
if(selectedProgramID == 0) return;
if(typeof(projectID) == 'undefined') projectID = 0;
projectID = currentID ? $('#projectIdList\\['+ currentID + '\\]').val() : projectID;
$.get(createLink('project', 'ajaxGetObjectInfo', 'objectType=project&objectID=' + projectID + '&selectedProgramID=' + selectedProgramID), function(data)
{
var data = JSON.parse(data);
@@ -383,23 +394,50 @@ function outOfDateTip()
var projectEnd = new Date(end);
var projectBegin = new Date(begin);
var beginLetterParentTip = beginLetterParent + data.selectedProgramBegin;
var endGreaterParentTip = endGreaterParent + data.selectedProgramEnd;
var dateExceedParentTip = dateExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd;
if(projectBegin >= parentBegin && projectEnd <= parentEnd) return;
var dateTip = "";
if(projectBegin < parentBegin && projectEnd <= parentEnd && projectEnd >= parentBegin)
{
dateTip = "<span id='dateTip' class='text-remind'>" + beginLetterParent + data.selectedProgramBegin + "</span>";
dateTip = currentID ? beginLetterParentTip + "'>" + beginLetterParentTip : beginLetterParentTip;
}
else if(projectEnd > parentEnd && projectBegin >= parentBegin && projectBegin <= parentEnd)
{
dateTip = "<span id='dateTip' class='text-remind'>" + endGreaterParent + data.selectedProgramEnd + "</span>";
dateTip = currentID ? endGreaterParentTip + "'>" + endGreaterParentTip : endGreaterParentTip;
}
else
{
dateTip = "<span id='dateTip' class='text-remind'>" + dateExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd + "</span>";
dateTip = currentID ? dateExceedParentTip + "'>" + dateExceedParentTip : dateExceedParentTip;
}
$('#dateBox').after(dateTip);
if(currentID)
{
$("#projects\\[" + currentID + "\\]").after("<tr id='dateTip[" + currentID + "]'><td colspan='5'></td><td id='dateTip' class='c-name' colspan='3'><span class='text-remind' title='" + dateTip + "</span></td></tr>");
}
else
{
$('#dateBox').after("<span id='dateTip' class='text-remind'><p>" + dateTip + "</p><p id='ignore' onclick='ignoreTip(this)'>" + ignore + "</p></span>");
}
});
}
}
/**
* Make this prompt no longer appear.
*
* @param string $obj
* @access public
* @return void
*/
function ignoreTip(obj)
{
var parentID = obj.parentNode.id;
$('#' + parentID).addClass('hidden');
if(parentID == 'dateTip') window.ignoreTips['dateTip'] = true;
if(parentID == 'beyondBudgetTip') window.ignoreTips['beyondBudgetTip'] = true;
}
+1
View File
@@ -63,6 +63,7 @@ $lang->project->teamMembersCount = ', there are %s team members.';
$lang->project->budgetNumber = '『Budget』must be numbers.';
$lang->project->budgetGe0 = '『Budget』must be greater than or equal to 0.';
$lang->project->allProjects = 'All Projects';
$lang->project->ignore = 'Ignore';
/* Fields. */
$lang->project->common = 'Project';
+2 -1
View File
@@ -63,6 +63,7 @@ $lang->project->teamMembersCount = ', there are %s team members.';
$lang->project->budgetNumber = '『Budget』must be numbers.';
$lang->project->budgetGe0 = '『Budget』must be greater than or equal to 0.';
$lang->project->allProjects = 'All Projects';
$lang->project->ignore = 'Ignore';
/* Fields. */
$lang->project->common = 'Project';
@@ -332,4 +333,4 @@ $lang->project->childLongTime = "There are long-term projects in the child
$lang->project->confirmUnlinkMember = "Do you want to remove this user from project?";
$lang->project->action = new stdclass();
$lang->project->action->managed = '$date, managed by <strong>$actor</strong>. $extra' . "\n";
$lang->project->action->managed = '$date, managed by <strong>$actor</strong>. $extra' . "\n";
+1
View File
@@ -63,6 +63,7 @@ $lang->project->teamMembersCount = ', there are %s team members.';
$lang->project->budgetNumber = '『Budget』must be numbers.';
$lang->project->budgetGe0 = '『Budget』must be greater than or equal to 0.';
$lang->project->allProjects = 'All Projects';
$lang->project->ignore = 'Ignorer';
/* Fields. */
$lang->project->common = 'Projets';
+1
View File
@@ -63,6 +63,7 @@ $lang->project->teamMembersCount = ',团队成员共%s人。';
$lang->project->budgetNumber = '『预算』金额必须为数字。';
$lang->project->budgetGe0 = '『预算』金额必须大于等于0。';
$lang->project->allProjects = '所有项目';
$lang->project->ignore = '忽略';
/* Fields. */
$lang->project->common = '项目';
+9 -3
View File
@@ -14,6 +14,12 @@
<?php js::set('weekend', $config->execution->weekend);?>
<?php js::set('linkedProjectsTip', $lang->project->linkedProjectsTip);?>
<?php js::set('changeProgram', $lang->project->changeProgram);?>
<?php js::set('beginLetterParent', $lang->project->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->project->endGreaterParent);?>
<?php js::set('dateExceedParent', $lang->project->dateExceedParent);?>
<?php js::set('LONG_TIME', LONG_TIME);?>
<?php js::set('longTime', $lang->project->longTime);?>
<?php js::set('ignore', $lang->project->ignore);?>
<?php $requiredFields = $config->project->edit->requiredFields;?>
<div id="mainContent" class="main-content">
<div class="main-header">
@@ -42,15 +48,15 @@
<tbody>
<?php foreach($projects as $projectID => $project):?>
<?php $aclList = $project->parent ? $lang->program->subAcls : $lang->project->acls;?>
<tr>
<tr id="projects[<?php echo $projectID;?>]">
<td><?php echo sprintf('%03d', $projectID) . html::hidden("projectIdList[$projectID]", $projectID);?></td>
<?php if(isset($unauthorizedPrograms[$project->parent])):?>
<td>
<?php echo html::select("parents[$projectID]", $unauthorizedPrograms, $project->parent, "class='form-control chosen' data-id='$projectID' data-name='{$project->name}' data-parent='{$project->parent}' disabled");?>
<?php echo html::select("parents[$projectID]", $unauthorizedPrograms, $project->parent, "class='form-control chosen' onchange='outOfDateTip($projectID)' data-id='$projectID' data-name='{$project->name}' data-parent='{$project->parent}' disabled");?>
<?php echo html::hidden("parents[$projectID]", $project->parent);?>
</td>
<?php else:?>
<td><?php echo html::select("parents[$projectID]", $programs, $project->parent, "class='form-control chosen' data-id='$projectID' data-name='{$project->name}' data-parent='{$project->parent}'");?></td>
<td><?php echo html::select("parents[$projectID]", $programs, $project->parent, "class='form-control chosen' onchange='outOfDateTip($projectID)' data-id='$projectID' data-name='{$project->name}' data-parent='{$project->parent}'");?></td>
<?php endif;?>
<td title='<?php echo $project->name;?>'><?php echo html::input("names[$projectID]", $project->name, "class='form-control'");?></td>
<?php if(!isset($config->setCode) or $config->setCode == 1):?>
+2 -1
View File
@@ -33,6 +33,7 @@
<?php js::set('beginLetterParent', $lang->project->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->project->endGreaterParent);?>
<?php js::set('dateExceedParent', $lang->project->dateExceedParent);?>
<?php js::set('ignore', $lang->project->ignore);?>
<?php $requiredFields = $config->project->create->requiredFields;?>
<?php js::set('requiredFields', $requiredFields);?>
<div id='mainContent' class='main-content'>
@@ -46,7 +47,7 @@
<button type='button' class='btn btn-link' data-toggle='modal' data-target='#copyProjectModal'><?php echo html::icon($lang->icons['copy'], 'muted') . ' ' . $lang->project->copy;?></button>
<?php else: ?>
<button type='button' class='btn btn-link open-btn' data-toggle='modal' data-target='#maxCopyProjectModal'><?php echo html::icon($lang->icons['copy'], 'muted') . ' ' . $lang->project->copy;?></button>
<?php endif; ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
+1
View File
@@ -37,6 +37,7 @@
<?php js::set('beginLetterParent', $lang->project->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->project->endGreaterParent);?>
<?php js::set('dateExceedParent', $lang->project->dateExceedParent);?>
<?php js::set('ignore', $lang->project->ignore);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
+1
View File
@@ -472,6 +472,7 @@ class task extends control
$position[] = $this->lang->task->batchCreate;
if($taskID) $this->view->parentTitle = $this->dao->select('name')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch('name');
if($taskID) $this->view->parentPri = $this->dao->select('pri')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch('pri');
$this->view->title = $title;
$this->view->position = $position;
+14 -6
View File
@@ -89,7 +89,7 @@ class taskModel extends model
->cleanINT('execution,story,module')
->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags)
->join('mailto', ',')
->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams,contactListMenu,selectTestStory,testStory,testPri,testEstStarted,testDeadline,testAssignedTo,testEstimate,sync,otherLane,region,lane')
->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams,contactListMenu,selectTestStory,testStory,testPri,testEstStarted,testDeadline,testAssignedTo,testEstimate,sync,otherLane,region,lane,estStartedDitto,deadlineDitto')
->add('version', 1)
->get();
@@ -177,6 +177,10 @@ class taskModel extends model
$this->loadModel('action');
if($this->post->testStory)
{
$assignedTo = '';
$testEstStarted = '0000-00-00';
$testDeadline = '0000-00-00';
foreach($this->post->testStory as $storyID)
{
if($storyID) $testStoryIdList[$storyID] = $storyID;
@@ -186,14 +190,18 @@ class taskModel extends model
{
if(!isset($testStories[$storyID])) continue;
$assignedTo = (!isset($this->post->testAssignedTo[$i]) or $this->post->testAssignedTo[$i] == 'ditto') ? $assignedTo : $this->post->testAssignedTo[$i];
$testEstStarted = (!isset($this->post->testEstStarted[$i]) or (isset($this->post->estStartedDitto[$i]) and $this->post->estStartedDitto[$i] == 'on')) ? $testEstStarted : $this->post->testEstStarted[$i];
$testDeadline = (!isset($this->post->testDeadline[$i]) or (isset($this->post->deadlineDitto[$i]) and $this->post->deadlineDitto[$i] == 'on')) ? $testDeadline : $this->post->testDeadline[$i];
$task->parent = $taskID;
$task->story = $storyID;
$task->storyVersion = $testStories[$storyID]->version;
$task->name = $this->lang->task->lblTestStory . " #{$storyID} " . $testStories[$storyID]->title;
$task->pri = $this->post->testPri[$i];
$task->estStarted = $this->post->testEstStarted[$i];
$task->deadline = $this->post->testDeadline[$i];
$task->assignedTo = $this->post->testAssignedTo[$i];
$task->estStarted = $testEstStarted;
$task->deadline = $testDeadline;
$task->assignedTo = $assignedTo;
$task->estimate = $this->post->testEstimate[$i];
$task->left = $this->post->testEstimate[$i];
$task->module = $testStories[$storyID]->module;
@@ -3947,9 +3955,9 @@ class taskModel extends model
{
$this->updateExecutionEsDateByGantt($objectID, $objectType, $post);
}
if(dao::isError()) return false;
$newObject = $this->dao->select('*')->from($changeTable)->where('id')->eq($objectID)->fetch();
$changes = common::createChanges($oldObject, $newObject);
$actionID = $this->loadModel('action')->create($actionType, $objectID, 'edited');
+1 -1
View File
@@ -114,7 +114,7 @@ $colspan = count($visibleFields) + 3;
$currentStory = $type = $member = $moduleID = 'ditto';
}
?>
<?php $pri = 3;?>
<?php $pri = $parent ? $parentPri : 3;?>
<tr>
<td class='text-left c-id'><?php echo $i;?></td>
<td class="<?php echo zget($visibleFields, 'module', 'hidden')?> moduleBox" style='overflow:visible'>
+10 -3
View File
@@ -135,18 +135,25 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
<tbody>
<?php $i = 0;?>
<?php foreach($stories as $storyID => $storyTitle):?>
<?php if($i > 0) $members['ditto'] = $lang->task->ditto;?>
<?php if(empty($storyID) or isset($testStoryIdList[$storyID])) continue;?>
<tr>
<td><?php echo html::select("testStory[]", array($storyID => $storyTitle), $storyID, "class='form-control chosen'");?></td>
<td><?php echo html::select("testPri[]", $lang->task->priList, $task->pri, "class='form-control chosen'");?></td>
<td>
<div class='input-group'>
<?php echo html::input("testEstStarted[]", $task->estStarted, "class='form-control form-date' placeholder='{$lang->task->estStarted}'");?>
<?php
echo html::input("testEstStarted[]", $task->estStarted, "class='form-control form-date' placeholder='{$lang->task->estStarted}'");
if($i != 0) echo "<span class='input-group-addon estStartedBox'><input type='checkbox' name='estStartedDitto[$i]' id='estStartedDitto$i' " . ($i > 0 ? "checked" : '') . " /> {$lang->task->ditto}</span>";
?>
<span class='input-group-addon fix-border'>~</span>
<?php echo html::input("testDeadline[]", $task->deadline, "class='form-control form-date' placeholder='{$lang->task->deadline}'");?>
<?php
echo html::input("testDeadline[]", $task->deadline, "class='form-control form-date' placeholder='{$lang->task->deadline}'");
if($i != 0) echo "<span class='input-group-addon deadlineBox'><input type='checkbox' name='deadlineDitto[$i]' id='deadlineDitto$i' " . ($i > 0 ? "checked" : '') . " /> {$lang->task->ditto}</span>";
?>
</div>
</td>
<td><?php echo html::select("testAssignedTo[]", $members, $task->assignedTo, "class='form-control chosen'");?></td>
<td><?php echo html::select("testAssignedTo[]", $members, $i == 0 ? $task->assignedTo : 'ditto', "class='form-control chosen'");?></td>
<td><?php echo html::input("testEstimate[]", '', "class='form-control'");?></td>
<td class='text-center'>
<div class="btn-group">