fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7105] property: add regulations to request


From: Sigurd Nes
Subject: [Fmsystem-commits] [7105] property: add regulations to request
Date: Thu, 10 Mar 2011 19:01:47 +0000

Revision: 7105
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7105
Author:   sigurdne
Date:     2011-03-10 19:01:45 +0000 (Thu, 10 Mar 2011)
Log Message:
-----------
property: add regulations to request

Modified Paths:
--------------
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.sorequest.inc.php
    trunk/property/inc/class.uirequest.inc.php
    trunk/property/templates/base/request.xsl

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2011-03-10 15:31:52 UTC (rev 
7104)
+++ trunk/property/inc/class.sogeneric.inc.php  2011-03-10 19:01:45 UTC (rev 
7105)
@@ -2085,6 +2085,9 @@
 
                        $this->_db->query("SELECT id, {$fields} FROM {$table} 
{$filtermthod} {$ordermethod}");
 
+                       $return_fields = isset($data['fields']) && 
$data['fields'] && is_array($data['fields']) ? $data['fields'] : array();
+                       
+                       $i = 0;
                        while ($this->_db->next_record())
                        {
                                $_extra = $this->_db->f($id_in_name);
@@ -2099,11 +2102,18 @@
                                        $name = "{$_extra} - {$name}";
                                }
 
-                               $values[] = array
-                                       (
-                                               'id'    => $id,
-                                               'name'  => $name
-                                       );
+                               $values[$i] = array
+                               (
+                                       'id'    => $id,
+                                       'name'  => $name
+                               );
+
+                               foreach ($return_fields as $return_field)
+                               {
+                                       $values[$i][$return_field] = 
$this->_db->f($return_field, true);
+                               }
+
+                               $i++;
                        }
                        return $values;
                }

Modified: trunk/property/inc/class.sorequest.inc.php
===================================================================
--- trunk/property/inc/class.sorequest.inc.php  2011-03-10 15:31:52 UTC (rev 
7104)
+++ trunk/property/inc/class.sorequest.inc.php  2011-03-10 19:01:45 UTC (rev 
7105)
@@ -468,7 +468,8 @@
                                                'entry_date'                    
=> $this->db->f('entry_date'),
                                                'closed_date'                   
=> $this->db->f('closed_date'),
                                                'in_progress_date'              
=> $this->db->f('in_progress_date'),
-                                               'delivered_date'                
=> $this->db->f('delivered_date')
+                                               'delivered_date'                
=> $this->db->f('delivered_date'),
+                                               'regulations'                   
=> explode(',', $this->db->f('regulations'))
                                        );
 
                                if ( isset($values['attributes']) && 
is_array($values['attributes']) )
@@ -585,6 +586,7 @@
                        $value_set['building_part']                     = 
$request['building_part'];
                        $value_set['start_date']                        = 
$request['start_date'];
                        $value_set['end_date']                          = 
$request['end_date'];
+                       $value_set['regulations']                       = 
$request['regulations'] ? ',' . implode(',',$request['regulations']) . ',' : '';
 
                        $cols = implode(',', array_keys($value_set));
                        $values = 
$this->bocommon->validate_db_insert(array_values($value_set));
@@ -688,20 +690,21 @@
                        }
 
                        $value_set = array
-                               (
-                                       'title'                                 
=> $this->db->db_addslashes($request['title']),
-                                       'status'                                
=> $request['status'],
-                                       'category'                              
=> $request['cat_id'],
-                                       'start_date'                    => 
$request['start_date'],
-                                       'end_date'                              
=> $request['end_date'],
-                                       'coordinator'                   => 
$request['coordinator'],
-                                       'descr'                                 
=> $this->db->db_addslashes($request['descr']),
-                                       'budget'                                
=> (int)$request['budget'],
-                                       'location_code'                 => 
$request['location_code'],
-                                       'address'                               
=> $address,
-                                       'authorities_demands'   => 
$request['authorities_demands'],
-                                       'building_part'                 => 
$request['building_part'],
-                               );
+                       (
+                               'title'                                 => 
$this->db->db_addslashes($request['title']),
+                               'status'                                => 
$request['status'],
+                               'category'                              => 
$request['cat_id'],
+                               'start_date'                    => 
$request['start_date'],
+                               'end_date'                              => 
$request['end_date'],
+                               'coordinator'                   => 
$request['coordinator'],
+                               'descr'                                 => 
$this->db->db_addslashes($request['descr']),
+                               'budget'                                => 
(int)$request['budget'],
+                               'location_code'                 => 
$request['location_code'],
+                               'address'                               => 
$address,
+                               'authorities_demands'   => 
$request['authorities_demands'],
+                               'building_part'                 => 
$request['building_part'],
+                               'regulations'                   => 
$request['regulations'] ? ',' . implode(',',$request['regulations']) . ',' : ''
+                       );
 
                        while (is_array($request['location']) && 
list($input_name,$value) = each($request['location']))
                        {

Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php  2011-03-10 15:31:52 UTC (rev 
7104)
+++ trunk/property/inc/class.uirequest.inc.php  2011-03-10 19:01:45 UTC (rev 
7105)
@@ -1408,12 +1408,12 @@
                                        'currency'                              
                        => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
 
                                        'authorities_demands'                   
        => array('options' => 
execMethod('property.bogeneric.get_list',array('type' => 'authorities_demands', 
'selected' => $values['authorities_demands']))),
-                                       'regulations'                           
                => execMethod('property.bogeneric.get_list',array('type' => 
'regulations', 'selected' => $values['regulations'])),
+                                       'regulations'                           
                => execMethod('property.bogeneric.get_list',array('type' => 
'regulations', 'selected' => $values['regulations'], 'fields' => array('descr', 
'external_ref'))),
 
                                        'condition_list'                        
                => $this->bo->select_conditions($id),
                                        'building_part_list'                    
        => array('options' => 
$this->bocommon->select_category_list(array('type'=> 'building_part','selected' 
=>$values['building_part'], 'order' => 'id', 'id_in_name' => 'num' ))),
                                );
