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

(-)a/C4/SIP/ILS/Item.pm (-1 / +5 lines)
Lines 21-26 use C4::Items; Link Here
21
use C4::Circulation;
21
use C4::Circulation;
22
use C4::Members;
22
use C4::Members;
23
use C4::Reserves;
23
use C4::Reserves;
24
use Koha::Database;
24
25
25
our $VERSION = 3.07.00.049;
26
our $VERSION = 3.07.00.049;
26
27
Lines 86-92 sub new { Link Here
86
    $item->{permanent_location}= $item->{homebranch};
87
    $item->{permanent_location}= $item->{homebranch};
87
    $item->{'collection_code'} = $item->{ccode};
88
    $item->{'collection_code'} = $item->{ccode};
88
    $item->{  'call_number'  } = $item->{itemcallnumber};
89
    $item->{  'call_number'  } = $item->{itemcallnumber};
89
    # $item->{'destination_loc'}  =  ?
90
91
    my $it = C4::Context->preference('item-level_itypes') ? $item->{itype} : $item->{itemtype};
92
    my $itemtype = Koha::Database->new()->schema()->resultset('Itemtype')->find( $it );
93
    $item->{sip_media_type} = $item->sip_media_type() if $itemtype;
90
94
91
	# check if its on issue and if so get the borrower
95
	# check if its on issue and if so get the borrower
92
	my $issue = GetItemIssue($item->{'itemnumber'});
96
	my $issue = GetItemIssue($item->{'itemnumber'});
(-)a/admin/itemtypes.pl (-2 / +6 lines)
Lines 121-126 if ( $op eq 'add_form' ) { Link Here
121
        checkinmsgtype  => $data->{'checkinmsgtype'},
121
        checkinmsgtype  => $data->{'checkinmsgtype'},
122
        imagesets       => $imagesets,
122
        imagesets       => $imagesets,
123
        remote_image    => $remote_image,
123
        remote_image    => $remote_image,
124
        sip_media_type  => $data->{sip_media_type},
124
    );
125
    );
125
126
126
    # END $OP eq ADD_FORM
127
    # END $OP eq ADD_FORM
Lines 145-150 elsif ( $op eq 'add_validate' ) { Link Here
145
                 , summary = ?
146
                 , summary = ?
146
                 , checkinmsg = ?
147
                 , checkinmsg = ?
147
                 , checkinmsgtype = ?
148
                 , checkinmsgtype = ?
149
                 , sip_media_type = ?
148
            WHERE itemtype = ?
150
            WHERE itemtype = ?
149
        ';
151
        ';
150
        $sth = $dbh->prepare($query2);
152
        $sth = $dbh->prepare($query2);
Lines 162-176 elsif ( $op eq 'add_validate' ) { Link Here
162
            $input->param('summary'),
164
            $input->param('summary'),
163
            $input->param('checkinmsg'),
165
            $input->param('checkinmsg'),
164
            $input->param('checkinmsgtype'),
166
            $input->param('checkinmsgtype'),
167
            $input->param('sip_media_type'),
165
            $input->param('itemtype')
168
            $input->param('itemtype')
166
        );
169
        );
167
    }
170
    }
168
    else {    # add a new itemtype & not modif an old
171
    else {    # add a new itemtype & not modif an old
169
        my $query = "
172
        my $query = "
170
            INSERT INTO itemtypes
173
            INSERT INTO itemtypes
171
                (itemtype,description,rentalcharge, notforloan, imageurl, summary, checkinmsg, checkinmsgtype)
174
                (itemtype,description,rentalcharge, notforloan, imageurl, summary, checkinmsg, checkinmsgtype, sip_media_type)
172
            VALUES
175
            VALUES
173
                (?,?,?,?,?,?,?,?);
176
                (?,?,?,?,?,?,?,?,?);
174
            ";
177
            ";
175
        my $sth = $dbh->prepare($query);
178
        my $sth = $dbh->prepare($query);
176
		my $image = $input->param('image');
179
		my $image = $input->param('image');
Lines 185-190 elsif ( $op eq 'add_validate' ) { Link Here
185
            $input->param('summary'),
188
            $input->param('summary'),
186
            $input->param('checkinmsg'),
189
            $input->param('checkinmsg'),
187
            $input->param('checkinmsgtype'),
190
            $input->param('checkinmsgtype'),
191
            $input->param('sip_media_type'),
188
        );
192
        );
189
    }
193
    }
190
194
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 1235-1240 CREATE TABLE `itemtypes` ( -- defines the item types Link Here
1235
  summary text, -- information from the summary field, may include HTML
1235
  summary text, -- information from the summary field, may include HTML
1236
  checkinmsg VARCHAR(255), -- message that is displayed when an item with the given item type is checked in
1236
  checkinmsg VARCHAR(255), -- message that is displayed when an item with the given item type is checked in
1237
  checkinmsgtype CHAR(16) DEFAULT 'message' NOT NULL, -- type (CSS class) for the checkinmsg, can be "alert" or "message"
1237
  checkinmsgtype CHAR(16) DEFAULT 'message' NOT NULL, -- type (CSS class) for the checkinmsg, can be "alert" or "message"
1238
  sip_media_type VARCHAR( 3 ) NOT NULL DEFAULT "", -- SIP2 protocol media type for this itemtype
1238
  PRIMARY KEY  (`itemtype`),
1239
  PRIMARY KEY  (`itemtype`),
1239
  UNIQUE KEY `itemtype` (`itemtype`)
1240
  UNIQUE KEY `itemtype` (`itemtype`)
1240
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1241
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 7797-7802 if ( CheckVersion($DBversion) ) { Link Here
7797
    SetVersion($DBversion);
7797
    SetVersion($DBversion);
7798
}
7798
}
7799
7799
7800
$DBversion = "3.15.00.XXX";
7801
if(CheckVersion($DBversion)) {
7802
    $dbh->do(q{
7803
        ALTER TABLE itemtypes ADD sip_media_type VARCHAR( 3 ) NOT NULL DEFAULT ""
7804
    });
7805
    print "Upgrade to $DBversion done ()\n";
7806
    SetVersion($DBversion);
7807
}
7808
7800
=head1 FUNCTIONS
7809
=head1 FUNCTIONS
7801
7810
7802
=head2 TableExists($table)
7811
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt (-1 / +71 lines)
Lines 246-251 Item types administration Link Here
246
          <select>
246
          <select>
247
      </li>
247
      </li>
248
      <li>
248
      <li>
249
          <label for="sip_media_type">SIP media type: </label>
250
          <select id="sip_media_type" name="sip_media_type">
251
              <option value=""></option>
252
              [% IF sip_media_type == '000' %]
253
                  <option value="000" selected="selected">Other</option>
254
              [% ELSE %]
255
                  <option value="000">Other</option>
256
              [% END %]
257
258
              [% IF sip_media_type == '001' %]
259
                  <option value="001" selected="selected">Book</option>
260
              [% ELSE %]
261
                  <option value="001">Book</option>
262
              [% END %]
263
264
              [% IF sip_media_type == '002' %]
265
                  <option value="002" selected="selected">Magazine</option>
266
              [% ELSE %]
267
                  <option value="002">Magazine</option>
268
              [% END %]
269
270
              [% IF sip_media_type == '003' %]
271
                  <option value="003" selected="selected">Bound journal</option>
272
              [% ELSE %]
273
                  <option value="003">Bound journal</option>
274
              [% END %]
275
276
              [% IF sip_media_type == '004' %]
277
                  <option value="004" selected="selected">Audio tape</option>
278
              [% ELSE %]
279
                  <option value="004">Audio tape</option>
280
              [% END %]
281
282
              [% IF sip_media_type == '005' %]
283
                  <option value="005" selected="selected">Video tape</option>
284
              [% ELSE %]
285
                  <option value="005">Video tape</option>
286
              [% END %]
287
288
              [% IF sip_media_type == '006' %]
289
                  <option value="006" selected="selected">CD/CDROM</option>
290
              [% ELSE %]
291
                  <option value="006">CD/CDROM</option>
292
              [% END %]
293
294
              [% IF sip_media_type == '007' %]
295
                  <option value="007" selected="selected">Diskette</option>
296
              [% ELSE %]
297
                  <option value="007">Diskette</option>
298
              [% END %]
299
300
              [% IF sip_media_type == '008' %]
301
                  <option value="008" selected="selected">Book with diskette</option>
302
              [% ELSE %]
303
                  <option value="008">Book with diskette</option>
304
              [% END %]
305
306
              [% IF sip_media_type == '009' %]
307
                  <option value="009" selected="selected">Book with CD</option>
308
              [% ELSE %]
309
                  <option value="009">Book with CD</option>
310
              [% END %]
311
312
              [% IF sip_media_type == '010' %]
313
                  <option value="010" selected="selected">Book with audio tape</option>
314
              [% ELSE %]
315
                  <option value="010">Book with audio tape</option>
316
              [% END %]
317
          </select>
318
      </li>
319
      <li>
249
          <label for="summary">Summary: </label>
320
          <label for="summary">Summary: </label>
250
         <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
321
         <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
251
          <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
322
          <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
252
- 

Return to bug 11351