fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16788] Backport diff from Syncromind to trunk


From: sigurdne
Subject: [Fmsystem-commits] [16788] Backport diff from Syncromind to trunk
Date: Sat, 27 May 2017 14:56:31 -0400 (EDT)

Revision: 16788
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16788
Author:   sigurdne
Date:     2017-05-27 14:56:31 -0400 (Sat, 27 May 2017)
Log Message:
-----------
Backport diff from Syncromind to trunk

Modified Paths:
--------------
    trunk/property/inc/class.boreport.inc.php
    trunk/property/inc/class.soreport.inc.php
    trunk/property/inc/class.uireport.inc.php
    trunk/property/js/portico/report.edit.js
    trunk/property/templates/base/report.xsl

Property Changed:
----------------
    trunk/
    trunk/booking/
    trunk/bookingfrontend/

Index: trunk
===================================================================
--- trunk       2017-05-27 18:53:04 UTC (rev 16787)
+++ trunk       2017-05-27 18:56:31 UTC (rev 16788)

Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
 /branches/dev-syncromind:13653
-/branches/dev-syncromind-2:14933-16738
+/branches/dev-syncromind-2:14933-16787
 /branches/stavangerkommune:12743-12875,12986
\ No newline at end of property
Index: trunk/booking
===================================================================
--- trunk/booking       2017-05-27 18:53:04 UTC (rev 16787)
+++ trunk/booking       2017-05-27 18:56:31 UTC (rev 16788)

Property changes on: trunk/booking
___________________________________________________________________
Modified: svn:mergeinfo
## -1,2 +1,2 ##
-/branches/dev-syncromind-2/booking:14933-16738
+/branches/dev-syncromind-2/booking:14933-16787
 /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
\ No newline at end of property
Index: trunk/bookingfrontend
===================================================================
--- trunk/bookingfrontend       2017-05-27 18:53:04 UTC (rev 16787)
+++ trunk/bookingfrontend       2017-05-27 18:56:31 UTC (rev 16788)

Property changes on: trunk/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
## -1,2 +1,2 ##
-/branches/dev-syncromind-2/bookingfrontend:14933-16738
+/branches/dev-syncromind-2/bookingfrontend:14933-16787
 /branches/stavangerkommune/bookingfrontend:9468-12740,12986
\ No newline at end of property
Modified: trunk/property/inc/class.boreport.inc.php
===================================================================
--- trunk/property/inc/class.boreport.inc.php   2017-05-27 18:53:04 UTC (rev 
16787)
+++ trunk/property/inc/class.boreport.inc.php   2017-05-27 18:56:31 UTC (rev 
16788)
@@ -40,6 +40,13 @@
                {
                        $this->so = CreateObject('property.soreport');
                        $this->bocommon = CreateObject('property.bocommon');
+                       $this->operators = $this->so->operators;
+                       
+                       $this->operators_equal = $this->so->operators_equal;
+                       $this->operators_between = $this->so->operators_between;
+                       $this->operators_like = $this->so->operators_like;
+                       $this->operators_in = $this->so->operators_in;
+                       $this->operators_null = $this->so->operators_null;      
                
                }
 
                function read_single( $id = '' )

Modified: trunk/property/inc/class.soreport.inc.php
===================================================================
--- trunk/property/inc/class.soreport.inc.php   2017-05-27 18:53:04 UTC (rev 
16787)
+++ trunk/property/inc/class.soreport.inc.php   2017-05-27 18:56:31 UTC (rev 
16788)
@@ -37,6 +37,34 @@
                        $this->left_join = & $this->db->left_join;
                        $this->like = & $this->db->like;                
                        $this->total_records = 0;
