fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11481] property: condition survey:: multiplier


From: Sigurd Nes
Subject: [Fmsystem-commits] [11481] property: condition survey:: multiplier
Date: Thu, 21 Nov 2013 14:27:00 +0000

Revision: 11481
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11481
Author:   sigurdne
Date:     2013-11-21 14:26:59 +0000 (Thu, 21 Nov 2013)
Log Message:
-----------
property: condition survey:: multiplier

Modified Paths:
--------------
    trunk/property/inc/class.socondition_survey.inc.php
    trunk/property/inc/class.uicondition_survey.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/condition_survey.xsl

Modified: trunk/property/inc/class.socondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.socondition_survey.inc.php 2013-11-21 12:19:07 UTC 
(rev 11480)
+++ trunk/property/inc/class.socondition_survey.inc.php 2013-11-21 14:26:59 UTC 
(rev 11481)
@@ -89,8 +89,8 @@
                                $querymethod    = " {$where} {$table}.title 
{$this->_like} '%{$query}%'";
                        }
 
-                       $groupmethod = "GROUP BY 
$table.id,$table.title,$table.descr,$table.address,$table.entry_date,$table.user_id,
 org_name";
-                       $sql = "SELECT DISTINCT 
$table.id,$table.title,$table.descr,$table.address,$table.entry_date,$table.user_id,"
+                       $groupmethod = "GROUP BY 
$table.id,$table.title,$table.descr,$table.address,$table.entry_date,$table.user_id,
 org_name,multiplier";
+                       $sql = "SELECT DISTINCT 
$table.id,$table.title,$table.descr,$table.address,$table.entry_date,$table.user_id,multiplier,"
                        . " count(condition_survey_id) AS cnt, org_name as 
vendor FROM {$table} "
                        . " {$this->_join} fm_vendor ON {$table}.vendor_id = 
fm_vendor.id"
                        . " {$this->_left_join} fm_request ON {$table}.id 
=fm_request.condition_survey_id {$filtermethod} {$querymethod} {$groupmethod}";
@@ -120,6 +120,7 @@
                                        'vendor'                => 
$this->_db->f('vendor',true),
                                        'entry_date'    => 
$this->_db->f('entry_date'),
                                        'user'                  => 
$this->_db->f('user_id'),
+                                       'multiplier'    => 
$this->_db->f('multiplier'),
                                        'cnt'                   => 
$this->_db->f('cnt'),
                                );
                        }
@@ -151,6 +152,7 @@
                                        'user_id'                       => 
(int)$this->_db->f('user_id'),
                                        'entry_date'            => 
(int)$this->_db->f('entry_date'),
                                        'modified_date'         => 
(int)$this->_db->f('modified_date'),
+                                       'multiplier'            => 
(float)$this->_db->f('multiplier'),
                                );
 
                                if ( isset($data['attributes']) && 
is_array($data['attributes']) )
@@ -188,8 +190,8 @@
                        $value_set['report_date']               = 
phpgwapi_datetime::date_to_timestamp($data['report_date']);
                        $value_set['user_id']                   = 
$this->account;
                        $value_set['modified_date']             = time();
+                       $value_set['multiplier']                = 
(float)$data['multiplier'];
 
-
                        $cols = implode(',', array_keys($value_set));
                        $values = 
$this->_db->validate_insert(array_values($value_set));
                        $sql = "INSERT INTO {$table} ({$cols}) VALUES 
({$values})";
@@ -236,9 +238,9 @@
                        $value_set['report_date']               = 
phpgwapi_datetime::date_to_timestamp($data['report_date']);
                        $value_set['user_id']                   = 
$this->account;
                        $value_set['modified_date']             = time();
+                       $value_set['multiplier']                = 
(float)$data['multiplier'];
 
 
-
                        $this->_db->query("SELECT coordinator_id FROM 
fm_condition_survey WHERE id = {$id}",__LINE__,__FILE__);
                        $this->_db->next_record();
                        $old_coordinator_id             = 
(int)$this->_db->f('coordinator_id');

Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2013-11-21 12:19:07 UTC 
(rev 11480)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2013-11-21 14:26:59 UTC 
(rev 11481)
@@ -200,6 +200,11 @@
                                                        'sortable' => true,
                                                ),
                                                array(
+                                                       'key' => 'multiplier',
+                                                       'label' => 
lang('multiplier'),
+                                                       'sortable' => false,
+                                               ),
+                                               array(
                                                        'key' => 'cnt',
                                                        'label' => 
lang('count'),
                                                        'sortable' => false,

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2013-11-21 12:19:07 UTC (rev 11480)
+++ trunk/property/setup/setup.inc.php  2013-11-21 14:26:59 UTC (rev 11481)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.673';
+       $setup_info['property']['version']              = '0.9.17.674';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2013-11-21 12:19:07 UTC (rev 
11480)
+++ trunk/property/setup/tables_current.inc.php 2013-11-21 14:26:59 UTC (rev 
11481)
@@ -831,6 +831,7 @@
                                'user_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
                                'entry_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                'modified_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
+                               'multiplier' => array('type' => 
'decimal','precision' => '20','scale' => '2','default' => '1','nullable' => 
True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2013-11-21 12:19:07 UTC (rev 
11480)
+++ trunk/property/setup/tables_update.inc.php  2013-11-21 14:26:59 UTC (rev 
11481)
@@ -7784,3 +7784,30 @@
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
+       
+       /**
+       * Update property version from 0.9.17.673 to 0.9.17.674
+       * Add configurable prioriy keys for tickets
+       */
+
+       $test[] = '0.9.17.673';
+       function property_upgrade0_9_17_673()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_condition_survey', 'multiplier', 
array
+                               (
+                                       'type'          => 'decimal',
+                                       'precision' => '20',
+                                       'scale'         => '2',
+                                       'default'       => '1.00',
+                                       'nullable'      => True
+                               )
+                       );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.674';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }

Modified: trunk/property/templates/base/condition_survey.xsl
===================================================================
--- trunk/property/templates/base/condition_survey.xsl  2013-11-21 12:19:07 UTC 
(rev 11480)
+++ trunk/property/templates/base/condition_survey.xsl  2013-11-21 14:26:59 UTC 
(rev 11481)
@@ -108,7 +108,6 @@
                                                </xsl:choose>
                                        </dd>
 
-
                                        <dt>
                                                <label 
for="category"><xsl:value-of select="php:function('lang', 'category')" 
/></label>
                                        </dt>
@@ -131,6 +130,26 @@
                                                </xsl:choose>
                                        </dd>
                                        <dt>
+                                               <label 
for="multiplier"><xsl:value-of select="php:function('lang', 'multiplier')" 
/></label>
+                                       </dt>
+                                       <dd>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="editable = 1">
+                                                               <input 
id="multiplier" name='values[multiplier]' type="text" 
value="{survey/multiplier}"
+                                                                       
formvalidator:FormField="yes" 
+                                                                       
formvalidator:Type="DoubleField" 
+                                                                       
formvalidator:min="1" 
+                                                                       
formvalidator:maxDecimalPlaces="2" 
+                                                                       
formvalidator:minInclusive="true" 
+                                                                       
formvalidator:maxInclusive="true" /> 
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <xsl:value-of 
select="survey/multiplier"/>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </dd>
+
+                                       <dt>
                                                        <label 
for="date"><xsl:value-of select="php:function('lang', 'date')" /></label>
                                        </dt>
                                        <dd>




reply via email to

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