1 | /** |
---|
2 | * Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
3 | * @file politicas_direccionales.js |
---|
4 | * Drupal part Module to Sistema Integral de Planificación y Presupuesto (SIPPES) |
---|
5 | * Copyright 2011 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL) |
---|
6 | * |
---|
7 | * This program is free software; you can redistribute it and/or modify |
---|
8 | * it under the terms of the GNU General Public License as published by |
---|
9 | * the Free Software Foundation; either version 2 of the License, or |
---|
10 | * (at your option) any later version. |
---|
11 | * |
---|
12 | * This program is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * GNU General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public License |
---|
18 | * along with this program; if not, write to the Free Software |
---|
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
20 | * |
---|
21 | * @author Cenditel Merida - Msc. Juan Vizcarrondo |
---|
22 | * @date 2013-12-02 // (año-mes-dia) |
---|
23 | * @version 0.1 // (0.1) |
---|
24 | */ |
---|
25 | |
---|
26 | /* |
---|
27 | * Implementacion valores iniciales |
---|
28 | */ |
---|
29 | var politicasDireccionales = {}; |
---|
30 | Drupal.behaviors.politicasDireccionales = function (context) { |
---|
31 | var causas = Drupal.settings.causas; |
---|
32 | var valores_causas = $("#edit-causas-politica").val(); |
---|
33 | $.each(causas, function(key) { |
---|
34 | $("#causas-descriptores-" + key).hide(); |
---|
35 | }); |
---|
36 | for (var k in valores_causas){ |
---|
37 | $("#causas-descriptores-" + valores_causas[k]).show(); |
---|
38 | } |
---|
39 | |
---|
40 | $("#edit-causas-politica").change(function(evt) { |
---|
41 | $.each(causas, function(key) { |
---|
42 | $("#causas-descriptores-" + key).hide(); |
---|
43 | }); |
---|
44 | var Var = $(this).val(); |
---|
45 | for (var k in Var){ |
---|
46 | $("#causas-descriptores-" + Var[k]).show(); |
---|
47 | } |
---|
48 | }); |
---|
49 | $(".ente-actores").each(function() { |
---|
50 | var valor = $(this).val(); |
---|
51 | var reque = $(this).attr('requerimiento'); |
---|
52 | var cant_actor = $(this).attr('cant_actor'); |
---|
53 | if (valor == 'otro') { |
---|
54 | $('#edit-otro-' + reque + '-' + cant_actor + '-wrapper').show(); |
---|
55 | } |
---|
56 | else { |
---|
57 | $('#edit-otro-' + reque + '-' + cant_actor + '-wrapper').hide(); |
---|
58 | } |
---|
59 | }); |
---|
60 | $(".ente-actores").change(function(evt) { |
---|
61 | var valor = $(this).val(); |
---|
62 | var reque = $(this).attr('requerimiento'); |
---|
63 | var cant_actor = $(this).attr('cant_actor'); |
---|
64 | if (valor == 'otro') { |
---|
65 | $('#edit-otro-' + reque + '-' + cant_actor + '-wrapper').show(); |
---|
66 | } |
---|
67 | else { |
---|
68 | $('#edit-otro-' + reque + '-' + cant_actor + '-wrapper').hide(); |
---|
69 | } |
---|
70 | }); |
---|
71 | } |
---|