fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14620] clean up from yui


From: Sigurd Nes
Subject: [Fmsystem-commits] [14620] clean up from yui
Date: Tue, 05 Jan 2016 08:28:45 +0000

Revision: 14620
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14620
Author:   sigurdne
Date:     2016-01-05 08:28:44 +0000 (Tue, 05 Jan 2016)
Log Message:
-----------
clean up from yui

Modified Paths:
--------------
    branches/dev-syncromind/bim/inc/class.uibim.inc.php
    branches/dev-syncromind/bim/inc/class.uibimitem.inc.php
    branches/dev-syncromind/bim/inc/class.uiitem.inc.php
    branches/dev-syncromind/bim/templates/base/bim_upload_ifc.xsl

Removed Paths:
-------------
    branches/dev-syncromind/bim/js/yahoo/
    branches/dev-syncromind/bim/templates/base/bim_showitems.xsl
    branches/dev-syncromind/bim/templates/base/bim_showmodels.xsl

Modified: branches/dev-syncromind/bim/inc/class.uibim.inc.php
===================================================================
--- branches/dev-syncromind/bim/inc/class.uibim.inc.php 2016-01-04 14:13:00 UTC 
(rev 14619)
+++ branches/dev-syncromind/bim/inc/class.uibim.inc.php 2016-01-05 08:28:44 UTC 
(rev 14620)
@@ -1,352 +1,538 @@
 <?php
