Bug 17170: (QA follow-up) Escape things, make them translatable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2022-10-06 10:58:53 -03:00
parent 00f0780b7f
commit b60cf7931a
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -140,15 +140,15 @@
"data": function( row, meta, val, type ) {
let filter = row;
let filter_buttons = '<a class="btn btn-default btn-xs edit_filter" onclick="edit_filter(this)"';
filter_buttons += ' data-filter_id="'+ filter.search_filter_id;
filter_buttons += '" data-filter_name="'+ filter.name;
filter_buttons += '" data-filter_opac="'+ filter.opac;
filter_buttons += '" data-filter_staff_client="'+ filter.staff_client;
filter_buttons += '" ><i class="fa fa-pencil"></i> Edit filter</a>';
filter_buttons += '<a class="btn btn-default btn-xs" href="/cgi-bin/koha/catalogue/search.pl?edit_filter='+filter.search_filter_id+'"><i class="fa fa-search"></i> Edit search</a>';
filter_buttons += ' data-filter_id="'+ escape_str(filter.search_filter_id);
filter_buttons += '" data-filter_name="'+ escape_str(filter.name);
filter_buttons += '" data-filter_opac="'+ escape_str(filter.opac);
filter_buttons += '" data-filter_staff_client="'+ escape_str(filter.staff_client);
filter_buttons += '" ><i class="fa fa-pencil"></i> '+_("Edit filter")+'</a>';
filter_buttons += '<a class="btn btn-default btn-xs" href="/cgi-bin/koha/catalogue/search.pl?edit_filter='+encodeURIComponent(filter.search_filter_id)+'"><i class="fa fa-search"></i> '+ _("Edit search") + '</a>';
filter_buttons += '<a class="btn btn-default btn-xs delete_filter" onclick="delete_filter(this)"';
filter_buttons += ' data-filter_id="'+ filter.search_filter_id;
filter_buttons += '"><i class="fa fa-trash"></i> Delete</a>';
filter_buttons += ' data-filter_id="'+ escape_str(filter.search_filter_id);
filter_buttons += '"><i class="fa fa-trash"></i> '+_("Delete")+'</a>';
return filter_buttons;
},
"searchable": false,