Monotone-Parent: 48dcb8712cd5e36fe33ea44dde50cad68d94f5c3

Monotone-Revision: a02bbe9f2e1f3a2c472f0499b21e163f8b6170ec

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-10-26T19:26:50
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2010-10-26 19:26:50 +00:00
parent b9598b7203
commit 12df5036f6
22 changed files with 374 additions and 117 deletions

View File

@ -1,5 +1,20 @@
2010-10-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/WebServerResources/UIxPreferences.js: added code to handle
the new "Contacts Options" tab, in particular the contacts
categories.
* UI/PreferencesUI/UIxPreferences.m (-languageCategories): renamed
to "_languageCalendarCategories" as it is a private method. The
dictionary key has also been renamed to
"calendar_category_labels" since we now handle contact categories
too.
(-calendarCategoriesValue, -setCalendarCategoriesValue:): renamed
from "categories" method.
(-contactsCategoryList, -contactsCategoriesValue)
(-setContactsCategoriesValue:): new methods for handling contacts
categories in the preferences. Transfers are in JSON.
* UI/WebServerResources/UIxContactEditor.js: (saveCategories)
(appendCategoryInput, onComboButtonClick, onCategoryInputChange)
(onCategoryInputFocus, regenerateCategoriesMenu)

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Geral";
"Calendar Options" = "Calendário";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Correio";
"IMAP Accounts" = "IMAP Accounts";
"Vacation" = "Vacation";
@ -16,6 +17,9 @@
"Add" = "Add";
"Delete" = "Delete";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Enable vacation auto reply";
"Auto reply message :" = "AutoResponder somente uma vez a cada remetente com o seguinte texto :";
@ -153,7 +157,7 @@
/* Event+task categories */
"category_none" = "Nenhum";
"category_labels" = "Aniversário,Negócios,Ligações,Concorrência,Cliente,Favoritos,Acompanhamento,Presentes,Feriados,Idéias,Meeting,Problemas,Miscelânea,Pessoal,Projetos,Feriado público,Posição,Fornecedores,Viagem,Férias";
"calendar_category_labels" = "Aniversário,Negócios,Ligações,Concorrência,Cliente,Favoritos,Acompanhamento,Presentes,Feriados,Idéias,Meeting,Problemas,Miscelânea,Pessoal,Projetos,Feriado público,Posição,Fornecedores,Viagem,Férias";
/* Default module */
"Calendar" = "Calendar";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "General";
"Calendar Options" = "Opcions de calendari";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Opcions de correu";
"IMAP Accounts" = "Comptes IMAP";
"Vacation" = "Vacances";
@ -16,6 +17,9 @@
"Add" = "Afegir";
"Delete" = "Esborrar";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Activar resposta automàtica";
"Auto reply message :" = "Respondre automàticament una sola vegada a cada remitent amb aquest text: ";
@ -155,7 +159,7 @@
/* Event+task categories */
"category_none" = "Cap";
"category_labels" = "Aniversari,Natalici,Negocis,Telefonades,Clients,Competició,Feina,Favorits,Seguiment,Regals,Festes,Idees,Reunió,Assumptes,Altres,Personal,Projectes,Vacances públiques,Estat,Proveïdors,Viatges,Vacances";
"calendar_category_labels" = "Aniversari,Natalici,Negocis,Telefonades,Clients,Competició,Feina,Favorits,Seguiment,Regals,Festes,Idees,Reunió,Assumptes,Altres,Personal,Projectes,Vacances públiques,Estat,Proveïdors,Viatges,Vacances";
/* Default module */
"Calendar" = "Calendari";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Obecný";
"Calendar Options" = "Možnosti kalendáře";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Možnosti pošty";
"IMAP Accounts" = "IMAP Accounts";
"Vacation" = "Nepřítomnost";
@ -16,6 +17,9 @@
"Add" = "Přidat";
"Delete" = "Smazat";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Zapnout odpovědi v nepřítomnosti";
"Auto reply message :" = "Zpráva zasílaná v nepřítomnosti :";
@ -153,7 +157,7 @@
/* Event+task categories */
"category_none" = "Žádný";
"category_labels" = "Výročí,Narozeniny,Obchod,Hovory,Klienti,Soutěže,Zákazník,Oblíbené,Sledování,Dárky,Volno,Nápady,Meeting,Problémy,Různé,Osobní,Projekty,Veřejné prázdniny,Stav,Dodavatelé,Cesta,Dovolená";
"calendar_category_labels" = "Výročí,Narozeniny,Obchod,Hovory,Klienti,Soutěže,Zákazník,Oblíbené,Sledování,Dárky,Volno,Nápady,Meeting,Problémy,Různé,Osobní,Projekty,Veřejné prázdniny,Stav,Dodavatelé,Cesta,Dovolená";
/* Default module */
"Calendar" = "Kalendář";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Algemeen";
"Calendar Options" = "Agenda";
"Contacts Options" = "Contacts Options";
"Mail Options" = "E-mail";
"IMAP Accounts" = "IMAP Accounts";
"Vacation" = "Vacation";
@ -16,6 +17,9 @@
"Add" = "Add";
"Delete" = "Delete";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Enable vacation auto reply";
"Auto reply message :" = "Automatisch eenmalig met het volgende bericht beantwoorden:";
@ -153,7 +157,7 @@
/* Event+task categories */
"category_none" = "Geen categorie";
"category_labels" = "Cliënten,Concurrentie,Diversen,Favorieten,Giften,Ideeën,Klant,Kwesties,Leveranciers,Nationale feestdag,Persoonlijk,Projecten,Meeting,Reizen,Status,Telefoongesprekken,Trouwdag,Vakantie,Verjaardag,Vervolggesprek,Vrije dagen,Zaken";
"calendar_category_labels" = "Cliënten,Concurrentie,Diversen,Favorieten,Giften,Ideeën,Klant,Kwesties,Leveranciers,Nationale feestdag,Persoonlijk,Projecten,Meeting,Reizen,Status,Telefoongesprekken,Trouwdag,Vakantie,Verjaardag,Vervolggesprek,Vrije dagen,Zaken";
/* Default module */
"Calendar" = "Calendar";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "General";
"Calendar Options" = "Calendar Options";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Mail Options";
"IMAP Accounts" = "IMAP Accounts";
"Vacation" = "Vacation";
@ -16,6 +17,9 @@
"Add" = "Add";
"Delete" = "Delete";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Enable vacation auto reply";
"Auto reply message :" = "Auto reply message :";
@ -153,7 +157,7 @@
/* Event+task categories */
"category_none" = "None";
"category_labels" = "Anniversary,Birthday,Business,Calls,Clients,Competition,Customer,Favorites,Follow up,Gifts,Holidays,Ideas,Meeting,Issues,Miscellaneous,Personal,Projects,Public Holiday,Status,Suppliers,Travel,Vacation";
"calendar_category_labels" = "Anniversary,Birthday,Business,Calls,Clients,Competition,Customer,Favorites,Follow up,Gifts,Holidays,Ideas,Meeting,Issues,Miscellaneous,Personal,Projects,Public Holiday,Status,Suppliers,Travel,Vacation";
/* Default module */
"Calendar" = "Calendar";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Général";
"Calendar Options" = "Calendrier";
"Contacts Options" = "Contacts";
"Mail Options" = "Courrier";
"IMAP Accounts" = "Comptes IMAP";
"Vacation" = "Absence prolongée";
@ -16,6 +17,9 @@
"Add" = "Ajouter";
"Delete" = "Supprimer";
/* contacts categories */
"contacts_category_labels" = "Ami, Client, Collègue, Concurrent, Famille, Fournisseur, Partenaire d'affaire, Presse, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Activer message d'absense prolongée";
"Auto reply message :" = "Message de réponse automatique :";
@ -151,7 +155,7 @@
/* Event+task categories */
"category_none" = "Aucune";
"category_labels" = "Anniversaire,Affaire,Appels,Clients,Compétitions,Congrès,Consommation,Préférés,Suivis,Cadeaux,Congés,Idées,Problèmes,Réunion,Divers,Personnel,Projets,Jour férié,Statut,Fournisseurs,Voyages,Professionnel";
"calendar_category_labels" = "Anniversaire,Affaire,Appels,Clients,Compétitions,Congrès,Consommation,Préférés,Suivis,Cadeaux,Congés,Idées,Problèmes,Réunion,Divers,Personnel,Projets,Jour férié,Statut,Fournisseurs,Voyages,Professionnel";
/* Default module */
"Calendar" = "Agenda";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Allgemein";
"Calendar Options" = "Kalender";
"Contacts Options" = "Contacts Options";
"Mail Options" = "E-Mail";
"IMAP Accounts" = "IMAP-Konten";
"Vacation" = "Abwesenheit";
@ -16,6 +17,9 @@
"Add" = "Hinzufügen";
"Delete" = "Löschen";
/* contacts categories */
"contacts_category_labels" = "Geschäftspartner, Familie, Freund, Kollegin, Konkurrenten, Kunden, Lieferant, Presse, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Automatische Abwesenheitsantwort aktivieren";
"Auto reply message :" = "Folgende Antwort wird automatisch einmal an jeden Absender gesendet:";
@ -152,7 +156,7 @@
/* Event+task categories */
"category_none" = "Keine";
"category_labels" = "Jubiläum,Geburtstag,Geschäft,Anrufe,Klienten,Konkurrenz,Kunde,Favoriten,Nachgehen,Geschenke,Ferien,Ideen,Meeting,Fragen,Verschiedenes,Persönlich,Projekte,Feiertag,Status,Lieferanten,Reise,Urlaub";
"calendar_category_labels" = "Jubiläum,Geburtstag,Geschäft,Anrufe,Klienten,Konkurrenz,Kunde,Favoriten,Nachgehen,Geschenke,Ferien,Ideen,Meeting,Fragen,Verschiedenes,Persönlich,Projekte,Feiertag,Status,Lieferanten,Reise,Urlaub";
/* Default module */
"Calendar" = "Kalender";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Általános";
"Calendar Options" = "Naptár";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Levelezés";
"IMAP Accounts" = "IMAP Accounts";
"Password" = "Jelszó";
@ -14,8 +15,25 @@
"Add" = "Add";
"Delete" = "Delete";
/* ooo */
"Auto reply messsage :" = "Automatikus válasz minden feladónak csak egy alkalommal :";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Enable vacation auto reply";
"Auto reply message :" = "Automatikus válasz minden feladónak csak egy alkalommal :";
"Email addresses (separated by commas) :" = "Email addresses (separated by commas) :";
"Add default email addresses" = "Add default email addresses";
"Days between responses :" = "Days between responses :";
"Do not send responses to mailing lists" = "Do not send responses to mailing lists";
"Please specify your message and your email addresses for which you want to enable auto reply."
= "Please specify your message and your email addresses for which you want to enable auto reply.";
/* forward messages */
"Forward incoming messages" = "Forward incoming messages";
"Forward to address :" = "Forward to address :";
"Keep a copy" = "Keep a copy";
"Please specify an address to which you want to forward your messages."
= "Please specify an address to which you want to forward your messages.";
/* d & t */
"Current Time Zone :" = "Időzóna :";
@ -137,7 +155,7 @@
/* Event+task categories */
"category_none" = "Nincs";
"category_labels" = "Évforduló,Születésnap,Üzleti,Meghívás,Ügyfelek,Versenytársak,Vevő,Kedvencek,Nyomonkövetés,Ajándékozás,Szabadság,Ötletek,Meeting,Ügyek,Egyéb,Személyes,Projektek,Állami ünnep,Állapot,Szállítók,Utazás,Szünidő";
"calendar_category_labels" = "Évforduló,Születésnap,Üzleti,Meghívás,Ügyfelek,Versenytársak,Vevő,Kedvencek,Nyomonkövetés,Ajándékozás,Szabadság,Ötletek,Meeting,Ügyek,Egyéb,Személyes,Projektek,Állami ünnep,Állapot,Szállítók,Utazás,Szünidő";
/* Default module */
"Calendar" = "Calendar";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Generale";
"Calendar Options" = "Opzioni calendario";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Opzioni di posta";
"Signature" = "Firma";
"Vacation" = "Risponditore automatico";
@ -17,6 +18,9 @@
"Add" = "Aggiungi";
"Delete" = "Cancella";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Abilita il risponditore automatico";
"Auto reply message :" = "Rispondi automaticamente solo una volta ad ogni mittente usando questo testo:";
@ -143,7 +147,7 @@
/* Event+task categories */
"category_none" = "Nessuna";
"category_labels" = "Anniversari,Compleanni,Lavoro,Chiamate,Clienti,Competizioni,Compratori,Preferiti,Incontri,Regali,Vacanze,Idee,Meeting,Problemi,Varie,Personale,Progetti,Giorno festivo,Stato,Fornitori,Viaggio,Chiusura";
"calendar_category_labels" = "Anniversari,Compleanni,Lavoro,Chiamate,Clienti,Competizioni,Compratori,Preferiti,Incontri,Regali,Vacanze,Idee,Meeting,Problemi,Varie,Personale,Progetti,Giorno festivo,Stato,Fornitori,Viaggio,Chiusura";
/* Default module */
"Calendar" = "Calendario";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Ogólne";
"Calendar Options" = "Opcje kalendarza";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Opcje poczty";
"Signature" = "Podpis";
"Vacation" = "Nieobecność";
@ -17,6 +18,9 @@
"Add" = "Dodaj";
"Delete" = "Usuń";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Włącz autoodpowiedź podczas nieobecności";
"Auto reply message :" = "Treść autoodpowiedzi :";
@ -143,7 +147,7 @@
/* Event+task categories */
"category_none" = "Brak";
"category_labels" = "Rocznica,Urodziny,Biznes,Telefony,Klienci,Konkurencja,Klient,Ulubione,Nawiązanie,Podarunki,Święta,Idee,Spotkania,Problemy,Różne,Osobiste,Projekty,Święta,Status,Dostawcy,Podróż,Wakacje";
"calendar_category_labels" = "Rocznica,Urodziny,Biznes,Telefony,Klienci,Konkurencja,Klient,Ulubione,Nawiązanie,Podarunki,Święta,Idee,Spotkania,Problemy,Różne,Osobiste,Projekty,Święta,Status,Dostawcy,Podróż,Wakacje";
/* Default module */
"Calendar" = "Kalendarz";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Общее";
"Calendar Options" = "Календарь";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Почта";
"IMAP Accounts" = "IMAP Accounts";
"Vacation" = "Vacation";
@ -16,6 +17,9 @@
"Add" = "Add";
"Delete" = "Delete";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Enable vacation auto reply";
"Auto reply message :" = "Автоматически посылать этот текст каждому отправителю один раз :";
@ -158,7 +162,7 @@
/* Event+task categories */
"category_none" = "None";
"category_labels" = "Anniversary,Birthday,Business,Calls,Clients,Competition,Customer,Favorites,Follow up,Gifts,Holidays,Ideas,Meeting,Issues,Miscellaneous,Personal,Projects,Public Holiday,Status,Suppliers,Travel,Vacation";
"calendar_category_labels" = "Anniversary,Birthday,Business,Calls,Clients,Competition,Customer,Favorites,Follow up,Gifts,Holidays,Ideas,Meeting,Issues,Miscellaneous,Personal,Projects,Public Holiday,Status,Suppliers,Travel,Vacation";
/* Default module */
"Calendar" = "Calendar";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "General";
"Calendar Options" = "Opciones de calendario";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Opciones de correo";
"IMAP Accounts" = "IMAP Accounts";
"Vacation" = "Vacation";
@ -16,6 +17,9 @@
"Add" = "Add";
"Delete" = "Delete";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Enable vacation auto reply";
"Auto reply message :" = "Responder automáticamente una sola vez a cada remitente con el siguiente texto: ";
@ -155,7 +159,7 @@
/* Event+task categories */
"category_none" = "Ninguna";
"category_labels" = "Aniversario,Cumpleaños,Negocios,Llamadas,Clientes,Competición,Trabajo,Favoritos,Seguimiento,Regalos,Fiestas,Ideas,Meeting,Asuntos,Varios,Personal,Proyectos,Vacaciones públicas,Estado,Proveedores,Viajes,Vacaciones";
"calendar_category_labels" = "Aniversario,Cumpleaños,Negocios,Llamadas,Clientes,Competición,Trabajo,Favoritos,Seguimiento,Regalos,Fiestas,Ideas,Meeting,Asuntos,Varios,Personal,Proyectos,Vacaciones públicas,Estado,Proveedores,Viajes,Vacaciones";
/* Default module */
"Calendar" = "Calendar";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Allmänt";
"Calendar Options" = "Kalenderinställningar";
"Contacts Options" = "Contacts Options";
"Mail Options" = "E-postinställningar";
"IMAP Accounts" = "IMAP Accounts";
"Vacation" = "Frånvaro";
@ -16,6 +17,9 @@
"Add" = "Lägg till";
"Delete" = "Ta bort";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Aktivera frånvaro auto-svar";
"Auto reply message :" = "Auto-svar meddelande:";
@ -153,7 +157,7 @@
/* Event+task categories */
"category_none" = "Ingen";
"category_labels" = "Arbete,Diverse,Favoriter,Födelsedagar,Helgdagar,Idéer,Kunder,Ledighet,Leverantörer,Personligt,Presenter,Projekt,Meeting,Resor,Status,Telefonsamtal,Tävlingar,Uppföljning,Ärenden";
"calendar_category_labels" = "Arbete,Diverse,Favoriter,Födelsedagar,Helgdagar,Idéer,Kunder,Ledighet,Leverantörer,Personligt,Presenter,Projekt,Meeting,Resor,Status,Telefonsamtal,Tävlingar,Uppföljning,Ärenden";
/* Default module */
"Calendar" = "Kalender";