+                                       
+                       $this->operators_equal = array(
+                               'equal' => '=', 
+                               'not_equal' => '!=', 
+                               'less' => '<', 
+                               'less_equal' => '<=', 
+                               'greater' => '>', 
+                               'greater_equal' => '>='
+                       );
+                       $this->operators_between = array(
+                               'between' => 'BETWEEN',
+                               'not_between' => 'NOT BETWEEN'
+                       );
+                       $this->operators_like = array(
+                               'like' => 'LIKE', 
+                               'not_like' => 'NOT LIKE', 
+                               'ilike' => 'ILIKE', 
+                               'not_ilike' => 'NOT ILIKE'
+                       );
+                       $this->operators_in = array(
+                               'in' => 'IN', 
+                               'not_in' => 'NOT IN'
+                       );
+                       $this->operators_null = array(
+                               'is_null' => 'IS NULL', 
+                               'is_not_null' => 'IS NOT NULL'
+                       );
+                       $this->operators = array_merge($this->operators_equal, 
$this->operators_between, $this->operators_like, $this->operators_in, 
$this->operators_null);
                }
 
                function read_single ( $id, $values = array() )
@@ -229,6 +257,120 @@
                        return $values;
                }
                
+               private function _is_date( $str ) {
+                       try {
+                               $dt = new DateTime( trim($str) );
+                       }
+                       catch( Exception $e ) {
+                               return false;
+                       }
+                       $month = $dt->format('m');
+                       $day = $dt->format('d');
+                       $year = $dt->format('Y');
+                       if( checkdate($month, $day, $year) ) {
+                               return true;
+                       }
+                       else {
+                               return false;
+                       }
+               }
+
+               private function _build_conditions_equal($param, $type)
+               {               
+                       $result = '';
+                       
+                       switch ($type) 
+                       {
+                               case 'character varying':
+                               case 'text':
+                                       $result = $param['field']." 
".$this->operators[$param['operator']]." '".$param['value1']."'";
+                                       if ($param['conector'] && 
$param['value2'] != '')
+                                       {
+                                               $result .= " 
".$param['conector']." ".$param['field']." 
".$this->operators[$param['operator']]." '".$param['value2']."'";
+                                       }
+                                       break;
+                               case 'integer':
+                               case 'smallint':
+                               case 'numeric':
+                                       if (is_numeric($param['value1']))
+                                       {
+                                               $result = $param['field']." 
".$this->operators[$param['operator']]." ".$param['value1'];
+                                               if ($param['conector'] && 
is_numeric(['value2']))
+                                               {
+                                                       $result .= " 
".$param['conector']." ".$param['field']." 
".$this->operators[$param['operator']]." ".$param['value2'];
+                                               }
+                                       }
+                                       break;
+                               case 'date':
+                               case 'timestamp without time zone':
+                                       if ($this->_is_date($param['value1']))
+                                       {
+                                               $result = $param['field']." 
".$this->operators[$param['operator']]." '".$param['value1']."'";
+                                               if ($param['conector'] && 
$this->_is_date($param['value2']))
+                                               {
+                                                       $result .= " 
".$param['conector']." ".$param['field']." 
".$this->operators[$param['operator']]." '".$param['value1']."'";
+                                               }
+                                       }
+                       }                               
+               
+                       return $result;
+               }
+               
+               private function _build_conditions($criteria, $id)
+               {
+                       $columns = $this->get_view_columns($id);
+                       $_columns = array();
+                       foreach ($columns as $column)
+                       {
+                               $_columns[$column['name']] = $column['type'];
+                       }
+                       
+                       $where = array();
+                       foreach ($criteria as $param)
+                       {
+                               switch (true) 
+                               {
+                                       case 
(array_key_exists($param['operator'], $this->operators_equal)):
+                                               $result =  
$this->_build_conditions_equal($param, $_columns[$param['field']]);
+                                               break;
+                                       case 
(array_key_exists($param['operator'], $this->operators_between)):
+                                               if ($param['value1'] != '' && 
$param['value2'] != '')
+                                               {
+                                                       $result =  
$param['field']."::text ".$this->operators[$param['operator']]." 
'".$param['value1']."' AND '".$param['value2']."'";
+                                               }
+                                               break;
+                                       case 
(array_key_exists($param['operator'], $this->operators_like)):
+                                               if ($param['value1'] != '')
+                                               {
+                                                       $result =  
$param['field']."::text ".$this->operators[$param['operator']]." 
'%".$param['value1']."%'";
+                                                       if ($param['conector'] 
&& $param['value2'] != '')
+                                                       {
+                                                               $result .= " 
".$param['conector']." ".$param['field']."::text 
".$this->operators[$param['operator']]." '%".$param['value2']."%'";
+                                                       }                       
                                
+                                               }
+                                               break;
+                                       case 
(array_key_exists($param['operator'], $this->operators_null)):
+                                               $result =  $param['field']." 
".$this->operators[$param['operator']];
+                                               break;
+                                       case 
(array_key_exists($param['operator'], $this->operators_in)):
+                                               if ($param['value1'] != '')
+                                               {
+                                                       $values = 
array_map('trim', explode(',', $param['value1']));
+                                                       $_string = 
"'".implode("','", $values)."'";
+                                                       $result =  
$param['field']."::text ".$this->operators[$param['operator']]." 
(".$_string.")";
+                                               }
+                                               break;
+                               }               
+                               
+                               if ($result)
+                               {
+                                       $where[] = $result;
+                               }
+                       }
+                       
+                       return $where;
+               }
+               
                function read_to_export ( $id, $data = array() )
                {
                        $id = (int)$id;
@@ -237,19 +379,25 @@
                        {
                                $dataset = $this->read_single_dataset($id);
                                $jsonB = $data;
-                       } 
+                       }
                        else {
                                $definition = $this->read_single($id);
                                $dataset = 
$this->read_single_dataset($definition['dataset_id']);                          
     
                                $jsonB = 
json_decode($definition['report_definition'], true);
                        }
