Exemplo n.º 1
0
 public function executeShowInfo()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'sm_content/listInfo');
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $public_information = PublicInformationPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($public_information);
     $this->subtitle = $public_information->toString() . ' - id:' . $public_information->getId();
     $actions = array(array('name' => 'back', 'url' => 'sm_content/listInfo', 'color' => 'black'));
     $this->actions = $actions;
     $this->public_information = $public_information;
 }
Exemplo n.º 2
0
 public function executeListStatus()
 {
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'pmb_menu/listStatus');
     $job = JobPeer::doSelectOne($c);
     $cw = new Criteria();
     $cw->add(JobInformationPeer::JOB_ID, $job->getId());
     $job_information = JobInformationPeer::doSelectOne($cw);
     $public_information = PublicInformationPeer::retrieveByPk($job_information->getPublicInformationId());
     $job_category = JobCategoryPeer::retrieveByPk($job_information->getJobCategoryId());
     $this->job = $job;
     $this->job_information = $job_information;
     $this->job_category = $job_category;
     $this->public_information = $public_information;
 }
Exemplo n.º 3
0
 public function executeDeleteArticle()
 {
     $public_information = PublicInformationPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($public_information);
     $ref_error = 0;
     foreach ($public_information->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $public_information->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('public_information/deleteArticle/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('public_information/deleteArticle', '_ERR_DELETE_ (' . $public_information->toString() . ' - id:' . $public_information->getId() . ')');
     } else {
         $public_information->delete();
     }
     return $this->forward('public_information', 'listArticle');
 }