- Posts: 70
- Thank you received: 15
Ask the community, share ideas, and connect with other LimeSurvey users!
$oSurveyAfterSave = $this->getEvent()->get('model'); $oSurveyBeforeSave = Survey::model()->findByPk($oSurveyAfterSave->sid);
Hi Denis, does that mean that you have already created some lines of code for supporting an event like afterSurveyActivate?DenisChenu wrote: I already use it to «silently» disable some update …
$event = new PluginEvent('afterSurveyActivate'); $event->set('surveyId', $iSurveyID); $event->set('simulate', $simulate); App()->getPluginManager()->dispatchEvent($event); return $aResult;
$event = new PluginEvent('afterSurveyDeactivate'); $event->set('surveyId', $iSurveyID); App()->getPluginManager()->dispatchEvent($event);
Yes, but i use Permission event (testing the controller and POST value); Only for before activate.Mazi wrote:
Hi Denis, does that mean that you have already created some lines of code for supporting an event like afterSurveyActivate?DenisChenu wrote: I already use it to «silently» disable some update …
Oh, got it : find it in another projectMazi wrote:
Hi Denis, does that mean that you have already created some lines of code for supporting an event like afterSurveyActivate?DenisChenu wrote: I already use it to «silently» disable some update …
$savedSurvey = $this->getEvent()->get("model"); if($savedSurvey->sid && $savedSurvey->active == "Y") { $oldSurvey => Survey::model()->findByPk($savedSurvey->sid); if($oldSurvey && $oldSurvey->active != "Y") { // We are before survey is activated, after response DB created } }