fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10538] property: More on condition survey


From: Sigurd Nes
Subject: [Fmsystem-commits] [10538] property: More on condition survey
Date: Mon, 26 Nov 2012 17:08:45 +0000

Revision: 10538
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10538
Author:   sigurdne
Date:     2012-11-26 17:08:45 +0000 (Mon, 26 Nov 2012)
Log Message:
-----------
property: More on condition survey

Modified Paths:
--------------
    trunk/property/inc/class.bocondition_survey.inc.php
    trunk/property/inc/class.socondition_survey.inc.php
    trunk/property/inc/class.uicondition_survey.inc.php
    trunk/property/js/portico/condition_survey_edit.js
    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.bocondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.bocondition_survey.inc.php 2012-11-26 11:23:08 UTC 
(rev 10537)
+++ trunk/property/inc/class.bocondition_survey.inc.php 2012-11-26 17:08:45 UTC 
(rev 10538)
@@ -177,6 +177,10 @@
                                unset($contacts);
                        }
 
+                       if($values['coordinator_id'])
+                       {
+                               $values['coordinator_name']     = 
$GLOBALS['phpgw']->accounts->get($values['coordinator_id'])->__toString();
+                       }
                        return $values;
                }
 

Modified: trunk/property/inc/class.socondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.socondition_survey.inc.php 2012-11-26 11:23:08 UTC 
(rev 10537)
+++ trunk/property/inc/class.socondition_survey.inc.php 2012-11-26 17:08:45 UTC 
(rev 10538)
@@ -150,6 +150,7 @@
                                        'id'                    => 
$this->_db->f('id'),
                                        'title'                 => 
$this->_db->f('title',true),
                                        'descr'                 => 
$this->_db->f('descr',true),
+                                       'address'               => 
$this->_db->f('address',true),
                                        'entry_date'    => 
$this->_db->f('entry_date'),
                                        'user'                  => 
$this->_db->f('user_id')
                                );
@@ -177,7 +178,7 @@
                                        'status_id'                     => 
(int)$this->_db->f('status_id'),
                                        'cat_id'                        => 
(int)$this->_db->f('category'),
                                        'vendor_id'                     => 
(int)$this->_db->f('vendor_id'),
-                                       'coordinator'           => 
(int)$this->_db->f('coordinator'),
+                                       'coordinator_id'        => 
(int)$this->_db->f('coordinator_id'),
                                        'report_date'           => 
(int)$this->_db->f('report_date'),
                                        'user_id'                       => 
(int)$this->_db->f('user_id'),
                                        'entry_date'            => 
(int)$this->_db->f('entry_date'),
@@ -206,8 +207,9 @@
 
                        $id = $this->_db->next_id($table);
 
-                       $value_set                      = 
$this->_get_value_set( $data );
-                       $value_set['id']        = $id;
+                       $value_set                                      = 
$this->_get_value_set( $data );
+                       $value_set['id']                        = $id;
+                       $value_set['entry_date']        = time();
 
                        $cols = implode(',', array_keys($value_set));
                        $values = 
$this->_db->validate_insert(array_values($value_set));
@@ -280,11 +282,10 @@
                                'status_id'                     => 
(int)$data['status_id'],
                                'category'                      => 
(int)$data['cat_id'],
                                'vendor_id'                     => 
(int)$data['vendor_id'],
-                               'coordinator'           => (int)$this->account,
+                               'coordinator_id'        => 
(int)$data['coordinator_id'],
                                'report_date'           => 
phpgwapi_datetime::date_to_timestamp($data['report_date']),
                                'user_id'                       => 
$this->account,
-                               'entry_date'            => time(),
-                               'modified_date'         => time()
+                               'modified_date'         => time(),
                        );
 
 
@@ -360,9 +361,9 @@
                        }
 
                        $address        = 
$this->_db->db_addslashes(implode('::', $_address));
-       //              $value_set['address'] = $address;
 
-                       unset($_address);
+                       $value_set['address'] = $address;
+
                        return $value_set;
                }
 

Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2012-11-26 11:23:08 UTC 
(rev 10537)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2012-11-26 17:08:45 UTC 
(rev 10538)
@@ -35,14 +35,16 @@
 
                private $bo;
                private $receipt = array();
