fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16396] Stable: Merge 16392:16395 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [16396] Stable: Merge 16392:16395 from trunk
Date: Wed, 1 Mar 2017 01:55:25 -0500 (EST)

Revision: 16396
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16396
Author:   sigurdne
Date:     2017-03-01 01:55:25 -0500 (Wed, 01 Mar 2017)
Log Message:
-----------
Stable: Merge 16392:16395 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/phpgwapi/inc/class.jquery.inc.php
    branches/Version-2_0-branch/property/inc/class.botts.inc.php
    branches/Version-2_0-branch/property/inc/class.menu.inc.php
    branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php
    branches/Version-2_0-branch/property/inc/class.sotts.inc.php
    branches/Version-2_0-branch/property/inc/class.uitts.inc.php
    
branches/Version-2_0-branch/property/inc/import/class.import_component_files.inc.php
    branches/Version-2_0-branch/property/setup/phpgw_no.lang

Added Paths:
-----------
    branches/Version-2_0-branch/phpgwapi/js/chart/
    branches/Version-2_0-branch/property/js/portico/tts.report.js
    branches/Version-2_0-branch/property/js/portico/utils.js
    branches/Version-2_0-branch/property/templates/base/tts_report.xsl

Property Changed:
----------------
    branches/Version-2_0-branch/
    branches/Version-2_0-branch/booking/
    branches/Version-2_0-branch/bookingfrontend/

Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-03-01 06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch 2017-03-01 06:55:25 UTC (rev 16396)

Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
 /branches/dev-syncromind:13653
-/branches/dev-syncromind-2:14933-16300
+/branches/dev-syncromind-2:14933-16394
 /branches/stavangerkommune:12743-12875,12986
-/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391
\ No newline at end of property
+/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395
\ No newline at end of property
Index: branches/Version-2_0-branch/booking
===================================================================
--- branches/Version-2_0-branch/booking 2017-03-01 06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch/booking 2017-03-01 06:55:25 UTC (rev 16396)

Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
-/branches/dev-syncromind-2/booking:14933-16300
+/branches/dev-syncromind-2/booking:14933-16394
 /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
-/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15360-15541,15543-15566,15568-15569,15585-15617,15621-15630,15637-15639,15641-15643,15645,15647-15665,15667-15668,15695-15712,15714-15764,15820-15849,15889-15900,15902-16046,16055,16101-16130,16144-16212,16297-16305,16307-16314
\ No newline at end of property
+/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15360-15541,15543-15566,15568-15569,15585-15617,15621-15630,15637-15639,15641-15643,15645,15647-15665,15667-15668,15695-15712,15714-15764,15820-15849,15889-15900,15902-16046,16055,16101-16130,16144-16212,16297-16305,16307-16314,16393-16395
\ No newline at end of property
Index: branches/Version-2_0-branch/bookingfrontend
===================================================================
--- branches/Version-2_0-branch/bookingfrontend 2017-03-01 06:29:38 UTC (rev 
16395)
+++ branches/Version-2_0-branch/bookingfrontend 2017-03-01 06:55:25 UTC (rev 
16396)

Property changes on: branches/Version-2_0-branch/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
-/branches/dev-syncromind-2/bookingfrontend:14933-16300
+/branches/dev-syncromind-2/bookingfrontend:14933-16394
 /branches/stavangerkommune/bookingfrontend:9468-12740,12986
-/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909,14917-14919,14924-14978,14980-15258,15297,15312-15335,15585-15617,15621-15630,15714-15764,15813-15814,15820-15849,15889-15900,15902-16046,16101-16130,16144-16212,16297-16305,16307-16314,16316-16318,16385,16387
\ No newline at end of property
+/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909,14917-14919,14924-14978,14980-15258,15297,15312-15335,15585-15617,15621-15630,15714-15764,15813-15814,15820-15849,15889-15900,15902-16046,16101-16130,16144-16212,16297-16305,16307-16314,16316-16318,16385,16387,16393-16395
\ No newline at end of property
Modified: branches/Version-2_0-branch/phpgwapi/inc/class.jquery.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.jquery.inc.php       
2017-03-01 06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.jquery.inc.php       
2017-03-01 06:55:25 UTC (rev 16396)
@@ -202,6 +202,14 @@
                                                
$GLOBALS['phpgw']->css->add_external_file("phpgwapi/js/contextMenu/jquery.contextMenu.min.css");
                                        break;
                                
