diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 9d2655a3..ed9cf60e 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -1,4 +1,10 @@ _getParam('add'); $edit=(int)$this->_getParam('edit'); - $delete=(int)$this->_getParam('delete'); + $delete=(int)$this->_getParam('delete'); set_time_limit(0); if ($add) { $form=new DatasetcdForm(); @@ -1098,13 +1104,13 @@ class Admin_DataController extends Zend_Controller_Action } //搜索 else{ - $select=$this->db->select(); - $select->from('mdref',array('id as mdid','refid','place')) - ->join('metadata','metadata.uuid=mdref.uuid') - ->join('reference','reference.id=mdref.refid') - ->order('metadata.ts_created desc') - ->order('mdref.place'); - $paginator = Zend_Paginator::factory($select); + $sql="select m.title as mdtitle,m.uuid,mr.id as mdid,mr.refid,mr.place,r.reference + from mdref mr right join metadata m on mr.uuid=m.uuid + left join reference r on mr.refid=r.id + order by m.ts_created desc,mr.place"; + $re=$this->db->query($sql); + $row=$re->fetchAll(); + $paginator = Zend_Paginator::factory($row); $paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setItemCountPerPage(30); $paginator->setView($this->view); @@ -1113,6 +1119,269 @@ class Admin_DataController extends Zend_Controller_Action }//列表 } + + //文献管理 + public function refAction() + { + $this->view->ac = $ac = $this->_getParam('ac'); + $submit = $this->_getParam('submit'); + $keyword = $this->view->q = trim($this->_getParam('q')); + $order = $this->view->search_order = trim($this->_getParam('order')); + $sort = $this->view->search_sort = trim($this->_getParam('sort')); + + $reference = new Reference(); + + if(!empty($keyword)) + { + $reference->keyword = $keyword; + } + + if(!empty($order)) + { + $reference->order = $order; + } + + if(!empty($sort)) + { + $reference->sort = $sort; + } + + //文献首页 + if(empty($ac)) + { + $this->view->referenceType = $reference->referenceType(); + view::addPaginator($reference->fetchReferences(),$this,12); + return true; + } + else if ($ac == "water") + { + $this->view->referenceType = $reference->referenceType(); + view::addPaginator($reference->fetchThemeReferences('water'),$this,10); + return true; + } + else if ($ac == "westdc") + { + $this->view->referenceType = $reference->referenceType(); + view::addPaginator($reference->fetchWestdcReferences(),$this,10); + return true; + } + else if ($ac == "todo") + { + $this->view->referenceType = $reference->referenceType(); + view::addPaginator($reference->fetchTodoReferences(),$this,10); + return true; + } + + //添加 + if($ac == "add") + { + $this->_helper->viewRenderer('ref-add'); + $id = $this->_getParam('id'); + $attid = $this->_getParam('attid'); + + if(!empty($submit)) + { + $this->view->data = $reference->getReferenceParam(); + $attid = $this->view->data['attid']; + + if(empty($id) || !is_numeric($id)) + { + $status = $reference->reference(); + }else{ + $status = $reference->reference($id); + } + + if($status !== true) + { + $this->view->error = view::Error($status); + }else{ + if(!empty($id)) + { + $msg = "文献修改成功!"; + view::Post($this,$msg,-2); + return true; + }else{ + $msg = "文献添加成功!"; + view::Post($this,$msg,"/admin/data/ref/ac/add"); + return true; + } + } + }else{ + $this->view->data = array(); + if(!empty($id) && is_numeric($id)) + { + $this->view->data = $reference->getOneReferenceData($id); + } + } + + if(!empty($attid)) + { + $files = new Files(); + $attfile = $files->getOne($attid); + $this->view->data['attid'] = $attid; + $this->view->data['file'] = $attfile; + } + + return true; + } + + //上传pdf + if($ac == "pdfupload") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + $autoread = false; + if($this->_getParam('multi')) + { + $autoread = true; + } + $statu = $reference->uploadReferencePdf($_FILES['Filedata'],$autoread); + $this->jsonexit($statu); + return true; + } + + //删除已上传的文件 + if($ac == "delete") + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + $statu = $reference->deleteReferenceAttchment($this->_getParam('attid')); + $this->jsonexit($statu); + return true; + } + + //批量上传 + if($ac == "multiupload") + { + $this->_helper->viewRenderer('ref-multiupload'); + return true; + } + + //文件管理 + if($ac == "files") + { + $this->_helper->viewRenderer('ref-files'); + view::addPaginator($reference->getReferenceFiles(),$this,10); + return true; + } + + //删除文献 + if($ac == "deleteref") + { + $refid = $this->_getParam('id'); + if($reference->deleteReference($refid)) + { + view::Post($this,"删除成功!",-1); + }else{ + view::Post($this,"删除失败!",-1); + } + return true; + } + + //相关数据 + if($ac == "data") + { + $refid = $this->view->refid = $this->_getParam('id'); + if(view::isXmlHttpRequest($this)){ + $this->jsonexit($reference->getDataByReference($refid)); + return true; + }else{ + $this->_helper->viewRenderer('ref-metadatas'); + $this->view->referenceType = $reference->referenceType(); + view::addPaginator($reference->getDataByReference($refid),$this,10); + return true; + } + } + + //添加数据文献 + if($ac == "mdref" && view::isXmlHttpRequest($this)) + { + $mdrefid = $this->_getParam('id'); + $status = $reference->makeMdref($mdrefid); + if($status !== true) + { + $this->jsonexit(array('error'=>$status)); + }else{ + $this->jsonexit(array('success' => 1)); + } + return true; + } + + //移除数据文献 + if($ac == "delmdref") + { + $mdrefid = $this->_getParam('id'); + $status = $reference->delMdref($mdrefid); + if($status === true) + { + view::Post($this,"移除成功",-1); + }else{ + view::Post($this,$status,-1); + } + return true; + } + + //ris + if($ac == "ris") + { + $this->_helper->viewRenderer('ref-ris'); + $submit = $this->_getParam('submit'); + + if(!empty($submit)) + { + $ris = new \Reference\Ris(); + $this->view->data = $ris->loadout(); + try{ + $ris->pushToDataTable($this->view->data); + }catch(Exception $e) + { + view::Dump($e->getMessage(),false); + } + } + } + + //ris更新单篇 + if($ac == "singleris") + { + $this->_helper->viewRenderer('ref-singleris'); + $id = (int)$this->_getParam('id'); + $this->view->ristext = $this->_getParam('ristext'); + + if($id < 1) + { + view::Post($this,"参数错误!",-1); + return true; + } + + $this->view->referenceData = $reference->getOneReferenceData($id); + + if(!empty($submit)) + { + $ris = new Ris(); + $data = $ris->loadout(); + + if(count($data) < 1) + { + view::Post($this,"输入的RIS信息有误".'查看详细',-1); + return true; + } + + if($ris->updateWithRis($id,$data[0]) === true) + { + view::Post($this,"编辑成功!".'查看详细',-2); + return true; + }else{ + view::Post($this,"编辑失败!".'查看详细',-1); + return true; + } + } + + return true; + }//ris单篇更新 + + + }//文献管理 refAction() + /* * 删除元数据,删除前有确认 */ @@ -1573,8 +1842,8 @@ class Admin_DataController extends Zend_Controller_Action $id = $this->_getParam('attupdate'); - $files=new files(); - $msg = $files -> upload($this->view->config->upload,$_FILES['Filedata'],empty($uuid)?'file':'md'); + $files=new Files(); + $msg = $files -> upload($_FILES['Filedata'],empty($uuid)?'file/':'md/',true); if(empty($msg['error'])) { @@ -1582,7 +1851,7 @@ class Admin_DataController extends Zend_Controller_Action $filename = $msg['db_path']; $filesize = $msg['file_size']; $filedesc = $this->_request->getParam('filedesc'); - $filetype = $msg['file_type']; + $filetype = 'md'; $realname = $msg['realname']; @@ -1901,8 +2170,8 @@ class Admin_DataController extends Zend_Controller_Action exit(); } - $files=new files(); - $msg = $files -> upload($this->view->config->upload,$_FILES['Filedata'],empty($uuid)?'file':'md'); + $files=new Files(); + $msg = $files -> upload($_FILES['Filedata'],empty($uuid)?'file/':'md/',true); if(empty($msg['error'])) { @@ -1910,7 +2179,7 @@ class Admin_DataController extends Zend_Controller_Action $filename = $msg['db_path']; $filesize = $msg['file_size']; $filedesc = $this->_request->getParam('filedesc'); - $filetype = $msg['file_type']; + $filetype = 'md'; $realname = $msg['realname']; @@ -1969,10 +2238,6 @@ class Admin_DataController extends Zend_Controller_Action $rs = $this->db->query($sql); $atts = $rs->fetchAll(); - foreach($atts as $k=>$v) - { - $atts[$k]['html']= $v['realname'].'['. round($v['filesize']/1024,2) .' kb]
'; - } echo Zend_Json::encode($atts); exit(); }else @@ -2489,7 +2754,7 @@ class Admin_DataController extends Zend_Controller_Action }else{ $mail->addTo($this->debug_email); } - @$mail->send(); + //@$mail->send(); $data = array("commited"=>1,"error"=>'该版本已经成功发布!'); $this->jsonexit($data); @@ -3410,13 +3675,13 @@ class Admin_DataController extends Zend_Controller_Action if(empty($uuid)) { $rows = $fund->fetch(NULL,true,0,$keyword); - view::addPaginator($rows,$this->view,$this->_request); + view::addPaginator($rows,$this,10); }else{ include('data/Metadata.php'); $md = new Metadata($this->db); $this->view->md = $md->view($uuid); $rows = $fund->fetch($uuid); - view::addPaginator($rows,$this->view,$this->_request); + view::addPaginator($rows,$this,10); } return true; } @@ -3426,7 +3691,7 @@ class Admin_DataController extends Zend_Controller_Action $this->_helper->viewRenderer('fund-data-list'); $this->view->q = $q = $this->_getParam('q'); $rows = $fund->fetchFromData(true,0,$q); - view::addPaginator($rows,$this->view,$this->_request); + view::addPaginator($rows,$this,10); return true; } @@ -3437,7 +3702,7 @@ class Admin_DataController extends Zend_Controller_Action $id = $this->_getParam('id'); $this->view->fund = $fund->view($id); $rows = $fund->fetchFromData($id,0,$q); - view::addPaginator($rows,$this->view,$this->_request); + view::addPaginator($rows,$this,10); return true; } @@ -3569,7 +3834,7 @@ class Admin_DataController extends Zend_Controller_Action $md = new Metadata($this->db); $this->view->md = $md->view($uuid); - view::addPaginator($rows,$this->view,$this->_request); + view::addPaginator($rows,$this,10); return true; }//formd @@ -3617,7 +3882,7 @@ class Admin_DataController extends Zend_Controller_Action } $rows = $fund->getData($id,$keyword); - view::addPaginator($rows,$this->view,$this->_request); + view::addPaginator($rows,$this,10); } }//fund @@ -3627,6 +3892,7 @@ class Admin_DataController extends Zend_Controller_Action $ac = $this->_getParam('ac'); $submit = $this->_getParam('submit'); $uuid = $this->_getParam('uuid'); + $q=$this->_getParam('q'); include_once("data/Doi.php"); $doi = new Doi($this->db); @@ -3636,8 +3902,8 @@ class Admin_DataController extends Zend_Controller_Action { if(empty($uuid)) { - $rows = $doi->fetch(); - view::addPaginator($rows,$this->view,$this->_request); + $rows = $doi->fetch(0,$q); + view::addPaginator($rows,$this,10); }else{ $this->_redirect('/admin/data/doi/ac/edit/?uuid='.$uuid); return true; @@ -3666,11 +3932,11 @@ class Admin_DataController extends Zend_Controller_Action { $this->view->uuid = $uuid; $this->view->data = $doi->view($uuid); + include('data/Metadata.php'); + $md = new Metadata($this->db); + $metadata = $md->view($uuid); if(empty($this->view->data)) { - include('data/Metadata.php'); - $md = new Metadata($this->db); - $metadata = $md->view($uuid); $this->view->data = array( 'uuid'=>$uuid, 'title'=>$metadata['title'], @@ -3681,6 +3947,7 @@ class Admin_DataController extends Zend_Controller_Action 'publisher_en'=>'Cold and Arid Regions Science Data Center at Lanzhou', ); }else{ + $this->view->data['doi'] = $metadata['doi']; $this->view->data['info'] = $doi->data_process_out($this->view->data); } }else{ diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index b603c68d..b28592ff 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -1,4 +1,12 @@ messenger=$this->_helper->getHelper('FlashMessenger'); $this->view->messages = $this->messenger->getMessages(); $this->_helper->layout->setLayout('administry'); + $this->view->Theme = new Theme(); } function postDispatch() { @@ -17,10 +26,151 @@ class Admin_DownController extends Zend_Controller_Action { //其他连接 } + + //新离线数据申请管理 + function offlineappsAction() + { + $this->view->navIn = $ac = $this->_getParam('ac'); + $this->view->offlineAppId = $offlineappid = $this->_getParam('offlineappid'); + $submit = $this->_getParam('submit'); + $search = $this->_getParam('search'); + + if(empty($ac)) + { + $this->view->navIn = $ac = "notreceived"; + } + + if($ac == "view") + { + if(empty($offlineappid)) + { + view::Post($this,"参数错误",-1); + return true; + } + + $offlineapp = new Offlineapp(); + + if(view::isXmlHttpRequest() !== true) + { + $this->_helper->viewRenderer('offlineapps-view'); + $this->view->data = $offlineapp->getOneAppInfo($offlineappid); + }else{ + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + $this->jsonexit($offlineapp->getOneAppInfo($offlineappid)); + } + return true; + } + + if($ac == "notreceived") + { + $this->_helper->viewRenderer('offlineapps-notreceived'); + $offlineapp = new Offlineapp(); + $data = $offlineapp->fetchNotReceived(); + view::addPaginator($data,$this,20); + return true; + }//未接收的 + + if($ac == "nopdf") + { + $this->_helper->viewRenderer('offlineapps-nopdf'); + $offlineapp = new Offlineapp(); + $data = $offlineapp->fetchNoPdf(); + view::addPaginator($data,$this,20); + return true; + }//没有上传申请表的 + + if($ac == "notpassed") + { + $this->_helper->viewRenderer('offlineapps-notpassed'); + $offlineapp = new Offlineapp(); + $data = $offlineapp->fetchNotApprove(); + view::addPaginator($data,$this,20); + return true; + } + + //接收 + if($ac == "receive") + { + $offlineapp = new Offlineapp(); + $statue = $offlineapp->receive($offlineappid); + if($statue !== true) + { + view::Post($this,$statue); + }else{ + view::Post($this,"接收成功",-1); + } + return true; + } + + //发送给作者 + if($ac == "toauthor") + { + $this->_helper->viewRenderer('offlineapps-toauthor'); + if(empty($submit)) + { + + }else{ + $offlineapp = new Offlineapp(); + } + return true; + } + + //拒绝 + if($ac == "deny") + { + $this->_helper->viewRenderer('offlineapps-deny'); + + if(empty($offlineappid)) + { + view::Post($this,"参数错误",-1); + return true; + } + + if(empty($submit)) + { + $offlineapp = new Offlineapp(); + $this->view->data = $offlineapp->getOneAppInfo($offlineappid); + $mail = new Mail(); + $data = array( + 'user' => $this->view->data[0]['username'], + 'datalist' => $this->view->data[0]['datalist'], + ); + $mail->loadTemplate("offline-deny",$data); + $this->view->mail_body = $mail->body; + $this->view->mail_subject = $mail->subject; + } + + return; + } + + //重置申请表 + if($ac == "resetappform") + { + if(empty($offlineappid)) + { + view::Post($this,"参数错误",-1); + return true; + } + + $offlineapp = new Offlineapp(); + $statue = $offlineapp->resetAppForm($offlineappid); + if($statue !== true) + { + view::Post($this,$statue); + }else{ + view::Post($this,"重置成功",-1); + } + + return true; + } + + } //离线数据申请管理 function offlineappAction() { + set_time_limit(0); include_once("Dataorder.php"); $DO = new Dataorder($this->db); @@ -32,8 +182,23 @@ class Admin_DownController extends Zend_Controller_Action $page =(int)$this->_getParam('page'); $reset =(int)$this->_getParam('reset'); $status =(int)$this->_getParam('status'); + $ac = $this->_getParam('ac'); $q = $this->_getParam('q'); + if($ac == "pending") + { + $keyword = ""; + if(!empty($q)) + { + $keyword = $q; + } + + $rows = $DO->fetchAllOfflineApp(3,$keyword); + + view::addPaginator($rows,$this,10); + return true; + } + if (!$page) $page=1; if ($view) { //查看此次申请的pdf @@ -64,9 +229,17 @@ class Admin_DownController extends Zend_Controller_Action $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); $mail->send(); - $sql="select pdflink from offlineapp where id=?"; - $row=$this->db->fetchRow($sql,array($start)); - $filecontent=file_get_contents($this->view->config->offline->savepath."/".$row['pdflink']); + //如果是wsn数据则生成数据 + $dataservice = new DataService(); + $offlineapp = new Offlineapp(); + if ($offlineapp->hasWsnData($start)) + { + @$dataservice->makeWsnData(array('uid'=>$row['userid'],'action'=>'prepare')); + } + + $sql="select applicationform as pdflink from offlineapp where id=?"; + $row=$this->db->fetchRow($sql,array($start)); + $filecontent=file_get_contents($row['pdflink']); //对每条数据的管理员用户发送相应的邮件通知,同一用户的邮件需要合并 //需要取出对应数据的标题、uuid,以及对应的作者的email(一条数据可能有多个作者,一次申请可能有多条数据对应同一个作者) @@ -229,8 +402,8 @@ class Admin_DownController extends Zend_Controller_Action $role['distributor']=array(); $role['publisher']=array(); $role['author']=array(); - $single=array(); - if ($rows) + $single=array(); + if ($rows) { foreach($rows as $row) { @@ -390,9 +563,14 @@ class Admin_DownController extends Zend_Controller_Action //$this->_redirect('/admin/down/offlineapp/'.$page); } + //如果是wsn数据则生成数据 + //wsn数据在ftp服务器端进行处理 + /*$dataservice = new DataService(); + @$dataservice->makeWsnData();*/ + $sql="update dataorder set status=5,ts_approved=now() where offlineappid=?"; $this->db->query($sql,array($finish)); - $sql="update offlineapp set ts_approved=now() where id=? and ts_approved is null"; + $sql="update offlineapp set ts_approved=now(),status=5 where id=? and ts_approved is null"; $this->db->query($sql,array($finish)); $sql="select * from offlineapp where id=?"; $row=$this->db->fetchRow($sql,array($finish)); @@ -409,6 +587,7 @@ class Admin_DownController extends Zend_Controller_Action // deal with ftp.westgis.ac.cn, use g6 to add path // todo ... } + //deal with ftp1&ftp2 account, for offline data if ($has_ftp1 || $has_ftp2) { $password=md5('westdc'.$row['userid'].rand(1000,9999)); @@ -612,6 +791,68 @@ class Admin_DownController extends Zend_Controller_Action $this->view->paginator=$paginator; } + + //上传申请表 + function uploadapplicationformAction() + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_getParam('orderid'); + + if(empty($id)) + { + $this->jsonexit(array('error'=>"参数错误")); + return true; + } + + $files = new Files(); + $FileListener = new FileListener(); + @$files->events()->attachAggregate($FileListener); + + $statu = $files->uploadApplicationForm($_FILES['Filedata'],$id); + + if(isset($statu['error'])) + { + $this->jsonexit($statu); + return true; + }else{ + $sql = "UPDATE offlineapp SET applicationform='{$statu['file']}' WHERE id=$id"; + if($this->db->exec($sql)) + { + $this->jsonexit(array("success"=>1)); + return true; + }else{ + $this->jsonexit(array('error'=>"数据库记录更新失败".$sql)); + return true; + } + } + } + + public function applicationformAction() + { + $ac = $this->_getParam('ac'); + if($ac == "view") + { + $link = $this->_getParam('link'); + $content=file_get_contents($link); + header("Content-Disposition: inline; filename=applicationform.pdf"); + header("Content-Type:application/pdf"); + echo $content; + exit(); + } + + if($ac == "download") + { + $link = $this->_getParam('link'); + $content=file_get_contents($link); + + $output = new Output(); + $output->pushDownload($content,"申请表.pdf",'pdf'); + exit(); + } + } + //离线数据服务记录 function offlineAction() { @@ -710,21 +951,13 @@ class Admin_DownController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(); $sql="select * from offlineapp where ts_approved is not null and pdflink is not null order by ts_created desc"; $rows=$this->db->fetchAll($sql); + foreach($rows as $row){ - $content.='"'.$row['username'].'","'.$row['unit'].'","'.$row['phone'].'","'.$row['address'].'","'.$row['postcoe'].'","'.str_replace("\"","'",$row['project']).'","'.str_replace("\"","'",$row['datalist']).'","'.$row['email'].'",'.$row['ts_created']."\n"; + $content.='"'.$row['username'].'","'.$row['unit'].'","'.$row['phone'].'","'.$row['address'].'","'.$row['postcode'].'","'.str_replace("\"","'",$row['project']).'","'.str_replace("\"","'",$row['datalist']).'","'.$row['email'].'",'.$row['ts_created']."\r\n"; } - $this->getResponse()->setHeader('Content-Type', 'application/octet-stream') - ->setHeader('Content-Disposition','attachment; filename="offlineapp.csv"') - ->setHeader('Content-Length', strlen($content)) - ->setHeader('Content-Type','application/force-download') - ->setHeader('Content-Type','application/download') - ->setHeader('Content-Description','File Transfer') - ->setHeader('Content-Transfer-Encoding','binary') - ->setHeader('Expires',0) - ->setHeader('Cache-Control','must-revalidate, post-check=0, pre-check=0') - ->setHeader('Pragma','public') - ->setBody($content); - + + $output = new Output($this->db); + $output->Download("offlineapp.csv",$content,"string"); } //下载离线服务记录 else if ($update) { @@ -905,7 +1138,7 @@ class Admin_DownController extends Zend_Controller_Action } $select=$this->db->select(); - $select->from('offlineapp')->where('ts_approved is not null')->where('pdflink is not null')->where('status=0')->order('ts_created desc'); + $select->from('offlineapp')->where('ts_approved is not null')->where('pdflink is not null')->where('status>=0')->order('ts_created desc'); $paginator = Zend_Paginator::factory($select); $paginator->setCurrentPageNumber($this->_getParam('page')); $paginator->setItemCountPerPage($this->view->config->page->max); diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index 3a703bf6..001217bf 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -123,6 +123,24 @@ class Admin_ReviewController extends Zend_Controller_Action } }//changestatus 更改状态 + function editorAction() + { + include_once("helper/view.php"); + include_once("data/Review.php"); + + $this->view->keyword = $keyword = $this->_request->getParam('keyword'); + + $review = new Review(); + if(!empty($keyword)) + { + $filter['keyword'] = $keyword; + $data = $review->needEditor($filter); + }else{ + $data = $review->needEditor(); + } + + \view::addPaginator($data,$this,NULL,20); + } /* * acceptAction()待审元数据 @@ -191,16 +209,12 @@ class Admin_ReviewController extends Zend_Controller_Action $sql = "select m.*,md.title,u.username,u.realname from mdstatus m right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid - where m.status in (1,2,3,4) order by m.ts_created desc"; + where m.status in (1,2,3,4) + order by m.ts_created desc"; $re = $this->db->query($sql); $rows = $re->fetchAll(); - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($this->_getParam('page')); - $paginator->setItemCountPerPage($this->view->config->page->max); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; + \view::addPaginator($rows,$this,NULL,20); }//列表 }//acceptAction @@ -586,6 +600,8 @@ class Admin_ReviewController extends Zend_Controller_Action $search=$this->_request->getParam('search'); $filter['keyword'] = $this->_request->getParam('keyword'); $filter['code'] = $this->_request->getParam('code'); + $filter['order'] = $this->_request->getParam('order'); + $filter['sort'] = $this->_request->getParam('sort'); $review = new Review($this->db); if(!empty($search) && !empty($filter)) @@ -593,6 +609,9 @@ class Admin_ReviewController extends Zend_Controller_Action $rows = $review->adminReviews($filter); $this->view->keyword = $filter['keyword']; $this->view->code = $filter['code']; + }if(!empty($filter)) + { + $rows = $review->adminReviews($filter); }else{ $rows = $review->adminReviews(); } diff --git a/application/admin/views/scripts/data/attachmentsadd.phtml b/application/admin/views/scripts/data/attachmentsadd.phtml index c6a37c0a..5660ef70 100644 --- a/application/admin/views/scripts/data/attachmentsadd.phtml +++ b/application/admin/views/scripts/data/attachmentsadd.phtml @@ -7,12 +7,7 @@ $this->breadcrumb('后台首页'); $this->breadcrumb('数据管理'); $this->breadcrumb()->setSeparator(' > '); - $this->headLink()->appendStylesheet('/static/js/uploadify/uploadify.css'); - $this->headScript()->appendFile('/static/js/jquery-1.7.2.min.js'); - $this->headScript()->appendFile('/js/jquery.colorbox-min.js'); - $this->headLink()->appendStylesheet('/css/colorbox.css'); - $this->headScript()->appendFile('/static/js/uploadify/swfobject.js'); - $this->headScript()->appendFile('/static/js/uploadify/jquery.uploadify.v2.1.4.min.js'); + $this->theme->AppendPlus($this,"uploadify"); ?>
partial('data/left.phtml'); ?> @@ -21,7 +16,7 @@
返回元数据附件列表 -查看元数据 +查看元数据 返回附件管理
@@ -30,7 +25,8 @@

