From 2efaf0580377a11cf1622357aac9716450c6e54b Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 20 Jul 2009 12:11:05 +0000 Subject: [PATCH] if there is an & within org_name, org_unit and such, the add to org will not work, as the GET Parameter gets splitted by &; ADDITIONAL: if there is any export limit set, pass it on to the nextmatch, to be evaluated by the export --- addressbook/inc/class.addressbook_bo.inc.php | 2 +- addressbook/inc/class.addressbook_so.inc.php | 2 ++ addressbook/inc/class.addressbook_ui.inc.php | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index c0e06c58de..8b4ad7aacc 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -721,7 +721,7 @@ class addressbook_bo extends addressbook_so function read_org($org_id) { if (!$org_id) return false; - + if (strpos($org_id,'*AND*')!== false) $org_id = str_replace('*AND*','&',$org_id); $org = array(); foreach(explode('|||',$org_id) as $part) { diff --git a/addressbook/inc/class.addressbook_so.inc.php b/addressbook/inc/class.addressbook_so.inc.php index e99a39a5ab..e31119b4a6 100755 --- a/addressbook/inc/class.addressbook_so.inc.php +++ b/addressbook/inc/class.addressbook_so.inc.php @@ -678,6 +678,7 @@ class addressbook_so foreach($rows as $n => $row) { + if (strpos($row['org_name'],'&')!==false) $row['org_name'] = str_replace('&','*AND*',$row['org_name']); //echo "Ampersand found
"; $rows[$n]['id'] = 'org_name:'.$row['org_name']; foreach(array( 'org_unit' => lang('departments'), @@ -690,6 +691,7 @@ class addressbook_so } else { + if (strpos($row[$by],'&')!==false) $row[$by] = str_replace('&','*AND*',$row[$by]); //echo "Ampersand found
"; $rows[$n]['id'] .= '|||'.$by.':'.$row[$by]; } } diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 706deffc11..d272d07b36 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -260,6 +260,8 @@ class addressbook_ui extends addressbook_bo 'vcard' => lang('Export as VCard'), // ToDo: move this to importexport framework ); } + // if there is any export limit set, pass it on to the nextmatch, to be evaluated by the export + if (isset($this->config['contact_export_limit']) && (int)$this->config['contact_export_limit']) $content['nm']['export_limit']=$this->config['contact_export_limit']; $sel_options['action'] += array( 'merge' => lang('Merge into first or account, deletes all other!'), 'cat_add' => lang('Add or delete Categoies'), // add a categirie to multible addresses @@ -317,6 +319,7 @@ class addressbook_ui extends addressbook_bo if (!isset($sel_options['org_view'][(string) $content['nm']['org_view']])) { $org_name = array(); + if (strpos($content['nm']['org_view'],'*AND*')!== false) $content['nm']['org_view'] = str_replace('*AND*','&',$content['nm']['org_view']); foreach(explode('|||',$content['nm']['org_view']) as $part) { list(,$name) = explode(':',$part,2); @@ -396,6 +399,7 @@ class addressbook_ui extends addressbook_bo if (count($checked) > 1) // use a nicely formatted org-name as title in infolog { $parts = array(); + if (strpos($org,'*AND*')!== false) $org = str_replace('*AND*','&',$org); foreach(explode('|||',$org) as $part) { list(,$part) = explode(':',$part,2); @@ -881,6 +885,7 @@ class addressbook_ui extends addressbook_bo } if ($query['org_view']) // view the contacts of one organisation only { + if (strpos($query['org_view'],'*AND*')!== false) $query['org_view'] = str_replace('*AND*','&',$query['org_view']); foreach(explode('|||',$query['org_view']) as $part) { list($name,$value) = explode(':',$part,2);