Changeset 892 for trunk


Ignore:
Timestamp:
11/01/16 15:10:39 (8 years ago)
Author:
Kris Deugau
Message:

/trunk

Commit tweak to city selection; on allocate-from-freeblock, preselect the
city of the parent

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r889 r892  
    508508    my $pinfo = getBlockData($ip_dbh, $webvar{parent});
    509509
     510    my @cities;
     511    foreach my $city (@citylist) {
     512      my %row = (city => $city, sel => ($pinfo->{city} eq $city) );
     513      push (@cities, \%row);
     514    }
     515    $page->param(preselected => 1);
     516    $page->param(citylist => \@cities);
     517
    510518    # Tree navigation
    511519    my $crumbs = getBreadCrumbs($ip_dbh, $webvar{parent});
     
    543551    $page->param(pops => \@pops);
    544552
     553    my @cities;
     554    foreach my $city (@citylist) {
     555      my %row = (city => $city);
     556      push (@cities, \%row);
     557    }
     558    $page->param(citylist => \@cities);
     559
    545560    # get all standard alloctypes
    546561    my $tlist = getTypeList($ip_dbh, 'a');
     
    548563    $page->param(typelist => $tlist);
    549564  }
    550 
    551   my @cities;
    552   foreach my $city (@citylist) {
    553     my %row = (city => $city);
    554     push (@cities, \%row);
    555   }
    556   $page->param(citylist => \@cities);
    557565
    558566## node hack
  • trunk/templates/assign.tmpl

    r878 r892  
    4242<td>
    4343<select name="city">
     44<TMPL_IF preselected>
     45<TMPL_LOOP NAME=citylist>
     46        <option<TMPL_IF sel> selected</TMPL_IF>><TMPL_VAR NAME=city></option></TMPL_LOOP>
     47<TMPL_ELSE>
    4448        <option selected="selected">-</option>
    4549<TMPL_LOOP NAME=citylist>
    4650        <option><TMPL_VAR NAME=city></option></TMPL_LOOP>
     51</TMPL_IF>
    4752</select>
    4853&nbsp;<a href="javascript:popNotes('<TMPL_VAR NAME=webpath>/cgi-bin/newcity.cgi')">Add new location</a>
Note: See TracChangeset for help on using the changeset viewer.