function userApply() { $p_mode = JRequest::getInt('p_mode', 0); if ($p_mode == 1) { JRequest::checkToken() or jexit(JText::_('Invalid Token')); } else { JRequest::checkToken('get') or jexit(JText::_('Invalid Token')); } $job_id = JRequest::getInt('jid'); $selcat = JRequest::getInt('cat_id', 1); $qid = JRequest::getInt('qid'); if ($this->_uid < 1) { $return = JRequest::getString('redirect', ''); return $this->setRedirect(JRoute::_('index.php?option=com_jobboard&view=member&redirect=' . $return . '&Itemid=' . $this->_itemid)); } if ($this->_umodel->isJobOwner($this->_uid, $job_id)) { return $this->setRedirect(JRoute::_('index.php?option=com_jobboard&view=job&id=' . $job_id . '&Itemid=' . $this->_itemid), JText::_('COM_JOBBOARD_APPLICATION_DENIED'), 'error'); } $has_applied = $this->_umodel->getJobApplicationStatus($this->_uid, $job_id) > 0 ? 1 : 0; if ($has_applied == 1) { $msg = JText::_('COM_JOBBOARD_ALREADYAPPLIED'); return $this->setRedirect(JRoute::_('index.php?option=com_jobboard&view=job&id=' . $job_id . '&Itemid=' . $this->_itemid), $msg, 'Message'); } $profdata = $this->_umodel->getMinCvProfiles($this->_uid); $applications_model =& $this->getModel('Apply'); $profile_pic = JobBoardHelper::checkProfilePicStatus($this->_uid, $this->_umodel); $data = $applications_model->getUserApplications($this->_uid); $layout_style = $this->_umodel->getLayoutConfig(); $job_title = $this->_umodel->getJobTitle($job_id); $view =& $this->getView('user', 'html'); $view->setLayout('user'); $view->assign('context', 'apply'); if ($qid > 0) { $questionnaire = $applications_model->getQuestionnaire($qid); $fields = json_decode($questionnaire['fields']); if (!is_object($fields)) { $qid = 0; } else { unset($questionnaire['fields']); jimport('joomla.utilities.date'); $today = new JDate(); $view->assignRef('questionnaire', $questionnaire); $view->assignRef('fields', $fields->fields); $view->assignRef('today', $today); } } require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'jobboard_invite.php'; $has_invite = JobBoardInviteHelper::hasInvite($this->_uid, $job_id); if ($p_mode == 1 || $has_invite) { $cpid = JRequest::getInt('cpid'); $inv_response = array('uid' => $this->_uid, 'jid' => $job_id, 'cpid' => $cpid); if ($this->_umodel->updateResponse($inv_response)) { $inv_sender = JobBoardInviteHelper::getSender($inv_response); if (JobBoardInviteHelper::mailInvites($inv_sender) == 1) { JPluginHelper::importPlugin('Jobboard'); $dispatcher =& JDispatcher::getInstance(); $dispatcher->trigger('onSendInvite', array(array('uid' => &$this->_uid, 'sid' => $inv_sender, 'jid' => $job_id, 'cpid' => $cpid, 'type' => 'adminvite'))); } } } $view->assign('data', $data); $view->assign('jobid', $job_id); $view->assign('job_title', $job_title); $view->assign('selcat', $selcat); $view->assign('qid', $qid); $view->assign('profdata', $profdata); $view->assign('is_profile_pic', $profile_pic['is_profile_pic']); $view->assign('imgthumb', $profile_pic['urithumb']); $view->assign('layout_style', $layout_style); $view->assignRef('user_auth', $this->_user_cred); $view->display(); }
?> <?php echo JText::_('COM_JOBBOARD_INVITE_DATE'); ?> : <?php echo JHTML::_('date', $row->create_date, $this->day_format . ' ' . $this->month_long_format . ', ' . $this->year_format); ?> <?php } ?> </span> </li> <li> <span> <?php $cv_title = JobBoardInviteHelper::getInviteCV($row->id); ?> <?php echo JText::_('CV_RESUME'); ?> : <?php if (!empty($cv_title)) { ?> <a class="jobbrdmodal" href="<?php echo JRoute::_('index.php?option=com_jobboard&view=user&task=viewcv&profileid=' . $row->cvprof_id . '&tmpl=component'); ?> "><?php echo $cv_title; ?> </a>
function inviteUser() { JRequest::checkToken() or jexit(JText::_('Invalid Token')); if ($this->_user_cred['search_cvs'] == 0) { $msg = JText::_('COM_JOBBOARD_ENTNOAUTH'); $msgtype = 'error'; return $this->setRedirect(JRoute::_('index.php?option=com_jobboard&view=admin&Itemid=' . $this->_itemid), $msg, $msgtype); } $resend = JRequest::getInt('resend', 0); $data = array('sid' => JRequest::getInt('sid', 0), 'jid' => JRequest::getInt('jid', 0), 'cpid' => JRequest::getInt('cpid', 0), 'message' => JString::Trim(JRequest::getString('message', ''))); require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'jobboard_invite.php'; $has_invite = JobBoardInviteHelper::hasInvite($data['sid'], $data['jid']) ? 1 : 0; $has_applied = JobBoardInviteHelper::getApplId(array('uid' => $data['sid'], 'jid' => $data['jid'])) > 0 ? true : false; if ($has_invite == 0) { if ($this->_umodel->saveInvite($data, $this->_uid) == true) { $msg = JText::sprintf('COM_JOBBOARD_ENT_CREATED', JText::_('COM_JOBBOARD_TXTINVITE')); $msgtype = 'Message'; } else { $msg = JText::sprintf('COM_JOBBOARD_ENT_CREATE_ERR', JText::_('COM_JOBBOARD_TXTINVITE')); $msgtype = 'error'; } } elseif ($resend == 1 && !$has_applied) { $msg = JText::sprintf('COM_JOBBOARD_ENT_SENT', JText::_('COM_JOBBOARD_TXTINVITE')); $msgtype = 'Message'; } else { $msg = JText::sprintf('COM_JOBBOARD_ENT_EXISTS_ERR', JText::_('COM_JOBBOARD_TXTINVITE')) . ': ' . JText::_('COM_JOBBOARD_ENT_JOB') . ' #' . $data['jid']; $msgtype = 'error'; } if ($has_invite == 0 || !$has_applied || $resend == 1) { if (JobBoardInviteHelper::mailInvites($data['sid']) == 1) { JPluginHelper::importPlugin('Jobboard'); $dispatcher =& JDispatcher::getInstance(); $dispatcher->trigger('onSendInvite', array(array('uid' => &$this->_uid, 'sid' => $data['sid'], 'jid' => $data['jid'], 'cpid' => $data['cpid'], 'message' => $data['message']))); } } $app =& JFactory::getApplication(); $app->enqueueMessage($msg, $msgtype); $resend != 1 ? $this->showMyJobs() : $this->showInvites(); }
<span class="grey"> <?php echo JText::_('POSTED'); ?> : <?php echo JHTML::_('date', $row->post_date, $this->day_format . ' ' . $this->month_short_format . ', ' . $this->year_format); ?> </span> </li> </ul> <?php $has_applied = JobBoardInviteHelper::getApplId(array('uid' => $this->sid, 'jid' => $row->id)) > 0 ? true : false; ?> <?php if (!JobBoardInviteHelper::hasInvite($this->sid, $row->id) && !$has_applied) { ?> <form id="frmInvite_<?php echo $incr; ?> " class="frmInvite" method="post" action="<?php echo JRoute::_('index.php?option=com_jobboard&view=admin&task=invite&jid=' . $row->id . '&Itemid=' . $this->itemid); ?> " > <input class="btn-grn right" type="submit" name="submit" value="<?php echo JText::_('COM_JOBBOARD_TXTINVITE') . ' ' . $this->candidate_name; ?> " /> <input type="hidden" name="option" value="com_jobboard" /> <input type="hidden" name="view" value="admin" /> <input type="hidden" name="task" value="invite" />
<?php echo JHTML::_('form.token'); ?> </span> </form> <?php } elseif (!empty($cv_title)) { ?> <?php if ($this->user_auth['manage_applicants'] == 1) { ?> <?php $invite_params = array('uid' => $row->user_id, 'jid' => $row->job_id, 'cpid' => $row->cvprof_id); ?> <?php $aid = JobBoardInviteHelper::getApplId($invite_params); ?> <form id="frmEdAppl_<?php echo $incr; ?> " method="post" action="<?php echo JRoute::_('index.php?option=com_jobboard&view=admin&task=edappl&aid=' . $aid . '&pid=' . $row->cvprof_id . '&Itemid=' . $this->itemid); ?> " > <span class="right"> <input class="btn-blk" type="submit" value="<?php echo ucfirst(JText::_('COM_JOBBOARD_APPLEDIT')); ?> " /> <input type="hidden" name="option" value="com_jobboard" /> <input type="hidden" name="view" value="admin" />