修改DOI中的空格和逗号错误

This commit is contained in:
Li Jianxuan 2013-05-09 08:20:44 +00:00
parent 126a7b8f6a
commit 5f514c5263
2 changed files with 10 additions and 10 deletions

View File

@ -3626,7 +3626,7 @@ class Admin_DataController extends Zend_Controller_Action
$this->view->data = $data; $this->view->data = $data;
$info = $doi->checkinfo($data['info']); $info = $doi->checkinfo($data['info']);
if(!is_array($info)){ if(!is_array($info)){
$this->view->error = view::Error('alert-error',$info,-1); $this->view->error = view::Error($info);
return true; return true;
}else{ }else{
$data['info'] = $info; $data['info'] = $info;
@ -3638,7 +3638,7 @@ class Admin_DataController extends Zend_Controller_Action
$this->view->msg = view::Msg('alert-success',"修改成功!",'/admin/data/doi/uuid/'.$uuid); $this->view->msg = view::Msg('alert-success',"修改成功!",'/admin/data/doi/uuid/'.$uuid);
return false; return false;
}else{ }else{
$this->view->error = view::Error('alert-error',"修改失败",-1); $this->view->error = view::Error("修改失败");
return false; return false;
} }
} }

View File

@ -82,10 +82,10 @@ class Doi extends Zend_Controller_Plugin_Abstract
$orgs_en = array(); $orgs_en = array();
foreach($data['info'] as $k=>$v) foreach($data['info'] as $k=>$v)
{ {
$authors[$v['order']] = $v['author']; $authors[$v['order']] = str_replace(",","",$v['author']);
$orgs[$v['order']] = $v['organization']; $orgs[$v['order']] = str_replace(",","",$v['organization']);
$authors_en[$v['order']] = $v['author_en']; $authors_en[$v['order']] = str_replace(",","",$v['author_en']);
$orgs_en[$v['order']] = $v['organization_en']; $orgs_en[$v['order']] = str_replace(",","",$v['organization_en']);
} }
$authors = "{".join(",",$authors)."}"; $authors = "{".join(",",$authors)."}";
$orgs = "{".join(",",$orgs)."}"; $orgs = "{".join(",",$orgs)."}";
@ -107,10 +107,10 @@ class Doi extends Zend_Controller_Plugin_Abstract
foreach($authors as $k=>$v) foreach($authors as $k=>$v)
{ {
$info[$k] = array( $info[$k] = array(
'author'=>$authors[$k], 'author'=>str_replace("\"","",$authors[$k]),
'organization'=>$orgs[$k], 'organization'=>str_replace("\"","",$orgs[$k]),
'author_en'=>$authors_en[$k], 'author_en'=>str_replace("\"","",$authors_en[$k]),
'organization_en'=>$orgs_en[$k], 'organization_en'=>str_replace("\"","",$orgs_en[$k]),
'order'=> count($authors)+($k-1) 'order'=> count($authors)+($k-1)
); );
} }