注:可选择多个文件
-

+
+

@@ -38,65 +34,79 @@
+data['attid']) && !empty($this->data['attid'])){ ?> +' /> + + \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref-files.phtml b/application/admin/views/scripts/data/ref-files.phtml new file mode 100644 index 00000000..9bf1e160 --- /dev/null +++ b/application/admin/views/scripts/data/ref-files.phtml @@ -0,0 +1,105 @@ +headTitle($this->config->title->site); +$this->headTitle('后台管理'); +$this->headTitle()->setSeparator(' - '); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('文献管理'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'colorbox'); +$this->theme->AppendPlus($this,'admin_plugin'); +?> + +
+
+ partial('data/left.phtml'); ?> +
+
+
+ partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?> +
+
+
+
+ + +
+
+
+ error)) { ?> + error ?> + + msg)) { ?> + msg ?> + +
+ paginator)): ?> + + + + + + + + + + paginator as $item): + $autoindex++;?> + + + + + + + +
文件名状态操作
未编辑':"已编辑" ?> + 编辑 + 删除 +
+ + +
+ +
+
+ + \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref-mdref-form.phtml b/application/admin/views/scripts/data/ref-mdref-form.phtml new file mode 100644 index 00000000..6721ff29 --- /dev/null +++ b/application/admin/views/scripts/data/ref-mdref-form.phtml @@ -0,0 +1,48 @@ + \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref-metadatas.phtml b/application/admin/views/scripts/data/ref-metadatas.phtml new file mode 100644 index 00000000..f004d4df --- /dev/null +++ b/application/admin/views/scripts/data/ref-metadatas.phtml @@ -0,0 +1,69 @@ +headTitle($this->config->title->site); +$this->headTitle('后台管理'); +$this->headTitle()->setSeparator(' - '); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('文献管理'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'colorbox'); +$this->theme->AppendPlus($this,'admin_plugin'); +$this->theme->AppendModel($this,'admin-data-ref'); +?> + +
+
+ partial('data/left.phtml'); ?> +
+
+
+ partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?> +
+ error)) { ?> + error ?> + + msg)) { ?> + msg ?> + + +
+ paginator)): ?> + + + + + + + + + + + paginator as $item): + $autoindex++;?> + + + + + + + + +
元数据类型排序操作
referenceType[$item['reftype']]) ? $this->referenceType[$item['reftype']]:"" ?> + 编辑 + 移除 +
+ + +
+ +
+
+ +partial('data/ref-mdref-form.phtml',array('referenceType'=>$this->referenceType,'refid'=>$this->refid)); ?> + \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref-multiupload.phtml b/application/admin/views/scripts/data/ref-multiupload.phtml new file mode 100644 index 00000000..c2cdb1bf --- /dev/null +++ b/application/admin/views/scripts/data/ref-multiupload.phtml @@ -0,0 +1,120 @@ +headTitle($this->config->title->site); +$this->headTitle('后台管理'); +$this->headTitle()->setSeparator(' - '); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('文献管理'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'colorbox'); +$this->theme->AppendPlus($this,"uploadify"); +$this->theme->AppendPlus($this,'admin_plugin'); +?> + +
+
+ partial('data/left.phtml'); ?> +
+
+
+ partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?> +
+ error)) { ?> + error ?> + + msg)) { ?> + msg ?> + +
+
+ +
+ +
+
+
+ +
+ +
+
+ + +data['attid']) && !empty($this->data['attid'])){ ?> +' /> + + \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref-nav.phtml b/application/admin/views/scripts/data/ref-nav.phtml new file mode 100644 index 00000000..85329fdd --- /dev/null +++ b/application/admin/views/scripts/data/ref-nav.phtml @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref-ris.phtml b/application/admin/views/scripts/data/ref-ris.phtml new file mode 100644 index 00000000..342bfeb6 --- /dev/null +++ b/application/admin/views/scripts/data/ref-ris.phtml @@ -0,0 +1,67 @@ +headTitle($this->config->title->site); +$this->headTitle('后台管理'); +$this->headTitle()->setSeparator(' - '); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('文献管理'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'colorbox'); +$this->theme->AppendPlus($this,"uploadify"); +$this->theme->AppendPlus($this,'admin_plugin'); +?> + +
+
+ partial('data/left.phtml'); ?> +
+
+
+ partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?> +
+ error)) { ?> + error ?> + + msg)) { ?> + msg ?> + + data)) { ?> +
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ + +
+
+ + data as $k=>$ref) + { + echo '"; + } + ?> + + +
+
+ \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref-singleris.phtml b/application/admin/views/scripts/data/ref-singleris.phtml new file mode 100644 index 00000000..54440b16 --- /dev/null +++ b/application/admin/views/scripts/data/ref-singleris.phtml @@ -0,0 +1,63 @@ +headTitle($this->config->title->site); +$this->headTitle('后台管理'); +$this->headTitle()->setSeparator(' - '); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('文献管理'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'colorbox'); +$this->theme->AppendPlus($this,"uploadify"); +$this->theme->AppendPlus($this,'admin_plugin'); +?> + +
+
+ partial('data/left.phtml'); ?> +
+
+
+ partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?> +
+ error)) { ?> + error ?> + + msg)) { ?> + msg ?> + +

referenceData['title']) ? $this->referenceData['reference'] : $this->referenceData['title'] ?>

