Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACRFDRC1

ACRFDRC1.m

Go to the documentation of this file.
ACRFDRC1 ;IHS/OIRM/DSD/THL,AEF - USER APPROVAL AUTHORITY; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE TO EDIT USER APPROVAL AUTHORITY
EN ;EP;
 F  D EN1 Q:'$D(ACRDUZ)!$D(ACROUT)!$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRDATA,ACRQUIT,ACRSET,ACRJ,ACRJ2,ACRMAX,J
 Q
EN1 W @IOF
 W !?22,"ESTABLISH USER SIGNATURE AUTHORITY"
 W !?22,"=================================="
 W !
 W !?5,"Select Authority Categories:"
 W !!?10,"1"
 W ?15,"ACQUISITION"
 W !?10,"2"
 W ?15,"TRAVEL"
 W !?10,"3"
 W ?15,"TRAINING"
 W !?10,"4"
 W ?15,"PURCHASE ORDER"
 W !?10,"5"
 W ?15,"RECEIVING"
 W !?10,"6"
 W ?15,"FMO"
 W !?10,"7"
 W ?15,"TRAVEL VOUCHER"
 S DIR(0)="LO^1:7"
 S DIR("A")="Which one(S)"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 S ACRCATX=ACRY
 F J=1:1 S ACRCAT=$P(ACRCATX,",",J) Q:ACRCAT=""  D DISPLAY Q:$D(ACROUT)
 K ACRQUIT
 Q
DISPLAY F  D D1 Q:$D(ACROUT)!$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
D1 K DR,ACRDR,ACRZ
 W @IOF
 W ?10,@ACRON,$P($P($P(^DD(9002190.5,.06,0),U,3),ACRCAT_":",2),";"),@ACROF
 W " Authorities for: ",@ACRON,ACRUSER,@ACROF
 W !!?10,"NO."
 W ?15,"APPROVAL CATEGORY"
 W !?10,"---  ---------------------------"
 S (ACRJ,ACRAPDA)=0
 F  S ACRAPDA=$O(^ACRAPVT("C",ACRCAT,ACRAPDA)) Q:'ACRAPDA  D
 .S ACRJ=ACRJ+1
 .D DISP1
 S ACRMAX=ACRJ
 F ACRJ=1:1:ACRMAX D
 .W !?10,$J(ACRJ,2)_")  ",$P(ACRZ(ACRJ),U,3)
 .W ?44,$S($P(ACRZ(ACRJ),U,2)=1:"<==",1:"")
 .D:ACRJ=10 PAUSE^ACRFWARN
 K ACRAPDA
 D:'$D(ACROUT) SELECT
 Q
DISP1 S ACRZ=^ACRAPVT(ACRAPDA,0)
 S ACRNAM=$P(ACRZ,U)
 S ACRORDR=$P(ACRZ,U,4)
 S ACRI=$S($D(^ACRAPL("AC",ACRDUZ,ACRAPDA)):1,1:0)
 S ACRZ(ACRORDR)=ACRAPDA_U_ACRI_U_$E(ACRNAM,1,28)
 K ACRNAM,ACRORDR
 Q
DISP2 S ACRJ2=ACRJ+ACRMAX
 W !?2,$J(ACRJ,2),")  ",$P(ACRZ(ACRJ),U,3)
 W ?34,$S($P(ACRZ(ACRJ),U,2)=1:"<==",1:"")
 I $D(ACRZ(ACRJ2)) D
 .W ?42,$J(ACRJ2,2)_")  ",$P(ACRZ(ACRJ2),U,3)
 .W ?74,$S($P(ACRZ(ACRJ2),U,2)=1:"<==",1:"")
 Q
SELECT W !!?10,"'<==' indicates user has this signature authority."
 W !
 S DIR(0)="SOA^A:Add APPROVAL AUTHORITIES;D:Delete APPROVAL AUTHORITIES;O:Exit APPROVAL Edit Sequence"
 S DIR("A")="    (A)dd/(D)elete/(O)UT: "
 D DIR^ACRFDIC
 I Y="O" S ACROUT="" Q
 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRDR
 S:Y="D" ACRDR=".01///@"
 S DIR(0)="LO^1:"_ACRMAX
 S DIR("A")="          Which AUTHORITY(IES)"
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 S ACRQK=Y(0)
 D LOOP Q
 Q
LOOP S ACRQK1=ACRQK
 W !
 F ACRLI=1:1 S ACRQK=$P(ACRQK1,",",ACRLI) Q:'ACRQK!$D(ACRQUIT)!$D(ACROUT)  Q:'$D(ACRZ(ACRQK))  D SET2
 K ACRCNT
 Q
SET2 S ACRAPDA=$P(ACRZ(ACRQK),U)
 S ACRAP=$P(^ACRAPVT(ACRAPDA,0),U)
 S X=ACRDUZ
 S (DIE,DIC)="^ACRAPL("
 S DIC(0)="L"
 S DIC("DR")=".02////"_ACRAPDA
 I '$D(ACRDR) D  Q
 .D:'$D(^ACRAPL("AC",ACRDUZ,ACRAPDA)) FILE^ACRFDIC
 .I ACRAPDA=21,'$D(^ACRAPL("AC",ACRDUZ,37)) D
 ..S X=ACRDUZ
 ..S DIC="^ACRAPL("
 ..S DIC(0)="L"
 ..S DIC("DR")=".02////37"
 ..D FILE^ACRFDIC
 .I ACRAPDA=8,'$D(^ACRAPL("AC",ACRDUZ,45)) D
 ..S X=ACRDUZ
 ..S DIC="^ACRAPL("
 ..S DIC(0)="L"
 ..S DIC("DR")=".02////45"
 ..D FILE^ACRFDIC
 .W !!,"Alternates for......: ",@ACRON,ACRUSER,@ACROF
 .W !,"when signing as the.: ",@ACRON,ACRAP,@ACROF
 .S DA=$O(^ACRAPL("AC",ACRDUZ,ACRAPDA,0))
 .S DIE="^ACRAPL("
 .S DR="[ACR APPROVAL ALTERNATE]"
 .D:DA DDS^ACRFDIC
 .I $D(ACRSCREN) K ACRSCREN D:DA DIE^ACRFDIC
 S DR=ACRDR
 S DA=$O(^ACRAPL("AC",ACRDUZ,ACRAPDA,0))
 D:DA DIE^ACRFDIC
 Q
SETREQ ;EP;TO AUTOMATICALLY SET APPROVAL AUTHORITY FOR REQUEST INITIATOR,
 ;;TRAVEL REQUESTED BY AND TRAVELER FOR EVERY ARMS USER
 F ACRAPDA=32,36,40,41 I '$D(^ACRAPL("AC",ACRDUZ,ACRAPDA)) D
 .S X=ACRDUZ
 .S DIC="^ACRAPL("
 .S DIC(0)="L"
 .S DIC("DR")=".02////"_ACRAPDA
 .D FILE^ACRFDIC
 Q