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: CrearImagen.js |
---|
7 | // Descripción : |
---|
8 | // Este fichero implementa las funciones javascript del fichero CrearImagen.php (Comandos) |
---|
9 | // ************************************************************************************************************************************************* |
---|
10 | function confirmar() |
---|
11 | { |
---|
12 | if (!comprobar_datos()) return; |
---|
13 | |
---|
14 | var RC="@"; |
---|
15 | // UHU - Ahora puede ser cualquier disco |
---|
16 | var disco; |
---|
17 | var atributos=""; |
---|
18 | |
---|
19 | var tb_conf=document.getElementById("tabla_conf"); |
---|
20 | var ochecks=tb_conf.getElementsByTagName('INPUT') |
---|
21 | for(var i=0;i<ochecks.length;i++){ |
---|
22 | if(ochecks[i].checked){ |
---|
23 | var parcod=ochecks[i].value.split("_"); |
---|
24 | atributos+="dsk="+parcod[0]+RC; // Número de disco |
---|
25 | atributos+="par="+parcod[1]+RC; // Número de partición |
---|
26 | atributos+="cpt="+parcod[2]+RC; // Código de partición |
---|
27 | |
---|
28 | var despleimagen=document.getElementById("despleimagen_"+parcod[0]+"_"+parcod[1]); |
---|
29 | var imgcan=despleimagen.value.split("_"); |
---|
30 | atributos+="idi="+imgcan[0]+RC; // Identificador de la imagen |
---|
31 | atributos+="nci="+imgcan[1]+RC; // Nonbre canónico |
---|
32 | |
---|
33 | var desplerepositorios=document.getElementById("desplerepositorios_"+parcod[0]+"_"+parcod[1]); |
---|
34 | var idx=desplerepositorios.selectedIndex; |
---|
35 | atributos+="ipr="+desplerepositorios.options[idx].value+RC; |
---|
36 | break; |
---|
37 | } |
---|
38 | } |
---|
39 | document.fdatosejecucion.atributos.value=atributos; |
---|
40 | document.fdatosejecucion.submit(); |
---|
41 | } |
---|
42 | //________________________________________________________________________________________________________ |
---|
43 | function cancelar(){ |
---|
44 | alert(CTbMsg[0]); |
---|
45 | location.href="../nada.php" |
---|
46 | } |
---|
47 | //________________________________________________________________________________________________________ |
---|
48 | function comprobar_datos() |
---|
49 | { |
---|
50 | tb_conf=document.getElementById("tabla_conf"); |
---|
51 | var ochecks=tb_conf.getElementsByTagName('INPUT') |
---|
52 | var op=0 |
---|
53 | for(var i=0;i<ochecks.length;i++){ |
---|
54 | if(ochecks[i].checked){ |
---|
55 | op++; |
---|
56 | // Los checks tienen en su nombre disco_nparticion_idparticion (Ej. 1_1_7 -> disco 1, part 1, NTFS |
---|
57 | var disco=ochecks[i].value.split("_")[0]; |
---|
58 | var particion=ochecks[i].value.split("_")[1]; |
---|
59 | // El desplegable de imagen ahora indica disco y particion en su nombre |
---|
60 | despleimagen=document.getElementById("despleimagen_"+disco+"_"+particion); |
---|
61 | var p=despleimagen.selectedIndex |
---|
62 | if (p==0){ |
---|
63 | alert(TbMsg[0]) |
---|
64 | despleimagen.focus() |
---|
65 | return(false) |
---|
66 | } |
---|
67 | } |
---|
68 | } |
---|
69 | if(op==0){ |
---|
70 | alert(TbMsg[1]) |
---|
71 | return(false); |
---|
72 | } |
---|
73 | return(comprobar_datosejecucion()) |
---|
74 | } |
---|
75 | |
---|