+
+ data)) { ?> +
+
+ +
+ + * 此功能是使用单个文献的 RIS 文本导入并覆盖以前填写过的信息 +
+
+
+ + +
+
+ + data as $k=>$ref) + { + echo '"; + } + ?> + + +
+
+ \ No newline at end of file diff --git a/application/admin/views/scripts/data/ref.phtml b/application/admin/views/scripts/data/ref.phtml new file mode 100644 index 00000000..b1298c2b --- /dev/null +++ b/application/admin/views/scripts/data/ref.phtml @@ -0,0 +1,102 @@ +headTitle($this->config->title->site); +$this->headTitle('后台管理'); +$this->headTitle()->setSeparator(' - '); +$this->breadcrumb('首页'); +$this->breadcrumb('数据管理'); +$this->breadcrumb('文献管理'); +$this->breadcrumb()->setSeparator(' > '); +$this->theme->AppendPlus($this,'colorbox'); +$this->theme->AppendPlus($this,'admin_plugin'); +$this->theme->AppendModel($this,'admin-data-ref'); +?> + +
+
+ partial('data/left.phtml'); ?> +
+
+
+ partial('data/ref-nav.phtml',array('ac'=>$this->ac)); ?> +
+
+
+
+ + + + +
+
+
+ error)) { ?> + error ?> + + msg)) { ?> + msg ?> + +
+ paginator)): ?> + + + + + + + + + + + paginator as $item): + $autoindex++;?> + + + + + + + + + + + + + + + + + + + + +
标题 + + + 年份 + + + 记录创建 + + + 操作
+ 编辑 + RIS编辑 + 数据(+) + 删除 +
+ 编辑 + RIS编辑 + 数据 + 删除 +
+ + +
+ +
+
+ +partial('data/ref-mdref-form.phtml',array('referenceType'=>$this->referenceType)); ?> \ No newline at end of file diff --git a/application/admin/views/scripts/data/reference.phtml b/application/admin/views/scripts/data/reference.phtml index 5e426ae5..39ff21ce 100644 --- a/application/admin/views/scripts/data/reference.phtml +++ b/application/admin/views/scripts/data/reference.phtml @@ -56,7 +56,7 @@ foreach ($this->paginator as $item): $i=0; $u=$item['uuid']; endif; - if ($i==0) echo '

