diff --git a/module/port/control.php b/module/port/control.php index 00d927ffb1..e73dc30282 100644 --- a/module/port/control.php +++ b/module/port/control.php @@ -73,6 +73,7 @@ class port extends control */ public function import($model, $locate = '') { + $locate = $locate ? $locate : $this->session->showImportURL; if($_FILES) { $file = $this->loadModel('file')->getUpload('file'); @@ -135,7 +136,7 @@ class port extends control */ public function ajaxGetOptions($model = '', $field = '', $value = '', $index = '') { - $this->app->loadConfig($model); + $this->loadModel($model); $fields = $this->config->$model->templateFields; $fieldList = $this->port->initFieldList($model, $fields, false); diff --git a/module/port/lang/zh-cn.php b/module/port/lang/zh-cn.php index d558d8ec6a..094104e416 100644 --- a/module/port/lang/zh-cn.php +++ b/module/port/lang/zh-cn.php @@ -12,9 +12,12 @@ $lang->port->reservedWord['title'] = '标题'; $lang->port->reservedWord['asdawdadw'] = '测试字段'; -$lang->port->importCase = '导入EXCEL'; -$lang->port->importNotice = '请先导出模板,按照模板格式填写数据后再导入。'; -$lang->port->noRequire = '%s行的“ %s” 是必填字段,不能为空。'; +$lang->port->importCase = '导入EXCEL'; +$lang->port->importNotice = '请先导出模板,按照模板格式填写数据后再导入。'; +$lang->port->noRequire = '%s行的“ %s” 是必填字段,不能为空。'; +$lang->port->exportTemplate = '导出模板'; +$lang->port->import = '导入'; +$lang->port->id = '编号'; $lang->port->new = '新增'; diff --git a/module/port/model.php b/module/port/model.php index 60074ba786..a2d5f67026 100644 --- a/module/port/model.php +++ b/module/port/model.php @@ -856,13 +856,14 @@ class portModel extends model * @access public * @return void */ - public function getPageDatas($datas, $pagerID = 1, $maxImport = 0) + public function getPageDatas($datas, $pagerID = 1) { $result = new stdClass(); $result->allCount = count($datas); $result->allPager = 1; $result->pagerID = $pagerID; + $maxImport = $_COOKIE['maxImport']; if($result->allCount > $this->config->file->maxImport) { if(empty($maxImport)) @@ -918,7 +919,7 @@ class portModel extends model * @access public * @return void */ - public function getViewDatas($model = '', $datas = '', $title = '', $pagerID = 1, $maxImport = 0, $insert) + public function getViewDatas($model = '', $datas = '', $title = '', $pagerID = 1, $insert) { $suhosinInfo = $this->checkSuhosinInfo($datas->datas); @@ -929,7 +930,7 @@ class portModel extends model $datas->allPager = isset($datas->allPager) ? $datas->allPager : 1; $datas->pagerID = $pagerID; $datas->isEndPage = $pagerID >= $datas->allPager; - $datas->maxImport = $maxImport; + $datas->maxImport = $_COOKIE['maxImport']; $datas->dataInsert = $insert; $datas->fields = $this->initFieldList($model, $fields, false); $datas->suhosinInfo = $suhosinInfo; @@ -1177,7 +1178,7 @@ class portModel extends model * @access public * @return void */ - public function readExcel($model = '', $pagerID = 1, $maxImport = 0) + public function readExcel($model = '', $pagerID = 1) { /* Bulid import paris (field => name) .*/ $fields = $this->getImportFields('bug'); @@ -1202,7 +1203,7 @@ class portModel extends model } /* Get page by datas.*/ - return $this->getPageDatas($bugData, $pagerID, $maxImport); + return $this->getPageDatas($bugData, $pagerID); } } diff --git a/module/port/view/exporttemplate.html.php b/module/port/view/exporttemplate.html.php index 9a21978d85..5003335d5e 100644 --- a/module/port/view/exporttemplate.html.php +++ b/module/port/view/exporttemplate.html.php @@ -21,12 +21,12 @@ function closeWindow()