-               public $public_functions = array(
-                       'query' => true,
-                       'index' => true,
-                       'view' => true,
-                       'add' => true,
-                       'edit' => true,
-                       'save' => true,
-                       'get_vendors'   => true
+               public $public_functions = array
+               (
+                       'query'                 => true,
+                       'index'                 => true,
+                       'view'                  => true,
+                       'add'                   => true,
+                       'edit'                  => true,
+                       'save'                  => true,
+                       'get_vendors'   => true,
+                       'get_users'             => true
                );
 
                public function __construct()
@@ -145,6 +147,11 @@
                                                        'editor' => 'new 
YAHOO.widget.TextboxCellEditor({disableBtns:true})'
                                                ),
                                                array(
+                                                       'key' => 'address',
+                                                       'label' => 
lang('address'),
+                                                       'sortable' => true
+                                               ),
+                                               array(
                                                        'key' => 'link',
                                                        'hidden' => true
                                                )
@@ -373,8 +380,39 @@
                        }
                }
 
+               public function get_users()
+               {
+                       if(!$this->acl_read)
+                       {
+                               return;
+                       }
+
+                       $query = phpgw::get_var('query');
+
+                       $accounts = 
$GLOBALS['phpgw']->accounts->get_list('accounts', $start, $sort, $order, 
$query,$offset);
+
+                       $values = array();
+                       foreach($accounts as $account)
+                       {
+                               if ($account->enabled)
+                               {
+                                       $values[] = array
+                                       (
+                                               'id'    => $account->id,
+                                               'name'  => 
$account->__toString(),
+                                       );
+                               }
+                       }
+                       return array('ResultSet'=> array('Result'=>$values));
+               }
+
                public function get_vendors()
                {
+                       if(!$this->acl_read)
+                       {
+                               return;
+                       }
+
                        $query = phpgw::get_var('query');
 
                        $sogeneric = CreateObject('property.sogeneric', 
'vendor');
@@ -440,6 +478,18 @@
                                        'type'  => 'string',
                                        'required'      => false
                                ),
+                               array
+                               (
+                                       'name' => 'coordinator_id',
+                                       'type'  => 'integer',
+                                       'required'      => false
+                               ),
+                               array
+                               (
+                                       'name' => 'coordinator_name',
+                                       'type'  => 'string',
+                                       'required'      => false
+                               ),
                        );
 
 

Modified: trunk/property/js/portico/condition_survey_edit.js
===================================================================
--- trunk/property/js/portico/condition_survey_edit.js  2012-11-26 11:23:08 UTC 
(rev 10537)
+++ trunk/property/js/portico/condition_survey_edit.js  2012-11-26 17:08:45 UTC 
(rev 10538)
@@ -44,3 +44,11 @@
                'vendor_name', 'vendor_id', 'vendor_container');
        });
 
+       YAHOO.util.Event.addListener(window, "load", function()
+       {
+               var oArgs = 
{menuaction:'property.uicondition_survey.get_users'};
+               var strURL = phpGWLink('index.php', oArgs, true);
+           YAHOO.portico.autocompleteHelper(strURL, 
+               'coordinator_name', 'coordinator_id', 'coordinator_container');
+       });
+

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2012-11-26 11:23:08 UTC (rev 
10537)
+++ trunk/property/setup/tables_current.inc.php 2012-11-26 17:08:45 UTC (rev 
10538)
@@ -802,9 +802,10 @@
                                'loc3' => array('type' => 'varchar','precision' 
=> '4','nullable' => True),
                                'loc4' => array('type' => 'varchar','precision' 
=> '4','nullable' => True),
                                'descr' => array('type' => 'text','nullable' => 
True),
+                               'address' => array('type' => 
'varchar','precision' => '255','nullable' => True),
                                'status_id' => array('type' => 
'int','precision' => '4','nullable' => false),
                                'category' => array('type' => 'int','precision' 
=> '4','nullable' => True),
-                               'coordinator' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'coordinator_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'vendor_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                'report_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                'user_id' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2012-11-26 11:23:08 UTC (rev 
10537)
+++ trunk/property/setup/tables_update.inc.php  2012-11-26 17:08:45 UTC (rev 
10538)
@@ -6850,9 +6850,10 @@
                                        'loc3' => array('type' => 
'varchar','precision' => '4','nullable' => True),
                                        'loc4' => array('type' => 
'varchar','precision' => '4','nullable' => True),
                                        'descr' => array('type' => 
'text','nullable' => True),
+                                       'address' => array('type' => 
'varchar','precision' => '255','nullable' => True),
                                        'status_id' => array('type' => 
'int','precision' => '4','nullable' => false),
                                        'category' => array('type' => 
'int','precision' => '4','nullable' => True),
-                                       'coordinator' => array('type' => 
'int','precision' => '4','nullable' => True),
+                                       'coordinator_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                        'vendor_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                        'report_date' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                        'user_id' => array('type' => 'int', 
'precision' => 4,'nullable' => True),