元数据:'.$item['title'].'添加

    '; + if ($i==0) echo '

    元数据:'.$item['mdtitle'].'添加

      '; echo '
    1. 文献(编辑 删除 排序):'.$item['place'].'. '.$item['reference'].'
    2. '; endforeach; echo ''; diff --git a/application/admin/views/scripts/down/left.phtml b/application/admin/views/scripts/down/left.phtml index 0736736f..5afd002e 100644 --- a/application/admin/views/scripts/down/left.phtml +++ b/application/admin/views/scripts/down/left.phtml @@ -1,9 +1,10 @@ -
- - +partial('down/offlineapps-uploaderform.phtml'); ?> \ No newline at end of file diff --git a/application/admin/views/scripts/down/offlineapps-notpassed.phtml b/application/admin/views/scripts/down/offlineapps-notpassed.phtml new file mode 100644 index 00000000..e84534bf --- /dev/null +++ b/application/admin/views/scripts/down/offlineapps-notpassed.phtml @@ -0,0 +1,73 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb()->setSeparator(' > '); + $this->Theme->AppendPlus($this,'colorbox'); + $this->Theme->AppendPlus($this,'uploadify'); + $this->Theme->AppendModel($this,'admin-down-offlineapps'); + $this->Theme->AppendModel($this,'sfadmin'); + function applicationform($form) + { + if(empty($form)) + { + return "未提交"; + }else{ + return '查看'; + } + } +?> + +
+
+ partial('down/left.phtml'); ?> +
+
+ + partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?> + + + + + + + + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + + + +
申请者提交时间申请表操作
'.mb_substr($item['title'],0,15,"UTF-8")."";echo mb_strlen($item['title'],"UTF-8") > 15 ? "...":"";?> + 查看详细 + 发给作者 + 上传申请表 + 重置申请表 +
+ + +
+
+ +partial('down/offlineapps-uploaderform.phtml'); ?> \ No newline at end of file diff --git a/application/admin/views/scripts/down/offlineapps-notreceived.phtml b/application/admin/views/scripts/down/offlineapps-notreceived.phtml new file mode 100644 index 00000000..c9e8f0b2 --- /dev/null +++ b/application/admin/views/scripts/down/offlineapps-notreceived.phtml @@ -0,0 +1,74 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb()->setSeparator(' > '); + $this->Theme->AppendPlus($this,'colorbox'); + $this->Theme->AppendPlus($this,'uploadify'); + $this->Theme->AppendModel($this,'admin-down-offlineapps'); + $this->Theme->AppendModel($this,'sfadmin'); + function applicationform($form) + { + if(empty($form)) + { + return "未提交"; + }else{ + return '查看 下载'; + } + } +?> + +
+
+ partial('down/left.phtml'); ?> +
+
+ + partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?> + + + + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + + + +
申请者提交时间申请表操作
'.mb_substr($item['title'],0,15,"UTF-8")."";echo mb_strlen($item['title'],"UTF-8") > 15 ? "...":"";?> + 查看详细 + 接收 + 退回 + 上传申请表 + 重置申请表 +
+ + +
+
+ +partial('down/offlineapps-uploaderform.phtml'); ?> \ No newline at end of file diff --git a/application/admin/views/scripts/down/offlineapps-toauthor.phtml b/application/admin/views/scripts/down/offlineapps-toauthor.phtml new file mode 100644 index 00000000..0f7a08ed --- /dev/null +++ b/application/admin/views/scripts/down/offlineapps-toauthor.phtml @@ -0,0 +1,42 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb()->setSeparator(' > '); + $this->Theme->AppendPlus($this,'colorbox'); + $this->Theme->AppendPlus($this,'uploadify'); + $this->Theme->AppendModel($this,'admin-down-offlineapps'); + $this->Theme->AppendModel($this,'sfadmin'); + function applicationform($form) + { + if(empty($form)) + { + return "未提交"; + }else{ + return '点击下载'; + } + } +?> + +
+
+ partial('down/left.phtml'); ?> +
+
+ + partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?> + +

