fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15672] Stable: Merge 15669:15671 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15672] Stable: Merge 15669:15671 from trunk
Date: Thu, 15 Sep 2016 09:25:21 +0000 (UTC)

Revision: 15672
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15672
Author:   sigurdne
Date:     2016-09-15 09:25:21 +0000 (Thu, 15 Sep 2016)
Log Message:
-----------
Stable: Merge 15669:15671 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/property/inc/class.uilocation.inc.php
    branches/Version-2_0-branch/property/js/portico/location.edit.js

Property Changed:
----------------
    branches/Version-2_0-branch/


Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250,15254-15257
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668
   + /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250,15254-15257
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671

Modified: branches/Version-2_0-branch/property/inc/class.uilocation.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uilocation.inc.php   
2016-09-15 09:22:48 UTC (rev 15671)
+++ branches/Version-2_0-branch/property/inc/class.uilocation.inc.php   
2016-09-15 09:25:21 UTC (rev 15672)
@@ -1696,8 +1696,14 @@
                        foreach ($documents as $item) 
                        {
                                $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']);
+                               $values[] =  array(
+                                       'id'=> $item['document_id'],
+                                       'type'=> 'location',
+                                       'document_name' => $document_name,
+                                       'title'=> $item['title']
+                                       );
                        }
+                       unset($item);
 
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', '.location.' . 
count(explode('-', $location_code)));
                        $generic_document = 
CreateObject('property.sogeneric_document');
@@ -1708,7 +1714,12 @@
                        foreach ($documents2 as $item) 
                        {
                                $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']);
+                               $values[] =  array(
+                                       'id'=> $item['id'],
+                                       'type'=> 'generic',
+                                       'document_name' => $document_name,
+                                       'title'=> $item['title']
+                                       );
                        }
                        
                        $result_data = array('results' => $values);
@@ -2103,7 +2114,8 @@
                                
                                        $tabs['document'] = array('label' => 
lang('document'), 'link' => '#document');
                                        
-                                       $documents_tabletools = array
+                                       $documents_tabletools = array();
+                                       $documents_tabletools[] = array
                                                (
                                                'my_name' => 'add',
                                                'text' => lang('add new 
document'),
@@ -2111,15 +2123,29 @@
                                                'className' => 'add',
                                                'custom_code' => "
                                                                var oArgs = " . 
json_encode(array(
-                                                                       
'menuaction' => 'property.uidocument.edit',                                     
                
+                                                                       
'menuaction' => 'property.uidocument.edit',
                                                                        
'location_code' => $location_code
                                                )) . ";
                                                                
newDocument(oArgs);
                                                        "
                                        );
-                                       
-                                       $documents_def = array
+                                       $documents_tabletools[] = array
                                                (
+                                               'my_name' => 'edit',
+                                               'text' => lang('edit'),
+                                               'type' => 'custom',
+                                               'custom_code' => "
+                                                       var oArgs = " . 
json_encode(array(
+                                                       'menuaction' => 
'property.uidocument.edit'
+                                               )) . ";
+                                                       var parameters = " . 
json_encode(array('parameter' => array(array('name' => 'document_id',
+                                                                       
'source' => 'id')))) . ";
+                                                       editDocument(oArgs, 
parameters);
+                                               "
+                                       );
+
+                                       $documents_def = array(
+                                               array('key' => 'id', 'label' => 
lang('id'), 'sortable' => false, 'resizeable' => true),
                                                array('key' => 'document_name', 
'label' => lang('name'), 'sortable' => false, 'resizeable' => true),
                                                array('key' => 'title', 'label' 
=> lang('title'), 'sortable' => false, 'resizeable' => true)
                                        );

Modified: branches/Version-2_0-branch/property/js/portico/location.edit.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/location.edit.js    
2016-09-15 09:22:48 UTC (rev 15671)
+++ branches/Version-2_0-branch/property/js/portico/location.edit.js    
2016-09-15 09:25:21 UTC (rev 15672)
@@ -27,4 +27,38 @@
        var requestUrl = phpGWLink('index.php', oArgs);
 
        window.open(requestUrl, '_self');
+};
+
+
+
+function editDocument(oArgs, parameters)
+{
+       var api = $('#datatable-container_0').dataTable().api();
+       var selected = api.rows({selected: true}).data();
+
+       if (selected.length === 0)
+       {
+               alert('None selected');
+               return false;
+       }
+       var requestUrl;
+
+       var n = 0;
+       for (var n = 0; n < selected.length; ++n)
+       {
+               $.each(parameters.parameter, function (i, val)
+               {
+                       if(selected[n]['type'] == 'generic')
+                       {
+                               oArgs['menuaction'] = 
'property.uigeneric_document.edit';
+                               oArgs['id'] = selected[n][val.source];
+                       }
+                       else
+                       {
+                               oArgs[val.name] = selected[n][val.source];
+                       }
+                       requestUrl = phpGWLink('index.php', oArgs);
+                       window.open(requestUrl, '_blank');
+               });
+       }
 };
\ No newline at end of file




reply via email to

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