2012-02-21 23:10:40 +04:00
|
|
|
<?php
|
|
|
|
|
2012-05-02 16:11:29 +04:00
|
|
|
$installedVersion=OCP\Config::getAppValue('calendar', 'installed_version');
|
2012-02-21 23:10:40 +04:00
|
|
|
if (version_compare($installedVersion, '0.2.1', '<')) {
|
2012-05-03 15:06:08 +04:00
|
|
|
$stmt = OCP\DB::prepare( 'SELECT id, calendarcolor FROM *PREFIX*calendar_calendars WHERE calendarcolor IS NOT NULL' );
|
2012-02-21 23:10:40 +04:00
|
|
|
$result = $stmt->execute();
|
|
|
|
while( $row = $result->fetchRow()) {
|
|
|
|
$id = $row['id'];
|
|
|
|
$color = $row['calendarcolor'];
|
|
|
|
if ($color[0] == '#' || strlen($color) < 6) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$color = '#' .$color;
|
2012-05-03 15:06:08 +04:00
|
|
|
$stmt = OCP\DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET calendarcolor=? WHERE id=?' );
|
2012-02-21 23:10:40 +04:00
|
|
|
$r = $stmt->execute(array($color,$id));
|
|
|
|
}
|
2012-05-02 18:41:00 +04:00
|
|
|
}
|