发给作者

+ + + +
+
+ +partial('down/offlineapps-uploaderform.phtml'); ?> \ No newline at end of file diff --git a/application/admin/views/scripts/down/offlineapps-uploaderform.phtml b/application/admin/views/scripts/down/offlineapps-uploaderform.phtml new file mode 100644 index 00000000..3af9cb18 --- /dev/null +++ b/application/admin/views/scripts/down/offlineapps-uploaderform.phtml @@ -0,0 +1,19 @@ + + \ No newline at end of file diff --git a/application/admin/views/scripts/down/offlineapps-view.phtml b/application/admin/views/scripts/down/offlineapps-view.phtml new file mode 100644 index 00000000..d11ca140 --- /dev/null +++ b/application/admin/views/scripts/down/offlineapps-view.phtml @@ -0,0 +1,63 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb()->setSeparator(' > '); + $this->Theme->AppendPlus($this,'colorbox'); + $this->Theme->AppendPlus($this,'uploadify'); + $this->Theme->AppendModel($this,'admin-down-offlineapps'); + $this->Theme->AppendModel($this,'sfadmin'); + function applicationform($form) + { + if(empty($form)) + { + return "未提交"; + }else{ + return '点击下载'; + } + } +?> + +
+
+ partial('down/left.phtml'); ?> +
+
+ + partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?> + +

查看详细

+ + + +
+
+ +partial('down/offlineapps-uploaderform.phtml'); ?> \ No newline at end of file diff --git a/application/admin/views/scripts/down/offlineapps.phtml b/application/admin/views/scripts/down/offlineapps.phtml new file mode 100644 index 00000000..b89078b9 --- /dev/null +++ b/application/admin/views/scripts/down/offlineapps.phtml @@ -0,0 +1,50 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb()->setSeparator(' > '); +?> + +
+
+ partial('down/left.phtml'); ?> +
+
+ + partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?> + + + + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + + +
元数据标题责任编辑接收时间操作
+ 分配编辑 +
+ + +
+
\ No newline at end of file diff --git a/application/admin/views/scripts/post-message.phtml b/application/admin/views/scripts/post-message.phtml index 89d2f043..4852db0d 100644 --- a/application/admin/views/scripts/post-message.phtml +++ b/application/admin/views/scripts/post-message.phtml @@ -10,9 +10,9 @@ if(!empty($this->pageTitle))

content ?>url)) echo ",系统正在为您跳转..."?>

url)) {?> - url == -1) { ?> + url)) { ?> 如果没有跳转请点击这样 - + 如果没有跳转请点击这样 diff --git a/application/admin/views/scripts/review/accept.phtml b/application/admin/views/scripts/review/accept.phtml index a2c24848..4f44491d 100644 --- a/application/admin/views/scripts/review/accept.phtml +++ b/application/admin/views/scripts/review/accept.phtml @@ -36,7 +36,7 @@ table thead tr th {background:#EBF2F6;color:#444;} - + @@ -48,7 +48,7 @@ table thead tr th {background:#EBF2F6;color:#444;} diff --git a/application/admin/views/scripts/review/editor.phtml b/application/admin/views/scripts/review/editor.phtml new file mode 100644 index 00000000..80f06c7c --- /dev/null +++ b/application/admin/views/scripts/review/editor.phtml @@ -0,0 +1,60 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('元数据评审'); + $this->breadcrumb()->setSeparator(' > '); +?> + +
+
+ partial('review/left.phtml'); ?> +
+
+ msg or $this->messages) :?> +
+ msg) : ?> +

