diff --git a/api/v1/entries/task.php b/api/v1/entries/task.php
index 15cd194d6e..926a337e98 100644
--- a/api/v1/entries/task.php
+++ b/api/v1/entries/task.php
@@ -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');
diff --git a/lib/dingapi/dingapi.class.php b/lib/dingapi/dingapi.class.php
index dacf0a52b7..238e1a084c 100644
--- a/lib/dingapi/dingapi.class.php
+++ b/lib/dingapi/dingapi.class.php
@@ -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;
}
diff --git a/lib/feishuapi/feishuapi.class.php b/lib/feishuapi/feishuapi.class.php
index d25126517d..3749eb5a99 100644
--- a/lib/feishuapi/feishuapi.class.php
+++ b/lib/feishuapi/feishuapi.class.php
@@ -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
*/
diff --git a/lib/front/front.class.php b/lib/front/front.class.php
index e4da51367d..d9078b82f8 100644
--- a/lib/front/front.class.php
+++ b/lib/front/front.class.php
@@ -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;
diff --git a/module/block/control.php b/module/block/control.php
index 1b08f2b03c..e8237a4b99 100644
--- a/module/block/control.php
+++ b/module/block/control.php
@@ -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();
diff --git a/module/common/lang/en.php b/module/common/lang/en.php
index 408f1289a7..5b353efe1a 100644
--- a/module/common/lang/en.php
+++ b/module/common/lang/en.php
@@ -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();
diff --git a/module/custom/model.php b/module/custom/model.php
index 273a093ff9..1b9eed74ad 100644
--- a/module/custom/model.php
+++ b/module/custom/model.php
@@ -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)
{
diff --git a/module/extension/model.php b/module/extension/model.php
index 29de175bba..30dbc63ec7 100644
--- a/module/extension/model.php
+++ b/module/extension/model.php
@@ -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) . '
';
- $return->mkdirCommands .= "mkdir -p $path
";
+ $return->mkdirCommands .= "sudo mkdir -p $path
";
$return->chmodCommands .= "sudo chmod -R 777 $path
";
}
$return->dirs2Created[] = $path;
diff --git a/module/product/model.php b/module/product/model.php
index 010ea89847..1222111415 100644
--- a/module/product/model.php
+++ b/module/product/model.php
@@ -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();
diff --git a/module/search/model.php b/module/search/model.php
index 770c90cc3f..5605abff9c 100644
--- a/module/search/model.php
+++ b/module/search/model.php
@@ -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.
*
diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php
index 7af76e8e24..52918a87dc 100644
--- a/module/search/view/buildform.html.php
+++ b/module/search/view/buildform.html.php
@@ -228,7 +228,7 @@ foreach($fieldParams as $fieldName => $param)