- Posts: 70
- Thank you received: 15
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
new PluginEvents afterSurveyActivate, afterSurveyDeactivate
- bismark
- Topic Author
- Offline
- Senior Member
Less
More
5 years 5 months ago #176373
by bismark
new PluginEvents afterSurveyActivate, afterSurveyDeactivate was created by bismark
maybe helpful
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13642
- Thank you received: 2491
5 years 5 months ago - 5 years 5 months ago #176426
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic new PluginEvents afterSurveyActivate, afterSurveyDeactivate
beforeSurveySave allow to test current model VS new model
I already use it to «silently» disable some update …
We already need more better plugin in my opinion : need a real beforeEmail, need a beforeFind, afterFind
Code:
$oSurveyAfterSave = $this->getEvent()->get('model'); $oSurveyBeforeSave = Survey::model()->findByPk($oSurveyAfterSave->sid);
I already use it to «silently» disable some update …
We already need more better plugin in my opinion : need a real beforeEmail, need a beforeFind, afterFind
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 5 months ago by DenisChenu.
The topic has been locked.
- bismark
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 70
- Thank you received: 15
5 years 5 months ago #176445
by bismark
Replied by bismark on topic new PluginEvents afterSurveyActivate, afterSurveyDeactivate
after "beforeSurveyActivate" the Response table survey_123456 will be created. We need to trigger some actions on that event.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
5 years 5 months ago - 5 years 5 months ago #176635
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic new PluginEvents afterSurveyActivate, afterSurveyDeactivate
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 …
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Last edit: 5 years 5 months ago by Mazi.
The topic has been locked.
- bismark
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 70
- Thank you received: 15
5 years 5 months ago #176636
by bismark
Replied by bismark on topic new PluginEvents afterSurveyActivate, afterSurveyDeactivate
for the afterSurveyActivate Event we added some code to activate_helper.php/activateSurvey-function:
for the afterSurveyDeactivate Event we added some code to surveyadmin.php/deactivate-method
Code:
$event = new PluginEvent('afterSurveyActivate'); $event->set('surveyId', $iSurveyID); $event->set('simulate', $simulate); App()->getPluginManager()->dispatchEvent($event); return $aResult;
for the afterSurveyDeactivate Event we added some code to surveyadmin.php/deactivate-method
Code:
$event = new PluginEvent('afterSurveyDeactivate'); $event->set('surveyId', $iSurveyID); App()->getPluginManager()->dispatchEvent($event);
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13642
- Thank you received: 2491
5 years 5 months ago #176731
by DenisChenu
@bismark : pull request can be done.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic new PluginEvents afterSurveyActivate, afterSurveyDeactivate
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 …
@bismark : pull request can be done.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- bismark
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 70
- Thank you received: 15
5 years 5 months ago #176738
by bismark
Replied by bismark on topic new PluginEvents afterSurveyActivate, afterSurveyDeactivate
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13642
- Thank you received: 2491
5 years 5 months ago #176922
by DenisChenu
near beforeSurveySave event :
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic new PluginEvents afterSurveyActivate, afterSurveyDeactivate
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 …
near beforeSurveySave event :
Code:
$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 } }
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.