#614 group management

open
Andreas Jung
5
2007-03-16
2007-03-16
auc
No

there are various ways group management could be made to work in pcng, right now it seems quite broken (in also various ways)

the following fixes were made locally to address the problem :

in issue_macros.pt
@@ -277,7 +277,7 @@ function show_tickets() {
</div>
<div class="left" tal:condition="allow_assign">
<span class="label" i18n:translate="assign_to_group">Assign to groups</span><br />
- <select name="assignees:list" size="7" multiple>
+ <select name="assignees_group:list" size="7" multiple>
<span tal:repeat="u tracker_users">
<option tal:condition="u/group" tal:attributes="value u/username; selected python: u['username'] in assignees">
<span tal:define="id python:u['username'][6:]" tal:replace="string:${u/fullname} ($id, " /><span i18n:translate="" tal:content="u/role" />)</option>

in pcng_view.pt
@@ -16,8 +16,9 @@
</metal:block>

<metal:block tal:condition="python: request.get('filter','') == 'assigned'">
- <span tal:define="dummy python: request.set('status', ['pending', 'accepted']);
- dummy python: request.set('assigned_to', [member.getUserName()])" />
+ <span tal:define="groups python:member.getGroups() + [member.getUserName()];
+ dummy python: request.set('status', ['pending', 'accepted']);
+ dummy python: request.set('assigned_to', groups )" />
</metal:block>

<metal:block tal:condition="python: request.get('filter','') == 'submitted'">

the most crucial bits (proper group maangement)
=== Products/PloneCollectorNG/Collector.py ===
@@ -14,7 +14,7 @@ from ComputedAttribute import ComputedAt
from ComputedAttribute import ComputedAttribute
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
-from Products.CMFCore.CatalogTool import CatalogTool
+from Products.CMFPlone.CatalogTool import CatalogTool
from Products.ZCatalog.ZCatalog import ZCatalog
from BTrees.OOBTree import OOBTree
from ZODB.POSException import ConflictError

=== Products/PloneCollectorNG/Issue.py ===
@@ -246,8 +246,8 @@ class PloneIssueNG(BaseBTreeFolder, Pare
assignees_changed = 0

# added users group assignees_group
- assignees.extend(getUsersForGroups(self, assignees_group))
-
+ assignees.extend([elt for elt in assignees_group
+ if elt not in assignees])
if not util.lists_eq(assignees, old_assignees):
self._transcript.addChange('assignees', old_assignees, assignees)
assignees_changed = 1

Discussion