Bugzilla – Attachment 77462 Details for
Bug 20809
Link patron image to patron image add/edit form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20809: Link patron image to patron image add/edit form
Bug-20809-Link-patron-image-to-patron-image-addedi.patch (text/plain), 7.69 KB, created by
Dilan Johnpullé
on 2018-08-03 02:17:01 UTC
(
hide
)
Description:
Bug 20809: Link patron image to patron image add/edit form
Filename:
MIME Type:
Creator:
Dilan Johnpullé
Created:
2018-08-03 02:17:01 UTC
Size:
7.69 KB
patch
obsolete
>From e7433783b4ac3b1982da0d2269e426415e4caa6d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 29 May 2018 14:41:39 +0000 >Subject: [PATCH] Bug 20809: Link patron image to patron image add/edit form >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch modifies an include file so that it is possible with edit a >patron's image on any patron-related page which uses that include. > >To test you must have the patronimages system preference enabled. > >Apply the patch and open any patron record for viewing. > > - Hover the mouse over the patron image. > > - If the patron has a previously-defined patron image, should you see > an "Edit" button appear. Clicking the button should display a modal > dialog titled "Edit patron image." Test that the "Upload," > "Delete," and "Cancel" buttons work correctly. > > - If a patron has no patron image defined, you should see an "Add" > button appear. Clicking the button should display a modal > dialog titled "Edit patron image." Test that the "Upload," > "Delete," and "Cancel" buttons work correctly. > >This process should work from any page which shows the patron sidebar: >Check out, Details, Fines, Routing lists, Circulation history, etc. > >Patch works as described. >Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au> >--- > koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 53 +++++++++++++++++----- > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 53 ++++++++++++++++------ > koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 15 ++++++ > 3 files changed, 95 insertions(+), 26 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >index c03fd89..40b39be 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >@@ -567,22 +567,53 @@ div.patroninfo ul li { > list-style-type : none; > } > >-#patronbasics div { >- background: transparent url("../img/patron-blank.min.svg") 10px 5px no-repeat; >- border: 1px solid #CCCCCC; >+/* Patron images */ >+ >+.patroninfo > div { >+ border-right: 1px solid #b9d8d9; >+ width: 100%; >+} >+ >+.patronimage-container { >+ padding: .2em; >+ position: relative; >+} >+ >+.patronimage { >+ opacity: 1; >+ display: block; >+ max-width: 160px; >+ transition: .2s ease; >+} >+ >+.patronimage.empty { >+ background: transparent url("../img/patron-blank.min.svg") center 5px no-repeat; > height: 125px; > margin: .3em 0 .3em .3em; > padding: 0; >- width: 105px; >+ width: 80%; > } > >-#patronimage { >- border: 1px solid #CCCCCC; >- max-width : 140px; >- margin: .3em 0 .3em .3em; >- padding: .2em; >- width:auto !important; >- width:130px; >+.patronimage-controls { >+ transition: .5s ease; >+ opacity: 0; >+ position: absolute; >+ top: 80%; >+ left: 50%; >+ transform: translate(-50%, -50%); >+ text-align: center; >+} >+ >+.patronimage-container:hover .patronimage { >+ opacity: 0.8; >+} >+ >+.patronimage-container:hover .patronimage-controls { >+ opacity: 1; >+} >+ >+.patronimage-control { >+ padding: 1em 2em; > } > > div.patronviews { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index fb56a01..bb025aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -1,22 +1,26 @@ > [% USE Koha %] > [% IF ( patron.borrowernumber ) %] > <div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5> >-<!--[if IE 6]> >-<style type="tex/css">img { width: expression(this.width > 140 ? 140: true); >-}</style> >-<![endif]--> >+ >+[% IF ( patronimages ) %] >+ <div> >+ <div class="patronimage-container"> >+ [% IF ( patron.image ) %] >+ <img src="/cgi-bin/koha/members/patronimage.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="patronimage" alt="[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])" /> >+ <div class="patronimage-controls"> >+ <div class="patronimage-control"><a data-borrowernumber="[% patron.borrowernumber | uri %]" class="btn btn-default btn-sm edit-patronimage" title="Edit patron image" href="#"><i class="fa fa-pencil"></i> Edit</a></div> >+ </div> >+ [% ELSE %] >+ <div class="patronimage empty"></div> >+ <div class="patronimage-controls"> >+ <div class="patronimage-control"><a data-borrowernumber="[% patron.borrowernumber | uri %]" class="btn btn-default btn-sm edit-patronimage" title="Add patron image" href="#"><i class="fa fa-plus"></i> Add</a></div> >+ </div> >+ [% END %] >+ </div> >+ </div> >+[% END %] >+ > <ul class="patronbriefinfo"> >- [% IF ( patronimages ) %] >- [% IF ( patron.image ) %] >- <li> >- <img src="/cgi-bin/koha/members/patronimage.pl?borrowernumber=[% patron.borrowernumber | uri %]" id="patronimage" alt="[% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])" /> >- </li> >- [% ELSE %] >- <li id="patronbasics"> >- <div></div> >- </li> >- [% END %] >- [% END %] > [% IF Koha.Preference( 'AddressFormat' ) %] > [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] > [% ELSE %] >@@ -122,4 +126,23 @@ > <li><a href="/cgi-bin/koha/ill/ill-requests.pl?borrowernumber=[% patron.borrowernumber %]">Interlibrary loans</a></li> > [% END %] > </ul></div> >+ >+<!-- Modal --> >+<div class="modal" id="patronImageEdit" tabindex="-1" role="dialog" aria-labelledby="patronImageEditLabel"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="patronImageEditLabel">Modal title</h4> >+ </div> >+ <div class="modal-body"> >+ <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> >+ </div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> >+ </div> >+ </div> >+ </div> >+</div> >+ > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >index 8fdb538..f40b6e3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >@@ -100,6 +100,21 @@ $(document).ready(function(){ > $("#select_patron_messages").on("change",function(){ > $("#borrower_message").val( $(this).val() ); > }); >+ >+ $(".edit-patronimage").on("click", function(e){ >+ e.preventDefault(); >+ var borrowernumber = $(this).data("borrowernumber"); >+ var url = "/cgi-bin/koha/members/moremember.pl?borrowernumber=" + borrowernumber; >+ $.get("/cgi-bin/koha/members/moremember.pl", { borrowernumber : borrowernumber }, function( data ){ >+ image_form = $(data).find("#picture-upload"); >+ image_form.show().find(".cancel").remove(); >+ $("#patronImageEdit .modal-body").html( image_form ); >+ }); >+ var modalTitle = $(this).attr("title"); >+ $("#patronImageEdit .modal-title").text(modalTitle); >+ $("#patronImageEdit").modal("show"); >+ }); >+ > }); > function confirm_local_deletion() { > var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the local database? This cannot be undone.")); >-- >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 20809
:
75514
|
75515
|
75637
|
75963
|
77462
|
77465
|
77789
|
77790
|
78409
|
78410
|
78595
|
78670
|
78711
|
82333
|
82334
|
82335
|
83711
|
83712
|
83713
|
83844
|
83845
|
83846
|
83847
|
84477
|
84478
|
84479
|
84480
|
84481
|
84482
|
84483
|
84484