Bugzilla – Attachment 4832 Details for
Bug 4222
Nonpublic note not appearing in the staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
0001-Bug-4222-allow-nonpublicnote-to-be-a-mapped-DB-colum.patch (text/plain), 14.80 KB, created by
Srdjan Jankovic
on 2011-08-04 02:10:45 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2011-08-04 02:10:45 UTC
Size:
14.80 KB
patch
obsolete
>From b36c83ca9d4a7c83c645fee2caa9c1ce101aa7dd Mon Sep 17 00:00:00 2001 >From: Srdjan Jankovic <srdjan@catalyst.net.nz> >Date: Thu, 4 Aug 2011 14:06:49 +1200 >Subject: [PATCH 1/1] Bug 4222 - allow nonpublicnote to be a mapped DB column > >This means that it's possible (and easy) to put non-public notes >(usually 952$x) on a template, same as public notes. It creates a >mapping between the 952$x field and the new database column. > >Note that when this is applied, it will only work on newly saved records. > >It is possible this will need to be altered to allow for UNIMARC etc. if >they use 952 differently. >--- > catalogue/detail.pl | 10 +++++++++- > catalogue/moredetail.pl | 1 + > circ/returns.pl | 1 + > installer/data/mysql/kohastructure.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 8 ++++++++ > .../prog/en/modules/catalogue/detail.tt | 4 +++- > .../prog/en/modules/catalogue/moredetail.tt | 1 + > .../prog/en/modules/circ/circulation.tt | 8 ++++---- > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 1 + > 9 files changed, 30 insertions(+), 6 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 8738737..f8feec5 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -223,6 +223,13 @@ foreach my $item (@items) { > $item->{waitingdate} = format_date($wait_hashref->{waitingdate}); > } > >+ foreach my $f (qw( itemnotes nonpublicnote )) { >+ if ($item->{$f}) { >+ $item->{$f} =~ s|\n|<br />|g; >+ $itemfields{$f} = 1; >+ } >+ } >+ > push @itemloop, $item; > } > >@@ -240,7 +247,8 @@ $template->param( > itemdata_uri => $itemfields{uri}, > itemdata_copynumber => $itemfields{copynumber}, > volinfo => $itemfields{enumchron}, >- itemdata_itemnotes => $itemfields{itemnotes}, >+ itemdata_itemnotes => $itemfields{itemnotes}, >+ itemdata_nonpublicnote => $itemfields{nonpublicnote}, > z3950_search_params => C4::Search::z3950_search_args($dat), > holdcount => $holdcount, > C4::Search::enabled_staff_search_views, >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index d848188..364c26c 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -145,6 +145,7 @@ foreach my $item (@items){ > } else { > $item->{'issue'}= 0; > } >+ $item->{nonpublicnote} =~ s|\n|<br />|g if $item->{nonpublicnote}; > } > $template->param(count => $data->{'count'}, > subscriptionsnumber => $subscriptionsnumber, >diff --git a/circ/returns.pl b/circ/returns.pl >index 6826d7c..5fd878d 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -575,6 +575,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { > $ri{itemcallnumber} = $biblio->{'itemcallnumber'}; > $ri{itemtype} = $biblio->{'itemtype'}; > $ri{itemnote} = $biblio->{'itemnotes'}; >+ $ri{nonpublicnote} = $biblio->{'nonpublicnote'}; > $ri{ccode} = $biblio->{'ccode'}; > $ri{itemnumber} = $biblio->{'itemnumber'}; > $ri{barcode} = $bar_code; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e3c6f42..3f3a702 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -745,6 +745,7 @@ CREATE TABLE `deleteditems` ( > `reserves` smallint(6) default NULL, > `restricted` tinyint(1) default NULL, > `itemnotes` mediumtext, >+ `nonpublicnote` mediumtext default NULL, > `holdingbranch` varchar(10) default NULL, > `paidfor` mediumtext, > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, >@@ -1012,6 +1013,7 @@ CREATE TABLE `items` ( > `reserves` smallint(6) default NULL, > `restricted` tinyint(1) default NULL, > `itemnotes` mediumtext, >+ `nonpublicnote` mediumtext default NULL, > `holdingbranch` varchar(10) default NULL, > `paidfor` mediumtext, > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 2076edf..4573841 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4391,6 +4391,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion($DBversion); > } > >+$DBversion = '3.05.00.XXX'; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("ALTER TABLE items ADD COLUMN nonpublicnote MEDIUMTEXT AFTER itemnotes"); >+ $dbh->do("ALTER TABLE deleteditems ADD COLUMN nonpublicnote MEDIUMTEXT AFTER itemnotes"); >+ $dbh->do("UPDATE marc_subfield_structure SET kohafield='items.nonpublicnote' WHERE (kohafield IS NULL OR kohafield = '') AND tagfield='952' AND tagsubfield='x'"); >+ print "Upgrade to $DBversion done (Make nonpublicnote easier to use. <b>If you have mapped your items to a MARC field other than 952 (system default), please check your Koha to MARC mapping for items.nonpublicnote</b>)\n"; >+} >+ > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 2ea7091..d374e3c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -247,7 +247,8 @@ function verify_images() { > [% IF ( itemdata_uri ) %]<th>url</th>[% END %] > [% IF ( itemdata_copynumber ) %]<th>Copy No.</th>[% END %] > [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %] >- [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine Label</th>[% END %] >+ [% IF itemdata_nonpublicnote %]<th>Non-public Note</th>[% END %] >+ [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine Label</th>[% END %] > </tr> > [% FOREACH itemloo IN itemloop %] > <tr> >@@ -370,6 +371,7 @@ function verify_images() { > <td class="copynumber">[% itemloo.copynumber %]</td> > [% END %] > [% IF ( itemdata_itemnotes ) %]<td><div class="itemnotes">[% itemloo.itemnotes %]</div></td>[% END %] >+ [% IF itemdata_nonpublicnote %]<td class="nonpublicnote">[% itemloo.nonpublicnote %]</td>[% END %] > [% IF ( itemloo.type ) %] > <td><a href="/cgi-bin/koha/maint/catmaintain.pl?type=fixitemtype&bi=[% itemloo.biblioitemnumber %]&item=[% itemloo.itemtype %]">Fix Itemtype</a></td> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index 86c8a3f..e9d483d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -174,6 +174,7 @@ > [% IF ( ITEM_DAT.card2 ) %]<li><span class="label">Previous Borrower:</span> <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.borrower2 %]">[% ITEM_DAT.card2 %]</a> </li>[% END %] > <li><span class="label">Paid for?:</span> [% ITEM_DAT.paidfor %] </li> > <li><span class="label">Serial enumeration:</span> [% ITEM_DAT.enumchron %] </li> >+ [% IF ITEM_DAT.nonpublicnote %]<li><span class="label">Non-public Note:</span> [% ITEM_DAT.nonpublicnote %] </li>[% END %] > <li><span class="label">Public Note:</span> > [% IF ( CAN_user_editcatalogue_edit_items ) %] > <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 4d2459b..8347ff9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -701,7 +701,7 @@ No patron matched <span class="ex">[% message %]</span> > [% IF ( todayissue.od ) %]<td class="od">[% ELSE %]<td>[% END %] > [% todayissue.dd %] > </td> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% todayissue.biblionumber %]&type=intra"><strong>[% todayissue.title |html %]</strong></a>[% IF ( todayissue.author ) %], by [% todayissue.author %][% END %][% IF ( todayissue.itemnotes ) %]- <span class="circ-hlt">[% todayissue.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% todayissue.biblionumber %]&itemnumber=[% todayissue.itemnumber %]#item[% todayissue.itemnumber %]">[% todayissue.barcode %]</a></td> >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% todayissue.biblionumber %]&type=intra"><strong>[% todayissue.title |html %]</strong></a>[% IF ( todayissue.author ) %], by [% todayissue.author %][% END %][% IF ( todayissue.itemnotes ) %]- <span class="circ-hlt">[% todayissue.itemnotes %]</span>[% END %][% IF ( todayissue.nonpublicnote ) %]- <span class="circ-hlt">[% todayissue.nonpublicnote %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% todayissue.biblionumber %]&itemnumber=[% todayissue.itemnumber %]#item[% todayissue.itemnumber %]">[% todayissue.barcode %]</a></td> > <td>[% UNLESS ( noItemTypeImages ) %] [% IF ( todayissue.itemtype_image ) %]<img src="[% todayissue.itemtype_image %]" alt="" />[% END %][% END %][% todayissue.itemtype %]</td> > <td>[% todayissue.checkoutdate %]</td> > [% IF ( todayissue.multiple_borrowers ) %]<td>[% todayissue.borrowername %]</td>[% END %] >@@ -773,7 +773,7 @@ No patron matched <span class="ex">[% message %]</span> > [% IF ( previssue.od ) %]<td class="od">[% ELSE %]<td>[% END %] > [% previssue.dd %] > </td> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% previssue.biblionumber %]&type=intra"><strong>[% previssue.title |html %]</strong></a>[% IF ( previssue.author ) %], by [% previssue.author %][% END %] [% IF ( previssue.itemnotes ) %]- [% previssue.itemnotes %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% previssue.biblionumber %]&itemnumber=[% previssue.itemnumber %]#item[% previssue.itemnumber %]">[% previssue.barcode %]</a></td> >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% previssue.biblionumber %]&type=intra"><strong>[% previssue.title |html %]</strong></a>[% IF ( previssue.author ) %], by [% previssue.author %][% END %] [% IF ( previssue.itemnotes ) %]- [% previssue.itemnotes %][% END %][% IF ( previssue.nonpublicnote ) %]- [% previssue.nonpublicnote %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% previssue.biblionumber %]&itemnumber=[% previssue.itemnumber %]#item[% previssue.itemnumber %]">[% previssue.barcode %]</a></td> > <td> > [% previssue.itemtype %] > </td> >@@ -879,7 +879,7 @@ No patron matched <span class="ex">[% message %]</span> > [% END %] > [% IF ( relissue.overdue ) %]<td class="od">[% ELSE %]<td>[% END %] > [% relissue.dd %]</td> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% relissue.biblionumber %]&type=intra"><strong>[% relissue.title |html %]</strong></a>[% IF ( relissue.author ) %], by [% relissue.author %][% END %][% IF ( relissue.itemnotes ) %]- <span class="circ-hlt">[% relissue.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% relissue.biblionumber %]&itemnumber=[% relissue.itemnumber %]#item[% relissue.itemnumber %]">[% relissue.barcode %]</a></td> >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% relissue.biblionumber %]&type=intra"><strong>[% relissue.title |html %]</strong></a>[% IF ( relissue.author ) %], by [% relissue.author %][% END %][% IF ( relissue.itemnotes ) %]- <span class="circ-hlt">[% relissue.itemnotes %]</span>[% END %][% IF ( relissue.nonpublicnote ) %]- <span class="circ-hlt">[% relissue.nonpublicnote %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% relissue.biblionumber %]&itemnumber=[% relissue.itemnumber %]#item[% relissue.itemnumber %]">[% relissue.barcode %]</a></td> > <td>[% UNLESS ( noItemTypeImages ) %] [% IF ( relissue.itemtype_image ) %]<img src="[% relissue.itemtype_image %]" alt="" />[% END %][% END %][% relissue.itemtype %]</td> > <td>[% relissue.displaydate %]</td> > <td>[% relissue.itemcallnumber %]</td> >@@ -899,7 +899,7 @@ No patron matched <span class="ex">[% message %]</span> > [% IF ( relprevissue.overdue ) %]<td class="od">[% ELSE %]<td>[% END %] > [% relprevissue.dd %] > </td> >- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% relprevissue.biblionumber %]&type=intra"><strong>[% relprevissue.title |html %]</strong></a>[% IF ( relprevissue.author ) %], by [% relprevissue.author %][% END %] [% IF ( relprevissue.itemnotes ) %]- [% relprevissue.itemnotes %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% relprevissue.biblionumber %]&itemnumber=[% relprevissue.itemnumber %]#item[% relprevissue.itemnumber %]">[% relprevissue.barcode %]</a></td> >+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% relprevissue.biblionumber %]&type=intra"><strong>[% relprevissue.title |html %]</strong></a>[% IF ( relprevissue.author ) %], by [% relprevissue.author %][% END %] [% IF ( relprevissue.itemnotes ) %]- [% relprevissue.itemnotes %][% END %][% IF ( relprevissue.nonpublicnote ) %] - [% relprevissue.nonpublicnote %][% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% relprevissue.biblionumber %]&itemnumber=[% relprevissue.itemnumber %]#item[% relprevissue.itemnumber %]">[% relprevissue.barcode %]</a></td> > <td>[% UNLESS noItemTypeImages %][% IF relprevissue.itemtype_image %]<img src="[% relprevissue.itemtype_image %]" alt="" />[% END %][% END %][% relprevissue.itemtype %]</td> > <td>[% relprevissue.displaydate %]</td> > <td>[% relprevissue.itemcallnumber %]</td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 8b68cb9..3db3ea6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -422,6 +422,7 @@ function Dopop(link) { > [% ELSE %]Not checked out[% END %]</td> > <td>[% IF ( riloo.bornote ) %]<span class="circ-hlt">[% riloo.bornote %]<br /></span>[% END %] > [% IF ( riloo.itemnote ) %]<span class="circ-hlt">[% riloo.itemnote %]</span>[% END %] >+ [% IF ( riloo.nonpublicnote ) %]<span class="circ-hlt">[% riloo.nonpublicnote %]</span>[% END %] > </td> > </tr> > [% END %] >-- >1.6.5 >
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 4222
:
1918
|
2739
|
4350
|
4351
|
4746
|
4764
|
4765
|
4775
|
4832
|
4836
|
8048
|
10056
|
10057