]> err.no Git - scalable-opengroupware.org/commitdiff
added email validation (#1483)
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 18 Jul 2005 20:22:48 +0000 (20:22 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 18 Jul 2005 20:22:48 +0000 (20:22 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@812 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/Templates/ChangeLog
SOGo/UI/Templates/ContactsUI/UIxContactEditor.wox
SOGo/UI/Templates/ContactsUI/UIxContactsListView.wox
SOGo/UI/Templates/MailerUI/UIxMailMainFrame.wox
SOGo/UI/Templates/UIxPageFrame.wox

index acffd510d408675c5c9a0de63041f4f6c7b34434..602c63c6e56afc08dcec04409a453abd98d269c1 100644 (file)
@@ -1,5 +1,12 @@
 2005-07-18  Helge Hess  <helge.hess@opengroupware.org>
 
+       * ContactsUI/UIxContactEditor.wox: validate email field prior form
+         submit (#1483)
+
+       * MailerUI/UIxMailMainFrame.wox: removed searchfield.js from <head>
+
+       * UIxPageFrame.wox: added generic.js to <head>
+
        * ContactsUI/UIxContactsListView.wox: fixed a static reference to
          /sogod.woa/
 
index 64c83fc3575b006793102d62958bcb39d1ed2369..9ac83421d521432dcc51b5652b22c8573ac6291d 100644 (file)
@@ -1,11 +1,12 @@
 <?xml version='1.0' standalone='yes'?>
-<var:component xmlns="http://www.w3.org/1999/xhtml"
-               xmlns:var="http://www.skyrix.com/od/binding"
-               xmlns:const="http://www.skyrix.com/od/constant"
-               xmlns:uix="OGo:uix"
-               xmlns:label="OGo:label"
-               className="UIxPageFrame"
-               title="name"
+<var:component
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:var="http://www.skyrix.com/od/binding"
+  xmlns:const="http://www.skyrix.com/od/constant"
+  xmlns:uix="OGo:uix"
+  xmlns:label="OGo:label"
+  className="UIxPageFrame"
+  title="name"
 >
   <style>
     table.editsec {
 
   <script language="JavaScript">
     <var:string value="jsCopyContactCode" const:escapeHTML="NO" />
+    
+    function validateContactEditor() {
+      var e = document.getElementById('email');
+      if (e.value.length == 0)
+        return true;
+      if (uixEmailRegex.test(e.value) != true)
+        return confirm('<var:string label:value="invalidemailwarn"/>');
+      return true;
+    }
   </script>
-
-  <form var:href="clientObject.baseURL">
+  
+  <form var:href="clientObject.baseURL" name="editform"
+        onsubmit="return validateContactEditor()">
     <table cellspacing="0" cellpadding="5" width="100%">
       <tr>
         <td>
@@ -38,7 +49,7 @@
         <td>
           <var:if condition="hasErrorText">
             <div style="background-color: #AA0000;">
-                 <var:string value="errorText" />
+             <var:string value="errorText" />
             </div>
             <hr />
           </var:if>
               </td>
               <td align="left" bgcolor="#FFFFF0">
                 <span class="aptview_text">
-                  <input type="text"
-                         name="sn"
-                         id="sn"
-                         var:value="snapshot.sn"
-                         size="60"
-                  />
+                  <input type="text" name="sn" id="sn"
+                         var:value="snapshot.sn" size="60" />
                 </span>
               </td>
             </tr>
               </td>
               <td align="left" bgcolor="#FFFFF0">
                 <span class="aptview_text">
-                  <input type="hidden"
-                         name="cn"
-                         id="cn"
-                         var:value="anaisCN"                         
-                  />
-                  <input type="text"
-                         name="givenName"
-                         id="givenName"
-                         var:value="snapshot.givenName"
-                         size="60"
-                  />
+                  <input type="hidden" name="cn" id="cn" var:value="anaisCN"/>
+                  <input type="text" name="givenName" id="givenName"
+                         var:value="snapshot.givenName" size="60" />
                 </span>
               </td>
             </tr>
                   <!-- pamela.schema defines this as 'mobile',
                        NOT 'mobileTelephoneNumber'
                   -->
-                  <input type="text"
-                         name="mobile"
-                         id="mobile"
-                         var:value="snapshot.mobile"
-                         size="60"
-                  />
+                  <input type="text" name="mobile" id="mobile"
+                         var:value="snapshot.mobile" size="60" />
                 </span>
               </td>
             </tr>
               </td>
               <td align="left" bgcolor="#FFFFF0">
                 <span class="aptview_text">
-                  <input type="text"
-                         name="mail"
-                         id="email"
-                         var:value="snapshot.mail"
-                         size="60"
-                  />
+                  <input type="text" name="mail" id="email"
+                         var:value="snapshot.mail" size="60" />
                 </span>
               </td>
             </tr>
               </td>
               <td align="left" bgcolor="#FFFFF0">
                 <span class="aptview_text">
-                  <input type="text"
-                         name="departmentNumber"
+                  <input type="text" name="departmentNumber"
                          id="departmentNumber"
-                         var:value="snapshot.departmentNumber"
-                         size="60"
-                  />
+                         var:value="snapshot.departmentNumber" size="60" />
                 </span>
               </td>
             </tr>
               </td>
               <td align="left" bgcolor="#FFFFF0">
                 <span class="aptview_text">
-                  <input type="text"
-                         name="l"
-                         id="l"
-                         var:value="snapshot.l"
-                         size="60"
-                  />
+                  <input type="text" name="l" id="l" var:value="snapshot.l"
+                         size="60" />
                 </span>
               </td>
             </tr>
               <td align="left" bgcolor="#FFFFF0">
                 <span class="aptview_text">
                   <input type="text" name="labeledURI" 
-                         var:value="snapshot.labeledURI" 
-                         size="60" />
+                        var:value="snapshot.labeledURI" size="60" />
                 </span>
               </td>
             </tr>
       clientObject: <var:string value="clientObject" />
     </small>
   </var:if>
-</var:component>
\ No newline at end of file
+</var:component>
index 4dd5168fd87b153f7ceae469116d9b6836377a0b..fc62ebd0b76a85800323e735cf7d2a71d13c15e2 100644 (file)
@@ -1,11 +1,13 @@
 <?xml version='1.0' standalone='yes'?>
-<var:component xmlns="http://www.w3.org/1999/xhtml"
-               xmlns:var="http://www.skyrix.com/od/binding"
-               xmlns:const="http://www.skyrix.com/od/constant"
-               xmlns:uix="OGo:uix"
-               xmlns:label="OGo:label"
-               className="UIxPageFrame"
-               title="name"
+<var:component
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:var="http://www.skyrix.com/od/binding"
+  xmlns:const="http://www.skyrix.com/od/constant"
+  xmlns:uix="OGo:uix"
+  xmlns:label="OGo:label"
+  xmlns:rsrc="OGo:url"
+  className="UIxPageFrame"
+  title="name"
 >
   <style>
     table.contacttableview {
     }
   </style>
 
-  <table id="skywintable"
-         class="wintable"
-         cellspacing="0"
-         cellpadding="5"
-         width="100%"
-  >
+  <table id="skywintable" class="wintable" cellspacing="0" cellpadding="5"
+         width="100%">
     <tr>
       <td class="wintitle">
         <table cellpadding="0" cellspacing="0" width="100%">
                       <table border="0" cellpadding="0" cellspacing="1">
                         <tr>
                           <td class="button_auto_env"
-                              nowrap="true"
-                              valign="middle"
-                              align="center"
-                          >
+                              nowrap="true" valign="middle" align="center">
                             <a class="button_auto"
                                href="new"
                                var:queryDictionary="queryParameters"
index 3661ccd9d85f6c1de6cfc1fd2c08211343cafda8..7a8a63feb744e2fc0b81ab00d15f3461a4e69ca9 100644 (file)
@@ -21,9 +21,8 @@
     <meta name="author" content="SKYRIX Software AG"/>
     <meta name="robots" content="stop"/>
     
-    <script rsrc:src="generic.js"    > <!-- space required --></script>
-    <script rsrc:src="mailer.js"     > <!-- space required --></script>
-    <script rsrc:src="searchfield.js"> <!-- space required --></script>
+    <script rsrc:src="generic.js"> <!-- space required --></script>
+    <script rsrc:src="mailer.js" > <!-- space required --></script>
     
     <link type="text/css" rel="stylesheet" rsrc:href="uix.css"/>
     <link type="text/css" rel="stylesheet" rsrc:href="mailer.css"/>
index 4c6f9f993b04c7a2663f845ef85b25c90556ac13..2758fe42d5239ef56fd6057b8ea94de0cf4d65f4 100644 (file)
@@ -15,6 +15,7 @@
     <link type="text/css" rel="stylesheet" rsrc:href="uix.css"/>
     <link type="text/css" rel="stylesheet" rsrc:href="calendar.css"/>
     <link href="mailto:hh@skyrix.com" rev="made"/>
+    <script rsrc:src="generic.js"> <!-- space required --></script>
   </head>
 
   <body>