+                               case 'chart':
+                                       $load = array
+                                               (
+                                               'chart' => 
array("Chart{$_type}")
+                                       );
+
+                                       break;
+                               
                                case 'file-upload':
                                        $load = array
                                                (

Modified: branches/Version-2_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.botts.inc.php        
2017-03-01 06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch/property/inc/class.botts.inc.php        
2017-03-01 06:55:25 UTC (rev 16396)
@@ -556,6 +556,11 @@
                        return $locations;
                }
 
+               function get_data_report( $data = array() )
+               {
+                       return $this->so->get_data_report($data);
+               }
+
                function read( $data = array() )
                {
                        static $category_name = array();

Modified: branches/Version-2_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.menu.inc.php 2017-03-01 
06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch/property/inc/class.menu.inc.php 2017-03-01 
06:55:25 UTC (rev 16396)
@@ -910,20 +910,28 @@
                                        'text' => lang('Helpdesk'),
                                        'image' => array('property', 'helpdesk')
                                );
+
+                               $menus['navigation']['helpdesk']['children'] = 
array
+                                       (
+                                       'report' => array
+                                               (
+                                               'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uitts.report')),
+                                               'text' => lang('report'),
+                                               'image' => array('property', 
'helpdesk')
+                                       )
+                               );
+
                        }
 
                        if ($acl->check('.ticket.order', PHPGW_ACL_ADD, 
'property'))
                        {
-                               $menus['navigation']['helpdesk']['children'] = 
array
-                                       (
-                                       'order_template' => array
+                               
$menus['navigation']['helpdesk']['children']['order_template'] =  array
                                                (
                                                'url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index',
                                                        'type' => 
'order_template')),
                                                'text' => lang('order 
template'),
                                                'image' => array('property', 
'helpdesk')
-                                       )
-                               );
+                                       );
                        }
 
                        if 
(isset($GLOBALS['phpgw_info']['user']['apps']['sms']))

Modified: 
branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php   
2017-03-01 06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch/property/inc/class.sogeneric_document.inc.php   
2017-03-01 06:55:25 UTC (rev 16396)
@@ -82,10 +82,10 @@
                        }
                        
                        $filtermethod = "WHERE a.mime_type != 'Directory' AND 
a.mime_type != 'journal' AND a.mime_type != 'journal-deleted'";
+                       $joinmethod .= " {$this->left_join} phpgw_vfs_filedata 
b ON ( a.file_id = b.file_id )";
 
                        if ($cat_id)
                        {
-                               $joinmethod .= " {$this->join} 
phpgw_vfs_filedata b ON ( a.file_id = b.file_id )";
                                $filtermethod .= " AND b.metadata @> 
'{\"cat_id\":\"{$cat_id}\"}'";
                        } 
 
@@ -127,7 +127,8 @@
                        if ($query)
                        {
                                $query = $this->db->db_addslashes($query);
-                               $querymethod = " AND a.name $this->like 
'%$query%'";
+                               $querymethod = " AND (a.name $this->like 
'%{$query}%'";
+                               $querymethod .= " OR metadata->>'descr' ilike 
'%{$query}%')";
                        }
                        
                        $sql = "SELECT DISTINCT a.file_id, a.* FROM phpgw_vfs a 
" ." {$joinmethod} "." {$filtermethod} "." {$querymethod} ";

Modified: branches/Version-2_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2017-03-01 06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2017-03-01 06:55:25 UTC (rev 16396)
@@ -110,6 +110,48 @@
                        return $this->db->f('descr', true);
                }
 
