Changeset 3550


Ignore:
Timestamp:
Jul 5, 2007, 1:18:28 PM (14 years ago)
Author:
Martin Svensson
Message:

Fixes #611 Improvements of Trashcan. Changed confusing button text/icon.
Browser is now redirected to an item's view page when the item has been restored from trashcan->view_item.jsp

Location:
trunk/www/views/trashcan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/views/trashcan/index.jsp

    r3526 r3550  
    219219    Item itemType = Item.valueOf(request.getParameter("item_type"));
    220220    int itemId = Values.getInt(request.getParameter("item_id"));
     221    String itemsIndexPage = request.getParameter("itemsIndexPage");
    221222    BasicItem item = itemType.getById(dc, itemId);
    222223    Removable r = (Removable)item;
    223224    r.setRemoved(false);
    224225    dc.commit();
    225     redirect = viewPage + "&item_type=" + itemType.name() + "&item_id="+itemId;
     226    redirect = itemsIndexPage + "?ID=" + ID + "&cmd=ViewItem&item_id=" + itemId;
    226227  }
    227228  else if ("DeleteItem".equals(cmd))
  • trunk/www/views/trashcan/view_item.jsp

    r3549 r3550  
    128128    function restoreItem()
    129129    {
    130       url = 'index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_type=<%=itemType.name()%>&item_id=<%=itemId%>';
     130      var controller = Main.getController('<%=itemType.name()%>');
     131      url = 'index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_type=<%=itemType.name()%>&item_id=<%=itemId%>';     
     132      url += '&itemsIndexPage=' + getRoot() + controller.url;
    131133      location.replace(url);
    132134    }
     
    195197      <tbl:button
    196198        disabled="<%=deletePermission ? false : true%>"
    197         image="<%=deletePermission ? "delete.gif" : "delete_disabled.gif"%>"
     199        image="<%=deletePermission ? "delete_permanently.png" : "delete_permanently_disabled.png"%>"
    198200        onclick="deleteItem()"
    199         title="Delete"
     201        title="Delete permanently&hellip;"
    200202        visible="<%=!isUsed%>"
    201203        tooltip="<%=deletePermission ? "Permanently delete this item" : "You do not have permission to delete this item"%>"
Note: See TracChangeset for help on using the changeset viewer.