-phpgw::import_class('bim.soitem');
-phpgw::import_class('bim.sobim');
-phpgw::import_class('bim.sovfs');
-phpgw::import_class('bim.sobimmodel');
-phpgw::import_class('bim.sobim_converter');
-phpgw::import_class('bim.soitem_group');
-phpgw::import_class('bim.bobimmodel');
-phpgw::import_class('bim.bobimitem');
-phpgw::import_class('bim.sobimitem');
-phpgw::import_class('bim.sobimtype');
-phpgw::import_class('bim.sobimmodelinformation');
-/*
- * This class serves as the 'Controller' or 'Container' in a dependancy 
injection context
- */
-interface uibim {
+       phpgw::import_class('bim.soitem');
+       phpgw::import_class('bim.sobim');
+       phpgw::import_class('bim.sovfs');
+       phpgw::import_class('bim.sobimmodel');
+       phpgw::import_class('bim.sobim_converter');
+       phpgw::import_class('bim.soitem_group');
+       phpgw::import_class('bim.bobimmodel');
+       phpgw::import_class('bim.bobimitem');
+       phpgw::import_class('bim.sobimitem');
+       phpgw::import_class('bim.sobimtype');
+       phpgw::import_class('bim.sobimmodelinformation');
+       /*
+        * This class serves as the 'Controller' or 'Container' in a dependancy 
injection context
+        */
 
-}
-class bim_uibim implements uibim {
-       public static $virtualFileSystemPath = "ifc";
-       private $db;
-       /* @var $bocommon property_bocommon */
-       private $bocommon;
-       private $bimconverterUrl = "http://localhost:8080/bimconverter/rest/";;
+       interface uibim
+       {
+               
+       }
+       phpgw::import_class('phpgwapi.uicommon_jquery');
 
-       public function __construct() {
-               $this->bocommon = CreateObject('property.bocommon');
+       class bim_uibim extends phpgwapi_uicommon_jquery
+       {
 
-               $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
-               $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'bim::item::index';
-               $this->db = & $GLOBALS['phpgw']->db;
-       }
+               public static $virtualFileSystemPath = "ifc";
+               private $db;
+               /* @var $bocommon property_bocommon */
+               private $bocommon;
+               private $bimconverterUrl                         = 
"http://localhost:8080/bimconverter/rest/";;
 
-       public $public_functions = array
-       (
-        'index' => true,
-       'foo' => true,
-       'showModels' => true,
-       'getModelsJson' => true,
-       'removeModelJson' => true,
-       'getFacilityManagementXmlByModelId' => true,
-       'upload' => true,
-       'uploadFile' => true,
-        'displayModelInformation' => true
-       );
-       private function setupBimCss() {
-               if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) ) {
-                       $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
+               public function __construct()
+               {
+                       parent::__construct();
+                       $this->acl                       = & 
$GLOBALS['phpgw']->acl;
+                       $this->acl_location      = 'admin';
+                       $this->acl_read          = 
$this->acl->check($this->acl_location, PHPGW_ACL_READ, 'bim');
+                       $this->acl_add           = 
$this->acl->check($this->acl_location, PHPGW_ACL_ADD, 'bim');
+                       $this->acl_edit          = 
$this->acl->check($this->acl_location, PHPGW_ACL_EDIT, 'bim');
+                       $this->acl_delete        = 
$this->acl->check($this->acl_location, PHPGW_ACL_DELETE, 'bim');
+                       $this->acl_manage        = 
$this->acl->check($this->acl_location, PHPGW_ACL_PRIVATE, 'bim'); // manage
+
+                       $this->bocommon = CreateObject('property.bocommon');
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection']       
 = 'bim::item::index';
+                       $this->db                                               
                                         = & $GLOBALS['phpgw']->db;
                }
-               
$GLOBALS['phpgw']->css->add_external_file('bim/templates/base/css/bim.css');
-       }
-       public function getModelsJson() {
-               $GLOBALS['phpgw_info']['flags']['noheader'] = true;
-               $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
-               $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-               header("Content-type: application/json");
-               $bobimmodel = new bobimmodel_impl();
-               $sobimmodel = new sobimmodel_impl($this->db);
-               $bobimmodel->setSobimmodel($sobimmodel);
-               $output = $bobimmodel->createBimModelList();
+
+               public $public_functions = array
+                       (
+                       'index'                                                 
         => true,
+                       'foo'                                                   
         => true,
+                       'showModels'                                            
 => true,
+                       'getModelsJson'                                         
 => true,
+                       'removeModelJson'                                       
 => true,
+                       'getFacilityManagementXmlByModelId'      => true,
+                       'upload'                                                
         => true,
+                       'uploadFile'                                            
 => true,
+                       'displayModelInformation'                        => true
+               );
+
+               private function setupBimCss()
+               {
+                       if(!isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css))
+                       {
+                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
+                       }
+                       
$GLOBALS['phpgw']->css->add_external_file('bim/templates/base/css/bim.css');
+               }
+
+               public function getModelsJson()
+               {
+                       $GLOBALS['phpgw_info']['flags']['noheader']      = true;
+                       $GLOBALS['phpgw_info']['flags']['nofooter']      = true;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app']      = 
false;
+                       header("Content-type: application/json");
+                       $bobimmodel                                             
                         = new bobimmodel_impl();
+                       $sobimmodel                                             
                         = new sobimmodel_impl($this->db);
+                       $bobimmodel->setSobimmodel($sobimmodel);
+                       $output                                                 
                         = $bobimmodel->createBimModelList();
 //             return $output;
-               echo json_encode($output);
-       }
-       /*
-        *
-        */
-       public function removeModelJson($modelId = null) {
-               $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-               header("Content-type: application/json");
-               $output = array();
-               $output["result"] = 1;
-               if($modelId == null) {
-                       $modelId = (int) phpgw::get_var("modelId");
-               }
-                       
-               $bobimmodel = new bobimmodel_impl();
-               $sovfs = new sovfs_impl();
-               $sovfs->setSubModule(self::$virtualFileSystemPath);
-               $bobimmodel->setVfsObject($sovfs);
-               $sobimmodel = new sobimmodel_impl($this->db);
-               $sobimmodel->setModelId($modelId);
-               $bobimmodel->setSobimmodel($sobimmodel);
-               try {
-                       $bobimmodel->removeIfcModelByModelId();
                        echo json_encode($output);
-               } catch (InvalidArgumentException $e) {
-                       $output["result"] = 0;
-                       $output["error"] = "Invalid arguments";
-                       $output["exception"] = $e;
-                       echo json_encode($output);
-               } catch (ModelDoesNotExistException $e) {
-                       $output["result"] = 0;
-                       $output["error"] = "Model does not exist!";
-                       $output["exception"] = $e;
-                       echo json_encode($output);
-               } catch (Exception $e) {
-                       $output["result"] = 0;
-                       $output["error"] = "General error";
-                       $output["exception"] = $e;
-                       echo json_encode($output);
                }
-       }
 
-       public function getFacilityManagementXmlByModelId($modelId = null) {
-               $GLOBALS['phpgw_info']['flags']['noheader'] = true;
-               $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
-               $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-               header("Content-type: application/xml");
-               $restUrl = $this->bimconverterUrl;
-               if($modelId == null) {
-                       $modelId = (int) phpgw::get_var("modelId");
-               }
-               //echo "ModelId is:".$modelId;
-               $bobimmodel = new bobimmodel_impl();
-               $sovfs = new sovfs_impl();
-               $sovfs->setSubModule(self::$virtualFileSystemPath);
-               $bobimmodel->setVfsObject($sovfs);
-               $sobimmodel = new sobimmodel_impl($this->db);
-               $sobimmodel->setModelId($modelId);
-               $bobimmodel->setSobimmodel($sobimmodel);
-               $sobimmodelinformation = new 
sobimmodelinformation_impl($this->db,$modelId);
-               
-               
-               try {
-                       if($bobimmodel->checkBimModelIsUsed()) {
-                               throw new Exception("Model is already in use!");
-                       }
-                       $ifcFileWithRealPath = 
$bobimmodel->getIfcFileNameWithRealPath();
-                       $xmlResult = 
$this->getFacilityManagementXmlFromIfc($ifcFileWithRealPath);
-                       $bobimitem = new bobimitem_impl();
-                       
$bobimitem->setSobimmodelinformation($sobimmodelinformation);
-                       $bobimitem->setIfcXml($xmlResult);
+               function query()
+               {
+                       $search  = phpgw::get_var('search');
+                       $order   = phpgw::get_var('order');
+                       $draw    = phpgw::get_var('draw', 'int');
+                       $columns = phpgw::get_var('columns');
 
-                       $bobimitem->setSobimitem(new sobimitem_impl($this->db));
-                       $bobimitem->setSobimtype(new sobimtype_impl($this->db));
+                       $params = array
+                               (
+                               'start'          => phpgw::get_var('start', 
'int', 'REQUEST', 0),
+                               'results'        => phpgw::get_var('length', 
'int', 'REQUEST', 0),
+                               'query'          => $search['value'],
+                               'order'          => 
$columns[$order[0]['column']]['data'],
+                               'sort'           => $order[0]['dir'],
+                               'filter'         => $this->filter,
+                               'allrows'        => phpgw::get_var('length', 
'int') == -1,
+                               'status_id'      => phpgw::get_var('status_id')
+                       );
 
-                       $bobimitem->loadIfcItemsIntoDatabase();
-                       
-                       $result = array();
-                       $result["result"] = 1;
-                       $result["error"] = "";
-                       echo json_encode($result);
-               } catch (NoResponseException $e) {
-                       $result = array();
-                       $result["result"] = 0;
-                       $result["error"] = "Could not connect to BIM converter 
rest service!";
-                       $result["Exception"] = $e;
-                       echo json_encode($result);
-               } catch (Exception $e) {
-                       $result = array();
-                       $result["result"] = 0;
-                       $result["error"] = "General error!\nMessage: 
".$e->getMessage();
-                       echo json_encode($result);
+                       $bobimmodel      = new bobimmodel_impl();
+                       $sobimmodel      = new sobimmodel_impl($this->db);
+                       $bobimmodel->setSobimmodel($sobimmodel);
+                       $output          = $bobimmodel->createBimModelList();
+
+                       $results['results']                      = $output;
+                       $results['total_records']        = count($output);
+                       $results['start']                        = 
$params['start'];
+                       $results['sort']                         = 'databaseId';
+                       $results['dir']                          = 
$params['sort'] ? $params['sort'] : 'ASC';
+                       $results['draw']                         = $draw;
+
+//_debug_array($results);
+                       return $this->jquery_results($results);
                }
+               /*
+                *
+                */
 
-               
-                       
-       }
+               public function removeModelJson($modelId = null)
+               {
+                       if(!$this->acl_delete)
+                       {
+                               return lang('sorry - insufficient rights');
+                       }
+                       $output                          = array();
+                       $output["result"]        = 1;
+                       if($modelId == null)
+                       {
+                               $modelId = (int)phpgw::get_var("modelId");
+                       }
 
-       private function getFacilityManagementXmlFromIfc($fileWithPath) {
-               $sobim_converter = new sobim_converter_impl();
-               $sobim_converter->setBaseUrl($this->bimconverterUrl);
-               $sobim_converter->setFileToSend($fileWithPath);
-               
-               try {
-                       $returnedXml =  
$sobim_converter->getFacilityManagementXml();
-                       $sxe = simplexml_load_string($returnedXml);
-                       return $sxe;
-               } catch (NoResponseException $e) {
-                       throw $e;
-               } catch (InvalidArgumentException $e) {
-                       throw $e;
-               } catch ( Exception $e) {
-                       echo $e;
+                       $bobimmodel      = new bobimmodel_impl();
+                       $sovfs           = new sovfs_impl();
+                       $sovfs->setSubModule(self::$virtualFileSystemPath);
+                       $bobimmodel->setVfsObject($sovfs);
+                       $sobimmodel      = new sobimmodel_impl($this->db);
+                       $sobimmodel->setModelId($modelId);
+                       $bobimmodel->setSobimmodel($sobimmodel);
+                       try
+                       {
+                               $bobimmodel->removeIfcModelByModelId();
+                               return $output;
+                       }
+                       catch(InvalidArgumentException $e)
+                       {
+                               $output["result"]        = 0;
+                               $output["error"]         = "Invalid arguments";
+                               $output["exception"] = $e;
+                               return $output;
+                       }
+                       catch(ModelDoesNotExistException $e)
+                       {
+                               $output["result"]        = 0;
+                               $output["error"]         = "Model does not 
exist!";
+                               $output["exception"] = $e;
+                               return $output;
+                       }
+                       catch(Exception $e)
+                       {
+                               $output["result"]        = 0;
+                               $output["error"]         = "General error";
+                               $output["exception"] = $e;
+                               return $output;
+                       }
                }
-       }
 
-       public function showModels() {
-               $GLOBALS['phpgw']->js->validate_file( 'yahoo', 'bim.modellist', 
'bim' );
-               /*$GLOBALS['phpgw_info']['flags']['noheader'] = false;
-                       $GLOBALS['phpgw_info']['flags']['nofooter'] = false;
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-                       $GLOBALS['phpgw']->common->phpgw_header(true);*/
-                       
-                       
-                       
-               $GLOBALS['phpgw']->xslttpl->add_file(array('bim_showmodels'));
-               $bobimmodel = new bobimmodel_impl();
-               $sobimmodel = new sobimmodel_impl($this->db);
-               $bobimmodel->setSobimmodel($sobimmodel);
-               $output = $bobimmodel->createBimModelList();
-               $loadingImage = $GLOBALS['phpgw']->common->find_image('bim', 
'ajaxLoader.gif');
-               $data = array (
-               'models' => $output,
-               'loadingImage' => $loadingImage
-               );
-               $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('modelData' 
=> $data));
-               $this->setupBimCss();
-               $GLOBALS['phpgw']->js->validate_file( 'yui3', 'yui/yui-min', 
'phpgwapi' );
-               // echo '<script type="text/javascript" 
src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js";></script>';
-               $ble =  <<<HTML
-        <script>YUI().use("event-delegate", function(Y) {
- 
-    Y.delegate("click", function(e) {
- 
-        //  The list item that matched the provided selector is the
-        //  default 'this' object
-        Y.log("Default scope: " + this.get("id"));
- 
-        //  The list item that matched the provided selector is
-        //  also available via the event's currentTarget property
-        //  in case the 'this' object is overridden in the subscription.
-        Y.log("Clicked list item: " + e.currentTarget.get("id"));
- 
-        //  The actual click target, which could be the matched item or a
-        //  descendant of it.
-        Y.log("Event target: " + e.target);
- 
-        //  The delegation container is added to the event facade
-        Y.log("Delegation container: " + e.container.get("id"));
- 
- 
-    }, "#container44", "li");
- 
-});</script>
-HTML;
+               public function getFacilityManagementXmlByModelId($modelId = 
null)
+               {
+                       $GLOBALS['phpgw_info']['flags']['noheader']      = true;
+                       $GLOBALS['phpgw_info']['flags']['nofooter']      = true;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app']      = 
false;
+                       header("Content-type: application/xml");
+                       $restUrl                                                
                         = $this->bimconverterUrl;
+                       if($modelId == null)
+                       {
+                               $modelId = (int)phpgw::get_var("modelId");
+                       }
+                       //echo "ModelId is:".$modelId;
+                       $bobimmodel                              = new 
bobimmodel_impl();
+                       $sovfs                                   = new 
sovfs_impl();
+                       $sovfs->setSubModule(self::$virtualFileSystemPath);
+                       $bobimmodel->setVfsObject($sovfs);
+                       $sobimmodel                              = new 
sobimmodel_impl($this->db);
+                       $sobimmodel->setModelId($modelId);
+                       $bobimmodel->setSobimmodel($sobimmodel);
+                       $sobimmodelinformation   = new 
sobimmodelinformation_impl($this->db, $modelId);
 
-               $someOutput =  '<div id="container44"><ul id="list"><li 
id="li-1">List Item 1</li>
-        <li id="li-2">List Item 2</li> 
-               <li id="li-3">List Item 3</li> 
-               <li id="li-4">List Item 4</li> 
-               <li id="li-5">List Item 5</li> 
-           </ul> 
-       </div> <script>doDelegate()</script>';
-       }
 
-       private $form_upload_field_filename ="ifc_file_name";
-       private $form_upload_field_modelname ="ifc_model_name";
+                       try
+                       {
+                               if($bobimmodel->checkBimModelIsUsed())
+                               {
+                                       throw new Exception("Model is already 
in use!");
+                               }
+                               $ifcFileWithRealPath = 
$bobimmodel->getIfcFileNameWithRealPath();
+                               $xmlResult                       = 
$this->getFacilityManagementXmlFromIfc($ifcFileWithRealPath);
+                               $bobimitem                       = new 
bobimitem_impl();
+                               
$bobimitem->setSobimmodelinformation($sobimmodelinformation);
+                               $bobimitem->setIfcXml($xmlResult);
 
-       public function upload() {
-               $GLOBALS['phpgw']->xslttpl->add_file(array('bim_upload_ifc'));
-                       
-               $import_action  = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'bim.uibim.uploadFile', 'id'=> $id));
-               $data = array
-               (
-                               'importfile'                                    
=> $importfile,
-                               'values'                                        
        => $content,
-                               'form_field_modelname'                  => 
$this->form_upload_field_modelname,
-                               'form_field_filename'                   => 
$this->form_upload_field_filename,
-                               'import_action'                                 
=> $import_action,
-                               'lang_import_statustext'                => 
lang('import to this location from spreadsheet'),
-                               'lang_import'                                   
=> lang('import'),
-                               'lang_cancel'                                   
=> lang('cancel')
-               );
-               $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('upload' => 
$data));
-               $this->setupBimCss();
-       }
+                               $bobimitem->setSobimitem(new 
sobimitem_impl($this->db));
+                               $bobimitem->setSobimtype(new 
sobimtype_impl($this->db));
 
+                               $bobimitem->loadIfcItemsIntoDatabase();
 
-       public function uploadFile($uploadedFileArray = null, $modelName = 
null, $unitTest = false) {
-               if(!$unitTest) {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('bim_upload_ifc_result'));
+                               $result                          = array();
+                               $result["result"]        = 1;
+                               $result["error"]         = "";
+                               echo json_encode($result);
+                       }
+                       catch(NoResponseException $e)
+                       {
+                               $result                          = array();
+                               $result["result"]        = 0;
+                               $result["error"]         = "Could not connect 
to BIM converter rest service!";
+                               $result["Exception"] = $e;
+                               echo phpgwapi_xmlhelper::toXML($result, 
'PHPGW');
+                               //echo json_encode($result);
+                       }
+                       catch(Exception $e)
+                       {
+                               $result                          = array();
+                               $result["result"]        = 0;
+                               $result["error"]         = "General 
error!\nMessage: " . $e->getMessage();
+                               echo json_encode($result);
+                       }
                }
 
-               if(!$uploadedFileArray) {
-                       $uploadedFileArray = 
$_FILES[$this->form_upload_field_filename];
-               }
-               if(!$modelName) {
-                       $modelName = 
phpgw::get_var($this->form_upload_field_modelname);
-               }
-               $returnValue = array();
+               private function getFacilityManagementXmlFromIfc($fileWithPath)
+               {
+                       $sobim_converter = new sobim_converter_impl();
+                       $sobim_converter->setBaseUrl($this->bimconverterUrl);
+                       $sobim_converter->setFileToSend($fileWithPath);
 
-               $filename = $uploadedFileArray['name'];
-               $filenameWithPath = $uploadedFileArray['tmp_name'];
-               $bobimmodel = new bobimmodel_impl();
-               $sovfs = new sovfs_impl($filename, $filenameWithPath, 
self::$virtualFileSystemPath);
-               $bobimmodel->setVfsObject($sovfs);
-               $sobimmodel = new sobimmodel_impl($this->db);
-               $bobimmodel->setSobimmodel($sobimmodel);
-               $bobimmodel->setModelName($modelName);
-               $errorMessage = "";
-               $error = false;
-               try {
-                       $bobimmodel->addUploadedIfcModel();
-
-               } catch (FileExistsException $e) {
-                       $error = true;
-                       $errorMessage =  "Filename in use! \n Try renaming the 
file";
-                       if($unitTest) {
+                       try
+                       {
+                               $returnedXml = 
$sobim_converter->getFacilityManagementXml();
+                               $sxe             = 
simplexml_load_string($returnedXml);
+                               return $sxe;
+                       }
+                       catch(NoResponseException $e)
+                       {
                                throw $e;
                        }
-               } catch (Exception $e) {
-                       $error = true;
-                       $errorMessage =  $e->getMessage();
-                       if($unitTest) {
+                       catch(InvalidArgumentException $e)
+                       {
                                throw $e;
                        }
+                       catch(Exception $e)
+                       {
+                               echo $e;
+                       }
                }
 
+               function showModels()
+               {
+                       if(phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               return $this->query();
+                       }
 
-               $link_to_models = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'bim.uibim.showModels'));
-               $link_to_upload = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'bim.uibim.upload'));
-               $data = array
-               (
-                               'modelName'                                     
        => $modelName,
-                               'error'                                         
        => $error,
-                               'errorMessage'                                  
=> $errorMessage,
-                               'linkToModels'                                  
=> $link_to_models,
-                               'linkToUpload'                                  
=> $link_to_upload
-               );
+                       $data = array(
+                               'datatable_name' => lang('Model data'),
+                               'js_lang'                => js_lang('edit', 
'add'),
+                               'form'                   => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                                       array(
+                                                               'type'   => 
'link',
+                                                               'value'  => 
lang('new'),
+                                                               'href'   => 
self::link(array('menuaction' => 'bim.uibim.upload')),
+                                                               'class'  => 
'new_item'
+                                                       ),
+                                               )
+                                       ),
+                               ),
+                               'datatable'              => array(
+                                       'source'                         => 
self::link(array('menuaction' => 'bim.uibim.showModels', 'phpgw_return_as' => 
'json')),
+                                       'ungroup_buttons'        => true,
+                                       'allrows'                        => 
true,
+                                       'field'                          => 
array(
+                                               array(
+                                                       'key'            => 
'databaseId',
+                                                       'label'          => 
lang('Database id'),
+                                                       'sortable'       => 
true,
+                                               ),
+                                               array(
+                                                       'key'            => 
'guid',
+                                                       'label'          => 
lang('guid'),
+                                                       'sortable'       => 
true,
+                                               ),
+                                               array(
+                                                       'key'            => 
'name',
+                                                       'label'          => 
lang('Name'),
+                                                       'sortable'       => true
+                                               ),
+                                               array(
+                                                       'key'            => 
'creationDate',
+                                                       'label'          => 
lang('creationDate'),
+                                                       'sortable'       => true
+                                               ),
+                                               array(
+                                                       'key'            => 
'fileSize',
+                                                       'label'          => 
lang('fileSize'),
+                                                       'sortable'       => 
true,
+                                                       'formatter'      => 
'JqueryPortico.FormatterCenter'
+                                               ),
+                                               array(
+                                                       'key'            => 
'fileName',
+                                                       'label'          => 
lang('fileName'),
+                                                       'sortable'       => 
false,
+                                               ),
+                                               array(
+                                                       'key'            => 
'usedItemCount',
+                                                       'label'          => 
lang('usedItemCount'),
+                                                       'sortable'       => 
false,
+                                               ),
+                                               array(
+                                                       'key'            => 
'vfsFileId',
+                                                       'label'          => 
lang('vfsFileId'),
+                                                       'sortable'       => 
false,
+                                               ),
+                                               array(
+                                                       'key'            => 
'used',
+                                                       'label'          => 
lang('used'),
+                                                       'sortable'       => 
false,
+                                               ),
+                                       ),
+                               ),
+                       );
 
