Summary: | Add a column of custom HTML to "my summary" | ||
---|---|---|---|
Product: | Koha | Reporter: | Magnus Enger <magnus> |
Component: | OPAC | Assignee: | Magnus Enger <magnus> |
Status: | CLOSED FIXED | QA Contact: | Bugs List <koha-bugs> |
Severity: | normal | ||
Priority: | PATCH-Sent (DO NOT USE) | CC: | chris, claire.hernandez, koha.sekjal, viktor.sarge |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | Sponsored | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Deadline: | 2011-03-01 | ||
Attachments: |
Screenshot showing the desired functionality
Proposed patch patch removed the tabs from the summary Revised patch This revised patch should fix the problem with missing tabs on My Summary Fines messed up, Links missing Followup patch, fixing missing Links column |
Description
Magnus Enger
2011-01-31 14:38:05 UTC
I love it!! :) I think there could be wider application if the variables were available in other places, such as on record display, lists, cart. Created attachment 3580 [details] [review] Proposed patch The code can be seen running on http://head.bibkat.no/ - log in as demo with username demo. The OPACMySummaryHTML hasa been left blank as default, so only those libraries the want the functionality have to worry about it. Here is a value for OPACMySummaryHTML that should display all the avalable variables, as well as an example of a link to Facebook (replace example.com with the domain name used by your OPAC): <p><a href="http://www.facebook.com/sharer.php?u=http://example.com/cgi-bin/koha/opac-detail.pl?biblionumber={BIBLIONUMBER}">Share on Facebook</a> <br />TITLE: {TITLE} <br />AUTHOR: {AUTHOR} <br />ISBN: {ISBN} <br />BIBLIONUMBER: {BIBLIONUMBER} <br />CONTROLNUMBER: {CONTROLNUMBER}</p> (In reply to comment #2) > I think there could be wider application if the variables were available in > other places, such as on record display, lists, cart. I agree completely, but do not have the time to do anything about it now. I can imagine a number of sysprefs that would allow libraries to "inject" HTML all over the opac - e.g. in detail view: above the items, below the items, in different spots in the right hand column etc. The patch attached does not perform the database update on my system; had to remove the escaped single quotes around "my profile"... Also, the actual name of the system preferences, OPACMySummaryHTML, is not what's in the update message: OPACMyProfileHTML. The patch applies, but when logging into my account in the OPAC, I find the Checkouts/Overdues/Fines tabs broken. It may be my data, but {CONTROLNUMBER is not parsed}; it remains {CONTROLNUMBER} (In reply to comment #5) > The patch attached does not perform the database update on my system; had to > remove the escaped single quotes around "my profile"... Also, the actual name > of the system preferences, OPACMySummaryHTML, is not what's in the update > message: OPACMyProfileHTML. > > The patch applies, but when logging into my account in the OPAC, I find the > Checkouts/Overdues/Fines tabs broken. > > It may be my data, but {CONTROLNUMBER is not parsed}; it remains > {CONTROLNUMBER} Thanks for testing, Ian. I definitely messed some things up. Revised patch coming! Created attachment 3582 [details]
patch removed the tabs from the summary
It looks like applying this patch removes the tabs from the summary page
What is 'controlnumber'? I thought it would be the bib number so I tried to create a twitter link (http://twitter.com/about/resources/tweetbutton) and on the page it appeared like this: http://twitter.com/share?_=1301593733583&count=vertical&text=Nicole%27s%20Library%20Catalog%20%E2%80%BA%20Library%20Home%20for%20Nicole%20Engard&url=http%3A%2F%2Flocalhost-opac%3A8000%2Fcgi-bin%2Fkoha%2Fopac-detail.pl%3Fbiblionumber%3D%7BCONTROLNUMBER%7D Note the controlnumber text in there. fyi i'm using FF4 Created attachment 3583 [details] [review] Revised patch Removed escaped single quotes from updatedatabase.pl and corrects the description on opac.pref. {CONTROLNUMBER} was not meant to be implemented. Revised test value: <p><a href="http://www.facebook.com/sharer.php?u=http://example.com/cgi-bin/koha/opac-detail.pl?biblionumber={BIBLIONUMBER}">Share on Facebook</a> <br />TITLE: {TITLE} <br />AUTHOR: {AUTHOR} <br />ISBN: {ISBN} <br />BIBLIONUMBER: {BIBLIONUMBER}</p> (In reply to comment #10) > Created attachment 3583 [details] [review] > Revised patch I have looked for the broken tabs in FF 3.6 on Linux and Windows, and FF4 on Mac OS X, but have not been able to reproduce them, either with the the first or the second patch. Will look into that further later. This bug is mentioned in: Bug 5671 - Add a column of custom HTML to my summary http://lists.koha-community.org/pipermail/koha-patches/2011-March/014405.html Bug 5671 - Revised Patch - Add a column of custom HTML to my summary http://lists.koha-community.org/pipermail/koha-patches/2011-March/014407.html What I did: - git am the patch - resolved conflicts with updatedatabase version (and kohaversion) - add a content syspref with TITLE, AUTHOR, ISBN and BIBLIONUMBER - connect in opac with a used and see checkout in "my summary" tab I saw what I put in syspref with good data in Chrome 10.0.6 and FFx 3.6.15 under Linux system without removing tabs display on the left. Seems ok for me. Created attachment 3630 [details] [review] This revised patch should fix the problem with missing tabs on My Summary There was a JavaScript error that was causing the tabs on "my summary" to (sometimes?) disappear. This revised patch should fix the JS error and restor the tabs. Pushed, please test I can't seem to get this working since switching to Template Toolkit ... can anyone fix or confirm? I'm on Mac and FF4 Created attachment 3948 [details]
Fines messed up, Links missing
I'm probably seeing the same as Nicole, see the attached screenshot from FF4 on Mac. Same thing in Safari on Mac. The fines column is messed up and Links are missing. The contents of OPACMySummaryHTML does not seem to affect this, however.
I see a couple of problems: In koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt, *html should be *HTML: 266 [% IF ( OPACMySummaryhtml ) %] 267 <td>[% MySummaryhtml %]</td> 268 [% END %] In opac/opac-user.pl, normalized_isbn and MySummaryHTML are both added to $issue after it has been pushed onto @issuedat, which is what gets assigned to the ISSUES template variable: 161 $issue->{date_due} = format_date($issue->{date_due}); 162 push @issuedat, $issue; 163 $count++; 164 165 my $isbn = GetNormalizedISBN($issue->{'isbn'}); 166 $issue->{normalized_isbn} = $isbn; 167 168 # My Summary HTML 169 if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){ ... 176 $issue->{MySummaryHTML} = $my_summary_html; ... 180 $template->param( ISSUES => \@issuedat ); But fixing both of these does not fix the "My Summary" page... Will look some more tomorrow... Created attachment 3949 [details] [review] Followup patch, fixing missing Links column The missing fines was due to me testing on an installation with not-quite-uptodate Norwegian templates, when I switched to English they showed just fine. The missing Links were due to OPACMySummaryHTML/MySummaryHTML being spelled as OPACMySummaryhtml/MySummaryhtml, and MySummaryHTML not being tied to issues with ISSUE.MySummaryHTML. Follow up patch pushed please test (In reply to comment #20) > Follow up patch pushed please test Works fine for me. |