diff --git a/apps/bookmarks/addBm.php b/apps/bookmarks/addBm.php index a2a39134ea..a7cdcee8fa 100644 --- a/apps/bookmarks/addBm.php +++ b/apps/bookmarks/addBm.php @@ -41,6 +41,5 @@ $metadata = getURLMetadata($url); $tmpl->assign('URL', htmlentities($metadata['url'])); $tmpl->assign('TITLE', htmlentities($metadata['title'])); -$tmpl->assign('DESCRIPTION', htmlentities($metadata['description'])); $tmpl->printPage(); diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php index 0dc83d9014..0a7cdfc9be 100644 --- a/apps/bookmarks/ajax/addBookmark.php +++ b/apps/bookmarks/ajax/addBookmark.php @@ -40,15 +40,14 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ //FIXME: Detect when user adds a known URL $query = OC_DB::prepare(" INSERT INTO *PREFIX*bookmarks - (url, title, description, user_id, public, added, lastmodified) - VALUES (?, ?, ?, ?, 0, $_ut, $_ut) + (url, title, user_id, public, added, lastmodified) + VALUES (?, ?, ?, 0, $_ut, $_ut) "); $params=array( htmlspecialchars_decode($_GET["url"]), htmlspecialchars_decode($_GET["title"]), - htmlspecialchars_decode($_GET["description"]), OC_User::getUser() ); $query->execute($params); diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php index b427a175e5..e205f69bf5 100644 --- a/apps/bookmarks/ajax/editBookmark.php +++ b/apps/bookmarks/ajax/editBookmark.php @@ -41,14 +41,13 @@ $bookmark_id = (int)$_GET["id"]; $query = OC_DB::prepare(" UPDATE *PREFIX*bookmarks - SET url = ?, title =?, description = ?, lastmodified = $_ut + SET url = ?, title =?, lastmodified = $_ut WHERE id = $bookmark_id "); $params=array( htmlspecialchars_decode($_GET["url"]), htmlspecialchars_decode($_GET["title"]), - htmlspecialchars_decode($_GET["description"]), ); $query->execute($params); diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php index 8e9bda0bc2..f2c81256bb 100644 --- a/apps/bookmarks/ajax/updateList.php +++ b/apps/bookmarks/ajax/updateList.php @@ -59,7 +59,7 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ } $query = OC_DB::prepare(' - SELECT id, url, title, description, + SELECT id, url, title, CASE WHEN *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id THEN GROUP_CONCAT( tag ' .$_gc_separator. ' ) ELSE \' \' diff --git a/apps/bookmarks/appinfo/app.php b/apps/bookmarks/appinfo/app.php index 33b7ba6144..44a1e47dff 100644 --- a/apps/bookmarks/appinfo/app.php +++ b/apps/bookmarks/appinfo/app.php @@ -1,27 +1,14 @@ . -* +* Copyright (c) 2011 Marvin Thomas Rabe +* Copyright (c) 2011 Arthur Schiwon +* This file is licensed under the Affero General Public License version 3 or +* later. +* See the COPYING-README file. */ OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' )); OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OC_Helper::linkTo( 'bookmarks', 'index.php' ), 'icon' => OC_Helper::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => 'Bookmarks' )); +OC_App::registerPersonal('bookmarks', 'settings'); diff --git a/apps/bookmarks/appinfo/database.xml b/apps/bookmarks/appinfo/database.xml index c30db8bd0c..fca38ad84b 100644 --- a/apps/bookmarks/appinfo/database.xml +++ b/apps/bookmarks/appinfo/database.xml @@ -29,13 +29,6 @@ true 140 - - description - text - - false - 255 - user_id text diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php index d674e595a8..f66d98a8cc 100644 --- a/apps/bookmarks/bookmarksHelper.php +++ b/apps/bookmarks/bookmarksHelper.php @@ -19,10 +19,6 @@ function getURLMetadata($url) { $metadata['title'] = htmlspecialchars_decode(@$match[1]); $meta = get_meta_tags($url); - - if(array_key_exists('description', $meta)) { - $metadata['description'] = $meta['description']; - } return $metadata; } \ No newline at end of file diff --git a/apps/bookmarks/css/bookmarks.css b/apps/bookmarks/css/bookmarks.css index 0fc6a2ad60..233d4a0294 100644 --- a/apps/bookmarks/css/bookmarks.css +++ b/apps/bookmarks/css/bookmarks.css @@ -12,34 +12,13 @@ padding: 0.5ex; } -.bookmark_actions { - font-size: smaller; - color: #ff44ff; - padding-left: 4em; -} - -.bookmark_actions span:hover { - cursor: pointer; - text-decoration: underline; -} - -.bookmarks_sorting { - float: left; - margin-left: 2em; -} - -.bookmarks_sorting li { - padding: 1ex 1em; - border: 1px solid gray; - -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; -} - -.bookmarks_sorting_active { - font-weight: bold; -} - .bookmarks_add { display: none; + margin-top: 45px; +} + +.bookmarks_list { + margin-top: 45px; } .bookmarks_addBml { @@ -56,15 +35,28 @@ width: 20em; } +.bookmark_actions { + display: none; + font-size: smaller; + color: #666; + padding-left: 4em; +} + +.bookmark_actions span:hover { + cursor: pointer; + text-decoration: underline; +} + .bookmark_single { - margin-left: 2em; - margin-top: 3ex; - padding: 0.5ex; -/* border-bottom: 1px solid black; */ + padding: 0.5em 1em; } .bookmark_single:hover { - background-color: #ccccff; + background-color: #EAEAEA; +} + +.bookmark_single:hover .bookmark_actions { + display: block; } .bookmark_title { @@ -77,14 +69,10 @@ color: green; } -.bookmark_tags { +.bookmark_tag { color: #ff3333; } -.clear { - clear:both; -} - .loading_meta { display: none; margin-left: 5px; diff --git a/apps/bookmarks/js/addBm.js b/apps/bookmarks/js/addBm.js index 7c914f2338..6e13b59bb2 100644 --- a/apps/bookmarks/js/addBm.js +++ b/apps/bookmarks/js/addBm.js @@ -5,11 +5,10 @@ $(document).ready(function() { function addBookmark(event) { var url = $('#bookmark_add_url').val(); var title = $('#bookmark_add_title').val(); - var description = $('#bookmark_add_description').val(); var tags = $('#bookmark_add_tags').val(); $.ajax({ url: 'ajax/addBookmark.php', - data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + encodeURI(description) + '&tags=' + encodeURI(tags), + data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags), success: function(data){ location.href='index.php'; } diff --git a/apps/bookmarks/js/bookmarks.js b/apps/bookmarks/js/bookmarks.js index 8c0b74b6c6..51646e5382 100644 --- a/apps/bookmarks/js/bookmarks.js +++ b/apps/bookmarks/js/bookmarks.js @@ -12,9 +12,6 @@ $(document).ready(function() { $(window).scroll(updateOnBottom); $('#bookmark_add_url').focusout(getMetadata); - $('.' + bookmarks_sorting).addClass('bookmarks_sorting_active'); - - $('.bookmarks_sorting li').click(function(event){changeSorting(this)}); $('.bookmarks_list').empty(); getBookmarks(); @@ -39,6 +36,7 @@ function getBookmarks() { for(var i in bookmarks.data) { updateBookmarksList(bookmarks.data[i]); } + $('.bookmark_link').click(recordClick); $('.bookmark_delete').click(delBookmark); $('.bookmark_edit').click(showBookmark); @@ -57,36 +55,21 @@ function getMetadata() { success: function(pageinfo){ $('#bookmark_add_url').val(pageinfo.data.url); $('#bookmark_add_title').val(pageinfo.data.title); - if (pageinfo.data.description !== undefined){ - $('#bookmark_add_description').val(pageinfo.data.description); - } $('.loading_meta').css('display','none'); } }); } -function changeSorting(sortEl) { - $('.' + bookmarks_sorting).removeClass('bookmarks_sorting_active'); - bookmarks_sorting = sortEl.className; - $('.' + bookmarks_sorting).addClass('bookmarks_sorting_active'); - - $('.bookmarks_list').empty(); - bookmarks_page = 0; - bookmarks_loading = false; - getBookmarks(); -} - // function addBookmark() { // Instead of creating editBookmark() function, Converted the one above to // addOrEditBookmark() to make .js file more compact. function addOrEditBookmark(event) { var id = $('#bookmark_add_id').val(); - var url = encodeEntities($('#bookmark_add_url').val()) - var title = encodeEntities($('#bookmark_add_title').val()) - var description = encodeEntities($('#bookmark_add_description').val()) - var tags = encodeEntities($('#bookmark_add_tags').val()) - var taglist = tags.split(' ') + var url = encodeEntities($('#bookmark_add_url').val()); + var title = encodeEntities($('#bookmark_add_title').val()); + var tags = encodeEntities($('#bookmark_add_tags').val()); + var taglist = tags.split(' '); var tagshtml = ''; for ( var i=0, len=taglist.length; i' + taglist[i] + ' '; @@ -95,16 +78,15 @@ function addOrEditBookmark(event) { if (id == 0) { $.ajax({ url: 'ajax/addBookmark.php', - data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + encodeURI(description) + '&tags=' + encodeURI(tags), + data: 'url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags), success: function(response){ var bookmark_id = response.data; $('.bookmarks_add').slideToggle(); $('.bookmarks_add').children('p').children('.bookmarks_input').val(''); $('.bookmarks_list').prepend( '
' + - '

