Merge branch '15.5' of https://gitlab.zcorp.cc/easycorp/zentaopms into 15.5
This commit is contained in:
@@ -7,8 +7,5 @@ $(function()
|
||||
{
|
||||
$("#sidebarHeader").toggle("fast");
|
||||
});
|
||||
if($("main").is(".hide-sidebar"))
|
||||
{
|
||||
$("#sidebarHeader").hide();
|
||||
}
|
||||
if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
|
||||
});
|
||||
|
||||
@@ -28,8 +28,5 @@ $(function()
|
||||
{
|
||||
$("#sidebarHeader").toggle("fast");
|
||||
});
|
||||
if($("main").is(".hide-sidebar"))
|
||||
{
|
||||
$("#sidebarHeader").hide();
|
||||
}
|
||||
if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
|
||||
});
|
||||
@@ -20,10 +20,7 @@ $(function()
|
||||
{
|
||||
$("#sidebarHeader").toggle("fast");
|
||||
});
|
||||
if($("main").is(".hide-sidebar"))
|
||||
{
|
||||
$("#sidebarHeader").hide();
|
||||
}
|
||||
if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
|
||||
});
|
||||
|
||||
$('#module' + moduleID).closest('li').addClass('active');
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
.file-input-list .input-group-btn{float:left}
|
||||
</style>
|
||||
<?php js::set('dangerExtensions', ',' . $this->config->file->dangers . ',');?>
|
||||
<?php js::set('maxUploadSize', $maxUploadSize);?>
|
||||
<div class="file-input-list" data-provide="fileInputList" data-each-file-max-size="<?php echo $maxUploadSize;?>" data-file-size-error="<?php echo sprintf($lang->file->errorFileSize, $maxUploadSize);?>">
|
||||
<div class="file-input">
|
||||
<div class="file-input-empty">
|
||||
@@ -32,11 +33,38 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function checkDangerExtension(obj)
|
||||
var totalSize = 0;
|
||||
maxUploadSize = unitConversion(maxUploadSize);
|
||||
|
||||
/**
|
||||
* Conversion unit to byte.
|
||||
*
|
||||
* @param string $maxUploadSize
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
function unitConversion(maxUploadSize)
|
||||
{
|
||||
var fileName = $(obj).val();
|
||||
var sizeOfString = maxUploadSize;
|
||||
if(sizeOfString.indexOf('K') != -1) maxUploadSize = parseFloat(maxUploadSize) * 1024;
|
||||
if(sizeOfString.indexOf('M') != -1) maxUploadSize = parseFloat(maxUploadSize) * 1024 * 1024;
|
||||
if(sizeOfString.indexOf('G') != -1) maxUploadSize = parseFloat(maxUploadSize) * 1024 * 1024 * 1024;
|
||||
return parseFloat(maxUploadSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check danger extension and file size.
|
||||
*
|
||||
* @param object $file
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function checkDangerExtension(file)
|
||||
{
|
||||
var fileName = $(file).val();
|
||||
var index = fileName.lastIndexOf(".");
|
||||
var fileSize = $(obj)[0].files[0].size;
|
||||
var fileSize = $(file)[0].files[0].size;
|
||||
totalSize += fileSize;
|
||||
|
||||
if(index >= 0)
|
||||
{
|
||||
@@ -44,14 +72,22 @@ function checkDangerExtension(obj)
|
||||
if(dangerExtensions.lastIndexOf(',' + extension + ',') >= 0)
|
||||
{
|
||||
alert(<?php echo json_encode($this->lang->file->dangerFile);?>);
|
||||
$(obj).val('');
|
||||
$(file).val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
if(fileSize == 0)
|
||||
{
|
||||
alert(<?php echo json_encode($this->lang->file->fileContentEmpty);?>);
|
||||
$(obj).val('');
|
||||
$(file).val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
if(totalSize >= maxUploadSize)
|
||||
{
|
||||
alert(<?php echo json_encode(sprintf($lang->file->errorFileSize, $maxUploadSize));?>);
|
||||
totalSize -= fileSize;
|
||||
$(file).val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,10 +110,7 @@ $(function()
|
||||
{
|
||||
$("#sidebarHeader").toggle("fast");
|
||||
});
|
||||
if($("main").is(".hide-sidebar"))
|
||||
{
|
||||
$("#sidebarHeader").hide();
|
||||
}
|
||||
if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
+13
-1
@@ -423,6 +423,18 @@ class task extends control
|
||||
$tasks = $this->task->getParentTaskPairs($this->view->execution->id, $this->view->task->parent);
|
||||
if(isset($tasks[$taskID])) unset($tasks[$taskID]);
|
||||
|
||||
if($this->config->systemMode == 'classic') $executionsPair = $this->execution->getPairs();
|
||||
else
|
||||
{
|
||||
$executionsPair = array();
|
||||
$executions = $this->execution->getByProject(0, 'all', 0);
|
||||
$projects = $this->project->getPairsByProgram(0, 'noclosed');
|
||||
foreach($executions as $executionId => $execution)
|
||||
{
|
||||
$executionsPair[$executionId] = (isset($projects[$execution->project]) ? $projects[$execution->project] . ' / ' : '') . $execution->name;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($this->view->members[$this->view->task->assignedTo])) $this->view->members[$this->view->task->assignedTo] = $this->view->task->assignedTo;
|
||||
if(isset($this->view->members['closed']) or $this->view->task->status == 'closed') $this->view->members['closed'] = 'Closed';
|
||||
|
||||
@@ -434,7 +446,7 @@ class task extends control
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nodeleted', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}");
|
||||
$this->view->showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : '';
|
||||
$this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->execution, 0, 0, $this->view->showAllModule ? 'allModule' : '');
|
||||
$this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject(0, 'all', 0, true);
|
||||
$this->view->executions = $executionsPair;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,5 @@ $(function()
|
||||
{
|
||||
$("#sidebarHeader").toggle("fast");
|
||||
});
|
||||
if($("main").is(".hide-sidebar"))
|
||||
{
|
||||
$("#sidebarHeader").hide();
|
||||
}
|
||||
if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user