From 66f92a1bebf0e26322906bca2f5a642a7fc2e5c9 Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 5 Jan 2015 04:55:12 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8B=B1=E6=96=87=E7=89=88do?= =?UTF-8?q?i=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DataController.php | 2 +- .../admin/views/scripts/data/doi-add.phtml | 34 +++------------ application/models/data/Doi.php | 41 +++++++++++++++++++ 3 files changed, 48 insertions(+), 29 deletions(-) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 8f199708..d35a3351 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -4028,7 +4028,7 @@ class Admin_DataController extends Zend_Controller_Action $data['info'] = $info; $data['info'] = $doi->sksort($data['info'],"order",SORT_ASC); } - $state = $doi->update($data,$uuid); + $state = $doi->update_en($data,$uuid); if($state) { $this->view->msg = view::Msg('alert-success',"修改成功!",'/admin/data/doi/uuid/'.$uuid); diff --git a/application/admin/views/scripts/data/doi-add.phtml b/application/admin/views/scripts/data/doi-add.phtml index 11da9d56..00f56737 100644 --- a/application/admin/views/scripts/data/doi-add.phtml +++ b/application/admin/views/scripts/data/doi-add.phtml @@ -68,38 +68,20 @@ $this->theme->AppendPlus($this,'colorbox'); " class="form-control"/> -
- -
- " class="form-control" /> -
-
-
- -
- " class="form-control" /> -
-
data['info']) || !is_array($this->data['info'])) {?>
-
- -
- +
-
- -
- +
@@ -114,15 +96,13 @@ $this->theme->AppendPlus($this,'colorbox');
-
- +
-
- +
1){ ?> @@ -163,11 +143,9 @@ function addinput(){ var index = now_index + 1; html = '
' +'
' - +'
' - +'
' + +'
' +'
' - +'
' - +'
' + +'
' +'' +'
'; now_index = null; diff --git a/application/models/data/Doi.php b/application/models/data/Doi.php index 31e6eeae..7a92c5e1 100644 --- a/application/models/data/Doi.php +++ b/application/models/data/Doi.php @@ -83,6 +83,47 @@ class Doi extends Zend_Controller_Plugin_Abstract } } } + + function update_en($data,$uuid,$uid=0){ + if(!empty($uid)) + { + include_once("data/Author.php"); + $author = new Author($this->db); + if($author->checkAuthor($uuid,$uid)==false) + { + return "您没有权限"; + } + } + $doi_info = $this->view($uuid); + if($doi_info == false) + { + return $this->add($data); + }else { + $this->data_process_in($data); + //include_once("helper/view.php"); + //view::Dump($data); + include_once("helper/dbh.php"); + $dbh = new dbh($this->db); + if(is_numeric($uuid)) + { + $condition = " id=$uuid "; + }else{ + $condition = " uuid='$uuid' "; + } + $data['publisher_en']=$data['publisher']; + $data['publisher']=''; + $data['title_en']=$data['title']; + $data['title']=''; + $state = $dbh->update($this->tbl_doi,$data,$condition,true); + + if( $state == true) + { + return true; + }else{ + return $state; + } + } + } function data_process_in(&$data){ $authors = array();