@@ -, +, @@ - In Administration -> Authorized values, locate the category 'PATRON_TITLE'. - Create two or more authorized values with new patron titles. - In Administration -> System preferences -> Patrons, there should be no entry for BorrowersTitles. - Create or edit a patron. Under "Salutation" your authorized values should appear correctly. - Log in to the OPAC and go to "Your personal details." Confirm that the correct values are shown there. - Remove all PATRON_TITLE authorized values and confirm that the "Salutation" field no longer appears on the staff client or OPAC patron entry form. --- ...bug_11815-convert-borrowertitle-to-authval.perl | 23 ++++++++++++++++++++++ installer/data/mysql/sysprefs.sql | 1 - .../prog/en/modules/admin/authorised_values.tt | 2 ++ .../prog/en/modules/admin/preferences/patrons.pref | 5 ----- .../prog/en/modules/members/memberentrygen.tt | 10 +++++----- .../bootstrap/en/modules/opac-memberentry.tt | 10 +++++----- members/memberentry.pl | 3 +++ opac/opac-memberentry.pl | 3 +++ 8 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_11815-convert-borrowertitle-to-authval.perl --- a/installer/data/mysql/atomicupdate/bug_11815-convert-borrowertitle-to-authval.perl +++ a/installer/data/mysql/atomicupdate/bug_11815-convert-borrowertitle-to-authval.perl @@ -0,0 +1,23 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + my ( $BorrowersTitles ) = $dbh->selectrow_array( q| + SELECT value FROM systempreferences WHERE variable='BorrowersTitles'; + |); + if( $BorrowersTitles ){ + $dbh->do(" + INSERT INTO authorised_value_categories( category_name ) VALUES ('PATRON_TITLE') + "); + my @titles; + push @titles, split ('\|', $BorrowersTitles); + my $sth = $dbh->prepare(" + INSERT INTO authorised_values(category, authorised_value, lib, lib_opac) VALUES ('PATRON_TITLE', ?, ?, ?) + "); + foreach my $patron_title ( @titles ) { + $sth->execute( $patron_title, $patron_title, $patron_title ); + } + } + # Remove the BorrowersTitles system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='BorrowersTitles'"); + SetVersion ($DBversion); + print "Upgrade to $DBversion done (Bug 11815: convert BorrowersTitles to an authorised value)\n"; +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -101,7 +101,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'), ('BorrowerRenewalPeriodBase','now','dateexpiry|now|combination','Set whether the borrower renewal date should be counted from the dateexpiry, from the current date or by combination: if the dateexpiry is in future use dateexpiry, else use current date ','Choice'), ('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'), -('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'), ('BorrowerUnwantedField','',NULL,'Name the fields you don\'t need to store for a patron\'s account','free'), ('BranchTransferLimitsType','ccode','itemtype|ccode','When using branch transfer limits, choose whether to limit by itemtype or collection code.','Choice'), ('BrowseResultSelection','0',NULL,'Enable/Disable browsing search results fromt the bibliographic record detail page in staff client','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -392,6 +392,8 @@
A list of reasons displayed in the suggestion form on the OPAC.
[% CASE 'ORDER_CANCELLATION_REASON' %]Reasons why an order might have been cancelled
+ [% CASE 'PATRON_TITLE' %] +Titles or honorifics which can be added to a patron record
[% CASE 'PAYMENT_TYPE' %]Populates a dropdown list of custom payment types when paying fines
[% CASE 'qualif' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -53,11 +53,6 @@ Patrons: class: multi - (input multiple choices separated by |). Leave empty to deactivate - - - "Borrowers can have the following titles:" - - pref: BorrowersTitles - class: multi - - (separate multiple choices with |) - - - pref: CheckPrevCheckout default: no choices: --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -183,7 +183,7 @@