fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6638] Property: fix link in dokument handling


From: Sigurd Nes
Subject: [Fmsystem-commits] [6638] Property: fix link in dokument handling
Date: Thu, 25 Nov 2010 09:54:41 +0000

Revision: 6638
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6638
Author:   sigurdne
Date:     2010-11-25 09:54:41 +0000 (Thu, 25 Nov 2010)
Log Message:
-----------
Property: fix link in dokument handling

Modified Paths:
--------------
    trunk/property/inc/class.uidocument.inc.php

Modified: trunk/property/inc/class.uidocument.inc.php
===================================================================
--- trunk/property/inc/class.uidocument.inc.php 2010-11-25 09:20:13 UTC (rev 
6637)
+++ trunk/property/inc/class.uidocument.inc.php 2010-11-25 09:54:41 UTC (rev 
6638)
@@ -1133,53 +1133,56 @@
 
                                if(!$receipt['error'])
                                {
-                                       $receipt = 
$this->bofiles->create_document_dir($document_dir);
-                                       if(isset($values['document_name_orig']) 
&& $values['document_name_orig'] && (!isset($values['document_name']) || 
!$values['document_name']))
+                                       
if(isset($_FILES['document_file']['tmp_name']) && 
$_FILES['document_file']['tmp_name'])
                                        {
-                                               $old_file       = 
$this->bo->get_file($document_id);
+                                               $receipt = 
$this->bofiles->create_document_dir($document_dir);
+                                               
if(isset($values['document_name_orig']) && $values['document_name_orig'] && 
(!isset($values['document_name']) || !$values['document_name']))
+                                               {
+                                                       $old_file       = 
$this->bo->get_file($document_id);
                                                
-                                               $to_file .= 
$values['document_name_orig'];
+                                                       $to_file .= 
$values['document_name_orig'];
                                                
-                                               if($old_file != $to_file)
+                                                       if($old_file != 
$to_file)
+                                                       {
+                                                               
$this->bofiles->vfs->override_acl = 1;
+                                                               
if(!$this->bofiles->vfs->mv (array (
+                                                                       'from'  
        => $old_file,
+                                                                       'to'    
        => $to_file,
+                                                                       
'relatives'     => array (RELATIVE_ALL, RELATIVE_ALL))))
+                                                               {
+                                                                       
$receipt['error'][]=array('msg'=>lang('Failed to move file !'));
+                                                               }
+                                                               
$this->bofiles->vfs->override_acl = 0;
+                                                       }
+                                               }
+                                       }
+
+                                       $values['document_id'] = $document_id;
+
+                                       if(!$receipt['error'])
+                                       {
+                                               if($values['document_name'] && 
!$values['link'])
                                                {
                                                        
$this->bofiles->vfs->override_acl = 1;
-                                                       
if(!$this->bofiles->vfs->mv (array (
-                                                               'from'          
=> $old_file,
+
+                                                       
if(!$this->bofiles->vfs->cp (array (
+                                                               'from'          
=> $_FILES['document_file']['tmp_name'],
                                                                'to'            
=> $to_file,
-                                                               'relatives'     
=> array (RELATIVE_ALL, RELATIVE_ALL))))
+                                                               'relatives'     
=> array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
                                                        {
-                                                               
$receipt['error'][]=array('msg'=>lang('Failed to move file !'));
+                                                               
$receipt['error'][]=array('msg'=>lang('Failed to upload file !'));
                                                        }
                                                        
$this->bofiles->vfs->override_acl = 0;
                                                }
                                        }
                                }
 
-                               $values['document_id'] = $document_id;
-
                                if(!$receipt['error'])
                                {
-                                       if($values['document_name'] && 
!$values['link'])
-                                       {
-                                               
$this->bofiles->vfs->override_acl = 1;
-
-                                               if(!$this->bofiles->vfs->cp 
(array (
-                                                       'from'          => 
$_FILES['document_file']['tmp_name'],
-                                                       'to'            => 
$to_file,
-                                                       'relatives'     => 
array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
-                                               {
-                                                       
$receipt['error'][]=array('msg'=>lang('Failed to upload file !'));
-                                               }
-                                               
$this->bofiles->vfs->override_acl = 0;
-                                       }
-
-                                       if(!$receipt['error'])
-                                       {
-                                               $receipt = 
$this->bo->save($values);
-       //                                      
$document_id=$receipt['document_id'];
-                                               
$GLOBALS['phpgw']->session->appsession('session_data','document_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'property.uidocument.list_doc', 'location_code'=> implode("-", 
$values['location']), 'entity_id'=> $this->entity_id, 'cat_id'=> $this->cat_id, 
'p_num'=> $values['extra']['p_num']));
-                                       }
+                                       $receipt = $this->bo->save($values);
+       //                              $document_id=$receipt['document_id'];
+                                       
$GLOBALS['phpgw']->session->appsession('session_data','document_receipt',$receipt);
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'property.uidocument.list_doc', 'location_code'=> implode("-", 
$values['location']), 'entity_id'=> $this->entity_id, 'cat_id'=> $this->cat_id, 
'p_num'=> $values['extra']['p_num']));
                                }
                                else
                                {




reply via email to

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