Пример #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;
 }
Пример #2
0
 public function __construct()
 {
     $this->_context = Wpjb_Project::getInstance();
     $this->_viewAdmin = "search.php";
     $this->_viewFront = "search.php";
     parent::__construct("wpjb-search", __("Search Jobs", WPJB_DOMAIN), array("description" => __("Search jobs widget.", WPJB_DOMAIN)));
 }
Пример #3
0
 public function __construct()
 {
     $this->_context = Wpjb_Project::getInstance();
     $this->_viewAdmin = "resumes-menu.php";
     $this->_viewFront = "resumes-menu.php";
     parent::__construct("wpjb-resumes-menu", __("Resumes Menu", WPJB_DOMAIN), array("description" => __("Resumes menu links", WPJB_DOMAIN)));
 }
Пример #4
0
 public function __construct()
 {
     $this->_context = Wpjb_Project::getInstance();
     $this->_viewAdmin = "feeds.php";
     $this->_viewFront = "feeds.php";
     parent::__construct("wpjb-widget-feeds", __("Job Feeds", WPJB_DOMAIN), array("description" => __("Displays list of available WPJobBoard feeds", WPJB_DOMAIN)));
 }
Пример #5
0
 public function __construct()
 {
     $this->_context = Wpjb_Project::getInstance();
     $this->_viewAdmin = "alerts.php";
     $this->_viewFront = "alerts.php";
     parent::__construct("wpjb-widget-alerts", __("Job Alerts", WPJB_DOMAIN), array("description" => __("Allows to create new job alert", WPJB_DOMAIN)));
 }
Пример #6
0
 public function __construct()
 {
     $this->_context = Wpjb_Project::getInstance();
     $this->_viewAdmin = "job-board-menu.php";
     $this->_viewFront = "job-board-menu.php";
     parent::__construct("wpjb-job-board-menu", __("Job Board Menu", WPJB_DOMAIN), array("description" => __("Job board and employer menu.", WPJB_DOMAIN)));
 }
Пример #7
0
 public function __construct()
 {
     $this->_context = Wpjb_Project::getInstance();
     $this->_viewAdmin = "categories.php";
     $this->_viewFront = "categories.php";
     parent::__construct("wpjb-job-categories", __("Job Categories", WPJB_DOMAIN), array("description" => __("Displays list of available job categories", WPJB_DOMAIN)));
 }
function user_panel_api_content($content)
{
    $request = Daq_Request::getInstance();
    // URL does not have ?panel=my_link param, this means some other panel is being executed
    // return default content then.
    if ($request->get("panel") != "my_link") {
        return $content;
    }
    // Make sure to authenticate user!
    // Load default WPJB styles
    wp_enqueue_style("wpjb-css");
    // Create breadcrumbs, basically two links:
    // - User Panel home
    // - Current page
    $breadcrumbs = array(array("title" => __("Home", "wpjobboard"), "url" => get_permalink(), "glyph" => "wpjb-icon-home"), array("title" => "My Link", "url" => get_permalink() . "?panel=my_link", "glyph" => is_rtl() ? "wpjb-icon-left-open" : "wpjb-icon-right-open"));
    // initiate view object and add new templates directory so we can load
    // a custom template file.
    $view = Wpjb_Project::getInstance()->getApplication("frontend")->getView();
    $view->addDir(dirname(__FILE__), true);
    $view->breadcrumbs = $breadcrumbs;
    // initatte session to allow flash messages
    $flash = new Wpjb_Utility_Session();
    $flash->addInfo("Custom My Link Panel Loaded!");
    $flash->save();
    // render template
    ob_start();
    $view->render("custom-template.php");
    $render = ob_get_clean();
    return $render;
}
/**
 * Insert attention message
 *
 * This function will show "Attention! This job is ..." message if current user
 * is on job details page and currently viewed job is older than X days.
 *
 * @since 1.0
 * @return void
 */
