Skip to content

Commit

Permalink
Merge branch 'release/1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgelzpz committed Nov 8, 2011
2 parents 479090c + 29d9edc commit 1f20169
Show file tree
Hide file tree
Showing 24 changed files with 433 additions and 186 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Release 1.2.3 (2011-11-08)
* Better error logging when in production mode
* Fixed editing of recurring events
* Fixed DAViCal/awl include paths when installed in same machine
* Fixed am/pm indicator under some circumstances
* Fixed fuzzy buttons on dialogs (issue #13)
* Event text color changes depending on background (dark/light)
* New default colors and color selection dialog

Release 1.2.2 (2011-10-25)
* Reverted upgrade to iCalcreator. Went back to 2.10.5
* Fixed am/pm indicator
Expand Down
26 changes: 26 additions & 0 deletions doc/source/admin/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ setting.

.. confval:: default_calendar_color

.. deprecated:: 1.2.3

Default background and foreground colors for calendars. Has to be
specified as an associative array. Example::

Expand All @@ -177,6 +179,8 @@ setting.

.. confval:: additional_calendar_colors

.. deprecated:: 1.2.3

List of selectable background and foreground color combinations. Specify
them as an associative array. Example::

Expand All @@ -192,6 +196,28 @@ setting.
'C4C4BC' => '000000',
);

.. confval:: calendar_colors

List of selectable background colors. Foreground color will be
automatically calculated depending on the darkness of the color. Specify
them as an array. Example::

$config['calendar_colors'] = array(
'9CC4E4',
'3A89C9',
'107FC9',
'FAC5C0',
'FF4E50',
'BD3737',
'C9DF8A',
'77AB59',
'36802D',
'F8F087',
'E6D5C1',
'3E4147',
);


Database configuration (database.php)
-------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '1.2.2'
version = '1.2.3'
# The full version, including alpha/beta/rc tags.
release = '1.2.2'
release = '1.2.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
19 changes: 19 additions & 0 deletions doc/source/releasenotes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Release notes
=============

.. _v1.2.3:

1.2.3 (2011-11-08)
------------------

This release fixes some bugs with am/pm indicators under some circumstances,
editing recurring events, include_path problems and other bugs.

It also introduces dynamic text color calculation and new default calendar
colors, so it's recommended to remove the following settings from
``config.php``:

* :confval:`default_calendar_color`: now the first color from :confval:`calendar_colors` is used
* :confval:`additional_calendar_colors`: this option has been replaced by :confval:`calendar_colors`

Copy :confval:`calendar_colors` definition from ``config.php.template`` to your ``config.php``

This release requires no database upgrades.

.. _v1.2.2:

1.2.2 (2011-10-25)
Expand Down
7 changes: 5 additions & 2 deletions libs/davical/inc/caldav-client-v2.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,14 @@ function ParseResponse( $response ) {
xml_parser_set_option ( $parser, XML_OPTION_CASE_FOLDING, 0 );

if ( xml_parse_into_struct( $parser, $this->xmlResponse, $this->xmlnodes, $this->xmltags ) === 0 ) {
printf( "XML parsing error: %s - %s\n", xml_get_error_code($parser), xml_error_string(xml_get_error_code($parser)) );
//printf( "XML parsing error: %s - %s\n", xml_get_error_code($parser), xml_error_string(xml_get_error_code($parser)) );
// debug_print_backtrace();
// echo "\nNodes array............................................................\n"; print_r( $this->xmlnodes );
// echo "\nTags array............................................................\n"; print_r( $this->xmltags );
printf( "\nXML Reponse:\n%s\n", $this->xmlResponse );
//printf( "\nXML Reponse:\n%s\n", $this->xmlResponse );
log_message('ERROR', 'XML parsing error: '
. xml_get_error_code($parser) . ', '
. xml_error_string(xml_get_error_code($parser)));
}

xml_parser_free($parser);
Expand Down
87 changes: 44 additions & 43 deletions web/application/controllers/caldav2json.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Caldav2json extends CI_Controller {
private $date_format;

private $tz;
private $calendar_colors;

function __construct() {
parent::__construct();
Expand All @@ -43,6 +44,8 @@ function __construct() {

$this->tz = $this->config->item('default_timezone');

$this->calendar_colors = $this->config->item('calendar_colors');

$this->load->library('caldav');

$this->output->set_content_type('application/json');
Expand Down Expand Up @@ -158,8 +161,8 @@ function delete_event() {
} else {
$this->load->library('caldav');
$res = $this->caldav->delete_resource(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$href,
$calendar,
$etag);
Expand Down Expand Up @@ -295,8 +298,8 @@ function com_event() {
// Valid destination calendar?
if (!$this->caldav->is_valid_calendar(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$p['calendar'])) {
$this->_throw_exception(
$this->i18n->_('messages', 'error_calendarnotfound',
Expand All @@ -323,8 +326,8 @@ function com_event() {
}

if (!$this->caldav->is_valid_calendar(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$original_calendar)) {
$this->_throw_exception(
$this->i18n->_('messages', 'error_calendarnotfound',
Expand All @@ -336,8 +339,8 @@ function com_event() {
$etag = $p['etag'];

$res = $this->caldav->fetch_resource_by_uid(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$uid,
$original_calendar);

Expand Down Expand Up @@ -412,8 +415,8 @@ function com_event() {
// Moving event between calendars
if ($original_calendar != $calendar) {
$res = $this->caldav->delete_resource(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$href,
$original_calendar,
$etag);
Expand All @@ -437,8 +440,8 @@ function com_event() {

// PUT on server
$new_etag = $this->caldav->put_resource(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$href,
$calendar,
$resource,
Expand Down Expand Up @@ -516,8 +519,8 @@ function resize_or_drag_event() {

// Load resource
$resource = $this->caldav->fetch_resource_by_uid(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$uid,
$calendar);

Expand Down Expand Up @@ -608,8 +611,8 @@ function resize_or_drag_event() {

// PUT on server
$new_etag = $this->caldav->put_resource(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$href,
$calendar,
$ical,
Expand Down Expand Up @@ -646,19 +649,19 @@ function resize_or_drag_event() {
function calendar_list() {
// TODO order
$own_calendars = $this->caldav->get_own_calendars(
$this->auth->user,
$this->auth->passwd
$this->auth->get_user(),
$this->auth->get_passwd()
);
$arr_calendars = $own_calendars;

// Look for shared calendars
$tmp_shared_calendars = $this->shared_calendars->get_shared_with(
$this->auth->user);
$this->auth->get_user());

if (is_array($tmp_shared_calendars) && count($tmp_shared_calendars) > 0) {
$shared_calendars = $this->caldav->get_shared_calendars_info(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$tmp_shared_calendars);
if ($shared_calendars === FALSE) {
$this->extended_logs->message('ERROR',
Expand Down Expand Up @@ -693,15 +696,13 @@ function create_calendar() {

// Default color
if (empty($calendar_color)) {
$default_calendar_color =
$this->config->item('default_calendar_color');
$calendar_color = '#' . $default_calendar_color;
$calendar_color = '#' . $this->calendar_color[0];
}

// Get current own calendars
$current_calendars = $this->caldav->get_own_calendars(
$this->auth->user,
$this->auth->passwd
$this->auth->get_user(),
$this->auth->get_passwd()
);

// Was internal calendar name provided? FALSE and '' return TRUE for
Expand Down Expand Up @@ -730,8 +731,8 @@ function create_calendar() {


$res = $this->caldav->mkcalendar(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$calendar,
$props);

Expand All @@ -757,8 +758,8 @@ function delete_calendar() {

// Get current own calendars and check if this one exists
$current_calendars = $this->caldav->get_own_calendars(
$this->auth->user,
$this->auth->passwd
$this->auth->get_user(),
$this->auth->get_passwd()
);

if (!isset($current_calendars[$calendar])) {
Expand All @@ -772,7 +773,7 @@ function delete_calendar() {

// Delete calendar shares (if any)
$shares =
$this->shared_calendars->get_shared_from($this->auth->user);
$this->shared_calendars->get_shared_from($this->auth->get_user());

if (isset($shares[$calendar])) {
$this_calendar_shares = array_values($shares[$calendar]);
Expand All @@ -781,14 +782,14 @@ function delete_calendar() {
}
}

$replace_pattern = '/^' . $this->auth->user . ':/';
$replace_pattern = '/^' . $this->auth->get_user() . ':/';
$internal_calendar = preg_replace($replace_pattern, '', $calendar);


// Proceed to remove calendar from CalDAV server
$res = $this->caldav->delete_resource(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
'',
$internal_calendar,
null);
Expand Down Expand Up @@ -831,8 +832,8 @@ function modify_calendar() {

// Check if calendar is valid
if (!$this->caldav->is_valid_calendar(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$calendar)) {
$this->extended_logs->message('INTERNALS',
'Call to modify_calendar() with non-existent calendar '
Expand All @@ -857,20 +858,20 @@ function modify_calendar() {

// Proceed to modify calendar
if ($shared != 'true') {
$replace_pattern = '/^' . $this->auth->user . ':/';
$replace_pattern = '/^' . $this->auth->get_user() . ':/';
$internal_calendar = preg_replace($replace_pattern, '', $calendar);

$res = $this->caldav->proppatch(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$internal_calendar,
$props);
} else {
// If this a shared calendar, store settings locally
$success = $this->shared_calendars->store($sid,
$user_from,
$calendar,
$this->auth->user,
$this->auth->get_user(),
$props);
if ($success === FALSE) {
$res = $this->i18n->_('messages', 'error_internal');
Expand All @@ -891,8 +892,8 @@ function modify_calendar() {
}

$res = $this->caldav->setacl(
$this->auth->user,
$this->auth->passwd,
$this->auth->get_user(),
$this->auth->get_passwd(),
$internal_calendar,
$arr_share_with);

Expand All @@ -910,7 +911,7 @@ function modify_calendar() {
// New users
foreach ($add as $added_user) {
$this->shared_calendars->store(null,
$this->auth->user,
$this->auth->get_user(),
$internal_calendar,
$added_user);
}
Expand Down

0 comments on commit 1f20169

Please sign in to comment.