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

(-)a/authorities/authorities.pl (-1 / +6 lines)
Lines 550-555 my $myindex = $input->param('index'); Link Here
550
my $linkid=$input->param('linkid');
550
my $linkid=$input->param('linkid');
551
my $authtypecode = $input->param('authtypecode');
551
my $authtypecode = $input->param('authtypecode');
552
my $breedingid    = $input->param('breedingid');
552
my $breedingid    = $input->param('breedingid');
553
my $changed_authtype = $input->param('changed_authtype') // q{};
553
554
554
555
555
my $dbh = C4::Context->dbh;
556
my $dbh = C4::Context->dbh;
Lines 618-624 if ($op eq "add") { Link Here
618
        }
619
        }
619
        exit;
620
        exit;
620
    } else {
621
    } else {
621
    # it may be a duplicate, warn the user and do nothing
622
        # it may be a duplicate, warn the user and do nothing
622
        build_tabs($template, $record, $dbh, $encoding,$input);
623
        build_tabs($template, $record, $dbh, $encoding,$input);
623
        build_hidden_data;
624
        build_hidden_data;
624
        $template->param(authid =>$authid,
625
        $template->param(authid =>$authid,
Lines 640-645 if ($op eq "duplicate") Link Here
640
        {
641
        {
641
                $authid = "";
642
                $authid = "";
642
        }
643
        }
644
        if($changed_authtype eq "changed"){
645
            $record = TransformHtmlToMarc( $input, 0 );
646
        }
647
643
        build_tabs ($template, $record, $dbh,$encoding,$input);
648
        build_tabs ($template, $record, $dbh,$encoding,$input);
644
        build_hidden_data;
649
        build_hidden_data;
645
        $template->param(oldauthtypetagfield=>$oldauthtypetagfield, oldauthtypetagsubfield=>$oldauthtypetagsubfield,
650
        $template->param(oldauthtypetagfield=>$oldauthtypetagfield, oldauthtypetagsubfield=>$oldauthtypetagsubfield,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-1 / +39 lines)
Lines 78-83 Link Here
78
            selectTab( tablink );
78
            selectTab( tablink );
79
            window.scrollTo( 0, getScrollto( field, "toolbar" ) );
79
            window.scrollTo( 0, getScrollto( field, "toolbar" ) );
80
        });
80
        });
81
82
        $(".change-authtype").on("click", function(){
83
            var authtypecode = $(this).data("authtypecode");
84
            var f = document.f;
85
            f.op.value = "[% op | html %]";
86
            f.authid.value = "[% authid | html %]";
87
            f.changed_authtype.value = "changed";
88
            f.authtypecode.value = authtypecode;
89
            f.submit();
90
        });
81
    });
91
    });
82
92
83
    function selectTab( tablink ){
93
    function selectTab( tablink ){
Lines 311-316 Link Here
311
                    <input type="hidden" name="authid" value="[% authid | html %]" />
321
                    <input type="hidden" name="authid" value="[% authid | html %]" />
312
                    <input type="hidden" name="index" value="[% index | html %]" />
322
                    <input type="hidden" name="index" value="[% index | html %]" />
313
                    <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
323
                    <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
324
                    <input type="hidden" name="changed_authtype" value="" />
314
325
315
                    <div id="toolbar" class="btn-toolbar">
326
                    <div id="toolbar" class="btn-toolbar">
316
                        <div class="btn-group"><a href="#" id="addauth" class="btn btn-default" accesskey="w"><i class="fa fa-save"></i> Save</a></div>
327
                        <div class="btn-group"><a href="#" id="addauth" class="btn btn-default" accesskey="w"><i class="fa fa-save"></i> Save</a></div>
Lines 322-327 Link Here
322
                            [% END %]
333
                            [% END %]
323
                        </div>
334
                        </div>
324
                        <div class="btn-group">
335
                        <div class="btn-group">
336
                            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
337
                            <ul id="settings-menu" class="dropdown-menu">
338
                                <li class="dropdown-header">Change authority type</li>
339
                                <li>
340
                                    <a href="#" class="change-authtype" data-authtypecode="">
341
                                        [% IF ( authtypecode ) %]
342
                                           <i class="fa fa-fw">&nbsp;</i>
343
                                        [% ELSE %]
344
                                            <i class="fa fa-fw fa-check"></i>
345
                                        [% END %]
346
                                        Default
347
                                    </a>
348
                                </li>
349
                                [% FOREACH authority_type IN authority_types %]
350
                                    <li>
351
                                        <a href="#" class="change-authtype" data-authtypecode="[% authority_type.authtypecode | html %]">
352
                                            [% IF authority_type.authtypecode == authtypecode %]
353
                                                <i class="fa fa-fw fa-check"></i>
354
                                            [% ELSE %]
355
                                                <i class="fa fa-fw">&nbsp;</i>
356
                                            [% END %]
357
                                            [% authority_type.authtypetext | html %]
358
                                        </a>
359
                                    </li>
360
                                [% END %]
361
                            </ul> <!-- /#settings-menu -->
362
                        </div> <!-- /.btn-group -->
363
                        <div class="btn-group">
325
                            [% IF ( authid ) %]
364
                            [% IF ( authid ) %]
326
                                <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
365
                                <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
327
                            [% ELSE %]
366
                            [% ELSE %]
328
- 

Return to bug 30930