phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] projects/inc/class.boprojecthours.inc.php, 1.33


From: nomail
Subject: [Phpgroupware-cvs] projects/inc/class.boprojecthours.inc.php, 1.33
Date: Mon, 21 Jun 2004 16:35:34 +0200

Update of /projects/inc
Modified Files:
        Branch: 
          class.boprojecthours.inc.php

date: 2004/06/21 14:35:34;  author: ceb;  state: Exp;  lines: +17 -19

Log Message:
update
=====================================================================
Index: projects/inc/class.boprojecthours.inc.php
diff -u projects/inc/class.boprojecthours.inc.php:1.32 
projects/inc/class.boprojecthours.inc.php:1.33
--- projects/inc/class.boprojecthours.inc.php:1.32      Sun Jun 20 23:02:36 2004
+++ projects/inc/class.boprojecthours.inc.php   Mon Jun 21 14:35:34 2004
@@ -7,7 +7,7 @@
        * Project Manager                                                   *
        * Written by Bettina Gille address@hidden                   *
        * -----------------------------------------------                   *
-       * Copyright 2000 - 2004 Free Software Foundation, Inc               *
+       * Copyright 2000 - 2004 Free Software Foundation, Inc.              *
        *                                                                   *
        * This program is free software; you can redistribute it and/or     *
        * modify it under the terms of the GNU General Public License as    *
@@ -293,16 +293,11 @@
                                }
                        }*/
 
-                       if (! 
checkdate($values['smonth'],$values['sday'],$values['syear']))
+                       if($values['sdate'] > 0 && $values['edate'] > 0)
                        {
-                               $error[] = lang('You have entered an invalid 
start date');
-                       }
-
-                       if ($values['emonth'] || $values['eday'] || 
$values['eyear'])
-                       {
-                               if (! 
checkdate($values['emonth'],$values['eday'],$values['eyear']))
+                               if($values['edate'] < $values['sdate'])
                                {
-                                       $error[] = lang('You have entered an 
invalid end date');
+                                       $error[] = lang('end date can not be 
before start date');
                                }
                        }
 
@@ -389,19 +384,22 @@
                                }
                        }
 
-                       if ($values['smonth'] || $values['sday'] || 
$values['syear'])
-                       {
-                               $values['sdate'] = 
mktime($values['shour'],$values['smin'],0,$values['smonth'], $values['sday'], 
$values['syear']);
-                       }
-
-            if (!$values['sdate'])
+                       if (!$values['sdate'])
             {
                 $values['sdate'] = time();
             }
 
-                       if ($values['emonth'] || $values['eday'] || 
$values['eyear'])
-                       {
-                               $values['edate'] = 
mktime($values['ehour'],$values['emin'],0,$values['emonth'],$values['eday'],$values['eyear']);
+                       $values['smonth']       = date('m',$values['sdate']);
+                       $values['sday']         = date('d',$values['sdate']);
+                       $values['syear']        = date('Y',$values['sdate']);
+                       $values['sdate']        = 
mktime(($values['shour']?$values['shour']:12),($values['smin']?$values['smin']:0),0,$values['smonth'],$values['sday'],$values['syear']);
+
+                       if (intval($values['edate']) > 0)
+                       {
+                               $values['emonth']       = 
date('m',$values['edate']);
+                               $values['eday']         = 
date('d',$values['edate']);
+                               $values['eyear']        = 
date('Y',$values['edate']);
+                               $values['edate']        = 
mktime(($values['ehour']?$values['ehour']:12),($values['emin']?$values['emin']:0),0,$values['emonth'],$values['eday'],$values['eyear']);
                        }
 
                        $values['w_minutes'] = 
$values['hours']*60+$values['minutes'];




reply via email to

[Prev in Thread] Current Thread [Next in Thread]