add: action to show only groups in the Account controller
authorRicardo Velhote <rvelhote@gmail.com>
Tue, 25 May 2010 23:09:52 +0000 (00:09 +0100)
committerRicardo Velhote <rvelhote@gmail.com>
Tue, 25 May 2010 23:09:52 +0000 (00:09 +0100)
swat/config/yaml/user-account-parameters.yaml
swat/controllers/account.py

index 096308cbe7676726b0971dfc33848af75f738261..a3f203aa197b999e54b0c4d91b7170d43431163d 100644 (file)
@@ -215,8 +215,8 @@ groups:
                 name: users.png
                 alt: 'Select Users/Groups Icon'
             link:
-                controller: share
-                action: users_groups
+                controller: account
+                action: show_groups
                 copy-to: account-insert-groups-list
                 
         manual-add:
index b374a2c87d592a7930f75a3c2e058fadea44ec5a..5d22d6829260dcf9bbb44ce6d0b0b06a1dd3d640 100644 (file)
@@ -25,6 +25,8 @@ from pylons.i18n.translation import _
 from swat.lib.helpers import ControllerConfiguration, DashboardConfiguration, \
 BreadcrumbTrail, SwatMessages, ParamConfiguration, filter_list
 
+from pylons.templating import render_mako_def
+
 from samba.dcerpc import samr, security, lsa
 from samba import credentials
 from samba import param
@@ -281,6 +283,18 @@ class AccountController(BaseController):
         SwatMessages.add(message)
         redirect_to(controller='account', action='user')
         
+    def show_groups(self):
+        """ """
+        already_selected = request.params.get('as', '')
+        log.debug("These are selected: " + already_selected)
+        
+        if len(already_selected) > 0:
+            already_selected = already_selected.split(',')
+        
+        return render_mako_def('/default/component/popups.mako', \
+                               'group_list', \
+                               already_selected=already_selected)
+        
 class SAMPipeManager:
     """ Support Class obtained from Calin Crisan's 2009 Summer of Code project
     Extensions to GTK Frontends