+               function get_data_report( $data )
+               {
+                       $type = isset($data['type']) && $data['type'] ? 
(int)$data['type'] : 0;
+                       $start_date = isset($data['start_date']) && 
$data['start_date'] ? (int)$data['start_date'] : 0;
+                       $end_date = isset($data['end_date']) && 
$data['end_date'] ? (int)$data['end_date'] :  mktime(23, 59, 59, 
date("n"),date("j"),date("Y"));
+                       $_end_date = $end_date + 3600 * 16 + 
phpgwapi_datetime::user_timezone();
+                       $_start_date = $start_date - 3600 * 8 + 
phpgwapi_datetime::user_timezone();
+
+                       $data_report = array();
+                       if($type ==1)
+                       {
+                               $fields = "count(cat_id) as count_category, 
cat_id";
+                               $groupmethod = " GROUP BY cat_id";
+                       }
+                       else if ($type ==2)
+                       {
+                               $fields = "count(status) as count_status, 
status";
+                               $groupmethod = " GROUP BY status";
+
+                       }
+                       else
+                       {
+                               return array();
+                       }
+
+                       $sql = "SELECT {$fields} FROM fm_tts_tickets WHERE 
fm_tts_tickets.entry_date >= $_start_date AND fm_tts_tickets.entry_date <= 
$_end_date "
+                               . " {$groupmethod}";
+
+                       $this->db->query($sql, __LINE__, __FILE__);
+
+                       while($this->db->next_record())
+                       {
+                               $data_report[] = array(
+                                       'status'                        => 
$this->db->f('status'),
+                                       'count_status'          => 
$this->db->f('count_status'),
+                                       'cat_id'                        => 
$this->db->f('cat_id'),
+                                       'count_category'        => 
$this->db->f('count_category'),
+                               );
+                       }
+                       return $data_report;
+               }
+
                function read( $data )
                {
                        $start = isset($data['start']) && $data['start'] ? 
(int)$data['start'] : 0;

Modified: branches/Version-2_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2017-03-01 06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2017-03-01 06:55:25 UTC (rev 16396)
@@ -37,6 +37,8 @@
 
                var $public_functions = array
                        (
+                       'report' => true,
+                       'get_data_report' => true,
                        'index' => true,
                        'view' => true,
                        'add' => true,
@@ -146,7 +148,7 @@
                                'vendor_id' => $this->bo->vendor_id,
                                'district_id' => $this->bo->district_id,
                                'part_of_town_id' => $this->bo->part_of_town_id,
-                               'allrows' => $this->bo->allrows,
+                               //'allrows' => $this->bo->allrows,
                                'start_date' => $this->bo->start_date,
                                'end_date' => $this->bo->end_date,
                                'location_code' => $this->bo->location_code,
@@ -1178,6 +1180,104 @@
                        self::render_template_xsl('datatable_jquery', $data);
                }
                
+               function report()
+               {
+                       if (!$this->acl_read)
+                       {
+                               $this->bocommon->no_access();
+                               return;
+                       }
+
+                       
$GLOBALS['phpgw']->jqcal->add_listener('filter_start_date');
+                       
$GLOBALS['phpgw']->jqcal->add_listener('filter_end_date');
+                       phpgwapi_jquery::load_widget('chart');
+                               
+                       $start_date = 
$GLOBALS['phpgw']->common->show_date(mktime(0, 0, 0, date("m"), '01', 
date("Y")), $this->dateFormat);
+                       $end_date = 
$GLOBALS['phpgw']->common->show_date(mktime(0, 0, 0, date("m"), date("d"), 
date("Y")), $this->dateFormat);
+                       
+                       $appname = lang('helpdesk');
+                       $function_msg = lang('Report');
+
+                       self::add_javascript('property', 'portico', 
'tts.report.js');
+
+                       $data = array(
+                               'start_date' => $start_date,
+                               'end_date' => $end_date,
+                               'image_loader' => 
$GLOBALS['phpgw']->common->image('property', 'ajax-loader', '.gif', false)
+                       );
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+                       self::render_template_xsl(array('tts_report'), $data);
+               }
+               
+               function get_data_report()
+               {
+                       $start_date = phpgw::get_var('start_date', 'date');
+                       $end_date = phpgw::get_var('end_date', 'date');
+                       $type = phpgw::get_var('type');
+                       
+                       $params['start_date'] = $start_date;
+                       $params['end_date'] = $end_date;
+                       $params['results'] = -1;
+                       $params['type'] = $type;
+
+                       $values = $this->bo->get_data_report($params);
+                       
+                       $rand = array('0', '1', '2', '3', '4', '5', '6', '7', 
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
+       
+                       $list_categories = 
$this->cats->formatted_xslt_list(array('format' => 'filter',
+                               'selected' => $this->cat_id, 'globals' => true, 
'use_acl' => $this->_category_acl));
+                       
+                       if ($type == 1)
+                       {
+                               $_categories = array();
+                               foreach ($list_categories['cat_list'] as 
$_category)
+                               {
+                                       $color = 
'#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
+                                       $_categories[$_category['cat_id']] = 
array('label'=>$_category['name'], 'count' => 0, 
+                                               'backgroundColor' => $color, 
'hoverBackgroundColor' => $color);
+                               }
+
+                               foreach ($values as $item) 
+                               {
+                                       if ($_categories[$item['cat_id']]) {
+                                               
$_categories[$item['cat_id']]['count'] = (int)$item['count_category'];
+                                       }
+                               }
+
+                               return $_categories;
+                       } 
+                       else {
+                               
+                               $list_status = $this->bo->filter(array('format' 
=> '', 'filter' => $this->status_id, 'default' => 'O'));
+                               if 
(isset($this->bo->config->config_data['tts_lang_open']) && 
$this->bo->config->config_data['tts_lang_open'])
+                               {
+                                       array_unshift($list_status, array('id' 
=> 'O2', 'name' => $this->bo->config->config_data['tts_lang_open']));
+                               }
+
+                               $_status = array();
+                               foreach ($list_status as $_item)
+                               {
+                                       if ($_item['id'] == 'all' || 
$_item['id'] == 'X')
+                                       {
+                                               continue;
+                                       }
+                                       $color = 
'#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
+                                       $_status[$_item['id']] = 
array('label'=>$_item['name'], 'count' => 0, 
+                                               'backgroundColor' => $color, 
'hoverBackgroundColor' => $color);                                 
+                               }
+
+                               foreach ($values as $item) 
+                               {
+                                       if ($_status[$item['status']]) {
+                                               
$_status[$item['status']]['count']  = (int)$item['count_status'];
+                                       }
+                               }
+
+                               return $_status;
+                       }
+               }
+               
                function add()
                {
                        if (!$this->acl_add)

Modified: 
branches/Version-2_0-branch/property/inc/import/class.import_component_files.inc.php
===================================================================
--- 
branches/Version-2_0-branch/property/inc/import/class.import_component_files.inc.php
        2017-03-01 06:29:38 UTC (rev 16395)
+++ 
branches/Version-2_0-branch/property/inc/import/class.import_component_files.inc.php
        2017-03-01 06:55:25 UTC (rev 16396)
@@ -11,8 +11,8 @@
                        $this->db = & $GLOBALS['phpgw']->db;
 
                        $this->fakebase = '/temp_files_components';
-//                     $this->path_upload_dir = 
$GLOBALS['phpgw_info']['server']['files_dir'] . $this->fakebase . '/';
-                       $this->path_upload_dir = 
'/data/portico/temp_files_components/';
+                       $this->path_upload_dir = 
$GLOBALS['phpgw_info']['server']['files_dir'] . $this->fakebase . '/';
+//                     $this->path_upload_dir = 
'/data/portico/temp_files_components/';
 
                        $this->location_code = phpgw::get_var('location_code');
                        $this->location_item_id = 
phpgw::get_var('location_item_id');
@@ -225,6 +225,8 @@
 
                        $this->_delete_all_dir_temp();
 
+                       $this->_delete_all_dir_temp();
+                       
                        return $message;
                }
 
@@ -849,6 +851,8 @@
 
                        $this->_delete_all_dir_temp();
 
+                       $this->_delete_all_dir_temp();
+                       
                        return $message;
                }
 
@@ -1016,4 +1020,4 @@
 
                        return $result;
                }
