1 | // ************************************************************************************************************************************************* |
---|
2 | // Libreria de scripts de Javascript |
---|
3 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
4 | // Fecha Creación: 2009-2010 |
---|
5 | // Fecha Última modificación: Agosto-2010 |
---|
6 | // Nombre del fichero: RestaurarSoftIncremental.js |
---|
7 | // Descripción : |
---|
8 | // Este fichero implementa las funciones javascript del fichero RestaurarSoftIncremental.php (Comandos) |
---|
9 | // ************************************************************************************************************************************************* |
---|
10 | function confirmar(){ |
---|
11 | if(comprobar_datos()){ |
---|
12 | var RC="@"; |
---|
13 | // UHU - Ahora puede ser cualquier disco |
---|
14 | var disco; |
---|
15 | var atributos=""; |
---|
16 | var tb_conf=document.getElementById("tabla_conf"); |
---|
17 | var ochecks=tb_conf.getElementsByTagName('INPUT'); |
---|
18 | for(var i=0;i<ochecks.length;i++){ |
---|
19 | if(ochecks[i].checked && ochecks[i].name==="particion"){ |
---|
20 | var idradio=ochecks[i].id; |
---|
21 | var diskPart = ochecks[i].value.split(";"); |
---|
22 | disco =diskPart[0]; |
---|
23 | var numpar= diskPart[1]; |
---|
24 | atributos+="dsk="+disco+RC; // Número de disco |
---|
25 | atributos+="par="+numpar+RC; // Número de partición |
---|
26 | |
---|
27 | var despleimagenizda=document.getElementById("despleimagen_"+idradio+"_1"); |
---|
28 | var despleimagen; |
---|
29 | |
---|
30 | if(despleimagenizda.selectedIndex>0) despleimagen=despleimagenizda; |
---|
31 | |
---|
32 | var imgcanrepo=despleimagen.value.split("_"); |
---|
33 | atributos+="idi="+imgcanrepo[0]+RC; // Identificador de la imagen |
---|
34 | atributos+="nci="+imgcanrepo[1]+RC; // Nombre canónico de la imagen básica |
---|
35 | atributos+="ipr="+imgcanrepo[2]+RC; // Dirección ip del repositorio donde se aloja la imagen |
---|
36 | atributos+="ifs="+imgcanrepo[3]+RC; // Identificador del perfil software |
---|
37 | atributos+="idf="+imgcanrepo[4]+RC; // Identificador de la imagen incremental |
---|
38 | atributos+="ncf="+imgcanrepo[5]+RC; // Nombre canónico de la imagen incremental |
---|
39 | atributos+="rti="+imgcanrepo[6]+RC; // Ruta de origen de la imagen |
---|
40 | |
---|
41 | var desplemet=document.getElementById("desplemet_"+idradio); // Desplegable metodo de restauración |
---|
42 | var p=desplemet.selectedIndex; // Toma índice seleccionado |
---|
43 | atributos+="met="+p+RC; // Método de clonación 0=caché 1=repositorio |
---|
44 | |
---|
45 | desplemet=document.getElementById("desplesync_"+idradio); // Desplegable metodo de syncronización |
---|
46 | p=desplemet.selectedIndex; // Toma índice seleccionado |
---|
47 | atributos+="msy="+p+RC; // Método de clonación |
---|
48 | |
---|
49 | desplemet=document.getElementById("despletpt_"+idradio); // Desplegable metodo de syncronización |
---|
50 | p=desplemet.value; // Toma índice seleccionado |
---|
51 | atributos+="tpt="+p+RC; // Método de transmision |
---|
52 | |
---|
53 | var chrChk=document.getElementById('whl-'+idradio); // Recupera objeto fila de la tabla opciones adicionales |
---|
54 | if(chrChk.checked) atributos+="whl=1"+RC; else atributos+="whl=0"+RC; |
---|
55 | chrChk=document.getElementById('eli-'+idradio); // Recupera objeto fila de la tabla opciones adicionales |
---|
56 | if(chrChk.checked) atributos+="eli=1"+RC; else atributos+="eli=0"+RC; |
---|
57 | chrChk=document.getElementById('cmp-'+idradio); // Recupera objeto fila de la tabla opciones adicionales |
---|
58 | if(chrChk.checked) atributos+="cmp=1"+RC; else atributos+="cmp=0"+RC; |
---|
59 | |
---|
60 | var cc=ochecks[i].getAttribute('idcfg'); // Toma identificador del bloque de configuración |
---|
61 | if(document.fdatosejecucion.ambito.value!=AMBITO_ORDENADORES){ |
---|
62 | var tbOrd=document.getElementById("tbOrd_"+cc); |
---|
63 | var idordenadores=tbOrd.getAttribute('value'); // Toma identificadores de los ordenadores |
---|
64 | var cadenaid=document.fdatos.cadenaid.value; // Cadena de identificadores de todos los ordenadores del ámbito |
---|
65 | if(idordenadores!==cadenaid){ |
---|
66 | document.fdatosejecucion.ambito.value=0; // Ambito de aplicación restringido |
---|
67 | document.fdatosejecucion.idambito.value=idordenadores; |
---|
68 | } |
---|
69 | } |
---|
70 | // Opciones adicionales |
---|
71 | var trObj=document.getElementById('trOpc'); // Recupera objeto fila de la tabla opciones adicionales |
---|
72 | var obChk=trObj.childNodes[3].childNodes[0]; // Recupera objeto checkbox borrar de la Imagen |
---|
73 | if(obChk.checked) atributos+="bpi=1"+RC; else atributos+="bpi=0"+RC; |
---|
74 | obChk=trObj.childNodes[7].childNodes[0]; // Recupera objeto checkbox copiar en cache |
---|
75 | if(obChk.checked) atributos+="cpc=1"+RC; else atributos+="cpc=0"+RC; |
---|
76 | obChk=trObj.childNodes[11].childNodes[0]; // Recupera objeto checkbox borrar la cache |
---|
77 | if(obChk.checked) atributos+="bpc=1"+RC; else atributos+="bpc=0"+RC; |
---|
78 | obChk=trObj.childNodes[15].childNodes[0]; // Recupera objeto checkbox no borrar archivos en destino |
---|
79 | if(obChk.checked) atributos+="nba=1"+RC; else atributos+="nba=0"+RC; |
---|
80 | |
---|
81 | document.fdatosejecucion.atributos.value=atributos; |
---|
82 | filtrado(); |
---|
83 | //alert(atributos) |
---|
84 | document.fdatosejecucion.submit(); |
---|
85 | break; |
---|
86 | } |
---|
87 | } |
---|
88 | } |
---|
89 | } |
---|
90 | //________________________________________________________________________________________________________ |
---|
91 | function cancelar(){ |
---|
92 | alert(CTbMsg[0]); |
---|
93 | location.href="../nada.php" |
---|
94 | } |
---|
95 | //________________________________________________________________________________________________________ |
---|
96 | function comprobar_datos() |
---|
97 | { |
---|
98 | var tb_conf=document.getElementById("tabla_conf"); |
---|
99 | var ochecks=tb_conf.getElementsByTagName('INPUT'); |
---|
100 | var op=0; |
---|
101 | for(var i=0;i<ochecks.length;i++){ |
---|
102 | if(ochecks[i].checked && ochecks[i].name==="particion"){ |
---|
103 | op++; |
---|
104 | var idradio=ochecks[i].id; // Toma idemtificador del desplegable de imagenes |
---|
105 | var despleimagenizda=document.getElementById("despleimagen_"+idradio+"_1"); // Desplegable imagenes. |
---|
106 | var p1=despleimagenizda.selectedIndex; // Toma índice seleccionado |
---|
107 | if (p1===0){ |
---|
108 | alert(TbMsg[0]); |
---|
109 | despleimagenizda.focus(); |
---|
110 | return(false) |
---|
111 | } |
---|
112 | var desplemet=document.getElementById("desplesync_"+idradio); // Desplegable metodo de syncronización |
---|
113 | p1=desplemet.selectedIndex; // Toma índice seleccionado |
---|
114 | if (p1===0){ |
---|
115 | alert(TbMsg[7]); |
---|
116 | desplemet.focus(); |
---|
117 | return(false) |
---|
118 | } |
---|
119 | } |
---|
120 | } |
---|
121 | if(op===0){ |
---|
122 | alert(TbMsg[1]); |
---|
123 | return(false); |
---|
124 | } |
---|
125 | return(comprobar_datosejecucion()) |
---|
126 | } |
---|
127 | |
---|