' + title + '

' + + '

' + title + '

' + '

' + url + '

' + - '

' + description + '

' + '

' + tagshtml + '

' + '

Delete Edit

' + '
' @@ -115,8 +97,7 @@ function addOrEditBookmark(event) { else { $.ajax({ url: 'ajax/editBookmark.php', - data: 'id=' + id + '&url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&description=' + - encodeURI(description) + '&tags=' + encodeURI(tags), + data: 'id=' + id + '&url=' + encodeURI(url) + '&title=' + encodeURI(title) + '&tags=' + encodeURI(tags), success: function(){ $('.bookmarks_add').slideToggle(); $('.bookmarks_add').children('p').children('.bookmarks_input').val(''); @@ -124,7 +105,6 @@ function addOrEditBookmark(event) { var record = $('.bookmark_single[data-id = "' + id + '"]'); record.children('.bookmark_url:first').text(url); - record.children('.bookmark_description:first').text(description); var record_title = record.children('.bookmark_title:first').children('a:first'); record_title.attr('href', url); @@ -138,7 +118,7 @@ function addOrEditBookmark(event) { } function delBookmark(event) { - var record = $(this).parent().parent() + var record = $(this).parent().parent(); $.ajax({ url: 'ajax/delBookmark.php', data: 'url=' + encodeURI($(this).parent().parent().children('.bookmark_url:first').text()), @@ -151,7 +131,6 @@ function showBookmark(event) { $('#bookmark_add_id').val(record.attr('data-id')); $('#bookmark_add_url').val(record.children('.bookmark_url:first').text()); $('#bookmark_add_title').val(record.children('.bookmark_title:first').text()); - $('#bookmark_add_description').val(record.children('.bookmark_description:first').text()); $('#bookmark_add_tags').val(record.children('.bookmark_tags:first').text()); if ($('.bookmarks_add').css('display') == 'none') { @@ -163,10 +142,6 @@ function showBookmark(event) { } -function editBookmark(event) { - -} - function updateBookmarksList(bookmark) { var tags = encodeEntities(bookmark.tags).split(' '); var taglist = ''; @@ -178,9 +153,8 @@ function updateBookmarksList(bookmark) { } $('.bookmarks_list').append( '
' + - '

