[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14583] clean up from yui
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [14583] clean up from yui |
Date: |
Sun, 13 Dec 2015 13:39:05 +0000 |
Revision: 14583
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14583
Author: sigurdne
Date: 2015-12-13 13:39:04 +0000 (Sun, 13 Dec 2015)
Log Message:
-----------
clean up from yui
Modified Paths:
--------------
branches/dev-syncromind/phpgwapi/setup/phpgw_no.lang
branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
branches/dev-syncromind/phpgwapi/templates/portico/head.tpl
branches/dev-syncromind/property/inc/class.uialarm.inc.php
branches/dev-syncromind/property/inc/class.uiinvestment.inc.php
branches/dev-syncromind/property/inc/class.uipricebook.inc.php
branches/dev-syncromind/property/inc/class.uiwo_hour.inc.php
branches/dev-syncromind/property/templates/base/investment.xsl
branches/dev-syncromind/property/templates/base/wo_hour.index.xsl
Added Paths:
-----------
branches/dev-syncromind/property/js/portico/investment.history.js
Removed Paths:
-------------
branches/dev-syncromind/property/templates/base/uialarm.index.xsl
branches/dev-syncromind/property/templates/base/uiinvestment.index.xsl
Modified: branches/dev-syncromind/phpgwapi/setup/phpgw_no.lang
===================================================================
--- branches/dev-syncromind/phpgwapi/setup/phpgw_no.lang 2015-12-11
16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/phpgwapi/setup/phpgw_no.lang 2015-12-13
13:39:04 UTC (rev 14583)
@@ -7,9 +7,9 @@
admin common no Admin
administration common no Administrasjon
april common no April
-are you sure you want to delete this entry ? common no Er du sikker du
vil slette denne entry ?
+are you sure you want to delete this entry ? common no Er du sikker du
vil slette denne posten ?
august common no August
-cancel common no Avslutt
+cancel common no Avbryt
change common no Endre
charset common no utf-8
clear common no Clear
Modified: branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
2015-12-11 16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
2015-12-13 13:39:04 UTC (rev 14583)
@@ -322,9 +322,73 @@
</xsl:template>
<xsl:template match="datatable">
- <xsl:call-template name="datasource-definition" />
+ <xsl:call-template name="top-toolbar" />
+ <xsl:call-template name="datasource-definition" />
+ <xsl:call-template name="end-toolbar" />
</xsl:template>
+<xsl:template name="top-toolbar">
+ <div class="toolbar-container">
+ <div class="toolbar" >
+ <form class="pure-form pure-form-stacked">
+ <div class="pure-g">
+ <div class="pure-u-1-3">
+ <xsl:apply-templates
select="//datatable/workorder_data" />
+ </div>
+ <div class="pure-u-2-3">
+ <xsl:for-each
select="//top-toolbar/fields/field">
+ <xsl:choose>
+ <xsl:when
test="type='button'">
+ <button
id="{id}" type="{type}" class="pure-button pure-button-primary"><xsl:value-of
select="value"/></button>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+</xsl:template>
+
+<xsl:template name="end-toolbar">
+ <div class="toolbar-container">
+ <div class="toolbar">
+ <form class="pure-form pure-form-stacked">
+ <div class="pure-g">
+ <div class="pure-u-1">
+ <xsl:for-each
select="//end-toolbar/fields/field">
+ <xsl:choose>
+ <xsl:when
test="type = 'date-picker'">
+ <td
valign="top">
+
<div>
+
<input id="filter_{name}" name="filter_{name}" type="text"></input>
+
</div>
+ </td>
+ </xsl:when>
+ <xsl:when
test="type='button'">
+ <button
id="{id}" type="{type}" class="pure-button pure-button-primary"
onclick="{action}">
+
<xsl:value-of select="value"/>
+
</button>
+ </xsl:when>
+ <xsl:when
test="type='label'">
+
<xsl:value-of select="value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <input
id="{id}" type="{type}" name="{name}" value="{value}">
+
<xsl:if test="type = 'checkbox' and checked = '1'">
+
<xsl:attribute name="checked">checked</xsl:attribute>
+
</xsl:if>
+ </input>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+</xsl:template>
+
<xsl:template name="datasource-definition">
<table id="datatable-container" class="display cell-border compact
responsive no-wrap" width="100%">
<thead>
Modified: branches/dev-syncromind/phpgwapi/templates/portico/head.tpl
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/portico/head.tpl 2015-12-11
16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/phpgwapi/templates/portico/head.tpl 2015-12-13
13:39:04 UTC (rev 14583)
@@ -1,5 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
+<!doctype html>
<!-- BEGIN head -->
<html>
<head>
Modified: branches/dev-syncromind/property/inc/class.uialarm.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uialarm.inc.php 2015-12-11
16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/property/inc/class.uialarm.inc.php 2015-12-13
13:39:04 UTC (rev 14583)
@@ -144,20 +144,12 @@
'data' =>
print_r($alarm['data'], true),
'enabled' => $alarm['enabled'],
'user' => $alarm['user'],
-// 'select'
=> $check_box,
'edit' => $link_edit
);
}
-// if( phpgw::get_var('export','bool'))
-// {
-// return $content;
-// }
-
$result_data = array('results' => $content);
-// echo '<pre>'; print_r($result_data); echo '</pre>';
-
$result_data['total_records'] =
$this->bo->total_records;
$result_data['draw'] = $draw;
@@ -188,20 +180,6 @@
{
$values = phpgw::get_var('values');
-// if($values['delete_alarm'] && count($values['alarm']))
-// {
-// $receipt =
$this->bo->delete_alarm('fm_async',$values['alarm']);
-// }
-// else if( (isset($values['enable_alarm']) &&
$values['enable_alarm']) || (isset($values['disable_alarm']) &&
$values['disable_alarm']) && count($values['alarm']))
-// {
-// $_enable_alarm = isset($values['enable_alarm'])
&& $values['enable_alarm'] ? true : false;
-// $receipt =
$this->bo->enable_alarm('fm_async',$values['alarm'],$_enable_alarm);
-// }
-// else if(isset($values['test_cron']) &&
$values['test_cron'] && isset($values['alarm']) && $values['alarm'])
-// {
-// $this->bo->test_cron($values['alarm']);
-// }
-
if(phpgw::get_var('phpgw_return_as') == 'json')
{
return $this->query();
@@ -250,284 +228,10 @@
array('key' => 'enabled',
'label' => lang('enabled'), 'sortable' => false,
'formatter' =>
'JqueryPortico.FormatterCenter'),
array('key' => 'user', 'label'
=> lang('User'), 'sortable' => true, 'formatter' =>
'JqueryPortico.FormatterCenter'),
-//
array('key'=>'select','label'=>lang('select'),'sortable'=>false
,'formatter'=>'JqueryPortico.FormatterCenter'),
array('key' => 'edit', 'label'
=> lang('edit'), 'sortable' => false, 'formatter' =>
'JqueryPortico.FormatterCenter')
)
- )/* ,
- 'top-toolbar' => array(
- 'fields' => array(
- 'field' => array(
- array
- ( // mensaje
- 'type' => 'label',
- 'id' => 'msg_header',
- 'value' => '',
- 'style' => 'filter'
- ),
- array
- (
- 'type' => 'button',
- 'id' => 'btn_test_cron',
- 'tab_index' => 4,
- 'value' => lang('test cron'),
- 'url' => self::link(array
- (
- //
'menuaction' => 'property.uiwo_hour.save_template',
- //
'from'=> 'index',
- //
'workorder_id' => $workorder_id
- ))
- ),
- array
- (
- 'type' => 'button',
- 'id' => 'btn_enable',
- 'tab_index' => 3,
- 'value' => lang('Enable'),
- 'url' => self::link(array
- (
- //
'menuaction' => 'property.uiwo_hour.edit',
- //
'from'=> 'index',
- //
'workorder_id' => $workorder_id
- ))
- ),
- array
- (
- 'type' => 'button',
- 'id' => 'btn_disable',
- 'tab_index' => 2,
- 'value' => lang('Disable'),
- 'url' => self::link(array
- (
- //
'menuaction' => 'property.uitemplate.index',
- //
'lookup'=> true,
- //
'workorder_id' => $workorder_id
- ))
- ),
- array
- (
- 'type' => 'button',
- 'id' => 'btn_delete',
- 'tab_index' => 1,
- 'value' => lang('Delete'),
- 'url' => self::link(array
- (
- //
'menuaction' => 'property.uiwo_hour.prizebook',
- //
'workorder_id' => $workorder_id
- ))
- )
- )
- )
- ) */
+ )
);
-// $datatable = array();
-// $values_combo_box = array();
-//
-// if( phpgw::get_var('phpgw_return_as') != 'json' )
-// {
-// $datatable['config']['base_url'] =
$GLOBALS['phpgw']->link('/index.php', array
-// (
-// 'menuaction' =>
'property.uialarm.index',
-// 'sort' =>
$this->sort,
-// 'order' =>
$this->order,
-// 'cat_id' =>
$this->cat_id,
-// 'filter' =>
$this->filter,
-// 'query' =>
$this->query
-//
-// ));
-//
-// $datatable['config']['allow_allrows'] = true;
-//
-// $datatable['config']['base_java_url'] =
"menuaction:'property.uialarm.index',"
-// ."sort:'{$this->sort}',"
-// ."order:'{$this->order}',"
-// ."cat_id:'{$this->cat_id}',"
-// ."filter:'{$this->filter}',"
-// ."query:'{$this->query}'";
-//
-// $datatable['actions']['form'] = array
-// (
-// array
-// (
-// 'action' =>
$GLOBALS['phpgw']->link('/index.php',
-// array
-// (
-// 'menuaction'
=> 'property.uialarm.index'
-// )
-// ),
-// 'fields' => array
-// (
-// 'field' => array
-// (
-// array
-// ( //boton
TEST_CROM
-// 'id'
=> 'btn_test_cron',
-// 'name'
=> 'test_cron',
-// 'value'
=> lang('test cron'),
-// 'type'
=> 'button',
-// 'style'
=> 'filter',
-//
'tab_index' => 1
-// ),
-// array
-// ( //boton ENABLE
-// 'id'
=> 'btn_enable',
-// 'name'
=> 'enable',
-// 'value'
=> lang('Enable'),
-// 'type'
=> 'button',
-// 'style'
=> 'filter',
-//
'tab_index' => 2
-// ),
-// array
-// ( //boton
DISABLE
-// 'id'
=> 'btn_disable',
-// 'name'
=> 'disable',
-// 'value'
=> lang('Disable'),
-// 'type'
=> 'button',
-// 'style'
=> 'filter',
-//
'tab_index' => 3
-// ),
-// array
-// ( //boton SEARCH
-// 'id'
=> 'btn_delete',
-// 'name'
=> 'delete',
-// 'value'
=> lang('Delete'),
-// 'type'
=> 'button',
-// 'style'
=> 'filter',
-//
'tab_index' => 4
-// ),
-// array
-// ( //boton ADD
-// 'id'
=> 'btn_new',
-// 'name'
=> 'add',
-// 'value'
=> lang('add'),
-// 'type'
=> 'button',
-//
'tab_index' => 7
-// ),
-// array
-// ( //boton SEARCH
-// 'id'
=> 'btn_search',
-// 'name'
=> 'search',
-// 'value'
=> lang('search'),
-// 'type'
=> 'button',
-//
'tab_index' => 6
-// ),
-// array
-// ( // TEXT IMPUT
-// 'name'
=> 'query',
-// 'id'
=> 'txt_query',
-// 'value'
=> $this->query,
-// 'type'
=> 'text',
-// 'size'
=> 28,
-//
'onkeypress'=> 'return pulsar(event)',
-//
'tab_index' => 5
-// ),
-// array
-// ( //boton
hidden actions for button
-// 'id'
=> 'values[action_button]',
-// 'name'
=> 'values[action_button]',
-// 'value'
=> '',
-// 'type'
=> 'hidden'
-// ),
-// array
-// ( //container
of control's Form
-// 'type'
=> 'label',
-// 'id'
=> 'controlsForm_container',
-// 'value'
=> ''
-// ),
-// ),
-// 'hidden_value' =>
array()
-// )
-// )
-// );
-// }
-// $list = array();
-// $list = $this->bo->read();
-//
-// foreach ($list as $alarm)
-// {
-// $link_edit = '';
-// $lang_edit_statustext = '';
-// $text_edit = '';
-//
-// if (substr($alarm['id'],0,8)=='fm_async')
-// {
-// $link_edit
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uialarm.edit', 'async_id'=> urlencode($alarm['id'])));
-// $text_edit
= lang('edit');
-// $link_edit
= "<a href=\"$link_edit\">$text_edit</a>";
-// }
-// else
-// {
-// $link_edit
= "-";
-// }
-//
-// $check_box = "<input type=\"checkbox\"
name=\"values[alarm][".$alarm['id']."]\" value=\"".$alarm['id']."\"
class=\"myValuesForPHP\">";
-//
-// $content[] = array
-// (
-// 'id'
=> $alarm['id'],
-// 'next_run'
=> $GLOBALS['phpgw']->common->show_date($alarm['next']),
-// 'times'
=> is_array($alarm['times']) ? print_r($alarm['times'],true) :
$GLOBALS['phpgw']->common->show_date($alarm['times']),
-// 'method'
=> $alarm['method'],
-// 'data'
=> print_r($alarm['data'],true),
-// 'enabled'
=> $alarm['enabled'],
-// 'user'
=> $alarm['user'],
-// 'check_box'
=> $check_box,
-// 'link_edit'
=> $link_edit
-// );
-// }
-// $uicols = array
-// (
-// array
-// (
-// 'col_name'=>'alarm_id',
'input_type'=>'varchar', 'name'=>'id', 'descr'=>lang('alarm
id'), 'className'=>'centerClasss', 'sortable'=>true ,'formatter'=>'',
'sort_field'=>'id'
-// ),
-// array
-// (
-// 'col_name'=>'next_run',
'input_type'=>'varchar', 'name'=>'next_run', 'descr'=>lang('Next
run'), 'className'=>'centerClasss', 'sortable'=>true ,'formatter'=>'',
'sort_field'=>'next'
-// ),
-// array
-// (
-// 'col_name'=>'times',
'input_type'=>'varchar', 'name'=>'times', 'descr'=>lang('Times'),
'className'=>'centerClasss', 'sortable'=>false ,'formatter'=>'',
'sort_field'=>''
-// ),
-// array
-// (
-// 'col_name'=>'method',
'input_type'=>'varchar', 'name'=>'method',
'descr'=>lang('Method'), 'className'=>'leftClasss',
'sortable'=>true ,'formatter'=>'', ' sort_field'=>'method'
-// ),
-// array
-// (
-// 'col_name'=>'data',
'input_type'=>'varchar', 'name'=>'data', 'descr'=>lang('Data'),
'className'=>'leftClasss', 'sortable'=>false
,'formatter'=>'', ' sort_field'=>''
-// ),
-// array
-// (
-// 'col_name'=>'enable',
'input_type'=>'varchar', 'name'=>'enabled',
'descr'=>lang('enabled'), 'className'=>'centerClasss',
'sortable'=>false ,'formatter'=>'', 'sort_field'=>''
-// ),
-// array
-// (
-// 'col_name'=>'user',
'input_type'=>'varchar', 'name'=>'user', 'descr'=>lang('User'),
'className'=>'centerClasss', 'sortable'=>true ,'formatter'=>'',
'sort_field'=>'account_lid'
-// ),
-// array
-// (
-// 'col_name'=>'select',
'input_type'=>'imput', 'name'=>'check_box','descr'=>lang('select'),
'className'=>'centerClasss', 'sortable'=>false ,'formatter'=>'',
'sort_field'=>''
-// ),
-// array
-// (
-// 'col_name'=>'edit',
'input_type'=>'link', 'name'=>'link_edit','descr'=>lang('edit'),
'className'=>'centerClasss', 'sortable'=>false ,'formatter'=>'',
'sort_field'=>''
-// )
-// );
-// $j=0;
-// if (isset($content) && is_array($content))
-// {
-// foreach($content as $alarm)
-// {
-// for ($i=0;$i<count($uicols);$i++)
-// {
-//
$datatable['rows']['row'][$j]['column'][$i]['name'] =
$uicols[$i]['col_name'];
-//
$datatable['rows']['row'][$j]['column'][$i]['value'] =
$alarm[$uicols[$i]['name']];
-//
$datatable['rows']['row'][$j]['column'][$i]['format'] =
$uicols[$i]['input_type'];
-// }
-// $j++;
-// }
-// }
-// $datatable['rowactions']['action'] = array();
$requestUrl = json_encode(self::link(array(
'menuaction' =>
'property.uialarm.index',
Modified: branches/dev-syncromind/property/inc/class.uiinvestment.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiinvestment.inc.php
2015-12-11 16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/property/inc/class.uiinvestment.inc.php
2015-12-13 13:39:04 UTC (rev 14583)
@@ -47,11 +47,12 @@
var $currentapp;
var $public_functions = array
(
- 'query' => true,
- 'index' => true,
- 'history' => true,
- 'add' => true,
- 'delete' => true
+ 'query' => true,
+ 'index' => true,
+ 'history' => true,
+ 'get_history' => true,
+ 'add' => true,
+ 'delete' => true
);
function __construct()
@@ -336,7 +337,7 @@
'className' =>
'center'),
)
),
- 'down-toolbar' => array(
+ 'end-toolbar' => array(
'fields' => array(
'field' => array(
array(
@@ -388,7 +389,7 @@
phpgwapi_jquery::load_widget('numberformat');
self::add_javascript('property', 'portico',
'investment.index.js');
- self::render_template_xsl('uiinvestment.index', $data);
+ self::render_template_xsl('datatable_jquery', $data);
}
function update_investment($values = '')
@@ -416,19 +417,8 @@
return $receipt;
}
- function history()
+ function get_history_cols()
{
- $values = phpgw::get_var('values');
- $entity_type = phpgw::get_var('entity_type');
- $entity_id = phpgw::get_var('entity_id',
'int');
- $investment_id = phpgw::get_var('investment_id',
'int');
-
- if($values)
- {
- $receipt =
$this->update_investment($values);
- $msgbox_data =
$this->bocommon->msgbox_data($receipt);
- }
-
$uicols = array(
'input_type' => array('text', 'text', 'text',
'text', 'text', 'text', 'hidden'),
'name' => array('initial_value',
'value', 'this_index', 'this_write_off', 'date',
@@ -441,6 +431,20 @@
'hidden' => array(false, false, false,
false, true, false, true)
);
+ return $uicols;
+
+ }
+ function get_history()
+ {
+ $draw = phpgw::get_var('draw', 'int');
+ $entity_id = phpgw::get_var('entity_id',
'int');
+ $investment_id = phpgw::get_var('investment_id',
'int');
+ $values = phpgw::get_var('values');
+ if($values)
+ {
+ return $this->update_investment($values);
+ }
+
$investment_list = $this->bo->read_single($entity_id,
$investment_id);
$dateformat
=
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
@@ -451,9 +455,7 @@
ksort($dlarr);
$dateformat
= (implode($sep, $dlarr));
-
$GLOBALS['phpgw']->jqcal->add_listener('filter_start_date');
- phpgwapi_jquery::load_widget('datepicker');
-
+ $uicols = $this->get_history_cols();
$values = array();
if(isset($investment_list) &&
is_array($investment_list))
{
@@ -485,7 +487,25 @@
$values[] = $json_row;
}
}
+ $result_data = array('results' => $values);
+ $result_data['total_records'] = count($values);
+ $result_data['draw'] = $draw;
+
+ return $this->jquery_results($result_data);
+ }
+
+ function history()
+ {
+ $entity_type = phpgw::get_var('entity_type');
+ $entity_id = phpgw::get_var('entity_id',
'int');
+ $investment_id = phpgw::get_var('investment_id',
'int');
+
+ $uicols = $this->get_history_cols();
+
+
$GLOBALS['phpgw']->jqcal->add_listener('filter_start_date');
+ phpgwapi_jquery::load_widget('datepicker');
+
$column_def = array();
$count_uicols = count($uicols['name']);
for($k = 0; $k < $count_uicols; $k++)
@@ -504,9 +524,10 @@
$datatable_def[] = array
(
'container' => 'datatable-container_0',
- 'requestUrl' => "''",
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
'property.uiinvestment.get_history',
+ 'entity_id' => $entity_id,
'investment_id' => $investment_id, 'phpgw_return_as' => 'json'))),
'ColumnDefs' => $column_def,
- 'data' => json_encode($values),
+ 'data' => '',
'config' => array(
array('disableFilter' => true),
array('disablePagination' => true)
@@ -527,7 +548,7 @@
)
);
- $down_toolbar = array
+ $end_toolbar = array
(
array(
'type' => 'label',
@@ -561,7 +582,7 @@
'tab_index' => 5,
'style' => 'filter',
'group' => '1',
- 'action' => ''
+ 'action' =>
'onclikUpdateinvestment()'
)
);
@@ -573,12 +594,18 @@
$info[2]['name'] = lang('Investment Id');
$info[2]['value'] = $investment_id;
+ $hidden[0]['name'] = 'entity_id';
+ $hidden[0]['value'] = $entity_id;
+ $hidden[1]['name'] = 'investment_id';
+ $hidden[1]['value'] = $investment_id;
+
$data = array
(
'datatable_def' => $datatable_def,
'top_toolbar' => $top_toolbar,
- 'down_toolbar' => $down_toolbar,
+ 'end_toolbar' => $end_toolbar,
'info' => $info,
+ 'hidden' => $hidden,
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
);
@@ -587,6 +614,7 @@
//Title of Page
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+ self::add_javascript('property', 'portico',
'investment.history.js');
self::render_template_xsl(array('investment',
'datatable_inline'), array('history' => $data));
}
Modified: branches/dev-syncromind/property/inc/class.uipricebook.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uipricebook.inc.php
2015-12-11 16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/property/inc/class.uipricebook.inc.php
2015-12-13 13:39:04 UTC (rev 14583)
@@ -303,7 +303,7 @@
'className' => 'center')
)
),
- 'down-toolbar' => array(
+ 'end-toolbar' => array(
'fields' => array(
'field' => array(
array(
Modified: branches/dev-syncromind/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiwo_hour.inc.php
2015-12-11 16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/property/inc/class.uiwo_hour.inc.php
2015-12-13 13:39:04 UTC (rev 14583)
@@ -782,7 +782,7 @@
)
)
),
- 'down-toolbar' => array
+ 'end-toolbar' => array
(
'fields' => array
(
Added: branches/dev-syncromind/property/js/portico/investment.history.js
===================================================================
--- branches/dev-syncromind/property/js/portico/investment.history.js
(rev 0)
+++ branches/dev-syncromind/property/js/portico/investment.history.js
2015-12-13 13:39:04 UTC (rev 14583)
@@ -0,0 +1,76 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+var intVal = function ( i )
+{
+ return typeof i === 'string' ?
+ i.replace(/[\$,]/g, '')*1 :
+ typeof i === 'number' ? i : 0;
+};
+
+
+onclikUpdateinvestment = function(){
+
+ var oDate = $('#filter_start_date').val();
+ var oIndex = $('#txt_index').val();
+
+ if(oIndex == ''){
+ alert('None index');
+ return false;
+ }
+ if(oDate == ''){
+ alert('None Date');
+ return false;
+ }
+
+ var values = {};
+
+ values['entity_id'] = {};
+ values['investment_id'] = {};
+ values['initial_value'] = {};
+ values['value'] = {};
+ values['update'] = {};
+ values['new_index'] = oIndex;
+ values['date'] = oDate;
+
+ values['entity_id'][0] = $('#entity_id').val();
+ values['investment_id'][0] = $('#investment_id').val();
+ values['update'][0] = 0;//first one
+
+ var api = oTable0.api();
+ api.data().each( function (d)
+ {
+ values['initial_value'][0] = d.initial_value;
+ values['value'][0] = d.value;
+ });
+
+ var requestUrl = api.ajax.url();
+ var data = {"values": values};
+ JqueryPortico.execute_ajax(requestUrl, function(result){
+
+ $('#filter_start_date').val('');
+ $('#txt_index').val('');
+ document.getElementById("message").innerHTML = '';
+ if (typeof(result.message) !== 'undefined')
+ {
+ $.each(result.message, function (k, v) {
+ document.getElementById("message").innerHTML +=
v.msg + "<br/>";
+ document.getElementById("message").style.color
= "green";
+ });
+ }
+
+ if (typeof(result.error) !== 'undefined')
+ {
+ $.each(result.error, function (k, v) {
+ document.getElementById("message").innerHTML +=
v.msg + "<br/>";
+ document.getElementById("message").style.color
= "red";
+ });
+ }
+ oTable0.fnDraw();
+
+ }, data, "POST", "JSON");
+}
+
Modified: branches/dev-syncromind/property/templates/base/investment.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/investment.xsl
2015-12-11 16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/property/templates/base/investment.xsl
2015-12-13 13:39:04 UTC (rev 14583)
@@ -1,327 +1,17 @@
- <!-- $Id$ -->
- <xsl:template match="data">
- <xsl:choose>
- <xsl:when test="add">
- <xsl:apply-templates select="add"/>
- </xsl:when>
- <xsl:when test="history">
- <xsl:apply-templates select="history"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="list"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- New template-->
- <xsl:template match="list">
- <xsl:apply-templates select="menu"/>
- <xsl:variable name="form_action">
- <xsl:value-of select="form_action"/>
- </xsl:variable>
- <form method="post" name="form_search" action="{$form_action}">
- <table width="100%" cellpadding="2" cellspacing="2"
align="center">
- <xsl:choose>
- <xsl:when test="msgbox_data != ''">
- <tr>
- <td align="left"
colspan="3">
-
<xsl:call-template name="msgbox"/>
- </td>
- </tr>
- </xsl:when>
- </xsl:choose>
- <tr>
- <td align="left">
- <xsl:call-template
name="cat_select"/>
- </td>
- </tr>
- <tr>
- <td align="left">
- <xsl:call-template
name="select_part_of_town"/>
- <xsl:call-template
name="filter_select"/>
- <xsl:variable
name="lang_search">
- <xsl:value-of
select="lang_search"/>
- </xsl:variable>
- <input type="submit"
name="submit_search" value="{$lang_search}" onMouseout="window.status='';return
true;">
- <xsl:attribute
name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
- <xsl:value-of
select="lang_search_statustext"/>
- <xsl:text>';
return true;</xsl:text>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- <tr>
- <td colspan="3" width="100%">
- <xsl:call-template
name="nextmatchs"/>
- </td>
- </tr>
- </table>
- </form>
- <xsl:variable name="update_action">
- <xsl:value-of select="update_action"/>
- </xsl:variable>
- <form method="post" name="form" action="{$update_action}">
- <table width="100%" cellpadding="2" cellspacing="2"
align="center">
- <xsl:apply-templates select="table_header"/>
- <xsl:choose>
- <xsl:when test="values[entity_id]!=''">
- <xsl:apply-templates
select="values"/>
- <tr>
- <td/>
- <td/>
- <td/>
- <td/>
- <td/>
- <td/>
- <td class="th_text"
align="right">
- <xsl:value-of
select="sum_initial_value"/>
- </td>
- <td class="th_text"
align="right">
- <xsl:value-of
select="sum_value"/>
- </td>
- <td/>
- <td/>
- <td/>
- <td/>
- <td/>
- <td align="center">
- <xsl:variable
name="img_check">
-
<xsl:value-of select="img_check"/>
- </xsl:variable>
- <a
href="javascript:check_all_checkbox('values[update]')">
- <img
src="{$img_check}" border="0" height="16" width="21" alt="{lang_select_all}"/>
- </a>
- </td>
- </tr>
- </xsl:when>
- </xsl:choose>
- </table>
- <table width="50%" cellpadding="2" cellspacing="2"
align="center">
- <xsl:apply-templates select="table_update"/>
- </table>
- </form>
- <table width="100%" cellpadding="2" cellspacing="2"
align="center">
- <xsl:apply-templates select="table_add"/>
- </table>
- </xsl:template>
+<!-- $Id$ -->
+<xsl:template match="data">
+ <xsl:choose>
+ <xsl:when test="add">
+ <xsl:apply-templates select="add"/>
+ </xsl:when>
+ <xsl:when test="history">
+ <xsl:apply-templates select="history"/>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
- <!-- New template-->
- <xsl:template match="table_header">
- <tr class="th">
- <td class="th_text" width="5%" align="right">
- <xsl:value-of select="lang_district"/>
- </td>
- <td class="th_text" width="10%" align="right">
- <xsl:value-of select="lang_part_of_town"/>
- </td>
- <td class="th_text" width="10%" align="right">
- <xsl:value-of select="lang_entity_id"/>
- </td>
- <td class="th_text" width="5%" align="right">
- <xsl:value-of select="lang_investment_id"/>
- </td>
- <td class="th_text" width="10%">
- <xsl:value-of select="lang_descr"/>
- </td>
- <td class="th_text" width="10%">
- <xsl:value-of select="lang_entity_name"/>
- </td>
- <td class="th_text" width="20%" align="center">
- <xsl:value-of select="lang_initial_value"/>
- </td>
- <td class="th_text" width="20%" align="center">
- <xsl:value-of select="lang_value"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_last_index"/>
- </td>
- <td class="th_text" width="10%" align="center">
- <xsl:value-of select="lang_write_off"/>
- </td>
- <td class="th_text" width="10%" align="center">
- <xsl:value-of select="lang_date"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_index_count"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_history"/>
- </td>
- <td class="th_text" width="5%" align="center">
- <xsl:value-of select="lang_select"/>
- </td>
- </tr>
- </xsl:template>
- <!-- New template-->
- <xsl:template match="values">
- <xsl:variable name="lang_history_statustext">
- <xsl:value-of select="lang_history_statustext"/>
- </xsl:variable>
- <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="right">
- <input type="hidden"
name="values[entity_id][{counter}]" value="{entity_id}"/>
- <input type="hidden"
name="values[investment_id][{counter}]" value="{investment_id}"/>
- <input type="hidden"
name="values[initial_value][{counter}]" value="{initial_value_ex}"/>
- <input type="hidden"
name="values[value][{counter}]" value="{value_ex}"/>
- <xsl:value-of select="district_id"/>
- </td>
- <td align="left">
- <xsl:value-of select="part_of_town"/>
- </td>
- <td align="right">
- <xsl:value-of select="entity_id"/>
- </td>
- <td align="right">
- <xsl:value-of select="investment_id"/>
- </td>
- <td align="left">
- <xsl:value-of select="descr"/>
- </td>
- <td align="left">
- <xsl:value-of select="entity_name"/>
- </td>
- <td align="right">
- <xsl:value-of select="initial_value"/>
- </td>
- <td align="right">
- <xsl:value-of select="value"/>
- </td>
- <td align="right">
- <xsl:value-of select="this_index"/>
- </td>
- <td align="right">
- <xsl:value-of select="this_write_off"/>
- </td>
- <td align="right">
- <xsl:value-of select="date"/>
- </td>
- <td align="center">
- <xsl:value-of select="index_count"/>
- </td>
- <xsl:choose>
- <xsl:when test="is_admin=1">
- <td align="center">
- <xsl:variable
name="link_history">
- <xsl:value-of
select="link_history"/>
- </xsl:variable>
- <a href="{$link_history}"
onMouseover="window.status='{$lang_history_statustext}';return true;"
onMouseout="window.status='';return true;">
- <xsl:value-of
select="lang_history"/>
- </a>
- </td>
- <td>
- <xsl:choose>
- <xsl:when
test="value_ex !=0">
- <input
type="checkbox" name="values[update][{counter}]" value="{counter}"
onMouseout="window.status='';return true;">
- </input>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </xsl:when>
- </xsl:choose>
- </tr>
- </xsl:template>
-
- <!-- New template-->
- <xsl:template match="table_update">
- <tr>
- <td>
- <xsl:value-of select="lang_new_index"/>
- <input type="text" name="values[new_index]"
size="12" onMouseout="window.status='';return true;">
- <xsl:attribute name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
- <xsl:value-of
select="lang_new_index_statustext"/>
- <xsl:text>'; return
true;</xsl:text>
- </xsl:attribute>
- </input>
- </td>
- <td>
- <input type="text" id="values_date"
name="values[date]" size="10" value="{value_date}" readonly="readonly"
onMouseout="window.status='';return true;">
- <xsl:attribute name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
- <xsl:value-of
select="lang_date_statustext"/>
- <xsl:text>'; return
true;</xsl:text>
- </xsl:attribute>
- </input>
- </td>
- <td height="50">
- <xsl:variable name="lang_update">
- <xsl:value-of select="lang_update"/>
- </xsl:variable>
- <input type="submit" name="submit_update"
value="{$lang_update}" onMouseout="window.status='';return true;">
- <xsl:attribute name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
- <xsl:value-of
select="lang_update_statustext"/>
- <xsl:text>'; return
true;</xsl:text>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- </xsl:template>
-
- <!-- New template-->
- <xsl:template match="table_add">
- <tr>
- <td height="50">
- <xsl:variable name="add_action">
- <xsl:value-of select="add_action"/>
- </xsl:variable>
- <xsl:variable name="lang_add">
- <xsl:value-of select="lang_add"/>
- </xsl:variable>
- <form method="post" action="{$add_action}">
- <input type="submit" name="add"
value="{$lang_add}" onMouseout="window.status='';return true;">
- <xsl:attribute
name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
- <xsl:value-of
select="lang_add_statustext"/>
- <xsl:text>'; return
true;</xsl:text>
- </xsl:attribute>
- </input>
- </form>
- </td>
- </tr>
- </xsl:template>
-
- <!-- New template-->
- <xsl:template match="table_done">
- <tr>
- <td height="50">
- <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>
- <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_statustext"/>
- <xsl:text>'; return
true;</xsl:text>
- </xsl:attribute>
- </input>
- </form>
- </td>
- </tr>
- </xsl:template>
-
<xsl:template match="history">
<xsl:call-template name="top-toolbar" />
<div>
@@ -334,6 +24,7 @@
</dl>
</xsl:when>
</xsl:choose>
+ <div id="message" class='message'/>
<xsl:for-each select="datatable_def">
<xsl:if test="container = 'datatable-container_0'">
<xsl:call-template name="table_setup">
@@ -347,7 +38,7 @@
</xsl:if>
</xsl:for-each>
</div>
- <xsl:call-template name="down-toolbar" />
+ <xsl:call-template name="end-toolbar" />
</xsl:template>
<xsl:template name="top-toolbar">
@@ -356,26 +47,35 @@
<div class="pure-u-1-3">
<xsl:for-each select="info">
<div>
- <span><xsl:value-of
select="name"/></span>: <span><xsl:value-of select="value"/></span>
+ <span>
+ <xsl:value-of
select="name"/>
+ </span>: <span>
+ <xsl:value-of
select="value"/>
+ </span>
</div>
</xsl:for-each>
+ <xsl:for-each select="hidden">
+ <input type="hidden" id="{name}"
name="{name}" value="{value}" />
+ </xsl:for-each>
</div>
<div class="pure-u-2-3">
<xsl:for-each select="top_toolbar">
- <a class="pure-button
pure-button-primary" href="{url}"><xsl:value-of select="value"/></a>
+ <a class="pure-button
pure-button-primary" href="{url}">
+ <xsl:value-of select="value"/>
+ </a>
</xsl:for-each>
</div>
</div>
</div>
</xsl:template>
-<xsl:template name="down-toolbar">
+<xsl:template name="end-toolbar">
<div class="toolbar-container">
<div class="toolbar">
<form class="pure-form pure-form-stacked">
<div class="pure-g">
<div class="pure-u-1">
- <xsl:for-each
select="down_toolbar">
+ <xsl:for-each
select="end_toolbar">
<xsl:choose>
<xsl:when
test="type = 'date-picker'">
<div>
@@ -383,7 +83,9 @@
</div>
</xsl:when>
<xsl:when
test="type='button'">
- <button
id="{id}" type="{type}" class="pure-button pure-button-primary"
onclick="{action}"><xsl:value-of select="value"/></button>
+ <button
id="{id}" type="{type}" class="pure-button pure-button-primary"
onclick="{action}">
+
<xsl:value-of select="value"/>
+
</button>
</xsl:when>
<xsl:when
test="type='label'">
<xsl:value-of select="value"/>
@@ -405,136 +107,135 @@
</xsl:template>
- <!-- New template-->
- <!-- add -->
- <xsl:template match="add">
- <script type="text/javascript">
- self.name="first_Window";
- function location_lookup()
- {
- Window1=window.open('<xsl:value-of
select="location_link"/>',"Search","left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
- }
- </script>
- <dl>
- <xsl:choose>
- <xsl:when test="msgbox_data !=
''">
- <tr>
- <td
align="left" colspan="3">
-
<xsl:call-template name="msgbox"/>
- </td>
- </tr>
- </xsl:when>
- </xsl:choose>
- </dl>
- <xsl:variable name="form_action">
- <xsl:value-of
select="form_action"/>
- </xsl:variable>
- <form method="post" class="pure-form
pure-form-aligned" id="form" action="{$form_action}" name="form">
- <div id="tab-content">
- <xsl:value-of
disable-output-escaping="yes" select="tabs"/>
- <div id="general">
- <xsl:call-template
name="location_form"/>
- <div
class="pure-control-group">
- <label>
- <xsl:value-of
select="lang_write_off_period"/>
- </label>
-
<xsl:call-template name="cat_select_investment" />
- <xsl:text>
</xsl:text>
- <xsl:value-of
select="lang_new"/>
- <input
type="text" id="numperiod" name="values[new_period]"
value="{value_new_period}" size="3" onMouseout="window.status='';return true;">
-
<xsl:attribute name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
-
<xsl:value-of select="lang_new_period_statustext"/>
-
<xsl:text>'; return true;</xsl:text>
-
</xsl:attribute>
- </input>
- </div>
- <div
class="pure-control-group">
- <label>
- <xsl:value-of
select="lang_type"/>
- </label>
-
<xsl:call-template name="filter_select"/>
- </div>
- <div
class="pure-control-group">
- <label>
- <xsl:value-of
select="lang_amount"/>
- </label>
- <input
type="text" name="values[initial_value]" value="{value_inital_value}"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
-
<xsl:value-of select="lang_value_statustext"/>
-
<xsl:text>'; return true;</xsl:text>
-
</xsl:attribute>
- </input>
- </div>
- <div
class="pure-control-group">
- <label>
- <xsl:value-of
select="lang_date"/>
- </label>
- <input
type="text" id="values_date" name="values[date]" size="10" value="{value_date}"
readonly="readonly" onMouseout="window.status='';return true;">
-
<xsl:attribute name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
-
<xsl:value-of select="lang_date_statustext"/>
-
<xsl:text>'; return true;</xsl:text>
-
</xsl:attribute>
- </input>
- </div>
- <div
class="pure-control-group">
- <label>
- <xsl:value-of
select="lang_descr"/>
- </label>
- <input
type="text" name="values[descr]" value="{value_descr}"
onMouseout="window.status='';return true;">
-
<xsl:attribute name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
-
<xsl:value-of select="lang_name_statustext"/>
-
<xsl:text>'; return true;</xsl:text>
-
</xsl:attribute>
- </input>
- </div>
- <div
class="pure-control-group">
- <xsl:variable
name="lang_save">
-
<xsl:value-of select="lang_save"/>
- </xsl:variable>
- <input
type="submit" class="pure-button pure-button-primary" 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_statustext"/>
-
<xsl:text>'; return true;</xsl:text>
-
</xsl:attribute>
- </input>
- </div>
- </div>
- </div>
- </form>
- <div class="pure-control-group">
- <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>
- <form method="post"
action="{$done_action}">
- <input
type="submit" class="pure-button pure-button-primary" 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_statustext"/>
-
<xsl:text>'; return true;</xsl:text>
-
</xsl:attribute>
- </input>
- </form>
- </div>
- <script type="text/javascript">
+<!-- add -->
+<xsl:template match="add">
+ <script type="text/javascript">
+ self.name="first_Window";
+ function location_lookup()
+ {
+ Window1=window.open('<xsl:value-of
select="location_link"/>',"Search","left=50,top=100,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
+ }
+ </script>
+ <dl>
+ <xsl:choose>
+ <xsl:when test="msgbox_data != ''">
+ <tr>
+ <td align="left" colspan="3">
+ <xsl:call-template
name="msgbox"/>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ </dl>
+ <xsl:variable name="form_action">
+ <xsl:value-of select="form_action"/>
+ </xsl:variable>
+ <form method="post" class="pure-form pure-form-aligned" id="form"
action="{$form_action}" name="form">
+ <div id="tab-content">
+ <xsl:value-of disable-output-escaping="yes"
select="tabs"/>
+ <div id="general">
+ <xsl:call-template name="location_form"/>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="lang_write_off_period"/>
+ </label>
+ <xsl:call-template
name="cat_select_investment" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="lang_new"/>
+ <input type="text" id="numperiod"
name="values[new_period]" value="{value_new_period}" size="3"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_new_period_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="lang_type"/>
+ </label>
+ <xsl:call-template
name="filter_select"/>
+ </div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="lang_amount"/>
+ </label>
+ <input type="text"
name="values[initial_value]" value="{value_inital_value}"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_value_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="lang_date"/>
+ </label>
+ <input type="text" id="values_date"
name="values[date]" size="10" value="{value_date}" readonly="readonly"
onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_date_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </div>
+ <div class="pure-control-group">
+ <label>
+ <xsl:value-of
select="lang_descr"/>
+ </label>
+ <input type="text" name="values[descr]"
value="{value_descr}" onMouseout="window.status='';return true;">
+ <xsl:attribute
name="onMouseover">
+
<xsl:text>window.status='</xsl:text>
+ <xsl:value-of
select="lang_name_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </div>
+ <div class="pure-control-group">
+ <xsl:variable name="lang_save">
+ <xsl:value-of
select="lang_save"/>
+ </xsl:variable>
+ <input type="submit" class="pure-button
pure-button-primary" 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_statustext"/>
+ <xsl:text>'; return
true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </div>
+ </div>
+ </div>
+ </form>
+ <div class="pure-control-group">
+ <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>
+ <form method="post" action="{$done_action}">
+ <input type="submit" class="pure-button
pure-button-primary" 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_statustext"/>
+ <xsl:text>'; return true;</xsl:text>
+ </xsl:attribute>
+ </input>
+ </form>
+ </div>
+ <script type="text/javascript">
$.formUtils.addValidator({
- name : 'write_period_num',
- validatorFunction : function(value, $el, config,
language, $form) {
- var select_num = (value == '') ? 0 : 1;
- var nun_period = ($('#numperiod').val() ==
parseInt($('#numperiod').val(), 10)) ? 1 : 0;
- var result = (nun_period + select_num == 0) ?
false : true;
- return result;
- },
- errorMessage : '',
- errorMessageKey: ''
+ name : 'write_period_num',
+ validatorFunction : function(value, $el, config, language,
$form) {
+ var select_num = (value == '') ? 0 : 1;
+ var nun_period = ($('#numperiod').val() ==
parseInt($('#numperiod').val(), 10)) ? 1 : 0;
+ var result = (nun_period + select_num == 0) ? false : true;
+ return result;
+ },
+ errorMessage : '',
+ errorMessageKey: ''
});
</script>
- </xsl:template>
+</xsl:template>
Deleted: branches/dev-syncromind/property/templates/base/uialarm.index.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/uialarm.index.xsl
2015-12-11 16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/property/templates/base/uialarm.index.xsl
2015-12-13 13:39:04 UTC (rev 14583)
@@ -1,994 +0,0 @@
-<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">
- <xsl:choose>
- <xsl:when test="datatable_name">
- <h3>
- <xsl:value-of select="datatable_name"/>
- </h3>
- </xsl:when>
- </xsl:choose>
- <xsl:call-template name="datatable" />
-</xsl:template>
-
-
-<xsl:template name="datatable">
- <xsl:call-template name="jquery_phpgw_i18n"/>
- <xsl:apply-templates select="form" />
- <div id="list_flash">
- <xsl:call-template name="msgbox"/>
- </div>
- <div id="message" class='message'/>
- <xsl:apply-templates select="datatable"/>
- <xsl:apply-templates select="form/list_actions"/>
-</xsl:template>
-
-<xsl:template match="toolbar">
- <style id='toggle-box-css' type='text/css' scoped='scoped'>
-.toggle-box {
- display: none;
-}
-
-.toggle-box + label {
- cursor: pointer;
- display: block;
- font-weight: bold;
- line-height: 21px;
- margin-bottom: 5px;
-}
-
-.toggle-box + label + div {
- display: none;
- margin-bottom: 10px;
-}
-
-.toggle-box:checked + label + div {
- display: block;
-}
-
-.toggle-box + label:before {
- background-color: #4F5150;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- border-radius: 10px;
- color: #FFFFFF;
- content: "+";
- display: block;
- float: left;
- font-weight: bold;
- height: 20px;
- line-height: 20px;
- margin-right: 5px;
- text-align: center;
- width: 20px;
-}
-
-.toggle-box:checked + label:before {
- content: "\2212";
-}
-
- </style>
-
- <input class="toggle-box" id="header1" type="checkbox" />
- <label for="header1">
- <xsl:value-of select="php:function('lang', 'toolbar')"/>
- </label>
-
- <div id="toolbar">
- <!--xsl:if test="item/text and normalize-space(item/text)"-->
- <xsl:if test="item">
- <table id="toolbar_table" class="pure-table">
- <thead>
- <tr>
- <th>
- <xsl:value-of
select="php:function('lang', 'name')"/>
- </th>
- <th>
- <xsl:value-of
select="php:function('lang', 'item')"/>
- </th>
- </tr>
- </thead>
- <tbody>
-
- <xsl:for-each select="item">
- <tr>
- <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')"/>
- <td>
- <xsl:if test="name">
- <label>
- <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:choose>
- <xsl:when test="type = 'date-picker'">
- <td valign="top">
- <div>
- <input id="filter_{name}"
name="filter_{name}" type="text"></input>
- </div>
- </td>
- </xsl:when>
- <xsl:when test="type = 'autocomplete'">
- <td class="auto">
- <div class="auto">
- <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 app = "<xsl:value-of
select="app"/>";
- 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');
-
- var oArgs =
{menuaction: app + '.ui'+ui+'.index'};
- var requestUrl =
phpGWLink('index.php', oArgs, true);
- requestUrl +=
'filter_'+name+'_name', 'filter_'+name+'_id', 'filter_'+name+'_container';
- // alert('FIXME:
autocompleteHelper::requestUrl ' + requestUrl );
-
-
- 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}">
- <xsl:for-each select="list">
- <xsl:variable
name="id"><xsl:value-of select="id"/></xsl:variable>
- <xsl:choose>
- <xsl:when
test="id = 'NEW'">
- <option
value="{$id}" selected="selected">
-
<xsl:value-of select="name"/>
-
</option>
- </xsl:when>
- <xsl:otherwise>
-
<xsl:choose>
-
<xsl:when test="selected = 'selected'">
-
<option value="{$id}" selected="selected">
-
<xsl:value-of select="name"/>
-
</option>
-
</xsl:when>
-
<xsl:otherwise>
-
<option value="{$id}">
-
<xsl:value-of select="name"/>
-
</option>
-
</xsl:otherwise>
-
</xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </select>
- </td>
- </xsl:when>
- <xsl:when test="type = 'link'">
- <td valign="top">
- <input type="button"
class="pure-button pure-button-primary">
- <xsl:choose>
- <xsl:when
test="onclick">
-
<xsl:attribute name="onclick"><xsl:value-of select="onclick"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
-
<xsl:attribute name="onclick">javascript:window.open('<xsl:value-of
select="href"/>', "_self");</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute
name="value"><xsl:value-of select="value"/></xsl:attribute>
- </input>
- <!--a href="{href}">
- <xsl:if test="onclick">
- <xsl:attribute
name="onclick">
-
<xsl:value-of select="onclick"/>
-
</xsl:attribute>
- </xsl:if>
- <xsl:value-of
select="value"/>
- </a-->
- </td>
- </xsl:when>
- <xsl:when test="type = 'hidden'">
- <td valign="top">
- <input>
- <xsl:attribute
name="type"><xsl:value-of select="phpgw:conditional(not(type), '',
type)"/></xsl:attribute>
- <xsl:attribute
name="id"><xsl:value-of select="phpgw:conditional(not(id), '',
id)"/></xsl:attribute>
- <xsl:attribute
name="name"><xsl:value-of select="phpgw:conditional(not(name), '',
name)"/></xsl:attribute>
- <xsl:attribute
name="value"><xsl:value-of select="phpgw:conditional(not(value), '',
value)"/></xsl:attribute>
- </input>
- </td>
- </xsl:when>
- <xsl:when test="type = 'label'">
- <td valign="top">
- <label><xsl:attribute
name="id"><xsl:value-of select="phpgw:conditional(not(id), '',
id)"/></xsl:attribute></label>
- </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>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
- </xsl:if>
- </div>
-</xsl:template>
-
-<xsl:template match="form/list_actions">
- <form id="list_actions_form" method="POST">
- <!-- Form action is set by javascript listener -->
- <div id="list_actions" class='yui-skin-sam'>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <xsl:for-each select="item">
- <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>
- </input>
- </td>
- </xsl:for-each>
- </tr>
- </table>
- </div>
- </form>
-</xsl:template>
-
-<xsl:template match="form">
- <div id="queryForm">
- <!--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"/>
- </div>
-
- <!--form id="update_table_dummy" method='POST' action='' >
- </form-->
-
-</xsl:template>
-
-<xsl:template match="datatable">
- <xsl:call-template name="top-toolbar" />
- <xsl:call-template name="datasource-definition" />
-</xsl:template>
-
-<xsl:template name="top-toolbar">
- <div class="toolbar-container">
- <div class="toolbar" >
- <form class="pure-form pure-form-stacked">
- <div class="pure-g">
- <div class="pure-u-1-3">
- <xsl:apply-templates
select="//datatable/workorder_data" />
- </div>
- <div class="pure-u-2-3">
- <xsl:for-each
select="//top-toolbar/fields/field">
- <xsl:choose>
- <xsl:when
test="type='button'">
- <button
id="{id}" type="{type}" class="pure-button pure-button-primary"><xsl:value-of
select="value"/></button>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </div>
- </div>
- </form>
- </div>
- </div>
-</xsl:template>
-<!--xsl:template name="down-toolbar">
- <div class="toolbar-container">
- <div class="toolbar">
- <form class="pure-form pure-form-stacked">
- <div class="pure-g">
- <div class="pure-u-1">
- <xsl:for-each
select="//down-toolbar/fields/field">
- <xsl:choose>
- <xsl:when
test="type = 'date-picker'">
- <td
valign="top">
- <div>
-
<input id="filter_{name}" name="filter_{name}" type="text"></input>
- </div>
- </td>
- </xsl:when>
- <xsl:when
test="type='button'">
- <button
id="{id}" type="{type}" class="pure-button pure-button-primary"
onclick="{action}"><xsl:value-of select="value"/></button>
- </xsl:when>
- <xsl:when
test="type='label'">
-
<xsl:value-of select="value"/>
- </xsl:when>
- <xsl:otherwise>
- <input
id="{id}" type="{type}" name="{name}" value="{value}">
-
<xsl:if test="type = 'checkbox' and checked = '1'">
-
<xsl:attribute name="checked">checked</xsl:attribute>
-
</xsl:if>
- </input>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </div>
- </div>
- </form>
- </div>
- </div>
-</xsl:template-->
-
-<xsl:template name="datasource-definition">
-
-
- <table id="datatable-container" class="display cell-border compact
responsive no-wrap" width="100%">
- <thead>
- <xsl:for-each select="//datatable/field">
- <xsl:choose>
- <xsl:when test="hidden">
- <xsl:if test="hidden
=0">
- <th>
-
<xsl:value-of select="label"/>
- </th>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <th>
- <xsl:value-of
select="label"/>
- </th>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </thead>
- <tfoot>
- <tr>
- <xsl:for-each select="//datatable/field">
- <xsl:choose>
- <xsl:when test="hidden">
- <xsl:if test="hidden
=0">
- <th>
-
<xsl:value-of select="value_footer"/>
- </th>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <th>
- <xsl:value-of
select="value_footer"/>
- </th>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </tr>
- </tfoot>
- </table>
- <form id="custom_values_form" name="custom_values_form"></form>
- <script>
-
- var columns = [
- <xsl:for-each select="//datatable/field">
- {
- data: "<xsl:value-of
select="key"/>",
- <xsl:if test="className">
- <xsl:choose>
- <xsl:when
test="className='right' or className='center'">
- <xsl:if
test="className ='right'">
- class:
'dt-right',
- </xsl:if>
- <xsl:if
test="className ='center'">
- class:
'dt-center',
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- class:
"<xsl:value-of select="className"/>",
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- orderable: <xsl:value-of
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
- <xsl:choose>
- <xsl:when test="hidden">
- <xsl:if test="hidden
=0">
- visible
:true,
- </xsl:if>
- <xsl:if test="hidden
=1">
- class:
'none', //FIXME - virker ikke...'responsive' plukker den fram igjen
- visible
:false,
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- visible
:true,
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="formatter">
- render: function (dummy1, dummy2,
oData) {
- try {
- var ret =
<xsl:value-of select="formatter"/>("<xsl:value-of select="key"/>", oData);
- }
- catch(err) {
- return
err.message;
- }
- return ret;
- },
-
- </xsl:if>
- <xsl:choose>
- <xsl:when test="editor">
- <xsl:if test="editor
=0">
- editor: false,
- </xsl:if>
- <xsl:if test="editor
=1">
- editor: true,
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- editor: false,
- </xsl:otherwise>
- </xsl:choose>
- defaultContent: "<xsl:value-of
select="defaultContent"/>"
- }<xsl:value-of
select="phpgw:conditional(not(position() = last()), ',', '')"/>
- </xsl:for-each>
- ];
-<![CDATA[
- JqueryPortico.columns = [];
-
- for(i=0;i < columns.length;i++)
- {
- if ( columns[i]['visible'] == true )
- {
- JqueryPortico.columns.push(columns[i]);
- }
- }
-// console.log(JqueryPortico.columns);
-]]>
- </script>
-
- <script type="text/javascript" class="init">
-
- var oTable = null;
- $(document).ready(function() {
-
- var ajax_url = '<xsl:value-of select="source"/>';
- var download_url = '<xsl:value-of select="download"/>';
- var exclude_colvis = [];
- var editor_cols = [];
- var editor_action = '<xsl:value-of
select="editor_action"/>';
- var disablePagination = '<xsl:value-of
select="disablePagination"/>';
-
-<![CDATA[
- TableTools.BUTTONS.download = {
- "sAction": "text",
- "sTag": "default",
- "sFieldBoundary": "",
- "sFieldSeperator": "\t",
- "sNewLine": "<br>",
- "sToolTip": "",
- "sButtonClass": "DTTT_button_text",
- "sButtonClassHover": "DTTT_button_text_hover",
- "sButtonText": "Download",
- "mColumns": "all",
- "bHeader": true,
- "bFooter": true,
- "sDiv": "",
- "fnMouseover": null,
- "fnMouseout": null,
- "fnClick": function( nButton, oConfig ) {
- var oParams =
this.s.dt.oApi._fnAjaxParameters( this.s.dt );
- oParams.length = -1;
- oParams.columns = null;
- oParams.start = null;
- oParams.draw = null;
- var iframe =
document.createElement('iframe');
- iframe.style.height = "0px";
- iframe.style.width = "0px";
- iframe.src =
oConfig.sUrl+"?"+$.param(oParams) + "&export=1";
- if(confirm("This will take some
time..."))
- {
- document.body.appendChild(
iframe );
- }
- },
- "fnSelect": null,
- "fnComplete": null,
- "fnInit": null
- };
- ]]>
- <xsl:choose>
- <xsl:when test="//datatable/actions">
- JqueryPortico.TableTools =
{
- "sSwfPath":
"phpgwapi/js/DataTables/extensions/TableTools/swf/copy_csv_xls_pdf.swf",
- "sRowSelect":
"multi",
- "aButtons":
- [
-
{
-
"sExtends": "collection",
-
"sButtonText": "Operation",
-
"aButtons": [
-
'copy',
-
{
-
sExtends: 'select_all',
-
//sButtonText: 'Select All',
-
fnClick: function (nButton, oConfig,
oFlash) {
-
TableTools.fnGetInstance('datatable-container').fnSelectAll();
-
//In case there are checkboxes
-
$(".mychecks").each(function()
-
{
-
$(this).prop("checked", true);
-
});
-
-
}
-
},
-
{
-
sExtends: 'select_none',
-
//sButtonText: 'Select None',
-
fnClick: function (nButton, oConfig,
oFlash) {
-
TableTools.fnGetInstance('datatable-container').fnSelectNone();
-
//In case there are checkboxes
-
$(".mychecks").each(function()
-
{
-
$(this).prop("checked", false);
-
});
-
-
}
-
}
-
<xsl:choose>
-
<xsl:when test="download">
-
,{
-
"sExtends": "download",
-
"sButtonText": "Download",
-
"sUrl": '<xsl:value-of select="download"/>'
-
}
-
</xsl:when>
-
</xsl:choose>
-
<xsl:choose>
-
<xsl:when test="//datatable/actions != ''">
-
,
-
{
-
sExtends: "div",
-
sButtonText: "Knapper nedenfor gjelder pr valgt
element "
-
},
-
<xsl:for-each select="//datatable/actions">
-
<xsl:choose>
-
<xsl:when test="type = 'custom'">
-
{
-
sExtends:
"select",
-
sButtonText:
"<xsl:value-of select="text"/>",
-
fnClick:
function (nButton, oConfig, oFlash) {
-
-
<xsl:if test="confirm_msg">
-
var confirm_msg = "<xsl:value-of
select="confirm_msg"/>";
-
var r = confirm(confirm_msg);
-
if (r != true) {
-
return false;
-
}
-
</xsl:if>
-
-
<xsl:value-of select="custom_code"/>
-
}
-
-
}<xsl:value-of
select="phpgw:conditional(not(position() = last()), ',', '')"/>
-
</xsl:when>
-
<xsl:otherwise>
-
{
-
sExtends:
"select",
-
sButtonText:
"<xsl:value-of select="text"/>",
-
fnClick:
function (nButton, oConfig, oFlash) {
-
var receiptmsg = [];
-
var selected = fnGetSelected();
-
var numSelected = selected.length;
-
-
if (numSelected ==0){
-
alert('None selected');
-
return false;
-
}
-
-
<xsl:if test="confirm_msg">
-
var confirm_msg = "<xsl:value-of select="confirm_msg"/>";
-
var r = confirm(confirm_msg);
-
if (r != true) {
-
return false;
-
}
-
</xsl:if>
-
-
var target = "<xsl:value-of select="target"/>";
-
if(!target)
-
{
-
target = '_self';
-
}
-
-
if (numSelected > 1){
-
target = '_blank';
-
}
-
-
var n = 0;
-
for (; n < numSelected; ) {
-
-
//
console.log(selected[n]);
-
var aData = oTable.fnGetData( selected[n] ); //complete dataset
from json returned from server
-
//
console.log(aData);
-
-
//delete stuff comes here
-
var action = "<xsl:value-of select="action"/>";
-
-
<xsl:if test="parameters">
-
var parameters = <xsl:value-of select="parameters"/>;
-
//
console.log(parameters.parameter);
-
var i = 0;
-
len = parameters.parameter.length;
-
for (; i < len; ) {
-
action += '&' +
parameters.parameter[i]['name'] + '=' +
aData[parameters.parameter[i]['source']];
-
i++;
-
}
-
</xsl:if>
-
-
// look for the word "DELETE" in URL
-
if(substr_count(action,'delete')>0)
-
{
-
action +=
"&confirm=yes&phpgw_return_as=json";
-
execute_ajax(action, function(result){
-
document.getElementById("message").innerHTML += '<br/>' + result;
-
});
-
oTable.fnDraw();
-
}
-
else if (target == 'ajax')
-
{
-
action += "&phpgw_return_as=json";
-
execute_ajax(action, function(result){
-
document.getElementById("message").innerHTML += '<br/>' + result;
-
});
-
oTable.fnDraw();
-
}
-
else
-
{
-
window.open(action,target);
-
}
-
-
n++;
-
}
-
}
-
-
}<xsl:value-of
select="phpgw:conditional(not(position() = last()), ',', '')"/>
-
</xsl:otherwise>
-
</xsl:choose>
-
</xsl:for-each>
-
</xsl:when>
-
</xsl:choose>
-
]
-
}
- ]
- };
-
-
-
- </xsl:when>
- <xsl:otherwise>
- JqueryPortico.TableTools = false;
- </xsl:otherwise>
- </xsl:choose>
-<![CDATA[
-
- for(i=0;i < JqueryPortico.columns.length;i++)
- {
- if (JqueryPortico.columns[i]['visible'] !=
'undefined' && JqueryPortico.columns[i]['visible'] == false)
- {
- exclude_colvis.push(i);
- }
- }
-
- for(i=0;i < JqueryPortico.columns.length;i++)
- {
- if (JqueryPortico.columns[i]['editor'] === true)
- {
-
editor_cols.push({sUpdateURL:editor_action + '&field_name=' +
JqueryPortico.columns[i]['data']});
- } else {
- editor_cols.push(null);
- }
- }
-
- if(JqueryPortico.TableTools)
- {
- var sDom_def =
'lCT<"clear">f<"top"ip>rt<"bottom"><"clear">';
- }
- else
- {
- var sDom_def = '<"clear">lfrtip';
- }
-
- $(document).ready(function() {
-
- oTable = $('#datatable-container').dataTable( {
- paginate: disablePagination ?
false : true,
- filter: true,
- processing: true,
- serverSide: true,
- responsive: true,
- deferRender: true,
- ajax: {
- url: ajax_url,
- data: {},
- type: 'GET'
- },
- fnRowCallback: function(nRow, aData,
iDisplayIndex, iDisplayIndexFull) {
-
if(typeof(aData['priority'])!= undefined && aData['priority'] > 0)
- {
-
//nRow.addClass(''),
-
console.log(nRow),
- $('td',
nRow).addClass('priority' + aData['priority']);
- }
- },
- fnDrawCallback: function () {
- oTable.makeEditable({
- sUpdateURL:
editor_action,
- fnOnEditing:
function(input){
- cell =
input.parents("td");
- id =
input.parents("tr")
-
.children("td:first")
-
.text();
- return true;
- },
- fnOnEdited:
function(status, sOldValue, sNewCellDisplayValue, aPos0, aPos1, aPos2)
- {
-
document.getElementById("message").innerHTML += '<br/>' + status;
- },
- oUpdateParameters: {
- "id":
function(){ return id; }
- },
- aoColumns: editor_cols,
- sSuccessResponse: "IGNORE",
- fnShowError:
function(){ return; }
- });
- if(typeof(addFooterDatatable) ==
'function')
- {
- addFooterDatatable(oTable);
- }
- },
- fnFooterCallback: function ( nRow, aaData,
iStart, iEnd, aiDisplay ) {
- if(typeof(addFooterDatatable2) ==
'function')
- {
- addFooterDatatable2(nRow,
aaData, iStart, iEnd, aiDisplay,oTable);
- }
- },//alternative
- fnInitComplete: function (oSettings, json)
- {
- if(typeof(initCompleteDatatable) ==
'function')
- {
-
initCompleteDatatable(oSettings, json, oTable);
- }
- },
- lengthMenu:
JqueryPortico.i18n.lengthmenu(),
- language:
JqueryPortico.i18n.datatable(),
- columns: JqueryPortico.columns,
- colVis: {
- exclude:
exclude_colvis
- },
- dom: sDom_def,
- stateSave: true,
- stateDuration: -1, //sessionstorage
- tabIndex: 1,
- oTableTools: JqueryPortico.TableTools
- } );
-
-});
-
- ]]>
-
- /**
- * Add left click action..
- */
- <xsl:if test="//left_click_action != ''">
- $("#datatable-container").on("click", "tbody
tr", function() {
- var iPos = oTable.fnGetPosition( this );
- var aData = oTable.fnGetData( iPos );
//complete dataset from json returned from server
- try {
- <xsl:value-of
select="//left_click_action"/>
- }
- catch(err) {
-
document.getElementById("message").innerHTML = err.message;
- }
- });
- </xsl:if>
-
- /**
- * Add dbl click action..
- */
- <xsl:if test="dbl_click_action != ''">
- $("#datatable-container").on("dblclick", "tr",
function() {
- var iPos = oTable.fnGetPosition( this );
- var aData = oTable.fnGetData( iPos );
//complete dataset from json returned from server
- try {
- <xsl:value-of
select="dbl_click_action"/>(aData);
- }
- catch(err) {
-
document.getElementById("message").innerHTML = err.message;
- }
- });
- </xsl:if>
-
- <xsl:for-each select="//form/toolbar/item">
- <xsl:if test="type = 'filter'">
- $('select#<xsl:value-of
select="name"/>').change( function()
- {
- <xsl:value-of select="extra"/>
- filterData('<xsl:value-of
select="name"/>', $(this).val());
- });
- </xsl:if>
- <xsl:if test="type = 'date-picker'">
- var previous_<xsl:value-of
select="id"/>;
- $("#filter_<xsl:value-of
select="id"/>").on('keyup change', function ()
- {
- if ( $.trim($(this).val()) !=
$.trim(previous_<xsl:value-of select="id"/>) )
- {
-
filterData('<xsl:value-of select="id"/>', $(this).val());
- previous_<xsl:value-of
select="id"/> = $(this).val();
- }
- });
- </xsl:if>
- </xsl:for-each>
-
-<![CDATA[
-
- function fnGetSelected( )
- {
- var aReturn = new Array();
- var aTrs = oTable.fnGetNodes();
- for ( var i=0 ; i < aTrs.length ; i++ )
- {
- if ( $(aTrs[i]).hasClass('selected') )
- {
- aReturn.push( i );
- }
- }
- return aReturn;
- }
-
- function execute_ajax(requestUrl, callback, data,type,
dataType)
- {
- type = typeof type !== 'undefined' ? type :
'POST';
- dataType = typeof dataType !== 'undefined' ?
dataType : 'html';
- data = typeof data !== 'undefined' ? data : {};
-
- $.ajax({
- type: type,
- dataType: dataType,
- data: data,
- url: requestUrl,
- success: function(result) {
- callback(result);
- }
- });
- }
-
- function substr_count( haystack, needle, offset, length
)
- {
- var pos = 0, cnt = 0;
-
- haystack += '';
- needle += '';
- if(isNaN(offset)) offset = 0;
- if(isNaN(length)) length = 0;
- offset--;
-
- while( (offset = haystack.indexOf(needle,
offset+1)) != -1 )
- {
- if(length > 0 && (offset+needle.length)
> length)
- {
- return false;
- } else
- {
- cnt++;
- }
- }
- return cnt;
- }
-
-
- } );
-
- function searchData(query)
- {
- var api = oTable.api();
- api.search( query ).draw();
- }
-
- function filterData(param, value)
- {
- oTable.dataTableSettings[0]['ajax']['data'][param] =
value;
- oTable.fnDraw();
- }
-
- function clearFilterParam(param)
- {
- oTable.dataTableSettings[0]['ajax']['data'][param] = '';
- }
-
- function reloadData()
- {
- var api = oTable.api();
- api.ajax.reload();
- }
-]]>
- </script>
-
- <script>
- <xsl:choose>
- <xsl:when test="//js_lang != ''">
- var lang = <xsl:value-of select="//js_lang"/>;
- </xsl:when>
- </xsl:choose>
- </script>
-
-</xsl:template>
Deleted: branches/dev-syncromind/property/templates/base/uiinvestment.index.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/uiinvestment.index.xsl
2015-12-11 16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/property/templates/base/uiinvestment.index.xsl
2015-12-13 13:39:04 UTC (rev 14583)
@@ -1,970 +0,0 @@
-<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">
- <xsl:choose>
- <xsl:when test="datatable_name">
- <h3>
- <xsl:value-of select="datatable_name"/>
- </h3>
- </xsl:when>
- </xsl:choose>
- <xsl:call-template name="datatable" />
-</xsl:template>
-
-
-<xsl:template name="datatable">
- <xsl:call-template name="jquery_phpgw_i18n"/>
- <xsl:apply-templates select="form" />
- <div id="list_flash">
- <xsl:call-template name="msgbox"/>
- </div>
- <div id="message" class='message'/>
- <xsl:apply-templates select="datatable"/>
- <xsl:apply-templates select="form/list_actions"/>
-</xsl:template>
-
-<xsl:template match="toolbar" xmlns:php="http://php.net/xsl">
- <style id='toggle-box-css' type='text/css' scoped='scoped'>
-.toggle-box {
- display: none;
-}
-
-.toggle-box + label {
- cursor: pointer;
- display: block;
- font-weight: bold;
- line-height: 21px;
- margin-bottom: 5px;
-}
-
-.toggle-box + label + div {
- display: none;
- margin-bottom: 10px;
-}
-
-.toggle-box:checked + label + div {
- display: block;
-}
-
-.toggle-box + label:before {
- background-color: #4F5150;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- border-radius: 10px;
- color: #FFFFFF;
- content: "+";
- display: block;
- float: left;
- font-weight: bold;
- height: 20px;
- line-height: 20px;
- margin-right: 5px;
- text-align: center;
- width: 20px;
-}
-
-.toggle-box:checked + label:before {
- content: "\2212";
-}
-
- </style>
-
- <input class="toggle-box" id="header1" type="checkbox" />
- <label for="header1">
- <xsl:value-of select="php:function('lang', 'toolbar')"/>
- </label>
-
- <div id="toolbar">
- <!--xsl:if test="item/text and normalize-space(item/text)"-->
- <xsl:if test="item">
- <table id="toolbar_table" class="pure-table">
- <thead>
- <tr>
- <th>
- <xsl:value-of
select="php:function('lang', 'name')"/>
- </th>
- <th>
- <xsl:value-of
select="php:function('lang', 'item')"/>
- </th>
- </tr>
- </thead>
- <tbody>
-
- <xsl:for-each select="item">
- <tr>
- <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')"/>
- <td>
- <xsl:if test="name">
- <label>
- <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:choose>
- <xsl:when test="type = 'date-picker'">
- <td valign="top">
- <div>
- <input id="filter_{name}"
name="filter_{name}" type="text"></input>
- </div>
- </td>
- </xsl:when>
- <xsl:when test="type = 'autocomplete'">
- <td class="auto">
- <div class="auto">
- <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">
-
$(document).ready(function() {
- var app =
"<xsl:value-of select="app"/>";
- var name =
"<xsl:value-of select="name"/>";
- var ui =
"<xsl:value-of select="ui"/>";
- var depends =
false;
- var
filter_depends = "";
- var
filter_selected = "";
- <xsl:if test="depends">
- depends =
"<xsl:value-of select="depends"/>";
-
//filter_depends = $('#filer_'+depends+'_id').val();
-
$("#filter_"+depends+"_name").on("autocompleteselect", function(event, i){
- var
filter_select = i.item.value;
-
filter_depends = i.item.value;
- if
(filter_select != filter_selected){
-
if (filter_depends) {
-
<![CDATA[
-
JqueryPortico.autocompleteHelper('index.php?menuaction=booking.ui'+ui+'.index&phpgw_return_as=json&filter_'+depends+'_id='+filter_depends+'&',
-
'filter_'+name+'_name', 'filter_'+name+'_id',
'filter_'+name+'_container');
-
]]>
-
}
-
oTable.dataTableSettings[0]['ajax']['data']['filter_'+name+'_id'] = "";
-
$('#filter_'+name+'_name').val('');
-
$('#filter_'+name+'_id').val('');
-
filter_selected = filter_select;
- }
- });
-
$("#filter_"+depends+"_name").on("keyup", function(){
- if
($(this).val() == ''){
-
filter_depends = false;
-
if (!filter_depends) {
-
<![CDATA[
-
JqueryPortico.autocompleteHelper('index.php?menuaction=booking.ui'+ui+'.index&phpgw_return_as=json&',
-
'filter_'+name+'_name', 'filter_'+name+'_id',
'filter_'+name+'_container');
-
]]>
-
}
-
filter_selected = "";
-
oTable.dataTableSettings[0]['ajax']['data']['filter_'+name+'_id'] = "";
-
$('#filter_'+name+'_name').val('');
-
$('#filter_'+name+'_id').val('');
- }
- });
- </xsl:if>
- if
(filter_depends) {
-
<![CDATA[
-
JqueryPortico.autocompleteHelper('index.php?menuaction=booking.ui'+ui+'.index&phpgw_return_as=json&filter_'+depends+'_id='+filter_depends+'&',
-
'filter_'+name+'_name', 'filter_'+name+'_id', 'filter_'+name+'_container');
- ]]>
- }else{
-
<![CDATA[
-
JqueryPortico.autocompleteHelper('index.php?menuaction=booking.ui'+ui+'.index&phpgw_return_as=json&',
-
'filter_'+name+'_name', 'filter_'+name+'_id', 'filter_'+name+'_container');
- ]]>
- }
- });
- </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}">
- <xsl:for-each select="list">
- <xsl:variable
name="id"><xsl:value-of select="id"/></xsl:variable>
- <xsl:choose>
- <xsl:when
test="id = 'NEW'">
- <option
value="{$id}" selected="selected">
-
<xsl:value-of select="name"/>
-
</option>
- </xsl:when>
- <xsl:otherwise>
-
<xsl:choose>
-
<xsl:when test="selected = 'selected'">
-
<option value="{$id}" selected="selected">
-
<xsl:value-of select="name"/>
-
</option>
-
</xsl:when>
-
<xsl:otherwise>
-
<option value="{$id}">
-
<xsl:value-of select="name"/>
-
</option>
-
</xsl:otherwise>
-
</xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </select>
- </td>
- </xsl:when>
- <xsl:when test="type = 'link'">
- <td valign="top">
- <input type="button"
class="pure-button pure-button-primary">
- <xsl:choose>
- <xsl:when
test="onclick">
-
<xsl:attribute name="onclick"><xsl:value-of select="onclick"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
-
<xsl:attribute name="onclick">javascript:window.open('<xsl:value-of
select="href"/>', "_self");</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute
name="value"><xsl:value-of select="value"/></xsl:attribute>
- </input>
- <!--a href="{href}">
- <xsl:if test="onclick">
- <xsl:attribute
name="onclick">
-
<xsl:value-of select="onclick"/>
-
</xsl:attribute>
- </xsl:if>
- <xsl:value-of
select="value"/>
- </a-->
- </td>
- </xsl:when>
- <xsl:when test="type = 'hidden'">
- <td valign="top">
- <input>
- <xsl:attribute
name="type"><xsl:value-of select="phpgw:conditional(not(type), '',
type)"/></xsl:attribute>
- <xsl:attribute
name="id"><xsl:value-of select="phpgw:conditional(not(id), '',
id)"/></xsl:attribute>
- <xsl:attribute
name="name"><xsl:value-of select="phpgw:conditional(not(name), '',
name)"/></xsl:attribute>
- <xsl:attribute
name="value"><xsl:value-of select="phpgw:conditional(not(value), '',
value)"/></xsl:attribute>
- </input>
- </td>
- </xsl:when>
- <xsl:when test="type = 'label'">
- <td valign="top">
- <label><xsl:attribute
name="id"><xsl:value-of select="phpgw:conditional(not(id), '',
id)"/></xsl:attribute></label>
- </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>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
- </xsl:if>
- </div>
-</xsl:template>
-
-<xsl:template match="form/list_actions">
- <form id="list_actions_form" method="POST">
- <!-- Form action is set by javascript listener -->
- <div id="list_actions" class='yui-skin-sam'>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <xsl:for-each select="item">
- <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>
- </input>
- </td>
- </xsl:for-each>
- </tr>
- </table>
- </div>
- </form>
-</xsl:template>
-
-<xsl:template match="form">
- <div id="queryForm">
- <!--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"/>
- </div>
-
- <!--form id="update_table_dummy" method='POST' action='' >
- </form-->
-
-</xsl:template>
-
-<xsl:template match="datatable">
- <xsl:call-template name="datasource-definition" />
- <xsl:call-template name="down-toolbar" />
-</xsl:template>
-
-<xsl:template name="down-toolbar">
- <div class="toolbar-container">
- <div class="toolbar">
- <form class="pure-form pure-form-stacked">
- <div class="pure-g">
- <div class="pure-u-1">
- <xsl:for-each
select="//down-toolbar/fields/field">
- <xsl:choose>
- <xsl:when
test="type = 'date-picker'">
- <td
valign="top">
-
<div>
-
<input id="filter_{name}" name="filter_{name}" type="text"></input>
-
</div>
- </td>
- </xsl:when>
- <xsl:when
test="type='button'">
- <button
id="{id}" type="{type}" class="pure-button pure-button-primary"
onclick="{action}">
-
<xsl:value-of select="value"/>
-
</button>
- </xsl:when>
- <xsl:when
test="type='label'">
-
<xsl:value-of select="value"/>
- </xsl:when>
- <xsl:otherwise>
- <input
id="{id}" type="{type}" name="{name}" value="{value}">
-
<xsl:if test="type = 'checkbox' and checked = '1'">
-
<xsl:attribute name="checked">checked</xsl:attribute>
-
</xsl:if>
- </input>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </div>
- </div>
- </form>
- </div>
- </div>
-</xsl:template>
-
-<xsl:template name="datasource-definition">
-
-
- <table id="datatable-container" class="display cell-border compact
responsive no-wrap" width="100%">
- <thead>
- <xsl:for-each select="//datatable/field">
- <xsl:choose>
- <xsl:when test="hidden">
- <xsl:if test="hidden =0">
- <th>
- <xsl:value-of
select="label"/>
- </th>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <th>
- <xsl:value-of
select="label"/>
- </th>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </thead>
- <tfoot>
- <tr>
- <xsl:for-each select="//datatable/field">
- <xsl:choose>
- <xsl:when test="hidden">
- <xsl:if test="hidden
=0">
- <th>
-
<xsl:value-of select="value_footer"/>
- </th>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <th>
- <xsl:value-of
select="value_footer"/>
- </th>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </tr>
- </tfoot>
- </table>
- <form id="custom_values_form" name="custom_values_form"></form>
- <script>
-
- var columns = [
- <xsl:for-each select="//datatable/field">
- {
- data: "<xsl:value-of select="key"/>",
- <xsl:if test="className">
- <xsl:choose>
- <xsl:when test="className='right' or
className='center'">
- <xsl:if test="className
='right'">
- class: 'dt-right',
- </xsl:if>
- <xsl:if test="className
='center'">
- class: 'dt-center',
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- class: "<xsl:value-of
select="className"/>",
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- orderable: <xsl:value-of
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
- <xsl:choose>
- <xsl:when test="hidden">
- <xsl:if test="hidden =0">
- visible :true,
- </xsl:if>
- <xsl:if test="hidden =1">
- class: 'none',
//FIXME - virker ikke...'responsive' plukker den fram igjen
- visible :false,
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- visible :true,
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="formatter">
- render: function (dummy1, dummy2, oData) {
- try {
- var ret = <xsl:value-of
select="formatter"/>("<xsl:value-of select="key"/>", oData);
- }
- catch(err) {
- return err.message;
- }
- return ret;
- },
-
- </xsl:if>
- <xsl:choose>
- <xsl:when test="editor">
- <xsl:if test="editor =0">
- editor: false,
- </xsl:if>
- <xsl:if test="editor =1">
- editor: true,
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- editor: false,
- </xsl:otherwise>
- </xsl:choose>
- defaultContent: "<xsl:value-of
select="defaultContent"/>"
- }<xsl:value-of select="phpgw:conditional(not(position()
= last()), ',', '')"/>
- </xsl:for-each>
- ];
-<![CDATA[
- JqueryPortico.columns = [];
-
- for(i=0;i < columns.length;i++)
- {
- if ( columns[i]['visible'] == true )
- {
- JqueryPortico.columns.push(columns[i]);
- }
- }
-// console.log(JqueryPortico.columns);
-]]>
- </script>
-
- <script type="text/javascript" class="init">
-
- var oTable = null;
- $(document).ready(function() {
-
- var ajax_url = '<xsl:value-of select="source"/>';
- var download_url = '<xsl:value-of select="download"/>';
- var exclude_colvis = [];
- var editor_cols = [];
- var editor_action = '<xsl:value-of select="editor_action"/>';
- var disablePagination = '<xsl:value-of
select="disablePagination"/>';
-
-<![CDATA[
- TableTools.BUTTONS.download = {
- "sAction": "text",
- "sTag": "default",
- "sFieldBoundary": "",
- "sFieldSeperator": "\t",
- "sNewLine": "<br>",
- "sToolTip": "",
- "sButtonClass": "DTTT_button_text",
- "sButtonClassHover": "DTTT_button_text_hover",
- "sButtonText": "Download",
- "mColumns": "all",
- "bHeader": true,
- "bFooter": true,
- "sDiv": "",
- "fnMouseover": null,
- "fnMouseout": null,
- "fnClick": function( nButton, oConfig ) {
- var oParams =
this.s.dt.oApi._fnAjaxParameters( this.s.dt );
- oParams.length = -1;
- oParams.columns = null;
- oParams.start = null;
- oParams.draw = null;
- var iframe =
document.createElement('iframe');
- iframe.style.height = "0px";
- iframe.style.width = "0px";
- iframe.src =
oConfig.sUrl+"?"+$.param(oParams) + "&export=1";
- if(confirm("This will take some
time..."))
- {
- document.body.appendChild(
iframe );
- }
- },
- "fnSelect": null,
- "fnComplete": null,
- "fnInit": null
- };
- ]]>
- <xsl:choose>
- <xsl:when test="//datatable/actions">
- JqueryPortico.TableTools = {
- "sSwfPath":
"phpgwapi/js/DataTables/extensions/TableTools/swf/copy_csv_xls_pdf.swf",
- "sRowSelect": "multi",
- "aButtons":
- [
- {
- "sExtends": "collection",
- "sButtonText": "Operation",
- "aButtons": [
- 'copy',
- {
- sExtends: 'select_all',
- //sButtonText: 'Select All',
- fnClick: function (nButton, oConfig, oFlash) {
-
TableTools.fnGetInstance('datatable-container').fnSelectAll();
- //In case there are checkboxes
- $(".mychecks").each(function()
- {
- $(this).prop("checked", true);
- });
-
- }
- },
- {
- sExtends: 'select_none',
- //sButtonText: 'Select None',
- fnClick: function (nButton, oConfig, oFlash) {
-
TableTools.fnGetInstance('datatable-container').fnSelectNone();
- //In case there are checkboxes
- $(".mychecks").each(function()
- {
- $(this).prop("checked", false);
- });
-
- }
- }
- <xsl:choose>
- <xsl:when test="download">
- ,{
- "sExtends": "download",
- "sButtonText": "Download",
- "sUrl": '<xsl:value-of
select="download"/>'
- }
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="//datatable/actions !=
''">
- ,
- {
- sExtends: "div",
- sButtonText: "Knapper nedenfor
gjelder pr valgt element "
- },
- <xsl:for-each
select="//datatable/actions">
- <xsl:choose>
- <xsl:when
test="type = 'custom'">
- {
-
sExtends: "select",
-
sButtonText: "<xsl:value-of select="text"/>",
-
fnClick: function (nButton, oConfig, oFlash) {
-
- <xsl:if
test="confirm_msg">
-
var confirm_msg = "<xsl:value-of select="confirm_msg"/>";
-
var r = confirm(confirm_msg);
-
if (r != true) {
-
return false;
-
}
-
</xsl:if>
-
-
<xsl:value-of select="custom_code"/>
- }
-
-
}<xsl:value-of select="phpgw:conditional(not(position() = last()), ',', '')"/>
- </xsl:when>
- <xsl:otherwise>
- {
-
sExtends: "select",
-
sButtonText: "<xsl:value-of select="text"/>",
-
fnClick: function (nButton, oConfig, oFlash) {
- var
receiptmsg = [];
- var
selected = fnGetSelected();
- var
numSelected = selected.length;
-
- if
(numSelected ==0){
-
alert('None selected');
- return
false;
- }
-
- <xsl:if
test="confirm_msg">
-
var confirm_msg = "<xsl:value-of select="confirm_msg"/>";
-
var r = confirm(confirm_msg);
-
if (r != true) {
-
return false;
-
}
-
</xsl:if>
-
- var
target = "<xsl:value-of select="target"/>";
-
if(!target)
- {
- target
= '_self';
- }
-
- if
(numSelected > 1){
- target
= '_blank';
- }
-
- var n =
0;
- for (;
n < numSelected; ) {
-
- //
console.log(selected[n]);
- var
aData = oTable.fnGetData( selected[n] ); //complete dataset from json returned
from server
- //
console.log(aData);
-
-
//delete stuff comes here
- var
action = "<xsl:value-of select="action"/>";
-
- <xsl:if
test="parameters">
-
var parameters = <xsl:value-of select="parameters"/>;
-
//
console.log(parameters.parameter);
-
var i = 0;
-
len = parameters.parameter.length;
-
for (; i < len; ) {
-
action += '&' + parameters.parameter[i]['name'] + '=' +
aData[parameters.parameter[i]['source']];
-
i++;
-
}
-
</xsl:if>
-
- // look
for the word "DELETE" in URL
-
if(substr_count(action,'delete')>0)
- {
- action
+= "&confirm=yes&phpgw_return_as=json";
-
execute_ajax(action, function(result){
-
document.getElementById("message").innerHTML += '<br/>' + result;
-
oTable.fnDraw();
- });
- }
- else if
(target == 'ajax')
- {
- action
+= "&phpgw_return_as=json";
-
execute_ajax(action, function(result){
-
document.getElementById("message").innerHTML += '<br/>' + result;
-
oTable.fnDraw();
- });
- }
- else
- {
-
window.open(action,target);
- }
-
- n++;
- }
- }
-
-
}<xsl:value-of select="phpgw:conditional(not(position() = last()), ',', '')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- ]
- }
- ]
- };
-
-
-
- </xsl:when>
- <xsl:otherwise>
- JqueryPortico.TableTools = false;
- </xsl:otherwise>
- </xsl:choose>
-<![CDATA[
-
- for(i=0;i < JqueryPortico.columns.length;i++)
- {
- if (JqueryPortico.columns[i]['visible'] !=
'undefined' && JqueryPortico.columns[i]['visible'] == false)
- {
- exclude_colvis.push(i);
- }
- }
-
- for(i=0;i < JqueryPortico.columns.length;i++)
- {
- if (JqueryPortico.columns[i]['editor'] === true)
- {
-
editor_cols.push({sUpdateURL:editor_action + '&field_name=' +
JqueryPortico.columns[i]['data']});
- } else {
- editor_cols.push(null);
- }
- }
-
- if(JqueryPortico.TableTools)
- {
- var sDom_def =
'lCT<"clear">f<"top"ip>rt<"bottom"><"clear">';
- }
- else
- {
- var sDom_def = '<"clear">lfrtip';
- }
-
- $(document).ready(function() {
-
- oTable = $('#datatable-container').dataTable( {
- paginate: disablePagination ?
false : true,
- filter: false,
- processing: true,
- serverSide: true,
- responsive: true,
- deferRender: true,
- ajax: {
- url: ajax_url,
- data: {},
- type: 'GET'
- },
- fnRowCallback: function(nRow, aData,
iDisplayIndex, iDisplayIndexFull) {
-
if(typeof(aData['priority'])!= undefined && aData['priority'] > 0)
- {
-
//nRow.addClass(''),
-
console.log(nRow),
- $('td',
nRow).addClass('priority' + aData['priority']);
- }
- },
- fnDrawCallback: function () {
- oTable.makeEditable({
- sUpdateURL:
editor_action,
- fnOnEditing:
function(input){
- cell =
input.parents("td");
- id =
input.parents("tr")
-
.children("td:first")
-
.text();
- return true;
- },
- fnOnEdited:
function(status, sOldValue, sNewCellDisplayValue, aPos0, aPos1, aPos2)
- {
-
document.getElementById("message").innerHTML += '<br/>' + status;
- },
- oUpdateParameters: {
- "id":
function(){ return id; }
- },
- aoColumns: editor_cols,
- sSuccessResponse: "IGNORE",
- fnShowError:
function(){ return; }
- });
- if(typeof(addFooterDatatable) ==
'function')
- {
- addFooterDatatable(oTable);
- }
- },
- fnFooterCallback: function ( nRow, aaData,
iStart, iEnd, aiDisplay ) {
- if(typeof(addFooterDatatable2) ==
'function')
- {
- addFooterDatatable2(nRow,
aaData, iStart, iEnd, aiDisplay,oTable);
- }
- },//alternative
- fnInitComplete: function (oSettings, json)
- {
- if(typeof(initCompleteDatatable) ==
'function')
- {
-
initCompleteDatatable(oSettings, json, oTable);
- }
- },
- lengthMenu:
JqueryPortico.i18n.lengthmenu(),
- language:
JqueryPortico.i18n.datatable(),
- columns: JqueryPortico.columns,
- colVis: {
- exclude:
exclude_colvis
- },
- dom: sDom_def,
- stateSave: true,
- stateDuration: -1, //sessionstorage
- tabIndex: 1,
- oTableTools: JqueryPortico.TableTools
- } );
-
-});
-
- ]]>
-
- /**
- * Add left click action..
- */
- <xsl:if test="//left_click_action != ''">
- $("#datatable-container").on("click", "tbody tr",
function() {
- var iPos = oTable.fnGetPosition( this );
- var aData = oTable.fnGetData( iPos ); //complete
dataset from json returned from server
- try {
- <xsl:value-of select="//left_click_action"/>
- }
- catch(err) {
- document.getElementById("message").innerHTML =
err.message;
- }
- });
- </xsl:if>
-
- /**
- * Add dbl click action..
- */
- <xsl:if test="dbl_click_action != ''">
- $("#datatable-container").on("dblclick", "tr",
function() {
- var iPos = oTable.fnGetPosition( this );
- var aData = oTable.fnGetData( iPos ); //complete
dataset from json returned from server
- try {
- <xsl:value-of select="dbl_click_action"/>(aData);
- }
- catch(err) {
- document.getElementById("message").innerHTML =
err.message;
- }
- });
- </xsl:if>
-
- <xsl:for-each select="//form/toolbar/item">
- <xsl:if test="type = 'filter'">
- $('select#<xsl:value-of
select="name"/>').change( function()
- {
- <xsl:value-of select="extra"/>
- filterData('<xsl:value-of select="name"/>',
$(this).val());
- });
- </xsl:if>
- <xsl:if test="type = 'date-picker'">
- var previous_<xsl:value-of select="id"/>;
- $("#filter_<xsl:value-of
select="id"/>").on('keyup change', function ()
- {
- if ( $.trim($(this).val()) !=
$.trim(previous_<xsl:value-of select="id"/>) )
- {
- filterData('<xsl:value-of select="id"/>',
$(this).val());
- previous_<xsl:value-of select="id"/> =
$(this).val();
- }
- });
- </xsl:if>
- </xsl:for-each>
-
-<![CDATA[
-
- function fnGetSelected( )
- {
- var aReturn = new Array();
- var aTrs = oTable.fnGetNodes();
- for ( var i=0 ; i < aTrs.length ; i++ )
- {
- if ( $(aTrs[i]).hasClass('selected') )
- {
- aReturn.push( i );
- }
- }
- return aReturn;
- }
-
- function execute_ajax(requestUrl, callback, data,type,
dataType)
- {
- type = typeof type !== 'undefined' ? type :
'POST';
- dataType = typeof dataType !== 'undefined' ?
dataType : 'html';
- data = typeof data !== 'undefined' ? data : {};
-
- $.ajax({
- type: type,
- dataType: dataType,
- data: data,
- url: requestUrl,
- success: function(result) {
- callback(result);
- }
- });
- }
-
- function substr_count( haystack, needle, offset, length
)
- {
- var pos = 0, cnt = 0;
-
- haystack += '';
- needle += '';
- if(isNaN(offset)) offset = 0;
- if(isNaN(length)) length = 0;
- offset--;
-
- while( (offset = haystack.indexOf(needle,
offset+1)) != -1 )
- {
- if(length > 0 && (offset+needle.length)
> length)
- {
- return false;
- } else
- {
- cnt++;
- }
- }
- return cnt;
- }
-
-
- } );
-
- function searchData(query)
- {
- var api = oTable.api();
- api.search( query ).draw();
- }
-
- function filterData(param, value)
- {
- oTable.dataTableSettings[0]['ajax']['data'][param] =
value;
- oTable.fnDraw();
- }
-
- function clearFilterParam(param)
- {
- oTable.dataTableSettings[0]['ajax']['data'][param] = '';
- }
-
- function reloadData()
- {
- var api = oTable.api();
- api.ajax.reload();
- }
-]]>
- </script>
-
- <script>
- <xsl:choose>
- <xsl:when test="//js_lang != ''">
- var lang = <xsl:value-of select="//js_lang"/>;
- </xsl:when>
- </xsl:choose>
- </script>
-
-</xsl:template>
Modified: branches/dev-syncromind/property/templates/base/wo_hour.index.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/wo_hour.index.xsl
2015-12-11 16:09:45 UTC (rev 14582)
+++ branches/dev-syncromind/property/templates/base/wo_hour.index.xsl
2015-12-13 13:39:04 UTC (rev 14583)
@@ -19,7 +19,7 @@
<xsl:call-template name="top-toolbar" />
<xsl:call-template name="prizebook_table" />
<xsl:call-template name="wo_hour_table" />
- <xsl:call-template name="down-toolbar" />
+ <xsl:call-template name="end-toolbar" />
</xsl:template>
<xsl:template name="top-toolbar">
@@ -65,13 +65,13 @@
</xsl:for-each>
</xsl:template>
-<xsl:template name="down-toolbar">
+<xsl:template name="end-toolbar">
<div class="toolbar-container">
<div class="toolbar">
<form class="pure-form pure-form-stacked">
<div class="pure-g">
<div class="pure-u-1">
- <xsl:for-each
select="//down-toolbar/fields/field">
+ <xsl:for-each
select="//end-toolbar/fields/field">
<xsl:choose>
<xsl:when
test="type='button'">
<button
id="{id}" type="{type}" class="pure-button pure-button-primary"><xsl:value-of
select="value"/></button>
@@ -415,7 +415,7 @@
});
</xsl:if>
- <xsl:for-each select="//down-toolbar/fields/field">
+ <xsl:for-each select="//end-toolbar/fields/field">
<xsl:if test="type = 'button'">
$('#<xsl:value-of
select="id"/>').click( function()
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14583] clean up from yui,
Sigurd Nes <=