phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] admin inc/class.boaclmanager.inc.php inc/class....


From: Dave Hall
Subject: [Phpgroupware-cvs] admin inc/class.boaclmanager.inc.php inc/class....
Date: Thu, 28 Dec 2006 01:35:22 +0000

CVSROOT:        /sources/phpgroupware
Module name:    admin
Changes by:     Dave Hall <skwashd>     06/12/28 01:35:22

Modified files:
        inc            : class.boaclmanager.inc.php 
                         class.uiaclmanager.inc.php 
        templates/base : addressmaster.xsl 

Log message:
        make the popup work properly again and fix the markup and css

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/admin/inc/class.boaclmanager.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/admin/inc/class.uiaclmanager.inc.php?cvsroot=phpgroupware&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/admin/templates/base/addressmaster.xsl?cvsroot=phpgroupware&r1=1.1&r2=1.2

Patches:
Index: inc/class.boaclmanager.inc.php
===================================================================
RCS file: /sources/phpgroupware/admin/inc/class.boaclmanager.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- inc/class.boaclmanager.inc.php      27 Dec 2006 05:41:34 -0000      1.8
+++ inc/class.boaclmanager.inc.php      28 Dec 2006 01:35:21 -0000      1.9
@@ -8,7 +8,7 @@
        *  Free Software Foundation; either version 2 of the License, or (at 
your  *
        *  option) any later version.                                           
   *
        
