[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [13408] class.uicompleted_reservation_export
From: |
Saul |
Subject: |
[Fmsystem-commits] [13408] class.uicompleted_reservation_export |
Date: |
Wed, 10 Jun 2015 22:52:01 +0000 |
Revision: 13408
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13408
Author: psaul
Date: 2015-06-10 22:52:00 +0000 (Wed, 10 Jun 2015)
Log Message:
-----------
class.uicompleted_reservation_export
Modified Paths:
--------------
branches/dev-syncromind/booking/inc/class.uicompleted_reservation_export.inc.php
Modified:
branches/dev-syncromind/booking/inc/class.uicompleted_reservation_export.inc.php
===================================================================
---
branches/dev-syncromind/booking/inc/class.uicompleted_reservation_export.inc.php
2015-06-10 22:51:38 UTC (rev 13407)
+++
branches/dev-syncromind/booking/inc/class.uicompleted_reservation_export.inc.php
2015-06-10 22:52:00 UTC (rev 13408)
@@ -1,12 +1,18 @@
<?php
-phpgw::import_class('booking.uicommon');
+//phpgw::import_class('booking.uicommon');
- class booking_uicompleted_reservation_export extends booking_uicommon
+ phpgw::import_class('booking.uidocument_building');
+ phpgw::import_class('booking.uipermission_building');
+
+ phpgw::import_class('phpgwapi.uicommon_jquery');
+
+ class booking_uicompleted_reservation_export extends
phpgwapi_uicommon_jquery
{
public $public_functions = array
(
'index' => true,
- 'add' => true,
+ 'query' => true,
+ 'add' => true,
'show' => true
);
@@ -76,23 +82,30 @@
public function index()
{
if(phpgw::get_var('phpgw_return_as') == 'json') {
- return $this->index_json();
+ return $this->query();
}
if (phpgw::get_var('generate_files')) {
$this->generate_files();
}
- self::add_javascript('booking', 'booking',
'datatable.js');
+ $GLOBALS['phpgw']->jqcal->add_listener('filter_to');
+ phpgwapi_jquery::load_widget('datepicker');
+
+ self::add_javascript('booking', 'booking',
'datatable.js');
phpgwapi_yui::load_widget('datatable');
phpgwapi_yui::load_widget('paginator');
+
$data = array(
'form' => array(
'toolbar' => array(
'item' => array(
- array('type' =>
'date-picker',
- 'name' => 'to',
- 'text' =>
lang('To').':',
+ array(
+ 'type' => 'date-picker',
+ 'id' => 'to',
+ 'name' => 'to',
+ 'value' => '',
+ 'text' =>
lang('To').':'
),
array(
'type' =>
'submit',
@@ -118,17 +131,17 @@
array(
'key' => 'id',
'label' => lang('ID'),
- 'formatter' =>
'YAHOO.booking.formatLink'
+ 'formatter' =>
'JqueryPortico.formatLink'
),
array(
'key' => 'building_id',
'label' =>
lang('Building'),
- 'formatter' =>
'YAHOO.booking.formatGenericLink()',
+ 'formatter' =>
'JqueryPortico.formatLinkGeneric',
),
array(
'key' => 'season_id',
'label' =>
lang('Season'),
- 'formatter' =>
'YAHOO.booking.formatGenericLink()',
+ 'formatter' =>
'JqueryPortico.formatLinkGeneric',
),
array(
'key' => 'from_',
@@ -157,13 +170,13 @@
array(
'key' => 'internal',
'label' => lang('Int.
invoice file'),
- 'formatter' =>
'YAHOO.booking.formatGenericLink()',
+ 'formatter' =>
'JqueryPortico.formatLinkGeneric',
'sortable' => false,
),
array(
'key' => 'external',
'label' => lang('Ext.
invoice file'),
- 'formatter' =>
'YAHOO.booking.formatGenericLink()',
+ 'formatter' =>
'JqueryPortico.formatLinkGeneric',
'sortable' => false,
),
array(
@@ -192,9 +205,30 @@
$data['filters'] = date("Y-m-d",$filters_to);
- $this->render_template('datatable', $data);
+// $this->render_template('datatable', $data);
+ self::render_template_xsl('datatable_jquery',$data);
}
+ public function query() //index_json
+ {
+ $this->db = $GLOBALS['phpgw']->db;
+ $exports = $this->bo->read();
+ array_walk($exports["results"], array($this,
"_add_links"), $this->module.".uicompleted_reservation_export.show");
+
+ foreach($exports["results"] as &$export) {
+ $export =
$this->bo->so->initialize_entity($export);
+ $this->add_default_display_data($export);
+
+ $sql = "SELECT account_lastname,
account_firstname FROM phpgw_accounts WHERE account_lid =
'".$export['created_by_name']."'";
+ $this->db->query($sql);
+ while ($record =
array_shift($this->db->resultSet)) {
+ $export['created_by_name'] =
$record['account_firstname']." ".$record['account_lastname'];
+ }
+ }
+ $results = $this->jquery_results($exports);
+ return $results;
+ }
+
public function create_link_data($entity, $id_key, $label_key,
$null_label, $ui, $action = 'show') {
$link_data = array();
@@ -235,25 +269,25 @@
}
}
- public function index_json()
- {
- $this->db = $GLOBALS['phpgw']->db;
- $exports = $this->bo->read();
- array_walk($exports["results"], array($this,
"_add_links"), $this->module.".uicompleted_reservation_export.show");
-
- foreach($exports["results"] as &$export) {
- $export =
$this->bo->so->initialize_entity($export);
- $this->add_default_display_data($export);
-
- $sql = "SELECT account_lastname,
account_firstname FROM phpgw_accounts WHERE account_lid =
'".$export['created_by_name']."'";
- $this->db->query($sql);
- while ($record =
array_shift($this->db->resultSet)) {
- $export['created_by_name'] =
$record['account_firstname']." ".$record['account_lastname'];
- }
- }
- $results = $this->yui_results($exports);
- return $results;
- }
+// public function index_json()
+// {
+// $this->db = $GLOBALS['phpgw']->db;
+// $exports = $this->bo->read();
+// array_walk($exports["results"], array($this,
"_add_links"), $this->module.".uicompleted_reservation_export.show");
+//
+// foreach($exports["results"] as &$export) {
+// $export =
$this->bo->so->initialize_entity($export);
+// $this->add_default_display_data($export);
+//
+// $sql = "SELECT account_lastname,
account_firstname FROM phpgw_accounts WHERE account_lid =
'".$export['created_by_name']."'";
+// $this->db->query($sql);
+// while ($record =
array_shift($this->db->resultSet)) {
+// $export['created_by_name'] =
$record['account_firstname']." ".$record['account_lastname'];
+// }
+// }
+// $results = $this->yui_results($exports);
+// return $results;
+// }
public function show()
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [13408] class.uicompleted_reservation_export,
Saul <=