Welcome to the LimeSurvey Community Forum

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

[Plugin] input type date / override settings

More
9 years 2 weeks ago - 9 years 2 weeks ago #140830 by S0r4
Hello all,

I am currently working on some plugins for limesurvey and I have some issues on that :/
I try to add an input type date on the survey properties "General settings and texts" but I couldn't found the 'type' to refer ...
Code:
$event->set("surveysettings.{$this->id}", array(
            'name' => "Test date name",
            'settings' => array(
                'testDateId' => array(
                    'type' => '?????', // I've tried stuff like 'datetimepicker', 'date', 'time', 'datetime', ...
                    'label' => 'Test date label :',
                    'current' => $this->get('message', 'Survey', $event->get('survey'))
                )
            )
         ));

And I also want to override some settings like "Allow backward navigation" to change its default value with the plugin. (so settings overrided can be desactivated easly). But I don't have any idea on how to do that and I don't found anything on the documentation (I assume that's because I am not confident with Limesurvey plugins developpement).

Thanks for your advices.

S0r4
Last edit: 9 years 2 weeks ago by S0r4.
The topic has been locked.
More
9 years 2 weeks ago #140831 by ollehar
Are your complete code open-source and hosted anywhere?

What event are you using?
The topic has been locked.
More
9 years 2 weeks ago #140833 by S0r4
Nop I just work in local for now.

I've subscribe on 'beforeSurveySettings' and 'newSurveySettings'.
The topic has been locked.
More
9 years 2 weeks ago #140834 by ollehar
The documentation can be lacking. Did you try to grep the LS source-code for "newSurveySettings"? Maybe the types are there.
The topic has been locked.
More
9 years 2 weeks ago #140835 by S0r4
Yes already tried, I only found my code and an exemple found on limesurvey forum made by Denis Chenu.
But It didn't have a 'date' exemple in there.
The topic has been locked.
More
9 years 2 weeks ago #140836 by ollehar
It's possible support for date is not yet added. We can add it now, if so. Do you have a link to that example by Denis?
The topic has been locked.
More
9 years 2 weeks ago #140837 by S0r4
Sorry, have to refound it : framagit.org/Shnoulle/exampleSettings/bl.../exampleSettings.php

If it's possible to add a date input for plugin in a next build I think it will be really helpfull :)
The topic has been locked.
More
9 years 2 weeks ago #140839 by ollehar
You need to use 2.5 or 2.06lts, we only update those version.
The topic has been locked.
More
9 years 2 weeks ago #140840 by S0r4
I currently work on Version 2.50+ Build 160715
The topic has been locked.
More
9 years 2 weeks ago #140841 by ollehar
Does any setting work for you? As I can see, the file tabPluginsettings_view has been removed, or was never there.

In file editSurvey_view:

33 $controller->renderPartial('/admin/survey/subview/tabPluginSettings_view',$data);
The topic has been locked.
More
9 years 2 weeks ago #140843 by S0r4
Whitch settings did you talk about ? For what I see, all limesurveys settings are working.

The text input I add with a plugin is visible and only suffer some design issue, but I didn't try to implement any serialization of this input so it was not saved.


I see the line on the code I have :

33 $controller->renderPartial('/admin/survey/subview/tabPluginSettings_view',$data);
The topic has been locked.
More
9 years 2 weeks ago #140846 by ollehar
The latest commit implements a datepicker. Use type 'date'. You can either wait for the next release or use git pull.
The topic has been locked.
More
9 years 2 weeks ago #140848 by S0r4
I get the master, the input 'date' works, the design is good but there is no dynamic "calendar" interaction (there is only the input design).
I will try to wait for a final release of this feature.

Thanks a lot :)
The topic has been locked.
More
9 years 2 weeks ago #140849 by ollehar
No calendar popup? There should be. Maybe you need to clear your tmp/ folder.
The topic has been locked.
More
9 years 2 weeks ago #140850 by S0r4
I just cleared those folders :

tmp/assets
tmp/runtime
tmp/upload

The popup style doesn't show.
I don't have any error on chrome js debug, and the others date works (on the original survey settings startDate, endDate).
The topic has been locked.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose