View | Details | Raw Unified | Return to bug 11351
Collapse All | Expand All

(-)a/C4/SIP/ILS/Item.pm (-1 / +4 lines)
Lines 86-92 sub new { Link Here
86
    $item->{permanent_location}= $item->{homebranch};
86
    $item->{permanent_location}= $item->{homebranch};
87
    $item->{'collection_code'} = $item->{ccode};
87
    $item->{'collection_code'} = $item->{ccode};
88
    $item->{  'call_number'  } = $item->{itemcallnumber};
88
    $item->{  'call_number'  } = $item->{itemcallnumber};
89
    # $item->{'destination_loc'}  =  ?
89
90
    my $it = C4::Context->preference('item-level_itypes') ? $item->{itype} : $item->{itemtype};
91
    my $sip_media_type = C4::Context->dbh->selectrow_array('SELECT sip_media_type FROM itemtypes WHERE itemtype = ?', undef, ( $it ) );
92
    $item->{sip_media_type} = $sip_media_type;
90
93
91
	# check if its on issue and if so get the borrower
94
	# check if its on issue and if so get the borrower
92
	my $issue = GetItemIssue($item->{'itemnumber'});
95
	my $issue = GetItemIssue($item->{'itemnumber'});
(-)a/Koha/Template/Plugin/AuthorisedValues.pm (+5 lines)
Lines 31-34 sub GetByCode { Link Here
31
    return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) );
31
    return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) );
32
}
32
}
33
33
34
sub Get {
35
    my ( $self, $category, $selected, $opac ) = @_;
36
    return GetAuthorisedValues( $category, $selected, $opac );
37
}
38
34
1;
39
1;
(-)a/Koha/Template/Plugin/EncodeUTF8.pm (+31 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::EncodeUTF8;
2
3
# Copyright Bywater Solutions 2013
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use base qw{Template::Plugin::Filter};
23
24
use Encode qw{encode};
25
26
sub filter {
27
    my ( $self, $value ) = @_;
28
    return encode( 'UTF-8', $value );
29
}
30
31
1;
(-)a/admin/itemtypes.pl (-2 / +6 lines)
Lines 119-124 if ( $op eq 'add_form' ) { Link Here
119
        summary         => $data->{summary},
119
        summary         => $data->{summary},
120
        imagesets       => $imagesets,
120
        imagesets       => $imagesets,
121
        remote_image    => $remote_image,
121
        remote_image    => $remote_image,
122
        sip_media_type  => $data->{sip_media_type},
122
    );
123
    );
123
124
124
    # END $OP eq ADD_FORM
125
    # END $OP eq ADD_FORM
Lines 141-146 elsif ( $op eq 'add_validate' ) { Link Here
141
                 , notforloan = ?
142
                 , notforloan = ?
142
                 , imageurl = ?
143
                 , imageurl = ?
143
                 , summary = ?
144
                 , summary = ?
145
                 , sip_media_type = ?
144
            WHERE itemtype = ?
146
            WHERE itemtype = ?
145
        ';
147
        ';
146
        $sth = $dbh->prepare($query2);
148
        $sth = $dbh->prepare($query2);
Lines 156-170 elsif ( $op eq 'add_validate' ) { Link Here
156
                )
158
                )
157
            ),
159
            ),
158
            $input->param('summary'),
160
            $input->param('summary'),
161
            $input->param('sip_media_type'),
159
            $input->param('itemtype')
162
            $input->param('itemtype')
160
        );
163
        );
161
    }
164
    }
162
    else {    # add a new itemtype & not modif an old
165
    else {    # add a new itemtype & not modif an old
163
        my $query = "
166
        my $query = "
164
            INSERT INTO itemtypes
167
            INSERT INTO itemtypes
165
                (itemtype,description,rentalcharge, notforloan, imageurl,summary)
168
                (itemtype,description,rentalcharge, notforloan, imageurl,summary,sip_media_type)
166
            VALUES
169
            VALUES
167
                (?,?,?,?,?,?);
170
                (?,?,?,?,?,?,?);
168
            ";
171
            ";
169
        my $sth = $dbh->prepare($query);
172
        my $sth = $dbh->prepare($query);
170
		my $image = $input->param('image');
173
		my $image = $input->param('image');
Lines 177-182 elsif ( $op eq 'add_validate' ) { Link Here
177
            $image eq 'remoteImage' ? $input->param('remoteImage') :
180
            $image eq 'remoteImage' ? $input->param('remoteImage') :
178
            $image,
181
            $image,
179
            $input->param('summary'),
182
            $input->param('summary'),
183
            $input->param('sip_media_type'),
180
        );
184
        );
181
    }