-
+//_debug_array($data['regulations']);die();
                        phpgwapi_yui::load_widget('dragdrop');
                        phpgwapi_yui::load_widget('datatable');
                        phpgwapi_yui::load_widget('menu');

Modified: trunk/property/templates/base/request.xsl
===================================================================
--- trunk/property/templates/base/request.xsl   2011-03-10 15:31:52 UTC (rev 
7104)
+++ trunk/property/templates/base/request.xsl   2011-03-10 19:01:45 UTC (rev 
7105)
@@ -460,6 +460,56 @@
                                                                                
                </select>                       
                                                                                
        </td>
                                                                                
</tr>
+
+                                                                               
<tr>
+                                                                               
        <td valign='top' align="left">
+                                                                               
                <xsl:value-of select="php:function('lang', 'regulations')" />
+                                                                               
        </td>
+                                                                               
        <td colspan='3'>
+                                                                               
                <table cellpadding="2" cellspacing="2" width="50%" align="left">
+                                                                               
                        <xsl:for-each select="regulations" >
+                                                                               
                                <tr>
+                                                                               
                                        <xsl:attribute name="class">
+                                                                               
                                                <xsl:choose>
+                                                                               
                                                        <xsl:when test="@class">
+                                                                               
                                                                <xsl:value-of 
select="@class"/>
+                                                                               
                                                        </xsl:when>
+                                                                               
                                                        <xsl:when 
test="position() mod 2 = 0">
+                                                                               
                                                                
<xsl:text>row_off</xsl:text>
+                                                                               
                                                        </xsl:when>
+                                                                               
                                                                <xsl:otherwise>
+                                                                               
                                                                        
<xsl:text>row_on</xsl:text>
+                                                                               
                                                                </xsl:otherwise>
+                                                                               
                                                        </xsl:choose>
+                                                                               
                                                </xsl:attribute>
+                                                                               
                                        <td align="left" title='{descr}'>
+                                                                               
                                                <xsl:text> </xsl:text>
+                                                                               
                                                <xsl:choose>
+                                                                               
                                                        <xsl:when 
test="external_ref!=''">
+                                                                               
                                                                <a 
href="{external_ref}" target="_blank"><xsl:value-of select="name"/></a>
+                                                                               
                                                        </xsl:when>
+                                                                               
                                                        <xsl:otherwise>
+                                                                               
                                                                <xsl:value-of 
select="name"/>
+                                                                               
                                                        </xsl:otherwise>
+                                                                               
                                                </xsl:choose>
+                                                                               
                                        </td>
+                                                                               
                                        <td align="left">
+                                                                               
                                                <input type="checkbox" 
name="values[regulations][]" value="{id}">
+                                                                               
                                                        <xsl:if test="selected 
= '1'">
+                                                                               
                                                                <xsl:attribute 
name="checked">
+                                                                               
                                                                        
<xsl:text>checked</xsl:text>
+                                                                               
                                                                </xsl:attribute>
+                                                                               
                                                        </xsl:if>
+                                                                               
                                                        <xsl:attribute 
name="title">
+                                                                               
                                                                <xsl:value-of 
select="descr"/>
+                                                                               
                                                        </xsl:attribute>
+                                                                               
                                                </input>
+                                                                               
                                        </td>
+                                                                               
                                </tr>
+                                                                               
                        </xsl:for-each>
+                                                                               
                </table>
+                                                                               
        </td>
+                                                                               
</tr>
                                                                                
<xsl:call-template name="attributes"/>
                                                                                
<tr>
                                                                                
        <td align="left">




reply via email to

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