View File

@ -35,9 +35,10 @@
id item;
SOGoUser *user;
NSDictionary *locale;
NSString *category;
NSArray *calendarCategories;
NSDictionary *calendarCategoriesColors;
NSString *category;
NSArray *contactsCategories;
NSString *defaultCategoryColor;
SOGoUserDefaults *userDefaults;
NSCalendarDate *today;

View File

@ -22,7 +22,6 @@
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSPropertyList.h>
#import <Foundation/NSScanner.h>
#import <Foundation/NSString.h>
#import <Foundation/NSTimeZone.h>
#import <Foundation/NSUserDefaults.h> /* for locale strings */
@ -36,7 +35,6 @@
#import <SOGo/NSArray+Utilities.h>
#import <SOGo/NSDictionary+BSJSONAdditions.h>
#import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/NSScanner+BSJSONAdditions.h>
#import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
@ -123,6 +121,7 @@
[calendarCategoriesColors release];
[defaultCategoryColor release];
[category release];
[contactsCategories release];
[forwardOptions release];
[daysOfWeek release];
[locale release];
@ -672,13 +671,13 @@
- (void) setSieveFiltersValue: (NSString *) newValue
{
NSScanner *jsonScanner;
if ([newValue hasPrefix: @"["])
sieveFilters = [newValue objectFromJSONString];
if (sieveFilters)
{
jsonScanner = [NSScanner scannerWithString: newValue];
[jsonScanner scanJSONArray: &sieveFilters];
[sieveFilters retain];
if ([sieveFilters isKindOfClass: [NSArray class]])
[sieveFilters retain];
else
sieveFilters = nil;
}
}
@ -967,23 +966,23 @@
return [locale objectForKey: @"NSLocaleCode"];
}
- (NSArray *) languageCategories
- (NSArray *) _languageCalendarCategories
{
NSArray *categoryLabels;
categoryLabels = [[self labelForKey: @"category_labels"]
categoryLabels = [[self labelForKey: @"calendar_category_labels"]
componentsSeparatedByString: @","];
return [categoryLabels trimmedComponents];
}
- (NSArray *) categoryList
- (NSArray *) calendarCategoryList
{
if (!calendarCategories)
{
ASSIGN (calendarCategories, [userDefaults calendarCategories]);
if (!calendarCategories)
ASSIGN (calendarCategories, [self languageCategories]);
ASSIGN (calendarCategories, [self _languageCalendarCategories]);
}
return [calendarCategories
@ -1022,23 +1021,62 @@
return categoryColor;
}
- (NSString *) categoriesValue
- (NSString *) calendarCategoriesValue
{
return @"";
}
- (void) setCategoriesValue: (NSString *) value
- (void) setCalendarCategoriesValue: (NSString *) value
{
NSDictionary *newColors;
newColors = [NSMutableDictionary dictionaryWithJSONString: value];
if (newColors)
newColors = [value objectFromJSONString];
if (newColors && [newColors isKindOfClass: [NSDictionary class]])
{
[userDefaults setCalendarCategories: [newColors allKeys]];
[userDefaults setCalendarCategoriesColors: newColors];
}
}
- (NSArray *) _languageContactsCategories
{
NSArray *categoryLabels;
categoryLabels = [[self labelForKey: @"contacts_category_labels"]
componentsSeparatedByString: @","];
if (!categoryLabels)
categoryLabels = [NSArray array];
return [categoryLabels trimmedComponents];
}
- (NSArray *) contactsCategoryList
{
if (!contactsCategories)
{
ASSIGN (contactsCategories, [userDefaults contactsCategories]);
if (!contactsCategories)
ASSIGN (contactsCategories, [self _languageContactsCategories]);
}
return [contactsCategories
sortedArrayUsingSelector: @selector (localizedCaseInsensitiveCompare:)];
}
- (NSString *) contactsCategoriesValue
{
return @"";
}
- (void) setContactsCategoriesValue: (NSString *) value
{
NSArray *newCategories;
newCategories = [value objectFromJSONString];
if (newCategories && [newCategories isKindOfClass: [NSArray class]])
[userDefaults setContactsCategories: newCategories];
}
- (NSArray *) languages
{
return [[SOGoSystemDefaults sharedSystemDefaults]
@ -1284,11 +1322,9 @@
- (void) setMailAccounts: (NSString *) newMailAccounts
{
NSArray *accounts;
NSScanner *scanner;
int max;
scanner = [NSScanner scannerWithString: newMailAccounts];
[scanner scanJSONArray: &accounts];
accounts = [newMailAccounts objectFromJSONString];
if (accounts && [accounts isKindOfClass: [NSArray class]])
{
max = [accounts count];

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Загальне";
"Calendar Options" = "Календар";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Пошта";
"IMAP Accounts" = "IMAP-записи";
"Vacation" = "Відпустка";
@ -18,6 +19,9 @@
"Cancel" = "Скасувати";
"OK" = "Добре";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Увімкнути повідомлення про мою відсутність";
"Auto reply message :" = "Текст автоматичної відповіді:";
@ -155,7 +159,7 @@
/* Event+task categories */
"category_none" = "Без категорії";
"category_labels" = "Важливий день,День народження,Справи,Дзвінки,Клієнти,Поточне,Користувачі,Обране,Продовження,Подарунки,Свято,Думки,Зустріч,Питання,Різне,Особисте,Проекти,Публічне свято,Поточне,Постачальники,Поїздка,Відпустка";
"calendar_category_labels" = "Важливий день,День народження,Справи,Дзвінки,Клієнти,Поточне,Користувачі,Обране,Продовження,Подарунки,Свято,Думки,Зустріч,Питання,Різне,Особисте,Проекти,Публічне свято,Поточне,Постачальники,Поїздка,Відпустка";
/* Default module */
"Calendar" = "Календар";

View File

@ -5,6 +5,7 @@
/* tabs */
"General" = "Cyffredinol";
"Calendar Options" = "Opsiynau Calendr";
"Contacts Options" = "Contacts Options";
"Mail Options" = "Opsiynau Ebost";
"IMAP Accounts" = "IMAP Accounts";
"Vacation" = "Vacation";
@ -16,6 +17,9 @@
"Add" = "Add";
"Delete" = "Delete";
/* contacts categories */
"contacts_category_labels" = "Colleague, Competitor, Customer, Friend, Family, Business Partner, Provider, Press, VIP";
/* vacation (auto-reply) */
"Enable vacation auto reply" = "Enable vacation auto reply";
"Auto reply message :" = "Ymateb Awtomatig unwaith yn unig i pob anfonwr gyda'r testun canlynol :";
@ -153,7 +157,7 @@
/* Event+task categories */
"category_none" = "Dim";
"category_labels" = "Amrywiol,Anrhegion,Busnes,Canlyniadau,Clientau,Cwsmer,Cyflenwyr,Cystadleuaeth,Dilyn lan,Ffefrynnau,Galwadau,Gwyliau,Meeting,Gwyliau Cyhoeddus,Penblwydd,Personol,Projectau,Statws,Syniadau,Teithio";
"calendar_category_labels" = "Amrywiol,Anrhegion,Busnes,Canlyniadau,Clientau,Cwsmer,Cyflenwyr,Cystadleuaeth,Dilyn lan,Ffefrynnau,Galwadau,Gwyliau,Meeting,Gwyliau Cyhoeddus,Penblwydd,Personol,Projectau,Statws,Syniadau,Teithio";
/* Default module */
"Calendar" = "Calendar";

View File

@ -10,8 +10,10 @@
title="name"
const:popup="YES"
>
<form var:href="saveURL" name="editform" id="mainForm">
<div class="menu" id="categoriesMenu">
</div>
<form var:href="saveURL" name="editform" id="mainForm">
<var:if condition="isNew"><div id="addressBookSelector">
<style type="text/css">DIV#editorTabs { top: 30px; };</style>
<var:string label:value="Add to:" />
@ -27,6 +29,8 @@
<li target="baseInfos">
<span><var:string label:value="Contact" /></span>
</li>
<li target="categoryInfos">
<span><var:string label:value="Categories" /></span></li>
<li target="addressesInfos">
<span><var:string label:value="Address" /></span></li>
<li target="photos">
@ -171,6 +175,21 @@
</table>
</div>
<div id="categoryInfos" class="tab">
<div id="categoryContainer">
</div>
<input type="text" class="textField" id="emptyCategory"
const:readonly="readonly"
const:name="emptyCategory"
const:value="" />
<script type="text/javascript">
var gCategories = <var:string value="contactCategoriesList" const:escapeHTML="NO"/>;
</script>
<input type="hidden" id="contactCategories"
const:name="contactCategories"
var:value="contactCategories" />
</div>
<div id="addressesInfos" class="tab">
<span class="caption"><var:string label:value="Home" /></span>
<table class="frame">

View File

@ -24,6 +24,8 @@
<li target="calendarOptionsView"><span><var:string
label:value="Calendar Options"/></span></li>
</var:if
><li target="contactsOptionsView"><span><var:string
label:value="Contacts Options"/></span></li
><var:if condition="userHasMailAccess">
<li target="mailOptionsView"><span><var:string
label:value="Mail Options"/></span></li>
@ -101,8 +103,8 @@
string="itemFirstWeekText" selection="userFirstWeek"
/></label><br/>
<label><var:string label:value="Categories"/></label>
<div id="categoriesListWrapper"
><table id="categoriesList" cellspacing="0">
<div id="calendarCategoriesListWrapper" class="listWrapper"
><table class="categoriesList" cellspacing="0">
<thead>
<tr class="tableview"
><th const:class="tbtv_headercell" const:id="nameTableHeader"
@ -112,7 +114,7 @@
></tr
></thead>
<tbody>
<var:foreach list="categoryList" item="category">
<var:foreach list="calendarCategoryList" item="category">
<tr const:class="categoryListRow"
><td const:class="categoryListCell"
><var:string var:value="category"/></td
@ -124,19 +126,50 @@
</tbody>
</table>
</div>
<div const:id="categoriesToolbar" class="bottomToolbar">
<a const:id="categoryAdd" class="bottomButton" href="#">
<div class="bottomToolbar">
<a const:id="calendarCategoryAdd" class="bottomButton" href="#">
<span><img rsrc:src="add-icon.png" label:title="Add" />
</span></a>
<a const:id="categoryDelete" class="bottomButton" href="#">
<a const:id="calendarCategoryDelete" class="bottomButton" href="#">
<span><img rsrc:src="remove-icon.png" label:title="Delete" />
</span></a>
</div>
<input type="hidden" const:id="categoriesValue"
const:name="categoriesValue" var:value="categoriesValue"/>
<input type="hidden" const:id="calendarCategoriesValue"
const:name="calendarCategoriesValue" var:value="calendarCategoriesValue"/>
</div>
</var:if
><var:if condition="userHasMailAccess">
</var:if>
<div id="contactsOptionsView" class="tab">
<label><var:string label:value="Categories"/></label>
<div id="contactsCategoriesListWrapper" class="listWrapper"
><table class="categoriesList" cellspacing="0">
<thead>
<tr class="tableview"
><th const:class="tbtv_headercell" const:id="nameTableHeader"
><var:string label:value="Name"/></th
></tr
></thead>
<tbody>
<var:foreach list="contactsCategoryList" item="category">
<tr const:class="categoryListRow"
><td const:class="categoryListCell"
><var:string var:value="category"/></td
></tr>
</var:foreach>
</tbody>
</table>
</div>
<div class="bottomToolbar">
<a const:id="contactsCategoryAdd" class="bottomButton" href="#">
<span><img rsrc:src="add-icon.png" label:title="Add" />
</span></a>
<a const:id="contactsCategoryDelete" class="bottomButton" href="#">
<span><img rsrc:src="remove-icon.png" label:title="Delete" />
</span></a>
</div>
<input type="hidden" const:id="contactsCategoriesValue"
const:name="contactsCategoriesValue" var:value="contactsCategoriesValue"/>
</div>
<var:if condition="userHasMailAccess">
<div id="mailOptionsView" class="tab">
<label><input type="checkbox"
const:name="subscribedFoldersOnly"
@ -171,7 +204,7 @@
<script type="text/javascript">
var sieveCapabilities = <var:string value="sieveCapabilities" const:escapeHTML="NO"/>;
</script>
<div id="filtersListWrapper"
<div id="filtersListWrapper" class="listWrapper"
><table id="filtersList" cellspacing="0">
<thead>
<tr class="tableview"
@ -186,7 +219,7 @@
<input type="hidden" const:name="sieveFilters" const:id="sieveFilters"
var:value="sieveFiltersValue"/>
</div>
<div const:id="filtersToolbar" class="bottomToolbar">
<div class="bottomToolbar">
<a const:id="filterAdd" class="bottomButton" href="#">
<span><img rsrc:src="add-icon.png" label:title="Add" />
</span></a>
@ -206,7 +239,7 @@
<div id="mailAccountsView" class="tab">
<input type="hidden" const:name="mailAccountsJSON" const:id="mailAccountsJSON"
var:value="mailAccounts"/>
<div id="mailAccountsListWrapper"
<div id="mailAccountsListWrapper" class="listWrapper"
><ul id="mailAccountsList"
><!-- space --></ul
></div>

View File

@ -9,10 +9,8 @@ DIV.bottomToolbar
{ position: absolute;
height: 20px;
margin: 0px;
padding: 0px; }
#categoriesToolbar, #filtersToolbar
{ left: 2em;
padding: 0px;
left: 2em;
right: 2em;
bottom: 8px; }
@ -21,19 +19,7 @@ DIV.bottomToolbar
bottom: 9px;
width: 130px; }
DIV#categoriesListWrapper
{ overflow: auto;
position: absolute;
bottom: 30px;
right: 2em;
top: 88px;
left: 2em;
padding: 0px;
margin-top: 2px;
border-left: 1px solid #9b9b9b;
background: #ccddec; }
TABLE#categoriesList
TABLE.categoriesList
{ width: 100%; }
#colorTableHeader
@ -54,6 +40,32 @@ DIV.colorBox
margin: 0 3px 0 0;
width: 1em; }
DIV.listWrapper
{ overflow: auto;
position: absolute;
padding: 0px;
margin-top: 2px;
border-left: 1px solid #9b9b9b;
background: #ccddec;}
#calendarCategoriesListWrapper
{ bottom: 30px;
right: 2em;
top: 88px;
left: 2em; }
#contactsCategoriesListWrapper
{ overflow: auto;
position: absolute;
bottom: 30px;
right: 2em;
top: 20px;
left: 2em;
padding: 0px;
margin-top: 2px;
border-left: 1px solid #9b9b9b;
background: #ccddec; }
/* vacation */
#vacation, #forward
{ padding-left: 2.5em; }
@ -73,16 +85,10 @@ DIV.colorBox
/* mail filters */
DIV#filtersListWrapper
{ overflow: auto;
position: absolute;
bottom: 30px;
{ bottom: 30px;
right: 2em;
top: 154px;
left: 2em;
padding: 0px;
margin-top: 2px;
border-left: 1px solid #9b9b9b;
background: #ccddec; }
left: 2em; }
TABLE#filtersList
{ width: 100%;
@ -115,21 +121,25 @@ P.infoMessage#passwordError
/* mail accounts */
#mailAccountsListWrapper, #mailAccountEditor
{ bottom: 30px;
top: 5px;
left: 0px;
margin: 0px; }
#mailAccountEditor
{ position: absolute;
overflow: auto;
bottom: 30px;
top: 5px;
left: 0px;
margin: 0px;
padding: 0px; }
left: 140px;
padding: 0px;
padding-top: 5px;
right: 5px; }
#mailAccountsListWrapper
{ overflow-x: hidden;
left: 5px;
width: 130px;
background: #ccddec;
border-top: 1px solid #9b9b9b;
border-left: 1px solid #9b9b9b; }
border-top: 1px solid #9b9b9b; }
#mailAccountsList
{ position: absolute;
@ -150,11 +160,6 @@ P.infoMessage#passwordError
{ cursor: default;
font-style: italic; }
#mailAccountEditor
{ left: 140px;
padding-top: 5px;
right: 5px; }
#serverName
{ width: 100px; }

View File

@ -10,8 +10,11 @@ function savePreferences(sender) {
if (sigList)
sigList.disabled = false;
if ($("categoriesList")) {
serializeCategories();
if ($("calendarCategoriesListWrapper")) {
serializeCalendarCategories();
}
if ($("contactsCategoriesListWrapper")) {
serializeContactsCategories();
}
if ($("dayStartTime")) {
@ -97,9 +100,12 @@ function _setupEvents() {
$("replyPlacementList").observe ("change", onReplyPlacementListChange);
$("composeMessagesType").observe ("change", onComposeMessagesTypeChange);
var categoriesValue = $("categoriesValue");
if (categoriesValue)
categoriesValue.value = "";
var valueInputs = [ "calendarCategoriesValue", "calendarCategoriesValue" ];
for (var i = 0; i < valueInputs.length; i++) {
var valueInput = $(valueInputs[i]);
if (valueInput)
valueInput.value = "";
}
}
function onChoiceChanged(event) {
@ -140,16 +146,29 @@ function initPreferences() {
if (typeof (initAdditionalPreferences) != "undefined")
initAdditionalPreferences();
var table = $("categoriesList");
if (table) {
resetCategoriesColors(null);
var r = $$("TABLE#categoriesList tbody tr");
var wrapper = $("calendarCategoriesListWrapper");
if (wrapper) {
var table = wrapper.childNodesWithTag("table")[0];
resetCalendarCategoriesColors(null);
var r = $$("#calendarCategoriesListWrapper tbody tr");
for (var i= 0; i < r.length; i++)
r[i].identify();
table.multiselect = true;
resetTableActions();
$("categoryAdd").observe("click", onCategoryAdd);
$("categoryDelete").observe("click", onCategoryDelete);
resetCalendarTableActions();
$("calendarCategoryAdd").observe("click", onCalendarCategoryAdd);
$("calendarCategoryDelete").observe("click", onCalendarCategoryDelete);
}
wrapper = $("contactsCategoriesListWrapper");
if (wrapper) {
var table = wrapper.childNodesWithTag("table")[0];
var r = $$("#contactsCategoriesListWrapper tbody tr");
for (var i= 0; i < r.length; i++)
r[i].identify();
table.multiselect = true;
resetContactsTableActions();
$("contactsCategoryAdd").observe("click", onContactsCategoryAdd);
$("contactsCategoryDelete").observe("click", onContactsCategoryDelete);
}
// Disable placement (after) if composing in HTML
@ -759,9 +778,9 @@ function compactMailAccounts() {
}
}
/* categories */
function resetTableActions() {
var r = $$("TABLE#categoriesList tbody tr");
/* calendar categories */
function resetCalendarTableActions() {
var r = $$("#calendarCategoriesListWrapper tbody tr");
for (var i = 0; i < r.length; i++) {
var row = $(r[i]);
row.observe("mousedown", onRowClick);
@ -773,9 +792,9 @@ function resetTableActions() {
}
function onColorEdit (e) {
var r = $$("TABLE#categoriesList tbody tr td div.colorEditing");
var r = $$("#calendarCategoriesListWrapper div.colorEditing");
for (var i=0; i<r.length; i++)
r[i].removeClassName ("colorEditing");
r[i].removeClassName("colorEditing");
this.addClassName ("colorEditing");
var cPicker = window.open(ApplicationBaseURL + "../" + UserLogin
@ -790,7 +809,7 @@ function onColorEdit (e) {
}
function onColorPickerChoice (newColor) {
var div = $$("TABLE#categoriesList tbody tr td div.colorEditing").first ();
var div = $$("#calendarCategoriesListWrapper div.colorEditing").first ();
// div.removeClassName ("colorEditing");
div.showColor = newColor;
div.style.background = newColor;
@ -800,7 +819,7 @@ function onColorPickerChoice (newColor) {
}
}
function onCategoryAdd (e) {
function onCalendarCategoryAdd (e) {
var row = new Element ("tr");
var nametd = new Element ("td").update ("");
var colortd = new Element ("td");
@ -818,14 +837,14 @@ function onCategoryAdd (e) {
colortd.appendChild (colordiv);
row.appendChild (nametd);
row.appendChild (colortd);
$("categoriesList").tBodies[0].appendChild (row);
$("calendarCategoriesListWrapper").childNodesWithTag("table")[0].tBodies[0].appendChild (row);
resetTableActions ();
resetCalendarTableActions ();
nametd.editionController.startEditing();
}
function onCategoryDelete (e) {
var list = $('categoriesList').down("TBODY");;
function onCalendarCategoryDelete (e) {
var list = $('calendarCategoriesListWrapper').down("TABLE").down("TBODY");
var rows = list.getSelectedNodes();
var count = rows.length;
@ -835,8 +854,8 @@ function onCategoryDelete (e) {
}
}
function serializeCategories() {
var r = $$("TABLE#categoriesList tbody tr");
function serializeCalendarCategories() {
var r = $$("#calendarCategoriesListWrapper TBODY TR");
var values = [];
for (var i = 0; i < r.length; i++) {
@ -846,12 +865,11 @@ function serializeCategories() {
values.push("\"" + name + "\": \"" + color + "\"");
}
$("categoriesValue").value = "{ " + values.join(",\n") + "}";
$("calendarCategoriesValue").value = "{ " + values.join(",\n") + "}";
}
function resetCategoriesColors (e) {
var divs = $$("TABLE#categoriesList DIV.colorBox");
function resetCalendarCategoriesColors (e) {
var divs = $$("#calendarCategoriesListWrapper DIV.colorBox");
for (var i = 0; i < divs.length; i++) {
var d = divs[i];
var color = d.innerHTML;
@ -862,6 +880,62 @@ function resetCategoriesColors (e) {
}
}
/* /calendar categories */
/* contacts categories */
function resetContactsTableActions() {
var r = $$("#contactsCategoriesListWrapper tbody tr");
for (var i = 0; i < r.length; i++) {
var row = $(r[i]);
row.observe("mousedown", onRowClick);
var tds = row.childElements();
var editionCtlr = new RowEditionController();
editionCtlr.attachToRowElement(tds[0]);
}
}
function onContactsCategoryAdd(e) {
var row = new Element("tr");
row.identify();
row.addClassName("categoryListRow");
var nametd = new Element("td").update("");
nametd.addClassName("categoryListCell");
row.appendChild(nametd);
var list = $('contactsCategoriesListWrapper').down("TABLE").down("TBODY");
list.appendChild(row);
resetContactsTableActions ();
nametd.editionController.startEditing();
}
function onContactsCategoryDelete (e) {
var list = $('contactsCategoriesListWrapper').down("TABLE").down("TBODY");
var rows = list.getSelectedNodes();
var count = rows.length;
for (var i = 0; i < count; i++) {
rows[i].editionController = null;
rows[i].remove();
}
}
function serializeContactsCategories() {
var values = [];
var tds = $$("#contactsCategoriesListWrapper TBODY TD");
for (var i = 0; i < tds.length; i++) {
var td = $(tds[i]);
values.push(td.allTextContent());
}
$("contactsCategoriesValue").value = values.toJSON();
}
/* / contact categories */
function onReplyPlacementListChange() {
// above = 0
if ($("replyPlacementList").value == 0) {