-               if(!$unitTest) {
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('uploadResult' => $data));
+                       $parameters = array
+                               (
+                               'parameter' => array
+                                       (
+                                       array
+                                               (
+                                               'name'   => 'modelId',
+                                               'source' => 'databaseId'
+                                       ),
+                               )
+                       );
+
+                       $parameters2 = array
+                               (
+                               'parameter' => array
+                                       (
+                                       array
+                                               (
+                                               'name'   => 'modelGuid',
+                                               'source' => 'guid'
+                                       ),
+                               )
+                       );
+
+
+                       $data['datatable']['actions'][]  = array
+                               (
+                               'my_name'        => 'view',
+                               'text'           => lang('view'),
+                               'action'         => 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                       'menuaction' => 
'bim.uibimitem.showItems'
+                               )),
+                               'parameters' => json_encode($parameters)
+                       );
+                       $data['datatable']['actions'][]  = array
+                               (
+                               'my_name'        => 'load',
+                               'text'           => lang('load'),
+                               'action'         => 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                       'menuaction' => 
'bim.uibim.getFacilityManagementXmlByModelId'
+                               )),
+                               'parameters' => json_encode($parameters)
+                       );
+                       $data['datatable']['actions'][]  = array
+                               (
+                               'my_name'                => 'delete',
+                               'text'                   => lang('Remove'),
+                               'confirm_msg'    => lang('do you really want to 
delete this entry'),
+                               'action'                 => 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                       'menuaction' => 
'bim.uibim.removeModelJson',
+                               )),
+                               'parameters'     => json_encode($parameters)
+                       );
+                       $data['datatable']['actions'][]  = array
+                               (
+                               'my_name'        => 'info',
+                               'text'           => lang('info'),
+                               'action'         => 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                       'menuaction' => 
'bim.uibim.displayModelInformation'
+                               )),
+                               'parameters' => json_encode($parameters)
+                       );
+
+                       self::render_template_xsl(array('datatable_jquery'), 
$data);
                }
 
