fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15251] Backport 15244:15250 from Syncromind


From: sigurdne
Subject: [Fmsystem-commits] [15251] Backport 15244:15250 from Syncromind
Date: Thu, 2 Jun 2016 08:06:03 +0000 (UTC)

Revision: 15251
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15251
Author:   sigurdne
Date:     2016-06-02 08:06:03 +0000 (Thu, 02 Jun 2016)
Log Message:
-----------
Backport 15244:15250 from Syncromind

Modified Paths:
--------------
    trunk/property/inc/class.uientity.inc.php
    trunk/property/inc/class.uigeneric_document.inc.php
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/js/portico/generic_document.edit.js
    trunk/property/templates/base/entity.xsl

Property Changed:
----------------
    trunk/


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243
/branches/stavangerkommune:12743-12875,12986
   + /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250
/branches/stavangerkommune:12743-12875,12986

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2016-06-02 02:27:14 UTC (rev 
15250)
+++ trunk/property/inc/class.uientity.inc.php   2016-06-02 08:06:03 UTC (rev 
15251)
@@ -496,7 +496,7 @@
                
                        foreach ($documents as $item) 
                        {
-                               $document_name = '<a 
href="'.self::link(array('menuaction'=>'property.uidocument.edit', 
'document_id'=>$item['document_id'])).'">'.$item['document_name'].'</a>';
+                               $document_name = '<a 
href="'.self::link(array('menuaction'=>'property.uidocument.view_file', 
'id'=>$item['document_id'])).'" target="_blank">'.$item['document_name'].'</a>';
                                $values[] =  array('document_name' => 
$document_name, 'title'=> $item['title']);
                        }
 
@@ -512,7 +512,7 @@
                        $documents2 = $generic_document->read($params);
                        foreach ($documents2 as $item) 
                        {
-                               $document_name = '<a 
href="'.self::link(array('menuaction'=>'property.uigeneric_document.edit', 
'id'=>$item['id'])).'">'.$item['name'].'</a>';
+                               $document_name = '<a 
href="'.self::link(array('menuaction'=>'property.uigeneric_document.view_file', 
'file_id'=>$item['id'])).'" target="_blank">'.$item['name'].'</a>';
                                $values[] =  array('document_name' => 
$document_name, 'title'=> $item['title']);
                        }
                        
@@ -1853,13 +1853,7 @@
                                                $attributes_general = 
array_merge($attributes_general, $group['attributes']);
                                        }
                                }
-
                                unset($attributes_groups);
-
-                               if ($category['fileupload'] || 
(isset($values['files']) && $values['files']))
-                               {
-                                       $tabs['files'] = array('label' => 
lang('files'), 'link' => '#files', 'disable' => 0);
-                               }
                                /*
                                  if($category['jasperupload'])
                                  {
@@ -1867,6 +1861,7 @@
                                  }
                                 */
                        }
+                               
 // ---- START INTEGRATION -------------------------
 
                        $custom_config = CreateObject('admin.soconfig', 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
$this->acl_location));
@@ -1985,40 +1980,8 @@
 // ---- END INTEGRATION -------------------------
 
                        unset($values['attributes']);
-
-                       $link_file_data = array
-                               (
-                               'menuaction' => 'property.uientity.view_file',
-                               'loc1' => $values['location_data']['loc1'],
-                               'id' => $id,
-                               'cat_id' => $this->cat_id,
-                               'entity_id' => $this->entity_id,
-                               'type' => $this->type
-                       );
-
-                       $file_def = array
-                               (
-                               array('key' => 'file_name', 'label' => 
lang('Filename'), 'sortable' => false,
-                                       'resizeable' => true),
-                               array('key' => 'delete_file', 'label' => 
lang('Delete file'), 'sortable' => false,
-                                       'resizeable' => true)
-                       );
-
                        $datatable_def = array();
-                       $datatable_def[] = array
-                               (
-                               'container' => 'datatable-container_0',
-                               'requestUrl' => 
json_encode(self::link(array('menuaction' => 'property.uientity.get_files',
-                                               'entity_id' => 
$this->entity_id, 'cat_id' => $this->cat_id, 'id' => $id, 'type' => 
$this->type, 'phpgw_return_as' => 'json'))),
-                               'ColumnDefs' => $file_def,
-                               'config' => array(
-                                       array('disableFilter' => true),
-                                       array('disablePagination' => true)
-                               )
-                       );
 
-                       //$category['enable_bulk'] = 1;
-
                        if ($id)
                        {
                                $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
$this->acl_location);
@@ -2035,7 +1998,7 @@
                                }
 
                                if ($get_docs)
