diff --git a/ChangeLog b/ChangeLog index 5f26aa4a0..6937d3c1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-09-29 Wolfgang Sourdeau + * UI/WebServerResources/ContactsUI.js: hide the current contact + whenever the user changes of contact folder. + + * UI/WebServerResources/UIxContactEditor.js: the contact UID is + now provided by the template when loading the page. + * SoObjects/SOGo/AgenorUserManager.m ([AgenorUserManager -iCalPersonWithUid:uid]): new method taken from removed module 'iCalPerson+UIx'; diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index f63e8c820..3ea754bf7 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -33,18 +33,15 @@ menubar, copyhistory */ -var currentMessages = new Array(); -var maxCachedMessages = 20; var cachedContacts = new Array(); var currentContactFolder = ''; /* mail list */ -function openContactWindow(sender, contactuid, url) { +function openContactWindow(sender, url) { log ("message window at url: " + url); - var msgWin = window.open(url, "SOGo_msg_" + contactuid, + var msgWin = window.open(url, null, "width=544,height=525,resizable=1,scrollbars=1,toolbar=0," + "location=0,directories=0,status=0,menubar=0,copyhistory=0"); - msgWin.contactId = contactuid; msgWin.focus(); } @@ -104,12 +101,18 @@ function onContactsFolderTreeItemClick(element) function openContactsFolder(contactsFolder, params) { if (contactsFolder != currentContactFolder || params) { + if (contactsFolder == currentContactFolder) + selection = $("contactsList").getSelectedRowsId(); + else + selection = null; + currentContactFolder = contactsFolder; var url = ApplicationBaseURL + contactsFolder + "/view?noframe=1&sort=cn&desc=0"; if (params) url += '&' + params; - var selection = $("contactsList").getSelectedRowsId(); + log ("reload url = '" + url + "'"); + var selection; if (document.contactsListAjaxRequest) { document.contactsListAjaxRequest.aborted = true; document.contactsListAjaxRequest.abort(); @@ -272,7 +275,7 @@ function onContactRowDblClick(event, node) { var contactId = node.getAttribute('id'); - openContactWindow(null, contactId, + openContactWindow(null, ApplicationBaseURL + currentContactFolder + "/" + contactId + "/edit"); @@ -284,7 +287,7 @@ function onMenuEditContact(event, node) var node = getParentMenu(node).menuTarget.parentNode; var contactId = node.getAttribute('id'); - openContactWindow(null, contactId, + openContactWindow(null, ApplicationBaseURL + currentContactFolder + "/" + contactId + "/edit"); @@ -296,7 +299,7 @@ function onMenuWriteToContact(event, node) var node = getParentMenu(node).menuTarget.parentNode; var contactId = node.getAttribute('id'); - openContactWindow(null, contactId, + openContactWindow(null, ApplicationBaseURL + currentContactFolder + "/" + contactId + "/write"); @@ -316,7 +319,7 @@ function onToolbarEditSelectedContacts(event) var rows = contactsList.getSelectedRowsId(); for (var i = 0; i < rows.length; i++) { - openContactWindow(null, 'edit_' + rows[i], + openContactWindow(null, ApplicationBaseURL + currentContactFolder + "/" + rows[i] + "/edit"); } @@ -330,7 +333,7 @@ function onToolbarWriteToSelectedContacts(event) var rows = contactsList.getSelectedRowsId(); for (var i = 0; i < rows.length; i++) { - openContactWindow(null, 'writeto_' + rows[i], + openContactWindow(null, ApplicationBaseURL + currentContactFolder + "/" + rows[i] + "/write"); } @@ -416,7 +419,7 @@ function registerDraggableMessageNodes() } function newContact(sender) { - openContactWindow(sender, "new", + openContactWindow(sender, ApplicationBaseURL + currentContactFolder + "/new"); return false; /* stop following the link */ @@ -428,6 +431,8 @@ function onFolderSelectionChange() var nodes = folderList.getSelectedNodes(); var newFolder = nodes[0].getAttribute("id"); + $('contactView').innerHTML = ''; + openContactsFolder(newFolder); } diff --git a/UI/WebServerResources/UIxContactEditor.js b/UI/WebServerResources/UIxContactEditor.js index 16d85571f..9e76b3219 100644 --- a/UI/WebServerResources/UIxContactEditor.js +++ b/UI/WebServerResources/UIxContactEditor.js @@ -97,7 +97,7 @@ function submitContact(thisForm) { if (validateContactEditor()) { thisForm.submit(); if (window.opener.refreshContacts) - window.opener.setTimeout("refreshContacts(\""+ window.contactId +"\");", 200); + window.opener.setTimeout("refreshContacts(\""+ self.contactId +"\");", 200); window.close(); } } @@ -134,7 +134,8 @@ function onFnNewValue(event) { return true; } -function initEditorForm() { +function initEditorForm(contactId) { + self.contactId = contactId; displayNameChanged = ($("fn").value.length > 0); $("fn").onkeydown = onFnKeyDown; $("sn").onkeyup = onFnNewValue;