-               return $data;
-       }
 
-       public function displayModelInformation() {
-               /*$GLOBALS['phpgw_info']['flags']['noheader'] = false;
-                       $GLOBALS['phpgw_info']['flags']['nofooter'] = false;
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-                       $GLOBALS['phpgw']->common->phpgw_header(true);*/
-               
$GLOBALS['phpgw']->xslttpl->add_file(array('bim_modelinformation'));
-               $modelId = phpgw::get_var("modelId");
-               //$modelId = 3;
-               if(empty($modelId)) {
-                       // go apeshit
-                       echo "No modelId!";
-                       
-               } else {
-                       $sobimInfo = new sobimmodelinformation_impl($this->db, 
$modelId);
-                       /* @var $modelInfo BimModelInformation */
-                       $modelInfo = $sobimInfo->getModelInformation();
-                       $sobimmodel = new sobimmodel_impl($this->db);
-                       $sobimmodel->setModelId($modelId);
-                       /* @var $model BimModel */
-                       $model = $sobimmodel->retrieveBimModelInformationById();
-                       $data = array (
-                               'model'         => 
$model->transformObjectToArray(),
-                               'information' => 
$modelInfo->transformObjectToArray()
+               private $form_upload_field_filename      = "ifc_file_name";
+               private $form_upload_field_modelname = "ifc_model_name";
+
+               public function upload()
+               {
+                       if(!$this->acl_add)
+                       {
+                               phpgw::no_access();
+                       }
+
+                       $import_action   = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'bim.uibim.uploadFile',
+                               'id' => $id));
+                       $data                    = array
+                               (
+                               'importfile'                     => $importfile,
+                               'values'                                 => 
$content,
+                               'form_field_modelname'   => 
$this->form_upload_field_modelname,
+                               'form_field_filename'    => 
$this->form_upload_field_filename,
+                               'import_action'                  => 
$import_action,
+                               'lang_import_statustext' => lang('import to 
this location from spreadsheet'),
+                               'lang_import'                    => 
lang('import'),
+                               'lang_cancel'                    => 
lang('cancel')
                        );
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('modelInformation' => $data));
-                       
+                       $this->setupBimCss();
+                       self::render_template_xsl('bim_upload_ifc', 
array('upload' => $data));
                }
-               
-               $this->setupBimCss();
-               
-       }
 
