backport infolog search features from nathan gray; may not be effective until the rest of his commits are in place, but they do not seem to break anything

This commit is contained in:
Klaus Leithoff 2009-12-14 09:21:02 +00:00
parent 18f03e6314
commit 410ab6a6a2
4 changed files with 11 additions and 4 deletions

View File

@ -924,16 +924,19 @@ class infolog_bo
* Is called as hook to participate in the linking * Is called as hook to participate in the linking
* *
* @param string $pattern pattern to search * @param string $pattern pattern to search
* @param array $options Array of options for the search
* @return array with info_id - title pairs of the matching entries * @return array with info_id - title pairs of the matching entries
*/ */
function link_query( $pattern ) function link_query( $pattern, Array &$options = array() )
{ {
$query = array( $query = array(
'search' => $pattern, 'search' => $pattern,
'start' => 0, 'start' => $options['start'],
'num_rows' => $options['num_rows'],
'subs' => true, 'subs' => true,
); );
$ids = $this->search($query); $ids = $this->search($query);
$options['total'] = $query['total'];
$content = array(); $content = array();
if (is_array($ids)) if (is_array($ids))
{ {

View File

@ -32,6 +32,7 @@ class infolog_hooks
'action' => 'sp' 'action' => 'sp'
), ),
'view_id' => 'action_id', 'view_id' => 'action_id',
'view_list' => 'infolog.infolog_ui.index',
'add' => array( 'add' => array(
'menuaction' => 'infolog.infolog_ui.edit', 'menuaction' => 'infolog.infolog_ui.edit',
'type' => 'task' 'type' => 'task'

View File

@ -378,7 +378,7 @@ class infolog_ical extends infolog_bo
break; break;
case 'PRIORITY': case 'PRIORITY':
if (1 <= $attributes['value'] && $attributes['value'] <= 3) { if (1 <= $attributes['value'] && $attributes['value'] <= 9) {
$taskData['info_priority'] = $this->vcal_priority2egw_priority[$attributes['value']]; $taskData['info_priority'] = $this->vcal_priority2egw_priority[$attributes['value']];
} else { } else {
$taskData['info_priority'] = 1; // default = normal $taskData['info_priority'] = 1; // default = normal

View File

@ -545,6 +545,9 @@ class infolog_ui
$values['action'] = $action; $values['action'] = $action;
$values['action_id'] = $action_id; $values['action_id'] = $action_id;
} }
if($_GET['search']) {
$values['nm']['search'] = $_GET['search'];
}
if ($values['nm']['add']) if ($values['nm']['add'])
{ {
$values['add'] = $values['nm']['add']; $values['add'] = $values['nm']['add'];
@ -880,7 +883,7 @@ class infolog_ui
if ($content['info_contact']) if ($content['info_contact'])
{ {
$old_link_id = (int)$content['info_link_id']; $old_link_id = (int)$content['info_link_id'];
list($app,$id) = explode(':',$content['info_contact']); list($app,$id) = explode(':',$content['info_contact'], 2);
$content['info_link_id'] = (int)($info_link_id = egw_link::link('infolog',$content['link_to']['to_id'],$app,$id)); $content['info_link_id'] = (int)($info_link_id = egw_link::link('infolog',$content['link_to']['to_id'],$app,$id));
if ($old_link_id && $old_link_id != $content['info_link_id']) egw_link::unlink($old_link_id); if ($old_link_id && $old_link_id != $content['info_link_id']) egw_link::unlink($old_link_id);
} }