From c6c034b29100a85eac50fbf38e1471bf69caecf2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 2 Sep 2004 10:17:37 +0000 Subject: [PATCH] allow to specify cats by there id again --- calendar/csv_import.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/calendar/csv_import.php b/calendar/csv_import.php index 911876294b..7ece2c16c0 100644 --- a/calendar/csv_import.php +++ b/calendar/csv_import.php @@ -93,9 +93,7 @@ return ''; } - $cats = split('[,;]',$cats); - - foreach($cats as $k => $cat) + foreach(split('[,;]',$cats) as $cat) { if (isset($cat2id[$cat])) { @@ -107,7 +105,11 @@ { $GLOBALS['phpgw']->categories = createobject('phpgwapi.categories'); } - if ($id = $GLOBALS['phpgw']->categories->name2id( addslashes($cat) )) + if (is_numeric($cat) && $GLOBALS['phpgw']->categories->id2name($cat) != '--') + { + $cat2id[$cat] = $ids[$cat] = $cat; + } + elseif ($id = $GLOBALS['phpgw']->categories->name2id( addslashes($cat) )) { // cat exists $cat2id[$cat] = $ids[$cat] = $id; }