+               public function uploadFile($uploadedFileArray = null, 
$modelName = null, $unitTest = false)
+               {
+                       if(!$unitTest)
+                       {
+                               
$GLOBALS['phpgw']->xslttpl->add_file(array('bim_upload_ifc_result'));
+                       }
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 
-}
+                       if(!$this->acl_add)
+                       {
+                               phpgw::no_access();
+                       }
+
+                       if(!$uploadedFileArray)
+                       {
+                               $uploadedFileArray = 
$_FILES[$this->form_upload_field_filename];
+                       }
+                       if(!$modelName)
+                       {
+                               $modelName = 
phpgw::get_var($this->form_upload_field_modelname);
+                       }
+                       $returnValue = array();
+
+                       $filename                        = 
$uploadedFileArray['name'];
+                       $filenameWithPath        = 
$uploadedFileArray['tmp_name'];
+                       $bobimmodel                      = new 
bobimmodel_impl();
+                       $sovfs                           = new 
sovfs_impl($filename, $filenameWithPath, self::$virtualFileSystemPath);
+                       $bobimmodel->setVfsObject($sovfs);
+                       $sobimmodel                      = new 
sobimmodel_impl($this->db);
+                       $bobimmodel->setSobimmodel($sobimmodel);
+                       $bobimmodel->setModelName($modelName);
+                       $errorMessage            = "";
+                       $error                           = false;
+                       try
+                       {
+                               $bobimmodel->addUploadedIfcModel();
+                       }
+                       catch(FileExistsException $e)
+                       {
+                               $error                   = true;
+                               $errorMessage    = "Filename in use! \n Try 
renaming the file";
+                               if($unitTest)
+                               {
+                                       throw $e;
+                               }
+                       }
+                       catch(Exception $e)
+                       {
+                               $error                   = true;
+                               $errorMessage    = $e->getMessage();
+                               if($unitTest)
+                               {
+                                       throw $e;
+                               }
+                       }
+
+
+                       $link_to_models  = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'bim.uibim.showModels'));
+                       $link_to_upload  = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'bim.uibim.upload'));
+                       $data                    = array
+                               (
+                               'modelName'              => $modelName,
+                               'error'                  => $error,
+                               'errorMessage'   => $errorMessage,
+                               'linkToModels'   => $link_to_models,
+                               'linkToUpload'   => $link_to_upload
+                       );
+
+                       if(!$unitTest)
+                       {
+                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('uploadResult' => $data));
+                       }
+
+                       return $data;
+               }
+
+               public function displayModelInformation()
+               {
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('bim_modelinformation'));
+                       $modelId = phpgw::get_var("modelId");
+                       //$modelId = 3;
+                       if(empty($modelId))
+                       {
+                               echo "No modelId!";
+                       }
+                       else
+                       {
+                               $sobimInfo       = new 
sobimmodelinformation_impl($this->db, $modelId);
+                               /* @var $modelInfo BimModelInformation */
+                               $modelInfo       = 
$sobimInfo->getModelInformation();
+                               $sobimmodel      = new 
sobimmodel_impl($this->db);
+                               $sobimmodel->setModelId($modelId);
+                               /* @var $model BimModel */
+                               $model           = 
$sobimmodel->retrieveBimModelInformationById();
+                               $data            = array(
+                                       'model'                  => 
$model->transformObjectToArray(),
+                                       'information'    => 
$modelInfo->transformObjectToArray()
+                               );
+                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('modelInformation' => $data));
+                       }
+
+//                     $this->setupBimCss();
+               }
+       }
\ No newline at end of file

