]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@257 d1b88da0-ebda-0310-925b-ed51d...
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 16 Aug 2004 12:31:46 +0000 (12:31 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 16 Aug 2004 12:31:46 +0000 (12:31 +0000)
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/UIxAppointmentProposal.m
SOGo/UI/Scheduler/UIxAppointmentProposal.wox

index 557b2a5e69bd27fac9e7449e18d876671b95d177..17d412298c8bacc1ab2d80f30cde1ddcaa80bbda 100644 (file)
@@ -1,8 +1,11 @@
-2004-08-16  Marcus Mueller  <znek@mulle-kybernetik.com>
+2004-08-16  Helge Hess  <helge.hess@skyrix.com>
 
-       * v0.9.60
+       * UIxAppointmentProposal: proper vertical/horizontal row generation
+         (v0.9.61)
 
-       * UIxAppointmentView.m: fixed redirect in deleteAction.
+2004-08-16  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * UIxAppointmentView.m: fixed redirect in deleteAction. (v0.9.60)
 
        * v0.9.59
 
@@ -12,9 +15,7 @@
        * UIxAppointmentProposal.wox, UIxAppointmentEditor.wox: fixed
          cancel button urls.
 
-       * v0.9.58
-
-       * UIxAppointmentProposal.[wox,m]: fixed date/time fields.
+       * UIxAppointmentProposal.[wox,m]: fixed date/time fields. (v0.9.58)
 
 2004-08-16  Helge Hess  <helge.hess@skyrix.com>
 
index c4005ea719143293f1549abff32d44548f3c41fb..4ea4faef9f8ce1ff6dae0ab198c33216032380b1 100644 (file)
   /* individual values */
   id startDateHour;
   id startDateMinute;
+  id endDateHour;
+  id endDateMinute;
+
   id startDateDay;
   id startDateMonth;
   id startDateYear;
-
-  id endDateHour;
-  id endDateMinute;
   id endDateDay;
   id endDateMonth;
   id endDateYear;
 }
 
 - (void)setStartDateHour:(id)_startDateHour {
-    ASSIGN(self->startDateHour, _startDateHour);
+  ASSIGN(self->startDateHour, _startDateHour);
 }
 - (id)startDateHour {
-    return self->startDateHour;
+  return self->startDateHour;
 }
 - (void)setStartDateMinute:(id)_startDateMinute {
-    ASSIGN(self->startDateMinute, _startDateMinute);
+  ASSIGN(self->startDateMinute, _startDateMinute);
 }
 - (id)startDateMinute {
-    return self->startDateMinute;
+  return self->startDateMinute;
 }
 - (void)setStartDateDay:(id)_startDateDay {
-    ASSIGN(self->startDateDay, _startDateDay);
+  ASSIGN(self->startDateDay, _startDateDay);
 }
 - (id)startDateDay {
-    return self->startDateDay;
+  return self->startDateDay;
 }
 - (void)setStartDateMonth:(id)_startDateMonth {
-    ASSIGN(self->startDateMonth, _startDateMonth);
+  ASSIGN(self->startDateMonth, _startDateMonth);
 }
 - (id)startDateMonth {
-    return self->startDateMonth;
+  return self->startDateMonth;
 }
 - (void)setStartDateYear:(id)_startDateYear {
-    ASSIGN(self->startDateYear, _startDateYear);
+  ASSIGN(self->startDateYear, _startDateYear);
 }
 - (id)startDateYear {
-    return self->startDateYear;
+  return self->startDateYear;
 }
 - (void)setEndDateHour:(id)_endDateHour {
-    ASSIGN(self->endDateHour, _endDateHour);
+  ASSIGN(self->endDateHour, _endDateHour);
 }
 - (id)endDateHour {
-    return self->endDateHour;
+  return self->endDateHour;
 }
 - (void)setEndDateMinute:(id)_endDateMinute {
-    ASSIGN(self->endDateMinute, _endDateMinute);
+  ASSIGN(self->endDateMinute, _endDateMinute);
 }
 - (id)endDateMinute {
-    return self->endDateMinute;
+  return self->endDateMinute;
 }
 - (void)setEndDateDay:(id)_endDateDay {
-    ASSIGN(self->endDateDay, _endDateDay);
+  ASSIGN(self->endDateDay, _endDateDay);
 }
 - (id)endDateDay {
-    return self->endDateDay;
+  return self->endDateDay;
 }
 - (void)setEndDateMonth:(id)_endDateMonth {
-    ASSIGN(self->endDateMonth, _endDateMonth);
+  ASSIGN(self->endDateMonth, _endDateMonth);
 }
 - (id)endDateMonth {
-    return self->endDateMonth;
+  return self->endDateMonth;
 }
 - (void)setEndDateYear:(id)_endDateYear {
-    ASSIGN(self->endDateYear, _endDateYear);
+  ASSIGN(self->endDateYear, _endDateYear);
 }
 - (id)endDateYear {
-    return self->endDateYear;
+  return self->endDateYear;
 }
 
 - (void)setStartDate:(NSCalendarDate *)_date {
 }
 - (NSCalendarDate *)startDate {
   return [NSCalendarDate dateWithYear:[[self startDateYear] intValue]
-                                month:[[self startDateMonth] intValue]
-                                  day:[[self startDateDay] intValue]
-                                 hour:[[self startDateHour] intValue]
-                               minute:[[self startDateMinute] intValue]
-                               second:0
-                             timeZone:[self viewTimeZone]];
+                        month:[[self startDateMonth] intValue]
+                        day:[[self startDateDay] intValue]
+                        hour:[[self startDateHour] intValue]
+                        minute:[[self startDateMinute] intValue]
+                        second:0
+                        timeZone:[self viewTimeZone]];
 }
 - (void)setEndDate:(NSCalendarDate *)_date {
   [self setEndDateHour:[NSNumber numberWithInt:[_date hourOfDay]]];
   [self setEndDateYear:[NSNumber numberWithInt:[_date yearOfCommonEra]]];
 }
 - (NSCalendarDate *)endDate {
-    return [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
-                                  month:[[self endDateMonth] intValue]
-                                    day:[[self endDateDay] intValue]
-                                   hour:[[self endDateHour] intValue]
-                                 minute:[[self endDateMinute] intValue]
-                                 second:59
-                               timeZone:[self viewTimeZone]];
+  return [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
+                        month:[[self endDateMonth] intValue]
+                        day:[[self endDateDay] intValue]
+                        hour:[[self endDateHour] intValue]
+                        minute:[[self endDateMinute] intValue]
+                        second:59
+                        timeZone:[self viewTimeZone]];
 }
 
 - (void)setDuration:(id)_duration {
 
 - (NSString *)itemDurationText {
   // TODO: use a formatter
+  // TODO: localize
   switch ([[self item] intValue]) {
   case  30: return @"30 minutes";
   case  60: return @"1 hour";
   case 120: return @"2 hours";
+  case 240: return @"4 hours";
+  case 480: return @"8 hours";
   default:
     return [NSString stringWithFormat:@"%@ minutes", [self item]];
   }
   unsigned lStartHour = 9, lEndHour = 17, i;
   NSMutableArray *ma;
   
+  lStartHour = [[self startDateHour] intValue];
+  lEndHour   = [[self endDateHour]   intValue];
+  if (lStartHour < 1) lStartHour = 1;
+  if (lEndHour < lStartHour) lEndHour = lStartHour + 1;
+  
   ma = [NSMutableArray arrayWithCapacity:lEndHour - lStartHour + 2];
   for (i = lStartHour; i <= lEndHour; i++)
     [ma addObject:[NSNumber numberWithInt:i]];
 
 - (NSArray *)days {
   // TODO: from startdate to enddate
-  return [NSArray arrayWithObjects:@"2004-08-15", nil];
+  NSMutableArray *ma;
+  NSCalendarDate *base, *stop, *current;
+  
+  base = [NSCalendarDate dateWithYear:[[self startDateYear] intValue]
+                        month:[[self startDateMonth] intValue]
+                        day:[[self startDateDay] intValue]
+                        hour:12 minute:0 second:0
+                        timeZone:[self viewTimeZone]];
+  stop = [NSCalendarDate dateWithYear:[[self endDateYear] intValue]
+                        month:[[self endDateMonth] intValue]
+                        day:[[self endDateDay] intValue]
+                        hour:12 minute:0 second:0
+                        timeZone:[self viewTimeZone]];
+  
+  ma = [NSMutableArray arrayWithCapacity:16];
+  
+  current = base;
+  while ([current compare:stop] != NSOrderedDescending) {
+    [ma addObject:current];
+    
+    /* Note: remember the timezone behaviour of the method below! */
+    current = [current dateByAddingYears:0 months:0 days:1];
+  }
+  return ma;
 }
 
 - (NSArray *)durationSteps {
   // TODO: make configurable
-  return [NSArray arrayWithObjects:@"30", @"60", @"120", nil];
+  return [NSArray arrayWithObjects:
+                   @"30", @"60", @"120", @"240", @"480", nil];
 }
 
 /* slots */
   
   now = [NSCalendarDate date];
 
+  [self setDuration:@"120"]; /* 1 hour as default */
   [self setStartDate:[now hour:9 minute:0]];
   [self setEndDate:[now hour:18 minute:0]];
   
index 1f29e8a545b01cb614a84acf7284c65cd9a44a7a..01a8ba66d4987120f105d1509cf28de4008a590a 100644 (file)
@@ -29,8 +29,8 @@
 
     <tr>
       <td id="skywinbodycell" class="wincontent">
-            <form href="proposalSearch">
-              <table border="0" width="100%" cellspacing="0" cellpadding="4">
+        <form var:href="clientObject.baseURL">
+          <table border="0" width="100%" cellspacing="0" cellpadding="4">
                 <tr bgcolor="#e8e8e0">
                   <td align="left" colspan="2">
                     <span class="aptview_title">
@@ -75,9 +75,7 @@
                   </td>
                 </tr>
                 <tr valign="top">
-                  <td align="right"
-                      width="15%"
-                      bgcolor="#E8E8E0"
+                  <td align="right" width="15%" bgcolor="#E8E8E0"
                       class="aptview_text"
                   >
                     <var:string label:value="Earliest start time" />:
                   </td>
                 </tr>
               </table>
-            </form>
+        </form>
 
 
-            <hr size="1" noshade="noshade" />
-           <table border="0" cellpadding="0" width="100%" cellspacing="1">
+        <hr size="1" noshade="noshade" />
+        <table border="0" cellpadding="0" width="100%" cellspacing="1">
               <tr>
                 <td align="middle" bgcolor="#FFDAAA" 
                     colspan="1" rowspan="2"> </td>
                   <td width="15%" align="middle" bgcolor="#FFDAAA" colspan="1">
                     <font color="black" size="2" 
                           face="Arial,Helvetica,Verdana,Geneva,Tahoma"
-                          ><var:string value="currentDay" /></font>
+                          ><var:string value="currentDay" 
+                                       const:dateformat="%Y-%m-%d" /></font>
                   </td>
                   <var:foreach list="hours" item="item">
                     <var:if condition="isFirstHalfGreen">
                    </var:if>
                   </var:foreach>
                 </tr>
-              </var:foreach>
-            </table>
+          </var:foreach>
+        </table>
       </td>
     </tr>
   </table>