[Koha-patches] [PATCH] Bug 3514 syspref to control whether the Return column is active in Patron Details checkout list

Jane Wagner jwagner at ptfs.com
Fri Aug 7 18:38:31 CEST 2009


Returning items through patron details tab checkout list does not seem to activate the same functionality that doing a return through Circulation, Checkin would.  In particular, it doesn't trigger holds.  This patch is a workaround to the problem -- it allows the library to turn off display of the Returns column by setting a new syspref, PatronDisplayReturn, to off.  This will force staff to use Circulation, Checkin to return items.

A longterm fix to the whole problem is still needed.
---
 admin/systempreferences.pl                         |    1 +
 installer/data/mysql/en/mandatory/sysprefs.sql     |    1 +
 .../1-Obligatoire/unimarc_standard_systemprefs.sql |    1 +
 .../ru-RU/mandatory/system_preferences_optimal.sql |    1 +
 installer/data/mysql/updatedatabase.pl             |    9 +++++++++
 .../prog/en/modules/members/moremember.tmpl        |   12 +++++++++++-
 members/moremember.pl                              |    3 +++
 7 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl
index 15bf608..e9e1586 100755
--- a/admin/systempreferences.pl
+++ b/admin/systempreferences.pl
@@ -200,6 +200,7 @@ $tabsysprefs{AutoEmailOpacUser}            = "Patrons";
 $tabsysprefs{AutoEmailPrimaryAddress}      = "Patrons";
 $tabsysprefs{EnhancedMessagingPreferences} = "Patrons";
 $tabsysprefs{'SMSSendDriver'}              = 'Patrons';
+$tabsysprefs{'PatronDisplayReturn'}        = 'Patrons';
 
 # I18N/L10N
 $tabsysprefs{dateformat}    = "I18N/L10N";
diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql
index e10058f..4e7a5a6 100644
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -247,3 +247,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('v
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('FilterBeforeOverdueReport','0','Do not run overdue report until filter selected','','YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '<itemcallnumber><copynumber>', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.', 'Textarea');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
+INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('PatronDisplayReturn', '1', '', 'If ON, allows items to be returned in the patron details display checkout list.', 'YesNo');
diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
index 5fa55c0..c58cae0 100644
--- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
+++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
@@ -249,3 +249,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('v
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('FilterBeforeOverdueReport','0','Ne pas lancer le rapport sur les retards tant qu''il n''y a pas de filtre','','YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '<itemcallnumber><copynumber>', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.', 'Textarea');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
+INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES ('PatronDisplayReturn', '1', '', ' Si ACTIVE, permet le retour des documents depuis la page d'affichage des prêts en cours de l'adhérent.', 'YesNo');
diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql
index da8b906..45649d6 100644
--- a/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql
+++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_optimal.sql
@@ -237,3 +237,4 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'if ON, enables the librarian to choose when they want to check out a notForLoan regular item',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES ('PatronDisplayReturn', '1', '', 'If ON, allows items to be returned in the patron details display checkout list.', 'YesNo');
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 4954962..1ee8cd0 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -2488,6 +2488,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     print "Upgrade to $DBversion done (added SpineLabelFormat and SpineLabelAutoPrint sysprefs)\n";
 }
 
+$DBversion = '3.01.00.040';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'PatronDisplayReturn', '1', '', 'If ON, allows items to be returned in the patron details display checkout list.', 'YesNo')");
+    print "Upgrade to $DBversion done (added PatronDisplayReturn system preference)\n";
+    SetVersion ($DBversion);
+}
+
+
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
index d3deaf9..d905b77 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
@@ -393,7 +393,9 @@ if (nodename =="barcodes[]"){
             <th scope="col">Charge</th>
             <th scope="col">Price</th>
             <th scope="col">Renew <p class="column-tool"><a href="#" id="CheckAllitems">select all</a> | <a href="#" id="CheckNoitems">none</a></p></th>
+    <!-- TMPL_IF NAME="dispreturn" -->
             <th scope="col">Return <p class="column-tool"><a href="#" id="CheckAllreturns">select all</a> | <a href="#" id="CheckNoreturns">none</a></p></th>
+    <!-- /TMPL_IF -->
         </tr></thead>
     	<tfoot>
 		<tr>
@@ -471,6 +473,7 @@ if (nodename =="barcodes[]"){
             <!-- /TMPL_IF -->
             </td>
       <!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="dispreturn" -->
       <!-- TMPL_IF NAME="return_failed" -->
             <td class="problem">Return Failed</td>
       <!--TMPL_ELSE-->
@@ -478,6 +481,7 @@ if (nodename =="barcodes[]"){
                 <input type="checkbox" name="all_barcodes[]" value="<!-- TMPL_VAR NAME="barcode" -->" checked="checked" style="display: none;" />
             </td>
       <!-- /TMPL_IF -->
+      <!-- /TMPL_IF -->
         </tr>
   <!-- /tmpl_loop -->
         </tbody>
@@ -488,10 +492,16 @@ if (nodename =="barcodes[]"){
         <label for="override_limit">Override Renewal Limit:</label>
         <input type="checkbox" name="override_limit" id="override_limit" value="1" />
         <!-- /TMPL_IF -->
-        <!-- /TMPL_IF -->
+      <!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="dispreturn" -->
         <input type="submit" name="renew_checked" value="Renew or Return checked items" />
+      <!--TMPL_ELSE-->
+        <input type="submit" name="renew_checked" value="Renew checked items" />
+      <!-- /TMPL_IF -->
         <input type="submit" id="renew_all" name="renew_all" value="Renew all" />
+    <!-- TMPL_IF NAME="dispreturn" -->
         <input type="submit" id="return_all" name="return_all" value="Return all" />
+      <!-- /TMPL_IF -->
         </fieldset>
     </form><!-- TMPL_ELSE --><p>Patron has nothing checked out.</p><!-- /TMPL_IF -->
 	</div>
diff --git a/members/moremember.pl b/members/moremember.pl
index 494121f..e9e46dd 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -58,6 +58,7 @@ BEGIN {
 	$debug = $ENV{DEBUG} || 0;
 }
 
+my $dispreturn = C4::Context->preference('PatronDisplayReturn');
 my $dbh = C4::Context->dbh;
 
 my $input = new CGI;
@@ -345,6 +346,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
     }
 }
 
+
 if (C4::Context->preference('EnhancedMessagingPreferences')) {
     C4::Form::MessagingPreferences::set_form_values({ borrowernumber => $borrowernumber }, $template);
     $template->param(messaging_form_inactive => 1);
@@ -358,6 +360,7 @@ $template->param(
     DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
     roaddetails     => $roaddetails,
     borrowernumber  => $borrowernumber,
+    dispreturn      => $dispreturn,
     categoryname    => $data->{'description'},
     reregistration  => $reregistration,
     branch          => $branch,
-- 
1.5.6.5




More information about the Koha-patches mailing list