' + encodeEntities(bookmark.title) + '

' + + '

' + encodeEntities(bookmark.title) + '

' + '

' + encodeEntities(bookmark.url) + '

' + - '

' + encodeEntities(bookmark.description) + '

' + '

' + taglist + '

' + '

Delete Edit

' + '
' diff --git a/apps/bookmarks/settings.php b/apps/bookmarks/settings.php new file mode 100644 index 0000000000..8186472dec --- /dev/null +++ b/apps/bookmarks/settings.php @@ -0,0 +1,13 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +$tmpl = new OC_Template( 'bookmarks', 'settings'); + +OC_Util::addScript('bookmarks','settings'); + +return $tmpl->fetchPage(); diff --git a/apps/bookmarks/templates/addBm.php b/apps/bookmarks/templates/addBm.php index 36f04e135b..c285c3579c 100644 --- a/apps/bookmarks/templates/addBm.php +++ b/apps/bookmarks/templates/addBm.php @@ -1,7 +1,6 @@

-

diff --git a/apps/bookmarks/templates/list.php b/apps/bookmarks/templates/list.php index d73657b36a..ccfe74f008 100644 --- a/apps/bookmarks/templates/list.php +++ b/apps/bookmarks/templates/list.php @@ -1,27 +1,25 @@ + + * Copyright (c) 2011 Arthur Schiwon + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ +?> -

t('Bookmarks with tag: ') . urldecode($_GET["tag"]) : $l->t('All bookmarks'); ?>

-
-   - t('Add page to ownCloud'); ?> +
+

-

-

-
-
    -
  • t('Recent Bookmarks'); ?>
  • -
  • t('Most clicks'); ?>
  • -
