mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-07 09:25:09 +00:00
Monotone-Parent: 87900b7c90887e5048e78bcaa1e722ea0e1ebfe5
Monotone-Revision: 1720cf251b5e03b7d77aadbba2e8a9b52b80ce5a Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-08-19T19:47:31 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
* UI/Scheduler/UIxCalMainView.m (checkDefaultModulePreference): Added to
|
||||
support "Last" SOGoUIxDefaultModule value.
|
||||
* UI/MailerUI/UIxMailListView.m (isMessageFlagged): Added for Mantis 1428
|
||||
* UI/MailerUI/UIxMailActions.m (markMessageFlaggedAction,
|
||||
markMessageUnflaggedAction): Added to support flagging
|
||||
* UI/MailerUI/UIxMailListView.m: Renamed Invisible to Flagged
|
||||
* UI/MailerUI/UIxMailMainFrame.m: Renamed Invisible to Flagged
|
||||
|
||||
2009-08-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
|
||||
@@ -91,6 +91,37 @@
|
||||
|
||||
/* active message */
|
||||
|
||||
- (id) markMessageUnflaggedAction
|
||||
{
|
||||
id response;
|
||||
SOGoMailFolder *mailFolder;
|
||||
|
||||
response = [[self clientObject] removeFlags: @"\\Flagged"];
|
||||
if (!response)
|
||||
{
|
||||
mailFolder = [[self clientObject] container];
|
||||
response = [self responseWith204];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
- (id) markMessageFlaggedAction
|
||||
{
|
||||
id response;
|
||||
SOGoMailFolder *mailFolder;
|
||||
|
||||
response = [[self clientObject] addFlags: @"\\Flagged"];
|
||||
if (!response)
|
||||
{
|
||||
mailFolder = [[self clientObject] container];
|
||||
response = [self responseWith204];
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
- (id) markMessageUnreadAction
|
||||
{
|
||||
id response;
|
||||
|
||||
@@ -755,10 +755,10 @@
|
||||
|
||||
tmpColumns
|
||||
= [NSArray arrayWithObjects: @"tbtv_headercell messageFlagColumn",
|
||||
@"invisibleHeader", @"Invisible", nil];
|
||||
@"invisibleHeader", @"Flagged", nil];
|
||||
[columnsMetaData setObject: [NSDictionary dictionaryWithObjects: tmpColumns
|
||||
forKeys: tmpKeys]
|
||||
forKey: @"Invisible"];
|
||||
forKey: @"Flagged"];
|
||||
|
||||
tmpColumns
|
||||
= [NSArray arrayWithObjects: @"tbtv_headercell messageFlagColumn",
|
||||
@@ -823,7 +823,7 @@
|
||||
defaultsOrder = [[NSUserDefaults standardUserDefaults]
|
||||
arrayForKey: @"SOGoMailListViewColumnsOrder"];
|
||||
if (![defaultsOrder count])
|
||||
defaultsOrder = [NSArray arrayWithObjects: @"Invisible",
|
||||
defaultsOrder = [NSArray arrayWithObjects: @"Flagged",
|
||||
@"Attachment", @"Subject", @"From",
|
||||
@"Unread", @"Date", @"Priority", @"Size", nil];
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
defaultColumnsOrder = [NSArray arrayWithArray: [sud arrayForKey: @"SOGoMailListViewColumnsOrder"]];
|
||||
if ( [defaultColumnsOrder count] == 0 )
|
||||
{
|
||||
defaultColumnsOrder = [NSArray arrayWithObjects: @"Invisible", @"Attachment", @"Subject",
|
||||
defaultColumnsOrder = [NSArray arrayWithObjects: @"Flagged", @"Attachment", @"Subject",
|
||||
@"From", @"Unread", @"Date", @"Priority", nil];
|
||||
}
|
||||
|
||||
|
||||
@@ -246,6 +246,16 @@
|
||||
actionClass = "UIxMailActions";
|
||||
actionName = "forward";
|
||||
};
|
||||
markMessageUnflagged = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailActions";
|
||||
actionName = "markMessageUnflagged";
|
||||
};
|
||||
markMessageFlagged = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailActions";
|
||||
actionName = "markMessageFlagged";
|
||||
};
|
||||
markMessageUnread = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailActions";
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<tr class="tableview"
|
||||
><var:foreach list="columnsDisplayOrder" item="currentColumn">
|
||||
<td var:class="currentColumn.headerClass" var:id="currentColumn.headerId">
|
||||
<var:if condition="currentColumn.value" const:value="Invisible">
|
||||
<var:if condition="currentColumn.value" const:value="Flagged">
|
||||
<img rsrc:src="empty.gif" width="100%" height="100%" const:title="" />
|
||||
</var:if>
|
||||
<var:if condition="currentColumn.value" const:value="Attachment">
|
||||
@@ -20,7 +20,7 @@
|
||||
<var:if condition="currentColumn.value" const:value="Unread">
|
||||
<img rsrc:src="title_read_14x14.png" label:title="$currentColumn.value" />
|
||||
</var:if>
|
||||
<var:if condition="currentColumn.value" const:value="Invisible" const:negate="YES">
|
||||
<var:if condition="currentColumn.value" const:value="Flagged" const:negate="YES">
|
||||
<var:if condition="currentColumn.value" const:value="Attachment" const:negate="YES">
|
||||
<var:if condition="currentColumn.value" const:value="Unread" const:negate="YES">
|
||||
<var:string var:value="columnTitle" />
|
||||
@@ -65,15 +65,15 @@
|
||||
<var:foreach list="messages" item="message">
|
||||
<tr var:class="messageRowStyleClass" var:id="msgRowID" var:labels="msgLabels"
|
||||
><var:foreach list="columnsDisplayOrder" item="currentColumn"
|
||||
><var:if condition="currentColumn.value" const:value="Invisible"
|
||||
><td class="messageFlagColumn"><var:entity name="nbsp"
|
||||
/><var:if condition="isMessageFlagged"
|
||||
><img rsrc:src="flag.png"
|
||||
><var:if condition="currentColumn.value" const:value="Flagged"
|
||||
><td class="messageFlagColumn messageFlag"
|
||||
><var:if condition="isMessageFlagged"
|
||||
><img rsrc:src="flag.png" const:class="messageIsFlagged"
|
||||
/></var:if
|
||||
><!--<var:if condition="isMessageFlagged" const:negate="YES"
|
||||
><var:if condition="isMessageFlagged" const:negate="YES"
|
||||
><img rsrc:src="flag-col.png"
|
||||
/></var:if
|
||||
>--></td
|
||||
></td
|
||||
></var:if>
|
||||
<var:if condition="currentColumn.value" const:value="Attachment"
|
||||
><td class="messageFlagColumn"
|
||||
|
||||
@@ -110,6 +110,23 @@ function onMenuSharing(event) {
|
||||
|
||||
/* mail list DOM changes */
|
||||
|
||||
function flagMailInWindow (win, msguid, flagged) {
|
||||
var row = win.$("row_" + msguid);
|
||||
|
||||
if (row) {
|
||||
var col = $$("TR#row_"+msguid+" TD.messageFlag").first ();
|
||||
var img = col.childElements ().first ();
|
||||
if (flagged) {
|
||||
img.src = img.src.replace (/-col/, "");
|
||||
img.addClassName ("messageIsFlagged");
|
||||
}
|
||||
else {
|
||||
img.src = img.src.replace (/.png/, "-col.png");
|
||||
img.removeClassName ("messageIsFlagged");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function markMailInWindow(win, msguid, markread) {
|
||||
var row = win.$("row_" + msguid);
|
||||
var subjectCell = win.$("div_" + msguid);
|
||||
@@ -209,7 +226,8 @@ function mailListMarkMessage(event) {
|
||||
action = 'markMessageUnread';
|
||||
markread = false;
|
||||
}
|
||||
var url = ApplicationBaseURL + encodeURI(Mailer.currentMailbox) + "/" + msguid + "/" + action;
|
||||
var url = ApplicationBaseURL + encodeURI(Mailer.currentMailbox) + "/"
|
||||
+ msguid + "/" + action;
|
||||
|
||||
var data = { "window": window, "msguid": msguid, "markread": markread };
|
||||
triggerAjaxRequest(url, mailListMarkMessageCallback, data);
|
||||
@@ -229,6 +247,35 @@ function mailListMarkMessageCallback(http) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mailListFlagMessageToggle (e) {
|
||||
var msguid = this.ancestors ().first ().id.split ("_")[1];
|
||||
var img = this.childElements ().first ();
|
||||
|
||||
var action = "markMessageFlagged";
|
||||
var flagged = true;
|
||||
if (img.hasClassName ("messageIsFlagged")) {
|
||||
action = "markMessageUnflagged";
|
||||
flagged = false;
|
||||
}
|
||||
|
||||
var url = ApplicationBaseURL + encodeURI(Mailer.currentMailbox) + "/"
|
||||
+ msguid + "/" + action;
|
||||
var data = { "window": window, "msguid": msguid, "flagged": flagged };
|
||||
|
||||
triggerAjaxRequest(url, mailListFlagMessageToggleCallback, data);
|
||||
}
|
||||
function mailListFlagMessageToggleCallback (http) {
|
||||
if (isHttpStatus204(http.status)) {
|
||||
var data = http.callbackData;
|
||||
flagMailInWindow(data["window"], data["msguid"], data["flagged"]);
|
||||
}
|
||||
else {
|
||||
alert("Message Mark Failed (" + http.status + "): " + http.statusText);
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
/* maillist row highlight */
|
||||
|
||||
var oldMaillistHighlight = null; // to remember deleted/selected style
|
||||
@@ -674,6 +721,7 @@ function messageListCallback(http) {
|
||||
var msg = data.replace(/^(.*\n)*.*<p>((.*\n)*.*)<\/p>(.*\n)*.*$/, "$2");
|
||||
log("messageListCallback: problem during ajax request (readyState = " + http.readyState + ", status = " + http.status + ", response = " + msg + ")");
|
||||
}
|
||||
initFlagIcons ();
|
||||
}
|
||||
|
||||
function getStatusFolders() {
|
||||
@@ -1406,6 +1454,12 @@ function openInbox(node) {
|
||||
mailboxTree.o(1);
|
||||
}
|
||||
|
||||
function initFlagIcons () {
|
||||
var icons = $$("TABLE#messageList TBODY TR.mailer_listcell_regular TD.messageFlag");
|
||||
for (var i = 0; i < icons.length; i++)
|
||||
icons[i].onclick = mailListFlagMessageToggle;
|
||||
}
|
||||
|
||||
function initMailer(event) {
|
||||
if (!$(document.body).hasClassName("popup")) {
|
||||
//initDnd();
|
||||
|
||||
Reference in New Issue
Block a user