mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 03:45:25 +00:00
Monotone-Parent: 9932c60ae3f371eb7352ff77e53ef5ca51f43aec
Monotone-Revision: 82f96380d04412c3a15ffd57500fa486d0f62a80 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2007-11-12T21:20:18 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -25,6 +25,9 @@
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
|
||||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
#import <Appointments/SOGoAppointmentFolders.h>
|
||||
|
||||
@@ -102,23 +105,26 @@ colorForNumber (unsigned int number)
|
||||
|
||||
- (NSArray *) calendars
|
||||
{
|
||||
NSArray *folders;
|
||||
NSArray *folders, *roles;
|
||||
SOGoAppointmentFolders *co;
|
||||
SOGoAppointmentFolder *folder;
|
||||
NSMutableDictionary *calendar;
|
||||
unsigned int count, max;
|
||||
NSString *folderName, *fDisplayName;
|
||||
NSNumber *isActive;
|
||||
SOGoUser *user;
|
||||
|
||||
if (!calendars)
|
||||
{
|
||||
co = [self clientObject];
|
||||
user = [[self context] activeUser];
|
||||
folders = [co subFolders];
|
||||
max = [folders count];
|
||||
calendars = [[NSMutableArray alloc] initWithCapacity: max];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
folder = [folders objectAtIndex: count];
|
||||
roles = [user rolesForObject: folder inContext: [self context]];
|
||||
calendar = [NSMutableDictionary dictionary];
|
||||
folderName = [folder nameInContainer];
|
||||
fDisplayName = [folder displayName];
|
||||
@@ -134,6 +140,8 @@ colorForNumber (unsigned int number)
|
||||
[calendar setObject: isActive forKey: @"active"];
|
||||
[calendar setObject: [folder ownerInContext: context]
|
||||
forKey: @"owner"];
|
||||
[calendar setObject: [roles componentsJoinedByString: @","]
|
||||
forKey: @"roles"];
|
||||
[calendars addObject: calendar];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ div.colorBox.calendarFolder<var:string value="currentCalendar.folder" />
|
||||
<ul id="calendarList">
|
||||
<var:foreach list="calendars" item="currentCalendar"
|
||||
><li class="denied" var:id="currentCalendar.id"
|
||||
var:owner="currentCalendar.owner">
|
||||
var:owner="currentCalendar.owner" var:roles="currentCalendar.roles" >
|
||||
<input type="checkbox" class="checkBox"
|
||||
const:disabled="disabled"
|
||||
var:checked="currentCalendar.active" />
|
||||
|
||||
@@ -31,7 +31,11 @@ function newEvent(sender, type) {
|
||||
var hour = sender.hour;
|
||||
if (!hour)
|
||||
hour = sender.getAttribute("hour");
|
||||
var folderID = getSelectedFolder();
|
||||
var folder = getSelectedFolder();
|
||||
var roles = folder.getAttribute("roles").split(",");
|
||||
var folderID = folder.getAttribute("id");
|
||||
if ($(roles).indexOf("PublicModifier") < 0)
|
||||
folderID = "/personal";
|
||||
var urlstr = ApplicationBaseURL + folderID + "/new" + type;
|
||||
var params = new Array();
|
||||
if (day)
|
||||
@@ -48,12 +52,12 @@ function newEvent(sender, type) {
|
||||
|
||||
function getSelectedFolder() {
|
||||
var folder;
|
||||
|
||||
var nodes = $("calendarList").getSelectedRows();
|
||||
var list = $("calendarList");
|
||||
var nodes = list.getSelectedRows();
|
||||
if (nodes.length > 0)
|
||||
folder = nodes[0].getAttribute("id");
|
||||
folder = nodes[0];
|
||||
else
|
||||
folder = "/personal";
|
||||
folder = list.down("li");
|
||||
|
||||
return folder;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ TEXTAREA
|
||||
padding-bottom: 0em; }
|
||||
|
||||
SELECT#calendarList
|
||||
{ width: 7em; }
|
||||
{ width: 18em; }
|
||||
|
||||
A#changeUrlButton
|
||||
{ margin-left: 1em; }
|
||||
|
||||
@@ -149,18 +149,7 @@ function onComponentEditorLoad(event) {
|
||||
Event.observe(list, "mousedown",
|
||||
onChangeCalendar.bindAsEventListener(list),
|
||||
false);
|
||||
if (document.createEvent) {
|
||||
var onSelectionChangeEvent;
|
||||
if (isSafari())
|
||||
onSelectionChangeEvent = document.createEvent("UIEvents");
|
||||
else
|
||||
onSelectionChangeEvent = document.createEvent("Events");
|
||||
onSelectionChangeEvent.initEvent("mousedown", false, false);
|
||||
list.dispatchEvent(onSelectionChangeEvent);
|
||||
}
|
||||
else {
|
||||
list.fireEvent("onmousedown"); // IE
|
||||
}
|
||||
list.fire("mousedown");
|
||||
|
||||
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
|
||||
for (var i = 0; i < menuItems.length; i++)
|
||||
|
||||
@@ -602,7 +602,7 @@ TR._selected > TD,
|
||||
TD._selected
|
||||
{
|
||||
background-color: #4b6983;
|
||||
color: #000 !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
LI[class~="_selected"].denied
|
||||
|
||||
@@ -525,18 +525,7 @@ function onRowClick(event) {
|
||||
var parentNode = node.parentNode;
|
||||
if (parentNode.tagName == 'TBODY')
|
||||
parentNode = parentNode.parentNode;
|
||||
if (document.createEvent) {
|
||||
var onSelectionChangeEvent;
|
||||
if (isSafari())
|
||||
onSelectionChangeEvent = document.createEvent("UIEvents");
|
||||
else
|
||||
onSelectionChangeEvent = document.createEvent("Events");
|
||||
onSelectionChangeEvent.initEvent("mousedown", true, true);
|
||||
parentNode.dispatchEvent(onSelectionChangeEvent);
|
||||
}
|
||||
else if (document.createEventObject) {
|
||||
parentNode.fireEvent("onmousedown");
|
||||
}
|
||||
parentNode.fire("mousedown");
|
||||
}
|
||||
}
|
||||
lastClickedRow = rowIndex;
|
||||
|
||||
Reference in New Issue
Block a user