185
    }
182
186
(-)a/installer/data/mysql/de-DE/optional/auth_val.sql (+13 lines)
Lines 57-59 INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_ Link Here
57
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Benutzer');
57
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Benutzer');
58
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Erwerbung');
58
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Erwerbung');
59
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Gebühren');
59
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Gebühren');
60
61
-- SIP2 media types
62
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '000', 'Other');
63
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '001', 'Book');
64
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '002', 'Magazine');
65
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '003', 'Bound journal');
66
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '004', 'Audio tape');
67
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '005', 'Video tape');
68
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '006', 'CD/CDROM');
69
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '007', 'Diskette');
70
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '008', 'Book with deskette');
71
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '009', 'Book with cd');
72
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '010', 'Book with audio tape');
(-)a/installer/data/mysql/en/optional/auth_val.sql (+13 lines)
Lines 57-59 INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_ Link Here
57
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Patrons');
57
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Patrons');
58
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Acquisitions');
58
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Acquisitions');
59
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Accounts');
59
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Accounts');
60
61
-- SIP2 media types
62
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '000', 'Other');
63
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '001', 'Book');
64
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '002', 'Magazine');
65
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '003', 'Bound journal');
66
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '004', 'Audio tape');
67
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '005', 'Video tape');
68
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '006', 'CD/CDROM');
69
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '007', 'Diskette');
70
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '008', 'Book with deskette');
71
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '009', 'Book with cd');
72
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '010', 'Book with audio tape');
(-)a/installer/data/mysql/es-ES/optional/auth_val.sql (+13 lines)
Lines 50-52 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('BOR_N Link Here
50
-- OPAC Suggestions reasons
50
-- OPAC Suggestions reasons
51
INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','damaged','The copy on the shelf is damaged','The copy on the shelf is damaged');
51
INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','damaged','The copy on the shelf is damaged','The copy on the shelf is damaged');
52
INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','bestseller','Upcoming title by popular author','Upcoming title by popular author');
52
INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','bestseller','Upcoming title by popular author','Upcoming title by popular author');
53
54
-- SIP2 media types
55
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '000', 'Other');
56
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '001', 'Book');
57
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '002', 'Magazine');
58
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '003', 'Bound journal');
59
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '004', 'Audio tape');
60
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '005', 'Video tape');
61
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '006', 'CD/CDROM');
62
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '007', 'Diskette');
63
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '008', 'Book with deskette');
64
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '009', 'Book with cd');
65
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '010', 'Book with audio tape');
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 1108-1113 CREATE TABLE `itemtypes` ( -- defines the item types Link Here
1108
  `notforloan` smallint(6) default NULL, -- 1 if the item is not for loan, 0 if the item is available for loan
1108
  `notforloan` smallint(6) default NULL, -- 1 if the item is not for loan, 0 if the item is available for loan
1109
  `imageurl` varchar(200) default NULL, -- URL for the item type icon
1109
  `imageurl` varchar(200) default NULL, -- URL for the item type icon
1110
  `summary` text, -- information from the summary field, may include HTML
1110
  `summary` text, -- information from the summary field, may include HTML
1111
  sip_media_type VARCHAR(3) DEFAULT NULL, -- SIP2 protocol media type for this itemtype
1111
  PRIMARY KEY  (`itemtype`),
1112
  PRIMARY KEY  (`itemtype`),
1112
  UNIQUE KEY `itemtype` (`itemtype`)
1113
  UNIQUE KEY `itemtype` (`itemtype`)
1113
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1114
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/auth_val.sql (+13 lines)
Lines 78-80 INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_ Link Here
78
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Lånere');
78
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Lånere');
79
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Innkjøp');
79
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Innkjøp');
80
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Gebyrer');
80
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Gebyrer');
81
82
-- SIP2 media types
83
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '000', 'Other');
84
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '001', 'Book');
85
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '002', 'Magazine');
86
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '003', 'Bound journal');
87
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '004', 'Audio tape');
88
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '005', 'Video tape');
89
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '006', 'CD/CDROM');
90
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '007', 'Diskette');
91
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '008', 'Book with deskette');
92
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '009', 'Book with cd');
93
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '010', 'Book with audio tape');
(-)a/installer/data/mysql/pl-PL/optional/auth_val.sql (+13 lines)
Lines 38-40 INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('NOT_L Link Here
38
38
39
-- restricted status of an item, linked to items.restricted
39
-- restricted status of an item, linked to items.restricted
40
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','1','Restricted Access');
40
INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('RESTRICTED','1','Restricted Access');
41
42
-- SIP2 media types
43
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '000', 'Other');
44
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '001', 'Book');
45
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '002', 'Magazine');
46
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '003', 'Bound journal');
47
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '004', 'Audio tape');
48
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '005', 'Video tape');
49
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '006', 'CD/CDROM');
50
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '007', 'Diskette');
51
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '008', 'Book with deskette');
52
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '009', 'Book with cd');
53
INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('SIP_MEDIA_TYPE', '010', 'Book with audio tape');
(-)a/installer/data/mysql/updatedatabase.pl (+23 lines)
Lines 6935-6940 if ( CheckVersion($DBversion) ) { Link Here
6935
    SetVersion ($DBversion);
6935
    SetVersion ($DBversion);
6936
}
6936
}
6937
6937
6938
$DBversion = "3.15.00.XXX";
6939
if(CheckVersion($DBversion)) {
6940
    $dbh->do(q{
6941
        ALTER TABLE itemtypes ADD sip_media_type VARCHAR( 3 ) DEFAULT NULL
6942
    });
6943
    $dbh->do(q{
6944
        INSERT INTO authorised_values (category, authorised_value, lib) VALUES
6945
         ('SIP_MEDIA_TYPE', '000', 'Other'),
6946
         ('SIP_MEDIA_TYPE', '001', 'Book'),
6947
         ('SIP_MEDIA_TYPE', '002', 'Magazine'),
6948
         ('SIP_MEDIA_TYPE', '003', 'Bound journal'),
6949
         ('SIP_MEDIA_TYPE', '004', 'Audio tape'),
6950
         ('SIP_MEDIA_TYPE', '005', 'Video tape'),
6951
         ('SIP_MEDIA_TYPE', '006', 'CD/CDROM'),
6952
         ('SIP_MEDIA_TYPE', '007', 'Diskette'),
6953
         ('SIP_MEDIA_TYPE', '008', 'Book with deskette'),
6954
         ('SIP_MEDIA_TYPE', '009', 'Book with cd'),
6955
         ('SIP_MEDIA_TYPE', '010', 'Book with audio tape')
6956
    });
6957
    print "Upgrade to $DBversion done (Bug 11351 - Add support for SIP2 media type)\n";
6958
    SetVersion($DBversion);
6959
}
6960
6938
=head1 FUNCTIONS
6961
=head1 FUNCTIONS
6939
6962
6940
=head2 TableExists($table)
6963
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt (-1 / +16 lines)
Lines 1-3 Link Here
1
[% USE EncodeUTF8 %]
2
[% USE AuthorisedValues %]
1
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; Item types [% IF ( add_form ) %]&rsaquo;
4
<title>Koha &rsaquo; Administration &rsaquo; Item types [% IF ( add_form ) %]&rsaquo;
3
  [% IF ( itemtype ) %]
5
  [% IF ( itemtype ) %]
Lines 229-234 Item types administration Link Here
229
		  <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
231
		  <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
230
         </li>
232
         </li>
231
      <li>
233
      <li>
234
      <li>
235
          <label for="sip_media_type">SIP media type: </label>
236
          <select id="sip_media_type" name="sip_media_type">
237
              <option value=""></option>
238
              [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE', sip_media_type ) %]
239
                  [% IF a.selected %]
240
                      <option value="[% a.authorised_value %]" selected="selected">[% a.lib | $EncodeUTF8 %]</option>
241
                  [% ELSE %]
242
                      <option value="[% a.authorised_value %]">[% a.lib | $EncodeUTF8  %]</option>
243
                  [% END %]
244
              [% END %]
245
          </select>
246
      </li>
247
      <li>
232
          <label for="summary">Summary: </label>
248
          <label for="summary">Summary: </label>
233
         <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
249
         <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
234
          <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
250
          <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
235
- 

Return to bug 11351