add author/fund and fixed a bug in /admin/data/fund

This commit is contained in:
Li Jianxuan 2013-04-21 09:08:43 +00:00
parent 2921d1c5b9
commit 9fb68755a7
10 changed files with 4586 additions and 4068 deletions

View File

@ -89,7 +89,11 @@ table thead tr th {background:#EBF2F6;}
<?php $autoindex=0; <?php $autoindex=0;
foreach ($this->paginator as $item): foreach ($this->paginator as $item):
$autoindex++;?> $autoindex++;?>
<?php if(empty($this->md)) { ?>
<tr id="DataLine_<?= $item['id']?>">
<?php }else{?>
<tr id="DataLine_<?= $item['mfid']?>"> <tr id="DataLine_<?= $item['mfid']?>">
<?php }?>
<td><?= $item['title'] ?></td> <td><?= $item['title'] ?></td>
<td><?= $item['fund_id'] ?></td> <td><?= $item['fund_id'] ?></td>
<td><?= $item['fund_type'] ?></td> <td><?= $item['fund_type'] ?></td>

File diff suppressed because it is too large Load Diff

View File

@ -7,12 +7,13 @@
$this->breadcrumb('<a href="/account/register">用户注册</a>'); $this->breadcrumb('<a href="/account/register">用户注册</a>');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<div id="info"> <div class="row-fluit">
<img src="/images/pass_login1.gif" />&nbsp;确认服务条款&nbsp;&nbsp; <div class="span12">
<img src="/images/pass_pic_arrowhead_2.gif" />&nbsp;&nbsp; <img src="/images/pass_login1.gif" />&nbsp;确认服务条款&nbsp;&nbsp;
<img src="/images/pass_login2.gif" />&nbsp;填写基本信息&nbsp;&nbsp; <img src="/images/pass_pic_arrowhead_2.gif" />&nbsp;&nbsp;
<img src="/images/pass_pic_arrowhead_2.gif" />&nbsp;&nbsp; <img src="/images/pass_login2.gif" />&nbsp;填写基本信息&nbsp;&nbsp;
<img src="/images/pass_login3.gif" />&nbsp;注册完成 <img src="/images/pass_pic_arrowhead_2.gif" />&nbsp;&nbsp;
<img src="/images/pass_login3.gif" />&nbsp;注册完成
<?php echo $this->form;?>
<?php echo $this->form;?></div> </div>
</div>

View File

@ -1,73 +1,74 @@
<?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/author.css'); $this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>'); $this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('我的数据'); $this->breadcrumb('我的数据');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<div class="row"> <div class="row">
<div class="span3"> <div class="span3">
<?= $this->partial('author/navi.phtml'); ?> <?= $this->partial('author/navi.phtml'); ?>
</div> </div>
<div class="span9"> <div class="span9">
<p>请输入元数据标题关键字进行搜索</p> <p>请输入元数据标题关键字进行搜索</p>
<div class="input-append"> <div class="input-append">
<form id="datasearch" class="search_form" action="/author/accept/ac/search"> <form id="datasearch" class="search_form" action="/author/accept/ac/search">
<input class="span2" type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>"> <input class="span2" type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>">
<button class="btn" type="submit">搜索</button> <button class="btn" type="submit">搜索</button>
</form> </form>
</div> </div>
<div> <div>
<?php <?php
if (count($this->paginator)): if (count($this->paginator)):
echo '<ul class="unstyled">'; echo '<ul class="unstyled">';
$autoindex=0; $autoindex=0;
foreach ($this->paginator as $item): foreach ($this->paginator as $item):
$autoindex++;?> $autoindex++;?>
<li class="well"> <li class="well">
<h4><a href="/data/<?php echo $item['uuid'];?>" target="_blank" class="title"><?php echo $item['title'];?></a></h4> <h4><a href="/data/<?php echo $item['uuid'];?>" target="_blank" class="title"><?php echo $item['title'];?></a></h4>
<?php if($item['status']==1) : ?> <?php if($item['status']==1) : ?>
<span class="dtctrlplan">【操作: <span class="dtctrlplan">【操作:
<a href="/author/inauthor/ac/datalist/uuid/<?php echo $item['uuid']; ?>">申请管理</a> | <a href="/author/inauthor/ac/datalist/uuid/<?php echo $item['uuid']; ?>">申请管理</a> |
<a href="/author/comment/ac/view/uuid/<?php echo $item['uuid']; ?>">反馈</a> | <a href="/author/comment/ac/view/uuid/<?php echo $item['uuid']; ?>">反馈</a> |
<a href="/author/document/uuid/<?php echo $item['uuid']; ?>">文档</a> | <a href="/author/document/uuid/<?php echo $item['uuid']; ?>">文档</a> |
<a href="/author/literature/uuid/<?php echo $item['uuid']; ?>">文献</a> | <a href="/author/literature/uuid/<?php echo $item['uuid']; ?>">文献</a> |
<a href="/author/literature/ac/add/uuid/<?php echo $item['uuid']; ?>">添加文献</a> | <a href="/author/literature/ac/add/uuid/<?php echo $item['uuid']; ?>">添加文献</a> |
<a href="/service/geonetwork?url=metadata.edit?id=<?php echo $item['gid']; ?>" target="_blank">修改元数据</a> | <a href="/service/geonetwork?url=metadata.edit?id=<?php echo $item['gid']; ?>" target="_blank">修改元数据</a> |
<a href="/author/version/uuid/<?php echo $item['uuid']; ?>">版本</a> | <a href="/author/version/uuid/<?php echo $item['uuid']; ?>">版本</a> |
<a href="/author/qa/uuid/<?php echo $item['uuid']; ?>">QA</a> | <a href="/author/qa/uuid/<?php echo $item['uuid']; ?>">QA</a> |
<a href="/author/news/uuid/<?php echo $item['uuid']; ?>">新闻</a> | <a href="/author/news/uuid/<?php echo $item['uuid']; ?>">新闻</a> |
<a href="/author/viewauthors/uuid/<?php echo $item['uuid']; ?>">所有作者</a> <a href="/author/viewauthors/uuid/<?php echo $item['uuid']; ?>">所有作者</a>
<?php if($item['mdstatus']==6) {?> <?php if($item['mdstatus']==6) {?>
| <a href="/author/delegate/uuid/<?php echo $item['uuid'];?>" onclick="return confirm('是否确定将该数据委托至数据中心?');">委托</a> | <a href="/author/delegate/uuid/<?php echo $item['uuid'];?>" onclick="return confirm('是否确定将该数据委托至数据中心?');">委托</a>
<?php } if($item['mdstatus']==7){ ?> <?php } if($item['mdstatus']==7){ ?>
| <a href="/author/delegate/ac/cancel/uuid/<?php echo $item['uuid'];?>" onclick="return confirm('是否确定取消该数据的委托?');">取消委托</a> | <a href="/author/delegate/ac/cancel/uuid/<?php echo $item['uuid'];?>" onclick="return confirm('是否确定取消该数据的委托?');">取消委托</a>
<?php }?> | <?php }?> |
<a href="/author/sendmail/uuid/<?php echo $item['uuid']; ?>">邮件通知</a> <a href="/author/sendmail/uuid/<?php echo $item['uuid']; ?>">邮件通知</a> |
<a href="/author/fund/ac/formd/uuid/<?php echo $item['uuid']; ?>">支持项目</a>
</span>
<?php endif; ?> </span>
<?php endif; ?>
<p><?php echo mb_strlen($item['description'])>400?$this->escape(mb_substr($item['description'],0,400,'UTF-8').'...'):$this->escape($item['description']); ?></p>
<p> <p><?php echo mb_strlen($item['description'])>400?$this->escape(mb_substr($item['description'],0,400,'UTF-8').'...'):$this->escape($item['description']); ?></p>
<?php <p>
if ($item['status']==0) <?php
{ if ($item['status']==0)
echo '<img src="/images/list_extensions.gif" />您已经申请该数据(如果长时间没有收到回应请联系数据中心)'; {
} echo '<img src="/images/list_extensions.gif" />您已经申请该数据(如果长时间没有收到回应请联系数据中心)';
?> }
<span id="data_<?php echo $item['uuid'];?>"></span> ?>
</p> <span id="data_<?php echo $item['uuid'];?>"></span>
</li> </p>
<?php endforeach; </li>
echo "</ul>"; <?php endforeach;
endif; ?> echo "</ul>";
<div class="pagenavi"><?= $this->paginator; ?></div> endif; ?>
</div> <div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>
</div>
</div> </div>

