Exemplo n.º 1
0
 protected static function _modify(Wpjb_Model_Job $job)
 {
     $arr = $job->allToArray();
     foreach (Wpjb_Utility_Registry::getCategories() as $category) {
         if ($category->id == $job->job_category) {
             break;
         }
     }
     foreach (Wpjb_Utility_Registry::getJobTypes() as $type) {
         if ($type->id == $job->job_type) {
             break;
         }
     }
     $public = array("id", "company_name", "company_website", "job_type", "job_category", "job_country", "job_state", "job_zip_code", "job_location", "job_limit_to_country", "job_title", "job_slug", "job_created_at", "job_expires_at", "job_description", "is_active", "is_filled", "is_featured", "stat_view", "stat_unique", "stat_apply");
     $publish = new stdClass();
     foreach ($public as $k) {
         $publish->{$k} = $job->{$k};
     }
     $arr = $job->allToArray();
     foreach ($arr as $k => $a) {
         if (substr($k, 0, 6) == "field_") {
             $publish->{$k} = $a;
         }
     }
     $publish->url = wpjb_link_to("job", $job);
     $publish->image = $job->getImageUrl();
     $publish->formatted_created_at = wpjb_date("M, d", $job->job_created_at);
     $publish->location = $job->locationToString();
     $publish->category = $category->toArray();
     $publish->type = $type->toArray();
     $publish->is_new = $job->isNew();
     $publish->is_free = $job->isFree();
     return $publish;
 }
Exemplo n.º 2
0
 public function init()
 {
     global $wp_rewrite;
     if (!$wp_rewrite->using_permalinks()) {
         $e = new Daq_Form_Element("job_resumes", Daq_Form_Element::TYPE_HIDDEN);
         $e->setValue("find");
         $this->addElement($e);
         $e = new Daq_Form_Element("page_id", Daq_Form_Element::TYPE_HIDDEN);
         $e->setValue(Wpjb_Project::getInstance()->conf("link_resumes"));
         $this->addElement($e);
     }
     $e = new Daq_Form_Element("query");
     $e->setLabel(__("Search", WPJB_DOMAIN));
     $e->setValue(__("title, experience, education ...", WPJB_DOMAIN));
     $e->addClass("wpjb-auto-clear");
     $this->addElement($e, "search");
     $e = new Daq_Form_Element("degree", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Degree", WPJB_DOMAIN));
     foreach (Wpjb_Form_Admin_Resume::getDegrees() as $k => $v) {
         $e->addOption($k, $k, $v);
     }
     $this->addElement($e, "search");
     $e = new Daq_Form_Element("experience", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Years of Experience", WPJB_DOMAIN));
     foreach (Wpjb_Form_Admin_Resume::getExperience() as $k => $v) {
         $e->addOption($k, $k, $v);
     }
     $this->addElement($e, "search");
     $e = new Daq_Form_Element("category", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Category", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     foreach (Wpjb_Utility_Registry::getCategories() as $obj) {
         $e->addOption($obj->id, $obj->id, $obj->title);
     }
     if (count(Wpjb_Utility_Registry::getCategories()) > 0) {
         $this->addElement($e, "search");
     }
     $e = new Daq_Form_Element("posted", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Last updated", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     $e->addOption(1, 1, __("Today", WPJB_DOMAIN));
     $e->addOption(2, 2, __("Yesterday", WPJB_DOMAIN));
     $e->addOption(7, 7, __("Less than 7 days ago", WPJB_DOMAIN));
     $e->addOption(30, 30, __("Less than 30 days ago", WPJB_DOMAIN));
     $this->addElement($e, "search");
     apply_filters("wpjr_form_init_search", $this);
 }
Exemplo n.º 3
0
 public function init()
 {
     global $wp_rewrite;
     if (!$wp_rewrite->using_permalinks()) {
         $e = new Daq_Form_Element("job_board", Daq_Form_Element::TYPE_HIDDEN);
         $e->setValue("find");
         $this->addElement($e);
         $e = new Daq_Form_Element("page_id", Daq_Form_Element::TYPE_HIDDEN);
         $e->setValue(Wpjb_Project::getInstance()->conf("link_jobs"));
         $this->addElement($e);
     }
     $e = new Daq_Form_Element("query");
     $e->setLabel(__("Search", WPJB_DOMAIN));
     $e->setValue(__("keyword, location, company ...", WPJB_DOMAIN));
     $e->addClass("wpjb-auto-clear");
     $this->addElement($e, "search");
     $e = new Daq_Form_Element("type", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Job Type", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     foreach (Wpjb_Utility_Registry::getJobTypes() as $obj) {
         $e->addOption($obj->id, $obj->id, $obj->title);
     }
     if (count(Wpjb_Utility_Registry::getJobTypes()) > 0) {
         $this->addElement($e, "search");
     }
     $e = new Daq_Form_Element("category", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Job Category", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     foreach (Wpjb_Utility_Registry::getCategories() as $obj) {
         $e->addOption($obj->id, $obj->id, $obj->title);
     }
     if (count(Wpjb_Utility_Registry::getCategories()) > 0) {
         $this->addElement($e, "search");
     }
     $e = new Daq_Form_Element("posted", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Posted", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     $e->addOption(1, 1, __("Today", WPJB_DOMAIN));
     $e->addOption(2, 2, __("Yesterday", WPJB_DOMAIN));
     $e->addOption(7, 7, __("Less then 7 days ago", WPJB_DOMAIN));
     $e->addOption(30, 30, __("Less then 30 days ago", WPJB_DOMAIN));
     $this->addElement($e, "search");
     apply_filters("wpjb_form_init_search", $this);
 }
Exemplo n.º 4
0
function wpjb_get_categories($options = null)
{
    return Wpjb_Utility_Registry::getCategories();
}