Index: APPS/TBXWeb/TBXContext.cls.xml
===================================================================
diff -u -r63 -r79
--- APPS/TBXWeb/TBXContext.cls.xml (.../TBXContext.cls.xml) (revision 63)
+++ APPS/TBXWeb/TBXContext.cls.xml (.../TBXContext.cls.xml) (revision 79)
@@ -484,10 +484,42 @@
]]>
+
+
+Controleert of het Klantnummer ingevuld is; mag zowel numeriek als niet-numeriek zijn.
+OPMERKING : 0 (nul) wordt als ook als NIET-ingevuld beschouwd.
+
+Deze method is ter vervanging van method IsGeldigKlantID()
+KlantID:%String
+%Boolean
+
+
+
Controle van het Klantnummer
-Valideert alleen het formaat; controleert niet of Klantnummer effectief aanwezig is in de databank.
+Valideert alleen het formaat; controleert niet of Klantnummer effectief aanwezig is in de databank.
+
+DEPRECATED : use method IsKlantIDIngevuld() instead!
KlantID:%String
%Boolean
@@ -535,7 +557,7 @@
Set IsToegelaten=(..HeeftToegangZonderLogin())
}
Else {
- Set IsToegelaten=(..IsGeldigKlantID(KlantID))
+ Set IsToegelaten=(..IsKlantIDIngevuld(KlantID))
}
Quit IsToegelaten
]]>
@@ -665,6 +687,11 @@
Set ToonKnop=1
}
}
+ ElseIf ..IsSFS {
+ If KLNr=10001 {
+ Set ToonKnop=1
+ }
+ }
Quit ToonKnop
]]>
Index: csp/vhisie/TBX/Wizard/tmpDev.mac.rou
===================================================================
diff -u -r41 -r79
--- csp/vhisie/TBX/Wizard/tmpDev.mac.rou (.../tmpDev.mac.rou) (revision 41)
+++ csp/vhisie/TBX/Wizard/tmpDev.mac.rou (.../tmpDev.mac.rou) (revision 79)
@@ -61,7 +61,7 @@
Set UserType=$$ophGetUserType(KLNr,TBXContext.GeefWebDomein(),VERW,sMode)
Set %session.Data("UserType")=UserType
;Set UserTypeTxt=$CASE(UserType, $$$utKlantAnon:"KlantAnon", $$$utKlantKnown:"KlantKnown", $$$utVerwSub:"VerwSub", $$$utVerwDomain:"VerwDomain", $$$utVerwAdmin:"VerwAdmin", "":"?", :UserType)
- If (wsID="")&&(KLNr>0) Do
+ If (wsID="")&&(TBXContext.IsKlantIDIngevuld(KLNr)) Do
. ; New from Order (Copy into New) : wsIDFrom is passed by QS-parameter
. Set wsIDFrom=$G(%request.Data("NEWFROMORD",1))
. Set blnNewFromOrd=($$ophCheckFromWSOrd(wsIDFrom,KLNr))
@@ -70,15 +70,16 @@
. Set wsIDFrom=wsID
. Set blnNewFromOrd=0
-#If $$$NSpace="DEMO"
- Set blnCalcPrices=0
- New CalcExpr
- Set CalcExpr=$G(^UI.Settings("WWW-TBX","DEMO","CalcPrijs","ExprCondit"),0)
- If @CalcExpr Set blnCalcPrices=1
- ;Set:(%RemoteIP?1(1"192.168.1.195")) blnCalcPrices=1
-#Else
- Set blnCalcPrices=(KLNr>0)||(UserType>$$$utKlantAnon)
-#EndIf
+ Set blnCalcPrices=(TBXContext.IsKlantIDIngevuld(KLNr))||(UserType>$$$utKlantAnon)
+ If 0 && (blnCalcPrices) && ##class(TECH.Config.ConfigMgr).Instance().GetBoolean("Nog_in_te_vullen") {
+ // Op de DEMO-site mogen geen prijzen berekend worden. Daarom blnCalcPrices=0
+ // Uitzonderingen (bvb. voor bepaalde IP-adressen) kunnen via een Global-expression ingevuld worden.
+ Set blnCalcPrices=0
+ New CalcExpr
+ Set CalcExpr=$G(^UI.Settings("WWW-TBX","DEMO","CalcPrijs","ExprCondit"),0)
+ If @CalcExpr Set blnCalcPrices=1
+ ;Set:(%RemoteIP?1(1"192.168.1.195")) blnCalcPrices=1
+ }
Set blnPriceAvail=(blnCalcPrices)||($$ophGetPriceAvail(wsID))
Set blnCalcOFFAV=(blnCalcPrices)&&($$ophGetBonType(wsID)="OFFAV")
Set Munt="EUR"
@@ -88,8 +89,8 @@
Set:(blnPriceAvail )||(sMode'="A") lbShowFT=lbShowFT_$LB("OFF")
Set:(TBXContext.IsDomeinHEIN())||(sMode'="A")||((wsID>0)&&(sMode'="A")) lbShowFT=lbShowFT_$LB("BBON")
Set BTWInputMode=$S($$$NSpace="DEMO":0, 'blnVHEPN:0, blnCalcPrices:1, 1:3) ; 0=hidden, 1=shown but optional, 3=shown+obligatory
- Set:(blnVHEPN)&&(KLNr>0) BTWInputMode=0 ; Overrules previous line
- Set blnShowDynSpace=(blnVHEPN)&&(KLNr?1(1"4645x",1"6821"))
+ Set:(blnVHEPN)&&(TBXContext.IsKlantIDIngevuld(KLNr)) BTWInputMode=0 ; Overrules previous line
+ Set blnShowDynSpace=0 ; (blnVHEPN)&&(KLNr?1(1"4645x",1"6821"))
// Design Choice Mode : Intivo, Standaard of eXpert
Set DCM=""
Set:(wsIDFrom>0) DCM=##class(WS.TBX.Order).DCMCalc(wsIDFrom) ; wsID or wsIDFrom
@@ -116,7 +117,7 @@
Quit 1
ophGetUserType(KLNr,Domain,Verw,Mode)
;d WL^vhDBG("KLNr"_KLNr_" Mode="_Mode_" wsID="_wsID_" Verw="_Verw_" Domain="_Domain)
- Quit:(Mode="A") $S(TBXContext.AlleenToegangZonderLogin():$$$utKlantAnonWP, KLNr>0:$$$utKlantKnown, 1:$$$utKlantAnon)
+ Quit:(Mode="A") $S(TBXContext.AlleenToegangZonderLogin():$$$utKlantAnonWP, TBXContext.IsKlantIDIngevuld(KLNr):$$$utKlantKnown, 1:$$$utKlantAnon)
Quit:(Mode="W") $$ophGetVERWType(Domain,Verw)
Quit:(Mode="P") $$$utKlantAnon ; Temporary: fixed value
;Else
@@ -131,7 +132,7 @@
Quit:('$IsObject(WSOrd)) 0
Set OrdDomVERW=$LG(##class(WS.TBX.Order).DomainLookUp($$TBXDomainCVT^cspBasis.Library(WSOrd.WebDomain),$LB("VERW")),1)
Quit:(OrdDomVERW'=TBXContext.GeefDomeinVerwerker()) 0 ; Onbekend of foutief domein
- Quit (WSOrd.KLNummer>0)&&(WSOrd.KLNummer=MatchKLNr)
+ Quit (TBXContext.IsKlantIDIngevuld(WSOrd.KLNummer))&&(WSOrd.KLNummer=MatchKLNr)
ophInschfElmntInfo(wsID)
// bepalen of InschuifElement reeds gekozen is kan adhv bestaand order.
Index: cspBasis/TBX/DecodeURL/tmpDev.mac.rou
===================================================================
diff -u -r18 -r79
--- cspBasis/TBX/DecodeURL/tmpDev.mac.rou (.../tmpDev.mac.rou) (revision 18)
+++ cspBasis/TBX/DecodeURL/tmpDev.mac.rou (.../tmpDev.mac.rou) (revision 79)
@@ -128,7 +128,7 @@
. If blnRedir Set %session.Data("UserType")=UserType
. Else Kill %session.Data("UserType")
- If (blnLMC||blnSFS||blnMBHO||blnHFLB)&&($G(RefArray("KLNR"))'>0) Do
+ If (blnLMC||blnSFS||blnMBHO||blnHFLB) && ( $$$Not(TBXContext.IsKlantIDIngevuld($G(RefArray("KLNR")))) ) Do
. Set blnRedir=0
. Set LoginState="ERR"
@@ -238,7 +238,7 @@
#If $$$NSpace="xDEMO"
Quit:(Mode="A") $S(1:$$$utKlantAnon)
#Else
- Quit:(Mode="A") $S(blnHEIN||blnDUPO||blnHELMY||blnHFLE:$$$utKlantAnonWP, KLNr>0:$$$utKlantKnown, 1:$$$utKlantAnon) ; blnLMC,blnSFS,blnMBHO, : $$$utKlantKnown
+ Quit:(Mode="A") $S(blnHEIN||blnDUPO||blnHELMY||blnHFLE:$$$utKlantAnonWP, TBXContext.IsKlantIDIngevuld(KLNr):$$$utKlantKnown, 1:$$$utKlantAnon) ; blnLMC,blnSFS,blnMBHO, : $$$utKlantKnown
#EndIf
Quit:(Mode="W") $$ophGetVERWType(Domain,Verw)
Quit:(Mode="P") $$$utKlantAnon ; Temporary: fixed value
@@ -388,7 +388,7 @@
. Set %OptimaVar("Data")=Data
. Set %OptimaVar("EncData")=$G(encData)
. Set Data=""
- . Quit:($IsValidNum(KLNr))&&($G(ForceKLNrLookup,1)=0)
+ . Quit:($IsValidNum(KLNr))&&($G(ForceKLNrLookup,1)=0) ; TBXContext.IsKlantIDIngevuld(KLNr)
. ; Else match encData with values from global
. Set KLNr=##class(cspBasis.GAProdTBox).GetOptimaFixKLNr($G(encData))
. Set:($L(KLNr)) %OptimaVar("KLNr")=KLNr
Index: csp/vhisie/TBX/Main/tmpDev.mac.rou
===================================================================
diff -u -r46 -r79
--- csp/vhisie/TBX/Main/tmpDev.mac.rou (.../tmpDev.mac.rou) (revision 46)
+++ csp/vhisie/TBX/Main/tmpDev.mac.rou (.../tmpDev.mac.rou) (revision 79)
@@ -83,7 +83,7 @@
. . Set:($L($G(tmpRq("REF")))) tmpRq("REF")=$$CreateHashedRef^cspBasis.TBX.DecodeURL.tmpDev($LB(KLNr,VERW,wsID,$G(RefArray("MODE"))))
. . Kill tmpRq("DATAOPT")
. . ;Do ophBuildSwitchTLArray ; Once again, but with the NEW QueryString-values
- . Else If ($IsValidNum(KLNr))&&($G(%request.Data("Taal",1))="") Do
+ . Else If (TBXContext.IsKlantIDIngevuld(KLNr))&&($G(%request.Data("Taal",1))="") Do
. . Set KLMini=##class(cspBasis.GAProdTBox).GetKlantData(TBXContext.GeefDomeinVerwerker(),KLNr,$LB("Stg","NoAction"))
. . Set:($IsObject(KLMini))&&(KLMini.Taal?1(1"N",1"F",1"E",1"D")) Taal=KLMini.Taal
. . Set KLMini=""
@@ -141,7 +141,11 @@
. Set blnAllowedBrowser=$$$IsAllowedMacBrowser(%request.UserAgent)
Else Do
. Set blnAllowedBrowser=$$$IsAllowedBrowser(%request.UserAgent) ; Browser list : MSIE, Firefox, Opera, Chrome, Safari
-
+
+ If (TBXContext.IsDomeinSFS())&&($G(KLNr)=10001) {
+ Set blnAllowedBrowser=1
+ }
+
// Placed in comment by WimV on 02/08/2011 --> universele oplossing in klasse %CSP.UserAgent
; If $$$IsRecentBrowser(%request.UserAgent) Do ; Added by WimV on 28/03/2011
; . Set %session.BrokerImplementation=2 ; use XMLHTTPRequest method
@@ -220,7 +224,7 @@
; In case of "Bad Encryption", try getting KLData from storage
If '$IsObject(KLMini) Do
. Set KLNr=$G(%OptimaVar("KLNr"))
- . Set:($IsValidNum(KLNr)) KLMini=##class(cspBasis.GAProdTBox).GetKlantData(TBXContext.GeefDomeinVerwerker(),KLNr,$LB("Stg","NoAction"))
+ . Set:(TBXContext.IsKlantIDIngevuld(KLNr)) KLMini=##class(cspBasis.GAProdTBox).GetKlantData(TBXContext.GeefDomeinVerwerker(),KLNr,$LB("Stg","NoAction"))
. Set sDomVERW=TBXContext.GeefDomeinVerwerker()
. Set msg="WARNING : Bad encryption for "_$S(sDomVERW="LMC":"Optima",1:sDomVERW)_" customer (n� "_$G(KLNr)_")"
. Set msg=msg_$$$CRLF_"Ref : "_($$ophGetRef^cspBasis.TBX.DecodeURL.tmpDev(Ref))_$$$CRLF_"Enc. Data : "_$G(%OptimaVar("EncData"))_$$$CRLF_"Decrypted Data : "_$G(%OptimaVar("Data"))_$$$CRLF_"KLNr via Lookup: "_$G(%OptimaVar("KLNrViaLookup"))
@@ -285,7 +289,7 @@
. // Onbekend of foutief domein - GEEN TOEGANG !!! WSOrder moet steeds binnen WebDomein blijven !!!
. Set arValues(0,"ERROR")="Onbekend of foutief domein"
; Else ; ==> sDomVERW=OrdDomVERW
- Quit:(%RemoteIP?1(1"192.168.1.")1.3N)&&(MatchKLNr=1000) 1
+ Quit:(%RemoteIP?1(1"192.168.")1.3N1"."1.3N)&&(MatchKLNr=1000) 1
Set OrdKLNr=WSOrd.KLNummer
Set blnOK=0
If TBXContext.IsDomeinVHEPN() Do Quit blnOK
@@ -469,7 +473,7 @@
; Button PrintPage
Do MShowPrintPage(1,blnOFFVervallen||blnDynaplugERR||$$$Not(IsDesignBeschikbaar))
; Button BookmarkPage
- Do MShowBookmarkPage('$IsValidNum(KLNr),WSOrd)
+ Do MShowBookmarkPage((KLNr=""),WSOrd)
; Button Show XML
Do MShowExportXML((TBXContext.IsBeschikbaarExportXML())&&((KLNr=$$$TBoxWebKlantNrVHEPN)||(KLNr=$$$TBoxWebKlantNrHEIN)) )
; Button Submit
@@ -665,7 +669,7 @@
Quit
MShowNewOrder(Visible)
- Quit:((TBXContext.AlleenToegangMetLogin())&&(KLNr'>0))
+ Quit:((TBXContext.AlleenToegangMetLogin())&&('TBXContext.IsKlantIDIngevuld(KLNr)))
Quit:(KLNr=$$$KLNrListAll)&&($$$Not((sMode="START")&&(TBXContext.AlleenToegangZonderLogin())))
Quit:('$G(blnValidKlant,1))
New tmpAr
Index: vhUnitTest/APPS/TBXWeb/TestTBXContext.cls.xml
===================================================================
diff -u
--- vhUnitTest/APPS/TBXWeb/TestTBXContext.cls.xml (revision 0)
+++ vhUnitTest/APPS/TBXWeb/TestTBXContext.cls.xml (revision 79)
@@ -0,0 +1,118 @@
+
+
+
+
+Oproepen via
+ do ##class(vhUnitTest.Manager).RunTest("/debug/display=all","APPS.TBXWeb.TestTBXContext")
+
+APPS.TBXWeb,PRGACNTs
+1
+vhUnitTest.TestCase
+0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1
+
+
+
+
+1
+
+
+
+
+1
+
+
+
+
+1
+
+
+
+