Modified: branches/dev-syncromind/bim/inc/class.uibimitem.inc.php
===================================================================
--- branches/dev-syncromind/bim/inc/class.uibimitem.inc.php     2016-01-04 
14:13:00 UTC (rev 14619)
+++ branches/dev-syncromind/bim/inc/class.uibimitem.inc.php     2016-01-05 
08:28:44 UTC (rev 14620)
@@ -1,4 +1,5 @@
 <?php
+phpgw::import_class('phpgwapi.uicommon_jquery');
 phpgw::import_class('bim.bobimitem');
 phpgw::import_class('bim.sobimitem');
 /*
@@ -8,10 +9,13 @@
        public function showItems();
        public function showBimItem();
 }
-class bim_uibimitem implements uibimitem {
+
+class bim_uibimitem extends phpgwapi_uicommon_jquery implements uibimitem {
        private $db;
 
-       public function __construct() {
+       public function __construct()
+       {
+                       parent::__construct();
                $this->bocommon = CreateObject('property.bocommon');
 
                $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
@@ -24,19 +28,33 @@
                'showBimItem' => true
        );
        
-       public function showItems()
+       function query()
        {
-               $GLOBALS['phpgw']->js->validate_file( 'yui3', 'yui/yui-min', 
'phpgwapi' );
-               $GLOBALS['phpgw']->js->validate_file( 'yahoo', 'bim.modellist', 
'bim' );
+                       $search  = phpgw::get_var('search');
+                       $order   = phpgw::get_var('order');
+                       $draw    = phpgw::get_var('draw', 'int');
+                       $columns = phpgw::get_var('columns');
+
+                       $params = array
+                               (
+                               'start'          => phpgw::get_var('start', 
'int', 'REQUEST', 0),
+                               'results'        => phpgw::get_var('length', 
'int', 'REQUEST', 0),
+                               'query'          => $search['value'],
+                               'order'          => 
$columns[$order[0]['column']]['data'],
+                               'sort'           => $order[0]['dir'],
+                               'filter'         => $this->filter,
+                               'allrows'        => phpgw::get_var('length', 
'int') == -1,
+                               'status_id'      => phpgw::get_var('status_id')
+                       );
+
+
                $modelId = phpgw::get_var("modelId");
-               //$modelId = 3;
                if(empty($modelId))
                {
-                       echo "No modelId!";
+                       $bimItems = array();
                }
                else
                {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('bim_showitems'));
                        $sobimitem = new sobimitem_impl($this->db);
                        $sobimitem->setModelId($modelId);
                        $bobimitem = new bobimitem_impl();
@@ -47,10 +65,9 @@
                        foreach( $items as $bimItem)
                        {
                                /* @var $bimItem BimItem*/
-                               array_push($bimItems, 
$bimItem->transformObjectToArray());//$bimItem->);
+                               array_push($bimItems, 
$bimItem->transformObjectToArray());
                        }
-                       //$bimItems = print_r($items, true);
-                       
+/*
                        $data = array
                        (
                                'someData' => "data",
@@ -58,23 +75,100 @@
                                'count' => $count,
                                'bimItems' => array("item" => $bimItems)
                        );
-                       
-                       $this->setupBimCss();
-                       $GLOBALS['phpgw']->xslttpl->set_var('bimitems',$data);
+*/
                }
-               
+               $results['results']                      = $bimItems;
+               $results['total_records']        = count(($items));
+               $results['start']                        = $params['start'];
+               $results['sort']                         = 'databaseId';
+               $results['dir']                          = $params['sort'] ? 
$params['sort'] : 'ASC';
+               $results['draw']                         = $draw;
+
+               return $this->jquery_results($results);
+
        }
+
+       public function showItems()
+       {
+                       if(phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               return $this->query();
+                       }
+
+                       $data = array(
+                               'datatable_name' => lang('Objects'),
+                               'js_lang'                => js_lang('edit', 
'add'),
+                               'form'                   => array(
+                       /*              'toolbar' => array(
+                                               'item' => array(
+                                                       array(
+                                                               'type'   => 
'link',
+                                                               'value'  => 
lang('new'),
+                                                               'href'   => 
self::link(array('menuaction' => 'bim.uibim.upload')),
+                                                               'class'  => 
'new_item'
+                                                       ),
+                                               )
+                                       ),*/
+                               ),
+                               'datatable'              => array(
+                                       'source'                         => 
self::link(array('menuaction' => 'bim.uibimitem.showItems', 'modelId' => 
phpgw::get_var("modelId"), 'phpgw_return_as' => 'json')),
+                                       'ungroup_buttons'        => true,
+                                       'allrows'                        => 
true,
+                                       'field'                          => 
array(
+                                               array(
+                                                       'key'            => 
'databaseId',
+                                                       'label'          => 
lang('Database id'),
+                                                       'sortable'       => 
true,
+                                               //      'formatter' => 
'formatLinkPending'
+                                               ),
+                                               array(
+                                                       'key'            => 
'guid',
+                                                       'label'          => 
lang('guid'),
+                                                       'sortable'       => 
true,
+                                               //      'formatter' => 
'formatLinkPending'
+                                               ),
+                                               array(
+                                                       'key'            => 
'type',
+                                                       'label'          => 
lang('type'),
+                                                       'sortable'       => true
+                                               )
+                                       )
+                               )
+                       );
+
+
+                       $parameters = array
+                               (
+                               'parameter' => array
+                                       (
+                                       array
+                                               (
+                                               'name'   => 'modelGuid',
+                                               'source' => 'guid'
+                                       ),
+                               )
+                       );
+
+
+                       $data['datatable']['actions'][]  = array
+                               (
+                               'my_name'        => 'view',
+                               'text'           => lang('view'),
+                               'action'         => 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                       'menuaction' => 
'bim.uibimitem.showBimItem'
+                               )),
+                               'parameters' => json_encode($parameters)
+                       );
+
+                       self::render_template_xsl(array('datatable_jquery'), 
$data);
+                       
+       }
+
+
        public function showBimItem()
        {
-               /*$GLOBALS['phpgw_info']['flags']['noheader'] = false;
-                       $GLOBALS['phpgw_info']['flags']['nofooter'] = false;
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-                       $GLOBALS['phpgw']->common->phpgw_header(true);*/
-                       
-               $GLOBALS['phpgw']->js->validate_file( 'yui3', 'yui/yui-min', 
'phpgwapi' );
-               $GLOBALS['phpgw']->js->validate_file( 'yahoo', 'bim.modellist', 
'bim' );
                $modelGuid = phpgw::get_var("modelGuid");
-               //$modelId = 3;
                if(empty($modelGuid))
                {
                        echo "No guid!";

Modified: branches/dev-syncromind/bim/inc/class.uiitem.inc.php
===================================================================
--- branches/dev-syncromind/bim/inc/class.uiitem.inc.php        2016-01-04 
14:13:00 UTC (rev 14619)
+++ branches/dev-syncromind/bim/inc/class.uiitem.inc.php        2016-01-05 
08:28:44 UTC (rev 14620)
@@ -68,7 +68,6 @@
             return $json;
         }
                $datatable['json_data'] = json_encode($json);
-               $this->loadYuiWidgets();
 
         // Prepare template variables and process XSLT
         $template_vars = array();
@@ -82,10 +81,6 @@
         //Title of Page
         $GLOBALS['phpgw_info']['flags']['app_header'] = lang('actor') . ': ' . 
lang('list ' . $this->role);
 
-        // Prepare YUI Library
-        $GLOBALS['phpgw']->js->validate_file( 'yahoo', 'item.index', 'bim' );
-
-        //$this->save_sessiondata();
     }
     private function populateJson(&$datatable) {
        $json = array
@@ -138,8 +133,6 @@
                $this->populateColumnNames($datatable, $uicols, $uicols_count);
         
 
-        // path for property.js
-        $datatable['property_js'] =  
$GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property.js";
 
         // Pagination and sort values
                $this->setPagination($datatable, $item_list);
@@ -375,31 +368,12 @@
 
         unset($parameters);
     }
