mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-18 21:15:57 +00:00
Monotone-Parent: 63bcd763cff414d885e16f073fd75273e3b16ddb
Monotone-Revision: 4d261df2cf600b1a2b203cffba49ea6559226fdd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-09-15T02:31:34 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2007-09-14 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalendarSelector.m ([UIxCalendarSelector
|
||||
-calendars]): also returns the owner of the listed folders.
|
||||
|
||||
* SoObjects/Appointments/SOGoAppointmentFolder.m
|
||||
([-deleteEntriesWithIds:ids]): moved method into SOGoFolder.
|
||||
|
||||
|
||||
@@ -129,6 +129,8 @@ colorForNumber (unsigned int number)
|
||||
forKey: @"color"];
|
||||
isActive = [NSNumber numberWithBool: [folder isActive]];
|
||||
[calendar setObject: isActive forKey: @"active"];
|
||||
[calendar setObject: [folder ownerInContext: context]
|
||||
forKey: @"owner"];
|
||||
[calendars addObject: calendar];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
|
||||
<div class="menu" id="calendarsMenu">
|
||||
<ul>
|
||||
<li><var:string label:value="Modify"/></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="New Calendar..."/></li>
|
||||
<li><var:string label:value="Delete Calendar"/></li>
|
||||
<li><!-- separator --></li>
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
</span>
|
||||
<ul id="calendarList" multiselect="yes">
|
||||
<var:foreach list="calendars" item="currentCalendar"
|
||||
><li class="denied" var:id="currentCalendar.id">
|
||||
><li class="denied" var:id="currentCalendar.id"
|
||||
var:owner="currentCalendar.owner">
|
||||
<input type="checkbox" class="checkBox"
|
||||
const:disabled="disabled"
|
||||
var:checked="currentCalendar.active" />
|
||||
|
||||
@@ -1299,7 +1299,9 @@ function getMenus() {
|
||||
editEvent, deleteEvent, "-",
|
||||
onSelectAll, "-",
|
||||
null, null);
|
||||
menus["calendarsMenu"] = new Array(onCalendarNew, onCalendarRemove,
|
||||
menus["calendarsMenu"] = new Array(onMenuModify,
|
||||
"-",
|
||||
onCalendarNew, onCalendarRemove,
|
||||
"-", null, null, "-",
|
||||
null, "-", onMenuSharing);
|
||||
menus["searchMenu"] = new Array(setSearchCriteria);
|
||||
@@ -1355,6 +1357,35 @@ function initCalendarSelector() {
|
||||
Event.observe(links[2], "click", onCalendarRemove);
|
||||
}
|
||||
|
||||
function onMenuModify(event) {
|
||||
var folders = $("calendarList");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
|
||||
if (UserLogin == selected.getAttribute("owner")) {
|
||||
var node = selected.childNodes[4];
|
||||
var currentName = node.nodeValue.trim();
|
||||
var newName = window.prompt(labels["Address Book Name"],
|
||||
currentName);
|
||||
if (newName && newName.length > 0
|
||||
&& newName != currentName) {
|
||||
var url = (URLForFolderID(selected.getAttribute("id"))
|
||||
+ "/renameFolder?name=" + escape(newName.utf8encode()));
|
||||
triggerAjaxRequest(url, folderRenameCallback,
|
||||
{node: node, name: " " + newName});
|
||||
}
|
||||
} else
|
||||
window.alert(clabels["Unable to rename that folder!"]);
|
||||
}
|
||||
|
||||
function folderRenameCallback(http) {
|
||||
if (http.readyState == 4) {
|
||||
if (isHttpStatus204(http.status)) {
|
||||
var dict = http.callbackData;
|
||||
dict["node"].nodeValue = dict["name"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onCalendarNew(event) {
|
||||
createFolder(window.prompt(labels["Name of the Calendar"]),
|
||||
appendCalendar);
|
||||
|
||||
Reference in New Issue
Block a user