Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX - Correct issues in delete items in list #4230

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions pages/items.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -1459,8 +1459,6 @@ function(data) {

// Refresh tree
refreshTree(folderId, true);
// Load list of items
ListerItems(folderId, '', 0);
// Close
if (closeItemCard === true) {
closeItemDetailsCard();
Expand Down Expand Up @@ -2346,15 +2344,15 @@ function(teampassItem) {
event.preventDefault();
// Delete item
if (debugJavascript === true) {
console.info('SHOW DELETE ITEM '+$(this).data('item-key'));
console.info('SHOW DELETE ITEM '+$(this).data('item-id'));
}
startedItemsListQuery = false;

// check if user still has access
var itemKeyToDelete = $(this).data('item-key');
var itemIdToDelete = $(this).data('item-id');

$.when(
checkAccess($(this).data('item-key'), selectedFolderId, <?php echo $session->get('user-id'); ?>, 'delete')
checkAccess($(this).data('item-id'), selectedFolderId, <?php echo $session->get('user-id'); ?>, 'delete')
).then(function(retData) {
// Is the user allowed?
if (retData.access === false || retData.delete === false) {
Expand Down Expand Up @@ -2390,8 +2388,8 @@ function(teampassItem) {
event2.preventDefault();

goDeleteItem(
itemIdToDelete,
'',
itemKeyToDelete,
selectedFolderId,
'',
false
Expand Down Expand Up @@ -4268,7 +4266,7 @@ function(teampassApplication) {
}

// Trash icon
trash_link = '<span class="fa-stack fa-clickable warn-user pointer infotip mr-2 list-item-clicktodelete" title="<?php echo $lang->get('delete'); ?>" data-item-key="' + value.item_key + '"><i class="fa-solid fa-circle fa-stack-2x"></i><i class="fa-solid fa-trash fa-stack-1x fa-inverse"></i></span>';
trash_link = '<span class="fa-stack fa-clickable warn-user pointer infotip mr-2 list-item-clicktodelete" title="<?php echo $lang->get('delete'); ?>" data-item-id="' + value.item_id + '"><i class="fa-solid fa-circle fa-stack-2x"></i><i class="fa-solid fa-trash fa-stack-1x fa-inverse"></i></span>';

// Prepare Description
if (value.desc !== '') {
Expand Down