Exemplo n.º 1
0
 public function init()
 {
     $this->addGroup("auth", __("User Account", WPJB_DOMAIN));
     $this->addGroup("default", __("Company", WPJB_DOMAIN));
     $this->addGroup("location", __("Location", WPJB_DOMAIN));
     $e = new Daq_Form_Element("user_login", Daq_Form_Element::TYPE_TEXT);
     $e->setLabel(__("Username", WPJB_DOMAIN));
     $e->setRequired(true);
     $e->addFilter(new Daq_Filter_Trim());
     $e->addFilter(new Daq_Filter_WP_SanitizeUser());
     $e->addValidator(new Daq_Validate_WP_Username());
     $this->addElement($e, "auth");
     $e = new Daq_Form_Element("user_password", Daq_Form_Element::TYPE_PASSWORD);
     $e->setLabel(__("Password", WPJB_DOMAIN));
     $e->addFilter(new Daq_Filter_Trim());
     $e->addValidator(new Daq_Validate_StringLength(4, 32));
     $e->addValidator(new Daq_Validate_PasswordEqual("user_password2"));
     $e->setRequired(true);
     $this->addElement($e, "auth");
     $e = new Daq_Form_Element("user_password2", Daq_Form_Element::TYPE_PASSWORD);
     $e->setLabel(__("Password (repeat)", WPJB_DOMAIN));
     $e->setRequired(true);
     $this->addElement($e, "auth");
     $e = new Daq_Form_Element("user_email", Daq_Form_Element::TYPE_TEXT);
     $e->setLabel(__("E-mail", WPJB_DOMAIN));
     $e->addFilter(new Daq_Filter_Trim());
     $e->addValidator(new Daq_Validate_WP_Email());
     $e->setRequired(true);
     $this->addElement($e, "auth");
     $e = new Daq_Form_Element("company_name");
     $e->setLabel(__("Company name", WPJB_DOMAIN));
     $e->setRequired(true);
     $e->addFilter(new Daq_Filter_Trim());
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("company_website");
     $e->setLabel(__("Company website", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_Url());
     $e->addFilter(new Daq_Filter_WP_Url());
     $e->addFilter(new Daq_Filter_Trim());
     $this->addElement($e, "default");
     $e = new Daq_Form_Element_File("company_logo", Daq_Form_Element::TYPE_FILE);
     $e->setLabel(__("Company Logo", WPJB_DOMAIN));
     $e->setHint(__("Max. file size 30 kB. Image size 300x100 px. File formats *.jpg; *.gif; *.png .", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_File_Default());
     $e->addValidator(new Daq_Validate_File_Ext("jpg,jpeg,gif,png"));
     $e->addValidator(new Daq_Validate_File_Size(30000));
     $e->addValidator(new Daq_Validate_File_ImageSize(300, 100));
     //$this->addElement($e, "default");
     $e = new Daq_Form_Element("company_info", Daq_Form_Element::TYPE_TEXTAREA);
     $e->setLabel(__("Company info", WPJB_DOMAIN));
     $e->setRequired(true);
     $e->addFilter(new Daq_Filter_Trim());
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("is_public", Daq_Form_Element::TYPE_CHECKBOX);
     $e->setLabel(__("Publish Profile", WPJB_DOMAIN));
     $e->addOption(1, 1, __("Allow job seekers to view company profile", WPJB_DOMAIN));
     $e->setValue($this->_object->is_public);
     $e->addFilter(new Daq_Filter_Int());
     $this->addElement($e, "default");
     $def = wpjb_locale();
     $e = new Daq_Form_Element("company_country", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Company Country", WPJB_DOMAIN));
     $e->setValue($this->_object->company_country ? $this->_object->company_country : $def);
     foreach (Wpjb_List_Country::getAll() as $listing) {
         $e->addOption($listing['code'], $listing['code'], $listing['name']);
     }
     $e->addClass("wpjb-location-country");
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("company_state");
     $e->setLabel(__("Company State", WPJB_DOMAIN));
     $e->setValue($this->_object->company_state);
     $e->addClass("wpjb-location-state");
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("company_zip_code");
     $e->setLabel(__("Company Zip-Code", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_StringLength(null, 20));
     $e->setValue($this->_object->company_zip_code);
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("company_location");
     $e->setLabel(__("Company Location", WPJB_DOMAIN));
     $e->setValue($this->_object->company_location);
     $e->addClass("wpjb-location-city");
     $this->addElement($e, "location");
     apply_filters("wpjb_form_init_register", $this);
 }
Exemplo n.º 2
0
 public function init()
 {
     $this->addGroup("default", __("Personal Information", WPJB_DOMAIN));
     $this->addGroup("resume", __("Resume", WPJB_DOMAIN));
     $this->addGroup("fields", __("Additional Fields", WPJB_DOMAIN));
     $e = new Daq_Form_Element("firstname");
     $e->setLabel(__("First Name", WPJB_DOMAIN));
     $e->setRequired(true);
     $e->setValue($this->_object->firstname);
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("lastname");
     $e->setLabel(__("Last Name", WPJB_DOMAIN));
     $e->setRequired(true);
     $e->setValue($this->_object->lastname);
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("country", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Country", WPJB_DOMAIN));
     $e->setValue($this->_object->country ? $this->_object->country : wpjb_locale());
     foreach (Wpjb_List_Country::getAll() as $listing) {
         $e->addOption($listing['code'], $listing['code'], $listing['name']);
     }
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("address");
     $e->setValue($this->_object->address);
     $e->setLabel(__("Address", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_StringLength(null, 250));
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("email");
     $e->setRequired(true);
     $e->setLabel(__("Email Address", WPJB_DOMAIN));
     $e->setHint(__('This field will be shown only to registered employers.', WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_Email());
     $e->setValue($this->_object->email);
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("phone");
     $e->setLabel(__("Phone Number", WPJB_DOMAIN));
     $e->setHint(__('This field will be shown only to registered employers.', WPJB_DOMAIN));
     $e->setValue($this->_object->phone);
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("website");
     $e->setLabel(__("Website", WPJB_DOMAIN));
     $e->setHint(__('This field will be shown only to registered employers.', WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_Url());
     $e->setValue($this->_object->website);
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("is_active", Daq_Form_Element::TYPE_CHECKBOX);
     $e->setLabel(__("Is Resume Active", WPJB_DOMAIN));
     $e->setHint(__("If resume is inactive employers won't find you search results.", WPJB_DOMAIN));
     $e->addOption(1, 1, __("Yes", WPJB_DOMAIN));
     $e->setValue($this->_object->is_active);
     $e->addFilter(new Daq_Filter_Int());
     $this->addElement($e, "default");
     $e = new Daq_Form_Element_File("image", Daq_Form_Element::TYPE_FILE);
     $e->setLabel(__("Your Photo", WPJB_DOMAIN));
     $e->setHint(__("Max. file size 30 kB. Image size 100x100 px. File formats *.jpg; *.gif; *.png .", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_File_Default());
     $e->addValidator(new Daq_Validate_File_Ext("jpg,jpeg,gif,png"));
     $e->addValidator(new Daq_Validate_File_Size(30000));
     $e->addValidator(new Daq_Validate_File_ImageSize(100, 100));
     $this->addElement($e, "default");
     $e = new Daq_Form_Element_File("file", Daq_Form_Element::TYPE_FILE);
     $e->setLabel(__("File", WPJB_DOMAIN));
     $e->setHint(__("Allowed Formats: pdf; doc; docx; rtf; txt.", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_File_Default());
     $e->addValidator(new Daq_Validate_File_Ext("pdf,doc,docx,rtf,txt"));
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("title");
     $e->setLabel(__("Professional Headline", WPJB_DOMAIN));
     $e->setHint(__("Describe yourself in few words, for example: Experienced Web Developer", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_StringLength(1, 120));
     $e->setValue($this->_object->title);
     $this->addElement($e, "resume");
     $e = new Daq_Form_Element("category_id", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Category", WPJB_DOMAIN));
     $e->setValue($this->_object->category_id);
     $e->addValidator(new Daq_Validate_Db_RecordExists("Wpjb_Model_Category", "id"));
     foreach ($this->_getCategoryArr() as $category) {
         $e->addOption($category->id, $category->id, $category->title);
     }
     $this->addElement($e, "resume");
     $e = new Daq_Form_Element("headline", Daq_Form_Element::TYPE_TEXTAREA);
     $e->setLabel(__("Profile Summary", WPJB_DOMAIN));
     $e->setHint(__("Use this field to list your skills, specialities, experience or goals", WPJB_DOMAIN));
     $e->setValue($this->_object->headline);
     $this->addElement($e, "resume");
     $e = new Daq_Form_Element("years_experience", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Experience Summary", WPJB_DOMAIN));
     $e->setValue($this->_object->years_experience);
     foreach (self::getExperience() as $k => $v) {
         $e->addOption($k, $k, $v);
     }
     $this->addElement($e, "resume");
     $e = new Daq_Form_Element("experience", Daq_Form_Element::TYPE_TEXTAREA);
     $e->setLabel(__("Experience", WPJB_DOMAIN));
     $e->setHint(__("List companies you worked for (remember to include: company name, time period, your position and job description)", WPJB_DOMAIN));
     $e->setValue($this->_object->experience);
     $this->addElement($e, "resume");
     $e = new Daq_Form_Element("degree", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Degree", WPJB_DOMAIN));
     $e->setValue($this->_object->degree);
     foreach (self::getDegrees() as $k => $v) {
         $e->addOption($k, $k, $v);
     }
     $this->addElement($e, "resume");
     $e = new Daq_Form_Element("education", Daq_Form_Element::TYPE_TEXTAREA);
     $e->setLabel(__("Education", WPJB_DOMAIN));
     $e->setHint(__("Your education, describe schools you attended, time period, degree and fields of study", WPJB_DOMAIN));
     $e->setValue($this->_object->education);
     $this->addElement($e, "resume");
     if (self::$mode == self::MODE_ADMIN) {
         $e = new Daq_Form_Element("is_approved", Daq_Form_Element::TYPE_SELECT);
         $e->setLabel(__("Resume Status", WPJB_DOMAIN));
         $e->addOption(Wpjb_Model_Resume::RESUME_PENDING, Wpjb_Model_Resume::RESUME_PENDING, __("Pending Approval", WPJB_DOMAIN));
         $e->addOption(Wpjb_Model_Resume::RESUME_DECLINED, Wpjb_Model_Resume::RESUME_DECLINED, __("Declined", WPJB_DOMAIN));
         $e->addOption(Wpjb_Model_Resume::RESUME_APPROVED, Wpjb_Model_Resume::RESUME_APPROVED, __("Approved", WPJB_DOMAIN));
         $e->setValue($this->_object->is_approved);
         $e->addFilter(new Daq_Filter_Int());
         $this->addElement($e, "admin");
     }
     $this->_additionalFields();
     apply_filters("wpja_form_init_resume", $this);
     $this->setModifiedScheme(Wpjb_Project::getInstance()->conf("form_admin_resume", true));
 }
Exemplo n.º 3
0
 public function init()
 {
     $this->addGroup("default", __("Company", WPJB_DOMAIN));
     $this->addGroup("location", __("Location", WPJB_DOMAIN));
     $e = new Daq_Form_Element("company_name");
     $e->setLabel(__("Company Name", WPJB_DOMAIN));
     $e->setRequired(true);
     $e->setValue($this->_object->company_name);
     $this->addElement($e, "default");
     $e = new Daq_Form_Element_File("company_logo", Daq_Form_Element::TYPE_FILE);
     $e->setLabel(__("Company Logo", WPJB_DOMAIN));
     $e->setHint(__("Max. file size 30 kB. Image size 300x100 px. File formats *.jpg; *.gif; *.png .", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_File_Default());
     $e->addValidator(new Daq_Validate_File_Ext("jpg,jpeg,gif,png"));
     $e->addValidator(new Daq_Validate_File_Size(30000));
     $e->addValidator(new Daq_Validate_File_ImageSize(300, 100));
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("company_website");
     $e->setLabel(__("Company Website", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_Url());
     $e->addFilter(new Daq_Filter_WP_Url());
     $e->setValue($this->_object->company_website);
     $this->addElement($e, "default");
     $e = new Daq_Form_Element("company_info", Daq_Form_Element::TYPE_TEXTAREA);
     $e->setLabel(__("Company Info", WPJB_DOMAIN));
     $eDesc = str_replace('{tags}', '<p><a><b><strong><em><i><ul><li><h3><h4><br>', __("Use this field to describe your company profile (what you do, company size etc). Only {tags} HTML tags are allowed", WPJB_DOMAIN));
     $e->setHint($eDesc);
     $e->setValue($this->_object->company_info);
     $this->addElement($e, "default");
     $def = wpjb_locale();
     $e = new Daq_Form_Element("company_country", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Company Country", WPJB_DOMAIN));
     $e->setValue($this->_object->company_country ? $this->_object->company_country : $def);
     foreach (Wpjb_List_Country::getAll() as $listing) {
         $e->addOption($listing['code'], $listing['code'], $listing['name']);
     }
     $e->addClass("wpjb-location-country");
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("company_state");
     $e->setLabel(__("Company State", WPJB_DOMAIN));
     $e->setValue($this->_object->company_state);
     $e->addClass("wpjb-location-state");
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("company_zip_code");
     $e->setLabel(__("Company Zip-Code", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_StringLength(null, 20));
     $e->setValue($this->_object->company_zip_code);
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("company_location");
     $e->setLabel(__("Company Location", WPJB_DOMAIN));
     $e->setValue($this->_object->company_location);
     $e->addClass("wpjb-location-city");
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("is_public", Daq_Form_Element::TYPE_CHECKBOX);
     $e->setLabel(__("Publish Profile", WPJB_DOMAIN));
     $e->addOption(1, 1, __("Allow job seekers to view company profile", WPJB_DOMAIN));
     $e->setValue($this->_object->is_public);
     $e->addFilter(new Daq_Filter_Int());
     $this->addElement($e, "default");
     if ($this->_mode != self::MODE_ADMIN) {
         return;
     }
     $e = new Daq_Form_Element("slug");
     $e->setRequired(true);
     $e->setValue($this->_object->slug);
     $e->setLabel("Company Slug");
     $e->setHint("The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.");
     $e->addValidator(new Daq_Validate_Slug());
     $e->addValidator(new Daq_Validate_Db_NoRecordExists("Wpjb_Model_Employer", "slug", $this->_exclude()));
     //$this->addElement($e, "manage");
     $e = new Daq_Form_Element("is_active", Daq_Form_Element::TYPE_CHECKBOX);
     $e->setLabel(__("Is Active", WPJB_DOMAIN));
     $e->setHint(__("Activates company account", WPJB_DOMAIN));
     $e->addOption(1, 1, __("Yes", WPJB_DOMAIN));
     $e->setValue($this->_object->is_active);
     $e->addFilter(new Daq_Filter_Int());
     $this->addElement($e, "default");
     apply_filters("wpja_form_init_company", $this);
 }
Exemplo n.º 4
0
 public function init()
 {
     $this->addGroup("company", __("Company Information", WPJB_DOMAIN));
     $this->addGroup("job", __("Job Information", WPJB_DOMAIN));
     $this->addGroup("fields", __("Additional Fields", WPJB_DOMAIN));
     $this->addGroup("location", __("Location", WPJB_DOMAIN));
     $this->addGroup("coupon", __("Coupon", WPJB_DOMAIN));
     $e = new Daq_Form_Element("company_name");
     $e->setRequired(true);
     $e->setLabel(__("Company Name", WPJB_DOMAIN));
     $e->setValue($this->_object->company_name);
     $this->addElement($e, "company");
     $e = new Daq_Form_Element("company_email");
     $e->setRequired(true);
     $e->setLabel(__("Company Email", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_Email());
     $e->setValue($this->_object->company_email);
     $this->addElement($e, "company");
     $e = new Daq_Form_Element("company_website");
     $e->setLabel(__("Company Website", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_Url());
     $e->addFilter(new Daq_Filter_WP_Url());
     $e->setValue($this->_object->company_website);
     $this->addElement($e, "company");
     $e = new Daq_Form_Element_File("company_logo", Daq_Form_Element::TYPE_FILE);
     $e->setLabel(__("Company Logo", WPJB_DOMAIN));
     $e->setHint(__("Max. file size 30 kB. Image size 300x100 px. File formats *.jpg; *.gif; *.png .", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_File_Default());
     $e->addValidator(new Daq_Validate_File_Ext("jpg,jpeg,gif,png"));
     $e->addValidator(new Daq_Validate_File_Size(30000));
     $e->addValidator(new Daq_Validate_File_ImageSize(300, 100));
     $e->setRenderer("wpjb_form_helper_logo_upload");
     $this->addElement($e, "company");
     $e = new Daq_Form_Element("id", Daq_Form_Element::TYPE_HIDDEN);
     $e->setValue($this->_object->id);
     $e->addFilter(new Daq_Filter_Int());
     $this->addElement($e, "job");
     $e = new Daq_Form_Element("job_type", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Job Type", WPJB_DOMAIN));
     $e->setValue($this->_object->job_type);
     $e->addValidator(new Daq_Validate_Db_RecordExists("Wpjb_Model_JobType", "id"));
     foreach ($this->_getTypeArr() as $type) {
         $e->addOption($type->id, $type->id, $type->title);
     }
     $this->addElement($e, "job");
     $e = new Daq_Form_Element("job_category", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Job Category", WPJB_DOMAIN));
     $e->setValue($this->_object->job_category);
     $e->addValidator(new Daq_Validate_Db_RecordExists("Wpjb_Model_Category", "id"));
     foreach ($this->_getCategoryArr() as $category) {
         $e->addOption($category->id, $category->id, $category->title);
     }
     $this->addElement($e, "job");
     $e = new Daq_Form_Element("job_title");
     $e->setRequired(true);
     $e->setLabel(__("Job Title", WPJB_DOMAIN));
     $e->setValue($this->_object->job_title);
     $e->addValidator(new Daq_Validate_StringLength(1, 120));
     $this->addElement($e, "job");
     $e = new Daq_Form_Element("job_description", Daq_Form_Element::TYPE_TEXTAREA);
     $e->setRequired(true);
     $e->setLabel(__("Job Description", WPJB_DOMAIN));
     $eDesc = str_replace('{tags}', '<p><a><b><strong><em><i><ul><li><h3><h4><br>', __("Only {tags} HTML tags are allowed", WPJB_DOMAIN));
     $e->addClass("wpjb-textarea-wide");
     $e->setHint($eDesc);
     $e->setValue($this->_object->job_description);
     $this->addElement($e, "job");
     $def = wpjb_locale();
     $e = new Daq_Form_Element("job_country", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Job Country", WPJB_DOMAIN));
     $e->setValue($this->_object->job_country ? $this->_object->job_country : $def);
     foreach (Wpjb_List_Country::getAll() as $listing) {
         $e->addOption($listing['code'], $listing['code'], $listing['name']);
     }
     $e->addClass("wpjb-location-country");
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("job_state");
     $e->setLabel(__("Job State", WPJB_DOMAIN));
     $e->setValue($this->_object->job_state);
     $e->addClass("wpjb-location-state");
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("job_zip_code");
     $e->setLabel(__("Job Zip-Code", WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_StringLength(null, 20));
     $e->setValue($this->_object->job_zip_code);
     $this->addElement($e, "location");
     $e = new Daq_Form_Element("job_location");
     $e->setValue($this->_object->job_location);
     $e->setRequired(true);
     $e->setLabel(__("Job City/Location", WPJB_DOMAIN));
     $e->setHint(__('For example: "Chicago", "London", "Anywhere" or "Telecommute".', WPJB_DOMAIN));
     $e->addValidator(new Daq_Validate_StringLength(null, 120));
     $e->addClass("wpjb-location-city");
     $this->addElement($e, "location");
     $this->_additionalFields();
 }