phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc/custom/organize_drawing.php, 1.1.2.5


From: nomail
Subject: [Phpgroupware-cvs] property/inc/custom/organize_drawing.php, 1.1.2.5
Date: Sun, 7 Nov 2004 21:37:01 +0100

Update of /property/inc/custom
Modified Files:
        Branch: proposed-0_9_18-branch
          organize_drawing.php

date: 2004/11/07 20:37:01;  author: sigurdne;  state: Exp;  lines: +40 -8

Log Message:
no message
=====================================================================
Index: property/inc/custom/organize_drawing.php
diff -u property/inc/custom/organize_drawing.php:1.1.2.4 
property/inc/custom/organize_drawing.php:1.1.2.5
--- property/inc/custom/organize_drawing.php:1.1.2.4    Sun Nov  7 14:44:40 2004
+++ property/inc/custom/organize_drawing.php    Sun Nov  7 20:37:01 2004
@@ -2,6 +2,15 @@
 
        class organize_drawing
        {
+               /* In Admin->Property->Async servises:
+               *  Name: property.custom_functions.index
+               *  Data: function=organize_drawing,dir=C:/path/to/drawings
+               */
+
+               var     $dir = 'C:/cygwin/var/www/phpw_files/Tegninger';
+               var     $suffix = 'dwg';
+               var $bypass = True; // bypass location check (only for 
debugging)
+
                function organize_drawing()
                {
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
@@ -18,14 +27,30 @@
 
                        if($data['enabled']==1)
                        {
-                               $confirm        = True;
-                               $execute        = True;
-                               $cron           = True;
+                               $confirm                = True;
+                               $execute                = True;
+                               $cron                   = True;
+                               if($data['suffix'])
+                               {
+                                       $this->suffix = $data['suffix'];
+                               }
+                               if($data['dir'])
+                               {
+                                       $this->dir = $data['dir'];
+                               }
                        }
                        else
                        {
                                $confirm        = 
get_var('confirm',array('POST'));
                                $execute        = 
get_var('execute',array('GET'));
+                               if(get_var('dir',array('GET')))
+                               {
+                                       $this->dir = urldecode 
(get_var('dir',array('GET')));
+                               }
+                               if(get_var('suffix',array('GET')))
+                               {
+                                       $this->suffix = 
get_var('suffix',array('GET'));
+                               }
                        }
 
                        if(!$execute)
@@ -48,8 +73,10 @@
                        $link_data = array
                        (
                                'menuaction' => 
$this->currentapp.'.custom_functions.index',
-                               'function'      =>'organize_drawing',
-                               'execute'       =>$execute
+                               'function'      => 'organize_drawing',
+                               'execute'       => $execute,
+                               'dir'           => $this->dir,
+                               'suffix'        => $this->suffix,
                        );
 
                        if(!$done)
@@ -144,13 +171,14 @@
                        'A' => 'arkitekt',
                        );
 
-                       $this->dir = 'C:\cygwin\var\www\phpw_files\Tegninger';
                        $dir_handle = @opendir($this->dir);
 
+
+
                        $i=0; $myfilearray = '';
                        while ($file = readdir($dir_handle))
                        {
-                               if ((substr($file, 0, 1) != '.') && 
is_file($this->dir . SEP . $file) )
+                               if ((strtolower(substr($file, -3, 3)) == 
$this->suffix) && is_file($this->dir . SEP . $file) )
                                {
                                        $myfilearray[$i] = $file;
                                        $i++;
@@ -183,7 +211,7 @@
 
                                $branch = 
$drawing_branch[substr($myfilearray[$i],-5,1)];
 
-//                             if ($this->check_building($loc1,$loc2))
+                               if ($this->check_building($loc1,$loc2))
                                {
                                        $file_list[] = array
                                        (
@@ -214,7 +242,11 @@
                        {
                                return True;
                        }
+
+                       if($this->bypass)
+                       {
                                return True;
+                       }
 
                }
 




reply via email to

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