$customviewcombo_html = $oCustomView->getCustomViewCombo($viewid);
$viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
//Added to handle approving or denying status-public by the admin in CustomView
$statusdetails = $oCustomView->isPermittedChangeStatus($viewnamedesc['status']);
$smarty->assign("CUSTOMVIEW_PERMISSION", $statusdetails);
//To check if a user is able to edit/delete a customview
$edit_permit = $oCustomView->isPermittedCustomView($viewid, 'EditView', $currentModule);
$delete_permit = $oCustomView->isPermittedCustomView($viewid, 'Delete', $currentModule);
$smarty->assign("CV_EDIT_PERMIT", $edit_permit);
$smarty->assign("CV_DELETE_PERMIT", $delete_permit);
//<<<<<customview>>>>>
$smarty->assign("CHANGE_OWNER", getUserslist());
$smarty->assign("CHANGE_GROUP_OWNER", getGroupslist());
// Buttons and View options
if ($viewid != 0) {
    $CActionDtls = $oCustomView->getCustomActionDetails($viewid);
} elseif ($viewid == 0) {
    echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
    echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'>\n\n\t\t<table border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t<tbody><tr>\n\t\t<td rowspan='2' width='11%'><img src='" . vtiger_imageurl('denied.gif', $theme) . "' ></td>\n\t\t<td style='border-bottom: 1px solid rgb(204, 204, 204);' nowrap='nowrap' width='70%'>\n\t\t\t<span class='genHeaderSmall'>{$app_strings['LBL_PERMISSION']}</span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class='small' align='right' nowrap='nowrap'>\n\t\t<a href='javascript:window.history.back();'>{$app_strings['LBL_GO_BACK']}</a><br>\n\t\t</td>\n\t\t</tr>\n\t\t</tbody></table>\n\t\t</div>";
    echo "</td></tr></table>";
    exit;
}
if (isPermitted('Contacts', 'Delete', '') == 'yes') {
    $other_text['del'] = $app_strings[LBL_MASS_DELETE];
}
if (isPermitted('Contacts', 'EditView', '') == 'yes') {
    $other_text['mass_edit'] = $app_strings[LBL_MASS_EDIT];
    $other_text['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
}
if (isPermitted('Emails', 'EditView', '') == 'yes') {
    $other_text['s_mail'] = $app_strings[LBL_SEND_MAIL_BUTTON];