- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Create Custom Forms to add Participants to the CPDB
- luckylokian
- Topic Author
- Offline
- New Member
Less
More
6 years 4 months ago #159919
by luckylokian
Create Custom Forms to add Participants to the CPDB was created by luckylokian
Hi,
I am currently running on the latest stable 2.67.2.
At the moment, I am planning to customize the Entry-Procedure for the CPDB without the need of a CSV Import Step
Several users should be able to add their specific participants by using a previously customized form.
Now I am looking for the best approach.
For example:
A Custom-Attribute-Field "Institution" (Drop-Down) is implemented and the User chooses "Institution XY", the fields Telephone / Address are autofilled by JavaScript for this specific "Institution XY". The assignment of XY and their specfic number/address is handled by JavaScript and a JSON-File on the server.
1. This first approach would require to change the code of the standard form in the backend files...
My first thought was to use a plugin for this, but the lack of CPDB-support in the API prevented this approach.
2. This second approach would involve something like: "Generating a CSV with PHP and transfer this file to the CPDB each time a new participant is added by a user".
3. Probably, the best idea would be to directly interact with the MySQL-DB by a PHP-File and implement it as a plugin to add new participants to the CPDB.
Do you have any advice on this? Should I go with approach three? Are there any massive problems with a direct access to the DB? What happens if multiple Users using the form at the same time?
Thanks a lot!
I am currently running on the latest stable 2.67.2.
At the moment, I am planning to customize the Entry-Procedure for the CPDB without the need of a CSV Import Step
Several users should be able to add their specific participants by using a previously customized form.
Now I am looking for the best approach.
For example:
A Custom-Attribute-Field "Institution" (Drop-Down) is implemented and the User chooses "Institution XY", the fields Telephone / Address are autofilled by JavaScript for this specific "Institution XY". The assignment of XY and their specfic number/address is handled by JavaScript and a JSON-File on the server.
1. This first approach would require to change the code of the standard form in the backend files...
My first thought was to use a plugin for this, but the lack of CPDB-support in the API prevented this approach.
2. This second approach would involve something like: "Generating a CSV with PHP and transfer this file to the CPDB each time a new participant is added by a user".
3. Probably, the best idea would be to directly interact with the MySQL-DB by a PHP-File and implement it as a plugin to add new participants to the CPDB.
Do you have any advice on this? Should I go with approach three? Are there any massive problems with a direct access to the DB? What happens if multiple Users using the form at the same time?
Thanks a lot!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13912
- Thank you received: 2549
6 years 4 months ago #159961
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Create Custom Forms to add Participants to the CPDB
I think i create a specific plugin using
manual.limesurvey.org/NewDirectRequest
+ and
github.com/LimeSurvey/LimeSurvey/blob/ma...dels/Participant.php
+ related models.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- luckylokian
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
6 years 4 months ago #160010
by luckylokian
Replied by luckylokian on topic Create Custom Forms to add Participants to the CPDB
Thank you for fast reply.
I am new to all this Yii-Stuff. Could you specify your answer?
Is there a simple PoC to write a Token to the CPDB by NewDirectRequest?
I try to dive into the Plugin Development by reverse engineering the MassAction-Plugin but it is a little overwhelming....
I am currently able to make Post-Request to my Plugins index.php and getting Data from my Plugins.php.
But I am not sure about the cleanest way to use the Yii-db -Syntax to add a participant and its attributes to the database by given POST-data. (without checking User Permissions)
Thanks in advance
I am new to all this Yii-Stuff. Could you specify your answer?
Is there a simple PoC to write a Token to the CPDB by NewDirectRequest?
I try to dive into the Plugin Development by reverse engineering the MassAction-Plugin but it is a little overwhelming....
I am currently able to make Post-Request to my Plugins index.php and getting Data from my Plugins.php.
But I am not sure about the cleanest way to use the Yii-db -Syntax to add a participant and its attributes to the database by given POST-data. (without checking User Permissions)
Thanks in advance
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13912
- Thank you received: 2549
6 years 4 months ago #160080
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Create Custom Forms to add Participants to the CPDB
I think of maling such plugin since a lot of time, but no client interested, maybe i must make a contribution call for this … (like to have something like
www.bountysource.com
but for non existing project).
You must use Yii Active Record directly
My point of view :
1. Create a completly clean new page (you already done)
2. Add an identification page with user/pass
3. This page just have a "user/password" form
4. To register or update other part : use a LimeSurvey Survey and afterSurveyComplete event
It's free code example. You have other's here : framagit.org/SondagePro-LimeSurvey-plugin
You must use Yii Active Record directly
My point of view :
1. Create a completly clean new page (you already done)
2. Add an identification page with user/pass
3. This page just have a "user/password" form
4. To register or update other part : use a LimeSurvey Survey and afterSurveyComplete event
It's NOT reverse engineering, reverse engineering is when you don't have the source code, but only compiled code. For example LibreOffice dev team must reverse engineering Word to do the .doc adaptation.reverse engineering the MassAction-Plugin
It's free code example. You have other's here : framagit.org/SondagePro-LimeSurvey-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 , plugin development .
I don't answer to private message.
The topic has been locked.