-                               {                                       
+                               {
                                        $tabs['document'] = array('label' => 
lang('document'), 'link' => '#document', 'disable' => 0);
                                        
                                        $cats = 
CreateObject('phpgwapi.categories', -1, 'property', '.document');
@@ -2080,13 +2043,49 @@
                                                'requestUrl' => 
json_encode(self::link(array('menuaction' => 'property.uientity.get_documents', 
                                                        'location_id' => 
$location_id, 'entity_id' => $this->entity_id, 'cat_id' => $this->cat_id, 'num' 
=> $values['num'], 'phpgw_return_as' => 'json'))),
                                                'data' => "",
-                                               'tabletools' => 
$documents_tabletools,
+                                               'tabletools' => ($mode == 
'edit') ? $documents_tabletools : array(),
                                                'ColumnDefs' => $documents_def,
                                                'config' => array(
                                                        array('disableFilter' 
=> true)
                                                )
                                        );
                                }
+
+                               if ($category['fileupload'] || 
(isset($values['files']) && $values['files']))
+                               {
+                                       $tabs['files'] = array('label' => 
lang('files'), 'link' => '#files', 'disable' => 0);
+                                       
+                                       $link_file_data = array
+                                               (
+                                               'menuaction' => 
'property.uientity.view_file',
+                                               'loc1' => 
$values['location_data']['loc1'],
+                                               'id' => $id,
+                                               'cat_id' => $this->cat_id,
+                                               'entity_id' => $this->entity_id,
+                                               'type' => $this->type
+                                       );
+
+                                       $file_def = array
+                                               (
+                                               array('key' => 'file_name', 
'label' => lang('Filename'), 'sortable' => false,
+                                                       'resizeable' => true),
+                                               array('key' => 'delete_file', 
'label' => lang('Delete file'), 'sortable' => false,
+                                                       'resizeable' => true)
+                                       );
+
+
+                                       $datatable_def[] = array
+                                               (
+                                               'container' => 
'datatable-container_0',
+                                               'requestUrl' => 
json_encode(self::link(array('menuaction' => 'property.uientity.get_files',
+                                                               'entity_id' => 
$this->entity_id, 'cat_id' => $this->cat_id, 'id' => $id, 'type' => 
$this->type, 'phpgw_return_as' => 'json'))),
+                                               'ColumnDefs' => $file_def,
+                                               'config' => array(
+                                                       array('disableFilter' 
=> true),
+                                                       
array('disablePagination' => true)
+                                               )
+                                       );
+                               }
                                
                                if (!$category['enable_bulk'])
                                {
@@ -2422,8 +2421,9 @@
                                'active_tab' => $active_tab,
                                'integration' => $integration,
                                'doc_type_filter' => array('options' => 
$doc_type_filter),
-                               /*'documents' => $documents,
-                               'requestUrlDoc' => $requestUrlDoc ? 
$requestUrlDoc : '',*/
+                               'documents' => $get_docs ? 1 : 0,
+                               /*'requestUrlDoc' => $requestUrlDoc ? 
$requestUrlDoc : '',*/
+                                               
                                'lean' => $_lean ? 1 : 0,
                                'entity_group_list' => array('options' => 
$entity_group_list),
                                'entity_group_name' => $entity_group_name,

Modified: trunk/property/inc/class.uigeneric_document.inc.php
===================================================================
--- trunk/property/inc/class.uigeneric_document.inc.php 2016-06-02 02:27:14 UTC 
(rev 15250)
+++ trunk/property/inc/class.uigeneric_document.inc.php 2016-06-02 08:06:03 UTC 
(rev 15251)
@@ -327,7 +327,7 @@
                                }
                                
                                $values[] = array(
-                                       'location_code' => 
$item['location_code'],
+                                       'location_code' => '<a 
href="'.self::link(array('menuaction' => 'property.uilocation.view', 
'location_code' => $item['location_code'])).'">'.$item['location_code'].'</a>',
                                        'loc1_name' => $item['loc1_name'],
                                        'relate' => '<input 
value="'.$item['id'].'" class="locations mychecks" type="checkbox" 
'.$checked.'>'
                                );                              
@@ -419,7 +419,8 @@
                                
                                $related_def = array
                                        (
-                                       array('key' => 'name', 'label' => 
lang('name'), 'sortable' => false, 'resizeable' => true),
+                                       array('key' => 'id', 'label' => 
lang('id'), 'sortable' => false, 'resizeable' => true),
+                                       array('key' => 'name', 'label' => 
lang('Benevnelse'), 'sortable' => false, 'resizeable' => true),
                                        array('key' => 'relate', 'label' => 
lang('related'), 'sortable' => false, 'resizeable' => true),
                                );
 
@@ -461,8 +462,8 @@
                                
                                $related_def2 = array
                                        (
-                                       array('key' => 'location_code', 'label' 
=> lang('name'), 'sortable' => false, 'resizeable' => true),
-                                       array('key' => 'loc1_name', 'label' => 
lang('eiendom name'), 'sortable' => false, 'resizeable' => true),
+                                       array('key' => 'location_code', 'label' 
=> lang('location'), 'sortable' => false, 'resizeable' => true),
+                                       array('key' => 'loc1_name', 'label' => 
lang('name'), 'sortable' => false, 'resizeable' => true),
                                        //array('key' => 'location_id', 'label' 
=> lang('location id'), 'sortable' => false, 'resizeable' => true, 'hidden' => 
true),
                                        array('key' => 'relate', 'label' => 
lang('related'), 'sortable' => false, 'resizeable' => true),
                                );
