[Vtigercrm-commits] [vtiger-commits] r5555 - in /vtigercrm/branches/4.2: include/ modules/Accounts/ modules/Activities/ modules/Contacts/ modules/Emails/ modules/Faq/ modules/HelpDesk/ modules/Invoice/ modules/Leads/ modules/Notes/ modules/Orders/ modules/Potentials/ modules/Products/ modules/Quotes/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Fri Apr 28 00:20:17 EDT 2006
Author: allanbush
Date: Thu Apr 27 22:20:06 2006
New Revision: 5555
Log:
Added rdhital's Improved pagination for List Views (http://forums.vtiger.com/viewtopic.php?t=3251). Refs #750.
Modified:
vtigercrm/branches/4.2/include/uifromdbutil.php
vtigercrm/branches/4.2/include/utils.php
vtigercrm/branches/4.2/modules/Accounts/ListView.php
vtigercrm/branches/4.2/modules/Activities/ListView.php
vtigercrm/branches/4.2/modules/Contacts/ListView.php
vtigercrm/branches/4.2/modules/Emails/ListView.php
vtigercrm/branches/4.2/modules/Faq/ListView.php
vtigercrm/branches/4.2/modules/HelpDesk/ListView.php
vtigercrm/branches/4.2/modules/Invoice/ListView.php
vtigercrm/branches/4.2/modules/Leads/ListView.php
vtigercrm/branches/4.2/modules/Notes/ListView.php
vtigercrm/branches/4.2/modules/Orders/ListView.php
vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php
vtigercrm/branches/4.2/modules/Potentials/ListView.php
vtigercrm/branches/4.2/modules/Products/ListView.php
vtigercrm/branches/4.2/modules/Products/PriceBookListView.php
vtigercrm/branches/4.2/modules/Products/VendorListView.php
vtigercrm/branches/4.2/modules/Quotes/ListView.php
Modified: vtigercrm/branches/4.2/include/uifromdbutil.php
==============================================================================
--- vtigercrm/branches/4.2/include/uifromdbutil.php (original)
+++ vtigercrm/branches/4.2/include/uifromdbutil.php Thu Apr 27 22:20:06 2006
@@ -140,29 +140,34 @@
$output = '<td align="right">';
$dir_name=getModuleDirName($module);
- if(isset($navigation_array['prev']))
- {
+ $output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start=1&viewname='.$viewid.'&allflag='.$navigation_array['allflag'].'" >'.$navigation_array['allflag'].'</a> ';
+ if(($navigation_array['prev']) != 0) {
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start=1&viewname='.$viewid.'" title="First"><img src="'.$image_path.'start.gif" border="0" align="absmiddle"></a> ';
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$navigation_array['prev'].'&viewname='.$viewid.'"><img src="'.$image_path.'previous.gif" border="0" align="absmiddle"></a> ';
- }
- else
- {
+ } else {
$output .= '<img src="'.$image_path.'start_disabled.gif" border="0" align="absmiddle"> ';
$output .= '<img src="'.$image_path.'previous_disabled.gif" border="0" align="absmiddle"> ';
}
- if(isset($navigation_array['next']))
- {
+
+ for ($i=$navigation_array['first'];$i<=$navigation_array['end'];$i++) {
+ if ($navigation_array['current']==$i) {
+ $output .='<b>'.$i.'</b> ';
+ } else {
+ $output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$i.'&viewname='.$viewid.'" >'.$i.'</a> ';
+ }
+ }
+
+ if(($navigation_array['next']) !=0) {
$output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$navigation_array['next'].'&viewname='.$viewid.'"><img src="'.$image_path.'next.gif" border="0" align="absmiddle"></a> ';
- $output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$navigation_array['end'].'&viewname='.$viewid.'"><img src="'.$image_path.'end.gif" border="0" align="absmiddle"></a> ';
- }
- else
- {
+ $output .= '<a href="index.php?module='.$dir_name.'&action='.$action_val.$url_qry.'&start='.$navigation_array['verylast'].'&viewname='.$viewid.'"><img src="'.$image_path.'end.gif" border="0" align="absmiddle"></a> ';
+ } else {
$output .= '<img src="'.$image_path.'next_disabled.gif" border="0" align="absmiddle"> ';
$output .= '<img src="'.$image_path.'end_disabled.gif" border="0" align="absmiddle"> ';
}
+
$output .= '</td>';
- return $output;
+ return $output;
}
?>
Modified: vtigercrm/branches/4.2/include/utils.php
==============================================================================
--- vtigercrm/branches/4.2/include/utils.php (original)
+++ vtigercrm/branches/4.2/include/utils.php Thu Apr 27 22:20:06 2006
@@ -2486,69 +2486,68 @@
return $user_id;
}
//outlook security
-function getNavigationValues($start, $noofrows, $list_max_entries_per_page)
-{
+function getNavigationValues($display, $noofrows, $limit)
+{
+ global $limitpage_navigation;
+ if(!isset($limitpage_navigation)) $limitpage_navigation = 5;
+
$navigation_array = Array();
- require_once('config.php');
- //Setting the start to end counter
- $starttoendvaluecounter = $list_max_entries_per_page - 1;
- //Setting the ending value
- if($noofrows > $list_max_entries_per_page)
- {
- $end = $start + $starttoendvaluecounter;
- if($end > $noofrows)
- {
- $end = $noofrows;
- }
- $startvalue = 1;
- $remainder = $noofrows % $list_max_entries_per_page;
- if($remainder > 0)
- {
- $endval = $noofrows - $remainder + 1;
- }
- elseif($remainder == 0)
- {
- $endval = $noofrows - $starttoendvaluecounter;
- }
- }
- else
- {
+ 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;
+ }
+
+ $start = ((($display * $limit) - $limit)+1);
+ $end = $start + ($limit-1);
+ if($end > $noofrows) {
$end = $noofrows;
}
-
-
- //Setting the next and previous value
- if(isset($start) && $start != '')
- {
- $tempnextstartvalue = $start + $list_max_entries_per_page;
- if($tempnextstartvalue <= $noofrows)
- {
-
- $nextstartvalue = $tempnextstartvalue;
- }
- $tempprevvalue = $_REQUEST['start'] - $list_max_entries_per_page;
- if($tempprevvalue > 0)
- {
- $prevstartvalue = $tempprevvalue;
- }
- }
- else
- {
- if($noofrows > $list_max_entries_per_page)
- {
- $nextstartvalue = $list_max_entries_per_page + 1;
- }
+ $paging = ceil ($noofrows / $limit);
+ // Display the navigation
+ if ($display > 1) {
+ $previous = $display - 1;
+ } else {
+ $previous=0;
+ }
+ if ($noofrows != $limit) {
+ $last = $paging;
+ $first = 1;
+ if ($paging > $limitpage_navigation) {
+ $first = $display-floor(($limitpage_navigation/2));
+ if ($first<1) $first=1;
+ $last = ($limitpage_navigation - 1) + $first;
+ }
+ if ($last > $paging ) {
+ $first = $paging - ($limitpage_navigation - 1);
+ $last = $paging;
+ }
+ }
+ if ($display < $paging) {
+ $next = $display + 1;
+ } else {
+ $next=0;
}
$navigation_array['start'] = $start;
- $navigation_array['end'] = $endval;
- $navigation_array['prev'] = $prevstartvalue;
- $navigation_array['next'] = $nextstartvalue;
+ $navigation_array['first'] = $first;
+ $navigation_array['end'] = $last;
+ $navigation_array['prev'] = $previous;
+ $navigation_array['next'] = $next;
$navigation_array['end_val'] = $end;
- return $navigation_array;
-
-}
+ $navigation_array['current'] = $display;
+ $navigation_array['allflag'] ='All';
+ $navigation_array['verylast'] =$paging;
+ return $navigation_array;
+}
function getURLstring($focus)
{
Modified: vtigercrm/branches/4.2/modules/Accounts/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Accounts/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Accounts/ListView.php Thu Apr 27 22:20:06 2006
@@ -430,49 +430,17 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Activities/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Activities/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Activities/ListView.php Thu Apr 27 22:20:06 2006
@@ -317,48 +317,16 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Contacts/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Contacts/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Contacts/ListView.php Thu Apr 27 22:20:06 2006
@@ -394,48 +394,17 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Emails/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Emails/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Emails/ListView.php Thu Apr 27 22:20:06 2006
@@ -315,48 +315,16 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Faq/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Faq/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Faq/ListView.php Thu Apr 27 22:20:06 2006
@@ -127,48 +127,16 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/HelpDesk/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/HelpDesk/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/HelpDesk/ListView.php Thu Apr 27 22:20:06 2006
@@ -398,48 +398,16 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Invoice/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Invoice/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Invoice/ListView.php Thu Apr 27 22:20:06 2006
@@ -290,49 +290,17 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Leads/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Leads/ListView.php Thu Apr 27 22:20:06 2006
@@ -410,48 +410,16 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Notes/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Notes/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Notes/ListView.php Thu Apr 27 22:20:06 2006
@@ -238,48 +238,16 @@
</script>";
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
Modified: vtigercrm/branches/4.2/modules/Orders/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Orders/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Orders/ListView.php Thu Apr 27 22:20:06 2006
@@ -301,49 +301,17 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php (original)
+++ vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php Thu Apr 27 22:20:06 2006
@@ -283,48 +283,16 @@
</script>";
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Potentials/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Potentials/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Potentials/ListView.php Thu Apr 27 22:20:06 2006
@@ -400,47 +400,16 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Products/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Products/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Products/ListView.php Thu Apr 27 22:20:06 2006
@@ -342,48 +342,16 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Products/PriceBookListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Products/PriceBookListView.php (original)
+++ vtigercrm/branches/4.2/modules/Products/PriceBookListView.php Thu Apr 27 22:20:06 2006
@@ -242,48 +242,16 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Products/VendorListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Products/VendorListView.php (original)
+++ vtigercrm/branches/4.2/modules/Products/VendorListView.php Thu Apr 27 22:20:06 2006
@@ -347,48 +347,16 @@
</script>";
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
Modified: vtigercrm/branches/4.2/modules/Quotes/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Quotes/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Quotes/ListView.php Thu Apr 27 22:20:06 2006
@@ -312,49 +312,17 @@
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = $_REQUEST['start'];
-}
-else
-{
-
+} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-// Setting the record count string
-if ($navigation_array['start'] == 1)
-{
- if($noofrows != 0)
- $start_rec = $navigation_array['start'];
- else
- $start_rec = 0;
- if($noofrows > $list_max_entries_per_page)
- {
- $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
- }
- else
- {
- $end_rec = $noofrows;
- }
-
-}
-else
-{
- if($navigation_array['next'] > $list_max_entries_per_page)
- {
- $start_rec = $navigation_array['next'] - $list_max_entries_per_page;
- $end_rec = $navigation_array['next'] - 1;
- }
- else
- {
- $start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
- $end_rec = $noofrows;
- }
-}
+$start_rec = $navigation_array['start'];
+$end_rec = $navigation_array['end_val'];
+
$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
//Retreive the List View Table Header
More information about the vtigercrm-commits
mailing list