source: EWD/archive/C0CE000F.m@ 1428

Last change on this file since 1428 was 1265, checked in by George Lilly, 13 years ago

old version of EWD fileman file and sample applications

File size: 4.1 KB
Line 
1 ;GT.M version of page ewdAjaxErrorRedirect (patientportal application)
2 ;Compiled on Mon, 01 Mar 2010 17:10:44
3 ;using Enterprise Web Developer (Build 790)
4 QUIT
5 ;
6run ;
7 n confirmText,ebToken,Error,formInfo,ok,sessid,sessionArray,tokens
8 s ok=$$pre()
9 i ok d body
10 QUIT
11 ;
12pre() ;
13 ;
14 n ctype,ewdAction,headers,jump,quitStatus,pageTitle,stop,urlNo
15 ;
16 s confirmText="Click OK if you're sure you want to delete this record"
17 s sessionArray("ewd_isFirstPage")="0"
18 s sessionArray("ewd_sessid_timeout")="1200"
19 s sessionArray("ewd_prePageScript")=""
20 s sessionArray("ewd_default_timeout")="1200"
21 s sessionArray("ewd_persistRequest")="true"
22 s sessionArray("ewd_pageTitle")=""
23 s sessionArray("ewd_errorPage")="ewdError"
24 s sessionArray("ewd_templatePrePageScript")=""
25 s sessionArray("ewd_onErrorScript")=""
26 s sessionArray("ewd_appName")="patientportal"
27 s sessionArray("ewd_pageName")="ewdAjaxErrorRedirect"
28 s sessionArray("ewd_translationMode")="0"
29 s sessionArray("ewd_technology")="gtm"
30 s sessionArray("ewd_pageType")="ajax"
31 s tokens("ewdAjaxError")=$$setNextPageToken^%zewdGTMRuntime("ewdAjaxError")
32 s tokens("ewdErrorRedirect")=$$setNextPageToken^%zewdGTMRuntime("ewdErrorRedirect")
33 s Error=$$startSession^%zewdPHP("ewdAjaxErrorRedirect",.%KEY,.%CGIEVAR,.sessionArray,.filesArray)
34 s sessid=$g(sessionArray("ewd_sessid"))
35 i Error["Enterprise Web Developer Error :",$g(sessionArray("ewd_pageType"))="ajax" d
36 . s Error=$p(Error,":",2,200)
37 . s Error=$$replaceAll^%zewdAPI(Error,"<br>",": ")
38 . s Error="EWD runtime error: "_Error
39 i $e(Error,1,32)="Enterprise Web Developer Error :" d QUIT 0
40 . n errorPage
41 . s errorPage=$g(sessionArray("ewd_errorPage"))
42 . i errorPage="" s errorPage="ewdError"
43 . i $g(sessionArray("ewd_pageType"))="ajax" s errorPage="ewdAjaxErrorRedirect"
44 . d writeHTTPHeader^%zewdGTMRuntime(sessionArray("ewd_appName"),errorPage,,,sessid,Error)
45 s stop=0
46 i Error="" d i stop QUIT 0
47 . n nextpage
48 . s nextpage=$$getSessionValue^%zewdAPI("ewd_nextPage",sessid)
49 . i nextpage'="" d
50 . . n x
51 . . d writeHTTPHeader^%zewdGTMRuntime(sessionArray("ewd_appName"),nextpage,$$getSessionValue^%zewdAPI("ewd_token",sessid),$$getSessionValue^%zewdAPI("ewd_pageToken",sessid))
52 . . s stop=1
53 i $$getSessionValue^%zewdAPI("ewd_warning",sessid)'="" d
54 . s Error=$$getSessionValue^%zewdAPI("ewd_warning",sessid)
55 . d deleteFromSession^%zewdAPI("ewd_warning",sessid)
56 w "HTTP/1.1 200 OK"_$c(13,10)
57 s ctype="text/html"
58 d mergeArrayFromSession^%zewdAPI(.headers,"ewd.header",sessid)
59 i $d(headers) d
60 . n lcname,name
61 . s name=""
62 . f s name=$o(headers(name)) q:name="" d
63 . . s lcname=$$zcvt^%zewdAPI(name,"l")
64 . . i lcname="content-type" s ctype=headers(name) q
65 . . w name_": "_headers(name)_$c(13,10)
66 w "Content-type: "_ctype_$c(13,10)
67 w $c(13,10)
68 QUIT 1
69 ;
70body ;
71 if ($g(Error)="") d
72 .w " <span>"_$c(13,10)
73 .w " <div href='/ewd/patientportal/ewdErrorRedirect.mgwsi?ewd_token="_$g(^%zewdSession("session",sessid,"ewd_token"))_"&n="_tokens("ewdErrorRedirect")_"&ewd_urlNo=ewdAjaxErrorRedirect1' id=""zewdRef"">"_$c(13,10)
74 .w "</div>"_$c(13,10)
75 .w " </span>"_$c(13,10)
76 .
77 w "<span id=""ewdajaxonload"">"_$c(13,10)
78 w " var ewdtext='"_$$jsEscape^%zewdGTMRuntime(Error)_"' ; if (ewdtext != '') { if (ewdtext.substring(0,11) == 'javascript:') { ewdtext=ewdtext.substring(11) ; eval(ewdtext) ; } else { EWD.ajax.alert('"_$$htmlEscape^%zewdGTMRuntime($$jsEscape^%zewdGTMRuntime(Error))_"') }"_$c(13,10)
79 s id=""
80 f s id=$o(^%zewdSession("session","ewd_idList",id)) q:id="" d
81 . w "idPointer = document.getElementById('"_id_"') ; "
82 . w "if (idPointer != null) idPointer.className='"_$g(^%zewdSession("session","ewd_idList"))_"' ; "
83 s id=""
84 f s id=$o(^%zewdSession("session","ewd_errorFields",id)) q:id="" d
85 . w "idPointer = document.getElementById('"_id_"') ; "
86 . w "if (idPointer != null) idPointer.className='"_$g(^%zewdSession("session","ewd_errorClass"))_"' ; "
87 k ^%zewdSession("session","ewd_hasErrors")
88 k ^%zewdSession("session","ewd_errorFields")
89 k ^%zewdSession("session","ewd_idList")
90 w " } else {document.location = document.getElementById(""zewdRef"").getAttribute(""href"") ; }"_""
91 w "</span>"_$c(13,10)
92 QUIT
Note: See TracBrowser for help on using the repository browser.