Created attachment 56026 [details] [review] Bug 17397: Show name of librarian who created circulation message Test plan: 1) Apply the patch 2) Update DB structure 3) Run update_dbix_class_files.pl 4) Select patron for checking out 5) Try to add some circulation and opac messages 6) Note that now there is creator (you ;) ) shown by every message added (with link to creator profile) 7) Try to delete messages to confirm that everything works as expected
Sorry, QA-Tools complain: FAIL koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (...) FAIL tt_valid lines 855 See: https://wiki.koha-community.org/wiki/Coding_Guidelines#HTML1:_Template_Toolkit_markup_inside_HTML
Created attachment 56044 [details] [review] Bug 17397: Show name of librarian who created circulation message Test plan: 1) Apply the patch 2) Update DB structure 3) Run update_dbix_class_files.pl 4) Select patron for checking out 5) Try to add some circulation and opac messages 6) Note that now there is creator (you ;) ) shown by every message added (with link to creator profile) 7) Try to delete messages to confirm that everything works as expected
Created attachment 56045 [details] [review] Bug 17397: Show name of librarian who created circulation message Test plan: 1) Apply the patch 2) Update DB structure 3) Run update_dbix_class_files.pl 4) Select patron for checking out 5) Try to add some circulation and opac messages 6) Note that now there is creator (you ;) ) shown by every message added (with link to creator profile) 7) Try to delete messages to confirm that everything works as expected
Created attachment 56046 [details] [review] Bug 17397: Show name of librarian who created circulation message Test plan: 1) Apply the patch 2) Update DB structure 3) Run update_dbix_class_files.pl 4) Select patron for checking out 5) Try to add some circulation and opac messages 6) Note that now there is creator (you ;) ) shown by every message added (with link to creator profile) 7) Try to delete messages to confirm that everything works as expected
Sorry, now Koha QA tools passed cleanly
I have tried to add different messages from different libraries staff user. Names appears correctly in pro interface and libraries in OPAC interface. Message are correctly deleted. It respects the syspref AllowAllMessageDeletion.
Created attachment 56503 [details] [review] Bug 17397: Show name of librarian who created circulation message Test plan: 1) Apply the patch 2) Update DB structure 3) Run update_dbix_class_files.pl 4) Select patron for checking out 5) Try to add some circulation and opac messages 6) Note that now there is creator (you ;) ) shown by every message added (with link to creator profile) 7) Try to delete messages to confirm that everything works as expected Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>
Comment on attachment 56503 [details] [review] Bug 17397: Show name of librarian who created circulation message Review of attachment 56503 [details] [review]: ----------------------------------------------------------------- ::: Koha/Patron/Message.pm @@ +49,5 @@ > and $self->message_type > and $self->branchcode; > > + my $userenv = C4::Context->userenv; > + $self->manager_id($userenv ? $userenv->{number} : 0); Please provide tests. ::: circ/circulation.pl @@ +587,5 @@ > + $this_item->{message} = $content->message; > + $this_item->{manager_id} = $content->manager_id; > + $this_item->{name} = $content->_result->get_column('manager_firstname') . ' ' . $content->_result->get_column('manager_surname'); > + > + push @messages, $this_item; You should not need this loop. You can access the message's methods from the template.
> @@ +587,5 @@ > > + $this_item->{message} = $content->message; > > + $this_item->{manager_id} = $content->manager_id; > > + $this_item->{name} = $content->_result->get_column('manager_firstname') . ' ' . $content->_result->get_column('manager_surname'); > > + > > + push @messages, $this_item; > > You should not need this loop. You can access the message's methods from the > template. I have written some tests and now I tried to eliminate that loop. I am able to access columns from table messages, but I can't access the two columns which are get by relation to table borrowers - manager_firstname and manager_surname... I am probably doing something wrong...
Created attachment 56911 [details] [review] Bug 17397: Show name of librarian who created circulation message Test plan: 1) Apply the patch 2) Update DB structure 3) Run update_dbix_class_files.pl 4) Select patron for checking out 5) Try to add some circulation and opac messages 6) Note that now there is creator (you ;) ) shown by every message added (with link to creator profile) 7) Try to delete messages to confirm that everything works as expected Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 56912 [details] [review] Bug 17397: Simplify code passing the Koha::Object to the template Instead of creating a new array Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 56913 [details] [review] Bug 17397: Do not display parenthesis if the manager has been deleted Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Pushed to master for 16.11, thanks Josef, Jonathan!
(In reply to Kyle M Hall from comment #14) > Pushed to master for 16.11, thanks Josef, Jonathan! The DBix::Class schema is not up-to-date
(In reply to Jonathan Druart from comment #15) > (In reply to Kyle M Hall from comment #14) > > Pushed to master for 16.11, thanks Josef, Jonathan! > > The DBix::Class schema is not up-to-date Fixed!
This patch set seems to break t/db_dependent/Koha/Patron/Messages.t, please fix.
I'll work on it in just few hours, I am pretty sure I have some test code on my another machine...
I added fix to new bug 17558
(In reply to Kyle M Hall from comment #14) > Pushed to master for 16.11, thanks Josef, Jonathan! contains DB changes, passing for 16.05