! CRS_RESERVE_COD.SCP REB, 22-Dec-1989 09:41 .LABEL CHECK_PRIV GET #TEST=CRS_RESERVE.RESERVER[$CRS_LAST_USED] .IF #TEST EQS OA$USER OR $CRS_PRV EQS "Y" OR $CRSMLC_PRV EQS "Y" - THEN .GOTO INIT_FIRST .GOTO NO_PRIV .LABEL INIT_FIRST DELETE INVAL_ROOM.TMP GET #DT=#NEW_DT=#ROOM=#NEWKEY=#BTIM=#ETIM="" .LABEL BEGIN PROMPT "Copy Current Record to What Date? " OA$FLD_STAY .IF OA$FORM_TERMINATOR = 112 THEN .GOTO CANCELLED GET #DT = OA$PROMPT_TEXT DATE_CONVERT #NEW_DT,#DT,7 .IF #NEW_DT EQS "" THEN .GOTO INVALID_DATE DATE_CONVERT #DT,#NEW_DT,9 .IF #DT EQS "" THEN .GOTO INVALID_DATE .LABEL BUILD_KEY GET #ROOM=CRS_RESERVE.ROOM[$CRS_LAST_USED] GET OA$DISPLAY=- "Checking availability of " #ROOM " for " #DT " . . . "\FORCE GET #BTIM=CRS_RESERVE.BEG_TIME[$CRS_LAST_USED] GET #ETIM=CRS_RESERVE.END_TIME[$CRS_LAST_USED] GET #NEWKEY=#NEW_DT:8 #BTIM:7 #NEW_DT:8 #ETIM:7 #ROOM .IF #NEWKEY EQS $CRS_LAST_USED THEN .GOTO DUP_EFFORT .LABEL VALIDATE_KEY GET #TVALID="Y" GET OA$DCL='OPEN/WRITE OUTFILE INVAL_ROOM.TMP' GET OA$DCL='WRITE OUTFILE "' #ROOM - ' has already been reserved on ' #DT ' for:"' GET OA$DCL='WRITE OUTFILE ""' FOR CRS_RESERVE WITH - .CRS_KEY::30 BEGINNING #ROOM AND - .CRS_KEY:8 BEGINNING #NEW_DT:8 DO - GET #SD=.CRS_KEY:14\\- GET #ED=.CRS_KEY:14:15\\- .IF - #NEWKEY:14:15 GES #SD AND #ED GES #NEWKEY:14 THEN - GET #TVALID="N" \\\\- GET #BD= .BEG_DT \\\\- GET #BT= .CRS_KEY:5:8 \\\\- GET #ED= .END_DT \\\\- GET #ET= .CRS_KEY:5:23 \\\\- GET #MTG= .MEETING \\\\- GET #CT= .CONTACT1 \\\\- GET OA$DCL='$ WRITE OUTFILE - "TIME: ' #BT ' - ' #ET '"' \\\\- GET OA$DCL='$ WRITE OUTFILE "MEETING: ' #MTG '"' \\\\ - GET OA$DCL='$ WRITE OUTFILE "CONTACT: ' #CT '"' \\\\ - GET OA$DCL='$ WRITE OUTFILE ""' GET OA$DCL='$ WRITE OUTFILE ""' GET OA$DCL='WRITE OUTFILE "Please select another ROOM or DATE & TIME."' GET OA$DCL='CLOSE OUTFILE' .IF #TVALID EQS "N" THEN .GOTO INVALID .LABEL WRITE_NEW_RECORD WRITE ADD CRS_RESERVE CRS_KEY=#NEWKEY,- ROOM=#ROOM,- TYPE=CRS_RESERVE.TYPE[$CRS_LAST_USED],- BEG_DT=#DT,- BEG_TIME=#BTIM,- END_DT=#DT,- END_TIME=#ETIM,- MEETING=CRS_RESERVE.MEETING[$CRS_LAST_USED],- RESERVER=OA$USER,- CONTACT1=CRS_RESERVE.CONTACT1[$CRS_LAST_USED],- EXT1=CRS_RESERVE.EXT1[$CRS_LAST_USED],- CONTACT2=CRS_RESERVE.CONTACT2[$CRS_LAST_USED],- EXT2=CRS_RESERVE.EXT2[$CRS_LAST_USED],- AM_YN=CRS_RESERVE.AM_YN[$CRS_LAST_USED] GET #CRS_TEST=CRS_RESERVE.ROOM[#NEWKEY] .IF #CRS_TEST EQS "" THEN .GOTO REC_NOT_WRITTEN .LABEL WRAPUP GET $CRS_LAST_USED=#NEWKEY DELETE INVAL_ROOM.TMP OA$MSG_PURGE GET OA$DISPLAY="Record has been copied to " #DT "."\FORCE .GOTO EXIT_PROCEDURE .LABEL NO_PRIV OA$MSG_PURGE DISPLAY You may not COpy a reservation not belonging to you. .GOTO EXIT_PROCEDURE .LABEL REC_NOT_WRITTEN DELETE INVAL_ROOM.TMP OA$MSG_PURGE DISPLAY The 'CO' option failed to Copy the record. Please try again. .GOTO EXIT_PROCEDURE .LABEL DUP_EFFORT PROMPT "You entered the date for the existing record. Press RETURN. " OA$FLD_STAY .GOTO BEGIN .LABEL INVALID LIST INVAL_ROOM.TMP DELETE INVAL_ROOM.TMP .GOTO EXIT_PROCEDURE .LABEL CANCELLED OA$MSG_PURGE DISPLAY Operation has been cancelled at the User's request. .GOTO EXIT_PROCEDURE .LABEL INVALID_DATE PROMPT #DT " is NOT a valid DATE. Press RETURN to re-enter. " .GOTO BEGIN .LABEL EXIT_PROCEDURE .EXIT