*/
require_once AWP_LIB_DIR . '/Plugin.php';
require_once AWP_INC_DIR . '/apptivo_services/jobApplicantDetails.php';
require_once AWP_INC_DIR . '/apptivo_services/appParam.php';
require_once AWP_INC_DIR . '/apptivo_services/jobDetails.php';
/**
* Class awp_jobsForms
*/
class AWP_Jobs extends AWP_Base
{
var $_plugin_activated = false;
/**
* PHP5 constructor
*/
function __construct()
{
$settings=array();
$this->_plugin_activated=false;
$settings=get_option("awp_plugins");
if(get_option("awp_plugins")!=="false"){
if($settings["jobs"])
$this->_plugin_activated=true;
}
}
/**
* Returns plugin instance
*
* @return awp_jobsForms
*/
function &instance()
{
static $instances = array();
if (!isset($instances[0])) {
$class = __CLASS__;
$instances[0] = & new $class();
}
return $instances[0];
}
/**
* Runs plugin
*/
function run()
{
if($this->_plugin_activated){
add_action( 'widgets_init',array(&$this, 'register_widget' )); //initialize widget
add_action('the_posts',array(&$this,'check_for_shortcode'));
add_shortcode('apptivo_job_applicantform',array(&$this,'jobapplicantform')); //Job applicant Form.
add_shortcode('apptivo_jobs',array(&$this,'listofjobs')); //List Of Jobs.
add_shortcode('apptivo_job_searchform',array(&$this,'jobsearchform'));//Job Search Form.
add_shortcode('apptivo_job_description',array(&$this,'jobdescription')); //Job description.
}
}
/**
* Registering widget
*
*/
function register_widget()
{
register_widget( 'JobSearch_Widget' ); // Job Search Form Widget.
register_widget( 'JobList_Widget' ); // Job Lists Widget.
}
/**
* Jobs Form shortcode handler
*/
function jobapplicantform($atts){
ob_start();
$jobidwith_Number = FALSE;
extract(shortcode_atts(array('name'=> ''), $atts));
$formname=trim($name);
$content="";
$successmsg="";
$hrjobsform=$this->get_jobapplicantform_fields($formname);
$status = array('0' => 'Approved', '1' => 'New');
$allJobs = getAllHrjobs(999,0,'false',$status)->jobDetails;
$allJobs = awp_convertObjToArray($allJobs);
$jobId = $_POST['jobId'];
$jobNo = $_POST['jobNo'];
if(!empty($hrjobsform[fields])) {
foreach($hrjobsform[fields] as $field){
if($field[fieldid]=="country"){
$countrylist = $this->getAllCountryList();
break;
}
}
}
$submitformname = $_POST['awp_jobsformname'];
if(isset($_POST['awp_jobsformname']) && $submitformname==$formname)
{
if(trim($jobId) == '' && isset($_POST['jobidwithnumber']))
{
$jobid_Number = $_POST['jobidwithnumber'];
$jobid_No = explode('::',$jobid_Number);
$jobId = $jobid_No[0];
$jobNo = $jobid_No[1];
$jobidwith_Number = TRUE;
}
$successmsg=$this->save_applicantjobs($submitformname,$jobId,$jobNo);
}
if($jobidwith_Number)
{
$jobId = '';
}
if(!empty($hrjobsform)){
include $hrjobsform['templatefile'];
} else { echo awp_messagelist('jobapplicant-form-display-page'); }
$content = ob_get_clean();
return $content;
}
function jobsearchform($atts){
ob_start();
$jobsearchForm_Submit = FALSE;
extract(shortcode_atts(array('name'=> '','resulttype' => ''), $atts));
$result_type = trim($resulttype);
$formname=trim($name);
$jobsSettings = get_option('awp_jobs_settings');
$target_pageid = $jobsSettings['description_page'];
$content="";
$successmsg="";
$jobsearchform=$this->get_jobsearch_field($formname);
$submitformname=$_POST['awp_job_seachformname'];
if(isset($_POST['awp_job_seachformname']) && $submitformname==$formname){ // Shortcode Form Submit.
$keywords = $_POST['keywords'];
if( $keywords == 'Keyword' ) { $keywords = ''; }
$industry = $_POST['customfield1'];
$jobtype = $_POST['customfield2'];
if(!is_array($jobtype))
{
$jobtype =array($jobtype);
}
$response = serchByJobs($keywords, $industry, $jobtype);
$jobDetails_Response = $response->return->jobDetails;
$JobSearchResults = awp_convertObjToArray($jobDetails_Response);
$jobsearchForm_Submit = TRUE;
}
$widgetFormname=$_POST['job_seachformname_widget'];
if(isset($_POST['job_seachformname_widget'])){ // Widget Form Submit.
$keywords = $_POST['keywords'];
if( $keywords == 'Keyword' ) { $keywords = ''; }
$industry = $_POST['customfield1'];
$jobtype = $_POST['customfield2'];
$maxcount = $_POST['maxcnt'];
if(!is_array($jobtype))
{
$jobtype =array($jobtype);
}
$response = serchByJobs($keywords, $industry, $jobtype);
$jobDetails_Response = $response->return->jobDetails;
$JobSearchResults = awp_convertObjToArray($jobDetails_Response);
$jobsearchForm_Submit = TRUE;
}
//To check custiom field (except fieldid=keywords) option is empty or not.
//To avoid Empty page.
$jobsearch_field = $jobsearchform['fields'];
$job_searchform_display = true;
if(count(($jobsearch_field) == 1))
{
if( $jobsearch_field[0]['fieldid'] != 'keywords' )
{
if( empty($jobsearch_field[0]['options'] ))
{
$job_searchform_display = false;
}
}
}
if($jobsearchForm_Submit && $response->return->statusCode == '1000' && $response->return->numResults == 0 )
{
echo awp_messagelist('jobsearch-noresult').' '; //Display error Message.
$jobsearchForm_Submit = FALSE;
}else if(isset($response->return->statusCode) && $jobsearchForm_Submit && $response->return->statusCode != '1000')
{
echo awp_messagelist('validate-searchJobsBySearchText'); //Display Apptivo Validation Error.(E.g Invalide SiteKey and others..)
$jobsearchForm_Submit = FALSE;
}
if(!empty($jobsearchform) && $job_searchform_display)
{
include $jobsearchform['templatefile'];
}else {
echo awp_messagelist('jobsearch-form-display-page'); //Display error Message (E.g forms are not available..).
}
$content = ob_get_clean();
return $content;
}
function jobdescription($atts)
{
ob_start();
extract(shortcode_atts(array('applicantpage'=> ''), $atts));
$jobNo= $_GET['vacancyno']; //Request Job vacancy number
$jobDetail = jobdescriptionByNumber($jobNo); //Get job details of selected job number
$jobDescription = $jobDetail->jobDescription;
$jobs_settings = get_option('awp_jobs_settings');
$applicantFormList = get_option('awp_jobsforms');
$applicantformName = $jobs_settings['applicant_form'];
$templateName = $jobs_settings['desc_template_name'];
$template_type = $jobs_settings['jobdescription_template_type'];
//added template files
if($template_type == 'theme_template') :
$template_File = TEMPLATEPATH."/jobs/jobdescription/".$templateName; //Job Description theme template
else:
$template_File = AWP_JOBDESCRIPTION_TEMPLATEPATH."/".$templateName; //Job Description plugin template.
endif;
if(!empty($applicantFormList))
{
foreach($applicantFormList as $applicantform)
{
if($applicantformName == $applicantform[name])
{
$applicantpageUrl = $applicantform[properties][jobapplicant_page];
}
}
}
if($jobs_settings['submit_type'] == 'image')
{
$value = '';
if(strlen(trim($jobs_settings['submit_val'])) != 0)
{
$imageSrc = 'src="'.$jobs_settings['submit_val'].'"';
} else {
$imageSrc = 'src="'.awp_image('submit_button').'"';
}
} else {
$imageSrc = '';
if(strlen(trim($jobs_settings['submit_val'])) != 0)
{
$value = 'value="'.$jobs_settings['submit_val'].'"';
} else {
$value = 'value="Submit"';
}
}
if(!empty($templateName) && strlen(trim($jobDescription)) != 0 ){
include $template_File;
}else if(empty($templateName)) {
echo awp_messagelist('jobdescription-display-page'); //Display error Message.
}else { echo awp_messagelist('validate-getJobsByNo'); }
$content = ob_get_clean();
return $content;
?>
'Approved', '1' => 'New');
$getalljobs_response = getAllHrjobs(999,0,'false',$status);
$allJobs = $getalljobs_response->jobDetails;
$allJobs = awp_convertObjToArray($allJobs);
if( $getalljobs_response->statusCode != '1000')
{
echo awp_messagelist('validate-getAllJobsWithStatus');
}else if(!empty($templateName) && $getalljobs_response->numResults != 0 )
{
include $template_File;
}else if(empty($templateName)){
echo awp_messagelist('joblists-display-page');
}else {
echo awp_messagelist('joblists-noresults-display-page');
}
$content = ob_get_clean();
return $content;
}
/**
* Save Jobs from submitted
*/
function save_applicantjobs($formname,$jobId,$jobNo){
$hrjobsform=$this->get_jobapplicantform_fields($formname);
if(!empty($hrjobsform)){
$hrjobsformfields=$hrjobsform['fields'];
//Process the $_POST here..
$submittedformvalues=array();
$submittedformvalues['name']=$hrjobsform[name];
$customfields="";
foreach($hrjobsformfields as $field)
{
$fieldid=$field['fieldid'];
$pos=strpos($fieldid, "customfield");
if($pos===false){
if($fieldid=='telephonenumber'){
if(isset($_POST['telephonenumber1'])){
$submittedformvalues[$fieldid]= $_POST['telephonenumber1'].$_POST['telephonenumber2'].$_POST['telephonenumber3'];
}
else{
$submittedformvalues[$fieldid]= $_POST[$fieldid];
}
}else if($fieldid=='upload')
{
$submittedformvalues[$fieldid]= $_POST['uploadfile_docid'];
}
else{
$submittedformvalues[$fieldid]= stripslashes($_POST[$fieldid]);
}
}else if($fieldid != 'industry'){
if(trim($customfields)!="")
{
if(is_array($_POST[$fieldid]))
{
$CustomArr = $_POST[$fieldid];
$customfieldVal= "";
for($i=0; $i".$field['showtext']." : ".stripslashes($customfieldVal);
}
else
{
if(is_array($_POST[$fieldid]))
{
$CustomArr = $_POST[$fieldid];
$customfieldVal= "";
for($i=0; $i:".stripslashes($customfieldVal);
}
}else {
$submittedformvalues[industry]= $_POST[industry];
}
}
if(trim($customfields)!="")
$submittedformvalues["notes"]=$customfields;
$firstName = $submittedformvalues['firstname'];
$lastName = $submittedformvalues['lastname'];
$emailId = $submittedformvalues['email'];
$jobTitle = $submittedformvalues['jobtitle'];
$company = $submittedformvalues['company'];
$address1 = $submittedformvalues['address1'];
$address2 = $submittedformvalues['address2'];
$city = $submittedformvalues['city'];
$provinceAndState = $submittedformvalues['state'];
$postalCode = $submittedformvalues['zipcode'];
$bestWayTohrjobs = $submittedformvalues['bestway'];
$country = $submittedformvalues['country'];
$leadSource = $submittedformvalues['name'];
$phoneNumber = $submittedformvalues['telephonenumber'];
$comments = $submittedformvalues['comments'];
$coverletter = $submittedformvalues['coverletter'];
$skills = $submittedformvalues['Skills'];
$upload_docid = $submittedformvalues['upload'];
$industryId = $submittedformvalues['industry'];
$noteDetails = $submittedformvalues['notes'];
if(!empty($noteDetails)){
$parent1details = nl2br($noteDetails);
$noteDetails = notes('Custom Fields',$parent1details,$parent1NoteId);
}
if(!empty($emailId)){
$response = createJobApplicant($addressId, $address1, $address2, $applicantId, $applicantNumber, $city, $comments, $country, $countyAndDistrict, $emailId, $expectedDesignation, $expectedSalary, $firstName, $industryId, $jobApplicantId, $jobId,$jobNo, $lastName, $middleName, $noteDetails, $phoneNumber, $postalCode, $provinceAndState, $coverletter, $resumeDetails, $resumeFileName, $resumeId, $skills,$upload_docid);
}
if(isset($response) && $response->statusCode == '1000'){
if(!empty($hrjobsform[confmsg])){
$confmsg = $hrjobsform[confmsg];
}
else{
$confmsg="Job applicant uploaded Successfully";
}
}else if($response == 'E_IP') { echo awp_messagelist('IP_banned');}
}
return $confmsg;
}
/**
* Get hrjobsform and its fields to render in page which is using shortcode
*/
function get_jobapplicantform_fields($formname){
$formExists="";
$hrjobs_forms=array();
$hrjobsform=array();
$hrjobsformdetails=array();
$formname=trim($formname);
$hrjobs_forms=get_option('awp_jobsforms');
if($formname=="")
$formExists="";
else if(!empty($hrjobs_forms))
$formExists = awp_recursive_array_search($hrjobs_forms,$formname,'name' );
if(trim($formExists)!=="" ){
$hrjobsform=$hrjobs_forms[$formExists];
//build hrjobsformdetails array
$hrjobsformdetails['name']=$hrjobsform['name'];
//add properties
$hrjobsformproperties=$hrjobsform['properties'];
$hrjobsformdetails['tmpltype']=$hrjobsformproperties['tmpltype'];
$hrjobsformdetails['layout']=$hrjobsformproperties['layout'];
$hrjobsformdetails['confmsg']= stripslashes($hrjobsformproperties['confmsg']);
$hrjobsformdetails['targetlist']=$hrjobsformproperties['targetlist'];
$hrjobsformdetails['css']=stripslashes($hrjobsformproperties['css']);
$hrjobsformdetails['submit_button_type']=$hrjobsformproperties['submit_button_type'];
$hrjobsformdetails['submit_button_val']=$hrjobsformproperties['submit_button_val'];
//inclde templates.
if($hrjobsformproperties['tmpltype']=="awp_plugin_template") :
$templatefile=AWP_JOBSFORM_TEMPLATEPATH."/".$hrjobsformproperties['layout']; //Job Applicant form plugin template
else :
$templatefile=TEMPLATEPATH."/jobs/jobapplicant/".$hrjobsformproperties['layout']; //Job Applicant form theme template
endif;
$hrjobsformdetails['templatefile']=$templatefile;
//add fields
$hrjobsformfields=$hrjobsform['fields'];
if(!empty($hrjobsformfields)){
usort($hrjobsformfields, "awp_sort_by_order");
$newhrjobsformfields=$hrjobsformfields;
$hrjobsformdetails['fields']=$newhrjobsformfields;
}
}
return $hrjobsformdetails;
}
function get_jobsearch_field($formname)
{
$formExists="";
$jobsearch_forms=array();
$jobsearchform=array();
$jobsearchformdetails=array();
$formname=trim($formname);
$jobsearch_forms=get_option('awp_jobsearchforms');
if($formname=="")
$formExists="";
else if(!empty($jobsearch_forms))
$formExists = awp_recursive_array_search($jobsearch_forms,$formname,'name' );
if(trim($formExists)!=="" ){
$jobsearchform=$jobsearch_forms[$formExists];
//build hrjobsformdetails array
$jobsearchformdetails['name']=$jobsearchform['name'];
//add properties
$jobsearchformproperties=$jobsearchform['properties'];
$jobsearchformdetails['tmpltype']=$jobsearchformproperties['tmpltype'];
$jobsearchformdetails['layout']=$jobsearchformproperties['layout'];
$jobsearchformdetails['confmsg']= stripslashes($jobsearchformproperties['confmsg']);
$jobsearchformdetails['targetlist']=$jobsearchformproperties['targetlist'];
$jobsearchformdetails['css']=stripslashes($jobsearchformproperties['css']);
$jobsearchformdetails['submit_button_type']=$jobsearchformproperties['submit_button_type'];
$jobsearchformdetails['submit_button_val']=$jobsearchformproperties['submit_button_val'];
$jobsearchformdetails['target_pageurl']=$jobsearchformproperties['target_pageurl'];
$jobsearchformdetails['jobapplicant_pageurl']=$jobsearchformproperties['jobapplicant_pageurl'];
//Include job serach template
if($jobsearchformproperties['tmpltype']=="awp_plugin_template") :
$templatefile=AWP_JOBSEARCHFORM_TEMPLATEPATH."/".$jobsearchformproperties['layout']; //Job search form plugin templates
else :
$templatefile=TEMPLATEPATH."/jobs/jobsearch/".$jobsearchformproperties['layout']; //Job search form theme templates
endif;
$jobsearchformdetails['templatefile']=$templatefile;
//add fields
$jobsearchformfields=$jobsearchform['fields'];
if(!empty($jobsearchformfields)){
usort($jobsearchformfields, "awp_sort_by_order");
$newhrjobsformfields=$jobsearchformfields;
$jobsearchformdetails['fields']=$newhrjobsformfields;
}
}
return $jobsearchformdetails;
}
/**
* Get hrjobs form settings by form name to render in Admin
*/
function get_settings($formname,$type){
$formExists="";
$hrjobs_forms=array();
$hrjobsform=array();
$formname=trim($formname);
if( $type == 'jobsearch')
{
$hrjobs_forms=get_option('awp_jobsearchforms');
}
else {
$hrjobs_forms=get_option('awp_jobsforms');
}
if($formname=="")
$formExists="";
else if(!empty($hrjobs_forms))
$formExists = awp_recursive_array_search($hrjobs_forms,$formname,'name' );
if(trim($formExists)!=="" ){
$hrjobsform=$hrjobs_forms[$formExists];
}
return $hrjobsform;
}
/**
* Return master fields lists supported by Apptivo hrjobs Form
*/
function get_master_fields()
{
$fields = array(
array('fieldid' => 'firstname','fieldname' => 'First Name','defaulttext' => 'First Name','showorder' => '1','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'lastname','fieldname' => 'Last Name','defaulttext' => 'Last Name','showorder' => '2','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'email','fieldname' => 'Email','defaulttext' => 'Email','showorder' => '3','validation' => 'email','fieldtype' => 'text'),
array('fieldid' => 'jobtitle','fieldname' => 'Job Title','defaulttext' => 'Job Title','showorder' => '4','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'company','fieldname' => 'Company','defaulttext' => 'Company','showorder' => '5','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'address1','fieldname' => 'Address1','defaulttext' => 'Address1','showorder' => '6','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'address2','fieldname' => 'Address2','defaulttext' => 'Address2','showorder' => '7','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'city','fieldname' => 'City','defaulttext' => 'City','showorder' => '8','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'zipcode','fieldname' => 'ZipCode','defaulttext' => 'ZipCode','showorder' => '10','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'country','fieldname' => 'Country','defaulttext' => 'Country','showorder' => '11','validation' => 'text','fieldtype' => 'select'),
array('fieldid' => 'telephonenumber','fieldname' => 'Telephone Number','defaulttext' => 'Telephone Number','showorder' => '12','validation' => 'number','fieldtype' => 'text'),
array('fieldid' => 'comments','fieldname' => 'Comments','defaulttext' => 'Comments','showorder' => '13','validation' => 'textarea','fieldtype' => 'textarea'),
array('fieldid' => 'coverletter','fieldname' => 'Cover Letter','defaulttext' => 'Cover Letter','showorder' => '14','validation' => 'textarea','fieldtype' => 'textarea'),
array('fieldid' => 'Skills','fieldname' => 'Skills','defaulttext' => 'Skills','showorder' => '15','validation' => 'upload','fieldtype' => 'textarea'),
array('fieldid' => 'upload','fieldname' => 'Upload File','defaulttext' => 'Upload File','showorder' => '16','validation' => 'textarea','fieldtype' => 'upload'),
array('fieldid' => 'industry','fieldname' => 'Industry','defaulttext' => 'Industry','showorder' => '17','validation' => '','fieldtype' => 'select'),
array('fieldid' => 'customfield1','fieldname' => 'Custom Field 1','defaulttext' => 'Custom Field1','showorder' => '18','validation' => '','fieldtype' => 'select'),
array('fieldid' => 'customfield2','fieldname' => 'Custom Field 2','defaulttext' => 'Custom Field2','showorder' => '19','validation' => '','fieldtype' => 'select'),
array('fieldid' => 'customfield3','fieldname' => 'Custom Field 3','defaulttext' => 'Custom Field3','showorder' => '20','validation' => '','fieldtype' => 'select'),
array('fieldid' => 'customfield4','fieldname' => 'Custom Field 4','defaulttext' => 'Custom Field4','showorder' => '21','validation' => '','fieldtype' => 'radio'),
array('fieldid' => 'customfield5','fieldname' => 'Custom Field 5','defaulttext' => 'Custom Field5','showorder' => '22','validation' => '','fieldtype' => 'checkbox')
);
//For Additional custom fields.
$addtional_custom = get_option('awp_addtional_custom_jobapplicant');
if(!empty($addtional_custom)):
$fields = array_merge($fields,$addtional_custom);
endif;
return $fields;
}
function get_master_fieldsfor_searchjobs()
{
$fields = array(
array('fieldid' => 'keywords','fieldname' => 'Keywords','defaulttext' => 'Keywords','showorder' => '1','validation' => 'text','fieldtype' => 'text'),
array('fieldid' => 'customfield1','fieldname' => 'Industry','defaulttext' => 'Industry','showorder' => '2','validation' => '','fieldtype' => 'select'),
array('fieldid' => 'customfield2','fieldname' => 'JobType','defaulttext' => 'Job Type','showorder' => '3','validation' => '','fieldtype' => 'select'),
);
return $fields;
}
/**
* Retrieve list of validations supported by Apptivo hrjobs Form
*
*/
function get_master_validations(){
$validations = array(
array('validationLabel' => 'None','validation' => 'none'),
array('validationLabel' => 'Email ID','validation' => 'email'),
array('validationLabel' => 'Number','validation' => 'number')
);
return $validations;
}
/**
*
* * Retrieve list of Field Types supported by Apptivo hrjobs Form
*/
function get_master_fieldtypes(){
$fieldtypes = array(
array('fieldtypeLabel' => 'Checkbox','fieldtype' => 'checkbox'),
array('fieldtypeLabel' => 'Radio Option','fieldtype' => 'radio'),
array('fieldtypeLabel' => 'Select','fieldtype' => 'select'),
array('fieldtypeLabel' => 'Textbox','fieldtype' => 'text'),
array('fieldtypeLabel' => 'Textarea','fieldtype' => 'textarea')
);
return $fieldtypes;
}
function get_master_fieldtypes_jobsearch(){
$fieldtypes = array(
array('fieldtypeLabel' => 'Checkbox','fieldtype' => 'checkbox'),
array('fieldtypeLabel' => 'Select','fieldtype' => 'select')
);
return $fieldtypes;
}
/**
* return array of plugin templates available with Template name and template file name
*/
function get_plugin_templates($dir_hrjobs)
{
$default_headers = array(
'Template Name' => 'Template Name'
);
$templates = array();
// Open a known directory, and proceed to read its contents
if (is_dir($dir_hrjobs)) {
if ($dh = opendir($dir_hrjobs)) {
while (($file = readdir($dh)) !== false) {
if ( substr( $file, -4 ) == '.php' )
{
$plugin_data = get_file_data( $dir_hrjobs."/".$file, $default_headers, '' );
if(strlen(trim($plugin_data['Template Name'])) != 0 )
{
$templates[$plugin_data['Template Name']] = $file;
}
}
}
closedir($dh);
}
}
return $templates;
}
function get_apptivo_template_data( $apptivo_template_file,$template_filename)
{
$test = array();
$default_headers = array(
'Apptivo Template Name' => 'Apptivo Template Name',
'Version' => 'Version',
'Description' => 'Description',
'Author' => 'Author',
);
$plugin_data = get_file_data( $apptivo_template_file, $default_headers, '' );
if(strlen(trim($plugin_data['Apptivo Template Name'])) != 0 )
{
$test[$plugin_data['Apptivo Template Name']] = $template_filename;
}
}
/**
* Create field array
*/
function createformfield_array($fieldid,$showtext,$required,$type,$validation,$options,$displayorder){
$displayorder = (trim($displayorder)=="")?0:trim($displayorder);
$options = (is_array($options))?$options:stripslashes(str_replace( array('"'), '', strip_tags($options)));
if( trim($type) != 'text' && trim($type) != 'textarea')
{
$pos = strpos(trim($fieldid), 'customfield');
if( $pos !== false )
{
if( !is_array($options) && trim($options) == '')
{
return '';
}
}
}
$hrjobsformfield= array(
'fieldid'=>$fieldid,
'showtext' => stripslashes(str_replace( array('"'), '', strip_tags($showtext))),
'required' => $required,
'type' => $type,
'validation' => $validation,
'options' => $options,
'order' => $displayorder
);
return $hrjobsformfield;
}
function createJobsoptions()
{
if($_POST['awp_jobs_add'] && ($_POST['nogdog'] == $_SESSION['apptvo_single_jobs'])) //Create Jobs
{
$jobtitle = $_POST['jobs_title'];
$content = stripslashes($_POST['content']);
$content = apply_filters('the_content', $content);
$jobindustry = $_POST['jobs_industry'];
$jobtype = $_POST['jobs_type'];
$isFeatured = $_POST['jobs_featured'];
if( strlen(trim($jobtitle)) == 0 || strlen(trim($content)) == 0)
{
$errorMsg = "Job Title and Job Description can not be empty.";
} else {
$response = createJobs($jobtitle,$content,$jobindustry,$jobtype,$isFeatured);
if($response == 'E_100')
{
$sucMsg = 'Invalid Keys ';
}else if(isset($response->statusCode) && $response->statusCode != '1000')
{
$sucMsg = ''.$response->statusMessage.' ';
}else { $sucMsg = "Job Created successfully."; }
}
} //End of Create Jobs.
if($_POST['awp_updatejobs']) // Update Jobs
{
$jobtitle = $_POST['jobs_title'];
$content = stripslashes($_POST['editcontent']);
$content = apply_filters('the_content', $content);
$jobId = $_POST['jobs_id'];
$industryId = $_POST['jobs_industry'];
$jobtype = $_POST['jobs_type'];
$jobstatus = $_POST['jobs_status'];
$isFeatured = $_POST['jobs_featured'];
if( strlen(trim($jobtitle)) == 0 || strlen(trim($content)) == 0)
{
$errorMsg = "Job Title and Job Description can not be empty.";
}else {
if(isset($jobId) && is_numeric($jobId))
{
$response = updatejobs($jobId,$jobtitle,$content,$industryId,$jobtype,$isFeatured,$jobstatus);
if(isset($response->statusCode) && $response->statusCode != '1000')
{
$sucMsg = ''.$response->statusMessage.' ';
}else {
$sucMsg = "Job Updated successfully.";}
}
}
} //End of Update Jobs.
$jobTypeLists = array('Full Time' => 'Full Time','Part Time' => 'Part Time','Contract' => 'Contract');
$jobTypeStatus = array('New' => 'New','Approved' => 'Approved','Closed' => 'Closed','Canceled' => 'Canceled');
$allIndustries = getAllIndustries();
?>
_plugin_activated){
echo "";
}
?>
For Complete instructions, see the - Developer's
Guide.
_plugin_activated) :
$this->AllJobs();
endif;
//Displaying Job Lists
if(strlen($sucMsg) != 0 ) { ?>
return;
?>
jobDetails);
if( $Job_results->numResults != 0)
{
$numberofjobs = count($JobSearchResults);
$jobsperpage =5;
$tpages = ceil($numberofjobs/$jobsperpage);
$currentpage = intval($_GET['pageno']);
if($currentpage<=0) $currentpage = 1;
if($currentpage>=$tpages) $currentpage = $tpages;
$reload = $_SERVER['PHP_SELF'].'?page=awp_jobs&keys=jobcreation';
$start = ( $currentpage - 1 ) * $jobsperpage;
$JobSearchResults = array_slice( $JobSearchResults, $start, $jobsperpage);
?>
_plugin_activated){
echo "Jobs plugin currently
disabled . Please enable this in
Apptivo General Settings .";
}else {
$jobapplicant_settings = get_option('awp_jobsforms');
$job_appl_page = $jobapplicant_settings[0][properties][jobapplicant_page];
$awp_jobs_settings = get_option('awp_jobs_settings');
$list_template = $awp_jobs_settings[list_template_name];
if(strlen(trim($job_appl_page)) == 0 && strlen(trim($list_template)) == 0)
{
echo 'To show job list in Website. Update
Job settings and
Job Applicant form Configuration before adding Jobs list shortcode in Page or Post.';
}else if(strlen(trim($job_appl_page)) != 0 && strlen(trim($list_template)) == 0)
{
echo 'To show job list in Website. Update
Job settings Configuration before adding Jobs list shortcode in Page or Post.';
}else if(strlen(trim($job_appl_page)) == 0 && strlen(trim($list_template)) != 0)
{
echo 'To show job list in Website. Update
Job Applicant form Configuration before adding Jobs list shortcode in Page or Post.';
}
}
?>
$jobsperpage)
{
echo awp_paginate($reload,$currentpage,$tpages,$numberofjobs);
}
?>
_plugin_activated) {
echo 'Copy and Paste this short code in your page to display this list of jobs
';
} ?>
numResults != 0) { */
$hrjobs_forms=array();
$hrjobsformdetails=array();
$hrjobs_forms=get_option('awp_jobsforms');
if(empty($hrjobs_forms))
{
$jobapplicant_array =array("name"=>'jaform');
$jobapplicantform=array($jobapplicant_array);
update_option('awp_jobsforms',$jobapplicantform);
$hrjobs_forms=get_option('awp_jobsforms');
}
/*
* Saving selected form settings
*/
if(isset($_POST['awp_jobsform_settings'])){
$templatelayout="";
$newformname=$_POST['awp_jobsform_name'];
if($_POST['awp_jobsform_templatetype']=="awp_plugin_template")
$templatelayout=$_POST['awp_jobsform_plugintemplatelayout'];
else
$templatelayout=$_POST['awp_jobsform_themetemplatelayout'];
$hrjobsformproperties=array(
'tmpltype' =>$_POST['awp_jobsform_templatetype'],
'layout' =>$templatelayout,
'confmsg' => stripslashes($_POST['awp_jobsform_confirmationmsg']),
'css' => stripslashes($_POST['awp_jobsform_customcss']),
'subscribe_option' => $_POST['subscribe_option'],
'submit_button_type' => $_POST['awp_jobsform_submit_type'],
'submit_button_val' => $_POST['awp_jobsform_submit_val'],
'jobapplicant_page' => $_POST['awp_jobapplicant_page'] );
//New custom fields
$stack = array();
$addtional_custom = array();
$addtional_order = 23;
for($i=6;$i<200;$i++)
{
if(isset($_POST['customfield'.$i.'_newest']) )
{
$addtional_custom = array('fieldid' => 'customfield'.$i.'','fieldname' => 'Custom Field '.$i.'',
'defaulttext' => 'Custom Field'.$i.'','showorder' => $addtional_order,'validation' => '',
'fieldtype' => 'select');
$addtional_order++;
array_push($stack, $addtional_custom);
}else {
break;
}
}
if(!empty($stack)) :
update_option('awp_addtional_custom_jobapplicant',$stack);
endif;
//General fields
$hrjobsformfields=array();
foreach( $this->get_master_fields() as $fieldsmasterproperties )
{
$enabled=0;
$hrjobsformfield=array();
$fieldid=$fieldsmasterproperties['fieldid'];
if(!empty ($_POST[$fieldid.'_order'])){
$displayorder = $_POST[$fieldid.'_order'];
}
else{
$displayorder = $fieldsmasterproperties['showorder'];
}
if(!empty ($_POST[$fieldid.'_text'])){
$displaytext = $_POST[$fieldid.'_text'];
}
else{
$displaytext = $fieldsmasterproperties['defaulttext'];
}
if($fieldid=='lastname' || $fieldid=='email' || $fieldid=='firstname' || $fieldid=='country' )
{
$enabled = 1;
$required = 1;
}
else
{
$enabled = $_POST[$fieldid.'_show'];
$required = $_POST[$fieldid.'_require'];
}
if($enabled){
$hrjobsformfield=$this->createformfield_array($fieldid,$displaytext,$required,$_POST[$fieldid.'_type'],$_POST[$fieldid.'_validation'],$_POST[$fieldid.'_options'],$displayorder);
array_push($hrjobsformfields, $hrjobsformfield);
}
}
//usort($hrjobsformfields, "awp_sort_by_order");
if(!empty($hrjobsformfields)){
$newhrjobsformdetails=array('name'=>$newformname,'properties'=>$hrjobsformproperties,'fields'=>$hrjobsformfields);
$formExists="";
if(!empty($hrjobs_forms))
$formExists = awp_recursive_array_search($hrjobs_forms,$newformname,'name' );
if(trim($formExists)!=="" ){
unset($hrjobs_forms[$formExists]);
array_push($hrjobs_forms, $newhrjobsformdetails);
sort($hrjobs_forms);
update_option('awp_jobsforms',$hrjobs_forms);
$hrjobs_forms=get_option('awp_jobsforms');
$updatemessage= "Jobs Form '".$newformname."' settings updated. Use Short code '[apptivo_job_applicantform name=\"".$newformname."\"]' in your page to use this form.";
}
}else{
$updatemessage="Select atleast one Form field for jobs Form. ";
}
$selectedhrjobsform=$newformname;
}
// Now display the settings editing screen
echo '';
//if updatemessage is not empty display the div
if(trim($updatemessage)!=""){
?>
get_plugin_templates(AWP_JOBSFORM_TEMPLATEPATH); //Job applicant form plugin templates
?>
get_settings($selectedhrjobsform,'');
if(count($hrjobsformdetails)>0){
$selectedhrjobsform=$hrjobsformdetails[name];
$fields=$hrjobsformdetails[fields];
$formproperties=$hrjobsformdetails[properties];
}
?>
Save the below settings to get the Shortcode for job applicant form. '; } ?>
_plugin_activated) :
echo "Jobs Plugin is currently disabled . Please enable this in Apptivo General Settings .";
endif;
?>
$_POST['awp_joblist_descriptionpage'],
'submit_type' => $_POST['awp_joblist_submit_type'],
'submit_val' => $_POST['awp_joblist_submit_value'],
'applicant_form' => $applicantformName,
'desc_template_name' => $jobdesc_template,
'jobdescription_template_type' => $_POST['awp_jobdesc_templatetype'],
'list_template_name' => $joblist_template,
'joblist_template_type' => $_POST['awp_joblists_templatetype']
);
update_option('awp_jobs_settings',$jobs_settings_post);
}
$jobs_settings = get_option('awp_jobs_settings');
?>
Copy and Paste this short code in Job Description Page :
Save the below settings to get the Shortcode for job description.
'; } ?>
_plugin_activated) { echo 'disabled="disabled"'; } ?>
type="submit"
value=""
class="button-primary" id="awp_joblists_settings"
name="awp_joblists_settings">
_plugin_activated) :
_e("Jobs Plugin is currently disabled . Please enable this in Apptivo General Settings .",'apptivo-businesssite');
endif;
?>
'jsform');
$newhrjobsform=array($newhrjobsformname_array);
update_option('awp_jobsearchforms',$newhrjobsform);
$hrjobs_forms=get_option('awp_jobsearchforms');
}
/*
* Saving selected form settings
*/
if(isset($_POST['awp_jobsearchform_settings'])){
$templatelayout="";
$newformname=$_POST['awp_jobsearchform_name'];
if($_POST['awp_jobsearchform_templatetype']=="awp_plugin_template")
$templatelayout=$_POST['awp_jobsearchform_plugintemplatelayout'];
else
$templatelayout=$_POST['awp_jobsearchform_themetemplatelayout'];
$hrjobsformproperties=array(
'tmpltype' =>$_POST['awp_jobsearchform_templatetype'],
'layout' =>$templatelayout,
'confmsg' => stripslashes($_POST['awp_jobsearchform_confirmationmsg']),
'css' => stripslashes($_POST['awp_jobsearchform_customcss']),
'subscribe_option' => $_POST['subscribe_option'],
'submit_button_type' => $_POST['awp_jobsearchform_submit_type'],
'submit_button_val' => $_POST['awp_jobsearchform_submit_value'],
'target_pageurl' => $_POST['awp_target_pageurl'],
'jobapplicant_pageurl' => $_POST['awp_jobapplicant_pageurl']
);
$hrjobsformfields=array();
foreach( $this->get_master_fieldsfor_searchjobs() as $fieldsmasterproperties )
{
$enabled=0;
$hrjobsformfield=array();
$fieldid=$fieldsmasterproperties['fieldid'];
if(!empty ($_POST[$fieldid.'_order'])){
$displayorder = $_POST[$fieldid.'_order'];
}
else{
$displayorder = $fieldsmasterproperties['showorder'];
}
if(!empty ($_POST[$fieldid.'_text'])){
$displaytext = $_POST[$fieldid.'_text'];
}
else{
$displaytext = $fieldsmasterproperties['defaulttext'];
}
$enabled = $_POST[$fieldid.'_show'];
if($enabled){
$hrjobsformfield=$this->createformfield_array($fieldid,$displaytext,'',$_POST[$fieldid.'_type'],'',$_POST[$fieldid.'_options'],$displayorder);
array_push($hrjobsformfields, $hrjobsformfield);
}
}
if(!empty($hrjobsformfields)){
$newhrjobsformdetails=array('name'=>$newformname,'properties'=>$hrjobsformproperties,'fields'=>$hrjobsformfields);
$formExists="";
if(!empty($hrjobs_forms))
$formExists = awp_recursive_array_search($hrjobs_forms,$newformname,'name' );
if(trim($formExists)!=="" ){
unset($hrjobs_forms[$formExists]);
array_push($hrjobs_forms, $newhrjobsformdetails);
sort($hrjobs_forms);
update_option('awp_jobsearchforms',$hrjobs_forms);
$hrjobs_forms=get_option('awp_jobsearchforms');
$updatemessage= "Job Search Form '".$newformname."' settings updated. Use Short code '[apptivo_job_searchform name=\"".$newformname."\"]' in your page to use this form.";
}
}else{
$updatemessage="Select atleast one Form field for job search Form. ";
}
$selectedhrjobsform=$newformname;
}
// Now display the settings editing screen
echo '';
// header
//if updatemessage is not empty display the div
if(trim($updatemessage)!=""){
?>
get_settings($selectedhrjobsform,'jobsearch');
if(count($hrjobsformdetails)>0){
$selectedhrjobsform=$hrjobsformdetails[name];
$fields=$hrjobsformdetails[fields];
$formproperties=$hrjobsformdetails[properties];
}
?>
Save the below settings to get the Shortcode for job search form. ';
}?>
" . __( 'Job Search Form Fields', 'apptivo-businesssite' ) . "";?>
_plugin_activated) { echo 'disabled="disabled"'; } ?>
type="submit" name="awp_jobsearchform_settings"
id="awp_jobsearchform_settings" class="button-primary"
value="" />
loadscripts();
$this->loadstyles_uploadify();
}
if($searchform_found || $joblists_found || $jobdesc_found || $applicantformfound)
{
$this->loadstyles();
}
return $posts;
}
function loadstyles()
{
wp_enqueue_style('style_awp_job', AWP_PLUGIN_BASEURL.'/inc/jobs/css/style.css' , false, '1.0.0', 'screen');
}
/**
* Load the CSS files
*/
function loadstyles_uploadify() {
wp_enqueue_style('style_uploadify', AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/uploadify.css' , false, '1.0.0', 'screen');
}
/**
* Load the JS files
*/
function loadscripts() {
wp_enqueue_script('jquery_validation',AWP_PLUGIN_BASEURL. '/assets/js/validator-min.js',array('jquery'));
wp_enqueue_script('jquery_uploadify_swfobject',AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/swfobject.js',array('jquery'));
wp_enqueue_script('jquery_uploadify_uploadify',AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/jquery.uploadify.v2.1.4.min.js',array('jquery'),'2.1.4');
wp_register_script('jquery_uploadify_uploadjs',AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/upload.js','jquery', '1.0');
wp_enqueue_script('jquery_uploadify_uploadjs');
wp_localize_script( 'jquery_uploadify_uploadjs', 'awp_upload', $this->localize_vars());
}
function localize_vars() {
$docDetails = getDetailsForDocumentUpload();
return array(
'accessKey'=>$docDetails->return->accessKey,
'bucketName'=>$docDetails->return->bucketName,
'acl'=>$docDetails->return->acl,
'documentKey'=>$docDetails->return->documentKey,
'policy'=>$docDetails->return->policy,
'signature'=>$docDetails->return->signature,
'uploadUrl'=>'http://'.$docDetails->return->uploadUrl.'/',
'swfUrl' => AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/uploadify.swf',
'cancelImg' => AWP_PLUGIN_BASEURL.'/inc/jobs/files/uploadify/cancel.png',
);
}
/**
* Country lists from Apptivo
*/
function getAllCountryList()
{
$countrylist = getAllCountries();
return $countrylist->return;
}
} //End Class
/**
* Create Jobs in Apptivo.
*/
function createJobs($jobTitle,$jobDescription,$industryId,$jobtype,$isFeatured)
{
if($isFeatured == 'on') :
$isFeatured = 'Y';
else:
$isFeatured = 'N';
endif;
$jobStatusName = 'New';
$jobDetails = new jobDetails($fillByDate, $firmId, $industryId, $industryName, $isFeatured, $jobDescription, $jobId, $jobNumber, $jobStatusId, $jobStatusName, $jobTitle, $jobTypeId, $jobtype);
$params = array (
"arg0" => APPTIVO_BUSINESS_API_KEY,
"arg1" => APPTIVO_BUSINESS_ACCESS_KEY,
"arg2" => $jobDetails
);
$response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'createJob',$params);
if($response == 'E_100')
{
return $response;
}
return $response->return;
}
/**
* Document details for upload document.
*/
function getDetailsForDocumentUpload(){
$params = array ( "arg0" => APPTIVO_BUSINESS_API_KEY,"arg1"=> APPTIVO_BUSINESS_ACCESS_KEY,"arg2" => '0');
$response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'getUploadDocumentDetails',$params);
return $response;
}
/**
* Update Apptivo Jobs
*/
function updatejobs($jobId,$jobTitle,$jobDescription,$industryId,$jobtype,$isFeatured,$jobStatusName='New')
{
if($isFeatured == 'on')
{
$isFeatured = 'Y';
}else {
$isFeatured = 'N';
}
$jobDetails = new jobDetails($fillByDate, $firmId, $industryId, $industryName, $isFeatured, $jobDescription, $jobId, $jobNumber, $jobStatusId, $jobStatusName, $jobTitle, $jobTypeId, $jobtype);
$params = array (
"arg0" => APPTIVO_BUSINESS_API_KEY,
"arg1" => APPTIVO_BUSINESS_ACCESS_KEY,
"arg2" =>$jobDetails
);
$response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'updateJob',$params);
return $response->return;
}
/**
* Job Details based on Jobs ID.
*/
function getJobByJobId($jobId)
{
$params = array (
"arg0" => APPTIVO_BUSINESS_API_KEY,
"arg1" => APPTIVO_BUSINESS_ACCESS_KEY,
"arg2" => $jobId
);
$response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'getJobByJobId',$params);
return $response;
}
/*
* Job Applicant Details are stored in Apptivo Jobs apps
*/
function createJobApplicant($addressId, $addressLine1, $addressLine2, $applicantId, $applicantNumber, $city, $comments, $country, $countyAndDistrict, $emailId, $expectedDesignation, $expectedSalary, $firstName, $industryId, $jobApplicantId, $jobId, $jobNumber, $lastName, $middleName, $noteDetails, $phoneNumber, $postalCode, $provinceAndState, $resumeCoverLetter, $resumeDetails, $resumeFileName, $resumeId, $skills,$upload_docid)
{
$verification = check_blockip();
if($verification){
return $verification;
}
$jobapplicantdetals = new JobApplicantDetails($addressId, $addressLine1, $addressLine2, $applicantId, $applicantNumber, $city, $comments, $country,$countyAndDistrict,$emailId, $expectedDesignation, $expectedSalary, $firstName, $industryId, $jobApplicantId,$jobId, $jobNumber, $lastName, $middleName, $noteDetails, $phoneNumber, $postalCode, $provinceAndState, $resumeCoverLetter, $resumeDetails, $resumeFileName, $resumeId, $skills,$upload_docid);
$params = array (
"arg0" => APPTIVO_BUSINESS_API_KEY,
"arg1" => APPTIVO_BUSINESS_ACCESS_KEY,
"arg2" => $jobapplicantdetals
);
$response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'createNewJobApplicant',$params);
if((isset($response->return->statusCode) && $response->return->statusCode != '1000') || $response =='E_100')
{
echo awp_messagelist('jobapplicant-display-page');
}
return $response->return;
}
/**
* Get ALL Jobs from Index
*/
function getAllHrjobs($maxCount=999,$pageIndex=1,$getFeaturedJobsOnly='false',$status = null)
{
$sortBy = 0;
$params_plugincall = array (
"arg0" => APPTIVO_BUSINESS_API_KEY,
"arg1" => APPTIVO_BUSINESS_ACCESS_KEY,
"arg2" => $getFeaturedJobsOnly,
"arg3" => $pageIndex,
"arg4" => $maxCount,
"arg5" => $sortBy,
"arg6" => $status
);
$response = getsoapCall(APPTIVO_BUSINESS_INDEX,'getAllJobsWithStatus',$params_plugincall);
if($response == 'E_100') :
echo awp_messagelist('validate-getAllJobsWithStatus');
endif;
return $response->return;
}
/*
* Get ALL Jobs from Apptivo
*/
function get_apptivojobs()
{
$params_plugincall = array (
"arg0" => APPTIVO_BUSINESS_API_KEY,
"arg1" => APPTIVO_BUSINESS_ACCESS_KEY,
"arg2" => 'false',
"arg3" => 999,
"arg4" => 0,
"arg5" => 0,
"arg6" => null
);
$response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'getAllJobsWithStatus',$params_plugincall);
if($response == 'E_100')
{
echo awp_messagelist('validate-getAllJobsWithStatus');
}
return $response->return;
}
/**
* Serach By Jobs
*/
function serchByJobs($keyword,$industry,$job_types,$maxcount=999,$pageIndex=1)
{
$params = array (
"arg0" => APPTIVO_BUSINESS_API_KEY,
"arg1" => APPTIVO_BUSINESS_ACCESS_KEY,
"arg2" => $keyword,
"arg3" => $industry,
"arg4" => $job_types,
"arg5" => 'false',
"arg6" => $pageIndex,
"arg7" => $maxcount,
"arg8" => 0
);
$response = getsoapCall(APPTIVO_BUSINESS_INDEX,'searchJobsBySearchText',$params); //searchJobs
return $response;
}
/**
* Job Details based on Job number.
*/
function jobdescriptionByNumber($jobNo)
{
$params = array (
"arg0" => APPTIVO_BUSINESS_API_KEY,
"arg1" => APPTIVO_BUSINESS_ACCESS_KEY,
"arg2" => $jobNo
);
$response = getsoapCall(APPTIVO_BUSINESS_INDEX,'getJobByJobNo',$params); //getJobByJobNumber
if( $response == 'E_100')
{
return $response;
}
return $response->return;
}
/**
* Apptivo Job Industries.
*/
function getAllIndustries()
{
$params = array ( "arg0" => APPTIVO_BUSINESS_API_KEY, "arg1" => APPTIVO_BUSINESS_ACCESS_KEY );
$data_key = APPTIVO_BUSINESS_API_KEY.'-industries';
if(class_exists('Memcache'))
{
$mcache_obj = new AWP_Cache_Util(); //Create Object in AWP_DataCache clss
$mcacheconnect = $mcache_obj->connectmcache();
}
else {
$mcacheconnect = FALSE;
}
//To check if the MemCache is connected or not.
if( $mcacheconnect )
{
$response = $mcache_obj->getdata($data_key);
if( empty($response)) //Check the published date key value is set in memcahe or not.
{
$response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'getAllIndustries',$params);
$mcache_obj->storedata($data_key,$response);
}
}else {
$response = getsoapCall(APPTIVO_BUSINESS_SERVICES,'getAllIndustries',$params);
}
return $response->return;
}