Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -102,7 +102,7 @@ class taskEntry extends Entry
|
||||
$oldTask = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
/* Set $_POST variables. */
|
||||
$fields = 'name,type,desc,assignedTo,pri,estimate,left,consumed,story,parent,execution,module,closedReason,status,estStarted,deadline,team,teamEstimate,multiple,mailto,uid';
|
||||
$fields = 'name,type,desc,assignedTo,pri,estimate,left,consumed,story,parent,execution,module,closedReason,status,estStarted,deadline,team,teamEstimate,teamConsumed,teamLeft,multiple,mailto,uid';
|
||||
$this->batchSetPost($fields, $oldTask);
|
||||
|
||||
$control = $this->loadController('task', 'edit');
|
||||
|
||||
@@ -188,6 +188,7 @@ class dingapi
|
||||
if(isset($response->errcode) and $response->errcode == 0) return $response;
|
||||
|
||||
if(empty($response)) $this->errors = $errors;
|
||||
if(isset($response->result) and $response->result == 'fail') $this->errors['curl'] = $response->message;
|
||||
if(isset($response->errcode)) $this->errors[$response->errcode] = "Errcode:{$response->errcode}, Errmsg:{$response->errmsg}";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ class feishuapi
|
||||
private $errors = array();
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @param string $appKey
|
||||
* @param string $appSecret
|
||||
* @param string $agentId
|
||||
* @param string $apiUrl
|
||||
* Construct
|
||||
*
|
||||
* @param string $appKey
|
||||
* @param string $appSecret
|
||||
* @param string $agentId
|
||||
* @param string $apiUrl
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -29,7 +29,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get token.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get users.
|
||||
*
|
||||
*
|
||||
* @param string $selectedDepts
|
||||
* @access public
|
||||
* @return array
|
||||
@@ -103,7 +103,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get depts.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -146,7 +146,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get department tree structure.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -186,10 +186,10 @@ class feishuapi
|
||||
}
|
||||
|
||||
/**
|
||||
* Send message
|
||||
*
|
||||
* @param string $userList
|
||||
* @param string $message
|
||||
* Send message
|
||||
*
|
||||
* @param string $userList
|
||||
* @param string $message
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -207,8 +207,8 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Query API.
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @param string $url
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
@@ -225,6 +225,7 @@ class feishuapi
|
||||
if(isset($response->code) and $response->code == 0) return $response;
|
||||
|
||||
if(empty($response)) $this->errors = $errors;
|
||||
if(isset($response->result) and $response->result == 'fail') $this->errors['curl'] = $response->message;
|
||||
if(isset($response->code)) $this->errors[$response->code] = "Errcode:{$response->code}, Errmsg:{$response->msg}";
|
||||
if(!empty($this->errors))
|
||||
{
|
||||
@@ -236,7 +237,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Check for errors.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
@@ -247,7 +248,7 @@ class feishuapi
|
||||
|
||||
/**
|
||||
* Get errors.
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -259,7 +259,7 @@ class html extends baseHTML
|
||||
}
|
||||
elseif(is_object($user))
|
||||
{
|
||||
$userObj->avatar = $user->avatar;
|
||||
$userObj->avatar = isset($user->avatar) ? $user->avatar : '';
|
||||
$userObj->account = $user->account;
|
||||
$userObj->name = isset($user->name) ? $user->name : (isset($user->realname) ? $user->realname : $user->account);
|
||||
$user = $userObj;
|
||||
|
||||
@@ -1399,7 +1399,8 @@ class block extends control
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($this->config->vision == 'lite')->andWhere('type')->eq('kanban')->fi()
|
||||
->beginIF($this->config->vision == 'rnd')->andWhere('type')->eq('sprint')->fi()
|
||||
->andWhere('parent')->eq($this->session->project)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->andWhere('project')->eq($this->session->project)
|
||||
->groupBy('status')
|
||||
->fetchPairs();
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ $lang->error->noData = 'No data.';
|
||||
$lang->error->editedByOther = 'This record might have been changed. Please refresh and try to edit again!';
|
||||
$lang->error->tutorialData = 'No data can be imported in tutorial mode. Please quit tutorial first!';
|
||||
$lang->error->noCurlExt = 'No Curl module installed';
|
||||
$lang->error->loginTimeout = 'Login has timed out, please login again!'
|
||||
$lang->error->loginTimeout = 'Login has timed out, please login again!';
|
||||
|
||||
/* Page info. */
|
||||
$lang->pager = new stdclass();
|
||||
|
||||
@@ -434,7 +434,7 @@ class customModel extends model
|
||||
global $lang, $app, $dbh;
|
||||
if(!isset($lang->$module->featureBar[$method])) return;
|
||||
$queryModule = $module == 'execution' ? 'task' : ($module == 'product' ? 'story' : $module);
|
||||
$shortcuts = $dbh->query('select id, title from ' . TABLE_USERQUERY . " where `account` = '{$app->user->account}' AND `module` = '{$queryModule}' AND `shortcut` = '1' order by id")->fetchAll();
|
||||
$shortcuts = $dbh->query('select id, title from ' . TABLE_USERQUERY . " where (`account` = '{$app->user->account}' or `common` = '1') AND `module` = '{$queryModule}' AND `shortcut` = '1' order by id")->fetchAll();
|
||||
|
||||
if($shortcuts)
|
||||
{
|
||||
|
||||
@@ -456,7 +456,7 @@ class extensionModel extends model
|
||||
if(!is_writable($parentDir) or !@mkdir($path, 0777, true))
|
||||
{
|
||||
$return->errors .= sprintf($this->lang->extension->errorTargetPathNotExists, $path) . '<br />';
|
||||
$return->mkdirCommands .= "mkdir -p $path<br />";
|
||||
$return->mkdirCommands .= "sudo mkdir -p $path<br />";
|
||||
$return->chmodCommands .= "sudo chmod -R 777 $path<br />";
|
||||
}
|
||||
$return->dirs2Created[] = $path;
|
||||
|
||||
@@ -1285,6 +1285,7 @@ class productModel extends model
|
||||
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->orderBy('id_desc')
|
||||
->fetchAll('id');
|
||||
|
||||
$projectIdList = array();
|
||||
|
||||
+15
-1
@@ -334,7 +334,7 @@ class searchModel extends model
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return string
|
||||
* @return object
|
||||
*/
|
||||
public function getQuery($queryID)
|
||||
{
|
||||
@@ -357,6 +357,20 @@ class searchModel extends model
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a query.
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByID($queryID)
|
||||
{
|
||||
$query = $this->dao->findByID($queryID)->from(TABLE_USERQUERY)->fetch();
|
||||
if(!$query) return false;
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save current query to db.
|
||||
*
|
||||
|
||||
@@ -228,7 +228,7 @@ foreach($fieldParams as $fieldName => $param)
|
||||
<ul>
|
||||
<?php foreach($queries as $queryID => $queryName):?>
|
||||
<?php if(empty($queryID)) continue;?>
|
||||
<?php $query = $this->search->getQuery($queryID);?>
|
||||
<?php $query = $this->search->getByID($queryID);?>
|
||||
<li><?php echo html::a("javascript:executeQuery($queryID)", $queryName . ((common::hasPriv('search', 'deleteQuery') and $this->app->user->account == $query->account) ? '<i class="icon icon-close"></i>' : ''), '', "class='label user-query' data-query-id='$queryID' title='{$queryName}'");?></li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
@@ -363,7 +363,6 @@ $(function()
|
||||
var setDateField = function(query, fieldNO)
|
||||
{
|
||||
var $period = $('#selectPeriod');
|
||||
if($period.length) $period.remove();
|
||||
|
||||
<?php
|
||||
$selectPeriod = "<ul id='selectPeriod' class='dropdown-menu'>";
|
||||
|
||||
@@ -1132,8 +1132,6 @@ class story extends control
|
||||
|
||||
$reviewers = $this->story->getReviewerPairs($storyID, $story->version);
|
||||
$reviewedBy = trim($story->reviewedBy, ',');
|
||||
$superReviewers = trim(zget($this->config->story, 'superReviewers', ''), ',');
|
||||
$checkSuperReviewed = empty($reviewedBy) ? false : strpos(",$superReviewers,", ",$reviewedBy,");
|
||||
|
||||
$this->executeHooks($storyID);
|
||||
|
||||
@@ -1165,7 +1163,6 @@ class story extends control
|
||||
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID);
|
||||
$this->view->from = $from;
|
||||
$this->view->param = $param;
|
||||
$this->view->checkSuperReviewed = $checkSuperReviewed !== false ? true : false;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1341,6 +1338,7 @@ class story extends control
|
||||
{
|
||||
$changes = $this->story->close($storyID);
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
$this->story->closeParentRequirement($storyID);
|
||||
|
||||
if($changes)
|
||||
{
|
||||
|
||||
@@ -2989,6 +2989,25 @@ class storyModel extends model
|
||||
return array(0 => '') + $stories ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close requirement if all son story for segmentation has been closed.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function closeParentRequirement($storyID)
|
||||
{
|
||||
$parentID = $this->dao->select('BID')->from(TABLE_RELATION)->where('AID')->eq($storyID)->fetch();
|
||||
$stories = $this->dao->select('t2.id, t2.status')->from(TABLE_RELATION)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t2.id=t1.AID')
|
||||
->where('t1.BType')->eq('requirement')
|
||||
->andWhere('t2.status')->ne('closed')
|
||||
->andWhere('t2.type')->eq('story')
|
||||
->fetchPairs();
|
||||
if(empty($stories)) $this->close($parentID->BID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get stories of a user.
|
||||
*
|
||||
|
||||
@@ -395,7 +395,6 @@
|
||||
<th><?php echo $lang->story->assignedTo;?></th>
|
||||
<td><?php if($story->assignedTo) echo zget($users, $story->assignedTo) . $lang->at . $story->assignedDate;?></td>
|
||||
</tr>
|
||||
<?php if(!$checkSuperReviewed):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewers;?></th>
|
||||
<td>
|
||||
@@ -410,7 +409,6 @@
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewedDate;?></th>
|
||||
<td><?php if($story->reviewedBy) echo $story->reviewedDate;?></td>
|
||||
|
||||
@@ -228,7 +228,7 @@ class userModel extends model
|
||||
{
|
||||
$users = $this->dao->select('account, realname, avatar, dept, role')->from(TABLE_USER)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($accounts)->andWhere('type')->eq($type)->fi()
|
||||
->beginIF($type)->andWhere('type')->eq($type)->fi()
|
||||
->beginIF($accounts)->andWhere('account')->in($accounts)->fi()
|
||||
->fetchAll('account');
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ include '../../common/view/header.lite.html.php';
|
||||
<?php
|
||||
$isOnlybody = helper::inOnlyBodyMode();
|
||||
unset($_GET['onlybody']);
|
||||
echo html::a('javascript:void(0)', $lang->my->common, ($isOnlybody ? '_parent' : ''), 'class="btn show-in-app" onclick="changeLeftNavigation()"');
|
||||
echo html::a($this->createLink('my'), $lang->my->common, ($isOnlybody ? '_parent' : ''), "class='btn show-in-app' data-app='my'");
|
||||
if($refererBeforeDeny) echo html::a(helper::safe64Decode($refererBeforeDeny), $lang->user->goback, ($isOnlybody ? '_parent' : ''), "class='btn'");
|
||||
echo html::a($this->createLink('user', 'logout', "referer=" . helper::safe64Encode($denyPage)), $lang->user->relogin, ($isOnlybody ? '_parent' : ''), "class='btn btn-primary'");
|
||||
?>
|
||||
@@ -60,20 +60,4 @@ include '../../common/view/header.lite.html.php';
|
||||
<?php js::set('isOnlybody', $isOnlybody);?>
|
||||
<?php js::set('indexLink', helper::createLink('my', 'index'));?>
|
||||
</body>
|
||||
<script>
|
||||
/* Click my site to modify the left navigation. */
|
||||
function changeLeftNavigation()
|
||||
{
|
||||
if(window.parent && window.parent.$.apps && isOnlybody)
|
||||
{
|
||||
$.closeModal();
|
||||
window.parent.$.apps.open('my');
|
||||
}
|
||||
else
|
||||
{
|
||||
$.apps.close();
|
||||
$.apps.open('my');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
+4
-4
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user