Welcome to the LimeSurvey Community Forum

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

[Plugin] input type date / override settings

More
7 years 6 months ago - 7 years 6 months 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: 7 years 6 months ago by S0r4.
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
7 years 6 months ago #140831 by ollehar
Replied by ollehar on topic [Plugin] input type date / override settings
Are your complete code open-source and hosted anywhere?

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

I've subscribe on 'beforeSurveySettings' and 'newSurveySettings'.
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
7 years 6 months ago #140834 by ollehar
Replied by ollehar on topic [Plugin] input type date / override settings
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
7 years 6 months 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.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
7 years 6 months ago #140836 by ollehar
Replied by ollehar on topic [Plugin] input type date / override settings
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
7 years 6 months 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.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
7 years 6 months ago #140839 by ollehar
Replied by ollehar on topic [Plugin] input type date / override settings
You need to use 2.5 or 2.06lts, we only update those version.
The topic has been locked.
More
7 years 6 months ago #140840 by S0r4
I currently work on Version 2.50+ Build 160715
The topic has been locked.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
7 years 6 months ago #140841 by ollehar
Replied by ollehar on topic [Plugin] input type date / override settings
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
7 years 6 months 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.
  • ollehar
  • ollehar's Avatar
  • Offline
  • LimeSurvey GmbH Employee
  • LimeSurvey GmbH Employee
More
7 years 6 months ago #140846 by ollehar
Replied by ollehar on topic [Plugin] input type date / override settings
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.

Lime-years ahead

Online-surveys for every purse and purpose