msg; ?>

+ messages): foreach($this->messages as $msg): ?> +

+ +
+ + + + + + + + + +
元数据标题负责编辑责任编辑 接收时间 操作
- 分配编辑 + 更改责任编辑
+ + + + + + + paginator)): ?> + + paginator as $item): ?> + + + + + + + + + +
元数据标题责任编辑接收时间操作
+ 分配编辑 +
+ +
+ \ No newline at end of file diff --git a/application/admin/views/scripts/review/left.phtml b/application/admin/views/scripts/review/left.phtml index 1937f856..b9ce7de6 100644 --- a/application/admin/views/scripts/review/left.phtml +++ b/application/admin/views/scripts/review/left.phtml @@ -1,6 +1,7 @@ - - \ No newline at end of file diff --git a/application/default/views/scripts/water/view.phtml b/application/default/views/scripts/water/view.phtml index 580455f6..3d4a58e9 100755 --- a/application/default/views/scripts/water/view.phtml +++ b/application/default/views/scripts/water/view.phtml @@ -11,6 +11,9 @@ $this->theme->AppendPlus($this,'google_map_v3'); $this->theme->AppendPlus($this,'colorbox'); $this->nav[] = array('link'=>"/water",'title'=>'黑河综合遥感联合试验'); + if(!empty($this->dataService)) { + $this->theme->AppendModel($this,"dataservice"); + } ?>