LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
04751User patchesOtherpublic2010-11-19 19:042012-06-21 14:14
ReporterCrystalBlood 
Assigned Toc_schmitz 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
Product Version1.90 
Target VersionFixed in Version2.00 
Summary04751: Adding attribute fields in the register form of a survey
DescriptionArouse the need in the registration form of a survey, that the custom attributes could be filled up in the form (only appear names and e-mail), currently this can be achieved loggin in and add manually the "participant" with the custom attributes.

So, i found in the common.php and register.php (common_functions.php and register.php in the limesurvey_dev repository) some commented code that meets my needs, and realized that it code was taking the approach, as the "static way".

I write some code, and now works like a charm, regardless of the number of attributes that exist.

See .diff's attached.
Additional InformationAbout the implementation, in the common_functions.php i use the function GetTokenFieldsAndNames to get the custom attributes as hash map, and for each key (name of the field) its generate a html input tag concatenating the word "register_" with the key.

In the register.php we calculate the extra number of custom attributes with the name of the field, and dinamically appends to the insert sql statement.

It's a fast solution, but we call two times the function GetTokenFieldsAndNames.
TagsNo tags attached.
LimeSurvey build number OR git commit ID9459
Attached Filespatch file icon patch_crystalblood.patch [^] (4,100 bytes) 2010-11-19 19:04 [Show Content]

- Relationships

-  Notes
User avatar (13588)
Mazi (developer)
2010-11-23 16:02

Carsten, this is an often requested feature by our users. Can you please have a look?!

Thanks!
User avatar (13592)
CrystalBlood (reporter)
2010-11-23 17:44

What do yo think about te code attached? you consider that may help? it works for me.. 8-)
User avatar (13597)
c_schmitz (administrator)
2010-11-23 19:22
edited on: 2010-11-23 19:44

In general it looks okay, but the patch assumes that by default all attribute fields are visible in the register page. There should be a way to configure what fields are visible in the rgister page (would be best in the attribute field configuration). Could you do that?

Please note that we feature-freeze for 1.91 soon so we would need your updated patch within the next 5 days.

User avatar (13602)
CrystalBlood (reporter)
2010-11-24 21:38
edited on: 2010-11-25 15:31

It will be a honor to help, to accomplish this task i propose to add another field in the tokens_xxxx table, with the syntax simmilar to the attributes fields, something like this:

attribute_1=yes
attribute_2=no
attribute_3=yes

So it's a way to show the fields in the registration form (register.php) and in the tokens management (tokens.php), we display with a checbox if shows or not.

Another idea?

Now i find myself with little time (finals in college), i don't think that 5 days will be sufficient, but if you want i'll do it! sooner or later.. hehe

User avatar (13815)
CrystalBlood (reporter)
2010-12-20 00:51

Now i'm free, and i have time if you wish i'll acomplish this issue!

Another proposal may could be adding to the existing extra attribute field another token after the value, something like this:

attribute_1=College=yes
attribute_2=Phone Number=no
attribute_3=Social Number=yes

what do you think?

Greetings!
User avatar (13816)
c_schmitz (administrator)
2010-12-20 16:28

I think that sounds great. Make sure your patch will be based on
https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev [^] and it should be created with SVN diff.

Also make sure it is backward compatible (defaults to 'no') after the installation was upgraded.
User avatar (14459)
Mazi (developer)
2011-03-17 23:16

CrystalBlood, any news on this? It would be really great to have this feature at one of the next Limesurvey versions.
User avatar (14581)
c_schmitz (administrator)
2011-03-28 02:28

CrystalBlood?
User avatar (14586)
CrystalBlood (reporter)
2011-03-28 13:31

Sorry c_schmitz and Mazi!
I'm in college exams!
My activities on this issue were frozen for a moment.
No problem if you wait a little longer? or you are in a great hurry?
User avatar (14588)
Mazi (developer)
2011-03-28 15:34

Thanks for getting back in touch with us. We prefer a tested, working solution so there is no problem if it takes a little longer. We are very happy that you are working on this!

- Issue History
Date Modified Username Field Change
2010-11-19 19:04 CrystalBlood New Issue
2010-11-19 19:04 CrystalBlood File Added: patch_crystalblood.patch
2010-11-23 16:02 Mazi Note Added: 13588
2010-11-23 16:02 Mazi Assigned To => c_schmitz
2010-11-23 16:02 Mazi Status new => assigned
2010-11-23 17:44 CrystalBlood Note Added: 13592
2010-11-23 19:22 c_schmitz Note Added: 13597
2010-11-23 19:44 c_schmitz Note Edited: 13597 View Revisions
2010-11-23 22:08 c_schmitz Status assigned => feedback
2010-11-24 21:38 CrystalBlood Note Added: 13602
2010-11-24 21:38 CrystalBlood Status feedback => assigned
2010-11-25 15:31 CrystalBlood Note Edited: 13602 View Revisions
2010-12-20 00:51 CrystalBlood Note Added: 13815
2010-12-20 16:28 c_schmitz Note Added: 13816
2011-03-17 23:16 Mazi Note Added: 14459
2011-03-28 02:28 c_schmitz Note Added: 14581
2011-03-28 02:28 c_schmitz Status assigned => feedback
2011-03-28 13:31 CrystalBlood Note Added: 14586
2011-03-28 13:31 CrystalBlood Status feedback => assigned
2011-03-28 15:34 Mazi Note Added: 14588
2012-06-21 14:14 c_schmitz Status assigned => closed
2012-06-21 14:14 c_schmitz Resolution open => fixed
2012-06-21 14:14 c_schmitz Fixed in Version => 2.00


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker