1 | // ************************************************************************************************************************************************* |
---|
2 | // Libreria de scripts de Javascript |
---|
3 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
4 | // Fecha Creación:2003-2004 |
---|
5 | // Fecha Última modificación: Febrero-2005 |
---|
6 | // Nombre del fichero: accionmenu.js |
---|
7 | // Descripción : |
---|
8 | // Este fichero implementa las funciones javascript del fichero accionmenu.php |
---|
9 | // ************************************************************************************************************************************************* |
---|
10 | var currentedicion=null; |
---|
11 | var currentidmenu=null; |
---|
12 | var EDICIONACCION=1; |
---|
13 | var EDICIONITEMS=2; |
---|
14 | var EDICIONITEM=3; |
---|
15 | //________________________________________________________________________________________________________ |
---|
16 | function gestion_acciones(id,o,op){ |
---|
17 | var idtipoaccion=document.fdatos.idtipoaccion.value |
---|
18 | var tipoaccion=document.fdatos.tipoaccion.value |
---|
19 | var otipoitem=document.getElementById("tipositems-"+id); |
---|
20 | var tipoitem=otipoitem.value |
---|
21 | var oTD=document.getElementById("TDurlimagesitems-"+id); |
---|
22 | var idurlimg=oTD.childNodes[0].value |
---|
23 | var odescripitem=document.getElementById("descripitem-"+id) |
---|
24 | var descripitem=odescripitem.value |
---|
25 | var oorden=document.getElementById("orden-"+id) |
---|
26 | var orden=oorden.value |
---|
27 | if(descripitem==""){ |
---|
28 | alert(TbMsg[0]); |
---|
29 | if(op==null) o.checked=false |
---|
30 | odescripitem.focus(); |
---|
31 | return |
---|
32 | } |
---|
33 | if(orden=="" || orden<0){ |
---|
34 | alert(TbMsg[1]); |
---|
35 | if(op==null) o.checked=false |
---|
36 | oorden.focus(); |
---|
37 | return |
---|
38 | } |
---|
39 | if (o.checked){ |
---|
40 | if(op==null) op=op_alta; |
---|
41 | var wurl="../gestores/gestor_accionmenu.php?opcion="+op+"&idtipoaccion="+idtipoaccion+"&idmenu="+id+"&tipoaccion="+tipoaccion+"&tipoitem="+tipoitem +"&idurlimg="+idurlimg+"&descripitem="+descripitem+"&orden="+orden |
---|
42 | } |
---|
43 | else |
---|
44 | var wurl="../gestores/gestor_accionmenu.php?opcion="+op_eliminacion+"&idtipoaccion="+idtipoaccion+"&idmenu="+id+"&tipoaccion="+tipoaccion |
---|
45 | currentidmenu=id // Guarda identificdor del menu |
---|
46 | ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe |
---|
47 | currentedicion=document.fdatos.tipoedicion.value |
---|
48 | ifr.src=wurl; // LLama a la página gestora |
---|
49 | } |
---|
50 | //________________________________________________________________________________________________________ |
---|
51 | function resultado_insertar_accionmenu(resul,descrierror,nwid,tablanodo){ |
---|
52 | if (!resul){ // Ha habido algún error en la inserción |
---|
53 | alert(descrierror) |
---|
54 | return |
---|
55 | } |
---|
56 | alert(TbMsg[2]) |
---|
57 | var imgact=document.getElementById("imgact-"+currentidmenu); |
---|
58 | var imgHTML='<TD id="imgact-'+currentidmenu+'"><IMG src="../images/iconos/actualizar.gif" style="cursor:hand" onclick="ActualizarAccion('+currentidmenu+')">'; |
---|
59 | imgact.innerHTML=imgHTML |
---|
60 | } |
---|
61 | //________________________________________________________________________________________________________ |
---|
62 | function resultado_eliminar_accionmenu(resul,descrierror,idp,idh){ |
---|
63 | if (!resul){ // Ha habido algún error en la eliminación |
---|
64 | alert(descrierror) |
---|
65 | return |
---|
66 | } |
---|
67 | alert(TbMsg[3]) |
---|
68 | var imgact=document.getElementById("imgact-"+currentidmenu); |
---|
69 | var imgHTML=' '; |
---|
70 | imgact.innerHTML=imgHTML |
---|
71 | var oorden=document.getElementById("orden-"+currentidmenu) |
---|
72 | oorden.value="" |
---|
73 | } |
---|
74 | //________________________________________________________________________________________________________ |
---|
75 | function resultado_modificar_accionmenu(resul,descrierror,idp,idh){ |
---|
76 | if (!resul){ // Ha habido algún error en la eliminación |
---|
77 | alert(descrierror) |
---|
78 | return |
---|
79 | } |
---|
80 | alert(TbMsg[4]) |
---|
81 | if( currentedicion==EDICIONITEM) self.close(); |
---|
82 | } |
---|
83 | //________________________________________________________________________________________________________ |
---|
84 | function ActualizarAccion(id){ |
---|
85 | |
---|
86 | var ocheckbox=document.getElementById("checkbox-"+id); |
---|
87 | gestion_acciones(id,ocheckbox,op_modificacion) |
---|
88 | } |
---|
89 | //________________________________________________________________________________________________________ |
---|
90 | function ActualizarItems(tipoaccion,idtipoaccion,id){ |
---|
91 | |
---|
92 | var oTD=document.getElementById("TDurlimagesitems-"+id); |
---|
93 | var idurlimg=oTD.childNodes[0].value |
---|
94 | var odescripitem=document.getElementById("descripitem-"+id) |
---|
95 | var descripitem=odescripitem.value |
---|
96 | var oorden=document.getElementById("orden-"+id) |
---|
97 | var orden=oorden.value |
---|
98 | if(descripitem==""){ |
---|
99 | alert(TbMsg[0]); |
---|
100 | odescripitem.focus(); |
---|
101 | return |
---|
102 | } |
---|
103 | if(orden=="" || orden<0){ |
---|
104 | alert(TbMsg[1]); |
---|
105 | odescripitem.focus(); |
---|
106 | return |
---|
107 | } |
---|
108 | var op=op_modificacion; |
---|
109 | var tipoitem=document.fdatos.tipoitem.value |
---|
110 | var idmenu=document.fdatos.idmenu.value |
---|
111 | var wurl="../gestores/gestor_accionmenu.php?opcion="+op+"&idtipoaccion="+idtipoaccion+"&idmenu="+idmenu+"&tipoaccion="+tipoaccion+"&tipoitem="+tipoitem +"&idurlimg="+idurlimg+"&descripitem="+descripitem+"&orden="+orden |
---|
112 | ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe |
---|
113 | currentedicion=document.fdatos.tipoedicion.value |
---|
114 | ifr.src=wurl; // LLama a la página gestora |
---|
115 | } |
---|
116 | //________________________________________________________________________________________________________ |
---|
117 | function ActualizarItem(tipoaccion,idtipoaccion,id){ |
---|
118 | var otipoitem=document.getElementById("tipositems-"+id); |
---|
119 | var tipoitem=otipoitem.value |
---|
120 | var oTD=document.getElementById("TDurlimagesitems-"+id); |
---|
121 | var idurlimg=oTD.childNodes[0].value |
---|
122 | var odescripitem=document.getElementById("descripitem-"+id) |
---|
123 | var descripitem=odescripitem.value |
---|
124 | var oorden=document.getElementById("orden-"+id) |
---|
125 | var orden=oorden.value |
---|
126 | if(descripitem==""){ |
---|
127 | alert(TbMsg[0]); |
---|
128 | odescripitem.focus(); |
---|
129 | return |
---|
130 | } |
---|
131 | if(orden=="" || orden<0){ |
---|
132 | alert(TbMsg[1]); |
---|
133 | odescripitem.focus(); |
---|
134 | return |
---|
135 | } |
---|
136 | var op=parseInt(op_modificacion); |
---|
137 | var idmenu=document.fdatos.idmenu.value |
---|
138 | var wurl="../gestores/gestor_accionmenu.php?opcion="+op+"&idtipoaccion="+idtipoaccion+"&idmenu="+idmenu+"&tipoaccion="+tipoaccion+"&tipoitem="+tipoitem +"&idurlimg="+idurlimg+"&descripitem="+descripitem+"&orden="+orden |
---|
139 | ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe |
---|
140 | currentedicion=document.fdatos.tipoedicion.value |
---|
141 | ifr.src=wurl; // LLama a la página gestora |
---|
142 | } |
---|