var undefined; var mounth_values = "1=1,2=2,3=3,4=4,5=5,6=6,7=7,8=8,9=9,10=10,11=11,12=12"; var alfabetic_values = "A=A,B=B,C=C,D=D,E=E,F=F,G=G,H=H,I=I,J=J,K=K,L=L,M=M,N=N,O=O,P=P,Q=Q,R=R,S=S,T=T,U=U,V=V,W=W,X=X,Y=Y,Z=Z"; var mounth_values = "1=1,2=2,3=3,4=4,5=5,6=6,7=7,8=8,9=9,10=10,11=11,12=12,13=13,14=14,15=15,16=16,17=17,18=18,19=19,20=20,21=21,22=22,23=23,24=24,25=25,26=26,27=27,28=28,29=29,30=30,31=31"; var datemsg = new Array ('DC','BIB','CIMI'); datemsg ["DC"] = 'Opere pubblicate/create '; datemsg ["BIB"] = 'Libri pubblicati '; datemsg ["CIMI"] = "Opere d'arte create "; function getselvalue (values,number) { var vals = values.substring(0); var i = 1; for (var indx=vals.indexOf(','); indx > 0; indx=vals.indexOf(',')) { var opt = vals.substring(0,indx); var indx1 = opt.indexOf('='); var tag = opt.substring(0,indx1); var val = opt.substring(indx1+1); if (i == number) return val; i++; vals = vals.substring(indx+1); } var indx1 = vals.indexOf('='); var tag = vals.substring(0,indx1); var val = vals.substring(indx1+1); if (i == number) return val; else return ''; } function print_options (values,selval) { var vals = values.substring(0); for (var indx=vals.indexOf(','); indx > 0; indx=vals.indexOf(',')) { var opt = vals.substring(0,indx); var indx1 = opt.indexOf('='); var tag = opt.substring(0,indx1); var val = opt.substring(indx1+1); if (selval != undefined && selval != '' && selval == val) self.document.write (''); else self.document.write (''); vals = vals.substring(indx+1); } var indx1 = vals.indexOf('='); var tag = vals.substring(0,indx1); var val = vals.substring(indx1+1); if (selval != undefined && selval != '' && selval == val) self.document.write (''); else self.document.write (''); } function print_ac_options (obj,selnum) { if (obj.values != '' && obj.values != undefined) { print_options(obj.values); return; } var type = obj.type; if (type.indexOf('=') != -1) type = type.substring(0,type.indexOf('=')); var obj1 = nick2cat(mycategory); if (type == 'field') print_options( obj1.fieldaccess,getselvalue(obj1.fieldaccess,selnum)); else print_options( obj1.listaccess); } function print_ac_radio (name,obj) { if (obj.values != '' && obj.values != undefined) { print_radio_options(name,obj.values); return; } var type = obj.type; if (type.indexOf('=') != -1) type = type.substring(0,type.indexOf('=')); var obj1 = nick2cat(mycategory); if (type == 'field') print_radio_options(name, obj1.fieldaccess); else print_radio_options(name, obj1.listaccess); } function print_radio_options (name,vals,selval) { if (selval == undefined) selval =''; var flag = 1; self.document.write("\n'); for (var indx=vals.indexOf(','); indx > 0; indx=vals.indexOf(',')) { var opt = vals.substring(0,indx); var indx1 = opt.indexOf('='); var tag = opt.substring(0,indx1); var val = opt.substring(indx1+1); if (selval != '' && selval == val) self.document.write (''+tag+' \n'); else self.document.write (''+tag+' \n'); vals = vals.substring(indx+1); } var indx1 = vals.indexOf('='); var tag = vals.substring(0,indx1); var val = vals.substring(indx1+1); if (selval != undefined && selval != '' && selval == val) self.document.write (''+tag+'\n'); else self.document.write (''+tag+'\n'); } function nick2access (nick) { for (var i=0; i< access.length; i++) { if (access[i].nick == nick) return access[i] } return ''; } function print_access (name) { obj = nick2access(name); var type = obj.type; if (!check_filter(obj)) return; if (obj.filter == '1' && obj.title != "") { if (filteroneline == '1') self.document.write (''+obj.title+':  '); else self.document.write (''+obj.title+':  '); } if ( type.indexOf('select') != -1) { var multi = ''; if ( type.indexOf('multipleselect') != -1) multi = 'multiple size=3'; self.document.write (''); } if ( type.indexOf('text') != -1 ) { var size = type.substring(type.indexOf('=')+1,type.indexOf(',')); var maxsize = type.substring(type.indexOf(',')+1); if (size != '') size = ' size='+size; if (maxsize != '') maxsize = ' maxsize='+maxsize; self.document.write (''); } if ( type.indexOf('radio') != -1) print_radio_options(name,obj.values); if ( type.indexOf('year') != -1 ) self.document.write (''); if ( type.indexOf('date') != -1 ) { self.document.write (''); self.document.write (''); self.document.write (''); } if ( type.indexOf('free') != -1) { var size = type.substring(type.indexOf('=')+1,type.indexOf(',')); var maxsize = type.substring(type.indexOf(',')+1); if (size != '') size = ' size='+size; if (maxsize != '') maxsize = ' maxsize='+maxsize; self.document.write (''); if (obj.option == 'select') { self.document.writeln (''); } else { if (obj.option == 'radio') { self.document.write ('
'); print_radio_options(name+"_struct",option_values,'@and@') self.document.write (''); } } } if ( type.indexOf('list') != -1) { if (obj.option == 'select') { self.document.writeln (''); } else { self.document.write (''); print_ac_radio(name+'_ac',obj); self.document.write (''); } if (type.indexOf('lett') == -1) { var size = type.substring(type.indexOf('=')+1,type.indexOf(',')); var maxsize = type.substring(type.indexOf(',')+1); if (size != '') size = ' size='+size; if (maxsize != '') maxsize = ' maxsize='+maxsize; self.document.write (''); } else { self.document.write (''); } } if ( type.indexOf('field') != -1) { var num = type.substring(type.indexOf('=')+1,type.indexOf(',')); type = type.substring(type.indexOf(',')+1); for (var i=1; i<=num; i++) { self.document.writeln (''); var size = type.substring(0,type.indexOf(',')); var maxsize = type.substring(type.indexOf(',')+1); if (size != '') size = ' size='+size; if (maxsize != '') maxsize = ' maxsize='+maxsize; self.document.write (''); if (obj.option == 'select') { self.document.writeln (''); } else { self.document.write ('
'); print_radio_options(name+"_struct"+i,option_values,'@and@') self.document.write (''); } if (i != num) { self.document.writeln (''); } self.document.write (''); } } if(obj.filter == 1 && obj.title != "") { if(filteroneline != '1') self.document.write (''); else self.document.write (''); } } function replace_char (str,ch,newch) { var res = ""; for (var s=str.indexOf(ch); s > 0; s=str.indexOf(ch)) { res = res + str.substring(0, s) + newch; str = str.substring(s+ch.length); } res = res + str; return res; } function replace_amp (str) { var res = ""; for (var s=str.indexOf("&"); s >= 0; s=str.indexOf("&")) { res = res + str.substring(0, s) + "%26"; str = str.substring(s+1); } res = res + str; return res; } function replace_space (str) { var res = ""; for (var s=str.indexOf(" "); s >= 0; s=str.indexOf(" ")) { res = res + str.substring(0, s) + "+"; str = str.substring(s+1); } res = res + str; return res; } var UsedStopWords = new Array ('A','AD','AI','AL','ALL','ALLA','ALLE','ALLO','B','C','CI','COL','CON','D', 'DA','DAGLI','DAI','DAL','DALL','DALLA','DALLE','DALLO','DE','DEGLI','DEL','DELL','DELLA','DELLE','DELLO','DI','E','ED','ET','F','FRA','G','GLI','H','J','K','I','IL', 'IN','L','LA','LE','LO','M','ME','MI','N','NE','NEGLI','NEL','NELL','NELLA','NELLO','O','OPPURE','P','PER','Q','R','S','SI','SU','SUI','SUGLI','SUL', 'SULL','SULLA','SULLE','T','TE','TI','TRA','U','UN', 'UNA','UNO','V','VI','X','Y','Z', 'THE','OF','TO','AND','IN','THAT','FOR','BY','AS','BE','OR','THIS','WHICH','WITH','AT','AN','FROM','UNDER','SUCH','THERE','OTHER','IF','BUT','UPON','WHERE','THESE','WHEN','WHETHER','ALSO','THAN','AFTER','WITHIN','BEFORE','BECAUSE','WITHOUT','HOWEVER','BETWEEN','THOSE','SINCE','INTO','OUT','WE','SAW','WERE','WHO','MORE','THAN','THEIR','BIG','A','ALL','OVER','THEY','INTO','THEM'); function search_list (term, List) { for (var i=0; i < List.length; i++) { if ((term. toUpperCase()) == ((List[i]).toUpperCase())) return 1; } return 0; } function all_stops (query) { var result = ""; if (query.indexOf(' ') == (-1)) return search_list(query,UsedStopWords); while ((i= query.indexOf(' ')) != -1) { el = query.substring (0, i); query = query.substring (i+1); if (!search_list(el, UsedStopWords)) return 0; } return 1; } function remove_stops (query) { var result = ""; while ((i= query.indexOf(' ')) != -1) { el = query.substring (0, i); query = query.substring (i+1); if (!search_list(el, UsedStopWords)) { if (result == "") result = el; else result = result + " " + el; } } if (query && !search_list(query, UsedStopWords)) { if (result == "") result = query; else result = result + " " + query; } return result; } function subfield (query, use, match, check, more_tg) { var result = ""; var paren; if (query == "") return result; if (match.indexOf("4=") >= 0 ) { if ((!check || all_stops(query)) == 0) result = "(5=100 " + more_tg + use + " " + match + ' "' + query + '")'; else result =""; return result; } if (query.indexOf(" ") != -1) { if (check) query = remove_stops(query); if (query == "") return query; while ( (i= query.indexOf(' ')) != -1) { el = query.substring (0, i); query = query.substring (i+1); if (el.indexOf('*') >0) el = " 5=1 4=2 " + more_tg + '"' + el.substring(0,el.indexOf('*')) + '"'; else el = ' 4=2 5=100 "' + more_tg + el + '"'; if (result == "") { result = '(' + use + ' ' + el + ') '; paren = 0; } else { result = result + match + ' ('+ use + ' ' + el + ') '; paren = 1; } } if (paren == 1) { result = '(' + result + ')'; } if (query) { if (query.indexOf('*') >0) query = " 5=1 4=2 " + more_tg + '"' + query.substring(0,el.indexOf('*')) + '"'; else query = ' 4=2 5=100 "' + more_tg + query + '"'; if (result == "") { result = '(' + use + ' ' + query + ') '; paren = 0; } else { result = result + match + ' (' + use + ' ' + query + ') '; paren = 1; } if (paren == 1) result = '(' + result + ')'; } } else { if (search_list(query, UsedStopWords)) result = ""; else { if (query.indexOf('*') > 0) result = use + ' 5=1 4=2 "' + more_tg + query.substring(0,query.indexOf('*')) + '"'; else result = use + ' 4=2 5=100 "' + more_tg + query + '"'; } } return result; } function txtsubfield (name,num, check) { var use = eval("document.AccessF."+name+"_ac"+num); var str = eval("document.AccessF."+name+"_"+num+".value"); use = use2txt(name,'field',use.options[use.selectedIndex].value); if (check) str = remove_stops(str); if (str == "") return ""; var res = "" + use + " = \"" + str + "\""; return res; } function check_input (ckStr, ckOK) { if (ckStr.length > 0) { var ok = true; for (i=0; i < ckStr.length; i++) { for (j=0; j < ckOK.length; j++) if (ckStr.charAt(i) == ckOK.charAt(j)) { ok = true; break; } else ok=false; if (!ok) break; } if (!ok){ return (false); } } return (true); } function isLegalyear (value) { if (!(value.length <= 4)) return false; return check_input(value,"0123456789"); } function isLegalmonth (value) { if (!(value.length <= 2)) return false; if (!check_input(value,"0123456789")) return false; var num = eval(value); if (num > 12 || num < 1) return false; return true; } function isLegalday (value) { if (!(value.length <= 2)) return false; if (!check_input(value,"0123456789")) return false; var num = eval(value); if (num > 31 || num < 1) return false; return true; } function isLegalDate (year, month, day) { if (!(isLegalyear(year))) return false; if (!(isLegalmonth(month))) return false; if (!(isLegalday(day))) return false; return true; } function isLegalRangeDate (y1, m1, d1, y2, m2, d2) { var res = ""; if (y1 != "" && m1 != "" && d1 != "") { if (isLegalDate(y1, m1, d1)) { res = y1+"-"+m1+"-"+d1 ; low = eval(y1); if (y2 != "" || m2 != "" || d2 != "") { if (isLegalDate(y2,m2,d2)){ res = res + ":" + y2+"-"+m2+"-"+d2; up = eval(y2); } else { alert ("Errore: la data di fine intervallo non è corretta."); return ""; } } else{ if (y2 == "" && m2 == "" && d2 == "") return res; alert ("Errore: la data di fine intervallo non è corretta."); return ""; } } else { alert ("Errore: la data di inizio intervallo non è corretta."); return ""; } } else { if (y1 == "" && m1 == "" && d1 == "") { if (y2 != "" || m2 != "" || d2 != "") { if (isLegalDate(y2,m2,d2)){ res = res + ":" + y2+"-"+m2+"-"+d2; return res; } else { alert ("Errore: la data di fine intervallo non è corretta."); return ""; } } } alert ("Errore: la data di inizio intervallo non è corretta."); return ""; } if (low > up){ alert ("Errore: data di inizio successiva alla data di fine intervallo."); return ""; } else { if (low == up) { low = eval(m1); up = eval (m2); if (low > up){ alert ("Errore: data di inizio successiva alla data di fine intervallo."); return ""; } else { if (low == up) { low = eval(d1); up = eval (d2); if (low > up){ alert ("Errore: data di inizio successiva alla data di fine intervallo."); return ""; } } } } } return res; } function isLegalRangeYear (v1, v2) { var res = ""; if (v1 != "") if (isLegalyear(v1)) { res = v1; low = eval(v1); if (v2 != "") if (isLegalyear(v2)){ res = res + ":" + v2; up = eval(v2); } else { alert ("L'anno di fine dell'intervallo è errato"); return ""; } else{ res = res + ":3000"; up = 3000; } } else { alert ("L'anno di inizio dell'intervallo è errato"); return ""; } else { res = "0"; low = 0; if (v2 != "") if (isLegalyear(v2)){ res = res + ":" + v2; up = eval(v2); } else { alert ("L'anno di fine dell'intervallo è errato"); return ""; } else{ res = res + ":3000"; up = 3000; } } if (low > up){ alert ("L'intervallo definito è inconsistente."); return ""; } return res; } function rangedate (datada,dataa,onlyyear,use,more_tg) { var m1 =''; var m2 = ''; var d1 = ''; var d2 = ''; var result = ""; var op = "@and@"; var y1 = eval("self.document.AccessF."+datada+"y.value"); var y2 = eval("self.document.AccessF."+dataa+"y.value"); if (onlyyear == '0') { m1 = eval("self.document.AccessF."+datada+"m"); m1 = m1.options[m1.selectedIndex].value; d1 = eval("self.document.AccessF."+datada+"d"); d1 = d1.options[d1.selectedIndex].value; m2 = eval("self.document.AccessF."+dataa+"m"); m2 = m2.options[m2.selectedIndex].value; d2 = eval("self.document.AccessF."+dataa+"d"); d2 = d2.options[d2.selectedIndex].value; } if ((y1 != "") || (m1 != "") || (d1 != "") || (y2 != "") || (m2 != "") || (d2 != "")) { if (onlyyear == '0') range=isLegalRangeDate(y1, m1,d1, y2,m2,d2); else range=isLegalRangeYear(y1, y2); if (range == "") return "errore"; s1 = range.indexOf(":"); if (s1 >= 0) { da = range.substring(0,s1); a = range.substring(s1+1); } else { da = range; a = ""; } if(more_tg.indexOf('2=') != -1) more_tg = more_tg.substring(0,more_tg.indexOf('2=')) + more_tg.substring(more_tg.indexOf('2=')+3); if (da != "") { result = '(' + use + '2=4 4=4 ' + more_tg + da + ') ';} if (a != "") { if (result) result = result + " " + op; result = result + ' (' + use + ' 2=2 4=4 ' + more_tg + a + ') ';} } return result; } function txtrangedate (dataz,nameda,namea,flag) { var m1 = ''; var m2 = ''; var d1 = ''; var d2 = ''; var y1 = eval("self.document.AccessF."+nameda+"y.value"); var y2 = eval("self.document.AccessF."+namea+"y.value"); if (flag != '1') { m1 = eval("self.document.AccessF."+nameda+"m"); m1 = m1.options[m1.selectedIndex].value; d1 = eval("self.document.AccessF."+nameda+"d"); d1 = d1.options[d1.selectedIndex].value; m2 = eval("self.document.AccessF."+namea+"m"); m2 = m2.options[m2.selectedIndex].value; d2 = eval("self.document.AccessF."+namea+"d"); d2 = d2.options[d2.selectedIndex].value; } if ((y1 != "") || (m1 != "") || (d1 != "") || (y2 != "") || (m2 != "") || (d2 != "")) { if (y1 != "" || m1 != "" || d1 != "") dataz = dataz + " dal " + y1 + " " + m1 + " " + d1 + " "; if (y2 != "" || m2 != "" || d2 != "") dataz = dataz + " al " + y2 + " " + m2 + " " + d2 + " "; } return dataz; } function txtfield (name,num) { var result = ""; var operator1 =""; for (var i = 1; i <= num; i++) { var opt = txtsubfield(name,i,stopwords); if ((opt != "") && (result =="")) result = opt; else { if (opt != "") result = result + " " + operator1 + " " + opt; } if (i != num) { operator1 = eval("document.AccessF."+name+"_operator"+i); operator1 = operator1.options[operator1.selectedIndex].value; if (operator1 == "@and@") operator1 = "e"; if (operator1 == "@or@") operator1 = "o"; if (operator1 == "@andnot@") operator1 = "e non"; } } return result; } function getfield(name,num,flag) { var query=''; var op=''; var result = ''; for (var i=1; i <= num; i++) { var use = eval("document.AccessF."+name+"_ac"+i); use = use.options[use.selectedIndex].value; use = '1='+ use; var struct = ''; if ( flag == 'radio') struct = getradio(name+"_struct"+i); else { struct = eval("document.AccessF."+name+"_struct"+i); struct = struct.options[struct.selectedIndex].value; } var str = eval("document.AccessF."+name+"_"+i+".value"); var opt = subfield (str,use,struct,stopwords,explicitz3950); if ((opt != "") && (result == "")) result = '(' + opt + ')'; else { if (opt != "") result = result + " " + op + " (" + opt + ')'; } if (i != num) { op = eval("document.AccessF."+name+"_"+"operator"+i); op = op.options[op.selectedIndex].value; } } return result; } function getselect (name,use) { var op = eval("self.document.AccessF."+name); var value = op.options[op.selectedIndex].value; if (value) value = " (" + use + "4=2 5=100 " + explicitz3950 + "\"" + value + "\")"; return value; } function getmultiselect (name,use) { var op = eval("self.document.AccessF."+name); var result = ''; for (i=0;i< op.length;i++) { if (op.options[i].selected) { if (op.options[i].value) { if (result) result = result + ' @or@ (' + use + " 4=2 5=100 " + explicitz3950 + "\"" + op.options[i].value + "\")"; else result = '(' + use + " 4=2 5=100 " + explicitz3950 + "\"" + op.options[i].value + "\")"; } } } if (result) result = '(' + result + ')'; return result; } function getradio (name) { for (var i = 0; i < self.document.AccessF.elements.length; i++) { if((document.AccessF.elements[i].name.indexOf (name) != (-1)) && (document.AccessF.elements[i].checked)) return document.AccessF.elements[i].value; } return ''; } function txtmultiselect (name,title) { var op = eval("self.document.AccessF."+name); var result = ''; for (i=0;i< op.length;i++) { if (op.options[i].selected) { if (op.options[i].value) { value = value2txt(name,op.options[i].value); if (result) result = result + "," + value + ""; else result = "" + title + " = " + value + ""; } } } if (result) result = '(' + result + ')'; return result; } function txtselect (name,title) { var op = eval("self.document.AccessF."+name); var value = op.options[op.selectedIndex].value; if (value) { value = value2txt(name,value); value = "" + title + " = " + value + ""; } return value; } function gettext (name,use,struct) { var value = eval("self.document.AccessF."+name+".value"); return subfield (value,use,struct,stopwords,explicitz3950); } function txttext (name,title) { var value = eval("self.document.AccessF."+name+".value"); if (value) value = "" + title + " = " + value + ""; return value; } function free_submit (name, resultform , forceresult, templatenm,nodbs) { if (name == '') name = 'free'; var struct = '@and@'; var obj = nick2access(name); var flag = obj.option; var str = ''; if (nodbs == '' || nodbs == '0') str = dbselected(-1); if (resultform == '1') { if (str != '' && str.indexOf('@') == -1) { if (forceresult == '1') form = self.document.result; else form = self.document.records; } else form = self.document.result; } else form = self.document.records; if ( flag == 'radio') struct = getradio(name+"_struct"); if (flag == 'select') { struct = eval("document.AccessF."+name+"_struct"); struct = struct.options[struct.selectedIndex].value; } form.request.value = gettext(name,'1=1016',struct); if (form.request.value == "") { alert("Inserire almeno una parola chiave."); return false; } form.address.value = str; form.visrequest.value = txttext (name,'Any (qualsiasi termine)'); form.template.value = templatenm; if (document.AccessF.target != '') form.target = document.AccessF.target; form.submit(); return false; } function list_submit (name,nodbs) { if (name == '') name = 'list'; var obj = nick2access(name); var type = obj.type; var opt = obj.option; var val = ''; var database = ''; if (nodbs == '' || nodbs == '0') { database = dbselected(-1); if (database == "") return false; } if (opt.indexOf('select') != -1) { use = eval("document.AccessF."+name+"_ac"); use = use.options[use.selectedIndex].value; } else use = getradio(name+"_ac"); if (type.indexOf('lett') == -1) val = eval("document.AccessF."+name+".value"); else { val = eval("document.AccessF."+name); val = val.options[val.selectedIndex].value; } if (val == "") { alert("Inserire almeno una parola chiave."); return false; } // convert use to the correct profile if the category profile is DC var profile = getcatprofile(); if (profile == 'DC' && database.indexOf('@') == -1) use1 = convert_use (use, getdbprofile (database)); else use1 =use; document.list.request.value = "1=" + use1 + ' 4=2 ' + val; var txtuse = use2txt(name,'list',use); document.list.visrequest.value = "" + txtuse + " = " + val + ""; document.list.address.value = database; document.list.submit(); return false; } function convert_use (use,profile) { // inserire tabelle conversione profilo var tabellaBIB = new Array (2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,1098,1097,1098,1099,1100,1101,1102,1103,1004,1105,1106,1107,1108,1109,1110,1111); tabellaBIB[2051] = 4; tabellaBIB[2052] = 1003; tabellaBIB[2053] = 21; tabellaBIB[2054] = 62; tabellaBIB[2055] = 1018; tabellaBIB[2056] = 1003; tabellaBIB[2057] = 31; tabellaBIB[2058] = 1031; tabellaBIB[2059] = 1107; tabellaBIB[2060] = 1032; tabellaBIB[2061] = 1108; tabellaBIB[2062] = 54; tabellaBIB[2063] = 1109; tabellaBIB[2064] = 1110; tabellaBIB[2065] = 1111; tabellaBIB[1097] = 4; tabellaBIB[1098] = 1003; tabellaBIB[1099] = 21; tabellaBIB[1100] = 62; tabellaBIB[1101] = 1018; tabellaBIB[1102] = 31; tabellaBIB[1103] = 1031; tabellaBIB[1104] = 1032; tabellaBIB[1105] = 54; tabellaBIB[1106] = 1003; // tabellaBIB[1107] = 1107; // tabellaBIB[1108] = 1108; // tabellaBIB[1109] = 1109; // tabellaBIB[1110] = 1110; // tabellaBIB[1111] = 1111; var tabellaCIMI = new Array (2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,1098,1097,1098,1099,1100,1101,1102,1103,1004,1105,1106,1107,1108,1109,1110,1111); tabellaCIMI[1097] = 2033; tabellaCIMI[1098] = 2035; tabellaCIMI[1099] = 2040; tabellaCIMI[1100] = 2054; tabellaCIMI[1101] = 2055; tabellaCIMI[1102] = 2022; tabellaCIMI[1103] = 2032; tabellaCIMI[1104] = 2060; tabellaCIMI[1105] = 2062; tabellaCIMI[1106] = 2056; tabellaCIMI[1107] = 2059; tabellaCIMI[1108] = 2061; tabellaCIMI[1109] = 2063; tabellaCIMI[1110] = 2064; tabellaCIMI[1111] = 2065; var tabella = eval("tabella"+profile); if (tabella[use] != '') return tabella[use]; else return use; } function value2txt (name,use) { if (use.indexOf('1=') != -1) use = use.substring(use.indexOf('1=')+2); obj = nick2access(name); accesspt = obj.values; while (accesspt.length > 0){ var indx = accesspt.indexOf(','); var opt = ''; if (indx != -1) { opt = accesspt.substring(0,indx); accesspt = accesspt.substring(indx+1); } else { opt = accesspt; accesspt = ''; } indx = opt.indexOf('='); var tag = opt.substring(0,indx); var val = opt.substring(indx+1); if (val == use) return tag; } return ''; } function use2txt (name,type,use) { if (use.indexOf('1=') != -1) use = use.substring(use.indexOf('1=')+2); if (mycategory != '') { obj = nick2cat(mycategory); if (type == 'field') accesspt = obj.fieldaccess; else accesspt = obj.listaccess; } else { obj = nick2access(name); accesspt = obj.values; } while (accesspt.length > 0){ var indx = accesspt.indexOf(','); var opt = ''; if (indx != -1) { opt = accesspt.substring(0,indx); accesspt = accesspt.substring(indx+1); } else { opt = accesspt; accesspt = ''; } indx = opt.indexOf('='); var tag = opt.substring(0,indx); var val = opt.substring(indx+1); if (val == use) return tag; } return ''; } function txt2use (name,type,txt) { var accesspt = ''; if (mycategory != '') { obj = nick2cat(mycategory); accesspt = obj.filteraccess; } else { obj = nick2access(name); accesspt = obj.values; } while (accesspt.length > 0){ var indx = accesspt.indexOf(','); var opt = ''; if (indx != -1) { opt = accesspt.substring(0,indx); accesspt = accesspt.substring(indx+1); } else { opt = accesspt; accesspt = ''; } indx = opt.indexOf('='); var tag = opt.substring(0,indx); var val = opt.substring(indx+1); if (tag == txt) return val; } return ''; } function field_submit (op,resultform, forceresult, templatenm,nodbs) { var yearto = ''; var yearfrom = ''; var dateto = ''; var datefrom = ''; var str = ''; if (op == '') op = '@and@'; if (op == '@and@') optxt = 'e'; else optxt = 'o'; var filterset = 0; var acset = 0; var query = ''; var querytxt = ''; for (var jj=0; jj < access.length; jj++) { var opt = ''; var type = access[jj].type; var nick = access[jj].nick; var title = access[jj].title; if (!check_filter(access[jj])) continue; if ( type.indexOf('select') != -1) { use = "1=" + txt2use(nick,'filter',title) + ' '; if ( type.indexOf('multipleselect') != -1) { opt = getmultiselect(nick, use); if (opt) opttxt = txtmultiselect(nick, title); } else { opt = getselect(nick, use); if (opt) opttxt = txtselect(nick, title); } } if ( type.indexOf('text') != -1) { use = "1=" + txt2use(nick,'filter',title) + ' '; opt = gettext(nick, use,'@and@'); if (opt != '') { opt = '(' + opt + ')'; opttxt = txttext(nick, title); } } if ( type.indexOf('year') != -1) { if ( type.indexOf('from') != -1) yearfrom= access[jj]; else { if ( type.indexOf('to') != -1) yearto= access[jj]; } } if ( type.indexOf('date') != -1) { if ( type.indexOf('from') != -1) datefrom= access[jj]; else { if ( type.indexOf('to') != -1) dateto= access[jj]; } } if ( type.indexOf('field') != -1) { num = type.substring(type.indexOf('=')+1,type.indexOf(',')); opt = getfield(nick,num, access[jj].option); if (opt) opttxt = txtfield(nick, num); } if ( type.indexOf('radio') != -1) { use = '1=' + txt2use(nick,'filter',title) + ' '; opt = getradio(nick); if (opt) { opttxt = "" + title + " = " + opt + ""; opt = " (" + use + " 4=2 5=100 " + explicitz3950 + "\"" + opt + "\")"; } } if ( type.indexOf('free') != -1) continue; if ( type.indexOf('list') != -1) continue; if (opt != '') { if(access[jj].filter == '1') filterset = 1; else acset = 1; if (query) { query = query + ' ' + op + ' '; querytxt = querytxt + ' ' + optxt + ' '; } query = query + opt; querytxt = querytxt + opttxt; } } if (yearfrom != '' || yearto != '') { profile = getcatprofile(); if (profile == 'DC') use = "1=" + '1102' + ' '; else use = "1=" + convert_use('1102',profile) + ' '; var opt = rangedate (yearfrom.nick,yearto.nick,1,use,explicitz3950); if (opt) { if(yearfrom.filter) filterset = 1; else acset = 1; opttxt = txtrangedate(datemsg[profile],yearfrom.nick,yearto.nick,1) if (query) { query = query + ' ' + op + ' '; querytxt = querytxt + ' ' + optxt + ' '; } query = query + opt; querytxt = querytxt + opttxt; } } if (datefrom != '' || dateto != '') { profile = getcatprofile(); if (profile == 'DC') use = '1102'; else use = convert_use('1102',profile); opt = rangedate (datefrom.nick,dateto.nick,0,use,explicitz3950); if (opt != '') { if(datefrom.filter) filterset = 1; else acset = 1; opttxt = txtrangedate(datemsg[profile],datefrom.nick,dateto.nick,1) if (query) { query = query + ' ' + op + ' '; querytxt = querytxt + ' ' + optxt + ' '; } query = query + opt; querytxt = querytxt + opttxt; } } if (acset == 0) { alert("Nessun campo del modulo di ricerca risulta riempito. Per avviare la\ ricerca è necessario inserire almeno un termine."); return false; } if ( query == "") { alert("Inserire almeno un termine significativo!."); return false; } if (nodbs == '' || nodbs == '0') str = dbselected(-1); // if (!str ) // return false; if (resultform == '1') { if (str != '' && str.indexOf('@') == -1) { if (forceresult == '1') form = self.document.result; else form = self.document.records; } else form = self.document.result; } else form = self.document.records; form.address.value = str; form.request.value = query; if (templatenm) form.name.value = templatenm; form.visrequest.value = querytxt; form.submit(); return false; } function print_sort_options (name,selvalue) { if (name != '') { obj = nick2object(name); if (obj == undefined || obj == '' || obj.sortaccess == undefined || obj.sortaccess == '') obj = categories[categories.length-1]; } else obj = categories[categories.length-1]; vals = obj.sortaccess; print_options(vals,selvalue); } function check_filter(obj) { if (obj.filter == '1') { var dep = obj.dependence; if (!dep || dep == undefined) return true; if (dep.indexOf('category') != -1) { val = dep.substring(dep.indexOf(':')+1); while (val.length > 0) { if (val.indexOf(',') == -1) { cat = val; val = ''; } else { cat = val.substring(0,val.indexOf(',')); val = val.substring(val.indexOf(',')+1); } if (cat == mycategory) return true; } return false; } else { if (nick2object(dep)) return true; else return false; } } return true; } function badImage (img) { img.src = "/metaeasy/images/quadro_b.gif"; }