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

(-)a/Koha/AdvancedEditorMacro.pm (-1 / +1 lines)
Lines 24-30 use base qw(Koha::Object); Link Here
24
24
25
=head1 NAME
25
=head1 NAME
26
26
27
Koha::AdvancedEditorMacro - Koha Advanced Editor Macro Object class
27
Koha::AdvancedEditorMacro - Koha Advanced editor macro object class
28
28
29
=head1 API
29
=head1 API
30
30
(-)a/Koha/AdvancedEditorMacros.pm (-1 / +5 lines)
Lines 26-32 use base qw(Koha::Objects); Link Here
26
26
27
=head1 NAME
27
=head1 NAME
28
28
29
Koha::AdvancedEditorMacros - Koha Advanced Editor Macro Object set class
29
Koha::AdvancedEditorMacros - Koha Advanced editor macro object set class
30
30
31
=head1 API
31
=head1 API
32
32
Lines 42-47 sub _type { Link Here
42
    return 'AdvancedEditorMacro';
42
    return 'AdvancedEditorMacro';
43
}
43
}
44
44
45
=head3 object_class
46
47
=cut
48
45
sub object_class {
49
sub object_class {
46
    return 'Koha::AdvancedEditorMacro';
50
    return 'Koha::AdvancedEditorMacro';
47
}
51
}
(-)a/api/v1/swagger/parameters/advancededitormacro.json (-1 / +1 lines)
Lines 2-8 Link Here
2
    "advancededitormacro_id_pp": {
2
    "advancededitormacro_id_pp": {
3
      "name": "advancededitormacro_id",
3
      "name": "advancededitormacro_id",
4
      "in": "path",
4
      "in": "path",
5
      "description": "Advanced Editor Macro internal identifier",
5
      "description": "Advanced editor macro internal identifier",
6
      "required": true,
6
      "required": true,
7
      "type": "integer"
7
      "type": "integer"
8
    }
8
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-7 / +43 lines)
Lines 714-720 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
714
                showSavedMacros();
714
                showSavedMacros();
715
            })
715
            })
716
            .fail(function(err) {
716
            .fail(function(err) {
717
                humanMsg.displayAlert( _("Failed to delete macro:") + err.responseText, { className: 'humanError' } );
717
                var err_message;
718
                if( err.status == "404" ){
719
                    err_message = "Macro not found";
720
                } else if ( err.status == "403" ){
721
                    err_message = _("You do not have permission to delete this macro");
722
                } else {
723
                    err_message = _("There was a problem, please check the logs");
724
                }
725
                humanMsg.displayAlert( _("Failed to delete macro: " + err_message), { className: 'humanError' } );
718
            });
726
            });
719
    }
727
    }
720
728
Lines 760-766 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
760
                macroEditor.activeMacroShared = result.shared;
768
                macroEditor.activeMacroShared = result.shared;
761
            })
769
            })
762
            .fail(function(err) {
770
            .fail(function(err) {
763
                humanMsg.displayAlert( _("Failed to load macros:") + err.responseText, { className: 'humanError' } );
771
                var err_message;
772
                if( err.status == "404" ){
773
                    err_message = "Macro not found";
774
                } else if ( err.status == "403" ){
775
                    err_message = _("You do not have permission to access this macro");
776
                } else {
777
                    err_message = _("There was a problem, please check the logs");
778
                }
779
                humanMsg.displayAlert( _("Failed to load macros: ") + err_message, { className: 'humanError' } );
764
            });
780
            });
765
781
766
    }
782
    }
Lines 795-801 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
795
811
796
                })
812
                })
797
                .fail(function(err) {
813
                .fail(function(err) {
798
                    humanMsg.displayAlert( _("Failed to create macro:") + err.responseText, { className: 'humanError' } );
814
                    var err_message;
815
                    if( err.status == "403" ){
816
                        err_message = _("You do not have permission to create this macro");
817
                    } else {
818
                        err_message = _("There was a problem, please check the logs");
819
                    }
820
                    humanMsg.displayAlert( _("Failed to create macro: ") + err_message, { className: 'humanError' } );
799
                });
821
                });
800
        } );
822
        } );
801
    }
823
    }
Lines 832-838 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
832
                    });
854
                    });
833
            })
855
            })
834
            .fail(function(err) {
856
            .fail(function(err) {
835
                humanMsg.displayAlert( _("Failed to load macros:") + err.responseText, { className: 'humanError' } );
857
                var err_message = _("There was a problem, please check the logs");
858
                humanMsg.displayAlert( _("Failed to load macros: ") + err_message, { className: 'humanError' } );
836
            });
859
            });
837
        var $new_li = $( '<li class="new-macro"><a href="#">' + _("New macro...") + '</a></li>' );
860
        var $new_li = $( '<li class="new-macro"><a href="#">' + _("New macro...") + '</a></li>' );
838
        $new_li.click( function() {
861
        $new_li.click( function() {
Lines 858-864 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
858
                    loadMacro( result.name, result.macro_id );
881
                    loadMacro( result.name, result.macro_id );
859
                })
882
                })
860
                .fail(function(err) {
883
                .fail(function(err) {
861
                    humanMsg.displayAlert( _("Failed to create macro:") + err.responseText, { className: 'humanError' } );
884
                    var err_message;
885
                    if( err.status == "403" ){
886
                        err_message = _("You do not have permission to access this macro");
887
                    } else {
888
                        err_message = _("There was a problem, please check the logs");
889
                    }
890
                    humanMsg.displayAlert( _("Failed to create macro: ") + err_message, { className: 'humanError' } );
862
                });
891
                });
863
        } );
892
        } );
864
        $('#macro-list').append($new_li);
893
        $('#macro-list').append($new_li);
Lines 894-900 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
894
                showSavedMacros();
923
                showSavedMacros();
895
            })
924
            })
896
            .fail(function(err) {
925
            .fail(function(err) {
897
                humanMsg.displayAlert( _("Failed to save macro:") + err.responseText, { className: 'humanError' } );
926
                var err_message;
927
                if( err.status == "404" ){
928
                    err_message = _("Macro not found");
929
                } else if ( err.status ="403" ){
930
                    err_message = _("You do not have permission to access this macro");
931
                } else {
932
                    err_message = _("There was a problem, please check the logs");
933
                }
934
                humanMsg.displayAlert( _("Failed to save macro: ") + err_message, { className: 'humanError' } );
898
            });
935
            });
899
    }
936
    }
900
937
901
- 

Return to bug 17268