#944 Speed-up the display of CSV import history. IF the feature is enabled, the CSV import history is:

1) Displayed asynchronously
2) Based on a specific 'origin' enum fields instead of parsing the userinfo comment

SVN:trunk[3234]
This commit is contained in:
Denis Flaven
2014-07-01 14:09:18 +00:00
parent ede552968b
commit 008cac25b4
9 changed files with 90 additions and 9 deletions

View File

@@ -29,6 +29,7 @@ try
require_once('../approot.inc.php');
require_once(APPROOT.'/application/application.inc.php');
require_once(APPROOT.'/application/itopwebpage.class.inc.php');
require_once(APPROOT.'/application/ajaxwebpage.class.inc.php');
require_once(APPROOT.'/application/startup.inc.php');
@@ -305,7 +306,8 @@ try
// We're doing it for real, let's create a change
$sUserString = CMDBChange::GetCurrentUserName().' (CSV)';
CMDBObject::SetTrackInfo($sUserString);
CMDBObject::SetTrackOrigin('csv-interactive');
$oMyChange = CMDBObject::GetCurrentChange();
}
@@ -1485,14 +1487,21 @@ EOF
if (Utils::GetConfig()->Get('csv_import_history_display'))
{
$oPage->SetCurrentTabContainer('tabs1');
$oPage->SetCurrentTab(Dict::S('UI:History:BulkImports'));
BulkChange::DisplayImportHistory($oPage);
$oPage->SetCurrentTabContainer('tabs1');
$oPage->AddAjaxTab(Dict::S('UI:History:BulkImports'), utils::GetAbsoluteUrlAppRoot().'pages/csvimport.php?step=11', true /* bCache */);
}
}
switch($iStep)
{
case 11:
// Asynchronous tab
$oPage = new ajax_page('');
BulkChange::DisplayImportHistory($oPage);
$oPage->add_ready_script('$("#CSVImportHistory table.listResults").tableHover();');
$oPage->add_ready_script('$("#CSVImportHistory table.listResults").tablesorter( { widgets: ["myZebra", "truncatedList"]} );');
break;
case 10:
// Case generated by BulkChange::DisplayImportHistory
$iChange = (int)utils::ReadParam('changeid', 0);