-       
+
                        $string_columns = implode(',', $jsonB['columns']);
                        
                        $group = implode(',', $jsonB['group']);
                        $order = 'ORDER BY '.$group.' ASC';
+                       $cond = $this->_build_conditions($jsonB['criteria'], 
$id);
                        
-                       $sql = "SELECT ".$string_columns." FROM 
".$dataset['view_name']." ".$order;
+                       if ($cond)
+                       {
+                               $where = 'WHERE '.implode(' AND ', $cond);
+                       }
+                       
+                       $sql = "SELECT ".$string_columns." FROM 
".$dataset['view_name']." ".$where." ".$order;
 
                        if (count($data))
                        {

Modified: trunk/property/inc/class.uireport.inc.php
===================================================================
--- trunk/property/inc/class.uireport.inc.php   2017-05-27 18:53:04 UTC (rev 
16787)
+++ trunk/property/inc/class.uireport.inc.php   2017-05-27 18:56:31 UTC (rev 
16788)
@@ -47,6 +47,7 @@
                        'save_dataset' => true,
                        'delete_dataset' => true,
                        'get_column_preview' => true,
+                       'get_operators' => true,
                        'preview' => true,
                        'download' => true
                );
@@ -59,6 +60,13 @@
                        $this->bo = CreateObject('property.boreport', true);
                        $this->bocommon = & $this->bo->bocommon;
                        $this->acl = & $GLOBALS['phpgw']->acl;                  
+                       $this->operators = $this->bo->operators;
+                       
+                       $this->operators_equal = $this->bo->operators_equal;
+                       $this->operators_between = $this->bo->operators_between;
+                       $this->operators_like = $this->bo->operators_like;
+                       $this->operators_in = $this->bo->operators_in;
+                       $this->operators_null = $this->bo->operators_null;      
                        
                }
 
                public function download()
@@ -334,6 +342,14 @@
                                'cancel_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uireport.index')),
                                'datasets' => array('options' => $list),
                                'report_definition' => 
$values['report_definition'],
+                               'operators' => json_encode($this->operators),
+                               
+                               'operators_equal' => 
json_encode($this->operators_equal),
+                               'operators_between' => 
json_encode($this->operators_between),
+                               'operators_like' => 
json_encode($this->operators_like),
+                               'operators_in' => 
json_encode($this->operators_in),
+                               'operators_null' => 
json_encode($this->operators_null),         
+                               
                                'report_id' => $values['id'],
                                'report_name' => $values['report_name'],
                                'msgbox_data' => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
