diff --git a/api/v1/entries/stories.php b/api/v1/entries/stories.php
index 87128c60b8..ec46e039eb 100644
--- a/api/v1/entries/stories.php
+++ b/api/v1/entries/stories.php
@@ -68,7 +68,7 @@ class storiesEntry extends entry
if(!$productID and isset($this->requestBody->product)) $productID = $this->requestBody->product;
if(!$productID) return $this->sendError(400, 'Need product id.');
- $fields = 'title,spec,verify,reviewer,type,parent,plan,module,moduleOptionMenu,source,sourceNote,category,pri,estimate,mailto,keywords,notifyemail,uid,URS';
+ $fields = 'title,spec,verify,reviewer,type,parent,plan,module,moduleOptionMenu,source,sourceNote,category,pri,estimate,mailto,keywords,notifyemail,uid,URS,status';
$this->batchSetPost($fields);
/* If reviewer is not post, set needNotReview. */
@@ -76,6 +76,7 @@ class storiesEntry extends entry
if(empty($reviewer)) $this->setPost('needNotReview', 1);
$this->setPost('product', $productID);
$this->setPost('type', $this->param('type', 'story'));
+ $this->setPost('status', $this->param('status', 'draft'));
$control = $this->loadController('story', 'create');
$this->requireFields('title,spec,pri,category');
diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php
index e18d52847f..f4de1d3f1b 100644
--- a/lib/dao/dao.class.php
+++ b/lib/dao/dao.class.php
@@ -263,12 +263,11 @@ class dao extends baseDAO
continue;
}
- if(!isset($this->sqlobj->data->{$field->field})) $this->sqlobj->data->{$field->field} = false;
-
/* Check rules of fields. */
foreach($field->ruleData as $rule)
{
if(empty($rule)) continue;
+ if(!isset($this->sqlobj->data->{$field->field})) continue;
if($rule->type == 'system')
{
diff --git a/module/action/model.php b/module/action/model.php
index 2b7f61ce1e..9fd4a46593 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -50,7 +50,7 @@ class actionModel extends model
$action->extra = $extra;
if(!defined('IN_UPGRADE')) $action->vision = $this->config->vision;
- if($objectType == 'story' and strpos(',reviewpassed,reviewrejected,reviewclarified,', ",$actionType,") !== false) $action->actor = $this->lang->action->system;
+ if($objectType == 'story' and strpos(',reviewpassed,reviewrejected,reviewclarified,reviewreverted,', ",$actionType,") !== false) $action->actor = $this->lang->action->system;
/* Use purifier to process comment. Fix bug #2683. */
$action->comment = fixer::stripDataTags($comment);
@@ -1631,12 +1631,6 @@ class actionModel extends model
}
}
- if($action->objectType == 'reviewissue')
- {
- $project = $this->dao->select('project')->from(TABLE_REVIEWISSUE)->where('id')->eq($action->objectID)->fetch('project');
- $action->objectLink = helper::createLink('reviewissue', 'view', "project=$project&issueID=$action->objectID");
- }
-
if($action->objectType == 'review')
{
$action->objectLink = helper::createLink('review', 'view', "reviewID=$action->objectID");
diff --git a/module/block/control.php b/module/block/control.php
index 18ba598678..c078c7a1bc 100755
--- a/module/block/control.php
+++ b/module/block/control.php
@@ -1198,24 +1198,16 @@ class block extends control
$weeks = $this->loadModel('weekly')->getWeekPairs($begin);
$current = zget($weeks, $date, '');
- $task = $this->dao->select("
- sum(consumed) as totalConsumed,
- sum(if(status != 'cancel' and status != 'closed', `left`, 0)) as totalLeft")
- ->from(TABLE_TASK)->where('project')->eq($this->session->project)
- ->andWhere('deleted')->eq(0)
- ->andWhere('parent')->lt(1)
- ->fetch();
-
$this->weekly->save($this->session->project, $date);
- $this->view->pv = $this->weekly->getPV($this->session->project, $today);
- $this->view->ev = $this->weekly->getEV($this->session->project, $today);
- $this->view->ac = $this->weekly->getAC($this->session->project, $today);
+ $this->view->pv = (float)$this->weekly->getPV($this->session->project, $today);
+ $this->view->ev = (float)$this->weekly->getEV($this->session->project, $today);
+ $this->view->ac = (float)$this->weekly->getAC($this->session->project, $today);
$this->view->sv = $this->weekly->getSV($this->view->ev, $this->view->pv);
$this->view->cv = $this->weekly->getCV($this->view->ev, $this->view->ac);
$this->view->current = $current;
- $this->view->progress = ($task->totalConsumed + $task->totalLeft) ? floor($task->totalConsumed / ($task->totalConsumed + $task->totalLeft) * 1000) / 1000 * 100 : 0;
+ $this->view->progress = !empty($this->view->pv) ? floor($this->view->ac / $this->view->pv * 1000) / 1000 * 100 : 0;
}
/**
diff --git a/module/block/view/todoblock.html.php b/module/block/view/todoblock.html.php
index 81b1c76209..65e41c4388 100644
--- a/module/block/view/todoblock.html.php
+++ b/module/block/view/todoblock.html.php
@@ -37,6 +37,7 @@ if(!$selfCall) die(include('./todolist.html.php'));
.block-todoes .todo-flexbetween {display: flex; justify-content: space-between;}
.block-todoes #todoList {display: flex; overflow: hidden;}
.block-todoes .label-todo {width: 50px; min-width: 50px!important; border: none; color: #43A047;}
+.block-todoes .todo-title.text-ellipsis {text-overflow: unset;}
[lang^='en'] .block-todoes .todo-pri {width: 60px; min-width: 60px;}
@@ -93,29 +94,31 @@ if(!$selfCall) die(include('./todolist.html.php'));
-
+
diff --git a/module/company/control.php b/module/company/control.php
index 641876ccf0..9e22d7d373 100644
--- a/module/company/control.php
+++ b/module/company/control.php
@@ -107,8 +107,8 @@ class company extends control
return print(js::reload('parent.parent'));
}
- $this->view->title = $this->lang->company->common . $this->lang->colon . $this->lang->company->create;
- $this->view->position = $this->lang->company->create;
+ $this->view->title = $this->lang->company->common . $this->lang->colon . $this->lang->company->create;
+ $this->view->position = $this->lang->company->create;
$this->display();
}
@@ -136,9 +136,9 @@ class company extends control
$this->company->setMenu();
$title = $this->lang->company->common . $this->lang->colon . $this->lang->company->edit;
$position[] = $this->lang->company->edit;
- $this->view->title = $title;
- $this->view->position = $position;
- $this->view->company = $this->company->getById($this->app->company->id);
+ $this->view->title = $title;
+ $this->view->position = $position;
+ $this->view->company = $this->company->getById($this->app->company->id);
$this->display();
}
@@ -253,8 +253,8 @@ class company extends control
/* Get actions. */
if($browseType != 'bysearch')
{
- if(!$productID) $productID = 'all';
- if(!$projectID) $projectID = 'all';
+ if(!$productID) $productID = 'all';
+ if(!$projectID) $projectID = 'all';
if(!$executionID) $executionID = 'all';
$actions = $this->action->getDynamic($account, $browseType, $orderBy, $pager, $productID, $projectID, $executionID, $date, $direction);
}
diff --git a/module/company/model.php b/module/company/model.php
index 4c98aa2076..eeabdbbc22 100644
--- a/module/company/model.php
+++ b/module/company/model.php
@@ -66,6 +66,7 @@ class companyModel extends model
/**
* Get users.
*
+ * @param string $browseType
* @param string $type
* @param int $queryID
* @param int $deptID
diff --git a/module/dept/model.php b/module/dept/model.php
index d50338310a..7fd5752c90 100644
--- a/module/dept/model.php
+++ b/module/dept/model.php
@@ -113,14 +113,8 @@ class deptModel extends model
krsort($deptMenu);
$topMenu = array_pop($deptMenu);
$topMenu = explode("\n", trim((string)$topMenu));
- if($this->app->tab == 'report')
- {
- $lastMenu[] = '/' . $this->lang->dept->noDepartment;
- }
- else
- {
- $lastMenu[] = '/';
- }
+
+ $lastMenu[] = '/';
foreach($topMenu as $menu)
{
if(!strpos($menu, '|')) continue;
diff --git a/module/dev/model.php b/module/dev/model.php
index e5e7dfa1ff..207f1e893a 100644
--- a/module/dev/model.php
+++ b/module/dev/model.php
@@ -154,85 +154,79 @@ class devModel extends model
foreach($methods as $method)
{
if($method->class == 'baseControl' or $method->class == 'control' or $method->name == '__construct') continue;
- $api = array('name' => $method->name, 'post' => false, 'default' => array());
+ $api = array('name' => $method->name, 'post' => false, 'param' => array());
$methodReflect = new ReflectionMethod($module, $method->name);
foreach($methodReflect->getParameters() as $key => $param)
{
- try
- {
- $api['default'][$param->getName()] = $param->getDefaultValue();
- }catch(ReflectionException $e){}
+ $paramName = $param->getName();
+ $api['param'][$paramName] = array('var' => $paramName, 'type' => '', 'desc' => '');
}
+
$startLine = $methodReflect->getStartLine();
$endLine = $methodReflect->getEndLine();
$comment = $methodReflect->getDocComment();
- $file = file($fileName);
- for($i = $startLine - 1; $i <= $endLine; $i++)
+ if($startLine > 0)
{
- if(strpos($file[$i], '$this->post') or strpos($file[$i], 'fixer::input') or strpos($file[$i], '$_POST'))
+ $file = file($fileName);
+ for($i = $startLine - 1; $i <= $endLine; $i++)
{
- $api['post'] = true;
+ if(strpos($file[$i], '$this->post') or strpos($file[$i], 'fixer::input') or strpos($file[$i], '$_POST')) $api['post'] = true;
}
}
- // Strip the opening and closing tags of the docblock.
- $comment = substr($comment, 3, -2);
-
- // Split into arrays of lines.
- $comment = preg_split('/\r?\n\r?/', $comment);
-
- // Trim asterisks and whitespace from the beginning and whitespace from the end of lines.
- $comment = array_map(array('devModel', "trimSpace"), $comment);
-
- // Group the lines together by @tags
- $blocks = array();
- $b = -1;
- foreach ($comment as $line)
+ if($comment)
{
- if (isset($line[1]) && $line[0] == '@' && ctype_alpha($line[1]))
- {
- $b++;
- $blocks[] = array();
- }
- else if($b == -1)
- {
- $b = 0;
- $blocks[] = array();
- }
- $blocks[$b][] = $line;
- }
+ // Strip the opening and closing tags of the docblock.
+ $comment = substr($comment, 3, -2);
- // Parse the blocks
- foreach ($blocks as $block => $body)
- {
- $body = trim(implode("\n", $body));
- if($block == 0 && !(isset($body[1]) && $body[0] == '@' && ctype_alpha($body[1])))
+ // Split into arrays of lines.
+ $comment = preg_split('/\r?\n\r?/', $comment);
+
+ // Trim asterisks and whitespace from the beginning and whitespace from the end of lines.
+ $comment = array_map(array('devModel', "trimSpace"), $comment);
+
+ // Group the lines together by @tags
+ $blocks = array();
+ $b = -1;
+ foreach($comment as $line)
{
- // This is the description block
- $api['desc'] = $body;
- continue;
+ if(isset($line[1]) && $line[0] == '@' && ctype_alpha($line[1])) $b++;
+ if($b == -1) $b = 0;
+
+ if(!isset($blocks[$b])) $blocks[$b] = array();
+ $blocks[$b][] = $line;
}
- else
+
+ // Parse the blocks
+ foreach($blocks as $block => $body)
{
+ $body = trim(implode("\n", $body));
+ if($block == 0 && !(isset($body[1]) && $body[0] == '@' && ctype_alpha($body[1])))
+ {
+ // This is the description block
+ $api['desc'] = $body;
+ continue;
+ }
+
// This block is tagged
if(preg_match('/^@[a-z0-9_]+/', $body, $matches))
{
$tag = substr($matches[0], 1);
- $body = substr($body, strlen($tag)+2);
- if($tag == 'param')
- {
- $parts = preg_split('/\s+/', trim($body), 3);
- $parts = array_pad($parts, 3, null);
- $property = array('type', 'var', 'desc');
- $param = array_combine($property, $parts);
- $param['var'] = substr($param['var'], 1);
- $api['param'][] = $param;
- }
- else
+ $body = substr($body, strlen($tag) + 2);
+ if($tag != 'param')
{
$api[$tag][] = $body;
+ continue;
}
+
+ $parts = preg_split('/\s+/', trim($body), 3);
+ $parts = array_pad($parts, 3, null);
+ $property = array('type', 'var', 'desc');
+ $param = array_combine($property, $parts);
+ $paramName = substr($param['var'], 1);
+ $param['var'] = $paramName;
+ if(isset($api['param'][$paramName])) $api['param'][$paramName] = $param;
}
}
}
@@ -245,7 +239,7 @@ class devModel extends model
* Get all modules.
*
* @access public
- * @return void
+ * @return array
*/
public function getModules()
{
@@ -258,7 +252,7 @@ class devModel extends model
$module = basename($module);
if($module == 'editor' or $module == 'help' or $module == 'setting' or $module == 'common') continue;
$group = zget($this->config->dev->group, $module, 'other');
- $modules[$group][] = $module;
+ $modules[$group][$module] = $module;
}
$extPaths = $this->getModuleExtPath();
@@ -272,7 +266,7 @@ class devModel extends model
$module = basename($path);
if($module == 'editor' or $module == 'help' or $module == 'setting' or $module == 'common') continue;
$group = zget($this->config->dev->group, $module, 'other');
- $modules[$group][] = $module;
+ $modules[$group][$module] = $module;
}
}
diff --git a/module/doc/view/createtexttype.html.php b/module/doc/view/createtexttype.html.php
index f74ded32e3..3342f71e1d 100644
--- a/module/doc/view/createtexttype.html.php
+++ b/module/doc/view/createtexttype.html.php
@@ -48,7 +48,10 @@
#basicInfoLink {border: unset;}
+#modalBasicInfo .modal-content {overflow-x: hidden; overflow-y: scroll;}
+#modalBasicInfo .modal-body {padding-bottom: 10px;}
.modal-title {font-size: 14px !important; font-weight: 700 !important;}
+#basicInfoBox tfoot td {padding-bottom: 0;}
' . $lang->doc->createLib, '', 'class="iframe hidden createCustomLib"');?>
@@ -81,7 +84,7 @@
-