-       }
\ No newline at end of file
+       }

Copied: branches/Version-2_0-branch/property/js/portico/tts.report.js (from rev 
16395, trunk/property/js/portico/tts.report.js)
===================================================================
--- branches/Version-2_0-branch/property/js/portico/tts.report.js               
                (rev 0)
+++ branches/Version-2_0-branch/property/js/portico/tts.report.js       
2017-03-01 06:55:25 UTC (rev 16396)
@@ -0,0 +1,67 @@
+
+$(document).ready(function ()
+{
+       $('.processing').hide();
+       
+       var config = {
+               type: 'pie',
+               data: {
+                       datasets: [{
+                               data: [],
+                               backgroundColor: [],
+                               hoverBackgroundColor: []
+                       }],
+                       labels: []
+               },
+               options: {
+                       responsive: true
+               }
+       };
+
+       var ctx = document.getElementById("chart-area");
+       var myPieChart = new Chart(ctx, config);
+       
+       $('#btn_search').click( function()
+       {
+               var oArgs = {menuaction: 'property.uitts.get_data_report'};
+               var requestUrl = phpGWLink('index.php', oArgs, true);
+               var data = {"start_date": $('#filter_start_date').val(), 
"end_date": $('#filter_end_date').val(), "type": $('#type').val()};
+
+               var labels = [];
+               var values = [];
+               var backgroundColor = [];
+               var hoverBackgroundColor = [];
+               var datasets = {};
+
+               $('.processing').show();
+               $.ajax({
+                       type: 'GET',
+                       url: requestUrl,
+                       dataType: 'json',
+                       data: data
+               }).always(function () {
+                       $('.processing').hide();
+               }).done(function (result) {
+                       $.each(result, function(key, value) {
+                               labels.push(value.label);
+                               values.push(value.count);
+                               backgroundColor.push(value.backgroundColor);
+                               
hoverBackgroundColor.push(value.hoverBackgroundColor);
+                       });
+
+                       datasets = {
+                               data: values,
+                               backgroundColor: backgroundColor,
+                               hoverBackgroundColor: hoverBackgroundColor
+                       }; 
+
+                       config.data.datasets = [datasets];
+                       config.data.labels = labels;
+
+                       myPieChart.update();
+               });             
+       });
+       
+       $("#btn_search").trigger( "click" );
+
+});

