
Define Field(#mnuitmid) Type(*string) Length(3)
Define Field(#prtitmid) Type(*string) Length(3)
Define Field(#mnucapt) Type(*char) Length(30) Input_Atr(LC)
Define Field(#mnuurl) Type(*string) Length(256)
Define Field(#mnuwam) Type(*char) Length(9)
Define Field(#mnuwrnme) Type(*char) Length(30)
Def_List Name(#mnusave) Fields(#mnuitmid #prtitmid #mnucapt #mnuurl #mnuwam #mnuwrnme) Type(*Working)
Def_List Name(#mnulist) Fields(#mnuitmid #prtitmid #mnucapt #mnuurl #mnuwam #mnuwrnme) Type(*Working)
Web_Map For(*output) Fields((#mnulist *private))
Web_Map For(*none) Fields(#mnusave) Options(*persist)
Web_Map For(*both) Fields((#stdrentry *hidden))
Webroutine Name(login) Onentry(*SESSIONSTATUS_NONE)Note that the fields USERID and PASSWD are mapped for *both. If these fields do not exist in the Repository, define them in your WAM as:
Web_Map For(*both) Fields(#userid #passwd)
Message Msgtxt('Enter your user id and password')
Endroutine
Define Field(#USERID) Type(*char) Length(10) Desc("User ID")
Define Field(#PASSWD) Type(*char) Length(10) Desc("Password") Input_Atr(ND) Mthroutine Name(AddToMenu)
Define_Map For(*input) Class(#STD_STRNG) Name(#itmid)
Define_Map For(*input) Class(#STD_STRNG) Name(#pitmid)
Define_Map For(*input) Class(#STD_DESC) Name(#caption)
Define_Map For(*input) Class(#STD_STRNG) Name(#URL)
Define_Map For(*input) Class(#STD_DESCS) Name(#WAM)
Define_Map For(*input) Class(#STD_DESCS) Name(#WRNAME)
#mnuitmid := #itmid
#prtitmid := #pitmid
#mnucapt := #caption
#mnuurl := #URL
#mnuwam := #WAM
#mnuwrnme := #WRNAME
Add_Entry To_List(#mnusave)
Endroutine
Subroutine Name(buildmenu)
Clr_List Named(#mnusave)
* Home
#com_owner.addtomenu Itmid('1') Pitmid('') Caption('Home') Url('http://www.lansa.com/') Wam('') Wrname('')
* Applications
#com_owner.addtomenu Itmid('2') Pitmid('') Caption('Applications') Url('') Wam('') Wrname('')
* Support
#com_owner.addtomenu Itmid('3') Pitmid('') Caption('Support') Url('http://www.lansa.com/support/index.htm') Wam('') Wrname('')
* Contact Us
#com_owner.addtomenu Itmid('4') Pitmid('') Caption('Contact Us') Url('http://www.lansa.com/about/contactus.htm') Wam('') Wrname('')
* About
#com_owner.addtomenu Itmid('5') Pitmid('') Caption('About') Url('http://www.lansa.com/about/index.htm') Wam('') Wrname('')
*
Endroutine
Subroutine Name(buildapps)
* Employees
#com_owner.addtomenu Itmid('50') Pitmid('2') Caption('Employees') Url('') Wam('') Wrname('')
* enquiry
#com_owner.addtomenu Itmid('51') Pitmid('50') Caption('Enquiry') Url('') Wam(IIIEMPEN) Wrname(BEGIN)
* Update
#com_owner.addtomenu Itmid('52') Pitmid('50') Caption('Update') Url('') Wam(IIIEMPUP) Wrname(BEGIN)
* Update with Dropdowns
#com_owner.addtomenu Itmid('53') Pitmid('50') Caption('Update with Dropdowns') Url('') Wam(IIIEMP_3) Wrname(BEGIN)
* Update using Dropdown with Selector
#com_owner.addtomenu Itmid('54') Pitmid('50') Caption('Update using Dropdown with selector') Url('') Wam(IIIEMP_4) Wrname(BEGIN)
Endroutine
Note: All menu entries must have a unique id. Sub-menu items must also have the correct parent id. |
Webroutine Name(welcome)
Web_Map For(*input) Fields(#userid)
Clr_List Named(#mnulist)
Selectlist Named(#mnusave)
Add_Entry To_List(#mnulist)
Endselect
Message Msgtxt('Welcome ' + #USERID) Type(*STATUS)
Message Msgtxt('You are logged into the Personnel Applications System') Type(*status)
Endroutine
Webroutine Name(login) Onentry(*SESSIONSTATUS_NONE)
Web_Map For(*both) Fields(#userid #passwd)
Message Msgtxt('Enter your user id and password')
If (#stdrentry = L)
Case (#userid)
When (= ADMIN)
If (#passwd = '14MIN')
#com_owner.sessionstatus := active
Execute Subroutine(buildmenu)
Execute Subroutine(buildapps)
Transfer Toroutine(welcome)
Else
Message Msgtxt('Password incorrect for this user')
Endif
When (= USER)
If (#passwd = 'US5R')
#com_owner.sessionstatus := active
Execute Subroutine(buildmenu)
Transfer Toroutine(welcome)
Else
Message Msgtxt('Password incorrect for this user')
Endif
Endcase
Endif
Endroutine
Property | Value |
|---|---|
caption | Log In |
left_relative_image | icons/normal/16/user_16.png |
on_click_wrname | Login |
submitExtraFields | Field Name: STDRENTRY |
Literal Value: L |