\**************************************************************************/
-       /* $Id: class.boaclmanager.inc.php,v 1.8 2006/12/27 05:41:34 skwashd 
Exp $ */
+       /* $Id: class.boaclmanager.inc.php,v 1.9 2006/12/28 01:35:21 skwashd 
Exp $ */
 
        class boaclmanager
        {
@@ -53,13 +53,15 @@
                        $admins = $this->get_addressmaster_ids();
                        //_debug_array($admins);
 
-                       for($i=0;$i<count($admins);$i++)
+                       $data = array();
+                       for ( $i = count($admins) - 1; $i >= 0; --$i)
                        {
                                $acc_name = 
$GLOBALS['phpgw']->accounts->get_account_data($admins[$i]);
 
-                               if(intval($admins[$i])>0)
+                               if ( isset($admins[$i]) )
                                {
-                                       $data[] = array(
+                                       $data[] = array
+                                       (
                                                'account_id'    => $admins[$i],
                                                'lid'                   => 
$acc_name[$admins[$i]]['lid'],
                                                'firstname'             => 
$acc_name[$admins[$i]]['firstname'],

Index: inc/class.uiaclmanager.inc.php
===================================================================
RCS file: /sources/phpgroupware/admin/inc/class.uiaclmanager.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- inc/class.uiaclmanager.inc.php      27 Dec 2006 05:41:34 -0000      1.18
+++ inc/class.uiaclmanager.inc.php      28 Dec 2006 01:35:21 -0000      1.19
@@ -11,7 +11,7 @@
        * Free Software Foundation; either version 2 of the License, or (at 
your   *
        * option) any later version.                                            
   *
        
\**************************************************************************/
-       /* $Id: class.uiaclmanager.inc.php,v 1.18 2006/12/27 05:41:34 skwashd 
Exp $ */
+       /* $Id: class.uiaclmanager.inc.php,v 1.19 2006/12/28 01:35:21 skwashd 
Exp $ */
 
        class uiaclmanager
        {
@@ -29,7 +29,7 @@
 
                function uiaclmanager()
                {
-                       $this->account_id       = 
(intval($_GET['account_id'])?intval($_GET['account_id']):$GLOBALS['phpgw_info']['user']['account_id']);
+                       $this->account_id       = isset($_GET['account_id']) ? 
(int) $_GET['account_id'] : $GLOBALS['phpgw_info']['user']['account_id'];
 
                        if (!$this->account_id || 
$GLOBALS['phpgw']->acl->check('account_access',64,'admin'))
                        {
@@ -254,7 +254,7 @@
 
                function edit_addressmasters()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 
                        $link_data = array
                        (
@@ -288,11 +288,12 @@
                        $GLOBALS['phpgw']->xslttpl->add_file('addressmaster');
 
                        $popwin_user = array();
+                       $select_user = array();
                        if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'])
                                && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'] == 
'popup')
                        {
                                $usel = $this->boacl->list_addressmasters();
-                               while(is_array($usel) && list(,$acc) = 
each($usel))
+                               foreach ( $usel as $acc )
                                {
                                        $user_list[] = array
                                        (
@@ -301,15 +302,13 @@
                                                'fullname'              => 
$GLOBALS['phpgw']->common->display_fullname($acc['lid'],$acc['firstname'],$acc['lastname'])
                                        );
                                }
-                               $account_num = count($sel_accounts);
 
                                $popwin_user = array
                                (
-                                       'url'                           => "'" 
. 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaclmanager.accounts_popup')
 . "'",
+                                       'url'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaclmanager.accounts_popup'), true),
                                        'width'                         => 
'800',
                                        'height'                        => 
'600',
                                        'lang_open_popup'       => lang('open 
popup window'),
-                                       'select_size'           => 
($account_num < 7?$account_num:7),
                                        'user_list'                     => 
$user_list
                                );
                        }
@@ -362,8 +361,6 @@
                                (
                                        'lang_select_users'             => 
lang('Select users'),
                                        'lang_select_groups'    => lang('Select 
groups'),
-                                       'u_select_size'                 => 7,
-                                       'g_select_size'                 => 7,
                                        'group_list'                    => 
$group_list,
                                        'user_list'                             
=> $user_list
                                );

Index: templates/base/addressmaster.xsl
===================================================================
RCS file: /sources/phpgroupware/admin/templates/base/addressmaster.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- templates/base/addressmaster.xsl    14 Feb 2006 09:47:27 -0000      1.1
+++ templates/base/addressmaster.xsl    28 Dec 2006 01:35:22 -0000      1.2
@@ -1,4 +1,4 @@
-<!-- $Id: addressmaster.xsl,v 1.1 2006/02/14 09:47:27 skwashd Exp $ -->
+<!-- $Id: addressmaster.xsl,v 1.2 2006/12/28 01:35:22 skwashd Exp $ -->
 
        <xsl:template name="addressmaster">
                <xsl:choose>
@@ -17,52 +17,54 @@
 <!-- BEGIN addressmaster list -->
 
        <xsl:template match="addressmaster_list">
-               <center>
-               <table width="80%" border="0" cellpadding="2" cellspacing="2">  
-                       <tr class="th">
-                               <td colspan="3"><xsl:value-of 
select="lang_users"/></td>
-                       </tr>
-                       <tr class="th">
-                               <td width="33%"><xsl:value-of 
select="sort_lid"/></td>
-                               <td width="33%"><xsl:value-of 
select="sort_firstname"/></td>
-                               <td width="33%"><xsl:value-of 
select="sort_lastname"/></td>
+               <table width="80%" border="0">
+                       <thead>
+                               <tr>
+                                       <th colspan="3"><xsl:value-of 
select="lang_users"/></th>
+                               </tr>
+                               <tr>
+                                       <th width="33%"><xsl:value-of 
select="sort_lid"/></th>
+                                       <th width="33%"><xsl:value-of 
select="sort_firstname"/></th>
+                                       <th width="33%"><xsl:value-of 
select="sort_lastname"/></th>
                        </tr>
+                       </thead>
 
 <!-- BEGIN user_list -->
+                       <tbody>
                        <xsl:if test="addressmaster_user != ''">
                                <xsl:apply-templates 
select="addressmaster_user"/>
                        </xsl:if>
+                       </tbody>
 <!-- END user_list -->
+               </table>
 
-                       <tr height="5">
-                               <td>&nbsp;</td>
-                       </tr>
-                       <tr class="th">
-                               <td colspan="3"><xsl:value-of 
select="lang_groups"/></td>
+               <table width="80%" border="0">
+                       <thead>
+                               <tr>
+                                       <th colspan="3"><xsl:value-of 
select="lang_groups"/></th>
                        </tr>
-                       <tr class="th">
-                               <td width="33%"><xsl:value-of 
select="sort_lid"/></td>
-                               <td width="33%">&nbsp;</td>
-                               <td width="33%">&nbsp;</td>
+                               <tr>
+                                       <th width="33%"><xsl:value-of 
select="sort_lid"/></th>
+                                       <th width="33%">&nbsp;</th>
+                                       <th width="33%">&nbsp;</th>
                        </tr>
+                       </thead>
 
 <!-- BEGIN group_list -->
+                       <tbody>
                        <xsl:if test="addressmaster_group != ''">
                                <xsl:apply-templates 
select="addressmaster_group"/>
                        </xsl:if>
+                       </tbody>
 <!-- END group_list -->
+               </table>
 
-                       <tr valign="bottom" height="50">
-                               <xsl:variable name="action_url" 
select="action_url"/>
-                               <xsl:variable name="lang_edit" 
select="lang_edit"/>
-                               <xsl:variable name="lang_done" 
select="lang_done"/>
-                               <form method="POST" action="{$action_url}">
-                               <td colspan="2"><input type="submit" 
name="edit" value="{$lang_edit}"/></td>
-                               <td colspan="2" align="right"><input 
type="submit" name="done" value="{$lang_done}"/></td>
+               <div class="button_group">
+                       <form method="POST" action="{action_url}">
+                               <input type="submit" name="edit" 
value="{lang_edit}"/>
+                               <input type="submit" name="done" 
value="{lang_done}"/>
                                </form>
-                       </tr>
-               </table>
-               </center>
+               </div>
        </xsl:template>
 
        <xsl:template match="addressmaster_user">
@@ -111,13 +113,9 @@
                <xsl:variable name="action_url" select="action_url"/>
                <xsl:variable name="lang_save" select="lang_save"/>
                <xsl:variable name="lang_cancel" select="lang_cancel"/>
-               <center>
-                       <xsl:value-of select="error_message"/>
-                       <table border="0" width="80%" cellpadding="2" 
cellspacing="2">
+               <div class="msg"><xsl:value-of select="error_message"/></div>
                                <form method="POST" action="{$action_url}" 
name="app_form">
-                                       <tr>
-                                               <td valign="top"><xsl:value-of 
select="lang_select_addressmasters"/>:</td>
-                                               <td>
+                       <h2><xsl:value-of 
select="lang_select_addressmasters"/></h2>
                                                        <xsl:choose>
                                                                <xsl:when 
test="select_user != ''">
                                                                        
<xsl:apply-templates select="select_user"/>
@@ -126,40 +124,29 @@
                                                                        
<xsl:apply-templates select="popwin_user"/>
                                                                </xsl:otherwise>
                                                        </xsl:choose>
-                                               </td>
-                                       </tr>
-                                       <tr height="50" valign="bottom">
-                                               <td><input type="submit" 
name="save" value="{$lang_save}"/></td>
-                                               <td align="right"><input 
type="submit" name="cancel" value="{$lang_cancel}"/></td>
-                                       </tr>
+                       <div class="button_group">
+                               <input type="submit" name="save" 
value="{$lang_save}"/>
+                               <input type="submit" name="cancel" 
value="{$lang_cancel}"/>
+                       </div>
                                </form>
-                       </table>
-               </center>
        </xsl:template>
 
 <!-- BEGIN select -->
 
        <xsl:template match="select_user">
-               <xsl:variable name="u_select_size" select="u_select_size"/>
-               <xsl:variable name="g_select_size" select="g_select_size"/>
-               <table>
-                       <tr>
-                               <td valign="top"><xsl:value-of 
select="lang_select_users"/>:</td>
-                               <td>
-                                       <select name="account_addressmaster[]" 
multiple="multiple" size="{$u_select_size}">
+               <fieldset>
+                       <legend><xsl:value-of 
select="lang_select_users"/></legend>
+                       <select name="account_addressmaster[]" 
multiple="multiple" size="7">
                                <xsl:apply-templates select="user_list"/>
                        </select>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td valign="top"><xsl:value-of 
select="lang_select_groups"/>:</td>
-                               <td>
-                                       <select name="group_addressmaster[]" 
multiple="multiple" size="{$g_select_size}">
+               </fieldset>
+
+               <fieldset>
+                       <legend><xsl:value-of 
select="lang_select_groups"/></legend>
+                       <select name="group_addressmaster[]" 
multiple="multiple" size="7">
                                <xsl:apply-templates select="group_list"/>
                        </select>
-                               </td>
-                       </tr>
-               </table>
+               </fieldset>
        </xsl:template>
 
 <!-- END select -->
@@ -167,25 +154,14 @@
 <!-- BEGIN popwin -->
 
        <xsl:template match="popwin_user">
-               <xsl:variable name="select_size" select="select_size"/>
-               <xsl:variable name="lang_open_popup" select="lang_open_popup"/>
-               <xsl:variable name="url" select="url"/>
-               <xsl:variable name="width" select="width"/>
-               <xsl:variable name="height" select="height"/>
-               <table>
-                       <tr>
-                               <td>
-                                       <select name="account_addressmaster[]" 
multiple="multiple" size="{$select_size}">
+               <fieldset>
+                       <select name="account_addressmaster[]" 
multiple="multiple" size="7">
                                                <xsl:if test="user_list != ''">
                                                        <xsl:apply-templates 
select="user_list"/>
                                                </xsl:if>
-                                       </select>
-                               </td>
-                               <td valign="top">
-                               <input type="button" value="{$lang_open_popup}" 
onClick="openwindow({$url},{$width},{$height})"/>
-                               </td>
-                       </tr>
-               </table>
+                       </select><br />
+                       <a href="#" onClick="window.open('{url}', 
'addressmaster', 
'menubar=0,toolbar=0,resizable=1,width={width},height={height}'); return 
false;"><xsl:value-of select="lang_open_popup" /></a>
+               </fieldset>
        </xsl:template>
 
 <!-- END popwin -->




reply via email to

[Prev in Thread] Current Thread [Next in Thread]