Introduced bulk edit endpoint for bulk edit of categories and tags

This commit is contained in:
Victor Mosin
2017-12-30 09:21:28 +01:00
committed by Victor Mosin
parent b65e1e022e
commit 805456d032
14 changed files with 328 additions and 3 deletions

View File

@@ -18,7 +18,7 @@
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** global: edit_selected_txt, delete_selected_txt */
/** global: edit_selected_txt, edit_bulk_selected_txt, delete_selected_txt */
/**
*
@@ -45,6 +45,8 @@ $(document).ready(function () {
// click the edit button:
$('.mass_edit').click(goToMassEdit);
// click the edit button:
$('.mass_edit_bulk').click(goToMassBulkEdit);
// click the delete button:
$('.mass_delete').click(goToMassDelete);
// click reconcile button
@@ -100,6 +102,26 @@ function goToMassEdit() {
return false;
}
/**
*
* @returns {boolean}
*/
function goToMassBulkEdit() {
"use strict";
var checkedArray = getCheckboxes();
// go to specially crafted URL:
var bases = document.getElementsByTagName('base');
var baseHref = null;
if (bases.length > 0) {
baseHref = bases[0].href;
}
window.location.href = baseHref + '/transactions/mass/edit/bulk/' + checkedArray;
return false;
}
/**
*
* @returns {boolean}
@@ -144,6 +166,7 @@ function countChecked() {
var checked = $('.select_all_single:checked').length;
if (checked > 0) {
$('.mass_edit span').text(edit_selected_txt + ' (' + checked + ')');
$('.mass_edit_bulk span').text(edit_bulk_selected_txt + ' (' + checked + ')');
$('.mass_delete span').text(delete_selected_txt + ' (' + checked + ')');
// get amount for the transactions: