Skip to content

Commit 7bae93a

Browse files
committed
Moved approvals management actions from main action bar to signing fieldset action bar
1 parent b994665 commit 7bae93a

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

imio/dms/mail/browser/actionspanel.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class SigningFieldsetActionsPanelView(ActionsPanelView):
164164

165165
def __init__(self, context, request):
166166
super(SigningFieldsetActionsPanelView, self).__init__(context, request)
167-
self.SECTIONS_TO_RENDER = ("renderEdit",)
167+
self.ACCEPTABLE_ACTIONS = ["edit", "approvals"]
168168

169169
@property
170170
def fieldset(self):
@@ -175,6 +175,27 @@ def renderEdit(self):
175175
return ViewPageTemplateFile("templates/fieldset_actions_panel_edit.pt")(self)
176176
return ""
177177

178+
@ram.cache(actionspanelview_cachekey)
179+
def SigningFieldsetActionsPanelView__call__(
180+
self,
181+
useIcons=True,
182+
showEdit=True,
183+
showOwnDelete=False,
184+
showTransitions=False,
185+
**kwargs
186+
):
187+
super(SigningFieldsetActionsPanelView, self).__call__(
188+
useIcons=useIcons,
189+
showEdit=showEdit,
190+
showOwnDelete=showOwnDelete,
191+
showTransitions=showTransitions,
192+
**kwargs
193+
)
194+
self.saveHasActions() # To remove dash "-" when no actions available
195+
return self.index()
196+
197+
__call__ = SigningFieldsetActionsPanelView__call__
198+
178199

179200
class DmsOMActionsPanelView(ActionsPanelView):
180201

@@ -203,7 +224,7 @@ def __init__(self, context, request):
203224
super(DmsOMActionsPanelView, self).__init__(context, request)
204225
# portal_actions.object_buttons action ids to keep
205226
# self.ACCEPTABLE_ACTIONS = ['copy', 'paste', 'delete']
206-
self.ACCEPTABLE_ACTIONS = ["delete", 'approvals']
227+
self.ACCEPTABLE_ACTIONS = ["delete"]
207228
self.SECTIONS_TO_RENDER += (
208229
"render_create_from_template_button",
209230
"render_create_new_message",
@@ -295,14 +316,13 @@ def DmsOMActionsPanelView__call__(
295316

296317

297318
class DmsFileActionsPanelView(ActionsPanelView):
298-
299319
def __init__(self, context, request):
300320
super(DmsFileActionsPanelView, self).__init__(context, request)
301321
self.ACCEPTABLE_ACTIONS = ["edit", "external_edit", "mailing", "documentviewer_convert", "download", "delete"]
302322

303323
def listObjectButtonsActions(self):
304324
actions = super(DmsFileActionsPanelView, self).listObjectButtonsActions()
305-
actions.sort(key=lambda x: self.ACCEPTABLE_ACTIONS.index(x['id']))
325+
actions.sort(key=lambda x: self.ACCEPTABLE_ACTIONS.index(x["id"]))
306326
return actions
307327

308328

0 commit comments

Comments
 (0)