From: helge Date: Tue, 19 Jul 2005 15:38:12 +0000 (+0000) Subject: moved apt-editor validation to an own file X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e63a3f70bc571eecccf594e660421c851fa8cbc;p=scalable-opengroupware.org moved apt-editor validation to an own file git-svn-id: http://svn.opengroupware.org/SOGo/trunk@828 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SoObjects/Mailer/ChangeLog b/SOGo/SoObjects/Mailer/ChangeLog index afb810e9..06dde0ef 100644 --- a/SOGo/SoObjects/Mailer/ChangeLog +++ b/SOGo/SoObjects/Mailer/ChangeLog @@ -3,7 +3,7 @@ * SOGoMailFolder.m: report NO in -isCreateAllowed when the folder is the INBOX and SOGoSpecialFoldersInRoot (altnamespace) is enabled (#1472) (v0.9.112) - + * SOGoDraftObject.m: made 'SOGoInternetMailSuffix' a pattern which can access request values (v0.9.111) diff --git a/SOGo/UI/Common/ChangeLog b/SOGo/UI/Common/ChangeLog index ce634f96..47d153f4 100644 --- a/SOGo/UI/Common/ChangeLog +++ b/SOGo/UI/Common/ChangeLog @@ -1,5 +1,8 @@ 2005-07-19 Helge Hess + * UIxPageFrame.m: workaround for an issue with [page name] (page name + gets reset, so we use the page class instead) (v0.9.46) + * UIxPageFrame.m: added ability to auto-load per-page JavaScript files if appropriate resources are available (v0.9.45) diff --git a/SOGo/UI/Common/UIxPageFrame.m b/SOGo/UI/Common/UIxPageFrame.m index a5811b0a..4845e228 100644 --- a/SOGo/UI/Common/UIxPageFrame.m +++ b/SOGo/UI/Common/UIxPageFrame.m @@ -113,19 +113,21 @@ static NSMutableDictionary *pageToURL = nil; WOResourceManager *rm; WOComponent *page; - NSString *jsname; + NSString *jsname, *pageName; NSString *url; - page = [[self context] page]; - jsname = [page name]; - if ((url = [pageToURL objectForKey:jsname]) != nil) + page = [[self context] page]; + pageName = NSStringFromClass([page class]); + // TODO: does not seem to work! (gets reset): pageName = [page name]; + + if ((url = [pageToURL objectForKey:pageName]) != nil) return [url isNotNull] ? url : nil; if (pageToURL == nil) pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32]; rm = [self pageResourceManager]; - jsname = [jsname stringByAppendingString:@".js"]; + jsname = [pageName stringByAppendingString:@".js"]; url = [rm urlForResourceNamed:jsname inFramework: @@ -134,7 +136,7 @@ request:[[self context] request]]; /* cache */ - [pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:[page name]]; + [pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName]; return url; } diff --git a/SOGo/UI/Common/Version b/SOGo/UI/Common/Version index def68eed..0b39168d 100644 --- a/SOGo/UI/Common/Version +++ b/SOGo/UI/Common/Version @@ -1,5 +1,5 @@ # Version file -SUBMINOR_VERSION:=45 +SUBMINOR_VERSION:=46 # v0.9.28 requires NGExtensions v4.5.136 diff --git a/SOGo/UI/Templates/ChangeLog b/SOGo/UI/Templates/ChangeLog index 9c0c2082..f700586c 100644 --- a/SOGo/UI/Templates/ChangeLog +++ b/SOGo/UI/Templates/ChangeLog @@ -1,5 +1,8 @@ 2005-07-19 Helge Hess + * UIxAppointmentEditor.wox: import scheduler labels to the client, + moved validation function to UIxAppointmentEditor.js + * UIxAppointmentEditor.wox: use dateformat specific parsing methods during validation (#1490) diff --git a/SOGo/UI/Templates/UIxAppointmentEditor.wox b/SOGo/UI/Templates/UIxAppointmentEditor.wox index 86b0c5ad..b0536e69 100644 --- a/SOGo/UI/Templates/UIxAppointmentEditor.wox +++ b/SOGo/UI/Templates/UIxAppointmentEditor.wox @@ -8,37 +8,8 @@ className="UIxPageFrame" title="name" > - +
diff --git a/SOGo/UI/WebServerResources/UIxAppointmentEditor.js b/SOGo/UI/WebServerResources/UIxAppointmentEditor.js new file mode 100644 index 00000000..a2bfec1d --- /dev/null +++ b/SOGo/UI/WebServerResources/UIxAppointmentEditor.js @@ -0,0 +1,29 @@ +function validateAptEditor() { + var e; + + e = document.getElementById('summary'); + if (e.value.length == 0) { + if (!confirm(labels.validate_notitle)) + return false; + } + + e = document.getElementById('startTime_date'); + if (e.value.length != 10) { + alert(labels.validate_invalid_startdate); + return false; + } + if (calendar_startTime_date.prs_date(e.value) == null) + return false; + + e = document.getElementById('endTime_date'); + if (e.value.length != 10) { + alert(labels.validate_invalid_enddate); + return false; + } + if (calendar_endTime_date.prs_date(e.value) == null) + return false; + + // TODO: parse start/enddate and ensure that start is before end + + return true; +}