[gen] Add the possibility, for an admin, to unlock a page that was locked for too long by some user.

This commit is contained in:
Gaetan Delannay 2013-05-22 10:27:31 +02:00
parent 89c961c5c5
commit fd33e73efa
7 changed files with 46 additions and 11 deletions

View file

@ -403,6 +403,13 @@ function onUnlinkObject(sourceUid, fieldName, targetUid) {
askConfirm('form', 'unlinkForm', unlink_confirm);
}
function onUnlockPage(objectUid, pageName) {
f = document.getElementById('unlockForm');
f.objectUid.value = objectUid;
f.pageName.value = pageName;
askConfirm('form', 'unlockForm', unlock_confirm);
}
function createCookie(name, value, days) {
if (days) {
var date = new Date();

View file

@ -31,6 +31,12 @@
<input type="hidden" name="fieldName"/>
<input type="hidden" name="targetUid"/>
</form>
<tal:comment replace="nothing">Global form for unlocking a page</tal:comment>
<form id="unlockForm" method="post" action="do">
<input type="hidden" name="action" value="Unlock"/>
<input type="hidden" name="objectUid"/>
<input type="hidden" name="pageName"/>
</form>
<tal:comment replace="nothing">Global form for generating a document from a pod template</tal:comment>
<form id="podTemplateForm" name="podTemplateForm" method="post"
tal:attributes="action python: tool.absolute_url() + '/generateDocument'">

View file

@ -163,8 +163,12 @@
<img style="cursor: help"
tal:define="lockDate python: tool.formatDate(locked[1]);
lockMsg python: _('page_locked', mapping={'user':tool.getUserName(locked[0]), 'date': lockDate})"
tal:attributes="src string: $appUrl/ui/locked.png; title lockMsg"/>
</a>
tal:attributes="src string: $appUrl/ui/locked.png; title lockMsg"/></a>
<a tal:condition="python: editable and locked and user.has_role('Manager')">
<img style="cursor: pointer"
tal:attributes="src string: $appUrl/ui/unlock.png;
title python: _('page_unlock');
onclick python: 'onUnlockPage(\'%s\',\'%s\')' % (contextObj.UID(), aPage)"/></a>
</tal:icons>
</div>
<tal:comment replace="nothing">Next lines: links</tal:comment>

BIN
gen/ui/unlock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B