On page
support/user/(id)
works support_page_user function.
When creating a count_query the code
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {support_ticket} t ON n.nid = t.nid LEFT JOIN {comments} c ON n.nid = c.nid WHERE (c.status = ". COMMENT_PUBLISHED ." OR c.status IS NULL) AND n.status = 1 AND n.type = 'support_ticket' AND t.assigned = $user->uid $state";
does not check if $assigned=false, And result of this query returns zero even if we have rows to show.
I have changed the code above on this:
if (!$assigned) {
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {support_ticket} t ON n.nid = t.nid LEFT JOIN {comments} c ON n.nid = c.nid WHERE (c.status = ". COMMENT_PUBLISHED ." OR c.status IS NULL) AND n.status = 1 AND n.type = 'support_ticket' AND (t.assigned = $user->uid OR n.uid = $user->uid) $state";
} else {
$sql_count = "SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {support_ticket} t ON n.nid = t.nid LEFT JOIN {comments} c ON n.nid = c.nid WHERE (c.status = ". COMMENT_PUBLISHED ." OR c.status IS NULL) AND n.status = 1 AND n.type = 'support_ticket' AND t.assigned = $user->uid $state";
}
and it began work correct.
Comments
Comment #1
natbampo commentedAlso in support.admin.inc
function support_admin_settings() {
...
$form['general']['support_secondary_sort_order'] = array(
'#type' => 'radios',
'#title' => t('Secondary sort order'),
'#description' => t('If specifying a secondary sort column, you can also specify a secondary sort order..'),
'#options' => array(t('Ascending'), t('Descending')),
'#default_value' => variable_get('support_default_sort_order', SUPPORT_SORT_DESC),
);
...
}
And in support.user.in in function support_page_user you did not use support_secondary_sort_order order at all, but used only support_default_sort_order for both columns.
Comment #2
purencool commented