[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11147] controller: bugfixes
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11147] controller: bugfixes |
Date: |
Tue, 04 Jun 2013 13:37:39 +0000 |
Revision: 11147
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11147
Author: sigurdne
Date: 2013-06-04 13:37:33 +0000 (Tue, 04 Jun 2013)
Log Message:
-----------
controller: bugfixes
Modified Paths:
--------------
trunk/controller/inc/class.uicontrol_register_to_component.inc.php
trunk/controller/inc/class.uicontrol_register_to_location.inc.php
trunk/controller/js/controller/ajax_control_to_component.js
trunk/controller/js/controller/ajax_control_to_location.js
Modified: trunk/controller/inc/class.uicontrol_register_to_component.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_register_to_component.inc.php
2013-06-03 10:52:23 UTC (rev 11146)
+++ trunk/controller/inc/class.uicontrol_register_to_component.inc.php
2013-06-04 13:37:33 UTC (rev 11147)
@@ -294,6 +294,8 @@
$results =
phpgw::get_var('results', 'int');
$control_registered =
phpgw::get_var('control_registered', 'bool');
+ $results =
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] ? (int)
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] : $results;
+
if(!$entity_id && !$cat_id)
{
$values = array();
@@ -325,8 +327,6 @@
}
}
- $num_rows =
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] ? (int)
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] : 15;
-
$data = array(
'ResultSet' => array(
'totalResultsAvailable' =>
$boentity->total_records,
@@ -334,15 +334,13 @@
'sortKey' => 'location_code',
'sortDir' => "ASC",
'Result' => $values,
- 'pageSize' => $num_rows,
- 'activePage' => floor($boentity->start
/ $num_rows) + 1
+ 'pageSize' => $results,
+ 'activePage' => floor($boentity->start
/ $results) + 1
)
);
return $data;
-
-
$return_data['recordsReturned'] = count($values);
$return_data['totalRecords'] = $boentity->total_records;
$return_data['startIndex'] = $this->start;
Modified: trunk/controller/inc/class.uicontrol_register_to_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_register_to_location.inc.php
2013-06-03 10:52:23 UTC (rev 11146)
+++ trunk/controller/inc/class.uicontrol_register_to_location.inc.php
2013-06-04 13:37:33 UTC (rev 11147)
@@ -299,11 +299,19 @@
'className' => ''
);
-
$count_fields = count($uicols['name']);
for ($i=0;$i<$count_fields;$i++)
{
+ switch($uicols['datatype'][$i])
+ {
+ case 'link':
+ $formatter = 'link';
+ break;
+ default:
+ $formatter =
$uicols['formatter'][$i];
+ }
+
if( $uicols['name'][$i])
{
$columndef[] = array
@@ -311,7 +319,7 @@
'key' =>
$uicols['name'][$i],
'label' =>
$uicols['descr'][$i],
'sortable' =>
!!$uicols['sortable'][$i],
- 'formatter' =>
$uicols['formatter'][$i],
+ 'formatter' => $formatter,
'hidden' =>
$uicols['input_type'][$i] == 'hidden' ? true : false ,
'className' =>
$uicols['classname'][$i],
);
@@ -352,9 +360,11 @@
$results =
phpgw::get_var('results', 'int');
$control_registered =
phpgw::get_var('control_registered', 'bool');
+ $results =
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] ? (int)
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] : $results;
+
$this->bo->results = $results;
- $this->bo->sort = phpgw::get_var('dir');
- $this->bo->order = phpgw::get_var('sort');
+ $this->bo->sort = 'ASC';
+ $this->bo->order = 'location_code';
$this->bo->start = phpgw::get_var('startIndex', 'int', 'REQUEST',
0);
$values = $this->bo->read(array('control_registered' =>
$control_registered,
@@ -380,8 +390,6 @@
}
}
- $num_rows =
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) &&
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] ? (int)
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] : 15;
-
$data = array(
'ResultSet' => array(
'totalResultsAvailable' =>
$this->bo->total_records,
@@ -389,8 +397,8 @@
'sortKey' => 'location_code',
'sortDir' => "ASC",
'Result' => $values,
- 'pageSize' => $num_rows,
- 'activePage' => floor($this->bo->start
/ $num_rows) + 1
+ 'pageSize' => $results,
+ 'activePage' => floor($this->bo->start
/ $results) + 1
)
);
Modified: trunk/controller/js/controller/ajax_control_to_component.js
===================================================================
--- trunk/controller/js/controller/ajax_control_to_component.js 2013-06-03
10:52:23 UTC (rev 11146)
+++ trunk/controller/js/controller/ajax_control_to_component.js 2013-06-04
13:37:33 UTC (rev 11147)
@@ -129,6 +129,7 @@
var oArgs = {menuaction:'property.bolocation.get_locations_by_name'};
var baseUrl = phpGWLink('index.php', oArgs, true);
+ var location_type = 1;
$("#search-location-name").autocomplete({
source: function( request, response ) {
Modified: trunk/controller/js/controller/ajax_control_to_location.js
===================================================================
--- trunk/controller/js/controller/ajax_control_to_location.js 2013-06-03
10:52:23 UTC (rev 11146)
+++ trunk/controller/js/controller/ajax_control_to_location.js 2013-06-04
13:37:33 UTC (rev 11147)
@@ -91,7 +91,7 @@
var oArgs = {menuaction:'property.bolocation.get_locations_by_name'};
var baseUrl = phpGWLink('index.php', oArgs, true);
-
+ var location_type = 1;
$("#search-location-name").autocomplete({
source: function( request, response ) {
location_type = $("#location_type").val();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11147] controller: bugfixes,
Sigurd Nes <=