Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?php if($config->visions == ',lite,'):?>
|
||||
<?php $feedbackDatasources = $this->dao->select('id')->from(TABLE_WORKFLOWDATASOURCE)->where('code')->like('litefeedback%')->andWhere('vision')->eq('lite')->fetchPairs('id', 'id');?>
|
||||
<?php if($feedbackDatasources):?>
|
||||
<script>
|
||||
<?php foreach($feedbackDatasources as $id):?>
|
||||
$('#fieldOptionType option[value=<?php echo $id;?>]').remove();
|
||||
<?php endforeach;?>
|
||||
$('#fieldOptionType').trigger("chosen:updated");
|
||||
</script>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
+14
-19
@@ -989,39 +989,43 @@ class actionModel extends model
|
||||
if($projectID == 'all') $authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? $this->app->user->view->projects : '0';
|
||||
if($executionID == 'all') $authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? $this->app->user->view->sprints : '0';
|
||||
|
||||
if(empty($authedProducts)) $authedProducts = '0';
|
||||
|
||||
if($productID == 'all' and $projectID == 'all')
|
||||
{
|
||||
$productCondition = '';
|
||||
foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'";
|
||||
foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "(execution = '0' and project = '0' and (product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'";
|
||||
$productCondition .= '))';
|
||||
|
||||
$projectCondition = "project " . helper::dbIN($authedProjects);
|
||||
$executionCondition = isset($authedExecutions) ? "execution " . helper::dbIN($authedExecutions) : '';
|
||||
$projectCondition = "(execution = '0' and project != '0' and project " . helper::dbIN($authedProjects) . ')';
|
||||
$executionCondition = isset($authedExecutions) ? "(execution != 0 and execution " . helper::dbIN($authedExecutions) . ')' : '';
|
||||
}
|
||||
elseif($productID == 'all' and is_numeric($projectID))
|
||||
{
|
||||
$products = $this->loadModel('product')->getProductPairsByProject($projectID);
|
||||
$executions = $this->loadModel('execution')->getPairs($projectID);
|
||||
$executions = $this->loadModel('execution')->getPairs($projectID) + array(0 => 0);
|
||||
|
||||
$authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions);
|
||||
|
||||
$productCondition = '';
|
||||
foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'";
|
||||
foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "(execution = '0' and project = '0' and (product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'";
|
||||
$productCondition .= '))';
|
||||
|
||||
$projectCondition = "project = $projectID";
|
||||
$executionCondition = "execution " . helper::dbIN($authedExecutions);
|
||||
$projectCondition = "(execution = '0' and project = '$projectID')";
|
||||
$executionCondition = "(execution != '0' and execution " . helper::dbIN($authedExecutions) . ')';
|
||||
}
|
||||
elseif(is_numeric($productID) and $projectID == 'all')
|
||||
{
|
||||
$this->loadModel('product');
|
||||
$projects = $this->product->getProjectPairsByProduct($productID);
|
||||
$executions = $this->product->getExecutionPairsByProduct($productID);
|
||||
$executions = $this->product->getExecutionPairsByProduct($productID) + array(0 => 0);
|
||||
|
||||
$authedProjects = array_intersect(array_keys($projects), explode(',', $authedProjects));
|
||||
$authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions);
|
||||
|
||||
$productCondition = "product like '%,$productID,%'";
|
||||
$projectCondition = 'project ' . helper::dbIN($authedProjects);
|
||||
$executionCondition = 'execution ' . helper::dbIN($authedExecutions);
|
||||
$projectCondition = "(execution = '0' and project != '0' and project " . helper::dbIN($authedProjects) . ')';
|
||||
$executionCondition = "(execution != '0' and execution " . helper::dbIN($authedExecutions) . ')';
|
||||
}
|
||||
|
||||
$condition = "((product =',0,' or product = '0' or product=',,') AND project = '0' AND execution = '0')";
|
||||
@@ -1222,17 +1226,8 @@ class actionModel extends model
|
||||
$relatedProjects = $relatedData['relatedProjects'];
|
||||
$requirements = $relatedData['requirements'];
|
||||
|
||||
$aclViews = isset($this->app->user->rights['acls']['views']) ? $this->app->user->rights['acls']['views'] : array();
|
||||
$authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? ",{$this->app->user->view->projects}," : '';
|
||||
$authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? ",{$this->app->user->view->sprints},": '';
|
||||
|
||||
foreach($actions as $i => $action)
|
||||
{
|
||||
if(($action->execution != '0' and strpos($authedExecutions, ",$action->execution,") === false) or ($action->execution == '0' and $action->project != '0' and strpos($authedProjects, ",$action->project,") === false))
|
||||
{
|
||||
unset($actions[$i]);
|
||||
continue;
|
||||
}
|
||||
/* Add name field to the actions. */
|
||||
$action->objectName = isset($objectNames[$action->objectType][$action->objectID]) ? $objectNames[$action->objectType][$action->objectID] : '';
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class executionModel extends model
|
||||
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
|
||||
}
|
||||
|
||||
if(isset($execution->cal) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist);
|
||||
if(isset($execution->acl) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist);
|
||||
|
||||
if($execution and $execution->lifetime == 'ops')
|
||||
{
|
||||
|
||||
@@ -114,7 +114,6 @@
|
||||
data: postData,
|
||||
success: function(data)
|
||||
{
|
||||
console.log(data['title']);
|
||||
$('#fileTitle' + fileID).html("<i class='icon icon-file-text'></i> " + data['title']);
|
||||
$('#renameFile' + fileID).closest('li').removeClass('hidden');
|
||||
$('#renameBox' + fileID).addClass('hidden');
|
||||
|
||||
@@ -104,13 +104,11 @@ class port extends control
|
||||
$file = $this->loadModel('file')->getUpload('file');
|
||||
$file = $file[0];
|
||||
$shortName = $this->file->getSaveName($file['pathname']);
|
||||
if(empty($shortName))
|
||||
{
|
||||
die(js::alert($this->lang->excel->emptyFileName));
|
||||
}
|
||||
$extension = $file['extension'];
|
||||
|
||||
$fileName = $this->file->savePath . $shortName;
|
||||
if(empty($shortName)) die(js::alert($this->lang->excel->emptyFileName));
|
||||
|
||||
$extension = $file['extension'];
|
||||
$fileName = $this->file->savePath . $shortName;
|
||||
|
||||
move_uploaded_file($file['tmpname'], $fileName);
|
||||
|
||||
|
||||
+5
-14
@@ -401,10 +401,8 @@ class portModel extends model
|
||||
$dataList = array();
|
||||
|
||||
$sysDataFields = explode(',', $this->portConfig->sysDataFields);
|
||||
foreach($sysDataFields as $field)
|
||||
{
|
||||
$dataList[$field] = $this->loadModel($field)->getPairs();
|
||||
}
|
||||
|
||||
foreach($sysDataFields as $field) $dataList[$field] = $this->loadModel($field)->getPairs();
|
||||
|
||||
return $dataList;
|
||||
}
|
||||
@@ -523,8 +521,7 @@ class portModel extends model
|
||||
*/
|
||||
public function getSourceByLang($lang)
|
||||
{
|
||||
$lang = isset($this->modelLang->$lang) ? $this->modelLang->$lang : '';
|
||||
return $lang;
|
||||
return isset($this->modelLang->$lang) ? $this->modelLang->$lang : '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -733,10 +730,7 @@ class portModel extends model
|
||||
}
|
||||
|
||||
/* Deal children datas and multiple tasks .*/
|
||||
if($modelDatas)
|
||||
{
|
||||
$modelDatas = $this->updateChildDatas($modelDatas);
|
||||
}
|
||||
if($modelDatas) $modelDatas = $this->updateChildDatas($modelDatas);
|
||||
|
||||
return $modelDatas;
|
||||
}
|
||||
@@ -790,10 +784,7 @@ class portModel extends model
|
||||
$relatedObjectIdList = array();
|
||||
$relatedObjects = array();
|
||||
|
||||
foreach($datas as $data)
|
||||
{
|
||||
$relatedObjectIdList[$data->$object] = $data->$object;
|
||||
}
|
||||
foreach($datas as $data) $relatedObjectIdList[$data->$object] = $data->$object;
|
||||
|
||||
if($object == 'openedBuild') $object = 'build';
|
||||
|
||||
|
||||
@@ -438,10 +438,16 @@ class task extends control
|
||||
$customFields[$field] = $this->lang->task->$field;
|
||||
}
|
||||
|
||||
if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review') unset($customFields['story']);
|
||||
$showFields = $this->config->task->custom->batchCreateFields;
|
||||
if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review')
|
||||
{
|
||||
unset($customFields['story']);
|
||||
$showFields = str_replace(',story,', ',', ",$showFields,");
|
||||
$showFields = trim($showFields, ',');
|
||||
}
|
||||
|
||||
$this->view->customFields = $customFields;
|
||||
$this->view->showFields = $this->config->task->custom->batchCreateFields;
|
||||
$this->view->showFields = $showFields;
|
||||
|
||||
if($execution->type == 'kanban')
|
||||
{
|
||||
|
||||
@@ -796,6 +796,7 @@ class userModel extends model
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_USER)->data($user)->autoCheck()->where('id')->eq((int)$userID)->exec();
|
||||
$_SESSION['user']->password = $user->password;
|
||||
$this->app->user->password = $user->password;
|
||||
$this->app->user->modifyPassword = false;
|
||||
if(!dao::isError())
|
||||
|
||||
Reference in New Issue
Block a user