]> err.no Git - scalable-opengroupware.org/commitdiff
AppointmentView -> first version
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 28 Jun 2004 18:50:52 +0000 (18:50 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 28 Jun 2004 18:50:52 +0000 (18:50 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@69 d1b88da0-ebda-0310-925b-ed51d893ca5b

13 files changed:
ZideStore/UI-X/ChangeLog
ZideStore/UI-X/Common/UIxComponent.h
ZideStore/UI-X/Common/UIxComponent.m
ZideStore/UI-X/Common/calendar.css
ZideStore/UI-X/Common/zidestoreui.css
ZideStore/UI-X/Scheduler/UIxAppointmentView.h
ZideStore/UI-X/Scheduler/UIxAppointmentView.m
ZideStore/UI-X/Scheduler/UIxAppointmentView.wox
ZideStore/UI-X/Scheduler/UIxCalDateLabel.wox
ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox
ZideStore/UI-X/Scheduler/UIxCalView.h
ZideStore/UI-X/Scheduler/UIxCalView.m
ZideStore/UI-X/Scheduler/UIxCalWeekOverview.wox

index f5f3d0701188402deb4af4497860b58e9dd6d947..1a2266b20986a5bb7aa199f769997a9b74615e96 100644 (file)
@@ -1,3 +1,14 @@
+2004-06-28  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * Common/UIxComponent.[hm]: moved -ownMethodName here.
+
+       * Scheduler/UIxCalView.[hm]: removed -ownMethodName, moved to
+         UIxComponent (reuse).
+
+       * Scheduler/UIxAppointmentView.[hm]: first "draft" of view component.
+         The look of OGo is resembled closely, but most features are still
+         missing.
+
 2004-06-28  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * Scheduler/GNUmakefile.preamble: links against libSOGoLogic now.
index eab1b73002ae7e0daea1ee269520c6f415d5bcf7..b3b41f59d1bcca2bc6149b80be3c2d83d350e4b1 100644 (file)
@@ -41,6 +41,8 @@
 /* appends queryParameters to _method if any are set */
 - (NSString *)completeHrefForMethod:(NSString *)_method;
 
+- (NSString *)ownMethodName;
+
 @end
 
 #endif /* __UIxComponent_H_ */
index 43534f0e5d0f4093738c525b6dec80949dbfc5a0..0a1650e6ac6e5778d1804e02e2322ccce6326912 100644 (file)
     return [_method stringByAppendingFormat:@"?%@", qs];
 }
 
+- (NSString *)ownMethodName {
+    NSString *uri;
+    NSRange  r;
+    
+    uri = [[[self context] request] uri];
+    
+    /* first: cut off query parameters */
+    
+    r = [uri rangeOfString:@"?" options:NSBackwardsSearch];
+    if (r.length > 0)
+        uri = [uri substringToIndex:r.location];
+    
+    /* next: strip trailing slash */
+    
+    if ([uri hasSuffix:@"/"]) uri = [uri substringToIndex:([uri length] - 1)];
+    r = [uri rangeOfString:@"/" options:NSBackwardsSearch];
+    
+    /* then: cut of last path component */
+    
+    if (r.length == 0) // no slash? are we at root?
+        return @"/";
+    
+    return [uri substringFromIndex:(r.location + 1)];
+}
+
 @end
index ee49f296da7670f7b6f731808a80c5fc624cd3f7..34553bb4cdf345c33c6c3087ba9f1d5f4be226da 100644 (file)
@@ -1,10 +1,16 @@
-.date_label {
-  color:            #06348b;
+.aptview_title {
+  font-size:        10pt;
   font-family:      Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
-  font-size:        12pt;
+  color:            #000000;
   font-weight:      bold;
 }
 
+.aptview_text {
+  font-size:        10pt;
+  font-family:      Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+  color:            #000000;
+}
+
 .weekoverview_title {
   font-size:        10pt;
   font-family:      Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
index be032b4629048c51b7a691c3cab95420a390970b..5d1e878ccdac27033971429f5cc6047796015d03 100644 (file)
@@ -41,6 +41,14 @@ font.defaultfont {
   color:            #000000;
 }
 
+.window_label {
+  color:            #06348b;
+  font-family:      Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+  font-size:        12pt;
+  font-weight:      bold;
+}
+
+
 /* tabs */
 
 .tab {
index 2cf500576f31bfb21a5ff2488f612cb81b29f4d8..9038594dbaa0c1cec1c94b0f63f7aca4d0cf290c 100644 (file)
@@ -3,12 +3,24 @@
 #ifndef __ZideStoreUI_UIxAppointmentView_H__
 #define __ZideStoreUI_UIxAppointmentView_H__
 
-#include <NGObjWeb/SoComponent.h>
+#include <Common/UIxComponent.h>
 
-@interface UIxAppointmentView : SoComponent
+@interface UIxAppointmentView : UIxComponent
 {
+    NSString *tabSelection;
+    id appointment;
+    id attendee;
 }
 
+- (id)appointment;
+
+- (NSString *)attributesTabLink;
+- (NSString *)participantsTabLink;
+
+- (NSString *)completeHrefForMethod:(NSString *)_method
+              withParameter:(NSString *)_param
+              forKey:(NSString *)_key;
+
 @end
 
 #endif /* __ZideStoreUI_UIxAppointmentView_H__ */
index e693810f98662fb6661c9812b198f934c5538f66..f69ee7471b542b5244487b75b4d19fbc326b986a 100644 (file)
@@ -3,6 +3,8 @@
 #include "UIxAppointmentView.h"
 #include "common.h"
 #include <Backend/SxAptManager.h>
+#include <SOGoLogic/SOGoAppointment.h>
+
 
 @interface NSObject(UsedPrivates)
 - (SxAptManager *)aptManagerInContext:(id)_ctx;
 @implementation UIxAppointmentView
 
 - (void)dealloc {
+  [self->appointment release];
+  [self->attendee release];
   [super dealloc];
 }
 
+
+/* accessors */
+
+
+- (NSString *)tabSelection {
+    NSString *selection;
+    
+    selection = [self queryParameterForKey:@"tab"];
+    if(! selection)
+        selection = @"attributes";
+    return selection;
+}
+
+- (void)setAttendee:(id)_attendee {
+    ASSIGN(self->attendee, _attendee);
+}
+- (id)attendee {
+    return self->attendee;
+}
+
+
 /* backend */
 
+
 - (SxAptManager *)aptManager {
   return [[self clientObject] aptManagerInContext:[self context]];
 }
 
-- (id)sogoApt {
-    NSString *iCalString;
-    id apt;
+- (SOGoAppointment *)appointment {
+    if(self->appointment == nil) {
+        NSString *iCalString;
+
+        iCalString = [[self clientObject] valueForKey:@"iCalString"];
+        self->appointment = [[SOGoAppointment alloc] initWithICalString:iCalString];
+    }
+    return self->appointment;
+}
+
+- (NSString *)formattedAptStartTime {
+    NSCalendarDate *date;
+    
+    date = [[self appointment] startDate];
+    /* TODO: convert this into display timeZone! */
+    return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"];
+}
+
+- (NSString *)formattedAptEndTime {
+    NSCalendarDate *date;
     
-    iCalString = [[self clientObject] iCalString];
-    apt = [[NSClassFromString(@"SOGoAppointment") alloc] initWithiCalString:iCalString];
-    return apt;
+    date = [[self appointment] endDate];
+    /* TODO: convert this into display timeZone! */
+    return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"];
+}
+
+
+/* hrefs */
+
+
+- (NSString *)attributesTabLink {
+    return [self completeHrefForMethod:[self ownMethodName]
+                 withParameter:@"attributes"
+                 forKey:@"tab"];
+}
+
+- (NSString *)participantsTabLink {
+    return [self completeHrefForMethod:[self ownMethodName]
+                 withParameter:@"participants"
+                 forKey:@"tab"];
+}
+
+- (NSString *)completeHrefForMethod:(NSString *)_method
+              withParameter:(NSString *)_param
+              forKey:(NSString *)_key
+{
+    NSString *href;
+
+    [self setQueryParameter:_param forKey:_key];
+    href = [self completeHrefForMethod:[self ownMethodName]];
+    [self setQueryParameter:nil forKey:_key];
+    return href;
 }
 
 @end /* UIxAppointmentView */
index 7d64959ed6402de56573d21e14bcf62d4a03e3c6..e60d68b4b5d8bd2f171fae03953510a6fbe1cf74 100644 (file)
@@ -1,9 +1,149 @@
 <?xml version='1.0' standalone='yes'?>
-<var:component className="UIxPageFrame" title="name"
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:var="http://www.skyrix.com/od/binding"
-  xmlns:const="http://www.skyrix.com/od/constant"
+<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"
+               className="UIxPageFrame"
+               title="name"
 >
+
+  <table cellspacing="0" cellpadding="5" width="100%">
+  <tr>
+  <td>
+  <table cellpadding="0" cellspacing="0" width="100%">
+  <tr>
+  <td width="5"/>
+  <td class="window_label">Appointment Viewer</td>
+  <td width="36" align="right" valign="center">
+  <var:component className="UIxWinClose" />
+  </td>
+  </tr>
+  </table>
+  </td>
+  </tr>
+
+  <tr>
+    <td>
+        <table border="0" cellpadding="2" width="100%" cellspacing="0">
+          <tr bgcolor="#e8e8e0">
+            <td align="left">
+              <span class="aptview_title"><var:string value="formattedAptStartTime" /></span>
+            </td>
+            <td align="right" >
+                <table border='0' cellpadding='0' cellspacing='1'>
+                    <tr>
+                        <td class="button_auto_env" nowrap="true" valign='middle' align='center'>
+                            <a class="button_auto"
+                               href="aptprintview"
+                               var:queryDictionary="queryParameters"
+                               target="SOGoPrintView"
+                            >printview</a>
+                        </td>
+                        <td class="button_auto_env" nowrap="true" valign='middle' align='center'>
+                            <a class="button_auto"
+                               href="edit"
+                               var:queryDictionary="queryParameters"
+                            >edit</a>
+                        </td>
+                        <td class="button_auto_env" nowrap="true" valign='middle' align='center'>
+                            <a class="button_auto"
+                               href="delete"
+                               var:queryDictionary="queryParameters"
+                            >delete</a>
+                        </td>
+                    </tr>
+                </table>
+            </td>
+          </tr>
+        </table>
+    </td>
+  </tr>
+  <tr>
+    <td valign="top" width="100%">
+      <table width="100%" border="0" cellpadding="4" cellspacing="0">
+      <!-- general appointment info -->
+      <tr valign="top">
+        <td align="right" width="15%" bgcolor="#E8E8E0">
+            <span class="aptview_text">Title:</span>
+        </td>
+        <td align="left" bgcolor="#FFFFF0">
+            <span class="aptview_text">
+              <var:string value="appointment.summary" />
+            </span>
+        </td>
+      </tr>
+      <tr valign="top">
+        <td align="right" width="15%" bgcolor="#E8E8E0">
+          <span class="aptview_text">Location:</span>
+        </td>
+        <td align="left" bgcolor="#FFFFF0">
+          <span class="aptview_text">
+            <var:string value="appointment.location" />
+          </span>
+        </td>
+      </tr>
+      </table>
+   </td>
+  </tr>
+  <tr>
+    <td valign="top" width="100%">
+        <uix:tabview var:selection="tabSelection"
+                     const:tabStyle="tab"
+                     const:selectedTabStyle="tab_selected"
+                     const:bodyStyle="tabview_body"
+        >
+          <uix:tab const:key="attributes"
+                   const:label="attributes"
+                   var:href="attributesTabLink">
+              <table width="100%" border="0" cellpadding="4" cellspacing="0">
+              <tr valign="top">
+                <td align="right" width="15%" bgcolor="#E8E8E0">
+                    <span class="aptview_text">Start time:</span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                    <span class="aptview_text">
+                      <var:string value="formattedAptStartTime" />
+                    </span>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td align="right" width="15%" bgcolor="#E8E8E0">
+                  <span class="aptview_text">End time:</span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <var:string value="formattedAptEndTime" />
+                  </span>
+                </td>
+              </tr>
+              </table>
+          </uix:tab>
+          <uix:tab const:key="participants"
+                   const:label="participants"
+                   var:href="participantsTabLink">
+              <table width="100%" border="0" cellpadding="4" cellspacing="0">
+              <tr valign="top">
+                <td align="left" bgcolor="#E8E8E0">
+                    <span class="aptview_title">Email</span>
+                </td>
+              </tr>
+              <var:foreach list="appointment.attendees" item="attendee">
+              <tr valign="top">
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <var:string value="attendee.email" />
+                  </span>
+                </td>
+              </tr>
+              </var:foreach>
+              </table>
+          </uix:tab>
+        </uix:tabview>
+    </td>
+  </tr>
+  </table>
+
+<!-- DEBUGGING
   <a href="../weekoverview" >week</a>
   <a href="../monthoverview">month</a>
   <br />
     As SOGoApt:<br />
     <pre><var:string value="sogoApt"/></pre>
     <pre><var:string value="sogoApt.event"/></pre>
-
+-->
 </var:component>
index c5d8b16849b76b7dade535b451dbfc360b1f106e..4a0c93ae65089cee780522516627792f7895bb93 100644 (file)
@@ -4,5 +4,5 @@
       xmlns:var="http://www.skyrix.com/od/binding"
       xmlns:const="http://www.skyrix.com/od/constant"
       xmlns:rsrc="OGo:url"
-      const:class="date_label"
+      const:class="window_label"
 ><var:string value="label" const:escapeHTML="NO" /></span>
\ No newline at end of file
index f79f96ae387c6f285a9b16ce1fed63412857b683..83b1b0d19c250d597e88a5d59741ca6ac74b7f86 100644 (file)
             <a var:href="appointmentViewURL"
                class="monthoverview_content_link"
                var:title="shortTextForApt"
+               var:queryDictionary="currentDayQueryParameters"
             ><var:string value="shortTitleForApt" /></a>
         </var:month>
     </var:month-overview>
index 59c49d37bcd42b82c26cb87777b7459f85647037..231d6228aab9b9a53c7552460eb608d2de68b544 100644 (file)
@@ -42,7 +42,6 @@
 /* URLs */
 
 - (NSString *)appointmentViewURL;
-- (NSString *)ownMethodName;
 
 /* backend */
 
index 65eb785b17c364911531678eee4fa84eaa130d9d..e68043df8d80065d0e4222b598be9242ca2e7d73 100644 (file)
   return [NSString stringWithFormat:@"%@/view", pkey];
 }
 
-- (NSString *)ownMethodName {
-  NSString *uri;
-  NSRange  r;
-  
-  uri = [[[self context] request] uri];
-  
-  /* first: cut off query parameters */
-  
-  r = [uri rangeOfString:@"?" options:NSBackwardsSearch];
-  if (r.length > 0)
-    uri = [uri substringToIndex:r.location];
-  
-  /* next: strip trailing slash */
-
-  if ([uri hasSuffix:@"/"]) uri = [uri substringToIndex:([uri length] - 1)];
-  r = [uri rangeOfString:@"/" options:NSBackwardsSearch];
-
-  /* then: cut of last path component */
-  
-  if (r.length == 0) // no slash? are we at root?
-    return @"/";
-  
-  return [uri substringFromIndex:(r.location + 1)];
-}
-
 
 /* backend */
 
index d5df607ec63a6b0c16b3ea3f7a7475096c448202..8faffe1e0145b1e766c4267521e68ba307d3b829 100644 (file)
                     <var:string value="holidayInfo" const:class="weekoverview_holidayinfo" />
                 </var:if>
                 <var:foreach list="allDayApts" item="appointment">
-                    <a var:href="appointmentViewURL"><var:string value="shortTextForApt" /></a>
+                    <a var:href="appointmentViewURL"
+                       var:queryDictionary="currentDayQueryParameters"
+                    ><var:string value="shortTextForApt" /></a>
                 </var:foreach>
             </var:week-info>
         </var:if>