Copied: branches/Version-2_0-branch/property/js/portico/utils.js (from rev 
16395, trunk/property/js/portico/utils.js)
===================================================================
--- branches/Version-2_0-branch/property/js/portico/utils.js                    
        (rev 0)
+++ branches/Version-2_0-branch/property/js/portico/utils.js    2017-03-01 
06:55:25 UTC (rev 16396)
@@ -0,0 +1,13 @@
+window.chartColors = {
+       red: 'rgb(255, 99, 132)',
+       orange: 'rgb(255, 159, 64)',
+       yellow: 'rgb(255, 205, 86)',
+       green: 'rgb(75, 192, 192)',
+       blue: 'rgb(54, 162, 235)',
+       purple: 'rgb(153, 102, 255)',
+       grey: 'rgb(231,233,237)'
+};
+
+window.randomScalingFactor = function() {
+       return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 
100);
+}
\ No newline at end of file

Modified: branches/Version-2_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/property/setup/phpgw_no.lang    2017-03-01 
06:29:38 UTC (rev 16395)
+++ branches/Version-2_0-branch/property/setup/phpgw_no.lang    2017-03-01 
06:55:25 UTC (rev 16396)
@@ -2102,4 +2102,5 @@
 attribute name for component id        property        no      Attributtnavn 
for komponent id
 category template      property        no      Kategori mal
 profile        property        no      Profil
-new attribute  property        no      Ny attributt
\ No newline at end of file
+new attribute  property        no      Ny attributt
+report property        no      Rapport
\ No newline at end of file

Copied: branches/Version-2_0-branch/property/templates/base/tts_report.xsl 
(from rev 16395, trunk/property/templates/base/tts_report.xsl)
===================================================================
--- branches/Version-2_0-branch/property/templates/base/tts_report.xsl          
                (rev 0)
+++ branches/Version-2_0-branch/property/templates/base/tts_report.xsl  
2017-03-01 06:55:25 UTC (rev 16396)
@@ -0,0 +1,53 @@
+
+<!-- $Id$ -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+
+       <form class="pure-form pure-form-aligned" id="form" name="form" 
method="post" action="">
+               <fieldset>
+                       <div class="pure-control-group">
+                               <label>
+                                       <xsl:value-of 
select="php:function('lang', 'from')"/>
+                               </label>
+                               <input type="text" id="filter_start_date" 
name="filter_start_date" size="10" value="{start_date}" readonly="readonly" 
onMouseout="window.status='';return true;">
+                                       <xsl:attribute name="title">
+                                               <xsl:value-of 
select="lang_finnish_date_statustext"/>
+                                       </xsl:attribute>
+                               </input>
+                       </div>
+
+                       <div class="pure-control-group">
+                               <label>
+                                       <xsl:value-of 
select="php:function('lang', 'to')"/>
+                               </label>
+                               <input type="text" id="filter_end_date" 
name="filter_end_date" size="10" value="{end_date}" readonly="readonly" 
onMouseout="window.status='';return true;">
+                                       <xsl:attribute name="title">
+                                               <xsl:value-of 
select="lang_finnish_date_statustext"/>
+                                       </xsl:attribute>
+                               </input>
+                       </div>
+                       
+                       <div class="pure-control-group">
+                               <label>
+                                       <xsl:value-of 
select="php:function('lang', 'type')"/>
+                               </label>
+                               <select id='type' name="type">
+                                       <option value="1"><xsl:value-of 
select="php:function('lang', 'categories')"/></option>
+                                       <option value="2"><xsl:value-of 
select="php:function('lang', 'status')"/></option>
+                               </select>
+
+                               <input type="button" id="btn_search" 
name="btn_search" size="40">
+                                       <xsl:attribute name="value">
+                                               <xsl:value-of 
select="php:function('lang', 'search')"/>
+                                       </xsl:attribute>
+                               </input>                        
+                               <img src="{image_loader}" class="processing" 
align="absmiddle"></img>   
+                       </div>
+                       
+                       <div id="canvas-holder" style="width:80%; 
display:inline-block;">
+                               <canvas style="display:inline-block;" 
id="chart-area" />
+                       </div>
+               </fieldset>
+       </form>
+
+</xsl:template>




reply via email to

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