diff --git a/admin/tool/dataprivacy/amd/build/categoriesactions.min.js b/admin/tool/dataprivacy/amd/build/categoriesactions.min.js index 66e3b0a458b38..cac33a4329791 100644 --- a/admin/tool/dataprivacy/amd/build/categoriesactions.min.js +++ b/admin/tool/dataprivacy/amd/build/categoriesactions.min.js @@ -1 +1 @@ -define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:'[data-action="deletecategory"]'},h=function(){this.registerEvents()};return h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name"),j=[{key:"deletecategory",component:"tool_dataprivacy",param:i},{key:"deletecategorytext",component:"tool_dataprivacy",param:i}];d.get_strings(j).then(function(d){var g=d[0],i=d[1];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){return d.setSaveButtonText(g),d.getRoot().on(f.save,function(){var d={methodname:"tool_dataprivacy_delete_category",args:{id:h}};b.call([d])[0].done(function(b){b.result?a('tr[data-categoryid="'+h+'"]').remove():c.addNotification({message:b.warnings[0].message,type:"error"})}).fail(c.exception)}),d.getRoot().on(f.hidden,function(){d.destroy()}),d})}).done(function(a){a.show()}).fail(c.exception)})},{init:function(){return new h}}}); \ No newline at end of file +define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:'[data-action="deletecategory"]'},h=function(){this.registerEvents()};return h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name"),j=[{key:"deletecategory",component:"tool_dataprivacy"},{key:"deletecategorytext",component:"tool_dataprivacy",param:i},{key:"delete"}];d.get_strings(j).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){return d.setSaveButtonText(j),d.getRoot().on(f.save,function(){var d={methodname:"tool_dataprivacy_delete_category",args:{id:h}};b.call([d])[0].done(function(b){b.result?a('tr[data-categoryid="'+h+'"]').remove():c.addNotification({message:b.warnings[0].message,type:"error"})}).fail(c.exception)}),d.getRoot().on(f.hidden,function(){d.destroy()}),d})}).done(function(a){a.show()}).fail(c.exception)})},{init:function(){return new h}}}); \ No newline at end of file diff --git a/admin/tool/dataprivacy/amd/build/purposesactions.min.js b/admin/tool/dataprivacy/amd/build/purposesactions.min.js index 0b159814b52d6..33b773c865681 100644 --- a/admin/tool/dataprivacy/amd/build/purposesactions.min.js +++ b/admin/tool/dataprivacy/amd/build/purposesactions.min.js @@ -1 +1 @@ -define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:'[data-action="deletepurpose"]'},h=function(){this.registerEvents()};return h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name"),j=[{key:"deletepurpose",component:"tool_dataprivacy",param:i},{key:"deletepurposetext",component:"tool_dataprivacy",param:i}];d.get_strings(j).then(function(d){var g=d[0],i=d[1];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){return d.setSaveButtonText(g),d.getRoot().on(f.save,function(){var d={methodname:"tool_dataprivacy_delete_purpose",args:{id:h}};b.call([d])[0].done(function(b){b.result?a('tr[data-purposeid="'+h+'"]').remove():c.addNotification({message:b.warnings[0].message,type:"error"})}).fail(c.exception)}),d.getRoot().on(f.hidden,function(){d.destroy()}),d})}).done(function(a){a.show()}).fail(c.exception)})},{init:function(){return new h}}}); \ No newline at end of file +define(["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={DELETE:'[data-action="deletepurpose"]'},h=function(){this.registerEvents()};return h.prototype.registerEvents=function(){a(g.DELETE).click(function(g){g.preventDefault();var h=a(this).data("id"),i=a(this).data("name"),j=[{key:"deletepurpose",component:"tool_dataprivacy"},{key:"deletepurposetext",component:"tool_dataprivacy",param:i},{key:"delete"}];d.get_strings(j).then(function(d){var g=d[0],i=d[1],j=d[2];return e.create({title:g,body:i,type:e.types.SAVE_CANCEL}).then(function(d){return d.setSaveButtonText(j),d.getRoot().on(f.save,function(){var d={methodname:"tool_dataprivacy_delete_purpose",args:{id:h}};b.call([d])[0].done(function(b){b.result?a('tr[data-purposeid="'+h+'"]').remove():c.addNotification({message:b.warnings[0].message,type:"error"})}).fail(c.exception)}),d.getRoot().on(f.hidden,function(){d.destroy()}),d})}).done(function(a){a.show()}).fail(c.exception)})},{init:function(){return new h}}}); \ No newline at end of file diff --git a/admin/tool/dataprivacy/amd/src/categoriesactions.js b/admin/tool/dataprivacy/amd/src/categoriesactions.js index c40a1a75c8581..6d059771ae0cb 100644 --- a/admin/tool/dataprivacy/amd/src/categoriesactions.js +++ b/admin/tool/dataprivacy/amd/src/categoriesactions.js @@ -58,25 +58,28 @@ function($, Ajax, Notification, Str, ModalFactory, ModalEvents) { var stringkeys = [ { key: 'deletecategory', - component: 'tool_dataprivacy', - param: categoryname + component: 'tool_dataprivacy' }, { key: 'deletecategorytext', component: 'tool_dataprivacy', param: categoryname + }, + { + key: 'delete' } ]; Str.get_strings(stringkeys).then(function(langStrings) { var title = langStrings[0]; var confirmMessage = langStrings[1]; + var buttonText = langStrings[2]; return ModalFactory.create({ title: title, body: confirmMessage, type: ModalFactory.types.SAVE_CANCEL }).then(function(modal) { - modal.setSaveButtonText(title); + modal.setSaveButtonText(buttonText); // Handle save event. modal.getRoot().on(ModalEvents.save, function() { diff --git a/admin/tool/dataprivacy/amd/src/purposesactions.js b/admin/tool/dataprivacy/amd/src/purposesactions.js index fd92141b869ec..05abf71896e30 100644 --- a/admin/tool/dataprivacy/amd/src/purposesactions.js +++ b/admin/tool/dataprivacy/amd/src/purposesactions.js @@ -58,25 +58,28 @@ function($, Ajax, Notification, Str, ModalFactory, ModalEvents) { var stringkeys = [ { key: 'deletepurpose', - component: 'tool_dataprivacy', - param: purposename + component: 'tool_dataprivacy' }, { key: 'deletepurposetext', component: 'tool_dataprivacy', param: purposename + }, + { + key: 'delete' } ]; Str.get_strings(stringkeys).then(function(langStrings) { var title = langStrings[0]; var confirmMessage = langStrings[1]; + var buttonText = langStrings[2]; return ModalFactory.create({ title: title, body: confirmMessage, type: ModalFactory.types.SAVE_CANCEL }).then(function(modal) { - modal.setSaveButtonText(title); + modal.setSaveButtonText(buttonText); // Handle save event. modal.getRoot().on(ModalEvents.save, function() { diff --git a/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php b/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php index a50a2710d4173..42a10520ae59a 100644 --- a/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php +++ b/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php @@ -77,12 +77,12 @@ $string['daterequested'] = 'Date requested'; $string['daterequesteddetail'] = 'Date requested:'; $string['defaultsinfo'] = 'Default categories and purposes are applied to all newly created instances.'; -$string['deletecategory'] = 'Delete "{$a}" category'; -$string['deletecategorytext'] = 'Are you sure you want to delete "{$a}" category?'; +$string['deletecategory'] = 'Delete category'; +$string['deletecategorytext'] = 'Are you sure you want to delete the following category?
{$a}
'; $string['deleteexpiredcontextstask'] = 'Delete expired contexts'; $string['deleteexpireddatarequeststask'] = 'Delete files from completed data requests that have expired'; -$string['deletepurpose'] = 'Delete "{$a}" purpose'; -$string['deletepurposetext'] = 'Are you sure you want to delete "{$a}" purpose?'; +$string['deletepurpose'] = 'Delete purpose'; +$string['deletepurposetext'] = 'Are you sure you want to delete the following purpose?{$a}
'; $string['defaultssaved'] = 'Defaults saved'; $string['deny'] = 'Deny'; $string['denyrequest'] = 'Deny request'; diff --git a/admin/tool/dataprivacy/templates/categories.mustache b/admin/tool/dataprivacy/templates/categories.mustache index 5bf63fb03f77e..ef310417b8ab1 100644 --- a/admin/tool/dataprivacy/templates/categories.mustache +++ b/admin/tool/dataprivacy/templates/categories.mustache @@ -53,7 +53,7 @@