Merge branch 'stable4' of git://gitorious.org/owncloud/owncloud into stable4
This commit is contained in:
commit
3e143601fe
|
@ -48,7 +48,7 @@ class PasswordHash {
|
|||
function get_random_bytes($count)
|
||||
{
|
||||
$output = '';
|
||||
if (is_readable('/dev/urandom') &&
|
||||
if (@is_readable('/dev/urandom') &&
|
||||
($fh = @fopen('/dev/urandom', 'rb'))) {
|
||||
$output = fread($fh, $count);
|
||||
fclose($fh);
|
||||
|
|
|
@ -27,7 +27,6 @@ else {
|
|||
$start = (version_compare(PHP_VERSION, '5.3.0', '>='))?DateTime::createFromFormat('U', $_GET['start']):new DateTime('@' . $_GET['start']);
|
||||
$end = (version_compare(PHP_VERSION, '5.3.0', '>='))?DateTime::createFromFormat('U', $_GET['end']):new DateTime('@' . $_GET['end']);
|
||||
$events = OC_Calendar_App::getrequestedEvents($calendar_id, $start, $end);
|
||||
|
||||
$output = array();
|
||||
foreach($events as $event){
|
||||
$output = array_merge($output, OC_Calendar_App::generateEventOutput($event, $start, $end));
|
||||
|
|
|
@ -331,26 +331,29 @@ class OC_Calendar_App{
|
|||
*/
|
||||
public static function getrequestedEvents($calendarid, $start, $end){
|
||||
$events = array();
|
||||
if($calendarid == 'shared_rw' || $_GET['calendar_id'] == 'shared_r'){
|
||||
if($calendarid == 'shared_rw' || $calendarid == 'shared_r'){
|
||||
$calendars = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::CALENDAR, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r');
|
||||
foreach($calendars as $calendar){
|
||||
$calendarevents = OC_Calendar_Object::allInPeriod($calendar['calendarid'], $start, $end);
|
||||
foreach($calendarevents as $event){
|
||||
$event['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($event['id']) . ')';
|
||||
}
|
||||
$events = array_merge($events, $calendarevents);
|
||||
}
|
||||
$singleevents = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::EVENT, 1, ($_GET['calendar_id'] == 'shared_rw')?'rw':'r');
|
||||
foreach($singleevents as $singleevent){
|
||||
$event = OC_Calendar_Object::find($singleevent['eventid']);
|
||||
$event['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($event['id']) . ')';
|
||||
$events[] = $event;
|
||||
}
|
||||
}else{
|
||||
$calendar_id = $_GET['calendar_id'];
|
||||
if (is_numeric($calendar_id)) {
|
||||
$calendar = self::getCalendar($calendar_id);
|
||||
if (is_numeric($calendarid)) {
|
||||
$calendar = self::getCalendar($calendarid);
|
||||
OCP\Response::enableCaching(0);
|
||||
OCP\Response::setETagHeader($calendar['ctag']);
|
||||
$events = OC_Calendar_Object::allInPeriod($calendar_id, $start, $end);
|
||||
$events = OC_Calendar_Object::allInPeriod($calendarid, $start, $end);
|
||||
} else {
|
||||
OCP\Util::emitHook('OC_Calendar', 'getEvents', array('calendar_id' => $calendar_id, 'events' => &$events));
|
||||
OCP\Util::emitHook('OC_Calendar', 'getEvents', array('calendar_id' => $calendarid, 'events' => &$events));
|
||||
}
|
||||
}
|
||||
return $events;
|
||||
|
|
|
@ -19,26 +19,23 @@
|
|||
<th width="75px"><?php echo $l->t("Category");?>:</th>
|
||||
<td>
|
||||
<?php
|
||||
if(count($_['categories']) == 0){
|
||||
if(count($_['categories']) == 0 || $_['categories'] == ''){
|
||||
echo $l->t('No categories selected');
|
||||
}else{
|
||||
echo '<select id="category" name="categories[]" multiple="multiple" title="' . $l->t("Select category") . '">';
|
||||
echo OCP\html_select_options($_['categories'], $_['categories'], array('combine'=>true));
|
||||
echo '</select>';
|
||||
echo '<ul>';
|
||||
foreach($_['categories'] as $categorie){
|
||||
echo '<li>' . $categorie . '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<th width="75px"> <?php echo $l->t("Calendar");?>:</th>
|
||||
<td>
|
||||
<select name="calendar" disabled="disabled">
|
||||
<option>
|
||||
<?php
|
||||
$calendar = OC_Calendar_App::getCalendar($_['calendar']);
|
||||
echo $calendar['displayname'] . ' ' . $l->t('of') . ' ' . $calendar['userid'];
|
||||
?>
|
||||
</option>
|
||||
|
||||
</select>
|
||||
<?php
|
||||
$calendar = OC_Calendar_App::getCalendar($_['calendar'], false, false);
|
||||
echo $calendar['displayname'] . ' ' . $l->t('of') . ' ' . $calendar['userid'];
|
||||
?>
|
||||
</td>
|
||||
<th width="75px"> </th>
|
||||
<td>
|
||||
|
|
|
@ -84,7 +84,8 @@
|
|||
}
|
||||
|
||||
title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
|
||||
|
||||
title = title.replace(/</, "<").replace(/>/, ">");
|
||||
|
||||
if (obj.nodeName && !selectedOpts.orig) {
|
||||
selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue