OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Required Registration Option with Registrant Report

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Required Registration Option with Registrant Report

Postby jcurtis » Tue Jul 16, 2013 6:36 am

Howdy!

I'm looking to add a Registration Option is called "Presentation Type", which could either be "Poster Presentation", "Oral Presentation", or "Not Presentation". A person registering should only be able to choose one of those items.

What would be the best way to go about this?
It is essential that this information is displayed in the downloadable "Registrant Report" under "Stats and Reports", so I'm wondering how OCS stores the information regarding whether a registrant checked an registration option or not.

This is a continuation from my previous post: http://pkp.sfu.ca/support/forum/viewtopic.php?f=3&t=10127

Thanks!
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Option with Registrant Report

Postby asmecher » Wed Jul 17, 2013 4:07 pm

Hi James,

Are you using registration options for anything else? If you change the control from a checkbox to a radio control it'll mean only one can be chosen, but of course you won't be able to use that feature in any other configuration.

If that's satisfactory, you should be able to edit templates/registration/userRegistrationForm.tpl and change "<input type="checkbox" ..." into "<input type="radio" ..." for the parts of the code relating to registration options. This shouldn't require any changes to the registrant report.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8668
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Option with Registrant Report

Postby jcurtis » Thu Jul 18, 2013 4:24 am

Hi Alec!

In addition to presentation type, there is one more required option "Meal Choice" (Again, they can choose from three options) and several optional options (such as T-shirts and Social Events).

I realize that I can create options through the database and then write a form validation with Javascript to only have one of the three checked. I would like to avoid this as it would have to be done for every conference (9 of them) and has the potential to break quite easily once the options get high enough.

Thanks,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Option with Registrant Report

Postby asmecher » Thu Jul 18, 2013 9:20 am

Hi James,

I'm starting to think a simple adaptation of Registration Options probably isn't the best solution, given the variety of things you'd like to use it for.

Fortunately, we do have some custom code that is aimed at solving the same sort of problem. Note that this solution *does not* interact with registration fees, i.e. what the user chooses will not affect the cost of their registration; in those cases you should stick with registration options. Also, the options selected with this modification will not currently be included in the registration report; that'll require a little bit of additional work. (Currently the field values are displayed in the Conference Manager's "Registrations" interface.)

This functionality allows the conference manager to build new form elements for the registration form.

(NOTE: This patch is deprecated in favour of one further down the thread. Please use the later one.)

Regards,
Alec Smecher
Public Knowledge Project Team
Attachments
registration-forms.sql.txt
SQL to create additional tables
(1.42 KiB) Downloaded 35 times
registration-forms.diff
Patch to add registration form functionality [DEPRECATED: See below]
(71.1 KiB) Downloaded 57 times
asmecher
 
Posts: 8668
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Option with Registrant Report

Postby jcurtis » Mon Jul 22, 2013 6:08 am

Hi Alec!

How do I go about adding these files to OCS?

Do I just query the SQL in my database and add the registration forms.diff to the templates/registration file?

Thanks,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Option with Registrant Report

Postby asmecher » Mon Jul 22, 2013 9:22 am

Hi James,

