You are viewing the PKP Support Forum | PKP Home Wiki

future registration types

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.

future registration types

Postby shimrah » Thu Nov 15, 2007 10:24 am

Hi there,

I added a bit of code to userRegistrationForm.tpl that I thought others might find useful.

The case: as with most conferences, we have both Early Bird and Normal pricing for registration. The Early Bird pricing starts now, and the Normal in the future (in this case, February 27th) when the Early Bird pricing stops. I put all of the pricing in, but the Normal pricing appears in userRegistrationForm.tpl as "Registration Closed [EndDate]".

This didn't really make sense, as the pricing was set to open and close in the future. A little peek at the .tpl revealed that for any Registratino Type that didn't have a start date >today and end date < today, it was assumed that the type had closed. This bit of code fixes that:

Code: Select all
            {if strtotime($registrationType->getOpeningDate()) < time() && strtotime($registrationType->getClosingDate()) > time()}
               {assign var="registrationMethodAvailable" value=1}
               <input type="radio" name="registrationTypeId" {if $registrationTypeId == $registrationType->getTypeId() || (!$registrationTypeId && $isFirstRegistrationType)}checked="checked" {/if} value="{$registrationType->getTypeId()|escape}" />
               {$registrationType->getCost()|escape} {$registrationType->getCurrencyCodeAlpha()|escape}
               {translate key="schedConf.registration.typeCloses" closingDate=$registrationType->getClosingDate()|date_format:$dateFormatShort}
               {assign var="isFirstRegistrationType" value=false}

            {elseif strtotime($registrationType->getOpeningDate()) > time()}
               <input type="radio" name="registrationTypeId" value="{$registrationType->getTypeId()|escape}" disabled="disabled" />
               {$registrationType->getCost()|escape} {$registrationType->getCurrencyCodeAlpha()|escape}
               {translate key="schedConf.registration.typeFuture" closingDate=$registrationType->getOpeningDate()|date_format:$dateFormatShort}
            {* END INSERTION  (SHIMRAH) *}   
               <input type="radio" name="registrationTypeId" value="{$registrationType->getTypeId()|escape}" disabled="disabled" />
               {$registrationType->getCost()|escape} {$registrationType->getCurrencyCodeAlpha()|escape}
               {translate key="schedConf.registration.typeClosed" closingDate=$registrationType->getClosingDate()|date_format:$dateFormatShort}

Oh, and the addition of a phrase in locale.xml:

Code: Select all
   <message key="schedConf.registration.typeFuture">(Registration Opening {$closingDate})</message>

That's it, I guess. I'm a bit new to this forum (and the process of submitting code), so let me know if there's a more official way to do this and have it implemented in future versions.

Assuming, of course, that I'm not fixing a problem that's already been fixed. :S

Posts: 45
Joined: Thu Apr 05, 2007 10:01 am

Re: future registration types

Postby asmecher » Fri Nov 16, 2007 1:30 pm

Hi Shimrah,

Thanks for contributing! I've created a Bugzilla entry for this with a slightly modified patch; see http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=3154. If you get the chance to test this patch, please do.

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

Return to OCS Development

Who is online

Users browsing this forum: No registered users and 0 guests