init
This commit is contained in:
214
modules/EcmCharts/tpls/AnnualSalesChart.tpl
Normal file
214
modules/EcmCharts/tpls/AnnualSalesChart.tpl
Normal file
@@ -0,0 +1,214 @@
|
||||
<style type="text/css">
|
||||
{literal}
|
||||
.buttons {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
table tr td {
|
||||
padding: 5px;
|
||||
}
|
||||
{/literal}
|
||||
</style>
|
||||
<script type="text/javascript" src="modules/EcmCharts/javascript/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
function listenerFunction() {
|
||||
//location.reload();
|
||||
};
|
||||
|
||||
$("#chartTypeSelector").change(function() {
|
||||
if( $(this).val() == 'pie' )
|
||||
{
|
||||
$("#documentTypeSelector").val("normal");
|
||||
}
|
||||
});
|
||||
|
||||
$("#documentTypeSelector").change(function(){
|
||||
if( $(this).val() == 'correct' && $("#chartTypeSelector").val() == 'pie' )
|
||||
{
|
||||
$("#chartTypeSelector").val("column");
|
||||
}
|
||||
});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
|
||||
<ul class="tablist" style="width:100%;">
|
||||
<li>
|
||||
<a class="current" href="#">{$LANG.LBL_CHARTOPTIONS}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form action="index.php" method="get" name="AnnualSalesChartOptions">
|
||||
<input type="hidden" name="module" value="EcmCharts" />
|
||||
<input type="hidden" name="action" value="AnnualSalesChart" />
|
||||
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{$LANG.LBL_SELECT_YEAR}: </td>
|
||||
<td>
|
||||
<select name="year">
|
||||
{foreach from=$years item=y}
|
||||
<option value="{$y}" { if $y == $year || $year == ""} selected="true" {/if}>{$y}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$LANG.LBL_INCLUDED_DOCUMENT_TYPE}: </td>
|
||||
<td>
|
||||
<select id="documentTypeSelector" name="type">
|
||||
<option value="%" { if $type == "%" || $type == ""} selected="true" {/if}>{$LANG.LBL_NORMAL_AND_CORRECT}</option>
|
||||
<option value="normal" { if $type == "normal"} selected="true" {/if}>{$LANG.LBL_NORMAL_ONLY}</option>
|
||||
<option value="correct" { if $type == "correct"} selected="true" {/if}>{$LANG.LBL_CORRECT_ONLY}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{* Search by contractor *}
|
||||
<td>{$LANG.LBL_CONTRACTOR}</td>
|
||||
<td>
|
||||
<input id="search_account_name" type="text" value="{$contractor_name}" name="account_name">
|
||||
<input id="search_account_id" type="hidden" value="{$contractor_id}" name="account_id">
|
||||
<input class="button" type="button" value="{$LANG.LBL_SELECT}" accesskey="T" title="Select [Alt+T]" value="" name="btn_account_name" onClick="getContractor()">
|
||||
|
||||
{* Open popup window to select contractor *}
|
||||
<script type="text/javascript">
|
||||
function getContractor()
|
||||
{ldelim}
|
||||
open_popup("Accounts", 600, 400, "", true, false,
|
||||
{ldelim}
|
||||
"call_back_function":"set_return","form_name":"AnnualSalesChartOptions","field_to_name_array":
|
||||
{ldelim}"id":"search_account_id","name":"search_account_name"{rdelim}
|
||||
{rdelim}, "single", true);
|
||||
{rdelim};
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>Typ wykresu: </td>
|
||||
<td>
|
||||
<select id="chartTypeSelector" name="chartType">
|
||||
<option value="column" { if $chartType == "column" || $chartType == ""} selected="true" {/if}>{$LANG.LBL_CHARTTYPECOLUMN}</option>
|
||||
<option value="pie" { if $chartType == "pie"} selected="true" {/if}>{$LANG.LBL_CHARTTYPEPIE}</option>
|
||||
<option value="area" { if $chartType == "area"} selected="true" {/if}>{$LANG.LBL_CHARTTYPEAREA}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$LANG.LBL_VIEW_COMPARATIVE_DATA}: </td>
|
||||
<td>
|
||||
<input type="radio" name="comparativeData" value="enabled" { if $comparativeData == "enabled" || $comparativeData == "" } checked {/if}> {$LANG.LBL_YES}
|
||||
<input type="radio" name="comparativeData" style="margin-left: 20px" value="disabled" { if $comparativeData == "disabled" || $comparativeData == "" } checked {/if}> {$LANG.LBL_NO}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input class="button" name="submit" value="{$LANG.LBL_GENERATECHART}" type="submit">
|
||||
<input class="button" name="clear" value="{$LANG.LBL_RESTOREDEFAULTPARAMETERS}" type="button" onclick="location.href='index.php?module=EcmCharts&action=AnnualSalesChart';">
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
{*********************************************************************}
|
||||
{*************************** CHART TPL} ******************************}
|
||||
{*********************************************************************}
|
||||
|
||||
{if $chartOptions == ''}
|
||||
{literal}
|
||||
<style type="text/css">
|
||||
.no-data {
|
||||
display: table;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.textCenter {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
.textCenter span {
|
||||
font-size: 16px;
|
||||
border: 1px dashed #E03E3E;
|
||||
padding: 10px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 10px 10px 5px #AAAAAA;
|
||||
background-color: #FFDEDE;
|
||||
color: #E03E3E;
|
||||
}
|
||||
|
||||
</style>
|
||||
{/literal}
|
||||
{/if}
|
||||
|
||||
{if $chartOptions == ''}
|
||||
<div id="annual_sales_chart" style="width: 100%; height: 400px;">
|
||||
<div class="no-data">
|
||||
<div class="textCenter">
|
||||
<span>
|
||||
{$LANG.LBL_NO_DATA_CHANGE_FILTER}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<div id="annual_sales_chart" style="width: 100%; height: 1000px;"></div>
|
||||
{/if}
|
||||
|
||||
<!-- GOOGLE CHARTS API -->
|
||||
{if $chartOptions != ''}
|
||||
{literal}
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
<script type="text/javascript" src="modules/EcmCharts/Dashlets/MyChartsSalesDashlet/js/salesChart.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
// Load the Visualization API and the piechart package.
|
||||
google.load('visualization', '1', {'packages':['corechart','geochart','table']});
|
||||
|
||||
function drawChart() {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Rok', {/literal}'{$LANG.LBL_SALE}'
|
||||
{if $comparativeData == 'enabled'} , '{$LANG.LBL_SALE_IN_PAST_YEAR}'{/if}
|
||||
{literal}],
|
||||
|
||||
{/literal}
|
||||
{$chartOptions}
|
||||
{literal}
|
||||
]);
|
||||
|
||||
var options = {
|
||||
{/literal}
|
||||
title: '{ $LANG.LBL_SALES_CHART_IN }{$year}',
|
||||
{literal}
|
||||
legend: {position: 'bottom', textStyle: {fontSize: 10}},
|
||||
tooltip:{textStyle:{fontSize:'12'}},
|
||||
vAxis:{title: {/literal}'{$LANG.LBL_VALUEOFSALES}'{literal},textStyle:{color: '#000000',fontSize: '13', paddingRight: '100',marginRight: '100'}},
|
||||
hAxis:{title:'',textStyle:{color: '#000000',fontSize: '13', paddingRight: '100',marginRight: '100'}}
|
||||
};
|
||||
|
||||
{/literal}
|
||||
{if $chartType == 'column' or $chartType == ''}
|
||||
var chart = new google.visualization.ColumnChart(document.getElementById('annual_sales_chart'));
|
||||
{elseif $chartType == 'pie'}
|
||||
var chart = new google.visualization.PieChart(document.getElementById('annual_sales_chart'));
|
||||
{else}
|
||||
var chart = new google.visualization.AreaChart(document.getElementById('annual_sales_chart'));
|
||||
{/if}
|
||||
{literal}
|
||||
|
||||
chart.draw(data, options);
|
||||
}
|
||||
|
||||
// sekunda opóźnienia, żeby zdążył wczytać się moduł "visualization"
|
||||
setTimeout(drawChart, 1000);
|
||||
|
||||
</script>
|
||||
{/literal}
|
||||
{/if}
|
||||
95
modules/EcmCharts/tpls/QuickCreate.tpl
Normal file
95
modules/EcmCharts/tpls/QuickCreate.tpl
Normal file
@@ -0,0 +1,95 @@
|
||||
{*
|
||||
|
||||
/**
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
*}
|
||||
|
||||
|
||||
<form name="ecmchartsQuickCreate" id="ecmchartsQuickCreate" method="POST" action="index.php">
|
||||
<input type="hidden" name="module" value="EcmCharts">
|
||||
<input type="hidden" name="email_id" value="{$REQUEST.email_id}">
|
||||
<input type="hidden" name="account_id" value="{$REQUEST.account_id}">
|
||||
<input type="hidden" name="case_id" value="{$REQUEST.acase_id}">
|
||||
<input type="hidden" name="contact_id" value="{$REQUEST.contact_id}">
|
||||
<input type="hidden" name="return_action" value="{$REQUEST.return_action}">
|
||||
<input type="hidden" name="return_module" value="{$REQUEST.return_module}">
|
||||
<input type="hidden" name="return_id" value="{$REQUEST.return_id}">
|
||||
<input type="hidden" name="action" value='Save'>
|
||||
<input type="hidden" name="duplicate_parent_id" value="{$REQUEST.duplicate_parent_id}">
|
||||
<input type="hidden" name="to_pdf" value='1'>
|
||||
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{$ASSIGNED_USER_ID}" />
|
||||
|
||||
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td align="left" style="padding-bottom: 2px;">
|
||||
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" type="submit" name="button" {$saveOnclick|default:"onclick=\"return check_form('EcmChartsQuickCreate');\""} value=" {$APP.LBL_SAVE_BUTTON_LABEL} " >
|
||||
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" type="submit" name="button" {$cancelOnclick|default:"onclick=\"this.form.action.value='$RETURN_ACTION'; this.form.module.value='$RETURN_MODULE'; this.form.record.value='$RETURN_ID'\""} value=" {$APP.LBL_CANCEL_BUTTON_LABEL} ">
|
||||
<input title="{$APP.LBL_FULL_FORM_BUTTON_TITLE}" accessKey="{$APP.LBL_FULL_FORM_BUTTON_KEY}" class="button" type="submit" name="button" onclick="this.form.to_pdf.value='0';this.form.action.value='EditView'; this.form.module.value='EcmCharts';" value=" {$APP.LBL_FULL_FORM_BUTTON_LABEL} "></td>
|
||||
<td align="right" nowrap><span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span> {$APP.NTC_REQUIRED}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th align="left" class="dataLabel" colspan="4"><h4 class="dataLabel"><slot>{$MOD.LBL_ECMCHART_INFORMATION}</slot></h4></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="dataLabel" width="15%"><slot>{$MOD.LBL_SUBJECT} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
|
||||
<td width="35%"><slot><textarea name='name' cols="40" tabindex='1' rows="1">{$NAME}</textarea></slot></td>
|
||||
<td class="dataLabel" width="15%"><slot>{$MOD.LBL_TYPE}</slot></td>
|
||||
<td width="35%"><slot><select tabindex='2' name='type'>{$TYPE_OPTIONS}</select></slot></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="dataLabel" rowspan="2" width="15%"><slot>{$MOD.LBL_DESCRIPTION}</slot></td>
|
||||
<td rowspan="2" width="35%"><slot><textarea name='description' tabindex='1' cols="40" rows="4">{$DESCRIPTION}</textarea></slot></td>
|
||||
<td class="dataLabel" width="15%"><slot>{$MOD.LBL_PRIORITY}</slot></td>
|
||||
<td class="dataField" nowrap width="35%"><slot><select tabindex='2' name='priority'>{$PRIORITY_OPTIONS}</select></slot></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="dataLabel" width="15%"><slot>{$MOD.LBL_STATUS}</slot></td>
|
||||
<td width="35%"><slot><select tabindex='2' name='status'>{$STATUS_OPTIONS}</select></slot></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<script>
|
||||
{$additionalScripts}
|
||||
</script>
|
||||
230
modules/EcmCharts/tpls/SalesChart.tpl
Normal file
230
modules/EcmCharts/tpls/SalesChart.tpl
Normal file
@@ -0,0 +1,230 @@
|
||||
<style type="text/css">
|
||||
{literal}
|
||||
.buttons {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
table tr td {
|
||||
padding: 5px;
|
||||
}
|
||||
{/literal}
|
||||
</style>
|
||||
<script type="text/javascript" src="modules/EcmCharts/javascript/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
function listenerFunction() {
|
||||
//location.reload();
|
||||
};
|
||||
|
||||
$("#chartTypeSelector").change(function() {
|
||||
if( $(this).val() == 'pie' )
|
||||
{
|
||||
$("#documentTypeSelector").val("normal");
|
||||
}
|
||||
});
|
||||
|
||||
$("#documentTypeSelector").change(function(){
|
||||
if( $(this).val() != 'normal' && $("#chartTypeSelector").val() == 'pie' )
|
||||
{
|
||||
$("#chartTypeSelector").val("column");
|
||||
}
|
||||
});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
|
||||
<ul class="tablist" style="width:100%;">
|
||||
<li>
|
||||
<a class="current" href="#">{$LANG.LBL_CHARTOPTIONS}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form action="index.php" method="get" name="SalesChartOptions">
|
||||
<input type="hidden" name="module" value="EcmCharts" />
|
||||
<input type="hidden" name="action" value="SalesChart" />
|
||||
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{$LANG.LBL_FROM}: </td>
|
||||
<td>
|
||||
{* Search by date_from *}
|
||||
<input id="date_from" name="date_from" type="text" maxlength="10" size="11" tabindex="" title="" value="{$date_from}" autocomplete="off">
|
||||
<img id="date_from_trigger" border="0" align="absmiddle" alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
Calendar.setup ({ldelim}
|
||||
inputField : "date_from",
|
||||
daFormat : "{$dateFormat}",
|
||||
button : "date_from_trigger",
|
||||
singleClick : true,
|
||||
dateStr : "",
|
||||
step : 1
|
||||
{rdelim}
|
||||
);
|
||||
</script>
|
||||
</td>
|
||||
<td> {$LANG.LBL_TO}: </td>
|
||||
<td>
|
||||
{* Search by date_to *}
|
||||
<input autocomplete="off" name="date_to" id="date_to" value="{$date_to}" title="" tabindex="" size="11" maxlength="10" type="text">
|
||||
<img src="themes/default/images/jscalendar.gif" alt="Enter Date" id="date_to_trigger" align="absmiddle" border="0">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
Calendar.setup ({ldelim}
|
||||
inputField : "date_to",
|
||||
daFormat : "{$dateFormat}",
|
||||
button : "date_to_trigger",
|
||||
singleClick : true,
|
||||
dateStr : "",
|
||||
step : 1
|
||||
{rdelim}
|
||||
);
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$LANG.LBL_SHOW}: </td>
|
||||
<td>
|
||||
<select name="detail">
|
||||
<option value="category" { if $detail == "category" || $detail == ""} selected="true" {/if} >Kategorii</option>
|
||||
<option value="subcategory" { if $detail=="subcategory"} selected {/if} >Podkategorii</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<td>{$LANG.LBL_INCLUDED_DOCUMENT_TYPE}: </td>
|
||||
<td>
|
||||
<select id="documentTypeSelector" name="type">
|
||||
<option value="%" { if $type == "%" || $type == ""} selected="true" {/if}>Faktury i korekty</option>
|
||||
<option value="normal" { if $type == "normal"} selected="true" {/if}>Faktury</option>
|
||||
<option value="correct" { if $type == "correct"} selected="true" {/if}>Korekty</option>
|
||||
</select>
|
||||
</td>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>{$LANG.LBL_CHARTTYPE}: </td>
|
||||
<td>
|
||||
<select id="chartTypeSelector" name="chartType">
|
||||
<option value="column" { if $chartType == "column" || $chartType == ""} selected="true" {/if}>{$LANG.LBL_CHARTTYPECOLUMN}</option>
|
||||
<option value="pie" { if $chartType == "pie"} selected="true" {/if}>{$LANG.LBL_CHARTTYPEPIE}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<td>{$LANG.LBL_VIEW_COMPARATIVE_DATA}: </td>
|
||||
<td>
|
||||
<input type="radio" name="comparativeData" value="enabled" { if $comparativeData == "enabled" || $comparativeData == "" } checked {/if}> {$LANG.LBL_YES}
|
||||
<input type="radio" name="comparativeData" style="margin-left: 20px" value="disabled" { if $comparativeData == "disabled" || $comparativeData == "" } checked {/if}> {$LANG.LBL_YES}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input class="button" name="submit" value="{$LANG.LBL_GENERATECHART}" type="submit">
|
||||
<input class="button" name="clear" value="{$LANG.LBL_RESTOREDEFAULTPARAMETERS}" type="button" onclick="location.href='index.php?module=EcmCharts&action=SalesChart';">
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
{*********************************************************************}
|
||||
{*************************** CHART TPL} ******************************}
|
||||
{*********************************************************************}
|
||||
|
||||
{if $chartOptions == ''}
|
||||
{literal}
|
||||
<style type="text/css">
|
||||
.no-data {
|
||||
display: table;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.textCenter {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
.textCenter span {
|
||||
font-size: 16px;
|
||||
border: 1px dashed #E03E3E;
|
||||
padding: 10px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 10px 10px 5px #AAAAAA;
|
||||
background-color: #FFDEDE;
|
||||
color: #E03E3E;
|
||||
}
|
||||
|
||||
</style>
|
||||
{/literal}
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
{if $chartOptions == ''}
|
||||
<div id="sales_chart" style="width: 100%; height: 400px;">
|
||||
<div class="no-data">
|
||||
<div class="textCenter">
|
||||
<span>
|
||||
Brak danych od {$date_from} do {$date_to}, wybierz inny przedział dat.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<div id="sales_chart" style="width: 100%; height: 1000px;"></div>
|
||||
{/if}
|
||||
<br><br>
|
||||
|
||||
<!-- GOOGLE CHARTS API -->
|
||||
{if $chartOptions != ''}
|
||||
{literal}
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="modules/EcmCharts/Dashlets/MyChartsSalesDashlet/js/salesChart.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
// Load the Visualization API and the piechart package.
|
||||
google.load('visualization', '1', {'packages':['corechart','geochart','table']});
|
||||
|
||||
function drawChart() {
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Kategoria', 'Sprzedaż w aktualnym roku'{/literal}
|
||||
{if $comparativeData == 'enabled'} , 'Sprzedaż z poprzedniego roku'{/if}
|
||||
{literal}],
|
||||
|
||||
{/literal}
|
||||
{$chartOptions}
|
||||
{literal}
|
||||
]);
|
||||
|
||||
var options = {
|
||||
{/literal}
|
||||
title: '{$LANG.LBL_CHARTSALES} {$LANG.LBL_FROM} {$date_from} {$LANG.LBL_TO} {$date_to}',
|
||||
{literal}
|
||||
hAxis: {title: {/literal}{if $detail == 'category'}'Kategoria'{else}'Podkategoria'{/if}{literal}, titleTextStyle: {color: 'red'}},
|
||||
legend: {position: 'bottom', textStyle: {fontSize: 10}},
|
||||
tooltip:{textStyle:{fontSize:'12'}},
|
||||
vAxis:{title: {/literal}'{$LANG.LBL_VALUEOFSALES}'{literal},textStyle:{color: '#000000',fontSize: '13', paddingRight: '100',marginRight: '100'}},
|
||||
hAxis:{title:'',textStyle:{color: '#000000',fontSize: '13', paddingRight: '100',marginRight: '100'}}
|
||||
};
|
||||
|
||||
{/literal}
|
||||
{if $chartType == 'column' || $chartType == ''}
|
||||
var chart = new google.visualization.ColumnChart(document.getElementById('sales_chart'));
|
||||
{else}
|
||||
var chart = new google.visualization.PieChart(document.getElementById('sales_chart'));
|
||||
{/if}
|
||||
|
||||
{literal}
|
||||
|
||||
chart.draw(data, options);
|
||||
|
||||
}
|
||||
|
||||
// sekunda opóźnienia, żeby zdążył wczytać się moduł "visualization"
|
||||
setTimeout(drawChart, 1000);
|
||||
|
||||
</script>
|
||||
{/literal}
|
||||
{/if}
|
||||
Reference in New Issue
Block a user