fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15849]


From: nelson . guerra
Subject: [Fmsystem-commits] [15849]
Date: Tue, 18 Oct 2016 02:30:07 +0000 (UTC)

Revision: 15849
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15849
Author:   nelson224
Date:     2016-10-18 02:30:07 +0000 (Tue, 18 Oct 2016)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind-2/property/inc/class.uitts.inc.php

Modified: branches/dev-syncromind-2/property/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uitts.inc.php  2016-10-18 
02:29:55 UTC (rev 15848)
+++ branches/dev-syncromind-2/property/inc/class.uitts.inc.php  2016-10-18 
02:30:07 UTC (rev 15849)
@@ -57,7 +57,9 @@
                        'get_unspsc_code'=> true,
                        'receive_order' => true,
                        'check_purchase_right'=> true,
-                       'show_attachment'       => true
+                       'show_attachment'       => true,
+                       'handle_files' => true,
+                       'multi_upload' => true
                );
 
                /**
@@ -493,6 +495,66 @@
                        }
                }
 
+               public function handle_files()
+               {
+                       require_once PHPGW_SERVER_ROOT . 
"/property/inc/import/UploadHandler.php";
+                       //include_class('phpgwapi', 'UploadHandler', 
'js/jquery/file-upload/server/php/');
+                       
+                       $options['upload_dir'] = 
$GLOBALS['phpgw_info']['server']['temp_dir'];
+                       $options['script_url'] = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uitts.handle_files'));
+                       $upload_handler = new UploadHandler($options);
+                       
+                       die;
+               }
+               
+               public function addfiles()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = true;
+                       $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+
+                       $id = phpgw::get_var('id', 'int');
+                       $jasperfile = phpgw::get_var('jasperfile', 'bool');
+
+                       $fileuploader = CreateObject('property.fileuploader');
+
+
+                       if (!$this->acl_add && !$this->acl_edit)
+                       {
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
+                       if (!$id)
+                       {
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
+                       $test = false;//true;
+                       if ($test)
+                       {
+                               if (!empty($_FILES))
+                               {
+                                       $tempFile = 
$_FILES['Filedata']['tmp_name'];
+                                       $targetPath = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/";
+                                       $targetFile = str_replace('//', '/', 
$targetPath) . $_FILES['Filedata']['name'];
+                                       move_uploaded_file($tempFile, 
$targetFile);
+                                       echo 
str_replace($GLOBALS['phpgw_info']['server']['temp_dir'], '', $targetFile);
+                               }
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
+                       $values = $this->bo->read_single(array('entity_id' => 
$this->entity_id, 'cat_id' => $this->cat_id,
+                               'id' => $id));
+
+                       $loc1 = isset($values['location_data']['loc1']) && 
$values['location_data']['loc1'] ? $values['location_data']['loc1'] : 'dummy';
+                       if ($this->type_app[$this->type] == 'catch')
+                       {
+                               $loc1 = 'dummy';
+                       }
+
+                       
$fileuploader->upload("{$this->category_dir}/{$loc1}/{$id}");
+               }
+               
                function columns()
                {
                        $receipt = array();
@@ -1147,6 +1209,24 @@
                        self::render_template_xsl('datatable_jquery', $data);
                }
 
+               public function multi_upload()
+               {
+                       phpgwapi_jquery::init_multi_upload_file();
+                       
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = true;
+                       $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+                       
+                       $multi_upload_action = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uitts.handle_files'));
+
+                       $data = array
+                               (
+                               'multi_upload_action' => $multi_upload_action   
                                
+                       );
+       
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('files', 
'multi_upload_file'));
+                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('multi_upload' => $data));
+               }
+               
                function add()
                {
                        if (!$this->acl_add)




reply via email to

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