jquery.pg.hrefProtocollo.js 3.77 KB
Newer Older
Admin CED's avatar
Admin CED committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
/**	
 * Realizzato per integrazione Autovie 
 * Addizione dei link sui campi che rappresentano il numero Protocollo
 *  href="javascript:consultaDocumentiArchiflow(nomeCampoProtocolloGenerico,'nomeCampoProtocolloSpecifico);"
 *  
 */
	
	function addHrefs() {
		 $.each(arrayCampiProtocollo,function( index, value ) {
			var arraySimili = $("input[name^='" + value.entita + '_' + value.campo + "']");
			var nomeFisico = value.entita + '_' + value.campo;
			$.each(arraySimili,function( index, value ) {
			 if($(this).val()!=""){
				var _span = $("<span/>");
				_span.css("float", "right");
				_span.css("vertical-align", "top");
				var _href = "javascript:consultaDocumentiArchiflow('" + nomeFisico + "','"+ $(this).attr('name') + "');";
				var _a = $("<a/>",{"text": "Consulta protocollo", "href": _href});
				_span.append(_a);
				_span.appendTo($("#" + $(this).attr('name') + "view").parent());
			 } 
			});				
		 });				
	};
	

	function consultaDocumentiArchiflow(campoProtocollo,campoSpecProtocollo) {
		var valoreProtocollo = $("[name='"+campoSpecProtocollo+"']").val();
		if(valoreProtocollo!=null){
			var par = "campoProtocollo=" + campoProtocollo;
			valoreProtocollo=$.trim(valoreProtocollo);
			par += "&valoreProtocollo=" + valoreProtocollo;
			openPopUpActionCustom(contextPath + "/pg/ConsultaDocumentiArchiflow.do", par, "ConsultaDocumentiArchiflow",700,700,"yes","yes");
		}else{
			alert("Valorizzare il numero protocollo!");
		}
	};

	
	var arrayCampiProtocollo = 
		[
		 {"entita" : "TORN",          "campo" : "NPROAT"       	},
		 {"entita" : "TORN",          "campo" : "NPNOMINACOMM"	},
		 {"entita" : "TORN",          "campo" : "NPROTI"       	},
		 {"entita" : "GARATT",        "campo" : "NPROAT"      	},
		 {"entita" : "GARE",     	  "campo" : "NPROAG"        },
		 {"entita" : "GARE",          "campo" : "NVPROV"      	},
		 {"entita" : "GARE",          "campo" : "NPROREQ"      	},
		 {"entita" : "GARE",          "campo" : "NCOMAG"       	},
		 {"entita" : "GARE",          "campo" : "NCOMNG"       	},
		 {"entita" : "GARE",          "campo" : "NCOMDITTAGG" 	},
		 {"entita" : "GARE",          "campo" : "NCOMDITTNAG"  	},
		 {"entita" : "GARE1",         "campo" : "NPLETTAGGPROVV"},
		 {"entita" : "GARE1",		  "campo" : "NRICHNOMINAMIT"},
		 {"entita" : "GARE1",         "campo" : "NPRAPAGG"      },
		 {"entita" : "GARE1",         "campo" : "NPLETCOM"      },
		 {"entita" : "GAREIDS",       "campo" : "NPROT"      	},
		 {"entita" : "GARSED",        "campo" : "NUMVERB"   	},
		 {"entita" : "GARSED",        "campo" : "NPROTRICONV"   },
		 {"entita" : "GARSED",        "campo" : "NPRVERB"       },
		 {"entita" : "DITG",          "campo" : "NPROFF"        },
		 {"entita" : "DITG",          "campo" : "NPROTG"        },
		 {"entita" : "DITG",          "campo" : "NPLETTRICHGIU" },
		 {"entita" : "DITG",          "campo" : "NPRICEZGIU"    },
		 {"entita" : "DITGSTATI",     "campo" : "NPLETTCOMESCL" },
		 {"entita" : "DITGSTATI",     "campo" : "NPLETTRICHCC"  },
		 {"entita" : "DITGSTATI",     "campo" : "NPPRESDOC"     },
		 {"entita" : "GARESTATI",     "campo" : "NPLETTCOMESCLOFEC"},
		 {"entita" : "GARECONT",      "campo" : "NPROPO"  	    },
		 {"entita" : "GARECONT",      "campo" : "NPROAT"  	    },
		 {"entita" : "GARECONT",      "campo" : "NSVIPO"  	    },
		 {"entita" : "XGARECONT",     "campo" : "XGAREACCNU"  	},
		 {"entita" : "XGARECONT",     "campo" : "XGARESUBPR"  	},
		 {"entita" : "XGARECONT",     "campo" : "XGARESUBP1"  	},
		 {"entita" : "XGARECONT",     "campo" : "XGARESUBNA"  	},
		 {"entita" : "XGARECONT",     "campo" : "XGAREATTA2"  	},
		 {"entita" : "XGARECONT",     "campo" : "XGAREATTAGGPROT"},
		 {"entita" : "XGARECONT",     "campo" : "XGAREPROTCONTRATTO"},
		 {"entita" : "PUBBLI",        "campo" : "NPRPUB"        },
		 {"entita" : "PUBG",          "campo" : "NPRPUB"        }
		];