function push_attention_msg()
{
    $job = null;
    if (is_singular("job")) {
        $query = new Daq_Db_Query();
        $query->from("Wpjb_Model_Job t");
        $query->where("post_id = ?", get_the_ID());
        $query->limit(1);
        $result = $query->execute();
        if (isset($result[0])) {
            $job = $result[0];
        }
    }
    if (is_wpjb() && wpjb_is_routed_to("index.single")) {
        $job = Wpjb_Project::getInstance()->placeHolder->job;
    }
    if ($job === null) {
        return;
    }
    $old = wpjb_conf("front_mark_as_old");
    if ($old > 0 && time() - strtotime($job->job_created_at) > $old * 3600 * 24) {
        $diff = floor((time() - strtotime($job->job_created_at)) / (3600 * 24));
        $msg = _n("Attention! This job posting is one day old and might be already filled.", "Attention! This job posting is %d days old and might be already filled.", $diff, "wpjobboard");
        $flash = new Wpjb_Utility_Session();
        $flash->addInfo(sprintf($msg, $diff));
        $flash->save();
    }
}
Пример #10
0
 public function __construct()
 {
     $this->_context = Wpjb_Project::getInstance();
     $this->_viewAdmin = "recently-viewed.php";
     $this->_viewFront = "recently-viewed.php";
     parent::__construct("wpjb-recently-viewed", __("Recently Viewed", WPJB_DOMAIN), array("description" => __("Recently viewed jobs list.", WPJB_DOMAIN)));
 }
Пример #11
0
 public function __construct()
 {
     $this->_context = Wpjb_Project::getInstance();
     $this->_viewAdmin = "recent-jobs.php";
     $this->_viewFront = "recent-jobs.php";
     parent::__construct("wpjb-recent-jobs", __("Recent Jobs", WPJB_DOMAIN), array("description" => __("Displays list of recently posted jobs", WPJB_DOMAIN)));
 }