@@ -360,7 +376,22 @@
                        $order_by = phpgw::get_var('order');
                        $aggregate = phpgw::get_var('aggregate');
                        $cbo_aggregate = phpgw::get_var('cbo_aggregate');
-       
+                       
+                       $restricted_values = 
phpgw::get_var('cbo_restricted_value');
+                       $operators = phpgw::get_var('cbo_operator');
+                       $values_1 = phpgw::get_var('txt_value1');
+                       $conector = phpgw::get_var('cbo_conector');
+                       $values_2 = phpgw::get_var('txt_value2');
+                       
+                       $criteria = array();
+                       foreach ($restricted_values as $k => $field) 
+                       {
+                               if ($field && $operators[$k])
+                               {
+                                       $criteria[] = array('field'=>$field, 
'operator'=>$operators[$k], 'value1'=>trim($values_1[$k]), 
'conector'=>$conector[$k], 'value2'=>trim($values_2[$k]));
+                               }
+                       }
+                       
                        $group = array($group_by => $group_by);
                        $order = array($order_by => $order_by);
                        
@@ -398,6 +429,7 @@
                        $values['report_definition']['order'] = $order;
                        $values['report_definition']['aggregate'] = $aggregate;
                        $values['report_definition']['cbo_aggregate'] = 
$cbo_aggregate;
+                       $values['report_definition']['criteria'] = $criteria;
                        //$values['report_definition']['txt_aggregate'] = 
$txt_aggregate;
                        $values['dataset_id'] = $dataset_id;
 
@@ -708,7 +740,7 @@
                        }
                        $html_table .= '</table>';
                        
-                       return array('columns_preview' => $html_table);
+                       return array('columns_preview' => $html_table, 
'columns' => $columns);
                }
                
                public function preview()
@@ -722,6 +754,22 @@
                        $data['aggregate'] = $values['aggregate'];
                        $data['cbo_aggregate'] = $values['cbo_aggregate'];      
        
 
+                       $restricted_values = $values['cbo_restricted_value'];
+                       $operators = $values['cbo_operator'];
+                       $values_1 = $values['txt_value1'];
+                       $conector = $values['cbo_conector'];
+                       $values_2 = $values['txt_value2'];
+                       
+                       $criteria = array();
+                       foreach ($restricted_values as $k => $field) 
+                       {
+                               if ($field && $operators[$k])
+                               {
+                                       $criteria[] = array('field'=>$field, 
'operator'=>$operators[$k], 'value1'=>trim($values_1[$k]), 
'conector'=>$conector[$k], 'value2'=>trim($values_2[$k]));
+                               }
+                       }
+                       $data['criteria'] = $criteria;
+                       
                        $list = $this->bo->read_to_export($dataset_id, $data);
                        
                        $html_table = '<table class="pure-table 
pure-table-bordered">';
@@ -742,4 +790,27 @@
                        
                }
                
+               public function get_operators()
+               {
+                       $operators = array(
+                               'equal' => '=', 
+                               'different' => '!=', 
+                               'less' => '<', 
+                               'less_equal' => '<=', 
+                               'higher' => '>', 
+                               'higher_equal' => '>=', 
+                               'between' => 'BETWEEN', 
+                               'like' => 'LIKE', 
+                               'not_like' => 'NOT LIKE', 
+                               'ilike' => 'ILIKE', 
+                               'not_ilike' => 'NOT ILIKE', 
+                               'in' => 'IN', 
+                               'not_in' => 'NOT IN', 
+                               'not_between' => 'NOT BETWEEN', 
+                               'is_null' => 'IS NULL', 
+                               'is_not_null' => 'IS NOT NULL'
+                       );
+                       
+                       return $operators;
+               }
        }
\ No newline at end of file

Modified: trunk/property/js/portico/report.edit.js
===================================================================
--- trunk/property/js/portico/report.edit.js    2017-05-27 18:53:04 UTC (rev 
16787)
+++ trunk/property/js/portico/report.edit.js    2017-05-27 18:56:31 UTC (rev 
16788)
@@ -28,9 +28,23 @@
                        $('#container_groups').empty();
                        $('#container_order').empty();
                        $('#container_aggregates').empty();
