incubator-lokahi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tob...@apache.org
Subject svn commit: r467746 - /incubator/lokahi/lokahi/trunk/src/www/Core/User/addAdmin.vm
Date Wed, 25 Oct 2006 19:51:41 GMT
Author: toback
Date: Wed Oct 25 12:51:40 2006
New Revision: 467746

URL: http://svn.apache.org/viewvc?view=rev&rev=467746
Log:
Add select all & unselect all buttons.

Modified:
    incubator/lokahi/lokahi/trunk/src/www/Core/User/addAdmin.vm

Modified: incubator/lokahi/lokahi/trunk/src/www/Core/User/addAdmin.vm
URL: http://svn.apache.org/viewvc/incubator/lokahi/lokahi/trunk/src/www/Core/User/addAdmin.vm?view=diff&rev=467746&r1=467745&r2=467746
==============================================================================
--- incubator/lokahi/lokahi/trunk/src/www/Core/User/addAdmin.vm (original)
+++ incubator/lokahi/lokahi/trunk/src/www/Core/User/addAdmin.vm Wed Oct 25 12:51:40 2006
@@ -32,6 +32,9 @@
 #set ($selUserId = $user.getPk())
 #end
 
+#if ($request.getParameter("selAll"))
+#set ($selAll = $math.toInteger($request.getParameter("selAll")))
+#end
 
 <SCRIPT LANGUAGE=javascript>
   <!--
@@ -49,6 +52,24 @@
     return true;
   }
 
+  function SelectAll()
+  {
+    var baseURL = "$appRoot/Core/User/addAdmin.vm?tryuser=$tryuser&selAll=1";
+
+    top.location.href = baseURL;
+
+    return true;
+  }
+   
+  function UnselectAll()
+  {
+    var baseURL = "$appRoot/Core/User/addAdmin.vm?tryuser=$tryuser&selAll=0";
+
+    top.location.href = baseURL;
+
+    return true;
+  }
+  
   function handleEnter(field, event) {
     var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
     if (keyCode == 13) {
@@ -101,15 +122,27 @@
         <br />
         #if ($tryuser)
         #if ($User.isAllowed("AddUserToProject"))
-        #set ($functions = $view.getFunctions())
-        #foreach($function in $functions)
-        #if($User.isAllowed($function) || $User.getPk() == 1)
-        #if($user && $user.isAllowed($function))
-        $function.getName()&nbsp;<input type=checkbox name=functions value="$function.getPk()"
checked> <br />
-        #else
-        $function.getName()&nbsp;<input type=checkbox name=functions value="$function.getPk()">
<br />
-        #end
-        #end
+          <br />
+          <input type=button value="Select All" onClick='SelectAll()'>&nbsp;&nbsp;<input
type=button value="Unselect All" onClick='UnselectAll()'>
+          <br />
+          <br />
+          #set ($functions = $view.getFunctions())
+          #foreach($function in $functions)
+            #if($User.isAllowed($function) || $User.getPk() == 1)
+              #if($user && $user.isAllowed($function))          
+                #if (!$selAll || ($selAll != 0))
+                  $function.getName()&nbsp;<input type=checkbox name=functions value="$function.getPk()"
checked> <br />
+                #else
+                  $function.getName()&nbsp;<input type=checkbox name=functions value="$function.getPk()"
> <br />
+                #end
+              #else
+                #if ($selAll == 1)
+                  $function.getName()&nbsp;<input type=checkbox name=functions value="$function.getPk()"
checked> <br />
+                #else
+                  $function.getName()&nbsp;<input type=checkbox name=functions value="$function.getPk()"
> <br /> 
+                #end             
+              #end
+            #end
         #end
 
         <input type="submit" value="Submit">



Mime
View raw message