phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: backup/inc class.uibackup.inc.php,1.14,1.15


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: backup/inc class.uibackup.inc.php,1.14,1.15
Date: Sat, 26 Apr 2003 16:52:07 -0400

Update of /cvsroot/phpgroupware/backup/inc
In directory subversions:/tmp/cvs-serv6836/inc

Modified Files:
        class.uibackup.inc.php 
Log Message:
update

Index: class.uibackup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/backup/inc/class.uibackup.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.uibackup.inc.php      25 May 2002 00:01:18 -0000      1.14
--- class.uibackup.inc.php      26 Apr 2003 20:52:05 -0000      1.15
***************
*** 7,11 ****
        * Written by Bettina Gille address@hidden                   *
        * -----------------------------------------------                   *
!       * Copyright (C) 2001 Bettina Gille                                  *
        *                                                                   *
        * This program is free software; you can redistribute it and/or     *
--- 7,11 ----
        * Written by Bettina Gille address@hidden                   *
        * -----------------------------------------------                   *
!       * Copyright (C) 2001 - 2003 Bettina Gille                           *
        *                                                                   *
        * This program is free software; you can redistribute it and/or     *
***************
*** 35,39 ****
                function uibackup()
                {
-                       $this->t                = $GLOBALS['phpgw']->template;
                        $this->bobackup = CreateObject('backup.bobackup');
                }
