/** * Function to show result of undo import * @param Vtiger_Request $request */ public function undoImport(Vtiger_Request $request) { $currentUserModel = Users_Record_Model::getCurrentUserModel(); $moduleName = $request->getModule(); $lastImport = new iCalLastImport(); $returnValue = $lastImport->undo($moduleName, $currentUserModel->getId()); if (!empty($returnValue)) { $undoStatus = true; } else { $undoStatus = false; } $viewer = $this->getViewer($request); $viewer->assign('MODULE', $moduleName); $viewer->assign('VIEW', 'List'); $viewer->assign('UNDO_STATUS', $undoStatus); $viewer->view('ImportFinalResult.tpl', $moduleName); }
$smarty->assign("RETURN_MODULE", $currentModule); $smarty->assign("RETURN_ACTION", 'ListView'); $smarty->assign("MODULE", $currentModule); $smarty->assign("MODULENAME", $currentModule); $smarty->display("iCalImport.tpl"); } else { $smarty->assign("IMAGE_PATH", $last_imported); $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['module'])); $smarty->assign("SINGLE_MOD", vtlib_purify($_REQUEST['module'])); $smarty->display("Buttons_List1.tpl"); $last_import = new iCalLastImport(); $ret_value = $last_import->undo('Calendar', $current_user->id); if (!empty($ret_value)) { $message = "<b>" . $mod_strings['LBL_SUCCESS'] . "</b>" . "<br><br>" . $mod_strings['LBL_LAST_IMPORT_UNDONE'] . " "; } else { $message = "<b>" . $mod_strings['LBL_FAILURE'] . "</b>" . "<br><br>" . $mod_strings['LBL_NO_IMPORT_TO_UNDO'] . " "; } $smarty->assign("MESSAGE", $message); $smarty->assign("UNDO", 'yes'); $smarty->assign("RETURN_MODULE", $currentModule); $smarty->assign("RETURN_ACTION", 'ListView'); $smarty->assign("MODULE", $currentModule); $smarty->assign("MODULENAME", $currentModule); $smarty->display("iCalImport.tpl"); }