2012-03-20 Sergio Martin <sergio.martin@artica.es>

* include/functions_reporting.php
	operation/reporting/reporting_viewer.php
	godmode/reporting/reporting_builder.php: Improved period form in the
	report view and navegability merged from 4.0



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5801 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-03-20 15:17:44 +00:00
parent b240279e04
commit dfca5db6da
4 changed files with 38 additions and 37 deletions

View File

@ -1,3 +1,10 @@
2012-03-20 Sergio Martin <sergio.martin@artica.es>
* include/functions_reporting.php
operation/reporting/reporting_viewer.php
godmode/reporting/reporting_builder.php: Improved period form in the
report view and navegability merged from 4.0
2012-03-20 Miguel de Dios <miguel.dedios@artica.es> 2012-03-20 Miguel de Dios <miguel.dedios@artica.es>
* ChangeLog: added lost lines. * ChangeLog: added lost lines.

View File

@ -43,7 +43,6 @@ switch ($action) {
case 'sort_items': case 'sort_items':
switch ($activeTab) { switch ($activeTab) {
case 'list_items': case 'list_items':
//NO FUNCIONA
$resultOperationDB = null; $resultOperationDB = null;
$position_to_sort = (int)get_parameter('position_to_sort', 1); $position_to_sort = (int)get_parameter('position_to_sort', 1);
@ -803,9 +802,9 @@ if ($enterpriseEnable) {
$buttons = reporting_enterprise_add_Tabs($buttons, $idReport); $buttons = reporting_enterprise_add_Tabs($buttons, $idReport);
} }
$buttons['preview'] = array('active' => false, $buttons['view'] = array('active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=' . $idReport . '">' . 'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=' . $idReport . '">' .
html_print_image("images/reporting.png", true, array ("title" => __('Preview'))) .'</a>'); html_print_image("images/reporting.png", true, array ("title" => __('View report'))) .'</a>');
$buttons[$activeTab]['active'] = true; $buttons[$activeTab]['active'] = true;

View File

@ -2157,8 +2157,8 @@ function header_content($mini, $content, $report, &$table, $title = false, $name
else { else {
$data[] = "<div style='text-align: right;'>" . $sizh . $data[] = "<div style='text-align: right;'>" . $sizh .
"(" . human_time_description_raw ($content['period']) . ") " . "(" . human_time_description_raw ($content['period']) . ") " .
__("From:") . " " . date("Y-m-d H:i", $report["datetime"]) . "<br />" . __("From:") . " " . date("Y-m-d H:i", $report["datetime"] - $content['period']) . "<br />" .
__("To:") . " " . date("Y-m-d H:i", $report["datetime"] - $content['period']) . "<br />" . __("To:") . " " . date("Y-m-d H:i", $report["datetime"]) . "<br />" .
$sizhfin . "</div>"; $sizhfin . "</div>";
} }

View File

@ -67,17 +67,17 @@ $enable_init_date = get_parameter('enable_init_date', 0);
$url = "index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=$id_report&date=$date&time=$time"; $url = "index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=$id_report&date=$date&time=$time";
$options['setup'] = "<a href='index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&action=edit&id_report=$id_report'>" $options['setup'] = "<a href='index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&action=new&tab=item_editor&id_report=$id_report'>"
. html_print_image ("images/setup.png", true, array ("title" => __('Setup'))) . html_print_image ("images/setup.png", true, array ("title" => __('Setup')))
. "</a>"; . "</a>";
if ($config["pure"] == 0) { if ($config["pure"] == 0) {
$options['screen'] = "<a href='$url&pure=1'>" $options['screen'] = "<a href='$url&pure=1&enable_init_date=$enable_init_date&date_init=$date_init&time_init=$time_init'>"
. html_print_image ("images/fullscreen.png", true, array ("title" => __('Full screen mode'))) . html_print_image ("images/fullscreen.png", true, array ("title" => __('Full screen mode')))
. "</a>"; . "</a>";
} }
else { else {
$options['screen'] = "<a href='$url&pure=0'>" $options['screen'] = "<a href='$url&pure=0&enable_init_date=$enable_init_date&date_init=$date_init&time_init=$time_init'>"
. html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode'))) . html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode')))
. "</a>"; . "</a>";
} }
@ -98,50 +98,48 @@ $table->style[0] = 'width: 60px;';
// Set initial conditions for these controls, later will be modified by javascript // Set initial conditions for these controls, later will be modified by javascript
if (!$enable_init_date) { if (!$enable_init_date) {
$table->style[0] .= 'font-weight: bold; display: none';
$table->style[1] = 'display: none'; $table->style[1] = 'display: none';
$table->style[2] = 'display: ""'; $table->style[2] = 'display: ""';
$table->style[3] = 'display: none'; $display_to = 'none';
//~ $table->style[5] = 'width: 380.583px'; $display_item = '';
} }
else { else {
$table->style[0] .= 'font-weight: bold; display: ""';
$table->style[1] = 'display: ""'; $table->style[1] = 'display: ""';
$table->style[2] = 'display: none'; $table->style[2] = 'display: ""';
$table->style[3] = 'display: ""'; $display_to = '';
$table->style[5] = 'display: none'; $display_item = 'none';
} }
$table->size = array (); $table->size = array ();
$table->size[0] = '60px'; $table->size[0] = '60px';
$table->size[2] = '60px';
$table->colspan[0][1] = 2; $table->colspan[0][1] = 2;
$table->data = array (); $table->data = array ();
$table->data[0][0] = html_print_image("images/reporting.png", true, array("width" => "32", "height" => "32")); $table->data[0][0] = html_print_image("images/reporting.png", true, array("width" => "32", "height" => "32"));
if ($report['description'] != '') { if ($report['description'] != '') {
$table->data[0][1] = $report['description']; $table->data[0][1] = '<div style="float:left">'.$report['description'].'</div>';
} }
else { else {
$table->data[0][1] = $report['name']; $table->data[0][1] = '<div style="float:left">'.$report['name'].'</div>';
} }
$table->data[0][3] = '<span style="text-align:right;width:100%">'.__('Set initial date of all reports') . html_print_checkbox('enable_init_date', 1, $enable_init_date, true).'</span>'; $table->data[0][1] .= '<div style="text-align:right; width:100%; margin-right:50px">'.__('Set initial date') . html_print_checkbox('enable_init_date', 1, $enable_init_date, true);
$html_enterprise = enterprise_hook('reporting_print_button_PDF', array($id_report)); $html_enterprise = enterprise_hook('reporting_print_button_PDF', array($id_report));
if ($html_enterprise !== ENTERPRISE_NOT_HOOK) { if ($html_enterprise !== ENTERPRISE_NOT_HOOK) {
$table->data[0][3] .= $html_enterprise; $table->data[0][1] .= $html_enterprise;
} }
$table->data[0][1] .= '</div>';
$table->data[1][0] = '<b>' . __('From') . ':</b>'; $table->data[1][0] = '';
$table->data[1][1] = html_print_input_text ('date_init', $date_init, '', 12, 10, true). ' '; $table->data[1][1] = '<div style="float:left;padding-top:3px;">' . __('From') . ': </div>';
$table->data[1][1] .= html_print_input_text ('date_init', $date_init, '', 12, 10, true). ' ';
$table->data[1][1] .= html_print_input_text ('time_init', $time_init, '', 7, 7, true). ' '; $table->data[1][1] .= html_print_input_text ('time_init', $time_init, '', 7, 7, true). ' ';
$table->data[1][2] = '<b>' . __('Interval before') . ':</b>'; $table->data[1][2] = '<div style="float:left;padding-top:3px;display:'.$display_item.'" id="string_items">' . __('Items period before') . ':</div>';
$table->data[1][3] = '<b>' . __('to') . ':</b>'; $table->data[1][2] .= '<div style="float:left;padding-top:3px;display:'.$display_to.'" id="string_to">' . __('to') . ':</div>';
$table->data[1][4] = html_print_input_text ('date', $date, '', 12, 10, true). ' '; $table->data[1][2] .= html_print_input_text ('date', $date, '', 12, 10, true). ' ';
$table->data[1][4] .= html_print_input_text ('time', $time, '', 7, 7, true). ' '; $table->data[1][2] .= html_print_input_text ('time', $time, '', 7, 7, true). ' ';
$table->data[1][4] .= html_print_submit_button (__('Update'), 'date_submit', false, 'class="sub next"', true); $table->data[1][2] .= html_print_submit_button (__('Update'), 'date_submit', false, 'class="sub next"', true);
$table->data[1][5] = '';
echo '<form method="post" action="">'; echo '<form method="post" action="'.$url.'&pure='.$config["pure"].'">';
html_print_table ($table); html_print_table ($table);
html_print_input_hidden ('id_report', $id_report); html_print_input_hidden ('id_report', $id_report);
echo '</form>'; echo '</form>';
@ -241,19 +239,16 @@ $(document).ready (function () {
$("#checkbox-enable_init_date").click(function() { $("#checkbox-enable_init_date").click(function() {
flag = $("#checkbox-enable_init_date").is(':checked'); flag = $("#checkbox-enable_init_date").is(':checked');
if (flag == true) { if (flag == true) {
$("#table1-1-0").css("display", "");
$("#table1-1-1").css("display", ""); $("#table1-1-1").css("display", "");
$("#table1-1-2").css("display", "none"); $("#table1-1-2").css("display", "");
$("#table1-1-3").css("display", ""); $("#string_to").show();
$("#table1-1-6").css("display", "none"); $("#string_items").hide();
} }
else { else {
$("#table1-1-0").css("display", "none");
$("#table1-1-1").css("display", "none"); $("#table1-1-1").css("display", "none");
$("#table1-1-2").css("display", ""); $("#table1-1-2").css("display", "");
$("#table1-1-3").css("display", "none"); $("#string_to").hide();
$("#table1-1-6").css("display", ""); $("#string_items").show();
$("#table1-1-6").css("width", "380.583px");
} }
}); });
}); });