It looks like you're new here. If you want to get involved, click one of these buttons!
for ($i=$navigation_array['start']; $i<=$navigation_array['end_val']; $i++)
{
if (($i%2)==0)
$list_header .= '<tr height=20 class=evenListRow>';
else
$list_header .= '<tr height=20 class=oddListRow>';
Then replace it with the follwoing code:
//added by raju for related paging
$relmodule=$module;
if ($_REQUEST[module]==$module) $relmodule='';
if ($relatedlist=='HomePage') $relmodule='';
$start=$relmodule.'start';
$end_val=$relmodule.'end_val';
for ($i=$navigation_array[$start]; $i<=$navigation_array[$end_val]; $i++)
{
if (($i%2)==0)
$list_header .= '<tr height=20 class=evenListRow>';
else
$list_header .= '<tr height=20 class=oddListRow>';
//by raju for related view paging
function getRelatedNavigationValues($display, $noofrows, $limit,$relatedmodule)
{
$navigation_array = Array();
global $limitpage_navigation;
$start=$relatedmodule.'start';
$first=$relatedmodule.'first';
$end=$relatedmodule.'end';
$prev=$relatedmodule.'prev';
$next=$relatedmodule.'next';
$end_val=$relatedmodule.'end_val';
$allflag=$relatedmodule.'allflag';
$current=$relatedmodule.'current';
$verylast=$relatedmodule.'verylast';
if(isset($_REQUEST[$allflag]) && $_REQUEST[$allflag] == 'All'){
$navigation_array[$start] =1;
$navigation_array[$first] = 1;
$navigation_array[$end] = 1;
$navigation_array[$prev] =0;
$navigation_array[$next] =0;
$navigation_array[$end_val] =$noofrows;
$navigation_array[$current] =1;
$navigation_array[$allflag] ='Normal';
$navigation_array[$verylast] =1;
return $navigation_array;
}
$mystart = ((($display * $limit) - $limit)+1);
$myend = $mystart + ($limit-1);
if($myend > $noofrows)
{
$myend = $noofrows;
}
$paging = ceil ($noofrows / $limit);
// Display the navigation
if ($display > 1) {
$myprevious = $display - 1;
}
else {
$myprevious=0;
}
if ($noofrows != $limit) {
$mylast = $paging;
$myfirst = 1;
if ($mypaging > $limitpage_navigation) {
$myfirst = $display-floor(($limitpage_navigation/2));
if ($myfirst<1) $myfirst=1;
$mylast = ($limitpage_navigation - 1) + $myfirst;
}
if ($mylast > $paging ) {
$myfirst = $paging - ($limitpage_navigation - 1);
$mylast = $paging;
}
}
if ($display < $paging) {
$mynext = $display + 1;
}
else {
$mynext=0;
}
$navigation_array[$start] = $mystart;
$navigation_array[$first] = $myfirst;
$navigation_array[$end] = $mylast;
$navigation_array[$prev] = $myprevious;
$navigation_array[$next] = $mynext;
$navigation_array[$end_val] = $myend;
$navigation_array[$current] = $display;
$navigation_array[$allflag] ='All';
$navigation_array[$verylast] =$paging;
return $navigation_array;
}
//modified rdhital to improve the pagination
function getTableHeaderNavigation($navigation_array, $url_qry,$module='',$action_val='index',$viewid='')
{
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$output = '<td align="right">';
$record='';
if (isset($_REQUEST['record']) && ($_REQUEST['record']!='')) $record=$_REQUEST['record'];
$dir_name=$_REQUEST['module'];
$relmodule=$module;
if ($_REQUEST[module]==$module) $relmodule='';
$start=$relmodule.'start';
$end_val=$relmodule.'end_val';
$first=$relmodule.'first';
$end=$relmodule.'end';
$allflag=$relmodule.'allflag';
$current=$relmodule.'current';
$next=$relmodule.'next';
$verylast=$relmodule.'verylast';
$prev=$relmodule.'prev';
$output .= '<a href="index.php?module='.$dir_name.'&record='.$record.'&action='.$action_val.$url_qry.'&'.$start.'=1&viewname='.$viewid.'&'.$allflag.'='.$navigation_array[$allflag].'" >'.$navigation_array[$allflag].'</a>&nbsp;';
if(($navigation_array[$prev]) != 0)
{
$output .= '<a href="index.php?module='.$dir_name.'&record='.$record.'&action='.$action_val.$url_qry.'&start=1&viewname='.$viewid.'" title="First"><img src="'.$image_path.'start.gif" border="0" align="absmiddle"></a>&nbsp;';
$output .= '<a href="index.php?module='.$dir_name.'&record='.$record.'&action='.$action_val.$url_qry.'&start='.$navigation_array[$prev].'&viewname='.$viewid.'"><img src="'.$image_path.'previous.gif" border="0" align="absmiddle"></a>&nbsp;';
}
else
{
$output .= '<img src="'.$image_path.'start_disabled.gif" border="0" align="absmiddle">&nbsp;';
$output .= '<img src="'.$image_path.'previous_disabled.gif" border="0" align="absmiddle">&nbsp;';
}
for ($i=$navigation_array[$first];$i<=$navigation_array[$end];$i++){
if ($navigation_array[$current]==$i){
$output .='<b>'.$i.'</b>&nbsp;';
}
else{
$output .= '<a href="index.php?module='.$dir_name.'&record='.$record.'&action='.$action_val.$url_qry.'&'.$start.'='.$i.'&viewname='.$viewid.'" >'.$i.'</a>&nbsp;';
}
}
if(($navigation_array[$next]) !=0)
{
$output .= '<a href="index.php?module='.$dir_name.'&record='.$record.'&action='.$action_val.$url_qry.'&'.$start.'='.$navigation_array[$next].'&viewname='.$viewid.'"><img src="'.$image_path.'next.gif" border="0" align="absmiddle"></a>&nbsp;';
$output .= '<a href="index.php?module='.$dir_name.'&record='.$record.'&action='.$action_val.$url_qry.'&'.$start.'='.$navigation_array[$verylast].'&viewname='.$viewid.'"><img src="'.$image_path.'end.gif" border="0" align="absmiddle"></a>&nbsp;';
}
else
{
$output .= '<img src="'.$image_path.'next_disabled.gif" border="0" align="absmiddle">&nbsp;';
$output .= '<img src="'.$image_path.'end_disabled.gif" border="0" align="absmiddle">&nbsp;';
}
$output .= '</td>';
return $output;
}
Comments
no the tabbed view is from another modification. this one only creates pagination in the related modules.
raju
jay
i would really like to set up my tabbed views to look like your. i have added fredy's tabbed view mod, but it seems when i add your code changes it affects the tabbed views. instead of showing just the appropriate module functions under the tab, i get all the modules as shown. i also loose the ability to click the tab that shows additional detail in the detailed view of accounts and contacts.
jay
jay
the tabbed view i have is not from fredy. it actually is not a tab for the related view, its actually the various blocks of entity details into tabs. the one i have is some modified version of mikes contribution back in august i think. about fredy's tab i havent tried it at all. anyway i think if you look at the new 5.0 the tabs issue will be little different. so lets see. i would like to help but i am working on creating some other ui enhancement like autocompleting text fields for invoices and so on. hope fredy might also be able to help.
regards
raju
jay
i noticed that i had problem with global search after my mod, so here is the new solution to get global search working. please instead of the code i gave earlier for fucntion named getlistviewentries in include/utils.php use this one
just added the two new lines and now global search works. this is something vtigercrm really has to improve. you have no idea about fucntion dependency until you get a problem. i hope with version 5 the codes will be more structured and modular.
ok enjoy the mod.
raju