! crs_reserve_c.scp reb, 05-Jul-1989 13:35 .label check_mlc_prv .if #crs_location eqs "FMB" then .goto init_values .if #crs_location eqs "MLC" and $crsmlc_prv eqs "Y" then - .goto init_values .goto no_access .label init_values decimal i get #ckey=#pkey="" get #room=#beg_dt=#beg_time=#end_dt=#end_time="" get #meeting=#contact1=#contact2=#ext1=#ext2=#am_yn"" get #cancel="N" form crs_reserve_c/fields=room,beg_dt,beg_time,end_time .if oa$form_terminator = 112 then .goto cancelled .if #tvalid eqs "N" then .goto error .label add_single_record write add crs_reserve crs_key=#ckey,- room=#room,- type="CR",- beg_dt=#beg_dt,- beg_time=#beg_time,- end_dt=#end_dt,- end_time=#end_time,- reserver=oa$user .label next_form form crs_reserve_c/fields=meeting,contact1,ext1,contact2,ext2,am_yn/- pre='get room=#room\get beg_dt=#beg_dt\get beg_time=#beg_time\- get end_time=#end_time' .if oa$form_terminator = 112 then .goto cancelled .label update_single_record write change crs_reserve crs_key = #ckey, - meeting = #meeting,- contact1 = #contact1,- ext1 = #ext1,- contact2 = #contact2,- ext2 = #ext2,- am_yn = #am_yn .if #am_yn eqs "Y" then .goto am_mail .goto post_message .label cancelled get #check_key= crs_reserve.room[#ckey] .if #check_key nes "" and #tvalid eqs "Y" then - write delete crs_reserve crs_key = #ckey oa$msg_purge display Operation has been cancelled at the User's request. .goto exit_procedure .label am_mail 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 - "Please include a notice for this meeting in the AM ADVISER:" mail text mail text "MEETING: " #meeting mail text "PLACE: " #room mail text "DATE: " #beg_dt mail text "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. .goto post_message .label error oa$msg_purge display An error occurred in this procedure. Please try again. .goto exit_procedure .label post_message get $crs_last_used=#ckey oa$msg_purge display Your room reservation has been completed as requested. .goto exit_procedure .label no_access oa$msg_purge display You are not authorized to create MLC room reservations. .goto exit_procedure .label exit_procedure .exit