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

(-)a/cataloguing/value_builder/stocknumber.pl (-4 / +4 lines)
Lines 17-24 Link Here
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
20
#use strict;
20
use strict;
21
#use warnings; FIXME - Bug 2505
21
use warnings;
22
use C4::Context;
22
use C4::Context;
23
23
24
=head1 plugin_parameters
24
=head1 plugin_parameters
Lines 53-64 sub plugin_javascript { Link Here
53
53
54
	my $branchcode = C4::Context->userenv->{'branch'};
54
	my $branchcode = C4::Context->userenv->{'branch'};
55
55
56
	$query = "SELECT MAX(CAST(SUBSTRING_INDEX(stocknumber,'_',-1) AS SIGNED))+1 FROM items WHERE homebranch = ? AND stocknumber LIKE ?";
56
	my $query = "SELECT MAX(CAST(SUBSTRING_INDEX(stocknumber,'_',-1) AS SIGNED))+1 FROM items WHERE homebranch = ? AND stocknumber LIKE ?";
57
	my $sth=$dbh->prepare($query);
57
	my $sth=$dbh->prepare($query);
58
58
59
	$sth->execute($branchcode,$branchcode."_%");
59
	$sth->execute($branchcode,$branchcode."_%");
60
	my ($nextnum) = $sth->fetchrow;
60
	my ($nextnum) = $sth->fetchrow;
61
	my $nextnum = $branchcode.'_'.$nextnum;
61
	$nextnum = $branchcode.'_'.$nextnum;
62
62
63
    my $scr = <<END_OF_JS;
63
    my $scr = <<END_OF_JS;
64
if (\$('#' + id).val() == '' || force) {
64
if (\$('#' + id).val() == '' || force) {
(-)a/cataloguing/value_builder/unimarc_field_210c.pl (-4 / +7 lines)
Lines 18-25 Link Here
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
20
21
#use strict;
21
use strict;
22
#use warnings; FIXME - Bug 2505
22
use warnings;
23
23
24
use C4::AuthoritiesMarc;
24
use C4::AuthoritiesMarc;
25
use C4::Auth;
25
use C4::Auth;
Lines 110-116 my ($input) = @_; Link Here
110
    my $authtypes = getauthtypes;
110
    my $authtypes = getauthtypes;
111
    my @authtypesloop;
111
    my @authtypesloop;
112
    foreach my $thisauthtype (keys %$authtypes) {
112
    foreach my $thisauthtype (keys %$authtypes) {
113
        my $selected = 1 if $thisauthtype eq $authtypecode;
113
        my $selected;
114
        if ($thisauthtype eq $authtypecode) {
115
            $selected=1;
116
        }
114
        my %row =(value => $thisauthtype,
117
        my %row =(value => $thisauthtype,
115
                    selected => $selected,
118
                    selected => $selected,
116
                    authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
119
                    authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
Lines 183-189 my ($input) = @_; Link Here
183
        } else {
186
        } else {
184
            $to = (($startfrom+1)*$resultsperpage);
187
            $to = (($startfrom+1)*$resultsperpage);
185
        }
188
        }
186
        my $link="../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_210c.pl&amp;authtypecode=EDITORS&and_or=$and_or&amp;marclist=$marclist&amp;operator=$operator&amp;orderby=$orderby&amp;excluding=$excluding&amp;".join("&amp;",map {"value=".$_} @value)."&amp;op=do_search&amp;type=intranet&amp;index=$index";
189
        my $link="../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_210c.pl&amp;authtypecode=EDITORS&amp;".join("&amp;",map {"value=".$_} @value)."&amp;op=do_search&amp;type=intranet&amp;index=$index";
187
190
188
        $template->param(result => $results) if $results;
191
        $template->param(result => $results) if $results;
189
        $template->param('index' => $query->param('index'));
192
        $template->param('index' => $query->param('index'));
(-)a/cataloguing/value_builder/unimarc_field_4XX.pl (-10 / +17 lines)
Lines 269-276 sub plugin { Link Here
269
            $subfield_value_t = $marcrecord->field('500')->subfield("a");
269
            $subfield_value_t = $marcrecord->field('500')->subfield("a");
270
        }
270
        }
271
271
272
        my $subfield_value_u = $marcrecord->field('856')->subfield("u")
272
        my $subfield_value_u;
273
          if ( $marcrecord->field('856') );
273
        if ( $marcrecord->field('856') ) {
274
            $subfield_value_u = $marcrecord->field('856')->subfield("u");
275
        }
274
276
275
        my $subfield_value_v;
277
        my $subfield_value_v;
276
        if (   ( $marcrecord->field('225') )
278
        if (   ( $marcrecord->field('225') )
Lines 283-296 sub plugin { Link Here
283
        {
285
        {
284
            $subfield_value_v = $marcrecord->field('200')->subfield("h");
286
            $subfield_value_v = $marcrecord->field('200')->subfield("h");
285
        }
287
        }
286
        my $subfield_value_x = $marcrecord->field('011')->subfield("a")
288
        my $subfield_value_x;
287
          if (
289
        if (
288
            $marcrecord->field('011')
290
            $marcrecord->field('011')
289
            and not( ( $marcrecord->field('011')->subfield("y") )
291
            and not( ( $marcrecord->field('011')->subfield("y") )
290
                or ( $marcrecord->field('011')->subfield("z") ) )
292
                or ( $marcrecord->field('011')->subfield("z") ) ) ) {
291
          );
293
             $subfield_value_x = $marcrecord->field('011')->subfield("a");
292
        my $subfield_value_y = $marcrecord->field('013')->subfield("a")
294
        }
293
          if ( $marcrecord->field('013') );
295
        my $subfield_value_y;
296
          if ( $marcrecord->field('013') ) {
297
             $subfield_value_y = $marcrecord->field('013')->subfield("a");
298
        }
294
        if   ( $marcrecord->field('010') ) {
299
        if   ( $marcrecord->field('010') ) {
295
            $subfield_value_y = $marcrecord->field('010')->subfield("a");
300
            $subfield_value_y = $marcrecord->field('010')->subfield("a");
296
        }
301
        }
Lines 374-380 sub plugin { Link Here
374
            my $record = MARC::Record::new_from_usmarc( $results->[$i] );
379
            my $record = MARC::Record::new_from_usmarc( $results->[$i] );
375
            my $rechash = TransformMarcToKoha( $dbh, $record );
380
            my $rechash = TransformMarcToKoha( $dbh, $record );
376
            my $pos;
381
            my $pos;
377
            my $countitems = 1 if ( $rechash->{itemnumber} );
382
            my $countitems;
383
            if ( $rechash->{itemnumber} ) {
384
                $countitems=1;
385
            }
378
            while ( index( $rechash->{itemnumber}, '|', $pos ) > 0 ) {
386
            while ( index( $rechash->{itemnumber}, '|', $pos ) > 0 ) {
379
                $countitems += 1;
387
                $countitems += 1;
380
                $pos = index( $rechash->{itemnumber}, '|', $pos ) + 1;
388
                $pos = index( $rechash->{itemnumber}, '|', $pos ) + 1;
381
- 

Return to bug 6679