Commit 1dcdea10 authored by Julien Muchembled's avatar Julien Muchembled

Restore links to cancel or invoke activities manually from "Activities" tab,...

Restore links to cancel or invoke activities manually from "Activities" tab, and add a button in "Advanced" tab to be able to hide them.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27620 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c88e69e3
...@@ -506,6 +506,7 @@ class ActivityTool (Folder, UniqueObject): ...@@ -506,6 +506,7 @@ class ActivityTool (Folder, UniqueObject):
activity_creation_trace = False activity_creation_trace = False
activity_tracking = False activity_tracking = False
activity_timing_log = False activity_timing_log = False
cancel_and_invoke_links_hidden = False
def SQLDict_setPriority(self, **kw): def SQLDict_setPriority(self, **kw):
real_SQLDict_setPriority = getattr(self.aq_parent, 'SQLDict_setPriority') real_SQLDict_setPriority = getattr(self.aq_parent, 'SQLDict_setPriority')
...@@ -655,6 +656,30 @@ class ActivityTool (Folder, UniqueObject): ...@@ -655,6 +656,30 @@ class ActivityTool (Folder, UniqueObject):
url += urllib.quote('Activity creation trace disabled') url += urllib.quote('Activity creation trace disabled')
RESPONSE.redirect(url) RESPONSE.redirect(url)
security.declareProtected(Permissions.manage_properties, 'isCancelAndInvokeLinksHidden')
def isCancelAndInvokeLinksHidden(self):
return self.cancel_and_invoke_links_hidden
security.declareProtected(Permissions.manage_properties, 'manage_hideCancelAndInvokeLinks')
def manage_hideCancelAndInvokeLinks(self, REQUEST=None, RESPONSE=None):
"""
"""
self.cancel_and_invoke_links_hidden = True
if RESPONSE is not None:
url = '%s/manageActivitiesAdvanced?manage_tabs_message=' % self.absolute_url()
url += urllib.quote('Cancel and invoke links hidden')
RESPONSE.redirect(url)
security.declareProtected(Permissions.manage_properties, 'manage_showCancelAndInvokeLinks')
def manage_showCancelAndInvokeLinks(self, REQUEST=None, RESPONSE=None):
"""
"""
self.cancel_and_invoke_links_hidden = False
if RESPONSE is not None:
url = '%s/manageActivitiesAdvanced?manage_tabs_message=' % self.absolute_url()
url += urllib.quote('Cancel and invoke links visible')
RESPONSE.redirect(url)
def manage_beforeDelete(self, item, container): def manage_beforeDelete(self, item, container):
self.unsubscribe() self.unsubscribe()
Folder.inheritedAttribute('manage_beforeDelete')(self, item, container) Folder.inheritedAttribute('manage_beforeDelete')(self, item, container)
......
...@@ -30,8 +30,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -30,8 +30,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<dtml-var manage_tabs> <dtml-var manage_tabs>
<h3>Queued Activities</h3> <h3>Queued Activities</h3>
<dtml-let show_cancel_and_invoke_links="not isCancelAndInvokeLinksHidden()">
<dtml-if show_cancel_and_invoke_links>
<p>Warning: Invoking or canceling activities will invoke/cancel all activities with both the same path and the same method_id.</p>
<p>Warning: Invoking an activity will <b>not</b> run any dependency check.</p>
</dtml-if>
<table cellspacing="0" cellpadding="2" border="1"> <table cellspacing="0" cellpadding="2" border="1">
<tr> <tr>
<dtml-if show_cancel_and_invoke_links>
<th align="left" valign="top"></th>
</dtml-if>
<th align="left" valign="top">Uid</th> <th align="left" valign="top">Uid</th>
<th align="left" valign="top">Object</th> <th align="left" valign="top">Object</th>
<th align="left" valign="top">Method Id</th> <th align="left" valign="top">Method Id</th>
...@@ -44,9 +54,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -44,9 +54,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<th align="left" valign="top">Call traceback</th> <th align="left" valign="top">Call traceback</th>
</tr> </tr>
<dtml-in expr="getMessageList(include_processing=1)"> <dtml-in expr="getMessageList(include_processing=1)">
<dtml-let path="'/'.join(object_path)">
<tr> <tr>
<dtml-if show_cancel_and_invoke_links>
<td align="left" valign="top">
<a href="manageCancel?object_path=&dtml-path;&amp;method_id=&dtml-method_id;">Cancel</a>
<a href="manageInvoke?object_path=&dtml-path;&amp;method_id=&dtml-method_id;">Invoke</a>
</td>
</dtml-if>
<td align="left" valign="top"><dtml-var uid></td> <td align="left" valign="top"><dtml-var uid></td>
<td align="left" valign="top"><a href="<dtml-var "'/'.join(object_path)">"><dtml-var "'/'.join(object_path)"></a></td> <td align="left" valign="top"><a href="&dtml-path;"><dtml-var path></a></td>
<td align="left" valign="top"><dtml-var method_id></td> <td align="left" valign="top"><dtml-var method_id></td>
<td align="left" valign="top"> <td align="left" valign="top">
<dtml-if activity_kw><dtml-var expr="_.repr(activity_kw)[1:-1]" html_quote> <dtml-if activity_kw><dtml-var expr="_.repr(activity_kw)[1:-1]" html_quote>
...@@ -76,8 +93,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -76,8 +93,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</dtml-if> </dtml-if>
</td> </td>
</tr> </tr>
</dtml-let>
</dtml-in> </dtml-in>
</table> </table>
</dtml-let>
<dtml-var manage_page_footer> <dtml-var manage_page_footer>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<dtml-var manage_tabs> <dtml-var manage_tabs>
<br /> <br />
<form action="<dtml-var URL1>"> <form action="&dtml-URL1;">
<table width="100%" cellspacing="0" cellpadding="2" border="0"> <table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr class="section-bar"> <tr class="section-bar">
<td colspan="3" align="left"> <td colspan="3" align="left">
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</dtml-if> </dtml-if>
</td> </td>
<td> <td>
<p class="form-help">Controls wether activities should contain a stack trace from their creation. <p class="form-help">Controls whether activities should contain a stack trace from their creation.
It helps finding out where an activity comes from. It helps finding out where an activity comes from.
Those traces are logged and mailed when an activity fails (as part of regular activity failure mails).</p> Those traces are logged and mailed when an activity fails (as part of regular activity failure mails).</p>
</td> </td>
...@@ -80,23 +80,37 @@ ...@@ -80,23 +80,37 @@
<p class="form-help">Recreate activity tables, preserving existing messages.</p> <p class="form-help">Recreate activity tables, preserving existing messages.</p>
</td> </td>
<td align="right" valign="top"> <td align="right" valign="top">
<form action="<dtml-var URL1>"> <form action="&dtml-URL1;">
<input class="form-element" type="submit" <input class="form-element" type="submit"
name="manageClearActivities:method" value=" Recreate Tables "> name="manageClearActivities:method" value=" Recreate Tables ">
</form> </form>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td align="left" valign="top">
<p class="form-help">Recreate activity tables, throwing away all contained messages.</p> <p class="form-help">Recreate activity tables, throwing away all contained messages.</p>
</td> </td>
<td align="right" valign="top"> <td align="right" valign="top">
<form action="<dtml-var URL1>"> <form action="&dtml-URL1;">
<input type="hidden" name="keep:int" value="0"> <input type="hidden" name="keep:int" value="0">
<input class="form-element" type="submit" <input class="form-element" type="submit"
name="manageClearActivities:method" value=" Clear Activities " style="background-color: #F00"> name="manageClearActivities:method" value=" Clear Activities " style="background-color: #F00">
</form> </form>
</td>
</tr>
<tr>
<td align="left" valign="top">
<p class="form-help">Controls the visibility of links to cancel or invoke activities from "Activities" tab.
These links are too dangerous in production environment and they must not be visible.</p>
</td>
<td align="right" valign="top">
<form action="&dtml-URL1;">
<dtml-if isCancelAndInvokeLinksHidden>
<input class="form-element" type="submit" name="manage_showCancelAndInvokeLinks:method" value="Show Links" style="background-color: #F00">
<dtml-else>
<input class="form-element" type="submit" name="manage_hideCancelAndInvokeLinks:method" value="Hide Links">
</dtml-if>
</form>
</td> </td>
</tr> </tr>
</table> </table>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment