fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10199] Logistic: Changed fields from_date and to_dat


From: Torstein
Subject: [Fmsystem-commits] [10199] Logistic: Changed fields from_date and to_date
Date: Wed, 10 Oct 2012 13:12:21 +0000

Revision: 10199
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10199
Author:   vator
Date:     2012-10-10 13:12:21 +0000 (Wed, 10 Oct 2012)
Log Message:
-----------
Logistic: Changed fields from_date and to_date 

Modified Paths:
--------------
    trunk/logistic/inc/class.sorequirement.inc.php
    trunk/logistic/inc/model/class.requirement.inc.php
    trunk/logistic/setup/setup.inc.php
    trunk/logistic/setup/tables_update.inc.php
    trunk/logistic/templates/base/requirement/requirement_item.xsl

Modified: trunk/logistic/inc/class.sorequirement.inc.php
===================================================================
--- trunk/logistic/inc/class.sorequirement.inc.php      2012-10-10 13:07:29 UTC 
(rev 10198)
+++ trunk/logistic/inc/class.sorequirement.inc.php      2012-10-10 13:12:21 UTC 
(rev 10199)
@@ -39,9 +39,9 @@
                {
                        $cols = array(
                                'activity_id',
-                               'date_from',
-                               'date_to',
-                               'no_of_items',
+                               'start_date',
+                               'end_date',
+                               'no_of_elements',
                                'location_id',
                                'create_user',
                                'create_date'
@@ -49,8 +49,8 @@
 
                        $values = array(
                                $this->marshal($requirement->get_activity_id(), 
'int'),
-                               $this->marshal($requirement->get_date_from(), 
'int'),
-                               $this->marshal($requirement->get_date_to(), 
'int'),
+                               $this->marshal($requirement->get_start_date(), 
'int'),
+                               $this->marshal($requirement->get_end_date(), 
'int'),
                                $this->marshal($requirement->get_no_of_items(), 
'int'),
                                $this->marshal($requirement->get_location_id(), 
'int'),
                                $this->marshal($requirement->get_create_user(), 
'int'),
@@ -76,9 +76,9 @@
 
                        $values = array(
                                'activity_id=' . 
$this->marshal($requirement->get_activity_id(), 'int'),
-                               'date_from=' . 
$this->marshal($requirement->get_date_from(), 'int'),
-                               'date_to=' . 
$this->marshal($requirement->get_date_to(), 'int'),
-                               'no_of_items=' . 
$this->marshal($requirement->get_no_of_items(), 'int'),
+                               'start_date=' . 
$this->marshal($requirement->get_start_date(), 'int'),
+                               'end_date=' . 
$this->marshal($requirement->get_end_date(), 'int'),
+                               'no_of_elements=' . 
$this->marshal($requirement->get_no_of_items(), 'int'),
                                'location_id=' . 
$this->marshal($requirement->get_location_id(), 'int')
                        );
 
@@ -166,8 +166,6 @@
                        $dir = $ascending ? 'ASC' : 'DESC';
                        $order = $sort_field ? "ORDER BY 
{$this->marshal($sort_field, 'field')} $dir ": '';
 
-                       //var_dump("SELECT {$cols} FROM {$tables} {$joins} 
WHERE {$condition} {$order}");
-
                        return "SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}";
                }
 
@@ -178,8 +176,10 @@
                                $requirement = new logistic_requirement((int) 
$requirement_id);
 
                                
$requirement->set_activity_id($this->unmarshal($this->db->f('activity_id'), 
'int'));
-                               
$requirement->set_date_from($this->unmarshal($this->db->f('date_from'), 'int'));
-                               
$requirement->set_date_to($this->unmarshal($this->db->f('date_to'), 'int'));
+                               
$requirement->set_start_date($this->unmarshal($this->db->f('start_date'), 
'int'));
+                               
$requirement->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
+                               
$requirement->set_no_of_items($this->unmarshal($this->db->f('no_of_elements'), 
'int'));
+                               
$requirement->set_location_id($this->unmarshal($this->db->f('location_id'), 
'int'));
                        }
 
                        return $requirement;

Modified: trunk/logistic/inc/model/class.requirement.inc.php
===================================================================
--- trunk/logistic/inc/model/class.requirement.inc.php  2012-10-10 13:07:29 UTC 
(rev 10198)
+++ trunk/logistic/inc/model/class.requirement.inc.php  2012-10-10 13:12:21 UTC 
(rev 10199)
@@ -36,10 +36,11 @@
                
                protected $id;
                protected $activity_id;
-               protected $date_from;
-               protected $date_to;
+               protected $start_date;
+               protected $end_date;
                protected $no_of_items;
                protected $location_id;
+               protected $create_user;
                
                /**
                 * Constructor.  Takes an optional ID.  If a contract is 
created from outside
@@ -92,26 +93,27 @@
                        return $this->activity_id;
                }
 
-               public function set_date_from($date_from)
+               public function set_end_date($end_date)
                {
-                       $this->date_from = $date_from;
+                       $this->end_date = $end_date;
                }
-
-               public function get_date_from()
+               
+               public function get_end_date() { return $this->end_date; }
+               
+               public function set_start_date($start_date)
                {
-                       return $this->date_from;
+                       $this->start_date = $start_date;
                }
-
-               public function set_date_to($date_to)
+               
+               public function get_start_date() { return $this->start_date; }
+               
+               public function set_create_user($create_user)
                {
-                       $this->date_to = $date_to;
+                       $this->create_user = $create_user;
                }
+               
+               public function get_create_user() { return $this->create_user; }
 
-               public function get_date_to()
-               {
-                       return $this->date_to;
-               }
-
                /**
                * Get a static reference to the storage object associated with 
this model object
                *
@@ -125,14 +127,16 @@
 
                        return self::$so;
                }
-
+               
                public function serialize()
                {
                        return array(
-                               'requirement_id' => $this->get_requirement_id(),
+                               'id' => $this->get_id(),
                                'activity_id' => $this->get_activity_id(),
-                               'date_from' => $this->get_date_from(),
-                               'date_to' => $this->get_date_to()
+                               'start_date' => $this->get_start_date(),
+                               'end_date' => $this->get_end_date(),
+                               'no_of_items' => $this->get_no_of_items(),
+                               'location_id' => $this->get_location_id(),
                        );
                }
        }
\ No newline at end of file

Modified: trunk/logistic/setup/setup.inc.php
===================================================================
--- trunk/logistic/setup/setup.inc.php  2012-10-10 13:07:29 UTC (rev 10198)
+++ trunk/logistic/setup/setup.inc.php  2012-10-10 13:12:21 UTC (rev 10199)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['logistic']['name'] = 'logistic';
-       $setup_info['logistic']['version'] = '0.0.1';
+       $setup_info['logistic']['version'] = '0.0.2';
        $setup_info['logistic']['app_order'] = 70;
        $setup_info['logistic']['enable'] = 1;
        $setup_info['logistic']['app_group']    = 'office';

Modified: trunk/logistic/setup/tables_update.inc.php
===================================================================
--- trunk/logistic/setup/tables_update.inc.php  2012-10-10 13:07:29 UTC (rev 
10198)
+++ trunk/logistic/setup/tables_update.inc.php  2012-10-10 13:12:21 UTC (rev 
10199)
@@ -1,2 +1,17 @@
 <?php
-        
\ No newline at end of file
+        
+       $test[] = '0.0.1';
+       function logistic_upgrade0_0_1()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               
+               
$GLOBALS['phpgw_setup']->oProc->RenameColumn('lg_requirement','date_from','start_date');
+               
$GLOBALS['phpgw_setup']->oProc->RenameColumn('lg_requirement','date_to','end_date');
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['logistic']['currentver'] = 
'0.0.2';
+                       return $GLOBALS['setup_info']['logistic']['currentver'];
+               }
+       }
+       
\ No newline at end of file

Modified: trunk/logistic/templates/base/requirement/requirement_item.xsl
===================================================================
--- trunk/logistic/templates/base/requirement/requirement_item.xsl      
2012-10-10 13:07:29 UTC (rev 10198)
+++ trunk/logistic/templates/base/requirement/requirement_item.xsl      
2012-10-10 13:12:21 UTC (rev 10199)
@@ -29,6 +29,7 @@
        <div class="yui-content" style="padding: 20px;">
                <div id="details">
                        <form action="#" method="post">
+                               <input type="hidden" name="id" value = 
"{requirement/id}" />
                                <input type="hidden" name="activity_id" value = 
"{activity/id}" />
                                                        
                                <dl class="proplist-col">
@@ -89,11 +90,7 @@
                                                        </dd>
                                                </xsl:when>
                                                <xsl:otherwise>
-                                                       <xsl:value-of 
select="entity/name" />
-                                                       <xsl:value-of 
select="category/name" />
-                                                       <xsl:for-each 
select="attributes">
-                                                               <xsl:value-of 
select="name" /><br/>
-                                                       </xsl:for-each>
+                                                       <xsl:value-of 
select="location/descr" />
                                                </xsl:otherwise>
                                        </xsl:choose>
                                        <dt>
@@ -105,7 +102,7 @@
                                                                <input 
style="width: 20px;" id="no_of_items" name="no_of_items" type="text" />
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                       
<span>{requirement/no_of_items}</span>
+                                                       <span><xsl:value-of 
select="requirement/no_of_items"/></span>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </dd>
@@ -121,7 +118,7 @@
                                                </xsl:when>
                                                <xsl:otherwise>
                                                        <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
-                                                       <input type="submit" 
name="edit_activity" value="{$lang_edit}" title = "{$lang_edit}" />
+                                                       <input type="submit" 
name="edit_requirement" value="{$lang_edit}" title = "{$lang_edit}" />
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </div>




reply via email to

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