fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16259] more on integration


From: sigurdne
Subject: [Fmsystem-commits] [16259] more on integration
Date: Mon, 6 Feb 2017 11:25:06 -0500 (EST)

Revision: 16259
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16259
Author:   sigurdne
Date:     2017-02-06 11:25:05 -0500 (Mon, 06 Feb 2017)
Log Message:
-----------
more on integration

Modified Paths:
--------------
    trunk/property/inc/cron/default/Import_fra_agresso_X205_BK.php

Modified: trunk/property/inc/cron/default/Import_fra_agresso_X205_BK.php
===================================================================
--- trunk/property/inc/cron/default/Import_fra_agresso_X205_BK.php      
2017-02-06 16:15:02 UTC (rev 16258)
+++ trunk/property/inc/cron/default/Import_fra_agresso_X205_BK.php      
2017-02-06 16:25:05 UTC (rev 16259)
@@ -81,11 +81,6 @@
 
                public function execute()
                {
-                       if 
(isset($this->config->config_data['import']['check_archive']) && 
$this->config->config_data['import']['check_archive'])
-                       {
-                               $this->check_archive();
-                       }
-
                        $this->get_files();
                        $dirname = 
$this->config->config_data['import']['local_path'];
                        // prevent path traversal
@@ -162,59 +157,7 @@
                        $this->remind();
                }
 
-               protected function check_archive()
-               {
-                       $dirname = 
$this->config->config_data['import']['local_path'];
 
-                       if (preg_match('/\./', $dirname) || !is_dir($dirname))
-                       {
-                               return array();
-                       }
-
-                       $archive = "{$dirname}/archive";
-                       $file_list = array();
-                       $dir = new DirectoryIterator($archive);
-                       if (is_object($dir))
-                       {
-                               foreach ($dir as $file)
-                               {
-                                       if ($file->isDot() || !$file->isFile() 
|| !$file->isReadable() || strcasecmp(end(explode(".", $file->getPathname())), 
'xml') != 0)
-                                       {
-                                               continue;
-                                       }
-
-                                       $file_list[] = (string)$file;
-                               }
-                       }
-
-                       foreach ($file_list as $file)
-                       {
-                               $file_parts = explode('_', basename($file, 
'.xml'));
-                               $external_voucher_id = $file_parts[2];
-
-                               $duplicate = false;
-                               $sql = "SELECT bilagsnr FROM fm_ecobilag WHERE 
external_voucher_id = '{$external_voucher_id}'";
-                               $this->db->query($sql, __LINE__, __FILE__);
-                               if ($this->db->next_record())
-                               {
-                                       $duplicate = true;
-                               }
-
-                               $sql = "SELECT bilagsnr FROM fm_ecobilagoverf 
WHERE external_voucher_id = '{$external_voucher_id}'";
-                               $this->db->query($sql, __LINE__, __FILE__);
-                               if ($this->db->next_record())
-                               {
-                                       $duplicate = true;
-                               }
-
-                               if (!$duplicate)
-                               {
-                                       rename("{$archive}/{$file}", 
"{$dirname}/{$file}");
-                                       $this->receipt['message'][] = 
array('msg' => "fil tilbakeført fra arkiv til importkø: 
{$external_voucher_id}");
-                               }
-                       }
-               }
-
                protected function remind()
                {
                        if 
(!isset($GLOBALS['phpgw_info']['server']['smtp_server']) || 
!$GLOBALS['phpgw_info']['server']['smtp_server'])




reply via email to

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