fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8424] property: move config values for invoices


From: Sigurd Nes
Subject: [Fmsystem-commits] [8424] property: move config values for invoices
Date: Fri, 23 Dec 2011 11:37:51 +0000

Revision: 8424
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8424
Author:   sigurdne
Date:     2011-12-23 11:37:50 +0000 (Fri, 23 Dec 2011)
Log Message:
-----------
property: move config values for invoices

Modified Paths:
--------------
    trunk/property/inc/class.uiinvoice.inc.php
    trunk/property/inc/cron/default/Import_fra_basware_X205.php
    trunk/property/inc/export/default/Agresso
    trunk/property/inc/export/default/Basware_X114
    trunk/property/setup/default_records.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/config.tpl

Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php  2011-12-23 11:36:00 UTC (rev 
8423)
+++ trunk/property/inc/class.uiinvoice.inc.php  2011-12-23 11:37:50 UTC (rev 
8424)
@@ -1642,9 +1642,10 @@
                                );
 
 
-                       $config         = 
CreateObject('phpgwapi.config','property');
-                       $config->read();
-                       $baseurl_invoice = 
isset($config->config_data['baseurl_invoice']) && 
$config->config_data['baseurl_invoice'] ? 
$config->config_data['baseurl_invoice'] : '';
+       //              $config         = 
CreateObject('phpgwapi.config','property');
+       //              $config->read();
+                       $custom_config  = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
+                       $baseurl_invoice = 
isset($custom_config->config_data['common']['baseurl_invoice']) && 
$custom_config->config_data['common']['baseurl_invoice'] ? 
$custom_config->config_data['common']['baseurl_invoice'] : '';
                        $lang_picture = lang('picture');
 
                        $j=0;

Modified: trunk/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
--- trunk/property/inc/cron/default/Import_fra_basware_X205.php 2011-12-23 
11:36:00 UTC (rev 8423)
+++ trunk/property/inc/cron/default/Import_fra_basware_X205.php 2011-12-23 
11:37:50 UTC (rev 8424)
@@ -61,8 +61,7 @@
                        $this->like                             = & 
$this->db->like;
                        $this->dateformat               = 
$this->db->date_format();
                        $this->datetimeformat   = $this->db->datetime_format();
-                       $this->config   = 
CreateObject('phpgwapi.config','property');
-                       $this->config->read();
+                       $this->config   = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
                }
 
                function pre_run($data = array())
