зеркало из https://github.com/nextcloud/server.git
Fix calendar colors with new calendar
This commit is contained in:
Родитель
8d4039b678
Коммит
9cfae56df5
|
@ -11,17 +11,8 @@ $l10n = new OC_L10N('calendar');
|
|||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
$calendarcolor_options = array(
|
||||
'ff0000', // "Red"
|
||||
'00ff00', // "Green"
|
||||
'ffff00', // "Yellow"
|
||||
'808000', // "Olive"
|
||||
'ffa500', // "Orange"
|
||||
'ff7f50', // "Coral"
|
||||
'ee82ee', // "Violet"
|
||||
'ecc255', // dark yellow
|
||||
);
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
|
||||
$calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
|
||||
$tmpl = new OC_Template("calendar", "part.editcalendar");
|
||||
$tmpl->assign('new', false);
|
||||
|
|
|
@ -12,6 +12,7 @@ if(!OC_USER::isLoggedIn()) {
|
|||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
|
||||
$calendar = array(
|
||||
'id' => 'new',
|
||||
'displayname' => '',
|
||||
|
@ -19,6 +20,7 @@ $calendar = array(
|
|||
);
|
||||
$tmpl = new OC_Template('calendar', 'part.editcalendar');
|
||||
$tmpl->assign('new', true);
|
||||
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
|
||||
$tmpl->assign('calendar', $calendar);
|
||||
$tmpl->printPage();
|
||||
?>
|
||||
|
|
|
@ -479,7 +479,8 @@ Calendar={
|
|||
},
|
||||
newCalendar:function(object){
|
||||
var tr = $(document.createElement('tr'))
|
||||
.load(OC.filePath('calendar', 'ajax', 'newcalendar.php'));
|
||||
.load(OC.filePath('calendar', 'ajax', 'newcalendar.php'),
|
||||
function(){Calendar.UI.Calendar.colorPicker(this)});
|
||||
$(object).closest('tr').after(tr).hide();
|
||||
},
|
||||
edit:function(object, calendarid){
|
||||
|
|
|
@ -228,4 +228,16 @@ class OC_Calendar_Calendar{
|
|||
list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
|
||||
return $userid;
|
||||
}
|
||||
public static function getCalendarColorOptions(){
|
||||
return array(
|
||||
'ff0000', // "Red"
|
||||
'00ff00', // "Green"
|
||||
'ffff00', // "Yellow"
|
||||
'808000', // "Olive"
|
||||
'ffa500', // "Orange"
|
||||
'ff7f50', // "Coral"
|
||||
'ee82ee', // "Violet"
|
||||
'ecc255', // dark yellow
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче