ShoUpCls ​
This version works in ACEweb. This SHOUPCLS version works in Student Manager.
Returns a list of upcoming courses on select ACEweb pages. By default the function will exclude courses the person is already enrolled in.
ACEweb Routines/Templates ​
XWelcome.htm, Regconfirm.txt
Required Parameters ​
None
Optional Parameters ​
- Character selection value:
"1" returns courses for the next month (Default) "2" returns courses for the next 2 months "3" returns courses for the next 3 months "4" returns courses for the next 4 months -OR-- Character string to return courses (e.g. "between(cobegdate,date(),date()+45)" returns courses for the next 45 days)
- Character return string: user defined string to return fields. This is a necessary parameter if you want to make the course title a link to the Course Status page (see examples below).
- "NMID="+pcUserID - ONLY returns upcoming courses IF the course subject code is listed in the individual's Interest Code list.
-OR--Condition to return courses based on Course Subject Code (e.g. "cosubcode='COMP'").
Notes:
- If you are using this function on the regconfirm.txt template, you will need to use tPerson.nmid instead of pcUserID.
- To filter already enrolled courses but ignore interest codes, include the NMID= parameter but add NOINTEREST to the parameter, e.g. "NMID="+pcUserID+"NOINTEREST" or "NMID="+tPerson.nmid+"NOINTEREST"; -OR- enter 'NOLOGON' to override the behavior to only show courses matching the logged on user's interest codes.
- Numeric value - specify the number of days to be added to current date to determine starting reference for date range of courses to be returned. Only used if setting parameter 1 to return courses for specified month (not used with character string option).
- Character return string: to specify output delimiter. By default, will put a crlf between each course. If you are using this function on the regconfirm.txt template--AND--you have applied HTMLÂ formatting to it, you will want to use the
<br />
delimiter instead, e.g.<br />
. - Datapath. Used only for custom expressions.
- Character return string: displayed above a nonempty listing (e.g.
<table>
). - Character return string: displayed below a nonempty listing (e.g.
</table>
). - Character return string: displayed if the upcoming class list is empty (e.g. "You have no interests selected").
Example(s) ​
XWelcome.htm Examples:
##ShoUpcCls("1", "dtoc(cobegdate+' - '+[<a href='coursestatus.awp?&course=\]+alltrim(cocrse)+\['>]+alltrim(cocrsenm)+[<br />]","NMID="+pcUserID)##
returns begin date and course title of courses that begin in the next month IF the subject code is listed in the individual's Interest Code list
##ShoUpCls("between(cobegdate,date(),date()+15)", "dtoc(cobegdate+' - '+[<a href='+alltrim(config.cACEwebURL)+'coursestatus.awp?&course=\]+alltrim(cocrse)+['>]+alltrim(cocrsenm)+[<br />]","cosubcode='COMP'")##
returns begin date and course title of courses that begin in the next 45 days and that have the COMP subject code
Regconfirm.txt Examples:
##shoupcls("1",,"NMID="+tPerson.nmid)##
returns course number, course title and begin date of courses that begin in the next month IF the subject code is listed in the individual's Interest Code list. For use on Text formatted regconfirm.txt--WILLÂ NOTÂ link courses to ACEweb course info pages
##shoupcls("between(cobegdate,date(),date()+15)","dtoc(cobegdate)+[<a href=']+alltrim(config.cACEwebURL)+\[coursestatus.awp?&course=]+alltrim(cocrse)+['>]+alltrim(cocrsenm)+[</a>]", "NMID="+tPerson.nmid),,[<br>])##
returns begin date and course title of courses that begin in the next 15 days IF the subject code is listed in the individual's Interest Code list. For use on HTMLÂ formatted regconfirm.txt. WILLÂ link courses to ACEweb course info pages
IMPORTANTÂ NOTE:Â Text formatted emails WILLÂ NOTÂ render HTML. So using this function on Text formatted emails WILLÂ NOTÂ generate links into ACEweb. The student will only see the HTMLÂ code in the email.
Notes ​
The above examples use the standard FoxPro functions: BETWEEN and DATE
SQL Version Notes ​
If you are using the SQL version of ACEweb and want to use the between option, you will need to use this expression, which returns courses that begin in the next 15 days:
##shoupcls("cobegdate BETWEEN CONVERT(date,GETDATE()) AND dateadd(day, 15, getdate())","[<p>]+nicedate(cobegdate,,3)+[<a href=']+alltrim(config.cACEwebURL)+[coursestatus]+mapext+[?&course=]+rtrim(cocrse)+[' target='_blank'>]+rtrim(cocrsenm)+[</a></p>]") ##
Convert(), GetDate(), and DateAdd() are standard TSQL functions.