-
-
t('You have no bookmarks'); ?> -
+
\ No newline at end of file diff --git a/apps/bookmarks/templates/settings.php b/apps/bookmarks/templates/settings.php new file mode 100644 index 0000000000..b7da441c2f --- /dev/null +++ b/apps/bookmarks/templates/settings.php @@ -0,0 +1,14 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ +?> +
+
+ t('Bookmarklet:');?> t('Add page to ownCloud'); ?> +
t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.'); ?>
+
+
diff --git a/apps/calendar/ajax/createcalendar.php b/apps/calendar/ajax/createcalendar.php index 82176d4368..3fb2e8398a 100644 --- a/apps/calendar/ajax/createcalendar.php +++ b/apps/calendar/ajax/createcalendar.php @@ -15,7 +15,7 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $userid = OC_User::getUser(); -$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], $_POST['description'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']); +$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']); OC_Calendar_Calendar::setCalendarActive($calendarid, 1); $calendar = OC_Calendar_Calendar::findCalendar($calendarid); $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); diff --git a/apps/calendar/ajax/getcal.php b/apps/calendar/ajax/getcal.php index 3d43677075..a65c6cf260 100644 --- a/apps/calendar/ajax/getcal.php +++ b/apps/calendar/ajax/getcal.php @@ -28,674 +28,43 @@ $select_year = $_GET["year"]; $user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); foreach($events as $event) { - if($select_year != substr($event['startdate'], 0, 4) && $event["repeating"] == false) + if ($select_year != substr($event['startdate'], 0, 4)) continue; - if($select_year == substr($event['startdate'], 0, 4) && $event["repeating"] == false){ - $object = Sabre_VObject_Reader::read($event['calendardata']); - $vevent = $object->VEVENT; - $dtstart = $vevent->DTSTART; - $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); - $start_dt = $dtstart->getDateTime(); - $start_dt->setTimezone(new DateTimeZone($user_timezone)); - $end_dt = $dtend->getDateTime(); - $end_dt->setTimezone(new DateTimeZone($user_timezone)); - $year = $start_dt->format('Y'); - $month = $start_dt->format('n') - 1; // return is 0 based - $day = $start_dt->format('j'); - $hour = $start_dt->format('G'); - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop) - { - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - if ($hour == 'allday') - { - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])) - { - $return[$year][$month][$day][$hour][] = $return_event; - } - else - { - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } + $object = Sabre_VObject_Reader::read($event['calendardata']); + $vevent = $object->VEVENT; + $dtstart = $vevent->DTSTART; + $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); + $start_dt = $dtstart->getDateTime(); + $start_dt->setTimezone(new DateTimeZone($user_timezone)); + $end_dt = $dtend->getDateTime(); + $end_dt->setTimezone(new DateTimeZone($user_timezone)); + $year = $start_dt->format('Y'); + $month = $start_dt->format('n') - 1; // return is 0 based + $day = $start_dt->format('j'); + $hour = $start_dt->format('G'); + if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { + $hour = 'allday'; } - if($event["repeating"] == 1){ - $object = Sabre_VObject_Reader::read($event['calendardata']); - $vevent = $object->VEVENT; - //echo substr_count($event["calendardata"], "EXDATE"); - $numofelements = substr_count($vevent->RRULE, ";"); - $properties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false"); - $exruleproperties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false"); - $byday = array("MO"=>"false", "TU"=>"false", "WE"=>"false", "TH"=>"false", "FR"=>"false", "SA"=>"false", "SU"=>"false"); - if($numofelements != 0){ - $rrule = explode(";", $vevent->RRULE); - for($i = 0;$i <= $numofelements;$i++){ - $rule = explode("=", $rrule[$i]); - $property = $rule[0]; - $value = $rule[1]; - $properties[$property] = $value; - } - if($properties["BYDAY"] != "false"){ - $numofdays = substr_count($properties["BYDAY"], ","); - if($numofdays == 0){ - if(strlen($properties["BYDAY"]) != 2){ - $lenght = strlen($properties["BYDAY"]); - switch($lenght){ - case "3": - $properties["BYSETPOS"] = substr($properties["BYDAY"],0,1); - $properties["BYDAY"] = substr($properties["BYDAY"],1,2); - break; - case "4": - $properties["BYSETPOS"] = substr($properties["BYDAY"],0,2); - $properties["BYDAY"] = substr($properties["BYDAY"],2,2); - break; - case "5": - $properties["BYSETPOS"] = substr($properties["BYDAY"],0,3); - $properties["BYDAY"] = substr($properties["BYDAY"],3,2); - break; - case "6": - $properties["BYSETPOS"] = substr($properties["BYDAY"],0,4); - $properties["BYDAY"] = substr($properties["BYDAY"],4,2); - break; - } - } - $byday[$properties["BYDAY"]] = true; - - }else{ - $days = explode(",", $properties["BYDAY"]); - for($i = 0;$i <= $numofdays;$i++){ - $day = $days[$i]; - $byday[$day] = true; - } - } - } - }else{ - $rule = explode("=", $vevent->RRULE); - $properties[$rule[0]] = $rule[1]; - } - if($properties["INTERVAL"] == "false"){ - $properties["INTERVAL"] = 1; - } - $count = 0; //counts all loops - $countedoutputs = 0; //counts only the outputs - $countchecker = true; - $dtstart = $vevent->DTSTART; - $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent); - $start_dt = $dtstart->getDateTime(); - $start_dt->setTimezone(new DateTimeZone($user_timezone)); - $end_dt = $dtend->getDateTime(); - $end_dt->setTimezone(new DateTimeZone($user_timezone)); - $firststart_year = $start_dt->format('Y'); - $firststart_month = $start_dt->format('n'); - $firststart_day = $start_dt->format('j'); - $hour = $start_dt->format('G'); - $interval = 0; - if($properties["UNTIL"] != "false"){ - $until = $properties["UNTIL"]; - $until_year = substr($until, 0, 4); - $until_month = substr($until, 4, 2); - $until_day = substr($until, 6, 2); - } - //print_r($properties); - //print_r($byday); - if($properties["FREQ"] == "DAILY"){ - if($properties["BYDAY"] == "false"){ - $byday = array("MO"=>"1", "TU"=>"1", "WE"=>"1", "TH"=>"1", "FR"=>"1", "SA"=>"1", "SU"=>"1"); - } - while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){ - if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){ - $newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = date("j", $newunixtime); - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - } - $count++; - } - } - if($properties["FREQ"] == "WEEKLY"){ - if($properties["BYDAY"] == "false"){ - $byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year)), 0, 2))] = "1"; - } - while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){ - if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){ - $newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = date("j", $newunixtime); - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - } - $count++; - } - } - if($properties["FREQ"] == "MONTHLY"){ - if(substr_count($properties["BYMONTHDAY"], ",") != 0){ - $numofBYMONTHDAY = substr_count($properties["BYMONTHDAY"], ","); - if($numofBYMONTHDAY == 0){ - $BYMONTHDAY = array(); - $BYMONTHDAY[0] = $properties["BYMONTHDAY"]; - }else{ - $BYMONTHDAY = explode(",", $properties["BYMONTHDAY"]); - } - while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){ - for($i = 0;$i <= $numofBYMONTHDAY;$i++){ - $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $BYMONTHDAY[$i], $firststart_year); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = date("j", $newunixtime); - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - } - $count++; - } - } - //if($properties["BYMONTHDAY"] != "false"){ - if($properties["BYSETPOS"] == "false"){ - while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){ - $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = date("j", $newunixtime); - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - $count++; - } - }else{ - if(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] >= 1){ - while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){ - $lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)); - $matches = 0; - $matchedday = ""; - for($i = 1;$i <= $lastdayofmonth;$i++){ - $thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)); - $thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2)); - //echo $thisdayname . " " . $thisday . "\n"; - if($byday[$thisdayname] == 1){ - $matches++; - } - if($matches == $properties["BYSETPOS"]){ - $matchedday = $thisday; - $i = 32; - } - } - $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = $matchedday; - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - $count++; - } - }elseif(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] <= -1){ - while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){ - $lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), 1, $firststart_year)); - $matches = 0; - $matchedday = ""; - for($i = $lastdayofmonth;$i >= 1;$i--){ - $thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)); - $thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2)); - //echo $thisdayname . " " . $thisday . "\n"; - if($byday[$thisdayname] == 1){ - $matches++; - } - if($matches == $properties["BYSETPOS"]){ - $matchedday = $thisday; - $i = 0; - } - } - $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = $matchedday; - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - $count++; - } - //} - } - } - if(strlen($properties["BYDAY"]) == 2){ - while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){ - if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)), 0, 2))] == "1"){ - $newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = date("j", $newunixtime); - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - } - $count++; - } - }else{ - while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){ - $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval)); - $year = date("Y", $newunixtime); - $month = $month - 1; // return is 0 based - $day = $dateofweekone; - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - $count++; - } - } - } - if($properties["FREQ"] == "YEARLY"){ - if($properties["BYMONTH"] != "false"){ - if($properties["BYMONTHDAY"] == false){ - $properties["BYMONTHDAY"] = date("j", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year)); - } - if($properties["BYDAY"] == "false"){ - while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){ - $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval)); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = date("j", $newunixtime); - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - $count++; - } - } - if(strlen($properties["BYDAY"]) == 2){ - while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){ - $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval)); - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = date("j", $newunixtime); - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - $count++; - } - }else{ - $number = substr($properties["BYDAY"],0,1); - $weekday = substr($properties["BYDAY"],1,2); - $month = $properties["BYMONTH"]; - $dateofweekone = ""; - for($i = 0; $i <= 7;$i++){ - if(strtoupper(substr(date("D", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year)), 0, 2)) == $weekday){ - $dateofweekone = date("j", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year)); - $i = 8; - } - } - if($number != 1){ - $dateofweekone = $dateofweekone + (7 * ($number - 1)); - } - while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){ - $newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval)); - $year = date("Y", $newunixtime); - $month = $month - 1; // return is 0 based - $day = $dateofweekone; - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - $count++; - } - } - }elseif($properties["BYYEARDAY"] != false){ - $numofyeardays = substr_count($properties["BYYEARDAY"], ","); - if($numofyeardays == 0){ - $yeardays = array(); - $yeardays[0] = $properties["BYYEARDAY"]; - }else{ - $yeardays = explode(",", $properties["BYYEARDAY"]); - } - while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval)) + ($yeardays[$numofyeardays]-1) * 86400) <= $select_year && $countchecker == true){ - for($i = 0;$i <= $numofyeardays;$i++){ - $newunixtime = mktime(0,0,0, 1, 1, $firststart_year + ($count * $interval)) + ($yeardays[$i] -1) * 86400; - $year = date("Y", $newunixtime); - $month = date("n", $newunixtime) - 1; // return is 0 based - $day = date("j", $newunixtime); - if($properties["UNTIL"] != "false"){ - if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){ - break; - } - } - if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) { - $hour = 'allday'; - } - $return_event = array(); - foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){ - $return_event[$prop] = $event[$prop]; - } - $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); - $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); - $return_event['description'] = $event['summary']; - $interval = $properties["INTERVAL"]; - $countedoutputs++; - if($properties["COUNT"] != "false"){ - if($countedoutputs == $properties["COUNT"]){ - $countchecker = false; - } - } - if ($hour == 'allday'){ - $return_event['allday'] = true; - } - if (isset($return[$year][$month][$day][$hour])){ - $return[$year][$month][$day][$hour][] = $return_event; - }else{ - $return[$year][$month][$day][$hour] = array(1 => $return_event); - } - } - $count++; - } - } - } + + $return_event = array(); + foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop) + { + $return_event[$prop] = $event[$prop]; + } + $return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i')); + $return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i')); + $return_event['description'] = $event['summary']; + if ($hour == 'allday') + { + $return_event['allday'] = true; + } + if (isset($return[$year][$month][$day][$hour])) + { + $return[$year][$month][$day][$hour][] = $return_event; + } + else + { + $return[$year][$month][$day][$hour] = array(1 => $return_event); } } OC_JSON::encodedPrint($return); diff --git a/apps/calendar/ajax/newcalendar.php b/apps/calendar/ajax/newcalendar.php index e01ae01ee8..f00dd0fb86 100644 --- a/apps/calendar/ajax/newcalendar.php +++ b/apps/calendar/ajax/newcalendar.php @@ -15,7 +15,6 @@ OC_JSON::checkAppEnabled('calendar'); $calendar = array( 'id' => 'new', 'displayname' => '', - 'description' => '', 'calendarcolor' => '', ); $tmpl = new OC_Template('calendar', 'part.editcalendar'); diff --git a/apps/calendar/ajax/updatecalendar.php b/apps/calendar/ajax/updatecalendar.php index 5cf48d50ea..a81644ded1 100644 --- a/apps/calendar/ajax/updatecalendar.php +++ b/apps/calendar/ajax/updatecalendar.php @@ -15,7 +15,7 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $calendarid = $_POST['id']; -OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']); +OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], null, null, null, $_POST['color']); OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']); $calendar = OC_Calendar_Calendar::findCalendar($calendarid); $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); diff --git a/apps/calendar/appinfo/database.xml b/apps/calendar/appinfo/database.xml index bf92179c40..7f7b645755 100644 --- a/apps/calendar/appinfo/database.xml +++ b/apps/calendar/appinfo/database.xml @@ -153,12 +153,6 @@ 4 - - description - clob - false - - calendarorder integer diff --git a/apps/calendar/import.php b/apps/calendar/import.php index 4682234944..211791f551 100644 --- a/apps/calendar/import.php +++ b/apps/calendar/import.php @@ -23,7 +23,7 @@ if($_GET["import"] == "existing"){ $filename = "/" . $_GET["file"]; } }else{ - $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname'], $_POST['description']); + $id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']); OC_Calendar_Calendar::setCalendarActive($id, 1); $calid = $id; if($_POST["path"] != ""){ diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php index 4549af8b3c..959cb14bf8 100644 --- a/apps/calendar/lib/calendar.php +++ b/apps/calendar/lib/calendar.php @@ -30,7 +30,6 @@ * uri VARCHAR(100), * active INTEGER UNSIGNED NOT NULL DEFAULT '0', * ctag INTEGER UNSIGNED NOT NULL DEFAULT '0', - * description TEXT, * calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0', * calendarcolor VARCHAR(10), * timezone TEXT, @@ -94,14 +93,13 @@ class OC_Calendar_Calendar{ * @brief Creates a new calendar * @param string $userid * @param string $name - * @param string $description * @param string $components Default: "VEVENT,VTODO,VJOURNAL" * @param string $timezone Default: null * @param integer $order Default: 1 * @param string $color Default: null * @return insertid */ - public static function addCalendar($userid,$name,$description,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){ + public static function addCalendar($userid,$name,$components='VEVENT,VTODO,VJOURNAL',$timezone=null,$order=0,$color=null){ $all = self::allCalendars($userid); $uris = array(); foreach($all as $i){ @@ -110,8 +108,8 @@ class OC_Calendar_Calendar{ $uri = self::createURI($name, $uris ); - $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' ); - $result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components)); + $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' ); + $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components)); return OC_DB::insertid(); } @@ -121,18 +119,17 @@ class OC_Calendar_Calendar{ * @param string $principaluri * @param string $uri * @param string $name - * @param string $description * @param string $components * @param string $timezone * @param integer $order * @param string $color * @return insertid */ - public static function addCalendarFromDAVData($principaluri,$uri,$name,$description,$components,$timezone,$order,$color){ + public static function addCalendarFromDAVData($principaluri,$uri,$name,$components,$timezone,$order,$color){ $userid = self::extractUserID($principaluri); - $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,description,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?,?)' ); - $result = $stmt->execute(array($userid,$name,$uri,1,$description,$order,$color,$timezone,$components)); + $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' ); + $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components)); return OC_DB::insertid(); } @@ -141,7 +138,6 @@ class OC_Calendar_Calendar{ * @brief Edits a calendar * @param integer $id * @param string $name Default: null - * @param string $description Default: null * @param string $components Default: null * @param string $timezone Default: null * @param integer $order Default: null @@ -150,20 +146,19 @@ class OC_Calendar_Calendar{ * * Values not null will be set */ - public static function editCalendar($id,$name=null,$description=null,$components=null,$timezone=null,$order=null,$color=null){ + public static function editCalendar($id,$name=null,$components=null,$timezone=null,$order=null,$color=null){ // Need these ones for checking uri $calendar = self::findCalendar($id); // Keep old stuff if(is_null($name)) $name = $calendar['name']; - if(is_null($description)) $description = $calendar['description']; if(is_null($components)) $components = $calendar['components']; if(is_null($timezone)) $timezone = $calendar['timezone']; if(is_null($order)) $order = $calendar['calendarorder']; if(is_null($color)) $color = $calendar['color']; - $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,description=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' ); - $result = $stmt->execute(array($name,$description,$order,$color,$timezone,$components,$id)); + $stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' ); + $result = $stmt->execute(array($name,$order,$color,$timezone,$components,$id)); return true; } diff --git a/apps/calendar/lib/connector_sabre.php b/apps/calendar/lib/connector_sabre.php index b94e6fb3ae..13a542fcca 100644 --- a/apps/calendar/lib/connector_sabre.php +++ b/apps/calendar/lib/connector_sabre.php @@ -102,13 +102,12 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract { } if(!isset($newValues['displayname'])) $newValues['displayname'] = 'unnamed'; - if(!isset($newValues['description'])) $newValues['description'] = ''; if(!isset($newValues['components'])) $newValues['components'] = 'VEVENT,VTODO'; if(!isset($newValues['timezone'])) $newValues['timezone'] = null; if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = 0; if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null; - return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['description'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']); + return OC_Calendar_Calendar::addCalendarFromDAVData($principalUri,$calendarUri,$newValues['displayname'],$newValues['components'],$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']); } /** @@ -191,12 +190,11 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract { // Success if(!isset($newValues['displayname'])) $newValues['displayname'] = null; - if(!isset($newValues['description'])) $newValues['description'] = null; if(!isset($newValues['timezone'])) $newValues['timezone'] = null; if(!isset($newValues['calendarorder'])) $newValues['calendarorder'] = null; if(!isset($newValues['calendarcolor'])) $newValues['calendarcolor'] = null; - OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],$newValues['description'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']); + OC_Calendar_Calendar::editCalendar($calendarId,$newValues['displayname'],null,$newValues['timezone'],$newValues['calendarorder'],$newValues['calendarcolor']); return true; diff --git a/apps/calendar/templates/part.editcalendar.php b/apps/calendar/templates/part.editcalendar.php index c2c22913be..b4ff573ec8 100644 --- a/apps/calendar/templates/part.editcalendar.php +++ b/apps/calendar/templates/part.editcalendar.php @@ -25,12 +25,6 @@ - - t('Description') ?> - - - - t('Calendar color') ?> diff --git a/apps/calendar/templates/part.import.php b/apps/calendar/templates/part.import.php index 3749367437..b8805e6b6e 100644 --- a/apps/calendar/templates/part.import.php +++ b/apps/calendar/templates/part.import.php @@ -31,11 +31,6 @@ foreach($calendars as $calendar){ -t('Description') ?> - - - -

@@ -65,8 +60,7 @@ function importcal(importtype){ } if(importtype == "new"){ var calname = $("#displayname").val(); - var description = $("#description").val(); - $.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'description':description, 'path':path, 'file':file}, function(){ + $.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'path':path, 'file':file}, function(){ $("#importdialog").dialog('destroy').remove(); $("#importdialogholder").remove(); }); diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php index 4f50928393..56fb55d235 100644 --- a/apps/calendar/templates/settings.php +++ b/apps/calendar/templates/settings.php @@ -6,8 +6,6 @@ * later. * See the COPYING-README file. */ -OC_UTIL::addScript('', 'jquery.multiselect'); -OC_UTIL::addStyle('', 'jquery.multiselect'); ?>
diff --git a/apps/contacts/ajax/addcard.php b/apps/contacts/ajax/addcard.php index ee95513732..e7b56a7bf0 100644 --- a/apps/contacts/ajax/addcard.php +++ b/apps/contacts/ajax/addcard.php @@ -37,16 +37,28 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ } $fn = $_POST['fn']; +$values = $_POST['value']; +$parameters = $_POST['parameters']; $vcard = new Sabre_VObject_Component('VCARD'); $vcard->add(new Sabre_VObject_Property('FN',$fn)); $vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_VCard::createUID())); +foreach(array('ADR', 'TEL', 'EMAIL', 'ORG') as $propname){ + $value = $values[$propname]; + if (isset($parameters[$propname])){ + $prop_parameters = $parameters[$propname]; + } else { + $prop_parameters = array(); + } + OC_Contacts_VCard::addVCardProperty($vcard, $propname, $value, $prop_parameters); +} $id = OC_Contacts_VCard::add($aid,$vcard->serialize()); $details = OC_Contacts_VCard::structureContact($vcard); +$name = $details['FN'][0]['value']; $tmpl = new OC_Template('contacts','part.details'); $tmpl->assign('details',$details); $tmpl->assign('id',$id); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page ))); +OC_JSON::success(array('data' => array( 'id' => $id, 'name' => $name, 'page' => $page ))); diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php index 68c4f65fa5..101cfabbe8 100644 --- a/apps/contacts/ajax/addproperty.php +++ b/apps/contacts/ajax/addproperty.php @@ -53,7 +53,7 @@ $name = $_POST['name']; $value = $_POST['value']; $parameters = isset($_POST['parameteres'])?$_POST['parameters']:array(); -OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters); +$property = OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters); $line = count($vcard->children) - 1; $checksum = md5($property->serialize()); diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js index 47e9bb10b1..0fcfdeaab5 100644 --- a/apps/contacts/js/interface.js +++ b/apps/contacts/js/interface.js @@ -75,7 +75,7 @@ $(document).ready(function(){ $('#contacts_addpropertyform input[type="submit"]').live('click',function(){ $.post('ajax/addproperty.php',$('#contacts_addpropertyform').serialize(),function(jsondata){ if(jsondata.status == 'success'){ - $('#contacts_cardoptions').before(jsondata.data.page); + $('#contacts_details').append(jsondata.data.page); $('#contacts_addpropertyform').remove(); $('#contacts_addcontactsparts').remove(); } @@ -129,7 +129,7 @@ $(document).ready(function(){ }); $('#contacts_setpropertyform input[type="submit"]').live('click',function(){ - $.post('ajax/setproperty.php',$('#contacts_setpropertyform').serialize(),function(jsondata){ + $.post('ajax/setproperty.php',$(this).parent('form').serialize(),function(jsondata){ if(jsondata.status == 'success'){ $('.contacts_details_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page); } diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php index bff2897384..9f15cf4bc3 100644 --- a/apps/contacts/lib/vcard.php +++ b/apps/contacts/lib/vcard.php @@ -290,6 +290,7 @@ class OC_Contacts_VCard{ } $vcard->add($property); + return $property; } /** diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php index 254d54a4e8..26a33739ac 100644 --- a/apps/contacts/templates/part.details.php +++ b/apps/contacts/templates/part.details.php @@ -1,5 +1,5 @@ - +
diff --git a/apps/contacts/templates/part.property.php b/apps/contacts/templates/part.property.php index 3469f53b0d..31fb187a0d 100644 --- a/apps/contacts/templates/part.property.php +++ b/apps/contacts/templates/part.property.php @@ -1,8 +1,8 @@ - + diff --git a/apps/media/templates/settings.php b/apps/media/templates/settings.php index da9346166e..ac813c2085 100644 --- a/apps/media/templates/settings.php +++ b/apps/media/templates/settings.php @@ -2,6 +2,6 @@
Media
Ampache address: -
+
diff --git a/core/css/styles.css b/core/css/styles.css index 5d4df586a8..46b340be96 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -34,6 +34,7 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', end input[type="text"], input[type="password"] { cursor:text; } input, select, .button, #quota, div.jp-progress, .pager li a { font-size:1em; width:10em; margin:.3em; padding:.6em .5em .4em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; } input[type="text"], input[type="password"], input[type="search"] { background:#f8f8f8; color:#555; cursor:text; } +input[type="text"], input[type="password"], input[type="search"] { -webkit-appearance:textfield; -webkit-box-sizing:content-box; } input[type="text"]:hover, input[type="text"]:focus, input[type="password"]:hover, input[type="password"]:focus, input[type="search"]:hover, input[type="search"]:focus { background:#fff; color:#333; } input[type="submit"], input[type="button"], .button, #quota, div.jp-progress, .pager li a { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; } diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 96f3d2662f..e1f8928fc9 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -32,6 +32,6 @@ -

ownCloud: t( 'web services under your control' ); ?>

+

ownCloudt( 'web services under your control' ); ?>

diff --git a/settings/js/users.js b/settings/js/users.js index 4944f3a62f..64a132b427 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -123,6 +123,10 @@ $(document).ready(function(){ $('#newuser').submit(function(event){ event.preventDefault(); var username=$('#newusername').val(); + if(username == '') { + alert('Please provide a username!'); + return false; + } var password=$('#newuserpassword').val(); var groups=$('#newusergroups').prev().children('div').data('settings').checked; $.post( diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 3c4ad08516..19bd878912 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -50,8 +50,7 @@ };?>

- ownCloud - + ownCloud , source code licensed freely under AGPL

 
t('Name'); ?> - +