From f4ab1e836fe9589d4656e396387c8d679962090b Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic Date: Fri, 9 Mar 2012 14:12:26 +1300 Subject: [PATCH] bug_7264: [SIGNED-OFF] Branch popup on OPAC detail.Added opac_info field to branches table. Signed-off-by: Delaye stephane Signed-off-by: Paul Poulain --- C4/Branch.pm | 10 ++++---- C4/Items.pm | 4 +++- admin/branches.pl | 4 +++- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++++++ .../prog/en/modules/admin/branches.tt | 22 +++++++++++++++++ .../en/lib/jquery/plugins/jquery.tools.min.js | 11 +++++++++ .../opac-tmpl/prog/en/modules/opac-detail.tt | 24 ++++++++++++++++++- 8 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.tools.min.js diff --git a/C4/Branch.pm b/C4/Branch.pm index 7bd03264b7..21530287fb 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -204,8 +204,8 @@ sub ModBranch { (branchcode,branchname,branchaddress1, branchaddress2,branchaddress3,branchzip,branchcity,branchstate, branchcountry,branchphone,branchfax,branchemail, - branchurl,branchip,branchprinter,branchnotes) - VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) + branchurl,branchip,branchprinter,branchnotes,opac_info) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) "; my $sth = $dbh->prepare($query); $sth->execute( @@ -217,7 +217,7 @@ sub ModBranch { $data->{'branchphone'}, $data->{'branchfax'}, $data->{'branchemail'}, $data->{'branchurl'}, $data->{'branchip'}, $data->{'branchprinter'}, - $data->{'branchnotes'}, + $data->{'branchnotes'}, $data->{opac_info}, ); return 1 if $dbh->err; } else { @@ -227,7 +227,7 @@ sub ModBranch { branchaddress2=?,branchaddress3=?,branchzip=?, branchcity=?,branchstate=?,branchcountry=?,branchphone=?, branchfax=?,branchemail=?,branchurl=?,branchip=?, - branchprinter=?,branchnotes=? + branchprinter=?,branchnotes=?,opac_info=? WHERE branchcode=? "; my $sth = $dbh->prepare($query); @@ -240,7 +240,7 @@ sub ModBranch { $data->{'branchphone'}, $data->{'branchfax'}, $data->{'branchemail'}, $data->{'branchurl'}, $data->{'branchip'}, $data->{'branchprinter'}, - $data->{'branchnotes'}, + $data->{'branchnotes'}, $data->{opac_info}, $data->{'branchcode'}, ); } diff --git a/C4/Items.pm b/C4/Items.pm index 2f32c988ef..365c1b3651 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1186,7 +1186,9 @@ sub GetItemsInfo { items.notforloan as itemnotforloan, itemtypes.description, itemtypes.notforloan as notforloan_per_itemtype, - holding.branchurl + holding.branchurl, + holding.branchname, + holding.opac_info as branch_opac_info FROM items LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode LEFT JOIN branches AS home ON items.homebranch=home.branchcode diff --git a/admin/branches.pl b/admin/branches.pl index 12c49e28ba..c12762d78e 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -328,6 +328,7 @@ sub branchinfotable { # - branchfax | # - branchemail / # - branchurl / + # - opac_info (can contain HTML) # - address-empty-p (1 if no address information, 0 otherwise) # - categories (containing a static error message) # - category_list (loop containing "categoryname") @@ -343,7 +344,7 @@ sub branchinfotable { 'branchaddress3', 'branchzip', 'branchcity', 'branchstate', 'branchcountry', 'branchphone', 'branchfax', - 'branchemail', 'branchurl', + 'branchemail', 'branchurl', 'opac_info', 'branchip', 'branchprinter', 'branchnotes' ) { @@ -406,6 +407,7 @@ sub _branch_to_template { branchfax => $data->{'branchfax'}, branchemail => $data->{'branchemail'}, branchurl => $data->{'branchurl'}, + opac_info => $data->{'opac_info'}, branchip => $data->{'branchip'}, branchnotes => $data->{'branchnotes'}, ); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index f5d8a2410b..bc0db1d510 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -362,6 +362,7 @@ CREATE TABLE `branches` ( -- information about your libraries or branches are st `branchip` varchar(15) default NULL, -- the IP address for your library or branch `branchprinter` varchar(100) default NULL, -- unused in Koha `branchnotes` mediumtext, -- notes related to your library or branch + opac_info text, -- HTML that displays in OPAC UNIQUE KEY `branchcode` (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 32099d8ba8..6c27ab7144 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4994,6 +4994,13 @@ if ( C4::Context->preference("Version") lt TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.07.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE branches ADD opac_info text;"); + print "Upgrade to $DBversion done add opac_info to branches \n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index df5e56c05d..b819e01d75 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -13,6 +13,25 @@ [% INCLUDE 'doc-head-close.inc' %] + + [% INCLUDE 'header.inc' %] @@ -122,6 +141,7 @@
  • +
  • Can be entered as a single IP, or a subnet such as 192.168.1.*