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 715-721 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
715
                showSavedMacros();
715
                showSavedMacros();
716
            })
716
            })
717
            .fail(function(err) {
717
            .fail(function(err) {
718
                humanMsg.displayAlert( _("Failed to delete macro:") + err.responseText, { className: 'humanError' } );
718
                var err_message;
719
                if( err.status == "404" ){
720
                    err_message = "Macro not found";
721
                } else if ( err.status == "403" ){
722
                    err_message = _("You do not have permission to delete this macro");
723
                } else {
724
                    err_message = _("There was a problem, please check the logs");
725
                }
726
                humanMsg.displayAlert( _("Failed to delete macro: " + err_message), { className: 'humanError' } );
719
            });
727
            });
720
    }
728
    }
721
729
Lines 761-767 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
761
                macroEditor.activeMacroShared = result.shared;
769
                macroEditor.activeMacroShared = result.shared;
762
            })
770
            })
763
            .fail(function(err) {
771
            .fail(function(err) {
764
                humanMsg.displayAlert( _("Failed to load macros:") + err.responseText, { className: 'humanError' } );
772
                var err_message;
773
                if( err.status == "404" ){
774
                    err_message = "Macro not found";
775
                } else if ( err.status == "403" ){
776
                    err_message = _("You do not have permission to access this macro");
777
                } else {
778
                    err_message = _("There was a problem, please check the logs");
779
                }
780
                humanMsg.displayAlert( _("Failed to load macros: ") + err_message, { className: 'humanError' } );
765
            });
781
            });
766
782
767
    }
783
    }
Lines 796-802 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
796
812
797
                })
813
                })
798
                .fail(function(err) {
814
                .fail(function(err) {
799
                    humanMsg.displayAlert( _("Failed to create macro:") + err.responseText, { className: 'humanError' } );
815
                    var err_message;
816
                    if( err.status == "403" ){
817
                        err_message = _("You do not have permission to create this macro");
818
                    } else {
819
                        err_message = _("There was a problem, please check the logs");
820
                    }
821
                    humanMsg.displayAlert( _("Failed to create macro: ") + err_message, { className: 'humanError' } );
800
                });
822
                });
801
        } );
823
        } );
802
    }
824
    }
Lines 833-839 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
833
                    });
855
                    });
834
            })
856
            })
835
            .fail(function(err) {
857
            .fail(function(err) {
836
                humanMsg.displayAlert( _("Failed to load macros:") + err.responseText, { className: 'humanError' } );
858
                var err_message = _("There was a problem, please check the logs");
859
                humanMsg.displayAlert( _("Failed to load macros: ") + err_message, { className: 'humanError' } );
837
            });
860
            });
838
        var $new_li = $( '<li class="new-macro"><a href="#">' + _("New macro...") + '</a></li>' );
861
        var $new_li = $( '<li class="new-macro"><a href="#">' + _("New macro...") + '</a></li>' );
839
        $new_li.click( function() {
862
        $new_li.click( function() {
Lines 859-865 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
859
                    loadMacro( result.name, result.macro_id );
882
                    loadMacro( result.name, result.macro_id );
860
                })
883
                })
861
                .fail(function(err) {
884
                .fail(function(err) {
862
                    humanMsg.displayAlert( _("Failed to create macro:") + err.responseText, { className: 'humanError' } );
885
                    var err_message;
886
                    if( err.status == "403" ){
887
                        err_message = _("You do not have permission to access this macro");
888
                    } else {
889
                        err_message = _("There was a problem, please check the logs");
890
                    }
891
                    humanMsg.displayAlert( _("Failed to create macro: ") + err_message, { className: 'humanError' } );
863
                });
892
                });
864
        } );
893
        } );
865
        $('#macro-list').append($new_li);
894
        $('#macro-list').append($new_li);
Lines 895-901 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
895
                showSavedMacros();
924
                showSavedMacros();
896
            })
925
            })
897
            .fail(function(err) {
926
            .fail(function(err) {
898
                humanMsg.displayAlert( _("Failed to save macro:") + err.responseText, { className: 'humanError' } );
927
                var err_message;
928
                if( err.status == "404" ){
929
                    err_message = _("Macro not found");
930
                } else if ( err.status ="403" ){
931
                    err_message = _("You do not have permission to access this macro");
932
                } else {
933
                    err_message = _("There was a problem, please check the logs");
934
                }
935
                humanMsg.displayAlert( _("Failed to save macro: ") + err_message, { className: 'humanError' } );
899
            });
936
            });
900
    }
937
    }
901
938
902
- 

Return to bug 17268