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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-bib-search.tt (-4 / +14 lines)
Lines 18-29 Link Here
18
	<ol>
18
	<ol>
19
    <li><label for="q">Keyword: </label>
19
    <li><label for="q">Keyword: </label>
20
    <input type="text" id="q"  name="q" /></li>
20
    <input type="text" id="q"  name="q" /></li>
21
    
21
22
[% FOREACH advancedsearchesloo IN advancedsearchesloop %]
22
    <!-- ITEMTYPE LIMITS -->
23
    <!-- ITEMTYPE LIMITS -->
23
        <li><label for="itemtypelimit">Limit type to: </label>
24
        <li>
24
        <select name="itemtypelimit" id="itemtypelimit">
25
            <label for="[% advancedsearchesloo.advanced_search_type %]">
26
               [% IF ( advancedsearchesloo.advanced_search_type == 'itemtypes' ) %]Item type
27
               [% ELSIF ( advancedsearchesloo.advanced_search_type == 'ccode' ) %]Collection
28
               [% ELSIF ( advancedsearchesloo.advanced_search_type == 'loc' ) %]Shelving location
29
               [% ELSE %][% advancedsearchesloo.advanced_search_type %]
30
               [% END %]
31
            </label>
32
        <select name="itemtypelimit" id="[% advancedsearchesloo.advanced_search_type %]">
25
	    <option value="">All</option>
33
	    <option value="">All</option>
26
        [% FOREACH itemtypeloo IN itemtypeloop %]
34
        [% FOREACH itemtypeloo IN advancedsearchesloo.code_loop %]
27
            <option value="[% itemtypeloo.code %]">
35
            <option value="[% itemtypeloo.code %]">
28
                [% itemtypeloo.description |html %]
36
                [% itemtypeloo.description |html %]
29
            </option>
37
            </option>
Lines 31-36 Link Here
31
        </select>
39
        </select>
32
        </li>
40
        </li>
33
    <!-- /ITEMTYPE LIMITS -->
41
    <!-- /ITEMTYPE LIMITS -->
42
[% END %]
43
34
	</ol>
44
	</ol>
35
</fieldset>
45
</fieldset>
36
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
46
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
(-)a/serials/subscription-bib-search.pl (-39 / +40 lines)
Lines 199-249 else { Link Here
199
                authnotrequired => 0,
199
                authnotrequired => 0,
200
                flagsrequired => {catalogue => 1, serials => '*'},
200
                flagsrequired => {catalogue => 1, serials => '*'},
201
                debug => 1,
201
                debug => 1,
202
                });
202
                    });
203
    # load the itemtypes
203
    # load the Type stuff
204
    my $itemtypes = GetItemTypes;
204
    my $itemtypes = GetItemTypes;
205
    my @itemtypesloop;
205
    my @advancedsearchesloop;
206
    if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
206
    my $selected=1;
207
	# load the itemtypes
207
208
	my $itemtypes = GetItemTypes;
208
    my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes";
209
	my $selected=1;
209
    my @advanced_search_types = split(/\|/, $advanced_search_types);
210
	my $cnt;
210
211
	foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
211
    foreach my $advanced_srch_type (@advanced_search_types) {
212
	    my %row =(
212
        if ($advanced_srch_type eq 'itemtypes') {
213
			code => $thisitemtype,
213
            # itemtype is a special case, since it's not defined in authorized values
214
			selected => $selected,
214
            my @itypesloop;
215
			description => $itemtypes->{$thisitemtype}->{'description'},
215
            foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
216
		    );
216
                my %row =(
217
	    $selected = 0 if ($selected) ;
217
                    code => $thisitemtype,
218
	    push @itemtypesloop, \%row;
218
                    selected => $selected,
219
	}
219
                    description => $itemtypes->{$thisitemtype}->{'description'},
220
220
                );
221
221
                $selected = 0 if ($selected);
222
    } else {
222
                push @itypesloop, \%row;
223
	my $advsearchtypes = GetAuthorisedValues($advanced_search_types);
223
            }
224
	my $cnt;
224
            my %search_code = (  advanced_search_type => $advanced_srch_type,
225
	my $selected=1;
225
                                 code_loop => \@itypesloop );
226
	for my $thisitemtype (sort {$a->{'lib'} cmp $b->{'lib'}} @$advsearchtypes) {
226
            push @advancedsearchesloop, \%search_code;
227
	    my %row =(
227
        } else {
228
		    number=>$cnt++,
228
            # covers all the other cases: non-itemtype authorized values
229
		    ccl => $advanced_search_types,
229
            my $advsearchtypes = GetAuthorisedValues($advanced_srch_type);
230
		    code => $thisitemtype->{authorised_value},
230
            my @authvalueloop;
231
		    selected => $selected,
231
            for my $thisitemtype (@$advsearchtypes) {
232
		    description => $thisitemtype->{'lib'},
232
                my %row =(
233
		    count5 => $cnt % 4,
233
                    code => $thisitemtype->{authorised_value},
234
		    imageurl=> getitemtypeimagelocation( 'intranet', $thisitemtype->{'imageurl'} ),
234
                    description => $thisitemtype->{'lib_opac'} || $thisitemtype->{'lib'},
235
		);
235
                    );
236
	    push @itemtypesloop, \%row;
236
                push @authvalueloop, \%row;
237
	}
237
            }
238
            my %search_code = (  advanced_search_type => $advanced_srch_type,
239
                                 code_loop => \@authvalueloop );
240
            push @advancedsearchesloop, \%search_code;
241
        }
238
    }
242
    }
239
240
241
    if ($op eq "do_search") {
243
    if ($op eq "do_search") {
242
       $template->param("no_query" => 1);
244
       $template->param("no_query" => 1);
243
    } else {
245
    } else {
244
       $template->param("no_query" => 0);
246
       $template->param("no_query" => 0);
245
    }
247
    }
246
    $template->param(itemtypeloop => \@itemtypesloop);
248
$template->param(advancedsearchesloop => \@advancedsearchesloop);
247
}
249
}
248
# Print the page
250
# Print the page
249
output_html_with_http_headers $input, $cookie, $template->output;
251
output_html_with_http_headers $input, $cookie, $template->output;
250
- 

Return to bug 9203