Stump the Panel: SharePoint Q&A

Immediate solutions for common SharePoint questions
It is currently Fri May 24, 2013 8:38 am

All times are UTC - 5 hours [ DST ]


Forum rules


What you are viewing is an archive of Stump the Panel. It remains for reference purposes. Please post all new questions on NothingButSharePoint.com
https://www.nothingbutsharepoint.com/sites/eusp/Forum



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Employee Training XSLT
PostPosted: Thu Apr 07, 2011 12:48 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
I have slightly modified the employee training template. Now I have some issue
1. When the user click the title , it takes to the registration page when the available seats >0 it is not showing or enrolling the user it just display the wrong template which is
<xsl:otherwise>
<tr><td class="ms-standardheader ms-WPTitle" nowrap="">
Currently this class is full and you are not registered to attend this Class.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
Sorry, but to register for <xsl:value-of select="$SessionTitle" />. Please contact the Instructor/Administrator for additional information.
</td></tr>

The full template code as follows


[size=50]<xsl:choose>
<xsl:when test="$RegistrationOver">
<tr><td class="ms-standardheader ms-WPTitle" nowrap="">
Class registration has completed - thank you for your interest.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
<a href="http://s0f3ab9/SITES/LEARNING/TRAININGHUB/Pages/default.aspx">Click here to return</a> to the site home page.
</td></tr>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$AlreadyRegistered">
<tr><td class="ms-standardheader ms-WPTitle" nowrap="">
You are currently registered to attend this class.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
Your registration for <xsl:value-of select="$SessionTitle" /> has been confirmed.
Please plan on arriving at <xsl:value-of select="ddwrt:FormatDate(string($SessionStartTime), 1033, 5)" />.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
<a href="http://s0f3ab9/SITES/LEARNING/TRAININGHUB/Pages/default.aspx">click here to return</a> to the site home page.
<xsl:call-template name="dvt_2.body">
<xsl:with-param name="Rows" select="$Rows"/>
</xsl:call-template>
</td></tr>
</xsl:when>
<xsl:when test="$IsAvailableSeats &gt; '0'">
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<tr><td class="ms-standardheader ms-WPTitle" nowrap="">
Currently this class is full and you are not registered to attend this Class.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
Sorry, but to register for <xsl:value-of select="$SessionTitle" />. Please contact the Instructor/Administrator for additional information.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
<a href="/SITES/LEARNING/TRAININGHUB/Pages/default.aspx">Click here to return</a> to the site registration page.
</td></tr>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</table>
[/size]
Please advice
Thanks


Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Thu Apr 07, 2011 1:29 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
SPD is flaking on me right now, trying to get access into one of my training sites to look at the XSLT. It sounds to me initially that the issue is the link from the Courses/DispForm.aspx to Registrations/Register.aspx. If you don't use the button, then you miss out on passing some query string variables to the Register.aspx page that help process the registration and determine what one of those tempates to display.


Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Thu Apr 07, 2011 1:36 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
Thanks Eric, But Im using button. the problem is I have to select the template depending on the available seats. In mycase even though I have seats >0 still it display the wrong template. I know that something Im doing wrong when selecting template.
Thanks.
Please advice


Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Thu Apr 07, 2011 1:47 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
<xsl:when test="$IsAvailableSeats &gt; '0'">
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
</xsl:call-template>
</xsl:when>


Im calling this template to display after checking IsAvailableSeats &gt; '0'
But its not checking am I doing something wrong?.
It just jump to the else condition
<xsl:otherwise>
<tr><td class="ms-standardheader ms-WPTitle" nowrap="">
Currently this class is full and you are not registered to attend this Class.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
Sorry, but to register for <xsl:value-of select="$SessionTitle" />. Please contact the Instructor/Administrator for additional information.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
<a href="/SITES/LEARNING/TRAININGHUB/Pages/default.aspx">Click here to return</a> to the site registration page.
</td></tr>


Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Thu Apr 07, 2011 1:54 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
If you're using the button, then that's fine. I must have read the post wrong.

It looks like you have an error with this snippet. IsAvailableSeating is a true/false condition. The default value is true. It should be listed in the query string parameters when they click the button and arrive to the Registrations.aspx page.
Code:
<xsl:when test="$IsAvailableSeats &gt; '0'">
  <xsl:call-template name="dvt_1.body">
    <xsl:with-param name="Rows" select="$Rows"/>
  </xsl:call-template>
</xsl:when>


