Added error handling in report admin when datasource is not accessable

This commit is contained in:
Andre Lorbach 2012-12-14 17:39:24 +01:00
parent d0ed1c5e5b
commit 0bcee2b490
2 changed files with 14 additions and 4 deletions

View File

@ -1426,7 +1426,7 @@ function CheckConfiguredLogStreamSource($myReport, $mySourceID)
{
$content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_PERFORMANCE_WARNING'];
$content['MSG_WARNING_CLASS'] = 'PriorityWarning';
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_ADD_MISSINGFIELDS'], $content['SOURCES'][$mySourceID]['Name'] ); // GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_IDNOTFOUND'], $content['ReportID'] );
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_ADD_MISSINGFIELDS'], $content['SOURCES'][$mySourceID]['Name'] );
$content['MSG_WARNING_SUBMITFORM'] = "true";
$content['MSG_WARNING_FORMURL'] .= "optimize=addfields"; // Addmissing fields
}
@ -1434,7 +1434,7 @@ function CheckConfiguredLogStreamSource($myReport, $mySourceID)
{
$content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_PERFORMANCE_WARNING'];
$content['MSG_WARNING_CLASS'] = 'PriorityWarning';
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_OPTIMIZE_INDEXES'], $content['SOURCES'][$mySourceID]['Name'] ); // GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_IDNOTFOUND'], $content['ReportID'] );
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_OPTIMIZE_INDEXES'], $content['SOURCES'][$mySourceID]['Name'] );
$content['MSG_WARNING_SUBMITFORM'] = "true";
$content['MSG_WARNING_FORMURL'] .= "optimize=indexes"; // Add missing INDEXES
}
@ -1442,7 +1442,7 @@ function CheckConfiguredLogStreamSource($myReport, $mySourceID)
{
$content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_PERFORMANCE_WARNING'];
$content['MSG_WARNING_CLASS'] = 'PriorityWarning';
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_OPTIMIZE_TRIGGER'], $content['SOURCES'][$mySourceID]['Name'] ); // GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_IDNOTFOUND'], $content['ReportID'] );
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_OPTIMIZE_TRIGGER'], $content['SOURCES'][$mySourceID]['Name'] );
$content['MSG_WARNING_SUBMITFORM'] = "true";
$content['MSG_WARNING_FORMURL'] .= "optimize=trigger"; // Add missing TRIGGERS
}
@ -1450,10 +1450,18 @@ function CheckConfiguredLogStreamSource($myReport, $mySourceID)
{
$content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_PERFORMANCE_WARNING'];
$content['MSG_WARNING_CLASS'] = 'PriorityWarning';
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_CHANGE_CHECKSUM'], $content['SOURCES'][$mySourceID]['Name'] ); // GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_IDNOTFOUND'], $content['ReportID'] );
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_CHANGE_CHECKSUM'], $content['SOURCES'][$mySourceID]['Name'] );
$content['MSG_WARNING_SUBMITFORM'] = "true";
$content['MSG_WARNING_FORMURL'] .= "optimize=checksum"; // Change Checksum field!
}
else
{
$content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_SOURCE_WARNING'];
$content['MSG_WARNING_CLASS'] = 'PriorityWarning';
$content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_FAILED_SOURCE_CHECK'], $content['SOURCES'][$mySourceID]['Name'], GetErrorMessage($res) );
$content['MSG_WARNING_SUBMITFORM'] = "true";
$content['MSG_WARNING_FORMURL'] .= "forcecheckoptimize=true"; // Change Checksum field!
}
}
else
{

View File

@ -480,6 +480,8 @@ $content['LN_REPORTS_ADDSAVEDREPORT'] = "Add Savedreport and save changes";
$content['LN_REPORTS_EDITSAVEDREPORT'] = "Save changes";
$content['LN_REPORTS_ADDSAVEDREPORTANDRETURN'] = "Add Savedreport and return to reportlist";
$content['LN_REPORTS_EDITSAVEDREPORTANDRETURN'] = "Save changes and return to reportlist";
$content['LN_REPORTS_SOURCE_WARNING'] = "Logstream Source Warning";
$content['LN_REPORTS_ERROR_FAILED_SOURCE_CHECK'] = "Failed to check the datasource '%1' with error '%2'";
$content['LN_REPORTS_'] = "";