[gen] Allow Managers to delete data change events if things go wrong.
This commit is contained in:
parent
90e46f11e7
commit
b76af3e0c2
3 changed files with 40 additions and 2 deletions
|
@ -351,6 +351,13 @@ function onDeleteObject(objectUid) {
|
|||
askConfirm('form', 'deleteForm', delete_confirm);
|
||||
}
|
||||
|
||||
function onDeleteEvent(objectUid, eventTime) {
|
||||
f = document.getElementById('deleteEventForm');
|
||||
f.objectUid.value = objectUid;
|
||||
f.eventTime.value = eventTime;
|
||||
askConfirm('form', 'deleteEventForm', delete_confirm);
|
||||
}
|
||||
|
||||
function onUnlinkObject(sourceUid, fieldName, targetUid) {
|
||||
f = document.getElementById('unlinkForm');
|
||||
f.sourceUid.value = sourceUid;
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
<input type="hidden" name="action" value="Delete"/>
|
||||
<input type="hidden" name="objectUid"/>
|
||||
</form>
|
||||
<tal:comment replace="nothing">Global form for deleting an event from an object's history</tal:comment>
|
||||
<form id="deleteEventForm" method="post" action="do">
|
||||
<input type="hidden" name="action" value="DeleteEvent"/>
|
||||
<input type="hidden" name="objectUid"/>
|
||||
<input type="hidden" name="eventTime"/>
|
||||
</form>
|
||||
<tal:comment replace="nothing">Global form for unlinking an object</tal:comment>
|
||||
<form id="unlinkForm" method="post" action="do">
|
||||
<input type="hidden" name="action" value="Unlink"/>
|
||||
|
@ -98,7 +104,12 @@
|
|||
state event/review_state|nothing;
|
||||
isDataChange python: event['action'] == '_datachange_'"
|
||||
tal:attributes="class python:test(odd, 'even', 'odd')" valign="top">
|
||||
<td tal:condition="isDataChange" tal:content="python: _('data_change')"></td>
|
||||
<td tal:condition="isDataChange">
|
||||
<span tal:content="python: _('data_change')"></span>
|
||||
<img tal:condition="python: user.has_role('Manager')" style="cursor:pointer"
|
||||
tal:attributes="src string:$appUrl/ui/delete.png;
|
||||
onClick python: 'onDeleteEvent(\'%s\', \'%s\')' % (contextObj.UID(), event['time'])"/>
|
||||
</td>
|
||||
<td tal:condition="not: isDataChange"
|
||||
tal:content="python: _(contextObj.getWorkflowLabel(event['action']))"/>
|
||||
<td tal:define="actorId python:event.get('actor')"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue