No regular expressions were active.
1 |
|
<?php requ
ire_once("
../header.
inc.php");
?>
|
|
1 |
|
<?php requ
ire_once("
../header.
inc.php");
?>
|
2 |
|
|
|
2 |
|
|
3 |
|
var sFolde
r = "<?php
echo $sit
e['url'];
?>xml/";
|
|
3 |
|
var sFolde
r = "<?php
echo $sit
e['url'];
?>xml/";
|
4 |
|
var sURLGe
tList = sF
older + "g
et_list.ph
p?";
|
|
4 |
|
var sURLGe
tList = sF
older + "g
et_list.ph
p?";
|
5 |
|
var reques
tsQueue =
new Array(
);
|
|
5 |
|
var reques
tsQueue =
new Array(
);
|
6 |
|
var arrIni
tialValues
OfAsyncFie
lds = new
Array();
|
|
6 |
|
var arrIni
tialValues
OfAsyncFie
lds = new
Array();
|
7 |
|
var update
dFields =
new Array(
);
|
|
7 |
|
var update
dFields =
new Array(
);
|
8 |
|
|
|
8 |
|
|
9 |
|
var sPostN
ame;
|
|
9 |
|
var sPostN
ame;
|
10 |
|
var sPostV
alue;
|
|
10 |
|
var sPostV
alue;
|
11 |
|
var bPostA
ction;
|
|
11 |
|
var bPostA
ction;
|
12 |
|
|
|
12 |
|
|
13 |
|
/*
|
|
13 |
|
/*
|
14 |
|
* update
List - fu
nction upd
ates optio
ns list in
drop-down
box
|
|
14 |
|
* update
List - fu
nction upd
ates optio
ns list in
drop-down
box
|
15 |
|
*/
|
|
15 |
|
*/
|
16 |
|
function U
pdateListC
ommon(data
Type, targ
etField, f
ilterFlag,
iID, sCus
tomTargetF
ield1, sCu
stomTarget
Field2, sU
nit) {
|
|
16 |
|
function U
pdateListC
ommon(data
Type, targ
etField, f
ilterFlag,
iID, sCus
tomTargetF
ield1, sCu
stomTarget
Field2, sU
nit) {
|
17 |
|
if (do
cument.get
ElementByI
d(targetFi
eld)) {//i
f targer e
xists
|
|
17 |
|
if (do
cument.get
ElementByI
d(targetFi
eld)) {//i
f targer e
xists
|
18 |
|
sw
itch (data
Type) {
|
|
18 |
|
sw
itch (data
Type) {
|
19 |
|
case "Re
loadClassi
fieds":
|
|
19 |
|
case "Re
loadClassi
fieds":
|
20 |
|
Clea
rSelection
(targetFie
ld);
|
|
20 |
|
Clea
rSelection
(targetFie
ld);
|
21 |
|
|
|
21 |
|
|
22 |
|
sele
ction = do
cument.get
ElementByI
d(targetFi
eld);
|
|
22 |
|
sele
ction = do
cument.get
ElementByI
d(targetFi
eld);
|
23 |
|
opti
onObject =
new Optio
n('Loading
...', 'nul
l', false,
false);
|
|
23 |
|
opti
onObject =
new Optio
n('Loading
...', 'nul
l', false,
false);
|
24 |
|
sele
ction.opti
ons[select
ion.length
] = option
Object;
|
|
24 |
|
sele
ction.opti
ons[select
ion.length
] = option
Object;
|
25 |
|
|
|
25 |
|
|
26 |
|
var
sURLReques
t = "dataT
ype="+data
Type+"&"+f
ilterFlag+
"="+iID;
|
|
26 |
|
var
sURLReques
t = "dataT
ype="+data
Type+"&"+f
ilterFlag+
"="+iID;
|
27 |
|
addR
equestToQu
eue(sURLRe
quest, dat
aType, tar
getField);
|
|
27 |
|
addR
equestToQu
eue(sURLRe
quest, dat
aType, tar
getField);
|
28 |
|
break;
|
|
28 |
|
break;
|
29 |
|
case "Re
loadSubTre
e":
|
|
29 |
|
case "Re
loadSubTre
e":
|
30 |
|
sele
ction = do
cument.get
ElementByI
d(targetFi
eld);
|
|
30 |
|
sele
ction = do
cument.get
ElementByI
d(targetFi
eld);
|
31 |
|
if (
selection.
innerHTML
== '') {
|
|
31 |
|
if (
selection.
innerHTML
== '') {
|
32 |
|
oPicSelect
ion = docu
ment.getEl
ementById(
"tree_acti
on_img_" +
iID);
|
|
32 |
|
oPicSelect
ion = docu
ment.getEl
ementById(
"tree_acti
on_img_" +
iID);
|
33 |
|
oPicSelect
ion.src =
"images/mi
nus.gif";
|
|
33 |
|
oPicSelect
ion.src =
"images/mi
nus.gif";
|
34 |
|
var bReloa
dTree = tr
ue;
|
|
34 |
|
var bReloa
dTree = tr
ue;
|
35 |
|
var sURLRe
quest = "d
ataType="+
dataType+"
&"+filterF
lag+"="+iI
D;
|
|
35 |
|
var sURLRe
quest = "d
ataType="+
dataType+"
&"+filterF
lag+"="+iI
D;
|
36 |
|
addRequest
ToQueue(sU
RLRequest,
dataType,
targetFie
ld, '', ''
, '', bRel
oadTree);
|
|
36 |
|
addRequest
ToQueue(sU
RLRequest,
dataType,
targetFie
ld, '', ''
, '', bRel
oadTree);
|
37 |
|
}
|
|
37 |
|
}
|
38 |
|
else
{
|
|
38 |
|
else
{
|
39 |
|
oPicSelect
ion = docu
ment.getEl
ementById(
"tree_acti
on_img_" +
iID);
|
|
39 |
|
oPicSelect
ion = docu
ment.getEl
ementById(
"tree_acti
on_img_" +
iID);
|
40 |
|
oPicSelect
ion.src =
"images/pl
us.gif";
|
|
40 |
|
oPicSelect
ion.src =
"images/pl
us.gif";
|
41 |
|
selection.
innerHTML
= '';
|
|
41 |
|
selection.
innerHTML
= '';
|
42 |
|
}
|
|
42 |
|
}
|
43 |
|
break;
|
|
43 |
|
break;
|
44 |
|
case "Re
loadClassi
fiedsAndCu
stomsField
s":
|
|
44 |
|
case "Re
loadClassi
fiedsAndCu
stomsField
s":
|
45 |
|
Clea
rSelection
(targetFie
ld);
|
|
45 |
|
Clea
rSelection
(targetFie
ld);
|
46 |
|
|
|
46 |
|
|
47 |
|
sele
ction = do
cument.get
ElementByI
d(targetFi
eld);
|
|
47 |
|
sele
ction = do
cument.get
ElementByI
d(targetFi
eld);
|
48 |
|
|
|
48 |
|
|
49 |
|
if (
selection)
{
|
|
49 |
|
if (
selection)
{
|
50 |
|
optionObje
ct = new O
ption('Loa
ding...',
'null', fa
lse, false
);
|
|
50 |
|
optionObje
ct = new O
ption('Loa
ding...',
'null', fa
lse, false
);
|
51 |
|
selection.
options[se
lection.le
ngth] = op
tionObject
;
|
|
51 |
|
selection.
options[se
lection.le
ngth] = op
tionObject
;
|
52 |
|
}
|
|
52 |
|
}
|
53 |
|
|
|
53 |
|
|
54 |
|
var
bAdminMan
= document
.getElemen
tById('adm
in_managin
g');
|
|
54 |
|
var
bAdminMan
= document
.getElemen
tById('adm
in_managin
g');
|
55 |
|
if (
bAdminMan)
{
|
|
55 |
|
if (
bAdminMan)
{
|
56 |
|
//document
.getElemen
tById('cus
tomRow1').
style.disp
lay = 'non
e';
|
|
56 |
|
//document
.getElemen
tById('cus
tomRow1').
style.disp
lay = 'non
e';
|
57 |
|
//document
.getElemen
tById('cus
tomRow2').
style.disp
lay = 'non
e';
|
|
57 |
|
//document
.getElemen
tById('cus
tomRow2').
style.disp
lay = 'non
e';
|
58 |
|
document.g
etElementB
yId('Custo
mName1').v
alue="";
|
|
58 |
|
document.g
etElementB
yId('Custo
mName1').v
alue="";
|
59 |
|
document.g
etElementB
yId('Custo
mName2').v
alue="";
|
|
59 |
|
document.g
etElementB
yId('Custo
mName2').v
alue="";
|
60 |
|
document.g
etElementB
yId('Custo
mAction1')
.value="-1
";
|
|
60 |
|
document.g
etElementB
yId('Custo
mAction1')
.value="-1
";
|
61 |
|
document.g
etElementB
yId('Custo
mAction2')
.value="-1
";
|
|
61 |
|
document.g
etElementB
yId('Custo
mAction2')
.value="-1
";
|
62 |
|
}
|
|
62 |
|
}
|
63 |
|
|
|
63 |
|
|
64 |
|
if (
oElement =
document.
getElement
ById(targe
tField)) {
|
|
64 |
|
if (
oElement =
document.
getElement
ById(targe
tField)) {
|
65 |
|
oElement.s
tyle.displ
ay = 'none
';
|
|
65 |
|
oElement.s
tyle.displ
ay = 'none
';
|
66 |
|
}
|
|
66 |
|
}
|
67 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
1)) {
|
|
67 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
1)) {
|
68 |
|
oElement.s
tyle.displ
ay = 'none
';
|
|
68 |
|
oElement.s
tyle.displ
ay = 'none
';
|
69 |
|
}
|
|
69 |
|
}
|
70 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
2)) {
|
|
70 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
2)) {
|
71 |
|
oElement.s
tyle.displ
ay = 'none
';
|
|
71 |
|
oElement.s
tyle.displ
ay = 'none
';
|
72 |
|
}
|
|
72 |
|
}
|
73 |
|
|
|
73 |
|
|
74 |
|
var
sURLReques
t = "dataT
ype="+data
Type+"&"+f
ilterFlag+
"="+iID;
|
|
74 |
|
var
sURLReques
t = "dataT
ype="+data
Type+"&"+f
ilterFlag+
"="+iID;
|
75 |
|
addR
equestToQu
eue(sURLRe
quest, dat
aType, tar
getField,
sCustomTar
getField1,
sCustomTa
rgetField2
, sUnit);
|
|
75 |
|
addR
equestToQu
eue(sURLRe
quest, dat
aType, tar
getField,
sCustomTar
getField1,
sCustomTa
rgetField2
, sUnit);
|
76 |
|
break;
|
|
76 |
|
break;
|
77 |
|
case "Re
loadOnlyCu
stomsField
s":
|
|
77 |
|
case "Re
loadOnlyCu
stomsField
s":
|
78 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
1)) {
|
|
78 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
1)) {
|
79 |
|
oElement.s
tyle.displ
ay = 'none
';
|
|
79 |
|
oElement.s
tyle.displ
ay = 'none
';
|
80 |
|
}
|
|
80 |
|
}
|
81 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
2)) {
|
|
81 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
2)) {
|
82 |
|
oElement.s
tyle.displ
ay = 'none
';
|
|
82 |
|
oElement.s
tyle.displ
ay = 'none
';
|
83 |
|
}
|
|
83 |
|
}
|
84 |
|
|
|
84 |
|
|
85 |
|
var
sURLReques
t = "dataT
ype="+data
Type+"&"+f
ilterFlag+
"="+iID;
|
|
85 |
|
var
sURLReques
t = "dataT
ype="+data
Type+"&"+f
ilterFlag+
"="+iID;
|
86 |
|
addR
equestToQu
eue(sURLRe
quest, dat
aType, '',
sCustomTa
rgetField1
, sCustomT
argetField
2);
|
|
86 |
|
addR
equestToQu
eue(sURLRe
quest, dat
aType, '',
sCustomTa
rgetField1
, sCustomT
argetField
2);
|
87 |
|
break;
|
|
87 |
|
break;
|
88 |
|
}
|
|
88 |
|
}
|
89 |
|
}
|
|
89 |
|
}
|
90 |
|
}
|
|
90 |
|
}
|
91 |
|
|
|
91 |
|
|
92 |
|
function a
ddRequestT
oQueue(sUR
LRequest,
sXmlNodeNa
me, toFiel
d, sCustom
TargetFiel
d1, sCusto
mTargetFie
ld2, sUnit
, bReloadT
ree) {
|
|
92 |
|
function a
ddRequestT
oQueue(sUR
LRequest,
sXmlNodeNa
me, toFiel
d, sCustom
TargetFiel
d1, sCusto
mTargetFie
ld2, sUnit
, bReloadT
ree) {
|
93 |
|
reques
tsQueue[re
questsQueu
e.length]
= new Queu
eItem(sURL
GetList+sU
RLRequest,
sXmlNodeN
ame, toFie
ld, sCusto
mTargetFie
ld1, sCust
omTargetFi
eld2, sUni
t, bReload
Tree);
|
|
93 |
|
reques
tsQueue[re
questsQueu
e.length]
= new Queu
eItem(sURL
GetList+sU
RLRequest,
sXmlNodeN
ame, toFie
ld, sCusto
mTargetFie
ld1, sCust
omTargetFi
eld2, sUni
t, bReload
Tree);
|
94 |
|
if (re
questsQueu
e.length =
= 1)
|
|
94 |
|
if (re
questsQueu
e.length =
= 1)
|
95 |
|
do
SendReques
t();
|
|
95 |
|
do
SendReques
t();
|
96 |
|
}
|
|
96 |
|
}
|
97 |
|
|
|
97 |
|
|
98 |
|
function Q
ueueItem(u
rl, sXmlNo
deName, to
Field, sCu
stomTarget
Field1, sC
ustomTarge
tField2, s
Unit, bRel
oadTree) {
|
|
98 |
|
function Q
ueueItem(u
rl, sXmlNo
deName, to
Field, sCu
stomTarget
Field1, sC
ustomTarge
tField2, s
Unit, bRel
oadTree) {
|
99 |
|
this.u
rl=url;
|
|
99 |
|
this.u
rl=url;
|
100 |
|
this.s
XmlNodeNam
e=sXmlNode
Name;
|
|
100 |
|
this.s
XmlNodeNam
e=sXmlNode
Name;
|
101 |
|
this.t
oField=toF
ield;
|
|
101 |
|
this.t
oField=toF
ield;
|
102 |
|
this.b
ReloadTree
=bReloadTr
ee;
|
|
102 |
|
this.b
ReloadTree
=bReloadTr
ee;
|
103 |
|
this.s
CustomTarg
etField1 =
sCustomTa
rgetField1
;
|
|
103 |
|
this.s
CustomTarg
etField1 =
sCustomTa
rgetField1
;
|
104 |
|
this.s
CustomTarg
etField2 =
sCustomTa
rgetField2
;
|
|
104 |
|
this.s
CustomTarg
etField2 =
sCustomTa
rgetField2
;
|
105 |
|
this.s
Unit = sUn
it;
|
|
105 |
|
this.s
Unit = sUn
it;
|
106 |
|
}
|
|
106 |
|
}
|
107 |
|
|
|
107 |
|
|
108 |
|
function d
oSendReque
st() {
|
|
108 |
|
function d
oSendReque
st() {
|
109 |
|
global
ObjXmlHttp
Request =
createXmlH
ttpObject(
);
|
|
109 |
|
global
ObjXmlHttp
Request =
createXmlH
ttpObject(
);
|
110 |
|
if ( g
lobalObjXm
lHttpReque
st ) {
|
|
110 |
|
if ( g
lobalObjXm
lHttpReque
st ) {
|
111 |
|
gl
obalObjXml
HttpReques
t.onreadys
tatechange
= Recieve
Data;
|
|
111 |
|
gl
obalObjXml
HttpReques
t.onreadys
tatechange
= Recieve
Data;
|
112 |
|
gl
obalObjXml
HttpReques
t.open("GE
T", reques
tsQueue[0]
.url);
|
|
112 |
|
gl
obalObjXml
HttpReques
t.open("GE
T", reques
tsQueue[0]
.url);
|
113 |
|
gl
obalObjXml
HttpReques
t.send(nul
l);
|
|
113 |
|
gl
obalObjXml
HttpReques
t.send(nul
l);
|
114 |
|
}
|
|
114 |
|
}
|
115 |
|
}
|
|
115 |
|
}
|
116 |
|
|
|
116 |
|
|
117 |
|
function c
reateXmlHt
tpObject()
{
|
|
117 |
|
function c
reateXmlHt
tpObject()
{
|
118 |
|
var ob
jXmlHttp =
false;
|
|
118 |
|
var ob
jXmlHttp =
false;
|
119 |
|
|
|
119 |
|
|
120 |
|
if ( w
indow.XMLH
ttpRequest
)
|
|
120 |
|
if ( w
indow.XMLH
ttpRequest
)
|
121 |
|
ob
jXmlHttp =
new XMLHt
tpRequest(
);
|
|
121 |
|
ob
jXmlHttp =
new XMLHt
tpRequest(
);
|
122 |
|
else i
f ( window
.ActiveXOb
ject )
|
|
122 |
|
else i
f ( window
.ActiveXOb
ject )
|
123 |
|
ob
jXmlHttp =
new Activ
eXObject("
Microsoft.
XMLHTTP");
|
|
123 |
|
ob
jXmlHttp =
new Activ
eXObject("
Microsoft.
XMLHTTP");
|
124 |
|
|
|
124 |
|
|
125 |
|
return
objXmlHtt
p;
|
|
125 |
|
return
objXmlHtt
p;
|
126 |
|
}
|
|
126 |
|
}
|
127 |
|
|
|
127 |
|
|
128 |
|
function R
ecieveData
() {
|
|
128 |
|
function R
ecieveData
() {
|
129 |
|
if(glo
balObjXmlH
ttpRequest
.readyStat
e == 4) {
|
|
129 |
|
if(glo
balObjXmlH
ttpRequest
.readyStat
e == 4) {
|
130 |
|
//
if( reque
stsQueue[0
] )
|
|
130 |
|
//
if( reque
stsQueue[0
] )
|
131 |
|
//
{
|
|
131 |
|
//
{
|
132 |
|
// alert
( requests
Queue[0].u
rl );
|
|
132 |
|
// alert
( requests
Queue[0].u
rl );
|
133 |
|
//window
.open( req
uestsQueue
[0].url );
|
|
133 |
|
//window
.open( req
uestsQueue
[0].url );
|
134 |
|
//
}
|
|
134 |
|
//
}
|
135 |
|
|
|
135 |
|
|
136 |
|
//
Dequeue r
equest and
run the h
andler
|
|
136 |
|
//
Dequeue r
equest and
run the h
andler
|
137 |
|
if
((request
Data = req
uestsQueue
.shift())
== null)
|
|
137 |
|
if
((request
Data = req
uestsQueue
.shift())
== null)
|
138 |
|
throw ne
w Error('I
nternal er
ror: queue
is empty'
);
|
|
138 |
|
throw ne
w Error('I
nternal er
ror: queue
is empty'
);
|
139 |
|
|
|
139 |
|
|
140 |
|
if
(globalOb
jXmlHttpRe
quest.stat
us == 200)
{
|
|
140 |
|
if
(globalOb
jXmlHttpRe
quest.stat
us == 200)
{
|
141 |
|
if (requ
estData.to
Field) {
|
|
141 |
|
if (requ
estData.to
Field) {
|
142 |
|
Clea
rSelection
(requestDa
ta.toField
, requestD
ata.bReloa
dTree);
|
|
142 |
|
Clea
rSelection
(requestDa
ta.toField
, requestD
ata.bReloa
dTree);
|
143 |
|
}
|
|
143 |
|
}
|
144 |
|
fillSele
ctionWithX
mlData(req
uestData.s
XmlNodeNam
e, request
Data.toFie
ld, global
ObjXmlHttp
Request.re
sponseXML,
requestDa
ta.sCustom
TargetFiel
d1, reques
tData.sCus
tomTargetF
ield2, req
uestData.s
Unit, requ
estData.bR
eloadTree)
;
|
|
144 |
|
fillSele
ctionWithX
mlData(req
uestData.s
XmlNodeNam
e, request
Data.toFie
ld, global
ObjXmlHttp
Request.re
sponseXML,
requestDa
ta.sCustom
TargetFiel
d1, reques
tData.sCus
tomTargetF
ield2, req
uestData.s
Unit, requ
estData.bR
eloadTree)
;
|
145 |
|
}
|
|
145 |
|
}
|
146 |
|
if
(requests
Queue.leng
th > 0)
|
|
146 |
|
if
(requests
Queue.leng
th > 0)
|
147 |
|
doSendRe
quest();
|
|
147 |
|
doSendRe
quest();
|
148 |
|
|
|
148 |
|
|
149 |
|
se
lection =
document.g
etElementB
yId(reques
tData.toFi
eld);
|
|
149 |
|
se
lection =
document.g
etElementB
yId(reques
tData.toFi
eld);
|
150 |
|
if
(arrIniti
alValuesOf
AsyncField
s[requestD
ata.toFiel
d] != unde
fined &&
|
|
150 |
|
if
(arrIniti
alValuesOf
AsyncField
s[requestD
ata.toFiel
d] != unde
fined &&
|
151 |
|
arrIniti
alValuesOf
AsyncField
s[requestD
ata.toFiel
d] != '')
|
|
151 |
|
arrIniti
alValuesOf
AsyncField
s[requestD
ata.toFiel
d] != '')
|
152 |
|
sele
ction.valu
e = arrIni
tialValues
OfAsyncFie
lds[reques
tData.toFi
eld];
|
|
152 |
|
sele
ction.valu
e = arrIni
tialValues
OfAsyncFie
lds[reques
tData.toFi
eld];
|
153 |
|
ar
rInitialVa
luesOfAsyn
cFields[re
questData.
toField]=n
ull;
|
|
153 |
|
ar
rInitialVa
luesOfAsyn
cFields[re
questData.
toField]=n
ull;
|
154 |
|
se
lection =
document.g
etElementB
yId(reques
tData.toFi
eld);
|
|
154 |
|
se
lection =
document.g
etElementB
yId(reques
tData.toFi
eld);
|
155 |
|
if
(selectio
n) {
|
|
155 |
|
if
(selectio
n) {
|
156 |
|
if (type
of(selecti
on.onchang
e) == 'fun
ction')
|
|
156 |
|
if (type
of(selecti
on.onchang
e) == 'fun
ction')
|
157 |
|
sele
ction.onch
ange();
// Perform
chain act
ion
|
|
157 |
|
sele
ction.onch
ange();
// Perform
chain act
ion
|
158 |
|
}
|
|
158 |
|
}
|
159 |
|
}
|
|
159 |
|
}
|
160 |
|
}
|
|
160 |
|
}
|
161 |
|
|
|
161 |
|
|
162 |
|
function C
learSelect
ion(select
ionID, bRe
loadTree)
{
|
|
162 |
|
function C
learSelect
ion(select
ionID, bRe
loadTree)
{
|
163 |
|
var se
lection =
document.g
etElementB
yId(select
ionID);
|
|
163 |
|
var se
lection =
document.g
etElementB
yId(select
ionID);
|
164 |
|
if (bR
eloadTree)
{
|
|
164 |
|
if (bR
eloadTree)
{
|
165 |
|
se
lection.in
nerHTML =
'';
|
|
165 |
|
se
lection.in
nerHTML =
'';
|
166 |
|
}
|
|
166 |
|
}
|
167 |
|
else {
|
|
167 |
|
else {
|
168 |
|
fo
r (var i =
selection
.options.l
ength - 1;
i >= 0; i
--) {
|
|
168 |
|
fo
r (var i =
selection
.options.l
ength - 1;
i >= 0; i
--) {
|
169 |
|
selectio
n.options[
i] = null;
|
|
169 |
|
selectio
n.options[
i] = null;
|
170 |
|
}
|
|
170 |
|
}
|
171 |
|
}
|
|
171 |
|
}
|
172 |
|
}
|
|
172 |
|
}
|
173 |
|
|
|
173 |
|
|
174 |
|
function f
illSelecti
onWithXmlD
ata(target
XmlTagName
, selectio
nID, xmlNo
de, sCusto
mTargetFie
ld1, sCust
omTargetFi
eld2, sUni
t, bReload
Tree) {
|
|
174 |
|
function f
illSelecti
onWithXmlD
ata(target
XmlTagName
, selectio
nID, xmlNo
de, sCusto
mTargetFie
ld1, sCust
omTargetFi
eld2, sUni
t, bReload
Tree) {
|
175 |
|
var se
lection =
document.g
etElementB
yId(select
ionID);
|
|
175 |
|
var se
lection =
document.g
etElementB
yId(select
ionID);
|
176 |
|
var op
tions = xm
lNode.getE
lementsByT
agName(tar
getXmlTagN
ame);
|
|
176 |
|
var op
tions = xm
lNode.getE
lementsByT
agName(tar
getXmlTagN
ame);
|
177 |
|
var cu
stSel1;
|
|
177 |
|
var cu
stSel1;
|
178 |
|
var cu
stSel1;
|
|
178 |
|
var cu
stSel1;
|
179 |
|
var st
rt='';
|
|
179 |
|
var st
rt='';
|
180 |
|
var bA
dminMan =
document.g
etElementB
yId('admin
_managing'
);
|
|
180 |
|
var bA
dminMan =
document.g
etElementB
yId('admin
_managing'
);
|
181 |
|
if (bA
dminMan==n
ull) bAdmi
nMan = fal
se;
|
|
181 |
|
if (bA
dminMan==n
ull) bAdmi
nMan = fal
se;
|
182 |
|
|
|
182 |
|
|
183 |
|
if (sC
ustomTarge
tField1 &&
sCustomTa
rgetField2
&& bAdmin
Man==false
) {
|
|
183 |
|
if (sC
ustomTarge
tField1 &&
sCustomTa
rgetField2
&& bAdmin
Man==false
) {
|
184 |
|
cu
stSel1 = d
ocument.ge
tElementBy
Id(sCustom
TargetFiel
d1);
|
|
184 |
|
cu
stSel1 = d
ocument.ge
tElementBy
Id(sCustom
TargetFiel
d1);
|
185 |
|
cu
stSel2 = d
ocument.ge
tElementBy
Id(sCustom
TargetFiel
d2);
|
|
185 |
|
cu
stSel2 = d
ocument.ge
tElementBy
Id(sCustom
TargetFiel
d2);
|
186 |
|
cu
stSel1.inn
erHTML = '
';
|
|
186 |
|
cu
stSel1.inn
erHTML = '
';
|
187 |
|
cu
stSel2.inn
erHTML = '
';
|
|
187 |
|
cu
stSel2.inn
erHTML = '
';
|
188 |
|
}
|
|
188 |
|
}
|
189 |
|
|
|
189 |
|
|
190 |
|
for (v
ar optionI
ndex = 0;
optionInde
x <= optio
ns.length
- 1; optio
nIndex++)
{
|
|
190 |
|
for (v
ar optionI
ndex = 0;
optionInde
x <= optio
ns.length
- 1; optio
nIndex++)
{
|
191 |
|
va
r optionDa
ta = optio
ns[optionI
ndex].chil
dNodes;
|
|
191 |
|
va
r optionDa
ta = optio
ns[optionI
ndex].chil
dNodes;
|
192 |
|
va
r optionID
= '';
|
|
192 |
|
va
r optionID
= '';
|
193 |
|
va
r optionVa
lue = '';
|
|
193 |
|
va
r optionVa
lue = '';
|
194 |
|
va
r optionCn
t = '';
|
|
194 |
|
va
r optionCn
t = '';
|
195 |
|
va
r custFiel
dName1 = '
';
|
|
195 |
|
va
r custFiel
dName1 = '
';
|
196 |
|
va
r custFiel
dName2 = '
';
|
|
196 |
|
va
r custFiel
dName2 = '
';
|
197 |
|
va
r customAc
tion1 = ''
;
|
|
197 |
|
va
r customAc
tion1 = ''
;
|
198 |
|
va
r customAc
tion2 = ''
;
|
|
198 |
|
va
r customAc
tion2 = ''
;
|
199 |
|
va
r sUnitVal
ue = '';
|
|
199 |
|
va
r sUnitVal
ue = '';
|
200 |
|
|
|
200 |
|
|
201 |
|
fo
r (var pro
pertyIndex
= 0; prop
ertyIndex
<= optionD
ata.length
- 1; prop
ertyIndex+
+) {
|
|
201 |
|
fo
r (var pro
pertyIndex
= 0; prop
ertyIndex
<= optionD
ata.length
- 1; prop
ertyIndex+
+) {
|
202 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'ID
')
|
|
202 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'ID
')
|
203 |
|
opti
onID = get
NodeText(o
ptionData[
propertyIn
dex]);
|
|
203 |
|
opti
onID = get
NodeText(o
ptionData[
propertyIn
dex]);
|
204 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Na
me')
|
|
204 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Na
me')
|
205 |
|
opti
onValue =
getNodeTex
t(optionDa
ta[propert
yIndex]);
|
|
205 |
|
opti
onValue =
getNodeTex
t(optionDa
ta[propert
yIndex]);
|
206 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Co
unt')
|
|
206 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Co
unt')
|
207 |
|
opti
onCnt = ge
tNodeText(
optionData
[propertyI
ndex]);
|
|
207 |
|
opti
onCnt = ge
tNodeText(
optionData
[propertyI
ndex]);
|
208 |
|
|
|
208 |
|
|
209 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Cu
stomFieldN
ame1')
|
|
209 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Cu
stomFieldN
ame1')
|
210 |
|
cust
FieldName1
= getNode
Text(optio
nData[prop
ertyIndex]
);
|
|
210 |
|
cust
FieldName1
= getNode
Text(optio
nData[prop
ertyIndex]
);
|
211 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Cu
stomFieldN
ame2')
|
|
211 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Cu
stomFieldN
ame2')
|
212 |
|
cust
FieldName2
= getNode
Text(optio
nData[prop
ertyIndex]
);
|
|
212 |
|
cust
FieldName2
= getNode
Text(optio
nData[prop
ertyIndex]
);
|
213 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Cu
stomAction
1')
|
|
213 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Cu
stomAction
1')
|
214 |
|
cust
omAction1
= getNodeT
ext(option
Data[prope
rtyIndex])
;
|
|
214 |
|
cust
omAction1
= getNodeT
ext(option
Data[prope
rtyIndex])
;
|
215 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Cu
stomAction
2')
|
|
215 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Cu
stomAction
2')
|
216 |
|
cust
omAction2
= getNodeT
ext(option
Data[prope
rtyIndex])
;
|
|
216 |
|
cust
omAction2
= getNodeT
ext(option
Data[prope
rtyIndex])
;
|
217 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Un
it')
|
|
217 |
|
if (opti
onData[pro
pertyIndex
].nodeType
== 1 && o
ptionData[
propertyIn
dex].nodeN
ame == 'Un
it')
|
218 |
|
sUni
tValue = g
etNodeText
(optionDat
a[property
Index]);
|
|
218 |
|
sUni
tValue = g
etNodeText
(optionDat
a[property
Index]);
|
219 |
|
}
|
|
219 |
|
}
|
220 |
|
|
|
220 |
|
|
221 |
|
if
(bReloadT
ree) {
|
|
221 |
|
if
(bReloadT
ree) {
|
222 |
|
//var re
= /(\d+$)
/;
|
|
222 |
|
//var re
= /(\d+$)
/;
|
223 |
|
//re.exe
c(selectio
nID);
|
|
223 |
|
//re.exe
c(selectio
nID);
|
224 |
|
//var ah
refs = "<a
href=" +
document.l
ocation +
" onclick=
\"fillHidd
enAndPostF
orm(" + Re
gExp.$1 +
"," + opti
onID + ");
return fa
lse;\">\n"
;
|
|
224 |
|
//var ah
refs = "<a
href=" +
document.l
ocation +
" onclick=
\"fillHidd
enAndPostF
orm(" + Re
gExp.$1 +
"," + opti
onID + ");
return fa
lse;\">\n"
;
|
225 |
|
var ahre
fs = "<a h
ref=\"" +
self.locat
ion.pathna
me + "?bSu
bClassifie
dID=" + op
tionID+"\"
>\n";
|
|
225 |
|
var ahre
fs = "<a h
ref=\"" +
self.locat
ion.pathna
me + "?bSu
bClassifie
dID=" + op
tionID+"\"
>\n";
|
226 |
|
var ahre
fe = "</a>
";
|
|
226 |
|
var ahre
fe = "</a>
";
|
227 |
|
strt +=
|
|
227 |
|
strt +=
|
228 |
|
'<di
v>' +
|
|
228 |
|
'<di
v>' +
|
229 |
|
'<img src=
"images/fo
lder_s.gif
" style="v
ertical-al
ign:middle
;"/>' +
|
|
229 |
|
'<img src=
"images/fo
lder_s.gif
" style="v
ertical-al
ign:middle
;"/>' +
|
230 |
|
'<img src=
"images/fo
lder.gif"
style="ver
tical-alig
n:middle;"
/>' +
|
|
230 |
|
'<img src=
"images/fo
lder.gif"
style="ver
tical-alig
n:middle;"
/>' +
|
231 |
|
'<span>' +
|
|
231 |
|
'<span>' +
|
232 |
|
ahrefs
+ optionV
alue + " (
" + option
Cnt + ")"
+ ahrefe +
|
|
232 |
|
ahrefs
+ optionV
alue + " (
" + option
Cnt + ")"
+ ahrefe +
|
233 |
|
'</span>'
+
|
|
233 |
|
'</span>'
+
|
234 |
|
'</d
iv>';
|
|
234 |
|
'</d
iv>';
|
235 |
|
|
|
235 |
|
|
236 |
|
}
|
|
236 |
|
}
|
237 |
|
el
se if (sel
ection){
|
|
237 |
|
el
se if (sel
ection){
|
238 |
|
optionOb
ject = new
Option(op
tionValue,
optionID,
false, fa
lse);
|
|
238 |
|
optionOb
ject = new
Option(op
tionValue,
optionID,
false, fa
lse);
|
239 |
|
selectio
n.options[
selection.
length] =
optionObje
ct;
|
|
239 |
|
selectio
n.options[
selection.
length] =
optionObje
ct;
|
240 |
|
selectio
n.style.di
splay = ''
;
|
|
240 |
|
selectio
n.style.di
splay = ''
;
|
241 |
|
if (el =
document.
getElement
ById('tr0'
)) {
|
|
241 |
|
if (el =
document.
getElement
ById('tr0'
)) {
|
242 |
|
el.s
tyle.displ
ay=''
|
|
242 |
|
el.s
tyle.displ
ay=''
|
243 |
|
}
|
|
243 |
|
}
|
244 |
|
}
|
|
244 |
|
}
|
245 |
|
|
|
245 |
|
|
246 |
|
if
(bAdminMa
n) {
|
|
246 |
|
if
(bAdminMa
n) {
|
247 |
|
if (cust
FieldName1
!= undefi
ned) {
|
|
247 |
|
if (cust
FieldName1
!= undefi
ned) {
|
248 |
|
docu
ment.getEl
ementById(
'CustomNam
e1').value
= custFie
ldName1;
|
|
248 |
|
docu
ment.getEl
ementById(
'CustomNam
e1').value
= custFie
ldName1;
|
249 |
|
if (
customActi
on1 == '&l
t;') custo
mAction1 =
'<';
|
|
249 |
|
if (
customActi
on1 == '&l
t;') custo
mAction1 =
'<';
|
250 |
|
if (
customActi
on1 == '&g
t;') custo
mAction1 =
'>';
|
|
250 |
|
if (
customActi
on1 == '&g
t;') custo
mAction1 =
'>';
|
251 |
|
docu
ment.getEl
ementById(
'CustomAct
ion1').val
ue = custo
mAction1;
|
|
251 |
|
docu
ment.getEl
ementById(
'CustomAct
ion1').val
ue = custo
mAction1;
|
252 |
|
}
|
|
252 |
|
}
|
253 |
|
if (cust
FieldName2
!= undefi
ned) {
|
|
253 |
|
if (cust
FieldName2
!= undefi
ned) {
|
254 |
|
docu
ment.getEl
ementById(
'CustomNam
e2').value
=custField
Name2;
|
|
254 |
|
docu
ment.getEl
ementById(
'CustomNam
e2').value
=custField
Name2;
|
255 |
|
if (
customActi
on2 == '&l
t;') custo
mAction2 =
'<';
|
|
255 |
|
if (
customActi
on2 == '&l
t;') custo
mAction2 =
'<';
|
256 |
|
if (
customActi
on2 == '&g
t;') custo
mAction2 =
'>';
|
|
256 |
|
if (
customActi
on2 == '&g
t;') custo
mAction2 =
'>';
|
257 |
|
docu
ment.getEl
ementById(
'CustomAct
ion2').val
ue=customA
ction2;
|
|
257 |
|
docu
ment.getEl
ementById(
'CustomAct
ion2').val
ue=customA
ction2;
|
258 |
|
}
|
|
258 |
|
}
|
259 |
|
}
|
|
259 |
|
}
|
260 |
|
|
|
260 |
|
|
261 |
|
if
(sCustomT
argetField
1 && bAdmi
nMan==fals
e) {
|
|
261 |
|
if
(sCustomT
argetField
1 && bAdmi
nMan==fals
e) {
|
262 |
|
if (cust
omAction1
== '<')
customAct
ion1 = 'Mi
n';
|
|
262 |
|
if (cust
omAction1
== '<')
customAct
ion1 = 'Mi
n';
|
263 |
|
if (cust
omAction1
== '>')
customAct
ion1 = 'Ma
x';
|
|
263 |
|
if (cust
omAction1
== '>')
customAct
ion1 = 'Ma
x';
|
264 |
|
if (cust
omAction1
== '=') cu
stomAction
1 = 'Equal
';
|
|
264 |
|
if (cust
omAction1
== '=') cu
stomAction
1 = 'Equal
';
|
265 |
|
custSel1
.innerHTML
= (custFi
eldName1 !
= undefine
d) ? custo
mAction1+'
'+custFie
ldName1+'
('+sUnitVa
lue+')' :
"";
|
|
265 |
|
custSel1
.innerHTML
= (custFi
eldName1 !
= undefine
d) ? custo
mAction1+'
'+custFie
ldName1+'
('+sUnitVa
lue+')' :
"";
|
266 |
|
|
|
266 |
|
|
267 |
|
if (type
of(custFie
ldName1)!=
'undefined
' && typeo
f(customAc
tion1)!='u
ndefined'
&& customA
ction1!=''
) {
|
|
267 |
|
if (type
of(custFie
ldName1)!=
'undefined
' && typeo
f(customAc
tion1)!='u
ndefined'
&& customA
ction1!=''
) {
|
268 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
1)) {
|
|
268 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
1)) {
|
269 |
|
oElement.s
tyle.displ
ay = '';
|
|
269 |
|
oElement.s
tyle.displ
ay = '';
|
270 |
|
}
|
|
270 |
|
}
|
271 |
|
}
|
|
271 |
|
}
|
272 |
|
}
|
|
272 |
|
}
|
273 |
|
if
(sCustomT
argetField
2 && bAdmi
nMan==fals
e) {
|
|
273 |
|
if
(sCustomT
argetField
2 && bAdmi
nMan==fals
e) {
|
274 |
|
if (cust
omAction2
== '<')
customAct
ion2 = 'Mi
n';
|
|
274 |
|
if (cust
omAction2
== '<')
customAct
ion2 = 'Mi
n';
|
275 |
|
if (cust
omAction2
== '>')
customAct
ion2 = 'Ma
x';
|
|
275 |
|
if (cust
omAction2
== '>')
customAct
ion2 = 'Ma
x';
|
276 |
|
if (cust
omAction2
== '=') cu
stomAction
2 = 'Equal
';
|
|
276 |
|
if (cust
omAction2
== '=') cu
stomAction
2 = 'Equal
';
|
277 |
|
custSel2
.innerHTML
= (custFi
eldName2 !
= undefine
d) ? custo
mAction2+'
'+custFie
ldName2+'
('+sUnitVa
lue+')' :
"";
|
|
277 |
|
custSel2
.innerHTML
= (custFi
eldName2 !
= undefine
d) ? custo
mAction2+'
'+custFie
ldName2+'
('+sUnitVa
lue+')' :
"";
|
278 |
|
|
|
278 |
|
|
279 |
|
if (type
of(custFie
ldName2)!=
'undefined
' && typeo
f(customAc
tion2)!='u
ndefined'
&& customA
ction2!=''
) {
|
|
279 |
|
if (type
of(custFie
ldName2)!=
'undefined
' && typeo
f(customAc
tion2)!='u
ndefined'
&& customA
ction2!=''
) {
|
280 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
2)) {
|
|
280 |
|
if (
oElement =
getCustom
ActionFiel
d(sCustomT
argetField
2)) {
|
281 |
|
oElement.s
tyle.displ
ay = '';
|
|
281 |
|
oElement.s
tyle.displ
ay = '';
|
282 |
|
}
|
|
282 |
|
}
|
283 |
|
}
|
|
283 |
|
}
|
284 |
|
}
|
|
284 |
|
}
|
285 |
|
if
(sUnit!=u
ndefined &
& sUnit !
= '' && sU
nitValue !
= ''){
|
|
285 |
|
if
(sUnit!=u
ndefined &
& sUnit !
= '' && sU
nitValue !
= ''){
|
286 |
|
var eUni
t = docume
nt.getElem
entById(sU
nit);
|
|
286 |
|
var eUni
t = docume
nt.getElem
entById(sU
nit);
|
287 |
|
eUnit.va
lue = sUni
tValue;
|
|
287 |
|
eUnit.va
lue = sUni
tValue;
|
288 |
|
}
|
|
288 |
|
}
|
289 |
|
}
|
|
289 |
|
}
|
290 |
|
|
|
290 |
|
|
291 |
|
// if
(selection
) {
|
|
291 |
|
// if
(selection
) {
|
292 |
|
//
optionObj
ect1 = new
Option('s
elect', -1
, false, f
alse);
|
|
292 |
|
//
optionObj
ect1 = new
Option('s
elect', -1
, false, f
alse);
|
293 |
|
//
selection
.options[s
election.l
ength] = o
ptionObjec
t1;
|
|
293 |
|
//
selection
.options[s
election.l
ength] = o
ptionObjec
t1;
|
294 |
|
// }
|
|
294 |
|
// }
|
295 |
|
|
|
295 |
|
|
296 |
|
if (bR
eloadTree)
{
|
|
296 |
|
if (bR
eloadTree)
{
|
297 |
|
//
strt += "
</td>\n";
|
|
297 |
|
//
strt += "
</td>\n";
|
298 |
|
se
lection.in
nerHTML =
strt;
|
|
298 |
|
se
lection.in
nerHTML =
strt;
|
299 |
|
}
|
|
299 |
|
}
|
300 |
|
|
|
300 |
|
|
301 |
|
if (bP
ostAction=
=true) {
|
|
301 |
|
if (bP
ostAction=
=true) {
|
302 |
|
va
r sPostSel
ection = d
ocument.ge
tElementBy
Id(sPostNa
me);
|
|
302 |
|
va
r sPostSel
ection = d
ocument.ge
tElementBy
Id(sPostNa
me);
|
303 |
|
sP
ostSelecti
on.value =
sPostValu
e;
|
|
303 |
|
sP
ostSelecti
on.value =
sPostValu
e;
|
304 |
|
bP
ostAction
= false; s
PostName='
'; sPostVa
lue='';
|
|
304 |
|
bP
ostAction
= false; s
PostName='
'; sPostVa
lue='';
|
305 |
|
}
|
|
305 |
|
}
|
306 |
|
}
|
|
306 |
|
}
|
307 |
|
|
|
307 |
|
|
308 |
|
// Retrei
ves inner
text of XM
L node (cr
oss-browsi
ng)
|
|
308 |
|
// Retrei
ves inner
text of XM
L node (cr
oss-browsi
ng)
|
309 |
|
function g
etNodeText
(node) {
|
|
309 |
|
function g
etNodeText
(node) {
|
310 |
|
return
(node.tex
tContent |
| node.inn
erText ||
node.text)
;
|
|
310 |
|
return
(node.tex
tContent |
| node.inn
erText ||
node.text)
;
|
311 |
|
}
|
|
311 |
|
}
|
312 |
|
|
|
312 |
|
|
313 |
|
function v
erify_addi
ng_new_adv
(lifetime_
tr, lifeti
me, maxlif
etime) {
|
|
313 |
|
function v
erify_addi
ng_new_adv
(lifetime_
tr, lifeti
me, maxlif
etime) {
|
314 |
|
ilifet
ime = docu
ment.getEl
ementById(
lifetime).
value;
|
|
314 |
|
ilifet
ime = docu
ment.getEl
ementById(
lifetime).
value;
|
315 |
|
if (il
ifetime>0)
{
|
|
315 |
|
if (il
ifetime>0)
{
|
316 |
|
if
(ilifetim
e <= maxli
fetime) {
|
|
316 |
|
if
(ilifetim
e <= maxli
fetime) {
|
317 |
|
//alert(
lifetime_t
r);
|
|
317 |
|
//alert(
lifetime_t
r);
|
318 |
|
return t
rue;
|
|
318 |
|
return t
rue;
|
319 |
|
}
|
|
319 |
|
}
|
320 |
|
do
cument.get
ElementByI
d(lifetime
_tr).style
.backgroun
dColor='re
d';
|
|
320 |
|
do
cument.get
ElementByI
d(lifetime
_tr).style
.backgroun
dColor='re
d';
|
321 |
|
}
|
|
321 |
|
}
|
322 |
|
return
false;//e
rrors in t
yping
|
|
322 |
|
return
false;//e
rrors in t
yping
|
323 |
|
}
|
|
323 |
|
}
|
324 |
|
|
|
324 |
|
|
325 |
|
/**
|
|
325 |
|
/**
|
326 |
|
* Update
fields Cus
tomFieldNa
me1, Custo
mFieldName
2, CustomA
ction1, Cu
stomAction
2 in table
`Classifi
eds`
|
|
326 |
|
* Update
fields Cus
tomFieldNa
me1, Custo
mFieldName
2, CustomA
ction1, Cu
stomAction
2 in table
`Classifi
eds`
|
327 |
|
*
|
|
327 |
|
*
|
328 |
|
* @param
$iEditAdve
rtisementI
D ID of ed
ited Adver
tisement
|
|
328 |
|
* @param
$iEditAdve
rtisementI
D ID of ed
ited Adver
tisement
|
329 |
|
*/
|
|
329 |
|
*/
|
330 |
|
function A
dmTryApply
Changes(sA
ctionType,
customNum
ber) {
|
|
330 |
|
function A
dmTryApply
Changes(sA
ctionType,
customNum
ber) {
|
331 |
|
if (sA
ctionType=
="DeleteCu
stom") {
|
|
331 |
|
if (sA
ctionType=
="DeleteCu
stom") {
|
332 |
|
do
cument.get
ElementByI
d('CustomN
ame'+custo
mNumber).v
alue="";
|
|
332 |
|
do
cument.get
ElementByI
d('CustomN
ame'+custo
mNumber).v
alue="";
|
333 |
|
do
cument.get
ElementByI
d('CustomA
ction'+cus
tomNumber)
.value="-1
";
|
|
333 |
|
do
cument.get
ElementByI
d('CustomA
ction'+cus
tomNumber)
.value="-1
";
|
334 |
|
}
|
|
334 |
|
}
|
335 |
|
var sN
ame = docu
ment.getEl
ementById(
'CustomNam
e' + custo
mNumber).v
alue;
|
|
335 |
|
var sN
ame = docu
ment.getEl
ementById(
'CustomNam
e' + custo
mNumber).v
alue;
|
336 |
|
var sA
ction = do
cument.get
ElementByI
d('CustomA
ction' + c
ustomNumbe
r).value;
|
|
336 |
|
var sA
ction = do
cument.get
ElementByI
d('CustomA
ction' + c
ustomNumbe
r).value;
|
337 |
|
var iI
Dcat = doc
ument.getE
lementById
('FilterCa
t').value;
|
|
337 |
|
var iI
Dcat = doc
ument.getE
lementById
('FilterCa
t').value;
|
338 |
|
sName
= encodeUR
IComponent
( sName );
|
|
338 |
|
sName
= encodeUR
IComponent
( sName );
|
339 |
|
sActio
n = encode
URICompone
nt ( sActi
on );
|
|
339 |
|
sActio
n = encode
URICompone
nt ( sActi
on );
|
340 |
|
var sU
RLRequest
= "dataTyp
e="+sActio
nType+"&iN
umb="+cust
omNumber+"
&sName="+s
Name+"&sAc
tion="+sAc
tion+"&iID
cat="+iIDc
at;
|
|
340 |
|
var sU
RLRequest
= "dataTyp
e="+sActio
nType+"&iN
umb="+cust
omNumber+"
&sName="+s
Name+"&sAc
tion="+sAc
tion+"&iID
cat="+iIDc
at;
|
341 |
|
AddReq
uestToQueu
e2(sURLReq
uest);
|
|
341 |
|
AddReq
uestToQueu
e2(sURLReq
uest);
|
342 |
|
}
|
|
342 |
|
}
|
343 |
|
|
|
343 |
|
|
344 |
|
/**
|
|
344 |
|
/**
|
345 |
|
* Update
field Unit
in table
`Classifie
ds`
|
|
345 |
|
* Update
field Unit
in table
`Classifie
ds`
|
346 |
|
*
|
|
346 |
|
*
|
347 |
|
*/
|
|
347 |
|
*/
|
348 |
|
function A
dmTryApply
UnitChange
s(sActionT
ype) {
|
|
348 |
|
function A
dmTryApply
UnitChange
s(sActionT
ype) {
|
349 |
|
if (sA
ctionType=
="DeleteUn
it") {
|
|
349 |
|
if (sA
ctionType=
="DeleteUn
it") {
|
350 |
|
do
cument.get
ElementByI
d('unit').
value="";
|
|
350 |
|
do
cument.get
ElementByI
d('unit').
value="";
|
351 |
|
}
|
|
351 |
|
}
|
352 |
|
var iI
Dcat = doc
ument.getE
lementById
('FilterCa
t').value;
|
|
352 |
|
var iI
Dcat = doc
ument.getE
lementById
('FilterCa
t').value;
|
353 |
|
var sU
nit = docu
ment.getEl
ementById(
'unit').va
lue;
|
|
353 |
|
var sU
nit = docu
ment.getEl
ementById(
'unit').va
lue;
|
354 |
|
var sU
RLRequest
= "dataTyp
e="+sActio
nType+"&sU
nit="+enco
deURICompo
nent(sUnit
)+"&iIDcat
="+iIDcat;
|
|
354 |
|
var sU
RLRequest
= "dataTyp
e="+sActio
nType+"&sU
nit="+enco
deURICompo
nent(sUnit
)+"&iIDcat
="+iIDcat;
|
355 |
|
AddReq
uestToQueu
e2(sURLReq
uest);
|
|
355 |
|
AddReq
uestToQueu
e2(sURLReq
uest);
|
356 |
|
}
|
|
356 |
|
}
|
357 |
|
|
|
357 |
|
|
358 |
|
function F
ilterReset
(){
|
|
358 |
|
function F
ilterReset
(){
|
359 |
|
docume
nt.getElem
entById('t
r1').style
.display='
none';
|
|
359 |
|
docume
nt.getElem
entById('t
r1').style
.display='
none';
|
360 |
|
docume
nt.getElem
entById('t
r2').style
.display='
none';
|
|
360 |
|
docume
nt.getElem
entById('t
r2').style
.display='
none';
|
361 |
|
var el
= documen
t.getEleme
ntById('tr
0');
|
|
361 |
|
var el
= documen
t.getEleme
ntById('tr
0');
|
362 |
|
if (el
) {
|
|
362 |
|
if (el
) {
|
363 |
|
el
.style.dis
play='none
';
|
|
363 |
|
el
.style.dis
play='none
';
|
364 |
|
}
|
|
364 |
|
}
|
365 |
|
}
|
|
365 |
|
}
|
366 |
|
|
|
366 |
|
|
367 |
|
function A
ddRequestT
oQueue2(sU
RLRequest)
{
|
|
367 |
|
function A
ddRequestT
oQueue2(sU
RLRequest)
{
|
368 |
|
reques
tsQueue[re
questsQueu
e.length]
= new Queu
eItem2(sUR
LGetList+s
URLRequest
);
|
|
368 |
|
reques
tsQueue[re
questsQueu
e.length]
= new Queu
eItem2(sUR
LGetList+s
URLRequest
);
|
369 |
|
if (re
questsQueu
e.length =
= 1)
|
|
369 |
|
if (re
questsQueu
e.length =
= 1)
|
370 |
|
Do
SendReques
t2();
|
|
370 |
|
Do
SendReques
t2();
|
371 |
|
}
|
|
371 |
|
}
|
372 |
|
|
|
372 |
|
|
373 |
|
function D
oSendReque
st2() {
|
|
373 |
|
function D
oSendReque
st2() {
|
374 |
|
global
ObjXmlHttp
Request =
createXmlH
ttpObject(
);
|
|
374 |
|
global
ObjXmlHttp
Request =
createXmlH
ttpObject(
);
|
375 |
|
if ( g
lobalObjXm
lHttpReque
st ) {
|
|
375 |
|
if ( g
lobalObjXm
lHttpReque
st ) {
|
376 |
|
gl
obalObjXml
HttpReques
t.onreadys
tatechange
= OnReady
StateChang
e;
|
|
376 |
|
gl
obalObjXml
HttpReques
t.onreadys
tatechange
= OnReady
StateChang
e;
|
377 |
|
gl
obalObjXml
HttpReques
t.open("GE
T", reques
tsQueue[0]
.url);
|
|
377 |
|
gl
obalObjXml
HttpReques
t.open("GE
T", reques
tsQueue[0]
.url);
|
378 |
|
gl
obalObjXml
HttpReques
t.send(nul
l);
|
|
378 |
|
gl
obalObjXml
HttpReques
t.send(nul
l);
|
379 |
|
}
|
|
379 |
|
}
|
380 |
|
}
|
|
380 |
|
}
|
381 |
|
|
|
381 |
|
|
382 |
|
function Q
ueueItem2(
url) {
|
|
382 |
|
function Q
ueueItem2(
url) {
|
383 |
|
this.u
rl=url;
|
|
383 |
|
this.u
rl=url;
|
384 |
|
}
|
|
384 |
|
}
|
385 |
|
|
|
385 |
|
|
386 |
|
function O
nReadyStat
eChange()
{
|
|
386 |
|
function O
nReadyStat
eChange()
{
|
387 |
|
if(glo
balObjXmlH
ttpRequest
.readyStat
e == 4) {
|
|
387 |
|
if(glo
balObjXmlH
ttpRequest
.readyStat
e == 4) {
|
388 |
|
//
Dequeue r
equest and
run the h
andler
|
|
388 |
|
//
Dequeue r
equest and
run the h
andler
|
389 |
|
if
((request
Data = req
uestsQueue
.shift())
== null)
|
|
389 |
|
if
((request
Data = req
uestsQueue
.shift())
== null)
|
390 |
|
throw ne
w Error('I
nternal er
ror: queue
is empty'
);
|
|
390 |
|
throw ne
w Error('I
nternal er
ror: queue
is empty'
);
|
391 |
|
}
|
|
391 |
|
}
|
392 |
|
}
|
|
392 |
|
}
|
393 |
|
|
|
393 |
|
|
394 |
|
function g
etCustomAc
tionField(
customTarg
etField) {
|
|
394 |
|
function g
etCustomAc
tionField(
customTarg
etField) {
|
395 |
|
var re
= /(\d+)/
;
|
|
395 |
|
var re
= /(\d+)/
;
|
396 |
|
result
= customT
argetField
.match(re)
;
|
|
396 |
|
result
= customT
argetField
.match(re)
;
|
397 |
|
if (re
sult[0]>0)
{
|
|
397 |
|
if (re
sult[0]>0)
{
|
398 |
|
va
r oElement
= documen
t.getEleme
ntById('tr
'+result[0
]);
|
|
398 |
|
va
r oElement
= documen
t.getEleme
ntById('tr
'+result[0
]);
|
399 |
|
re
turn oElem
ent;
|
|
399 |
|
re
turn oElem
ent;
|
400 |
|
}
|
|
400 |
|
}
|
401 |
|
}
|
|
401 |
|
}
|
402 |
|
|
|
402 |
|
|
403 |
|
function A
ddCatField
s(sFieldsC
at, sAddLn
k, sDelLnk
) {
|
|
403 |
|
function A
ddCatField
s(sFieldsC
at, sAddLn
k, sDelLnk
) {
|
404 |
|
if (do
cument.get
ElementByI
d(sFieldsC
at).style.
display ==
'') {
|
|
404 |
|
if (do
cument.get
ElementByI
d(sFieldsC
at).style.
display ==
'') {
|
405 |
|
do
cument.get
ElementByI
d(sFieldsC
at).style.
display =
'none';
|
|
405 |
|
do
cument.get
ElementByI
d(sFieldsC
at).style.
display =
'none';
|
406 |
|
do
cument.get
ElementByI
d(sDelLnk)
.style.dis
play = '';
|
|
406 |
|
do
cument.get
ElementByI
d(sDelLnk)
.style.dis
play = '';
|
407 |
|
}
|
|
407 |
|
}
|
408 |
|
else {
//show and
hide firs
t Ad
|
|
408 |
|
else {
//show and
hide firs
t Ad
|
409 |
|
do
cument.get
ElementByI
d(sFieldsC
at).style.
display =
'';
|
|
409 |
|
do
cument.get
ElementByI
d(sFieldsC
at).style.
display =
'';
|
410 |
|
do
cument.get
ElementByI
d(sAddLnk)
.style.dis
play = 'no
ne';
|
|
410 |
|
do
cument.get
ElementByI
d(sAddLnk)
.style.dis
play = 'no
ne';
|
411 |
|
do
cument.get
ElementByI
d(sDelLnk)
.style.dis
play = 'no
ne';
|
|
411 |
|
do
cument.get
ElementByI
d(sDelLnk)
.style.dis
play = 'no
ne';
|
412 |
|
}
|
|
412 |
|
}
|
413 |
|
}
|
|
413 |
|
}
|
414 |
|
|
|
414 |
|
|
415 |
|
function U
pdateField
(sName, sV
alue){
|
|
415 |
|
function U
pdateField
(sName, sV
alue){
|
416 |
|
var se
lection =
document.g
etElementB
yId(sName)
;
|
|
416 |
|
var se
lection =
document.g
etElementB
yId(sName)
;
|
417 |
|
select
ion.value
= sValue;
|
|
417 |
|
select
ion.value
= sValue;
|
418 |
|
if (se
lection) {
|
|
418 |
|
if (se
lection) {
|
419 |
|
if
(typeof(s
election.o
nchange) =
= 'functio
n')
|
|
419 |
|
if
(typeof(s
election.o
nchange) =
= 'functio
n')
|
420 |
|
selectio
n.onchange
(); // P
erform cha
in action
|
|
420 |
|
selectio
n.onchange
(); // P
erform cha
in action
|
421 |
|
}
|
|
421 |
|
}
|
422 |
|
}
|
|
422 |
|
}
|
423 |
|
|
|
423 |
|
|
424 |
|
function U
pdateField
Tiny(sName
, sValue){
|
|
424 |
|
function U
pdateField
Tiny(sName
, sValue){
|
425 |
|
if (el
= documen
t.getEleme
ntById('co
mmentText'
)) {
|
|
425 |
|
if (el
= documen
t.getEleme
ntById('co
mmentText'
)) {
|
426 |
|
do
cument.get
ElementByI
d('comment
Text').val
ue = sValu
e;
|
|
426 |
|
do
cument.get
ElementByI
d('comment
Text').val
ue = sValu
e;
|
427 |
|
if
(typeof t
inyMCE !=
'undefined
') {
|
|
427 |
|
if
(typeof t
inyMCE !=
'undefined
') {
|
428 |
|
tinyMCE.
updateCont
ent('comme
ntText');
|
|
428 |
|
tinyMCE.
activeEdit
or.load();
|
429 |
|
tinyMCE.ex
ecInstance
Command('c
ommentText
',
"mceFocus"
);
|
|
429 |
|
//
tinyMCE.ex
ecInstance
Command('c
ommentText
',
"mceFocus"
);
|
430 |
|
}
|
|
430 |
|
}
|
431 |
|
}
|
|
431 |
|
}
|
432 |
|
}
|
|
432 |
|
}
|
433 |
|
|
|
433 |
|
|
434 |
|
function U
pdateField
s(sName, s
Value, sNa
me2, sValu
e2){
|
|
434 |
|
function U
pdateField
s(sName, s
Value, sNa
me2, sValu
e2){
|
435 |
|
sPostN
ame = sNam
e2;
|
|
435 |
|
sPostN
ame = sNam
e2;
|
436 |
|
sPostV
alue = sVa
lue2;
|
|
436 |
|
sPostV
alue = sVa
lue2;
|
437 |
|
bPostA
ction = tr
ue;
|
|
437 |
|
bPostA
ction = tr
ue;
|
438 |
|
|
|
438 |
|
|
439 |
|
var se
lection =
document.g
etElementB
yId(sName)
;
|
|
439 |
|
var se
lection =
document.g
etElementB
yId(sName)
;
|
440 |
|
select
ion.value
= sValue;
|
|
440 |
|
select
ion.value
= sValue;
|
441 |
|
if (se
lection) {
|
|
441 |
|
if (se
lection) {
|
442 |
|
if
(typeof(s
election.o
nchange) =
= 'functio
n')
|
|
442 |
|
if
(typeof(s
election.o
nchange) =
= 'functio
n')
|
443 |
|
selectio
n.onchange
(); // P
erform cha
in action
|
|
443 |
|
selectio
n.onchange
(); // P
erform cha
in action
|
444 |
|
}
|
|
444 |
|
}
|
445 |
|
}
|
|
445 |
|
}
|
446 |
|
|
|
446 |
|
|
447 |
|
function U
pdateField
ByInnerHtm
l(sName, s
Value){
|
|
447 |
|
function U
pdateField
ByInnerHtm
l(sName, s
Value){
|
448 |
|
docume
nt.getElem
entById(sN
ame).value
= documen
t.getEleme
ntById(sVa
lue).inner
HTML;
|
|
448 |
|
docume
nt.getElem
entById(sN
ame).value
= documen
t.getEleme
ntById(sVa
lue).inner
HTML;
|
449 |
|
}
|
|
449 |
|
}
|
450 |
|
|
|
450 |
|
|
451 |
|
function U
pdateField
Style(sNam
e, sStyle)
{
|
|
451 |
|
function U
pdateField
Style(sNam
e, sStyle)
{
|
452 |
|
docume
nt.getElem
entById(sN
ame).style
.display =
sStyle;
|
|
452 |
|
docume
nt.getElem
entById(sN
ame).style
.display =
sStyle;
|
453 |
|
}
|
|
453 |
|
}
|