phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc calendar.html,1.2,1.3 calendar.js,


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc calendar.html,1.2,1.3 calendar.js,1.2,1.3 class.boinvoice.inc.php,1.1,1.2 class.soinvoice.inc.php,1.1,1.2 class.soXport.inc.php,1.8,1.9 class.uiXport.inc.php,1.5,1.6
Date: Tue, 24 Dec 2002 18:22:32 -0500

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv5295/inc

Modified Files:
        class.boinvoice.inc.php class.soinvoice.inc.php 
        class.soXport.inc.php class.uiXport.inc.php 
Added Files:
        calendar.html calendar.js 
Log Message:
no message



Index: class.boinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boinvoice.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.boinvoice.inc.php     21 Dec 2002 12:49:09 -0000      1.1
--- class.boinvoice.inc.php     24 Dec 2002 23:22:29 -0000      1.2
***************
*** 69,77 ****
                {
  
!                       $GLOBALS['phpgw']->db->query("update idgenerator set 
value = value + 1 where name = 'Bilagsnummer'");
!                       $GLOBALS['phpgw']->db->query("select value from 
idgenerator where name = 'Bilagsnummer'");
!                       $GLOBALS['phpgw']->db->next_record();
!                       $bilagsnr = $GLOBALS['phpgw']->db->f('value');
!                       return $bilagsnr;
  
                }
--- 69,73 ----
                {
  
!                       return $this->so->increment_bilagsnr();
  
                }
***************
*** 79,88 ****
                function next_bilagsnr()
                {
! 
!                       $GLOBALS['phpgw']->db->query("select value from 
idgenerator where name = 'Bilagsnummer'");
!                       $GLOBALS['phpgw']->db->next_record();
!                       $bilagsnr = $GLOBALS['phpgw']->db->f('value')+1;
! 
!                       return $bilagsnr;
                }
  
--- 75,79 ----
                function next_bilagsnr()
                {
!                       return $this->so->next_bilagsnr();
                }
  
***************
*** 90,106 ****
                {
  
!                       $GLOBALS['phpgw']->db->query("select count(*) from 
phpgw_addressbook where id='$abid'");
!                       $GLOBALS['phpgw']->db->next_record();
!                       return $GLOBALS['phpgw']->db->f(0);
!               }
! 
!               function next_bilagsnr()
!               {
! 
!                       $GLOBALS['phpgw']->db->query("select value from 
idgenerator where name = 'Bilagsnummer'");
!                       $GLOBALS['phpgw']->db->next_record();
!                       $bilagsnr = $GLOBALS['phpgw']->db->f('value')+1;
! 
!                       return $bilagsnr;
                }
  
--- 81,85 ----
                {
  
!                       return $this->so->check_vendor($abid);
                }
  

Index: class.soinvoice.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soinvoice.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.soinvoice.inc.php     21 Dec 2002 12:49:09 -0000      1.1
--- class.soinvoice.inc.php     24 Dec 2002 23:22:29 -0000      1.2
***************
*** 40,45 ****
                {
  
!                       $this->db->query("update idgenerator set value = value 
+ 1 where name = 'Bilagsnummer'");
!                       $this->db->query("select value from idgenerator where 
name = 'Bilagsnummer'");
                        $this->db->next_record();
                        $bilagsnr = $this->db->f('value');
--- 40,45 ----
                {
  
!                       $this->db->query("update fm_idgenerator set value = 
value + 1 where name = 'Bilagsnummer'");
!                       $this->db->query("select value from fm_idgenerator 
where name = 'Bilagsnummer'");
                        $this->db->next_record();
                        $bilagsnr = $this->db->f('value');
***************
*** 51,55 ****
                {
  
!                       $this->db->query("select value from idgenerator where 
name = 'Bilagsnummer'");
                        $this->db->next_record();
                        $bilagsnr = $this->db->f('value')+1;
--- 51,55 ----
                {
  
!                       $this->db->query("select value from fm_idgenerator 
where name = 'Bilagsnummer'");
                        $this->db->next_record();
                        $bilagsnr = $this->db->f('value')+1;
***************
*** 64,77 ****
                        $this->db->next_record();
                        return $this->db->f(0);
-               }
- 
-               function next_bilagsnr()
-               {
- 
-                       $this->db->query("select value from idgenerator where 
name = 'Bilagsnummer'");
-                       $this->db->next_record();
-                       $bilagsnr = $this->db->f('value')+1;
- 
-                       return $bilagsnr;
                }
  
--- 64,67 ----

Index: class.soXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soXport.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.soXport.inc.php       21 Dec 2002 12:49:09 -0000      1.8
--- class.soXport.inc.php       24 Dec 2002 23:22:29 -0000      1.9
***************
*** 133,140 ****
                }
  
!               function check_spbudact_code($account_id)
                {
  
!                       $this->db->query("select count(*) from fm_wo_accounts 
where account_id='$account_id'");
                        $this->db->next_record();
                        return $this->db->f(0);
--- 133,140 ----
                }
  
!               function check_spbudact_code($id)
                {
  
!                       $this->db->query("select count(*) from fm_wo_accounts 
where id='$id'");
                        $this->db->next_record();
                        return $this->db->f(0);

Index: class.uiXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiXport.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.uiXport.inc.php       21 Dec 2002 12:49:09 -0000      1.5
--- class.uiXport.inc.php       24 Dec 2002 23:22:29 -0000      1.6
***************
*** 41,50 ****
                function import()
                {
                        $values         = get_var('values',array('POST'));
  
  //_debug_array($values);
!                       if ($values['cancel'] && $values['tsvfile'])
                        {
!                               unlink ($values['tsvfile']);
                        }
  
--- 41,59 ----
                function import()
                {
+                       global $tsvfile;
+ 
+ //echo $tsvfile;
                        $values         = get_var('values',array('POST'));
+                       $invoice_date = get_var('invoice_date',array('POST'));
+                       $payment_date = get_var('payment_date',array('POST'));
+ 
+                       $values[invoice_date] = $invoice_date;
+                       $values[payment_date] = $payment_date;
+ 
  
  //_debug_array($values);
!                       if ($values['cancel'] && $tsvfile)
                        {
!       //                      unlink ($tsvfile);
                        }
  
***************
*** 59,70 ****
                                }
  
!                               if (!$values['tsvfile'])
                                {
                                        $error[$errorcount++] = 
array('msg'=>lang('Please - select a file to import from !'));
                                }
  
!                               if ($values['tsvfile'] && 
!file_exists($values['tsvfile']))
                                {
!                                       $error[$errorcount++] = 
array('msg'=>lang('The file is already imported !'));
                                }
  
--- 68,79 ----
                                }
  
!                               if (!$tsvfile)
                                {
                                        $error[$errorcount++] = 
array('msg'=>lang('Please - select a file to import from !'));
                                }
  
!                               if ($tsvfile && !file_exists($tsvfile))
                                {
! //                                    $error[$errorcount++] = 
array('msg'=>lang('The file is already imported !'));
                                }
  
***************
*** 125,130 ****
                                if (!$error)
                                {
                                        $invoice_common=array(
!                       //                                      'bilagsnr'      
                        => $this->invoice->next_bilagsnr(),
                                                                'art'           
                        => $values['art'],
                                                                'type'          
                        => $values['type'],
--- 134,165 ----
                                if (!$error)
                                {
+ 
+ 
+                                       $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                                       $dateformat = 
str_replace(".","",$dateformat);
+                                       $dateformat = 
str_replace("-","",$dateformat);
+                                       $dateformat = 
str_replace("/","",$dateformat);
+                                       $y=strpos($dateformat,'y');
+                                       $d=strpos($dateformat,'d');
+                                       $m=strpos($dateformat,'m');
+ 
+                                       $dateparts = explode('/', 
$invoice_date);
+                                       $sday = $dateparts[$d];
+                                       $smonth = $dateparts[$m];
+                                       $syear = $dateparts[$y];
+ 
+                                       $dateparts = explode('/', 
$payment_date);
+                                       $eday = $dateparts[$d];
+                                       $emonth = $dateparts[$m];
+                                       $eyear = $dateparts[$y];
+ 
+                                       $debug_import_link =  $values;
+ 
+ //                                    $debug_import_link['invoice_date']      
=       $invoice_date;
+ //                                    $debug_import_link['payment_date']      
=       $payment_date;
+ //                                    $debug_import_link['download']  =       
'';
+ 
                                        $invoice_common=array(
!                                                               'bilagsnr'      
                        => $this->invoice->next_bilagsnr(),
                                                                'art'           
                        => $values['art'],
                                                                'type'          
                        => $values['type'],
***************
*** 137,163 ****
                                                                
'budget_responsible'    => $values['budget_responsible'],
                                                                'num_days'      
                        => $values['num_days'],
!                                                               'invoice_day'   
                => $values['sday'],
!                                                               'invoice_month' 
                => $values['smonth'],
!                                                               'invoice_year'  
                => $values['syear'],
!                                                               'payment_day'   
                => $values['eday'],
!                                                               'payment_month' 
                => $values['emonth'],
!                                                               'payment_year'  
                => $values['eyear']
                                                        );
  
!                                       $old = $values['tsvfile']; 
$values['tsvfile'] = 
$GLOBALS['phpgw_info']['server']['temp_dir'].'/info_log_import_'.basename($values['tsvfile']);
!                                       rename($old,$values['tsvfile']);
!       //                              $buffer = 
$this->bo->import($values['tsvfile'],$values['conv_type'],$values['private'],$values['fcat_id'],$invoice_common,$values['download']);
!                               }
  
-                               if (!$error && !$values['download'])
-                               {
                                        if(!$values['download'])
                                        {
!                                               unlink ($values['tsvfile']);
                                                $message = $buffer;
                                        }
                                        else
                                        {
!                                               $this->debug_import($buffer);
                                                return;
                                        }
--- 172,198 ----
                                                                
'budget_responsible'    => $values['budget_responsible'],
                                                                'num_days'      
                        => $values['num_days'],
!                                                               'invoice_day'   
                => $sday,
!                                                               'invoice_month' 
                => $smonth,
!                                                               'invoice_year'  
                => $syear,
!                                                               'payment_day'   
                => $eday,
!                                                               'payment_month' 
                => $emonth,
!                                                               'payment_year'  
                => $eyear
                                                        );
  
! _debug_array($debug_import_link);
! //                                    $old = $tsvfile;
! //                                    $tsvfile = 
$GLOBALS['phpgw_info']['server']['temp_dir'].'/invoice_import_'.basename($tsvfile);
! //echo $tsvfile;
! //                                    rename($old,$tsvfile);
!                                       $buffer = 
$this->bo->import($tsvfile,$values['conv_type'],$values['private'],$values['fcat_id'],$invoice_common,$values['download']);
  
                                        if(!$values['download'])
                                        {
! //                                            unlink ($tsvfile);
                                                $message = $buffer;
                                        }
                                        else
                                        {
!                                               
$this->debug_import($buffer,$debug_import_link);
                                                return;
                                        }
***************
*** 168,227 ****
                        set_time_limit(0);
  
- 
- 
-                       $sm = CreateObject($this->currentapp.'.sbox_xsl');
- 
-                       if (!$values['sdate'])
-                       {
-                               $values['smonth'] = date('m',time());
-                               $values['sday'] = date('d',time());
-                               $values['syear'] = date('Y',time());
-                       }
-                       else
-                       {
-                               $values['smonth'] = date('m',$values['sdate']);
-                               $values['sday'] = date('d',$values['sdate']);
-                               $values['syear'] = date('Y',$values['sdate']);
-                       }
- 
- //                    
$this->template->set_var('start_date_select',$GLOBALS['phpgw']->common->dateformatorder($sm->getYears('syear',$values['syear']),$sm->getMonthText('smonth',$values['smonth']),$sm->getDays('sday',$values['sday'])));
- 
//$start_date_select=$GLOBALS['phpgw']->common->dateformatorder($sm->getYears('syear',$values['syear']),$sm->getMonthText('smonth',$values['smonth']),$sm->getDays('sday',$values['sday']));
- 
- //echo $start_date_select;
- //_debug_array($sm->getMonthText('smonth',$values['smonth']));
- 
-                       $start_date_select= array(
-                               'syear'=> 
$sm->getYears('syear',$values['syear']),
-                               'smonth'=> 
$sm->getMonthText('smonth',$values['smonth']),
-                               'sday'=> $sm->getDays('sday',$values['sday'])
-                               );
- 
- 
-                       if (!$values['edate'])
-                       {
-                               $values['emonth'] = 0;
-                               $values['eday'] = 0;
-                               $values['eyear'] = 0;
-                       }
-                       else
-                       {
-                               $values['emonth'] = date('m',$values['edate']);
-                               $values['eday'] = date('d',$values['edate']);
-                               $values['eyear'] = date('Y',$values['edate']);
-                       }
- 
-                       $end_date_select= array(
-                               'syear'=> 
$sm->getYears('syear',$values['eyear']),
-                               'smonth'=> 
$sm->getMonthText('smonth',$values['emonth']),
-                               'sday'=> $sm->getDays('sday',$values['eday'])
-                               );
- 
- $dateformatorder      =       
$GLOBALS['phpgw']->common->dateformatorder('syear','smonth','sday');
- echo $dateformatorder;
- 
- 
- //_debug_array($end_date_select);
- //                    
$this->template->set_var('end_date_select',$GLOBALS['phpgw']->common->dateformatorder($sm->getYears('eyear',$values['eyear']),$sm->getMonthText('emonth',$values['emonth']),$sm->getDays('eday',$values['eday'])));
- 
                        $link_data = array
                        (
--- 203,206 ----
***************
*** 229,235 ****
--- 208,230 ----
                        );
  
+                       $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                       $sep = '/';
+                       $dlarr[strpos($dateformat,'y')] = 'yyyy';
+                       $dlarr[strpos($dateformat,'m')] = 'MM';
+                       $dlarr[strpos($dateformat,'d')] = 'DD';
+                       ksort($dlarr);
+ 
+                       $dateformat= (implode($sep,$dlarr));
+ 
                        $data = array
                        (
  
+ 
+                               'link_calendar_invoice_date'    => 
'setDateField(document.form.invoice_date);top.newWin=window.open('."'.".'/'.$this->currentapp.'/inc/calendar.html'."'".','."'".'cal'."'".','."'dependent=yes,width=210,height=230,screenX=200,screenY=300,titlebar=yes'".')',
+                               'link_calendar_payment_date'    => 
'setDateField(document.form.payment_date);top.newWin=window.open('."'.".'/'.$this->currentapp.'/inc/calendar.html'."'".','."'".'cal'."'".','."'dependent=yes,width=210,height=230,screenX=200,screenY=300,titlebar=yes'".')',
+                               'calendar_gif'                                  
=> './'.$this->currentapp.'/templates/default/images/calendar.gif',
+                               'calendar_source'                               
=> './'.$this->currentapp.'/inc/calendar.js',
+                               'dateformat'                                    
=> $dateformat,
+                               'lang_popup_calendar'                   => 
lang('Popup Calendar'),
                                'message'                                       
        => $message,
                                'error'                                         
        => $error,
***************
*** 249,258 ****
                                'value_debug'                                   
=> $values['download'],
  
!                               'lang_import'                                   
        => lang('Import'),
!                               'lang_import_statustext'                        
=> lang('Klick this button to start the import'),
  
                                'addressbook_link'                              
=> $GLOBALS['phpgw']->link('/property/addressbook.php','query='),
                                'lang_invoice_date'                             
=> lang('invoice date'),
!                               'lang_pay_day'                                  
=> lang('Payment date'),
                                'lang_no_of_days'                               
=> lang('Days'),
                                'lang_invoice_number'                   => 
lang('Invoice Number'),
--- 244,253 ----
                                'value_debug'                                   
=> $values['download'],
  
!                               'lang_import'                                   
=> lang('Import'),
!                               'lang_import_statustext'                => 
lang('Klick this button to start the import'),
  
                                'addressbook_link'                              
=> $GLOBALS['phpgw']->link('/property/addressbook.php','query='),
                                'lang_invoice_date'                             
=> lang('invoice date'),
!                               'lang_payment_date'                             
=> lang('Payment date'),
                                'lang_no_of_days'                               
=> lang('Days'),
                                'lang_invoice_number'                   => 
lang('Invoice Number'),
***************
*** 266,275 ****
  
                                'lang_vendor'                                   
=> lang('Vendor'),
!                               'lang_start_date'                               
=> lang('Start date'),
!                               'lang_end_date'                                 
=> lang('Date due'),
  
                                'value_belop'                                   
=> $values['belop'],
                                'value_abid'                                    
=> $values['abid'],
!                               'value_name'                                    
=> $values['name'],
                                'value_kid_nr'                                  
=> $values['kid_nr'],
                                'value_dim_b'                                   
=> $values['dim_b'],
--- 261,279 ----
  
                                'lang_vendor'                                   
=> lang('Vendor'),
!                               'addressbook_link'                              
=> $GLOBALS['phpgw']->link('/property/addressbook.php','query='),
! 
!                               'lang_invoice_date_statustext'  => lang('Enter 
the invoice date'),
!                               'lang_num_days_statustext'              => 
lang('Enter the payment date or the payment delay'),
!                               'lang_payment_date_statustext'  => lang('Enter 
the payment date or the payment delay'),
!                               'lang_file_statustext'                  => 
lang('Select the file to import from'),
!                               'lang_abid_statustext'                  => 
lang('Select the vendor by klicking the button'),
!                               'lang_vendor_name_statustext'   => lang('Select 
the vendor by klicking the button'),
! 
  
+                               'value_invoice_date'                    => 
$values['invoice_date'],
+                               'value_payment_date'                    => 
$values['payment_date'],
                                'value_belop'                                   
=> $values['belop'],
                                'value_abid'                                    
=> $values['abid'],
!                               'value_vendor_name'                             
=> $values['vendor_name'],
                                'value_kid_nr'                                  
=> $values['kid_nr'],
                                'value_dim_b'                                   
=> $values['dim_b'],
***************
*** 277,281 ****
--- 281,287 ----
                                'value_merknad'                                 
=> $values['merknad'],
                                'value_num_days'                                
=> $values['num_days'],
+                               'value_tsvfile'                                 
=> $tsvfile,
  
+                               'lang_file'                                     
        => lang('File'),
                                'lang_conv'                                     
        => lang('Conversion'),
                                'conv_list'                                     
        => $this->bo->select_conv($values['conv_type']),
***************
*** 331,337 ****
                }
  
!               function debug_import($buffer='')
                {
  
                        $table  = $buffer['table'];
                        $header = $buffer['header'];
--- 337,344 ----
                }
  
!               function debug_import($buffer='',$debug_import_link='')
                {
  
+ //_debug_array($buffer);
                        $table  = $buffer['table'];
                        $header = $buffer['header'];
***************
*** 344,347 ****
--- 351,363 ----
                                for ($k=0; $k<count($header); $k++)
                                {
+                               }
+                       }
+ 
+ 
+                       for ($i=1; $i<count($table)+1; $i++)
+                       {
+                               for ($k=0; $k<count($import); $k++)
+                               {
+                                       
$values[$i]['field_'.$k]=$table[$i][$import[$header[$k]]];
                                        if ($import[$header[$k]]=='belop')
                                        {
***************
*** 351,354 ****
--- 367,397 ----
                        }
  
+                       $import_values = array_values($import);
+ 
+                       for ($k=0; $k<count($header); $k++)
+                       {
+                               $table_header[$k]['header']=$header[$k];
+                               $table_key[$k]['key']=$import_values[$k];
+                       }
+ 
+ 
+                       $link_data_add = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiXport.import'
+                       );
+ 
+                       $link_data_add  =       $link_data_add  +       
$debug_import_link;
+ 
+ 
+                       $table_add[] = array
+                       (
+                               'lang_add'                              => 
lang('Import'),
+                               'lang_add_statustext'   => lang('Import this 
invoice'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',$link_data_add),
+                               'lang_cancel'                           => 
lang('cancel'),
+                               'lang_cancel_statustext'        => lang('Do not 
import this invoice'),
+                               'cancel_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiXport.import')
+ 
+                       );
  
                        $data = array
***************
*** 368,376 ****
                                'lang_budget_responsible'               => 
lang('Budget Reponsible'),
                                'budsjettansvarligid'                   => 
$table[1]['budsjettansvarligid'],
                                'sum'                                           
        => $sum,
!                               'header'                                        
        => $header,
!                               'table'                                         
        => $table
                        );
  
  //_debug_array($data);
  
--- 411,425 ----
                                'lang_budget_responsible'               => 
lang('Budget Reponsible'),
                                'budsjettansvarligid'                   => 
$table[1]['budsjettansvarligid'],
+                               'lang_sum'                                      
        => lang('Sum'),
                                'sum'                                           
        => $sum,
!                               'felt_1'                                        
                => 'belop',
!                               'table_header'                                  
=> $table_header,
!                               'table_key'                                     
        => $table_key,
!                               'values'                                        
        => $values,
!                               'table_add'                                     
        => $table_add
                        );
  
+                       unset($table);
+ _debug_array($table);
  //_debug_array($data);
  
***************
*** 382,386 ****
                function export()
                {
! //                    global 
$values['convert'],$values['tsvfile']name,$values['download'],$values['conv_type'],$roleback_file,$role_back_date;
  
                        if ($values['convert'])
--- 431,435 ----
                function export()
                {
! //                    global 
$values['convert'],$tsvfilename,$values['download'],$values['conv_type'],$roleback_file,$role_back_date;
  
                        if ($values['convert'])




reply via email to

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