diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index bb8072c9..7ae6be56 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -27,147 +27,7 @@ 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() { @@ -185,6 +45,7 @@ class Admin_DownController extends Zend_Controller_Action $status =(int)$this->_getParam('status'); $ac = $this->_getParam('ac'); $q = $this->_getParam('q'); + $submd=$this->view->config->sub->metadata; if($ac == "pending") { diff --git a/application/admin/views/scripts/down/offlineapp.phtml b/application/admin/views/scripts/down/offlineapp.phtml index 99598dda..a0ac93ea 100644 --- a/application/admin/views/scripts/down/offlineapp.phtml +++ b/application/admin/views/scripts/down/offlineapp.phtml @@ -29,7 +29,6 @@
- 重置1年前的所有未收到申请表的记录 已收到的申请 已拒绝的申请 待处理的申请 diff --git a/application/models/Dataorder.php b/application/models/Dataorder.php index 0a96dd04..3801f44b 100644 --- a/application/models/Dataorder.php +++ b/application/models/Dataorder.php @@ -18,9 +18,11 @@ class Dataorder } public function fetchAllOfflineApp($statu=0,$q=""){ - + $config = \Zend_Registry::get('config'); + $submd=$config->sub->metadata; $wheresql = array(); + $wheresql[]=" d.uuid in (select uuid from $submd) "; if ($statu==4) $wheresql[] = " (o.ts_approved is null and o.pdflink is not null and d.status=4) "; elseif ($statu==-1)