View File

@ -0,0 +1,91 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>');
$this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('申请成为元数据作者');
$this->breadcrumb()->setSeparator(' > ');
$this->theme->AppendPlus($this,'colorbox');
$this->theme->AppendPlus($this,'admin_plugin');
?>
<div class="row-fluid">
<div class="span3">
<?= $this->partial('author/navi.phtml'); ?>
</div>
<div class="span9">
<div>
<ul class="nav nav-tabs">
<li><a href="/author/fund/">所有项目</a></li>
<li class="active"><a href="/author/fund/ac/add">添加新项目</a></li>
</ul>
</div>
<div class="">
<?php if(!empty($this->error)) { ?>
<div class="alert alert-block alert-error fade in" id="Alert-error-box">
<a class="close" data-dismiss="alert" href="#">×</a>
<?php if(!is_array($this->error)) { ?><h4 class="alert-heading"><?= $this->error ?></h4><?php } else { ?>
<ul>
<?php foreach($this->error as $v) { ?>
<li><?= $v ?></li>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
<?php if(!empty($this->msg)) { ?>
<div class="alert <?= $this->AlertType;?>">
<a data-dismiss="alert" class="close">×</a>
<?php echo $this->msg ?>
</div>
<?php if(!empty($this->jump_url)) { ?>
<script language="javascript">setTimeout("self.location='<?php echo $this->jump_url ?>'",3000);</script>
<?php } ?>
<?php } else{ ?>
<form class="form-horizontal" method="post">
<div class="control-group">
<label class="control-label" for="title">项目名称</label>
<div class="controls">
<input type="text" id="title" class="span12" name="title" value="<?= isset($this->data['title']) ? $this->data['title']:"" ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="fund_id">编号</label>
<div class="controls">
<input type="text" id="fund_id" name="fund_id" value="<?= isset($this->data['fund_id']) ? $this->data['fund_id']:"" ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="fund_type">类型</label>
<div class="controls">
<input type="text" id="fund_type" name="fund_type" value="<?= isset($this->data['fund_type']) ? $this->data['fund_type']:"" ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="title_en">英文名称</label>
<div class="controls">
<input type="text" id="title_en" name="title_en" value="<?= isset($this->data['title_en']) ? $this->data['title_en']:"" ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="fund_type_en">英文类型</label>
<div class="controls">
<input type="text" id="fund_type_en" name="fund_type_en" value="<?= isset($this->data['fund_type_en']) ? $this->data['fund_type_en']:"" ?>" />
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="hidden" name="submit" value="1" />
<?php if(!empty($this->id)) { ?>
<input type="hidden" name="id" value=" <?=$this->id?> " />
<?php } ?>
<button type="submit" class="btn btn-primary">提交</button>
</div>
</div>
</form>
<?php } ?>
</div>
</div>
</div>
<!-- //页面内容 -->

View File

@ -0,0 +1,165 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>');
$this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('申请成为元数据作者');
$this->breadcrumb()->setSeparator(' > ');
$this->theme->AppendPlus($this,'colorbox');
$this->theme->AppendPlus($this,'admin_plugin');
?>
<style>
table thead tr th {background:#EBF2F6;}
</style>
<div class="row-fluid">
<div class="span3">
<?= $this->partial('author/navi.phtml'); ?>
</div>
<div class="span9">
<div>
<ul class="nav nav-tabs">
<li class="active"><a href="/author/fund/">所有项目</a></li>
<li><a href="/author/fund/ac/add">添加新项目</a></li>
</ul>
</div>
<?php if(!empty($this->md)) { ?>
<div>
<?php if(empty($this->ct)) { ?>
<a class="btn btn-primary pull-right" href="/author/fund/ac/formd/uuid/<?= $this->md['uuid'] ?>"><i class="icon-plus"></i>为此数据添加项目</a>
<?php }else{ ?>
<a class="pull-right btn" href="/author/fund/uuid/<?= $this->md['uuid'] ?>">返回</a>
<div class="pull-right label label-info">点击“添加此项目”即可将项目添加到元数据</div>
<?php } ?>
<h3><?= $this->md['title'] ?>》 的支持项目</h3>
<hr />
</div>
<?php } ?>
<div>
<div class="input-append">
<form id="datasearch" class="search_form" action="">
<input type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>" />
<button type="submit" class="btn" id="search_btn">搜索</button>
</form>
</div>
</div>
<?php if(!empty($this->error)) { ?>
<?php if(empty($this->AlertType)) $AlertType = "alert-error";else $AlertType = $this->AlertType;?>
<div class="alert alert-block fade in <?= $AlertType ?>" id="Alert-error-box">
<a class="close" data-dismiss="alert" href="#">×</a>
<?php if(!is_array($this->error)) { ?><h4 class="alert-heading"><?= $this->error ?></h4><?php } else { ?>
<ul>
<?php foreach($this->error as $v) { ?>
<li><?= $v ?></li>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
<?php if(!empty($this->msg)) { ?>
<div class="alert <?= $this->AlertType;?>">
<a data-dismiss="alert" class="close">×</a>
<?php echo $this->msg ?>
</div>
<?php if(!empty($this->jump_url)) { ?>
<script language="javascript">setTimeout("self.location='<?php echo $this->jump_url ?>'",3000);</script>
<?php } ?>
<?php } else{ ?>
<div id="datalist">
<?php if (count($this->paginator)): ?>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>名称</th>
<th>编号</th>
<th>类型</th>
<?php if($this->md) { ?>
<th width="80">排序</th>
<?php }else{ ?>
<th>英文标题</th>
<th>英文类型</th>
<?php } ?>
<?php if($this->ct) { ?>
<th>添加</th>
<?php } ?>
<th width="70">操作</th>
</tr>
</thead>
<tbody>
<?php $autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<?php if(empty($this->md)) { ?>
<tr id="DataLine_<?= $item['id']?>">
<?php }else{?>
<tr id="DataLine_<?= $item['mfid']?>">
<?php }?>
<td><?= $item['title'] ?></td>
<td><?= $item['fund_id'] ?></td>
<td><?= $item['fund_type'] ?></td>
<?php if($this->md) { ?>
<?php if($this->ct) { ?>
<td><input type="text" name="order" id="order_<?= $item['id']?>" class="span12" /></td>
<?php }else{ ?>
<td><input type="text" name="order" id="order_<?= $item['mfid']?>" class="span12" value="<?= $item['place'] ?>" /></td>
<?php }?>
<?php }else{ ?>
<td><?= $item['title_en'] ?></td>
<td><?= $item['fund_type_en'] ?></td>
<?php } ?>
<?php if($this->ct) { ?>
<td><a href="javascript:void(0);" class="addtomd" rel="<?= $item['id']?>">添加此项目</a></td>
<?php } ?>
<td>
<?php if(empty($this->md)) { ?>
<a href="/author/fund/ac/edit/id/<?= $item['id']?>">编辑</a>
<a href="javascript:void(0);" onclick="onedel(<?= $item['id']?>)" id="delbtn_<?= $item['id']?>">删除</a>
<?php }else{ ?>
<?php if(empty($this->ct)) { ?><a href="javascript:void(0);" class="changeorder" rel="<?= $item['mfid']?>">排序</a> <?php } ?>
<a href="javascript:void(0);" onclick="onedel(<?= $item['mfid']?>)" id="delbtn_<?= $item['mfid']?>">移除</a>
<?php } ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<?php } ?>
</div>
</div>
<!-- //页面内容 -->
<script>
<?php if(!empty($this->ct)) { ?>
$('.addtomd').each(function(index, element) {
$(this).click(function(){
id = $(this).attr('rel');
order = $('#order_'+id).val();
self.location='/author/fund/ac/formd/uuid/<?= $this->md['uuid'] ?>/id/'+id+'/order/'+ order
});
});
<?php }else{ ?>
$('.changeorder').each(function(index, element) {
$(this).click(function(){
id = $(this).attr('rel');
order = $('#order_'+id).val();
self.location='/author/fund/ac/formd/uuid/<?= $this->md['uuid'] ?>/mfid/'+id+'/order/'+ order
});
});
<?php } ?>
<?php if(empty($this->md)) { ?>
var info = {
btn_prefix : "delbtn_",
item_prefix : "DataLine_",
url : "/author/fund/ac/del"
}
<?php }else{ ?>
var info = {
btn_prefix : "delbtn_",
item_prefix : "DataLine_",
url : "/author/fund/ac/mdfunddel/uuid/<?= $this->md['uuid'] ?>"
}
<?php } ?>
</script>

View File

@ -1,45 +1,45 @@
<?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/author.css'); $this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>'); $this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('数据申请管理'); $this->breadcrumb('数据申请管理');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<div class="row"> <div class="row">
<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-pills"> <ul class="nav nav-pills">
<li><a href="/author/inauthor/ac/online">在线下载记录</a></li> <li><a href="/author/inauthor/ac/online">在线下载记录</a></li>
<li><a href="/author/inauthor/ac/offline">离线申请记录</a></li> <li><a href="/author/inauthor/ac/offline">离线申请记录</a></li>
<li class="active"><a href="/author/inauthor/ac/datalist">按数据查看</a></li> <li class="active"><a href="/author/inauthor/ac/datalist">按数据查看</a></li>
</ul> </ul>
</div> </div>
<p>请输入元数据标题关键字进行搜索</p> <p>请输入元数据标题关键字进行搜索</p>
<form id="datasearch" class="search_form" action="/author/inauthor/ac/searchdata"> <form id="datasearch" class="search_form" action="/author/inauthor/ac/searchdata">
<input type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>" /> <input type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>" />
<button type="submit" class="btn" id="search_btn">搜索</button> <button type="submit" class="btn" id="search_btn">搜索</button>
</form> </form>
<div> <div>
<?php <?php
if (count($this->paginator)): if (count($this->paginator)):
echo '<ul class="unstyled">'; echo '<ul class="unstyled">';
$autoindex=0; $autoindex=0;
foreach ($this->paginator as $item): foreach ($this->paginator as $item):
$autoindex++;?> $autoindex++;?>
<li class="well"> <li class="well">
<h4><a href="/data/<?php echo $item['uuid'];?>" target="_blank"><?php echo $item['title'];?></a></h4> <h4><a href="/data/<?php echo $item['uuid'];?>" target="_blank"><?php echo $item['title'];?></a></h4>
<p>申请次数:<?php echo $item['c'];?> (<a href="/author/inauthor/ac/datalist/uuid/<?php echo $item['uuid'];?>">查看详细</a>)</p> <p>申请次数:<?php echo $item['c'];?> (<a href="/author/inauthor/ac/datalist/uuid/<?php echo $item['uuid'];?>">查看详细</a>)</p>
</li> </li>
<?php endforeach; <?php endforeach;
echo "</ul>"; echo "</ul>";
endif; ?> endif; ?>
<div class="pagenavi"><?= $this->paginator; ?></div> <div class="pagenavi"><?= $this->paginator; ?></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,18 +1,19 @@
<div class="sidebar-nav bs-review-nav"> <div class="sidebar-nav bs-review-nav">
<ul class="nav nav-list bs-review-sidenav"> <ul class="nav nav-list bs-review-sidenav">
<li id="Nav-author-index"><a href="/author/"><i class="icon-chevron-right"></i>介绍</a></li> <li id="Nav-author-index"><a href="/author/"><i class="icon-chevron-right"></i>介绍</a></li>
<li id="Nav-author-newdata"><a href="/author/newdata"><i class="icon-chevron-right"></i>新建数据</a></li> <li id="Nav-author-newdata"><a href="/author/newdata"><i class="icon-chevron-right"></i>新建数据</a></li>
<li id="Nav-author-apply"><a href="/author/apply"><i class="icon-chevron-right"></i>数据认证</a></li> <li id="Nav-author-apply"><a href="/author/apply"><i class="icon-chevron-right"></i>数据认证</a></li>
<li id="Nav-author-accept"><a href="/author/accept"><i class="icon-chevron-right"></i>我的数据</a></li> <li id="Nav-author-accept"><a href="/author/accept"><i class="icon-chevron-right"></i>我的数据</a></li>
<li id="Nav-author-inauthor"><a href="/author/inauthor"><i class="icon-chevron-right"></i>数据申请管理</a></li> <li id="Nav-author-inauthor"><a href="/author/inauthor"><i class="icon-chevron-right"></i>数据申请管理</a></li>
<li id="Nav-author-comment"><a href="/author/comment"><i class="icon-chevron-right"></i>数据反馈管理</a></li> <li id="Nav-author-comment"><a href="/author/comment"><i class="icon-chevron-right"></i>数据反馈管理</a></li>
<li id="Nav-author-literature"><a href="/author/literature"><i class="icon-chevron-right"></i>数据文献管理</a></li> <li id="Nav-author-literature"><a href="/author/literature"><i class="icon-chevron-right"></i>数据文献管理</a></li>
<li id="Nav-author-document"><a href="/author/document"><i class="icon-chevron-right"></i>数据文档管理</a></li> <li id="Nav-author-document"><a href="/author/document"><i class="icon-chevron-right"></i>数据文档管理</a></li>
<li id="Nav-author-news"><a href="/author/news"><i class="icon-chevron-right"></i>数据新闻管理</a></li> <li id="Nav-author-news"><a href="/author/news"><i class="icon-chevron-right"></i>数据新闻管理</a></li>
<li id="Nav-author-version"><a href="/author/version"><i class="icon-chevron-right"></i>数据版本管理</a></li> <li id="Nav-author-version"><a href="/author/version"><i class="icon-chevron-right"></i>数据版本管理</a></li>
<!-- <li id="Nav-author-version"><a href="/author/fund"><i class="icon-chevron-right"></i>支持项目</a></li>
<li><a href="/author/survey">数据调查</a></li> <!--
<li><a href="/author/qa">数据QA</a></li> --> <li><a href="/author/survey">数据调查</a></li>
<li id="Nav-author-statics"><a href="/author/statics"><i class="icon-chevron-right"></i>信息统计</a></li> <li><a href="/author/qa">数据QA</a></li> -->
</ul> <li id="Nav-author-statics"><a href="/author/statics"><i class="icon-chevron-right"></i>信息统计</a></li>
</ul>
</div> </div>

View File

@ -1,99 +1,94 @@
<?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->headScript()->appendFile('/js/jquery-1.7.min.js'); $this->headLink()->appendStylesheet('/css/author.css');
$this->headLink()->appendStylesheet('/css/author.css'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('<a href="/author">数据作者</a>'); $this->breadcrumb('查看数据申请记录');
$this->breadcrumb('查看数据申请记录'); $this->breadcrumb()->setSeparator(' > ');
$this->breadcrumb()->setSeparator(' > '); ?>
?> <div class="row">
<!-- 左侧导航 --> <div class="span3">
<div id='sidebar'> <?= $this->partial('author/navi.phtml'); ?>
<div id='leftnavi'> </div>
<?= $this->partial('author/navi.phtml'); ?> <div class="span9">
</div> <?php
</div> if(!empty($this->error))
<!-- //左侧导航 --> {
echo $this->error;
<!-- 页面内容 --> }
<div id="wapper">
<?php
if(!empty($this->error))
{
echo $this->error;
}
?> ?>
<div id="tabs-controller"> <div>
<ul> <ul class="nav nav-pills">
<li class="box-shadow"><a class="text-shadow" href="/author/inauthor/ac/online">在线下载记录</a></li> <li><a href="/author/inauthor/ac/online">在线下载记录</a></li>
<li class="box-shadow"><a class="text-shadow" href="/author/inauthor/ac/offline">离线申请记录</a></li> <li><a href="/author/inauthor/ac/offline">离线申请记录</a></li>
<li class="box-shadow active"><a class="text-shadow" href="/author/inauthor/ac/datalist">按数据查看</a></li> <li class="active"><a href="/author/inauthor/ac/datalist">按数据查看</a></li>
</ul> </ul>
</div> </div>
<div id="datalist"> <div>
<?php <?php
if (count($this->paginator)): if (count($this->paginator)):
echo "<h2>申请记录:".$this->mdtitle."</h2>"; echo "<h2>申请记录:".$this->mdtitle."</h2>";
echo "<ul>"; echo '<ul class="unstyled">';
$autoindex=0; $autoindex=0;
foreach ($this->paginator as $item): foreach ($this->paginator as $item):
$autoindex++; $autoindex++;
if(!empty($item['offa_id'])) : if(!empty($item['offa_id'])) :
?> ?>
<li> <li class="well well-small">
<p>【离线申请】<?php echo $item['offa_name'];?> (<?php echo $item['offa_email'];?>)</p> <p>【离线申请】<?php echo $item['offa_name'];?> (<?php echo $item['offa_email'];?>)</p>
<p>申请时间:<?php echo $item['offa_tscreated'];?></p> <p>申请时间:<?php echo $item['offa_tscreated'];?></p>
<p>单位:<?php echo $item['offa_unit'];?></p> <p>单位:<?php echo $item['offa_unit'];?></p>
<p>项目:<?php echo $item['offa_project'];?></p> <p>项目:<?php echo $item['offa_project'];?></p>
<p><span id="ct_<?php echo $item['doid'];?>"> <p><span id="ct_<?php echo $item['doid'];?>">
<?php if($item['status']==4): echo $item['btns']; endif;?> </span><span id="data_<?php echo $item['doid'];?>"></span></p> <?php if($item['status']==4): echo $item['btns']; endif;?> </span><span id="data_<?php echo $item['doid'];?>"></span></p>
</li> </li>
<?php <?php
endif; endif;
if(!empty($item['ona_id'])): if(!empty($item['ona_id'])):
?> ?>
<li> <li class="well well-small">
<p>【在线下载记录】<?php echo $item['ona_name'];?> (<?php echo $item['ona_email'];?>)</p> <p>【在线下载记录】<?php echo $item['ona_name'];?> (<?php echo $item['ona_email'];?>)</p>
<p>申请时间:<?php echo $item['ona_tscreated'];?></p> <p>申请时间:<?php echo $item['ona_tscreated'];?></p>
<p>单位:<?php echo $item['ona_unit'];?></p> <p>单位:<?php echo $item['ona_unit'];?></p>
<p>项目:<?php echo $item['ona_project'];?></p> <p>项目:<?php echo $item['ona_project'];?></p>
</li> </li>
<?php <?php
endif; endif;
endforeach; endforeach;
echo "</ul>"; echo "</ul>";
endif; ?> endif; ?>
</div> </div>
<div class="pagenavi"><?= $this->paginator; ?></div> <div class="pagenavi"><?= $this->paginator; ?></div>
</div> </div>
<!-- //页面内容 --> </div>
<script> <!-- //页面内容 -->
$('#wapper').width($('body').width()-300); <script>
function confirm(uuid,oid){ $('#wapper').width($('body').width()-300);
doPD(uuid,"confirm",oid); function confirm(uuid,oid){
} doPD(uuid,"confirm",oid);
function objection(uuid,oid){ }
doPD(uuid,"objection",oid); function objection(uuid,oid){
} doPD(uuid,"objection",oid);
function doPD(uuid,pr,oid){ }
$.ajax({ function doPD(uuid,pr,oid){
'type':"POST", $.ajax({
'url':'/author/inauthor/ac/offline', 'type':"POST",
'data':'pr='+ pr +'&uuid='+uuid+'&oid='+oid, 'url':'/author/inauthor/ac/offline',
'success':function(html){ 'data':'pr='+ pr +'&uuid='+uuid+'&oid='+oid,
$('#ct_'+oid).html(html);$('#data_'+oid).html(''); 'success':function(html){
}, $('#ct_'+oid).html(html);$('#data_'+oid).html('');
'beforeSend':function(){ },
$('#data_'+oid).html('<img src="/images/ajax-load-small.gif" />正在处理...'); 'beforeSend':function(){
}, $('#data_'+oid).html('<img src="/images/ajax-load-small.gif" />正在处理...');
'timeout': 20000, },
'error': function(){ 'timeout': 20000,
alert('处理中出现问题,请重试'); 'error': function(){
$('#data_'+oid).html(''); alert('处理中出现问题,请重试');
} $('#data_'+oid).html('');
}); }
} });
}
</script> </script>

View File

@ -15,29 +15,51 @@ class Fund extends Zend_Controller_Plugin_Abstract
$this->auth = $auth; $this->auth = $auth;
} }
function fetch($uuid = "",$include = true){ function fetch($uuid = "",$include = true,$uid=0){
if(empty($uuid)) if(empty($uuid))
{ {
$sql = "SELECT * FROM ".$this->tbl_fund." ORDER BY id DESC"; if(empty($uid))
{
$sql = "SELECT * FROM ".$this->tbl_fund." ORDER BY id DESC";
}else{
$sql = "SELECT * FROM ".$this->tbl_fund." WHERE userid=$uid ORDER BY id DESC";
}
$rs = $this->db->query($sql); $rs = $this->db->query($sql);
$rows = $rs->fetchAll(); $rows = $rs->fetchAll();
return $rows; return $rows;
}else{ }else{
$wheresql = array();
if($include) if($include)
{ {
$sql = "SELECT f.*,mf.place,mf.id as mfid FROM ".$this->tbl_fund." f $wheresql[] = " mf.uuid='$uuid' ";
LEFT JOIN ".$this->tbl_mdfund." mf ON mf.fid=f.id
WHERE uuid='$uuid'
ORDER BY mf.place DESC";
}else{ }else{
$fids = $this->getMdFunds($uuid); $fids = $this->getMdFunds($uuid);
if(count($fids)>0) if(count($fids)>0)
{ {
$fids = ' WHERE f.id NOT IN ('.join(",",$fids).')'; $wheresql[] = ' f.id NOT IN ('.join(",",$fids).')';
}else{
$fids = "";
} }
$sql = "SELECT f.* FROM ".$this->tbl_fund." f $fids ORDER BY f.id DESC"; }
if(!empty($uid) && is_int($uid))
{
$wheresql[] = " f.userid='$uid' ";
}
if(count($wheresql)>0)
{
$wheresql = " WHERE ".join(" AND ",$wheresql);
}else{
$wheresql = "";
}
if($include)
{
$sql = "SELECT f.*,mf.place,mf.id as mfid FROM ".$this->tbl_fund." f
LEFT JOIN ".$this->tbl_mdfund." mf ON mf.fid=f.id
$wheresql
ORDER BY mf.place DESC";
}else{
$sql = "SELECT f.* FROM ".$this->tbl_fund." f $wheresql ORDER BY f.id DESC";
} }
$rs = $this->db->query($sql); $rs = $this->db->query($sql);
$rows = $rs->fetchAll(); $rows = $rs->fetchAll();
@ -52,17 +74,35 @@ class Fund extends Zend_Controller_Plugin_Abstract
return $dbh->insert($this->tbl_fund,$data); return $dbh->insert($this->tbl_fund,$data);
} }
function update($data,$id) function update($data,$id,$uid=0)
{ {
include_once("helper/dbh.php"); if(!is_numeric($id))
$dbh = new dbh($this->db);
if(empty($id))
{ {
return "参数错误"; return "参数错误";
} }
$state = $dbh->update($this->tbl_fund,$data,"id=$id",true); if(!empty($uid))
{
if(!is_numeric($uid))
{
return "参数错误";
}
$sql = "SELECT * FROM ".$this->tbl_fund." WHERE userid=$uid AND id=$id";
$rs = $this->db->query($sql);
$row = $rs->fetch();
if(empty($row['id']))
{
return "您无权修改这条记录";
}
$condition = " id=$id AND userid=$uid ";
}else{
$condition = " id=$id ";
}
include_once("helper/dbh.php");
$dbh = new dbh($this->db);
$state = $dbh->update($this->tbl_fund,$data,$condition,true);
if( $state == true) if( $state == true)
{ {
@ -72,8 +112,29 @@ class Fund extends Zend_Controller_Plugin_Abstract
} }
} }
function delete($id){ function delete($id,$uid=0){
$sql = "DELETE FROM ".$this->tbl_fund." WHERE id=$id"; if(!is_numeric($id))
{
return "参数错误";
}
if(!empty($uid))
{
if(!is_numeric($uid))
{
return "参数错误";
}
$sql = "SELECT * FROM ".$this->tbl_fund." WHERE userid=$uid AND id=$id";
$rs = $this->db->query($sql);
$row = $rs->fetch();
if(empty($row['id']))
{
return "您无权修改这条记录";
}
$condition = " id=$id AND userid=$uid ";
}else{
$condition = " id=$id ";
}
$sql = "DELETE FROM ".$this->tbl_fund." WHERE $condition";
return $this->db->exec($sql); return $this->db->exec($sql);
} }