phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: inv/inc class.boinvoice.inc.php,1.1,1.2 class.ui


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: inv/inc class.boinvoice.inc.php,1.1,1.2 class.uiinvoice.inc.php,1.2,1.3
Date: Mon, 15 Apr 2002 19:03:42 -0400

Update of /cvsroot/phpgroupware/inv/inc
In directory subversions:/tmp/cvs-serv26580/inc

Modified Files:
        class.boinvoice.inc.php class.uiinvoice.inc.php 
Log Message:
update

Index: class.boinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/inv/inc/class.boinvoice.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.boinvoice.inc.php     14 Apr 2002 22:27:31 -0000      1.1
--- class.boinvoice.inc.php     15 Apr 2002 23:03:39 -0000      1.2
***************
*** 148,157 ****
                function read_single_contact($abid)
                {
!                       $cols = array('n_given' => 'n_given',
!                                               'n_family' => 'n_family',
!                                               'org_name' => 'org_name');
  
!                       $entry = 
$this->contacts->read_single_entry($abid,$cols);
!                       return $entry;
                }
  
--- 148,171 ----
                function read_single_contact($abid)
                {
!                       $fields =  array('org_name' => 'org_name',
!                                                       'org_unit' => 
'org_unit',
!                                                       'n_given'  => 'n_given',
!                                                       'n_family' => 
'n_family',
!                                               'industry_type' => 
'industry_type',
!                                                       'software' => 
'software',
!                                                               'email' => 
'email',
!                                                       'tel_work' => 
'tel_work', 
!                                                       'tel_fax' => 'tel_fax',
!                                                       'tel_pager' => 
'tel_pager',
!                                                               'note' => 
'note',
!                                                               'url' => 'url',
!                                               'url_mirror' => 'url_mirror',
!                                                               'ftp' => 'ftp',
!                                               'ftp_mirror' => 'ftp_mirror',
!                                                       'access' => 'access',
!                                                       'cat_id' => 'cat_id'
!                       );
  
!                       return 
$this->contacts->read_single_entry($abid,$fields);
                }
  
***************
*** 180,183 ****
--- 194,253 ----
                        $this->total_records = $this->contacts->total_records;
                        return $entries;
+               }
+ 
+               function save_dist($values)
+               {
+                       $fields = array
+                       (
+                               'org_name'              => $values['company'],
+                               'org_unit'              => 
$values['department'],
+                               'n_given'               => $values['firstname'],
+                               'n_family'              => $values'[lastname'],
+                               'industry_type' => $values['industry_type'],
+                               'software'              => $values['software'],
+                               'email'                 => $values['email'],
+                               'tel_work'              => $values['wphone'],
+                               'tel_fax'               => $values['fax'],
+                               'tel_cell'              => $values['cell'],
+                               'note'                  => $values['notes']
+                       );
+ 
+                       if ($values['url'] != 'http://')
+                       {
+                               $fields['url'] = $values['url'];
+                       }
+ 
+                       if ($values['url_mirror'] != 'http://')
+                       {
+                               $fields['url_mirror'] = $values['url_mirror';
+                       }
+ 
+                       if ($values['ftp'] != 'ftp://')
+                       {
+                               $fields['ftp'] = $values['ftp'];
+                       }
+ 
+                       if ($values['ftp_mirror'] != 'ftp://')
+                       {
+                               $fields['ftp_mirror'] = $values['ftp_mirror'];
+                       }
+ 
+                       if ($values['access'])
+                       {
+                               $access = 'private';
+                       }
+                       else
+                       {
+                               $access = 'public';
+                       }
+ 
+                       if ($values['dist_id'] && $values['dist_id'] != 0)
+                       {
+                               
$this->contacts->update($values['dist_id'],$this->account,$fields,$access,$values['cat_id'],$tid='n');
+                       }
+                       else
+                       {
+                               
$this->contacts->add($this->account,$fields,$access,$values['cat_id'],$tid='n');
+                       }
                }
        }

Index: class.uiinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/inv/inc/class.uiinvoice.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uiinvoice.inc.php     14 Apr 2002 22:46:34 -0000      1.2
--- class.uiinvoice.inc.php     15 Apr 2002 23:03:39 -0000      1.3
***************
*** 123,126 ****
--- 123,144 ----
                        $this->t->set_var('lang_done',lang('Done'));
                        $this->t->set_var('lang_save',lang('Save'));
