assign('CUSTOM_MODULE', true); $smarty->assign('MOD', $mod_strings); $smarty->assign('APP', $app_strings); $smarty->assign('MODULE', $currentModule); $smarty->assign('SINGLE_MOD', $currentModule); $smarty->assign('CATEGORY', $category); $smarty->assign('IMAGE_PATH', "themes/$theme/images/"); $smarty->assign('THEME', $theme); $reqid = vtlib_purify($_REQUEST['id']); $atpoint = vtlib_purify($_REQUEST['atpoint']); // Calculate the paging before hand $prevAtPoint = ($atpoint + 1); $nextAtPoint = ($atpoint - 1); $trackrecord = false; if($_REQUEST['mode'] == 'history') { // Retrieve the track record at required point $trackrecord = ModTracker_Basic::getByCRMId($reqid, $atpoint); // If there is no more older records, show the last record itself if($trackrecord === false && $atpoint > 0) { $atpoint = $atpoint - 1; $prevAtPoint = $atpoint; // Singal no more previous $trackrecord = ModTracker_Basic::getByCRMId($reqid, $atpoint); } } else { $trackrecord = ModTracker_Basic::getById($reqid); } if($trackrecord === false || !$trackrecord->exists()) { $smarty->display(vtlib_getModuleTemplate($currentModule, 'ShowDiffNotExist.tpl')); } else { if ($trackrecord && $trackrecord->isViewPermitted()) { $smarty->assign('TRACKRECORD', $trackrecord); $smarty->assign("ATPOINT", $atpoint); $smarty->assign("ATPOINT_PREV", $prevAtPoint); $smarty->assign("ATPOINT_NEXT", $nextAtPoint); $smarty->display(vtlib_getModuleTemplate($currentModule, 'ShowDiff.tpl')); } else{ $smarty->display(vtlib_getModuleTemplate($currentModule, 'ShowDiffDenied.tpl')); } } ?>