+                       $('#container_criteria').empty();
                        
                        $('#container_columns').html(result.columns_preview);
+                       $('#responsiveTabsGroups').responsiveTabs('activate', 
0);
                        
+                       columns = result.columns;
+                       
+                       var row = '<span style="display:table-row;">\n\
+                                               <span 
style="display:table-cell;">Restricted value</span>\n\
+                                               <span 
style="display:table-cell;">Operator</span>\n\
+                                               <span 
style="display:table-cell;">Value</span>\n\
+                                               <span 
style="display:table-cell;">Conector</span>\n\
+                                               <span 
style="display:table-cell;">Value</span>\n\
+                               </span>';
+                       $('#container_criteria').append(row);
+                       n = 0;
+               
                        if (jsonB !== '')
                        {
                                set_values();
@@ -58,6 +72,11 @@
                values['order'] = {};
                values['aggregate'] = {};
                values['cbo_aggregate'] = {};
+               values['cbo_restricted_value'] = {};
+               values['cbo_operator'] = {};
+               values['txt_value1'] = {};
+               values['cbo_conector'] = {};
+               values['txt_value2'] = {};
                
                $('input[name^="columns"]').each(function() {
 
@@ -113,7 +132,29 @@
                        alert('Choose COUNT/SUM option');                       
                        return;
                }
+                               
+               var idx = 0;
+               var size = 0;
+               $('.criteria').each(function() 
+               {
+                       idx = $(this).val();
+                       if ($('#cbo_restricted_value_' + idx).val())
+                       {
+                               values['cbo_restricted_value'][idx] = 
$('#cbo_restricted_value_' + idx).val();
+                               values['cbo_operator'][idx] = 
$('#cbo_operator_' + idx).val();
+                               values['txt_value1'][idx] = $('#txt_value1_' + 
idx).val();
+                               values['cbo_conector'][idx] = 
$('#cbo_conector_' + idx).val();
+                               values['txt_value2'][idx] = $('#txt_value2_' + 
idx).val();
+                               size ++;
+                       }
+               });
                
+               if (size && !validate_criteria(values))
+               {
+                       $('#responsiveTabsGroups').responsiveTabs('activate', 
4);
+                       return;
+               }
+               
                var data = {"values": values, "dataset_id": 
$('#cbo_dataset_id').val()};
                $('.processing-preview').show();
                $.ajax({
@@ -128,8 +169,115 @@
                });             
        });
        
+       $('#btn_add_restricted_value').click( function()
+       {
+               var combo_operator = $("<select></select>");
+               combo_operator.append("<option value=''></option>");
+               $.each(operators, function(key, value) 
+               {
+                       combo_operator.append("<option value='"+ key +"'>"+ 
value +"</option>");
+               });
+
+               var combo_conector = $("<select></select>");
+               combo_conector.append("<option value=''></option>");
+               combo_conector.append("<option value='and'>AND</option>");
+               combo_conector.append("<option value='or'>OR</option>");
+
+               var combo_restricted_value = $("<select></select>");
+               combo_restricted_value.append("<option value=''></option>");
+               $.each(columns, function(key, value) 
+               {
+                       combo_restricted_value.append("<option value='"+ 
value.name +"'>"+ value.name +"</option>");
+               });
+
+               var el_1 = "<span style='display:table-cell;'><select 
id='cbo_restricted_value_"+ n +"' name='cbo_restricted_value[]'>" + 
$(combo_restricted_value).html() + "</select></span>";
+               var el_2 = "<span style='display:table-cell;'><select 
id='cbo_operator_"+ n +"' name='cbo_operator[]'>" + $(combo_operator).html() + 
"</select></span>";
+               var el_3 = "<span style='display:table-cell;'><input 
type='text' id='txt_value1_"+ n +"' name='txt_value1[]'></input></span>";
+               var el_4 = "<span style='display:table-cell;'><select 
id='cbo_conector_"+ n +"' name='cbo_conector[]'>" + $(combo_conector).html() + 
"</select></span>";
+               var el_5 = "<span style='display:table-cell;'><input 
type='text' id='txt_value2_"+ n +"' name='txt_value2[]'></input></span>";
+               var el_6 = "<span style='display:table-cell;'><input 
type='hidden' class='criteria' value='"+ n +"'><input type='button' 
class='pure-button pure-button-primary' onclick='delete_restricted_value(this)' 
name='btn_del' value='Delete'></input></span>";
+
+               var row = '<span style="display:table-row;">'+ el_1 + el_2 + 
el_3 + el_4 + el_5 + el_6 +'</span>';
+               n ++;
+               $('#container_criteria').append(row);
+
+       });
 });
 
