Changeset 388


Ignore:
Timestamp:
09/21/12 13:05:17 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Extend location view on the record page to either show a dropdown
when adding/editing if the user has record_locchg permission, or
just show the location's short description if not. See #10.
Also add the new permission to the permissions subtemplate.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r383 r388  
    21212121  return unless ($permissions{admin} || $permissions{location_view});
    21222122
    2123   my $loclist = getLocDropdown($dbh, $cur, $defloc);
    2124 
    21252123  $page->param(location_view => ($permissions{admin} || $permissions{location_view}));
    2126   $page->param(loclist => $loclist);
     2124
     2125  if ($permissions{admin} || $permissions{record_locchg}) {
     2126    my $loclist = getLocDropdown($dbh, $cur, $defloc);
     2127    $page->param(record_locchg => 1);
     2128    $page->param(loclist => $loclist);
     2129  } else {
     2130    my $loc = getLoc($dbh, $defloc);
     2131    $page->param(loc_name => $loc->{description});
     2132  }
    21272133} # end fill_loclist()
    21282134
  • trunk/templates/permlist.tmpl

    r370 r388  
    2222        <td<TMPL_UNLESS may_record_create> class="<TMPL_UNLESS info>noaccess<TMPL_ELSE>info</TMPL_UNLESS>"</TMPL_UNLESS>><input type="checkbox"<TMPL_UNLESS info> name="record_create"</TMPL_UNLESS><TMPL_IF record_create> checked="checked"</TMPL_IF><TMPL_UNLESS may_record_create> disabled="disabled"</TMPL_UNLESS> /> Create</td>
    2323        <td<TMPL_UNLESS may_record_delete> class="<TMPL_UNLESS info>noaccess<TMPL_ELSE>info</TMPL_UNLESS>"</TMPL_UNLESS>><input type="checkbox"<TMPL_UNLESS info> name="record_delete"</TMPL_UNLESS><TMPL_IF record_delete> checked="checked"</TMPL_IF><TMPL_UNLESS may_record_delete> disabled="disabled"</TMPL_UNLESS> /> Delete</td>
     24        <td<TMPL_UNLESS may_record_locchg> class="<TMPL_UNLESS info>noaccess<TMPL_ELSE>info</TMPL_UNLESS>"</TMPL_UNLESS>><input type="checkbox"<TMPL_UNLESS info> name="record_locchg"</TMPL_UNLESS><TMPL_IF record_locchg> checked="checked"</TMPL_IF><TMPL_UNLESS may_record_locchg> disabled="disabled"</TMPL_UNLESS> /> Change location</td>
    2425        <!-- td class="noaccess"> - Delegate</td -->
    2526</tr>
  • trunk/templates/record.tmpl

    r383 r388  
    7373        <tr class="datalinelight">
    7474                <td>Location/view</td>
     75<TMPL_IF record_locchg>
    7576                <td><select name="location">
    7677<TMPL_LOOP name=loclist>                <option value="<TMPL_VAR NAME=loc>"<TMPL_IF selected> selected="selected"</TMPL_IF>><TMPL_VAR NAME=locname></option>
    7778</TMPL_LOOP>
    7879                </select></td>
     80<TMPL_ELSE>
     81                <td><TMPL_VAR NAME=loc_name></td>
     82</TMPL_IF>
    7983        </tr>
    8084</TMPL_IF>
Note: See TracChangeset for help on using the changeset viewer.