Modified: trunk/property/templates/base/condition_survey.xsl
===================================================================
--- trunk/property/templates/base/condition_survey.xsl  2012-11-26 11:23:08 UTC 
(rev 10537)
+++ trunk/property/templates/base/condition_survey.xsl  2012-11-26 17:08:45 UTC 
(rev 10538)
@@ -184,54 +184,47 @@
                                </tr>
                                <tr>
                                        <td>
-                                               <label 
for="vendor"><xsl:value-of select="php:function('lang', 'vendor')" /></label>
+                                               <label 
for="coordinator"><xsl:value-of select="php:function('lang', 'coordinator')" 
/></label>
                                        </td>
                                        <td>
 
                                                <xsl:choose>
                                                        <xsl:when 
test="editable = 1">
                                                            <div 
class="autocomplete">
-                                                               <input 
type="hidden" id="vendor_id" name="values[vendor_id]"  
value="{survey/vendor_id}"/>
-                                                               <input 
type="text" id="vendor_name" name="values[vendor_name]" 
value="{survey/vendor_name}">
+                                                               <input 
type="hidden" id="coordinator_id" name="values[coordinator_id]"  
value="{survey/coordinator_id}"/>
+                                                               <input 
type="text" id="coordinator_name" name="values[coordinator_name]" 
value="{survey/coordinator_name}">
                                                                        </input>
-                                                               <div 
id="vendor_container"/>
+                                                               <div 
id="coordinator_container"/>
                                                            </div>
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                               <xsl:value-of 
select="survey/vendor_name" />
+                                                               <xsl:value-of 
select="survey/coordinator_name" />
                                                        </xsl:otherwise>
                                                </xsl:choose>
 
-<!--
-
                                        </td>
                                </tr>
+
                                <tr>
                                        <td>
+                                               <label 
for="vendor"><xsl:value-of select="php:function('lang', 'vendor')" /></label>
+                                       </td>
+                                       <td>
 
-                                                <div class="label">
-                                                       <label 
for="age2">Age:</label>                                          
-                                                </div>
-                                                       <input id="age2" 
type="text"
-                                                               
formvalidator:FormField="yes"
-                                                               
formvalidator:type="IntegerField"
-                                                               
formvalidator:max="100"
-                                                               
formvalidator:min="10"/>
-                                               <div class="clearDiv"></div>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="editable = 1">
+                                                           <div 
class="autocomplete">
+                                                               <input 
type="hidden" id="vendor_id" name="values[vendor_id]"  
value="{survey/vendor_id}"/>
+                                                               <input 
type="text" id="vendor_name" name="values[vendor_name]" 
value="{survey/vendor_name}">
+                                                                       </input>
+                                                               <div 
id="vendor_container"/>
+                                                           </div>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <xsl:value-of 
select="survey/vendor_name" />
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
 
-                                                 <div class="label">
-                                                       <label 
for="income2">Income ($):</label>                                               
 
-                                                </div>
-                                                       <input id="income2" 
type="text"
-                                                               
formvalidator:FormField="yes"
-                                                               
formvalidator:type="DoubleField"
-                                                               
formvalidator:maxDecimalPlaces="2"
-                                                               
formvalidator:max="40000"
-                                                               
formvalidator:maxInclusive="true"/>
-                                               <div class="clearDiv"></div>
-                                       
-                                       -->
-
                                        </td>
                                </tr>
 




reply via email to

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