Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Adding a mandatory check before allowing activation

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 5 months ago #190693 by Jmantysalo
I want to force users to set up some expiration date for every survey. I am able to make a plugin that makes use of beforeSurveyActivate-hook and can get the ID of the survey by $this->getEvent()->get('surveyId'). But how to get the expiration date from that?
The topic has been locked.
  • gabrieljenik
  • gabrieljenik's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 5 months ago #190694 by gabrieljenik
Replied by gabrieljenik on topic Adding a mandatory check before allowing activation
Given that surveyId, you should fetch the survey model and get the expiration date attribute from it.

Something like this:
>>>
$S = Survey::model()->findByPk($iSurveyID);
$expirationDate = $S->expires
>>>

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .

The following user(s) said Thank You: Jmantysalo
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 5 months ago #190696 by Jmantysalo
Thanks, this works.

Somewhat hard to find instructions for developing plugins. LimeSurvey itself is great!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose