Bugzilla – Attachment 103513 Details for
Bug 17268
Advanced cataloging editor - rancor - macros are lost when browser storage cleared
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17268: (follow-up) Fix translatability
Bug-17268-follow-up-Fix-translatability.patch (text/plain), 7.18 KB, created by
Nick Clemens (kidclamp)
on 2020-04-22 21:15:53 UTC
(
hide
)
Description:
Bug 17268: (follow-up) Fix translatability
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-04-22 21:15:53 UTC
Size:
7.18 KB
patch
obsolete
>From eb39804b2a3e3725c19dd820d359b6950a0b99b5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 27 Mar 2020 10:38:04 +0000 >Subject: [PATCH] Bug 17268: (follow-up) Fix translatability > >This patch moves the error messages to translatable strings > >Also includes capitalization fixes and POD adjustment >--- > Koha/AdvancedEditorMacro.pm | 2 +- > Koha/AdvancedEditorMacros.pm | 6 ++- > api/v1/swagger/parameters/advancededitormacro.json | 2 +- > .../prog/en/includes/cateditor-ui.inc | 49 +++++++++++++++++++--- > 4 files changed, 50 insertions(+), 9 deletions(-) > >diff --git a/Koha/AdvancedEditorMacro.pm b/Koha/AdvancedEditorMacro.pm >index aeae1a805e..975f850fa9 100644 >--- a/Koha/AdvancedEditorMacro.pm >+++ b/Koha/AdvancedEditorMacro.pm >@@ -24,7 +24,7 @@ use base qw(Koha::Object); > > =head1 NAME > >-Koha::AdvancedEditorMacro - Koha Advanced Editor Macro Object class >+Koha::AdvancedEditorMacro - Koha Advanced editor macro object class > > =head1 API > >diff --git a/Koha/AdvancedEditorMacros.pm b/Koha/AdvancedEditorMacros.pm >index 4246947e88..4fdf25ba9f 100644 >--- a/Koha/AdvancedEditorMacros.pm >+++ b/Koha/AdvancedEditorMacros.pm >@@ -26,7 +26,7 @@ use base qw(Koha::Objects); > > =head1 NAME > >-Koha::AdvancedEditorMacros - Koha Advanced Editor Macro Object set class >+Koha::AdvancedEditorMacros - Koha Advanced editor macro object set class > > =head1 API > >@@ -42,6 +42,10 @@ sub _type { > return 'AdvancedEditorMacro'; > } > >+=head3 object_class >+ >+=cut >+ > sub object_class { > return 'Koha::AdvancedEditorMacro'; > } >diff --git a/api/v1/swagger/parameters/advancededitormacro.json b/api/v1/swagger/parameters/advancededitormacro.json >index 482e0bc917..e4fd0debf3 100644 >--- a/api/v1/swagger/parameters/advancededitormacro.json >+++ b/api/v1/swagger/parameters/advancededitormacro.json >@@ -2,7 +2,7 @@ > "advancededitormacro_id_pp": { > "name": "advancededitormacro_id", > "in": "path", >- "description": "Advanced Editor Macro internal identifier", >+ "description": "Advanced editor macro internal identifier", > "required": true, > "type": "integer" > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >index bfee330ac2..7469db35f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >@@ -714,7 +714,15 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > showSavedMacros(); > }) > .fail(function(err) { >- humanMsg.displayAlert( _("Failed to delete macro:") + err.responseText, { className: 'humanError' } ); >+ var err_message; >+ if( err.status == "404" ){ >+ err_message = "Macro not found"; >+ } else if ( err.status == "403" ){ >+ err_message = _("You do not have permission to delete this macro"); >+ } else { >+ err_message = _("There was a problem, please check the logs"); >+ } >+ humanMsg.displayAlert( _("Failed to delete macro: " + err_message), { className: 'humanError' } ); > }); > } > >@@ -760,7 +768,15 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > macroEditor.activeMacroShared = result.shared; > }) > .fail(function(err) { >- humanMsg.displayAlert( _("Failed to load macros:") + err.responseText, { className: 'humanError' } ); >+ var err_message; >+ if( err.status == "404" ){ >+ err_message = "Macro not found"; >+ } else if ( err.status == "403" ){ >+ err_message = _("You do not have permission to access this macro"); >+ } else { >+ err_message = _("There was a problem, please check the logs"); >+ } >+ humanMsg.displayAlert( _("Failed to load macros: ") + err_message, { className: 'humanError' } ); > }); > > } >@@ -795,7 +811,13 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > > }) > .fail(function(err) { >- humanMsg.displayAlert( _("Failed to create macro:") + err.responseText, { className: 'humanError' } ); >+ var err_message; >+ if( err.status == "403" ){ >+ err_message = _("You do not have permission to create this macro"); >+ } else { >+ err_message = _("There was a problem, please check the logs"); >+ } >+ humanMsg.displayAlert( _("Failed to create macro: ") + err_message, { className: 'humanError' } ); > }); > } ); > } >@@ -832,7 +854,8 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > }); > }) > .fail(function(err) { >- humanMsg.displayAlert( _("Failed to load macros:") + err.responseText, { className: 'humanError' } ); >+ var err_message = _("There was a problem, please check the logs"); >+ humanMsg.displayAlert( _("Failed to load macros: ") + err_message, { className: 'humanError' } ); > }); > var $new_li = $( '<li class="new-macro"><a href="#">' + _("New macro...") + '</a></li>' ); > $new_li.click( function() { >@@ -858,7 +881,13 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > loadMacro( result.name, result.macro_id ); > }) > .fail(function(err) { >- humanMsg.displayAlert( _("Failed to create macro:") + err.responseText, { className: 'humanError' } ); >+ var err_message; >+ if( err.status == "403" ){ >+ err_message = _("You do not have permission to access this macro"); >+ } else { >+ err_message = _("There was a problem, please check the logs"); >+ } >+ humanMsg.displayAlert( _("Failed to create macro: ") + err_message, { className: 'humanError' } ); > }); > } ); > $('#macro-list').append($new_li); >@@ -894,7 +923,15 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > showSavedMacros(); > }) > .fail(function(err) { >- humanMsg.displayAlert( _("Failed to save macro:") + err.responseText, { className: 'humanError' } ); >+ var err_message; >+ if( err.status == "404" ){ >+ err_message = _("Macro not found"); >+ } else if ( err.status ="403" ){ >+ err_message = _("You do not have permission to access this macro"); >+ } else { >+ err_message = _("There was a problem, please check the logs"); >+ } >+ humanMsg.displayAlert( _("Failed to save macro: ") + err_message, { className: 'humanError' } ); > }); > } > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17268
:
93474
|
95948
|
96616
|
96617
|
96618
|
96757
|
96758
|
96759
|
96760
|
100559
|
100560
|
100561
|
100562
|
100563
|
100564
|
100565
|
100569
|
100570
|
100571
|
100572
|
100573
|
100574
|
100575
|
100584
|
100604
|
100758
|
100759
|
100760
|
100761
|
100762
|
100763
|
100766
|
100767
|
100768
|
100769
|
100770
|
100771
|
100772
|
100773
|
100774
|
100775
|
100776
|
100777
|
100780
|
100781
|
100782
|
100783
|
100784
|
100785
|
100983
|
100984
|
100985
|
100986
|
100987
|
100988
|
101980
|
103507
|
103508
|
103509
|
103510
|
103511
|
103512
|
103513
|
103514
|
104144
|
104145
|
104146
|
104147
|
104148
|
104149
|
104150
|
104151
|
104152
|
104153