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

(-)a/acqui/addorderiso2709.pl (-31 lines)
Lines 311-347 foreach my $r ( @{$budgets_hierarchy} ) { Link Here
311
}
311
}
312
$template->param( budget_loop    => $budget_loop,);
312
$template->param( budget_loop    => $budget_loop,);
313
313
314
my $CGIsort1;
315
if ($budget) {    # its a mod ..
316
    if ( defined $budget->{'sort1_authcat'} ) {    # with custom  Asort* planning values
317
        $CGIsort1 = GetAuthvalueDropbox(  $budget->{'sort1_authcat'}, $data->{'sort1'} );
318
    }
319
} elsif ( scalar(@$budgets) ) {
320
} elsif ( scalar(@$budgets_hierarchy) ) {
321
    $CGIsort1 = GetAuthvalueDropbox( @$budgets_hierarchy[0]->{'sort1_authcat'}, '' );
322
}
323
# if CGIsort is successfully fetched, the use it
324
# else - failback to plain input-field
325
if ($CGIsort1) {
326
    $template->param( CGIsort1 => $CGIsort1 );
327
} else {
328
    $template->param( sort1 => $data->{'sort1'} );
329
}
330
331
my $CGIsort2;
332
if ($budget) {
333
    if ( defined $budget->{'sort2_authcat'} ) {
334
        $CGIsort2 = GetAuthvalueDropbox(  $budget->{'sort2_authcat'}, $data->{'sort2'} );
335
    }
336
} elsif ( scalar(@$budgets_hierarchy) ) {
337
    $CGIsort2 = GetAuthvalueDropbox( @$budgets_hierarchy[0]->{sort2_authcat}, '' );
338
}
339
if ($CGIsort2) {
340
    $template->param( CGIsort2 => $CGIsort2 );
341
} else {
342
    $template->param( sort2 => $data->{'sort2'} );
343
}
344
345
output_html_with_http_headers $input, $cookie, $template->output;
314
output_html_with_http_headers $input, $cookie, $template->output;
346
315
347
316
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt (-31 / +6 lines)
Lines 70-75 Link Here
70
            $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2');
70
            $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2');
71
        } );
71
        } );
72
72
73
        $("select[name='all_budget_id']").change();
74
73
        $("#records_to_import fieldset.rows ol").hide();
75
        $("#records_to_import fieldset.rows ol").hide();
74
        $('input:checkbox[name="import_record_id"]').change(function(){
76
        $('input:checkbox[name="import_record_id"]').change(function(){
75
            var container = $(this).parents("fieldset");
77
            var container = $(this).parents("fieldset");
Lines 321-358 Link Here
321
                                </li>
323
                                </li>
322
                                <li>
324
                                <li>
323
                                    <div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
325
                                    <div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
324
                                    <label for="sort1">Statistic 1: </label>
326
                                    <label for="all_sort1">Statistic 1: </label>
325
                                    [% IF CGIsort1 %]
327
                                    <input type="text" id="all_sort1" size="20" name="all_sort1" value="" />
326
                                        <select id="all_sort1" size="1" name="all_sort1">
327
                                        [% FOREACH sort_opt IN CGIsort1 %]
328
                                            [% IF sort_opt.default %]
329
                                                <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
330
                                            [% ELSE %]
331
                                                <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
332
                                            [% END %]
333
                                        [% END %]
334
                                        </select>
335
                                    [% ELSE %]
336
                                        <input type="text" id="all_sort1" size="20" name="all_sort1" value="[% sort1 %]" />
337
                                    [% END %]
338
                                </li>
328
                                </li>
339
                                <li>
329
                                <li>
340
                                  <span id="sort2_zone">
330
                                    <label for="all_sort2">Statistic 2: </label>
341
                                    <label for="sort2">Statistic 2: </label>
331
                                    <input type="text" id="all_sort2" size="20" name="all_sort2" value="" />
342
                                    [% IF CGIsort2 %]
343
                                        <select id="all_sort2" size="1" name="all_sort1">
344
                                        [% FOREACH sort_opt IN CGIsort2 %]
345
                                            [% IF sort_opt.default %]
346
                                                <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
347
                                            [% ELSE %]
348
                                                <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
349
                                            [% END %]
350
                                        [% END %]
351
                                        </select>
352
                                    [% ELSE %]
353
                                         <input type="text" id="all_sort2" size="20" name="all_sort2" value="[% sort2 %]" />
354
                                    [% END %]
355
                                  </span>
356
                                </li>
332
                                </li>
357
                            </ol>
333
                            </ol>
358
                        </fieldset>
334
                        </fieldset>
359
- 

Return to bug 7180