Bugzilla – Attachment 74906 Details for
Bug 20444
Remove C4::Members::Attributes::GetAttributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20444: Use Koha::Patron::Attribute::Types object for getting patron attributes in letter.pl
Bug-20444-Use-KohaPatronAttributeTypes-object-for-.patch (text/plain), 2.22 KB, created by
Marcel de Rooy
on 2018-04-27 08:39:37 UTC
(
hide
)
Description:
Bug 20444: Use Koha::Patron::Attribute::Types object for getting patron attributes in letter.pl
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-04-27 08:39:37 UTC
Size:
2.22 KB
patch
obsolete
>From 04bc117fc8ba56b4bcff803307c6b02957bd997c Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Mon, 19 Mar 2018 09:27:07 +0000 >Subject: [PATCH] Bug 20444: Use Koha::Patron::Attribute::Types object for > getting patron attributes in letter.pl >MIME-Version: 1.0 >Content-Type: text/plain; charset=utf-8 >Content-Transfer-Encoding: 8bit >Content-Type: text/plain; charset=utf-8 > >Test plan: >0) Apply the patch >1) Do not have any patron attribute types defined >2) Go to Tools -> Notices and slips >3) Edit any slip/letter which uses table borrower >4) Confirm the editing works, and the slip/letter itself works >5) Add some patron attributes types and define them a value for any >patron >6) Go to Tools -> Notices and slips and edit any slip/letter which uses >table borrower >7) Confirm, the attributes are listed in available fields >8) Confirm the slip/letter is working when you add a attribute to it > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > tools/letter.pl | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > >diff --git a/tools/letter.pl b/tools/letter.pl >index 92615a5..5f90149 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -46,7 +46,8 @@ use C4::Auth; > use C4::Context; > use C4::Output; > use C4::Letters; >-use C4::Members::Attributes; >+ >+use Koha::Patron::Attribute::Types; > > # $protected_letters = protected_letters() > # - return a hashref of letter_codes representing letters that should never be deleted >@@ -466,12 +467,14 @@ sub get_columns_for { > } > } > if ($table eq 'borrowers') { >- if ( my $attributes = C4::Members::Attributes::GetAttributes() ) { >- foreach (@$attributes) { >- push @fields, { >- value => "borrower-attribute:$_", >- text => "attribute:$_", >- } >+ my $attribute_types = Koha::Patron::Attribute::Types->search( >+ {}, >+ { order_by => 'code' }, >+ ); >+ while ( my $at = $attribute_types->next ) { >+ push @fields, { >+ value => "borrower-attribute:" . $at->code, >+ text => "attribute:" . $at->code, > } > } > } >-- >2.1.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 20444
:
73083
|
73084
|
73085
|
74788
|
74789
|
74790
|
74793
|
74794
|
74795
| 74906 |
74907
|
74908