[b0dc2e4] | 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: Marzo-2005 |
---|
| 6 | // Nombre del fichero: EjecutarScripts.js |
---|
| 7 | // Descripción : |
---|
| 8 | // Este fichero implementa las funciones javascript del fichero EjecutarScripts.php (Comandos) |
---|
| 9 | // ************************************************************************************************************************************************* |
---|
| 10 | function confirmar(){ |
---|
| 11 | if (comprobar_datos()){ |
---|
| 12 | if(confirm(TbMsg[0])){ |
---|
| 13 | document.fdatos.pseudocodigo.value=convierte_a_pseudocodigo("#!/bin/bash \n"+document.fdatos.codigo.value); |
---|
| 14 | document.fdatos.sw_ejya.value=document.fdatosejecucion.sw_ejya.checked |
---|
| 15 | document.fdatosejecucion.sw_seguimiento.value=document.fdatosejecucion.sw_seguimiento[0].checked; |
---|
| 16 | document.fdatos.sw_seguimiento.value=document.fdatosejecucion.sw_seguimiento.value |
---|
| 17 | document.fdatos.sw_mkprocedimiento.value=document.fdatosejecucion.sw_mkprocedimiento.checked |
---|
| 18 | document.fdatos.nwidprocedimiento.value=document.fdatosejecucion.idprocedimiento.value |
---|
| 19 | document.fdatos.nwdescriprocedimiento.value=document.fdatosejecucion.nombreprocedimiento.value |
---|
| 20 | document.fdatos.sw_mktarea.value=document.fdatosejecucion.sw_mktarea.checked |
---|
| 21 | document.fdatos.nwidtarea.value=document.fdatosejecucion.idtarea.value |
---|
| 22 | document.fdatos.nwdescritarea.value=document.fdatosejecucion.nombretarea.value |
---|
| 23 | document.fdatos.submit(); |
---|
| 24 | } |
---|
| 25 | } |
---|
| 26 | } |
---|
| 27 | //________________________________________________________________________________________________________ |
---|
| 28 | function convierte_a_pseudocodigo(codi){ |
---|
| 29 | pseudo="" |
---|
| 30 | for(var i=0;i<codi.length;i++) |
---|
| 31 | pseudo+=escape(codi.charAt(i)); |
---|
| 32 | return(pseudo); |
---|
| 33 | } |
---|
| 34 | //________________________________________________________________________________________________________ |
---|
| 35 | function cancelar(){ |
---|
| 36 | alert(CTbMsg[0]); |
---|
| 37 | location.href="../nada.php" |
---|
| 38 | } |
---|
| 39 | //________________________________________________________________________________________________________ |
---|
| 40 | function comprobar_datos(){ |
---|
| 41 | var sw_seguimientocon=document.fdatosejecucion.sw_seguimiento[0].checked; |
---|
| 42 | var sw_mkprocedimiento=document.fdatosejecucion.sw_mkprocedimiento.checked; |
---|
| 43 | var sw_mktarea=document.fdatosejecucion.sw_mktarea.checked; |
---|
| 44 | if (document.fdatos.codigo.value=="" && document.fdatos.userfile.value=="" ) { |
---|
| 45 | alert(TbMsg[1]); |
---|
| 46 | document.fdatos.codigo.focus(); |
---|
| 47 | return(false); |
---|
| 48 | } |
---|
| 49 | if(!sw_seguimientocon && !sw_mkprocedimiento && !sw_mktarea) return(true) |
---|
| 50 | if (document.fdatos.titulo.value=="" ) { |
---|
| 51 | alert(TbMsg[2]); |
---|
| 52 | document.fdatos.titulo.focus(); |
---|
| 53 | return(false); |
---|
| 54 | } |
---|
| 55 | if (document.fdatos.descripcion.value=="" ) { |
---|
| 56 | alert(TbMsg[3]); |
---|
| 57 | document.fdatos.descripcion.focus(); |
---|
| 58 | return(false); |
---|
| 59 | } |
---|
| 60 | return(comprobar_datosejecucion()) |
---|
| 61 | } |
---|