phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php,1.28,1.29 cla


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: admin/inc class.boaccounts.inc.php,1.28,1.29 class.uiaccounts.inc.php,1.30,1.31class.uicategories.inc.php,1.32,1.33 class.uimainscreen.inc.php,1.6,1.7 class.uiserver.inc.php,1.6,1.7 hook_admin.inc.php,1.28,1.29
Date: Tue, 22 Apr 2003 21:08:34 -0400

Update of /cvsroot/phpgroupware/admin/inc
In directory subversions:/tmp/cvs-serv28202/inc

Modified Files:
        class.boaccounts.inc.php class.uiaccounts.inc.php 
        class.uicategories.inc.php class.uimainscreen.inc.php 
        class.uiserver.inc.php hook_admin.inc.php 
Log Message:
started updating to xslt and rework accounts classes

Index: class.boaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.boaccounts.inc.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** class.boaccounts.inc.php    28 Sep 2002 20:01:43 -0000      1.28
--- class.boaccounts.inc.php    23 Apr 2003 01:08:31 -0000      1.29
***************
*** 1,7 ****
  <?php
        
/**************************************************************************\
!       * phpGroupWare - account administration                                 
   *
        * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
        *  This program is free software; you can redistribute it and/or modify 
it *
        *  under the terms of the GNU General Public License as published by 
the   *
--- 1,8 ----
  <?php
        
/**************************************************************************\
!       * phpGroupWare - Account Administration                                 
   *
        * http://www.phpgroupware.org                                           
   *
!       * Written by coreteam <address@hidden>                    *
!       * -----------------------------------------------------                 
   *
        *  This program is free software; you can redistribute it and/or modify 
it *
        *  under the terms of the GNU General Public License as published by 
the   *
***************
*** 9,13 ****
        *  option) any later version.                                           
   *
        
\**************************************************************************/
- 
        /* $Id$ */
  
