[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15671] property: documents at locations
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15671] property: documents at locations |
Date: |
Thu, 15 Sep 2016 09:22:48 +0000 (UTC) |
Revision: 15671
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15671
Author: sigurdne
Date: 2016-09-15 09:22:48 +0000 (Thu, 15 Sep 2016)
Log Message:
-----------
property: documents at locations
Modified Paths:
--------------
trunk/property/inc/class.uilocation.inc.php
trunk/property/js/portico/location.edit.js
Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2016-09-15 01:08:18 UTC (rev
15670)
+++ trunk/property/inc/class.uilocation.inc.php 2016-09-15 09:22:48 UTC (rev
15671)
@@ -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: trunk/property/js/portico/location.edit.js
===================================================================
--- trunk/property/js/portico/location.edit.js 2016-09-15 01:08:18 UTC (rev
15670)
+++ trunk/property/js/portico/location.edit.js 2016-09-15 09:22:48 UTC (rev
15671)
@@ -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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15671] property: documents at locations,
sigurdne <=