--- 35,38 ----
***************
*** 41,94 ****
                function set_app_langs()
                {
!                       
$this->t->set_var('bg_color',$GLOBALS['phpgw_info']['theme']['th_bg']);
!                       
$this->t->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
!                       
$this->t->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
!                       $this->t->set_var('lang_b_create',lang('Create backups 
of your data ?'));
!                       $this->t->set_var('lang_b_intval',lang('Interval'));
!                       $this->t->set_var('lang_select_b_intval',lang('Select 
interval'));
!                       $this->t->set_var('lang_b_data',lang('Data'));
!                       $this->t->set_var('lang_b_sql',lang('SQL'));
!                       $this->t->set_var('lang_b_ldap',lang('LDAP'));
!                       $this->t->set_var('lang_b_email',lang('E-MAIL'));
!                       $this->t->set_var('lang_r_host',lang('Operating 
system'));
!                       $this->t->set_var('lang_r_config',lang('Configuration 
remote host'));
!                       $this->t->set_var('lang_r_save',lang('Save backup to a 
remote host ?'));
!                       $this->t->set_var('lang_config_path',lang('Absolute 
path of the directory to store the backup script'));
!                       $this->t->set_var('lang_path',lang('Absolute path of 
the backup directory'));
!                       $this->t->set_var('lang_r_ip',lang('IP or hostname'));
!                       $this->t->set_var('lang_user',lang('User'));
!                       $this->t->set_var('lang_pwd',lang('Password'));
!                       $this->t->set_var('lang_l_config',lang('Configuration 
localhost'));
!                       $this->t->set_var('lang_l_save',lang('Save backup 
locally ?'));
!                       $this->t->set_var('lang_l_websave',lang('Show backup 
archives in phpGroupWare ?'));
!                       $this->t->set_var('lang_b_config',lang('Configuration 
backup'));
!                       $this->t->set_var('lang_b_type',lang('Archive type'));
!                       $this->t->set_var('lang_select_b_type',lang('Select 
archive type'));
!                       $this->t->set_var('lang_app',lang('Transport 
application'));
!                       $this->t->set_var('lang_select_app',lang('Select 
transport application'));
!                       $this->t->set_var('lang_save',lang('Save'));
!                       $this->t->set_var('lang_versions',lang('Number of 
stored backup versions'));
                }
  
                function backup_admin()
                {
!                       global $values, $submit;
  
                        $link_data = array
                        (
!                               'menuaction'    => 
'backup.uibackup.backup_admin'
                        );
  
!                       if ($submit)
                        {
                                $error = $this->bobackup->check_values($values);
                                if (is_array($error))
                                {
!                                       
$this->t->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                                }
                                else
                                {
                                        $this->bobackup->save_items($values);
!                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/admin/index.php'));
                                }
                        }
--- 40,95 ----
                function set_app_langs()
                {
!                       
$GLOBALS['phpgw']->template->set_var('bg_color',$GLOBALS['phpgw_info']['theme']['th_bg']);
!                       
$GLOBALS['phpgw']->template->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
!                       
$GLOBALS['phpgw']->template->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
!                       
$GLOBALS['phpgw']->template->set_var('lang_b_create',lang('Create backups of 
your data ?'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_b_intval',lang('Interval'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_select_b_intval',lang('Select 
interval'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_b_data',lang('Data'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_b_sql',lang('SQL'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_b_ldap',lang('LDAP'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_b_email',lang('E-MAIL'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_r_host',lang('Operating system'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_r_config',lang('Configuration remote 
host'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_r_save',lang('Save backup to a 
remote host ?'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_config_path',lang('Absolute path of 
the directory to store the backup script'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_path',lang('Absolute path of the 
backup directory'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_r_ip',lang('IP or hostname'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_user',lang('User'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_pwd',lang('Password'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_l_config',lang('Configuration 
localhost'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_l_save',lang('Save backup locally 
?'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_l_websave',lang('Show backup 
archives in phpGroupWare ?'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_b_config',lang('Configuration 
backup'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_b_type',lang('Archive type'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_select_b_type',lang('Select archive 
type'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_app',lang('Transport application'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_select_app',lang('Select transport 
application'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_save',lang('Save'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('cancel'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_done',lang('done'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_versions',lang('Number of stored 
backup versions'));
                }
  
                function backup_admin()
                {
!                       $values = $_POST['values'];
  
                        $link_data = array
                        (
!                               'menuaction' => 'backup.uibackup.backup_admin'
                        );
  
!                       if ($values['save'])
                        {
                                $error = $this->bobackup->check_values($values);
                                if (is_array($error))
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
                                }
                                else
                                {
                                        $this->bobackup->save_items($values);
!                                       
$GLOBALS['phpgw']->template->set_var('message',lang('values have been saved'));
                                }
                        }
***************
*** 98,109 ****
                        $this->set_app_langs();
  
!                       $this->t->set_file(array('admin_form' => 
'admin_form.tpl'));
  
!                       
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
!                       $this->t->set_var('lang_action',lang('Backup 
administration'));
  
                        $values = $this->bobackup->get_config();
  
!                       $this->t->set_var('b_create','<input type="checkbox" 
name="values[b_create]" value="True"' . ($values['b_create'] == 'yes'?' 
checked':'') . '>');
  
                        switch($values['b_intval'])
--- 99,122 ----
                        $this->set_app_langs();
  
!                       
$GLOBALS['phpgw']->template->set_file(array('admin_form' => 'admin_form.tpl'));
  
!                       
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
! 
!                       
$GLOBALS['phpgw']->template->set_var('done_url',$GLOBALS['phpgw']->link('/admin/index.php'));
! 
!                       if ($values && !$error)
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('lang_done_cancel',lang('done'));
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('lang_done_cancel',lang('cancel'));
!                       }
! 
!                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('backup') . ': ' . lang('administration');
  
                        $values = $this->bobackup->get_config();
  
!                       $GLOBALS['phpgw']->template->set_var('b_create','<input 
type="checkbox" name="values[b_create]" value="True"' . ($values['b_create'] == 
'yes'?' checked':'') . '>');
  
                        switch($values['b_intval'])
***************
*** 118,122 ****
                                                . '<option value="monthly"' . 
$b_intval_sel[2] . '>' . lang('monthly') . '</option>' . "\n";
  
!                       $this->t->set_var('intval_list',$intval_list);
  
                        switch($values['b_type'])
--- 131,135 ----
                                                . '<option value="monthly"' . 
$b_intval_sel[2] . '>' . lang('monthly') . '</option>' . "\n";
  
!                       
$GLOBALS['phpgw']->template->set_var('intval_list',$intval_list);
  
                        switch($values['b_type'])
***************
*** 131,135 ****
                                                . '<option value="zip"' . 
$b_type_sel[2] . '>' . lang('zip') . '</option>' . "\n";
  
!                       $this->t->set_var('type_list',$type_list);
  
                        switch($values['r_app'])
--- 144,148 ----
                                                . '<option value="zip"' . 
$b_type_sel[2] . '>' . lang('zip') . '</option>' . "\n";
  
!                       
$GLOBALS['phpgw']->template->set_var('type_list',$type_list);
  
                        switch($values['r_app'])
***************
*** 144,148 ****
                                                . '<option value="smbmount"' . 
$r_type_sel[2] . '>' . lang('smbmount') . '</option>' . "\n";
  
!                       $this->t->set_var('r_app_list',$r_app_list);
  
                        if ($values['b_sql'] == 'mysql' || $values['b_sql'] == 
'pgsql')
--- 157,161 ----
                                                . '<option value="smbmount"' . 
$r_type_sel[2] . '>' . lang('smbmount') . '</option>' . "\n";
  
!                       
$GLOBALS['phpgw']->template->set_var('r_app_list',$r_app_list);
  
                        if ($values['b_sql'] == 'mysql' || $values['b_sql'] == 
'pgsql')
***************
*** 151,187 ****
                        }
  
!                       $this->t->set_var('b_sql','<input type="checkbox" 
name="values[b_sql]" value="True"' . ($values['b_sql'] == 'yes'?' checked':'') 
. '>');
!                       $this->t->set_var('b_ldap','<input type="checkbox" 
name="values[b_ldap]" value="True"' . ($values['b_ldap'] == 'yes'?' 
checked':'') . '>');
!                       $this->t->set_var('b_email','<input type="checkbox" 
name="values[b_email]" value="True"' . ($values['b_email'] == 'yes'?' 
checked':'') . '>');
! 
!                       $this->t->set_var('l_save','<input type="checkbox" 
name="values[l_save]" value="True"' . ($values['l_save'] == 'yes'?' 
checked':'') . '>');
!                       $this->t->set_var('l_websave','<input type="checkbox" 
name="values[l_websave]" value="True"' . ($values['l_websave'] == 'yes'?' 
checked':'') . '>');
!                       $this->t->set_var('r_save','<input type="checkbox" 
name="values[r_save]" value="True"' . ($values['r_save'] == 'yes'?' 
checked':'') . '>');
  
                        $r_host = '<input type="radio" name="values[r_host]" 
value="unix"' . ($values['r_host'] == 'unix'?' checked':'') . '>UNIX' . "\n";
                        $r_host .= '<input type="radio" name="values[r_host]" 
value="win"' . ($values['r_host'] == 'win'?' checked':'') . '>WIN';
  
!                       $this->t->set_var('r_host',$r_host);
!                       $this->t->set_var('r_path',$values['r_path']);
!                       $this->t->set_var('r_ip',$values['r_ip']);
!                       $this->t->set_var('r_user',$values['r_user']);
!                       $this->t->set_var('r_pwd',$values['r_pwd']);
! 
!                       $this->t->set_var('script_path',$values['script_path']);
!                       $this->t->set_var('l_path',$values['l_path']);
!                       $this->t->set_var('versions',$values['versions']);
! 
!                       $this->t->pfp('out','admin_form');
  
!                       $GLOBALS['phpgw']->common->phpgw_footer();
                }
  
                function web_backup()
                {
!                       global $delete, $archive;
! 
!                       if ($delete && $archive)
                        {
!                               $this->bobackup->drop_archive($archive);
                        }
  
--- 164,196 ----
                        }
  
!                       $GLOBALS['phpgw']->template->set_var('b_sql','<input 
type="checkbox" name="values[b_sql]" value="True"' . ($values['b_sql'] == 
'yes'?' checked':'') . '>');
!                       $GLOBALS['phpgw']->template->set_var('b_ldap','<input 
type="checkbox" name="values[b_ldap]" value="True"' . ($values['b_ldap'] == 
'yes'?' checked':'') . '>');
!                       $GLOBALS['phpgw']->template->set_var('b_email','<input 
type="checkbox" name="values[b_email]" value="True"' . ($values['b_email'] == 
'yes'?' checked':'') . '>');
! 
!                       $GLOBALS['phpgw']->template->set_var('l_save','<input 
type="checkbox" name="values[l_save]" value="True"' . ($values['l_save'] == 
'yes'?' checked':'') . '>');
!                       
$GLOBALS['phpgw']->template->set_var('l_websave','<input type="checkbox" 
name="values[l_websave]" value="True"' . ($values['l_websave'] == 'yes'?' 
checked':'') . '>');
!                       $GLOBALS['phpgw']->template->set_var('r_save','<input 
type="checkbox" name="values[r_save]" value="True"' . ($values['r_save'] == 
'yes'?' checked':'') . '>');
  
                        $r_host = '<input type="radio" name="values[r_host]" 
value="unix"' . ($values['r_host'] == 'unix'?' checked':'') . '>UNIX' . "\n";
                        $r_host .= '<input type="radio" name="values[r_host]" 
value="win"' . ($values['r_host'] == 'win'?' checked':'') . '>WIN';
  
!                       $GLOBALS['phpgw']->template->set_var('r_host',$r_host);
!                       
$GLOBALS['phpgw']->template->set_var('r_path',$values['r_path']);
!                       
$GLOBALS['phpgw']->template->set_var('r_ip',$values['r_ip']);
!                       
$GLOBALS['phpgw']->template->set_var('r_user',$values['r_user']);
!                       
$GLOBALS['phpgw']->template->set_var('r_pwd',$values['r_pwd']);
! 
!                       
$GLOBALS['phpgw']->template->set_var('script_path',$values['script_path']);
!                       
$GLOBALS['phpgw']->template->set_var('l_path',$values['l_path']);
!                       
$GLOBALS['phpgw']->template->set_var('versions',$values['versions']);
  
!                       $GLOBALS['phpgw']->template->pfp('out','admin_form');
                }
  
                function web_backup()
                {
!                       if ($_POST['delete'] && $_POST['archive'])
                        {
!                               
$this->bobackup->drop_archive($_POST['archive']);
                        }
  
***************
*** 197,204 ****
                        $this->set_app_langs();
  
!                       $this->t->set_file(array('archive_list_t' => 
'web_form.tpl'));
!                       
$this->t->set_block('archive_list_t','archive_list','list');
  
!                       $this->t->set_var('lang_action',lang('Backup'));
  
                        $config = $this->bobackup->get_config();
--- 206,213 ----
                        $this->set_app_langs();
  
!                       
$GLOBALS['phpgw']->template->set_file(array('archive_list_t' => 
'web_form.tpl'));
!                       
$GLOBALS['phpgw']->template->set_block('archive_list_t','archive_list','list');
  
!                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('backup') . ': ' . lang('list backup archives');
  
                        $config = $this->bobackup->get_config();
***************
*** 206,212 ****
                        if ($config['l_websave'] == 'yes')
                        {
-                               $this->nextmatchs = 
CreateObject('phpgwapi.nextmatchs');
- 
                                $archives = $this->bobackup->get_archives();
  
                                if ($archives)
--- 215,220 ----
                        if ($config['l_websave'] == 'yes')
                        {
                                $archives = $this->bobackup->get_archives();
+                               $this->nextmatchs = 
CreateObject('phpgwapi.nextmatchs');
  
                                if ($archives)
***************
*** 214,220 ****
                                        for ($i=0;$i<count($archives);$i++)
                                        {
!                                               
$this->nextmatchs->template_alternate_row_color(&$this->t);
  
!                                               $this->t->set_var(array
                                                (
                                                        'archive'       => 
'archives/' . $archives[$i],
--- 222,228 ----
                                        for ($i=0;$i<count($archives);$i++)
                                        {
!                                               
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
  
!                                               
$GLOBALS['phpgw']->template->set_var(array
                                                (
                                                        'archive'       => 
'archives/' . $archives[$i],
***************
*** 222,244 ****
                                                ));
  
!                                               
$this->t->set_var('delete',$GLOBALS['phpgw']->link('/index.php','menuaction=backup.uibackup.web_backup&delete=True&archive='
                                                                                
        . $archives[$i]));
!                                               
$this->t->set_var('lang_delete',lang('Delete'));
  
!                                               
$this->t->fp('list','archive_list',True);
                                        }
                                }
                                else
                                {
!                                       $this->t->set_var('noweb',lang('No 
backup archives available !'));
                                }
                        }
                        else
                        {
!                               $this->t->set_var('noweb',lang('The backup 
application is not configured for showing the archives in phpGroupWare yet !'));
                        }
  
!                       $this->t->pfp('out','archive_list_t',True);
!                       $GLOBALS['phpgw']->common->phpgw_footer();
                }
        }
--- 230,251 ----
                                                ));
  
!                                               
$GLOBALS['phpgw']->template->set_var('delete',$GLOBALS['phpgw']->link('/index.php','menuaction=backup.uibackup.web_backup&delete=True&archive='
                                                                                
        . $archives[$i]));
!                                               
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
  
!                                               
$GLOBALS['phpgw']->template->fp('list','archive_list',True);
                                        }
                                }
                                else
                                {
!                                       
$GLOBALS['phpgw']->template->set_var('noweb',lang('No backup archives available 
!'));
                                }
                        }
                        else
                        {
!                               
$GLOBALS['phpgw']->template->set_var('noweb',lang('The backup application is 
not configured for showing the archives in phpGroupWare yet !'));
                        }
  
!                       
$GLOBALS['phpgw']->template->pfp('out','archive_list_t',True);
                }
        }





reply via email to

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