@@ -145,7 +144,7 @@
                public function execute($cron='')
                {
                        $this->get_files();
-                       $dirname = $this->config->config_data['import_path'];
+                       $dirname = 
$this->config->config_data['import']['local_path'];
                        // prevent path traversal
                        if ( preg_match('/\./', $dirname) 
                         || !is_dir($dirname) )
@@ -222,11 +221,11 @@
 
                protected function get_files()
                {
-                       $server                         = 
$this->config->config_data['invoice_ftp_host'];
-                       $user                           = 
$this->config->config_data['invoice_ftp_user'];
-                       $password                       = 
$this->config->config_data['invoice_ftp_password'];
-                       $directory_remote       = 
rtrim($this->config->config_data['invoice_ftp_import_basedir'],'/');
-                       $directory_local        = 
rtrim($this->config->config_data['import_path'],'/');
+                       $server                         = 
$this->config->config_data['common']['host'];
+                       $user                           = 
$this->config->config_data['common']['user'];
+                       $password                       = 
$this->config->config_data['common']['password'];
+                       $directory_remote       = 
rtrim($this->config->config_data['common']['remote_basedir'],'/');
+                       $directory_local        = 
rtrim($this->config->config_data['import']['local_path'],'/');
                        $port                           = 22;
 
                        if (!function_exists("ssh2_connect"))

Modified: trunk/property/inc/export/default/Agresso
===================================================================
--- trunk/property/inc/export/default/Agresso   2011-12-23 11:36:00 UTC (rev 
8423)
+++ trunk/property/inc/export/default/Agresso   2011-12-23 11:37:50 UTC (rev 
8424)
@@ -43,12 +43,11 @@
                {
                        $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'property';
                        $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-       //              $this->db                       = $GLOBALS['phpgw']->db;
+       //              $this->db                               = 
$GLOBALS['phpgw']->db;
 
-                       $this->soXport = CreateObject('property.soXport');      
-                       $this->config = 
CreateObject('phpgwapi.config','property');
-                       $this->config->read_repository();
-                       $this->bocommon                 = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->soXport                  = 
CreateObject('property.soXport');     
+                       $this->config                   = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
+                       $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db               = $this->bocommon->new_db();    
                
                }
 
@@ -438,7 +437,7 @@
                
                        if($antall > 0)
                        {               
-                               $fil_katalog = 
$this->config->config_data['export_path'];                       
+                               $fil_katalog = 
$this->config->config_data['export']['path'];                    
                        
                                if(unlink ($fil_katalog. '/' . $Filnavn))
                                {
@@ -464,7 +463,7 @@
                {       
                        if($pre_transfer)
                        {
-                               $fil_katalog = 
$this->config->config_data['export_pre_path'];
+                               $fil_katalog = 
$this->config->config_data['export']['pre_path'];
                        
                                // Slett gamle filer
 
@@ -497,7 +496,7 @@
                        }
                        else
                        {
-                               $fil_katalog = 
$this->config->config_data['export_path'];
+                               $fil_katalog = 
$this->config->config_data['export']['path'];
                                $continue = True;
                                $i = 1;
                                do
@@ -893,7 +892,7 @@
                                        $file_written=True;
                                }
 
-                               if($file_written && 
$this->config->config_data['invoice_export_method']!='ftp'):
+                               if($file_written && 
$this->config->config_data['common']['method']!='ftp'):
                                {
                                        $transfer_ok = True;
                                }
@@ -925,7 +924,7 @@
                                        $file_written=True;
                                }
                                
-                               if($file_written && 
$this->config->config_data['invoice_export_method']!='ftp'):
+                               if($file_written && 
$this->config->config_data['common']['method']!='ftp'):
                                {
                                        $transfer_ok = True;
                                }
@@ -960,11 +959,11 @@
                function transfer($buffer,$Filnavn,$batchid,$tranfser_bilag)
                {                       
 
-                       
if($this->config->config_data['invoice_export_method']=='ftp')
+                       
if($this->config->config_data['common']['method']=='ftp')
                        {
                                $ftp    = $this->phpftp_connect();      
                                
-                               $basedir = 
$this->config->config_data['invoice_ftp_basedir'];
+                               $basedir = 
$this->config->config_data['common']['remote_basedir'];
                                if($basedir)
                                {
                                        $newfile = $basedir . '/' . 
basename($Filnavn);
@@ -1002,15 +1001,15 @@
 
                function phpftp_connect() 
                {
-                       $host = $this->config->config_data['invoice_ftp_host'];
-                       $user = $this->config->config_data['invoice_ftp_user'];
-                       $pass = 
$this->config->config_data['invoice_ftp_password'];
+                       $host                           = 
$this->config->config_data['common']['host'];
+                       $user                           = 
$this->config->config_data['common']['user'];
+                       $password                       = 
$this->config->config_data['common']['password'];
                        
 //                     echo "connecting to $host with $user and $pass\n <br>";
                        $ftp = ftp_connect($host);
                        if($ftp) 
                        {
-                               if (ftp_login($ftp,$user,$pass)) 
+                               if (ftp_login($ftp,$user,$password)) 
                                {
                                        return $ftp;
                                }

Modified: trunk/property/inc/export/default/Basware_X114
===================================================================
--- trunk/property/inc/export/default/Basware_X114      2011-12-23 11:36:00 UTC 
(rev 8423)
+++ trunk/property/inc/export/default/Basware_X114      2011-12-23 11:37:50 UTC 
(rev 8424)
@@ -50,22 +50,20 @@
                        $this->join                             = & 
$this->db->join;
 
                        $this->soXport                  = 
CreateObject('property.soXport');     
-                       $this->config                   = 
CreateObject('phpgwapi.config','property');
-                       $this->config->read_repository();
-                       $this->custom_config    = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
+                       $this->config                   = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
                        
-                       if(!isset($this->custom_config->config_data['export']))
+                       
if(!isset($this->config->config_data['common']['method']))
                        {
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'admin.uiconfig2.index', 'location_id' => 
$GLOBALS['phpgw']->locations->get_id('property', '.invoice')) );
                        }
                        
-                       if 
(isset($this->custom_config->config_data['export']['cleanup_old']) && 
$this->custom_config->config_data['export']['cleanup_old'])
+                       if 
(isset($this->config->config_data['export']['cleanup_old']) && 
$this->config->config_data['export']['cleanup_old'])
                        {
                                $this->cleanup_old();
                        }
 
-_debug_array($this->custom_config->config_data['export']);die();
-_debug_array($this->custom_config->config_data['export']['cleanup_old']);die();
                        
+_debug_array($this->config->config_data['export']);die();
+_debug_array($this->config->config_data['export']['cleanup_old']);die();       
                
                }
 
                protected function cleanup_old()
@@ -97,7 +95,7 @@
                
                protected function select_vouchers_to_transfer()
                {
-                       
if(isset($this->config->config_data['invoice_approval']) && 
$this->config->config_data['invoice_approval']== 1)
+                       
if(isset($this->config->config_data['common']['invoice_approval']) && 
$this->config->config_data['common']['invoice_approval']== 1)
                        {
                                $sql= 'SELECT DISTINCT bilagsnr from 
fm_ecobilag WHERE budsjettsigndato IS NOT NULL AND utbetalingsigndato IS NOT 
NULL ORDER BY bilagsnr asc';
                        }
@@ -414,7 +412,7 @@
 
                        if($this->connection)
                        {
-                               switch 
($this->config->config_data['invoice_export_method'])
+                               switch 
($this->config->config_data['common']['method'])
                                {
                                        case 'ftp';
                                                ftp_quit($this->connection);
@@ -486,7 +484,7 @@
                        $antall = count($voucher);
                        if($antall > 0)
                        {               
-                               $fil_katalog = 
$this->config->config_data['export_path'];                       
+                               $fil_katalog = 
$this->config->config_data['export']['path'];                    
                        
                                if($rollback_voucher)
                                {
@@ -518,7 +516,7 @@
                        {
                                $external_ref = mt_rand();
                        }
-                       $fil_katalog = 
$this->config->config_data['export_path'];
+                       $fil_katalog = 
$this->config->config_data['export']['path'];
                        $continue = True;
                        $Filnavn = $fil_katalog . 
"/x114_14_{$external_ref}.xml";
 
@@ -643,9 +641,9 @@
                        {
                                $periode = $oRsBilag[0]['periode'];
                        }
-                       else if 
(isset($this->custom_config->config_data['export']['dato_aarsavslutning']) && 
time() < $this->custom_config->config_data['export']['dato_aarsavslutning'])
+                       else if 
(isset($this->config->config_data['export']['dato_aarsavslutning']) && time() < 
$this->config->config_data['export']['dato_aarsavslutning'])
                        {               
-                               if(date('Y',time()) == date('Y', 
$this->custom_config->config_data['export']['dato_aarsavslutning']))
+                               if(date('Y',time()) == date('Y', 
$this->config->config_data['export']['dato_aarsavslutning']))
                                {
                                        $periode = date('Y',time()) - 1 . '12';
                                }
@@ -838,7 +836,7 @@
                                }
                        
                        // -- END
-                               if( $file_written && 
($this->config->config_data['invoice_export_method'] != 'ftp' && 
$this->config->config_data['invoice_export_method'] != 'ssh'))
+                               if( $file_written && 
($this->config->config_data['common']['method'] != 'ftp' && 
$this->config->config_data['common']['method'] != 'ssh'))
                                {
                                        $transfer_ok = true;
                                }
@@ -933,14 +931,14 @@
 
                protected function 
transfer($buffer,$Filnavn,$batchid,$tranfser_bilag)
                {                       
-                       
if($this->config->config_data['invoice_export_method']=='ftp' || 
$this->config->config_data['invoice_export_method']=='ssh')
+                       
if($this->config->config_data['common']['method']=='ftp' || 
$this->config->config_data['common']['method']=='ssh')
                        {
                                if(!$connection = $this->connection)
                                {
                                        $connection     = 
$this->phpftp_connect();
                                }
                                
-                               $basedir = 
$this->config->config_data['invoice_ftp_basedir'];
+                               $basedir = 
$this->config->config_data['common']['remote_basedir'];
                                if($basedir)
                                {
                                        $remote_file = $basedir . '/' . 
basename($Filnavn);
@@ -950,7 +948,7 @@
                                        $remote_file = basename($Filnavn);
                                }
 
-                               switch 
($this->config->config_data['invoice_export_method'])
+                               switch 
($this->config->config_data['common']['method'])
                                {
                                        case 'ftp';
                                                $transfer_ok = 
ftp_put($connection,$remote_file, $Filnavn, FTP_BINARY);
@@ -989,12 +987,12 @@
 
                protected function phpftp_connect() 
                {
-                       $server                         = 
$this->config->config_data['invoice_ftp_host'];
-                       $user                           = 
$this->config->config_data['invoice_ftp_user'];
-                       $password                       = 
$this->config->config_data['invoice_ftp_password'];
+                       $server                         = 
$this->config->config_data['common']['host'];
+                       $user                           = 
$this->config->config_data['common']['user'];
+                       $password                       = 
$this->config->config_data['common']['password'];
                        $port                           = 22;
                        
-                       switch 
($this->config->config_data['invoice_export_method'])
+                       switch ($this->config->config_data['common']['method'])
                        {
                                case 'ftp';
                                        if($connection = ftp_connect($server))

Modified: trunk/property/setup/default_records.inc.php
===================================================================
--- trunk/property/setup/default_records.inc.php        2011-12-23 11:36:00 UTC 
(rev 8423)
+++ trunk/property/setup/default_records.inc.php        2011-12-23 11:37:50 UTC 
(rev 8424)
@@ -726,3 +726,134 @@
 
 $solocation = createObject('property.solocation');
 $solocation->update_location();
+
+               $custom_config  = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
+
+               // common
+               $receipt_section_common = $custom_config->add_section(array
+                       (
+                               'name' => 'common',
+                               'descr' => 'common invoice config'
+                       )
+               );
+
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_common['section_id'],
+                               'input_type'    => 'text',
+                               'name'                  => 'host',
+                               'descr'                 => 'Host',
+                       )
+               );
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_common['section_id'],
+                               'input_type'    => 'text',
+                               'name'                  => 'user',
+                               'descr'                 => 'User',
+                       )
+               );
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_common['section_id'],
+                               'input_type'    => 'password',
+                               'name'                  => 'password',
+                               'descr'                 => 'Password',
+                       )
+               );
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_common['section_id'],
+                               'input_type'    => 'listbox',
+                               'name'                  => 'method',
+                               'descr'                 => 'Export / import 
method',
+                               'choice'                => 
array('local','ftp','ssh'),
+                       )
+               );
+
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_common['section_id'],
+                               'input_type'    => 'text',
+                               'name'                  => 'remote_basedir',
+                               'descr'                 => 'basedir on remote 
server',
+                       )
+               );
+
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_common['section_id'],
+                               'attrib_id'             => 
$receipt['attrib_id'],
+                               'input_type'    => 'listbox',
+                               'name'                  => 'invoice_approval',
+                               'descr'                 => 'Number of persons 
required to approve for payment',
+                               'choice'                => array(1,2),
+                       )
+               );
+
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_common['section_id'],
+                               'input_type'    => 'text',
+                               'name'                  => 'baseurl_invoice',
+                               'descr'                 => 'baseurl on remote 
server for image of invoice',
+                       )
+               );
+
+               // import:
+               $receipt_section_import = $custom_config->add_section(array
+                       (
+                               'name' => 'import',
+                               'descr' => 'import invoice config'
+                       )
+               );
+
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_import['section_id'],
+                               'input_type'    => 'text',
+                               'name'                  => 'local_path',
+                               'descr'                 => 'path on local sever 
to store imported files',
+                       )
+               );
+
+               //export
+               $receipt_section_export = $custom_config->add_section(array
+                       (
+                               'name' => 'export',
+                               'descr' => 'Invoice export'
+                       )
+               );
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_export['section_id'],
+                               'input_type'    => 'text',
+                               'name'                  => 'cleanup_old',
+                               'descr'                 => 'Overføre manuelt 
registrerte fakturaer rett til historikk'
+                       )
+               );
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_export['section_id'],
+                               'input_type'    => 'date',
+                               'name'                  => 
'dato_aarsavslutning',
+                               'descr'                 => "Dato for 
årsavslutning: overført pr. desember foregående år"
+                       )
+               );
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_export['section_id'],
+                               'input_type'    => 'text',
+                               'name'                  => 'path',
+                               'descr'                 => 'path on local sever 
to store exported files',
+                       )
+               );
+
+               $receipt = $custom_config->add_attrib(array
+                       (
+                               'section_id'    => 
$receipt_section_export['section_id'],
+                               'input_type'    => 'text',
+                               'name'                  => 'pre_path',
+                               'descr'                 => 'path on local sever 
to store exported files for pre approved vouchers',
+                       )
+               );

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2011-12-23 11:36:00 UTC (rev 8423)
+++ trunk/property/setup/setup.inc.php  2011-12-23 11:37:50 UTC (rev 8424)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.629';
+       $setup_info['property']['version']              = '0.9.17.630';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2011-12-23 11:36:00 UTC (rev 
8423)
+++ trunk/property/setup/tables_update.inc.php  2011-12-23 11:37:50 UTC (rev 
8424)
@@ -5580,12 +5580,15 @@
 
        /**
        * Update property version from 0.9.17.629 to 0.9.17.630
-       * Add invoice config as separate section
+       * Add convert invoice configuration to separate section
        */
        $test[] = '0.9.17.629';
        function property_upgrade0_9_17_629()
        {
-//             $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               $config         = CreateObject('phpgwapi.config','property');
+               $config->read();
+
                $custom_config  = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
 
                // common
@@ -5601,7 +5604,8 @@
                                'section_id'    => 
$receipt_section_common['section_id'],
                                'input_type'    => 'text',
                                'name'                  => 'host',
-                               'descr'                 => 'Host'
+                               'descr'                 => 'Host',
+                               'value'                 => 
$config->config_data['invoice_ftp_host'],
                        )
                );
                $receipt = $custom_config->add_attrib(array
@@ -5609,7 +5613,8 @@
                                'section_id'    => 
$receipt_section_common['section_id'],
                                'input_type'    => 'text',
                                'name'                  => 'user',
-                               'descr'                 => 'User'
+                               'descr'                 => 'User',
+                               'value'                 => 
$config->config_data['invoice_ftp_user'],
                        )
                );
                $receipt = $custom_config->add_attrib(array
@@ -5617,7 +5622,8 @@
                                'section_id'    => 
$receipt_section_common['section_id'],
                                'input_type'    => 'password',
                                'name'                  => 'password',
-                               'descr'                 => 'Password'
+                               'descr'                 => 'Password',
+                               'value'                 => 
$config->config_data['invoice_ftp_password'],
                        )
                );
                $receipt = $custom_config->add_attrib(array
@@ -5626,44 +5632,18 @@
                                'input_type'    => 'listbox',
                                'name'                  => 'method',
                                'descr'                 => 'Export / import 
method',
+                               'choice'                => 
array('local','ftp','ssh'),
+                               'value'                 => 
$config->config_data['invoice_export_method'],
                        )
                );
