Bugzilla – Attachment 25212 Details for
Bug 7372
RoadTypes should be folded into Authorised Values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7372: Move road types from the roadtype table to the ROADTYPE AV
Bug-7372-Move-road-types-from-the-roadtype-table-t.patch (text/plain), 23.11 KB, created by
Sophie MEYNIEUX
on 2014-02-12 16:14:02 UTC
(
hide
)
Description:
Bug 7372: Move road types from the roadtype table to the ROADTYPE AV
Filename:
MIME Type:
Creator:
Sophie MEYNIEUX
Created:
2014-02-12 16:14:02 UTC
Size:
23.11 KB
patch
obsolete
>From 77fafed47cb58cf6b03f7dc7630ee9638d547902 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 23 Oct 2013 14:27:45 +0200 >Subject: [PATCH] Bug 7372: Move road types from the roadtype table to the > ROADTYPE AV > >Currently road types are stored in a specific table in DB. Moreover, an >admin page is present in order to manage them. >This patch proposes to remove this table and this page in favour of a >new authorised value category 'ROADTYPE'. > >This patch: >- adds a new AV category 'ROADTYPE' (created from the roadtype table > content). >- remove the roadtype table. >- remove the .pl and .tt file admin/roadtype >- remove the 2 routines C4::Members::GetRoadTypes and > C4::Members::GetRoadTypeDetails > >Test plan: >1/ Execute the updatedatabase entry and verify existing roadtypes are >now stored in the AV 'ROADTYPE'. >2/ Verify you can add/update a streettype for patrons. >3/ Verify on following pages the streettype is displayed in patron >information (top left): > circ/circulation.pl > members/memberentry.pl > members/moremember.pl > members/routing-lists.pl > >Signed-off-by: Sophie Meynieux <sophie.meynieux@biblibre.com> >--- > C4/Members.pm | 67 --------- > admin/roadtype.pl | 129 ----------------- > circ/circulation.pl | 2 +- > installer/data/mysql/updatedatabase.pl | 31 +++++ > .../intranet-tmpl/prog/en/includes/admin-menu.inc | 1 - > .../prog/en/modules/admin/admin-home.tt | 3 - > .../prog/en/modules/admin/roadtype.tt | 147 -------------------- > .../prog/en/modules/members/memberentrygen.tt | 14 +- > .../prog/en/modules/members/moremember.tt | 4 +- > members/memberentry.pl | 15 +- > members/moremember.pl | 4 +- > members/routing-lists.pl | 4 +- > 12 files changed, 50 insertions(+), 371 deletions(-) > delete mode 100755 admin/roadtype.pl > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt > >diff --git a/C4/Members.pm b/C4/Members.pm >index 29eda68..a0769ca 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -71,8 +71,6 @@ BEGIN { > > &GetAge > &GetCities >- &GetRoadTypes >- &GetRoadTypeDetails > &GetSortDetails > &GetTitles > >@@ -1860,48 +1858,6 @@ EOF > return 0; > } > >-=head2 GetRoadTypes (OUEST-PROVENCE) >- >- ($idroadtypearrayref, $roadttype_hashref) = &GetRoadTypes(); >- >-Looks up the different road type . Returns two >-elements: a reference-to-array, which lists the id_roadtype >-codes, and a reference-to-hash, which maps the road type of the road . >- >-=cut >- >-sub GetRoadTypes { >- my $dbh = C4::Context->dbh; >- my $query = qq| >-SELECT roadtypeid,road_type >-FROM roadtype >-ORDER BY road_type|; >- my $sth = $dbh->prepare($query); >- $sth->execute(); >- my %roadtype; >- my @id; >- >- # insert empty value to create a empty choice in cgi popup >- >- while ( my $data = $sth->fetchrow_hashref ) { >- >- push @id, $data->{'roadtypeid'}; >- $roadtype{ $data->{'roadtypeid'} } = $data->{'road_type'}; >- } >- >-#test to know if the table contain some records if no the function return nothing >- my $id = @id; >- if ( $id eq 0 ) { >- return (); >- } >- else { >- unshift( @id, "" ); >- return ( \@id, \%roadtype ); >- } >-} >- >- >- > =head2 GetTitles (OUEST-PROVENCE) > > ($borrowertitle)= &GetTitles(); >@@ -2001,29 +1957,6 @@ sub GetHideLostItemsPreference { > return $hidelostitems; > } > >-=head2 GetRoadTypeDetails (OUEST-PROVENCE) >- >- ($roadtype) = &GetRoadTypeDetails($roadtypeid); >- >-Returns the description of roadtype >-C<&$roadtype>return description of road type >-C<&$roadtypeid>this is the value of roadtype s >- >-=cut >- >-sub GetRoadTypeDetails { >- my ($roadtypeid) = @_; >- my $dbh = C4::Context->dbh; >- my $query = qq| >-SELECT road_type >-FROM roadtype >-WHERE roadtypeid=?|; >- my $sth = $dbh->prepare($query); >- $sth->execute($roadtypeid); >- my $roadtype = $sth->fetchrow; >- return ($roadtype); >-} >- > =head2 GetBorrowersToExpunge > > $borrowers = &GetBorrowersToExpunge( >diff --git a/admin/roadtype.pl b/admin/roadtype.pl >deleted file mode 100755 >index 6dd4a16..0000000 >--- a/admin/roadtype.pl >+++ /dev/null >@@ -1,129 +0,0 @@ >-#! /usr/bin/perl >- >-# Copyright 2006 SAN OUEST-PROVENCE et Paul POULAIN >-# >-# This file is part of Koha. >-# >-# Koha 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. >-# >-# Koha 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 Koha; if not, write to the Free Software Foundation, Inc., >-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >- >-use strict; >-use warnings; >- >-use CGI; >-use C4::Context; >-use C4::Output; >-use C4::Auth; >- >- >-sub StringSearch { >- my $sth = C4::Context->dbh->prepare("Select * from roadtype where (road_type like ?) ORDER BY road_type"); >- $sth->execute((shift || '') . '%'); >- return $sth->fetchall_arrayref({}); >-} >- >-my $input = new CGI; >-my $searchfield=$input->param('road_type'); >-my $script_name="/cgi-bin/koha/admin/roadtype.pl"; >-my $roadtypeid=$input->param('roadtypeid'); >-my $op = $input->param('op') || ''; >- >-my ($template, $loggedinuser, $cookie) >- = get_template_and_user({template_name => "admin/roadtype.tmpl", >- query => $input, >- type => "intranet", >- authnotrequired => 0, >- flagsrequired => {parameters => 'parameters_remaining_permissions'}, >- debug => 1, >- }); >- >- >-$template->param( script_name => $script_name, >- roadtypeid => $roadtypeid , >- searchfield => $searchfield); >- >- >-################## ADD_FORM ################################## >-# called by default. Used to create form to add or modify a record >-if ($op eq 'add_form') { >- $template->param(add_form => 1); >- >- #---- if primkey exists, it's a modify action, so read values to modify... >- my $data; >- if ($roadtypeid) { >- my $dbh = C4::Context->dbh; >- my $sth=$dbh->prepare("select roadtypeid,road_type from roadtype where roadtypeid=?"); >- $sth->execute($roadtypeid); >- $data=$sth->fetchrow_hashref; >- $sth->finish; >- } >- >- $template->param( >- road_type => $data->{'road_type'}, >- ); >-##############ICI##################### >-# END $OP eq ADD_FORM >-################## ADD_VALIDATE ################################# >-# called by add_form, used to insert/modify data in DB >-} elsif ($op eq 'add_validate') { >- my $dbh = C4::Context->dbh; >- my $sth; >- >- if ($input->param('roadtypeid') ){ >- $sth=$dbh->prepare("UPDATE roadtype SET road_type=? WHERE roadtypeid=?"); >- $sth->execute($input->param('road_type'),$input->param('roadtypeid')); >- >- } >- else{ >- $sth=$dbh->prepare("INSERT INTO roadtype (road_type) VALUES (?)"); >- $sth->execute($input->param('road_type')); >- } >- $sth->finish; >- print $input->redirect("/cgi-bin/koha/admin/roadtype.pl"); >- exit; >- >-# END $OP eq ADD_VALIDATE >-################## DELETE_CONFIRM ################################## >-# called by default form, used to confirm deletion of data in DB >-} elsif ($op eq 'delete_confirm') { >- $template->param(delete_confirm => 1); >- my $dbh = C4::Context->dbh; >- my $sth2=$dbh->prepare("select roadtypeid,road_type from roadtype where roadtypeid=?"); >- $sth2->execute($roadtypeid); >- my $data=$sth2->fetchrow_hashref; >- $sth2->finish; >- >- $template->param( >- road_type => ( $data->{'road_type'}), >- ); >- >- >- # END $OP eq DELETE_CONFIRM >-################## DELETE_CONFIRMED ################################## >-# called by delete_confirm, used to effectively confirm deletion of data in DB >-} elsif ($op eq 'delete_confirmed') { >- my $dbh = C4::Context->dbh; >- my $categorycode=uc($input->param('roadtypeid')); >- my $sth=$dbh->prepare("delete from roadtype where roadtypeid=?"); >- $sth->execute($roadtypeid); >- $sth->finish; >- print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=roadtype.pl\"></html>"; >- exit; >- # END $OP eq DELETE_CONFIRMED >-} else { # DEFAULT >- $template->param(else => 1); >- $template->param(loop => StringSearch($searchfield)); >- >- >-} #---- END $OP eq DEFAULT >-output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 7d214ea..509cd1d 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -686,7 +686,7 @@ if($bor_messages_loop){ $template->param(flagged => 1 ); } > # Computes full borrower address > my @fulladdress; > push @fulladdress, $borrower->{'streetnumber'} if ( $borrower->{'streetnumber'} ); >-push @fulladdress, &GetRoadTypeDetails( $borrower->{'streettype'} ) if ( $borrower->{'streettype'} ); >+push @fulladdress, C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{'streettype'} ) if ( $borrower->{'streettype'} ); > push @fulladdress, $borrower->{'address'} if ( $borrower->{'address'} ); > > my $fast_cataloging = 0; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f043d0b..a96419d 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7953,6 +7953,37 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->{AutoCommit} = 0; >+ $dbh->{RaiseError} = 1; >+ >+ my $av_added = $dbh->do(q| >+ INSERT INTO authorised_values(category, authorised_value, lib, lib_opac) >+ SELECT 'ROADTYPE', roadtypeid, road_type, road_type >+ FROM roadtype; >+ |); >+ >+ my $rt_deleted = $dbh->do(q| >+ DELETE FROM roadtype >+ |); >+ >+ if ( $av_added == $rt_deleted or $rt_deleted eq "0E0" ) { >+ $dbh->do(q| >+ DROP TABLE roadtype; >+ |); >+ $dbh->commit; >+ print "Upgrade to $DBversion done (Bug 7372: Move road types from the roadtype table to the ROADTYPE authorised values)\n"; >+ SetVersion($DBversion); >+ } else { >+ print "Upgrade to $DBversion failed (Bug 7372: Move road types from the roadtype table to the ROADTYPE authorised values.\nTransaction aborted because $@\n)"; >+ $dbh->rollback; >+ } >+ >+ $dbh->{AutoCommit} = 1; >+ $dbh->{RaiseError} = 0; >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc >index 91878bf..ebd345c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc >@@ -33,7 +33,6 @@ > <li><a href="/cgi-bin/koha/admin/transport-cost-matrix.pl">Transport cost matrix</a></li> > <li><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></li> > <li><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></li> >- <li><a href="/cgi-bin/koha/admin/roadtype.pl">Road types</a></li> > </ul> > > <h5>Catalog</h5> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >index 46a3b3a..217b069 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >@@ -56,9 +56,6 @@ > <dd>Define rules for check-in and checkout notifications for combinations of libraries, patron categories, and item types</dd> > <dt><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></dt> > <dd>Define cities and towns that your patrons live in.</dd> >- <dt><a href="/cgi-bin/koha/admin/roadtype.pl" >Road types</a> >- </dt> >- <dd>Define road types (street, avenue, way, etc.). Road types display as authorized values when adding/editing patrons and can be used in geographic statistics.</dd> > </dl> > </div> > <div class="yui-u"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt >deleted file mode 100644 >index ad491fd..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt >+++ /dev/null >@@ -1,147 +0,0 @@ >-[% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Administration › [% IF ( add_form ) %]Road types › [% IF ( roadtypeid ) %] Modify road type[% ELSE %] New road type[% END %][% ELSE %][% IF ( delete_confirm ) %]Road types › Confirm deletion of road type[% ELSE %] Road type[% END %][% END %]</title> >-[% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// >- function isNotNull(f,noalert) { >- if (f.value.length == 0) { >- return false; >- } >- return true; >- } >- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// >- function toUC(f) { >- var x=f.value.toUpperCase(); >- f.value=x; >- return true; >- } >- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// >- function isNum(v,maybenull) { >- var n = new Number(v.value); >- if (isNaN(n)) { >- return false; >- } >- if (maybenull == 0 && v.value =='') { >- return false; >- } >- return true; >- } >- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// >- function isDate(f) { >- var t = Date.parse(f.value); >- if (isNaN(t)) { >- return false; >- } >- } >- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// >- function Check(f) { >- var ok=1; >- var _alertString=""; >- var alertString2; >- if (f.road_type.value.length == 0 ) { >- _alertString += "\n- " + _("Road type"); >- alert(_alertString); >- } >- else{ >- document.Aform.submit(); >- } >- } >-//]]> >-</script> >-</head> >-<body id="admin_roadtype" class="admin"> >-[% INCLUDE 'header.inc' %] >-[% INCLUDE 'roadtype-admin-search.inc' %] >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( add_form ) %]<a href="/cgi-bin/koha/admin/roadtype.pl">Road types</a> › [% IF ( roadtypeid ) %] Modify road type[% ELSE %] New road type[% END %][% ELSE %][% IF ( delete_confirm ) %]<a href="/cgi-bin/koha/admin/roadtype.pl">Road types</a> › Confirm deletion of road type[% ELSE %] Road type[% END %][% END %]</div> >- >-<div id="doc3" class="yui-t2"> >- >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >- >-[% IF ( add_form ) %] >- [% IF ( roadtypeid ) %] >- <h1>Modify road type</h1> >- [% ELSE %] >- <h1>New road type</h1> >- [% END %] >- >- <form action="[% script_name %]" name="Aform" method="post"> >- <input type="hidden" name="op" value="add_validate" /> >- <input type="hidden" name="checked" value="0" /> >- <input type="hidden" name="roadtypeid" value="[% roadtypeid %]" /> >- >-<fieldset class="rows"><ol> >-[% IF ( roadtypeid ) %] >-<li> >- <span class="label">Road type: </span>[% roadtypeid %] >- </li> >-[% END %] >- <li> >- <label for="road_type">Road type: </label> >- <input type="text" name="road_type" id="road_type" size="80" maxlength="100" value="[% road_type |html %]" /> >- </li></ol></fieldset> >- >- <fieldset class="action"> >- <input class="button" type="button" onclick="Check(this.form)" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/roadtype.pl">Cancel</a> >- </fieldset> >- </form> >-[% END %] >- >-[% IF ( delete_confirm ) %] >- <div class="dialog alert"><h3>Delete road type "[% road_type %]?"</h3> >-<table> <tr> >- <th>Road type id: </th> >- <td>[% roadtypeid %]</td> >- </tr> >- <tr> <th>Road type: </th> >- <td>[% road_type %] >- </td> >- >- </tr></table><form action="[% script_name %]" method="post"> >- <input type="hidden" name="op" value="delete_confirmed" /> >- <input type="hidden" name="roadtypeid" value="[% roadtypeid %]" /><input type="submit" class="approve" value="Yes, delete" /></form> <form action="[% script_name %]" method="post"> >- <input type="submit" class="deny" value="No, do not delete" /></form></div> >-[% END %] >- >-[% IF ( else ) %] >- >-<div id="toolbar" class="btn-toolbar"> >- <a class="btn btn-small" id="addroad" href="/cgi-bin/koha/admin/roadtype.pl?op=add_form"><i class="icon-plus"></i> New road type</a> >-</div> >- >- <h2>Road type</h2> >- [% IF ( searchfield ) %] >- Search on [% searchfield %] >- [% END %] >- >-[% IF ( loop ) %] <table> >- <tr> >- <th>Road type</th> >- <th colspan="2"> </th> >- </tr> >- [% FOREACH loo IN loop %] >- [% UNLESS ( loop.odd ) %] >- <tr class="highlight"> >- [% ELSE %] >- <tr> >- [% END %] >- <td>[% loo.road_type %]</td> >- <td><a href="[% loo.script_name %]?op=add_form&roadtypeid=[% loo.roadtypeid %]">Edit</a></td> >- <td><a href="[% loo.script_name %]?op=delete_confirm&roadtypeid=[% loo.roadtypeid %]">Delete</a></td> >- </tr> >- [% END %] >- </table>[% END %] >-[% END %] >- >-</div> >-</div> >-<div class="yui-b"> >-[% INCLUDE 'admin-menu.inc' %] >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >- >- >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 05b5b4e..469bbbd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -218,7 +218,6 @@ > <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField %]" /> > <input type="hidden" name="category_type" value="[% category_type %]" /> > <input type="hidden" name="updtype" value="[% updtype %]" /> >-<input type="hidden" name="select_roadtype" value="[% select_roadtype %]" /> > <input type="hidden" name="destination" value="[% destination %]" /> > <input type="hidden" name="check_member" value="[% check_member %]" /> > <input type="hidden" name="borrowernumber" value="[% IF ( opduplicate ) %][% ELSE %][% borrowernumber %][% END %]" /> >@@ -456,7 +455,7 @@ > </li> > [% END %] > [% UNLESS nostreettype %] >- [% IF ( road_cgipopup ) %] >+ [% IF roadtypes %] > <li> > [% IF ( mandatorystreettype ) %] > <label for="streettype" class="required"> >@@ -464,7 +463,16 @@ > <label for="streettype"> > [% END %] > Street type: </label> >- [% roadpopup %] >+ <select name="streettype"> >+ <option value=""></option> >+ [% FOR roadtype IN roadtypes %] >+ [% IF roadtype.selected %] >+ <option value="[% roadtype.authorised_value %]" selected="selected">[% roadtype.lib %]</option> >+ [% ELSE %] >+ <option value="[% roadtype.authorised_value %]">[% roadtype.lib %]</option> >+ [% END %] >+ [% END %] >+ </select> > [% IF ( mandatorystreettype ) %]<span class="required">Required</span>[% END %] > </li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 79d319e..cd2b0be 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -211,9 +211,7 @@ function validate1(date) { > [% UNLESS ( I ) %][% IF ( othernames ) %]“[% othernames %]”[% END %] > > <p class="address">[% streetnumber %] >- [% IF ( roaddetails ) %] >- [% roaddetails %] >- [% END %] >+ [% IF roadtype %][% roadtype %][% END %] > [% address %]<br /> > [% IF ( address2 ) %][% address2 %]<br />[% END %] > [% IF ( city ) %][% city %][% END %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 3d68e49..429768a 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -204,7 +204,6 @@ if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) > qr/^nodouble$/, > qr/^op$/, > qr/^save$/, >- qr/^select_roadtype$/, > qr/^updtype$/, > qr/^SMSnumber$/, > qr/^setting_extended_patron_attributes$/, >@@ -549,17 +548,8 @@ if (@{$city_arrayref} ) { > } > } > >-my $default_roadtype; >-$default_roadtype=$data{'streettype'} ; >-my($roadtypeid,$road_type)=GetRoadTypes(); >- $template->param( road_cgipopup => 1) if ($roadtypeid ); >-my $roadpopup = CGI::popup_menu(-name=>'streettype', >- -id => 'streettype', >- -values=>$roadtypeid, >- -labels=>$road_type, >- -override => 1, >- -default=>$default_roadtype >- ); >+my $roadtypes = C4::Koha::GetAuthorisedValues( 'ROADTYPE', $data{streettype} ); >+$template->param( roadtypes => $roadtypes); > > my $default_borrowertitle = ''; > unless ( $op eq 'duplicate' ) { $default_borrowertitle=$data{'title'} } >@@ -731,7 +721,6 @@ $template->param( > ethcatpopup => $ethcatpopup, > relshiploop => \@relshipdata, > city_loop => $city_arrayref, >- roadpopup => $roadpopup, > borrotitlepopup => $borrotitlepopup, > guarantorinfo => $guarantorinfo, > flagloop => \@flagdata, >diff --git a/members/moremember.pl b/members/moremember.pl >index adce9d2..e794efa 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -246,7 +246,7 @@ my $relissue = []; > if ( @borrowernumbers ) { > $relissue = GetPendingIssues(@borrowernumbers); > } >-my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} ); >+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); > my $today = DateTime->now( time_zone => C4::Context->tz); > $today->truncate(to => 'day'); > my @borrowers_with_issues; >@@ -412,7 +412,7 @@ $template->param( > detailview => 1, > AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"), > CANDELETEUSER => $candeleteuser, >- roaddetails => $roaddetails, >+ roadtype => $roadtype, > borrowernumber => $borrowernumber, > othernames => $data->{'othernames'}, > categoryname => $data->{'description'}, >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index 70165f7..6331d07 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -101,8 +101,8 @@ if ($borrowernumber) { > > > # Computes full borrower address >-my (undef, $roadttype_hashref) = &GetRoadTypes(); >-my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'}; >+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} ); >+my $address = $borrower->{'streetnumber'} . " $roadtype " . $borrower->{'address'}; > > $template->param( > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7372
:
22310
|
22542
|
25212
|
25540
|
31526
|
32083