2 commits - plugins/calendar
Thomas Brüderli
bruederli at kolabsys.com
Wed Mar 6 15:25:56 CET 2013
plugins/calendar/calendar_ui.js | 4 ++--
plugins/calendar/drivers/database/database_driver.php | 18 ++++++++++++------
2 files changed, 14 insertions(+), 8 deletions(-)
New commits:
commit a3fedfa134875fe16f720b7d33d10889d8690b9e
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Wed Mar 6 15:25:45 2013 +0100
Correctly quote procted column names such as 'start' and 'end' (#1675)
diff --git a/plugins/calendar/drivers/database/database_driver.php b/plugins/calendar/drivers/database/database_driver.php
index 5a518f7..958e8ca 100644
--- a/plugins/calendar/drivers/database/database_driver.php
+++ b/plugins/calendar/drivers/database/database_driver.php
@@ -240,8 +240,10 @@ class database_driver extends calendar_driver
$event = $this->_save_preprocess($event);
$query = $this->rc->db->query(sprintf(
"INSERT INTO " . $this->db_events . "
- (calendar_id, created, changed, uid, start, end, all_day, recurrence, title, description, location, categories, free_busy, priority, sensitivity, attendees, alarms, notifyat)
+ (calendar_id, created, changed, uid, %s, %s, all_day, recurrence, title, description, location, categories, free_busy, priority, sensitivity, attendees, alarms, notifyat)
VALUES (?, %s, %s, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
+ $this->rc->db->quote_identifier('start'),
+ $this->rc->db->quote_identifier('end'),
$this->rc->db->now(),
$this->rc->db->now()
),
@@ -341,9 +343,10 @@ class database_driver extends calendar_driver
$sqlresult = $this->rc->db->query(sprintf(
"SELECT event_id FROM " . $this->db_events . "
WHERE calendar_id IN (%s)
- AND start >= ?
+ AND %s >= ?
AND recurrence_id=?",
- $this->calendar_ids
+ $this->calendar_ids,
+ $this->rc->db->quote_identifier('start')
),
$fromdate->format(self::DB_DATE_FORMAT),
$master['id']);
@@ -538,9 +541,11 @@ class database_driver extends calendar_driver
$notify_at = $this->_get_notification(array('alarms' => $event['alarms'], 'start' => $next_start, 'end' => $next_end));
$query = $this->rc->db->query(sprintf(
"INSERT INTO " . $this->db_events . "
- (calendar_id, recurrence_id, created, changed, uid, start, end, all_day, recurrence, title, description, location, categories, free_busy, priority, sensitivity, alarms, notifyat)
+ (calendar_id, recurrence_id, created, changed, uid, %s, %s, all_day, recurrence, title, description, location, categories, free_busy, priority, sensitivity, alarms, notifyat)
SELECT calendar_id, ?, %s, %s, uid, ?, ?, all_day, recurrence, title, description, location, categories, free_busy, priority, sensitivity, alarms, ?
FROM " . $this->db_events . " WHERE event_id=? AND calendar_id IN (" . $this->calendar_ids . ")",
+ $this->rc->db->quote_identifier('start'),
+ $this->rc->db->quote_identifier('end'),
$this->rc->db->now(),
$this->rc->db->now()
),
@@ -636,7 +641,7 @@ class database_driver extends calendar_driver
$query = $this->rc->db->query(
"DELETE FROM " . $this->db_events . "
WHERE calendar_id IN (" . $this->calendar_ids . ")
- AND start >= ?
+ AND " . $this->rc->db->quote_identifier('start') . " >= ?
AND recurrence_id=?",
$fromdate->format(self::DB_DATE_FORMAT),
$master['id']
@@ -836,9 +841,10 @@ class database_driver extends calendar_driver
$result = $this->rc->db->query(sprintf(
"SELECT * FROM " . $this->db_events . "
WHERE calendar_id IN (%s)
- AND notifyat <= %s AND end > %s",
+ AND notifyat <= %s AND %s > %s",
join(',', $calendar_ids),
$this->rc->db->fromunixtime($time),
+ $this->rc->db->quote_identifier('end'),
$this->rc->db->fromunixtime($time)
));
commit e6c0f222d90238f5f25af08ca3fe38be1293ae7e
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Wed Mar 6 15:23:31 2013 +0100
Fix javascript errors about invalid method calls
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 6a333e8..c80b894 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -2488,8 +2488,8 @@ function rcube_calendar_ui(settings)
widget.children().each(function(){
li = $(this);
html = li.children().first().html().replace(/\s+\(.+\)$/, '').replace(amregex, '0:$1').replace(pmregex, '1:$1');
- if (html == val)
- menu.activate($.Event({ type:'keypress' }), li);
+ if (html.indexOf(val) == 0)
+ menu._scrollIntoView(li);
});
};
More information about the commits
mailing list