--- 10,13 ----
***************
*** 15,25 ****
        {
                var $so;
!               var $public_functions = array(
!                       'add_group'    => True,
!                       'add_user'     => True,
!                       'delete_group' => True,
!                       'delete_user'  => True,
!                       'edit_group'   => True,
!                       'edit_user'    => True,
                        'set_group_managers'    => True
                );
--- 15,26 ----
        {
                var $so;
!               var $public_functions = array
!               (
!                       'add_group'                             => True,
!                       'add_user'                              => True,
!                       'delete_group'                  => True,
!                       'delete_user'                   => True,
!                       'edit_group'                    => True,
!                       'edit_user'                             => True,
                        'set_group_managers'    => True
                );
***************
*** 27,34 ****
                var $xml_functions = array();
  
!               var $soap_functions = array(
!                       'add_user' => array(
!                               'in'  => array('int', 'struct'),
!                               'out' => array()
                        )
                );
--- 28,37 ----
                var $xml_functions = array();
  
!               var $soap_functions = array
!               (
!                       'add_user'      => array
!                       (
!                               'in'    => array('int','struct'),
!                               'out'   => array()
                        )
                );
***************
*** 76,96 ****
                }
  
!               function delete_group()
                {
!                       if 
(address@hidden($GLOBALS['HTTP_POST_VARS']['account_id']) || 
address@hidden'HTTP_POST_VARS']['account_id'] || 
$GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
                        {
-                               ExecMethod('admin.uiaccounts.list_groups');
                                return False;
                        }
-                       
-                       $account_id = 
intval($GLOBALS['HTTP_POST_VARS']['account_id']);
  
!                       $GLOBALS['phpgw']->db->lock(
!                               Array(
                                        'phpgw_accounts',
                                        'phpgw_acl'
                                )
                        );
!                               
                        $old_group_list = 
$GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group');
  
--- 79,96 ----
                }
  
!               function delete_group($account_id)
                {
!                       if 
($GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
                        {
                                return False;
                        }
  
!                       $GLOBALS['phpgw']->db->lock(array
!                               (
                                        'phpgw_accounts',
                                        'phpgw_acl'
                                )
                        );
! 
                        $old_group_list = 
$GLOBALS['phpgw']->acl->get_ids_for_location($account_id,1,'phpgw_group');
  
***************
*** 114,123 ****
  
                        $GLOBALS['phpgw']->accounts->delete($account_id);
- 
                        $GLOBALS['phpgw']->db->unlock();
- 
-                       Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'));
-                       $GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
-                       exit;
                }
  
--- 114,118 ----
***************
*** 172,184 ****
                }
  
!               function add_group()
                {
!                       if 
($GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
!                       {
!                               ExecMethod('admin.uiaccounts.list_groups');
!                               return False;
!                       }
! 
!                       $temp_users = 
($GLOBALS['HTTP_POST_VARS']['account_user']?$GLOBALS['HTTP_POST_VARS']['account_user']:Array());
                        $account_user = Array();
                        @reset($temp_users);
--- 167,173 ----
                }
  
!               function add_group($values)
                {
!                       $temp_users = 
($values['account_user']?$values['account_user']:Array());
                        $account_user = Array();
                        @reset($temp_users);
***************
*** 189,193 ****
                        @reset($account_user);
  
!                       $group_permissions = 
($GLOBALS['HTTP_POST_VARS']['account_apps']?$GLOBALS['HTTP_POST_VARS']['account_apps']:Array());
                        $account_apps = Array();
                        @reset($group_permissions);
--- 178,182 ----
                        @reset($account_user);
  
!                       $group_permissions = 
($values['account_apps']?$values['account_apps']:Array());
                        $account_apps = Array();
                        @reset($group_permissions);
***************
*** 201,229 ****
                        @reset($account_apps);
  
!                       $group_info = Array(
!                               'account_id'   => 
($GLOBALS['HTTP_POST_VARS']['account_id']?intval($GLOBALS['HTTP_POST_VARS']['account_id']):0),
!                               'account_name' => 
($GLOBALS['HTTP_POST_VARS']['account_name']?$GLOBALS['HTTP_POST_VARS']['account_name']:''),
                                'account_user' => $account_user,
                                'account_apps' => $account_apps
                        );
  
!                       $this->validate_group($group_info);
! 
!                       $GLOBALS['phpgw']->db->lock(
!                               Array(
!                                       'phpgw_accounts',
!                                       'phpgw_nextid',
!                                       'phpgw_preferences',
!                                       'phpgw_sessions',
!                                       'phpgw_acl',
!                                       'phpgw_applications',
!                                       'phpgw_app_sessions',
!                                       'phpgw_hooks'
!                               )
!                       );
  
                        $group = 
CreateObject('phpgwapi.accounts',$group_info['account_id'],'g');
                        $group->acct_type = 'g';
!                       $account_info = array(
                                'account_type'      => 'g',
                                'account_lid'       => 
$group_info['account_name'],
--- 190,217 ----
                        @reset($account_apps);
  
!                       $group_info = Array
!                       (
!                               'account_id'   => 
($values['account_id']?intval($values['account_id']):0),
!                               'account_name' => 
($values['account_name']?$values['account_name']:''),
                                'account_user' => $account_user,
                                'account_apps' => $account_apps
                        );
  
!                       $GLOBALS['phpgw']->db->lock(array
!                       (
!                               'phpgw_accounts',
!                               'phpgw_nextid',
!                               'phpgw_preferences',
!                               'phpgw_sessions',
!                               'phpgw_acl',
!                               'phpgw_applications',
!                               'phpgw_app_sessions',
!                               'phpgw_hooks'
!                       ));
  
                        $group = 
CreateObject('phpgwapi.accounts',$group_info['account_id'],'g');
                        $group->acct_type = 'g';
!                       $account_info = array
!                       (
                                'account_type'      => 'g',
                                'account_lid'       => 
$group_info['account_name'],
***************
*** 287,295 ****
                                $cd = 37;
                        }
- 
                        $GLOBALS['phpgw']->db->unlock();
- 
-                       ExecMethod('admin.uiaccounts.list_groups');
-                       return False;
                }
  
--- 275,279 ----
***************
*** 349,361 ****
                }
  
!               function edit_group()
                {
                        if 
($GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
                        {
!                               ExecMethod('admin.uiaccounts.list_groups');
!                               return False;
                        }
  
!                       $temp_users = 
($GLOBALS['HTTP_POST_VARS']['account_user']?$GLOBALS['HTTP_POST_VARS']['account_user']:Array());
                        $account_user = Array();
                        @reset($temp_users);
--- 333,344 ----
                }
  
!               function edit_group($values)
                {
                        if 
($GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
                        {
!                               $error[] = lang('no permission to create 
groups');
                        }
  
!                       $temp_users = 
($values['account_user']?$values['account_user']:Array());
                        $account_user = Array();
                        @reset($temp_users);
***************
*** 366,370 ****
                        @reset($account_user);
  
!                       $group_permissions = 
($GLOBALS['HTTP_POST_VARS']['account_apps']?$GLOBALS['HTTP_POST_VARS']['account_apps']:Array());
                        $account_apps = Array();
                        @reset($group_permissions);
--- 349,353 ----
                        @reset($account_user);
  
!                       $group_permissions = 
($values['account_apps']?$values['account_apps']:Array());
                        $account_apps = Array();
                        @reset($group_permissions);
***************
*** 379,390 ****
  
                        $group_info = Array(
!                               'account_id'   => 
($GLOBALS['HTTP_POST_VARS']['account_id']?intval($GLOBALS['HTTP_POST_VARS']['account_id']):0),
!                               'account_name' => 
($GLOBALS['HTTP_POST_VARS']['account_name']?$GLOBALS['HTTP_POST_VARS']['account_name']:''),
                                'account_user' => $account_user,
                                'account_apps' => $account_apps
                        );
  
-                       $this->validate_group($group_info);
- 
                        // Lock tables
                        $GLOBALS['phpgw']->db->lock(
--- 362,371 ----
  
                        $group_info = Array(
!                               'account_id'   => 
($values['account_id']?intval($values['account_id']):0),
!                               'account_name' => 
($values['account_name']?$values['account_name']:''),
                                'account_user' => $account_user,
                                'account_apps' => $account_apps
                        );
  
                        // Lock tables
                        $GLOBALS['phpgw']->db->lock(
***************
*** 515,521 ****
  
                        $GLOBALS['phpgw']->db->unlock();
- 
-                       ExecMethod('admin.uiaccounts.list_groups');
-                       return False;
                }
  
--- 496,499 ----
***************
*** 606,626 ****
                }
  
!               function validate_group($group_info)
                {
!                       $errors = Array();
!                       
!                       $group = 
CreateObject('phpgwapi.accounts',$group_info['account_id'],'g');
                        $group->read_repository();
  
!                       if(!$group_info['account_name'])
                        {
!                               $errors[] = lang('You must enter a group 
name.');
                        }
  
!                       if($group_info['account_name'] != 
$group->id2name($group_info['account_id']))
                        {
!                               if ($group->exists($group_info['account_name']))
                                {
!                                       $errors[] = lang('Sorry, that group 
name has already been taken.');
                                }
                        }
--- 584,607 ----
                }
  
!               function validate_group($values)
                {
!                       $group = 
CreateObject('phpgwapi.accounts',$values['account_id'],'g');
                        $group->read_repository();
  
!                       if 
($GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
                        {
!                               $error[] = lang('no permission to create 
groups');
                        }
  
!                       if(!$values['account_name'])
                        {
!                               $error[] = lang('You must enter a group name.');
!                       }
! 
!                       if($values['account_name'] != 
$group->id2name($values['account_id']))
!                       {
!                               if ($group->exists($values['account_name']))
                                {
!                                       $error[] = lang('Sorry, that group name 
has already been taken.');
                                }
                        }
***************
*** 629,641 ****
                        if (preg_match ("/\D/", $account_file_space_number))
                        {
!                               $errors[] = lang ('File space must be an 
integer');
                        }
                */
!                       if(count($errors))
                        {
!                               $ui = createobject('admin.uiaccounts');
!                               $ui->create_edit_group($group_info,$errors);
!                               $GLOBALS['phpgw_info']['flags']['nodisplay'] = 
True;
!                               exit;
                        }
                }
--- 610,619 ----
                        if (preg_match ("/\D/", $account_file_space_number))
                        {
!                               $error[] = lang ('File space must be an 
integer');
                        }
                */
!                       if(is_array($error))
                        {
!                               return $error;
                        }
                }

Index: class.uiaccounts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uiaccounts.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** class.uiaccounts.inc.php    6 Apr 2003 22:29:57 -0000       1.30
--- class.uiaccounts.inc.php    23 Apr 2003 01:08:32 -0000      1.31
***************
*** 3,7 ****
        * phpGroupWare - account administration                                 
   *
        * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
        *  This program is free software; you can redistribute it and/or modify 
it *
        *  under the terms of the GNU General Public License as published by 
the   *
--- 3,8 ----
        * phpGroupWare - account administration                                 
   *
        * http://www.phpgroupware.org                                           
   *
!       * Written by coreteam <address@hidden>                    *
!       * -----------------------------------------------------                 
   *
        *  This program is free software; you can redistribute it and/or modify 
it *
        *  under the terms of the GNU General Public License as published by 
the   *
***************
*** 9,27 ****
        *  option) any later version.                                           
   *
        
\**************************************************************************/
- 
        /* $Id$ */
  
        class uiaccounts
        {
!               var $public_functions = array(
!                       'list_groups' => True,
!                       'list_users'  => True,
!                       'add_group'   => True,
!                       'add_user'    => True,
!                       'delete_group' => True,
!                       'delete_user' => True,
!                       'edit_user'   => True,
!                       'edit_group'  => True,
!                       'view_user'   => True,
                        'group_manager' => True
                );
--- 10,28 ----
        *  option) any later version.                                           
   *
        
\**************************************************************************/
        /* $Id$ */
  
        class uiaccounts
        {
!               var $public_functions = array
!               (
!                       'list_groups'   => True,
!                       'list_users'    => True,
!                       'add_group'             => True,
!                       'add_user'              => True,
!                       'delete_group'  => True,
!                       'delete_user'   => True,
!                       'edit_user'             => True,
!                       'edit_group'    => True,
!                       'view_user'             => True,
                        'group_manager' => True
                );
***************
*** 32,37 ****
                function uiaccounts()
                {
!                       $this->bo = createobject('admin.boaccounts');
!                       $this->nextmatchs = createobject('phpgwapi.nextmatchs');
                        @set_time_limit(300);
                }
--- 33,41 ----
                function uiaccounts()
                {
!                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
! 
!                       $this->bo                       = 
createobject('admin.boaccounts');
!                       $this->nextmatchs       = 
createobject('phpgwapi.nextmatchs');
! 
                        @set_time_limit(300);
                }
***************
*** 49,53 ****
                        if 
($GLOBALS['phpgw']->acl->check('group_access',1,'admin'))
                        {
!                               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php'));
                        }
  
--- 53,57 ----
                        if 
($GLOBALS['phpgw']->acl->check('group_access',1,'admin'))
                        {
!                               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen'));
                        }
  
***************
*** 55,72 ****
  
                        $GLOBALS['cd'] = ($_GET['cd']?$_GET['cd']:0);
-                       
-                       unset($GLOBALS['phpgw_info']['flags']['noheader']);
-                       unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
-                       $GLOBALS['phpgw']->common->phpgw_header();
  
!                       $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
!                       $p->set_file(
!                               array(
!                                       'groups'   => 'groups.tpl'
!                               )
!                       );
!                       $p->set_block('groups','list','list');
!                       $p->set_block('groups','row','row');
!                       $p->set_block('groups','row_empty','row_empty');
  
                        if 
($GLOBALS['phpgw']->acl->check('group_access',2,'admin'))
--- 59,68 ----
  
                        $GLOBALS['cd'] = ($_GET['cd']?$_GET['cd']:0);
  
!                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('administration') . ': ' . lang('list groups');
! 
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data','groups',
!                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'search_field',
!                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'nextmatchs'));
  
                        if 
($GLOBALS['phpgw']->acl->check('group_access',2,'admin'))
***************
*** 81,170 ****
                        }
  
!                       $url = $GLOBALS['phpgw']->link('/index.php');
! 
!                       $var = Array(
!                               'th_bg'             => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
!                               'left_next_matchs'  => 
$this->nextmatchs->left('/index.php',$start,$total,'menuaction=admin.uiaccounts.list_groups'),
!                               'right_next_matchs' => 
$this->nextmatchs->right('/admin/groups.php',$start,$total,'menuaction=admin.uiaccounts.list_groups'),
!                               'lang_groups'   => lang('user groups'),
!                               'sort_name'     => 
$this->nextmatchs->show_sort_order($sort,'account_lid',$order,'/index.php',lang('name'),'menuaction=admin.uiaccounts.list_groups'),
!                               'header_edit'   => lang('Edit'),
!                               'header_delete' => lang('Delete'),
!                               'lang_done'     => lang('Done'),
!                               'doneurl'       => 
$GLOBALS['phpgw']->link('/admin/index.php')
                        );
-                       $p->set_var($var);
  
!                       if (!count($account_info) || !$total)
                        {
!                               $p->set_var('message',lang('No matches found'));
!                               $p->parse('rows','row_empty',True);
                        }
-                       else
-                       {
-                               if (! 
$GLOBALS['phpgw']->acl->check('group_access',8,'admin'))
-                               {
-                                       $can_view = True;
-                               }
- 
-                               if (! 
$GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
-                               {
-                                       $can_edit = True;
-                               }
- 
-                               if (! 
$GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
-                               {
-                                       $can_delete = True;
-                               }
- 
-                               while (list($null,$account) = 
each($account_info))
-                               {
-                                       $tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
-                                       $var = Array(
-                                               'tr_color'    => $tr_color,
-                                               'group_name'  => 
(!$account['account_lid']?'&nbsp;':$account['account_lid']),
-                                               'delete_link' => 
$this->row_action('delete','group',$account['account_id'])
-                                       );
-                                       $p->set_var($var);
  
!                                       if ($can_edit)
!                                       {
!                                               
$p->set_var('edit_link',$this->row_action('edit','group',$account['account_id']));
!                                       }
!                                       else
!                                       {
!                                               
$p->set_var('edit_link','&nbsp;');
!                                       }
! 
!                                       if ($can_delete)
!                                       {
!                                               
$p->set_var('delete_link',$this->row_action('delete','group',$account['account_id']));
!                                       }
!                                       else
!                                       {
!                                               
$p->set_var('delete_link','&nbsp;');
!                                       }
  
!                                       $p->fp('rows','row',True);
  
!                               }
                        }
-                       $var = Array(
-                               'new_action'    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.add_group'),
-                               'search_action' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')
-                       );
-                       $p->set_var($var);
  
                        if (! 
$GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
                        {
!                               $p->set_var('input_add','<input type="submit" 
value="' . lang('Add') . '">');
                        }
  
                        if (! 
$GLOBALS['phpgw']->acl->check('group_access',2,'admin'))
                        {
!                               $p->set_var('input_search',lang('Search') . 
'&nbsp;<input name="query">');
                        }
  
!                       $p->pfp('out','list');
                }
  
--- 77,165 ----
                        }
  
!                       $group_header = array
!                       (
!                               'sort_name'                             => 
$this->nextmatchs->show_sort_order(array
!                                                                               
        (
!                                                                               
                'sort'  => $sort,
!                                                                               
                'var'   => 'account_lid',
!                                                                               
                'order' => $order,
!                                                                               
                'extra' => 'menuaction=admin.uiaccounts.list_groups'
!                                                                               
        )),
!                               'lang_name'                             => 
lang('name'),
!                               'lang_edit'                             => 
lang('edit'),
!                               'lang_delete'                   => 
lang('delete'),
!                               'lang_sort_statustext'  => lang('sort the 
entries')
                        );
  
!                       if (! 
$GLOBALS['phpgw']->acl->check('group_access',8,'admin'))
                        {
!                               $can_view = True;
                        }
  
!                       if (! 
$GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
!                       {
!                               $can_edit = True;
!                       }
  
!                       if (! 
$GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
!                       {
!                               $can_delete = True;
!                       }
  
!                       while (list($null,$account) = each($account_info))
!                       {
!                               $group_data[] = Array
!                               (
!                                       'edit_url'                              
        => 
($can_edit?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_group&account_id='
 . $account['account_id']):''),
!                                       'lang_edit'                             
        => ($can_edit?lang('edit'):''),
!                                       'lang_edit_statustext'          => 
($can_edit?lang('edit this group'):''),
!                                       'group_name'                            
=> (!$account['account_lid']?'':$account['account_lid']),
!                                       'delete_url'                            
=> 
($can_delete?$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group&account_id='
 . $account['account_id']):''),
!                                       'lang_delete_statustext'        => 
($can_delete?lang('delete this group'):''),
!                                       'lang_delete'                           
=> ($can_delete?lang('delete'):'')
!                               );
                        }
  
                        if (! 
$GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
                        {
!                               $add_access = 'yes';
                        }
  
+                       $group_add = array
+                       (
+                               'lang_add'                              => 
lang('add'),
+                               'lang_add_statustext'   => lang('add a group'),
+                               'add_url'                               => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_group'),
+                               'lang_done'                             => 
lang('done'),
+                               'lang_done_statustext'  => lang('return to 
admin mainscreen'),
+                               'done_url'                              => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen'),
+                               'add_access'                    => $add_access,
+                       );
+ 
                        if (! 
$GLOBALS['phpgw']->acl->check('group_access',2,'admin'))
                        {
!                               $search_access = 'yes';
                        }
  
!                       $data = array
!                       (
!                               'start_record'                                  
=> $start,
!                               'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
!                               'num_records'                                   
=> count($account_info),
!                               'all_records'                                   
=> $total,
!                               'nextmatchs_url'                                
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'),
!                               'nextmatchs_img_path'                   => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
!                               'select_url'                                    
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'),
!                               'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
!                               'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
!                               'query'                                         
        => $query,
!                               'lang_search'                                   
=> lang('search'),
!                               'lang_groups'                                   
=> lang('user groups'),
!                               'group_header'                                  
=> $group_header,
!                               'group_data'                                    
=> $group_data,
!                               'group_add'                                     
        => $group_add,
!                               'search_access'                                 
=> $search_access
!                       );
!                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('group_list' => $data));
                }
  
***************
*** 173,177 ****
                        if 
($GLOBALS['phpgw']->acl->check('account_access',1,'admin'))
                        {
!                               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/admin/index.php'));
                        }
  
--- 168,172 ----
                        if 
($GLOBALS['phpgw']->acl->check('account_access',1,'admin'))
                        {
!                               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen'));
                        }
  
***************
*** 183,187 ****
                        $GLOBALS['query'] = 
(isset($GLOBALS['HTTP_POST_VARS']['query'])?$GLOBALS['HTTP_POST_VARS']['query']:'');
                        $start = 
(isset($GLOBALS['HTTP_POST_VARS']['start'])?intval($GLOBALS['HTTP_POST_VARS']['start']):'');
! =======
                        if(isset($_GET['order']))
                        {
--- 178,182 ----
                        $GLOBALS['query'] = 
(isset($GLOBALS['HTTP_POST_VARS']['query'])?$GLOBALS['HTTP_POST_VARS']['query']:'');
                        $start = 
(isset($GLOBALS['HTTP_POST_VARS']['start'])?intval($GLOBALS['HTTP_POST_VARS']['start']):'');
! 
                        if(isset($_GET['order']))
                        {
***************
*** 325,345 ****
                }
  
-               function add_group()
-               {
-                       if 
($GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
-                       {
-                               $this->list_groups();
-                               return False;
-                       }
- 
-                       $group_info = Array(
-                               'account_id'   => $_GET['account_id'],
-                               'account_name' => '',
-                               'account_user' => Array(),
-                               'account_apps' => Array()
-                               );
-                       $this->create_edit_group($group_info);
-               }
- 
                function add_user()
                {
--- 320,323 ----
***************
*** 356,434 ****
                function delete_group()
                {
!                       if ($_POST['no'] || $_POST['yes'] || 
address@hidden($_GET['account_id']) || address@hidden'account_id'] || 
$GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
                        {
-                               if ($_POST['yes'])
-                               {
-                                       $this->bo->delete_group();
-                               }
                                $this->list_groups();
                                return False;
                        }
  
!                       unset($GLOBALS['phpgw_info']['flags']['noheader']);
!                       unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
!                       $GLOBALS['phpgw']->common->phpgw_header();
  
!                       $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
!                       $p->set_file(
!                               Array(
!                                       'body' => 'delete_common.tpl',
!                                       'message_row' => 'message_row.tpl',
!                                       'form_button' => 
'form_button_script.tpl'
!                               )
!                       );
  
!                       $p->set_var('message_display',lang('Are you sure you 
want to delete this group ?'));
!                       $p->parse('messages','message_row');
  
!                       $old_group_list = 
$GLOBALS['phpgw']->acl->get_ids_for_location(intval($_GET['account_id']),1,'phpgw_group');
  
                        if($old_group_list)
                        {
!                               $group_name = 
$GLOBALS['phpgw']->accounts->id2name($_GET['account_id']);
! 
!                               $p->set_var('message_display','<br>');
!                               $p->parse('messages','message_row',True);
  
                                $user_list = '';
                                while (list(,$id) = each($old_group_list))
                                {
!                                       $user_list .= '<a href="' . 
$GLOBALS['phpgw']->link('/index.php',
!                                               Array(
!                                                       'menuaction' => 
'admin.uiaccounts.edit_user',
!                                                       'account_id' => $id
!                                               )
!                                       ) . '">' . 
$GLOBALS['phpgw']->common->grab_owner_name($id) . '</a><br>';
!                               }
!                               $p->set_var('message_display',$user_list);
!                               $p->parse('messages','message_row',True);
! 
!                               $p->set_var('message_display',lang("Sorry, the 
above users are still a member of the group x",$group_name)
!                                       . '.<br>' . lang('They must be removed 
before you can continue'). '.<br>' . lang('Remove all users from this 
group').'?');
!                               $p->parse('messages','message_row',True);
!                       }
! 
!                       $var = Array(
!                               'form_action' => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group'),
!                               'hidden_vars' => '<input type="hidden" 
name="account_id" value="'.$_GET['account_id'].'">',
!                               'yes'         => lang('Yes'),
!                               'no'          => lang('No')
!                       );
!                       $p->set_var($var);
! /*
!                       $p->parse('yes','form_button');
  
  
!                       $var = Array(
!                               'submit_button' => lang('Submit'),
!                               'action_url_button'     => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'),
!                               'action_text_button'    => ' '.lang('No'),
!                               'action_confirm_button' => '',
!                               'action_extra_field'    => ''
!                       );
!                       $p->set_var($var);
!                       $p->parse('no','form_button');
! */
!                       $p->pparse('phpgw_body','body');
                }
  
--- 334,389 ----
                function delete_group()
                {
!                       $account_id = get_var('account_id',array('POST','GET'));
! 
!                       if 
($GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
                        {
                                $this->list_groups();
                                return False;
                        }
  
!                       if ($account_id && get_var('confirm',array('POST')))
!                       {
!                               $this->bo->delete_group($account_id);
!                               $this->list_groups();
!                               return False;
!                       }
  
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_delete'));
!                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('administration') . ': ' . lang('delete group');
  
!                       $data = array
!                       (
!                               'delete_url'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.delete_group&account_id='
 . $account_id),
!                               'done_url'                              => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'),
!                               'lang_yes'                              => 
lang('Yes'),
!                               'lang_no'                               => 
lang('No'),
!                               'lang_yes_statustext'   => lang('Delete the 
entry'),
!                               'lang_no_statustext'    => lang('Back to the 
list'),
!                               'lang_error_msg'                => lang('are 
you sure you want to delete this group ?')
!                       );
  
!                       $old_group_list = 
$GLOBALS['phpgw']->acl->get_ids_for_location(intval($account_id),1,'phpgw_group');
  
                        if($old_group_list)
                        {
!                               $group_name = 
$GLOBALS['phpgw']->accounts->id2name($account_id);
  
                                $user_list = '';
                                while (list(,$id) = each($old_group_list))
                                {
!                                       $data['user_list'][] = array
!                                       (
!                                               'user_url'                      
                => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.edit_user&account_id='
 . $id),
!                                               'user_name'                     
                => $GLOBALS['phpgw']->common->grab_owner_name($id),
!                                               'lang_user_url_statustext'      
=> lang('edit user')
!                                       );
!                               }
  
+                               $data['lang_confirm_msg']                       
= lang('the users bellow are still members of group %1',$group_name) . '. '
+                                                                               
                        . lang('they must be removed before you can continue');
+                               $data['lang_remove_user']                       
= lang('Remove all users from this group ?');
+                       }
  
!                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
  
***************
*** 475,481 ****
                }
  
!               function edit_group($cd='',$account_id='')
                {
!                       if 
($GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
                        {
                                $this->list_groups();
--- 430,480 ----
                }
  
!               function edit_group()
                {
!                       $account_id     = 
get_var('account_id',array('POST','GET'));
!                       $values                 = 
get_var('values',array('POST'));
!                       $account_user   = get_var('account_user',array('POST'));
!                       $account_apps   = get_var('account_apps',array('POST'));
! 
!                       if ($values['save'])
!                       {
!                               $error = $this->bo->validate_group($values);
! 
!                               if (is_array($error))
!                               {
! 
!                               }
!                               else
!                               {
!                                       if (is_array($account_user))
!                                       {
!                                               $values['account_user'] = 
$account_user;
!                                       }
! 
!                                       if (is_array($account_apps))
!                                       {
!                                               $values['account_apps'] = 
$account_apps;
!                                       }
! 
!                                       if ($values['account_id'])
!                                       {
!                                               $this->bo->edit_group($values);
!                                               $account_id = 
$values['account_id'];
!                                       }
!                                       else
!                                       {
!                                               $this->bo->add_group($values);
!                                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'));
!                                       }
!                               }
!                       }
! 
!                       if (!$account_id && 
$GLOBALS['phpgw']->acl->check('group_access',4,'admin'))
!                       {
!                               $this->list_groups();
!                               return False;
!                       }
! 
!                       if ($account_id && 
$GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
                        {
                                $this->list_groups();
***************
*** 487,511 ****
                        $cd = ($_GET['cd']?$_GET['cd']:intval($cdid));
  
!                       $accountid = $account_id;
!                       settype($account_id,'integer');
!                       $account_id = 
($_GET['account_id']?$_GET['account_id']:intval($accountid));
!                       
!                       // todo
!                       // not needed if i use the same file for new groups too
!                       if (! $account_id)
                        {
!                               $this->list_groups();
                        }
!                       else
                        {
!                               $group_info = Array(
!                                       'account_id'   => 
intval($_GET['account_id']),
!                                       'account_name' => 
$GLOBALS['phpgw']->accounts->id2name($_GET['account_id']),
!                                       'account_user' => 
$this->bo->load_group_users($_GET['account_id']),
!                                       'account_apps' => 
$this->bo->load_group_apps($_GET['account_id'])
                                );
  
!                               $this->create_edit_group($group_info);
                        }
                }
  
--- 486,628 ----
                        $cd = ($_GET['cd']?$_GET['cd']:intval($cdid));
  
!                       if ($account_id)
                        {
!                               $group_info = Array
!                               (
!                                       'account_name' => 
$GLOBALS['phpgw']->accounts->id2name($account_id),
!                                       'account_user' => 
$this->bo->load_group_users($account_id),
!                                       'account_apps' => 
$this->bo->load_group_apps($account_id)
!                               );
                        }
! 
!                       $apps_with_acl = Array
!                       (
!                               'addressbook'   => True,
!                               'bookmarks'             => True,
!                               'calendar'              => True,
!                               'filemanager'   => True,
!                               'img'                   => True,
!                               'infolog'               => True,
!                               'inv'                   => True,
!                               'netsaint'              => True,
!                               'notes'                 => True,
!                               'phonelog'              => True,
!                               'phpwebhosting' => True,
!                               'projects'              => True,
!                               'todo'                  => True,
!                               'tts'                   => True
!                       );
! 
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data','groups'));
!                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('administration') . ': ' . ((intval($account_id) > 0)?lang('edit 
group'):lang('add group'));
! 
!                       $accounts = 
CreateObject('phpgwapi.accounts',$account_id,'u');
!                       $account_list = $accounts->get_list('accounts');
!                       $account_num = count($account_list);
! 
!                       $user_list = '';
!                       while (list($key,$entry) = each($account_list))
                        {
!                               $user_list[] = array
!                               (
!                                       'account_id'            => 
$entry['account_id'],
!                                       'account_name'          => 
$GLOBALS['phpgw']->common->display_fullname($entry['account_lid'],$entry['account_firstname'],
!                                                                               
                                                                                
                $entry['account_lastname']),
!                                       'selected'                      => 
$group_info['account_user'][intval($entry['account_id'])]
                                );
+                       }
+ 
+                       $group_repository = $accounts->read_repository();
+                       if (!$group_repository['file_space'])
+                       {
+                               $group_repository['file_space'] = 
$GLOBALS['phpgw_info']['server']['vfs_default_account_size_number'] . "-" . 
$GLOBALS['phpgw_info']['server']['vfs_default_account_size_type'];
+                       }
+       /*
+                       $file_space_array = explode ('-', 
$group_repository['file_space']);
+                       $account_file_space_types = array ('gb', 'mb', 'kb', 
'b');
+                       while (list ($num, $type) = each 
($account_file_space_types))
+                       {
+                               $account_file_space_select .= '<option 
value="'.$type.'"'.($type==$file_space_array[1]?' selected':'').'>'.strtoupper 
($type).'</option>'."\n";
+                       }
+                       $p->set_var ('lang_file_space', lang('File space'));
+                       $p->set_var ('account_file_space', '<input type=text 
name="account_file_space_number" value="'.trim($file_space_array[0]).'" 
size="7">');
+                       $p->set_var ('account_file_space_select','<select 
name="account_file_space_type">'."\n".$account_file_space_select.'</select>'."\n");
+       */
+ 
+                       reset($GLOBALS['phpgw_info']['apps']);
+                       $sorted_apps = $GLOBALS['phpgw_info']['apps'];
+                       @asort($sorted_apps);
+                       @reset($sorted_apps);
+                       while ($permission = each($sorted_apps))
+                       {
+                               if ($permission[1]['enabled'] && 
$permission[1]['status'] != 3)
+                               {
+                                       $perm_display[] = array
+                                       (
+                                               $permission[0],
+                                               $permission[1]['title']
+                                       );
+                               }
+                       }
+ 
+                       /*$perm_html = 
'<td>'.lang('Application').'</td><td>&nbsp;</td><td>'.lang('ACL').'</td>';
+                       $perm_html = '<tr 
class="th">'.$perm_html.$perm_html."</tr>\n";*/
  
!                       for ($i=0;$i < count($perm_display);$i++)
!                       {
!                               $app = $perm_display[$i][0];
!                               /*$perm_html .= '<td width="40%">' . 
$perm_display[$i][1] . '</td>'
!                                       . '<td width="5%"><input 
type="checkbox" name="account_apps['
!                                       . $perm_display[$i][0] . ']" 
value="True"'.($group_info['account_apps'][$app]?' checked':'').'></td><td 
width="5%" align="center">'
!                                       . ($apps_with_acl[$app] && 
$group_info['account_id']?'<a 
href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$app.'&owner='.$group_info['account_id'])
!                                       . '" target="_blank"><img 
src="'.$GLOBALS['phpgw']->common->image('admin','dot').'" border="0" hspace="3" 
align="absmiddle" alt="'
!                                       . lang('Grant 
Access').'"></a>':'&nbsp;').'</td>'.($i & 1?'</tr>':'')."\n";*/
! 
!                               $app_list[] = array
!                               (
!                                       'app_name'              => 
$perm_display[$i][1],
!                                       'checkbox_name' => 'account_apps[' . 
$perm_display[$i][0] . ']',
!                                       'checked'               => 
($group_info['account_apps'][$app]?'checked':''),
!                                       'acl_url'               => 
($apps_with_acl[$app] && 
$account_id?$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$app.'&owner='.$account_id):''),
!                                       'acl_img'               => 
$GLOBALS['phpgw']->common->image('admin','dot'),
!                                       'img_name'              => lang('Grant 
Access')
!                               );
                        }
+ 
+                       /*if($i & 1)
+                       {
+                               $perm_html .= '<td 
colspan="4">&nbsp;</td></tr>';
+                       }*/
+ 
+                       $link_data = array
+                       (
+                               'menuaction'    => 
'admin.uiaccounts.edit_group',
+                               'account_id'    => $account_id
+                       );
+ 
+                       $data = array
+                       (
+                               'edit_url'                              => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_url'                              => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups'),
+                               'account_id'                    => 
$group_info['account_id'],
+                               'lang_account_name'             => lang('group 
name'),
+                               'value_account_name'    => 
$group_info['account_name'],
+                               'lang_include_user'             => lang('select 
users for inclusion'),
+                               'error'                                 => 
(!$_errors?'':$GLOBALS['phpgw']->common->error_list($_errors)),
+                               'select_size'                   => 
($account_num < 5?$account_num:5),
+                               'user_list'                             => 
$user_list,
+                               'lang_permissions'              => 
lang('permissions this group has'),
+                               'lang_application'              => 
lang('application'),
+                               'lang_acl'                              => 
lang('acl'),
+                               'lang_done'                             => 
lang('done'),
+                               'lang_save'                             => 
lang('save'),
+                               'app_list'                              => 
$app_list,
+                               'account_id'                    => $account_id
+                       );
+ 
+                       /* create the menu on the left, if needed
+                       
$p->set_var('rows',ExecMethod('admin.uimenuclass.createHTMLCode','group_manager'));
 */
+ 
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('group_edit' => $data));
                }
  
***************
*** 728,862 ****
                                $this->edit_group_managers($group_info);
                        }
-               }
- 
-               function create_edit_group($group_info,$_errors='')
-               {
-                       $apps_with_acl = Array(
-                               'addressbook' => True,
-                               'todo'        => True,
-                               'calendar'    => True,
-                               'notes'       => True,
-                               'projects'    => True,
-                               'phonelog'    => True,
-                               'infolog'     => True,
-                               'filemanager' => True,
-                               'phpwebhosting' => True,
-                               'tts'         => True,
-                               'bookmarks'   => True,
-                               'img'         => True,
-                               'netsaint'    => True,
-                               'inv'         => True
-                       );
- 
-                       $sbox = createobject('phpgwapi.sbox');
- 
-                       unset($GLOBALS['phpgw_info']['flags']['noheader']);
-                       unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
-                       $GLOBALS['phpgw']->common->phpgw_header();
- 
-                       $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-                       $p->set_file(
-                               Array(
-                                       'form' => 'group_form.tpl'
-                               )
-                       );
- 
-                       $accounts = 
CreateObject('phpgwapi.accounts',$group_info['account_id'],'u');
-                       $account_list = $accounts->get_list('accounts');
-                       $account_num = count($account_list);
- 
-                       $user_list = '';
-                       while (list($key,$entry) = each($account_list))
-                       {
-                               $user_list .= '<option value="' . 
$entry['account_id'] . '"'
-                                       . 
$group_info['account_user'][intval($entry['account_id'])] . '>'
-                                       . 
$GLOBALS['phpgw']->common->display_fullname(
-                                               $entry['account_lid'],
-                                               $entry['account_firstname'],
-                                               $entry['account_lastname'])
-                                       . '</option>'."\n";
-                       }
- 
-                       $var = Array(
-                               'form_action'       => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.'.($group_info['account_id']?'edit':'add').'_group'),
-                               'cancel_action'     => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                               'hidden_vars'       => '<input type="hidden" 
name="account_id" value="' . $group_info['account_id'] . '">',
-                               'lang_group_name'   => lang('group name'),
-                               'group_name_value'  => 
$group_info['account_name'],
-                               'lang_include_user' => lang('Select users for 
inclusion'),
-                               'error'             => 
(!$_errors?'':'<center>'.$GLOBALS['phpgw']->common->error_list($_errors).'</center>'),
-                               'select_size'       => ($account_num < 
5?$account_num:5),
-                               'user_list'         => $user_list,
-                               'lang_permissions'  => lang('Permissions this 
group has'),
-                               'lang_cancel'       => lang('Cancel')
-                       );
-                       $p->set_var($var);
- 
-                       $group_repository = $accounts->read_repository ();
-                       if (!$group_repository['file_space'])
-                       {
-                               $group_repository['file_space'] = 
$GLOBALS['phpgw_info']['server']['vfs_default_account_size_number'] . "-" . 
$GLOBALS['phpgw_info']['server']['vfs_default_account_size_type'];
-                       }
-       /*
-                       $file_space_array = explode ('-', 
$group_repository['file_space']);
-                       $account_file_space_types = array ('gb', 'mb', 'kb', 
'b');
-                       while (list ($num, $type) = each 
($account_file_space_types))
-                       {
-                               $account_file_space_select .= '<option 
value="'.$type.'"'.($type==$file_space_array[1]?' selected':'').'>'.strtoupper 
($type).'</option>'."\n";
-                       }
-                       $p->set_var ('lang_file_space', lang('File space'));
-                       $p->set_var ('account_file_space', '<input type=text 
name="account_file_space_number" value="'.trim($file_space_array[0]).'" 
size="7">');
-                       $p->set_var ('account_file_space_select','<select 
name="account_file_space_type">'."\n".$account_file_space_select.'</select>'."\n");
-       */
- 
-                       reset($GLOBALS['phpgw_info']['apps']);
-                       $sorted_apps = $GLOBALS['phpgw_info']['apps'];
-                       @asort($sorted_apps);
-                       @reset($sorted_apps);
-                       while ($permission = each($sorted_apps))
-                       {
-                               if ($permission[1]['enabled'] && 
$permission[1]['status'] != 3)
-                               {
-                                       $perm_display[] = Array(
-                                               $permission[0],
-                                               $permission[1]['title']
-                                       );
-                               }
-                       }
- 
-                       $perm_html = 
'<td>'.lang('Application').'</td><td>&nbsp;</td><td>'.lang('ACL').'</td>';
-                       $perm_html = '<tr 
class="th">'.$perm_html.$perm_html."</tr>\n";
-                       
-                       $tr_color = $GLOBALS['phpgw_info']['theme']['row_off'];
-                       for ($i=0;$i < count($perm_display);$i++)
-                       {
-                               $app = $perm_display[$i][0];
-                               if(!($i & 1))
-                               {
-                                       $tr_color = 
$this->nextmatchs->alternate_row_color();
-                                       $perm_html .= '<tr 
class="'.$tr_color.'">';
-                               }
-                               $perm_html .= '<td width="40%">' . 
$perm_display[$i][1] . '</td>'
-                                       . '<td width="5%"><input 
type="checkbox" name="account_apps['
-                                       . $perm_display[$i][0] . ']" 
value="True"'.($group_info['account_apps'][$app]?' checked':'').'></td><td 
width="5%" align="center">'
-                                       . ($apps_with_acl[$app] && 
$group_info['account_id']?'<a 
href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$app.'&owner='.$group_info['account_id'])
-                                       . '" target="_blank"><img 
src="'.$GLOBALS['phpgw']->common->image('admin','dot').'" border="0" hspace="3" 
align="absmiddle" alt="'
-                                       . lang('Grant 
Access').'"></a>':'&nbsp;').'</td>'.($i & 1?'</tr>':'')."\n";
-                       }
-                       if($i & 1)
-                       {
-                               $perm_html .= '<td 
colspan="4">&nbsp;</td></tr>';
-                       }
- 
-                       $var = Array(
-                               'permissions_list'   => $perm_html,
-                               'lang_submit_button' => lang('submit changes')
-                       );
-                       $p->set_var($var);
- 
-                       // create the menu on the left, if needed
-                       
$p->set_var('rows',ExecMethod('admin.uimenuclass.createHTMLCode','group_manager'));
- 
-                       $p->pfp('out','form');
                }
  
--- 845,848 ----

Index: class.uicategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uicategories.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** class.uicategories.inc.php  22 Apr 2003 20:09:01 -0000      1.32
--- class.uicategories.inc.php  23 Apr 2003 01:08:32 -0000      1.33
***************
*** 16,20 ****
        {
                var $bo;
!               var $template;
  
                var $start;
--- 16,21 ----
        {
                var $bo;
!               var $nextmatchs;
!               var $xslttpl;
  
                var $start;
***************
*** 28,32 ****
                (
                        'index'  => True,
-                       'add'    => True,
                        'edit'   => True,
                        'delete' => True
--- 29,32 ----
***************
*** 35,38 ****
--- 35,40 ----
                function uicategories()
                {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+ 
                        $this->bo                       = 
CreateObject('admin.bocategories');
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
***************
*** 76,107 ****
                }
  
-               function set_langs()
-               {
-                       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
-                       
$GLOBALS['phpgw']->template->set_var('lang_save',lang('Save'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_search',lang('Search'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_sub',lang('Add sub'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_parent',lang('Parent category'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_none',lang('None'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_name',lang('Name'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_descr',lang('Description'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_add',lang('Add'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_reset',lang('Clear Form'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_done',lang('Done'));
-               }
- 
                function index()
                {
                        $global_cats  = 
get_var('global_cats',array('POST','GET'));
  
!                       $GLOBALS['phpgw']->common->phpgw_header();
! 
!                       
$GLOBALS['phpgw']->template->set_file(array('cat_list_t' => 'listcats.tpl'));
!                       
$GLOBALS['phpgw']->template->set_block('cat_list_t','cat_list');
!                       
$GLOBALS['phpgw']->template->set_block('cat_list_t','cat_row');
! 
!                       $this->set_langs();
  
                        $link_data = array
--- 78,88 ----
                }
  
                function index()
                {
                        $global_cats  = 
get_var('global_cats',array('POST','GET'));
  
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data','cats',
!                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'search_field',
!                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'nextmatchs'));
  
                        $link_data = array
***************
*** 112,128 ****
                        );
  
-                       
$GLOBALS['phpgw']->template->set_var('lang_action',lang('Category list'));
- 
                        if ($GLOBALS['appname'])
                        {
!                               
$GLOBALS['phpgw']->template->set_var('title_categories',lang($GLOBALS['appname'])
 . '&nbsp;' . lang('global categories'));
                        }
                        else
                        {
!                               
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Global 
categories'));
                        }
-                       
$GLOBALS['phpgw']->template->set_var('query',$this->query);
-                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
  
                        if (!$global_cats)
--- 93,104 ----
                        );
  
                        if ($GLOBALS['appname'])
                        {
!                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($GLOBALS['appname']) . '&nbsp;' . lang('global categories') . ': ' . 
lang('category list');
                        }
                        else
                        {
!                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('global categories') . ': ' . lang('category list');
                        }
  
                        if (!$global_cats)
***************
*** 133,154 ****
                        $categories = $this->bo->get_list($global_cats);
  
!                       $left  = 
$this->nextmatchs->left('/index.php',$this->start,$this->bo->cats->total_records,$link_data);
!                       $right = 
$this->nextmatchs->right('/index.php',$this->start,$this->bo->cats->total_records,$link_data);
!                       $GLOBALS['phpgw']->template->set_var('left',$left);
!                       $GLOBALS['phpgw']->template->set_var('right',$right);
! 
!                       
$GLOBALS['phpgw']->template->set_var('lang_showing',$this->nextmatchs->show_hits($this->bo->cats->total_records,$this->start));
! 
!                       
$GLOBALS['phpgw']->template->set_var('sort_name',$this->nextmatchs->show_sort_order($this->sort,'cat_name',$this->order,'/index.php',lang('Name'),$link_data));
!                       
$GLOBALS['phpgw']->template->set_var('sort_description',$this->nextmatchs->show_sort_order($this->sort,'cat_description',$this->order,'/index.php',lang('Description'),$link_data));
  
!                       for ($i=0;$i<count($categories);$i++)
                        {
!                               $tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
!                               
$GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
! 
!                               $level          = $categories[$i]['level'];
!                               $cat_name       = 
$GLOBALS['phpgw']->strip_html($categories[$i]['name']);
  
                                if ($level > 0)
                                {
--- 109,142 ----
                        $categories = $this->bo->get_list($global_cats);
  
!                       $cat_header[] = array
!                       (
!                               'sort_name'                             => 
$this->nextmatchs->show_sort_order(array
!                                                                               
(
!                                                                               
        'sort'  => $this->sort,
!                                                                               
        'var'   => 'cat_name',
!                                                                               
        'order' => $this->order,
!                                                                               
        'extra' => $link_data
!                                                                               
)),
!                               'lang_add_sub'                  => lang('add 
sub'),
!                               'lang_name'                             => 
lang('name'),
!                               'lang_descr'                    => 
lang('description'),
!                               'lang_edit'                             => 
lang('edit'),
!                               'lang_delete'                   => 
lang('delete'),
!                               'lang_sort_statustext'  => lang('sort the 
entries'),
!                               'sort_descr'                    => 
$this->nextmatchs->show_sort_order(array
!                                                                               
        (
!                                                                               
                'sort'  => $this->sort,
!                                                                               
                'var'   => 'cat_description',
!                                                                               
                'order' => $this->order,
!                                                                               
                'extra' => $link_data
!                                                                               
        ))
!                       );
  
!                       while (is_array($categories) && list(,$cat) = 
each($categories))
                        {
!                               $level          = $cat['level'];
!                               $cat_name       = 
$GLOBALS['phpgw']->strip_html($cat['name']);
  
+                               $main = 'yes';
                                if ($level > 0)
                                {
***************
*** 156,171 ****
                                        $spaceset = str_repeat($space,$level);
                                        $cat_name = $spaceset . $cat_name;
                                }
  
!                               $descr = 
$GLOBALS['phpgw']->strip_html($categories[$i]['descr']);
!                               if (!$descr) { $descr = '&nbsp;'; }
  
!                               if ($level == 0)
!                               {
!                                       $cat_name = '<font color="FF0000"><b>' 
. $cat_name . '</b></font>';
!                                       $descr = '<font color="FF0000"><b>' . 
$descr . '</b></font>';
!                               }
! 
!                               if ($GLOBALS['appname'] && 
$categories[$i]['app_name'] == 'phpgw')
                                {
                                        $appendix = '&nbsp;&lt;' . 
lang('Global') . '&gt;';
--- 144,153 ----
                                        $spaceset = str_repeat($space,$level);
                                        $cat_name = $spaceset . $cat_name;
+                                       $main = 'no';
                                }
  
!                               $descr = 
$GLOBALS['phpgw']->strip_html($cat['descr']);
  
!                               if ($GLOBALS['appname'] && $cat['app_name'] == 
'phpgw')
                                {
                                        $appendix = '&nbsp;&lt;' . 
lang('Global') . '&gt;';
***************
*** 176,195 ****
                                }
  
!                               $GLOBALS['phpgw']->template->set_var(array
!                               (
!                                       'name' => $cat_name . $appendix,
!                                       'descr' => $descr
!                               ));
! 
!                               $link_data['menuaction'] = 
'admin.uicategories.add';
!                               $link_data['parent'] = 
$categories[$i]['cat_id'];
!                               
$GLOBALS['phpgw']->template->set_var('add_sub',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                               
$GLOBALS['phpgw']->template->set_var('lang_sub_entry',lang('Add sub'));
  
!                               if ($GLOBALS['appname'] && 
$categories[$i]['app_name'] == $GLOBALS['appname'])
                                {
                                        $show_edit_del = True;
                                }
!                               elseif(!$GLOBALS['appname'] && 
$categories[$i]['app_name'] == 'phpgw')
                                {
                                        $show_edit_del = True;
--- 158,170 ----
                                }
  
!                               $link_data['menuaction'] = 
'admin.uicategories.edit';
!                               $link_data['parent'] = $cat['cat_id'];
!                               $add_sub_url = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
  
!                               if ($GLOBALS['appname'] && $cat['app_name'] == 
$GLOBALS['appname'])
                                {
                                        $show_edit_del = True;
                                }
!                               elseif(!$GLOBALS['appname'] && $cat['app_name'] 
== 'phpgw')
                                {
                                        $show_edit_del = True;
***************
*** 202,270 ****
                                if ($show_edit_del)
                                {
!                                       $link_data['cat_id'] = 
$categories[$i]['cat_id'];
!                                       $link_data['menuaction'] = 
'admin.uicategories.edit';
!                                       
$GLOBALS['phpgw']->template->set_var('edit',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                                       
$GLOBALS['phpgw']->template->set_var('lang_edit_entry',lang('Edit'));
! 
!                                       $link_data['menuaction'] = 
'admin.uicategories.delete';
!                                       
$GLOBALS['phpgw']->template->set_var('delete',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                                       
$GLOBALS['phpgw']->template->set_var('lang_delete_entry',lang('Delete'));
                                }
                                else
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('edit','');
!                                       
$GLOBALS['phpgw']->template->set_var('lang_edit_entry','&nbsp;');
!                                       
$GLOBALS['phpgw']->template->set_var('delete','');
!                                       
$GLOBALS['phpgw']->template->set_var('lang_delete_entry','&nbsp;');
                                }
!                               
$GLOBALS['phpgw']->template->fp('rows','cat_row',True);
                        }
  
!                       $link_data['menuaction'] = 'admin.uicategories.add';
                        $link_data['parent'] = '';
-                       
$GLOBALS['phpgw']->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
- 
-                       $this->save_sessiondata();
-                       
$GLOBALS['phpgw']->template->fp('phpgw_body','cat_list',True);
-               }
  
!               function add()
!               {
!                       $global_cats    = 
get_var('global_cats',array('POST','GET'));
!                       $parent                 = 
get_var('parent',array('GET'));
! 
!                       $link_data = array
                        (
!                               'menuaction'  => 'admin.uicategories.index',
!                               'appname'     => $GLOBALS['appname'],
!                               'global_cats' => $global_cats
                        );
  
!                       $GLOBALS['phpgw']->common->phpgw_header();
! 
!                       $this->set_langs();
  
!                       $values = get_var('values',array('POST'));
! 
!                       $GLOBALS['phpgw']->template->set_file(array('cat_form' 
=> 'category_form.tpl'));
!                       
$GLOBALS['phpgw']->template->set_block('cat_form','add');
!                       
$GLOBALS['phpgw']->template->set_block('cat_form','edit');
!                       
$GLOBALS['phpgw']->template->set_block('cat_form','form');
  
!                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
!                       if ($GLOBALS['appname'])
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Add global 
category for x',lang($GLOBALS['appname'])));
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Add global 
category'));
!                       }
  
!                       if (get_var('submit',array('POST')))
                        {
!                               if(is_array($values))
                                {
                                        $values['access'] = 'public';
                                }
--- 177,263 ----
                                if ($show_edit_del)
                                {
!                                       $link_data['cat_id']            = 
$cat['cat_id'];
!                                       $link_data['menuaction']        = 
'admin.uicategories.edit';
!                                       $edit_url                               
        = $GLOBALS['phpgw']->link('/index.php',$link_data);
!                                       $lang_edit                              
        = lang('edit');
! 
!                                       $link_data['menuaction']        = 
'admin.uicategories.delete';
!                                       $delete_url                             
        = $GLOBALS['phpgw']->link('/index.php',$link_data);
!                                       $lang_delete                            
= lang('delete');
                                }
                                else
                                {
!                                       $edit_url                               
        = '';
!                                       $lang_edit                              
        = '';
!                                       $delete_url                             
        = '';
!                                       $lang_delete                            
= '';
                                }
! 
!                               $content[] = array
!                               (
!                                       'name'                                  
        => $cat_name . $appendix,
!                                       'descr'                                 
        => $descr,
!                                       'date'                                  
        => $note['date'],
!                                       'main'                                  
        => $main,
!                                       'add_sub_url'                           
=> $add_sub_url,
!                                       'edit_url'                              
        => $edit_url,
!                                       'delete_url'                            
=> $delete_url,
!                                       'lang_add_sub_statustext'       => 
lang('add a subcategory'),
!                                       'lang_edit_statustext'          => 
lang('edit this category'),
!                                       'lang_delete_statustext'        => 
lang('delete this category'),
!                                       'lang_add_sub'                          
=> lang('add sub'),
!                                       'lang_edit'                             
        => $lang_edit,
!                                       'lang_delete'                           
=> $lang_delete
!                               );
                        }
  
!                       $link_data['menuaction'] = 'admin.uicategories.edit';
                        $link_data['parent'] = '';
  
!                       $cat_add[] = array
                        (
!                               'lang_add'                              => 
lang('add'),
!                               'lang_add_statustext'   => lang('add a 
category'),
!                               'add_url'                               => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'lang_done'                             => 
lang('done'),
!                               'lang_done_statustext'  => lang('return to 
admin mainscreen'),
!                               'done_url'                              => 
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.mainscreen')
                        );
  
!                       $link_data['menuaction'] = 'admin.uicategories.index';
  
!                       $data = array
!                       (
!                               'start_record'                                  
=> $this->start,
!                               'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
!                               'num_records'                                   
=> count($categoris),
!                               'all_records'                                   
=> $this->bo->cats->total_records,
!                               'nextmatchs_url'                                
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'nextmatchs_img_path'                   => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
!                               'select_url'                                    
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
!                               'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
!                               'query'                                         
        => $this->query,
!                               'lang_search'                                   
=> lang('search'),
!                               'cat_header'                                    
=> $cat_header,
!                               'cat_data'                                      
        => $content,
!                               'cat_add'                                       
        => $cat_add 
!                       );
  
!                       $this->save_sessiondata();
!                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_list' => $data));
!               }
  
!               function edit()
!               {
!                       $global_cats    = 
get_var('global_cats',array('POST','GET'));
!                       $parent                 = 
get_var('parent',array('GET'));
!                       $values                 = 
get_var('values',array('POST'));
  
!                       if ($values['save'])
                        {
!                               if (is_array($values))
                                {
+                                       $values['cat_id'] = $this->cat_id;
                                        $values['access'] = 'public';
                                }
***************
*** 273,359 ****
                                if (is_array($error))
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                                }
                                else
                                {
!                                       $this->bo->save_cat($values);
!                                       
$GLOBALS['phpgw']->template->set_var('message',lang('Category %1 has been added 
!', $values['name']));
                                }
                        }
  
!                       $link_data['menuaction'] = 'admin.uicategories.add';
!                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
! 
!                       if ($values['parent'])
                        {
!                               $parent = $values['parent'];
                        }
  
!                       
$GLOBALS['phpgw']->template->set_var('category_list',$this->bo->cats->formatted_list(array('format'
     => 'select',
!                                                                               
                                                                                
                                        'type'          => 'all',
!                                                                               
                                                                                
                                        'selected'      => $parent,
!                                                                               
                                                                                
                                        'globals'       => $global_cats)));
! 
!                       
$GLOBALS['phpgw']->template->set_var('cat_name',$values['name']);
!                       
$GLOBALS['phpgw']->template->set_var('cat_description',$values['descr']);
! 
!                       $GLOBALS['phpgw']->template->parse('buttons','add');
!                       $GLOBALS['phpgw']->template->fp('phpgw_body','form');
!               }
! 
!               function edit()
!               {
!                       $global_cats  = 
get_var('global_cats',array('POST','GET'));
! 
!                       $link_data = array
!                       (
!                               'menuaction'  => 'admin.uicategories.index',
!                               'appname'     => $GLOBALS['appname'],
!                               'global_cats' => $global_cats
!                       );
  
!                       if (!$this->cat_id)
                        {
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
! 
!                       $GLOBALS['phpgw']->common->phpgw_header();
! 
!                       $this->set_langs();
! 
!                       $values = get_var('values',array('POST'));
! 
!                       $GLOBALS['phpgw']->template->set_file(array('cat_form' 
=> 'category_form.tpl'));
!                       
$GLOBALS['phpgw']->template->set_block('cat_form','add');
!                       
$GLOBALS['phpgw']->template->set_block('cat_form','edit');
!                       
$GLOBALS['phpgw']->template->set_block('cat_form','form');
! 
!                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
! 
!                       if (get_var('submit',array('POST')))
                        {
!                               if (is_array($values))
!                               {
!                                       $values['cat_id'] = $this->cat_id;
!                                       $values['access'] = 'public';
!                               }
! 
!                               $error = $this->bo->check_values($values);
!                               if (is_array($error))
!                               {
!                                       
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
!                               }
!                               else
!                               {
!                                       $this->cat_id = 
$this->bo->save_cat($values);
!                                       
$GLOBALS['phpgw']->template->set_var('message',lang('Category %1 has been 
updated !',$values['name']));
!                               }
                        }
  
!                       $cats = $this->bo->cats->return_single($this->cat_id);
  
                        if ($GLOBALS['appname'])
                        {
!                               
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit global 
category for x',lang($GLOBALS['appname'])));
                        }
                        else
--- 266,306 ----
                                if (is_array($error))
                                {
!                                       $message = 
$GLOBALS['phpgw']->common->error_list($error);
                                }
                                else
                                {
!                                       $this->cat_id = 
$this->bo->save_cat($values);
!                                       $message = lang('Category %1 has been 
saved !',$values['name']);
                                }
                        }
  
!                       if (!$this->cat_id)
                        {
!                               $function = lang('add category');
!                               $action = 'add';
                        }
+                       else
+                       {
+                               $action = 'edit';
+                               $function = lang('edit category');
+                               $cats = 
$this->bo->cats->return_single($this->cat_id);
  
!                               $parent = $cats['parent'];
!                       }
  
!                       if ($GLOBALS['appname'])
                        {
!                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($GLOBALS['appname']) . '&nbsp;' . lang('global categories') . ': ' . 
$function;
                        }
!                       else
                        {
!                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('global categories') . ': ' . $function;
                        }
  
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_data','cats'));
  
                        if ($GLOBALS['appname'])
                        {
!                               
$GLOBALS['phpgw']->template->set_var('title_categories',lang('Edit global 
category for %1',lang($GLOBALS['appname'])));
                        }
                        else
***************
*** 362,382 ****
                        }
  
!                       $link_data['menuaction'] = 'admin.uicategories.edit';
!                       $link_data['cat_id']    = $this->cat_id;
!                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
!                       $link_data['menuaction'] = 'admin.uicategories.delete';
!                       
$GLOBALS['phpgw']->template->set_var('deleteurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
!                       
$GLOBALS['phpgw']->template->set_var('old_parent',$cats['parent']);
  
!                       
$GLOBALS['phpgw']->template->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cats['name']));
!                       
$GLOBALS['phpgw']->template->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats['descr']));
!                       
$GLOBALS['phpgw']->template->set_var('category_list',$this->bo->cats->formatted_list(array('format'
     => 'select',
!                                                                               
                                                                                
                                                'type'  => 'all',
!                                                                               
                                                                                
                                        'selected'      => $cats['parent'],
!                                                                               
                                                                                
                                        'globals'       => $global_cats)));
!                       $GLOBALS['phpgw']->template->parse('buttons','edit');
!                       $GLOBALS['phpgw']->template->fp('phpgw_body','form');
                }
  
--- 309,352 ----
                        }
  
!                       $link_data = array
!                       (
!                               'menuaction'  => 'admin.uicategories.index',
!                               'appname'     => $GLOBALS['appname'],
!                               'global_cats' => $global_cats
!                       );
  
!                       $data = array
!                       (
!                               'action'                                        
=> $action,
!                               'done_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'lang_name'                                     
=> lang('name'),
!                               'lang_descr'                            => 
lang('description'),
!                               'lang_parent'                           => 
lang('parent category'),
!                               'old_parent'                            => 
$cats['parent'],
!                               'lang_save'                                     
=> lang('save'),
!                               'lang_done'                                     
=> lang('done'),
!                               'lang_delete'                           => 
lang('delete'),
!                               'lang_reset'                            => 
lang('reset'),
!                               'value_name'                            => 
$GLOBALS['phpgw']->strip_html($cats['name']),
!                               'value_descr'                           => 
$GLOBALS['phpgw']->strip_html($cats['descr']),
!                               'message'                                       
=> $message,
!                               'lang_content_statustext'       => lang('Enter 
a description for the category'),
!                               'lang_done_statustext'          => lang('Back 
to the list'),
!                               'lang_save_statustext'          => lang('Save 
the category'),
!                               'lang_no_cat'                           => 
lang('no category'),
!                               'lang_cat_statustext'           => lang('Select 
the parent category. If this is a main category select NO CATEGORY'),
!                               'select_name'                           => 
'values[parent]',
!                               'cat_list'                                      
=> $this->bo->cats->formatted_xslt_list(array('format' => 'select','selected' 
=> $parent,'globals' => $global_cats))
!                       );
  
!                       $link_data['menuaction'] = 'admin.uicategories.edit';
!                       if ($this->cat_id)
!                       {
!                               $link_data['cat_id']    = $this->cat_id;
!                       }
!                       $data['edit_url'] = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
!                       $data['delete_url'] = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
  
!                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('cat_edit' => $data));
                }
  
***************
*** 385,388 ****
--- 355,367 ----
                        $global_cats  = 
get_var('global_cats',array('POST','GET'));
  
+                       if ($GLOBALS['appname'])
+                       {
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($GLOBALS['appname']) . '&nbsp;' . lang('global categories') . ': ' . 
lang('delete category');
+                       }
+                       else
+                       {
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('global categories') . ': ' . lang('delete category');
+                       }
+ 
                        $link_data = array
                        (
***************
*** 397,405 ****
                        }
  
!                       if ($GLOBALS['HTTP_POST_VARS']['confirm'])
                        {
!                               if ($GLOBALS['HTTP_POST_VARS']['subs'])
                                {
!                                       switch 
($GLOBALS['HTTP_POST_VARS']['subs'])
                                        {
                                                case 'move':
--- 376,384 ----
                        }
  
!                       if (get_var('confirm',array('POST')))
                        {
!                               if (get_var('subs',array('POST')))
                                {
!                                       switch (get_var('subs',array('POST')))
                                        {
                                                case 'move':
***************
*** 423,430 ****
                        }
  
!                       
$GLOBALS['phpgw']->template->set_file(array('category_delete' => 
'delete_cat.tpl'));
! 
!                       
$GLOBALS['phpgw']->template->set_var('error_msg',$error_msg);
!                       $nolink = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
  
                        if ($GLOBALS['appname'])
--- 402,406 ----
                        }
  
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_delete'));
  
                        if ($GLOBALS['appname'])
***************
*** 437,465 ****
                        }
  
!                       $apps_cats = $this->bo->exists(array
!                       (
!                               'type'     => $type,
!                               'cat_name' => '',
!                               'cat_id'   => $this->cat_id
!                       ));
  
-                       $GLOBALS['phpgw']->common->phpgw_header();
  
                        if ($apps_cats)
                        {
!                               
$GLOBALS['phpgw']->template->set_var('delete_msg',lang('This category is 
currently being used by applications as a parent category') . '<br>'
!                                                                               
                                                . lang('You will need to 
reassign these subcategories before you can delete this category'));
! 
!                               
$GLOBALS['phpgw']->template->set_var('lang_subs','');
!                               $GLOBALS['phpgw']->template->set_var('subs','');
!                               
$GLOBALS['phpgw']->template->set_var('nolink',$nolink);
!                               
$GLOBALS['phpgw']->template->set_var('deletehandle','');
!                               
$GLOBALS['phpgw']->template->set_var('donehandle','');
!                               
$GLOBALS['phpgw']->template->pfp('out','category_delete');
!                               
$GLOBALS['phpgw']->template->pfp('donehandle','done');
                        }
                        else
                        {
!                               
$GLOBALS['phpgw']->template->set_var('delete_msg',lang('Are you sure you want 
to delete this global category ?'));
  
                                $exists = $this->bo->exists(array
--- 413,429 ----
                        }
  
!                       $apps_cats = $this->bo->exists(array('type'             
=> $type,
!                                                                               
                'cat_name'      => '',
!                                                                               
                'cat_id'        => $this->cat_id));
  
  
                        if ($apps_cats)
                        {
!                               $lang_confirm_msg = lang('This category is 
currently being used by applications as a parent category. ')
!                                                                       . 
lang('You will need to reassign these subcategories before you can delete this 
category');
                        }
                        else
                        {
!                               $lang_confirm_msg = lang('Are you sure you want 
to delete this global category ?');
  
                                $exists = $this->bo->exists(array
***************
*** 472,490 ****
                                if ($exists)
                                {
!                                       $sub_select = '<input type="radio" 
name="subs" value="move">' . lang('Do you want to move all global subcategories 
one level down ?') . '<br>';
!                                       $sub_select .= '<input type="radio" 
name="subs" value="drop">' . lang('Do you want to delete all global 
subcategories ?');
!                                       
$GLOBALS['phpgw']->template->set_var('sub_select',$sub_select);
                                }
  
!                               
$GLOBALS['phpgw']->template->set_var('nolink',$nolink);
!                               
$GLOBALS['phpgw']->template->set_var('lang_no',lang('No'));
  
!                               $link_data['menuaction'] = 
'admin.uicategories.delete';
!                               $link_data['cat_id'] = $this->cat_id;
!                               
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                               
$GLOBALS['phpgw']->template->set_var('lang_yes',lang('Yes'));
  
!                               
$GLOBALS['phpgw']->template->fp('phpgw_body','category_delete');
!                       }
                }
        }
--- 436,464 ----
                                if ($exists)
                                {
!                                       $subs                                   
= 'yes';
!                                       $lang_sub_select_move   = lang('Do you 
want to move all global subcategories one level down ?');
!                                       $lang_sub_select_drop   = lang('Do you 
want to delete all global subcategories ?');
                                }
+                       }
  
!                       $data = array
!                       (
!                               'done_url'                              => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'lang_confirm_msg'              => 
$lang_confirm_msg,
!                               'lang_yes'                              => 
lang('yes'),
!                               'subs'                                  => 
$subs,
!                               'lang_sub_select_move'  => 
$lang_sub_select_move,
!                               'lang_sub_select_drop'  => 
$lang_sub_select_drop,
!                               'lang_yes_statustext'   => lang('Delete the 
entry'),
!                               'lang_no_statustext'    => lang('Back to the 
list'),
!                               'lang_no'                               => 
lang('no'),
!                               'lang_error_msg'                => $error_msg
!                       );
  
!                       $link_data['menuaction']        = 
'admin.uicategories.delete';
!                       $link_data['cat_id']            = $this->cat_id;
!                       $data['delete_url']                     = 
$GLOBALS['phpgw']->link('/index.php',$link_data);
  
!                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }

Index: class.uimainscreen.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uimainscreen.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.uimainscreen.inc.php  24 May 2002 10:38:02 -0000      1.6
--- class.uimainscreen.inc.php  23 Apr 2003 01:08:32 -0000      1.7
***************
*** 1,22 ****
  <?php
!   /**************************************************************************\
!   * phpGroupWare - administration                                            *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
  
        class uimainscreen
        {
!               var $public_functions = array('index' => True);
  
                function uimainscreen()
                {
                        $GLOBALS['phpgw']->nextmatchs = 
CreateObject('phpgwapi.nextmatchs');
                }
  
--- 1,35 ----
  <?php
!       
/**************************************************************************\
!       * phpGroupWare - Administration                                         
   *
!       * http://www.phpgroupware.org                                           
   *
!       * Written by coreteam <address@hidden>                    *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
!       /* $Id$ */
  
        class uimainscreen
        {
!               var $public_functions = array
!               (
!                       'index'                 => True,
!                       'mainscreen'    => True
!               );
  
                function uimainscreen()
                {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
                        $GLOBALS['phpgw']->nextmatchs = 
CreateObject('phpgwapi.nextmatchs');
+               }
+ 
+               function mainscreen()
+               {
+                       $GLOBALS['phpgw']->xslttpl->add_file('app_data');
+                       $GLOBALS['phpgw']->hooks->process('admin');
+ 
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => 
$GLOBALS['phpgw']->common->output));
                }
  

Index: class.uiserver.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uiserver.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.uiserver.inc.php      22 Apr 2003 20:22:06 -0000      1.6
--- class.uiserver.inc.php      23 Apr 2003 01:08:32 -0000      1.7
***************
*** 234,238 ****
                                else
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('message',lang('Server %1 has been 
added',$GLOBALS['HTTP_POST_VARS']['server_name']));
                                }
                        }
--- 234,238 ----
                                else
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('message',lang('Server x has been 
added',$GLOBALS['HTTP_POST_VARS']['server_name']));
                                }
                        }

Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/hook_admin.inc.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** hook_admin.inc.php  3 Nov 2002 01:03:04 -0000       1.28
--- hook_admin.inc.php  23 Apr 2003 01:08:32 -0000      1.29
***************
*** 73,76 ****
   
        /* Do not modify below this line */
!       display_section('admin',$file);
  ?>
--- 73,77 ----
   
        /* Do not modify below this line */
! 
!       $GLOBALS['phpgw']->common->display_mainscreen('admin',$file);
  ?>





reply via email to

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