diff --git a/archive-programa.php b/archive-programa.php index 4ed11d04..6b5ad034 100644 --- a/archive-programa.php +++ b/archive-programa.php @@ -57,12 +57,11 @@ $query['sistema_operatiu'] = $sistema_operatiu; $args_so_baixades = get_post_query_args( 'baixada', SearchQueryType::Baixada, $query['sistema_operatiu'] ); - $baixades_posts = get_posts( $args_so_baixades ); $programes_baixades_ids = array_map( "extract_post_ids_program", $baixades_posts ); - if( isset( $args ) ) { + $args['posts_per_page'] = -1; $all_programs = get_posts( $args ); $all_programs_ids = array_map("extract_post_ids", $all_programs); diff --git a/static/js/programes.js b/static/js/programes.js index 3fbdc1a5..c46779f7 100644 --- a/static/js/programes.js +++ b/static/js/programes.js @@ -21,6 +21,19 @@ jQuery( document ).ready(function() { }); /** Cerca **/ +var $cerca_form = jQuery('#cerca_programes'); +$cerca_form.on('submit', function(){ + disable_empty_fields(); + return true; +}); + +function disable_empty_fields() { + jQuery('#cerca_programes').find('input, select').each(function(_, inp) { + if (jQuery(inp).val() === '' || jQuery(inp).val() === null || jQuery(inp).val() === '0') + inp.disabled = true; + }); +} + jQuery(".selectpicker").on('change', function() { jQuery( "#cerca_programes" ).submit(); }); diff --git a/templates/ajax/programs-list.twig b/templates/ajax/programs-list.twig index 355979c5..ab718bfd 100644 --- a/templates/ajax/programs-list.twig +++ b/templates/ajax/programs-list.twig @@ -1,11 +1,13 @@