function integrateRegistrationWithPType() { $aecExists = XiptLibAec::isAecExists(); $payplansExists = XiptLibPayplans::isPayplansExists(); $subs_integrate = XiptFactory::getSettings('subscription_integrate', 0); $integrate_with = XiptFactory::getSettings('integrate_with', 0); $show_ptype_during_reg = XiptFactory::getSettings('show_ptype_during_reg', 0); $selectedProfiletypeID = $this->isPTypeExistInSession(); if ($show_ptype_during_reg) { $link = "index.php?option=com_xipt&view=registration"; // pType not selected : send to select profiletype if (!$selectedProfiletypeID) { $this->app->redirect(XiptRoute::_("index.php?option=com_xipt&view=registration", false)); return; } // pType already selected if ($aecExists && $subs_integrate && $integrate_with == 'aec') { $url = XiptRoute::_('index.php?option=com_acctexp&task=subscribe', false); $msg = XiptLibAec::getAecMessage(); if ($msg != false) { $link = '<a id="xipt_back_link" href=' . $url . '>' . XiptText::_("CLICK_HERE") . '</a>'; $this->app->enqueueMessage($msg . ' ' . $link); } return; } else { $url = XiptRoute::_('index.php?option=com_xipt&view=registration&ptypeid=' . $selectedProfiletypeID . '&reset=true', false); $selectedpTypeName = XiptLibProfiletypes::getProfiletypeName($selectedProfiletypeID); $msg = sprintf(XiptText::_('CURRENT_PTYPE_AND_CHANGE_PTYPE_OPTION'), $selectedpTypeName); $link = '<a id="xipt_back_link" href=' . $url . '>' . XiptText::_("CLICK_HERE") . '</a>'; $this->app->enqueueMessage($msg . ' ' . $link); return; } } else { if ($subs_integrate) { if ($payplansExists && $integrate_with == 'payplans') { $url = XiptRoute::_('index.php?option=com_payplans&view=plan', false); $msg = XiptLibPayplans::getPayplansMessage(); if ($msg != false) { $link = '<a id="xipt_back_link" href=' . $url . '>' . XiptText::_("CLICK_HERE") . '</a>'; $this->app->enqueueMessage($msg . ' ' . $link); } return; } } } // if pType is not set, collect default pType // set it in session if (!$selectedProfiletypeID) { $pType = $this->getRegistrationPType(); $this->setDataInSession('SELECTED_PROFILETYPE_ID', $pType); return; } return; }
function event_com_xipt_registration_blank() { $app = JFactory::getApplication(); $subs_integrate = XiptFactory::getSettings('subscription_integrate', 0); $integrate_with = XiptFactory::getSettings('integrate_with', 0); if (!$subs_integrate) { return false; } //when integrated with AEC, set PT in session as per plan. if ($integrate_with == 'aec') { if (!XiptLibAec::isAecExists()) { return false; } // find selected profiletype from AEC $aecData = XiptLibAec::getProfiletypeInfoFromAEC(); // as user want to integrate the AEC so a plan must be selected // send user to profiletype selection page if ($aecData['planSelected'] == false) { $app->redirect(XiptRoute::_('index.php?option=com_acctexp&task=subscribe', false), XiptText::_('PLEASE_SELECT_AEC_PLAN_IT_IS_RQUIRED')); } // set selected profiletype in session $this->_pluginHandler->mySess->set('SELECTED_PROFILETYPE_ID', $aecData['profiletype'], 'XIPT'); } //when integrated with Payplans, no need to set PT in session //payplans itself set PT in session if ($integrate_with == 'payplans') { if (!XiptLibPayplans::isPayplansExists()) { return false; } // find selected profiletype from Payplans $payplansData = XiptLibPayplans::getProfiletypeInfoFromPayplans(); // as user want to integrate the Payplans so a plan must be selected // send user to profiletype selection page if ($payplansData['planSelected'] == false) { $app->redirect(XiptRoute::_('index.php?option=com_payplans&view=plan', false), XiptText::_('PLEASE_SELECT_AEC_PLAN_IT_IS_RQUIRED')); } } $app->redirect(XiptHelperJomsocial::getReturnURL()); return true; }
function isApplicable() { return XiptLibPayplans::isPayplansExists(); }