[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8237]
From: |
Erik Holm-Larsen |
Subject: |
[Fmsystem-commits] [8237] |
Date: |
Mon, 05 Dec 2011 09:05:24 +0000 |
Revision: 8237
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8237
Author: erikhl
Date: 2011-12-05 09:05:23 +0000 (Mon, 05 Dec 2011)
Log Message:
-----------
Added Paths:
-----------
trunk/controller/inc/class.uicheck_list_for_equipment.inc.php
trunk/controller/js/yahoo/equipment_location.js
trunk/controller/templates/base/equipment.xsl
Added: trunk/controller/inc/class.uicheck_list_for_equipment.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list_for_equipment.inc.php
(rev 0)
+++ trunk/controller/inc/class.uicheck_list_for_equipment.inc.php
2011-12-05 09:05:23 UTC (rev 8237)
@@ -0,0 +1,226 @@
+<?php
+
+ phpgw::import_class('phpgwapi.yui');
+ phpgw::import_class('controller.uicommon');
+ phpgw::import_class('controller.socontrol_area');
+
+ class controller_uicheck_list_for_equipment extends controller_uicommon
+ {
+ var $grants;
+ var $cat_id;
+ var $start;
+ var $query;
+ var $sort;
+ var $order;
+ var $filter;
+ var $currentapp;
+ var $type_id;
+ var $location_code;
+
+ private $so_control_area;
+
+ var $public_functions = array(
+
'index' => true,
+ );
+
+ function __construct()
+ {
+ parent::__construct();
+
+ $GLOBALS['phpgw_info']['flags']['nonavbar'] = true; //
menus added where needed via bocommon::get_menu
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+
+ $this->bo =
CreateObject('property.bolocation',true);
+ $this->bocommon = &
$this->bo->bocommon;
+ $this->so_control_area =
CreateObject('controller.socontrol_area');
+
+ $this->type_id =
$this->bo->type_id;
+
+ $this->start =
$this->bo->start;
+ $this->query =
$this->bo->query;
+ $this->sort =
$this->bo->sort;
+ $this->order =
$this->bo->order;
+ $this->filter =
$this->bo->filter;
+ $this->cat_id =
$this->bo->cat_id;
+ $this->part_of_town_id =
$this->bo->part_of_town_id;
+ $this->district_id =
$this->bo->district_id;
+ $this->status =
$this->bo->status;
+ $this->allrows =
$this->bo->allrows;
+ $this->lookup =
$this->bo->lookup;
+ $this->location_code =
$this->bo->location_code;
+
+
self::set_active_menu('controller::control::equipment_for_check_list');
+ }
+
+ function index()
+ {
+ if(phpgw::get_var('phpgw_return_as') == 'json') {
+ return $this->query();
+ }
+ $building_types =
execMethod('property.soadmin_location.read',array());
+
+ $type_id = 1;
+
+ $category_types =
$this->bocommon->select_category_list(array(
+
'format'=>'filter',
+
'selected' =>
$this->cat_id,
+
'type'
=>'location',
+
'type_id'
=>$type_id,
+
'order'=>'descr'
+
));
+
+ $district_list =
$this->bocommon->select_district_list('filter',$this->district_id);
+ $default_value = array ('id'=>'','name'=>lang('no
district'));
+ array_unshift($district_list,$default_value);
+
+ $part_of_town_list =
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
+ $default_value = array ('id'=>'','name'=>lang('no part
of town'));
+ array_unshift($part_of_town_list,$default_value);
+
+ $_role_criteria = array
+ (
+ 'type' =>
'responsibility_role',
+ 'filter' =>
array('location' => ".location.{$type_id}"),
+ 'order' => 'name'
+ );
+
+ $responsibility_roles_list =
execMethod('property.sogeneric.get_list',$_role_criteria);
+ $default_value = array ('id'=>'','name'=>lang('no
role'));
+ array_unshift ($responsibility_roles,$default_value);
+
+ $control_areas_array =
$this->so_control_area->get_control_areas_as_array();
+
+ // Fetches prosedures that are related to first control
area in list
+ $control_area_id = $control_areas_array[0]['id'];
+
+ $lists = array
+ (
+ 'building_types' =>
$building_types,
+ 'category_types' =>
$category_types,
+ 'district_list' =>
$district_list,
+ 'part_of_town_list' =>
$part_of_town_list,
+ 'responsibility_roles_list' =>
$responsibility_roles_list,
+ 'control_area_list' =>
$control_areas_array,
+ );
+
+
+
+
+ $data = array(
+ 'datatable' => array(
+ 'source' =>
self::link(array('menuaction' => 'controller.uicheck_list_for_equipment.index',
'phpgw_return_as' => 'json')),
+ 'field' => array(
+ array(
+ 'key' =>
'location_code',
+ 'label' =>
lang('Property'),
+ 'sortable' => true,
+ 'formatter' =>
'YAHOO.portico.formatLink'
+ ),
+ array(
+ 'key' =>
'loc1_name',
+ 'label' =>
lang('Property name'),
+ 'sotrable' =>
false
+ ),
+ array(
+ 'key' => 'adresse1',
+ 'label' =>
lang('Address'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'postnummer',
+ 'label' => lang('Zip
code'),
+ 'sortable' => false
+ ),
+ array(
+ 'key' => 'checked',
+ 'label' => 'Velg',
+ 'sortable' => false,
+ 'formatter' =>
'YAHOO.widget.DataTable.formatCheckbox',
+ 'className' =>
'mychecks'
+ ),
+ array(
+ 'key' => 'link',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'actions',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'labels',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'ajax',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'alert',
+ 'hidden' => true
+ )
+ )
+ ),
+ 'lists' => $lists
+ );
+
+ //self::add_javascript('controller', 'yahoo',
'datatable.js');
+ self::add_javascript('controller', 'controller',
'controller_datatable_test.js');
+ self::add_javascript('controller', 'controller',
'jquery.js');
+ self::add_javascript('controller', 'controller',
'ajax.js');
+ //self::add_javascript('controller', 'yahoo',
'equipment_location.js');
+
+ //$GLOBALS['phpgw']->js->validate_file( 'yahoo',
'location.responsiblility_role', 'property' );
+
+ //self::render_template_xsl('datatable', $data);
+ self::render_template_xsl('equipment', $data);
+ }
+
+ public function query(){
+
+ $type_id = 1;
+
+ $location_list = array();
+
+ $this->bo->sort = "ASC";
+
+ $location_list = $this->bo->read(array('user_id' =>
$user_id, 'role_id' =>$role_id,
'type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,
+
'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run'
=>$dry_run));
+
+ $uicols = $this->bo->uicols;
+
+ $results = array();
+
+ foreach($location_list as $location)
+ {
+ //var_dump($location);
+ $location['checked'] = true;
+ $results['results'][]= $location;
+
+ }
+
+ $results['total_records'] = 10;
+ $results['start'] = 1;
+ $results['sort'] = 'location_code';
+
+ array_walk($results['results'], array($this,
'add_actions'), array($type));
+
+ return $this->yui_results($results);
+ }
+
+ public function add_actions(&$value, $key, $params)
+ {
+ unset($value['query_location']);
+
+ $value['ajax'] = array();
+ $value['actions'] = array();
+ $value['labels'] = array();
+
+ $value['ajax'][] = false;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' => 'property.uilocation.view',
'location_code' => $value['location_code'])));
+ $value['labels'][] = lang('show');
+
+ $value['ajax'][] = true;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'rental.uicomposite.add_unit', 'location_code' => $value['location_code'])));
+ $value['labels'][] = lang('add_location');
+ }
+ }
\ No newline at end of file
Added: trunk/controller/js/yahoo/equipment_location.js
===================================================================
--- trunk/controller/js/yahoo/equipment_location.js
(rev 0)
+++ trunk/controller/js/yahoo/equipment_location.js 2011-12-05 09:05:23 UTC
(rev 8237)
@@ -0,0 +1,323 @@
+//--------------------------------------------------------
+// Declaration of event.index vars
+//--------------------------------------------------------
+ //define SelectButton
+ var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3,
oMenuButton_4;//, oMenuButton_5;
+ var selectsButtons = [
+ {order:0, var_URL:'type_id', name:'btn_type_id',
style:'typebutton', dependiente:[], reload:1},
+ {order:1, var_URL:'cat_id', name:'btn_cat_id',
style:'categorybutton', dependiente:[]},
+ {order:2, var_URL:'district_id', name:'btn_district_id',
style:'districtbutton', dependiente:[3]},
+ {order:3,
var_URL:'part_of_town_id',name:'btn_part_of_town_id',style:'partOFTownbutton',dependiente:[]},
+ {order:4, var_URL:'role_id', name:'btn_role_id',
style:'roleIdbutton', dependiente:[]}
+// {order:5, var_URL:'user_id', name:'btn_user_id',
style:'userIdbutton', dependiente:[]}, // dummy - changed to
select
+ ];
+
+ // define buttons
+ var oNormalButton_0, oNormalButton_1;//, oNormalButton_2;
+ var normalButtons = [
+ {order:0, name:'btn_search', funct:"onSearchClick"},
+ {order:1, name:'btn_save', funct:"onSave"}
+ ];
+
+ // define Text buttons
+ var textImput = [
+ {order:0, name:'query', id:'txt_query'}
+ ];
+
+ var toolTips =
+ [
+ {name:'status', title:'Status',
description:'',ColumnDescription:'status'},
+ {name:'btn_export', title:'download', description:'Download
table to your browser',ColumnDescription:''}
+ ];
+
+ var linktoolTips =
+ [
+ {name:'btn_data_search', title:'Data search',
description:'Narrow the search dates'}
+ ];
+
+ var config_values =
+ [
+ {date_search : 0} //if search has link "Data search"
+ ];
+
+ var tableYUI;
+
/********************************************************************************
+ *
+ */
+
+ this.onChangeSelect = function()
+ {
+ var myselect=document.getElementById("sel_user_id");
+ for (var i=0; i<myselect.options.length; i++)
+ {
+ if (myselect.options[i].selected==true)
+ {
+ break;
+ }
+ }
+ eval("path_values.user_id='"+myselect.options[i].value+"'");
+ execute_ds();
+ }
+
+
+ this.myParticularRenderEvent = function()
+ {
+ delete_content_div("message",2); //find it in property.js
+ create_message();
+ tableYUI.deleteTFoot();
+ addFooterDatatable();
+ }
+
+
/********************************************************************************
+ * Delete all message un DIV 'message'
+ */
+ this.create_message = function()
+ {
+ div_message= YAHOO.util.Dom.get("message");
+
+ //SHOW message if exist 'values_ds.message'
+ if(window.values_ds.message)
+ {
+ // succesfull
+ if(window.values_ds.message[0].message)
+ {
+ for(i=0; i<values_ds.message[0].message.length;
i++)
+ {
+ oDiv=document.createElement("DIV");
+ txtNode =
document.createTextNode(values_ds.message[0].message[i].msg);
+ oDiv.appendChild(txtNode);
+ oDiv.style.color = '#009900';
+ oDiv.style.fontWeight = 'bold';
+
+ div_message.appendChild(oDiv);
+ }
+ }
+
+ // error
+ if(window.values_ds.message[0].error)
+ {
+ for(i=0; i<values_ds.message[0].error.length;
i++)
+ {
+ oDiv=document.createElement("DIV");
+ txtNode =
document.createTextNode(values_ds.message[0].error[i].msg);
+ oDiv.appendChild(txtNode);
+ oDiv.style.color = '#FF0000';
+ oDiv.style.fontWeight = 'bold';
+
+ div_message.appendChild(oDiv);
+ }
+ }
+ }
+ window.values_ds.message = null;
+ }
+
+ this.particular_setting = function()
+ {
+ if(flag_particular_setting=='init')
+ {
+ //locate (asign ID) to datatable
+ tableYUI =
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[0].parentNode;
+ tableYUI.setAttribute("id","tableYUI");
+
+ //type
+ index =
locate_in_array_options(0,"value",path_values.type_id);
+ if(index)
+ {
+ oMenuButton_0.set("label", ("<em>" +
array_options[0][index][1] + "</em>"));
+ }
+ //category
+ index =
locate_in_array_options(1,"value",path_values.cat_id);
+ if(index)
+ {
+ oMenuButton_1.set("label", ("<em>" +
array_options[1][index][1] + "</em>"));
+ }
+
+ //district
+ index =
locate_in_array_options(2,"value",path_values.district_id);
+ if(index)
+ {
+ oMenuButton_2.set("label", ("<em>" +
array_options[2][index][1] + "</em>"));
+ }
+ //user
+ index =
locate_in_array_options(3,"value",path_values.user_id);
+ if(index)
+ {
+ oMenuButton_3.set("label", ("<em>" +
array_options[3][index][1] + "</em>"));
+ }
+
+// oMenuButton_0.focus();
+ YAHOO.util.Dom.get(textImput[0].id).focus();
+ }
+ else if(flag_particular_setting=='update')
+ {
+ }
+ }
+
+
+/****************************************************************************************/
+
+ this.Exchange_values = function()
+ {
+ //nothing
+ }
+
+/********************************************************************************/
+ var myFormatterCheck = function(elCell, oRecord, oColumn, oData)
+ {
+ var checked = '';
+ var hidden = '';
+ if(oRecord.getData('responsible_item'))
+ {
+ checked = "checked = 'checked'";
+ hidden = "<input type=\"hidden\" class=\"orig_check\"
name=\"values[assign_orig][]\"
value=\""+oRecord.getData('responsible_contact_id')+"_"+oRecord.getData('responsible_item')+"_"+oRecord.getData('location_code')+"\"/>";
+ }
+
+ elCell.innerHTML = hidden + "<center><input type=\"checkbox\"
"+checked+" class=\"mychecks\" name=\"values[assign][]\"
value=\""+oRecord.getData('location_code')+"\"/></center>";
+ }
+
+ var FormatterCenter = function(elCell, oRecord, oColumn, oData)
+ {
+ elCell.innerHTML = "<center>"+oData+"</center>";
+ }
+
+/********************************************************************************/
+
+ this.onSave = function()
+ {
+ //get the last div in th form
+ var divs= YAHOO.util.Dom.getElementsByClassName('field');
+ var mydiv = divs[divs.length-1];
+ //remove all child of mydiv
+ if (mydiv.hasChildNodes())
+ {
+ while ( mydiv.childNodes.length >= 1 )
+ {
+ mydiv.removeChild( mydiv.firstChild );
+ }
+ }
+ // styles for dont show
+ mydiv.style.display = "none";
+
+ valuesForPHP =
YAHOO.util.Dom.getElementsByClassName('mychecks');
+ valuesForPHP_orig =
YAHOO.util.Dom.getElementsByClassName('orig_check');
+
+ var values_return =
+ {
+ assign:[],
+ assign_orig:[]
+ };
+
+ //add all control to form
+ for(i=0;i<valuesForPHP.length;i++)
+ {
+ //values_return.assign[i] = valuesForPHP[i].value;
+ if(valuesForPHP[i].checked)
+ {
+
values_return.assign.push(valuesForPHP[i].value);
+ }
+ }
+
+ for(i=0;i<valuesForPHP_orig.length;i++)
+ {
+ //console.log(valuesForPHP_orig[i].name); // firebug
+ values_return.assign_orig[i] =
valuesForPHP_orig[i].value;
+ }
+
+ var returnfield = document.createElement('input');
+ returnfield.setAttribute('name', 'values_assign');
+ returnfield.setAttribute('type', 'text');
+ returnfield.setAttribute('value',
JSON.stringify(values_return));
+ mydiv.appendChild(returnfield);
+
+ // find out the unique form
+ formObject = document.body.getElementsByTagName('form');
+ // modify the 'form' for send it as POST using asyncronize call
+ YAHOO.util.Connect.setForm(formObject[0]);
+
+ maintain_pagination_order();
+ execute_ds();
+ }
+
+
+//----------------------------------------------------------
+
/********************************************************************************
+ *
+ */
+ this.addFooterDatatable = function()
+ {
+ //Create ROW
+ newTR = document.createElement('tr');
+ var i = 0;
+
+ for(var k=0 ; k<values_ds.headers.name.length; k++)
+ {
+ if (values_ds.headers.input_type[k] != 'hidden')
+ {
+ i++;
+ }
+ }
+
+ td_empty(i+2);
+
+ //RowChecked
+ CreateRowChecked("mychecks");
+
+ //Add to Table
+ myfoot = tableYUI.createTFoot();
+ myfoot.setAttribute("id","myfoot");
+ myfoot.appendChild(newTR.cloneNode(true));
+ //clean value for values_ds.message
+ values_ds.message = null;
+ }
+
+
/********************************************************************************
+ *
+ */
+ check_all = function(myclass)
+ {
+ controls = YAHOO.util.Dom.getElementsByClassName(myclass);
+ for(i=0;i<controls.length;i++)
+ {
+ if(!controls[i].disabled)
+ {
+ //for class=mychecks, they have to be
interchanged
+ if(myclass=="mychecks")
+ {
+ if(controls[i].checked)
+ {
+ controls[i].checked = false;
+ }
+ else
+ {
+ controls[i].checked = true;
+ }
+ }
+ //for the rest, always id checked
+ else
+ {
+ controls[i].checked = true;
+ }
+ }
+ }
+ }
+
+
+ //YAHOO.util.Event.addListener(window, "load", function()
+ YAHOO.util.Event.onDOMReady(function()
+ {
+
YAHOO.util.Dom.getElementsByClassName('toolbar','div')[0].style.display =
'none';
+ var loader = new YAHOO.util.YUILoader();
+ loader.addModule({
+ name: "anyone", //module name; must be unique
+ type: "js", //can be "js" or "css"
+ fullpath: property_js //'property_js' have the path for
property.js, is render in HTML
+ });
+
+ loader.require("anyone");
+
+ //Insert JSON utility on the page
+
+ loader.insert();
+
+ });
+
Property changes on: trunk/controller/js/yahoo/equipment_location.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/controller/templates/base/equipment.xsl
===================================================================
--- trunk/controller/templates/base/equipment.xsl
(rev 0)
+++ trunk/controller/templates/base/equipment.xsl 2011-12-05 09:05:23 UTC
(rev 8237)
@@ -0,0 +1,319 @@
+<func:function name="phpgw:conditional">
+ <xsl:param name="test"/>
+ <xsl:param name="true"/>
+ <xsl:param name="false"/>
+
+ <func:result>
+ <xsl:choose>
+ <xsl:when test="$test">
+ <xsl:value-of select="$true"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$false"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </func:result>
+</func:function>
+
+<xsl:template match="data">
+
+ <div id="addedProperties">
+ <ul id="locations_for_control" name="locations_for_control">
+ <xsl:for-each select="locations_for_control">
+ <li>
+ <div><xsl:value-of select="id"/></div>
+ <div><xsl:value-of
select="title"/></div>
+ <div><xsl:value-of
select="location_code"/></div>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </div>
+
+ <iframe id="yui-history-iframe"
src="phpgwapi/js/yahoo/history/assets/blank.html"
style="position:absolute;top:0; left:0;width:1px;
height:1px;visibility:hidden;"></iframe>
+ <input id="yui-history-field" type="hidden"/>
+ <xsl:call-template name="yui_booking_i18n"/>
+ <xsl:apply-templates select="form" />
+ <xsl:apply-templates select="paging"/>
+ <div id="list_flash">
+ <xsl:call-template name="msgbox"/>
+ </div>
+ <xsl:apply-templates select="datatable"/>
+ <xsl:apply-templates select="form/list_actions"/>
+
+</xsl:template>
+
+<xsl:template match="form">
+ <form id="queryForm" style="margin: 20px; width: 65%;">
+ <xsl:attribute name="method">
+ <xsl:value-of select="phpgw:conditional(not(method),
'GET', method)"/>
+ </xsl:attribute>
+
+ <xsl:attribute name="action">
+ <xsl:value-of select="phpgw:conditional(not(action),
'', action)"/>
+ </xsl:attribute>
+ <xsl:apply-templates select="toolbar"/>
+ </form>
+
+ <form id="update_table_dummy" method='POST' action='' >
+ </form>
+
+</xsl:template>
+
+
+<xsl:template match="toolbar">
+ <div id="toolbar">
+ <table class='yui-skin-sam' border="0" cellspacing="0"
cellpadding="0" style="padding:0px; margin:0px;">
+ <tr>
+ <xsl:for-each select="item">
+ <xsl:variable name="filter_key"
select="concat('filter_', name)"/>
+ <xsl:variable name="filter_key_name"
select="concat(concat('filter_', name), '_name')"/>
+ <xsl:variable name="filter_key_id"
select="concat(concat('filter_', name), '_id')"/>
+
+ <xsl:choose>
+ <xsl:when test="type = 'date-picker'">
+ <td valign="top">
+ <div class="date-picker">
+ <input id="filter_{name}" name="filter_{name}"
type="text">
+ <xsl:attribute
name="value"><xsl:value-of select="../../../filters/*[local-name() =
$filter_key]"/></xsl:attribute>
+ </input>
+ </div>
+ </td>
+ </xsl:when>
+ <xsl:when test="type = 'autocomplete'">
+ <td valign="top" width="160px">
+ <div style="width:140px">
+ <input
id="filter_{name}_name" name="filter_{name}_name" type="text">
+ <xsl:attribute
name="value"><xsl:value-of select="../../../filters/*[local-name() =
$filter_key_name]"/></xsl:attribute>
+ </input>
+ <input
id="filter_{name}_id" name="filter_{name}_id" type="hidden">
+ <xsl:attribute
name="value"><xsl:value-of select="../../../filters/*[local-name() =
$filter_key_id]"/></xsl:attribute>
+ </input>
+ <div
id="filter_{name}_container"/>
+ </div>
+ <script type="text/javascript">
+
YAHOO.util.Event.onDOMReady(function() {
+ var name = "<xsl:value-of
select="name"/>";
+ var ui = "<xsl:value-of
select="ui"/>";
+
+ var itemSelectCallback
= false;
+ <xsl:if
test="onItemSelect">
+
itemSelectCallback = <xsl:value-of select="onItemSelect"/>;
+ </xsl:if>
+
+ var
onClearSelectionCallback = false;
+ <xsl:if
test="onClearSelection">
+
onClearSelectionCallback = <xsl:value-of select="onClearSelection"/>;
+ </xsl:if>
+
+ var requestGenerator =
false;
+ <xsl:if
test="requestGenerator">
+
requestGenerator = <xsl:value-of select="requestGenerator"/>;
+ </xsl:if>
+
+ <![CDATA[
+ var oAC =
YAHOO.portico.autocompleteHelper('index.php?menuaction=booking.ui'+ui+'.index&phpgw_return_as=json&',
+
'filter_'+name+'_name', 'filter_'+name+'_id', 'filter_'+name+'_container');
+
+ if (requestGenerator) {
+
oAC.generateRequest = requestGenerator;
+ }
+
+ if (itemSelectCallback)
{
+
oAC.itemSelectEvent.subscribe(itemSelectCallback);
+ }
+
+
YAHOO.util.Event.addBlurListener('filter_'+name+'_name', function()
+ {
+ if
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "")
+ {
+
YAHOO.util.Dom.get('filter_'+name+'_id').value = "";
+ if
(onClearSelectionCallback) {
+
onClearSelectionCallback();
+ }
+ }
+ });
+
+
YAHOO.portico.addPreSerializeQueryFormListener(function(form)
+ {
+ if
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "")
+ {
+
YAHOO.util.Dom.get('filter_'+name+'_id').value = "";
+ }
+ });
+ ]]>
+ });
+ </script>
+ </td>
+ </xsl:when>
+ <xsl:when test="type = 'filter'">
+ <td valign="top">
+ <xsl:variable name="name"><xsl:value-of
select="name"/></xsl:variable>
+
+ <select id="{$name}" name="{$name}"
onMouseout="window.status='';return true;">
+ <xsl:for-each select="list">
+ <xsl:variable name="id"><xsl:value-of
select="id"/></xsl:variable>
+ <xsl:if test="id =
'NEW'">
+ <option value="{$id}"
selected="selected">
+
<xsl:value-of select="name"/>
+ </option>
+ </xsl:if>
+ <xsl:if test="id !=
'NEW'">
+ <option value="{$id}">
+
<xsl:value-of select="name"/>
+ </option>
+ </xsl:if>
+ </xsl:for-each>
+ </select>
+ </td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td valign="top">
+ <input id="innertoolbar">
+ <xsl:attribute
name="type"><xsl:value-of select="phpgw:conditional(not(type), '',
type)"/></xsl:attribute>
+ <xsl:attribute
name="name"><xsl:value-of select="phpgw:conditional(not(name), '',
name)"/></xsl:attribute>
+ <xsl:attribute
name="onclick"><xsl:value-of select="phpgw:conditional(not(onClick), '',
onClick)"/></xsl:attribute>
+ <xsl:attribute
name="value"><xsl:value-of select="phpgw:conditional(not(value), '',
value)"/></xsl:attribute>
+ <xsl:attribute
name="href"><xsl:value-of select="phpgw:conditional(not(href), '',
href)"/></xsl:attribute>
+ <xsl:attribute
name="class"><xsl:value-of select="phpgw:conditional(not(class), '',
class)"/></xsl:attribute>
+ </input>
+ </td>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </tr>
+ <xsl:if test="item/text and normalize-space(item/text)">
+ <thead style="background:none">
+ <tr>
+ <xsl:for-each select="item">
+ <td>
+ <xsl:if
test="name">
+ <label
style='margin:auto 0.25em'>
+
<xsl:attribute name="for"><xsl:value-of select="phpgw:conditional(not(name),
'', name)"/></xsl:attribute>
+
<xsl:value-of select="phpgw:conditional(not(text), '', text)"/>
+ </label>
+ </xsl:if>
+ </td>
+ </xsl:for-each>
+ </tr>
+ </thead>
+ </xsl:if>
+ </table>
+ </div>
+</xsl:template>
+
+<xsl:template match="datatable">
+ <div id="paginator"/>
+ <div id="datatable-container"/>
+ <xsl:call-template name="datasource-definition" />
+</xsl:template>
+
+
+<xsl:template name="datasource-definition">
+ <script>
+ YAHOO.namespace('controller');
+
+ YAHOO.controller.columnDefs = [
+ <xsl:for-each select="//datatable/field">
+ {
+ key: "<xsl:value-of
select="key"/>",
+ <xsl:if test="label">
+ label: "<xsl:value-of
select="label"/>",
+ </xsl:if>
+ sortable: <xsl:value-of
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
+ <xsl:if test="hidden">
+ hidden: true,
+ </xsl:if>
+ <xsl:if test="formatter">
+ formatter: <xsl:value-of
select="formatter"/>,
+ </xsl:if>
+ className: "<xsl:value-of
select="className"/>"
+ }<xsl:value-of
select="phpgw:conditional(not(position() = last()), ',', '')"/>
+ </xsl:for-each>
+ ];
+
+ setDataSource('<xsl:value-of select="source"/>',
YAHOO.controller.columnDefs, 'queryForm', ['building_types', 'cat_id',
'district_id', 'part-of_town_list', 'responsibility_roles_list'],
'datatable-container', '_form', '_paginator', null);
+
+ </script>
+
+</xsl:template>
+<!--
+<xsl:template match="lists">
+
+<div style="background: none repeat scroll 0 0 #EDF5FF;border: 1px solid
#243356;margin: 20px;padding: 20px;">
+-->
+ <!-- When control area is chosen an ajax request is executed.
The operation fetches controls from db and populates the control list below.
+ The ajax opearation is handled in file ajax.js
+ -->
+ <!--
+ <select id="control_area_list" name="control_area_list">
+ <xsl:for-each select="control_area_list">
+ <xsl:variable
name="control_area_id"><xsl:value-of select="id"/></xsl:variable>
+ <option value="{$control_area_id}">
+ <xsl:value-of select="title"/>
+ </option>
+ </xsl:for-each>
+ </select>
+
+ <select id="control_list" name="control_list">
+ <xsl:for-each select="control_list">
+ <xsl:variable name="control_id"><xsl:value-of
select="id"/></xsl:variable>
+ <option value="{$control_id}">
+ <xsl:value-of select="title"/>
+ </option>
+
+ </xsl:for-each>
+ </select>
+ </div>
+
+ <div style="background: none repeat scroll 0 0 #EDF5FF;border: 1px
solid #243356;margin: 20px;padding: 20px;">
+ <select id="building_types" name="building_types">
+ <xsl:for-each select="building_types">
+ <xsl:variable
name="building_type_id"><xsl:value-of select="id"/></xsl:variable>
+ <option value="{$building_type_id}">
+ <xsl:value-of select="name"/>
+ </option>
+
+ </xsl:for-each>
+ </select>
+
+ <select id="category_types" name="category_types">
+ <xsl:for-each select="category_types">
+ <xsl:variable
name="category_type_id"><xsl:value-of select="id"/></xsl:variable>
+ <option value="{$category_type_id}">
+ <xsl:value-of select="name"/>
+ </option>
+
+ </xsl:for-each>
+ </select>
+
+ <select id="district_list" name="district_list">
+ <xsl:for-each select="district_list">
+ <xsl:variable
name="district_list_id"><xsl:value-of select="id"/></xsl:variable>
+ <option value="{$district_list_id}">
+ <xsl:value-of select="name"/>
+ </option>
+
+ </xsl:for-each>
+ </select>
+
+ <select id="part_of_town_list" name="part_of_town_list">
+ <xsl:for-each select="part_of_town_list">
+ <xsl:variable
name="part_of_town_list_id"><xsl:value-of select="id"/></xsl:variable>
+ <option value="{$part_of_town_list_id}">
+ <xsl:value-of select="name"/>
+ </option>
+
+ </xsl:for-each>
+ </select>
+ <select id="responsibility_roles" name="responsibility_roles">
+ <xsl:for-each select="responsibility_roles_list">
+ <xsl:variable
name="responsibility_roles_list_id"><xsl:value-of select="id"/></xsl:variable>
+ <option value="{$responsibility_roles_list_id}">
+ <xsl:value-of select="name"/>
+ </option>
+
+ </xsl:for-each>
+ </select>
+ </div>
+</xsl:template>
+-->
\ No newline at end of file
Property changes on: trunk/controller/templates/base/equipment.xsl
___________________________________________________________________
Added: svn:mime-type
+ text/plain
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8237],
Erik Holm-Larsen <=