-               $receipt = $custom_config->edit_attrib(array
-                       (
-                               'section_id'    => 
$receipt_section_common['section_id'],
-                               'attrib_id'             => 
$receipt['attrib_id'],
-                               'input_type'    => 'listbox',
-                               'name'                  => 'method',
-                               'descr'                 => 'Export / import 
method',
-                               'new_choice'    => 'local'
-                       )
-               );
-               $receipt = $custom_config->edit_attrib(array
-                       (
-                               'section_id'    => 
$receipt_section_common['section_id'],
-                               'attrib_id'             => 
$receipt['attrib_id'],
-                               'input_type'    => 'listbox',
-                               'name'                  => 'method',
-                               'descr'                 => 'Export / import 
method',
-                               'new_choice'    => 'ftp'
-                       )
-               );
-               $receipt = $custom_config->edit_attrib(array
-                       (
-                               'section_id'    => 
$receipt_section_common['section_id'],
-                               'attrib_id'             => 
$receipt['attrib_id'],
-                               'input_type'    => 'listbox',
-                               'name'                  => 'method',
-                               'descr'                 => 'Export / import 
method',
-                               'new_choice'    => 'ssh'
-                       )
-               );
+
                $receipt = $custom_config->add_attrib(array
                        (
                                'section_id'    => 
$receipt_section_common['section_id'],
                                'input_type'    => 'text',
-                               'name'                  => 'basedir',
-                               'descr'                 => 'basedir on remote 
server'
+                               'name'                  => 'remote_basedir',
+                               'descr'                 => 'basedir on remote 
server',
+                               'value'                 => 
$config->config_data['invoice_ftp_basedir'],
                        )
                );
 