-    private function loadYuiWidgets() {
-       phpgwapi_yui::load_widget('dragdrop');
-        phpgwapi_yui::load_widget('datatable');
-        phpgwapi_yui::load_widget('menu');
-        phpgwapi_yui::load_widget('connection');
-        //// cramirez: necesary for include a partucular js
-        phpgwapi_yui::load_widget('loader');
-        //cramirez: necesary for use opener . Avoid error JS
-        phpgwapi_yui::load_widget('tabview');
-        phpgwapi_yui::load_widget('paginator');
-        //FIXME this one is only needed when $lookup==true - so there is 
probably an error
-        phpgwapi_yui::load_widget('animation');
-    }
+ 
     private function setupCss() {
        if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) ) {
             $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
         }
-        // Prepare CSS Style
-        $GLOBALS['phpgw']->css->validate_file('datatable');
-        $GLOBALS['phpgw']->css->validate_file('property');
-        
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
-        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
-        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
-        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
-        
+         
         
$GLOBALS['phpgw']->css->add_external_file('bim/templates/base/css/bim.css');
     }
     private function setupBimCss() {
@@ -500,14 +474,7 @@
        }
     
     public function showModels() {
-       $GLOBALS['phpgw']->js->validate_file( 'yahoo', 'bim.modellist', 'bim' );
-       /*$GLOBALS['phpgw_info']['flags']['noheader'] = false;
-                       $GLOBALS['phpgw_info']['flags']['nofooter'] = false;
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
-                       $GLOBALS['phpgw']->common->phpgw_header(true);*/
-       
-       
-       
+       
        $GLOBALS['phpgw']->xslttpl->add_file(array('bim_showmodels'));
        $bobimmodel = new bobimmodel_impl();
        $sobimmodel = new sobimmodel_impl($this->db);
@@ -520,42 +487,7 @@
        );
        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('modelData' => 
$data));
         $this->setupBimCss();
-       // echo '<script type="text/javascript" 
src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js";></script>';
-        $ble =  <<<HTML
-        <script>YUI().use("event-delegate", function(Y) {
- 
-    Y.delegate("click", function(e) {
- 
-        //  The list item that matched the provided selector is the
-        //  default 'this' object
-        Y.log("Default scope: " + this.get("id"));
- 
-        //  The list item that matched the provided selector is
-        //  also available via the event's currentTarget property
-        //  in case the 'this' object is overridden in the subscription.
-        Y.log("Clicked list item: " + e.currentTarget.get("id"));
- 
-        //  The actual click target, which could be the matched item or a
-        //  descendant of it.
-        Y.log("Event target: " + e.target);
- 
-        //  The delegation container is added to the event facade
-        Y.log("Delegation container: " + e.container.get("id"));
- 
- 
-    }, "#container44", "li");
- 
-});</script>
-HTML;
-        
-        $someOutput =  '<div id="container44"><ul id="list"><li id="li-1">List 
Item 1</li>
-        <li id="li-2">List Item 2</li> 
-               <li id="li-3">List Item 3</li> 
-               <li id="li-4">List Item 4</li> 
-               <li id="li-5">List Item 5</li> 
-           </ul> 
-       </div> <script>doDelegate()</script>';
-    }
+     }
     
     private $form_upload_field_filename ="ifc_file_name";
     private $form_upload_field_modelname ="ifc_model_name";

Deleted: branches/dev-syncromind/bim/templates/base/bim_showitems.xsl
===================================================================
--- branches/dev-syncromind/bim/templates/base/bim_showitems.xsl        
2016-01-04 14:13:00 UTC (rev 14619)
+++ branches/dev-syncromind/bim/templates/base/bim_showitems.xsl        
2016-01-05 08:28:44 UTC (rev 14620)
@@ -1,26 +0,0 @@
-       <xsl:template match="bimitems">
-               <div> Objects </div>
-               <div class="showModels">
-                       <table id="bimItems">
-                               <tr>
-                                       <th>Database id</th>
-                                       <th>Guid</th>
-                                       <th>type</th>
-                               </tr>
-                               <xsl:for-each select="bimItems/item">
-                                       <tr>
-                                               <td><xsl:value-of 
select="databaseId"/></td>
-                                               <td class="guid"><xsl:value-of 
select="guid"/></td>
-                                               <td><xsl:value-of 
select="type"/></td>
-                                       </tr>
-                               </xsl:for-each>
-                       </table>
-               </div>
-               <script type="text/javascript">
-               if (typeof YUI != 'undefined') {
-                       YUI().use('node-base', function(Y) {
-                               Y.on("load", doDelegateViewItem);
-                       }); 
-               }
-               </script>
-       </xsl:template>

