[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7881] property: custom function-call for custom fiel
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7881] property: custom function-call for custom fields |
Date: |
Fri, 14 Oct 2011 09:18:35 +0000 |
Revision: 7881
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7881
Author: sigurdne
Date: 2011-10-14 09:18:34 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
property: custom function-call for custom fields
Modified Paths:
--------------
trunk/property/inc/class.bogeneric.inc.php
trunk/property/inc/class.custom_fields.inc.php
trunk/property/inc/class.uiadmin_entity.inc.php
trunk/property/inc/class.uigeneric.inc.php
trunk/property/inc/class.uilookup.inc.php
trunk/property/templates/base/admin_entity.xsl
trunk/property/templates/base/attributes_form.xsl
Modified: trunk/property/inc/class.bogeneric.inc.php
===================================================================
--- trunk/property/inc/class.bogeneric.inc.php 2011-10-14 09:16:27 UTC (rev
7880)
+++ trunk/property/inc/class.bogeneric.inc.php 2011-10-14 09:18:34 UTC (rev
7881)
@@ -76,7 +76,7 @@
$this->cat_id = isset($_REQUEST['cat_id']) ?
$cat_id : $this->cat_id;
$this->allrows = isset($allrows) ? $allrows :
false;
- $this->location_info =
$this->so->get_location_info($type, $type_id);
+// $this->location_info =
$this->so->get_location_info($type, $type_id);
}
@@ -103,9 +103,11 @@
$this->allrows = $data['allrows'];
}
- public function get_location_info($type,$type_id)
+ public function get_location_info($type = '', $type_id = 0)
{
- return $this->so->get_location_info($type,$type_id);
+ $type = $type ? $type : $this->type;
+ $type_id = $type_id ? $type_id : $this->type_id;
+ return $this->location_info =
$this->so->get_location_info($type,$type_id);
}
function column_list($selected='',$allrows='')
Modified: trunk/property/inc/class.custom_fields.inc.php
===================================================================
--- trunk/property/inc/class.custom_fields.inc.php 2011-10-14 09:16:27 UTC
(rev 7880)
+++ trunk/property/inc/class.custom_fields.inc.php 2011-10-14 09:18:34 UTC
(rev 7881)
@@ -188,6 +188,42 @@
$lookup_functions[$m]['action'] =
'Window1=window.open('."'" . $lookup_link ."'"
.',"Search","left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
$m++;
}
+ else if($attributes['datatype'] == 'custom1')
// select
+ {
+ $attributes['choice'] = array();
+ if($attributes['get_list_function'])
+ {
+ $attributes['choice'] =
execMethod($attributes['get_list_function'],
$attributes['get_list_function_input']);
+ }
+ foreach ($attributes['choice'] as
&$_choice)
+ {
+ $_choice['name'] =
"{$_choice['id']} {$_choice['name']}";
+ $_choice['selected'] =
$_choice['id'] == $attributes['value'] ? 1 : 0;
+ }
+ }
+ else if($attributes['datatype'] == 'custom2')
//lookup
+ {
+ if($attributes['value'] &&
$attributes['get_single_function'])
+ {
+
if(!$attributes['get_single_function_input'])
+ {
+
$attributes['get_single_function_input'] = $attributes['value'];
+ }
+ $attributes['custom_name'] =
execMethod($attributes['get_single_function'],
$attributes['get_single_function_input']);
+ }
+
+ $insert_record_values[]
= $attributes['name'];
+ $lookup_link
= $GLOBALS['phpgw']->link('/index.php',array(
+ 'menuaction'
=> 'property.uilookup.custom',
+ 'column'
=> $attributes['name'],
+ 'get_list_function'
=> $attributes['get_list_function'],
+ 'get_list_function_input'
=> urlencode(serialize($attributes['get_list_function_input']))
+ ));
+
+ $lookup_functions[$m]['name'] =
'lookup_'. $attributes['name'] .'()';
+ $lookup_functions[$m]['action'] =
'Window1=window.open('."'" . $lookup_link ."'"
.',"Search","left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+ $m++;
+ }
else if($attributes['datatype'] == 'user')
{
if($attributes['value'])
Modified: trunk/property/inc/class.uiadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin_entity.inc.php 2011-10-14 09:16:27 UTC
(rev 7880)
+++ trunk/property/inc/class.uiadmin_entity.inc.php 2011-10-14 09:18:34 UTC
(rev 7881)
@@ -2352,17 +2352,31 @@
}
$link_data = array
- (
- 'menuaction' =>
'property.uiadmin_entity.edit_attrib',
- 'entity_id' => $entity_id,
- 'cat_id' => $cat_id,
- 'id' => $id,
- 'type' => $this->type
- );
+ (
+ 'menuaction' =>
'property.uiadmin_entity.edit_attrib',
+ 'entity_id' => $entity_id,
+ 'cat_id' => $cat_id,
+ 'id' => $id,
+ 'type' => $this->type
+ );
- if($values['column_info']['type']=='R' ||
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
+ $multiple_choice = false;
+ $custom_get_list = false;
+ $custom_get_single = false;
+ switch($values['column_info']['type'])
{
- $multiple_choice= true;
+ case 'R':
+ case 'CH':
+ case 'LB':
+ $multiple_choice = true;
+ break;
+ case 'custom1';
+ $custom_get_list = true;
+ break;
+ case 'custom2';
+ $custom_get_list = true;
+ $custom_get_single = true;
+ default:
}
$entity = $this->bo->read_single($entity_id,false);
@@ -2371,69 +2385,38 @@
$msgbox_data =
(isset($receipt)?$this->bocommon->msgbox_data($receipt):'');
$data = array
- (
- 'lang_entity'
=> lang('entity'),
- 'entity_name'
=> $entity['name'],
- 'lang_category'
=> lang('category'),
- 'category_name'
=> $category['name'],
+ (
+ 'entity_name'
=> $entity['name'],
+ 'category_name'
=> $category['name'],
+ 'multiple_choice'
=> $multiple_choice,
+ 'value_choice'
=> (isset($values['choice'])?$values['choice']:''),
+ 'custom_get_list'
=> $custom_get_list,
+ 'custom_get_single'
=> $custom_get_single,
+ 'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+ 'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+ 'done_action'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiadmin_entity.list_attribute', 'entity_id'=> $entity_id, 'cat_id'=>
$cat_id, 'type' => $this->type)),
+ 'value_id'
=> $id,
+ 'value_column_name'
=> $values['column_name'],
+ 'value_input_text'
=> $values['input_text'],
+ 'value_statustext'
=> $values['statustext'],
+ 'datatype_list'
=> $this->bocommon->select_datatype($values['column_info']['type']),
+ 'attrib_group_list'
=> $this->bo->get_attrib_group_list($entity_id,$cat_id,
$values['group_id']),
+ 'value_precision'
=> $values['column_info']['precision'],
+ 'value_scale'
=> $values['column_info']['scale'],
+ 'value_default'
=> $values['column_info']['default'],
+ 'nullable_list'
=> $this->bocommon->select_nullable($values['column_info']['nullable']),
+ 'value_lookup_form'
=> $values['lookup_form'],
+ 'value_list'
=> $values['list'],
+ 'value_search'
=> $values['search'],
+ 'value_history'
=> $values['history'],
+ 'value_disabled'
=> $values['disabled'],
+ 'value_helpmsg'
=> $values['helpmsg'],
+ 'value_get_list_function'
=> $values['get_list_function'],
+ 'value_get_list_function_input' =>
print_r($values['get_list_function_input'],true),
+ 'value_get_single_function'
=> $values['get_single_function'],
+ 'value_get_single_function_input' =>
print_r($values['get_single_function_input'],true)
+ );
- 'lang_choice'
=> lang('Choice'),
- 'lang_new_value'
=> lang('New value'),
- 'lang_new_value_statustext'
=> lang('New value for multiple choice'),
- 'multiple_choice'
=> (isset($multiple_choice)?$multiple_choice:''),
- 'value_choice'
=> (isset($values['choice'])?$values['choice']:''),
- 'lang_delete_value'
=> lang('Delete value'),
- 'lang_value'
=> lang('value'),
- 'lang_delete_choice_statustext'
=> lang('Delete this value from the list of multiple choice'),
-
- 'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
- 'done_action'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiadmin_entity.list_attribute', 'entity_id'=> $entity_id, 'cat_id'=>
$cat_id, 'type' => $this->type)),
- 'lang_id'
=> lang('Attribute ID'),
- 'lang_entity_type'
=> lang('Entity type'),
- 'lang_no_entity_type'
=> lang('No entity type'),
- 'lang_save'
=> lang('save'),
- 'lang_done'
=> lang('done'),
- 'value_id'
=> $id,
-
- 'lang_column_name'
=> lang('Column name'),
- 'value_column_name'
=> $values['column_name'],
- 'lang_column_name_statustext'
=> lang('enter the name for the column'),
-
- 'lang_input_text'
=> lang('input text'),
- 'value_input_text'
=> $values['input_text'],
- 'lang_input_name_statustext'
=> lang('enter the input text for records'),
-
- 'lang_id_attribtext'
=> lang('Enter the attribute ID'),
- 'lang_entity_statustext'
=> lang('Select a entity type'),
-
- 'lang_statustext'
=> lang('Statustext'),
- 'lang_statustext_attribtext'
=> lang('Enter a statustext for the inputfield in forms'),
- 'value_statustext'
=> $values['statustext'],
-
- 'lang_done_attribtext'
=> lang('Back to the list'),
- 'lang_save_attribtext'
=> lang('Save the attribute'),
-
- 'datatype_list'
=>
$this->bocommon->select_datatype($values['column_info']['type']),
-
- 'attrib_group_list'
=> $this->bo->get_attrib_group_list($entity_id,$cat_id,
$values['group_id']),
-
- 'value_precision'
=> $values['column_info']['precision'],
-
- 'value_scale'
=> $values['column_info']['scale'],
-
- 'value_default'
=> $values['column_info']['default'],
-
- 'nullable_list'
=>
$this->bocommon->select_nullable($values['column_info']['nullable']),
- 'value_lookup_form'
=> $values['lookup_form'],
- 'value_list'
=> $values['list'],
- 'value_search'
=> $values['search'],
- 'value_history'
=> $values['history'],
- 'value_disabled'
=> $values['disabled'],
- 'value_helpmsg'
=> $values['helpmsg'],
- );
- //_debug_array($values);
-
$appname = lang('entity');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->type_app[$this->type]) . ' - ' . $appname . ': ' . $function_msg;
Modified: trunk/property/inc/class.uigeneric.inc.php
===================================================================
--- trunk/property/inc/class.uigeneric.inc.php 2011-10-14 09:16:27 UTC (rev
7880)
+++ trunk/property/inc/class.uigeneric.inc.php 2011-10-14 09:18:34 UTC (rev
7881)
@@ -58,6 +58,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('property.bogeneric',true);
+ $this->bo->get_location_info();
$this->bocommon = &
$this->bo->bocommon;
$this->custom = &
$this->bo->custom;
Modified: trunk/property/inc/class.uilookup.inc.php
===================================================================
--- trunk/property/inc/class.uilookup.inc.php 2011-10-14 09:16:27 UTC (rev
7880)
+++ trunk/property/inc/class.uilookup.inc.php 2011-10-14 09:18:34 UTC (rev
7881)
@@ -62,7 +62,8 @@
'project_group' => true,
'ecodimb' => true,
'order_template' => true,
- 'response_template' => true
+ 'response_template' => true,
+ 'custom' => true
);
function __construct()
@@ -3300,6 +3301,227 @@
$this->save_sessiondata();
}
+ function custom()
+ {
+ $get_list_function =
phpgw::get_var('get_list_function');
+ $get_list_function_input =
urlencode(phpgw::get_var('get_list_function_input'));
+ $column =
phpgw::get_var('column');
+ if( phpgw::get_var('phpgw_return_as') != 'json' )
+ {
+ $datatable['config']['base_url'] =
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction' =>
'property.uilookup.custom',
+ 'cat_id'
=> $this->cat_id,
+ 'query'
=> $this->query,
+ 'filter'
=> $this->filter,
+ 'get_list_function' =>
$get_list_function,
+ 'get_list_function_input' =>
$get_list_function_input
+ ));
+ $datatable['config']['allow_allrows'] = true;
+ $datatable['config']['base_java_url'] =
"menuaction:'property.uilookup.custom',"
+ ."cat_id:'{$this->cat_id}',"
+ ."query:'{$this->query}',"
+ ."filter:'{$this->filter}',"
+
."get_list_function:'{$get_list_function}',"
+
."get_list_function_input:'{$get_list_function_input}'";
+
+ $datatable['actions']['form'] = array
+ (
+ array
+ (
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php',
+ array
+ (
+ 'menuaction'
=> 'property.uilookup.custom',
+ 'cat_id'
=> $this->cat_id,
+ 'query'
=> $this->query,
+ 'filter'
=> $this->filter,
+
'get_list_function' => $get_list_function,
+
'get_list_function_input' => $get_list_function_input
+ )
+ ),
+ 'fields' => array
+ (
+ 'field' => array
+ (
+ array
+ ( //boton
SEARCH
+ 'id' =>
'btn_search',
+ 'name'
=> 'search',
+ 'value'
=> lang('search'),
+ 'type'
=> 'button',
+
'tab_index' => 2
+ ),
+ array
+ ( // TEXT IMPUT
+ 'name'
=> 'query',
+ 'id'
=> 'txt_query',
+ 'value'
=> '',//'',//$query,
+ 'type'
=> 'text',
+ 'size'
=> 28,
+
'onkeypress' => 'return pulsar(event)',
+
'tab_index' => 1
+ )
+ ),
+ 'hidden_value' => array
+ (
+ )
+ )
+ )
+ );
+ }
+
+ $uicols = array (
+ 'input_type' => array('text','text'),
+ 'name' =>
array('id','name'),
+ 'formatter' => array('',''),
+ 'descr' =>
array(lang('ID'),lang('name'))
+ );
+
+ $template_list = array();
+ // $bo = CreateObject('property.bogeneric',true);
+ // $template_list = $bo->read();
+
+ $template_list = execMethod($get_list_function,
unserialize(urldecode($_GET['get_list_function_input'])));
+//_debug_array(unserialize(urldecode($get_list_function_input)));
+//_debug_array(unserialize(urldecode($_GET['get_list_function_input'])));
+ $content = array();
+ $j=0;
+ if (isset($template_list) && is_array($template_list))
+ {
+ foreach($template_list as $template_entry)
+ {
+ for
($i=0;$i<count($uicols['name']);$i++)
+ {
+
$datatable['rows']['row'][$j]['column'][$i]['value'] =
$template_entry[$uicols['name'][$i]];
+
$datatable['rows']['row'][$j]['column'][$i]['name'] = $uicols['name'][$i];
+ }
+ $j++;
+ }
+ }
+
+ $uicols_count = count($uicols['descr']);
+ $datatable['rowactions']['action'] = array();
+ for ($i=0;$i<$uicols_count;$i++)
+ {
+ //all colums should be have formatter
+
$datatable['headers']['header'][$i]['formatter'] =
($uicols['formatter'][$i]==''? '""' : $uicols['formatter'][$i]);
+
+ $datatable['headers']['header'][$i]['name']
= $uicols['name'][$i];
+ $datatable['headers']['header'][$i]['text']
= $uicols['descr'][$i];
+ $datatable['headers']['header'][$i]['visible']
= true;
+ $datatable['headers']['header'][$i]['sortable']
= true;
+
$datatable['headers']['header'][$i]['sort_field'] =
$uicols['name'][$i];
+ }
+
+ $custom_id = $column;
+ $custom_name = $column . '_name';
+
+ $function_exchange_values = '';
+
+ $function_exchange_values .=
'opener.document.getElementsByName("'.$custom_id.'")[0].value = "";' ."\r\n";
+ $function_exchange_values .=
'opener.document.getElementsByName("'.$custom_name.'")[0].value = "";' ."\r\n";
+
+ $function_exchange_values .=
'opener.document.getElementsByName("'.$custom_id.'")[0].value =
data.getData("id");' ."\r\n";
+ $function_exchange_values .=
'opener.document.getElementsByName("'.$custom_name.'")[0].value =
data.getData("name");' ."\r\n";
+
+ $function_exchange_values .= 'window.close()';
+
+ $datatable['exchange_values'] =
$function_exchange_values;
+ $datatable['valida'] = '';
+
+ // path for property.js
+ $datatable['property_js'] =
$GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property.js";
+
+ // Pagination and sort values
+ $datatable['pagination']['records_start'] =
(int)$this->start;
+ $datatable['pagination']['records_limit'] =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+ $datatable['pagination']['records_returned']=
count($template_list);
+ $datatable['pagination']['records_total'] =
$this->bo->total_records;
+
+ if ( (phpgw::get_var("start")== "") &&
(phpgw::get_var("order",'string')== ""))
+ {
+ $datatable['sorting']['order']
= 'id'; // name key Column in myColumnDef
+ $datatable['sorting']['sort']
= 'name'; // ASC / DESC
+ }
+ else
+ {
+ $datatable['sorting']['order']
= phpgw::get_var('order', 'string'); // name of column of Database
+ $datatable['sorting']['sort']
= phpgw::get_var('sort', 'string'); // ASC / DESC
+ }
+
+ $appname
= lang('template');
+ $function_msg =
lang('list order template');
+
+
+ //-- BEGIN----------------------------- JSON CODE
------------------------------
+
+ //values for Pagination
+ $json = array
+ (
+ 'recordsReturned' =>
$datatable['pagination']['records_returned'],
+ 'totalRecords' =>
(int)$datatable['pagination']['records_total'],
+ 'startIndex' =>
$datatable['pagination']['records_start'],
+ 'sort' =>
$datatable['sorting']['order'],
+ 'dir' =>
$datatable['sorting']['sort'],
+ 'records' =>
array()
+ );
+
+ // values for datatable
+ if(isset($datatable['rows']['row']) &&
is_array($datatable['rows']['row'])){
+ foreach( $datatable['rows']['row'] as $row )
+ {
+ $json_row = array();
+ foreach( $row['column'] as $column)
+ {
+ if(isset($column['format']) &&
$column['format']== "link" && $column['java_link']==true)
+ {
+
$json_row[$column['name']] = "<a href='#' id='".$column['link']."'
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
+ }
+ else
if(isset($column['format']) && $column['format']== "link")
+ {
+
$json_row[$column['name']] = "<a href='".$column['link']."' target='_blank'>"
.$column['value']."</a>";
+ }
+ else
+ {
+
$json_row[$column['name']] = $column['value'];
+ }
+ }
+ $json['records'][] = $json_row;
+ }
+ }
+
+ // right in datatable
+ if(isset($datatable['rowactions']['action']) &&
is_array($datatable['rowactions']['action']))
+ {
+ $json['rights'] =
$datatable['rowactions']['action'];
+ }
+
+ if( phpgw::get_var('phpgw_return_as') == 'json' )
+ {
+ return $json;
+ }
+
+ $datatable['json_data'] = json_encode($json);
+ //-------------------- JSON CODE ----------------------
+
+ // Prepare template variables and process XSLT
+ $template_vars = array();
+ $template_vars['datatable'] = $datatable;
+
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
$template_vars);
+
+
+ //Title of Page
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+
+ // Prepare YUI Library
+ $GLOBALS['phpgw']->js->validate_file( 'yahoo',
'lookup.tenant.index', 'property' );
+
+ $this->save_sessiondata();
+ }
+
+
}
Modified: trunk/property/templates/base/admin_entity.xsl
===================================================================
--- trunk/property/templates/base/admin_entity.xsl 2011-10-14 09:16:27 UTC
(rev 7880)
+++ trunk/property/templates/base/admin_entity.xsl 2011-10-14 09:18:34 UTC
(rev 7881)
@@ -1185,7 +1185,7 @@
<tr>
<td class="th_text"
align="left">
- <xsl:value-of
select="lang_entity"/>
+ <xsl:value-of
select="php:function('lang', 'entity')" />
</td>
<td class="th_text"
align="left">
<xsl:value-of
select="entity_name"/>
@@ -1193,7 +1193,7 @@
</tr>
<tr>
<td class="th_text"
align="left">
- <xsl:value-of
select="lang_category"/>
+ <xsl:value-of
select="php:function('lang', 'category')" />
</td>
<td class="th_text"
align="left">
<xsl:value-of
select="category_name"/>
@@ -1203,7 +1203,7 @@
<xsl:when test="value_id != ''">
<tr>
<td
valign="top">
-
<xsl:value-of select="lang_id"/>
+
<xsl:value-of select="php:function('lang', 'attribute id')" />
</td>
<td>
<xsl:value-of select="value_id"/>
@@ -1213,36 +1213,36 @@
</xsl:choose>
<tr>
<td valign="top">
- <xsl:value-of
select="lang_column_name"/>
+ <xsl:value-of
select="php:function('lang', 'column name')" />
</td>
<td>
<input type="text"
name="values[column_name]" value="{value_column_name}" maxlength="50">
<xsl:attribute
name="title">
-
<xsl:value-of select="lang_column_name_statustext"/>
+
<xsl:value-of select="php:function('lang', 'enter the name for the column')" />
</xsl:attribute>
</input>
</td>
</tr>
<tr>
<td valign="top">
- <xsl:value-of
select="lang_input_text"/>
+ <xsl:value-of
select="php:function('lang', 'input text')" />
</td>
<td>
<input type="text"
name="values[input_text]" value="{value_input_text}" size ="60" maxlength="50">
<xsl:attribute
name="title">
-
<xsl:value-of select="lang_input_text_statustext"/>
+
<xsl:value-of select="php:function('lang', 'enter the input text for records')"
/>
</xsl:attribute>
</input>
</td>
</tr>
<tr>
<td valign="top">
- <xsl:value-of
select="lang_statustext"/>
+ <xsl:value-of
select="php:function('lang', 'statustext')" />
</td>
<td>
<textarea cols="60"
rows="10" name="values[statustext]">
<xsl:attribute
name="title">
-
<xsl:value-of select="lang_statustext_attribtext"/>
+
<xsl:value-of select="php:function('lang', 'enter a statustext for the
inputfield in forms')" />
</xsl:attribute>
<xsl:value-of
select="value_statustext"/>
</textarea>
@@ -1417,10 +1417,10 @@
</tr>
<xsl:choose>
- <xsl:when test="multiple_choice
!= ''">
+ <xsl:when test="multiple_choice
= 1">
<tr>
<td
valign="top">
-
<xsl:value-of select="lang_choice"/>
+
<xsl:value-of select="php:function('lang', 'choice')" />
</td>
<td
align="right">
<xsl:call-template name="choice"/>
@@ -1428,30 +1428,84 @@
</tr>
</xsl:when>
</xsl:choose>
+ <xsl:choose>
+ <xsl:when test="custom_get_list
= 1">
+ <tr>
+ <td
valign="top">
+
<xsl:value-of select="php:function('lang', 'custom get list function')" />
+ </td>
+ <td>
+ <input
type="text" name="values[get_list_function]" value="{value_get_list_function}"
size='60'>
+
<xsl:attribute name="title">
+
<xsl:text><app>.<class>.<function></xsl:text>
+
</xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td
valign="top">
+
<xsl:value-of select="php:function('lang', 'get list function input')" />
+ </td>
+ <td>
+
<textarea cols="60" rows="10" name="values[get_list_function_input]">
+
<xsl:attribute name="title">
+
<xsl:text>parameter1 = value1, parameter2 = value2...</xsl:text>
+
</xsl:attribute>
+
<xsl:value-of select="value_get_list_function_input"/>
+
</textarea>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when
test="custom_get_single = 1">
+ <tr>
+ <td
valign="top">
+
<xsl:value-of select="php:function('lang', 'custom get single function')" />
+ </td>
+ <td>
+ <input
type="text" name="values[get_single_function]"
value="{value_get_single_function}" size='60'>
+
<xsl:attribute name="title">
+
<xsl:text><app>.<class>.<function></xsl:text>
+
</xsl:attribute>
+ </input>
+ </td>
+ </tr>
+ <tr>
+ <td
valign="top">
+
<xsl:value-of select="php:function('lang', 'get single function input')" />
+ </td>
+ <td>
+
<textarea cols="60" rows="10" name="values[get_single_function_input]">
+
<xsl:attribute name="title">
+
<xsl:text>parameter1 = value1, parameter2 = value2...</xsl:text>
+
</xsl:attribute>
+
<xsl:value-of select="value_get_single_function_input"/>
+
</textarea>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+
<tr height="50">
<td>
- <xsl:variable
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
- <input type="submit"
name="values[save]" value="{$lang_save}" onMouseout="window.status='';return
true;">
- <xsl:attribute
name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
-
<xsl:value-of select="lang_save_attribtext"/>
-
<xsl:text>'; return true;</xsl:text>
+ <xsl:variable
name="lang_save"><xsl:value-of select="php:function('lang', 'save')"
/></xsl:variable>
+ <input type="submit"
name="values[save]" value="{$lang_save}">
+ <xsl:attribute
name="title">
+
<xsl:value-of select="php:function('lang', 'save the attribute')" />
</xsl:attribute>
</input>
</td>
</tr>
-
</form>
<tr>
<td>
<xsl:variable
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
- <xsl:variable
name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
+ <xsl:variable
name="lang_done"><xsl:value-of select="php:function('lang', 'done')"
/></xsl:variable>
<form method="post"
action="{$done_action}">
- <input type="submit"
name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
- <xsl:attribute
name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
-
<xsl:value-of select="lang_done_attribtext"/>
-
<xsl:text>'; return true;</xsl:text>
+ <input type="submit"
name="done" value="{$lang_done}">
+ <xsl:attribute
name="title">
+
<xsl:value-of select="php:function('lang', 'back to the list')" />
</xsl:attribute>
</input>
</form>
@@ -1808,7 +1862,7 @@
<xsl:value-of
select="php:function('lang', 'order')" />
</td>
<td class="th_text" width="15%"
align="center">
- <xsl:value-of
select="lang_delete_value"/>
+ <xsl:value-of
select="php:function('lang', 'delete value')" />
</td>
</tr>
<xsl:for-each select="value_choice" >
@@ -1844,11 +1898,9 @@
</input>
</td>
<td align="center">
- <input
type="checkbox" name="values[delete_choice][]" value="{id}"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
-
<xsl:value-of select="//lang_delete_choice_statustext"/>
-
<xsl:text>'; return true;</xsl:text>
+ <input
type="checkbox" name="values[delete_choice][]" value="{id}">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'delete this value from the list of
multiple choice')" />
</xsl:attribute>
</input>
</td>
@@ -1858,14 +1910,12 @@
</xsl:choose>
<tr>
<td valign="top" colspan='2'>
- <xsl:value-of select="lang_new_value"/>
+ <xsl:value-of
select="php:function('lang', 'new value')" />
</td>
<td valign="top" colspan='2'>
- <input type="text"
name="values[new_choice]" onMouseout="window.status='';return true;">
- <xsl:attribute
name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
- <xsl:value-of
select="lang_new_value_statustext"/>
- <xsl:text>'; return
true;</xsl:text>
+ <input type="text"
name="values[new_choice]">
+ <xsl:attribute name="title">
+ <xsl:value-of
select="php:function('lang', 'new value for multiple choice')" />
</xsl:attribute>
</input>
</td>
Modified: trunk/property/templates/base/attributes_form.xsl
===================================================================
--- trunk/property/templates/base/attributes_form.xsl 2011-10-14 09:16:27 UTC
(rev 7880)
+++ trunk/property/templates/base/attributes_form.xsl 2011-10-14 09:18:34 UTC
(rev 7881)
@@ -209,6 +209,54 @@
</xsl:choose>
</input>
</xsl:when>
+ <xsl:when
test="datatype='custom1'">
+ <select
name="values_attribute[{counter}][value]" class="forms">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
<option value="">
+
<xsl:value-of select="php:function('lang', 'select')" />
+
</option>
+
<xsl:for-each select="choice">
+
<xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
+
<xsl:choose>
+
<xsl:when test="selected='1'">
+
<option value="{$id}" selected="selected"><xsl:value-of
disable-output-escaping="yes" select="name"/></option>
+
</xsl:when>
+
<xsl:otherwise>
+
<option value="{$id}"><xsl:value-of
disable-output-escaping="yes" select="name"/></option>
+
</xsl:otherwise>
+
</xsl:choose>
+
</xsl:for-each>
+
</select>
+ </xsl:when>
+ <xsl:when
test="datatype='custom2'">
+
<xsl:variable name="custom_name"><xsl:value-of
select="name"/><xsl:text>_name</xsl:text></xsl:variable>
+
<xsl:variable name="lookup_function"><xsl:text>lookup_</xsl:text><xsl:value-of
select="name"/><xsl:text>();</xsl:text></xsl:variable>
+ <input
type="text" name="{name}" value="{value}" onClick="{$lookup_function}"
readonly="readonly" size="6">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+ <input
size="30" type="text" name="{$custom_name}" value="{custom_name}"
onClick="{$lookup_function}" readonly="readonly">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+ </xsl:when>
+
<xsl:when
test="datatype='user'">
<xsl:variable name="user_name"><xsl:value-of
select="name"/><xsl:text>_user_name</xsl:text></xsl:variable>
<xsl:variable name="lookup_function"><xsl:text>lookup_</xsl:text><xsl:value-of
select="name"/><xsl:text>();</xsl:text></xsl:variable>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7881] property: custom function-call for custom fields,
Sigurd Nes <=