From ae5c70c4a68d029a1e1b6eae57f4e9107b1ba235 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 28 Oct 2011 10:00:13 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=A0=B7=E5=BC=8F=EF=BC=8C=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=A0=B7=E5=BC=8F=E3=80=81=E5=88=97=E8=A1=A8=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E3=80=81=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E5=AE=B9=E5=99=A8tbox=E3=80=82=E5=A2=9E=E5=8A=A0=E4=BA=86ajax?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=8D=89=E7=A8=BF=E7=9A=84=E5=8A=A8=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/ReviewController.php | 56 ++++++++++------ .../default/views/scripts/review/review.phtml | 65 +++++++++++++++---- 2 files changed, 90 insertions(+), 31 deletions(-) diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php index 67557b69..16f9887b 100644 --- a/application/default/controllers/ReviewController.php +++ b/application/default/controllers/ReviewController.php @@ -1,6 +1,6 @@ db->quoteInto("select m.id,m.uuid,m.title,m.description,m.title_en,r.status from metadata m left join mdstatus r on r.uuid=m.uuid where m.uuid=?",$uuid); - $this->view->metadata = $md = $this->db->fetchRow($sql); + $md = $this->db->fetchRow($sql); + + $this->view->metadata = $md; $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) { @@ -311,32 +313,46 @@ class ReviewController extends Zend_Controller_Action '; } + if(empty($list)) + { + $list="

暂无评审数据

"; + } + $stringbuffer = ""; echo $stringbuffer.'
'.$paginator.'
'; - }//allreviewAction() + }//allreviewAction() 所有评论 ajax - function searchAction() - { - $key=$this->_request->getParam('q'); - if (!empty($key)) { - $search=new Search($key); - $where=$search->sql_expr(array("m.title","m.description")); - $page=@(int)$this->_request->getParam('page'); - if (empty($page)) $page=1; - $offset=$this->limit*($page-1); - $row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status>0 and ".$where); - $sum=$row[0]['count']; - $sql="select m.uuid,m.title,m.id,m.description,s.status,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status>0 and ".$where." order by s.ts_created desc,m.title limit ? offset ?"; - $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); - $this->view->page=new Pagination($sum,$page,$this->limit); - $this->view->key=$key; + function saveAction(){ + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + echo "保存成功!"; + + }// saveAction 存草稿 ajax + + function searchAction() + { + $key=$this->_request->getParam('q'); + if (!empty($key)) { + $search=new Search($key); + $where=$search->sql_expr(array("m.title","m.description")); + $page=@(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $row=$this->db->fetchAll("select count(s.*) from mdstatus s left join normalmetadata m on s.uuid=m.uuid where s.status>0 and ".$where); + $sum=$row[0]['count']; + $sql="select m.uuid,m.title,m.id,m.description,s.status,g.id as gid,t.filename from mdstatus s left join normalmetadata m on s.uuid=m.uuid left join geonetworkmetadata g on g.uuid=m.uuid left join thumbnail t on t.id=m.id where s.status>0 and ".$where." order by s.ts_created desc,m.title limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); + $this->view->key=$key; foreach($this->view->metadata as $k=>$v) { $this->view->metadata[$k]['statustext']=$this->rewritestatus($v['status']); - } - } + } + } } } diff --git a/application/default/views/scripts/review/review.phtml b/application/default/views/scripts/review/review.phtml index 0d248692..4de65942 100755 --- a/application/default/views/scripts/review/review.phtml +++ b/application/default/views/scripts/review/review.phtml @@ -5,6 +5,7 @@ $this->headTitle()->setSeparator(' - '); $this->headLink()->appendStylesheet('/css/mdreview.css'); $this->headScript()->appendFile('/js/jquery-1.6.4.min.js'); + $this->headScript()->appendFile('/js/pubfunc.js'); $this->breadcrumb('首页'); $this->breadcrumb(''.$this->config->title->review.''); $this->breadcrumb('评审元数据'); @@ -29,7 +30,16 @@
-

数据评审意见

+
+
所有评审意见
+
+
+
+
+ +
+
发布评审意见
+
hasIdentity()) { @@ -40,8 +50,6 @@ echo "该数据已经通过评审"; }else{ ?> -我要发布评审意见 - - +
+
+ @@ -99,7 +111,8 @@
-
+ + @@ -109,6 +122,36 @@ loadmdcomment(1); function loadmdcomment(page){var url="/review/allreview/uuid//";if(page!=''){url+='page/'+page;} $.ajax({type:"POST",url:url,data:'',success:function(html){$('#allcomments').html(html);},beforeSend:function(){$('#allcomments').html('正在加载...');}});} +$('.slideabletbox .title').click( + function(){ + $(this).next(".content").slideToggle(1000,function(){ + if($(this).css('display')=='none') + $(this).prev('.title').find(".slidebtn").html(''); + else + $(this).prev('.title').find(".slidebtn").html(''); + ;}) + }); +$('#save').click(function(){ + savereview(); +}); + +function savereview(){ + var url="/review/save/uuid//"; + var date = $('#postcomment').serialize(); + $.ajax({ + type:"POST", + url:url, + data:date, + success:function(html){ + $('#save').html(html); + setTimeout("$('#save').html('存草稿');$('#save').removeAttr('disabled');",2000) + }, + beforeSend:function(){ + $('#save').attr('disabled','disabled'); + $('#save').html('正在保存...'); + } + }); +}