From c545d8b95ddd2f9307cc99ca5a0efaac8daf49b9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 2 Sep 2004 10:32:15 +0000 Subject: [PATCH] allow to specify cats by there id again --- infolog/csv_import.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/infolog/csv_import.php b/infolog/csv_import.php index aa4a02339b..4fddfdbf7c 100644 --- a/infolog/csv_import.php +++ b/infolog/csv_import.php @@ -103,9 +103,7 @@ function cat_id($cats) } // no multiple cat's in InfoLog atm. - $cats = array($cats); //split('[,;]',$cats); - - foreach($cats as $k => $cat) + foreach(array($cats) /*split('[,;]',$cats)*/ as $cat) { if (isset($cat2id[$cat])) { @@ -117,7 +115,11 @@ function cat_id($cats) { $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; }