! CRS_RESERVE_E.SCP REB, 18-Sep-1989 10:17 .LABEL TEST_PRIV .IF $CRS_PRV EQS "Y" THEN .GOTO CONTINUE GET #TEST=CRS_RESERVE.RESERVER[$CRS_LAST_USED] .IF #TEST NES OA$USER THEN .GOTO NO_PRIV .LABEL CONTINUE GET #PROOM=ROOM GET #R=ROOM GET #PBEG_DT=BEG_DT GET #D=BEG_DT GET #PBEG_TIME=BEG_TIME GET #T=BEG_TIME GET #PEND_TIME=END_TIME GET #E=END_TIME GET #M=MEETING GET #C1=CRS_RESERVE.CONTACT1[$CRS_LAST_USED] GET #E1=CRS_RESERVE.EXT1[$CRS_LAST_USED] GET #C2=CRS_RESERVE.CONTACT2[$CRS_LAST_USED] GET #E2=CRS_RESERVE.EXT2[$CRS_LAST_USED] GET #PAM_YN= GET #A=CRS_RESERVE.AM_YN[$CRS_LAST_USED] GET #PKEY=$CRS_LAST_USED GET #CHG_KEY="N" .LABEL DISPLAY_FORM ! enter data for new ROOMS or DATE/TIMES FORM CRS_RESERVE_E/- PRE= 'GET ROOM=#R\- GET BEG_DT=#D\- GET BEG_TIME=#T\- GET END_TIME=#E\- GET MEETING=#M\- GET CONTACT1=#C1\- GET EXT1=#E1\- GET CONTACT2=#C2\- GET EXT2=#E2\- GET AM_YN=#A'- /FIELDS=ROOM,BEG_DT,BEG_TIME,END_TIME .IF OA$FORM_TERMINATOR = 112 THEN .GOTO CANCELLED ! #PKEY = PREVIOUS KEY; #CKEY = CURRENT KEY (i.e., "NEW") ! If ROOM, DATE,or TIMES being changed then .IF #PKEY NES #CKEY THEN GET #CHG_KEY="Y" .IF #CHG_KEY EQS "Y" THEN .GOTO WRITE_NEW_REC ELSE - .GOTO COMPLETE .LABEL WRITE_NEW_REC GET #CHG_KEY="Y" WRITE ADD CRS_RESERVE CRS_KEY=#CKEY,- TYPE="CR",- RESERVER=OA$USER,- ROOM=#ROOM,- BEG_DT=#BEG_DT,- BEG_TIME=#BEG_TIME,- END_DT=#BEG_DT,- END_TIME=#END_TIME .LABEL COMPLETE FORM CRS_RESERVE_E/FIELDS=MEETING,CONTACT1,EXT1,CONTACT2,EXT2,AM_YN .IF OA$FORM_TERMINATOR = 112 THEN .GOTO CANCELLED GET #PMEETING=CRS_RESERVE.MEETING[#PKEY] .IF #CHG_KEY EQS "Y" THEN - WRITE CHANGE CRS_RESERVE CRS_KEY = #CKEY,- MEETING=#MEETING,- CONTACT1=#CONTACT1,- EXT1=#EXT1,- CONTACT2=#CONTACT2,- EXT2=#EXT2,- AM_YN=#AM_YN\- WRITE DELETE CRS_RESERVE CRS_KEY=#PKEY .IF #CHG_KEY EQS "N" THEN - WRITE CHANGE CRS_RESERVE CRS_KEY = #PKEY,- MEETING=#MEETING,- CONTACT1=#CONTACT1,- EXT1=#EXT1,- CONTACT2=#CONTACT2,- EXT2=#EXT2,- AM_YN=#AM_YN .IF #PAM_YN EQS "Y" OR #AM_YN EQS "Y" THEN .GOTO AM_ADVISE OA$MSG_PURGE DISPLAY Your ROOM reservation was changed as requested. .GOTO EXIT_PROCEDURE .LABEL AM_ADVISE OA$MSG_PURGE display Creating message to AM ADVISER . . .\force mail create/open/nosend/noedit mail subject "MEETING NOTICE: " #meeting mail to "AM_ADVISER" mail text "" mail text - "This meeting notice information replaces the previous information (if any):" mail text mail text "PREVIOUS MEETING: " #pmeeting mail text "PREVIOUS PLACE: " #proom mail text "PREVIOUS DATE: " #pbeg_dt mail text "PREVIOUS TIME: " #pbeg_time " - " #pend_time mail text mail text "NEW MEETING: " #meeting mail text "NEW PLACE: " #room mail text "NEW DATE: " #beg_dt mail text "NEW TIME: " #beg_time " - " #end_time mail text mail text "Let me know if you have any questions." mail close_message .label edit_prompt mail read prompt "Do you need to edit this message? [Y/N] " oa$fld_stay .if oa$prompt_text nes "Y" then .goto send_am_msg .label edit_msg mail edit .goto edit_prompt .label send_am_msg get #curdoc=oa$curmes mail send ! do wpdelete ! display Notice has been sent to AM ADVISER. oa$msg_purge display Reservation changed as requested; AM Adviser has been notified. .goto exit_procedure .LABEL CANCELLED .IF #CHG_KEY EQS "Y" THEN WRITE DELETE CRS_RESERVE CRS_KEY=#CKEY OA$MSG_PURGE DISPLAY No change was made to the exisiting room reservation. .GOTO EXIT_PROCEDURE .LABEL NO_PRIV OA$MSG_PURGE DISPLAY You are NOT AUTHORIZED to change THIS reservation. .GOTO EXIT_PROCEDURE .LABEL EXIT_PROCEDURE GET #TEST_CRS=CRS_RESERVE.ROOM[$CRS_LAST_USED] .IF #TEST_CRS EQS "" THEN GET $CRS_LAST_USED=#CKEY .EXIT