diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index 30884c0b..ec266f3a 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -51,27 +51,27 @@ class Admin_DownController extends Zend_Controller_Action $mail->setSubject($mailtp->getSubject()); $mail->addTo($row['email']); $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); - $mail->send(); - - unset($mail); - $mail = new WestdcMailer($this->view->config->smtp); - $mailtp=new EmailText($this->db,'offline-start-admin',array('user'=>$row['username'],'datalist'=>$datalist)); - $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); - $sql="select distinct(res.email) from dataorder d left join role on d.uuid=role.uuid left join responsible res on role.resid=res.id where length(res.email)>4 and d.offlineappid=? and role.role in ('pointOfContact','resourceProvider')"; - $rows=$this->db->fetchAll($this->db->quoteInto($sql,$start)); - $addrs=array(); - foreach($rows as $row) - { - $addrs[]=$row['email']; + $mail->send(); + + unset($mail); + $mail = new WestdcMailer($this->view->config->smtp); + $mailtp=new EmailText($this->db,'offline-start-admin',array('user'=>$row['username'],'datalist'=>$datalist)); + $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); + $sql="select distinct(res.email) from dataorder d left join role on d.uuid=role.uuid left join responsible res on role.resid=res.id where length(res.email)>4 and d.offlineappid=? and role.role in ('pointOfContact','resourceProvider')"; + $rows=$this->db->fetchAll($this->db->quoteInto($sql,$start)); + $addrs=array(); + foreach($rows as $row) + { + $addrs[]=$row['email']; } //收件人邮箱 - $addrs[] = 'nztong@lzb.ac.cn'; - $addrs[] = 'wjian@lzb.ac.cn'; + $addrs[] = 'nztong@lzb.ac.cn'; + $addrs[] = 'wjian@lzb.ac.cn'; $addrs[] = 'lixin@lzb.ac.cn'; $mail->setBodyText($mailtp->getBody()); $mail->setSubject($mailtp->getSubject()); - $mail->addTo($addrs); - $mail->addCc($this->view->config->service->email,'西部数据中心服务组'); + $mail->addTo($addrs); + $mail->addCc($this->view->config->service->email,'西部数据中心服务组'); $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']); @@ -247,7 +247,11 @@ class Admin_DownController extends Zend_Controller_Action $param[]=$edit; $this->db->query($sql,$param); $this->messenger->addMessage('提示信息:您已经编辑添加该记录。'); - $this->_redirect('/admin/down/offline'); + $page = $this->_getParam('page'); + if(!empty($page)) + $this->_redirect('/admin/down/offline/page/'.$page); + else + $this->_redirect('/admin/down/offline/'); } else { $form->populate($formdata); } @@ -382,6 +386,8 @@ class Admin_DownController extends Zend_Controller_Action $paginator->setView($this->view); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); $this->view->paginator=$paginator; + + $this->view->page = $this->_getParam('page'); } //在线数据下载情况,仅针对onlineapp表,自2011-9-8开始记录。 function onlineAction() @@ -393,7 +399,7 @@ class Admin_DownController extends Zend_Controller_Action { $select=$this->db->select(); $select->from('onlineapp as o',array('id','userid','unit','username','ts_created','project')) - ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) + ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) ->where('o.id in (select distinct(onlineappid) from dataorder)') ->order('o.id desc'); $paginator = Zend_Paginator::factory($select); @@ -409,10 +415,10 @@ class Admin_DownController extends Zend_Controller_Action elseif($delete) { - try { + try { $sql="delete from onlineapp where id=?"; - $this->db->query($sql,array($delete)); - $sql="delete from dataorder where onlineappid=?"; + $this->db->query($sql,array($delete)); + $sql="delete from dataorder where onlineappid=?"; $this->db->query($sql,array($delete)); $this->messenger->addMessage('该记录已删除'); } catch (Exception $e) { diff --git a/application/admin/views/scripts/down/offline.phtml b/application/admin/views/scripts/down/offline.phtml index c7b2ff83..4accc6b8 100644 --- a/application/admin/views/scripts/down/offline.phtml +++ b/application/admin/views/scripts/down/offline.phtml @@ -49,10 +49,10 @@