phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] projects/inc/class.uiprojects.inc.php, 1.149


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

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

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

Log Message:
update
=====================================================================
Index: projects/inc/class.uiprojects.inc.php
diff -u projects/inc/class.uiprojects.inc.php:1.148 
projects/inc/class.uiprojects.inc.php:1.149
--- projects/inc/class.uiprojects.inc.php:1.148 Sun Jun 20 23:02:41 2004
+++ projects/inc/class.uiprojects.inc.php       Mon Jun 21 14:35:34 2004
@@ -1768,12 +1768,16 @@
                        
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
                }
 
+
+// ---- MILESTONES -----
+
                function project_mstones()
                {
                        $action         = get_var('action',array('GET','POST'));
                        $project_id     = 
get_var('project_id',array('GET','POST'));
                        $values         = get_var('values',array('POST'));
                        $s_id           = get_var('s_id',array('GET','POST'));
+                       $edate          = get_var('edate',array('POST','GET'));
 
                        if(!$_POST['save'] && !$_GET['delete'] && 
!$_POST['done'] && !$_GET['edit'])
                        {
@@ -1798,10 +1802,19 @@
                                'referer'               => $referer
                        );
 
+                       $jscal = CreateObject('phpgwapi.jscalendar');
+
+                       if(is_array($edate))
+                       {
+                               $end_array      = 
$jscal->input2date($edate['str']);
+                               $end_val        = $end_array['raw'];
+                       }
+
                        if ($_POST['save'])
                        {
                                $values['s_id']                 = 
$values['new']?'':$s_id;
                                $values['project_id']   = $project_id;
+                               $values['edate']                = $end_val;
                                $error = 
$this->boprojects->check_mstone($values);
                                if(is_array($error))
                                {
@@ -1816,6 +1829,7 @@
 
                        if ($_POST['done'])
                        {
+                               unset($jscal);
                                Header('Location: ' . $referer);
                        }
 
@@ -1890,22 +1904,8 @@
                        
$GLOBALS['phpgw']->template->set_var('new_checked',$values['new']?' 
checked':'');
                        
$GLOBALS['phpgw']->template->set_var('title',$GLOBALS['phpgw']->strip_html($values['title']));
 
-                       if (!$values['edate'])
-                       {
-                               $values['emonth']       = 
$values['emonth']?$values['emonth']:date('m',time());
-                               $values['eday']         = 
$values['eday']?$values['eday']:date('d',time());
-                               $values['eyear']        = 
$values['eyear']?$values['eyear']:date('Y',time());
-                       }
-                       else
-                       {
-                               $values['eday'] = date('d',$values['edate']);
-                               $values['emonth'] = date('m',$values['edate']);
-                               $values['eyear'] = date('Y',$values['edate']);
-                       }
-
-                       
$GLOBALS['phpgw']->template->set_var('end_date_select',$GLOBALS['phpgw']->common->dateformatorder($this->sbox->getYears('values[eyear]',$values['eyear']),
-                                                                               
                                                                                
                        
$this->sbox->getMonthText('values[emonth]',$values['emonth']),
-                                                                               
                                                                                
                        $this->sbox->getDays('values[eday]',$values['eday'])));
+                       $end = 
$end_val?$end_val:($values['edate']?mktime(12,0,0,date('m',$values['edate']),date('d',$values['edate']),date('Y',$values['edate'])):mktime(12,0,0,date('m'),date('d'),date('Y')));
+                       
$GLOBALS['phpgw']->template->set_var('end_date_select',$jscal->input('edate[str]',$end));
 
                        
$GLOBALS['phpgw']->template->pfp('out','mstone_list_t',True);
                }




reply via email to

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