示例#1
0
 protected function _notifyResume($id)
 {
     $object = new Wpjb_Model_ResumesAccess($id);
     $emp = new Wpjb_Model_Employer($object->employer_id);
     $emp->addAccess($object->extend);
     $emp->save();
 }
示例#2
0
 protected function _multiDecline($id)
 {
     $object = new Wpjb_Model_Employer($id);
     $object->is_active = Wpjb_Model_Employer::ACCOUNT_DECLINED;
     $object->save();
     return true;
 }
示例#3
0
 public function newAction()
 {
     if (!get_option('users_can_register')) {
         $this->view->_flash->addError(__("User registration is disabled.", WPJB_DOMAIN));
         return false;
     }
     if ($this->_isCandidate()) {
         return false;
     }
     if ($this->_isLoggedIn()) {
         wp_redirect(wpjb_link_to("employer_panel"));
         return;
     }
     if (Wpjb_Model_Employer::current()->isEmployer()) {
         $this->view->_flash->addError(__("You need to be registered as Candidate in order to access this page. Your current account type is Employer.", WPJB_DOMAIN));
         return false;
     }
     $this->_setTitle(__("Register Employer", WPJB_DOMAIN));
     $form = new Wpjb_Form_Frontend_Register();
     $this->view->errors = array();
     if ($this->isPost()) {
         $isValid = $form->isValid($this->getRequest()->getAll());
         if ($isValid) {
             $username = $form->getElement("user_login")->getValue();
             $password = $form->getElement("user_password")->getValue();
             $email = $form->getElement("user_email")->getValue();
             $id = wp_create_user($username, $password, $email);
             $val = $form->getValues();
             update_usermeta($id, "is_employer", 1);
             $employer = new Wpjb_Model_Employer();
             $employer->user_id = $id;
             $employer->company_name = $val["company_name"];
             $employer->company_website = $val["company_website"];
             $employer->company_info = $val["company_info"];
             $employer->company_location = $val["company_location"];
             $employer->is_public = $val["is_public"];
             $employer->save();
             $instance = Wpjb_Project::getInstance();
             $router = $instance->getApplication("frontend")->getRouter();
             /* @var $router Daq_Router */
             $url = $instance->getApplication("frontend")->getUrl();
             $url .= "/" . $router->linkTo("employer_login");
             $mail = new Wpjb_Utility_Message(9);
             $mail->setTo($email);
             $mail->setParam("username", $username);
             $mail->setParam("password", $password);
             $mail->setParam("login_url", $url);
             $mail->send();
             $form = new Wpjb_Form_Login();
             $form->isValid(array("user_login" => $username, "user_password" => $password, "remember" => false));
             $this->view->_flash->addInfo(__("You have been registered successfully", WPJB_DOMAIN));
             $redirect = wpjb_link_to("employer_panel");
             wp_redirect($redirect);
         }
     }
     $this->view->form = $form;
     return "company-new";
 }
示例#4
0
 public function delete()
 {
     $this->deleteImage();
     $query = new Daq_Db_Query();
     $object = $query->select()->from("Wpjb_Model_JobSearch t")->where("t.job_id = ?", $this->getId())->limit(1)->execute();
     if (!empty($object)) {
         $object[0]->delete();
     }
     $employer = new Wpjb_Model_Employer($this->employer_id);
     if ($employer->getId() > 0) {
         $employer->jobs_posted--;
         $employer->save();
     }
     $result = parent::delete();
     Wpjb_Project::scheduleEvent();
     return $result;
 }