Beispiel #1
0
 public function save()
 {
     if (Wpjb_Project::getInstance()->conf("cv_approval") == 1) {
         $e = new Daq_Form_Element("is_approved");
         $e->setValue(Wpjb_Model_Resume::RESUME_PENDING);
         $this->addElement($e);
     }
     $e = new Daq_Form_Element("updated_at");
     $e->setValue(date("Y-m-d H:i:s"));
     $this->addElement($e);
     parent::save();
     if (Wpjb_Project::getInstance()->conf("cv_approval") == 1) {
         $url = rtrim(site_url(), "/");
         $url .= "/wp-admin/admin.php?page=wpjb/resumes&action=edit/id/";
         $url .= $this->getObject()->id;
         $mail = new Wpjb_Utility_Message(11);
         $mail->setParams($this->getObject()->toArray());
         $mail->setParam("resume_admin_url", $url);
         $mail->setTo($mail->getTemplate()->mail_from);
         $mail->send();
     }
 }
Beispiel #2
0
 protected function _accessRequest()
 {
     // request employer account
     $object = $this->_employer();
     $this->view->object = $object;
     if ($object->is_active == Wpjb_Model_Employer::ACCOUNT_REQUEST) {
         $this->view->already_requested = true;
         $this->view->_flash->addInfo(__("You already requested employer account.", WPJB_DOMAIN));
         return;
     } elseif ($object->is_active == Wpjb_Model_Employer::ACCOUNT_INACTIVE) {
         $this->view->already_requested = true;
         $this->view->_flash->addError(__("Your employer account has been deactivated. Contact Administrator for more information.", WPJB_DOMAIN));
         return;
     } else {
         $this->view->already_requested = false;
     }
     if ($object->is_active == Wpjb_Model_Employer::ACCOUNT_DECLINED) {
         $this->view->_flash->addError(__("Your request has been declined, please update your profile and re-submit request", WPJB_DOMAIN));
     }
     if ($this->_request->getParam("request_employer")) {
         $object->is_active = 2;
         $object->save();
         $this->view->request_sent = true;
         $this->_setTitle(__("Request has been sent", WPJB_DOMAIN));
         $url = rtrim(site_url(), "/");
         $url .= "/wp-admin/admin.php?page=wpjb/employers&action=edit/id/";
         $url .= $object->id;
         $mail = new Wpjb_Utility_Message(12);
         $mail->setParams($object->toArray());
         $mail->setParam("company_admin_url", $url);
         $mail->setTo($mail->getTemplate()->mail_from);
         $mail->send();
     }
 }