修改英文版doi修改方法

This commit is contained in:
wlx 2015-01-05 04:55:12 +00:00
parent f556a1bebb
commit 66f92a1beb
3 changed files with 48 additions and 29 deletions

View File

@ -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);

View File

@ -68,38 +68,20 @@ $this->theme->AppendPlus($this,'colorbox');
<input type="text" id="title" name="title" readonly="readonly" value="<?= isset($this->data['title']) ? $this->data['title']:"" ?>" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="title_en">英文标题</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="title_en" name="title_en" readonly="readonly" value="<?= isset($this->data['title_en']) ? $this->data['title_en']:"" ?>" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-sm-2 control-label" for="publisher_en">发布者英文</label>
<div class="col-md-10 col-sm-10">
<input type="text" id="publisher_en" name="publisher_en" value="<?= isset($this->data['publisher_en']) ? $this->data['publisher_en']:"" ?>" class="form-control" />
</div>
</div>
<?php if(empty($this->data['info']) || !is_array($this->data['info'])) {?>
<div class="form-group infocontrol" id="info1">
<label class="col-md-2 col-sm-2 control-label" for="title_en">info</label>
<div class="col-md-10 col-sm-10">
<div class="controls row">
<div class="col-md-2 col-sm-4">
<input type="text" name="info[1][author]" value="" placeholder="作者" class="form-control"/>
</div>
<div class="col-md-2 col-sm-3">
<input type="text" name="info[1][author_en]" value="" placeholder="作者英文" class="form-control"/>
<input type="text" name="info[1][author_en]" value="" placeholder="Author Name" class="form-control"/>
</div>
<div class="col-md-1 col-sm-2">
<input type="text" name="info[1][order]" value="" placeholder="排序" class="form-control"/>
</div>
<div class="col-md-3 col-sm-7">
<input type="text" name="info[1][organization]" value="" placeholder="单位" class="form-control"/>
</div>
<div class="col-md-3 col-sm-6">
<input type="text" name="info[1][organization_en]" value="" placeholder="单位英文" class="form-control"/>
<input type="text" name="info[1][organization_en]" value="" placeholder="Organization" class="form-control"/>
</div>
</div>
</div>
@ -114,15 +96,13 @@ $this->theme->AppendPlus($this,'colorbox');
<label class="col-md-2 col-sm-2 control-label">info</label>
<div class="col-sm-10">
<div class="row">
<div class="col-md-2 col-sm-4"><input class="form-control" type="text" name="info[<?= $k ?>][author]" value="<?= $v['author'] ?>" placeholder="作者" /></div>
<div class="col-md-2 col-sm-3">
<input class="form-control" type="text" name="info[<?= $k ?>][author_en]" value="<?= $v['author_en'] ?>" placeholder="作者英文" />
<input class="form-control" type="text" name="info[<?= $k ?>][author_en]" value="<?= $v['author_en'] ?>" placeholder="Author Name" />
</div>
<div class="col-md-1 col-sm-2"><input class="form-control" type="text" name="info[<?= $k ?>][order]" value="<?= $v['order'] ?>" placeholder="排序" /></div>
<div class="col-md-3 col-sm-7"><input class="form-control" type="text" name="info[<?= $k ?>][organization]" value="<?= $v['organization'] ?>" placeholder="单位" /></div>
<div class="col-md-3 col-sm-6">
<input class="form-control" type="text" name="info[<?= $k ?>][organization_en]" value="<?= $v['organization_en'] ?>" placeholder="单位英文" />
<input class="form-control" type="text" name="info[<?= $k ?>][organization_en]" value="<?= $v['organization_en'] ?>" placeholder="Organization" />
</div>
<div class="col-md-1">
<?php if($index>1){ ?>
@ -163,11 +143,9 @@ function addinput(){
var index = now_index + 1;
html = '<div class="form-group infocontrol"><label class="col-md-2 col-sm-2 control-label">info</label>'
+'<div class="col-sm-10"><div class="controls row">'
+'<div class="col-md-2 col-sm-4"><input class="form-control" type="text" name="info[' + index + '][author]" placeholder="作者" /></div>'
+'<div class="col-md-2 col-sm-3"><input class="form-control" type="text" name="info[' + index + '][author_en]" placeholder="作者英文" /></div>'
+'<div class="col-md-2 col-sm-3"><input class="form-control" type="text" name="info[' + index + '][author_en]" placeholder="Author Name" /></div>'
+'<div class="col-md-1 col-sm-2"><input class="form-control" type="text" name="info[' + index + '][order]" placeholder="排序" /></div>'
+'<div class="col-md-3 col-sm-7"><input class="form-control" type="text" name="info[' + index + '][organization]" placeholder="单位" /></div>'
+'<div class="col-md-3 col-sm-6"><input class="form-control" type="text" name="info[' + index + '][organization_en]" placeholder="单位英文" /></div>'
+'<div class="col-md-3 col-sm-6"><input class="form-control" type="text" name="info[' + index + '][organization_en]" placeholder="Organization" /></div>'
+'<div class="col-md-1"><label class="control-label"><a href="javascript:void(0);" onclick="RmInput(this)"> -删除</a></label></div>'
+'</div></div></div>';
now_index = null;

View File

@ -84,6 +84,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();
$orgs = array();