+                       $this->t->set_var('lang_company',lang('Company name'));
+                       $this->t->set_var('lang_department',lang('Department'));
+                       $this->t->set_var('lang_software',lang('Software'));
+                       $this->t->set_var('lang_url',lang('WWW'));
+                       $this->t->set_var('lang_url_mirror',lang('WWW mirror'));
+                       $this->t->set_var('lang_industry_type',lang('Industry 
type'));
+                       $this->t->set_var('lang_firstname',lang('Firstname'));
+                       $this->t->set_var('lang_lastname',lang('Lastname'));
+                       $this->t->set_var('lang_notes',lang('Notes'));
+                       $this->t->set_var('lang_cell',lang('Mobile phone'));
+                       $this->t->set_var('lang_ftp',lang('FTP'));
+                       $this->t->set_var('lang_ftp_mirror',lang('FTP mirror'));
+                       $this->t->set_var('lang_email',lang('Email'));
+                       $this->t->set_var('lang_phone',lang('Business phone'));
+                       $this->t->set_var('lang_fax',lang('Fax'));
+                       $this->t->set_var('lang_contact',lang('Contact'));
+                       $this->t->set_var('lang_access',lang('Private'));
+                       $this->t->set_var('lang_reset',lang('Clear Form'));
                }
  
***************
*** 419,422 ****
--- 437,528 ----
                        $this->t->pfp('out','distlist_list_t',True);
                        $this->save_sessiondata('inv_dist');
+               }
+ 
+               function edit_dist()
+               {
+                       $dist_id        = $GLOBALS['HTTP_POST_VARS']['dist_id'] 
? $GLOBALS['HTTP_POST_VARS']['dist_id'] : $GLOBALS['HTTP_GET_VARS']['dist_id'];
+                       $values         = $GLOBALS['HTTP_POST_VARS']['values'];
+ 
+                       if ($GLOBALS['HTTP_POST_VARS']['submit'])
+                       {
+                               $this->bo->save_dist($values);
+                               Header('Location: ' . 
$phpgw->link('/index.php','menuaction=inv.uiinvoice.list_dist&action=inv_dist'));
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+ 
+                       $this->t->set_file(array('form' => 'dist_form.tpl'));
+                       $this->t->set_block('form','add','addhandle');
+                       $this->t->set_block('form','edit','edithandle');
+ 
+                       
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=inv.uiinvoice.edit_dist&dist_id='
 . $dist_id));
+ 
+                       if ($dist_id)
+                       {
+                               $values = 
$this->bo->read_single_contact($dist_id);
+                               $this->t->set_var('lang_action',lang('Edit 
distributor'));
+                               $cat_id = $values[0]['cat_id'];
+                       }
+                       else
+                       {
+                               $this->t->set_var('lang_action',lang('Add 
distributor'));
+                               $cat_id = $this->cat_id;
+                       }
+ 
+                       $this->bo->cats->app_name = 'addressbook';
+                       
$this->t->set_var('cats_list',$this->bo->cats->formated_list('select','all',$cat_id,'True'));
+ 
+                       $this->t->set_var('dist_id',$dist_id);
+                       
$this->t->set_var('company',$GLOBALS['phpgw']->strip_html(($values[0]['org_name']));
+                       
$this->t->set_var('department',$GLOBALS['phpgw']->strip_html($values[0]['org_unit']));
+                       
$this->t->set_var('firstname',$GLOBALS['phpgw']->strip_html($values[0]['n_given']));
+                       
$this->t->set_var('lastname',$GLOBALS['phpgw']->strip_html($values[0]['n_family']));
+                       
$this->t->set_var('industry_type',$GLOBALS['phpgw']->strip_html($values[0]['industry_type']));
+                       
$this->t->set_var('software',$GLOBALS['phpgw']->strip_html($values[0]['software']));
+                       
$this->t->set_var('email',$GLOBALS['phpgw']->strip_html($values[0]['email']));
+                       
$this->t->set_var('wphone',$GLOBALS['phpgw']->strip_html($values[0]['tel_work']));
+                       
$this->t->set_var('fax',$GLOBALS['phpgw']->strip_html($values[0]['tel_fax']));
+                       
$this->t->set_var('cell',$GLOBALS['phpgw']->strip_html($values[0]['tel_cell']));
+ 
+                       if (! ereg('http://',$values[0]['url']))
+                       {
+                               $values[0]['url'] = 'http://'. $values['url'];
+                       }
+                       
$this->t->set_var('url',$GLOBALS['phpgw']->strip_html($values[0]['url']));
+ 
+                       if (! ereg('http://',$values[0]['url_mirror']))
+                       {
+                               $values[0]['url_mirror'] = 'http://'. 
$values[0]['url_mirror'];
+                       }
+                       
$this->t->set_var('url_mirror',$GLOBALS['phpgw']->strip_html($values[0]['url_mirror']));
+ 
+                       if (! ereg('ftp://',$values[0]['ftp']))
+                       {
+                               $values[0]['ftp'] = 'ftp://'. $values[0]['ftp'];
+                       }
+                       
$this->t->set_var('ftp',$GLOBALS['phpgw']->strip_html($values[0]['ftp']));
+ 
+                       if (! ereg('ftp://',$values[0]['ftp_mirror']))
+                       {
+                               $values[0]['ftp_mirror'] = 'ftp://'. 
$values[0]['ftp_mirror'];
+                       }
+                       
$this->t->set_var('ftp_mirror',$GLOBALS['phpgw']->strip_html($values[0]['ftp_mirror']));
+ 
+                       
$this->t->set_var('notes',$GLOBALS['phpgw']->strip_html(nl2br($values[0]['note'])));
+ 
+                       $this->t->set_var('access','<input type="checkbox" 
name="values[access]" value="True"' . ($values[0]['access'] == 'private'?' 
checked':'') . '>');
+ 
+                       $this->t->set_var('edithandle','');
+                       $this->t->set_var('addhandle','');
+ 
+                       $this->t->pfp('out','form');
+ 
+                       if ($dist_id)
+                       {
+                               $this->t->pfp('addhandle','add');
+                       }
+                       else
+                       {
+                               $this->t->pfp('edithandle','edit');
+                       }
                }
        }




reply via email to

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