Merge branch 'master' into calendar_export

This commit is contained in:
Georg Ehrke 2012-06-27 22:24:12 +02:00
commit 1f738d8c9f
11 changed files with 62 additions and 33 deletions

View File

@ -10,19 +10,6 @@
* The following SQL statement is just a help for developers and will not be * The following SQL statement is just a help for developers and will not be
* executed! * executed!
* *
* CREATE TABLE calendar_objects (
* id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
* calendarid INTEGER UNSIGNED NOT NULL,
* objecttype VARCHAR(40) NOT NULL,
* startdate DATETIME,
* enddate DATETIME,
* repeating INT(1),
* summary VARCHAR(255),
* calendardata TEXT,
* uri VARCHAR(100),
* lastmodified INT(11)
* );
*
* CREATE TABLE calendar_calendars ( * CREATE TABLE calendar_calendars (
* id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, * id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
* userid VARCHAR(255), * userid VARCHAR(255),
@ -35,6 +22,7 @@
* timezone TEXT, * timezone TEXT,
* components VARCHAR(20) * components VARCHAR(20)
* ); * );
*
*/ */
/** /**
@ -212,7 +200,20 @@ class OC_Calendar_Calendar{
return true; return true;
} }
/*
* @brief merges two calendars
* @param integer $id1
* @param integer $id2
* @return boolean
*/
public static function mergeCalendar($id1, $id2){
$stmt = OCP\DB::prepare('UPDATE *PREFIX*calendar_objects SET calendarid = ? WHERE calendarid = ?');
$stmt->execute(array($id1, $id2));
self::touchCalendar($id1);
self::deleteCalendar($id2);
}
/** /**
* @brief Creates a URI for Calendar * @brief Creates a URI for Calendar
* @param string $name name of the calendar * @param string $name name of the calendar
@ -238,6 +239,11 @@ class OC_Calendar_Calendar{
list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri); list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
return $userid; return $userid;
} }
/*
* @brief returns the possible color for calendars
* @return array
*/
public static function getCalendarColorOptions(){ public static function getCalendarColorOptions(){
return array( return array(
'#ff0000', // "Red" '#ff0000', // "Red"
@ -251,6 +257,11 @@ class OC_Calendar_Calendar{
); );
} }
/*
* @brief generates the Event Source Info for our JS
* @param array $calendar calendar data
* @return array
*/
public static function getEventSourceInfo($calendar){ public static function getEventSourceInfo($calendar){
return array( return array(
'url' => OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'], 'url' => OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'],

View File

@ -5,6 +5,25 @@
* later. * later.
* See the COPYING-README file. * See the COPYING-README file.
*/ */
/*
*
* The following SQL statement is just a help for developers and will not be
* executed!
*
* CREATE TABLE calendar_objects (
* id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
* calendarid INTEGER UNSIGNED NOT NULL,
* objecttype VARCHAR(40) NOT NULL,
* startdate DATETIME,
* enddate DATETIME,
* repeating INT(1),
* summary VARCHAR(255),
* calendardata TEXT,
* uri VARCHAR(100),
* lastmodified INT(11)
* );
*
*/
/** /**
* This class manages our calendar objects * This class manages our calendar objects

View File

@ -45,7 +45,7 @@ class OC_Mount_Config {
'OC_Filestorage_FTP' => array('backend' => 'FTP', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure ftps://')), 'OC_Filestorage_FTP' => array('backend' => 'FTP', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure ftps://')),
'OC_Filestorage_Google' => array('backend' => 'Google Drive', 'configuration' => array('token' => '#token', 'token_secret' => '#token secret'), 'custom' => 'google'), 'OC_Filestorage_Google' => array('backend' => 'Google Drive', 'configuration' => array('token' => '#token', 'token_secret' => '#token secret'), 'custom' => 'google'),
'OC_Filestorage_SWIFT' => array('backend' => 'OpenStack Swift', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'token' => '*Token', 'root' => '&Root', 'secure' => '!Secure ftps://')), 'OC_Filestorage_SWIFT' => array('backend' => 'OpenStack Swift', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'token' => '*Token', 'root' => '&Root', 'secure' => '!Secure ftps://')),
'OC_Filestorage_SMB' => array('backend' => 'SMB', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root')), 'OC_Filestorage_SMB' => array('backend' => 'SMB', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'share' => 'Share', 'root' => '&Root')),
'OC_Filestorage_DAV' => array('backend' => 'WebDAV', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure https://')) 'OC_Filestorage_DAV' => array('backend' => 'WebDAV', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure https://'))
); );
} }

View File

@ -33,7 +33,6 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
$oauth = new Dropbox_OAuth_Curl($params['app_key'], $params['app_secret']); $oauth = new Dropbox_OAuth_Curl($params['app_key'], $params['app_secret']);
$oauth->setToken($params['token'], $params['token_secret']); $oauth->setToken($params['token'], $params['token_secret']);
$this->dropbox = new Dropbox_API($oauth, 'dropbox'); $this->dropbox = new Dropbox_API($oauth, 'dropbox');
} }
private function getMetaData($path, $list = false) { private function getMetaData($path, $list = false) {
@ -84,8 +83,8 @@ class OC_Filestorage_Dropbox extends OC_Filestorage_Common {
foreach ($contents as $file) { foreach ($contents as $file) {
$files[] = basename($file['path']); $files[] = basename($file['path']);
} }
OC_FakeDirStream::$dirs['dropbox'] = $files; OC_FakeDirStream::$dirs['dropbox'.$path] = $files;
return opendir('fakedir://dropbox'); return opendir('fakedir://dropbox'.$path);
} }
return false; return false;
} }

View File

@ -237,8 +237,8 @@ class OC_Filestorage_Google extends OC_Filestorage_Common {
$this->entries[$name] = $entry; $this->entries[$name] = $entry;
} }
} }
OC_FakeDirStream::$dirs['google'] = $files; OC_FakeDirStream::$dirs['google'.$path] = $files;
return opendir('fakedir://google'); return opendir('fakedir://google'.$path);
} }
public function stat($path) { public function stat($path) {

View File

@ -81,8 +81,8 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
$files[] = basename($item['target']); $files[] = basename($item['target']);
} }
} }
OC_FakeDirStream::$dirs['shared']=$files; OC_FakeDirStream::$dirs['shared'.$path] = $files;
return opendir('fakedir://shared'); return opendir('fakedir://shared'.$path);
} else { } else {
$source = $this->getSource($path); $source = $this->getSource($path);
if ($source) { if ($source) {

View File

@ -5,7 +5,6 @@ require_once('apps/files_versions/versions.php');
$userDirectory = "/".OCP\USER::getUser()."/files"; $userDirectory = "/".OCP\USER::getUser()."/files";
$source = $_GET['source']; $source = $_GET['source'];
$source = strip_tags( $source );
if( OCA_Versions\Storage::isversioned( $source ) ) { if( OCA_Versions\Storage::isversioned( $source ) ) {
@ -14,9 +13,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) {
$versionsFormatted = array(); $versionsFormatted = array();
foreach ( $versions AS $version ) { foreach ( $versions AS $version ) {
$versionsFormatted[] = OCP\Util::formatDate( doubleval($version) );
$versionsFormatted[] = OCP\Util::formatDate( $version );
} }
$versionsSorted = array_reverse( $versions ); $versionsSorted = array_reverse( $versions );

View File

@ -38,13 +38,13 @@ if ( isset( $_GET['path'] ) ) {
$tmpl->assign( 'outcome_stat', 'success' ); $tmpl->assign( 'outcome_stat', 'success' );
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) ); $tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
} else { } else {
$tmpl->assign( 'outcome_stat', 'failure' ); $tmpl->assign( 'outcome_stat', 'failure' );
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( $_GET['revert'] ) ); $tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
} }

View File

@ -104,9 +104,9 @@ function createVersionsDropdown(filename, files) {
} }
function addVersion(revision ) { function addVersion(revision ) {
name=formatDate(revision*1000); name=formatDate(revision.version*1000);
var version=$('<option/>'); var version=$('<option/>');
version.attr('value',revision); version.attr('value',revision.version);
version.text(name); version.text(name);
// } else { // } else {

View File

@ -20,13 +20,11 @@ if( isset( $_['message'] ) ) {
echo('<p><em>Revert a file to a previous version by clicking on its revert button</em></p><br />'); echo('<p><em>Revert a file to a previous version by clicking on its revert button</em></p><br />');
foreach ( $_['versions'] as $v ) { foreach ( $_['versions'] as $v ) {
echo ' '; echo ' ';
echo OCP\Util::formatDate( $v['version'] ); echo OCP\Util::formatDate( doubleval($v['version']) );
echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php').'?path='.urlencode( $_['path'] ).'&revert='. $v['version'] .'" class="button">Revert</a><br /><br />'; echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php').'?path='.urlencode( $_['path'] ).'&revert='. $v['version'] .'" class="button">Revert</a><br /><br />';
if ( $v['cur'] ) { echo ' (<b>Current</b>)'; } if ( $v['cur'] ) { echo ' (<b>Current</b>)'; }
echo '<br /><br />'; echo '<br /><br />';
} }
} }

View File

@ -36,6 +36,7 @@ class OC_App{
static private $appInfo = array(); static private $appInfo = array();
static private $appTypes = array(); static private $appTypes = array();
static private $loadedApps = array(); static private $loadedApps = array();
static private $checkedApps = array();
/** /**
* @brief loads all apps * @brief loads all apps
@ -530,6 +531,10 @@ class OC_App{
* check if the app need updating and update when needed * check if the app need updating and update when needed
*/ */
public static function checkUpgrade($app) { public static function checkUpgrade($app) {
if (in_array($app, self::$checkedApps)) {
return;
}
self::$checkedApps[] = $app;
$versions = self::getAppVersions(); $versions = self::getAppVersions();
$currentVersion=OC_App::getAppVersion($app); $currentVersion=OC_App::getAppVersion($app);
if ($currentVersion) { if ($currentVersion) {