The SQL file needs to be executed in your MySQL client, e.g. phpMyAdmin or using the mysql command-line tool. The .diff file is a patch, and needs to be applied using the "patch" tool, typically on the command line. (Search the forum for information on applying patches; there are a few explanatory posts.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8668
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Option with Registrant Report

Postby jcurtis » Tue Jul 23, 2013 9:31 am

Hi Alec,

I tried using the command line and one of the "Patch tool's" from a previous post I saw about OJS patches, but I was unable to apply their solution.

I am running OCS on my web space. I made a copy of it onto my desktop where I added the .diff file and the "Patch tool" to the root directory.

Using the command line I find the root file directory and then entered: patch -p0 < anyName.patch (anyName.patch being the name of the .diff file). The Command line then states:
"can't find file to patch at input 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------------------------
diff --git a/classes/core/Application.inc.php b/classes/core/Application.inc.php
index 38d9092..75957ec 100644
--- a/classes/core/Application.inc.php
+++ b/classes/core/Application.inc.php
------------------------------------------------
File to patch:"

I tried using one of the file names that were in the .diff file, but it was rejected. Do I have to apply the .diff file to every file that needs to be changed?

And with the OCS already installed on my webspace, will this be a problem?

Thanks,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Option with Registrant Report

Postby asmecher » Tue Jul 23, 2013 10:38 am

Hi James,

If you're in the OCS installation's base directory (the one containing the config.inc.php file) you ought to be able to run:
Code: Select all
patch -p1 --dry-run < /path/to/registration-forms.diff
If it works, you should get something like the following:
Code: Select all
patching file classes/core/Application.inc.php
patching file classes/manager/form/RegistrationFormElementForm.inc.php
patching file classes/registration/form/RegistrationForm.inc.php
patching file classes/registration/form/UserRegistrationForm.inc.php
patching file classes/registrationForm/RegistrationFormElement.inc.php
patching file classes/registrationForm/RegistrationFormElementDAO.inc.php
patching file classes/registrationForm/RegistrationFormResponse.inc.php
patching file classes/registrationForm/RegistrationFormResponseDAO.inc.php
patching file dbscripts/xml/ocs_schema.xml
patching file locale/en_US/locale.xml
patching file pages/manager/RegistrationFormHandler.inc.php
patching file pages/manager/index.php
patching file templates/manager/index.tpl
patching file templates/manager/registrationForms/previewRegistrationForm.tpl
patching file templates/manager/registrationForms/registrationFormElementForm.tpl
patching file templates/manager/registrationForms/registrationFormElements.tpl
patching file templates/registration/registrationForm.tpl
Hunk #1 succeeded at 127 with fuzz 1.
patching file templates/registration/userRegistrationForm.tpl

There are no error messages here, so I can run it again without the --dry-run option:
Code: Select all
patch -p1 < /path/to/registration-forms.diff
I suspect you're missing the -p1 option in your case, which means patch is looking in the wrong place when trying to modify files.

If it runs successfully, it should apply changes to many files according to the instructions in the patch file; the list above (you should get the same in your own case) will then tell you what files were modified e.g. so you can upload them to your server if need be.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8668
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Option with Registrant Report

Postby jcurtis » Wed Jul 24, 2013 5:55 am

Hi Alec,
Code: Select all

I haven't seem to have any luck yet. When I enter the code, all that happens is the patch.exe located in the OCS root folder opens with nothing written inside. And nothing in the command line either.

My code looks like this:
Code: Select all
C:\Users\James\Desktop\wamp\www\conferences>patch -p1 --dry-run < registration-forms.diff

The registration-forms.diff file being in the OCS root file: C:\Users\James\Desktop\wamp\www\conferences

I also tried running command line as the "Administer" and I got the error
Code: Select all
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

And then the application terminates

I also tried:
Code: Select all
patch -p1 --dry-run --binary < registration-forms.diff

When I did that, it looked like it patched many files but, but there are also lots of "1 out of 1 hunk FAILED" aswell, so I'm not sure it worked 100%

Any Ideas?

Thanks!
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Option with Registrant Report

Postby asmecher » Wed Jul 24, 2013 9:49 am

Hi James,

This error message:
Code: Select all
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
...is documented here.

If hunks are failing, that's a problem. The output didn't get posted above; could you post it? Perhaps if you try correcting the line endings (see the link above) that'll correct the problem.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8668
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Option with Registrant Report

Postby jcurtis » Fri Jul 26, 2013 6:29 am

Hi Alec,

I downloaded a new version of OCS (one that I hadn't tampered with) and the patch worked fine.

As I was testing out the new registration forms, I found a problem with the database with the table "registration_form_responses". When there is one registrant signed up for the conference and another person goes to register for the conference, the information of the new registrant overwrites the information of the previous registrant.

Is this how the system is meant to work? or have I encounter an unexpected error?

Thanks,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Option with Registrant Report

Postby asmecher » Fri Jul 26, 2013 2:20 pm

Hi James,

That doesn't sound like intended behavior. Can you post a step-by-step description of what you did and what you saw?

Thanks,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8668
Joined: Wed Aug 10, 2005 12:56 pm

Re: Required Registration Option with Registrant Report

Postby jcurtis » Mon Jul 29, 2013 6:51 am

Hi Alec,

After I completed the patch process using
Code: Select all
patch -p1 --binary < registration-forms.diff


I uploaded the new OCS Installation with the patch to my web space. As I already have an OCS database setup (with the new tables), I changed some information in the config.inc.php file. I changed the "Installed" to "on" and I changed the database information to meet the database I'm currently using.

From there I went to the URL in my browser and created a new test account and registered for the conference as that user. I created a second new user and registered for the same conference. But the information of the first person was overwritten in the database.

Those are all the steps that I took to install the patch. I have another installation of OCS that is using the same database, but I do not think that is the problem (The one installation will be removed once the new one is up to date).

Thanks,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Option with Registrant Report

Postby jcurtis » Wed Jul 31, 2013 8:58 am

Howdy!

So I had an IT consultant with many years of programming experience install the patch with a blank version of OCS. When he uploaded OCS to the web space, he had the same problem that I also had.

When a second registrant goes to register for a conference the information in the table "registration_form_responses" for the first registrant is over written by the second registration.

Could this still be an error on my side? Are there other conferences that have tried to apply this patch or am I the first?

Thanks,
James Curtis
jcurtis
 
Posts: 45
Joined: Wed May 29, 2013 10:19 am

Re: Required Registration Option with Registrant Report

Postby asmecher » Wed Jul 31, 2013 10:19 am

Hi James,

This has been on my list to look into, but unfortunately that list is long. I found a bug that results in the behavior you saw. See the attached patch (one to fix the above patch, another complete patch for if you're applying this from scratch).

Regards,
Alec Smecher
Public Knowledge Project Team
Attachments
registration-forms.sql.txt
SQL for registration forms modification (same as above)
(1.42 KiB) Downloaded 51 times
registration-forms.diff
Updated complete patch for registration forms
(71.07 KiB) Downloaded 53 times
registration-forms-fix.diff
Fix for earlier registration forms diff
(1.18 KiB) Downloaded 31 times
asmecher
 
Posts: 8668
Joined: Wed Aug 10, 2005 12:56 pm

Next

Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron