Esempio n. 1
0
 public function execute()
 {
     $this->_sql($this->getVersion());
     set_time_limit(0);
     $query = new Daq_Db_Query();
     $query->select()->from("Wpjb_Model_Job t")->joinLeft("t.search s")->where("is_active = 1")->where("s.job_id IS NULL");
     foreach ($query->execute() as $job) {
         Wpjb_Model_JobSearch::createFrom($job);
     }
     $db = Daq_Db::getInstance();
     $wpdb = $db->getDb();
     $config = Wpjb_Project::getInstance();
     $config->setConfigParam("front_template", "twentyten");
     $config->saveConfig();
     if (!Wpjb_Project::getInstance()->conf("link_jobs")) {
         $jId = wp_insert_post(array('post_type' => 'page', 'post_status' => 'publish', 'post_title' => 'Jobs', 'comment_status' => 'closed', 'ping_status' => 'closed'));
         $config->setConfigParam("link_jobs", $jId);
         $config->saveConfig();
     }
     if (!Wpjb_Project::getInstance()->conf("link_resumes")) {
         $rId = wp_insert_post(array('post_type' => 'page', 'post_status' => 'publish', 'post_title' => 'Resumes', 'comment_status' => 'closed', 'ping_status' => 'closed'));
         $config->setConfigParam("link_resumes", $rId);
         $config->saveConfig();
     }
     return;
 }
Esempio n. 2
0
 public function execute()
 {
     $query = new Daq_Db_Query();
     $result = $query->select("*")->from("Wpjb_Model_Job t")->execute();
     foreach ($result as $job) {
         Wpjb_Model_JobSearch::createFrom($job);
     }
 }
Esempio n. 3
0
 public function searchAction()
 {
     $request = Daq_Request::getInstance();
     $query = $request->post("query");
     $category = $request->post("category");
     $type = $request->post("type");
     $posted = $request->post("posted");
     $page = $request->post("page", 1);
     $count = $request->post("count", 20);
     $param = array("query" => $request->post("query"), "category" => $request->post("category"), "type" => $request->post("type"), "page" => $request->post("page", 1), "count" => $request->post("count"), "country" => $request->post("country"), "posted" => $request->post("posted"), "location" => $request->post("location"), "is_featured" => $request->post("is_featured"), "employer_id" => $request->post("employer_id"), "field" => $request->post("field", array()), "sort" => $request->post("sort"), "order" => $request->post("order"));
     $result = Wpjb_Model_JobSearch::search($param);
     $list = $result->job;
     $result->job = array();
     foreach ($list as $job) {
         $result->job[] = self::_modify($job);
     }
     self::_push($result);
 }
Esempio n. 4
0
 public function save()
 {
     $isNew = true;
     if ($this->getId()) {
         $isNew = false;
     }
     $m1 = (bool) $this->_fields["job_country"]["modified"];
     $m2 = (bool) $this->_fields["job_state"]["modified"];
     $m3 = (bool) $this->_fields["job_zip_code"]["modified"];
     $m4 = (bool) $this->_fields["job_location"]["modified"];
     if ($m1 || $m2 || $m3 || $m4) {
         // reset geolocation
         $this->geo_status = self::GEO_UNSET;
         $this->geo_longitude = 0;
         $this->geo_latitude = 0;
     }
     $id = parent::save();
     if ($isNew) {
         Wpjb_Utility_Messanger::send(1, $this);
     }
     if ($id && $this->_approve) {
         $this->_approve();
         $this->_approve = false;
     }
     Wpjb_Model_JobSearch::createFrom($this);
     $employer = new Wpjb_Model_Employer($this->employer_id);
     if ($employer->getId() > 0 && $isNew) {
         $employer->jobs_posted++;
         $employer->save();
     }
     Wpjb_Project::scheduleEvent();
     return $id;
 }
Esempio n. 5
0
 public function rssAction()
 {
     $request = $this->getRequest();
     $query = $request->get("query", "all");
     $category = $request->get("category", "all");
     $type = $request->get("type", "all");
     if (empty($query) || $query == "all") {
         $query = "";
     }
     if (empty($category) || $category == "all") {
         $category = null;
     } else {
         $category = $this->_resolve($category, "Wpjb_Model_Category");
     }
     if (empty($type) || $type == "all") {
         $type = null;
     } else {
         $type = $this->_resolve($type, "Wpjb_Model_JobType");
     }
     $param = array("query" => $query, "category" => $category, "type" => $type, "posted" => null, "page" => null, "count" => null, "country" => $request->get("country"), "location" => $request->get("location"), "is_featured" => $request->get("is_featured"), "employer_id" => $request->get("employer_id"), "field" => $request->get("field", array()), "sort" => $request->get("sort"), "order" => $request->get("order"));
     $search = Wpjb_Model_JobSearch::search($param);
     $this->_feed($search->job);
 }
Esempio n. 6
0
 public function searchAction()
 {
     $request = $this->getRequest();
     $text = Wpjb_Project::getInstance()->conf("seo_search_results", __("Search Results: {keyword}", WPJB_DOMAIN));
     $param = array('keyword' => $request->get("query"));
     $this->_setTitle($text, $param);
     $request = Daq_Request::getInstance();
     $param = array("query" => $request->get("query"), "category" => $request->get("category"), "type" => $request->get("type"), "page" => $request->get("page", 1), "count" => $request->get("count", 20), "country" => $request->get("country"), "posted" => $request->get("posted"), "location" => $request->get("location"), "is_featured" => $request->get("is_featured"), "employer_id" => $request->get("employer_id"), "field" => $request->get("field", array()), "sort" => $request->get("sort"), "order" => $request->get("order"));
     $result = Wpjb_Model_JobSearch::search($param);
     $this->view->jobPage = $result->page;
     $this->view->jobCount = ceil($result->total / $result->perPage);
     $this->view->jobList = $result->job;
     $router = Wpjb_Project::getInstance()->router();
     $this->view->cDir = $router->linkTo("search", null, $param);
     $this->view->qString = $this->getServer("QUERY_STRING");
     return "index";
 }
Esempio n. 7
0
function wpjb_find_jobs(array $options = null)
{
    return Wpjb_Model_JobSearch::search($options);
}