[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11773] booking: order comment in events and applicat
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11773] booking: order comment in events and applications |
Date: |
Mon, 03 Mar 2014 14:18:45 +0000 |
Revision: 11773
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11773
Author: sigurdne
Date: 2014-03-03 14:18:45 +0000 (Mon, 03 Mar 2014)
Log Message:
-----------
booking: order comment in events and applications
Modified Paths:
--------------
trunk/booking/inc/class.soapplication.inc.php
trunk/booking/inc/class.socommon.inc.php
trunk/booking/inc/class.soevent.inc.php
trunk/booking/inc/class.uiapplication.inc.php
trunk/booking/inc/class.uievent.inc.php
Modified: trunk/booking/inc/class.soapplication.inc.php
===================================================================
--- trunk/booking/inc/class.soapplication.inc.php 2014-03-03 13:16:45 UTC
(rev 11772)
+++ trunk/booking/inc/class.soapplication.inc.php 2014-03-03 14:18:45 UTC
(rev 11773)
@@ -72,7 +72,8 @@
'manytomany' => array(
'table' =>
'bb_application_comment',
'key' =>
'application_id',
- 'column' =>
array('time', 'author', 'comment', 'type')
+ 'column' =>
array('time', 'author', 'comment', 'type'),
+ 'order'=> array('sort'
=>'time', 'dir' => 'ASC' )
)),
'resources' => array('type' => 'int',
'required' => true,
'manytomany' => array(
Modified: trunk/booking/inc/class.socommon.inc.php
===================================================================
--- trunk/booking/inc/class.socommon.inc.php 2014-03-03 13:16:45 UTC (rev
11772)
+++ trunk/booking/inc/class.socommon.inc.php 2014-03-03 14:18:45 UTC (rev
11773)
@@ -272,8 +272,14 @@
$column[] =
is_array($paramsOrFieldName) ? $fieldOrInt : $paramsOrFieldName;
}
$column = join(',',
$column);
+ $order_method = '';
+
+
if(is_array($params['manytomany']['order']))
+ {
+ $order_method =
"ORDER BY {$params['manytomany']['order']['sort']}
{$params['manytomany']['order']['dir']}";
+ }
-
$this->db->query("SELECT $column FROM $table WHERE $key=$id", __LINE__,
__FILE__);
+
$this->db->query("SELECT {$column} FROM {$table} WHERE {$key}={$id}
{$order_method}", __LINE__, __FILE__);
$row[$field] = array();
while
($this->db->next_record())
{
Modified: trunk/booking/inc/class.soevent.inc.php
===================================================================
--- trunk/booking/inc/class.soevent.inc.php 2014-03-03 13:16:45 UTC (rev
11772)
+++ trunk/booking/inc/class.soevent.inc.php 2014-03-03 14:18:45 UTC (rev
11773)
@@ -55,7 +55,8 @@
'manytomany' => array(
'table' =>
'bb_event_comment',
'key' => 'event_id',
- 'column' =>
array('time', 'author', 'comment', 'type')
+ 'column' =>
array('time', 'author', 'comment', 'type'),
+ 'order'=> array('sort'
=>'time', 'dir' => 'ASC' )
)),
'resources' => array('type' => 'int',
'required' => true,
'manytomany' => array(
Modified: trunk/booking/inc/class.uiapplication.inc.php
===================================================================
--- trunk/booking/inc/class.uiapplication.inc.php 2014-03-03 13:16:45 UTC
(rev 11772)
+++ trunk/booking/inc/class.uiapplication.inc.php 2014-03-03 14:18:45 UTC
(rev 11773)
@@ -723,7 +723,7 @@
$this->set_case_officer($application);
- $comments = array_reverse($application['comments']);
+ // $comments = array_reverse($application['comments']);
//fixed in db
$agegroups = $this->agegroup_bo->fetch_age_groups();
$agegroups = $agegroups['results'];
$audience = $this->audience_bo->fetch_target_audience();
@@ -735,6 +735,6 @@
self::check_date_availability($application);
self::render_template('application',
array('application' => $application,
'audience' =>
$audience, 'agegroups' => $agegroups,
-
'num_associations'=>$num_associations,'comments' => $comments));
+
'num_associations'=>$num_associations,'comments' => $application['comments']));
}
}
Modified: trunk/booking/inc/class.uievent.inc.php
===================================================================
--- trunk/booking/inc/class.uievent.inc.php 2014-03-03 13:16:45 UTC (rev
11772)
+++ trunk/booking/inc/class.uievent.inc.php 2014-03-03 14:18:45 UTC (rev
11773)
@@ -708,14 +708,14 @@
$event['cancel_link'] = self::link(array('menuaction'
=> 'booking.uievent.index'));
$activities = $this->activity_bo->fetch_activities();
$activities = $activities['results'];
- $comments = array_reverse($event['comments']);
+ // $comments = array_reverse($event['comments']); // fixed
in db
$agegroups = $this->agegroup_bo->fetch_age_groups();
$agegroups = $agegroups['results'];
$audience = $this->audience_bo->fetch_target_audience();
$audience = $audience['results'];
$this->install_customer_identifier_ui($event);
$this->add_template_helpers();
- self::render_template('event_edit', array('event' =>
$event, 'activities' => $activities, 'agegroups' => $agegroups, 'audience' =>
$audience, 'comments' => $comments));
+ self::render_template('event_edit', array('event' =>
$event, 'activities' => $activities, 'agegroups' => $agegroups, 'audience' =>
$audience, 'comments' => $event['comments']));
}
public function info()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11773] booking: order comment in events and applications,
Sigurd Nes <=