pancherre

Untitled

Aug 20th, 2013
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.38 KB | None | 0 0
  1. <!-- http://10.172.80.93/Personalizaciones_CGPJ/salidas.asp?IdUser=U0000412&Indice=211&Numero=95168 -->
  2. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head>
  5. <meta http-equiv="Pragma" content="no-cache">
  6. <title>Registro de Salida</title>
  7. <script type="text/javascript" src="./js/jquery-1.4.2.min.js"></script>
  8. <script type="text/javascript" src="./js/jquery-ui-1.8.custom.min.js"></script>
  9. <link type="text/css" href="./css/ui-lightness/jquery-ui-1.8.custom.css" rel="stylesheet" />
  10. <!--<script type="text/javascript" src="./js/jstree/jquery.jstree.js"></script>-->
  11. <style type="text/css">
  12. td,span
  13. {
  14. font-family: Tahoma, Arial, Verdana;
  15. font-size:0.8em;
  16. margin:0;
  17. padding:0;
  18. vertical-align: top;
  19. }
  20. .Documento
  21. {
  22. border: 1px solid #FFFFFF;
  23. margin: 0;
  24. padding: 2px;
  25. text-align: left;
  26. vertical-align: middle;
  27. background-color: #ffffff;
  28. color:#000000;
  29. cursor:hand;
  30. white-space: nowrap;
  31. font-size: 11px;
  32. }
  33. .Documento a img {
  34. vertical-align: middle;
  35. }
  36. .Docs
  37. {
  38. margin:4px 20px 4px 20px;
  39. padding:4px;
  40. border: 1px solid #CCCCCC;
  41. width: 100%;
  42. list-style-type: none;
  43. min-height: 20px;
  44. }
  45. .SalidaDoc
  46. {
  47. list-style-type: none;
  48. float: left;
  49. background-color: #feaade;
  50. white-space: nowrap;
  51. }
  52. .SalidaDoc a
  53. {
  54. border: 1px solid #FFFFFF;
  55. margin: 0;
  56. padding: 5px;
  57. text-align: left;
  58. vertical-align: middle;
  59. background-color: #ffffff;
  60. color:#000000;
  61. cursor:hand;
  62. font-family: Tahoma, Arial, Verdana;
  63. white-space: nowrap;
  64. font-size: 11px;
  65. }
  66. .SalidaDoc a .img_borrar {
  67. float: left;
  68. display: block;
  69. width: 20px;
  70. margin: 0;
  71. boder: 0 solid;
  72. }
  73. .SalidaDoc a img {
  74. vertical-align: middle;
  75. }
  76. .SalidaDoc a:hover {
  77. background-color: #d1cbaa;
  78. border: 1px solid #CCCCCC;
  79. }
  80. </style>
  81. <style>
  82. #draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
  83. #droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }
  84. </style>
  85. <link rel="stylesheet" href="styles/FormsEdit.css" type="text/css"/>
  86. <link rel="stylesheet" href="styles/AuxiliarValuesTable.css" type="text/css"/>
  87. <script language="javascript" src="scripts/Formularios.js" type="text/jscript"></script>
  88.  
  89. <SCRIPT type=text/JavaScript
  90. src="./customization/scripts/CustomForms.js"></SCRIPT>
  91. </head>
  92.  
  93. <body style="margin:0; padding:0;" onload="" onunload="closeFullWindow();">
  94. <%
  95. Response.CodePage = 1252
  96. Response.CharSet = "iso-88519-1"
  97.  
  98. Dim emailpre
  99.  
  100. ' DSN de la conexion ODBC a usar para la base de datos
  101. Dim strFileName
  102. Dim FSysObj
  103. Dim TS
  104. Dim strConnection
  105. strFileName = Server.MapPath("./App_Code/PixelWebConfig.txt")
  106. Set FSysObj = Server.CreateObject("Scripting.FileSystemObject")
  107. Set TS = FSysObj.OpenTextFile(strFileName, 1, False)
  108. If not TS.AtEndOfStream Then
  109. Do While not TS.AtendOfStream
  110. strConnection = TS.ReadLine
  111. loop
  112. End If
  113. TS.Close
  114. Set TS = Nothing
  115. Set FSysObj = Nothing
  116. 'strConnection = "DSN=pixelware;UID=sa;PWD=sgsg+2009;"
  117.  
  118. ' Obtengo los valores del querystring
  119. indice = Request.Querystring("Indice")
  120. numero = Request.QueryString("Numero")
  121. iduser = Request.QueryString("IdUser")
  122. cargoPon = Request.QueryString("cargoPon")
  123.  
  124.  
  125. ' Comprueba los valores pasados
  126. If ((Len(indice) > 0) and (Len(numero) > 0) and (Len(iduser) > 0)) Then
  127. ' Procede a ejecutar la sentencia para obtener resultados
  128. Dim Conn
  129. Dim rs
  130. Set Conn = Server.CreateObject("ADOdb.Connection")
  131. Conn.Open strConnection
  132. %>
  133. <script type="text/javascript" language="javascript">
  134. function checkayuntamiento(value)
  135. {
  136. alert(value);
  137. alert('Hola');
  138. alert($('#TEXTOAYUNTAMIENTO', window.parent.document).html());
  139. alert('<%=indice%>');
  140. alert('<%=TEXTOAYUNTAMIENTO%>');
  141. alert('<%=DESCMODOENVIO%>');
  142. var valor = document.getElementById("TEXTOAYUNTAMIENTO");
  143. var valor5 = document.getElementsByName('TEXTOAYUNTAMIENTO')[0].value
  144. var valor2 = document.getElementById("TEXTOAYUNTAMIENTO").innerHTML;
  145. //var elem = $('#salida_'+id);
  146. var idi = $("#TEXTOAYUNTAMIENTO").val();
  147. var asdf = $(this).closest('tr').next().find(".AYUNTAMIENTOS").val();
  148. var valor3 = document.getElementById("PRUEBA");
  149. var valor4 = document.getElementById("PRUEBA").innerHTML;
  150. //var elem = $('#salida_'+id);
  151. var idi2 = $("#PRUEBA").val();
  152. var asdf2 = $(this).closest('td').next().find(".PRUEBA").val();
  153. alert(asdf);
  154. alert(idi);
  155. alert(valor);
  156. alert(valor2);
  157. alert(asdf2);
  158. alert(idi2);
  159. alert(valor3);
  160. alert(valor4);
  161. alert(valor5);
  162. }
  163. </script>
  164. <script language="javascript" type="text/jscript">
  165. $.ajaxSetup ({
  166. cache: false
  167. });
  168. $(function() {
  169. $(".Documento").draggable({
  170. helper:'clone',
  171. addClasses:false,
  172. cursor:'hand',
  173. scroll:true,
  174. scrollSensitivity:40,
  175. scrollSpeed: 40,
  176. opacity:0.75
  177. });
  178.  
  179. // Llama por AJAX para obtener el listado de modos de envio
  180. $.get('Salidas_Action.asp?Accion=ModosEnvio',
  181. function(datos) {
  182. if ($(datos).find('code')[0].text == "0") {
  183. var modosenvio = $('#DESCMODOENVIO');
  184. $(datos).find('modoenvio').each(function(index) {
  185. modosenvio.append($("<option value='"+$(this).find('id')[0].text+"'>"+$(this).find('desc')[0].text+"</option>"));
  186. });
  187. checkFullWindow();
  188. } else {
  189. alert($(datos).find('message')[0],text);
  190. }
  191. });
  192. });
  193.  
  194. function FilterOptions(id,elem)
  195. {
  196. $(elem[0]).find('#AYUNTAMIENTOS').hide();
  197. $(elem[0]).find('#JUZGADOPAZ').hide();
  198. //Eliminar los modos de envio que no se van a utilizar dependiendo del destinatario
  199. switch (id)
  200. {
  201. case 18: //Registro General CGPJ
  202. $(elem[0]).find('#DESCMODOENVIO option:contains(Sistema de Gestión Gubernativa)').remove();
  203. $(elem[0]).find('#DESCMODOENVIO option:contains(INTERIUS)').remove();
  204. $(elem[0]).find('#DESCMODOENVIO option:contains(Correo electrónico)').remove();
  205. break;
  206. case 21: //Ministerio de Justicia
  207. case 23: //Otro
  208. case 24: //Interesado
  209. case 16221://Ponente
  210. $(elem[0]).find('#DESCMODOENVIO option:contains(Sistema de Gestión Gubernativa)').remove();
  211. $(elem[0]).find('#DESCMODOENVIO option:contains(Registro General del CGPJ)').remove();
  212. $(elem[0]).find('#DESCMODOENVIO option:contains(INTERIUS)').remove();
  213. break;
  214. case 16222://Ayuntamiento
  215. $(elem[0]).find('#DESCMODOENVIO option:contains(Sistema de Gestión Gubernativa)').remove();
  216. $(elem[0]).find('#DESCMODOENVIO option:contains(Registro General del CGPJ)').remove();
  217. $(elem[0]).find('#DESCMODOENVIO option:contains(INTERIUS)').remove();
  218. $(elem[0]).find('#AYUNTAMIENTOS').show();
  219. case 16223://Juzgado de Paz
  220. $(elem[0]).find('#DESCMODOENVIO option:contains(Sistema de Gestión Gubernativa)').remove();
  221. $(elem[0]).find('#DESCMODOENVIO option:contains(Registro General del CGPJ)').remove();
  222. $(elem[0]).find('#DESCMODOENVIO option:contains(INTERIUS)').remove();
  223. $(elem[0]).find('#JUZGADOPAZ').show();
  224. default://Juzgados
  225. $(elem[0]).find('#DESCMODOENVIO option:contains(Sistema de Gestión Gubernativa)').remove();
  226. $(elem[0]).find('#DESCMODOENVIO option:contains(Registro General del CGPJ)').remove();
  227. break;
  228. }
  229. }
  230.  
  231. function addSalida(valor,id,replicar)
  232. {
  233. // Comprueba si se ha abierto en pantalla completa para replicar en el llamante
  234. if (abiertototal && replicar) {
  235. window.opener.addSalida(valor,id);
  236. }
  237. // Obtiene las variables para sumar la salida
  238. var listasal = $('#list_salidas');
  239. var ele0 = listasal.children('#salida0');
  240. var elesal = listasal.find('#salida_'+id);
  241.  
  242. if (elesal.length == 0) {
  243. var ele0 = listasal.children('#salida0');
  244. // Crea la nueva salida
  245. var elenew = ele0.clone().attr("id","salida_"+id).show();
  246. // Se encarga de poner los datos de la nueva salida
  247. elenew.find('#name_dest').text(valor);
  248. elenew.find('#btn_Eliminar').click(
  249. function() { Delete(id); });
  250. elenew.find('#btn_Eliminar').hover(
  251. function() { $(this).parents('li').css('background-color','#e6dec9'); },
  252. function() { $(this).parents('li').css('background-color','#ffffff'); });
  253.  
  254. elenew.find('#DESCMODOENVIO').change(
  255. function() { changeModoEnvio(id,$('#salida_'+id).find('#DESCMODOENVIO').val()); });
  256. // Se encarga de obtener los datos de las tablas.
  257. $.get('Salidas_Action.asp?Accion=Obtain&Id='+id+'&Tabla=PWJSDESTINATARIO&Indice=<%=indice%>&Numero=<%=numero%>',
  258. function(datos) {
  259. if ($(datos).find('code')[0].text == "0") {
  260. elenew.find('#Obteniendo').hide();
  261. elenew.find('#Destinatario').show();
  262. elenew.find('#DocInc1').show();
  263. elenew.find('#DocInc2').show();
  264. // Obtiene todos los datos, y los asigna en los datos de salida
  265. var elem = $('#list_salidas').find('#salida_'+$(datos).find('id')[0].text);
  266. $(elem[0]).find('#NAME').val(''); // Quita el valor de 'Obteniendo datos'
  267. $(elem[0]).find('#DESCMODOENVIO').val($(datos).find('modoenvio')[0].text);
  268. FilterOptions(id,elem);
  269. // Introducimos los datos por defecto
  270. $(elem[0]).find('#PIXEL_INFO_EMAIL').val($(datos).find('pjemail')[0].text);
  271. $(elem[0]).find('#INTERIUS').val($(datos).find('pjemail')[0].text);
  272. switch ($(datos).find('modoenvio')[0].text)
  273. {
  274. case "3": // Envio Reg Entrada Tribunal
  275. case "0": // Envío postal
  276. elenew.find('#PIXEL_INFO_EMAIL').parents('tr').hide();
  277. elenew.find('#NAME').parents('tr').hide();
  278. elenew.find('#TIPODOC').parents('tr').hide();
  279. break;
  280. case "1": // Envio por Interus
  281. //$(elem[0]).find('#EMAIL').val($(datos).find('pjemail')[0].text);
  282. elenew.find('#PIXEL_INFO_EMAIL').parents('tr').show();
  283. elenew.find('#INTERIUS').parents('td').show();
  284. elenew.find('#PIXEL_INFO_EMAIL').parents('td').hide();
  285. elenew.find('#NAME').parents('tr').hide();
  286. elenew.find('#TIPODOC').parents('tr').hide();
  287. break;
  288. case "2": // Envio email
  289. if (($(datos).find('nombre').size() > 0) && ($(datos).find('apellido1').size() > 0) && ($(datos).find('apellido2').size() > 0)) {
  290. $(elem[0]).find('#NAME').val($(datos).find('nombre')[0].text + " " + $(datos).find('apellido1')[0].text + " " + $(datos).find('apellido2')[0].text);
  291. } else {
  292. $(elem[0]).find('#NAME').val('');
  293. elenew.find('#NAME').val('');
  294. }
  295. if ($(datos).find('email').length)
  296. {
  297. $(elem[0]).find('#PIXEL_INFO_EMAIL').val($(datos).find('email')[0].text);
  298. }
  299. else
  300. {
  301. if( $(datos).find('pjemail').length)
  302. {
  303. $(elem[0]).find('#PIXEL_INFO_EMAIL').val($(datos).find('pjemail')[0].text);
  304. }
  305. else
  306. {
  307. $(elem[0]).find('#PIXEL_INFO_EMAIL').val('');
  308. }
  309. }
  310.  
  311.  
  312. elenew.find('#INTERIUS').parents('td').hide();
  313. elenew.find('#PIXEL_INFO_EMAIL').parents('tr').show();
  314. elenew.find('#PIXEL_INFO_EMAIL').parents('td').show();
  315. elenew.find('#NAME').parents('tr').show();
  316. elenew.find('#TIPODOC').parents('tr').hide();
  317. break;
  318. case "4": // Envio por WS Reg Gen. Entrada CGPJ
  319. elenew.find('#PIXEL_INFO_EMAIL').parents('tr').hide();
  320. elenew.find('#NAME').parents('tr').hide();
  321. elenew.find('#TIPODOC').parents('tr').show();
  322. break;
  323. case "5": // Envio Organismos especiales
  324. //$(elem[0]).find('#EMAIL').val($(datos).find('pjemail')[0].text);
  325. elenew.find('#PIXEL_INFO_EMAIL').parents('tr').show();
  326. elenew.find('#PIXEL_INFO_EMAIL').parents('td').show();
  327. elenew.find('#NAME').parents('tr').hide();
  328. elenew.find('#TIPODOC').parents('tr').hide();
  329. break;
  330. }
  331. // Obtiene los tipos documentales
  332. $(datos).find('tipodocumental').each(function(index) {
  333. elenew.find('#TIPODOC').append($('<option></option>').val($(this).find('iddoccod')[0].text).html($(this).find('nodo')[0].text));
  334.  
  335. });
  336. // Vincula los campos de edicion
  337. elenew.find('#PIXEL_INFO_EMAIL').bind('propertychange',function(e) {
  338. if (abiertototal) {
  339. if ($(this).parents('li').attr('id').indexOf('salida_') == 0) {
  340. var id = $(this).parents('li').attr('id').substring(7);
  341. window.opener.$('#salida_'+id).find('#PIXEL_INFO_EMAIL').val($(this).val());
  342. }
  343. }
  344. });
  345. elenew.find('#NAME').bind('propertychange',function(e) {
  346. if (abiertototal) {
  347. if ($(this).parents('li').attr('id').indexOf('salida_') == 0) {
  348. var id = $(this).parents('li').attr('id').substring(7);
  349. window.opener.$('#'+id).find('#NAME').val($(this).val());
  350. }
  351. }
  352. });
  353. elenew.find('#TIPODOC').bind('propertychange',function(e) {
  354. if (abiertototal) {
  355. if ($(this).parents('li').attr('id').indexOf('salida_') == 0) {
  356. var id = $(this).parents('li').attr('id').substring(7);
  357. window.opener.$('#'+id).find('#TIPODOC').val($(this).val());
  358. }
  359. }
  360. });
  361. }
  362. else
  363. {
  364. if ($(datos).find('code')[0].text == "23")
  365. {
  366. elenew.find('#Destinatario').show();
  367. elenew.find('#DocInc1').show();
  368. elenew.find('#DocInc2').show();
  369. // Obtiene todos los datos, y los asigna en los datos de salida
  370. var elem = $('#list_salidas').find('#salida_'+$(datos).find('id')[0].text);
  371. $(elem[0]).find('#NAME').val(''); // Quita el valor de 'Obteniendo datos'
  372. $(elem[0]).find('#DESCMODOENVIO').val($(datos).find('modoenvio')[0].text);
  373. $("#DESCMODOENVIO option[value='"+$(datos).find('descmodoenvio')[0].text+"']").attr("selected",true);
  374. FilterOptions(23,elem);
  375. elenew.find('#Obteniendo').hide();
  376. }
  377. else
  378. {
  379. alert($(datos).find('code')[0].text);
  380. alert($(datos).find('message')[0].text);
  381. Delete(id);
  382. }
  383. }
  384. });
  385.  
  386. // Pone el doc como droppable
  387. elenew.find('#DOCUS').droppable({
  388. accept: ".Documento",
  389. addClasses: false,
  390. hoverClass: 'drophover',
  391. tolerance: 'touch',
  392. drop: function(ev, ui) {
  393. var id = $(this).parents('li').attr('id').substring(7);
  394. var iddoc = $(ui.draggable).children(":first").attr('id').substring(4);
  395. // Comprueba si se ha abierto en pantalla completa para replicar en el llamante
  396. if (abiertototal) {
  397. var ele = $(ui.draggable).clone(); //.removeClass("Documento").addClass("SalidaDoc");
  398. /* OJO: Se debe de poner el evento click cuando se copia en checkFullWindow */
  399. ele.children(":first").click(function() { delDocumento(id,iddoc); return false; });
  400. ele.children(":first").children("#img_borrar").removeAttr("style");
  401. window.opener.$('#salida_'+id).find('#DOCUS').append("<li class='Documento'>"+ele.html()+"</li>");
  402. }
  403. var ele = $(ui.draggable).clone(); //.removeClass("Documento").addClass("SalidaDoc");
  404. ele.children(":first").click(function() { delDocumento(id,iddoc); return false; });
  405. ele.children(":first").children("#img_borrar").removeAttr("style");
  406. $(this).append(ele);
  407. }
  408. });
  409.  
  410. listasal.append(elenew);
  411. }
  412.  
  413. return;
  414. }
  415. // Se encarga de poner bien los valores que se asocian al modo de envio
  416. function changeModoEnvio(id,modoenvio)
  417. {
  418. // Comprueba si se ha abierto en pantalla completa para replicar en el llamante
  419. if (abiertototal) {
  420. window.opener.changeModoEnvio(id,modoenvio);
  421. }
  422. // Cambia el modo de envio
  423. var elem = $('#salida_'+id);
  424. if (elem != null) {
  425. switch (modoenvio)
  426. {
  427. case "0": // Envío postal
  428. case "3": // Envio Reg Entrada Tribunal
  429. $(elem).find('#PIXEL_INFO_EMAIL').parents('tr').hide();
  430. $(elem).find('#NAME').parents('tr').hide();
  431. $(elem).find('#TIPODOC').parents('tr').hide();
  432. break;
  433. case "1": // Envio por Interus
  434. $(elem).find('#INTERIUS').parents('tr').show();
  435. $(elem).find('#INTERIUS').parents('td').show();
  436. $(elem).find('#PIXEL_INFO_EMAIL').parents('td').hide();
  437. $(elem).find('#NAME').parents('tr').hide();
  438. $(elem).find('#TIPODOC').parents('tr').hide();
  439. break;
  440. case "2": // Envio email
  441. $(elem).find('#PIXEL_INFO_EMAIL').parents('tr').show();
  442. $(elem).find('#PIXEL_INFO_EMAIL').parents('td').show();
  443. $(elem).find('#INTERIUS').parents('td').hide();
  444. $(elem).find('#NAME').parents('tr').show();
  445. $(elem).find('#TIPODOC').parents('tr').hide();
  446. break;
  447. case "4": // Envio por WS Reg Gen. Entrada CGPJ
  448. $(elem).find('#PIXEL_INFO_EMAIL').parents('tr').hide();
  449. $(elem).find('#NAME').parents('tr').hide();
  450. $(elem).find('#TIPODOC').parents('tr').show();
  451. break;
  452. case "5": // Envio Organismos especiales
  453. $(elem).find('#PIXEL_INFO_EMAIL').parents('tr').show();
  454. $(elem).find('#NAME').parents('tr').hide();
  455. $(elem).find('#TIPODOC').parents('tr').hide();
  456. break;
  457. }
  458. $(elem).find('#DESCMODOENVIO').val(modoenvio);
  459. }
  460. }
  461. // Se encarga de generar las salidas, a raiz de avanzar la tarea de usuario
  462. function avanzar()
  463. {
  464. // Primero recorre la lista de salidas para detectar si para salida CGPJ no existen documentos, o email no existe email
  465. var estaokcgpj = true;
  466. var estaokemail = true;
  467. var estaokinterius = true;
  468. $('#list_salidas').find('li').each(function(index) {
  469. if ($(this).attr('id').indexOf('salida_') == 0) {
  470. var id = $(this).attr('id').substring(7);
  471. var modoenvio = $(this).find('#DESCMODOENVIO option:selected').val();
  472. var email = $(this).find('#PIXEL_INFO_EMAIL').val();
  473. var interius = $(this).find('#INTERIUS').val();
  474. var docs = '';
  475. $(this).find('#iddoc').each(function(index) {
  476. if (docs.length > 0) {
  477. docs = docs + ';' + $(this).val()
  478. } else {
  479. docs = $(this).val()
  480. }
  481. });
  482. if (modoenvio=='4') { // CGPJ
  483. if (docs.length <= 0) {
  484. estaokcgpj = false;
  485. }
  486. }
  487. if (modoenvio=='2') { // EMAIL
  488. var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  489. if (!filter.test(email)) {
  490. estaokemail = false;
  491. }
  492. }
  493. if (modoenvio=='1'){ //INTERIUS
  494. if (interius.indexOf('@pnj.cgpj.es') == -1)
  495. {
  496. estaokinterius = false;
  497. }
  498. }
  499. }
  500. });
  501. if (!estaokcgpj) {
  502. alert('ERROR. No se puede realizar el avance ya que existe alguna salida al Registro General del CGPJ sin documento asociado.');
  503. return false;
  504. }
  505. if (!estaokemail) {
  506. alert('ERROR. No se puede realizar el avance ya que existe algún correo electrónico erróneo');
  507. return false;
  508. }
  509. if (!estaokinterius) {
  510. alert('ERROR. No se puede realizar el avance ya que existe alguna direccion interius errónea');
  511. return false;
  512. }
  513. // Seguidamente recorre las salidas y va realizando el avance
  514. $('#list_salidas').find('li').each(function(index) {
  515. if ($(this).attr('id').indexOf('salida_') == 0) {
  516. var id = $(this).attr('id').substring(7);
  517. var modoenvio = $(this).find('#DESCMODOENVIO option:selected').val();
  518. var descmodoenvio = $(this).find('#DESCMODOENVIO option:selected').text();
  519.  
  520.  
  521.  
  522.  
  523.  
  524. if (modoenvio == 1 )
  525. {
  526. var email = $(this).find('#INTERIUS').val();
  527. }else
  528. {
  529. var email = $(this).find('#PIXEL_INFO_EMAIL').val();
  530. }
  531.  
  532. var tipodoc = $(this).find('#TIPODOC').val();
  533. var docs = '';
  534. $(this).find('#iddoc').each(function(index) {
  535. if (docs.length > 0) {
  536. docs = docs + ';' + $(this).val()
  537. } else {
  538. docs = $(this).val()
  539. }
  540. });
  541. $.get('Salidas_Action.asp?Accion=Advance&Id='+id+'&Indice=<%=indice%>&Numero=<%=numero%>&ModoEnvio='+modoenvio+'&DescModoEnvio='+descmodoenvio+'&Email='+email+'&TipoDoc='+tipodoc+'&Docs='+docs,
  542. function(datos) {
  543. if ($(datos).find('code')[0].text == "0") {
  544. // El avance se ha realizado correctamente
  545. } else {
  546. alert($(datos).find('message')[0].text);
  547. }
  548. });
  549. }
  550. });
  551. return true;
  552. }
  553. // Se encarga de eliminar un destinatario de salida
  554. function Delete(id)
  555. {
  556. // Comprueba si se ha abierto en pantalla completa para replicar en el llamante
  557. if (abiertototal) {
  558. window.opener.Delete(id);
  559. }
  560. if ($('#PIXEL_INFO_DESTINATARIO_IDS').val().indexOf(id+';') == 0)
  561. $('#PIXEL_INFO_DESTINATARIO_IDS').val($('#PIXEL_INFO_DESTINATARIO_IDS').val().substring($('#PIXEL_INFO_DESTINATARIO_IDS').val().indexOf(';')+1))
  562. else
  563. $('#PIXEL_INFO_DESTINATARIO_IDS').val($('#PIXEL_INFO_DESTINATARIO_IDS').val().replace(';'+id+';',';'));
  564. $('#salida_'+id).remove();
  565. }
  566. function delDocumento(id,iddoc)
  567. {
  568. // Comprueba si se ha abierto en pantalla completa para replicar en el llamante
  569. if (abiertototal) {
  570. window.opener.delDocumento(id,iddoc);
  571. }
  572. // Se encarga de eliminar el elemento en HTML
  573. $('#salida_'+id).find('#Doc_'+iddoc).parent().remove();
  574. }
  575. </script>
  576.  
  577. <script type="text/javascript">
  578. var abiertototal = false;
  579. function openFullWindow() {
  580. if (window.name != 'salidas') {
  581. url_src = "salida.asp?Indice=<%=indice%>&Numero=<%=numero%>&IdUser=<%=iduser%>";
  582. w=800;
  583. h=600;
  584. if (window.screen) {
  585. w = window.screen.availWidth;
  586. h = window.screen.availHeight;
  587. }
  588. window.open(url_src, "salidas", "toolbar=no,location=no,directories=no,scrollbars=yes,menubar=no,width="+w+",height="+h+",top=0,left=0");
  589. }
  590. }
  591. function closeFullWindow() {
  592. if (window.name == 'salidas') {
  593. // No hace falta recargar, ya que se ha ido haciendo en la ventana padre
  594.  
  595. window.close();
  596. }
  597. }
  598. function checkFullWindow() {
  599. if (window.name == 'salidas') {
  600. $('#openfullwindow').hide();
  601. abiertototal=true;
  602. /* Copia la lista de valores seleccionados */
  603. $('#PIXEL_INFO_DESTINATARIO_IDS').val(window.opener.$('#PIXEL_INFO_DESTINATARIO_IDS').val());
  604. /* Procede a replicar la lista de salidas del llamante */
  605. window.opener.$('#list_salidas').children().each(function(index) {
  606. if ($(this).attr('id') != 'salida0') {
  607. var id = $(this).attr('id').substring(7);
  608. addSalida($(this).find('#name_dest').text(), id, false);
  609. /* Procede a copiar el valor de los campos */
  610. $('#salida_'+id).find('#PIXEL_INFO_EMAIL').val($(this).find('#PIXEL_INFO_EMAIL').val());
  611. $('#salida_'+id).find('#NAME').val($(this).find('#NAME').val());
  612. $('#salida_'+id).find('#TIPODOC').val($(this).find('#TIPODOC').val());
  613. /* Procede a copiar la lista de documentos */
  614. $('#salida_'+id).find('#DOCUS').children().remove();
  615. $('#salida_'+id).find('#DOCUS').append($(this).find('#DOCUS').html());
  616. /* Procede a poner cada evento click en cada documento copiado */
  617. $('#salida_'+id).find('#DOCUS').children().each(function(index) {
  618. if ($(this).attr('id') != 'doc0') {
  619. var iddoc = $(this).children(":first").attr('id').substring(4);
  620. $(this).children(":first").click(function() { delDocumento(id,iddoc); return false; });
  621. }
  622. });
  623. changeModoEnvio(id,$(this).find('#DESCMODOENVIO').val())
  624. }
  625. });
  626. }
  627. }
  628. </script>
  629.  
  630. <form id="FormSalida">
  631. <div style="width:30%; float:left; margin: 0; padding: 2px 5px 2px 5px;">
  632. <FIELDSET>
  633. <LEGEND style="FONT-FAMILY: Arial; FONT-SIZE: 12px">Datos de la salida</LEGEND>
  634. <TABLE border=0 cellSpacing=4 cellPadding=3 width="99%">
  635. <TBODY>
  636. <TR><td>
  637. <div>
  638. <a onclick="openFullWindow();" href="javascript:this.onClick"
  639. style="float:right; display:block;" id="openfullwindow">
  640. <IMG id=id_FullScreen border="0" src="./images/fullscreen.jpg" align=absMiddle alt="Pantalla Completa">
  641. </a>
  642. </div>
  643. <DIV class=BotonJerarquico style="text-align:center">
  644. <A onclick="ArbolJera(this,'PIXEL_INFO_DESTINATARIO','PWJSDESTINATARIO',PIXEL_INFO_DESTINATARIO.value, '<%=iduser%>', 10, 0, '', '', 'DESTINATARIO', 100, true);" href="javascript:this.onClick">
  645. <IMG id=img_destinatario align=middle src="images/Auxiliares-17.png">&nbsp;Seleccionar Destinatario/s</A>
  646. </DIV>
  647. <div alt="Destinatario" style="display:none">
  648. <table id="PIXEL_INFO_DESTINATARIO" style="BEHAVIOR: url('./scripts/AuxiliarValuesTable.htc')">
  649. <TBODY></TBODY>
  650. </table>
  651. </div>
  652. <input type="hidden" id="PIXEL_INFO_DESTINATARIO_IDS" name="PIXEL_INFO_DESTINATARIO_IDS" value=""/>
  653. </td>
  654. <tr><td>
  655. <span style="font-size:0.9em;"><B>Documentos a enviar a los destinatarios</B></span>
  656. <ul class="Documentos" style="list-style-type: none; height:auto; overflow: auto; overflow-x: none; overflow-y: visible; margin:0 10px 0 10px; padding:4px; border: 1px solid #CCCCCC; ">
  657. <%
  658. ' Obtiene la lista de documentos
  659. strconsulta = "select iddoc,nombredoc from pwsdocpunteros where indice="+indice+" and numero="+numero+" order by fecha_creacion asc"
  660. Set rs = Conn.Execute(strconsulta)
  661. ' Comprueba si no existen datos
  662. If (not rs.EOF) Then
  663. ' Procede a obtener todos los resultados
  664. Do While Not rs.EOF
  665. %>
  666. <li class="Documento">
  667. <a href="#" id="Doc_<%=rs("iddoc")%>">
  668. <img border="0" style="display:none" id='img_borrar' src='images/IMG-Cancelar-17.png' alt='Eliminar documento' />
  669. <input type="hidden" id="iddoc" value="<%=rs("iddoc")%>"/>
  670. <img border="0" src="images/applet/icons16/<%
  671. Dim imagen
  672. imagen = split(rs("nombredoc"),".")(ubound(split(rs("nombredoc"),".")))
  673. If (InStr(rs("nombredoc"),".") > 0) Then
  674. Response.Write imagen + ".png"
  675. Else
  676. Response.Write "tiff.png"
  677. End If %>">
  678. <span><%
  679. If (Len(rs("nombredoc")) > 45) Then
  680. if (Instr(rs("nombredoc"),".")>0) then
  681. Response.Write Left(split(rs("nombredoc"),".")(0),40) + ".." + split(rs("nombredoc"),".")(1)
  682. Else
  683. Response.Write Left (rs("nombredoc"),40)
  684. End If
  685. Else
  686. Response.Write rs("nombredoc")
  687. End If %></span>
  688. </a>
  689. </li>
  690. <%
  691. rs.MoveNext
  692. Loop
  693. End If
  694. %>
  695. </ul>
  696. <span><u>Modo de asignación:</u> Pulse con el ratón con el botón izquierdo sobre el documento que desee enviar al destinatario, arrastrelo hasta la salida del destinatario y suelte el botón izquierdo.</span>
  697. </td></TR>
  698. </TBODY></TABLE>
  699. </FIELDSET>
  700. </div>
  701. <div style="width:60%; float:left; margin: 0; padding: 2px 5px 2px 5px;">
  702. <FIELDSET>
  703. <LEGEND style="FONT-FAMILY: Arial; FONT-SIZE: 12px">Salidas a generar</LEGEND>
  704. <ul id ="list_salidas" style="width:100%; margin: 2px 5px 2px 5px;">
  705. <li id='salida0' style="display:none; width:95%; margin:4px 0px 4px 0px; padding:4px 10px 4px 10px; border: 1px solid #CCCCCC;">
  706. <table cellspacing="2">
  707. <tr id='Obteniendo'>
  708. <td colspan="4"><b>Obteniendo datos. Espere por favor...&nbsp;</b><img border="0" src='images/cargando.gif' align='middle'/></td>
  709. </tr>
  710. <tr id='Destinatario' style="display:none">
  711. <td width="90px"><u>Destinatario:</u></td>
  712. <td colspan="2"><span id="name_dest" style="font-weight:bold;"></span></td>
  713. <td width="32px"><a id="btn_Eliminar" href="#" style="display:block; float:right">
  714. <img border="0" id='img_cancelar' src='images/IMG-Cancelar-17.png' align='middle' alt='Eliminar salida' />
  715. </a>
  716. </td>
  717. </tr>
  718. <tr>
  719. <td width="190px" colspan="2" style="width:150px"><u>Modo env&iacute;o:</u></td>
  720. <td width="100%"><select id="DESCMODOENVIO" name="DESCMODOENVIO" class=Lista
  721. size=1 alt="Modo de envío"></select>
  722. </td>
  723. <td width="32px"></td>
  724. </tr>
  725. <tr id=AYUNTAMIENTOS style="display:none">
  726. <td width="190px" colspan="2" style="width:150px"><u>Ayuntamiento:</u></td>
  727. <td width="100%" id=PRUEBA><TEXTAREA
  728. style="TEXT-ALIGN: left; BACKGROUND-COLOR: #ffffff; WIDTH: 100%; COLOR: #000000"
  729. id=TEXTOAYUNTAMIENTO class=Edit alt=Ayuntamiento maxLength=150
  730. name=TEXTOAYUNTAMIENTO></TEXTAREA></TD>
  731. <TD><button onclick="checkayuntamiento(document.getElementById('TEXTOAYUNTAMIENTO').value);">Buscar</button></TD>
  732. </tr>
  733. <tr style="display:none">
  734. <td width="190px" colspan="2" style="width:150px"><u>Destinatario:</u></td>
  735. <td width="100%"><input name="NAME" class="Edit" id="NAME" style="width:100%; text-align: left; background-color: #ffffff; color: #000000;"
  736. alt="Nombre y apellidos" value="Obteniendo datos"/>
  737. </td>
  738. <td width="32px"></td>
  739. </tr>
  740. <tr style="display:none">
  741. <td width="190px" colspan="2" style="width:150px"><u>E-mail:</u></td>
  742. <td width="100%" style="display: none"><input name=PIXEL_INFO_EMAIL class=Edit id=PIXEL_INFO_EMAIL style=" width:100%; text-align: left; background-color: #ffffff; color: #000000;" alt=Correo electrónico/>
  743. </td>
  744. <td width="100%" style="display: none"><input name=INTERIUS class=Edit id=INTERIUS readOnly style=" width:100%; text-align: left; background-color: #e1e1e1; color: #000000;" alt=INTERIUS/>
  745. </td>
  746. <td width="32px"></td>
  747. </tr>
  748. <tr style="display:none">
  749. <td width="190px" colspan="2" style="width:150px"><u>Tipo documental:</u></td>
  750. <td width="100%"><select name="TIPODOC" class="Lista" id="TIPODOC" style="width:100%; text-align: left; background-color: #ffffff; color: #000000;" alt="Tipo documental de salida">
  751. </select>
  752. </td>
  753. <td width="32px"></td>
  754. </tr>
  755. <tr id='DocInc1' style="display:none">
  756. <td width="190px" colSpan="3" ><u>Documentos a incluir:</u></td>
  757. <td width="32px"></td>
  758. </tr>
  759. <tr id='DocInc2' style="display:none">
  760. <td colSpan="3"><ul class="Docs" id="DOCUS">
  761. <li id="doc0" style="height:20px;width:0;float:left;"></li>
  762. </ul></td>
  763. <td width="32px"></td>
  764. </tr>
  765. </table>
  766. </li>
  767. </ul>
  768. </FIELDSET>
  769. </div>
  770. <input type="hidden" id="IdUser" name="IdUser" value="<%=iduser%>"/>
  771. <input type="hidden" id="Indice" name="Indice" value="<%=indice%>"/>
  772. <input type="hidden" id="Numero" name="Numero" value="<%=numero%>"/>
  773. </form>
  774.  
  775. <%
  776. Conn.Close
  777. Else
  778. Response.Write "ERROR: Fallo en parámetros"
  779. End If
  780. %>
  781. </body>
  782. </html>
Add Comment
Please, Sign In to add comment