This is the full XSLT I have:
Code:
<xsl:choose>
            <xsl:when test="$RegistrationOver">
               <tr><td class="ms-standardheader ms-WPTitle" nowrap="">
                  Course registration has completed - thank you for your interest.
               </td></tr>
               <tr><td class="ms-vb" nowrap=""><br />
                  <a href="../../default.aspx">Click here to return</a> to the site home page.
               </td></tr>
            </xsl:when>
            <xsl:otherwise>
               <xsl:choose>
                  <xsl:when test="$AlreadyRegistered">
                     <tr><td class="ms-standardheader ms-WPTitle" nowrap="">
                        You are currently registered to attend this course.
                     </td></tr>
                     <tr><td class="ms-vb" nowrap=""><br />
                        Your registration for <xsl:value-of select="$CourseTitle" /> has been confirmed.
                        Please plan on arriving at <xsl:value-of select="ddwrt:FormatDate(string($CourseStartTime), 1033, 5)" />.
                     </td></tr>
                     <tr><td class="ms-vb" nowrap=""><br />
                        <a href="Unregister.aspx?ID={$MyRegistration/@ID}&amp;Source={ddwrt:UrlEncode($Source)}">Click here to unregister</a> from the course, or
                        <a href="../../default.aspx">click here to return</a> to the site home page.
                     </td></tr>
                  </xsl:when>
                  <xsl:when test="$IsAvailableSeating = 'true'">
                     <xsl:call-template name="dvt_1.body">
                        <xsl:with-param name="Rows" select="$Rows"/>
                     </xsl:call-template>
                  </xsl:when>
                  <xsl:otherwise>
                     <tr><td class="ms-standardheader ms-WPTitle" nowrap="">
                        You are not registered to attend this course.
                     </td></tr>
                     <tr><td class="ms-vb" nowrap=""><br />
                        Sorry, but <xsl:value-of select="$CourseTitle" /> is currently full. Please contact the instructor for additional information.
                     </td></tr>
                     <tr><td class="ms-vb" nowrap=""><br />
                        <a href="../../default.aspx">Click here to return</a> to the site home page.
                     </td></tr>
                  </xsl:otherwise>
               </xsl:choose>
            </xsl:otherwise>
         </xsl:choose>



Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Thu Apr 07, 2011 2:06 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
Thanks a lot eric "You Rock" :). I just figured that out I wasn't passing the Parameter where IsAvailableSeats='True. It worked like a charm. :)'


Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Thu Apr 07, 2011 2:38 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
Glad to be of service.


Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Tue Apr 12, 2011 2:47 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:11 pm
Posts: 103
Location: Baltimore, MD
I have another issue :

Sometimes I can able to register the course morethan one time(but it should not allow to register more than onetime) and sometimes it works fines which displays the message "You are already registered"

Also It is allwoing me to registered for the expired class

Code :
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:variable name="MyRegistration" select="$Rows[@Session_x0020_ID = $SessionID and contains(@Author, $UserID)]" />
<xsl:variable name="AlreadyRegistered" select="count($MyRegistration) != 0" />
<xsl:variable name="TimeStampToday" select="translate(ddwrt:TodayIso(), '-T:Z', '')" />
<xsl:variable name="TimeStampStart" select="translate(ddwrt:FormatDateTime($SessionStartTime, 1033, 's'), '-T:Z', '')" />
<xsl:variable name="RegistrationOver" select="$TimeStampStart &lt;= $TimeStampToday" />
<table border="0" width="100%">
<xsl:choose>
<xsl:when test="$RegistrationOver">
<tr><td class="ms-standardheader ms-WPTitle" nowrap="">
Class registration has completed - thank you for your interest.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
<a href="http://site/Pages/default.aspx">Click here to return</a> to the site home page.
</td></tr>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$AlreadyRegistered">
<tr><td class="ms-standardheader ms-WPTitle" nowrap="">
You are currently registered to attend this class.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
Your registration for <xsl:value-of select="$SessionTitle" /> has been confirmed.
Please plan on arriving at <xsl:value-of select="ddwrt:FormatDate(string($SessionStartTime), 1033, 5)" />.
</td></tr>
<tr><td class="ms-vb" nowrap=""><br />
<a href="http://s0f3ab9/SITES/LEARNING/TRAININGHUB/Pages/default.aspx">click here to return</a> to the site home page.
<xsl:call-template name="dvt_2.body">
<xsl:with-param name="Rows" select="$Rows"/>
</xsl:call-template>
</td></tr>
</xsl:when>
<xsl:when test="$IsAvailableSeats ='true'">
<xsl:call-template name="dvt_1.body">
<xsl:with-param name="Rows" select="$Rows"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>



Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Tue Apr 12, 2011 10:07 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
I'll check it against my code tomorrow and see what I can find out.


Top
 Profile  
 
 Post subject: Re: Employee Training XSLT
PostPosted: Wed Apr 13, 2011 9:17 am 
Offline
User avatar

Joined: Mon Jan 04, 2010 1:15 am
Posts: 1839
Location: North Carolina
The code looks pretty straight forward compared to mine.

For the expired sessions, you'll want to make sure the Courses DispForm.aspx page is set up to pass in the proper query string parameters so that the Register.aspx page can parse it properly. It builds a hyperlink like:
Code:
<xsl:variable name="RegisterURL" select="concat('../../Lists/Registrations/Register.aspx?CourseID=',$Rows[1]/@ID,'&amp;CourseTitle=',ddwrt:UrlEncode($Rows[1]/@Title),'&amp;CourseStartTime=',$Rows[1]/@EventDate,'&amp;CourseEndTime=',$Rows[1]/@EndDate,'&amp;IsAvailableSeating=',$IsAvailableSeating)" />

Since it looks like you renamed the Course names to Session, you'll want to make sure that it's being properly passed in. If it isn't than that would explain why you could sign up for past sessions.

It might also explain why you can dual register sometimes.

The only registration issues we've seen is that very infrequently users can overbook the course. This has only happened once in several hundred courses. It was a high demand class and many registered at once, so the workflow wasn't keeping up with the demand.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group