@@ -690,7 +691,7 @@
                 'location_id' => $location_id,
                 'filter_item' => array()
                 ));
-                       
+
                        if ($file_id)
                        {
                                $relation_values = 
$this->bo->get_file_relations($location_id, $file_id);
@@ -715,6 +716,7 @@
                                }
                                
                                $values[] = array(
+                                       'id' => '<a 
href="'.self::link(array('menuaction' => 'property.uientity.view', 
'location_id' => $location_id, 'id' => $item['id'])).'">'.$item['id'].'</a>',
                                        'name' => $item['benevnelse'],
                                        'relate' => '<input 
value="'.$item['id'].'" class="components mychecks" type="checkbox" 
'.$checked.'>',
                                );

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2016-06-02 02:27:14 UTC (rev 
15250)
+++ trunk/property/inc/class.uilocation.inc.php 2016-06-02 08:06:03 UTC (rev 
15251)
@@ -1633,7 +1633,7 @@
                
                        foreach ($documents as $item) 
                        {
-                               $document_name = '<a 
href="'.self::link(array('menuaction'=>'property.uidocument.edit', 
'document_id'=>$item['document_id'])).'">'.$item['document_name'].'</a>';
+                               $document_name = '<a 
href="'.self::link(array('menuaction'=>'property.uidocument.view_file', 
'id'=>$item['document_id'])).'" target="_blank">'.$item['document_name'].'</a>';
                                $values[] =  array('document_name' => 
$document_name, 'title'=> $item['title']);
                        }
 
@@ -1645,7 +1645,7 @@
                        $documents2 = $generic_document->read($params);
                        foreach ($documents2 as $item) 
                        {
-                               $document_name = '<a 
href="'.self::link(array('menuaction'=>'property.uigeneric_document.edit', 
'id'=>$item['id'])).'">'.$item['name'].'</a>';
+                               $document_name = '<a 
href="'.self::link(array('menuaction'=>'property.uigeneric_document.view_file', 
'file_id'=>$item['id'])).'" target="_blank">'.$item['name'].'</a>';
                                $values[] =  array('document_name' => 
$document_name, 'title'=> $item['title']);
                        }
                        
@@ -2067,7 +2067,7 @@
                                                'container' => 
'datatable-container_0',
                                                'requestUrl' => 
json_encode(self::link(array('menuaction' => 
'property.uilocation.get_documents', 'location_code' => $location_code, 
'phpgw_return_as' => 'json'))),
                                                'data' => "",
-                                               'tabletools' => 
$documents_tabletools,
+                                               'tabletools' => ($mode == 
'edit') ? $documents_tabletools : array(),
                                                'ColumnDefs' => $documents_def,
                                                'config' => array(
                                                        array('disableFilter' 
=> true)

Modified: trunk/property/js/portico/generic_document.edit.js
===================================================================
--- trunk/property/js/portico/generic_document.edit.js  2016-06-02 02:27:14 UTC 
(rev 15250)
+++ trunk/property/js/portico/generic_document.edit.js  2016-06-02 08:06:03 UTC 
(rev 15251)
@@ -82,7 +82,6 @@
        } else {
                paramsTable1['only_related'] = 0;
        }
-       console.log(paramsTable1);
        
        oTable1.fnDraw();
 }
@@ -97,7 +96,7 @@
        } else {
                paramsTable0['only_related'] = 0;
        }
-       console.log(paramsTable0);
+
        oTable0.fnDraw();
 }
 

Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl    2016-06-02 02:27:14 UTC (rev 
15250)
+++ trunk/property/templates/base/entity.xsl    2016-06-02 08:06:03 UTC (rev 
15251)
@@ -703,7 +703,7 @@
                                </xsl:choose>
                                        
                                <xsl:choose>
-                                       <xsl:when test="files!='' or fileupload 
= 1">
+                                       <xsl:when test="files!='' or  
fileupload = 1 and value_id!=''">
                                                <div id="files">
                                                        <script 
type="text/javascript">
                                                                var 
fileuploader_action = <xsl:value-of select="fileuploader_action"/>;
@@ -741,7 +741,8 @@
                                        </div>
                                </xsl:for-each>
 
-               
+                       <xsl:choose>
+                               <xsl:when test="value_id!='' and documents =1"> 
        
                                                <div id="document">
                                                        <div 
class="pure-control-group">
                                                                <label>
@@ -765,7 +766,8 @@
                                                                        
</xsl:if>
                                                                </xsl:for-each>
                                                </div>
-       
+                               </xsl:when>
+                       </xsl:choose>   
 
                                <xsl:choose>
                                        <xsl:when test="value_id !='' and 
enable_bulk = 0">




reply via email to

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