source: GuiMail/trunk/p/CWMACPPI.m@ 1687

Last change on this file since 1687 was 1139, checked in by George Lilly, 14 years ago

version 2.3 of GuiMail

File size: 1.6 KB
Line 
1CWMACPPI ;RVAMC/PLS - Convert Personal Preferences to Parameters Utility;21-Jun-2005 06:34;CLC
2 ;;2.3;CWMAIL;;Jul 19, 2005
3 ;Call EN to convert Personal Preferences from File 890
4 ;to the Kernel Toolkit Parameter File.
5EN ;entry point
6 N CWLP,CWCNT,DTOUT,DUOUT,DIR,X,Y
7 ;check for existing CWMAIL1 global containing preferences
8 I '$D(^CWMAIL1) D BMES^XPDUTL("CWMAIL1 Global doesn't exist! Conversion of preferences not needed.") Q
9 S (CWCNT,CWLP)=0 F S CWLP=$O(^CWMAIL1(CWLP)) Q:CWLP<1 D
10 . I $D(^CWMAIL1(CWLP,1,1,0)) S CWCNT=CWCNT+1
11 D BMES^XPDUTL("There are "_CWCNT_" user(s) to convert")
12 D UPDATE^XPDID(0) ;init progress bar
13 D MES^XPDUTL("Beginning conversion of preferences...")
14 D LOOP
15 Q
16LOOP ;loop thru users
17 N CWUSR,CWLP,CWTXT,CWVAL,CWPREF,CWCNTC,XPDIDTOT
18 S CWUSR=0
19 S XPDIDTOT=CWCNT ;set total number
20 F S CWUSR=$O(^CWMAIL1(CWUSR)) Q:CWUSR<1 D
21 . S CWCNTC=+$G(CWCNTC)+1
22 . I CWCNTC#10=0 D UPDATE^XPDID(CWCNTC)
23 . S CWPREF=$O(^CWMAIL1(CWUSR,1,"B","PREFERENCES",0)) ;get node
24 . Q:'CWPREF ;no preferences stored
25 . S CWLP=0 F S CWLP=$O(^CWMAIL1(CWUSR,1,CWPREF,1,CWLP)) Q:CWLP<1 D
26 . . S CWTXT=^CWMAIL1(CWUSR,1,CWPREF,1,CWLP,0) ;get node text
27 . . I CWTXT'?1"[".E1"]" D
28 . . . S CWPRM=$$GETPRM^CWMAILE($P(CWTXT,"=")) ;get parameter
29 . . . I $L(CWPRM) D
30 . . . . S CWVAL=$$STRIP^XLFSTR($P(CWTXT,"=",2)," ") ;get value
31 . . . . I CWPRM="1|CWMA GENERAL MD COL" D
32 . . . . . S CWVAL=CWVAL_$S($E(CWVAL,$L(CWVAL))=";":"6,38",1:";6,38") ;add data for new column
33 . . . . S CWERR=$$SETPARM^CWMAILD(CWUSR,CWPRM,CWVAL) ;set value into parameter
34 D BMES^XPDUTL("Preference conversion is finished.")
35 Q
Note: See TracBrowser for help on using the repository browser.