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

(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (+11 lines)
Lines 2758-2760 span.onsite_checkout { Link Here
2758
    border-radius: 4px;
2758
    border-radius: 4px;
2759
    border : 1px solid #FFF2CE;
2759
    border : 1px solid #FFF2CE;
2760
}
2760
}
2761
2762
.branchgriditem {
2763
    display: table-cell;
2764
    float: left;
2765
}
2766
.branchgridrow {
2767
    display: table-row;
2768
}
2769
.branchselector {
2770
    display: table;
2771
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/branch-selector.inc (+21 lines)
Line 0 Link Here
1
[%# First check to see if we have anything selected, otherwise we select all %]
2
[% selectall = 1 %]
3
[% FOREACH branch IN branches;
4
    IF branch.selected;
5
        selectall = 0;
6
    END;
7
END %]
8
<div class="branchselector">
9
    <div class="branchgridrow">
10
    [% FOREACH branch IN branches %]
11
        <div class="branchgriditem">
12
            <input id="branch_[% branch.value %]" type="checkbox" name="branch" value="[% branch.value %]"[% IF branch.selected || (selectall == 1) %] checked="checked" [% END %]/>
13
            <label for="branch_[% branch.value %]">[% branch.branchname %]</label>
14
        </div>
15
        [% IF loop.count() % 4 == 0 && !loop.last() %]
16
            </div>
17
            <div class="branchgridrow">
18
        [% END %]
19
    [% END %]
20
    </div>
21
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/export.tt (-3 / +3 lines)
Lines 15-21 Link Here
15
<ul>
15
<ul>
16
	<li>Limit to a bib number range</li>
16
	<li>Limit to a bib number range</li>
17
	<li>Limit to a specific item type</li>
17
	<li>Limit to a specific item type</li>
18
	<li>Limit to a specific library</li>
18
	<li>Limit to a specific set of libraries</li>
19
	<li>Limit to a call number range</li>
19
	<li>Limit to a call number range</li>
20
	<li>Limit to an acquisition date range</li>
20
	<li>Limit to an acquisition date range</li>
21
</ul>
21
</ul>
Lines 23-29 Link Here
23
    <li>Next choose what to skip when exporting
23
    <li>Next choose what to skip when exporting
24
<ul>
24
<ul>
25
	<li>By default items will be exported, if you would like to only export bibliographic data, check the 'Don't export items' box</li>
25
	<li>By default items will be exported, if you would like to only export bibliographic data, check the 'Don't export items' box</li>
26
	<li>To limit your export only to items from the library you're logged in as (if you leave the 'Library' field set to 'All') or to the library you selected above check the 'Remove non-local items' box</li>
26
	<li>To limit your export only to items from the library you're logged in as, check the 'Remove non-local items' box</li>
27
	<li>You can also choose what fields you don't want to export. This can be handy if you're sharing your data, you can remove all local fields before sending your data to another library</li>
27
	<li>You can also choose what fields you don't want to export. This can be handy if you're sharing your data, you can remove all local fields before sending your data to another library</li>
28
</ul>
28
</ul>
29
</li>
29
</li>
Lines 61-64 Link Here
61
61
62
<p><strong>See the full documentation for Exporting MARC Records in the <a href="http://manual.koha-community.org/[% helpVersion %]/en/exportbibs.html">manual</a> (online).</strong></p>
62
<p><strong>See the full documentation for Exporting MARC Records in the <a href="http://manual.koha-community.org/[% helpVersion %]/en/exportbibs.html">manual</a> (online).</strong></p>
63
63
64
[% INCLUDE 'help-bottom.inc' %]
64
[% INCLUDE 'help-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt (-10 / +3 lines)
Lines 65-80 $(document).ready(function() { Link Here
65
        </li>
65
        </li>
66
        
66
        
67
        <li>
67
        <li>
68
            <label for="branch">Library: </label>
68
            <label>Library: </label>
69
            <select id="branch" name="branch">
69
            [% INCLUDE 'branch-selector.inc'
70
            <option value="">-- All --</option>
70
                branches = branchloop %]
71
                [% FOREACH branchloo IN branchloop %]
72
                    [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
73
				[% ELSE %]
74
				<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
75
				[% END %]
76
                    [% END %]
77
                </select>
78
        </li>
71
        </li>
79
        <li>
72
        <li>
80
            <label for="startcn">From item call number: </label>
73
            <label for="startcn">From item call number: </label>
(-)a/tools/export.pl (-17 / +15 lines)
Lines 134-146 my $limit_ind_branch = Link Here
134
      && !C4::Context->IsSuperLibrarian()
134
      && !C4::Context->IsSuperLibrarian()
135
      && C4::Context->userenv->{branch} ) ? 1 : 0;
135
      && C4::Context->userenv->{branch} ) ? 1 : 0;
136
136
137
my $branch = $query->param("branch") || '';
137
my @branch = $query->param("branch");
138
if (   C4::Context->preference("IndependentBranches")
138
if (   C4::Context->preference("IndependentBranches")
139
    && C4::Context->userenv
139
    && C4::Context->userenv
140
    && !C4::Context->IsSuperLibrarian() )
140
    && !C4::Context->IsSuperLibrarian() )
141
{
141
{
142
    $branch = C4::Context->userenv->{'branch'};
142
    @branch = ( C4::Context->userenv->{'branch'} );
143
}
143
}
144
# if stripping nonlocal items, use loggedinuser's branch
145
my $localbranch = C4::Context->userenv->{'branch'};
146
147
my %branchmap = map { $_ => 1 } @branch; # for quick lookups
144
148
145
my $backupdir = C4::Context->config('backupdir');
149
my $backupdir = C4::Context->config('backupdir');
146
150
Lines 246-252 if ( $op eq "export" ) { Link Here
246
                        itemstable           => $itemstable,
250
                        itemstable           => $itemstable,
247
                        StartingBiblionumber => $StartingBiblionumber,
251
                        StartingBiblionumber => $StartingBiblionumber,
248
                        EndingBiblionumber   => $EndingBiblionumber,
252
                        EndingBiblionumber   => $EndingBiblionumber,
249
                        branch               => $branch,
253
                        branch               => \@branch,
250
                        start_callnumber     => $start_callnumber,
254
                        start_callnumber     => $start_callnumber,
251
                        end_callnumber       => $end_callnumber,
255
                        end_callnumber       => $end_callnumber,
252
                        start_accession      => $start_accession,
256
                        start_accession      => $start_accession,
Lines 323-329 if ( $op eq "export" ) { Link Here
323
            # Someone is trying to mess us up
327
            # Someone is trying to mess us up
324
            exit;
328
            exit;
325
        }
329
        }
326
327
        unless (@biblionumbers) {
330
        unless (@biblionumbers) {
328
            my $sth = $dbh->prepare($sql_query);
331
            my $sth = $dbh->prepare($sql_query);
329
            $sth->execute(@sql_params);
332
            $sth->execute(@sql_params);
Lines 364-377 if ( $op eq "export" ) { Link Here
364
                        my ( $homebranchfield, $homebranchsubfield ) =
367
                        my ( $homebranchfield, $homebranchsubfield ) =
365
                          GetMarcFromKohaField( 'items.homebranch', '' );
368
                          GetMarcFromKohaField( 'items.homebranch', '' );
366
                        for my $itemfield ( $record->field($homebranchfield) ) {
369
                        for my $itemfield ( $record->field($homebranchfield) ) {
367
368
# if stripping nonlocal items, use loggedinuser's branch if they didn't select one
369
                            $branch = C4::Context->userenv->{'branch'}
370
                              unless $branch;
371
                            $record->delete_field($itemfield)
370
                            $record->delete_field($itemfield)
372
                              if ( $dont_export_items
371
                              if ( $dont_export_items
373
                                || $itemfield->subfield($homebranchsubfield) ne
372
                                || $localbranch ne $itemfield->subfield(
374
                                $branch );
373
                                        $homebranchsubfield) );
375
                        }
374
                        }
376
                    }
375
                    }
377
                }
376
                }
Lines 472-478 else { Link Here
472
        push @branchloop,
471
        push @branchloop,
473
          {
472
          {
474
            value      => $thisbranch,
473
            value      => $thisbranch,
475
            selected   => $thisbranch eq $branch,
474
            selected   => %branchmap ? $branchmap{$thisbranch} : 1,
476
            branchname => $branches->{$thisbranch}->{'branchname'},
475
            branchname => $branches->{$thisbranch}->{'branchname'},
477
          };
476
          };
478
    }
477
    }
Lines 547-560 sub construct_query { Link Here
547
            my $itemstable           = $params->{itemstable};
546
            my $itemstable           = $params->{itemstable};
548
            my $StartingBiblionumber = $params->{StartingBiblionumber};
547
            my $StartingBiblionumber = $params->{StartingBiblionumber};
549
            my $EndingBiblionumber   = $params->{EndingBiblionumber};
548
            my $EndingBiblionumber   = $params->{EndingBiblionumber};
550
            my $branch               = $params->{branch};
549
            my @branch               = @{ $params->{branch} };
551
            my $start_callnumber     = $params->{start_callnumber};
550
            my $start_callnumber     = $params->{start_callnumber};
552
            my $end_callnumber       = $params->{end_callnumber};
551
            my $end_callnumber       = $params->{end_callnumber};
553
            my $start_accession      = $params->{start_accession};
552
            my $start_accession      = $params->{start_accession};
554
            my $end_accession        = $params->{end_accession};
553
            my $end_accession        = $params->{end_accession};
555
            my $itemtype             = $params->{itemtype};
554
            my $itemtype             = $params->{itemtype};
556
            my $items_filter =
555
            my $items_filter =
557
                 $branch
556
                 @branch
558
              || $start_callnumber
557
              || $start_callnumber
559
              || $end_callnumber
558
              || $end_callnumber
560
              || $start_accession
559
              || $start_accession
Lines 576-584 sub construct_query { Link Here
576
                push @sql_params, $EndingBiblionumber;
575
                push @sql_params, $EndingBiblionumber;
577
            }
576
            }
578
577
579
            if ($branch) {
578
            if (@branch) {
580
                $sql_query .= " AND homebranch = ? ";
579
                $sql_query .= " AND homebranch IN (".join(',',map({'?'} @branch)).")";
581
                push @sql_params, $branch;
580
                push @sql_params, @branch;
582
            }
581
            }
583
582
584
            if ($start_callnumber) {
583
            if ($start_callnumber) {
585
- 

Return to bug 13040