Bug 8980 - Untranslatable strings in modborrowers.pl

This patch removes the declaration of interface labels
from the script and puts it in the template where the
labels can be translated. The labels have been modified
to match those used on the patron entry form.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Owen Leonard 2012-10-29 15:24:37 -04:00 committed by Paul Poulain
parent 678c7c4230
commit 715c52977a
2 changed files with 27 additions and 13 deletions

View file

@ -237,7 +237,32 @@
<ol>
[% FOREACH field IN fields %]
<li>
<label style="width:20em;">[% field.lib %]</label>
<label style="width:20em;">
[% SWITCH ( field.name ) %]
[% CASE 'surname' %]
Surname:
[% CASE 'firstname' %]
First name:
[% CASE 'branchcode' %]
Library:
[% CASE 'categorycode' %]
Category
[% CASE 'sort1' %]
Sort 1:
[% CASE 'sort2' %]
Sort 2:
[% CASE 'dateenrolled' %]
Registration date:
[% CASE 'dateexpiry' %]
Expiry date:
[% CASE 'debarred' %]
Restricted:
[% CASE 'debarredcomment' %]
Restriction comment:
[% CASE 'borrowernotes' %]
Circulation note:
[% END %]
</label>
[% IF field.mandatory %]
<input type="checkbox" title="This field is mandatory" name="disable_input" value="[% field.name %]" readonly="readonly" onclick="return false;" />
[% ELSE %]
@ -265,7 +290,7 @@
[% END %]
[% IF ( patron_attributes_codes ) %]
<li class="attributes">
<label style="width:20em;">Attribute
<label style="width:20em;">Attribute:
<select name="patron_attributes">
[% FOREACH pac IN patron_attributes_codes %]
<option value="[% pac.attribute_code %]" data-type="[% pac.type %]" data-category="[% pac.category_lib %]">[% pac.attribute_lib %]</option>

View file

@ -155,21 +155,18 @@ if ( $op eq 'show' ) {
my @fields = (
{
name => "surname",
lib => "Surname",
type => "text",
mandatory => ( grep /surname/, @mandatoryFields ) ? 1 : 0
}
,
{
name => "firstname",
lib => "Firstname",
type => "text",
mandatory => ( grep /surname/, @mandatoryFields ) ? 1 : 0,
}
,
{
name => "branchcode",
lib => "Branchname",
type => "select",
option => \@branches_option,
mandatory => ( grep /branchcode/, @mandatoryFields ) ? 1 : 0,
@ -177,7 +174,6 @@ if ( $op eq 'show' ) {
,
{
name => "categorycode",
lib => "Category",
type => "select",
option => \@categories_option,
mandatory => ( grep /categorycode/, @mandatoryFields ) ? 1 : 0,
@ -185,7 +181,6 @@ if ( $op eq 'show' ) {
,
{
name => "sort1",
lib => "Sort 1",
type => @sort1_option ? "select" : "text",
option => \@sort1_option,
mandatory => ( grep /sort1/, @mandatoryFields ) ? 1 : 0,
@ -193,7 +188,6 @@ if ( $op eq 'show' ) {
,
{
name => "sort2",
lib => "Sort 2",
type => @sort2_option ? "select" : "text",
option => \@sort2_option,
mandatory => ( grep /sort2/, @mandatoryFields ) ? 1 : 0,
@ -201,35 +195,30 @@ if ( $op eq 'show' ) {
,
{
name => "dateenrolled",
lib => "Date enrolled",
type => "date",
mandatory => ( grep /dateenrolled/, @mandatoryFields ) ? 1 : 0,
}
,
{
name => "dateexpiry",
lib => "Date expiry",
type => "date",
mandatory => ( grep /dateexpiry/, @mandatoryFields ) ? 1 : 0,
}
,
{
name => "debarred",
lib => "Debarred",
type => "date",
mandatory => ( grep /debarred/, @mandatoryFields ) ? 1 : 0,
}
,
{
name => "debarredcomment",
lib => "Debarred comment",
type => "text",
mandatory => ( grep /debarredcomment/, @mandatoryFields ) ? 1 : 0,
}
,
{
name => "borrowernotes",
lib => "Borrower Notes",
type => "text",
mandatory => ( grep /borrowernotes/, @mandatoryFields ) ? 1 : 0,
}