+ var n = 0;
+
+function delete_restricted_value (e)
+{
+       $(e).parent().parent().remove();
+}
+
+function in_array_object (key_operator, array_object)
+{
+       var result = false;
+       $.each(array_object, function(key, value) 
+       {
+               if (key == key_operator)
+               {
+                       result = true;
+                       return;
+               }
+       });
+       
+       return result; 
+}
+
+function validate_criteria (values)
+{
+       var result = true;
+       $.each(values.cbo_restricted_value, function(key, value) 
+       {
+               if (values.cbo_operator[key] == "")
+               {
+                       result = false;
+                       alert('Select an operator for: ' + value);
+                       $("#cbo_operator_" + key).focus();
+                       return;
+               }
+       });
+       
+       if (!result)
+       {
+               return result;
+       }
+       
+       $.each(values.cbo_operator, function(key, value) 
+       {
+               switch (true)
+               {
+                       case (in_array_object(value, operators_between)):
+                               if ($("#txt_value1_" + key).val() == '')
+                               {
+                                       result = false;
+                                       alert('Enter a value for ' + 
values.cbo_restricted_value[key]);
+                                       $("#txt_value1_" + key).focus();
+                               }
+                               if ($("#txt_value2_" + key).val() == '')
+                               {
+                                       result = false;
+                                       alert('Enter a second value for: ' + 
values.cbo_restricted_value[key]);
+                                       $("#txt_value2_" + key).focus();
+                               }
+                               break;
+                       case (in_array_object(value, operators_null)):
+                               break;
+                       default: 
+                               if ($("#txt_value1_" + key).val() == '')
+                               {
+                                       result = false;
+                                       alert('Enter a value for: ' + 
values.cbo_restricted_value[key]);
+                                       $("#txt_value1_" + key).focus();
+                               }
+               }               
+       });
+       
+       return result;
+}
+
 function set_values()
 {
        $.each(jsonB.columns, function(key, value) 
@@ -158,18 +306,18 @@
        {
                $("#cbo_" + key).val(value);
        });
-}
-
-function build_check_columns(data)
-{
-       $.each(data, function(key, object) 
+       
+       $.each(jsonB.criteria, function(key, value) 
        {
-               var combo = build_list_aggregates(object.name, object.type);
-               //var text = build_text_aggregates(object.name);
-               var check = build_check_aggregates(object.name);
-               var el_1 = '<span style="display:table-row;">'+ check + combo + 
'</span>';
-               $('#container_aggregates').append(el_1);                        
-       });     
+               $('#btn_add_restricted_value').click();
+               
+               $("#cbo_restricted_value_" + key).val(value.field);
+               $("#cbo_operator_" + key).val(value.operator);
+               $("#txt_value1_" + key).val(value.value1);
+               $("#cbo_conector_" + key).val(value.conector);
+               $("#txt_value2_" + key).val(value.value2);
+       });
+       
 }
 
 function build_check_groups(name, type)
@@ -182,7 +330,6 @@
                $('#container_order').append(el_2);
                
                var combo = build_list_aggregates(name, type);
-               //var text = build_text_aggregates(name);
                var check = build_check_aggregates(name);
                var el_1 = '<span style="display:table-row;">'+ check + combo + 
'</span>';
                $('#container_aggregates').append(el_1);
