]> err.no Git - scalable-opengroupware.org/commitdiff
some more work on the Kolab viewers
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sat, 30 Jul 2005 18:44:52 +0000 (18:44 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sat, 30 Jul 2005 18:44:52 +0000 (18:44 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@926 d1b88da0-ebda-0310-925b-ed51d893ca5b

UI/MailPartViewers/ChangeLog
UI/MailPartViewers/UIxKolabPartContactViewer.m
UI/MailPartViewers/UIxKolabPartViewer.h
UI/MailPartViewers/UIxKolabPartViewer.m
UI/MailPartViewers/Version
UI/Templates/MailPartViewers/UIxKolabPartContactViewer.wox

index 2e886cbc97d406b4529fb715ba6a79351a6972c4..cc58921fd13ebf6f4810fa7b010578bdfc0c7920 100644 (file)
@@ -1,5 +1,11 @@
 2005-07-30  Helge Hess  <helge.hess@opengroupware.org>
 
+       * v0.9.22
+
+       * UIxKolabPartContactViewer.m: added accessors for multi-value fields
+
+       * UIxKolabPartViewer.m: added item
+
        * UIxKolabPartViewer.m: cache parsed DOM document (v0.9.21)
 
        * v0.9.20
index 9c9a948a9493e6ea7842ab907d22ecd3aebe8e64..663a9fdc05426bee4ea3dd938ea125e740660470 100644 (file)
 #include "common.h"
 
 @implementation UIxKolabPartContactViewer
+
+- (id<NSObject,DOMNodeList>)addressElements {
+  return [[[self domDocument] documentElement]
+                getElementsByTagName:@"address"];
+}
+
+- (id<NSObject,DOMNodeList>)phoneElements {
+  return [[[self domDocument] documentElement]
+                getElementsByTagName:@"phone"];
+}
+
+- (id<NSObject,DOMNodeList>)emailElements {
+  return [[[self domDocument] documentElement]
+                getElementsByTagName:@"email"];
+}
+
+- (id<NSObject,DOMNodeList>)customElements {
+  return [[[self domDocument] documentElement]
+                getElementsByTagName:@"x-custom"];
+}
+
 @end /* UIxKolabPartContactViewer */
index c2d02c6839afcb0f14c0c347fde67acdf0b12422..a47608b62d533ea3ecd33a3e45d6aae8fd97864f 100644 (file)
 
 @interface UIxKolabPartViewer : UIxMailPartViewer
 {
-  id<DOMDocument> domDocument;
+  id<NSObject,DOMDocument> domDocument;
+  id item;
 }
 
+/* getting a DOM representation */
+
+- (id<DOMDocument>)domDocument;
+
 @end
 
 #endif /* __Mailer_UIxKolabPartViewer_H__ */
index aecdb03adb6e660e755d30aac830870267e2dbd8..e5ac1cd642f754e111985f5c2a7b6e8920059c04 100644 (file)
@@ -38,6 +38,7 @@ static id<DOMBuilder> domBuilder = nil;
 
 - (void)dealloc {
   [(id)self->domDocument release];
+  [self->item release];
   [super dealloc];
 }
 
@@ -46,6 +47,7 @@ static id<DOMBuilder> domBuilder = nil;
 - (void)resetPathCaches {
   [super resetPathCaches];
   [(id)self->domDocument release]; self->domDocument = nil;
+  [self->item            release]; self->item        = nil;
 }
 
 /* getting a DOM representation */
@@ -65,4 +67,13 @@ static id<DOMBuilder> domBuilder = nil;
   return self->domDocument;
 }
 
+/* accessors */
+
+- (void)setItem:(id)_item {
+  ASSIGN(self->item, _item);
+}
+- (id)item {
+  return self->item;
+}
+
 @end /* UIxKolabPartViewer */
index d7c250fcac8deb05740ffc85e133a676715803ff..af29f2b2dc4223d7b6a17a98fffb4bbb2c82f552 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=21
+SUBMINOR_VERSION:=22
 
 # v0.9.0 requires libNGiCal v4.5.53
 # v0.9.1 requires libNGMime v4.5.213
index 0b5f57240cb4cf8e40cc8f6bbf9ff66d73c015a9..be0a05049775257e2647956ba376ef156de4c9ca 100644 (file)
             <var:string value="domDocument./longitude.textValue" />
           </td>
         </tr>
+
+        <tr>
+          <td valign="top"><var:string label:value="Phones"/>:</td>
+          <td>
+            <var:foreach list="phoneElements" item="item">
+              <var:string value="item./number.textValue"/>
+              (<var:string value="item./type.textValue"/>)
+              <br />
+            </var:foreach>
+          </td>
+        </tr>
+
+        <tr>
+          <td valign="top"><var:string label:value="Emails"/>:</td>
+          <td>
+            <var:foreach list="emailElements" item="item">
+              <var:string value="item./display-name.textValue"/>
+              &lt;<var:string value="item./smtp-address.textValue"/>&gt;
+              <br />
+            </var:foreach>
+          </td>
+        </tr>
       </table>
 <!--
 creation-date
@@ -103,16 +125,49 @@ last-modification-date
 picture
 x-logo
 
-phone [ type, number]
-email [ display-name, smtp-address ]
-
-address [ type, street, locality, region, postal-code, country ]
 preferred-address (type: home)
 
 x-custom [ @value, @app, @name ]
   -->
     </div>
 
+    <br />
+
+    <var:foreach list="addressElements" item="item">
+      <fieldset>
+        <legend>
+          <var:string label:value="Address"/>:
+          <var:string value="item./type.textValue"/><br />
+        </legend>
+      
+        <div class="linked_attachment_meta"
+             style="background-color: white; padding: 8px;">
+          <var:string value="item./street.textValue"/><br />
+          <var:string value="item./locality.textValue"/><br />
+          <var:string value="item./region.textValue"/><br />
+          <var:string value="item./postal-code.textValue"/><br />
+          <var:string value="item./country.textValue"/>
+        </div>
+     </fieldset>
+    </var:foreach>
+
+    <fieldset>
+      <legend>
+        <var:string label:value="Custom Attributes"/>
+      </legend>
+
+      <div class="linked_attachment_meta" style="background-color: white;">
+        <table border="0" class="linked_attachment_meta">
+          <var:foreach list="customElements" item="item">
+            <tr>
+              <td valign="top"><var:string value="item.@name.textValue"/>:</td>
+              <td><var:string value="item.@value.textValue"/></td>
+            </tr>
+          </var:foreach>
+        </table>
+      </div>
+    </fieldset>
+
 <!--
 DOC:     <var:string value="domDocument" /><br />
 DOCEL:   <var:string value="domDocument.documentElement" /><br />