Changeset 12138


Ignore:
Timestamp:
2006-07-11T15:09:11+12:00 (18 years ago)
Author:
mdewsnip
Message:

Now all states are included in the static states page, even if they contain no institutions (needed for the "search institutions by state" page).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cic-hcap/perllib/plugins/CICPlug.pm

    r12134 r12138  
    12071207
    12081208    print BROWSER_MACROFILE "<table cellpadding=\"0\" cellspacing=\"0\" width=\"_pagewidth_\">\n";
    1209     foreach my $state (sort(keys(%{$state_to_ids_mapping}))) {
     1209    foreach my $state (sort(keys(%state_name_to_abbr_mapping))) {
    12101210    my $state_abbr = $state_name_to_abbr_mapping{$state};
    12111211    print BROWSER_MACROFILE "_cicstate" . $state_abbr . "_\n";
     
    12141214    print BROWSER_MACROFILE "}\n";
    12151215
    1216     foreach my $state (sort(keys(%{$state_to_ids_mapping}))) {
     1216    foreach my $state (sort(keys(%state_name_to_abbr_mapping))) {
    12171217    my $state_abbr = $state_name_to_abbr_mapping{$state};
    12181218    print BROWSER_MACROFILE "\n_cicstate" . $state_abbr . "_ {";
    1219     my @state_ids = @{$state_to_ids_mapping->{$state}};
     1219    my @state_ids = ();
     1220    if (defined($state_to_ids_mapping->{$state})) {
     1221        @state_ids = @{$state_to_ids_mapping->{$state}};
     1222    }
    12201223    &write_static_browser_macros_chunk($state, \@state_ids, $id_to_name_mapping, undef);
     1224    if (!defined($state_to_ids_mapping->{$state})) {
     1225        print BROWSER_MACROFILE "<tr><td colspan=\"2\" valign=\"top\">No institutions for this state</td></tr>";
     1226    }
    12211227    print BROWSER_MACROFILE "}\n";
    12221228    }
Note: See TracChangeset for help on using the changeset viewer.