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.7


From: nomail
Subject: [Phpgroupware-cvs] property/inc/custom/organize_drawing.php, 1.1.2.7
Date: Mon, 8 Nov 2004 14:57:50 +0100

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

date: 2004/11/08 13:57:50;  author: sigurdne;  state: Exp;  lines: +23 -7

Log Message:
no message
=====================================================================
Index: property/inc/custom/organize_drawing.php
diff -u property/inc/custom/organize_drawing.php:1.1.2.6 
property/inc/custom/organize_drawing.php:1.1.2.7
--- property/inc/custom/organize_drawing.php:1.1.2.6    Mon Nov  8 09:57:44 2004
+++ property/inc/custom/organize_drawing.php    Mon Nov  8 13:57:50 2004
@@ -7,9 +7,9 @@
                *  Data: function=organize_drawing,dir=C:/path/to/drawings
                */
 
-               var     $dir = 'C:/cygwin/var/www/phpw_files/Tegninger';
+               var     $dir = '/mnt/filer2/Tegninger';
                var     $suffix = 'dwg';
-               var $bypass = True; // bypass location check (only for 
debugging)
+               var $bypass = False; // bypass location check (only for 
debugging)
 
                function organize_drawing()
                {
@@ -185,12 +185,23 @@
                        'A' => 'arkitekt',
                        );
 
+                       $category=array(
+                       'plan' => 2,
+                       'snitt' => 3
+                       );
+
+                       $branch_id_array=array(
+                       'arkitekt' => 13
+                       );
+
+
+
                        $dir_handle = @opendir($this->dir);
 
 
 
                        $i=0; $myfilearray = '';
-                       while ($file = readdir($dir_handle))
+                       while ($file = @readdir($dir_handle))
                        {
                                if ((strtolower(substr($file, -3, 3)) == 
$this->suffix) && is_file($this->dir . SEP . $file) )
                                {
@@ -198,8 +209,8 @@
                                        $i++;
                                }
                        }
-                       closedir($dir_handle);
-                       sort($myfilearray);
+                       @closedir($dir_handle);
+                       @sort($myfilearray);
 
                        for ($i=0;$i<count($myfilearray);$i++)
                        {
@@ -225,7 +236,7 @@
 
                                $branch = 
$drawing_branch[substr($myfilearray[$i],-5,1)];
 
-                               if ($this->check_building($loc1,$loc2))
+                               if ($this->check_building($loc1,$loc2) && $type)
                                {
                                        $file_list[] = array
                                        (
@@ -237,6 +248,8 @@
                                                'nr'            => $nr,
                                                'etasje'        => $etasje,
                                                'branch'        => $branch,
+                                               'branch_id' => 
$branch_id_array[$branch],
+                                               'category_id'   => 
$category[$type],
                                                'location_code' => 
$location_code,
                                        );
                                }
@@ -298,6 +311,7 @@
                        $from_file = $this->dir . SEP . $values['file_name'];
                        $this->vfs->override_acl = 1;
 
+
 //_debug_array($to_file);
                        if($this->vfs->file_exists(array(
                                        'string' => $to_file,
@@ -328,11 +342,13 @@
                                                $values['title'] = 
$this->db->db_addslashes($values['branch'] . ', ' . $values['type'] . ' nr: ' . 
$values['nr']);
                                        }
 
+
+
                                        $insert_values= array(
                                                $values['file_name'],
                                                $values['title'],
                                                'public',
-                                               4,
+                                               $values['category_id'],
                                                time(),
                                                $values['values_date'],
                                                $values['version'],




reply via email to

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