OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Patch: allow unpaid registrants to re-register for conf.

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page. While these are OJS-specific, the OCS codebase is similar enough to OJS they should be of help. There is also an [url=http://pkp.sfu.ca/ocs_documentation[/url]OCS Documentation[/url] page with some more general documentation that might also be of interest.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a technical support question, try the OCS Technical Support subforum.

Patch: allow unpaid registrants to re-register for conf.

Postby derekp » Wed Mar 19, 2008 3:49 pm

If a user who has already registered for a conference attempts to register again, OCS 2.0.0-1 shows an error message. This patch changes the behaviour of OCS:
  • If a user has registered but not paid, allow the user to re-register.
  • If a user has registered and paid, on the "already registed and paid" error page, also display the registration information and registration manager contact information.
After all, an unpaid registration doesn't really count. :wink:

Code: Select all
--- ocs-2.0.0-1/locale/en_US/locale.xml.reregister      2007-05-16 14:51:17.000000000 -0700
+++ ocs-2.0.0-1/locale/en_US/locale.xml 2008-03-03 15:54:10.530050000 -0800
@@ -456,6 +456,5 @@

        <!-- User self-registration form -->
-       <message key="schedConf.registration.alreadyRegistered">You are already registered for this conference, although payment has not yet been received. Please contact the principal contact in "About" if this is in error or you would like to change your registration.</message>
-       <message key="schedConf.registration.alreadyRegisteredAndPaid">You are already registered for this conference and your registration has been paid. Please contact the principal contact in "About" if this is in error or you would like to change your registration.</message>
+       <message key="schedConf.registration.alreadyRegisteredAndPaid">You are already registered for this conference and your registration has been paid. Please contact the us if
this is in error or you would like to change your registration.</message>
        <message key="schedConf.registration.noPaymentMethodAvailable">Your registration has been recorded. If applicable, you will be contacted regarding payment.</message>
        <message key="schedConf.registration.conferenceFees">Conference Fees</message>
--- ocs-2.0.0-1/pages/schedConf/SchedConfHandler.inc.php.reregister     2008-02-20 21:32:27.000000000 +0000
+++ ocs-2.0.0-1/pages/schedConf/SchedConfHandler.inc.php        2008-03-03 15:49:21.789678000 -0800
@@ -149,20 +149,20 @@
                $user =& Request::getUser();
                $registrationDao =& DAORegistry::getDAO('RegistrationDAO');
+               import('registration.form.UserRegistrationForm');
+
+               $form =& new UserRegistrationForm();
                if ($user && ($registrationId = $registrationDao->getRegistrationIdByUser($user->getUserId(), $schedConf->getSchedConfId()))) {
                        // This user has already registered.
                        $registration =& $registrationDao->getRegistration($registrationId);

-                       if ($registration && $registration->getDatePaid()) $templateMgr->assign('message', 'schedConf.registration.alreadyRegisteredAndPaid');
-                       else $templateMgr->assign('message', 'schedConf.registration.alreadyRegistered');
+                       if ($registration && $registration->getDatePaid()) {
+                               $form->addError(null, 'schedConf.registration.alreadyRegisteredAndPaid');

-                       $templateMgr->assign('backLinkLabel', 'common.back');
-                       $templateMgr->assign('backLink', Request::url(null, null, 'index'));
-                       $templateMgr->display('common/message.tpl');
-               } else {
-                       import('registration.form.UserRegistrationForm');
-
-                       $form =& new UserRegistrationForm();
-                       $form->display();
+                               $templateMgr->assign('alreadyRegistered', true);
+                               $templateMgr->assign('backLinkLabel', 'common.back');
+                               $templateMgr->assign('backLink', Request::url(null, null, 'index'));
+                       }
                }
+               $form->display();
        }

@@ -179,6 +179,11 @@
                $registrationDao =& DAORegistry::getDAO('RegistrationDAO');
                if ($user && ($registrationId = $registrationDao->getRegistrationIdByUser($user->getUserId(), $schedConf->getSchedConfId()))) {
-                       // User is already registered. Redirect to a message explaining.
-                       Request::redirect(null, null, null, 'registration');
+                       $registration =& $registrationDao->getRegistration($registrationId);
+
+                       if ($registration && $registration->getDatePaid())
+                               // User is already registered. Redirect to a message explaining.
+                               Request::redirect(null, null, null, 'registration');
+                       else
+                               $registrationDao->deleteRegistrationById($registrationId);
                }

--- ocs-2.0.0-1/templates/registration/userRegistrationForm.tpl.reregister      2007-05-16 12:09:51.000000000 -0700
+++ ocs-2.0.0-1/templates/registration/userRegistrationForm.tpl 2008-03-03 15:49:21.811680000 -0800
@@ -26,4 +26,5 @@
 {/if}

+{if !$alreadyRegistered}
 <h3>{translate key="schedConf.registration.conferenceFees"}</h3>

@@ -250,4 +251,5 @@

 <div class="separator"></div>
+{/if} {* alreadyRegistered *}

 {if $schedConfSettings.registrationName}
@@ -280,5 +282,9 @@
 {/if}{* if displaying reg manager info *}

+{if $alreadyRegistered}
+<p>&#187; <a href="{$backLink}">{translate key="$backLinkLabel"}</a></p>
+{else}
 <p><input type="submit" value="{translate key="schedConf.registration.register"}" {if !$registrationMethodAvailable}disabled="disabled" class="button" {else}class="button defaultButton" {/if}/></p>
+{/if}

 </form>
derekp
 
Posts: 16
Joined: Wed Oct 10, 2007 12:45 am
Location: University of British Columbia

Re: Patch: allow unpaid registrants to re-register for conf.

Postby asmecher » Sat Mar 22, 2008 4:40 am

Hi Derek,

FYI, this has already been fixed in CVS -- see http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=3166.

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


Return to OCS Development

Who is online

Users browsing this forum: No registered users and 1 guest