Code Duplication    Length = 7-7 lines in 2 locations

letter.php 2 locations

@@ 284-290 (lines=7) @@
281
                        continue;
282
                    }
283
                    // get categories
284
                    foreach ($letter_cat_ids as $letter_cat_id) {
285
                        $catObj = $helper->getHandler('Cat')->get($letter_cat_id);
286
                        if ($grouppermHandler->checkRight('newsletter_read_cat', $catObj->getVar('cat_id'), $groups, $helper->getModule()->mid())) {
287
                            $letter_filter[] = $letterObj->getVar('letter_id');
288
                        }
289
                        unset($catObj);
290
                    }
291
                }
292
            }
293
        }
@@ 334-340 (lines=7) @@
331
                }
332
                // get categories
333
                unset($letter_array['letter_cats']); // IN PROGRESS
334
                foreach ($letter_cat_ids as $letter_cat_id) {
335
                    $catObj = $helper->getHandler('Cat')->get($letter_cat_id);
336
                    if ($grouppermHandler->checkRight('newsletter_read_cat', $catObj->getVar('cat_id'), $groups, $helper->getModule()->mid())) {
337
                        $letter_array['letter_cats'][] = $catObj->toArray();
338
                    }
339
                    unset($catObj);
340
                }
341
                // count letter attachements
342
                $attachmentCriteria = new \CriteriaCompo();
343
                $attachmentCriteria->add(new \Criteria('attachment_letter_id', $letterObj->getVar('letter_id')));