fix the bug in author contorller

This commit is contained in:
Li Jianxuan 2013-04-24 10:35:53 +00:00
parent d2e3a4ad33
commit bb4eacce87
3 changed files with 116 additions and 118 deletions

View File

@ -1595,14 +1595,11 @@ class AuthorController extends Zend_Controller_Action
$sth = $this->db->prepare($sql);
$sth->execute(array($uuid));
$rows = $sth->fetchAll();
$rows = $sth->fetchAll(PDO::FETCH_BOTH);
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(10);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
include_once("helper/view.php");
view::addPaginator($rows,$this->view,$this->_request);
$this->view->datas = $rows;
}else{
$this->view->error = "参数有误";
}
@ -2041,9 +2038,9 @@ class AuthorController extends Zend_Controller_Action
return true;
}
else if ($row['status']==2 || $row['status']==3 || $row['status']==4)//已发送过外审邮件,需由编辑告知变化信息
{
//同步元数据
$iso=new ISO19115();
{
//同步元数据
$iso=new ISO19115();
@$iso->loadXML($row['xml']);
//email to admin
$mail=new WestdcMailer($this->view->config->smtp);
@ -2089,11 +2086,11 @@ class AuthorController extends Zend_Controller_Action
}
@$mail->send();
//email to experts
$sql="select u.username,u.email from mdexpertreview e left join users u on e.id=u.id where e.status in (0,1) and e.uuid=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($row['uuid']));
$experts = $sth->fetchAll();
//email to experts
$sql="select u.username,u.email from mdexpertreview e left join users u on e.id=u.id where e.status in (0,1) and e.uuid=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($row['uuid']));
$experts = $sth->fetchAll();
unset($mail);
unset($mailtp);
@ -2108,10 +2105,10 @@ class AuthorController extends Zend_Controller_Action
));
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.doc');
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf');
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.doc');
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/service/pdf/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.pdf');
if($this->debug==0)
{
foreach ($experts as $expert) $mail->addTo($expert['email']);
@ -2240,7 +2237,7 @@ class AuthorController extends Zend_Controller_Action
if (!empty($id) && empty($ac))
{
$this->view->url='metadata.show?id='.$id;
$this->_helper->viewRenderer('newdata-view');
$this->_helper->viewRenderer('newdata-view');
}
//查看属于自己的所有的未提交数据列表
else if((empty($ac) && empty($uuid))|| $ac=='list')

View File

@ -1,58 +1,60 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/author.css');
$this->theme->AppendPlus($this,'colorbox');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('新建数据');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="span3">
<?= $this->partial('author/navi.phtml'); ?>
</div>
<div class="span9">
<div>
<ul class="nav nav-pills">
<li class=""><a href="/author/newdata">未提交数据列表</a></li>
<li class=""><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
<li class=""><a href="/author/newdata/ac/add-by-template">根据模板新建元数据</a></li>
<li class="active"><a href="/author/newdata/ac/add-by-data">根据已有数据新建元数据</a></li>
</ul>
</div>
<div>
<h2>根据已有数据创建元数据</h2>
<form id="datasearch" class="search_form" action="/author/newdata/ac/add-by-data">
<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>
<?php
if (count($this->paginator)):
echo '<ul class="unstyled">';
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;
?>
<li class="well">
<h4><?php echo $item['title'];?></h4>
<p><a href="/service/geonetwork?url=metadata.create?group=2<?php echo urlencode('&id='.$item['gid']); ?>" target="_blank">以此为模板新建</a>
| <a href="/data/<?php echo $item['uuid'];?>" target="_blank">查看数据</a></p>
<p><?php echo mb_strlen($item['description'])>400?$this->escape(mb_substr($item['description'],0,400,'UTF-8').'...'):$this->escape($item['description']); ?></p>
</li>
<?php
endforeach;
echo "</ul>";
endif; ?>
</div>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>
<script>
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$('#wapper').width($('body').width()-300);
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/author.css');
$this->theme->AppendPlus($this,'colorbox');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('新建数据');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="span3">
<?= $this->partial('author/navi.phtml'); ?>
</div>
<div class="span9">
<div>
<ul class="nav nav-pills">
<li class=""><a href="/author/newdata">未提交数据列表</a></li>
<li class=""><a class="iframe" href="/service/geonetwork?url=metadata.xmlinsert.form">导入元数据</a></li>
<li class=""><a href="/author/newdata/ac/add-by-template">根据模板新建元数据</a></li>
<li class="active"><a href="/author/newdata/ac/add-by-data">根据已有数据新建元数据</a></li>
</ul>
</div>
<div>
<h2>根据已有数据创建元数据</h2>
<div class="input-append">
<form id="datasearch" class="search_form" action="/author/newdata/ac/add-by-data">
<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>
<?php
if (count($this->paginator)):
echo '<ul class="unstyled">';
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;
?>
<li class="well">
<h4><?php echo $item['title'];?></h4>
<p><a href="/service/geonetwork?url=metadata.create?group=2<?php echo urlencode('&id='.$item['gid']); ?>" target="_blank">以此为模板新建</a>
| <a href="/data/<?php echo $item['uuid'];?>" target="_blank">查看数据</a></p>
<p><?php echo mb_strlen($item['description'])>400?$this->escape(mb_substr($item['description'],0,400,'UTF-8').'...'):$this->escape($item['description']); ?></p>
</li>
<?php
endforeach;
echo "</ul>";
endif; ?>
</div>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>
<script>
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$('#wapper').width($('body').width()-300);
</script>

View File

@ -1,42 +1,41 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('查看数据作者');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="span3">
<?= $this->partial('author/navi.phtml'); ?>
</div>
<div class="span9">
<?php
if(!empty($this->error))
{
echo $this->error;
}
?>
<h3><a href="/data/<?php echo $this->paginator[0]['uuid']; ?>"><?php echo $this->paginator[0]['title']; ?></a> </h3>
<div class="well">
<?php
if (count($this->paginator)):
echo "<ul>";
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<li>
<p><?php echo $item['realname'];?> (<?php echo $item['email'];?>)</p>
<p>单位:<?php echo $item['unit'];?></p>
</li>
<?php endforeach;
echo "</ul>";
endif; ?>
</div>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/author.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/author">数据作者</a>');
$this->breadcrumb('查看数据作者');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="span3">
<?= $this->partial('author/navi.phtml'); ?>
</div>
<div class="span9">
<?php
if(!empty($this->error))
{
echo $this->error;
}
?>
<h3><a href="/data/<?php echo $this->datas[0]['uuid']; ?>"><?php echo $this->datas[0]['title']; ?></a> </h3>
<div class="well">
<?php
if (count($this->paginator)):
echo "<ul>";
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;?>
<li>
<p><?php echo $item['realname'];?> (<?php echo $item['email'];?>)</p>
<p>单位:<?php echo $item['unit'];?></p>
</li>
<?php endforeach;
echo "</ul>";
endif; ?>
</div>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div>