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

(-)a/Koha/Library.pm (-1 / +1 lines)
Lines 29-35 use Koha::StockRotationStages; Link Here
29
use Koha::SMTP::Servers;
29
use Koha::SMTP::Servers;
30
use Koha::Library::Hours;
30
use Koha::Library::Hours;
31
31
32
use base qw(Koha::Object);
32
use base qw(Koha::Object::Mixin::AdditionalFields Koha::Object);
33
33
34
my $cache = Koha::Caches->get_instance();
34
my $cache = Koha::Caches->get_instance();
35
35
(-)a/admin/branches.pl (+20 lines)
Lines 28-33 use C4::Context; Link Here
28
use C4::Output qw( output_html_with_http_headers );
28
use C4::Output qw( output_html_with_http_headers );
29
use C4::Koha;
29
use C4::Koha;
30
30
31
use Koha::AdditionalFields;
31
use Koha::Database;
32
use Koha::Database;
32
use Koha::Patrons;
33
use Koha::Patrons;
33
use Koha::Items;
34
use Koha::Items;
Lines 49-54 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
49
    }
50
    }
50
);
51
);
51
52
53
if ($branchcode) {
54
    my @additional_fields = Koha::AdditionalFields->search( { tablename => 'branches' } )->as_list;
55
    my @additional_field_values;
56
    @additional_field_values = Koha::Libraries->find($branchcode)->get_additional_field_values_for_template;
57
58
    $template->param(
59
        additional_fields       => \@additional_fields,
60
        additional_field_values => @additional_field_values,
61
    );
62
}
63
52
if ( $op eq 'add_form' ) {
64
if ( $op eq 'add_form' ) {
53
    $template->param(
65
    $template->param(
54
        library      => Koha::Libraries->find($branchcode),
66
        library      => Koha::Libraries->find($branchcode),
Lines 146-151 if ( $op eq 'add_form' ) { Link Here
146
                        $index++;
158
                        $index++;
147
                    }
159
                    }
148
160
161
                    my @additional_fields =
162
                        Koha::Libraries->find($branchcode)->prepare_cgi_additional_field_values( $input, 'branches' );
163
                    Koha::Libraries->find($branchcode)->set_additional_fields( \@additional_fields );
164
149
                    push @messages, { type => 'message', code => 'success_on_update' };
165
                    push @messages, { type => 'message', code => 'success_on_update' };
150
                }
166
                }
151
            );
167
            );
Lines 208-213 if ( $op eq 'add_form' ) { Link Here
208
                        $index++;
224
                        $index++;
209
                    }
225
                    }
210
226
227
                    my @additional_fields =
228
                        Koha::Libraries->find($branchcode)->prepare_cgi_additional_field_values( $input, 'branches' );
229
                    Koha::Libraries->find($branchcode)->set_additional_fields( \@additional_fields );
230
211
                    push @messages, { type => 'message', code => 'success_on_insert' };
231
                    push @messages, { type => 'message', code => 'success_on_insert' };
212
                }
232
                }
213
            );
233
            );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt (-1 / +8 lines)
Lines 368-373 Link Here
368
                </li>
368
                </li>
369
            </ol>
369
            </ol>
370
        </fieldset>
370
        </fieldset>
371
        [% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values wrap_fieldset=1 %]
371
        <fieldset class="action">
372
        <fieldset class="action">
372
            <input type="submit" class="btn btn-primary" value="Submit" />
373
            <input type="submit" class="btn btn-primary" value="Submit" />
373
            <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a>
374
            <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a>
Lines 602-607 Link Here
602
            </div> <!-- /.rows -->
603
            </div> <!-- /.rows -->
603
        </div> <!-- /.col-sm-6 -->
604
        </div> <!-- /.col-sm-6 -->
604
    </div> <!-- /.row -->
605
    </div> <!-- /.row -->
606
    [% IF additional_fields && additional_field_values %]
607
        <div class="rows page-section">
608
            <h2>Additional fields</h2>
609
            [% INCLUDE 'additional-fields-display.inc' available=additional_fields values=additional_field_values %]
610
        </div>
611
    [% END %]
605
    [% IF OpacLibraryInfo %]<!-- opac_info -->
612
    [% IF OpacLibraryInfo %]<!-- opac_info -->
606
        <div class="row page-section">
613
        <div class="row page-section">
607
            <div class="col-sm-12">
614
            <div class="col-sm-12">
Lines 626-631 Link Here
626
633
627
[% MACRO jsinclude BLOCK %]
634
[% MACRO jsinclude BLOCK %]
628
    [% Asset.js("js/admin-menu.js") | $raw %]
635
    [% Asset.js("js/admin-menu.js") | $raw %]
636
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
629
    [% INCLUDE 'calendar.inc' %]
637
    [% INCLUDE 'calendar.inc' %]
630
    [% INCLUDE 'datatables.inc' %]
638
    [% INCLUDE 'datatables.inc' %]
631
    [% INCLUDE 'columns_settings.inc' %]
639
    [% INCLUDE 'columns_settings.inc' %]
632
- 

Return to bug 38663