Datepicker plugin - Prevent multiple entries

Mehr
2 Wochen 6 Tage her #171907 von gardalid
gardalid erstellte das Thema Datepicker plugin - Prevent multiple entries
Hello

I am a relatively new developer. I have been tasked with modifying the jquery date-picker for a client. The client wants old entries in the survey date-picker to be disabled, and as such, prevent multiple entries on the same date.


I recon it is possible to gather the data, by registering to specific events and use the API to fetch the data. But is it in anyway possible to pass the data(gathered with php) to the jquery date-picker?


Best regards Sam

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 6 Tage her #171925 von LouisGac
LouisGac antwortete auf das Thema: Datepicker plugin - Prevent multiple entries
"The client wants old entries in the survey date-picker to be disabled"

I don't understand: could you expand please, by giving more details about the use case?

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 5 Tage her #171948 von gardalid
gardalid antwortete auf das Thema: Datepicker plugin - Prevent multiple entries
Hi LuisGac

Our client is a group of doctors (allergy specialists), which use the platform to monitor development of their patients. The patients make a daily entry in the system, answering a few questions about their disease and progress. Some patients will fill out more than one survey each day, if they are being monitored for more than one disease.

The patients will inevitably have some days on which they do not have any irritation or bother from the disease, and will mostly forget to make an entry on these days. For that reason we included a date-based question in the first question-group of each survey, to let patients make entries for earlier days. i.e. the days on which they forgot to make an entry. But the clients problem is, that they want their patients to see which days already have entries.

So the question is, whether it is possible to gather the old dates for a token and a particular survey, and save them in an js object, which can be used to disable old entry dates in the date-picker itself.

We are using the system pretty much 'as is', meaning, that we have not made any changes in our installation, but only use the included features at the moment.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 5 Tage her - 2 Wochen 5 Tage her #171955 von DenisChenu
DenisChenu antwortete auf das Thema: Datepicker plugin - Prevent multiple entries
beforeQuestionRender event since you need to get existing values in your Response table you can't use (i think) twig files from this.

Something like (really speedly done, without any control).
$token = Yii::app()->getRequest()-getPost('token');
$sid = $this->getEvent()->get('surveyId');
$column = $this->getEvent()->get('surveyId').'X'.$this->getEvent()->get('gid')."X".$this->getEvent()->get('qid');
$oResponse = Reponse::model($sid)->findAll("token = :token",array(":token"=>$token));
$listDate = CHtml::listData($oResponse,$id,$column);// Here you have the array of existing date
$script = "//TODO"; // Here you do you javascript
Yii::app()->getClientScript()->registerScript('filterDate'.$this->getEvent()->get('qid'),$script);

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 .
Letzte Änderung: 2 Wochen 5 Tage her von DenisChenu. Begründung: typo + // Here you have the array of existing date
Folgende Benutzer bedankten sich: LouisGac, gardalid

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 4 Tage her #171994 von gardalid
gardalid antwortete auf das Thema: Datepicker plugin - Prevent multiple entries
Hi Denis

On the page with plugin events, it says that the event (BeforeQuestionRender) is available from LS v. 2.05 build 140922. We have the right version, but our build is 140618. Is there any way of updating to a newer build without having to do a version jump?? We would rather not have to redesign our templates(according to the documentation, templates were changed in v 2.5 or 2.6), as our surveys are currently in use. Or is there any other event that could handle our issue and is available in our build? like AfterFindSurvey?

Best regards

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 4 Tage her #171996 von Joffm
Joffm antwortete auf das Thema: Datepicker plugin - Prevent multiple entries
Hi,
here you find the older versions.

You can update to 2.06 to keep the structure of your templates.

https://www.limesurvey.org/downloads/category/24-archived-releases

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Folgende Benutzer bedankten sich: DenisChenu, gardalid

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 4 Tage her #172004 von DenisChenu
DenisChenu antwortete auf das Thema: Datepicker plugin - Prevent multiple entries
Then : with an older version : only solution : make a php script call in ajax.

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 .
Folgende Benutzer bedankten sich: gardalid

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha