By Kazuo Gomi Filho on Tuesday, 05 May 2015
Posted in Technical Issues
Replies 6
Likes 0
Views 1.4K
Votes 0
Hi...
Iam working wiht EasySocial + JSJobs. EasySocial is my default registration form.
My problem is : when users register ... JSJobs needs insert into DB some values rules..
I need insert this code :
In below code change bold code with my code/variable
function onAfterStoreUser($user, $isnew, $success, $msg){ //j 1.5
if( $isnew )
{
if(isset($_POST['userrole'])){
$db = &JFactory::getDBO();
$created = date('Y-m-d H:i:s');
$query = "INSERT INTO #__js_job_userroles (uid,role,dated) VALUES (".$user['id'].", ".$user['userrole'].", '".$created."')";
$db->setQuery( $query );
$db->query();

$componentAdminPath = JPATH_ADMINISTRATOR.'/components/com_jsjobs';
$componentPath = JPATH_SITE.'/components/com_jsjobs';
if(file_exists($componentPath.'/JSApplication.php')){
require_once $componentPath.'/JSApplication.php';
$result = JSModel::getJSModel('userrole')->addUser($_POST['userrole'],$user['id']);
}
}
}
}


I need create a combobox in EasySocial registration form to make users choose JSJobs usergroup
1 for empployer
2 for job seeker

Or

I have 2 EasySocial profiles (employer and jobseeker) ... when users choose employer he will be asigned in employer Joomla usergroup and employer EasySocial profile/Usergroup.
So is it possible set in JSJobs DB automatically too??

Thanks in advance

Kazuo
Original reply from JsJobs

Hi,
We do not know about easysocial, we just give you idea, it may have option to create combo box.
If you create combo box in easysocial, you can read that combo values in jsjobs register plugin.
Remember role values are (1 or 2):
1- for employer
2- for job seeker
In below code change bold code with your code/variable
function onAfterStoreUser($user, $isnew, $success, $msg){ //j 1.5
if( $isnew )
{
if(isset($_POST['userrole'])){
$db = &JFactory::getDBO();
$created = date('Y-m-d H:i:s');
$query = "INSERT INTO #__js_job_userroles (uid,role,dated) VALUES (".$user['id'].", ".$user['userrole'].", '".$created."')";
$db->setQuery( $query );
$db->query();

$componentAdminPath = JPATH_ADMINISTRATOR.'/components/com_jsjobs';
$componentPath = JPATH_SITE.'/components/com_jsjobs';
if(file_exists($componentPath.'/JSApplication.php')){
require_once $componentPath.'/JSApplication.php';
$result = JSModel::getJSModel('userrole')->addUser($_POST['userrole'],$user['id']);
}
}
}
}
·
Tuesday, 05 May 2015 13:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Kazuo,

Ideally, what you should do is to create a new custom field app that processes these values when a user registers on the site. Since JSJobs told you that some specific values should be added when a new user registers on the site, your custom field app should run those codes when the registration is completed
·
Thursday, 07 May 2015 01:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Where can i find documentation about custom field app... i canot find anywhere..
Thanks in advance

Kazuo
·
Thursday, 07 May 2015 12:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Kazuo,

Sorry for late reply to this,

You can take a look of this documentation -> http://stackideas.com/docs/easysocial/developers/custom-fields/getting-started

Hope this help.
·
Friday, 08 May 2015 15:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Kazuo Gomi Filho,

I really would like to speak with you regarding the js_jobs integration. If you could provide your email or phone#, i really appriciate

itcclub@outlook.com
·
Tuesday, 17 May 2016 15:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for heading up on this.
·
Tuesday, 17 May 2016 16:39
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post