@@ -191,7 +338,7 @@
                $("#g_" + name).parent().remove();
                $("#o_" + name).parent().remove();
                $("#cbo_" + name).parent().parent().remove();
-       }
+       }       
 }
 
 function build_check_aggregates(name)
@@ -212,11 +359,6 @@
        return "<span style='display:table-cell;'><select disabled='true' 
id='cbo_" + name + "' name='cbo_aggregate["+ name +"]'>" + $(combo).html() + 
"</select></span>";
 }
 
-function build_text_aggregates(name)
-{
-       return "<span style='display:table-cell;'>As <input disabled='true' 
data-validation='required' type='text' id='txt_" + name + "' 
name='txt_aggregate["+ name +"]'/></span>";
-}
-
 function enabled_disabled_aggregates(name)
 {
        if ($("#a_" + name).is(":checked")) 

Modified: trunk/property/templates/base/report.xsl
===================================================================
--- trunk/property/templates/base/report.xsl    2017-05-27 18:53:04 UTC (rev 
16787)
+++ trunk/property/templates/base/report.xsl    2017-05-27 18:56:31 UTC (rev 
16788)
@@ -78,7 +78,34 @@
                var jsonB = {};
                <xsl:if test="report_definition != ''">
                        jsonB = <xsl:value-of select="report_definition"/>;
-               </xsl:if>               
+               </xsl:if>
+               var operators = {};
+               <xsl:if test="operators != ''">
+                       operators = <xsl:value-of select="operators"/>;
+               </xsl:if>
+               
+               var operators_equal = {};
+               <xsl:if test="operators_equal != ''">
+                       operators_equal = <xsl:value-of 
select="operators_equal"/>;
+               </xsl:if>
+               var operators_between = {};
+               <xsl:if test="operators_between != ''">
+                       operators_between = <xsl:value-of 
select="operators_between"/>;
+               </xsl:if>
+               var operators_like = {};
+               <xsl:if test="operators_like != ''">
+                       operators_like = <xsl:value-of 
select="operators_like"/>;
+               </xsl:if>
+               var operators_in = {};
+               <xsl:if test="operators_in != ''">
+                       operators_in = <xsl:value-of select="operators_in"/>;
+               </xsl:if>
+               var operators_null = {};
+               <xsl:if test="operators_null != ''">
+                       operators_null = <xsl:value-of 
select="operators_null"/>;
+               </xsl:if>
+               
+               var columns = {};
        </script>
        
        <style type="text/css">
@@ -126,6 +153,7 @@
                                                        <li><a 
href="#tab-group"><xsl:value-of select="php:function('lang', 'Group 
by')"/></a></li>
                                                        <li><a 
href="#tab-sort"><xsl:value-of select="php:function('lang', 'Sort 
by')"/></a></li>
                                                        <li><a 
href="#tab-count-sum"><xsl:value-of select="php:function('lang', 'Count / 
Sum')"/></a></li>
+                                                       <li><a 
href="#tab-criteria"><xsl:value-of select="php:function('lang', 
'Criteria')"/></a></li>
                                                        <li><a 
href="#tab-preview"><xsl:value-of select="php:function('lang', 
'Preview')"/></a></li>
                                                </ul>
                                                <div id="tab-columns">
@@ -159,7 +187,17 @@
                                                                </label>
                                                                <div 
id="container_aggregates" class="pure-custom"></div>
                                                        </div>          
-                                               </div>  
+                                               </div>
+                                               <div id="tab-criteria">
+                                                       <div 
class="pure-control-group">
+                                                               <input 
type="button" class="pure-button pure-button-primary" 
name="btn_add_restricted_value" id="btn_add_restricted_value">
+                                                                       
<xsl:attribute name="value">
+                                                                               
<xsl:value-of select="php:function('lang', 'add')" />
+                                                                       
</xsl:attribute>
+                                                               </input>        
                                                        
+                                                               <div 
id="container_criteria" class="pure-custom"></div>
+                                                       </div>          
+                                               </div>
                                                <div id="tab-preview">
                                                        <div 
class="pure-control-group">
                                                                <label>




reply via email to

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