Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -917,6 +917,8 @@ class actionModel extends model
|
||||
->beginIF($docs and !$this->app->user->admin)->andWhere("IF(objectType != 'doc' || (objectType = 'doc' && (action = 'approved' || action = 'removed')), '1=1', objectID " . helper::dbIN($docs) . ")")->fi()
|
||||
->beginIF($libs and !$this->app->user->admin)->andWhere("IF(objectType != 'doclib', '1=1', objectID " . helper::dbIN(array_keys($libs)) . ') ')->fi()
|
||||
->beginIF($actionCondition)->andWhere("($actionCondition)")->fi()
|
||||
/* Filter out client login/logout actions. */
|
||||
->andWhere('action')->notin('disconnectxuanxuan,loginxuanxuan')
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
@@ -1008,13 +1010,13 @@ class actionModel extends model
|
||||
$actionQuery = str_replace("`product` = '$productID'", "`product` LIKE '%,$productID,%'", $actionQuery);
|
||||
|
||||
if($date) $actionQuery = "($actionQuery) AND " . ('date' . ($direction == 'next' ? '<' : '>') . "'{$date}'");
|
||||
|
||||
|
||||
/* If this vision is lite, delete product actions. */
|
||||
if($this->config->vision == 'lite') $actionQuery .= " AND objectType != 'product'";
|
||||
|
||||
|
||||
$actionQuery .= " AND vision = '" . $this->config->vision . "'";
|
||||
$actions = $this->getBySQL($actionQuery, $orderBy, $pager);
|
||||
|
||||
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'action');
|
||||
if(!$actions) return array();
|
||||
return $this->transformActions($actions);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->branch->noData;?></span>
|
||||
<?php if($canCreate) echo html::a($this->createLink('branch', 'create', "productID=$productID", '', true), "<i class='icon icon-plus'></i> " . $lang->branch->create, '', "class='btn btn-info iframe'");?>
|
||||
<?php if($canCreate and $browseType != 'closed') echo html::a($this->createLink('branch', 'create', "productID=$productID", '', true), "<i class='icon icon-plus'></i> " . $lang->branch->create, '', "class='btn btn-info iframe'");?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
|
||||
@@ -413,7 +413,7 @@ class commonModel extends model
|
||||
{
|
||||
if(!commonModel::isTutorialMode())
|
||||
{
|
||||
echo '<li>' . html::a(helper::createLink('tutorial', 'start'), "<i class='icon icon-guide'></i> " . $lang->tutorialAB, '', "class='iframe' data-class-name='modal-inverse' data-width='800' data-headerless='true' data-backdrop='true' data-keyboard='true'") . '</li>';
|
||||
echo '<li class="user-tutorial">' . html::a(helper::createLink('tutorial', 'start'), "<i class='icon icon-guide'></i> " . $lang->tutorialAB, '', "class='iframe' data-class-name='modal-inverse' data-width='800' data-headerless='true' data-backdrop='true' data-keyboard='true'") . '</li>';
|
||||
}
|
||||
|
||||
echo '<li>' . html::a(helper::createLink('my', 'preference', '', '', true), "<i class='icon icon-controls'></i> " . $lang->preference, '', "class='iframe' data-width='700'") . '</li>';
|
||||
|
||||
@@ -48,6 +48,10 @@ include 'chosen.html.php';
|
||||
<?php endif;?>
|
||||
<script>
|
||||
adjustMenuWidth();
|
||||
if(window.navigator.userAgent.indexOf('xuanxuan') > 0)
|
||||
{
|
||||
$('li.user-tutorial').addClass('hide');
|
||||
}
|
||||
</script>
|
||||
<main id='main' <?php if(!empty($config->sso->redirect)) echo "class='ranzhiFixedTfootAction'";?> >
|
||||
<div class='container'>
|
||||
|
||||
@@ -77,6 +77,8 @@ if($this->config->vision == 'lite')
|
||||
$extHookFiles = glob($extHookRule);
|
||||
if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
|
||||
}
|
||||
$xuanExtFile = $extensionRoot . 'xuan/common/ext/view/header.xuanxuan.html.hook.php';
|
||||
if(file_exists($xuanExtFile)) include $xuanExtFile;
|
||||
?>
|
||||
</head>
|
||||
<?php $singleClass = $this->app->getViewType() == 'xhtml' ? 'allow-self-open' : '';?>
|
||||
|
||||
@@ -1829,7 +1829,7 @@ class executionModel extends model
|
||||
foreach($plans as $plan) $planPairs += $plan;
|
||||
}
|
||||
$this->config->product->search['params']['plan']['values'] = $planPairs;
|
||||
$this->config->product->search['params']['module']['values'] = $modules;
|
||||
$this->config->product->search['params']['module']['values'] = array('' => '') + $modules;
|
||||
if($productType == 'normal')
|
||||
{
|
||||
unset($this->config->product->search['fields']['branch']);
|
||||
|
||||
@@ -1291,7 +1291,7 @@ class product extends control
|
||||
$this->view->position[] = $this->lang->product->line;
|
||||
|
||||
$this->view->programs = array('') + $this->loadModel('program')->getTopPairs();
|
||||
$this->view->lines = $this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->orderBy('`order`')->fetchAll();
|
||||
$this->view->lines = $this->product->getLines();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -970,7 +970,7 @@ class productModel extends model
|
||||
else
|
||||
{
|
||||
$moduleList = array();
|
||||
$modules = array('' => '/');
|
||||
$modules = array('/');
|
||||
$branchGroup = $this->loadModel('execution')->getBranchByProduct(array_keys($products), $this->session->project, '');
|
||||
foreach($products as $productID => $productName)
|
||||
{
|
||||
@@ -996,7 +996,7 @@ class productModel extends model
|
||||
{
|
||||
$modules = $this->tree->getOptionMenu($productID, 'story', 0, $branch);
|
||||
}
|
||||
$this->config->product->search['params']['module']['values'] = $modules;
|
||||
$this->config->product->search['params']['module']['values'] = array('' => '') + $modules;
|
||||
|
||||
$productInfo = $this->getById($productID);
|
||||
if(!$productID or $productInfo->type == 'normal' or $this->app->tab == 'assetlib')
|
||||
@@ -1786,7 +1786,7 @@ class productModel extends model
|
||||
*
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getLinePairs($programID = 0)
|
||||
{
|
||||
@@ -1797,6 +1797,16 @@ class productModel extends model
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
/*
|
||||
* Get all lines.
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getLines()
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->orderBy('`order`')->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the summary of product's stories.
|
||||
*
|
||||
|
||||
@@ -4,6 +4,14 @@ $(function()
|
||||
{
|
||||
$('#reviewer').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
|
||||
getStatus('change', "storyID=" + storyID + ",changed=" + changed + ",needNotReview=" + ($(this).prop('checked') ? 1 : 0));
|
||||
if($(this).is(':checked'))
|
||||
{
|
||||
$('.input-group-addon').removeClass('required');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.input-group-addon').addClass('required');
|
||||
}
|
||||
});
|
||||
$('#needNotReview').change();
|
||||
|
||||
|
||||
@@ -670,7 +670,7 @@ class storyModel extends model
|
||||
->add('lastEditedDate', $now)
|
||||
->setIF($specChanged, 'version', $oldStory->version + 1)
|
||||
->setIF($specChanged and $oldStory->status == 'active' and $this->post->needNotReview == false, 'status', 'changed')
|
||||
->setIF($specChanged and $oldStory->status == 'draft' and $this->post->needNotReview, 'status', 'active')
|
||||
->setIF($oldStory->status == 'draft' and $this->post->needNotReview, 'status', 'active')
|
||||
->setIF($specChanged, 'reviewedBy', '')
|
||||
->setIF($specChanged, 'closedBy', '')
|
||||
->setIF($specChanged, 'closedReason', '')
|
||||
@@ -679,7 +679,7 @@ class storyModel extends model
|
||||
->stripTags($this->config->story->editor->change['id'], $this->config->allowedTags)
|
||||
->remove('files,labels,reviewer,comment,needNotReview,uid')
|
||||
->get();
|
||||
if($specChanged and $story->status == 'active' and $this->checkForceReview()) $story->status = 'changed';
|
||||
if($specChanged and isset($story->status) && $story->status == 'active' and $this->checkForceReview()) $story->status = 'changed';
|
||||
$story = $this->loadModel('file')->processImgURL($story, $this->config->story->editor->change['id'], $this->post->uid);
|
||||
$this->dao->update(TABLE_STORY)->data($story, 'spec,verify')
|
||||
->autoCheck()
|
||||
@@ -735,7 +735,7 @@ class storyModel extends model
|
||||
|
||||
$this->file->updateObjectID($this->post->uid, $storyID, 'story');
|
||||
|
||||
$oldStory->reviewers = implode(',', array_keys($oldStroyReviewers));
|
||||
$oldStory->reviewers = implode(',', array_keys($oldStoryReviewers));
|
||||
$story->reviewers = implode(',', $_POST['reviewer']);
|
||||
return common::createChanges($oldStory, $story);
|
||||
}
|
||||
@@ -1315,11 +1315,11 @@ class storyModel extends model
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->setDefault('lastEditedDate', $now)
|
||||
->setDefault('status', $oldStory->status)
|
||||
->setDefault('reviewedDate', $date)
|
||||
->setIF($this->post->result == 'revert', 'version', $this->post->preVersion)
|
||||
->removeIF($this->post->result != 'reject', 'closedReason, duplicateStory, childStories')
|
||||
->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'duplicate', 'duplicateStory')
|
||||
->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'subdivided', 'childStories')
|
||||
->add('reviewedDate', $date)
|
||||
->add('reviewedBy', $oldStory->reviewedBy . ',' . $this->app->user->account)
|
||||
->remove('result,preVersion,comment')
|
||||
->get();
|
||||
@@ -2663,6 +2663,8 @@ class storyModel extends model
|
||||
{
|
||||
$storyQuery .= " AND `status` NOT IN ('draft', 'closed')";
|
||||
}
|
||||
|
||||
if($this->app->rawModule == 'build' and $this->app->rawMethod == 'linkstory') $storyQuery .= " AND `parent` != '-1'";
|
||||
}
|
||||
elseif(strpos($storyQuery, $allBranch) !== false)
|
||||
{
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewedDate;?></th>
|
||||
<td><?php if($story->reviewedBy) echo $story->reviewedDate;?></td>
|
||||
<td><?php if($story->reviewedBy) echo date('Y-m-d', strtotime($story->reviewedDate))?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->closedBy;?></th>
|
||||
|
||||
@@ -5257,8 +5257,9 @@ class upgradeModel extends model
|
||||
$products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('acl')->eq('custom')->fetchAll();
|
||||
foreach($products as $product)
|
||||
{
|
||||
$groups = explode(',', $product->whitelist);
|
||||
$accounts = $this->dao->select('account')->from(TABLE_USERGROUP)->where('`group`')->in($groups)->fetchPairs('account');
|
||||
$groups = explode(',', $product->whitelist);
|
||||
$accounts = $this->dao->select('account')->from(TABLE_USERGROUP)->where('`group`')->in($groups)->fetchPairs('account');
|
||||
$whiteList = '';
|
||||
foreach($accounts as $account)
|
||||
{
|
||||
$acl = new stdclass();
|
||||
@@ -5269,9 +5270,11 @@ class upgradeModel extends model
|
||||
$acl->source = 'upgrade';
|
||||
|
||||
$this->dao->insert(TABLE_ACL)->data($acl)->exec();
|
||||
|
||||
$whiteList .= ',' . $account;
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_PRODUCT)->set('acl')->eq('private')->where('id')->eq($product->id)->exec();
|
||||
$this->dao->update(TABLE_PRODUCT)->set('acl')->eq('private')->set('whitelist')->eq($whiteList)->where('id')->eq($product->id)->exec();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user