OJS OCS OMP OHS

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
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

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}

            {* INSERTED TO ACCOUNT FOR FUTURE REGISTRATION TYPES (E.G., NON EARLY-BIRD PRICING (SHIMRAH)*}
            {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) *}   
            
            {else}   
               <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}
            {/if}


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

Cheers,
Shimrah
shimrah
 
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.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
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