survey activation event and adding content to survey overview

More
1 week 2 days ago #171135 by mindau
mindau created the topic: survey activation event and adding content to survey overview
Hello, I'm developing survey url shortener plugin (based on Bitly api ) and encountered some problems.

from the manual beforeSurveyActivate event is not yet released. For short url generation im using beforeSurveySettingsSave event. . beforeSurveyActivate event checks if survey is active or not and if active then beforeSurveyActivate calls short url generation. This solution is not best, because I must to click "save" on the survey if I want to generate a short url. Can I use any other event that suits better?

Second question is if i can somehow put new generated url into Overview tab under default survey url?

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #171137 by DenisChenu
DenisChenu replied the topic: survey activation event and adding content to survey overview
About beforeSurveyActivate : seems manual is outdated github.com/LimeSurvey/LimeSurvey/blob/af...vate_helper.php#L267

Else, sometimes i use manual.limesurvey.org/Plugin_events#Model_Events to know what happen.

For «put new generated url into Overview» : only javascript solution

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #171208 by mindau
mindau replied the topic: survey activation event and adding content to survey overview
Thank you, beforeSurveyActivate works indeed!

Now I'm struggling with short URL display solution.


I think I can use beforeSurveyBarRender() event to check if survey is activated & short url is generated and if yes -> then append short url with javascript in right place.

But how can I inject JS from plugin class?

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #171217 by DenisChenu
DenisChenu replied the topic: survey activation event and adding content to survey overview
framagit.org/Shnoulle/insertAdminJS/blob...nsertAdminJS.php#L49

beforeControllerAction , you can restrict to admin + survey for example

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #171232 by mindau
mindau replied the topic: survey activation event and adding content to survey overview
Thank you for your help. I solved this with beforeSurveyBarRender instead of beforeControllerAction, because i have better control and information of survey.

I will upload my plugin later to github and post it in forum.

My plugin uses Bitly shortener api. After activation bitly url is posted to overview also.

Just one quick question.

Based on Plugins_-_advanced Manual settings could have also readOnly option. But its somehow does not work. I tried true, 1 "1","true" but I can edit it anyway

... array(
'type' => 'string',
'readOnly' => true
.....

Please Log in or Create an account to join the conversation.

More
1 week 16 hours ago - 1 week 15 hours ago #171244 by DenisChenu
DenisChenu replied the topic: survey activation event and adding content to survey overview
I never use beforeSurveyBarRender , maybe i must look at it , thank you.

About the issue : did you try
'htmlOptions'  => array(
'readonly' => true,
),

Remind : you need to save yourself the settings in manual.limesurvey.org/NewSurveySettings

PS about the readOnly : strange : code is here : github.com/LimeSurvey/LimeSurvey/blob/d3...tingsWidget.php#L611 Please , report the issue with an example plugin.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 1 week 15 hours ago by DenisChenu.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!