Deleted: branches/dev-syncromind/bim/templates/base/bim_showmodels.xsl
===================================================================
--- branches/dev-syncromind/bim/templates/base/bim_showmodels.xsl       
2016-01-04 14:13:00 UTC (rev 14619)
+++ branches/dev-syncromind/bim/templates/base/bim_showmodels.xsl       
2016-01-05 08:28:44 UTC (rev 14620)
@@ -1,92 +0,0 @@
-       <xsl:template match="modelData">
-       <div> The Model Data </div>
-       <!--<table id="bimModelList">
-               <tr>
-                       <th>Database id</th>
-                       <th>Name</th>
-                       <th>creationDate</th>
-                       <th>fileSize</th>
-                       <th>fileName</th>
-                       <th>usedItemCount</th>
-                       <th>vfsFileId</th>
-                       <th>used</th>
-                       <th></th>
-               </tr>
-               <xsl:for-each select="models">
-                       <tr>
-                               <td>
-                                       <xsl:value-of select="databaseId" />
-                               </td>
-                               <td>
-                                       <xsl:value-of select="name" />
-                               </td>
-                               <td>
-                                       <xsl:value-of select="creationDate" />
-                               </td>
-                               <td>
-                                       <xsl:value-of select="fileSize" />
-                               </td>
-                               <td>
-                                       <xsl:value-of select="fileName" />
-                               </td>
-                               <td>
-                                       <xsl:value-of select="usedItemCount" />
-                               </td>
-                               <td>
-                                       <xsl:value-of select="vfsFileId" />
-                               </td>
-                               <td>
-                                       <xsl:value-of select="used" />
-                               </td>
-                               <td>
-                                       <button>
-                                               <xsl:attribute name="value">
-
-                                                       <xsl:value-of 
select="databaseId" />
-
-                                               </xsl:attribute>
-                                               Delete
-                                       </button>
-                               </td>
-                       </tr>
-               </xsl:for-each>
-       </table>
-
-       -->
-       <div class="showModels">
-               <button onClick="reloadModelList()">Reload model list</button>
-               <table id="bimModelList2">
-                       <tr>
-                               <th>Database id</th>
-                               <th>Name</th>
-                               <th>creationDate</th>
-                               <th>fileSize</th>
-                               <th>fileName</th>
-                               <th>usedItemCount</th>
-                               <th>vfsFileId</th>
-                               <th>used</th>
-                               <th></th>
-                               <th></th>
-                               <th></th>
-                       </tr>
-               </table>
-               <div id="modelsLoader">
-                       <xsl:variable name="loadingImage"><xsl:value-of 
select="loadingImage"/></xsl:variable>
-                       <img src="{$loadingImage}" />
-               </div>
-       </div>
-       <script type="text/javascript">
-               // doDelegate();
-               
-               if (typeof YUI != 'undefined') {
-               YUI().use('node-base', function(Y) {
-               Y.on("load",  getModelList);
-               //Y.on("load", doDelegateDeleteModel);
-               doDelegateDeleteModel();
-               Y.on("load", doDelegateLoadModel);
-               Y.on("load", doDelegateModelInfo);
-               Y.on("load", doDelegateModelView);
-               }); 
-               }
-       </script>
-</xsl:template>

Modified: branches/dev-syncromind/bim/templates/base/bim_upload_ifc.xsl
===================================================================
--- branches/dev-syncromind/bim/templates/base/bim_upload_ifc.xsl       
2016-01-04 14:13:00 UTC (rev 14619)
+++ branches/dev-syncromind/bim/templates/base/bim_upload_ifc.xsl       
2016-01-05 08:28:44 UTC (rev 14620)
@@ -1,22 +1,58 @@
-       <xsl:template match="upload">
-               <div class="bimObject">
-                       <h1>Upload Bim file</h1>
-                       <xsl:variable name="form_action"><xsl:value-of 
select="import_action"/></xsl:variable>
-                       <xsl:variable name="form_field_filename"><xsl:value-of 
select="form_field_filename"/></xsl:variable>
-                       <xsl:variable name="form_field_modelname"><xsl:value-of 
select="form_field_modelname"/></xsl:variable>
-                       <form method="post" enctype="multipart/form-data" 
name="uploadIfc" action="{$form_action}">
-                               <dl>
-                                       <dt>Upload file</dt>
-                                       <dd><input type="file" 
name="{$form_field_filename}" /></dd>
-                                       
-                                       <dt>IFC Model name</dt>
-                                       <dd><input type="text" 
name="{$form_field_modelname}" size="64"/></dd>
-                                               
-                                       <dt></dt>
-                                       <dd><input type="submit" /></dd>
-                                       
-                               </dl>
-                       </form>
-               </div>
-       </xsl:template>
+<func:function name="phpgw:conditional">
+       <xsl:param name="test"/>
+       <xsl:param name="true"/>
+       <xsl:param name="false"/>
+
+       <func:result>
+               <xsl:choose>
+                       <xsl:when test="$test">
+                               <xsl:value-of select="$true"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="$false"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </func:result>
+</func:function>
+
+<xsl:template match="data">
+       <xsl:choose>
+               <xsl:when test="upload">
+                       <xsl:apply-templates select="upload"/>
+               </xsl:when>
+       </xsl:choose>
+       <xsl:call-template name="jquery_phpgw_i18n"/>
+</xsl:template>
+
+<xsl:template match="upload">
+       <div class="bimObject">
+               <h1>Upload Bim file</h1>
+               <xsl:variable name="form_action">
+                       <xsl:value-of select="import_action"/>
+               </xsl:variable>
+               <xsl:variable name="form_field_filename">
+                       <xsl:value-of select="form_field_filename"/>
+               </xsl:variable>
+               <xsl:variable name="form_field_modelname">
+                       <xsl:value-of select="form_field_modelname"/>
+               </xsl:variable>
+               <form method="post" enctype="multipart/form-data" 
name="uploadIfc" action="{$form_action}">
+                       <fieldset>
+                               <div class="pure-control-group">
+                                       <label>
+                                               Upload file
+                                       </label>
+                                       <input type="file" 
name="{$form_field_filename}" />
+                               </div>
+                               <div class="pure-control-group">
+                                       <label>
+                                               IFC Model name
+                                       </label>
+                                       <input type="text" 
name="{$form_field_modelname}" size="64"/>
+                               </div>
+                               <input type="submit" />
+                       </fieldset>
+               </form>
+       </div>
+</xsl:template>
        
\ No newline at end of file




reply via email to

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