info("Import Step last");
$parenttab = getParenttab();
//This Buttons_List1.tpl is is called to display the add, search, import and export buttons ie., second level tabs
$smarty = new vtigerCRM_Smarty;
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("IMP", $import_mod_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE", vtlib_purify($_REQUEST['modulename']));
$smarty->assign("SINGLE_MOD", vtlib_purify($_REQUEST['modulename']));
$smarty->assign("CATEGORY", vtlib_purify($_SESSION['import_parenttab']));
//@session_unregister("import_parenttab");
if($req_module != 'Accounts' || $req_module != 'Contacts' || $req_module != 'Products' || $req_module != 'Leads' || $req_module != 'HelpDesk' || $req_module != 'Potentials' || $req_module != 'Vendors' )
{
$smarty->display("Buttons_List1.tpl");
}
if ( isset($_REQUEST['message']))
{
?>
";
$return_module=vtlib_purify($_REQUEST['modulename']);
$ret_arr=getDuplicateRecordsArr($req_module);
$fld_values=$ret_arr[0];
$total_num_group=count($fld_values);
$fld_name=$ret_arr[1];
$smarty->assign("MODULE",$req_module);
$smarty->assign("MODULELABEL",getTranslatedString($req_module,$req_module));
$smarty->assign("NUM_GROUP",$total_num_group);
$smarty->assign("FIELD_NAMES",$fld_name);
$smarty->assign("CATEGORY",$parenttab);
$smarty->assign("ALL_VALUES",$fld_values);
$smarty->assign("MOD", return_module_language($current_language,'Contacts'));
$smarty->assign("IMAGE_PATH",$image_path);
$smarty->assign("APP", $app_strings);
$smarty->assign("CMOD", $mod_strings);
$smarty->assign("MODE",'view');
$smarty->assign("NAVIGATION",$ret_arr["navigation"]);//Added for page navigation
if(isPermitted($req_module,'Delete','') == 'yes')
$button_del = $app_strings[LBL_MASS_DELETE];
$smarty->assign("DELETE",$button_del);
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("FindDuplicateAjax.tpl");
else
$smarty->display('FindDuplicateDisplay.tpl');
}
else
{
echo "
";
$currentModule = "Import";
global $limit;
global $list_max_entries_per_page;
$implict_account = false;
$import_modules_array = Array(
"Leads"=>"Leads",
"Accounts"=>"Accounts",
"Contacts"=>"Contacts",
"Potentials"=>"Potentials",
"Products"=>"Products",
"HelpDesk"=>"ImportTicket",
"Vendors"=>"ImportVendors"
);
// vtlib customization: Hook provide to include custom modules
$module = $_REQUEST['modulename'];
checkFileAccess("modules/$module/$module.php");
require_once("modules/$module/$module.php");
$import_modules_array[$module] = $module;
// END
foreach($import_modules_array as $module_name => $object_name)
{
$seedUsersLastImport = new UsersLastImport();
$seedUsersLastImport->bean_type = $module_name;
$list_query = $seedUsersLastImport->create_list_query($o,$w);
$current_module_strings = return_module_language($current_language, $module_name);
$object = new $object_name();
$seedUsersLastImport->list_fields = $object->list_fields;
$list_result = $adb->query($list_query);
//Retreiving the no of rows
$noofrows = $adb->num_rows($list_result);
if($noofrows>=1)
{
if($module_name != 'Accounts')
{
$implict_account=true;
}
if($module_name == 'Accounts' && $implict_account==true)
$display_header_msg = "Newly created Accounts";
else
$display_header_msg = "".$mod_strings['LBL_LAST_IMPORTED']." ".$app_strings[$module_name]."";
//Display the Header Message
echo "
|
".$mod_strings['LBL_LAST_IMPORTED']." ".$app_strings[$module_name]."
|
";
$smarty = new vtigerCRM_Smarty;
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("IMAGE_PATH",$image_path);
$smarty->assign("MODULE",$module_name);
$smarty->assign("MODULELABEL",getTranslatedString($module_name,$module_name));
$smarty->assign("SINGLE_MOD",$module_name);
$smarty->assign("SHOW_MASS_SELECT",'false');
//Retreiving the start value from request
if($module_name == $_REQUEST['nav_module'] && isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = vtlib_purify($_REQUEST['start']);
} else {
$start = 1;
}
$info_message='&recordcount='.vtlib_purify($_REQUEST['recordcount']).'&noofrows='.vtlib_purify($_REQUEST['noofrows']).'&message='.vtlib_purify($_REQUEST['message']).'&skipped_record_count='.vtlib_purify($_REQUEST['skipped_record_count']);
$url_string = '&modulename='.vtlib_purify($_REQUEST['modulename']).'&nav_module='.$module_name.$info_message;
$viewid = '';
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string,"Import","ImportSteplast",$viewid);
//Retreive the List View Header and Entries
$listview_header = getListViewHeader($object,$module_name);
$listview_entries = getListViewEntries($object,$module_name,$list_result,$navigation_array,"","","EditView","Delete","");
//commented to remove navigation buttons from import list view
//$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("HIDE_CUSTOM_LINKS", 1);//Added to hide the CustomView links in imported records ListView
// Remove all the links for the list view header as they do not work in this page.
for($i=0;$iassign("LISTHEADER", $listview_header);
$smarty->assign("LISTENTITY", $listview_entries);
$smarty->display("ListViewEntries.tpl");
echo "
";
}
}
}
?>