/** * Sistema Integral de Planificación y Presupuesto (SIPP) * @file ente_planificador_sipp_mcti.js * Drupal part Module to Sistema Integral de Planificación y Presupuesto (SIPP) * Copyright 2011 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * @author Cenditel Merida - Msc. Jose puentes * @date 2015-01-12 // (año-mes-dia) * @version 0.1 // (0.1) */ /* * mostrar los campos seleccionados asi como el ocultarlos */ Drupal.behaviors.ente_planificador_sector = function (context) { //mostrando el campo ente ascrito a un organismo $("#organismo_ente").hide(); $("#sector_ente_planificador").hide(); $("#sub_ente").hide(); var nivel = $("#nivel option:selected").text(); $('#nivel select option').ready(function() { if (nivel == 'Organismo rector en planificación.') { $("#organismo").hide(); $("#sector_ente_planificador").show(); $("#sub_ente").hide(); } else if (nivel == 'Organismo público.') { $("#organismo").hide(); $("#sector_ente_planificador").show(); $("#sub_ente").hide(); } else if (nivel == 'Ente adscrito a un organismo público.') { $("#organismo_ente").hide(); $("#sector_ente_planificador").hide(); $("#sub_ente").hide(); } else if (nivel == 'Ente adscrito a otro ente adscrito (sub-ente adscrito).') { $("#sector_ente_planificador").hide(); $("#sub_ente").show(); } else if (nivel == 'Organismo rector en planificación.') { // si es un organismo publico $("#sector_ente_planificador").hide(); } else { $("#organismo_ente").hide(); $("#sector_ente_planificador").show(); } }); $('#nivel select option').click(function() { if (($(this).text() == 'Ente adscrito a un organismo público.')) { // si es un organismo publico $("#organismo_ente").show(); $("#sector_ente_planificador").hide(); $("#sub_ente").hide(); } else if (($(this).text() == 'Ente adscrito a otro ente adscrito (sub-ente adscrito).')) { // si es un organismo publico $("#sector_ente_planificador").hide(); $("#organismo_ente").hide(); $("#sub_ente").show(); } else if ($(this).text() == 'Organismo rector en planificación.') { // si es un organismo publico $("#sector_ente_planificador").hide(); } else { $("#organismo_ente").hide(); $("#sub_ente").hide(); $("#sector_ente_planificador").show(); } }); }