Пример #12
0
 public function init()
 {
     $this->name = __("Resumes Settings", WPJB_DOMAIN);
     $instance = Wpjb_Project::getInstance();
     $e = new Daq_Form_Element("cv_enabled", Daq_Form_Element::TYPE_CHECKBOX);
     $e->setValue($instance->getConfig("cv_enabled"));
     $e->setLabel(__("Enable 'Resumes' Module", WPJB_DOMAIN));
     $e->setHint(__("If NOT checked, users won't be able to post resumes and employers won't be able to browse them", WPJB_DOMAIN));
     $e->addFilter(new Daq_Filter_Int());
     $e->addOption(1, 1, "Yes");
     $this->addElement($e);
     $e = new Daq_Form_Element("cv_access", Daq_Form_Element::TYPE_SELECT);
     $e->setValue($instance->getConfig("cv_access"));
     $e->setLabel(__("Grant Resumes Access", WPJB_DOMAIN));
     $e->setHint(__("Note that automatically activating employer accounts might cause, potential security issue for employers since anyone will be able to browse their personal data", WPJB_DOMAIN));
     $e->addFilter(new Daq_Filter_Int());
     $e->addOption(1, 1, __("To all", WPJB_DOMAIN));
     $e->addOption(4, 4, __("To registered members", WPJB_DOMAIN));
     $e->addOption(2, 2, __("To activated employers", WPJB_DOMAIN));
     $e->addOption(3, 3, __("To premium employers", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("cv_privacy", Daq_Form_Element::TYPE_SELECT);
     $e->setValue($instance->getConfig("cv_privacy"));
     $e->setLabel(__("Resumes Privacy", WPJB_DOMAIN));
     $e->addOption(0, 0, __("Hide contact details only.", WPJB_DOMAIN));
     $e->addOption(1, 1, __("Hide resume list and details", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("cv_approval", Daq_Form_Element::TYPE_SELECT);
     $e->setValue($instance->getConfig("cv_approval"));
     $e->setLabel(__("Resumes Approval", WPJB_DOMAIN));
     $e->setHint("");
     $e->addValidator(new Daq_Validate_InArray(array(0, 1)));
     $e->addOption(0, 0, __("Instant", WPJB_DOMAIN));
     $e->addOption(1, 1, __("By Administrator", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("cv_access_cost");
     $e->setValue($instance->getConfig("cv_access_cost"));
     $e->setLabel(__("Resumes Access Cost", WPJB_DOMAIN));
     $e->setHint(__("How much do you want to charge premium members.", WPJB_DOMAIN));
     $e->addFilter(new Daq_Filter_Float());
     $e->addValidator(new Daq_Validate_Float(0));
     $this->addElement($e);
     $e = new Daq_Form_Element("cv_access_curr", Daq_Form_Element::TYPE_SELECT);
     $e->setValue($instance->getConfig("cv_access_curr"));
     $e->setLabel(__("Resumes Cost Currency", WPJB_DOMAIN));
     $e->setHint(__("Currency for 'Resumes Access Cost'", WPJB_DOMAIN));
     foreach ($this->_currArr() as $c) {
         $e->addOption($c[0], $c[1], $c[2]);
     }
     $this->addElement($e);
     $e = new Daq_Form_Element("cv_extend");
     $e->setValue($instance->getConfig("cv_extend"));
     $e->setLabel(__("Grant Access", WPJB_DOMAIN));
     $e->setHint(__("Number of days premium member will have access to resumes after purchase.", WPJB_DOMAIN));
     $e->addFilter(new Daq_Filter_Int());
     $e->addValidator(new Daq_Validate_Int(0));
     $this->addElement($e);
     apply_filters("wpja_form_init_config_resume", $this);
 }
Пример #13
0
 public function init()
 {
     $this->_virtual = array("editAction" => array("form" => "Wpjb_Form_Admin_Company", "info" => __("Form saved.", WPJB_DOMAIN), "error" => __("There are errors in your form.", WPJB_DOMAIN)), "_multi" => array("activate" => array("success" => __("Number of activated employer accounts: {success}", WPJB_DOMAIN)), "deactivate" => array("success" => __("Number of deactivated employer accounts: {success}", WPJB_DOMAIN))));
     if (Wpjb_Project::getInstance()->conf("cv_access") == 2) {
         $this->_virtual['_multi']['approve'] = array('success' => __("Number of approved employer accounts: {success}", WPJB_DOMAIN));
         $this->_virtual['_multi']['decline'] = array('success' => __("Number of declined employer accounts: {success}", WPJB_DOMAIN));
     }
 }
Пример #14
0
 public function getPage()
 {
     if (!is_null($this->_link)) {
         return $this->_link;
     }
     $this->_link = get_post(Wpjb_Project::getInstance()->conf("link_resumes"));
     return $this->_link;
 }
Пример #15
0
 public static function search($query, $category, $degree, $experience, $posted, $count, $page)
 {
     $select = new Daq_Db_Query();
     $select->select()->from("Wpjb_Model_Resume t1")->join("t1.users t2")->where("is_active = 1")->order("updated_at DESC");
     if (Wpjb_Project::getInstance()->conf("cv_approval") == 1) {
         $select->where("is_approved = ?", Wpjb_Model_Resume::RESUME_APPROVED);
     }
     if ($query) {
         $search = $query;
         $q = "MATCH(title, headline, experience, education)";
         $q .= "AGAINST (? IN BOOLEAN MODE)";
         $select->where($q, $search);
     }
     if (is_array($category)) {
         $category = array_map("intval", $category);
         $select->where("category_id IN (?)", join(",", $category));
     } elseif ($category) {
         $select->where("category_id = ?", $category);
     }
     if (is_array($degree)) {
         $degree = array_map("intval", $degree);
         $select->where("category_id IN (?)", join(",", $degree));
     } elseif ($degree) {
         $select->where("degree = ?", $degree);
     }
     if (is_array($experience)) {
         $experience = array_map("intval", $experience);
         $select->where("category_id IN (?)", join(",", $experience));
     } elseif ($experience) {
         $select->where("years_experience = ?", $experience);
     }
     if ($posted) {
         $days = posted;
         if ($days == 1) {
             $time = date("Y-m-d");
             $select->where("DATE(updated_at) = ?", date("Y-m-d"));
         } elseif ($days == 2) {
             $time = date("Y-m-d", strtotime("yesterday"));
             $select->where("DATE(updated_at) = ?", date("Y-m-d", strtotime("now -1 day")));
         } else {
             $select->where("updated_at >= DATE_SUB(NOW(), INTERVAL ? DAY)", (int) $days);
         }
     }
     $itemsFound = $select->select("COUNT(*) AS cnt")->fetchColumn();
     $select->select("*");
     if ($count > 0) {
         $select->limitPage($page, $count);
     }
     $list = $select->execute();
     $response = new stdClass();
     $response->resume = $list;
     $response->page = (int) $page;
     $response->perPage = (int) $count;
     $response->count = count($list);
     $response->total = (int) $itemsFound;
     return $response;
 }
Пример #16
0
 public function editAction()
 {
     $section = $this->_request->getParam("section");
     $this->view->section = $section;
     $fArr = array("payment", "posting", "frontend", "seo", "integration", "resume");
     $fList = array();
     if ($section === null || !in_array($section, $fArr)) {
         foreach ($fArr as $key) {
             $class = "Wpjb_Form_Admin_Config_" . ucfirst($key);
             $fList[$key] = new $class();
         }
     } else {
         $class = "Wpjb_Form_Admin_Config_" . ucfirst($section);
         $fList[$section] = new $class();
     }
     if ($this->isPost() && apply_filters("_wpjb_can_save_config", $this)) {
         $isValid = true;
         foreach ($fList as $k => $obj) {
             if (!$obj->isValid($this->_request->getAll())) {
                 $isValid = false;
             }
             $fList[$k] = $obj;
         }
         if ($isValid) {
             $instance = Wpjb_Project::getInstance();
             foreach ($fList as $k => $obj) {
                 // @todo: save config
                 foreach ($obj->getValues() as $k => $v) {
                     $instance->setConfigParam($k, $v);
                 }
             }
             $instance->saveConfig();
             $this->_addInfo(__("Configuration saved.", WPJB_DOMAIN));
         } else {
             $this->_addError(__("There are errors in the form.", WPJB_DOMAIN));
         }
     }
     if ($this->_request->getParam("saventest")) {
         $list = new Daq_Db_Query();
         $list->select("*");
         $list->from("Wpjb_Model_Job t");
         $list->limit(1);
         $result = $list->execute();
         if (empty($result)) {
             $this->_addError(__("Twitter: You need to have at least one posted job to send test tweet.", WPJB_DOMAIN));
         } else {
             $job = $result[0];
             try {
                 Wpjb_Service_Twitter::tweet($job);
                 $this->_addInfo(__("Tweet has been posted, please check your Twitter account.", WPJB_DOMAIN));
             } catch (Exception $e) {
                 $this->_addError($e->getMessage());
             }
         }
     }
     $this->view->fList = $fList;
 }
Пример #17
0
 public function getCount()
 {
     $count = Wpjb_Project::getInstance()->conf("count", array("category" => array()));
     $count = $count["category"];
     if (!array_key_exists($this->getId(), $count)) {
         return null;
     }
     return $count[$this->getId()];
 }
Пример #18
0
 public function widget($args, $instance)
 {
     $view = Wpjb_Project::getInstance()->env("template_base") . "/widget";
     $this->view = new Daq_View($view);
     $this->view->theme = (object) $args;
     $this->view->title = apply_filters('widget_title', $instance['title']);
     $this->view->param = (object) $instance;
     $this->_filter();
     $this->view->render($this->_viewFront);
 }
Пример #19
0
 public function execute()
 {
     $this->_sql($this->getVersion());
     $project = Wpjb_Project::getInstance();
     $project->setConfigParam("show_maps", true);
     $project->saveConfig();
     foreach (array("frontend", "resumes") as $sc) {
         $app = Wpjb_Project::getInstance()->getApplication($sc);
         wp_update_post(array("ID" => $app->getPage()->ID, "post_content" => $app->getOption("shortcode")));
     }
 }
Пример #20
0
 public static function shorten($url)
 {
     $query = array("version" => "2.0.1", "longUrl" => $url, "login" => Wpjb_Project::getInstance()->conf("api_bitly_login"), "apiKey" => Wpjb_Project::getInstance()->conf("api_bitly_key"));
     $query = http_build_query($query);
     $response = self::_download(self::API_URL . "shorten?" . $query);
     $response = json_decode($response);
     if ($response->errorCode == 0 && $response->statusCode == "OK") {
         return $response->results->{$url}->shortUrl;
     } else {
         throw new Exception("Bit.ly API: " . $response->errorMessage);
     }
 }
Пример #21
0
 public function execute()
 {
     $config = Wpjb_Project::getInstance();
     $config->setConfigParam("api_twitter_username", "");
     $config->setConfigParam("api_twitter_password", "");
     $config->saveConfig();
     $db = Daq_Db::getInstance()->getDb();
     $db->query("DELETE FROM `wpjb_field_value` WHERE (SELECT `wpjb_job`.`id` FROM `wpjb_job` WHERE `wpjb_job`.`id`=`job_id` LIMIT 1) IS NULL");
     $db->query("ALTER TABLE `wpjb_field_value` ADD FOREIGN KEY ( `job_id` ) REFERENCES `wpjb_job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE");
     // SELECT wpjb_field_value.id, wpjb_job.id FROM `wpjb_field_value` LEFT JOIN `wpjb_job` ON `wpjb_job`.`id`=`job_id`
     return;
 }
Пример #22
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);
 }
Пример #23
0
 public function init()
 {
     $this->addGroup("apply", "Apply");
     $e = new Daq_Form_Element("applicant_name", Daq_Form_Element::TYPE_TEXT);
     $e->addFilter(new Daq_Filter_Trim());
     $e->setLabel(__("Your name", WPJB_DOMAIN));
     $e->setRequired(true);
     $this->addElement($e, "apply");
     $e = new Daq_Form_Element("email", Daq_Form_Element::TYPE_TEXT);
     $e->setLabel(__("Your e-mail address", WPJB_DOMAIN));
     $e->setRequired(true);
     $e->addValidator(new Daq_Validate_Email());
     $this->addElement($e, "apply");
     $e = new Daq_Form_Element_File("cv_file", Daq_Form_Element::TYPE_FILE);
     $e->setDestination(Wpjb_List_Path::getPath("apply_file"));
     $e->setLabel(__("Your CV file", WPJB_DOMAIN));
     $this->addElement($e, "apply");
     $resume = Wpjb_Model_Resume::current();
     $isEmp = get_user_meta(wp_get_current_user()->ID, "is_employer", true);
     if ($resume->id > 0 && !$isEmp || is_admin()) {
         $e = new Daq_Form_Element("resume_id", Daq_Form_Element::TYPE_CHECKBOX);
         $e->setLabel(__("Send my profile resume", WPJB_DOMAIN));
         $id = $resume->id;
         $e->addOption($id, $id, "");
         $e->addValidator(new Daq_Validate_InArray(array($id)));
         $this->addElement($e, "apply");
     }
     $e = new Daq_Form_Element("resume", Daq_Form_Element::TYPE_TEXTAREA);
     $e->setLabel(__("Your resume/message", WPJB_DOMAIN));
     $this->addElement($e, "apply");
     $this->_additionalFields();
     if (Wpjb_Project::getInstance()->conf("front_enable_protection") == 1) {
         $e = new Daq_Form_Element("protection", Daq_Form_Element::TYPE_HIDDEN);
         $e->addValidator(new Daq_Validate_InArray(array(Wpjb_Project::getInstance()->conf("front_protection", "pr0t3ct1on"))));
         $e->setRequired(true);
         $this->addElement($e, "hidden");
     } elseif (Wpjb_Project::getInstance()->conf("front_enable_protection") == 2) {
         $e = new Daq_Form_Element("recaptcha_response_field");
         $e->setRequired(true);
         $e->addValidator(new Daq_Validate_Callback("wpjb_recaptcha_check"));
         $e->setRenderer("wpjb_recaptcha_form");
         $e->setLabel(__("Captcha", WPJB_DOMAIN));
         $this->addElement($e, "apply");
     }
     apply_filters("wpjb_form_init_apply", $this);
     $this->setModifiedScheme(Wpjb_Project::getInstance()->conf("form_apply_for_job", true));
 }
Пример #24
0
 private function _handle($form, $param)
 {
     $this->_forced($form);
     if ($this->isPost() && $this->hasParam("reset")) {
         $conf = Wpjb_Project::getInstance();
         $conf->setConfigParam($param, null);
         $conf->saveConfig();
         $this->view->_flash->addInfo(__("Form layout has been reseted.", WPJB_DOMAIN));
     } elseif ($this->isPost()) {
         $conf = Wpjb_Project::getInstance();
         $conf->setConfigParam($param, $this->_getGroup());
         $conf->saveConfig();
         $this->view->_flash->addInfo(__("Form layout has been saved.", WPJB_DOMAIN));
     }
     $form = new $form(null, false);
     $this->view->scheme = $form->getFinalScheme();
     //print_r($this->view->scheme);
 }
Пример #25
0
 public function save()
 {
     $file = null;
     if ($this->hasElement("company_logo")) {
         $file = $this->getElement("company_logo");
     }
     $valueList = $this->getValues();
     parent::save();
     $this->_saveAdditionalFields($valueList);
     $this->_additionalFields();
     $baseDir = Wpjb_Project::getInstance()->getProjectBaseDir();
     if ($file && $file->fileSent()) {
         $file->setDestination($baseDir . "/environment/images/");
         $file->upload("job_" . $this->getObject()->getId() . "." . $file->getExt());
     }
     apply_filters("wpja_form_save_addjob", $this);
     $this->reinit();
 }
Пример #26
0
 public static function render()
 {
     $list = new Daq_Db_Query();
     $list->select("t.payment_currency as curr");
     $list->from("Wpjb_Model_Payment t");
     $list->where("payment_paid > 0");
     $list->group("payment_currency");
     $result = $list->fetchAll();
     $curr = array();
     foreach ($result as $r) {
         $c = Wpjb_List_Currency::getCurrency($r->curr);
         $curr[$r->curr] = $c["name"];
     }
     $view = Wpjb_Project::getInstance()->getAdmin()->getView();
     /* @var $view  Daq_View */
     $view->currency = $curr;
     $view->render("dashboard/stats.php");
 }
Пример #27
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);
 }
Пример #28
0
 protected static function _send($msg)
 {
     $path = Wpjb_List_Path::getPath("vendor");
     require_once $path . "/TwitterOAuth/OAuth.php";
     require_once $path . "/TwitterOAuth/TwitterOAuth.php";
     //$user = Wpjb_Project::getInstance()->conf("api_twitter_username");
     //$pass = Wpjb_Project::getInstance()->conf("api_twitter_password");
     $ck = Wpjb_Project::getInstance()->conf("api_twitter_consumer_key");
     $cs = Wpjb_Project::getInstance()->conf("api_twitter_consumer_secret");
     $ot = Wpjb_Project::getInstance()->conf("api_twitter_oauth_token");
     $os = Wpjb_Project::getInstance()->conf("api_twitter_oauth_secret");
     $connection = new TwitterOAuth($ck, $cs, $ot, $os);
     $content = $connection->get('account/verify_credentials');
     if (isset($content->error)) {
         throw new Exception($content->error);
     }
     $connection->post('statuses/update', array('status' => $msg));
     return null;
 }
Пример #29
0
 public function init()
 {
     $this->name = __("Integrations", WPJB_DOMAIN);
     $instance = Wpjb_Project::getInstance();
     $e = new Daq_Form_Element("api_cb_key");
     $e->setValue($instance->getConfig("api_cb_key"));
     $e->setLabel(__("Career Builder API Key", WPJB_DOMAIN));
     $e->setHint(__("Claim your key at http://api.careerbuilder.com/RequestDevKey.aspx, It's required to use Import feature", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("indeed_publisher");
     $e->setValue($instance->getConfig("indeed_publisher"));
     $e->setLabel(__("Indeed Publisher API Key", WPJB_DOMAIN));
     $e->setHint(__("Claim your key at https://ads.indeed.com/jobroll/, It's required to use Indeed Import", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("api_twitter_consumer_key");
     $e->setValue($instance->getConfig("api_twitter_consumer_key"));
     $e->setLabel(__("Twitter Consumer Key", WPJB_DOMAIN));
     $e->setHint(__("You must configure both Twitter and Bit.ly in order to automatically post jobs to Twitter", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("api_twitter_consumer_secret");
     $e->setValue($instance->getConfig("api_twitter_consumer_secret"));
     $e->setLabel(__("Twitter Consumer Secret", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("api_twitter_oauth_token");
     $e->setValue($instance->getConfig("api_twitter_oauth_token"));
     $e->setLabel(__("Twitter OAuth Token", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("api_twitter_oauth_secret");
     $e->setValue($instance->getConfig("api_twitter_oauth_secret"));
     $e->setLabel(__("Twitter OAuth Secret", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("api_bitly_login");
     $e->setValue($instance->getConfig("api_bitly_login"));
     $e->setLabel(__("Bit.ly Login", WPJB_DOMAIN));
     $e->setHint(__("Bit.ly is an URL shortening service", WPJB_DOMAIN));
     $this->addElement($e);
     $e = new Daq_Form_Element("api_bitly_key");
     $e->setValue($instance->getConfig("api_bitly_key"));
     $e->setLabel(__("Bit.ly API Key", WPJB_DOMAIN));
     $this->addElement($e);
     apply_filters("wpja_form_init_config_integration", $this);
 }
Пример #30
0
 public function init()
 {
     $this->name = __("Payment Settings", WPJB_DOMAIN);
     $this->_env = array(1 => __("Sandbox (For testing only)", WPJB_DOMAIN), 2 => __("Production (Real money)", WPJB_DOMAIN));
     $instance = Wpjb_Project::getInstance();
     $e = new Daq_Form_Element("paypal_email");
     $e->setValue($instance->getConfig("paypal_email"));
     $e->setLabel(__("PayPal eMail", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_Email());
     $this->addElement($e);
     $e = new Daq_Form_Element("paypal_env", Daq_Form_Element::TYPE_SELECT);
     $e->setValue($instance->getConfig("paypal_env"));
     $e->setLabel(__("PayPal Environment", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_InArray(array_keys($this->_env)));
     foreach ($this->_env as $k => $v) {
         $e->addOption($k, $k, $v);
     }
     $this->addElement($e);
     apply_filters("wpja_form_init_config_payment", $this);
 }