systemMode == 'new' and isset($project)):?>
diff --git a/module/file/view/viewfiles.html.php b/module/file/view/viewfiles.html.php
index a1534e45d3..9848291995 100644
--- a/module/file/view/viewfiles.html.php
+++ b/module/file/view/viewfiles.html.php
@@ -114,7 +114,6 @@
data: postData,
success: function(data)
{
- console.log(data['title']);
$('#fileTitle' + fileID).html(" " + data['title']);
$('#renameFile' + fileID).closest('li').removeClass('hidden');
$('#renameBox' + fileID).addClass('hidden');
diff --git a/module/group/css/managemember.css b/module/group/css/managemember.css
index c77de018bd..6676b72702 100644
--- a/module/group/css/managemember.css
+++ b/module/group/css/managemember.css
@@ -1,4 +1,5 @@
.group-item {display: block; width: 100px; float: left; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;}
-.group-item .checkbox-primary>input {cursor: pointer;}
+.group-item .checkbox-primary > input {cursor: pointer;}
+.group-item .checkbox-primary > label {width: 100px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}
.table th {vertical-align: top;}
-.main-table tbody>tr>td {border-bottom: 0px;}
+.main-table tbody > tr > td {border-bottom: 0px;}
diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php
index 333ecfee8e..56080b05d5 100644
--- a/module/group/lang/resource.php
+++ b/module/group/lang/resource.php
@@ -1632,6 +1632,7 @@ $lang->resource->admin->sso = 'ssoAction';
$lang->resource->admin->register = 'register';
$lang->resource->admin->ztCompany = 'ztCompany';
$lang->resource->admin->resetPWDSetting = 'resetPWDSetting';
+$lang->resource->admin->tableEngine = 'tableEngine';
$lang->admin->methodOrder[0] = 'index';
$lang->admin->methodOrder[5] = 'checkDB';
@@ -1641,6 +1642,7 @@ $lang->admin->methodOrder[20] = 'sso';
$lang->admin->methodOrder[25] = 'register';
$lang->admin->methodOrder[30] = 'ztCompany';
$lang->admin->methodOrder[35] = 'resetPWDSetting';
+$lang->admin->methodOrder[40] = 'tableEngine';
/* Extension. */
$lang->resource->extension = new stdclass();
diff --git a/module/index/js/index.js b/module/index/js/index.js
index 5ffb7866d8..6d4f97f5f7 100644
--- a/module/index/js/index.js
+++ b/module/index/js/index.js
@@ -464,7 +464,6 @@
if(!notTriggerEvent) app.$app.trigger('reloadapp', app);
- if(url) $(iframe.contentWindow.document.body).hide(); // Code for task #59703.
if(!isSameUrl) app.$app.addClass('loading');
if(app._loadTimer) clearTimeout(app._loadTimer);
app._loadTimer = setTimeout(function()
diff --git a/module/kanban/view/space.html.php b/module/kanban/view/space.html.php
index cd66f70129..be3ae116f3 100644
--- a/module/kanban/view/space.html.php
+++ b/module/kanban/view/space.html.php
@@ -50,7 +50,7 @@
desc) ? $lang->kanban->emptyDesc : str_replace("\n", '', strip_tags($space->desc));?>
]*>|
]*>/';?>
desc) ? $lang->kanban->emptyDesc : preg_replace($pattern, '', $space->desc);?>
-
+
status == 'closed' ? 'disabled' : '';?>
diff --git a/module/misc/lang/de.php b/module/misc/lang/de.php
index 6ad68d0fc5..90115bb702 100644
--- a/module/misc/lang/de.php
+++ b/module/misc/lang/de.php
@@ -187,7 +187,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22';
$lang->misc->releaseDate['7.1.stable'] = '2015-03-07';
$lang->misc->releaseDate['6.3.stable'] = '2014-11-07';
-$lang->misc->feature->all['17.5'][] = array('title' => "Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Optimize gantt chart, the copy project of max version can copy the task and more information. Fix bugs.", 'desc' => '');
+$lang->misc->feature->all['17.5'][] = array('title' => "Provide efficient visual statistical tools. Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.4'][] = array('title' => "Optimization of details Page visualization and jumping page logic. Improvement of Kanban function. Optimization of document creating and editing pages. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.3'][] = array('title' => "UI optimization of the modules such as statistics and background, the use case library will synchronize the function optimization information. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.2'][] = array('title' => "Adjust the display of agile project block; optimize the UI of programs, projects and tests; optimize the detailed experience. Fix bugs.", 'desc' => '');
diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php
index 9efc3dd3b5..b76497cf92 100644
--- a/module/misc/lang/en.php
+++ b/module/misc/lang/en.php
@@ -187,7 +187,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22';
$lang->misc->releaseDate['7.1.stable'] = '2015-03-07';
$lang->misc->releaseDate['6.3.stable'] = '2014-11-07';
-$lang->misc->feature->all['17.5'][] = array('title' => "Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Optimize gantt chart, the copy project of max version can copy the task and more information. Fix bugs.", 'desc' => '');
+$lang->misc->feature->all['17.5'][] = array('title' => "Provide efficient visual statistical tools. Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.4'][] = array('title' => "Optimization of details Page visualization and jumping page logic. Improvement of Kanban function. Optimization of document creating and editing pages. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.3'][] = array('title' => "UI optimization of the modules such as statistics and background, the use case library will synchronize the function optimization information. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.2'][] = array('title' => "Adjust the display of agile project block; optimize the UI of programs, projects and tests; optimize the detailed experience. Fix bugs.", 'desc' => '');
diff --git a/module/misc/lang/fr.php b/module/misc/lang/fr.php
index 2b10535179..7a70ca590f 100644
--- a/module/misc/lang/fr.php
+++ b/module/misc/lang/fr.php
@@ -187,7 +187,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22';
$lang->misc->releaseDate['7.1.stable'] = '2015-03-07';
$lang->misc->releaseDate['6.3.stable'] = '2014-11-07';
-$lang->misc->feature->all['17.5'][] = array('title' => "Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Optimize gantt chart, the copy project of max version can copy the task and more information. Fix bugs.", 'desc' => '');
+$lang->misc->feature->all['17.5'][] = array('title' => "Provide efficient visual statistical tools. Optimize ZenTao performance, the database engine is adjusted from MyISAM to InnoDB. Gantt chart is optimized and upgraded, and the Copy items of the Max version can replicate more information. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.4'][] = array('title' => "Optimization of details Page visualization and jumping page logic. Improvement of Kanban function. Optimization of document creating and editing pages. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.3'][] = array('title' => "UI optimization of the modules such as statistics and background, the use case library will synchronize the function optimization information. Fix bugs.", 'desc' => '');
$lang->misc->feature->all['17.2'][] = array('title' => "Adjust the display of agile project block; optimize the UI of programs, projects and tests; optimize the detailed experience. Fix bugs.", 'desc' => '');
diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php
index d0680416a5..1f74434ae5 100644
--- a/module/misc/lang/zh-cn.php
+++ b/module/misc/lang/zh-cn.php
@@ -187,7 +187,7 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22';
$lang->misc->releaseDate['7.1.stable'] = '2015-03-07';
$lang->misc->releaseDate['6.3.stable'] = '2014-11-07';
-$lang->misc->feature->all['17.5'][] = array('title' => '优化禅道性能,数据库引擎从MyISAM调整为InnoDB。甘特图优化升级,旗舰版的复制项目可以复制任务等更多信息。修复Bug。', 'desc' => '');
+$lang->misc->feature->all['17.5'][] = array('title' => '提供高效的可视化统计工具。优化禅道性能,数据库引擎从MyISAM调整为InnoDB。甘特图优化升级,旗舰版的复制项目可以复制任务等更多信息。修复Bug。', 'desc' => '');
$lang->misc->feature->all['17.4'][] = array('title' => '详情页面的视觉优化和部分页面跳转逻辑优化。看板功能完善。文档创建和编辑页面优化。修复Bug。', 'desc' => '');
$lang->misc->feature->all['17.3'][] = array('title' => '统计、后台等模块的UI优化,用例库同步用例信息功能优化。修复Bug。', 'desc' => '');
$lang->misc->feature->all['17.2'][] = array('title' => '调整敏捷项目区块的展示,项目集、项目和测试相关UI优化,细节体验优化。修复Bug。', 'desc' => '');
diff --git a/module/misc/model.php b/module/misc/model.php
index 68ab08a1bc..739ab197e3 100644
--- a/module/misc/model.php
+++ b/module/misc/model.php
@@ -143,4 +143,19 @@ class miscModel extends model
return $weakSites;
}
+
+ /**
+ * Get table and engine pairs.
+ *
+ * @access public
+ * @return array
+ */
+ public function getTableEngines()
+ {
+ $tableEngines = array();
+ $stmt = $this->dao->query("SHOW TABLE STATUS WHERE `Engine` is not null");
+ while($table = $stmt->fetch()) $tableEngines[$table->Name] = $table->Engine;
+
+ return $tableEngines;
+ }
}
diff --git a/module/mr/control.php b/module/mr/control.php
index 59c63e1b56..6f95b6313c 100644
--- a/module/mr/control.php
+++ b/module/mr/control.php
@@ -122,7 +122,7 @@ class mr extends control
$giteaUsers = $this->gitea->getGiteaListByAccount();
foreach($hosts as $hostID => $host)
{
- if($host->type == 'gitLab' and isset($gitlabUsers[$hostID])) continue;
+ if($host->type == 'gitlab' and isset($gitlabUsers[$hostID])) continue;
if($host->type == 'gitea' and isset($giteaUsers[$hostID])) continue;
unset($hosts[$hostID]);
@@ -186,10 +186,10 @@ class mr extends control
if(!$this->app->user->admin and $scm == 'gitlab')
{
$groupIDList = array(0 => 0);
- $groups = $this->scm->apiGetGroups($MR->hostID, 'name_asc', 'developer');
+ $groups = $this->$scm->apiGetGroups($MR->hostID, 'name_asc', 'developer');
foreach($groups as $group) $groupIDList[] = $group->id;
- $sourceProject = $this->scm->apiGetSingleProject($MR->hostID, $MR->sourceProject);
- $isDeveloper = $this->scm->checkUserAccess($MR->hostID, 0, $sourceProject, $groupIDList, 'developer');
+ $sourceProject = $this->$scm->apiGetSingleProject($MR->hostID, $MR->sourceProject);
+ $isDeveloper = $this->$scm->checkUserAccess($MR->hostID, 0, $sourceProject, $groupIDList, 'developer');
if(!isset($gitUsers[$this->app->user->account]) or !$isDeveloper) return print(js::alert($this->lang->mr->errorLang[3]) . js::locate($this->createLink('mr', 'browse')));
}
diff --git a/module/my/css/task.css b/module/my/css/task.css
index f0f26db88a..55c85389c0 100644
--- a/module/my/css/task.css
+++ b/module/my/css/task.css
@@ -3,7 +3,7 @@ td.delayed {background: #e84e0f !important; color: white;}
.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;}
.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
-.table td.has-child > a:not(.task-toggle) {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
+.table td.has-child > a:not(.task-toggle) {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; white-space: nowrap;}
.table td.has-child > .task-toggle {color: #838a9d; position: relative; top: 1px; line-height: 16px;}
.table td.has-child > .task-toggle:hover {color: #006af1; cursor: pointer;}
.table td.has-child > .task-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -o-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); transform: rotate(-90deg);}
diff --git a/module/port/config.php b/module/port/config.php
index fc8b481765..2b6ead6da0 100644
--- a/module/port/config.php
+++ b/module/port/config.php
@@ -15,9 +15,12 @@ $config->port->initFunction = 'title,control,required,';
$config->port->dateFeilds = 'estStarted,realStarted,deadline,openedDate,assignedDate,finishedDate,canceledDate,closedDate,lastEditedDate,';
$config->port->datetimeFeilds = '';
$config->port->listFields = '';
-$config->port->sysLangFields = ',pri,status,type,mode,severity,os,browser,resolution,confirmed,source,reviewResult,stage,change';
+$config->port->sysLangFields = ',pri,status,type,mode,severity,os,browser,resolution,confirmed,source,reviewResult,stage,change,category';
$config->port->sysDataFields = 'execution,product,user';
-$config->port->userFields = 'assignedTo,openedBy,finishedBy,canceledBy,closedBy,lastEditedBy,lastRunner,resolvedBy';
+$config->port->userFields = 'assignedTo,openedBy,finishedBy,canceledBy,closedBy,lastEditedBy,lastRunner,resolvedBy,reviewedBy';
+
+$config->port->defaultZeroField = 'severity,pri';
+$config->port->defaultEmptyField = '';
$config->port->import = new stdClass();
diff --git a/module/port/control.php b/module/port/control.php
index 999282c6cd..bc8edac653 100644
--- a/module/port/control.php
+++ b/module/port/control.php
@@ -104,13 +104,11 @@ class port extends control
$file = $this->loadModel('file')->getUpload('file');
$file = $file[0];
$shortName = $this->file->getSaveName($file['pathname']);
- if(empty($shortName))
- {
- die(js::alert($this->lang->excel->emptyFileName));
- }
- $extension = $file['extension'];
- $fileName = $this->file->savePath . $shortName;
+ if(empty($shortName)) die(js::alert($this->lang->excel->emptyFileName));
+
+ $extension = $file['extension'];
+ $fileName = $this->file->savePath . $shortName;
move_uploaded_file($file['tmpname'], $fileName);
@@ -146,9 +144,13 @@ class port extends control
{
$filter = '';
if($model == 'task') $filter = 'estimate';
+ if($model == 'story')
+ {
+ if($this->session->storyType) $this->loadModel('story')->replaceUserRequirementLang();
+ }
$this->loadModel($model);
- $importFields = $this->config->$model->templateFields;
+ $importFields = !empty($_SESSION[$model . 'TemplateFields']) ? $_SESSION[$model . 'TemplateFields'] : $this->config->$model->templateFields;
$fields = $this->port->initFieldList($model, $importFields, false);
$formatDatas = $this->port->format($model, $filter);
$datas = $this->port->getPageDatas($formatDatas, $pagerID);
@@ -184,9 +186,11 @@ class port extends control
$fieldList = $this->port->initFieldList($model, $fields, false);
if(empty($fieldList[$field]['values'])) $fieldList[$field]['values'] = array();
- if(!isset($fieldList[$field]['values'][''])) $fieldList[$field]['values'][''] = '';
+
$multiple = $fieldList[$field]['control'] == 'multiple' ? 'multiple' : '';
- return print(html::select($field . "[$index]", $fieldList[$field]['values'], $value, "class='form-control picker-select' $multiple"));
+ $name = $field . "[$index]";
+ if($multiple == 'multiple') $name .= "[]";
+ return print(html::select($name, $fieldList[$field]['values'], $value, "class='form-control picker-select' data-field='$field' data-index='$index' $multiple"));
}
}
diff --git a/module/port/model.php b/module/port/model.php
index 3e664c4401..ffc231ee4f 100644
--- a/module/port/model.php
+++ b/module/port/model.php
@@ -212,6 +212,7 @@ class portModel extends model
*/
public function initPostFields($model = '')
{
+ $this->commonActions($model);
$datas = fixer::input('post')->get();
$objectData = array();
foreach ($datas as $field => $data)
@@ -220,7 +221,7 @@ class portModel extends model
{
foreach($data as $key => $value)
{
- if(is_array($value) and array_key_exists($field, $this->config->$model->fieldList) and $this->config->$model->fieldList[$field]['control'] == 'multiple') $value = implode(',', $value);
+ if(is_array($value)) $value = join(',', $value);
$objectData[$key][$field] = $value;
}
}
@@ -258,7 +259,7 @@ class portModel extends model
foreach ($portFieldList as $portField => $value)
{
$funcName = 'init' . ucfirst($portField);
- if((!array_key_exists($portField, $modelFieldList)) or $portField == 'title')
+ if((!isset($modelFieldList[$portField])) or $portField == 'title')
{
$modelFieldList[$portField] = $this->portConfig->fieldList[$portField];
if(strpos($this->portConfig->initFunction, $portField) !== false) $modelFieldList[$portField] = $this->$funcName($model, $field);
@@ -268,7 +269,6 @@ class portModel extends model
$modelFieldList['values'] = $this->initValues($model, $field, $modelFieldList, $withKey);
$fieldList[$field] = $modelFieldList;
}
-
return $fieldList;
}
@@ -287,15 +287,15 @@ class portModel extends model
$this->commonActions($model);
if(!empty($this->modelConfig->fieldList[$field]['title'])) return $this->modelLang->{$this->modelConfig->fieldList[$field]['title']};
- if(array_key_exists($field, $this->lang->$model))
+ if(isset($this->lang->$model->$field))
{
$title = $this->lang->$model->$field;
}
- elseif(array_key_exists(($field . 'AB'), $this->lang->$model))
+ elseif(isset($this->lang->$model->{$field . 'AB'}))
{
$title = $this->lang->$model->{$field . 'AB'};
}
- elseif(array_key_exists($field, $this->lang->port->reservedWord))
+ elseif(isset($this->lang->port->reservedWord[$field]))
{
$title = $this->lang->port->reservedWord[$field];
}
@@ -313,7 +313,10 @@ class portModel extends model
*/
public function initControl($model, $field)
{
- if(isset($this->modelLang->{$field.'List'})) return 'select';
+ if(isset($this->modelFieldList[$field]['control'])) return $this->modelFieldList[$field]['control'];
+ if(isset($this->modelLang->{$field.'List'})) return 'select';
+ if(isset($this->modelFieldList[$field]['dataSource'])) return 'select';
+
if(strpos($this->portConfig->sysDataFields, $field) !== false) return 'select';
return $this->portConfig->fieldList['control'];
}
@@ -399,58 +402,12 @@ class portModel extends model
$dataList = array();
$sysDataFields = explode(',', $this->portConfig->sysDataFields);
- foreach($sysDataFields as $field)
- {
- $dataList[$field] = $this->loadModel($field)->getPairs();
- }
+
+ foreach($sysDataFields as $field) $dataList[$field] = $this->loadModel($field)->getPairs();
return $dataList;
}
- /**
- * Init tmpFile.
- *
- * @param int $created
- * @access public
- * @return void
- */
- public function initTmpFile($created = true)
- {
- $taskLang = $this->lang->task;
- $file = $this->session->fileImportFileName;
- $tmpPath = $this->loadModel('file')->getPathOfImportedFile();
- $tmpFile = $tmpPath . DS . md5(basename($file));
-
- if(file_exists($tmpFile)) return $tmpFile;
-
- $rows = $this->file->getRowsFromExcel($file);
-
- /* Check empty.*/
- if(is_string($rows))
- {
- if(file_exists($this->session->fileImportFileName)) unlink($this->session->fileImportFileName);
- unset($_SESSION['fileImportFileName']);
- unset($_SESSION['fileImportExtension']);
- $response['result'] = 'fail';
- $response['message'] = $rows;
- return $response;
- }
-
- $fields = $this->config->task->templateFields;
- array_unshift($fields, 'id');
-
- foreach($fields as $key => $fieldName)
- {
- $fieldName = trim($fieldName);
- $fields[$fieldName] = isset($taskLang->$fieldName) ? $taskLang->$fieldName : $fieldName;
- unset($fields[$key]);
- }
-
- if($created) $this->createTmpFile($tmpFile, $objectDatas);
-
- return $objectDatas;
- }
-
/**
* Get showImport datas.
*
@@ -520,7 +477,7 @@ class portModel extends model
*/
public function getSourceByModuleMethod($model, $module, $method, $params = '', $pairs = '')
{
- $getParams = $this->session->{$model.'PortParams'};
+ $getParams = $this->session->{$model . 'PortParams'};
if($params)
{
@@ -565,8 +522,7 @@ class portModel extends model
*/
public function getSourceByLang($lang)
{
- $lang = isset($this->modelLang->$lang) ? $this->modelLang->$lang : '';
- return $lang;
+ return isset($this->modelLang->$lang) ? $this->modelLang->$lang : '';
}
/**
@@ -594,7 +550,7 @@ class portModel extends model
if(empty($rows)) return $exportDatas;
- $exportDatas['user'] = $this->loadModel('user')->getPairs('devfirst|noclosed|nodeleted');
+ $exportDatas['user'] = $this->loadModel('user')->getPairs('noclosed|nodeleted|noletter');
foreach ($rows as $id => $values)
{
@@ -760,7 +716,7 @@ class portModel extends model
{
$modelDatas = $this->getQueryDatas($model);
- if(array_key_exists('files', $fieldList))
+ if(isset($fieldList['files']) or property_exists($fieldList, 'files'))
{
$modelDatas = $this->getFiles($model, $modelDatas);
}
@@ -775,10 +731,7 @@ class portModel extends model
}
/* Deal children datas and multiple tasks .*/
- if($modelDatas)
- {
- $modelDatas = $this->updateChildDatas($modelDatas);
- }
+ if($modelDatas) $modelDatas = $this->updateChildDatas($modelDatas);
return $modelDatas;
}
@@ -807,7 +760,11 @@ class portModel extends model
}
elseif($queryCondition)
{
- $stmt = $this->dbh->query($queryCondition . ($this->post->exportType == 'selected' ? " AND t1.id IN({$this->cookie->checkedItem})" : ''));
+ $selectKey = 'id';
+ if(strpos($queryCondition, "FROM `{$this->config->db->prefix}_$model` AS t1") == false) $selectKey = 't1.id';
+ if(strpos($queryCondition, "FROM `{$this->config->db->prefix}_$model` AS t2") == false) $selectKey = 't2.id';
+
+ $stmt = $this->dbh->query($queryCondition . ($this->post->exportType == 'selected' ? " AND $selectKey IN({$this->cookie->checkedItem})" : ''));
while($row = $stmt->fetch()) $modelDatas[$row->id] = $row;
}
@@ -832,10 +789,7 @@ class portModel extends model
$relatedObjectIdList = array();
$relatedObjects = array();
- foreach($datas as $data)
- {
- $relatedObjectIdList[$data->$object] = $data->$object;
- }
+ foreach($datas as $data) $relatedObjectIdList[$data->$object] = $data->$object;
if($object == 'openedBuild') $object = 'build';
@@ -864,6 +818,7 @@ class portModel extends model
{
foreach($data as $field => $cellValue)
{
+ if(strpos($this->portConfig->dateFeilds, $field) !== false and helper::isZeroDate($cellValue)) $datas[$key]->$field = '';
if(strpos($filter, $field) !== false) continue;
if(is_array($cellValue)) continue;
if(strrpos($cellValue, '(#') === false)
@@ -882,6 +837,17 @@ class portModel extends model
{
$id = trim(substr($cellValue, strrpos($cellValue,'(#') + 2), ')');
$datas[$key]->$field = $id;
+ $control = !empty($this->modelFieldList[$field]['control']) ? $this->modelFieldList[$field]['control'] : '';
+ if($control == 'multiple')
+ {
+ $cellValue = explode("\n", $cellValue);
+ foreach($cellValue as &$value)
+ {
+ $value = trim(substr($value, strrpos($value,'(#') + 2), ')');
+ }
+ $cellValue = array_filter($cellValue, function($v) {return (empty($v) && $v == '0') || !empty($v);});
+ $datas[$key]->$field = join(',', $cellValue);
+ }
}
}
@@ -930,11 +896,16 @@ class portModel extends model
$datas = array_slice($datas, ($pagerID - 1) * $maxImport, $maxImport, true);
}
- if(!$maxImport) $this->maxImport = $result->allCount;
+ if(!$maxImport) $this->maxImport = $result->allCount;
$result->maxImport = $maxImport;
$result->isEndPage = $pagerID >= $result->allPager;
$result->datas = $datas;
+ foreach($datas as $data)
+ {
+ if(isset($data->id)) $this->session->set('insert', false);
+ }
+
if(empty($datas)) die(js::locate('back'));
return $result;
}
@@ -1231,7 +1202,7 @@ class portModel extends model
$suhosinInfo = $this->checkSuhosinInfo($datas->datas);
- $importFields = $this->config->$model->templateFields;
+ $importFields = !empty($_SESSION[$model . 'TemplateFields']) ? $_SESSION[$model . 'TemplateFields'] : $this->config->$model->templateFields;
$this->getWorkFlowFields($model);
@@ -1264,7 +1235,7 @@ class portModel extends model
$html = '';
$key = key($list);
$addID = 1;
- $members = $this->loadModel('user')->getTeamMemberPairs($this->session->taskPortParams['executionID'], 'execution');
+ if($model == 'task') $members = $this->loadModel('user')->getTeamMemberPairs($this->session->taskPortParams['executionID'], 'execution');
$appendFields = $this->session->appendFields;
$showImportCount = $this->config->port->lazyLoading ? $this->config->port->showImportCount : $this->maxImport;
@@ -1284,7 +1255,6 @@ class portModel extends model
if(!empty($object->id))
{
$html .= $object->id . html::hidden("id[$row]", $object->id);
- $this->session->set('insert', false);
}
else
{
@@ -1300,17 +1270,21 @@ class portModel extends model
$values = $value['values'];
$name = "{$field}[$row]";
$selected = !empty($object->$field) ? $object->$field : '';
-
- $options = array();
- if($control == 'select' or $control == 'multiple')
+ if($model)
{
- if(!empty($values[$selected])) $options = array($selected => $values[$selected]);
- if(!empty($values[$selected]) and isset($values[0])) $options = array_slice($values, 0, 1);
+ if($control == 'hidden' and isset($this->session->{$model.'PortParams'}[$field. 'ID'])) $selected = $this->session->{$model . 'PortParams'}[$field. 'ID'];
}
- if($control == 'select') $html .= '
' . html::select("$name", $options, $selected, "class='form-control picker-select nopicker' data-field='{$field}'") . ' | ';
+ $options = array();
+ if($control == 'select')
+ {
+ if(!empty($values[$selected])) $options = array($selected => $values[$selected]);
+ if(empty($options) and is_array($values)) $options = array_slice($values, 0, 1);
+ }
- elseif($control == 'multiple') $html .= '' . html::select($name . "[]", $options, $selected, "multiple class='form-control picker-select nopicker' data-field='{$field}'") . ' | ';
+ if($control == 'select') $html .= '' . html::select("$name", $options, $selected, "class='form-control picker-select nopicker' data-field='{$field}' data-index='{$row}'") . ' | ';
+
+ elseif($control == 'multiple') $html .= '' . html::select($name . "[]", $values, $selected, "multiple class='form-control picker-select nopicker' data-field='{$field}' data-index='{$row}'") . ' | ';
elseif($control == 'date') $html .= '' . html::input("$name", $selected, "class='form-control form-date' autocomplete='off'") . ' | ';
diff --git a/module/port/view/header.html.php b/module/port/view/header.html.php
index 2da408399c..373f268f77 100644
--- a/module/port/view/header.html.php
+++ b/module/port/view/header.html.php
@@ -13,14 +13,14 @@ $model = $datas->model;
$datas = $datas->datas;
$appendFields = $this->session->appendFields;
$notEmptyRule = $this->session->notEmptyRule;
-$insert = $this->session->insert;
?>
diff --git a/module/port/view/showimport.html.php b/module/port/view/showimport.html.php
index e91aef2988..c60f8e6a78 100644
--- a/module/port/view/showimport.html.php
+++ b/module/port/view/showimport.html.php
@@ -17,7 +17,7 @@
getModuleRoot() . 'port/view/tfoot.html.php';?>
- getModuleRoot() . 'common/view/noticeimport.html.php';?>
+ session->insert); include $app->getModuleRoot() . 'common/view/noticeimport.html.php';?>