@@ -5674,32 +5654,21 @@
                                'input_type'    => 'listbox',
                                'name'                  => 'invoice_approval',
                                'descr'                 => 'Number of persons 
required to approve for payment',
+                               'choice'                => array(1,2),
+                               'value'                 => 
$config->config_data['invoice_approval'],
                        )
                );
 
-               $receipt = $custom_config->edit_attrib(array
+               $receipt = $custom_config->add_attrib(array
                        (
                                'section_id'    => 
$receipt_section_common['section_id'],
-                               'attrib_id'             => 
$receipt['attrib_id'],
-                               'input_type'    => 'listbox',
-                               'name'                  => 'invoice_approval',
-                               'descr'                 => 'Number of persons 
required to approve for payment',
-                               'new_choice'    => '1'
+                               'input_type'    => 'text',
+                               'name'                  => 'baseurl_invoice',
+                               'descr'                 => 'baseurl on remote 
server for image of invoice',
+                               'value'                 => 
$config->config_data['baseurl_invoice'],
                        )
                );
-               $receipt = $custom_config->edit_attrib(array
-                       (
-                               'section_id'    => 
$receipt_section_common['section_id'],
-                               'attrib_id'             => 
$receipt['attrib_id'],
-                               'input_type'    => 'listbox',
-                               'name'                  => 'invoice_approval',
-                               'descr'                 => 'Number of persons 
required to approve for payment',
-                               'new_choice'    => '2'
-                       )
-               );
 
-
-
                // import:
                $receipt_section_import = $custom_config->add_section(array
                        (
@@ -5712,8 +5681,9 @@
                        (
                                'section_id'    => 
$receipt_section_import['section_id'],
                                'input_type'    => 'text',
-                               'name'                  => 'path',
-                               'descr'                 => 'path on local sever 
to store imported files'
+                               'name'                  => 'local_path',
+                               'descr'                 => 'path on local sever 
to store imported files',
+                               'value'                 => 
$config->config_data['import_path'],
                        )
                );
 
@@ -5745,7 +5715,8 @@
                                'section_id'    => 
$receipt_section_export['section_id'],
                                'input_type'    => 'text',
                                'name'                  => 'path',
-                               'descr'                 => 'path on local sever 
to store exported files'
+                               'descr'                 => 'path on local sever 
to store exported files',
+                               'value'                 => 
$config->config_data['export_path'],
                        )
                );
 
