Merge branch 'sprint/185' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/185

This commit is contained in:
王怡栋
2022-02-23 16:45:09 +08:00
8 changed files with 60 additions and 51 deletions
@@ -0,0 +1,3 @@
<script>
$('#mainMenu .dropdown-menu li:last-child').remove();
</script>
@@ -0,0 +1,3 @@
<script>
$('#mainMenu .dropdown-menu li:last-child').remove();
</script>
+1 -5
View File
@@ -479,11 +479,7 @@ class commonModel extends model
{
$currentVision = $app->config->vision;
$userVisions = array_filter(explode(',', $app->user->visions));
if(count($userVisions) < 2)
{
echo "<div>{$lang->visionList[$currentVision]}</div>";
return;
}
if(count($userVisions) < 2) return print("<div>{$lang->visionList[$currentVision]}</div>");
echo "<ul class='dropdown-menu pull-right'>";
echo "<li class='text-gray'>{$lang->switchTo}:</li>";
+1
View File
@@ -276,6 +276,7 @@ function createColumnCreateMenu(options)
{
if(priv.canCreateTask) items.push({label: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID + "&storyID=0&moduleID=0&taskID=0&todoID=0&extra=laneID=" + laneID + ",columnID=" + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canBatchCreateTask) items.push({label: taskLang.batchCreate, url: $.createLink('task', 'batchcreate', 'executionID=' + executionID + "&storyID=0&moduleID=0&taskID=0&iframe=0&extra=laneID=" + laneID + ",columnID=" + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canImportBug) items.push({label: executionLang.importBug, url: $.createLink('execution', 'importBug', 'executionID=' + executionID + "&storyID=0&moduleID=0&taskID=0&todoID=0&extra=laneID=" + laneID + ",columnID=" + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
}
return items;
}
+1
View File
@@ -809,6 +809,7 @@ function createColumnCreateMenu(options)
{
if(priv.canCreateTask) items.push({label: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '80%'}});
if(priv.canBatchCreateTask) items.push({label: taskLang.batchCreate, url: $.createLink('task', 'batchcreate', 'executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '80%'}});
if(priv.canImportBug) items.push({label: executionLang.importBug, url: $.createLink('execution', 'importBug', 'executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '80%'}});
}
return items;
}
+13 -11
View File
@@ -48,26 +48,28 @@ js::set('colorListLang', $lang->kanbancard->colorList);
js::set('colorList', $this->config->kanban->cardColorList);
js::set('projectID', $projectID);
$canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1;
$canEditRegion = commonModel::hasPriv('kanban', 'editRegion');
$canDeleteRegion = commonModel::hasPriv('kanban', 'deleteRegion');
$canCreateLane = commonModel::hasPriv('kanban', 'createLane');
$canCreateTask = common::hasPriv('task', 'create');
$canBatchCreateTask = common::hasPriv('task', 'batchCreate');
$canCreateBug = common::hasPriv('bug', 'create');
$canBatchCreateBug = common::hasPriv('bug', 'batchCreate');
$canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1;
$canEditRegion = commonModel::hasPriv('kanban', 'editRegion');
$canDeleteRegion = commonModel::hasPriv('kanban', 'deleteRegion');
$canCreateLane = commonModel::hasPriv('kanban', 'createLane');
$canCreateTask = common::hasPriv('task', 'create');
$canBatchCreateTask = common::hasPriv('task', 'batchCreate');
$canCreateBug = common::hasPriv('bug', 'create');
$canBatchCreateBug = common::hasPriv('bug', 'batchCreate');
$canImportBug = common::hasPriv('execution', 'importBug');
$canCreateStory = ($productID and common::hasPriv('story', 'create'));
$canBatchCreateStory = ($productID and common::hasPriv('story', 'batchCreate'));
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory'));
$canLinkStoryByPlan = ($productID and common::hasPriv('execution', 'importplanstories'));
$hasStoryButton = ($canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan);
$hasTaskButton = ($canCreateTask or $canBatchCreateTask);
$hasTaskButton = ($canCreateTask or $canBatchCreateTask or $canImportBug);
$hasBugButton = ($canCreateBug or $canBatchCreateBug);
js::set('priv',
array(
'canCreateTask' => $canCreateTask,
'canBatchCreateTask' => $canBatchCreateTask,
'canImportBug' => $canImportBug,
'canCreateBug' => $canCreateBug,
'canBatchCreateBug' => $canBatchCreateBug,
'canCreateStory' => $canCreateStory,
@@ -101,7 +103,6 @@ js::set('hasStoryButton', $hasStoryButton);
js::set('hasBugButton', $hasBugButton);
js::set('hasTaskButton', $hasTaskButton);
?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<div class="input-control space c-type">
@@ -155,7 +156,7 @@ js::set('hasTaskButton', $hasTaskButton);
echo $actions;
?>
<?php if($canCreateTask or $canBatchCreateTask or $canCreateBug or $canBatchCreateBug or $canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan):?>
<?php if($canCreateTask or $canBatchCreateTask or $canImportBug or $canCreateBug or $canBatchCreateBug or $canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan):?>
<div class='dropdown' id='createDropdown'>
<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i> <?php echo $this->lang->create;?> <span class='caret'></span></button>
<ul class='dropdown-menu pull-right'>
@@ -168,6 +169,7 @@ js::set('hasTaskButton', $hasTaskButton);
<?php if($canBatchCreateBug) echo '<li>' . html::a(helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branchID&executionID=$execution->id", '', true), $lang->bug->batchCreate, '', "class='iframe'") . '</li>';?>
<?php if(($hasStoryButton or $hasBugButton) and $hasTaskButton) echo '<li class="divider"></li>';?>
<?php if($canCreateTask) echo '<li>' . html::a(helper::createLink('task', 'create', "execution=$execution->id", '', true), $lang->task->create, '', "class='iframe'") . '</li>';?>
<?php if($canImportBug) echo '<li>' . html::a(helper::createLink('execution', 'importBug', "executionID=$executionID", '', true), $lang->execution->importBug, '', "class='ifram'") . '</li>';?>
<?php if($canBatchCreateTask) echo '<li>' . html::a(helper::createLink('task', 'batchCreate', "execution=$execution->id", '', true), $lang->execution->batchCreateTask, '', "class='iframe'") . '</li>';?>
</ul>
</div>
+10 -7
View File
@@ -73,19 +73,20 @@
<?php
$checkObject = new stdclass();
$checkObject->execution = $executionID;
$canCreateTask = common::hasPriv('task', 'create', $checkObject);
$canBatchCreateTask = common::hasPriv('task', 'batchCreate', $checkObject);
$canCreateBug = common::hasPriv('bug', 'create');
$canBatchCreateBug = common::hasPriv('bug', 'batchCreate');
$canCreateTask = common::hasPriv('task', 'create', $checkObject);
$canBatchCreateTask = common::hasPriv('task', 'batchCreate', $checkObject);
$canCreateBug = common::hasPriv('bug', 'create');
$canBatchCreateBug = common::hasPriv('bug', 'batchCreate');
$canImportBug = common::hasPriv('execution', 'importBug');
$canCreateStory = ($productID and common::hasPriv('story', 'create'));
$canBatchCreateStory = ($productID and common::hasPriv('story', 'batchCreate'));
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory'));
$canLinkStoryByPlan = ($productID and common::hasPriv('execution', 'importplanstories'));
$hasStoryButton = ($canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan);
$hasTaskButton = ($canCreateTask or $canBatchCreateTask);
$hasTaskButton = ($canCreateTask or $canBatchCreateTask or $canImportBug);
$hasBugButton = ($canCreateBug or $canBatchCreateBug);
?>
<?php if($canCreateTask or $canBatchCreateTask or $canCreateBug or $canBatchCreateBug or $canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan):?>
<?php if($canCreateTask or $canBatchCreateTask or $canImportBug or $canCreateBug or $canBatchCreateBug or $canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan):?>
<div class='dropdown' id='createDropdown'>
<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i> <?php echo $this->lang->create;?> <span class='caret'></span></button>
<ul class='dropdown-menu pull-right'>
@@ -99,11 +100,12 @@
<?php if(($hasStoryButton or $hasBugButton) and $hasTaskButton) echo '<li class="divider"></li>';?>
<?php if($canCreateTask) echo '<li>' . html::a(helper::createLink('task', 'create', "execution=$execution->id", '', true), $lang->task->create, '', "class='iframe'") . '</li>';?>
<?php if($canBatchCreateTask) echo '<li>' . html::a(helper::createLink('task', 'batchCreate', "execution=$execution->id", '', true), $lang->execution->batchCreateTask, '', "class='iframe'") . '</li>';?>
<?php if($canImportBug) echo '<li>' . html::a(helper::createLink('execution', 'importBug', "execution=$execution->id", '', true), $lang->execution->importBug, '', "class='iframe'") . '</li>';?>
</ul>
</div>
<?php endif;?>
<?php else:?>
<?php $canCreateTask = $canBatchCreateTask = $canCreateBug = $canBatchCreateBug = $canCreateStory = $canBatchCreateStory = $canLinkStory = $canLinkStoryByPlan = false;?>
<?php $canCreateTask = $canBatchCreateTask = $canImportBug = $canCreateBug = $canBatchCreateBug = $canCreateStory = $canBatchCreateStory = $canLinkStory = $canLinkStoryByPlan = false;?>
<?php endif;?>
</div>
</div>
@@ -146,6 +148,7 @@ js::set('priv',
'canSortCards' => common::hasPriv('kanban', 'cardsSort'),
'canCreateTask' => $canCreateTask,
'canBatchCreateTask' => $canBatchCreateTask,
'canImportBug' => $canImportBug,
'canCreateBug' => $canCreateBug,
'canBatchCreateBug' => $canBatchCreateBug,
'canCreateStory' => $canCreateStory,
+28 -28
View File
@@ -39,15 +39,15 @@ class upgradeModel extends model
set_time_limit(0);
$openVersion = $fromVersion;
if(strpos($fromVersion, 'pro') !== false)
if(strpos($fromVersion, 'pro') !== false)
{
$openVersion = $this->config->proVersion[$fromVersion];
}
elseif(strpos($fromVersion, 'biz') !== false)
elseif(strpos($fromVersion, 'biz') !== false)
{
$openVersion = $this->config->bizVersion[$fromVersion];
}
elseif(strpos($fromVersion, 'max') !== false)
elseif(strpos($fromVersion, 'max') !== false)
{
$openVersion = $this->config->maxVersion[$fromVersion];
}
@@ -66,7 +66,7 @@ class upgradeModel extends model
$this->executeOpen($openVersion, $fromVersion, $executeXuanxuan);
$proVersions = array();
foreach($this->config->proVersion as $pro => $open)
foreach($this->config->proVersion as $pro => $open)
{
if($open == $openVersion) $proVersions[] = $pro;
}
@@ -79,7 +79,7 @@ class upgradeModel extends model
}
$bizVersions = array();
foreach($this->config->bizVersion as $biz => $open)
foreach($this->config->bizVersion as $biz => $open)
{
if($open == $openVersion) $bizVersions[] = $biz;
}
@@ -106,9 +106,9 @@ class upgradeModel extends model
/**
* Execute open source version.
*
* @param string $openVersion
* @param string $fromVersion
*
* @param string $openVersion
* @param string $fromVersion
* @param bool $executeXuanxuan
* @access public
* @return void
@@ -433,7 +433,7 @@ class upgradeModel extends model
if(is_numeric($fromVersion[0] == 'b')) break;
$this->execSQL($this->getUpgradeFile('bizinstall'));
if(!empty($this->config->isINT))
{
{
$xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'xuanxuan.sql';
$this->execSQL($xuanxuanSql);
}
@@ -449,7 +449,7 @@ class upgradeModel extends model
/**
* Execute pro version sql.
*
*
* @param string $proVersion
* @access public
* @return void
@@ -487,7 +487,7 @@ class upgradeModel extends model
/**
* Execute biz upgrade program.
*
*
* @param int $bizVersion
* @param bool $executeXuanxuan
* @access public
@@ -588,12 +588,12 @@ class upgradeModel extends model
$confirmContent = '';
$openVersion = $fromVersion;
if(strpos($fromVersion, 'pro') !== false)
if(strpos($fromVersion, 'pro') !== false)
{
$openVersion = $this->config->proVersion[$fromVersion];
$confirmContent .= $this->getProConfirm($fromVersion);
}
elseif(strpos($fromVersion, 'biz') !== false)
elseif(strpos($fromVersion, 'biz') !== false)
{
$openVersion = $this->config->bizVersion[$fromVersion];
$proVersion = array_search($openVersion, $this->config->proVersion);
@@ -601,7 +601,7 @@ class upgradeModel extends model
$confirmContent .= $this->getProConfirm($proVersion);
$confirmContent .= $this->getBizConfirm($fromVersion);
}
elseif(strpos($fromVersion, 'max') !== false)
elseif(strpos($fromVersion, 'max') !== false)
{
$openVersion = $this->config->maxVersion[$fromVersion];
$proVersion = array_search($openVersion, $this->config->proVersion);
@@ -619,9 +619,9 @@ class upgradeModel extends model
/**
* Get open source confirm contents.
*
*
* @param string $openVersion
* @param string $fromVersion
* @param string $fromVersion
* @access public
* @return void
*/
@@ -823,18 +823,18 @@ class upgradeModel extends model
case '16_1': $confirmContent .= file_get_contents($this->getUpgradeFile('16.1'));
case '16_2': $confirmContent .= file_get_contents($this->getUpgradeFile('16.2'));
case '16_3': $confirmContent .= file_get_contents($this->getUpgradeFile('16.3'));
case '16_4':
if(strpos($fromVersion, 'pro') === false and strpos($fromVersion, 'biz') === false and strpos($fromVersion, 'max') === false)
case '16_4':
if(strpos($fromVersion, 'pro') === false and strpos($fromVersion, 'biz') === false and strpos($fromVersion, 'max') === false)
{
$confirmContent .= file_get_contents($this->getUpgradeFile('proinstall'));
}
if(strpos($fromVersion, 'biz') === false and strpos($fromVersion, 'max') === false)
if(strpos($fromVersion, 'biz') === false and strpos($fromVersion, 'max') === false)
{
$confirmContent .= file_get_contents($this->getUpgradeFile('bizinstall'));
}
if(strpos($fromVersion, 'max') === false)
if(strpos($fromVersion, 'max') === false)
{
$confirmContent .= file_get_contents($this->getUpgradeFile('maxinstall'));
$confirmContent .= file_get_contents($this->getUpgradeFile('functions'));
@@ -848,8 +848,8 @@ class upgradeModel extends model
/**
* Get pro version confirm contents.
*
* @param string $fromVersion
*
* @param string $fromVersion
* @access public
* @return void
*/
@@ -962,8 +962,8 @@ class upgradeModel extends model
/**
* Get biz version confirm contents.
*
* @param string $fromVersion
*
* @param string $fromVersion
* @access public
* @return void
*/
@@ -1030,8 +1030,8 @@ class upgradeModel extends model
/**
* Get max version confirm contents.
*
* @param string $fromVersion
*
* @param string $fromVersion
* @access public
* @return void
*/
@@ -1039,9 +1039,9 @@ class upgradeModel extends model
{
$confirmContent = '';
if($fromVersion == 'max2_0_beta4' && $this->config->version != 'max2.0.rc1') $fromVersion = 'max2_0_rc1';
switch($fromVersion)
{
{
case 'max2_0_rc1':
case 'max2_0_beta4': $confirmContent .= file_get_contents($this->getUpgradeFile('max2.0.beta4'));
case 'max2_0': $confirmContent .= file_get_contents($this->getUpgradeFile('max2.0'));