merge heihedata branch from r3436 to r3451.
This commit is contained in:
commit
9fb00529c2
|
@ -3582,9 +3582,9 @@ class Admin_DataController extends Zend_Controller_Action
|
||||||
'title'=>$metadata['title'],
|
'title'=>$metadata['title'],
|
||||||
'doi'=>$metadata['doi'],
|
'doi'=>$metadata['doi'],
|
||||||
'url'=>"http://" . $_SERVER['HTTP_HOST'].'/data/'.$uuid,
|
'url'=>"http://" . $_SERVER['HTTP_HOST'].'/data/'.$uuid,
|
||||||
'publisher'=>view::User('realname'),
|
'publisher'=>'寒区旱区科学数据中心',
|
||||||
'title_en'=>$metadata['title_en'],
|
'title_en'=>$metadata['title_en'],
|
||||||
'publisher_en'=>view::User('realname'),
|
'publisher_en'=>'Cold and Arid Regions Science Data Center at Lanzhou',
|
||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
$this->view->data['info'] = $doi->data_process_out($this->view->data);
|
$this->view->data['info'] = $doi->data_process_out($this->view->data);
|
||||||
|
|
|
@ -54,7 +54,7 @@ $('#divFooter').css('position','absolute');
|
||||||
|
|
||||||
<a href="/admin/news/newslist">所有新闻列表</a>
|
<a href="/admin/news/newslist">所有新闻列表</a>
|
||||||
</div>
|
</div>
|
||||||
<table id="report" class="stylized full" style="width:650px;">
|
<table id="report" class="stylized full">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="50%">新闻标题</th>
|
<th width="50%">新闻标题</th>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -70,8 +70,8 @@ class IndexController extends Zend_Controller_Action
|
||||||
|
|
||||||
$this->view->news = $rows;
|
$this->view->news = $rows;
|
||||||
|
|
||||||
$time = date("Y-m-d H:i:s",time());
|
//$time = date("Y-m-d H:i:s",time());
|
||||||
$sql = "SELECT * FROM archive WHERE is_pub=true AND ts_published<'$time' order by ts_published desc LIMIT 12 ";
|
$sql = "SELECT * FROM archive WHERE is_pub=true AND ts_published<now() and id in (select ar_catalog.aid from ar_catalog left join ar_category on ar_catalog.cid=ar_category.id where ar_category.ptype='news') order by ts_published desc LIMIT 12 ";
|
||||||
$sth = $this->db->query($sql);
|
$sth = $this->db->query($sql);
|
||||||
$rows = $sth->fetchAll(PDO::FETCH_BOTH);
|
$rows = $sth->fetchAll(PDO::FETCH_BOTH);
|
||||||
|
|
||||||
|
|
|
@ -541,14 +541,14 @@ class ReviewController extends Zend_Controller_Action
|
||||||
foreach($this->view->metadata as $k=>$v)
|
foreach($this->view->metadata as $k=>$v)
|
||||||
{
|
{
|
||||||
$this->view->metadata[$k]['statustext']=$this->rewritestatus($v['status']);
|
$this->view->metadata[$k]['statustext']=$this->rewritestatus($v['status']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function helpAction()
|
function helpAction()
|
||||||
{
|
{
|
||||||
$archives=new Archive($this->db);
|
$archives=new Archive($this->db);
|
||||||
$this->view->item=$archives->getOneArchive('元数据评审说明','help');
|
$this->view->item=$archives->getOneArchive('元数据评审说明','help');
|
||||||
$this->view->pageID = "review-help";
|
$this->view->pageID = "review-help";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,8 +704,7 @@ class ReviewController extends Zend_Controller_Action
|
||||||
|
|
||||||
|
|
||||||
}// downattAction 下载附件
|
}// downattAction 下载附件
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* denyinviteAction() 专家拒绝邀请
|
* denyinviteAction() 专家拒绝邀请
|
||||||
*
|
*
|
||||||
|
@ -719,13 +718,14 @@ class ReviewController extends Zend_Controller_Action
|
||||||
*/
|
*/
|
||||||
function denyinviteAction()
|
function denyinviteAction()
|
||||||
{
|
{
|
||||||
|
include_once("helper/view.php");
|
||||||
$id = $this->_request->getParam('id');
|
$id = $this->_request->getParam('id');
|
||||||
$uuid = $this->_request->getParam('uuid');
|
$uuid = $this->_request->getParam('uuid');
|
||||||
|
|
||||||
if(empty($id) || empty($uuid) || !is_numeric($id) ||!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
|
if(empty($id) || empty($uuid) || !is_numeric($id) ||!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
|
||||||
{
|
{
|
||||||
$this->view->message = "参数错误";
|
view::Post($this,array('pageTitle'=>'提示信息','content'=>'参数错误','url'=>'/'));
|
||||||
|
return true;
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$auth = Zend_Auth::getInstance();
|
$auth = Zend_Auth::getInstance();
|
||||||
|
@ -739,9 +739,15 @@ class ReviewController extends Zend_Controller_Action
|
||||||
try{
|
try{
|
||||||
$sql = "update mdexpertreview set status=-1 where id='$id' and uuid='$uuid'";
|
$sql = "update mdexpertreview set status=-1 where id='$id' and uuid='$uuid'";
|
||||||
if($this->db->exec($sql))
|
if($this->db->exec($sql))
|
||||||
$this->view->message = "您已经拒绝该元数据的评审邀请";
|
{
|
||||||
|
view::Post($this,array('pageTitle'=>'提示信息','content'=>'您已经拒绝该元数据的评审邀请','url'=>'/'));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$this->view->message = "您无权限进行此操作";
|
{
|
||||||
|
view::Post($this,array('pageTitle'=>'提示信息','content'=>'您无权执行此操作','url'=>'/'));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}catch(Exception $e){
|
}catch(Exception $e){
|
||||||
$this->view->message = $e->getMessage();
|
$this->view->message = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
@ -749,61 +755,49 @@ class ReviewController extends Zend_Controller_Action
|
||||||
}//end if
|
}//end if
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->view->message = "您无权使用此通知";
|
view::Post($this,array('pageTitle'=>'提示信息','content'=>'您无权使用此通知','url'=>'/'));
|
||||||
|
return true;
|
||||||
}//非本人操作,或尝试删除他人信息
|
}//非本人操作,或尝试删除他人信息
|
||||||
|
|
||||||
}//end if
|
}//end if
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->view->message = '请登录后再执行此操作,请<a href="/account/login/?href=/review/denyinvite/id/'.$id.'/uuid/'.$uuid.'">点击此处登录</a>';
|
view::Post($this,array('pageTitle'=>'提示信息','content'=>'请登录后再执行此操作','url'=>'/account/login/?href=/review/allowinvite/id/'.$id.'/uuid/'.$uuid));
|
||||||
|
return true;
|
||||||
}//未登录
|
}//未登录
|
||||||
}
|
}
|
||||||
|
|
||||||
}// denyinviteAction() 专家拒绝邀请
|
}// denyinviteAction() 专家拒绝邀请
|
||||||
|
|
||||||
//parameters are same as denyinviteAction
|
//parameters are same as denyinviteAction
|
||||||
function inviteokAction()
|
function inviteokAction()
|
||||||
{
|
{
|
||||||
|
include_once("helper/view.php");
|
||||||
$id = $this->_request->getParam('id');
|
|
||||||
$uuid = $this->_request->getParam('uuid');
|
$id = $this->_request->getParam('id');
|
||||||
|
$uuid = $this->_request->getParam('uuid');
|
||||||
if(empty($id) || empty($uuid) || !is_numeric($id) ||!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
|
|
||||||
{
|
$auth = Zend_Auth::getInstance();
|
||||||
$this->view->message = "参数错误";
|
if($auth->hasIdentity())
|
||||||
}else{
|
{
|
||||||
|
$user = $auth->getIdentity();
|
||||||
$auth = Zend_Auth::getInstance();
|
$userid = $user->id;
|
||||||
if($auth->hasIdentity())
|
|
||||||
{
|
include_once("data/Review.php");
|
||||||
$user = $auth->getIdentity();
|
$review = new Review($this->db);
|
||||||
$userid = $user->id;
|
$s = $review->invite($id,$uuid,$userid,1);
|
||||||
|
if($s == true)
|
||||||
if($id==$userid)
|
{
|
||||||
{
|
view::Post($this,array('content'=>'您已经接受邀请','url'=>'/review/review/uuid/'.$uuid));
|
||||||
try{
|
return true;
|
||||||
$sql = "update mdexpertreview set status=1 where id='$id' and uuid='$uuid'";
|
}else{
|
||||||
if($this->db->exec($sql))
|
view::Post($this,array('content'=>$s));
|
||||||
$this->view->message = "感谢您同意对该数据的评审邀请,如遇到任何问题,请联系数据中心服务人员。";
|
return true;
|
||||||
else
|
}
|
||||||
$this->view->message = "您无权限进行此操作";
|
}else{
|
||||||
}catch(Exception $e){
|
view::Post($this,array('content'=>'请登录后再执行此操作','url'=>'/account/login/?href=/review/allowinvite/id/'.$id.'/uuid/'.$uuid));
|
||||||
$this->view->message = $e->getMessage();
|
return true;
|
||||||
}
|
}//未登录
|
||||||
|
}//allowinviteAction()
|
||||||
}//end if
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->view->message = "您无权使用此通知";
|
|
||||||
}//非本人操作,或尝试删除他人信息
|
|
||||||
|
|
||||||
}//end if
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->view->message = '请登录后再执行此操作,请<a href="/account/login/?href=/review/inviteok/id/'.$id.'/uuid/'.$uuid.'">点击此处登录</a>';
|
|
||||||
}//未登录
|
|
||||||
}
|
|
||||||
|
|
||||||
}// denyinviteAction() 专家拒绝邀请
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,133 +1,150 @@
|
||||||
<?php
|
<?php
|
||||||
$this->headTitle($this->config->title->site);
|
$this->headTitle($this->config->title->site);
|
||||||
$this->headTitle($this->config->title->author);
|
$this->headTitle($this->config->title->author);
|
||||||
$this->headTitle()->setSeparator(' - ');
|
$this->headTitle()->setSeparator(' - ');
|
||||||
//$this->headLink()->appendStylesheet('/css/admin.css');
|
$this->breadcrumb('<a href="/">首页</a>');
|
||||||
$this->breadcrumb('<a href="/">首页</a>');
|
$this->breadcrumb('<a href="/author">数据作者</a>');
|
||||||
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
|
$this->breadcrumb('DOI');
|
||||||
$this->breadcrumb('DOI');
|
$this->breadcrumb()->setSeparator(' > ');
|
||||||
$this->breadcrumb()->setSeparator(' > ');
|
$this->theme->AppendPlus($this,'colorbox');
|
||||||
$this->theme->AppendPlus($this,'colorbox');
|
$this->headLink()->appendStylesheet('/css/author.css');
|
||||||
$this->headLink()->appendStylesheet('/css/author.css');
|
?>
|
||||||
?>
|
<div class="row-fluid">
|
||||||
<div class="row-fluid">
|
<div class="span3">
|
||||||
<div class="span3">
|
<?= $this->partial('author/navi.phtml'); ?>
|
||||||
<?= $this->partial('author/navi.phtml'); ?>
|
</div>
|
||||||
</div>
|
<div class="span9">
|
||||||
<div class="span9">
|
<div>
|
||||||
<div>
|
<ul class="nav nav-tabs">
|
||||||
<ul class="nav nav-tabs">
|
<li><a href="/author/doi">浏览所有</a></li>
|
||||||
<li><a href="/author/doi">浏览所有</a></li>
|
<?php if(!empty($this->uuid)) {?>
|
||||||
<?php if(!empty($this->uuid)) {?>
|
<li class="active"><a href="javascript:void(0);">编辑DOI</a></li>
|
||||||
<li class="active"><a href="javascript:void(0);">编辑DOI</a></li>
|
<?php }?>
|
||||||
<?php }?>
|
</ul>
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
<div class="">
|
||||||
<div class="">
|
<?php if(!empty($this->error)) { ?>
|
||||||
<?php if(!empty($this->error)) { ?>
|
<?= $this->error ?>
|
||||||
<?= $this->error ?>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php if(!empty($this->msg)) { ?>
|
||||||
<?php if(!empty($this->msg)) { ?>
|
<?= $this->msg ?>
|
||||||
<?= $this->msg ?>
|
<?php } else{ ?>
|
||||||
<?php } else{ ?>
|
<form class="form-horizontal" method="post">
|
||||||
<form class="form-horizontal" method="post">
|
<div class="control-group">
|
||||||
<div class="control-group">
|
<label class="control-label" for="doi">doi</label>
|
||||||
<label class="control-label" for="doi">doi</label>
|
<div class="controls">
|
||||||
<div class="controls">
|
<input type="text" id="doi" name="doi" readonly="readonly" value="<?= (isset($this->data['doi'])&&!empty($this->data['doi'])) ? $this->data['doi']:"doi:10.3972/westdc.x.2013.db" ?>" />
|
||||||
<input type="text" id="doi" name="doi" readonly="readonly" value="<?= (isset($this->data['doi'])&&!empty($this->data['doi'])) ? $this->data['doi']:"doi:10.3972/westdc.x.2013.db" ?>" />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="control-group">
|
||||||
<div class="control-group">
|
<label class="control-label" for="uuid">uuid</label>
|
||||||
<label class="control-label" for="uuid">uuid</label>
|
<div class="controls">
|
||||||
<div class="controls">
|
<input type="text" id="uuid" name="uuid" readonly="readonly" value="<?= isset($this->data['uuid']) ? $this->data['uuid']:"" ?>" />
|
||||||
<input type="text" id="uuid" name="uuid" readonly="readonly" value="<?= isset($this->data['uuid']) ? $this->data['uuid']:"" ?>" />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="control-group">
|
||||||
<div class="control-group">
|
<label class="control-label" for="publisher">发布者</label>
|
||||||
<label class="control-label" for="publisher">发布者</label>
|
<div class="controls">
|
||||||
<div class="controls">
|
<input type="text" id="publisher" name="publisher" value="<?= isset($this->data['publisher']) ? $this->data['publisher']:"" ?>" />
|
||||||
<input type="text" id="publisher" name="publisher" value="<?= isset($this->data['publisher']) ? $this->data['publisher']:"" ?>" />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="control-group">
|
||||||
<div class="control-group">
|
<label class="control-label" for="url">url</label>
|
||||||
<label class="control-label" for="url">url</label>
|
<div class="controls">
|
||||||
<div class="controls">
|
<input type="text" id="url" name="url" readonly="readonly" value="<?= isset($this->data['url']) ? $this->data['url']:"" ?>" />
|
||||||
<input type="text" id="url" name="url" readonly="readonly" value="<?= isset($this->data['url']) ? $this->data['url']:"" ?>" />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="control-group">
|
||||||
<div class="control-group">
|
<label class="control-label" for="title">标题</label>
|
||||||
<label class="control-label" for="title">title</label>
|
<div class="controls">
|
||||||
<div class="controls">
|
<input type="text" id="title" name="title" readonly="readonly" value="<?= isset($this->data['title']) ? $this->data['title']:"" ?>" />
|
||||||
<input type="text" id="title" name="title" readonly="readonly" value="<?= isset($this->data['title']) ? $this->data['title']:"" ?>" />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="control-group">
|
||||||
<?php if(empty($this->data['info']) || !is_array($this->data['info'])) {?>
|
<label class="control-label" for="title_en">英文标题</label>
|
||||||
<div class="control-group infocontrol" id="info1">
|
<div class="controls">
|
||||||
<label class="control-label" for="">info</label>
|
<input type="text" id="title_en" name="title_en" value="<?= isset($this->data['title_en']) ? $this->data['title_en']:"" ?>" />
|
||||||
<div class="controls">
|
</div>
|
||||||
<input type="text" name="info[1][author]" value="" placeholder="作者" />
|
</div>
|
||||||
<input type="text" name="info[1][organization]" value="" placeholder="单位" />
|
<div class="control-group">
|
||||||
<input type="text" name="info[1][order]" value="" placeholder="排序" />
|
<label class="control-label" for="publisher_en">发布者英文</label>
|
||||||
</div>
|
<div class="controls">
|
||||||
</div>
|
<input type="text" id="publisher_en" name="publisher_en" value="<?= isset($this->data['publisher_en']) ? $this->data['publisher_en']:"" ?>" />
|
||||||
<?php }else{ ?>
|
</div>
|
||||||
<?php
|
</div>
|
||||||
$index = 0;
|
<?php if(empty($this->data['info']) || !is_array($this->data['info'])) {?>
|
||||||
foreach($this->data['info'] as $k=>$v){
|
<div class="control-group infocontrol" id="info1">
|
||||||
$index ++;
|
<label class="control-label" for="">info</label>
|
||||||
?>
|
<div class="controls">
|
||||||
<div class="control-group infocontrol">
|
<input type="text" name="info[1][author]" value="" placeholder="作者" />
|
||||||
<label class="control-label">info</label>
|
<input type="text" name="info[1][organization]" value="" placeholder="单位" />
|
||||||
<div class="controls">
|
<input type="text" name="info[1][author_en]" value="" placeholder="作者英文" />
|
||||||
<input type="text" name="info[<?= $k ?>][author]" value="<?= $v['author'] ?>" placeholder="作者" />
|
<input type="text" name="info[1][organization_en]" value="" placeholder="单位英文" />
|
||||||
<input type="text" name="info[<?= $k ?>][organization]" value="<?= $v['organization'] ?>" placeholder="单位" />
|
<input type="text" name="info[1][order]" value="" placeholder="排序" />
|
||||||
<input type="text" name="info[<?= $k ?>][order]" value="<?= $v['order'] ?>" placeholder="排序" />
|
</div>
|
||||||
<?php if($index>0){ ?>
|
</div>
|
||||||
<a href="javascript:void(0);" onclick="RmInput(this)"> -删除</a>
|
<?php }else{ ?>
|
||||||
<?php }?>
|
<?php
|
||||||
</div>
|
$index = 0;
|
||||||
</div>
|
foreach($this->data['info'] as $k=>$v){
|
||||||
<?php } ?>
|
$index ++;
|
||||||
<?php } ?>
|
?>
|
||||||
<div class="control-group">
|
<div class="control-group infocontrol">
|
||||||
<div class="controls">
|
<label class="control-label">info</label>
|
||||||
<a href="javascript:void(0);" onclick="addinput()">+添加一条</a>
|
<div class="controls">
|
||||||
</div>
|
<input type="text" name="info[<?= $k ?>][author]" value="<?= $v['author'] ?>" placeholder="作者" />
|
||||||
</div>
|
<input type="text" name="info[<?= $k ?>][organization]" value="<?= $v['organization'] ?>" placeholder="单位" />
|
||||||
<div class="control-group">
|
<input type="text" name="info[<?= $k ?>][author_en]" value="<?= $v['author_en'] ?>" placeholder="作者英文" />
|
||||||
<div class="controls">
|
<input type="text" name="info[<?= $k ?>][organization_en]" value="<?= $v['organization_en'] ?>" placeholder="单位英文" />
|
||||||
<input type="hidden" name="submit" value="1" />
|
<input type="text" name="info[<?= $k ?>][order]" value="<?= $v['order'] ?>" placeholder="排序" />
|
||||||
<?php if(!empty($this->id)) { ?>
|
<?php if($index>1){ ?>
|
||||||
<input type="hidden" name="id" value=" <?=$this->id?> " />
|
<a href="javascript:void(0);" onclick="RmInput(this)"> -删除</a>
|
||||||
<?php } ?>
|
<?php }?>
|
||||||
<?php if(!empty($this->uuid)) { ?>
|
</div>
|
||||||
<input type="hidden" name="uuid" value=" <?=$this->uuid?>" />
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<button type="submit" class="btn btn-primary">提交</button>
|
<?php } ?>
|
||||||
</div>
|
<div class="control-group">
|
||||||
</div>
|
<div class="controls">
|
||||||
</form>
|
<a href="javascript:void(0);" onclick="addinput()">+添加一条</a>
|
||||||
<?php } ?>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="control-group">
|
||||||
</div>
|
<div class="controls">
|
||||||
<script>
|
<input type="hidden" name="submit" value="1" />
|
||||||
function addinput(){
|
<?php if(!empty($this->id)) { ?>
|
||||||
var now_index = $('.infocontrol').length;
|
<input type="hidden" name="id" value=" <?=$this->id?> " />
|
||||||
var index = now_index + 1;
|
<?php } ?>
|
||||||
html = '<div class="control-group infocontrol"><div class="controls">'
|
<?php if(!empty($this->uuid)) { ?>
|
||||||
+ '<input type="text" name="info[' + index + '][author]" placeholder="作者" /> '
|
<input type="hidden" name="uuid" value=" <?=$this->uuid?>" />
|
||||||
+ '<input type="text" name="info[' + index + '][organization]" placeholder="单位" /> '
|
<?php } ?>
|
||||||
+ '<input type="text" name="info[' + index + '][order]" placeholder="排序" /> '
|
<button type="submit" class="btn btn-primary">提交</button>
|
||||||
+ '<a href="javascript:void(0);" onclick="RmInput(this)"> -删除</a>'
|
</div>
|
||||||
+ '</div></div>';
|
</div>
|
||||||
now_index = null;
|
</form>
|
||||||
index = null;
|
<?php } ?>
|
||||||
$('.infocontrol').last().after(html);
|
</div>
|
||||||
}
|
</div>
|
||||||
function RmInput(e){
|
</div>
|
||||||
$e = $(e);
|
<script>
|
||||||
$e.parent('div').parent('div.infocontrol').remove();
|
function addinput(){
|
||||||
}
|
var now_index = $('.infocontrol').length;
|
||||||
</script>
|
var index = now_index + 1;
|
||||||
|
html = '<div class="control-group infocontrol"><div class="controls">'
|
||||||
|
+ '<input type="text" name="info[' + index + '][author]" placeholder="作者" /> '
|
||||||
|
+ '<input type="text" name="info[' + index + '][organization]" placeholder="单位" /> '
|
||||||
|
+ '<input type="text" name="info[' + index + '][author_en]" placeholder="作者英文" /> '
|
||||||
|
+ '<input type="text" name="info[' + index + '][organization_en]" placeholder="单位英文" /> '
|
||||||
|
+ '<input type="text" name="info[' + index + '][order]" placeholder="排序" /> '
|
||||||
|
+ '<a href="javascript:void(0);" onclick="RmInput(this)"> -删除</a>'
|
||||||
|
+ '</div></div>';
|
||||||
|
now_index = null;
|
||||||
|
index = null;
|
||||||
|
$('.infocontrol').last().after(html);
|
||||||
|
}
|
||||||
|
function RmInput(e){
|
||||||
|
$e = $(e);
|
||||||
|
$e.parent('div').parent('div.infocontrol').remove();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<!-- //页面内容 -->
|
<!-- //页面内容 -->
|
|
@ -3,6 +3,7 @@ $this->headTitle($this->config->title->site);
|
||||||
$this->headTitle($this->config->title->author);
|
$this->headTitle($this->config->title->author);
|
||||||
$this->headTitle()->setSeparator(' - ');
|
$this->headTitle()->setSeparator(' - ');
|
||||||
$this->theme->AppendPlus($this,'colorbox');
|
$this->theme->AppendPlus($this,'colorbox');
|
||||||
|
$this->theme->AppendModel($this,"author-literature");
|
||||||
$this->headLink()->appendStylesheet('/css/author.css');
|
$this->headLink()->appendStylesheet('/css/author.css');
|
||||||
$this->headScript()->appendFile('/static/js/uploadify/swfobject.js');
|
$this->headScript()->appendFile('/static/js/uploadify/swfobject.js');
|
||||||
$this->headScript()->appendFile('/static/js/uploadify/jquery.uploadify.v2.1.4.min.js');
|
$this->headScript()->appendFile('/static/js/uploadify/jquery.uploadify.v2.1.4.min.js');
|
||||||
|
@ -34,9 +35,12 @@ $this->breadcrumb()->setSeparator(' > ');
|
||||||
foreach ($this->paginator as $item):
|
foreach ($this->paginator as $item):
|
||||||
$autoindex++;?>
|
$autoindex++;?>
|
||||||
<li class="well" id="list_<?php echo $item['id'].$item['uuid'];?>">
|
<li class="well" id="list_<?php echo $item['id'].$item['uuid'];?>">
|
||||||
<p><?php echo $item['reference'];?>
|
<p><?php echo $item['reference'];?></p>
|
||||||
|
<p>
|
||||||
【 <a href="/author/literature/id/<?php echo $item['id'];?>">查看详细</a>
|
【 <a href="/author/literature/id/<?php echo $item['id'];?>">查看详细</a>
|
||||||
| <a onclick="return confirm('是否确定删除该版本?');" href="javascript:action('delete&id=<?php echo $item['id'];?>','<?php echo $item['uuid'];?>');" class="more">删除</a>
|
| <a href="javascript:void(0);" class="edit" rel="<?= $item['id'];?>">编辑</a>
|
||||||
|
| <a href="javascript:void(0);" class="order" rel="<?= $item['id'];?>" rev="<?= $item['place']?>">排序</a>
|
||||||
|
| <a onclick="return confirm('是否确定删除该文献?');" href="javascript:action('delete&id=<?php echo $item['id'];?>','<?php echo $item['uuid'];?>');" class="more">删除</a>
|
||||||
| <a href="/author/literature/ac/add/uuid/<?php echo $item['uuid'];?>" class="more iframe">添加文献</a>
|
| <a href="/author/literature/ac/add/uuid/<?php echo $item['uuid'];?>" class="more iframe">添加文献</a>
|
||||||
】</p>
|
】</p>
|
||||||
</li>
|
</li>
|
||||||
|
@ -45,8 +49,6 @@ $this->breadcrumb()->setSeparator(' > ');
|
||||||
endif; ?>
|
endif; ?>
|
||||||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -49,7 +49,7 @@ $this->breadcrumb()->setSeparator(' > ');
|
||||||
<p><?php echo $item['reference'];?>
|
<p><?php echo $item['reference'];?>
|
||||||
【 <a href="/author/literature/id/<?php echo $item['id'];?>">查看详细</a>
|
【 <a href="/author/literature/id/<?php echo $item['id'];?>">查看详细</a>
|
||||||
|
|
|
|
||||||
<a onclick="return confirm('是否确定删除该版本?');" href="javascript:action('delete&id=<?php echo $item['id'];?>','<?php echo $item['uuid'];?>');" class="more">删除</a>
|
<a onclick="return confirm('是否确定删除该文献?');" href="javascript:action('delete&id=<?php echo $item['id'];?>','<?php echo $item['uuid'];?>');" class="more">删除</a>
|
||||||
】</p>
|
】</p>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach;
|
<?php endforeach;
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
$this->headTitle('寒区旱区科学数据中心');
|
||||||
|
if(!empty($this->pageTitle))
|
||||||
|
{
|
||||||
|
$this->headTitle()->setSeparator(' - ');
|
||||||
|
$this->headTitle($this->pageTitle);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="row-fluit">
|
||||||
|
<div class="hero-unit">
|
||||||
|
<h2><?= $this->content ?><?php if(!empty($this->url)) echo ",系统正在为您跳转..."?></h2>
|
||||||
|
<?php if(!empty($this->url)) {?>
|
||||||
|
<a href="<?= $this->url ?>">如果没有跳转请点击这样</a>
|
||||||
|
<script language="javascript">setTimeout("self.location='<?= $this->url?>'",3000);</script>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -158,5 +158,13 @@ class Theme
|
||||||
|
|
||||||
}// AppendPlus
|
}// AppendPlus
|
||||||
|
|
||||||
|
//加载页面中的JS
|
||||||
|
function AppendModel($render,$model)
|
||||||
|
{
|
||||||
|
|
||||||
|
$model = trim($model);
|
||||||
|
|
||||||
|
$render->headScript()->appendFile("/js/lib/custom/models/".$model.".js");
|
||||||
|
|
||||||
|
}//
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,44 +1,122 @@
|
||||||
<?php
|
<?php
|
||||||
class Author extends Zend_Controller_Plugin_Abstract
|
class Author extends Zend_Controller_Plugin_Abstract
|
||||||
{
|
{
|
||||||
private $db; //传入PDO对象.
|
public $db; //传入PDO对象.
|
||||||
private $auth = NULL; //Zend_Auth 对象
|
private $auth = NULL; //Zend_Auth 对象
|
||||||
|
|
||||||
//使用到的公共变量
|
//使用到的公共变量
|
||||||
public $tbl_metadata = "metadata"; //元数据
|
public $tbl_metadata = "metadata"; //元数据
|
||||||
public $tbl_author = "mdauthor"; //数据作者表
|
public $tbl_author = "mdauthor"; //数据作者表
|
||||||
|
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
//检查前台用户对某条数据的权限
|
//检查前台用户对某条数据的权限
|
||||||
function checkAuthor($uuid,$uid=0)
|
function checkAuthor($uuid,$uid=0)
|
||||||
{
|
{
|
||||||
if(empty($uid))
|
if(empty($uid))
|
||||||
{
|
{
|
||||||
$auth = Zend_Auth::getInstance();
|
$auth = Zend_Auth::getInstance();
|
||||||
if($auth->hasIdentity())
|
if($auth->hasIdentity())
|
||||||
{
|
{
|
||||||
$user = $auth->getIdentity();
|
$user = $auth->getIdentity();
|
||||||
$uid = $user->id;
|
$uid = $user->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!empty($uid))
|
if(!empty($uid))
|
||||||
{
|
{
|
||||||
$sql = "SELECT * FROM ".$this->tbl_author." WHERE uuid='$uuid' AND userid=$uid";
|
$sql = "SELECT * FROM ".$this->tbl_author." WHERE uuid='$uuid' AND userid=$uid";
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rs = $this->db->query($sql);
|
$rs = $this->db->query($sql);
|
||||||
$row = $rs->fetch(PDO::FETCH_BOTH);
|
$row = $rs->fetch(PDO::FETCH_BOTH);
|
||||||
if($row['status']>0)
|
if($row['status']>0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Literature extends Author
|
||||||
|
{
|
||||||
|
public function __construct($db)
|
||||||
|
{
|
||||||
|
$this->db = $db;
|
||||||
|
}
|
||||||
|
|
||||||
|
function byuuid($uuid){
|
||||||
|
include_once("helper/view.php");
|
||||||
|
$uid = view::User('id');
|
||||||
|
$sql = "SELECT md.title,md.uuid,r.id,r.reference,r.link,mr.place FROM mdref mr
|
||||||
|
LEFT JOIN metadata md ON md.uuid=mr.uuid
|
||||||
|
LEFT JOIN mdauthor a ON md.uuid=a.uuid
|
||||||
|
left join reference r on mr.refid=r.id
|
||||||
|
WHERE md.title IS NOT NULL AND a.userid=? and mr.uuid=? AND a.status=1
|
||||||
|
order by mr.place ASC,r.id DESC,md.ts_created desc
|
||||||
|
";
|
||||||
|
$sth = $this->db->prepare($sql);
|
||||||
|
$sth->execute(array($uid,$uuid));
|
||||||
|
$rows = $sth->fetchAll();
|
||||||
|
return $rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
function edit($id,$content){
|
||||||
|
include_once("helper/dbh.php");
|
||||||
|
$dbh = new dbh($this->db);
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'reference' => $content
|
||||||
|
);
|
||||||
|
|
||||||
|
$s = $dbh->update("reference",$data," id=$id ",false);
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
|
function order($id,$order){
|
||||||
|
include_once("helper/dbh.php");
|
||||||
|
$dbh = new dbh($this->db);
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'place' => $order
|
||||||
|
);
|
||||||
|
|
||||||
|
$s = $dbh->update("mdref",$data," refid=$id ",false);
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
|
function bydata($keywords=""){
|
||||||
|
$auth = Zend_Auth::getInstance();
|
||||||
|
if($auth->hasIdentity())
|
||||||
|
{
|
||||||
|
$user = $auth->getIdentity();
|
||||||
|
$uid = $user->id;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT md.title,md.uuid,count(mr.id) as c FROM metadata md
|
||||||
|
LEFT JOIN mdref mr ON md.uuid=mr.uuid
|
||||||
|
LEFT JOIN mdauthor a ON md.uuid=a.uuid
|
||||||
|
left join reference r on mr.refid=r.id
|
||||||
|
WHERE md.title IS NOT NULL AND a.userid=$uid AND a.status=1";
|
||||||
|
if(!empty($keywords))
|
||||||
|
{
|
||||||
|
include_once('SimpleSearch.php');
|
||||||
|
$search=new SimpleSearch($keywords);
|
||||||
|
$where=$search->sql_expr(array("md.title","md.description"));
|
||||||
|
$sql.=' and '.$where;
|
||||||
|
}
|
||||||
|
$sql.=" group by md.uuid,md.title";
|
||||||
|
|
||||||
|
$sth = $this->db->query($sql);
|
||||||
|
$rows = $sth->fetchAll();
|
||||||
|
|
||||||
|
return $rows;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
class Review extends Zend_Controller_Plugin_Abstract
|
||||||
|
{
|
||||||
|
private $db; //传入PDO对象.
|
||||||
|
private $auth = NULL; //Zend_Auth 对象
|
||||||
|
|
||||||
|
//使用到的公共变量
|
||||||
|
public $tbl_review = "mdexpertreview";
|
||||||
|
|
||||||
|
function __construct($db)
|
||||||
|
{
|
||||||
|
$this->db = $db;
|
||||||
|
}
|
||||||
|
|
||||||
|
//接受或者拒绝评审
|
||||||
|
function invite($id,$uuid,$uid,$status)
|
||||||
|
{
|
||||||
|
if(empty($id) || empty($uuid) || !is_numeric($id) ||!preg_match("/^[0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12}$/",$uuid))
|
||||||
|
{
|
||||||
|
return"参数错误";
|
||||||
|
}
|
||||||
|
|
||||||
|
if($id != $uid)
|
||||||
|
{
|
||||||
|
return "您无权使用此通知";
|
||||||
|
}//非本人操作
|
||||||
|
|
||||||
|
try{
|
||||||
|
$sql = "update ".$this->tbl_review." set status=$status where id='$id' and uuid='$uuid'";
|
||||||
|
if($this->db->exec($sql))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return "您无权限进行此操作";
|
||||||
|
}
|
||||||
|
}catch(Exception $e){
|
||||||
|
return "处理中出现错误";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,83 +1,100 @@
|
||||||
<?php
|
<?php
|
||||||
class view extends Zend_Controller_Plugin_Abstract
|
class view extends Zend_Controller_Plugin_Abstract
|
||||||
{
|
{
|
||||||
private $db; //传入PDO对象.
|
private $db; //传入PDO对象.
|
||||||
private $product = 0; //产品环境
|
private $product = 0; //产品环境
|
||||||
|
|
||||||
function __construct($db='')
|
function __construct($db='')
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function addPaginator($data,$ctl,Zend_Controller_Request_Abstract $request)
|
static function addPaginator($data,$ctl,Zend_Controller_Request_Abstract $request)
|
||||||
{
|
{
|
||||||
$page = $request->getParam('page');
|
$page = $request->getParam('page');
|
||||||
|
|
||||||
$paginator = Zend_Paginator::factory($data);
|
$paginator = Zend_Paginator::factory($data);
|
||||||
$paginator->setCurrentPageNumber($page);
|
$paginator->setCurrentPageNumber($page);
|
||||||
$paginator->setItemCountPerPage(12);
|
$paginator->setItemCountPerPage(12);
|
||||||
$paginator->setView($ctl);
|
$paginator->setView($ctl);
|
||||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
||||||
$ctl->paginator = $paginator;
|
$ctl->paginator = $paginator;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function Msg($type,$content,$url=''){
|
static function Msg($type,$content,$url=''){
|
||||||
$html = '<div class="alert '.$type.'">'."\r\n";
|
$html = '<div class="alert '.$type.'">'."\r\n";
|
||||||
$html.= '<a data-dismiss="alert" class="close">×</a>'."\r\n";
|
$html.= '<a data-dismiss="alert" class="close">×</a>'."\r\n";
|
||||||
$html.= $content."\r\n";
|
$html.= $content."\r\n";
|
||||||
$html.= '</div>'."\r\n";
|
$html.= '</div>'."\r\n";
|
||||||
if(!empty($url))
|
if(!empty($url))
|
||||||
{
|
{
|
||||||
if($url == -1){
|
if($url == -1){
|
||||||
$html.= '<script language="javascript">setTimeout("window.history.back(-1);",3000);</script>'."\r\n";
|
$html.= '<script language="javascript">setTimeout("window.history.back(-1);",3000);</script>'."\r\n";
|
||||||
}else{
|
}else{
|
||||||
$html.= '<script language="javascript">setTimeout("self.location=\''.$url.'\'",3000);</script>'."\r\n";
|
$html.= '<script language="javascript">setTimeout("self.location=\''.$url.'\'",3000);</script>'."\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function Error($type,$content,$url=''){
|
static function Error($type,$content,$url=''){
|
||||||
if(empty($type))
|
if(empty($type))
|
||||||
{
|
{
|
||||||
$AlertType = "alert-error";
|
$AlertType = "alert-error";
|
||||||
}else{
|
}else{
|
||||||
$AlertType = $type;
|
$AlertType = $type;
|
||||||
}
|
}
|
||||||
$html = '<div class="alert alert-block fade in '.$AlertType.'" id="Alert-error-box">'."\r\n";
|
$html = '<div class="alert alert-block fade in '.$AlertType.'" id="Alert-error-box">'."\r\n";
|
||||||
$html.= '<a class="close" data-dismiss="alert" href="#">×</a>'."\r\n";
|
$html.= '<a class="close" data-dismiss="alert" href="#">×</a>'."\r\n";
|
||||||
if(!is_array($content)) {
|
if(!is_array($content)) {
|
||||||
$html.= '<h4 class="alert-heading">'.$content.'</h4>'."\r\n";
|
$html.= '<h4 class="alert-heading">'.$content.'</h4>'."\r\n";
|
||||||
}else{
|
}else{
|
||||||
$html.= '<ul>'."\r\n";
|
$html.= '<ul>'."\r\n";
|
||||||
foreach($content as $v) {
|
foreach($content as $v) {
|
||||||
$html.='<li>'.$v.'</li>'."\r\n";
|
$html.='<li>'.$v.'</li>'."\r\n";
|
||||||
}
|
}
|
||||||
$html.= '</ul>'."\r\n";
|
$html.= '</ul>'."\r\n";
|
||||||
}
|
}
|
||||||
$html.= '</div>'."\r\n";
|
$html.= '</div>'."\r\n";
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function User($param){
|
static function User($param){
|
||||||
$auth = Zend_Auth::getInstance();
|
$auth = Zend_Auth::getInstance();
|
||||||
if($auth->hasIdentity())
|
if($auth->hasIdentity())
|
||||||
{
|
{
|
||||||
$user = $auth->getIdentity();
|
$user = $auth->getIdentity();
|
||||||
return $user->$param;
|
return $user->$param;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static function Dump($data,$exit = true){
|
static function Dump($data,$exit = true){
|
||||||
echo "<pre>";
|
echo "<pre>";
|
||||||
var_dump($data);
|
var_dump($data);
|
||||||
echo "</pre>";
|
echo "</pre>";
|
||||||
if($exit)
|
if($exit)
|
||||||
{
|
{
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function Post(Zend_Controller_Action $ctl,$msg){
|
||||||
|
|
||||||
|
if(empty($msg))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!array($msg))
|
||||||
|
{
|
||||||
|
$msg = array('content'=>$msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
$helper = new Zend_Controller_Action_HelperBroker($ctl);
|
||||||
|
$helper->viewRenderer->setNoRender();
|
||||||
|
echo $ctl->view->partial('post-message.phtml', $msg);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ $registry->set('db',$db);
|
||||||
|
|
||||||
// setup controller
|
// setup controller
|
||||||
$frontController = Zend_Controller_Front::getInstance();
|
$frontController = Zend_Controller_Front::getInstance();
|
||||||
$frontController->throwExceptions(false);
|
$frontController->throwExceptions(true);
|
||||||
//$frontController->setControllerDirectory('../application/controllers');
|
//$frontController->setControllerDirectory('../application/controllers');
|
||||||
$frontController->setControllerDirectory(array(
|
$frontController->setControllerDirectory(array(
|
||||||
'default' => '../application/default/controllers',
|
'default' => '../application/default/controllers',
|
||||||
|
|
|
@ -0,0 +1,167 @@
|
||||||
|
$(document).ready(function(e) {
|
||||||
|
$('.edit').click(function(e) {
|
||||||
|
$(this).litedit({'id':$(this).attr('rel')});
|
||||||
|
});
|
||||||
|
$('.order').click(function(e) {
|
||||||
|
$(this).litorder({'id':$(this).attr('rel')});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// JavaScript Document
|
||||||
|
(function( $ ){
|
||||||
|
|
||||||
|
$.fn.litedit = function( options ) {
|
||||||
|
|
||||||
|
var settings = $.extend( {
|
||||||
|
id:'',
|
||||||
|
content : '',
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
var methods = {
|
||||||
|
edit : function(id)
|
||||||
|
{
|
||||||
|
methods.creatWindow(id);
|
||||||
|
},
|
||||||
|
creatWindow : function(id){
|
||||||
|
$.colorbox({
|
||||||
|
initialHeight: '0',
|
||||||
|
initialWidth: '0',
|
||||||
|
html: methods.dialog,
|
||||||
|
opacity: '0.3',
|
||||||
|
onComplete: function(){
|
||||||
|
$('.confirm_yes').click(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
methods.submited(id);
|
||||||
|
$.colorbox.close();
|
||||||
|
});
|
||||||
|
$('.confirm_no').click(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$.colorbox.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submited : function(id){
|
||||||
|
$.ajax({
|
||||||
|
'type':"POST",
|
||||||
|
'url':'/author/literature/',
|
||||||
|
'data':'ac=edit&id='+id+'&content='+$('#content_input_area').val(),
|
||||||
|
'success':function(data){
|
||||||
|
if (typeof(data)=='object')
|
||||||
|
{
|
||||||
|
if(typeof(data.error)!='undefined')
|
||||||
|
{alert(data.error);}
|
||||||
|
if(typeof(data.success)!='undefined')
|
||||||
|
{
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert('出现错误,请稍候再试');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'timeout': 30000,
|
||||||
|
'error': function(){
|
||||||
|
alert('出现错误,请刷新后重试');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dialog : function(content){
|
||||||
|
HTML = '<div class=""><div class="modal-header"><h3>修改文献</h3></div>'
|
||||||
|
+ '<div class="modal-body"><textarea class="span8" id="content_input_area">'+settings.content+'</textarea></div>'
|
||||||
|
+ '<div class="modal-footer"><a href="javascript:void(0);" class="btn btn-primary confirm_yes">是</a><a href="javascript:void(0);" class="btn confirm_no">否</a></div></div>';
|
||||||
|
return HTML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.each(function() {
|
||||||
|
if( settings.id == '')
|
||||||
|
{
|
||||||
|
alert('参数错误');
|
||||||
|
}
|
||||||
|
|
||||||
|
settings.content = $(this).parent('p').prev('p').html();
|
||||||
|
|
||||||
|
methods.edit(settings.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
})( jQuery );
|
||||||
|
|
||||||
|
(function( $ ){
|
||||||
|
|
||||||
|
$.fn.litorder = function( options ) {
|
||||||
|
|
||||||
|
var settings = $.extend( {
|
||||||
|
id:'',
|
||||||
|
order : '',
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
var methods = {
|
||||||
|
edit : function(id)
|
||||||
|
{
|
||||||
|
methods.creatWindow(id);
|
||||||
|
},
|
||||||
|
creatWindow : function(id){
|
||||||
|
$.colorbox({
|
||||||
|
initialHeight: '0',
|
||||||
|
initialWidth: '0',
|
||||||
|
html: methods.dialog,
|
||||||
|
opacity: '0.3',
|
||||||
|
onComplete: function(){
|
||||||
|
$('.confirm_yes').click(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
methods.submited(id);
|
||||||
|
$.colorbox.close();
|
||||||
|
});
|
||||||
|
$('.confirm_no').click(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$.colorbox.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submited : function(id){
|
||||||
|
$.ajax({
|
||||||
|
'type':"POST",
|
||||||
|
'url':'/author/literature/',
|
||||||
|
'data':'ac=order&id='+id+'&order='+$('#order_input').val(),
|
||||||
|
'success':function(data){
|
||||||
|
if (typeof(data)=='object')
|
||||||
|
{
|
||||||
|
if(typeof(data.error)!='undefined')
|
||||||
|
{alert(data.error);}
|
||||||
|
if(typeof(data.success)!='undefined')
|
||||||
|
{
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert('出现错误,请稍候再试');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'timeout': 30000,
|
||||||
|
'error': function(){
|
||||||
|
alert('出现错误,请刷新后重试');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dialog : function(content){
|
||||||
|
HTML = '<div class=""><div class="modal-header"><h3>修改排序</h3></div>'
|
||||||
|
+ '<div class="modal-body">数字越小排序越靠前<br />'
|
||||||
|
+ '请输入排序数字<input type="text" id="order_input" value="'+settings.order+'"/></div>'
|
||||||
|
+ '<div class="modal-footer"><a href="javascript:void(0);" class="btn btn-primary confirm_yes">是</a><a href="javascript:void(0);" class="btn confirm_no">否</a></div></div>';
|
||||||
|
return HTML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.each(function() {
|
||||||
|
if( settings.id == '')
|
||||||
|
{
|
||||||
|
alert('参数错误');
|
||||||
|
}
|
||||||
|
settings.order = $(this).attr('rev');
|
||||||
|
methods.edit(settings.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
})( jQuery );
|
Loading…
Reference in New Issue