You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1989 lines
71 KiB
1989 lines
71 KiB
function setHeaderExpanded(si, tid, id, state) { |
|
document.getElementById('progressbar').style.display = ""; |
|
var url = location.protocol + '//' + location.host + |
|
'/superx/servlet/SuperXmlTabelle'; |
|
//if (si) url+=';jsessionid='+si; |
|
url += '?tid=' + tid + "&reuseresult=true&"; |
|
if (state == true) url += "openHeader=" + id; |
|
else url += "closeHeader=" + id; |
|
self.location.href = url; |
|
} |
|
|
|
function createLinkForTable(refapp,colset='',colsort='') { |
|
let stylesheet = 'tabelle_html.xsl'; |
|
let ausgabe_text = 'Standard HTML mit Navigation'; |
|
let contenttype = "text/html"; |
|
let navigation = ""; |
|
//alert("Ausgabe: " + ausgabe_text + "\nstylesheet: "+ stylesheet); |
|
if (ausgabe_text.indexOf('Navi') >= 0 ){ |
|
navigation = "&navi=true"; |
|
} |
|
if (stylesheet=='tabelle_xls.xsl'){ |
|
contenttype = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; |
|
} |
|
else if (stylesheet=='tabelle_fo_pdf.xsl') { |
|
contenttype = "application/pdf"; |
|
} |
|
else if (stylesheet=='tabelle_html_p.xsl') { |
|
contenttype = "text/html"; |
|
} |
|
else if (stylesheet=='tabelle_xml.xsl') { |
|
contenttype = "text/xml"; |
|
} |
|
else { |
|
//speziells Stylesheet |
|
contenttype = stylesheetcontenttype[stylesheet]; |
|
} |
|
let url = location.protocol+'//'+location.host + '/superx/servlet/SuperXmlTabelle?'; |
|
let url_sso = location.protocol+'//'+location.host + '/' + refapp + '/rds?state=redirect&sso=superx&utarget=/superx/servlet/SuperXmlTabelle?'; |
|
let params = ""; |
|
let params_sso = ''; |
|
let fields = $(document.forms[0]).serializeArray(); |
|
jQuery.each( fields, function( i, field ) { |
|
let htmlname= ''; |
|
for (j = 1; j < felder.length; j++) { |
|
if(field.name==felder[j]["htmlname"]) |
|
htmlname=felder[j]["htmlname"]; |
|
} |
|
if (field.name != 'UserID' && field.name.indexOf('contenttype') == -1 && htmlname.indexOf('##line##') == -1 |
|
&& field.name.indexOf('stylesheet') == -1 && field.name.indexOf('reuseresult') == -1 |
|
&& field.name.indexOf('navi') == -1 && field.value != '' && field.name.indexOf('maxoffset') == -1) { |
|
params += ( '&' + encodeURIComponent(field.name) + '=' + encodeURIComponent(field.value)); |
|
params_sso += ( '&' + field.name + '=' + field.value); |
|
} |
|
}); |
|
params += '&contenttype=' + encodeURIComponent(contenttype); |
|
params += '&stylesheet=' + encodeURIComponent(stylesheet) + navigation; |
|
params_sso += '&contenttype=' + contenttype; |
|
params_sso += '&stylesheet=' + stylesheet + navigation; |
|
if (colset!='') {params+='&colset='+encodeURIComponent(colset).replace('|','%7C');params_sso+='colset='+colset.replace('|','%7C');} |
|
if (colsort!='') {params+='&colsort='+encodeURIComponent(colsort).replace('|','%7C');params_sso+='colsort='+colset.replace('|','%7C');} |
|
if(platform=="his1") |
|
{ |
|
document.getElementById('lesezeichenlink').href=url_sso + encodeURIComponent(params); |
|
} else { |
|
document.getElementById('lesezeichenlink').href=url + params; |
|
} |
|
} |
|
|
|
function lesezeichen(servlet, tid, MandantenID, params, title) { |
|
if (servlet == 'allg_vorlage') { |
|
url = 'javascript:applyMerkmale("' + params + '");'; |
|
} else { |
|
url = location.protocol + '//' + location.host + servlet + '?tid=' + tid; |
|
if (MandantenID != 'default') |
|
url += '&MandatenID=' + MandantenID; |
|
|
|
//beim IE 6 klappen die Javascript-Bookmarks nicht |
|
if (navigator.appName != "Microsoft Internet Explorer" || |
|
(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf( |
|
"MSIE 6") == -1)) { |
|
url = 'javascript:url="' + url + '";' + params + |
|
';for(i=0;i<p.length;i++)url+="&"+escape(p[i].n)+"="+escape(p[i].k);if(window.oeffne)oeffne(url);else self.location.href=url;'; |
|
} |
|
} |
|
// Opera 8.0+ |
|
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent |
|
.indexOf(' OPR/') >= 0; |
|
// Firefox 1.0+ |
|
var isFirefox = typeof InstallTrigger !== 'undefined'; |
|
// At least Safari 3+: "[object HTMLElementConstructor]" |
|
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf( |
|
'Constructor') > 0; |
|
// Internet Explorer 6-11 |
|
var isIE = /*@cc_on!@*/ false || !!document.documentMode; |
|
// Edge 20+ |
|
var isEdge = !isIE && !!window.StyleMedia; |
|
// Chrome 1+ |
|
var isChrome = !!window.chrome && !!window.chrome.webstore; |
|
// Blink engine detection |
|
var isBlink = (isChrome || isOpera) && !!window.CSS; |
|
document.getElementById('lesezeichenlink').href = url; |
|
document.getElementById('lesezeichenlink').innerHTML = title; |
|
|
|
if (isChrome) { |
|
document.getElementById('lesezeicheninfoChrome').style.display = ''; |
|
document.getElementById('lesezeicheninfoIE').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoFF').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoOther').style.display = 'none'; |
|
} else if (isIE || isEdge) { |
|
document.getElementById('lesezeicheninfoChrome').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoIE').style.display = ''; |
|
document.getElementById('lesezeicheninfoFF').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoOther').style.display = 'none'; |
|
} else if (isFirefox) { |
|
document.getElementById('lesezeicheninfoChrome').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoIE').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoFF').style.display = ''; |
|
document.getElementById('lesezeicheninfoOther').style.display = 'none'; |
|
} else { |
|
document.getElementById('lesezeicheninfoChrome').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoIE').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoFF').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoOther').style.display = ''; |
|
} |
|
try { |
|
document.getElementById('lesezeichen_abbrechen').style.display = 'none'; |
|
document.getElementById('lesezeichen_ok').style.display = 'none'; |
|
document.getElementById('lesezeichenlinkdiv').style.display = ''; |
|
document.getElementById('lesezeichen_konfig').style.display = 'none'; |
|
} catch (e) { |
|
//falls nicht definiert auch nicht tragisch |
|
} |
|
} |
|
|
|
function lesezeichen2(servlet, tid, MandantenID, params, title) { |
|
if (servlet == 'allg_vorlage') { |
|
url = 'javascript:applyMerkmale("' + params + '");'; |
|
} else { |
|
url = location.protocol + '//' + location.host + servlet + '?tid=' + tid; |
|
if (MandantenID != 'default') { |
|
url += '&MandatenID=' + MandantenID; |
|
} |
|
url += params; |
|
} |
|
document.getElementById('lesezeichenlink').href = url; |
|
document.getElementById('lesezeichenlink').innerHTML = title; |
|
// Opera 8.0+ |
|
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent |
|
.indexOf(' OPR/') >= 0; |
|
// Firefox 1.0+ |
|
var isFirefox = typeof InstallTrigger !== 'undefined'; |
|
// At least Safari 3+: "[object HTMLElementConstructor]" |
|
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf( |
|
'Constructor') > 0; |
|
// Internet Explorer 6-11 |
|
var isIE = /*@cc_on!@*/ false || !!document.documentMode; |
|
// Edge 20+ |
|
var isEdge = !isIE && !!window.StyleMedia; |
|
// Chrome 1+ |
|
var isChrome = !!window.chrome ; |
|
// Blink engine detection |
|
var isBlink = (isChrome || isOpera) && !!window.CSS; |
|
document.getElementById('lesezeichenlink').href = url; |
|
document.getElementById('lesezeichenlink').innerHTML = title; |
|
if (isChrome) { |
|
document.getElementById('lesezeicheninfoChrome').style.display = ''; |
|
document.getElementById('lesezeicheninfoIE').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoFF').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoOther').style.display = 'none'; |
|
} |
|
else if (isIE || isEdge) { |
|
document.getElementById('lesezeicheninfoChrome').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoIE').style.display = ''; |
|
document.getElementById('lesezeicheninfoFF').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoOther').style.display = 'none'; |
|
} else if (isFirefox) { |
|
document.getElementById('lesezeicheninfoChrome').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoIE').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoFF').style.display = ''; |
|
document.getElementById('lesezeicheninfoOther').style.display = 'none'; |
|
} else { |
|
document.getElementById('lesezeicheninfoChrome').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoIE').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoFF').style.display = 'none'; |
|
document.getElementById('lesezeicheninfoOther').style.display = ''; |
|
} |
|
try { |
|
document.getElementById('lesezeichen_abbrechen').style.display = 'none'; |
|
document.getElementById('lesezeichen_ok').style.display = 'none'; |
|
document.getElementById('lesezeichenlinkdiv').style.display = ''; |
|
document.getElementById('lesezeichen_konfig').style.display = 'none'; |
|
} catch (e) { |
|
//falls nicht definiert auch nicht tragisch |
|
} |
|
|
|
} |
|
|
|
//masken_funktionen |
|
// <!-- start combo--> |
|
function maskeComboauswahlUebernehmen() { |
|
selIndex = document.forms['comboform'].elements['comboselect'].selectedIndex; |
|
if (selIndex > -1) { |
|
isFirst = true; |
|
val = ""; |
|
label = ""; |
|
|
|
for (i = 0; i < document.forms['comboform'].elements['comboselect'].options.length; i++) { |
|
if (document.forms['comboform'].elements['comboselect'].options[i].selected == |
|
true) { |
|
if (isFirst == false) { |
|
val += ","; |
|
label += ";"; |
|
} else isFirst = false; |
|
val += document.forms['comboform'].elements['comboselect'].options[i].value; |
|
label += document.forms['comboform'].elements['comboselect'].options[i].text; |
|
} |
|
} |
|
|
|
document.forms[0].elements[Feldname].value = val; |
|
//document.getElementById("label_"+Feldname).innerHTML=label; |
|
|
|
//document.forms[0].elements["label_"+Feldname].value=label; |
|
document.forms[0].elements["label_" + createVarname(Feldname)].value = label; |
|
|
|
} else { |
|
document.forms[0].elements[Feldname].value = ''; |
|
//document.getElementById("label_"+Feldname).innerHTML='nichts gewählt'; |
|
document.forms[0].elements["label_" + createVarname(Feldname)].value = |
|
"nichts gewählt"; |
|
} |
|
zeigeCombosIE6(); |
|
} |
|
|
|
|
|
// end combo |
|
// start sicht |
|
function suchauswahlUebernehmen() { |
|
keys = ""; |
|
names = ""; |
|
itemcount = 0; |
|
|
|
for (i = 0; i < document.getElementById('suchselect').options.length; i++) { |
|
if (document.getElementById('suchselect').options[i].selected) { |
|
if (itemcount > 0) { |
|
keys += ","; |
|
names += ","; |
|
} |
|
itemcount++; |
|
keys += document.getElementById('suchselect').options[i].value; |
|
names += document.getElementById('suchselect').options[i].text; |
|
} |
|
} |
|
|
|
//document.getElementById("label_"+Feldname).innerHTML=names; |
|
document.forms[0].elements["label_" + createVarname(Feldname)].value = names; |
|
document.forms[0].elements[Feldname].value = keys; |
|
zeigeCombosIE6(); |
|
|
|
} |
|
|
|
function maskeSichtauswahlUebernehmen() { |
|
|
|
var selnodes = dojo.widget.byId("treeSelector").selectedNodes; |
|
if (selnodes.length && selnodes.length > 0) { |
|
keys = ""; |
|
names = ""; |
|
|
|
for (i = 0; i < selnodes.length; i++) { |
|
if (i > 0) { |
|
keys += ","; |
|
names += ","; |
|
} |
|
keys += selnodes[i].objectId; |
|
names += selnodes[i].title; |
|
} |
|
//document.getElementById("label_"+Feldname).innerHTML=names; |
|
if (document.forms[0].elements["label_" + createVarname(Feldname)]) |
|
document.forms[0].elements["label_" + createVarname(Feldname)].value = names; |
|
document.forms[0].elements[Feldname].value = keys; |
|
|
|
} else { |
|
document.forms[0].elements[Feldname].value = ""; |
|
//document.getElementById("label_"+Feldname).innerHTML="nichts gewählt"; |
|
document.forms[0].elements["label_" + createVarname(Feldname)].value = |
|
"nichts gewählt"; |
|
} |
|
zeigeCombosIE6(); |
|
|
|
} |
|
|
|
//copy in TreeLoadingControllerSx |
|
function purgeval(data) { |
|
var res; |
|
var commentOK = false; |
|
//dojo.debug("check:"+data.indexOf+" "+data.indexOf("\/\*")+" "+data.lastIndexOf("\*\/")); |
|
if (data.indexOf && data.indexOf("\/\*") > -1 && data.lastIndexOf("\*\/") > 1) |
|
commentOK = true; |
|
|
|
if (commentOK) { |
|
// dojo.debug("go"); |
|
//dojo.debug(data.substring(data.indexOf("\/\*")+2)); |
|
//dojo.debug(data.substring(0,data.lastIndexOf("\*\/"))); |
|
//dojo.debug(data.substring(data.indexOf("\/\*")+2, data.lastIndexOf("\*\/"))); |
|
data = data.substring(data.indexOf("\/\*") + 2, data.lastIndexOf("\*\/")); |
|
//dojo.debug("to parse:"+data); |
|
res = eval(data, "UTF-8"); |
|
//dojo.debug("res:"+res); |
|
} |
|
|
|
if (!commentOK || !res) { |
|
alert("Unerwartete Serverantwort " + res); |
|
} |
|
|
|
return res; |
|
} |
|
|
|
// start date stuff |
|
function isDate(str) { |
|
var result = false; |
|
if (str) { |
|
var pos1 = str.indexOf('.'); |
|
//dojo.debug(str+pos1); |
|
var pos2 = str.lastIndexOf('.'); |
|
//dojo.debug(pos2) |
|
if (pos1 && pos1 > -1 && pos2 && pos2 > pos1 && str.length > pos2) { |
|
var day = str.substring(0, pos1); |
|
if (day && day >= 1 && day <= 31) { |
|
var month = str.substring(pos1 + 1, pos2); |
|
if (month && month > 0 && month <= 12) { |
|
var year = str.substring(pos2 + 1); |
|
if (year <= 30) year = '20' + year; |
|
if (year > 30 && year < 100) year = '19' + year; |
|
//dojo.debug(month+" "+day+" "+year); |
|
var d = Date.parse(month + " " + day + " " + year); |
|
//var date=new Date(year,month,day); |
|
date = new Date(d); |
|
//dojo.debug(date); |
|
//dojo.debug(date.toString()); |
|
result = true; |
|
} |
|
} |
|
} |
|
} |
|
//dojo.debug(str+" "+result); |
|
return result; |
|
} |
|
|
|
function isToday(str) { |
|
var result = false; |
|
if (str) { |
|
var pos1 = str.indexOf('.'); |
|
var pos2 = str.lastIndexOf('.'); |
|
if (pos1 && pos1 > -1 && pos2 && pos2 > pos1 && str.length > pos2) { |
|
var day = str.substring(0, pos1); |
|
if (day && day >= 1 && day <= 31) { |
|
var month = str.substring(pos1 + 1, pos2); |
|
if (month && month > 0 && month <= 12) { |
|
var year = str.substring(pos2 + 1); |
|
if (year <= 30) year = '20' + year; |
|
if (year > 30 && year < 100) year = '19' + year; |
|
var d = Date.parse(month + " " + day + " " + year); |
|
var date = new Date(d); |
|
var today = new Date(); |
|
if (date.getDate() == today.getDate() && date.getMonth() == today.getMonth() && |
|
date.getYear() == today.getYear()) |
|
result = true; |
|
} |
|
} |
|
} |
|
} |
|
//dojo.debug(str+" "+result); |
|
return result; |
|
} |
|
// end date stuff |
|
|
|
//zu versuchszwecken derzeit nicht im Einsatz |
|
function sx_encode(text) { |
|
var f = escape(text); //Umlaut in Standard URL-Encoding nicht Unicode |
|
//äöüÄÖÜß + |
|
f = f.replace(/ä/g, "%E4"); // |
|
f = f.replace(/Ä/g, "%C4"); // |
|
f = f.replace(/ü/g, "%FC"); // |
|
f = f.replace(/Ü/g, "%DC"); // |
|
f = f.replace(/ö/g, "%F6"); // |
|
f = f.replace(/Ö/g, "%D6"); // |
|
f = f.replace(/ß/g, "%DF"); // |
|
alert(f); |
|
return f; |
|
} |
|
|
|
function adaptFeldnameHTML(Feldname) { |
|
var f = Feldname; |
|
f = f.replace(/ä/g, "ä"); |
|
f = f.replace(/Ä/g, "Ä"); |
|
f = f.replace(/ü/g, "ü"); |
|
f = f.replace(/Ü/g, "Ü"); |
|
f = f.replace(/ö/g, "ö"); |
|
f = f.replace(/Ö/g, "Ö"); |
|
f = f.replace(/ß/g, "ß"); |
|
return f; |
|
} |
|
|
|
//ACHTUNG: muss funktion in xsl_functions.xsl entsprechen! |
|
function createVarname(Feldname) { |
|
var f = Feldname; |
|
f = f.replace(/\u00e4/g, "ae"); |
|
f = f.replace(/\u00c4/g, "Ae"); |
|
f = f.replace(/\u00f6/g, "oe"); |
|
f = f.replace(/\u00d6/g, "ae"); |
|
f = f.replace(/\u00fc/g, "ue"); |
|
f = f.replace(/\u00dc/g, "Ue"); |
|
f = f.replace(/\u00df/g, "ss"); |
|
f = f.replace(/ä/g, "ae"); |
|
f = f.replace(/Ä/g, "Ae"); |
|
f = f.replace(/ü/g, "ue"); |
|
f = f.replace(/Ü/g, "Ue"); |
|
f = f.replace(/ö/g, "oe"); |
|
f = f.replace(/Ö/g, "Oe"); |
|
f = f.replace(/ß/g, "ss"); |
|
f = f.replace(/ /g, "_"); |
|
f = f.replace(/,/g, ""); |
|
f = f.replace(/\?/g, ""); |
|
f = f.replace(/!/g, ""); |
|
f = f.replace(/\^/g, ""); |
|
f = f.replace(/%/g, ""); |
|
f = f.replace(/\//g, ""); |
|
f = f.replace(/\*/g, ""); |
|
f = f.replace(/#/g, ""); |
|
f = f.replace(/\|/g, ""); |
|
f = f.replace(/\$/g, ""); |
|
f = f.replace(/\(/g, ""); |
|
f = f.replace(/\)/g, ""); |
|
return f; |
|
} |
|
|
|
//not needed now |
|
function sx_adaptUrl(url, MandantenId) { |
|
if (url.indexOf('jsession') > -1) { |
|
newurl = url.substring(0, url.indexOf('jsession') - 1) + url.substring(url.indexOf( |
|
'?'), url.length); |
|
url = newurl; |
|
} |
|
url = paramRaus(url, 'kennung'); |
|
url = paramRaus(url, 'passwort'); |
|
url = paramRaus(url, 'cachingcontrol'); |
|
if (MandantenId != 'default') |
|
url += "&MandantenID=" + MandantenId; |
|
return url; |
|
} |
|
|
|
function paramRaus(url, param) { |
|
newurl = url; |
|
parampos = url.indexOf(param); |
|
if (parampos > -1) { |
|
newurl = url.substring(0, parampos - 1); |
|
//alert(newurl); |
|
pos2 = url.substring(parampos, url.length - 1).indexOf('&'); |
|
//alert(pos2) |
|
if (pos2 > -1) newurl = newurl + url.substring(parampos + pos2, url.length); |
|
} |
|
return newurl; |
|
} |
|
|
|
// ---------------------------------------------------------------------- |
|
function sichtEintraegeSuchen(was) { |
|
var callurl = '/superx/servlet/SuperXmlMaske'; |
|
//if(jsessionid != '') |
|
// callurl += ';jsessionid='+jsessionid; |
|
|
|
callurl += '?tid=' + maskentid + '&getJSON_' + getEncoded(Feldname) + |
|
'=search:' + getEncoded(was); |
|
document.getElementById('progressbar').style.display = ""; |
|
dojo.io.bind({ |
|
url: callurl, |
|
encoding: "UTF-8", |
|
method: "get", |
|
handler: function(type, data, evt) { |
|
var da = purgeval(data); |
|
if (type == 'error' || da.error) { |
|
document.getElementById('progressbar').style.display = "none"; |
|
<!-- eigentlich sollte immer type gleich error geliefert werden, aber bug in dojo --> |
|
if (da.error) msg = da.error; |
|
else msg = data.message; |
|
alert('Fehler beim Lesen der Daten!\n' + msg); |
|
} else { |
|
|
|
document.getElementById('suchok').style.display = 'none'; |
|
|
|
|
|
document.getElementById('suchselect').options.length = 0; |
|
if (da.length > 0) { |
|
document.getElementById('suchuebernehmen').style.display = ''; |
|
|
|
for (i = 0; i < da.length; i++) |
|
|
|
{ |
|
document.getElementById('suchselect').options[i] = new Option(da[i].title, |
|
da[i].objectId); |
|
} |
|
} else { |
|
document.getElementById('suchselect').options[0] = new Option( |
|
"kein Eintrag gefunden", "-999999"); |
|
document.getElementById('suchuebernehmen').style.display = 'none'; |
|
} |
|
document.getElementById('suchselect').style.display = ''; |
|
|
|
document.getElementById('progressbar').style.display = "none"; |
|
} |
|
} |
|
}); |
|
} |
|
|
|
// params sollten schon passend escaped sein |
|
function maskeSichtLaden(fname, cap, params1) { |
|
resetValidation(); |
|
if (fname) Feldname = fname; |
|
caption = cap; |
|
// <!-- test ohne Jsession var callurl='/superx/servlet/SuperXmlMaske?tid=<xsl:value-of select="/maske/@tid"/><![CDATA[&getJSON_'+Feldname+'=xxxxxx-xxxxxx@'; --> |
|
//<!--Feldname muss escaped werden!--> |
|
var callurl = '/superx/servlet/SuperXmlMaske'; |
|
//if(jsessionid != '') |
|
//callurl += ';jsessionid='+jsessionid; |
|
|
|
callurl += '?tid=' + maskentid + '&getJSON_' + getEncoded(Feldname) + |
|
'=xxxxxx-xxxxxx@'; |
|
|
|
// MB 1/2016 auch fuer Sichtenladen Parameter uebergeben |
|
var params = ""; |
|
|
|
|
|
for (i = 1; i < felder.length; i++) { |
|
//alert(i+"_"+felder[i]["htmlname"]); |
|
e = document.forms['maske'].elements[felder[i]["htmlname"]]; |
|
//alert(felder[i]["htmlname"]+" "+e); |
|
if (e) { |
|
var t = e.type; |
|
var name = felder[i]["name"]; |
|
if (name == Feldname || t == 'button' || t == 'submit' || t == 'reset' || t == |
|
'hidden') continue; |
|
//todo bei startsWith select_ label_ auch überspringen |
|
|
|
if (e.value != '') //leere Felder müssen auch übergeben werden MB!! |
|
// 1/2016 MB dies geht nicht weil ISO kodiert |
|
//params+="&"+felder[i]["cb_name"]+"="+encodeURIComponent(e.value); |
|
params += "&" + getEncoded(felder[i]["htmlname"]) + "=" + getEncoded(e.value); |
|
else |
|
params += "&" + getEncoded(felder[i]["htmlname"]) + "=--leer--"; |
|
} |
|
|
|
} |
|
|
|
if (params1) callurl += "&" + params1; |
|
callurl += params; |
|
// alert(callurl); |
|
versteckeCombosIE6(); |
|
document.getElementById('progressbar').style.display = ""; |
|
dojo.widget.byId("selTree").setChildren(new Array()); |
|
dojo.io.bind({ |
|
url: callurl, |
|
encoding: "UTF-8", |
|
method: "get", |
|
handler: function(type, data, evt) { |
|
var da = purgeval(data); |
|
if (type == 'error' || da.error) { |
|
document.getElementById('progressbar').style.display = "none"; |
|
//<!-- eigentlich sollte immer type gleich error geliefert werden, aber bug in dojo --> |
|
if (da.error) msg = da.error; |
|
else msg = data.message; |
|
alert('Fehler beim Lesen der Daten!\n' + msg); |
|
} else { |
|
dojo.widget.byId("treeLoadingController").setRpcActionParam('getJSON_' + |
|
getEncoded(Feldname)); |
|
sichten = da.sichten; |
|
dojo.widget.byId('treeSelector').allowedMulti = sichten.isMultiSelection; |
|
dojo.widget.byId('treeSelector').deselectAll(); //alte Selektionen entfernen |
|
if (sichten.isMultiSelection) { |
|
document.getElementById("sichthintmulti").style.display = ""; |
|
document.getElementById("suchselect").multiple = true; |
|
} else { |
|
document.getElementById("sichthintmulti").style.display = "none"; |
|
document.getElementById("suchselect").multiple = false; |
|
} |
|
dojo.widget.byId("selTree").setChildren(da.nodes); |
|
if (!caption || caption == '') caption = Feldname; |
|
document.getElementById("sichtElementName").innerHTML = 'Auswahl ' + |
|
caption; |
|
if (sichten.count > 1) { |
|
document.getElementById("sicht").style.display = ""; |
|
document.getElementById("sicht").innerHTML = "<b>Sicht:</b> " + sichten |
|
.selected.name; |
|
document.getElementById("sichtbutton").style.display = ""; |
|
document.forms['sichtauswahlform'].sichtselect.options.length = 0; |
|
document.forms['sichtauswahlform'].sichtselect.options[0] = new Option( |
|
sichten.selected.name, sichten.selected.name_intern); |
|
|
|
for (i = 0; i < sichten.other.length; i++) |
|
|
|
{ |
|
document.forms['sichtauswahlform'].sichtselect.options[i + 1] = new Option( |
|
sichten.other[i].name, sichten.other[i].name_intern); |
|
} |
|
} else { |
|
document.getElementById("sicht").style.display = "none"; |
|
document.getElementById("sichtbutton").style.display = "none"; |
|
} |
|
if (sichten.selected.stand == true) { |
|
document.getElementById("stand").style.display = ""; |
|
document.getElementById("stand").innerHTML = "<b>Stand:</b> " + sichten |
|
.stand; |
|
document.getElementById("standbutton").style.display = ""; |
|
} else { |
|
document.getElementById("stand").style.display = "none"; |
|
document.getElementById("standbutton").style.display = "none"; |
|
} |
|
if (da.nodes.length == 1) { |
|
var d = dojo.widget.byId('treeLoadingController').expandToLevel(dojo.widget |
|
.byId('selTree'), 1); |
|
//d.addCallback(function() { alert('done') }); |
|
} |
|
document.getElementById('progressbar').style.display = "none"; |
|
sichtdlg.show(); |
|
} |
|
} |
|
}); |
|
} |
|
|
|
|
|
//<!-- end sicht--> |
|
|
|
//<!-- start textarea--> |
|
function maskeTextareaUebernehmen() { |
|
var eingabe = document.forms['textareaform'].elements['textarea_fld'].value; |
|
if (eingabe != "") { |
|
|
|
if (eingabe.length > 50) |
|
label = eingabe.substring(0, 49) + ".."; |
|
else |
|
label = eingabe; |
|
|
|
document.forms[0].elements[createVarname(Feldname)].value = eingabe; |
|
document.forms[0].elements["label_" + createVarname(Feldname)].value = label; |
|
|
|
} else { |
|
document.forms[0].elements[createVarname(Feldname)].value = ''; |
|
document.forms[0].elements["label_" + createVarname(Feldname)].value = |
|
"nichts gewählt"; |
|
} |
|
zeigeCombosIE6(); |
|
} |
|
|
|
function textareaLaden(fname, cap) { |
|
Feldname = fname; |
|
caption = cap; |
|
if (!cap || cap == '') caption = Feldname; |
|
document.getElementById("textareaElementName").innerHTML = 'Eingabe ' + |
|
caption; |
|
document.forms['textareaform'].elements["textarea_fld"].value = document.forms[ |
|
0].elements[Feldname].value; |
|
versteckeCombosIE6(); |
|
textareadlg.show(); |
|
} |
|
//<!-- end textarea--> |
|
function initMaske(e) { |
|
sichtdlg = dojo.widget.byId("sichtdlg"); |
|
//dojo.debugDeep(sichtdlg); |
|
sichtdlg._onKey = null; |
|
combodlg = dojo.widget.byId("combodlg"); |
|
combodlg._onKey = null; |
|
textareadlg = dojo.widget.byId("textareadlg"); |
|
combodlg._onKey = null; |
|
lesezeichendlg = dojo.widget.byId("lesezeichendlg"); |
|
combodlg._onKey = null; |
|
sichtauswahl = dojo.widget.byId("sichtauswahl"); |
|
combodlg._onKey = null; |
|
selector = dojo.widget.byId("treeSelector"); |
|
dojo.widget.byId('Standeingabedlg')._onKey = null; |
|
for (i = 0; i < document.forms['maske'].elements.length; i++) { |
|
e = document.forms['maske'].elements[i]; |
|
if (e.getAttribute('class') == "schluesselfeld") e.style.display = "none"; |
|
} |
|
|
|
document.getElementById('progressbar').style.display = "none"; |
|
} |
|
|
|
function maskeSichtstandAendern() { |
|
var eingabe = document.getElementById('gewuenschterStand').value; |
|
|
|
if (eingabe && eingabe != '' && eingabe != sichten.stand) { |
|
sichten.stand = eingabe; |
|
maskeSichtLaden(Feldname, caption, getEncoded(Feldname) + |
|
"-aktualisieren=true&" + getEncoded(Feldname) + "-Stand=" + eingabe); |
|
document.forms['maske'].elements[createVarname(Feldname) + "_Standmerker"].value = |
|
eingabe; |
|
} |
|
|
|
} |
|
|
|
function maskeSichtAendern() { |
|
|
|
index = document.forms['sichtauswahlform'].sichtselect.selectedIndex; |
|
sichtname_intern = document.forms['sichtauswahlform'].sichtselect.options[ |
|
index].value; |
|
|
|
maskeSichtLaden(Feldname, caption, getEncoded(Feldname) + |
|
"-aktualisieren=true&" + getEncoded(Feldname) + "-Sicht=" + getEncoded( |
|
sichtname_intern)); |
|
document.forms['maske'].elements[createVarname(Feldname) + "_Sichtmerker"].value = |
|
sichtname_intern; |
|
sichtauswahl.hide(); |
|
|
|
} |
|
|
|
function maskeTogglekeyfields() { |
|
document.forms['maske'].elements.keyfieldsused.value = "true"; |
|
|
|
for (i = 0; i < document.forms['maske'].elements.length; i++) { |
|
e = document.forms['maske'].elements[i]; |
|
if (e.getAttribute('class') == "schluesselfeld" || e.className == |
|
"schluesselfeld") |
|
if (e.style.display != "none") { |
|
e.style.display = "none"; |
|
} else e.style.display = ""; |
|
} |
|
|
|
} |
|
//ende 1 |
|
|
|
// start Lesezeichen |
|
function maskepreparelesezeichendlg() { |
|
document.getElementById('lesezeichenlinkdiv').style.display = 'none'; |
|
document.getElementById('lesezeichen_konfig').style.display = ''; |
|
document.getElementById('lesezeichen_abbrechen').style.display = ''; |
|
document.getElementById('lesezeichen_ok').style.display = ''; |
|
|
|
x = document.getElementById('lesezeichen_checkboxen'); |
|
while (x.hasChildNodes()) |
|
x.removeChild(x.childNodes[0]); |
|
for (var i = 1; i <= felder.length - 1; i++) { |
|
|
|
if (felder[i]["attribut"] != 'hidden') { |
|
if (document.getElementById(felder[i]["name"]) != null && document.getElementById( |
|
felder[i]["name"]).value != '') { |
|
p = document.createElement("p"); |
|
p.appendChild(document.createTextNode(felder[i]["caption_short"] + ':' + |
|
document.getElementById(felder[i]["name"]).value)); |
|
|
|
cb = document.createElement("input"); |
|
cb.type = "checkbox"; |
|
cb.name = "lesezeichen_fuer_feld_" + felder[i]["htmlname"]; //MB 29.9.2008 htmlname statt cb_name |
|
cb.fieldId = felder[i]["name"]; |
|
cb.value = "on"; |
|
cb.defaultChecked = true; |
|
p.appendChild(cb); |
|
x.appendChild(p); |
|
|
|
} |
|
} |
|
} |
|
} |
|
|
|
// don't encode in IE |
|
function sx_part_encode(str) { |
|
if (navigator.appVersion.indexOf("MSIE") == -1) { |
|
//str=encodeURIComponent(str); |
|
str = getEncoded(str); |
|
|
|
|
|
} |
|
return str; |
|
} |
|
|
|
//somebody explain why FF needs encoding, IE not for Maskenservlet, different in Tabelle --> |
|
//weitere Parameter wie z.B. stylesheet werden nicht berücksichtigt |
|
function prepareLesezeichenLink() { |
|
allg_vorlage = document.getElementById('lesezeichen_vorlage').checked; |
|
if (allg_vorlage) { |
|
if (navigator.appVersion.indexOf("MSIE 6") == -1) { |
|
servlet = 'allg_vorlage'; |
|
title = 'Meine Vorlage'; |
|
var lis = document.getElementById('lesezeichen_checkboxen').getElementsByTagName( |
|
"input"); |
|
params = '/*(['; |
|
|
|
var count = 0; |
|
for (var x = 0; x < lis.length; x++) { |
|
if (lis[x].checked == true) { |
|
if (count > 0) params += ','; |
|
count++; |
|
feldname = lis[x].name.substring(22, lis[x].name.length); |
|
//adaptFeldnameHTML(feldname) hat Ärger im IE gemacht |
|
params += "{n:'" + sx_part_encode(feldname) + "',k:'" + sx_part_encode( |
|
document.getElementById(lis[x].fieldId).value) + "'"; |
|
|
|
if (document.forms['maske'].elements[lis[x].fieldId + "_Sichtmerker"]) |
|
params += ",sichtparam:'" + sx_part_encode(document.forms['maske'].elements[ |
|
lis[x].fieldId + "_Sichtmerker"].value) + "'"; |
|
if (document.forms['maske'].elements[lis[x].fieldId + "_Standmerker"]) { |
|
var stand = document.forms['maske'].elements[lis[x].fieldId + |
|
"_Standmerker"].value; |
|
if (stand && isDate(stand) && !isToday(stand)) params += ",standparam:'" + |
|
stand + "'"; |
|
} |
|
params += "}"; |
|
|
|
} |
|
} |
|
|
|
params += '])*/'; |
|
} else { |
|
alert( |
|
'Mit dem Browser Internet Explorer 6 ist diese Funktion leider nicht nutzbar' |
|
); |
|
} |
|
} else { |
|
servlet = '/superx/servlet/SuperXmlMaske'; |
|
title = 'Maske ' + maskenname; |
|
var lis = document.getElementById('lesezeichen_checkboxen').getElementsByTagName( |
|
"input"); |
|
params = 'p=['; |
|
|
|
for (var x = 0; x < lis.length; x++) { |
|
if (lis[x].checked == true) { |
|
feldname = lis[x].name.substring(22, lis[x].name.length); |
|
params += "{\"n\":\"" + sx_part_encode(feldname) + "\",\"k\":\"" + |
|
sx_part_encode(document.getElementById(lis[x].fieldId).value) + "\"},"; |
|
|
|
if (document.forms['maske'].elements[lis[x].fieldId + "_Sichtmerker"]) |
|
params += "{\"n\":\"" + sx_part_encode(feldname) + "-Sicht\",\"k\":\"" + |
|
sx_part_encode(document.forms['maske'].elements[lis[x].fieldId + |
|
"_Sichtmerker"].value) + "\"},"; |
|
if (document.forms['maske'].elements[lis[x].fieldId + "_Standmerker"]) { |
|
var stand = document.forms['maske'].elements[lis[x].fieldId + |
|
"_Standmerker"].value; |
|
if (stand && isDate(stand) && !isToday(stand)) |
|
params += "{\"n\":\"" + sx_part_encode(feldname) + "-Stand\",\"k\":\"" + |
|
document.forms['maske'].elements[lis[x].fieldId + "_Standmerker"].value + |
|
"\"},"; |
|
} |
|
//title+=" "+feldname+":"+document.getElementById(lis[x].fieldId).value; |
|
} |
|
} |
|
params = params.substring(0, params.length - 1) + "]"; //letztes Komma überschreiben |
|
} |
|
|
|
lesezeichen(servlet, maskentid, mandantenID, params, title); |
|
|
|
} |
|
//<!-- end lesezeichen --> |
|
//<!-- start combo--> |
|
function prepareLesezeichenLink2() { |
|
allg_vorlage = document.getElementById('lesezeichen_vorlage').checked; |
|
if (allg_vorlage) { |
|
if (navigator.appVersion.indexOf("MSIE 6") == -1) { |
|
servlet = 'allg_vorlage'; |
|
title = 'Meine Vorlage'; |
|
var lis = document.getElementById('lesezeichen_checkboxen').getElementsByTagName( |
|
"input"); |
|
params = '/*(['; |
|
|
|
var count = 0; |
|
for (var x = 0; x < lis.length; x++) { |
|
if (lis[x].checked == true) { |
|
if (count > 0) params += ','; |
|
count++; |
|
feldname = lis[x].name.substring(22, lis[x].name.length); |
|
//adaptFeldnameHTML(feldname) hat Ärger im IE gemacht |
|
params += "{n:'" + sx_part_encode(feldname) + "',k:'" + sx_part_encode( |
|
document.getElementById(lis[x].fieldId).value) + "'"; |
|
|
|
if (document.forms['maske'].elements[lis[x].fieldId + "_Sichtmerker"]) |
|
params += ",sichtparam:'" + sx_part_encode(document.forms['maske'].elements[ |
|
lis[x].fieldId + "_Sichtmerker"].value) + "'"; |
|
if (document.forms['maske'].elements[lis[x].fieldId + "_Standmerker"]) { |
|
var stand = document.forms['maske'].elements[lis[x].fieldId + |
|
"_Standmerker"].value; |
|
if (stand && isDate(stand) && !isToday(stand)) params += ",standparam:'" + |
|
stand + "'"; |
|
} |
|
params += "}"; |
|
|
|
} |
|
} |
|
|
|
params += '])*/'; |
|
} else { |
|
alert( |
|
'Mit dem Browser Internet Explorer 6 ist diese Funktion leider nicht nutzbar' |
|
); |
|
} |
|
} else { |
|
servlet = '/superx/servlet/SuperXmlMaske'; |
|
title = 'Maske '+maskenname; |
|
var lis = document.getElementById('lesezeichen_checkboxen').getElementsByTagName( |
|
"input"); |
|
params = ''; |
|
|
|
for (var x = 0; x < lis.length; x++) { |
|
if (lis[x].checked == true) { |
|
params += "&"; |
|
feldname = lis[x].name.substring(22, lis[x].name.length); |
|
params += sx_part_encode(feldname) + "=" + sx_part_encode(document.getElementById( |
|
lis[x].fieldId).value); |
|
|
|
if (document.forms['maske'].elements[lis[x].fieldId + "_Sichtmerker"]) |
|
params += "&" + sx_part_encode(feldname) + "-Sicht=" + sx_part_encode( |
|
document.forms['maske'].elements[lis[x].fieldId + "_Sichtmerker"].value); |
|
if (document.forms['maske'].elements[lis[x].fieldId + "_Standmerker"]) { |
|
var stand = document.forms['maske'].elements[lis[x].fieldId + |
|
"_Standmerker"].value; |
|
if (stand && isDate(stand) && !isToday(stand)) |
|
params += "&" + sx_part_encode(feldname) + "-Stand=" + document.forms[ |
|
'maske'].elements[lis[x].fieldId + "_Standmerker"].value; |
|
} |
|
//title+=" "+feldname+":"+document.getElementById(lis[x].fieldId).value; |
|
} |
|
} |
|
} |
|
params+= "&navi=true"; |
|
lesezeichen2(servlet, maskentid, mandantenID, params, title); |
|
|
|
} |
|
|
|
function maskeComboLaden(fname, caption) { |
|
resetValidation(); |
|
Feldname = fname; |
|
var callurl = '/superx/servlet/SuperXmlMaske'; |
|
//if (jsessionid!='') callurl+=";jsessionid="+jsessionid; |
|
callurl += "?tid=" + maskentid + "&getJSON_" + getEncoded(Feldname) + |
|
'=xxxxxx-xxxxxx@'; |
|
var params = ""; |
|
|
|
/* for (i=0;i<document.forms['maske'].elements.length;i++) |
|
{ |
|
var t=document.forms['maske'].elements[i].type; |
|
var name=document.forms['maske'].elements[i].name; |
|
if (name==Feldname||t=='button'||t=='submit'||t=='reset'||t=='hidden') continue; |
|
//todo bei startsWith select_ label_ auch überspringen |
|
alert(i+"_"+document.forms['maske'].elements[i].name); |
|
if (document.forms['maske'].elements[i].value!='') //leere Felder müssen auch übergeben werden MB!! |
|
params+="&"+document.forms['maske'].elements[i].name+"="+escape(document.forms['maske'].elements[i].value); |
|
else |
|
params+="&"+document.forms['maske'].elements[i].name+"=--leer--"; |
|
}*/ |
|
//alert("test"+felder+" "+felder.length); |
|
for (i = 1; i < felder.length; i++) { |
|
//alert(i+"_"+felder[i]["htmlname"]); |
|
e = document.forms['maske'].elements[felder[i]["htmlname"]]; |
|
//alert(felder[i]["htmlname"]+" "+e); |
|
if (e) { |
|
var t = e.type; |
|
var name = felder[i]["name"]; |
|
if (name == Feldname || t == 'button' || t == 'submit' || t == 'reset' || t == |
|
'hidden') continue; |
|
//todo bei startsWith select_ label_ auch überspringen |
|
|
|
if (e.value != '') //leere Felder müssen auch übergeben werden MB!! |
|
// 1/2016 MB dies geht nicht weil ISO kodiert |
|
//params+="&"+felder[i]["cb_name"]+"="+encodeURIComponent(e.value); |
|
params += "&" + getEncoded(felder[i]["htmlname"]) + "=" + getEncoded(e.value); |
|
else |
|
params += "&" + getEncoded(felder[i]["htmlname"]) + "=--leer--"; |
|
} |
|
|
|
} |
|
|
|
//alert(params); |
|
if (!caption || caption == '') caption = Feldname; |
|
document.getElementById("comboElementName").innerHTML = 'Auswahl ' + caption; |
|
document.getElementById("comboload").style.display = ""; |
|
document.getElementById("comboselect").style.display = "none"; |
|
versteckeCombosIE6(); |
|
var currentFieldValue=document.forms['maske'].elements[Feldname].value; |
|
var splitchar=","; |
|
if(currentFieldValue.indexOf("|")>-1) |
|
splitchar="\|"; |
|
var currentFieldValueArray = currentFieldValue.split(splitchar); |
|
var currentFieldValueCount=currentFieldValueArray.length; |
|
combodlg.show(); |
|
|
|
dojo.io.bind({ |
|
url: callurl + params, |
|
encoding: "UTF-8", |
|
method: "get", |
|
handler: function(type, data, evt) { |
|
|
|
var da = purgeval(data); |
|
|
|
if (type == 'error' || da.error) { |
|
//<!-- eigentlich sollte immer type gleich error geliefert werden, aber bug in dojo --> |
|
if (da.error) msg = da.error; |
|
else msg = data.message; |
|
document.getElementById('progressbar').style.display = "none"; |
|
alert('Fehler beim Lesen der Daten!\n' + msg); |
|
combodlg.hide(); |
|
} else { |
|
nodes = da.nodes; |
|
|
|
document.forms['comboform'].comboselect.options.length = 0; |
|
if (nodes.length == 0) { |
|
document.forms['comboform'].comboselect.options[0] = new Option( |
|
"keine Auswahl möglich", ""); |
|
} else { |
|
if (da.zeilenanzahl > 1 && nodes.length > 1) { |
|
document.forms['comboform'].comboselect.size = 10; |
|
|
|
document.forms['comboform'].comboselect.multiple = true; |
|
document.getElementById("multiselecthint").style.display = ""; |
|
document.getElementById("suchselect").multiple = true; |
|
|
|
} else { |
|
document.forms['comboform'].comboselect.size = 1; |
|
document.forms['comboform'].comboselect.multiple = false; |
|
document.getElementById("multiselecthint").style.display = "none"; |
|
document.getElementById("suchselect").multiple = false; |
|
} |
|
for (i = 0; i < nodes.length; i++) |
|
|
|
{ |
|
|
|
sel = false; |
|
if (nodes[i].isSelected && nodes[i].objectId !="") sel = true; |
|
if(currentFieldValue |
|
&& nodes[i].objectId !="" |
|
&& currentFieldValueArray.includes(nodes[i].objectId) |
|
) |
|
sel=true; |
|
//-------------------HIER IST DER ANGEPASSTE CODE------------------------------------------------------------------------ |
|
title = nodes[i].title; |
|
var o = new Option(title, nodes[i].objectId, sel, sel); |
|
document.forms['comboform'].comboselect.options[i] = o; |
|
|
|
if (nodes[i].nodeattrib && nodes[i].nodeattrib == 3) o.innerHTML = |
|
" " + title; |
|
//---------------------------------------- BIS HIER ------------------------------------------------------------- |
|
} |
|
|
|
document.getElementById("comboload").style.display = "none"; |
|
document.getElementById("comboselect").style.display = ""; |
|
} |
|
document.getElementById('progressbar').style.display = "none"; |
|
} |
|
} |
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
function validateForm(frm, platform) { |
|
//Prüft ob Pflichtfelder ausgefüllt sind. |
|
|
|
var anzElem = frm.elements.length - 1; |
|
var fieldok = false; |
|
var zs = ""; |
|
var zsradio = ""; |
|
var anzFelder = felder.length; |
|
var achtung = "Achtung:<br />"; |
|
if (platform == "his1") |
|
achtung = ""; |
|
var his1_stern = ""; |
|
if (platform == "his1") |
|
his1_stern = "* "; |
|
|
|
for (var i = 1; i < anzFelder; i++) { |
|
//e=frm.elements[i]; |
|
|
|
//if (e.getAttribute('class')=="maskinputPflicht" || e.className=="maskinputPflicht") |
|
if (felder[i]["obligatorisch"] == '1') { |
|
e = frm.elements[felder[i]["htmlname"]]; |
|
if (e) { |
|
if (e.type == "text" || e.type == "textarea" || e.type == "hidden" || e.type == |
|
"password") { |
|
if (e.value != "") |
|
fieldok = true; |
|
} else { |
|
if (e.type == "select-one") { |
|
if (e.options[e.selectedIndex].value != "") |
|
fieldok = true; |
|
} else { |
|
if (e.type == "radio") { |
|
if (zs.indexOf(e.name.toUpperCase()) < 0) { |
|
|
|
if (getRadioValue(frm, e.name) != "") |
|
fieldok = true; |
|
|
|
} else |
|
fieldok = true; |
|
|
|
} else |
|
//alle anderen Felder werden nicht validiert |
|
fieldok = true; |
|
} |
|
} |
|
if (!fieldok) { |
|
var e_name = e.name; |
|
if (e_name.indexOf("select_") == 0) |
|
e_name = e_name.substring(7, e_name.length); |
|
zs += his1_stern + "Bitte füllen Sie das Feld <u>" + felder[i][ |
|
"caption_short" |
|
] + "</u> aus.<br />"; |
|
//zs+=his1_stern+"Bitte füllen Sie das Feld <u><a onMouseOver='document.getElementById(\"f_"+felder[i]["tid"]+"\").style.border=\"medium solid red\";' onMouseOut='document.getElementById(\"f_"+felder[i]["tid"]+"\").style.border=\"none\";'>"+felder[i]["caption_short"]+ "</a></u> aus.<br />"; |
|
//zs+=his1_stern+"Bitte fuellen Sie das Feld <u><a onClick='document.forms[\""+frm.name+"\"].elements[\""+e.name + "\"].focus();'>"+e_name + "</a></u> aus.<br />"; |
|
} |
|
|
|
zsradio = ""; |
|
fieldok = false; |
|
} //Wenn Feld überhaupt drin ist |
|
} |
|
} |
|
var semester_ok = semester_validate(); |
|
if (!semester_ok) { |
|
zs += his1_stern + |
|
"Bitte wählen Sie in <u>Seit Semester</u> ein Semester aus welches vor <u>Bis Semester</u> liegt.<br />"; |
|
//zs +=his1_stern+"Bitte wählen Sie in <u><a onMouseOver='document.getElementById(select_Seit_Semester).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Seit_Semester).style.border=\"none\";'>Seit Semester</a></u> ein Semester aus welches vor <u><a onMouseOver='document.getElementById(select_Bis_Semester).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Bis_Semester).style.border=\"none\";'>Bis Semester</a></u> liegt."; |
|
} |
|
var release_year_ok = release_year_validate(); |
|
if (!release_year_ok) { |
|
zs += his1_stern + |
|
"<u>Publikationsjahr von</u>: Der eingegebene Wert ist größer als der eingegebene Wert in <u>Publikationsjahr bis</u>.<br />"; |
|
//zs +=his1_stern+"<u><a onMouseOver='document.getElementById(select_Publikationsjahr_von).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Publikationsjahr_von).style.border=\"none\";'>Publikationsjahr von</a></u>: Der eingegebene Wert ist größer als der eingegebene Wert in <u><a onMouseOver='document.getElementById(select_Publikationsjahr_bis).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Publikationsjahr_bis).style.border=\"none\";'>Publikationsjahr_bis</a></u>."; |
|
} |
|
var release_from_year_ok = release_from_year_as_jjjj_validate(); |
|
if (!release_from_year_ok) { |
|
zs += his1_stern + |
|
"<u>Publikationsjahr von</u>: entspricht nicht dem Format jjjj.<br />"; |
|
//zs +=his1_stern+"<u><a onMouseOver='document.getElementById(select_Publikationsjahr_von).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Publikationsjahr_von).style.border=\"none\";'>Publikationsjahr von</a></u>: entspricht nicht dem Format "jjjj"."; |
|
} |
|
var release_until_year_ok = release_until_year_as_jjjj_validate(); |
|
if (!release_until_year_ok) { |
|
zs += his1_stern + |
|
"<u>Publikationsjahr bis</u>: entspricht nicht dem Format jjjj.<br />"; |
|
//zs +=his1_stern+"<u><a onMouseOver='document.getElementById(select_Publikationsjahr_bis).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Publikationsjahr_bis).style.border=\"none\";'>Publikationsjahr bis</a></u>: entspricht nicht dem Format "jjjj"."; |
|
} |
|
var semesterverl_ok = semesterverl_validate(); |
|
if (!semesterverl_ok) { |
|
zs += his1_stern + |
|
"Bitte wählen Sie in <u>Einschreibsemester</u> ein Semester aus welches vor <u>Bis Semester</u> und vor <u>Verlaufsbetr. bis.</u> liegt sowie in <u>Bis Semester</u> ein Semester aus welches vor <u>Verlaufsbetr. bis.</u> liegt.<br />"; |
|
//zs +=his1_stern+"Bitte wählen Sie in <u><a onMouseOver='document.getElementById(select_Seit_Semester).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Seit_Semester).style.border=\"none\";'>Seit Semester</a></u> ein Semester aus welches vor <u><a onMouseOver='document.getElementById(select_Bis_Semester).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Bis_Semester).style.border=\"none\";'>Bis Semester</a></u> liegt."; |
|
} |
|
|
|
var datenblatt_ok = datenblatt_validate(); |
|
if (!datenblatt_ok) { |
|
zs += his1_stern + |
|
"Wenn Sie in dem Button <u>Bericht</u> das generische Standardlayout wählen, müssen Sie bei dem Button <u>Ausgabeformat</u> HTML auswählen.<br />"; |
|
zs += his1_stern + "Bericht: " + document.getElementById( |
|
'select_tablestylesheet').value + "<br />Ausgabeformat: " + document.getElementById( |
|
'select_Ausgabeformat').value + "<br />"; |
|
//zs +=his1_stern+"Bitte wählen Sie in <u><a onMouseOver='document.getElementById(select_Seit_Semester).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Seit_Semester).style.border=\"none\";'>Seit Semester</a></u> ein Semester aus welches vor <u><a onMouseOver='document.getElementById(select_Bis_Semester).style.border=\"medium solid red\";' onMouseOut='document.getElementById(select_Bis_Semester).style.border=\"none\";'>Bis Semester</a></u> liegt."; |
|
} |
|
if (zs == "") { |
|
frm.stylesheet.value = ''; |
|
//wenn alles OK ist noch ggfs bei Texteingabefelder art=0 und Defaultwert ggfs. "--leer--" statt Leerstring setzen, damit evtl. vorhandener Defaultwert aus DB den Leerstring nicht überschreibt |
|
for (var i = 1; i < felder.length; i++) { |
|
if (felder[i]["art"] == '0' && felder[i]["hasDefaultDbValue"] != null && |
|
felder[i]["hasDefaultDbValue"] == 'true') { |
|
var tmp_field = document.getElementById(felder[i]["name"]); |
|
if (tmp_field.value == null || tmp_field.value == "") tmp_field.value = |
|
"--leer--"; |
|
} |
|
} |
|
return true; |
|
} else { |
|
document.getElementById('validation').innerHTML = "<p>" + achtung + zs + |
|
"</p>"; |
|
|
|
return false; |
|
} |
|
|
|
|
|
} |
|
|
|
function semester_validate() { |
|
|
|
if ((document.getElementById('select_Seit_Semester') != null) && (document.getElementById( |
|
'select_Bis_Semester') != null)) { |
|
sem_von = document.getElementById('select_Seit_Semester').value; |
|
sem_bis = document.getElementById('select_Bis_Semester').value; |
|
if ((sem_von != "" && sem_bis != "")) { |
|
if (sem_von <= sem_bis) { |
|
return true; |
|
} else { |
|
return false; |
|
} |
|
|
|
} else { |
|
return true; |
|
} |
|
} else { |
|
return true; |
|
} |
|
} |
|
|
|
function release_year_validate() { |
|
|
|
if ((document.getElementById('select_Publikationsjahr_von') != null) && (document.getElementById( |
|
'select_Publikationsjahr_bis') != null)) { |
|
Publikationsjahr_von = document.getElementById('select_Publikationsjahr_von').value; |
|
Publikationsjahr_bis = document.getElementById('select_Publikationsjahr_bis').value; |
|
if ((Publikationsjahr_von != "" && Publikationsjahr_bis != "")) { |
|
if (Publikationsjahr_von <= Publikationsjahr_bis) { |
|
return true; |
|
} else { |
|
return false; |
|
} |
|
|
|
} else { |
|
return true; |
|
} |
|
} else { |
|
return true; |
|
} |
|
} |
|
|
|
function release_from_year_as_jjjj_validate() { |
|
|
|
if (document.getElementById('Publikationsjahr_von') != null) { |
|
Publikationsjahr_von = document.getElementById('Publikationsjahr_von').value; |
|
if (Publikationsjahr_von !== "") { |
|
if (Publikationsjahr_von > 999 && Publikationsjahr_von < 3000) { |
|
return true; |
|
} else { |
|
return false; |
|
} |
|
|
|
} else { |
|
return true; |
|
} |
|
} else { |
|
return true; |
|
} |
|
} |
|
|
|
function release_until_year_as_jjjj_validate() { |
|
|
|
if (document.getElementById('Publikationsjahr_bis') != null) { |
|
Publikationsjahr_bis = document.getElementById('Publikationsjahr_bis').value; |
|
if (Publikationsjahr_bis !== "") { |
|
if (Publikationsjahr_bis > 999 && Publikationsjahr_bis < 3000) { |
|
return true; |
|
} else { |
|
return false; |
|
} |
|
|
|
} else { |
|
return true; |
|
} |
|
} else { |
|
return true; |
|
} |
|
} |
|
|
|
function semesterverl_validate() { |
|
if ((document.getElementById('select_Einschreibsemester') != null) && ( |
|
document.getElementById('select_Verlaufsbetr._bis') != null)) { |
|
sem_bis = document.getElementById('select_Bis_Semester').value; |
|
einschreibsemester = document.getElementById('select_Einschreibsemester').value; |
|
verlaufsbetrbis = document.getElementById('select_Verlaufsbetr._bis').value; |
|
if (sem_bis != "") { |
|
if ((einschreibsemester != "") && (verlaufsbetrbis != "")) { |
|
if (einschreibsemester <= sem_bis) { |
|
if (sem_bis <= verlaufsbetrbis) { |
|
//alert('richtig'); |
|
return true; |
|
} else { |
|
//alert('falsch'); |
|
return false; |
|
} |
|
} else { |
|
//alert('falsch'); |
|
return false; |
|
} |
|
} else { |
|
return false; |
|
} |
|
} else { |
|
if (einschreibsemester <= verlaufsbetrbis) { |
|
//alert('richtig1'); |
|
return true; |
|
} else { |
|
//alert('falsch1'); |
|
return false; |
|
} |
|
} |
|
} else { |
|
return true; |
|
} |
|
} |
|
|
|
function datenblatt_validate() { |
|
if ((document.getElementById('select_tablestylesheet') != null) && (document.getElementById( |
|
'select_Ausgabeformat') != null)) { |
|
bericht = document.getElementById('select_tablestylesheet').value; |
|
ausgfor = document.getElementById('select_Ausgabeformat').value; |
|
if ((bericht != "" && ausgfor != "")) { |
|
if (bericht == "tabelle_html.xsl" && ausgfor != "text/html") { |
|
return false; |
|
} else { |
|
return true; |
|
} |
|
|
|
} else { |
|
return true; |
|
} |
|
} else { |
|
return true; |
|
} |
|
} |
|
|
|
function report_validate() { |
|
if ((document.getElementById('select_tablestylesheet') != null) && (document.getElementById( |
|
'select_Ausgabeformat') != null)) |
|
|
|
{ |
|
bericht = document.getElementById('select_tablestylesheet').value; |
|
ausgfor = document.getElementById('select_Ausgabeformat').value; |
|
if (bericht != "" && ausgfor != "" && ausgfor == "text/html") { |
|
if (/.jrxml/.test(bericht)) { |
|
$("#SuperXMaske").prop("target", "_blank"); |
|
} else { |
|
$("#SuperXMaske").prop("target", ""); |
|
} |
|
return true; |
|
} |
|
return true; |
|
} |
|
return true; |
|
} |
|
|
|
function versteckeCombosIE6() |
|
//Dies ist ein Workaround für den IE |
|
//Comboboxen scheinen beim IE durch Layer durch. |
|
//siehe http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q177/3/78.asp&NoWebContent=1 |
|
//oder http://dotnetjunkies.com/WebLog/jking/archive/2003/07/21/488.aspx |
|
//Alle Combos ausser Sichtenauswahlbuttons werden ausgeblendet. |
|
{ |
|
if (navigator.appVersion.indexOf("MSIE 6") > -1) { |
|
for (var i = 0; i < document.forms[0].elements.length; i++) { |
|
//alert(document.forms[0].elements[i].type +'-'+document.forms[0].elements[i].name); |
|
if (document.forms[0].elements[i].type && document.forms[0].elements[i].type |
|
.indexOf("select-one") > -1) |
|
document.forms[0].elements[i].style.display = "none"; |
|
} |
|
} |
|
} |
|
|
|
function zeigeCombosIE6() { |
|
if (navigator.appVersion.indexOf("MSIE 6") > -1) { |
|
for (var i = 0; i < document.forms[0].elements.length; i++) { |
|
if (document.forms[0].elements[i].type && document.forms[0].elements[i].type |
|
.indexOf("select-one") > -1) |
|
document.forms[0].elements[i].style.display = "inline"; |
|
} |
|
} |
|
} |
|
|
|
function enterClicksButton(buttonName, e) { |
|
//the purpose of this function is to allow the enter key to |
|
//point to the correct button to click. |
|
var key; |
|
if (window.event) |
|
key = window.event.keyCode; //IE |
|
else |
|
key = e.which; //firefox |
|
|
|
if (key == 13) { |
|
//Get the button the user wants to have clicked |
|
|
|
var btn = document.getElementById(buttonName); |
|
if (btn != null) { //If we find the button click it |
|
|
|
btn.click(); |
|
// e.keyCode = 0 |
|
} |
|
} |
|
} |
|
|
|
|
|
function getEncoded(fname_orig) { |
|
//diese Zeile wird beim build mit utf8 oder iso belegt: |
|
var myEncoding = "UTF-8"; |
|
var fname_encoded = "unknown"; |
|
//nur bei Unicode darf encodeURIComponent benutzt werden |
|
if (myEncoding.charAt(0) == "U") //Platzhalter für Unicode, soll beim build nicht ersetzt werden |
|
fname_encoded = encodeURIComponent(fname_orig); |
|
else |
|
fname_encoded = escape(fname_orig).replace("+", "%2B"); |
|
return fname_encoded; |
|
} |
|
|
|
function getFieldName(position) { |
|
return felder[position]["htmlname"]; |
|
} |
|
var cssdropdown = { |
|
disappeardelay: 250, // Millisekunden in denen das Menü verschwindet |
|
dropdownindicator: '<img src="../images/down.gif" border="0" />', // Pfeil nach unten nach dem Test im Dropdownmenü |
|
enablereveal: [true, 5], // swipe effect aktivieren? [true/false, stufen (Nummer der Animationsstufen. Integer zwischen 1-20. je kleiner die Zahl, desto schneller öffnet sich das Manü)] |
|
enableiframeshim: 1, // für IE5.5 - IE7? (1=ja, 0=nein) |
|
|
|
|
|
|
|
dropmenuobj: null, |
|
asscmenuitem: null, |
|
domsupport: document.all || document.getElementById, |
|
standardbody: null, |
|
iframeshimadded: false, |
|
revealtimers: {}, |
|
|
|
getposOffset: function(what, offsettype) { |
|
var totaloffset = (offsettype == "left") ? what.offsetLeft : what.offsetTop; |
|
var parentEl = what.offsetParent; |
|
while (parentEl != null) { |
|
totaloffset = (offsettype == "left") ? totaloffset + parentEl.offsetLeft : |
|
totaloffset + parentEl.offsetTop; |
|
parentEl = parentEl.offsetParent; |
|
} |
|
return totaloffset; |
|
}, |
|
|
|
css: function(el, targetclass, action) { |
|
var needle = new RegExp("(^|\\s+)" + targetclass + "($|\\s+)", "ig") |
|
if (action == "check") |
|
return needle.test(el.className) |
|
else if (action == "remove") |
|
el.className = el.className.replace(needle, "") |
|
else if (action == "add" && !needle.test(el.className)) |
|
el.className += " " + targetclass |
|
}, |
|
|
|
showmenu: function(dropmenu, e) { |
|
if (this.enablereveal[0]) { |
|
if (!dropmenu._trueheight || dropmenu._trueheight < 10) |
|
dropmenu._trueheight = dropmenu.offsetHeight |
|
clearTimeout(this.revealtimers[dropmenu.id]) |
|
dropmenu.style.height = dropmenu._curheight = 0 |
|
dropmenu.style.overflow = "hidden" |
|
dropmenu.style.visibility = "visible" |
|
this.revealtimers[dropmenu.id] = setInterval(function() { |
|
cssdropdown.revealmenu(dropmenu) |
|
}, 10) |
|
} else { |
|
dropmenu.style.visibility = "visible" |
|
} |
|
this.css(this.asscmenuitem, "selected", "add") |
|
}, |
|
|
|
revealmenu: function(dropmenu, dir) { |
|
var curH = dropmenu._curheight, |
|
maxH = dropmenu._trueheight, |
|
steps = this.enablereveal[1] |
|
if (curH < maxH) { |
|
var newH = Math.min(curH, maxH) |
|
dropmenu.style.height = newH + "px" |
|
dropmenu._curheight = newH + Math.round((maxH - newH) / steps) + 1 |
|
} else { |
|
dropmenu.style.height = "auto" |
|
dropmenu.style.overflow = "hidden" |
|
clearInterval(this.revealtimers[dropmenu.id]) |
|
} |
|
}, |
|
|
|
clearbrowseredge: function(obj, whichedge) { |
|
var edgeoffset = 0 |
|
if (whichedge == "rightedge") { |
|
var windowedge = document.all && !window.opera ? this.standardbody.scrollLeft + |
|
this.standardbody.clientWidth - 15 : window.pageXOffset + window.innerWidth - |
|
15 |
|
var dropmenuW = this.dropmenuobj.offsetWidth |
|
if (windowedge - this.dropmenuobj.x < dropmenuW) |
|
edgeoffset = dropmenuW - obj.offsetWidth |
|
} else { |
|
var topedge = document.all && !window.opera ? this.standardbody.scrollTop : |
|
window.pageYOffset |
|
var windowedge = document.all && !window.opera ? this.standardbody.scrollTop + |
|
this.standardbody.clientHeight - 15 : window.pageYOffset + window.innerHeight - |
|
18 |
|
var dropmenuH = this.dropmenuobj._trueheight |
|
if (windowedge - this.dropmenuobj.y < dropmenuH) { |
|
edgeoffset = dropmenuH + obj.offsetHeight |
|
if ((this.dropmenuobj.y - topedge) < dropmenuH) |
|
edgeoffset = this.dropmenuobj.y + obj.offsetHeight - topedge |
|
} |
|
} |
|
return edgeoffset |
|
}, |
|
|
|
dropit: function(obj, e, dropmenuID) { |
|
if (this.dropmenuobj != null) |
|
this.hidemenu() |
|
this.clearhidemenu() |
|
this.dropmenuobj = document.getElementById(dropmenuID) |
|
this.asscmenuitem = obj |
|
this.showmenu(this.dropmenuobj, e) |
|
this.dropmenuobj.x = this.getposOffset(obj, "left") |
|
this.dropmenuobj.y = this.getposOffset(obj, "top") |
|
this.dropmenuobj.style.left = this.dropmenuobj.x - this.clearbrowseredge( |
|
obj, "rightedge") + "px" |
|
this.dropmenuobj.style.top = this.dropmenuobj.y - this.clearbrowseredge(obj, |
|
"bottomedge") + obj.offsetHeight + 1 + "px" |
|
this.positionshim() |
|
}, |
|
|
|
positionshim: function() { |
|
if (this.iframeshimadded) { |
|
if (this.dropmenuobj.style.visibility == "visible") { |
|
this.shimobject.style.width = this.dropmenuobj.offsetWidth + "px" |
|
this.shimobject.style.height = this.dropmenuobj._trueheight + "px" |
|
this.shimobject.style.left = parseInt(this.dropmenuobj.style.left) + "px" |
|
this.shimobject.style.top = parseInt(this.dropmenuobj.style.top) + "px" |
|
this.shimobject.style.display = "block" |
|
} |
|
} |
|
}, |
|
|
|
hideshim: function() { |
|
if (this.iframeshimadded) |
|
this.shimobject.style.display = 'none' |
|
}, |
|
|
|
isContained: function(m, e) { |
|
var e = window.event || e |
|
var c = e.relatedTarget || ((e.type == "mouseover") ? e.fromElement : e.toElement) |
|
while (c && c != m) try { |
|
c = c.parentNode |
|
} catch (e) { |
|
c = m |
|
} |
|
if (c == m) |
|
return true |
|
else |
|
return false |
|
}, |
|
|
|
dynamichide: function(m, e) { |
|
if (!this.isContained(m, e)) { |
|
this.delayhidemenu() |
|
} |
|
}, |
|
|
|
delayhidemenu: function() { |
|
this.delayhide = setTimeout("cssdropdown.hidemenu()", this.disappeardelay) |
|
}, |
|
|
|
hidemenu: function() { |
|
this.css(this.asscmenuitem, "selected", "remove") |
|
this.dropmenuobj.style.visibility = 'hidden' |
|
this.dropmenuobj.style.left = this.dropmenuobj.style.top = "-1000px" |
|
this.hideshim() |
|
}, |
|
|
|
clearhidemenu: function() { |
|
if (this.delayhide != "undefined") |
|
clearTimeout(this.delayhide) |
|
}, |
|
|
|
addEvent: function(target, functionref, tasktype) { |
|
if (target.addEventListener) |
|
target.addEventListener(tasktype, functionref, false); |
|
else if (target.attachEvent) |
|
target.attachEvent('on' + tasktype, function() { |
|
return functionref.call(target, window.event) |
|
}); |
|
}, |
|
|
|
startdropdown: function() { |
|
if (!this.domsupport) |
|
return |
|
this.standardbody = (document.compatMode == "CSS1Compat") ? document.documentElement : |
|
document.body |
|
for (var ids = 0; ids < arguments.length; ids++) { |
|
var menuitems = document.getElementById(arguments[ids]).getElementsByTagName( |
|
"a") |
|
for (var i = 0; i < menuitems.length; i++) { |
|
if (menuitems[i].getAttribute("rel")) { |
|
var relvalue = menuitems[i].getAttribute("rel") |
|
var asscdropdownmenu = document.getElementById(relvalue) |
|
this.addEvent(asscdropdownmenu, function() { |
|
cssdropdown.clearhidemenu() |
|
}, "mouseover") |
|
this.addEvent(asscdropdownmenu, function(e) { |
|
cssdropdown.dynamichide(this, e) |
|
}, "mouseout") |
|
this.addEvent(asscdropdownmenu, function() { |
|
cssdropdown.delayhidemenu() |
|
}, "click") |
|
try { |
|
menuitems[i].innerHTML = menuitems[i].innerHTML + " " + this.dropdownindicator |
|
} catch (e) {} |
|
this.addEvent(menuitems[i], function(e) { |
|
if (!cssdropdown.isContained(this, e)) { |
|
var evtobj = window.event || e |
|
cssdropdown.dropit(this, evtobj, this.getAttribute("rel")) |
|
} |
|
}, "mouseover") |
|
this.addEvent(menuitems[i], function(e) { |
|
cssdropdown.dynamichide(this, e) |
|
}, "mouseout") |
|
this.addEvent(menuitems[i], function() { |
|
cssdropdown.delayhidemenu() |
|
}, "click") |
|
} |
|
} |
|
} |
|
if (this.enableiframeshim && document.all && !window.XDomainRequest && ! |
|
this.iframeshimadded) { |
|
document.write( |
|
'<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>' |
|
) |
|
this.shimobject = document.getElementById("iframeshim") |
|
this.shimobject.style.filter = |
|
'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)' |
|
this.iframeshimadded = true |
|
} |
|
} |
|
} |
|
|
|
function prepareExport(which) { |
|
if (which == 'excel') { |
|
document.forms[0].stylesheet.value = 'tabelle_xls.xsl'; |
|
document.forms[0].contenttype.value = |
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
|
} |
|
if (which == 'pdf') { |
|
document.forms[0].stylesheet.value = 'tabelle_fo_pdf.xsl'; |
|
document.forms[0].contenttype.value = 'application/pdf'; |
|
document.forms[0].target = '_blank'; |
|
} |
|
if (which == 'druckversion') { |
|
document.forms[0].stylesheet.value = 'tabelle_html_p.xsl'; |
|
document.forms[0].contenttype.value = 'text/html'; |
|
document.forms[0].target = '_blank'; |
|
} |
|
if (which == 'xml') { |
|
document.forms[0].stylesheet.value = 'tabelle_xml.xsl'; |
|
document.forms[0].contenttype.value = 'text/xml'; |
|
document.forms[0].target = '_blank'; |
|
} |
|
document.forms[0].offset.value='0'; |
|
document.forms[0].maxoffset.value = '1000000'; |
|
document.forms[0].reuseresult.value = 'true'; |
|
if (isTreeTable) { |
|
dojo.widget.byId("ttexdlg").show(); //ruft function exportandhidedlg auf |
|
} else { |
|
startExport(); |
|
} |
|
} |
|
|
|
function exportandhidedlg(what) { |
|
rows = ''; |
|
if (what == 'some rows') { |
|
tableId = "table1"; |
|
table = document.getElementById(tableId); |
|
rowChildren = table.getElementsByTagName('tr'); |
|
for (i = 0; i < rowChildren.length; i++) { |
|
if (index = rowChildren[i].id.indexOf('_')) { |
|
if (rowChildren[i].style.display == '') rows = rows + rowChildren[i].getAttribute( |
|
"irowno") + ","; |
|
} |
|
} |
|
rows = rows.replace("null,", ""); |
|
} |
|
document.forms[0].irowno.value = rows; |
|
// alert(rows); |
|
dojo.widget.byId("ttexdlg").hide(); |
|
startExport(); |
|
} |
|
|
|
|
|
function startExport() { |
|
document.forms[0].submit(); |
|
} |
|
|
|
function enwicklerServletLaden(param) { |
|
document.getElementById('progressbar').style.display = ""; |
|
dojo.io.bind({ |
|
url: "/superx/servlet/de.superx.servlet.Entwicklung?param=" + param, |
|
encoding: "UTF-8", |
|
method: "get", |
|
handler: function(type, data, evt) { //dojo.debug(data); |
|
var da = purgeval(data); //dojo.debugDeep(da) |
|
document.getElementById('progressbar').style.display = "none" |
|
if (type == 'error' || da.error) { |
|
// eigentlich sollte immer type gleich error geliefert werden, aber bug in dojo |
|
if (da.error) msg = da.error; |
|
else msg = data.message; |
|
alert('Fehler beim Lesen der Daten!' + msg); |
|
} else { |
|
var help = ''; |
|
if (param == 'maskxml') help += "<b>Masken-XML</b>"; |
|
if (param == 'sql1') help += "<b>SQL-Quelle</b>"; |
|
if (param == 'sql2') help += "<b>SQL nach 1. Transformation</b>"; |
|
if (param == 'sql3') help += "<b>nach Freemarker Transformation</b>"; |
|
if (param == 'tablexml') help += "<b>Tabellen-XML</b>"; |
|
if (param == 'sqlparams') help += "<b>Parameter</b>"; |
|
help += " <a href='#' onclick='purgeEnwicklerServletDiv(\"" + param + |
|
"\");'>Ausblenden</a><br>"; |
|
document.getElementById(param).innerHTML = help + '-- ' + da.maskinfo + |
|
'<br>' + da.txt; |
|
//dojo.widget.byId('sqldlg').show() ; |
|
} |
|
} |
|
}) |
|
} |
|
|
|
function purgeEnwicklerServletDiv(param) { |
|
document.getElementById(param).innerHTML = ""; |
|
} |
|
|
|
function createLinkForMask(refapp, colset='',colsort='') { |
|
var stylesheet = jQuery('#deeplinkausgabe').val(); |
|
var ausgabe_text = jQuery('#deeplinkausgabe option:selected').text(); |
|
var contenttype = "text/html"; |
|
var contenttype_portlet = ""; |
|
var navigation = ""; |
|
//alert("Ausgabe: " + ausgabe_text + "\nstylesheet: "+ stylesheet); |
|
if (ausgabe_text.indexOf('Navi') >= 0 ){ |
|
navigation = "&navi=true"; |
|
} |
|
if (stylesheet == 'tabelle_xls.xsl') { |
|
contenttype = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; |
|
} else if (stylesheet == 'tabelle_fo_pdf.xsl') { |
|
contenttype = "application/pdf"; |
|
} else if (stylesheet == 'tabelle_html_p.xsl') { |
|
contenttype = "text/html"; |
|
} else if (stylesheet == 'tabelle_xml.xsl') { |
|
contenttype = "text/xml"; |
|
} else if (stylesheet.indexOf(".jrxml") > -1) { |
|
contenttype = jQuery('#jasper_ausgabeformat').val(); |
|
contenttype_portlet = jQuery('#jasper_ausgabeformat option:selected').text(); |
|
} else { |
|
//speziells Stylesheet |
|
contenttype = stylesheetcontenttype[stylesheet]; |
|
} |
|
var url = location.protocol + '//' + location.host + |
|
'/superx/servlet/SuperXmlTabelle?'; |
|
var url_sso = location.protocol + '//' + location.host + '/' + refapp + |
|
'/rds?state=redirect&sso=superx&utarget=/superx/servlet/SuperXmlTabelle?'; |
|
var params = ""; |
|
var params_sso = ''; |
|
var tablestyle = ''; |
|
var fields = $(document.forms[0]).serializeArray(); |
|
jQuery.each(fields, function(i, field) { |
|
var htmlname = ''; |
|
for (j = 1; j < felder.length; j++) { |
|
if (field.name == felder[j]["htmlname"]) |
|
htmlname = felder[j]["htmlname"]; |
|
} |
|
if (field.name != 'UserID' && field.name.indexOf('contenttype') == -1 && |
|
htmlname.indexOf('##line##') == -1 && field.name.indexOf('stylesheet') == |
|
-1 && field.name.indexOf('reuseresult') == -1 && field.name.indexOf('navi') == |
|
-1 && field.value != '' && field.name.indexOf('maxoffset') == -1) { |
|
params += ('&' + encodeURIComponent(field.name) + '=' + encodeURIComponent( |
|
field.value)); |
|
params_sso += ('&' + field.name + '=' + field.value); |
|
} |
|
if (field.name == 'tablestylesheet') { |
|
tablestyle = 'table'; |
|
} |
|
}); |
|
params += '&contenttype=' + encodeURIComponent(contenttype); |
|
params += '&' + tablestyle + 'stylesheet=' + encodeURIComponent(stylesheet) + navigation; |
|
if (contenttype_portlet == "Portlet") { |
|
params +='&cachingcontrol=clearmask'; |
|
} |
|
params_sso += '&contenttype=' + contenttype; |
|
params_sso += '&stylesheet=' + stylesheet + navigation; |
|
if (colset!='') {params+='&colset='+encodeURIComponent(colset).replace('|','%7C');params_sso+='colset='+colset.replace('|','%7C');} |
|
if (colsort!='') {params+='&colsort='+encodeURIComponent(colsort).replace('|','%7C');params_sso+='colsort='+colset.replace('|','%7C');} |
|
|
|
var linksForMask=""; |
|
if (platform == "his1") { |
|
linksForMask+='HISinOne SSO-Link (komplett):\n' + |
|
url_sso + encodeURIComponent(params)+'\n\n'; |
|
linksForMask+='HISinOne SSO-Link für Portlets lokale Serverfunktion:\n' + |
|
'/rds?state=redirect&sso=superx&utarget=/superx/servlet/SuperXmlTabelle?' + encodeURIComponent(params+"&cachingcontrol=clearmask")+'\n\n'; |
|
} |
|
linksForMask+=" Direkter Link:\n\n" + |
|
url + params; |
|
|
|
document.getElementById('deeplinktext').innerHTML =linksForMask; |
|
|
|
} |
|
|
|
function deeplinkerzeugen(refapp) { |
|
var url = location.protocol + '//' + location.host + |
|
'/superx/servlet/SuperXmlTabelle?tid='; |
|
var url_sso = location.protocol + '//' + location.host + '/' + refapp + |
|
'/rds?state=redirect&sso=superx&utarget=/superx/servlet/SuperXmlTabelle?tid='; |
|
var fieldsep = "&"; |
|
|
|
if (refapp != "" && refapp != "null") { |
|
//his1: |
|
url = location.protocol + '//' + location.host + '/' + refapp + |
|
'/rds?state=redirect&sso=superx&utarget=/superx/servlet/SuperXmlTabelle?tid='; |
|
fieldsep = "%26"; |
|
|
|
} |
|
url += getTid(); |
|
var params = getParams('direkt'); |
|
var deeplinka = document.getElementById('deeplinkausgabe'); |
|
var stylesheet = deeplinka.options[deeplinka.selectedIndex].value; |
|
params = params + fieldsep + "stylesheet=" + stylesheet; |
|
if (fieldsep == "%26") |
|
params = params.replace(/&/g, '%26'); |
|
|
|
var offset = true; |
|
var contenttype = "contenttype="; |
|
if (stylesheet == 'tabelle_xls.xsl') { |
|
contenttype += |
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; |
|
} else if (stylesheet == 'tabelle_fo_pdf.xsl') { |
|
contenttype += "application/pdf"; |
|
} else if (stylesheet == 'tabelle_html_p.xsl') { |
|
contenttype += "text/html"; |
|
} else if (stylesheet == 'tabelle_xml.xsl') { |
|
contenttype += "text/xml"; |
|
} else if (stylesheet.indexOf(".jrxml") > -1) { |
|
offset = false; |
|
var h = document.getElementById("jasper_ausgabeformat"); |
|
contenttype += h.options[h.selectedIndex].value; |
|
} else { |
|
//speziells Stylesheet |
|
contenttype += stylesheetcontenttype[stylesheet]; |
|
} |
|
|
|
params += fieldsep + contenttype; |
|
|
|
if (offset) { |
|
params += fieldsep + "maxoffset=1000000"; |
|
} |
|
document.getElementById('deeplinktext').innerHTML = url + params + "\n" + |
|
url_sso + encodeURIComponent(params); |
|
} |
|
|
|
function deeplink_ausgabeformat() { |
|
var deeplinka = document.getElementById('deeplinkausgabe'); |
|
var stylesheet = deeplinka.options[deeplinka.selectedIndex].value; |
|
if (stylesheet.indexOf(".jrxml") > -1) |
|
document.getElementById('div_jasper_ausgabeformat').style.display = ""; |
|
else |
|
document.getElementById('div_jasper_ausgabeformat').style.display = "none"; |
|
document.getElementById('deeplinktext').innerHTML = ""; |
|
} |
|
|
|
function maskSubmit(event) { |
|
//alert("Submit"); |
|
return report_validate(); |
|
//event.preventDefault(); |
|
} |
|
|
|
/*$(document).ready(function() { |
|
$("#SuperXMaske").submit(maskSubmit); |
|
}); |
|
*/ |
|
function toggleCheckbox(fldname) |
|
{ |
|
//alert(fldname); |
|
if(document.forms[0].elements['chkbx_'+fldname].checked) |
|
document.forms[0].elements[fldname].value="true"; |
|
else |
|
document.forms[0].elements[fldname].value="false"; |
|
} |
|
|
|
function copyText(mydiv) |
|
{ |
|
var ergtabelle=document.getElementById(mydiv); |
|
const selection = window.getSelection(); |
|
const range = document.createRange(); |
|
range.selectNodeContents(ergtabelle); |
|
selection.removeAllRanges(); |
|
selection.addRange(range); |
|
|
|
document.execCommand('copy'); |
|
selection.removeAllRanges(); |
|
|
|
//alert("Angezeigte Tabelle wurde in die Zwischenablage kopiert."); |
|
} |
|
|
|
function expandMinimizeTextArea(mytextarea,rowsSmall,rowsLarge) |
|
{ |
|
var ta=document.getElementById(mytextarea); |
|
if(ta.rows==rowsSmall) |
|
ta.rows=rowsLarge; |
|
else |
|
ta.rows=rowsSmall; |
|
} |
|
|
|
|
|
//Spalten in Tabelle die beim scrollen mitlaufen sollen |
|
function tableRowHeaderSticky(fixedColumnCount_width) |
|
{ |
|
if (fixedColumnCount_width === undefined) { |
|
fixedColumnCount_width = 0; |
|
} |
|
//Variable für fixen Abstand von links, wird im lauf immer erweitert. |
|
var column_width=0; |
|
var tableRaws = document.getElementById("table1").getElementsByTagName('tbody')[0].getElementsByTagName('tr'); |
|
var numTableRaws = tableRaws.length; |
|
|
|
// |
|
// Versucht Header mit Colgroupfilds zu fixieren ohne thead. Funktioniert bisher nur bei Firefox |
|
// |
|
//var header_top=68; |
|
//var header_top_add=0; |
|
// |
|
//var tableHeadersRaws = document.getElementById("table1").getElementsByTagName('thead')[0]; |
|
//var numTableHeadersRaws = tableHeadersRaws.length; |
|
//var tableHeadersCols = document.getElementById("table1").getElementsByTagName('thead')[0].getElementsByTagName('tr'); |
|
//var numTableHeadersCols = tableHeadersCols.length; |
|
//alert("Rows: " + numTableHeadersRaws + "| Cols: " + numTableHeadersCols); |
|
// |
|
|
|
//// for-Schleife über alle Zeilen im HEADER - Wichtig falls Header mehr als eine Zeile hat |
|
//for (var r=0; r < numTableHeadersRaws; r++) { |
|
// for (var h=0; h < numTableHeadersCols; h++) { |
|
// //Tabellenheader Abstand oben |
|
// document.getElementById("table1").getElementsByTagName('thead')[0].getElementsByTagName('tr')[r].getElementsByTagName('th')[h].style.top=header_top + "px"; |
|
// header_top_add=document.getElementById("table1").getElementsByTagName('thead')[0].getElementsByTagName('tr')[0].getElementsByTagName('th')[c].offsetWidth; |
|
// } |
|
// header_top+=header_top_add; |
|
//} |
|
|
|
|
|
//erste for-Schleife über Anzahl der Spalten die mitlaufen sollen |
|
for (var c=0; c < fixedColumnCount_width; c++) |
|
{ |
|
//Überschriften Spalten, die mitlaufen sollen - Abstand links, Ebene und Position setzen |
|
document.getElementById("table1").getElementsByTagName('thead')[0].getElementsByTagName('tr')[0].getElementsByTagName('th')[c].style.left=column_width + "px"; |
|
document.getElementById("table1").getElementsByTagName('thead')[0].getElementsByTagName('tr')[0].getElementsByTagName('th')[c].style.zIndex=5; |
|
document.getElementById("table1").getElementsByTagName('thead')[0].getElementsByTagName('tr')[0].getElementsByTagName('th')[c].style.position="sticky"; |
|
|
|
//zweite (innere) for-Schleife über alle Zeilen (dessen Spalten mitlaufen sollen) |
|
for (var i=0; i < numTableRaws; i++) { |
|
//normale Spalten, die mitlaufen sollen - Abstand links, Hintergrundfarbe, Ebene und Position setzen |
|
document.getElementById("table1").getElementsByTagName('tbody')[0].getElementsByTagName('tr')[i].getElementsByTagName('td')[c].style.left=column_width + "px"; |
|
//eigene Farbgebung raus, statt dessen inherit damit nicht durchscheint und ursprüngliche Farbe erhalten bleibt #293635c7 |
|
//document.getElementById("table1").getElementsByTagName('tbody')[0].getElementsByTagName('tr')[i].getElementsByTagName('td')[c].style.backgroundColor="#c4c4c4"; |
|
document.getElementById("table1").getElementsByTagName('tbody')[0].getElementsByTagName('tr')[i].getElementsByTagName('td')[c].style.backgroundColor="inherit"; |
|
document.getElementById("table1").getElementsByTagName('tbody')[0].getElementsByTagName('tr')[i].getElementsByTagName('td')[c].style.zIndex=3; |
|
document.getElementById("table1").getElementsByTagName('tbody')[0].getElementsByTagName('tr')[i].getElementsByTagName('td')[c].style.position="sticky"; |
|
} |
|
//weite der aktuellen Spalte auslesen |
|
var this_column_width = document.getElementById("table1").getElementsByTagName('thead')[0].getElementsByTagName('tr')[0].getElementsByTagName('th')[c].offsetWidth; |
|
//und dann der Variable für fixen Abstand von links ergänzen |
|
column_width+=this_column_width; |
|
} |
|
} |
|
|
|
function resetValidation() |
|
{ |
|
var el=document.getElementById('validation'); |
|
if(el) |
|
el.innerHTML = ""; |
|
} |
|
|
|
function maske18100check(frm,platform) |
|
{ |
|
var keys = document.getElementById('Ausgabe_des_Berichts').value; |
|
var keysSplit = keys.split("*"); |
|
//alert(keysSplit + '\n' + keysSplit[2]); |
|
document.getElementById('Berichtsart').value=keysSplit[0]; |
|
document.getElementById('tablestylesheet').value=keysSplit[1]; |
|
document.getElementById('Ausgabeformat').value=keysSplit[2]; |
|
var ok1=validateForm(frm,platform); |
|
if(!ok1) |
|
return false; |
|
|
|
return true; |
|
} |
|
|
|
function validiereNeueMaskennr(frm,platform) |
|
{ |
|
var neueNr=frm.elements["Neue tid"].value; |
|
if(neueNr.indexOf("0", neueNr.length - 1) == -1) |
|
{ |
|
var meldung="<p>Achtung: bitte wählen Sie eine Maskennummer, die mit 0 endet. Zu Nummernkreisen "; |
|
if(platform=="his1") |
|
meldung +="siehe <a href='https://wiki.his.de/mediawiki/index.php/Masken_entladen_und_einspielen_-_HISinOne-BI' target='_blank'>Leitfaden</a></p>"; |
|
else |
|
meldung +="siehe <a href='http://www.superx-projekt.de/doku/entwicklung/masken/f_MaskenerstellenausKopien.htm' target='_blank'>Leitfaden</a></p>"; |
|
|
|
document.getElementById('validation').innerHTML = meldung; |
|
|
|
return false; |
|
} |
|
else |
|
{ |
|
return true; |
|
} |
|
}
|
|
|