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

This commit is contained in:
Klaus Leithoff 2009-07-20 12:11:05 +00:00
parent 21d2db0e54
commit 2efaf05803
3 changed files with 8 additions and 1 deletions

View File

@ -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)
{

View File

@ -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<br>";
$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<br>";
$rows[$n]['id'] .= '|||'.$by.':'.$row[$by];
}
}

View File

@ -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);