[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [10511] property: condition survey
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [10511] property: condition survey |
Date: |
Sun, 18 Nov 2012 16:33:23 +0000 |
Revision: 10511
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10511
Author: sigurdne
Date: 2012-11-18 16:33:22 +0000 (Sun, 18 Nov 2012)
Log Message:
-----------
property: condition survey
Modified Paths:
--------------
trunk/property/inc/class.sogeneric.inc.php
trunk/property/inc/class.uicondition_survey.inc.php
trunk/property/js/portico/condition_survey_edit.js
trunk/property/templates/base/condition_survey.xsl
Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php 2012-11-16 14:44:41 UTC (rev
10510)
+++ trunk/property/inc/class.sogeneric.inc.php 2012-11-18 16:33:22 UTC (rev
10511)
@@ -41,7 +41,7 @@
protected $table;
var $appname = 'property';
- function __construct()
+ function __construct($type = '', $type_id = 0)
{
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->custom =
createObject('property.custom_fields');
@@ -49,6 +49,12 @@
$this->_db2 = clone($this->_db);
$this->_like = & $this->_db->like;
$this->_join = & $this->_db->join;
+
+ if($type)
+ {
+ $this->get_location_info($type,$type_id);
+ }
+
}
function read($data, $filter = array())
Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2012-11-16 14:44:41 UTC
(rev 10510)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2012-11-18 16:33:22 UTC
(rev 10511)
@@ -40,7 +40,8 @@
'view' => true,
'add' => true,
'edit' => true,
- 'save' => true
+ 'save' => true,
+ 'get_vendors' => true
);
public function __construct()
@@ -319,6 +320,19 @@
}
}
+ public function get_vendors()
+ {
+ $query = phpgw::get_var('query');
+
+ $sogeneric = CreateObject('property.sogeneric',
'vendor');
+ $values = $sogeneric->read(array('query' => $query));
+ foreach ($values as &$entry)
+ {
+ $entry['name'] = $entry['org_name'];
+ }
+ return array('ResultSet'=> array('Result'=>$values));
+ }
+
private function _get_categories($selected = 0)
{
$cats = CreateObject('phpgwapi.categories', -1,
'property', $this->acl_location);
Modified: trunk/property/js/portico/condition_survey_edit.js
===================================================================
--- trunk/property/js/portico/condition_survey_edit.js 2012-11-16 14:44:41 UTC
(rev 10510)
+++ trunk/property/js/portico/condition_survey_edit.js 2012-11-18 16:33:22 UTC
(rev 10511)
@@ -35,3 +35,12 @@
});
});
+
+ YAHOO.util.Event.addListener(window, "load", function()
+ {
+ var oArgs =
{menuaction:'property.uicondition_survey.get_vendors'};
+ var strURL = phpGWLink('index.php', oArgs, true);
+ YAHOO.portico.autocompleteHelper(strURL,
+ 'vendor_name', 'vendor_id', 'vendor_container');
+ });
+
Modified: trunk/property/templates/base/condition_survey.xsl
===================================================================
--- trunk/property/templates/base/condition_survey.xsl 2012-11-16 14:44:41 UTC
(rev 10510)
+++ trunk/property/templates/base/condition_survey.xsl 2012-11-18 16:33:22 UTC
(rev 10511)
@@ -104,6 +104,30 @@
<div class="clearDiv"></div>
</div>
+
+ <div class="row">
+ <div class="label">
+ <label
for="vendor"><xsl:value-of select="php:function('lang', 'vendor')" /></label>
+ </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}"
+
formvalidator:FormField="yes"
+
formvalidator:type="TextBaseField"/>
+ <input
type="text" id="vendor_name" name="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="clearDiv"></div>
+ </div>
+
+
<!--
<div class="row">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [10511] property: condition survey,
Sigurd Nes <=