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
* 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 (
* id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
* userid VARCHAR(255),
@ -35,6 +22,7 @@
* timezone TEXT,
* components VARCHAR(20)
* );
*
*/
/**
@ -212,7 +200,20 @@ class OC_Calendar_Calendar{
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
* @param string $name name of the calendar
@ -238,6 +239,11 @@ class OC_Calendar_Calendar{
list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
return $userid;
}
/*
* @brief returns the possible color for calendars
* @return array
*/
public static function getCalendarColorOptions(){
return array(
'#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){
return array(
'url' => OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'],

View File

@ -5,6 +5,25 @@
* later.
* 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

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_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_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://'))
);
}

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

View File

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

View File

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

View File

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

View File

@ -38,13 +38,13 @@ if ( isset( $_GET['path'] ) ) {
$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 {
$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 ) {
name=formatDate(revision*1000);
name=formatDate(revision.version*1000);
var version=$('<option/>');
version.attr('value',revision);
version.attr('value',revision.version);
version.text(name);
// } 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 />');
foreach ( $_['versions'] as $v ) {
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 />';
if ( $v['cur'] ) { echo ' (<b>Current</b>)'; }
echo '<br /><br />';
}
}

View File

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