]> err.no Git - scalable-opengroupware.org/commitdiff
Fixed month navigation, some pretty printing
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 18 Jun 2004 10:46:35 +0000 (10:46 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 18 Jun 2004 10:46:35 +0000 (10:46 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@49 d1b88da0-ebda-0310-925b-ed51d893ca5b

ZideStore/UI-X/ChangeLog
ZideStore/UI-X/Common/OGoComponent.h
ZideStore/UI-X/Common/OGoComponent.m
ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox
ZideStore/UI-X/Scheduler/OGoCalMonthView.h
ZideStore/UI-X/Scheduler/OGoCalMonthView.m
ZideStore/UI-X/Scheduler/OGoCalSelectTab.m
ZideStore/UI-X/Scheduler/OGoCalView.m
ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox
ZideStore/UI-X/Scheduler/OGoCalWeekView.m

index d3a8eec8cb7c23b3510de651c6401df7d16f1ccd..483f30a8768d85c4c0c4abaac3f92908eef72a4f 100644 (file)
@@ -1,3 +1,20 @@
+2004-06-18  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * Common/OGoComponent.[hm]: new component which serves as a base
+         component for calendar components now. Knows how to deal with
+         queryParameters and offers url construction method(s).
+
+       * All existing components have been rewritten to use queryParameters
+         instead of hardcoded strings where this is feasible. This provides
+         future extensibility and flexibility.
+
+       * Handling of dates has been fixed to center around the use of a
+         'day' parameter. startDate/endDate are coupled to this, but
+         don't override it as it's the duty of the individual view to set
+         its (feasible) ranges accordingly. The new behaviour is noticable
+         in the calendar selection tabview instantly, as it now replicates
+         what OGo does.
+
 2004-06-16  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * Common/OGoAppNavView.m: construct URL correctly.
index 86795fdf09aac9a7a45e1fe8e02cf4ffb08581e0..e5323457040eebb99d3b27d34f705d92fc7bf9cf 100644 (file)
 - (NSString *)queryParameterForKey:(NSString *)_key;
 - (NSDictionary *)queryParameters;
 
-/* use this to set permanent query parameters */
+/* use this to set 'sticky' query parameters */
 - (void)setQueryParameter:(NSString *)_param forKey:(NSString *)_key;
 
+/* appends queryParameters to _method if any are set */
+- (NSString *)completeHrefForMethod:(NSString *)_method;
+
 @end
 
 #endif /* __OGoComponent_H_ */
index e6b4e621f68231ae2a074361e12a13c812b1011d..9e422ae6c7a9f42442e8f220fb1d46a22d3cba26 100644 (file)
     return self->queryParameters;
 }
 
+- (NSString *)completeHrefForMethod:(NSString *)_method {
+    NSDictionary *qp;
+    NSString *qs;
+    
+    qp = [self queryParameters];
+    if([qp count] == 0)
+        return _method;
+    
+    qs = [[self context] queryStringFromDictionary:qp];
+    return [_method stringByAppendingFormat:@"?%@", qs];
+}
+
 @end
index ef612d319d2849a954c0839b7d0f58aa6b8615b1..b863898c696d7cfdb9aaa02e942c9a9d3d7efb55 100644 (file)
         <tr bgcolor="#e8e8e0">
             <td align="left" valign="middle" width="80%">TODO: controls</td><!-- 99% -->
             <td align="right">
-                <var:component className="OGoCalBackForthNavView" prevURL="prevMonthURL" currentURL="thisMonthURL" nextURL="nextMonthURL" const:label="this month" />
+                <var:component className="OGoCalBackForthNavView"
+                               methodName="ownMethodName"
+                               prevQueryParameters="prevMonthQueryParameters"
+                               currentQueryParameters="todayQueryParameters"
+                               nextQueryParameters="nextMonthQueryParameters"
+                               const:label="this month"
+                />
             </td>
         </tr>
     </table>
   <table border="0" width="100%" cellpadding="0" cellspacing="0">
   <tr>
   <td colspan="2">
-  <var:component className="OGoCalSelectTab" const:selection="month" currentDate="startDate">
+  <var:component className="OGoCalSelectTab"
+                 const:selection="month"
+                 currentDate="selectedDate"
+  >
 
     <var:month-overview
       list="appointments"
index a4ba3ac8b9d04ef75e8d214f55bc96bb6344c9b2..f2c79e582592cbc262b19792180e0f41d223bbb3 100644 (file)
 {
 }
 
+- (NSDictionary *)prevMonthQueryParameters;
+- (NSDictionary *)thisMonthQueryParameters;
+- (NSDictionary *)nextMonthQueryParameters;
+
 @end
 
 #endif /* __ZideStoreUI_OGoCalMonthView_H__ */
index 3530b839f6c42124146f15cbd7ab454742ac38bf..a043271623e92d18775dba05f5f193c6b9f2ca25 100644 (file)
 
 /* URLs (TODO: fix scroll ranges for months!) */
 
-- (NSString *)prevMonthURL {
-  NSCalendarDate *newMonthDate;
-
-  newMonthDate = [[[self startDate] firstDayOfMonth] dateByAddingYears:0
-                                                     months:-1
-                                                     days:0
-                                                     hours:0
-                                                     minutes:0
-                                                     seconds:0];
-  return [self dateNavigationURLWithNewStartDate:newMonthDate];
-}
-
-- (NSString *)nextMonthURL {
-  NSCalendarDate *newMonthDate;
 
-  newMonthDate = [[[self startDate] firstDayOfMonth] dateByAddingYears:0
-                                                     months:1
-                                                     days:0
-                                                     hours:0
-                                                     minutes:0
-                                                     seconds:0];
-    return [self dateNavigationURLWithNewStartDate:newMonthDate];
+- (NSDictionary *)prevMonthQueryParameters {
+    NSCalendarDate *date;
+    
+    date = [[[self startDate] firstDayOfMonth] dateByAddingYears:0
+                                               months:-1
+                                               days:0
+                                               hours:0
+                                               minutes:0
+                                               seconds:0];
+    return [self queryParametersBySettingSelectedDate:date];
 }
 
-- (NSString *)thisMonthURL {
-  NSCalendarDate *newMonthDate;
-  
-  newMonthDate = [[NSCalendarDate date] mondayOfWeek];
-  return [self dateNavigationURLWithNewStartDate:newMonthDate];
+- (NSDictionary *)nextMonthQueryParameters {
+    NSCalendarDate *date;
+    
+    date = [[[self startDate] firstDayOfMonth] dateByAddingYears:0
+                                               months:1
+                                               days:0
+                                               hours:0
+                                               minutes:0
+                                               seconds:0];
+    return [self queryParametersBySettingSelectedDate:date];
 }
 
 @end /* OGoCalMonthView */
index a2bcb9fc5660c36c46cdc81e1f15e277a574075a..07d26696d5a2834c8b0217121d96ed69fc509bb0 100644 (file)
@@ -32,8 +32,6 @@
     NSCalendarDate *currentDate;
 }
 
-- (NSString *)completeHrefForMethod:(NSString *)_method;
-
 @end
 
 
 /* hrefs */
 
 
-- (NSString *)completeHrefForMethod:(NSString *)_method {
-    NSDictionary *qp;
-    NSString *qs;
-    
-    qp = [self queryParameters];
-    if([qp count] == 0)
-        return _method;
-
-    qs = [[self context] queryStringFromDictionary:qp];
-    return [_method stringByAppendingFormat:@"?%@", qs];
-}
-
 - (NSString *)daytabLink {
     return [self completeHrefForMethod:@"dayoverview"];
 }
index 1928ac0e7d6367d9e4fbb8ffb43c0a535bfd511b..6fe2a0582f57146818d442e116d7b633f8fc8eff 100644 (file)
 /* date selection & conversion */
 
 
+- (NSDictionary *)todayQueryParameters {
+    NSCalendarDate *date;
+    
+    date = [NSCalendarDate date]; /* today */
+    return [self queryParametersBySettingSelectedDate:date];
+}
+
 - (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date {
     NSMutableDictionary *qp;
     
index e69e697fba52f6c48bb70ba2183a541284b1b1f6..b0add1c53540b9141fdda16036df32d565080380 100644 (file)
     <tr bgcolor="#e8e8e0">
     <td align="left" valign="middle" width="80%">TODO: controls</td><!-- 99% -->
     <td align="right">
-    <var:component className="OGoCalBackForthNavView" methodName="ownMethodName" prevQueryParameters="prevWeekQueryParameters" currentQueryParameters="thisWeekQueryParameters" nextQueryParameters="nextWeekQueryParameters" const:label="this week" />
+    <var:component className="OGoCalBackForthNavView"
+                   methodName="ownMethodName"
+                   prevQueryParameters="prevWeekQueryParameters"
+                   currentQueryParameters="todayQueryParameters"
+                   nextQueryParameters="nextWeekQueryParameters"
+                   const:label="this week"
+    />
     </td>
     </tr>
     </table>
   </td>
   </tr>
   </table>
+  <!--
   <hr />
   <var:string value="thisWeekQueryParameters" />
+  -->
   <!--
   <hr/>
     
index c3ac9f6ee54c01a44c0d4990f66728628c3b40cd..9a3fe0800b72438db78d9060d5267b30c9d647d3 100644 (file)
     return [self queryParametersBySettingSelectedDate:date];
 }
 
-- (NSDictionary *)thisWeekQueryParameters {
-    NSCalendarDate *date;
-    
-    date = [NSCalendarDate date]; /* today */
-    return [self queryParametersBySettingSelectedDate:date];
-}
-
 - (NSDictionary *)nextWeekQueryParameters {
     NSCalendarDate *date;