diff --git a/db/update18.3.sql b/db/update18.3.sql
index 67e915554a..0dcad3eabd 100644
--- a/db/update18.3.sql
+++ b/db/update18.3.sql
@@ -384,6 +384,12 @@ INNER JOIN zt_project AS t2 ON t1.`project` = t2.`id`
SET t1.`addedDate` = t2.`openedDate`, t1.`addedBy` = t2.`openedBy`
WHERE t1.`type` = 'project' AND t1.`main` = '1';
+/* Update the execution document. */
+UPDATE zt_doc AS t1
+LEFT JOIN zt_project t2 ON t1.`execution` = t2.`id`
+SET t1.`project` = t2.`project`
+WHERE t1.`execution` != '0' AND t1.`project` = '0' AND t2.`project` != '0';
+
/* Update the execution master library. */
UPDATE zt_doclib AS t1
INNER JOIN zt_project AS t2 ON t1.`execution` = t2.`id`
diff --git a/framework/control.class.php b/framework/control.class.php
index 82549c6859..2dfca05829 100644
--- a/framework/control.class.php
+++ b/framework/control.class.php
@@ -35,7 +35,7 @@ class control extends baseControl
$this->app->setOpenApp();
- if(!isset($this->config->bizVersion)) return false;
+ if($this->config->edition == 'open') return false;
/* Code for task #9224. Set requiredFields for workflow. */
if($this->dbh and (defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE == 'api')))
@@ -424,7 +424,7 @@ class control extends baseControl
*/
public function buildOperateMenu($object, $type = 'view')
{
- if(!isset($this->config->bizVersion)) return false;
+ if($this->config->edition == 'open') return false;
$moduleName = $this->moduleName;
return $this->$moduleName->buildOperateMenu($object, $type);
@@ -439,7 +439,7 @@ class control extends baseControl
*/
public function executeHooks($objectID)
{
- if(!isset($this->config->bizVersion)) return false;
+ if($this->config->edition == 'open') return false;
$moduleName = $this->moduleName;
return $this->$moduleName->executeHooks($objectID);
@@ -454,7 +454,7 @@ class control extends baseControl
*/
public function getFlowExportFields()
{
- if(!isset($this->config->bizVersion)) return array();
+ if($this->config->edition == 'open') return array();
$moduleName = $this->moduleName;
return $this->$moduleName->getFlowExportFields();
@@ -478,7 +478,7 @@ class control extends baseControl
*/
public function printExtendFields($object, $type, $extras = '', $print = true, $moduleName = '', $methodName = '')
{
- if(!isset($this->config->bizVersion)) return false;
+ if($this->config->edition == 'open') return false;
$moduleName = $moduleName ? $moduleName : $this->app->getModuleName();
$methodName = $methodName ? $methodName : $this->app->getMethodName();
diff --git a/framework/model.class.php b/framework/model.class.php
index 2287fb1103..b94ced3241 100644
--- a/framework/model.class.php
+++ b/framework/model.class.php
@@ -99,7 +99,7 @@ class model extends baseModel
if(empty($method)) $method = $methodName;
static $actions = array();
- if(isset($this->config->bizVersion))
+ if($this->config->edition != 'open')
{
if(empty($actions[$moduleName]))
{
@@ -155,7 +155,7 @@ class model extends baseModel
*/
public function buildFlowMenu($module, $data, $type = 'browse', $show = '')
{
- if(!isset($this->config->bizVersion)) return '';
+ if($this->config->edition == 'open') return '';
$moduleName = $module;
if(strpos($module, '.') !== false) list($appName, $moduleName) = explode('.', $module);
@@ -233,7 +233,7 @@ class model extends baseModel
*/
public function processStatus($module, $record)
{
- if(!isset($this->config->bizVersion) or empty($record->subStatus)) return zget($this->lang->$module->statusList, $record->status);
+ if($this->config->edition == 'open' or empty($record->subStatus)) return zget($this->lang->$module->statusList, $record->status);
return $this->loadModel('workflowfield')->processSubStatus($module, $record);
}
@@ -247,7 +247,7 @@ class model extends baseModel
*/
public function processExportData($data)
{
- if(!isset($this->config->bizVersion)) return $data;
+ if($this->config->edition == 'open') return $data;
return $this->loadModel('workflowfield')->processExportData($data);
}
@@ -261,7 +261,7 @@ class model extends baseModel
*/
public function processExportOptions($data)
{
- if(!isset($this->config->bizVersion)) return $data;
+ if($this->config->edition == 'open') return $data;
return $this->loadModel('workflowfield')->processExportOptions($data);
}
@@ -275,7 +275,7 @@ class model extends baseModel
*/
public function processImportData($data)
{
- if(!isset($this->config->bizVersion)) return $data;
+ if($this->config->edition == 'open') return $data;
return $this->loadModel('workflowfield')->processImportData($data);
}
@@ -288,7 +288,7 @@ class model extends baseModel
*/
public function getFlowExtendFields()
{
- if(!isset($this->config->bizVersion)) return array();
+ if($this->config->edition == 'open') return array();
return $this->loadModel('flow')->getExtendFields($this->app->getModuleName(), $this->app->getMethodName());
}
@@ -301,7 +301,7 @@ class model extends baseModel
*/
public function getFlowExportFields()
{
- if(!isset($this->config->bizVersion)) return array();
+ if($this->config->edition == 'open') return array();
return $this->loadModel('workflowfield')->getExportFields($this->app->getModuleName());
}
@@ -315,7 +315,7 @@ class model extends baseModel
*/
public function executeHooks($objectID)
{
- if(!isset($this->config->bizVersion)) return false;
+ if($this->config->edition == 'open') return false;
$moduleName = $this->app->getModuleName();
$methodName = $this->app->getMethodName();
diff --git a/framework/router.class.php b/framework/router.class.php
index ac909cfb8b..41f2eaa016 100755
--- a/framework/router.class.php
+++ b/framework/router.class.php
@@ -478,7 +478,7 @@ class router extends baseRouter
if(empty($this->rawMethod)) $this->rawMethod = $this->methodName;
/* If is not a biz version or is in install mode or in in upgrade mode, call parent method. */
- if(!isset($this->config->bizVersion) or defined('IN_INSTALL') or defined('IN_UPGRADE')) return parent::setControlFile($exitIfNone);
+ if($this->config->edition == 'open' or defined('IN_INSTALL') or defined('IN_UPGRADE')) return parent::setControlFile($exitIfNone);
/* Check if the requested module is defined in workflow. */
$flow = $this->dbh->query("SELECT * FROM " . TABLE_WORKFLOW . " WHERE `module` = '$this->moduleName'")->fetch();
diff --git a/module/action/model.php b/module/action/model.php
index b2d40af67a..d54f772a6f 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -1136,9 +1136,7 @@ class actionModel extends model
->beginIF($account != 'all')->andWhere('actor')->eq($account)->fi()
->beginIF($beginDate)->andWhere('date')->ge($beginDate)->fi()
->beginIF(is_numeric($productID))->andWhere('product')->like("%,$productID,%")->fi()
- ->andWhere()
- ->markLeft(1)
- ->where('1=1')
+ ->andWhere('1=1', true)
->beginIF(is_numeric($projectID))->andWhere('project')->eq($projectID)->fi()
->beginIF(!empty($executions))->andWhere('execution')->in(array_keys($executions))->fi()
->beginIF(is_numeric($executionID))->andWhere('execution')->eq($executionID)->fi()
diff --git a/module/admin/control.php b/module/admin/control.php
index be3f68d288..be05d520ba 100755
--- a/module/admin/control.php
+++ b/module/admin/control.php
@@ -478,7 +478,7 @@ class admin extends control
$response['thisTable'] = '';
$response['nextTable'] = '';
- $tableEngines = $this->loadModel('misc')->getTableEngines();
+ $tableEngines = $this->dao->getTableEngines();
$thisTable = '';
$nextTable = '';
diff --git a/module/api/control.php b/module/api/control.php
index 3563dfd41a..b338cac69b 100755
--- a/module/api/control.php
+++ b/module/api/control.php
@@ -52,6 +52,15 @@ class api extends control
$objectType = $this->objectType;
$objectID = $this->objectID;
$isFirstLoad = $libID ? false : true;
+ if($libID)
+ {
+ $lib = $this->doc->getLibById($libID);
+ if($objectType == 'nolink' and !$objectID and ($lib->product or $lib->project))
+ {
+ $objectType = $lib->product ? 'product' : 'project';
+ $objectID = $lib->product ? $lib->product : $lib->project;
+ }
+ }
if($release)
{
@@ -158,7 +167,7 @@ class api extends control
if(!strpos($this->server->http_referer, 'space') and !strpos($this->server->http_referer, 'api')) setCookie("docSpaceParam", '', $this->config->cookieLife, $this->config->webRoot, '', false, true);
/* Get all api doc libraries. */
- $libs = $this->doc->getApiLibs($libID);
+ $libs = $this->doc->getApiLibs($libID, $this->objectType, $this->objectID);
$api = $this->api->getLibById($apiID, $version, $release);
if($api)
{
@@ -174,7 +183,7 @@ class api extends control
}
/* Crumbs links array. */
- $lib = zget($libs, $libID);
+ $lib = zget($libs, $libID);
$type = $lib->product ? 'product' : ($lib->project ? 'project' : 'unlink');
$methodName = $type != 'unlink' ? $type . 'Space' : 'index';
@@ -768,7 +777,7 @@ class api extends control
if(in_array($this->session->spaceType, array('product', 'project')))
{
- $this->lang->doc->menu->api['exclude'] = 'api-' . $this->app->rawMethod;
+ $this->lang->doc->menu->api['exclude'] = 'api-' . $this->app->rawMethod . ',' . $this->app->rawMethod;
$this->lang->doc->menu->{$this->session->spaceType}['subModule'] = 'api';
}
else
diff --git a/module/api/view/apilist.html.php b/module/api/view/apilist.html.php
index 897a1c6da9..75e50d6ebf 100644
--- a/module/api/view/apilist.html.php
+++ b/module/api/view/apilist.html.php
@@ -115,7 +115,7 @@
-
lib}&moduleID=0&apiID={$api->id}&version=0&release=$release");?>" data-app="tab;?>">
+ lib}&moduleID=0&apiID={$api->id}&version=0");?>" data-app="tab;?>">
method;?>
path;?>
title;?>
diff --git a/module/chart/lang/de.php b/module/chart/lang/de.php
index dfbb0c6642..65b1d63669 100644
--- a/module/chart/lang/de.php
+++ b/module/chart/lang/de.php
@@ -36,7 +36,7 @@ $lang->chart->typeList = array();
$lang->chart->typeList['pie'] = 'Pie';
$lang->chart->typeList['line'] = 'Line';
$lang->chart->typeList['radar'] = 'Radar';
-$lang->chart->typeList['cluBarY'] = 'clustered Bar Y';
-$lang->chart->typeList['stackedBarY'] = 'stacked Bar Y';
-$lang->chart->typeList['cluBarX'] = 'clustered Bar X';
-$lang->chart->typeList['stackedBar'] = 'stacked Bar';
+$lang->chart->typeList['cluBarY'] = 'Clustered Bar Y';
+$lang->chart->typeList['stackedBarY'] = 'Stacked Bar Y';
+$lang->chart->typeList['cluBarX'] = 'Clustered Bar X';
+$lang->chart->typeList['stackedBar'] = 'Stacked Bar';
diff --git a/module/chart/lang/en.php b/module/chart/lang/en.php
index dfbb0c6642..65b1d63669 100644
--- a/module/chart/lang/en.php
+++ b/module/chart/lang/en.php
@@ -36,7 +36,7 @@ $lang->chart->typeList = array();
$lang->chart->typeList['pie'] = 'Pie';
$lang->chart->typeList['line'] = 'Line';
$lang->chart->typeList['radar'] = 'Radar';
-$lang->chart->typeList['cluBarY'] = 'clustered Bar Y';
-$lang->chart->typeList['stackedBarY'] = 'stacked Bar Y';
-$lang->chart->typeList['cluBarX'] = 'clustered Bar X';
-$lang->chart->typeList['stackedBar'] = 'stacked Bar';
+$lang->chart->typeList['cluBarY'] = 'Clustered Bar Y';
+$lang->chart->typeList['stackedBarY'] = 'Stacked Bar Y';
+$lang->chart->typeList['cluBarX'] = 'Clustered Bar X';
+$lang->chart->typeList['stackedBar'] = 'Stacked Bar';
diff --git a/module/chart/lang/fr.php b/module/chart/lang/fr.php
index dfbb0c6642..65b1d63669 100644
--- a/module/chart/lang/fr.php
+++ b/module/chart/lang/fr.php
@@ -36,7 +36,7 @@ $lang->chart->typeList = array();
$lang->chart->typeList['pie'] = 'Pie';
$lang->chart->typeList['line'] = 'Line';
$lang->chart->typeList['radar'] = 'Radar';
-$lang->chart->typeList['cluBarY'] = 'clustered Bar Y';
-$lang->chart->typeList['stackedBarY'] = 'stacked Bar Y';
-$lang->chart->typeList['cluBarX'] = 'clustered Bar X';
-$lang->chart->typeList['stackedBar'] = 'stacked Bar';
+$lang->chart->typeList['cluBarY'] = 'Clustered Bar Y';
+$lang->chart->typeList['stackedBarY'] = 'Stacked Bar Y';
+$lang->chart->typeList['cluBarX'] = 'Clustered Bar X';
+$lang->chart->typeList['stackedBar'] = 'Stacked Bar';
diff --git a/module/chart/model.php b/module/chart/model.php
index 9192c34b29..5dd1919c42 100644
--- a/module/chart/model.php
+++ b/module/chart/model.php
@@ -72,7 +72,7 @@ class chartModel extends model
if(!empty($chart->sql)) $chart->sql = trim(str_replace(';', '', $chart->sql));
if(!empty($chart->settings)) $chart->settings = json_decode($chart->settings, true);
- if(!empty($chart->settings) and is_array($chart->settings))
+ if(empty($chart->type) and !empty($chart->settings) and is_array($chart->settings))
{
$firstSetting = current($chart->settings);
if(isset($firstSetting['type'])) $chart->type = $firstSetting['type'];
@@ -696,5 +696,110 @@ class chartModel extends model
return $filterFormat;
}
+
+ /**
+ * Get tables.
+ *
+ * @param string $sql
+ * @access public
+ * @return array
+ */
+ public function getTables($sql)
+ {
+ $processedSql = trim($sql, ';');
+ $processedSql = str_replace(array("\r\n", "\n"), ' ', $processedSql);
+ $processedSql = str_replace('`', '', $processedSql);
+ preg_match_all('/^select (.+) from (.+)$/i', $processedSql, $selectAndFrom);
+ if(empty($selectAndFrom[2][0])) return false;
+
+ $selectSql = $selectAndFrom[1][0];
+ $tableSql = $fromSql = $selectAndFrom[2][0];
+ if(stripos($fromSql, 'where') !== false) $tableSql = trim(substr($fromSql, 0, stripos($fromSql, 'where')));
+ if(stripos($fromSql, 'limit') !== false) $tableSql = trim(substr($fromSql, 0, stripos($fromSql, 'limit')));
+ if(stripos($fromSql, 'having') !== false) $tableSql = trim(substr($fromSql, 0, stripos($fromSql, 'having')));
+ if(stripos($fromSql, 'group by') !== false) $tableSql = trim(substr($fromSql, 0, stripos($fromSql, 'group by')));
+
+ /* Remove such as "left join|right join|join", "on (t1.id=t2.id)", result like t1, t2 as t3. */
+ $tableSql .= ' ';
+ if(stripos($tableSql, 'join') !== false) $tableSql = preg_replace(array('/join\s+([A-Z]+_\w+ .*)on/Ui', '/,\s*on\s+[^,]+/i'), array(',$1,on', ''), $tableSql);
+
+ /* Match t2 as t3 */
+ preg_match_all('/(\w+) +as +(\w+)/i', $tableSql, $out);
+
+ $fields = explode(',', $selectSql);
+ foreach($fields as $i => $field)
+ {
+ if($field) $asField = '';
+ if(strrpos($field, ' as ') !== false) list($field, $asField) = explode(' as ', $field);
+ if(strrpos($field, ' AS ') !== false) list($field, $asField) = explode(' AS ', $field);
+
+ $field = trim($field);
+ $asField = trim($asField);
+ $fieldName = $field;
+ if(strrpos($field, '.') !== false)
+ {
+ $table = substr($field, 0, strrpos($field, '.'));
+ $fieldName = substr($field, strrpos($field, '.') + 1);
+ if(!empty($out[0]) and in_array($table, $out[2]))
+ {
+ $realTable = $out[1][array_search($table, $out[2])];
+ $tableFieldName = str_replace($table . '.', $realTable . '.', $field);
+
+ if(isset($fields[$fieldName]) && !$asField)
+ {
+ $fieldName = str_replace('.', '', $field);
+
+ $sql = preg_replace(array("/$field/", "/`$field`/"), array("$field AS $fieldName", "`$field` AS $fieldName"), $sql, 1);
+
+ $field = $tableFieldName;
+ }
+ }
+
+ if($fieldName == '*') $fieldName = $field;
+ }
+
+ $fieldName = $asField ? $asField : $fieldName;
+
+ $fields[$fieldName] = $field;
+ unset($fields[$i]);
+ }
+
+ $tableSql = preg_replace('/as +\w+/i', ' ', $tableSql);
+ $tableSql = trim(str_replace(array('(', ')', ','), ' ', $tableSql));
+ $tableSql = preg_replace('/ +/', ' ', $tableSql);
+
+ $tables = explode(' ', $tableSql);
+
+ return array('sql' => $sql, 'tables' => $tables, 'fields' => $fields);
+ }
+
+ /**
+ * Parse variables to null string in sql.
+ *
+ * @param string $sql
+ * @access public
+ * @return string
+ */
+ public function parseSqlVars($sql, $filters)
+ {
+ if($filters)
+ {
+ foreach($filters as $filter)
+ {
+ if(!isset($filter['default'])) continue;
+ if(isset($filter['from']) and $filter['from'] == 'query')
+ {
+ $default = "'{$filter['default']}'";
+ $sql = str_replace('$' . $filter['field'], $default, $sql);
+ }
+ }
+ }
+ if(preg_match_all("/[\$]+[a-zA-Z0-9]+/", $sql, $out))
+ {
+ foreach($out[0] as $match) $sql = str_replace($match, "''", $sql);
+ }
+
+ return $sql;
+ }
}
diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php
index d602aa4238..b84a44a518 100644
--- a/module/common/lang/menu.php
+++ b/module/common/lang/menu.php
@@ -256,7 +256,7 @@ $lang->waterfall->menu = new stdclass();
$lang->waterfall->menu->index = array('link' => "$lang->dashboard|project|index|project=%s");
$lang->waterfall->menu->execution = array('link' => "{$lang->stage->common}|project|execution|status=all&projectID=%s", 'subModule' => 'programplan,task');
$lang->waterfall->menu->storyGroup = array('link' => "{$lang->common->story}|projectstory|story|projectID=%s",'class' => 'dropdown dropdown-hover', 'exclude' => 'tree-browse,projectstory-track');
-$lang->waterfall->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story', 'exclude' => 'projectstory-track');
+$lang->waterfall->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story', 'exclude' => 'projectstory-track,tree-browse');
$lang->waterfall->menu->design = array('link' => "{$lang->design->common}|design|browse|project=%s");
$lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport');
$lang->waterfall->menu->doc = array('link' => "{$lang->doc->common}|doc|projectSpace|objectID=%s");
@@ -264,18 +264,9 @@ $lang->waterfall->menu->devops = array('link' => "{$lang->repo->common}|repo
$lang->waterfall->menu->build = array('link' => "{$lang->build->common}|projectbuild|browse|project=%s", 'subModule' => 'projectbuild');
$lang->waterfall->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease');
$lang->waterfall->menu->dynamic = array('link' => "$lang->dynamic|project|dynamic|project=%s");
-$lang->waterfall->menu->settings = array('link' => "$lang->settings|project|view|project=%s", 'subModule' => 'stakeholder', 'alias' => 'edit,manageproducts,group,managemembers,manageview,managepriv,whitelist,addwhitelist,team', 'exclude' => 'tree-browsetask');
-$lang->waterfall->menu->settings['subMenu'] = new stdclass();
-$lang->waterfall->menu->settings['subMenu']->view = array('link' => "$lang->overview|project|view|project=%s", 'alias' => 'edit');
-$lang->waterfall->menu->settings['subMenu']->products = array('link' => "{$lang->productCommon}|project|manageProducts|project=%s", 'alias' => 'manageproducts');
-$lang->waterfall->menu->settings['subMenu']->members = array('link' => "{$lang->team->common}|project|team|project=%s", 'alias' => 'managemembers,team');
-$lang->waterfall->menu->settings['subMenu']->whitelist = array('link' => "{$lang->whitelist}|project|whitelist|project=%s", 'subModule' => 'personnel');
-$lang->waterfall->menu->settings['subMenu']->stakeholder = array('link' => "{$lang->stakeholder->common}|stakeholder|browse|project=%s", 'subModule' => 'stakeholder');
-$lang->waterfall->menu->settings['subMenu']->group = array('link' => "{$lang->priv}|project|group|project=%s", 'alias' => 'group,manageview,managepriv');
-$lang->waterfall->menu->settings['subMenu']->module = array('link' => "{$lang->module}|tree|browse|product=%s&view=story");
-
-$lang->waterfall->dividerMenu = ',programplan,build,dynamic,';
+$lang->waterfall->menu->settings = $lang->scrum->menu->settings;
+$lang->waterfall->dividerMenu = ',programplan,build,dynamic,';
$lang->waterfall->menu->storyGroup['dropMenu'] = $lang->scrum->menu->storyGroup['dropMenu'];
diff --git a/module/common/model.php b/module/common/model.php
index 6633796d01..11b4d910e1 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -2078,6 +2078,7 @@ EOF;
if(strtolower($key) == 'assigneddate') continue;
if(strtolower($key) == 'editedby') continue;
if(strtolower($key) == 'editeddate') continue;
+ if(strtolower($key) == 'editingdate') continue;
if(strtolower($key) == 'uid') continue;
if(strtolower($key) == 'finisheddate' and $value == '') continue;
if(strtolower($key) == 'canceleddate' and $value == '') continue;
diff --git a/module/convert/model.php b/module/convert/model.php
index 45e48cc0ac..8eb185fec4 100644
--- a/module/convert/model.php
+++ b/module/convert/model.php
@@ -128,7 +128,7 @@ class convertModel extends model
{
$dataList = $this->dao->dbh($this->sourceDBH)->select('t1.`ID`, t1.`lower_user_name` as account, t1.`lower_display_name` as realname, t1.`lower_email_address` as email, t1.created_date as `join`, t2.user_key as userCode')->from(JIRA_USERINFO)->alias('t1')
->leftJoin(JIRA_USER)->alias('t2')->on('t1.`lower_user_name` = t2.`lower_user_name`')
- ->where(1)
+ ->where('1=1')
->beginIF($lastID)->andWhere('t1.ID')->gt($lastID)->fi()
->orderBy('t1.ID asc')->limit($limit)
->fetchAll('ID');
@@ -136,7 +136,7 @@ class convertModel extends model
elseif($module == 'project')
{
$dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_PROJECT)
- ->where(1)
+ ->where('1=1')
->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi()
->orderBy('ID asc')->limit($limit)
->fetchAll('ID');
@@ -144,7 +144,7 @@ class convertModel extends model
elseif($module == 'issue')
{
$dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_ISSUE)
- ->where(1)
+ ->where('1=1')
->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi()
->orderBy('ID asc')->limit($limit)
->fetchAll('ID');
@@ -152,7 +152,7 @@ class convertModel extends model
elseif($module == 'build')
{
$dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_BUILD)
- ->where(1)
+ ->where('1=1')
->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi()
->orderBy('ID asc')->limit($limit)
->fetchAll('ID');
@@ -160,7 +160,7 @@ class convertModel extends model
elseif($module == 'issuelink')
{
$dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_ISSUELINK)
- ->where(1)
+ ->where('1=1')
->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi()
->orderBy('ID asc')->limit($limit)
->fetchAll('ID');
@@ -168,7 +168,7 @@ class convertModel extends model
elseif($module == 'action')
{
$dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_ACTION)
- ->where(1)
+ ->where('1=1')
->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi()
->orderBy('ID asc')->limit($limit)
->fetchAll('ID');
@@ -176,7 +176,7 @@ class convertModel extends model
elseif($module == 'file')
{
$dataList = $this->dao->dbh($this->sourceDBH)->select('*')->from(JIRA_FILE)
- ->where(1)
+ ->where('1=1')
->beginIF($lastID)->andWhere('ID')->gt($lastID)->fi()
->orderBy('ID asc')->limit($limit)
->fetchAll('ID');
diff --git a/module/doc/model.php b/module/doc/model.php
index 4ed5ee207b..7a6611d5a6 100644
--- a/module/doc/model.php
+++ b/module/doc/model.php
@@ -47,13 +47,13 @@ class docModel extends model
$libs = $this->dao->select('*')->from(TABLE_DOCLIB)
->where('deleted')->eq(0)
->andWhere('type')->eq('api')
- ->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
- ->beginIF(!empty($objectType) && $objectID > 0 and $objectType != 'nolink')->andWhere($objectType)->eq($objectID)->fi()
+ ->beginIF(!empty($objectType) and $objectID > 0 and $objectType != 'nolink')->andWhere($objectType)->eq($objectID)->fi()
->beginIF($objectType == 'nolink')
->andWhere('product')->eq(0)
->andWhere('project')->eq(0)
->andWhere('execution')->eq(0)
->fi()
+ ->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
->orderBy('order_asc, id_asc')
->fetchAll('id');
@@ -1218,7 +1218,7 @@ class docModel extends model
if($libID == 0 and $browseType != 'collectedbyme') return array();
$modules = $this->dao->select('*')->from(TABLE_MODULE)
- ->where(1)
+ ->where('1=1')
->beginIF($browseType != "collectedbyme")->andWhere('root')->eq($libID)->fi()
->beginIF($browseType == "collectedbyme")->andWhere('collector')->like("%,{$this->app->user->account},%")->fi()
->andWhere('type')->eq('doc')
diff --git a/module/doc/view/editothertype.html.php b/module/doc/view/editothertype.html.php
index fe120dfb06..132dfa39a6 100644
--- a/module/doc/view/editothertype.html.php
+++ b/module/doc/view/editothertype.html.php
@@ -30,7 +30,7 @@