@@ -5754,30 +5725,12 @@
                                'section_id'    => 
$receipt_section_export['section_id'],
                                'input_type'    => 'text',
                                'name'                  => 'pre_path',
-                               'descr'                 => 'path on local sever 
to store exported files for pre approved vouchers'
+                               'descr'                 => 'path on local sever 
to store exported files for pre approved vouchers',
+                               'value'                 => 
$config->config_data['export_pre_path'],                             
                        )
                );
 
-
-               $receipt = $custom_config->add_attrib(array
-                       (
-                               'section_id'    => 
$receipt_section_export['section_id'],
-                               'input_type'    => 'text',
-                               'name'                  => 'cleanup_old',
-                               'descr'                 => 'Overføre manuelt 
registrerte fakturaer rett til historikk'
-                       )
-               );
-               $receipt = $custom_config->add_attrib(array
-                       (
-                               'section_id'    => 
$receipt_section_export['section_id'],
-                               'input_type'    => 'date',
-                               'name'                  => 
'dato_aarsavslutning',
-                               'descr'                 => "Dato for 
årsavslutning: overført pr. desember foregående år"
-                       )
-               );
-
-
-       //      if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
                {
                        $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.630';
                        return $GLOBALS['setup_info']['property']['currentver'];

Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl    2011-12-23 11:36:00 UTC (rev 
8423)
+++ trunk/property/templates/base/config.tpl    2011-12-23 11:37:50 UTC (rev 
8424)
@@ -61,66 +61,6 @@
                                <textarea cols="40" rows="4" 
name="newsettings[sms_client_order_notice]" 
wrap="virtual">{value_sms_client_order_notice}</textarea>
                        </td>
                </tr>
-
-               <tr class="row_off">
-                       <td>{lang_needed_for_invoice_approval}:</td>
-                       <td>
-                               <select name="newsettings[invoice_approval]">
-                                       <option value="" 
{selected_invoice_approval_}>2</option>
-                                       <option value="1" 
{selected_invoice_approval_1}>1</option>
-                               </select>
-                       </td>
-               </tr>
-
-               <tr class="row_on">
-                       <td>{lang_Path_to_Invoice_import_files}:<br>
-                               {lang_On_windows_use}: "//computername/share" 
{lang_or} "\\\\computername\share"</td>
-                       <td><input name="newsettings[import_path]" 
value="{value_import_path}"></td>
-               </tr>
-               <tr class="row_on">
-                       <td>{lang_Path_to_Invoice_Export_files}: 
({lang_mandatory})<br>
-                               {lang_On_windows_use}: "//computername/share" 
{lang_or} "\\\\computername\share"</td>
-                       <td><input name="newsettings[export_path]" 
value="{value_export_path}"></td>
-               </tr>
-               <tr class="row_off">
-                       <td>{lang_Path_to_Invoice_Export_preregistering}: 
({lang_mandatory})<br>
-                               {lang_On_windows_use}: "//computername/share" 
{lang_or} "\\\\computername\share"</td>
-                       <td><input name="newsettings[export_pre_path]" 
value="{value_export_pre_path}"></td>
-               </tr>
-               <tr class="row_off">
-                       <td>{lang_baseurl_to_invoice_image}:</td>
-                       <td><input name="newsettings[baseurl_invoice]" 
value="{value_baseurl_invoice}"></td>
-               </tr>
-               <tr class="row_on">
-                       <td>{lang_invoice_export_method}:</td>
-                       <td>
-                               <select 
name="newsettings[invoice_export_method]">
-                                       <option value="local" 
{selected_invoice_export_method_local}>Local</option>
-                                       <option value="ftp" 
{selected_invoice_export_method_ftp}>Local and ftp</option>
-                                       <option value="ssh" 
{selected_invoice_export_method_ssh}>Local and ssh</option>
-                               </select>
-                       </td>
-               </tr>
-               <tr class="row_off">
-                       <td>{lang_invoice_ftp_host}:</td>
-                       <td><input name="newsettings[invoice_ftp_host]" 
value="{value_invoice_ftp_host}"></td>
-               </tr>
-               <tr class="row_on">
-                       <td>{lang_invoice_ftp_host_user}:</td>
-                       <td><input name="newsettings[invoice_ftp_user]" 
value="{value_invoice_ftp_user}"></td>
-               </tr>
-               <tr class="row_off">
-                       <td>{lang_invoice_ftp_host_password}:</td>
-                       <td><input type ="password" 
name="newsettings[invoice_ftp_password]" 
value="{value_invoice_ftp_password}"></td>
-               </tr>
-               <tr class="row_on">
-                       
<td>{lang_invoice_ftp_host_export_basedir_with_NO_trailing_slash}:</td>
-                       <td><input name="newsettings[invoice_ftp_basedir]" 
value="{value_invoice_ftp_basedir}"></td>
-               </tr>
-               <tr class="row_on">
-                       
<td>{lang_invoice_ftp_host_import_basedir_with_NO_trailing_slash}:</td>
-                       <td><input 
name="newsettings[invoice_ftp_import_basedir]" 
value="{value_invoice_ftp_import_basedir}"></td>
-               </tr>
        </tr>
        <tr class="row_off">
                <td>{lang_dimb_responsible_1}:</td>




reply via email to

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