diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 39e23cb1..dc9e4483 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -709,22 +709,24 @@ class AuthorController extends Zend_Controller_Action */ function applyAction() { - $ac = $this->_request->getParam('ac'); + $ac = $this->_request->getParam('ac'); + include_once('helper/view.php'); + $this->view->id=view::User('id'); if($ac == "mydata") { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); - include_once('helper/view.php'); $email = view::User('email'); - $realname=view::User('realname'); + $realname=view::User('realname'); + $sql = "SELECT distinct m.uuid,m.title,m.description,a.status,a.userid FROM normalmetadata m LEFT JOIN mdauthor a ON m.uuid=a.uuid LEFT JOIN role r ON r.uuid=m.uuid LEFT JOIN responsible re ON r.resid = re.id - WHERE re.email LIKE '%$email%' or re.realname='$realname'"; + WHERE r.role in ('originator','resourceProvider','pointOfContact','owner') and (re.email LIKE '%$email%' or re.individual='$realname')"; $rs = $this->db->query($sql); $this->jsonexit($rs->fetchAll()); diff --git a/application/default/views/scripts/author/apply.phtml b/application/default/views/scripts/author/apply.phtml index 09711c18..736c8500 100644 --- a/application/default/views/scripts/author/apply.phtml +++ b/application/default/views/scripts/author/apply.phtml @@ -77,8 +77,8 @@ function datareceive(data){ var result = new Array(); for(i=0;i'; + if(data[i].status==1 && data[i].userid==id; ?>) var ct='您是此元数据的作者'; + else if (data[i].status==0 && data[i].userid==id; ?>) var ct='您已经申请成为该元数据作者,请前往 我的数据 查看'; else var ct='申请成为此数据的作者'; result.push('
  • '+data[i].title+'

    '+data[i].description+'

    '+ct+'

  • '); }