Code Duplication    Length = 7-7 lines in 2 locations

admin/main.php 2 locations

@@ 1556-1562 (lines=7) @@
1553
                $tblTmp   = array();
1554
                $criteria = new Criteria('ba_book_id', $book->getVar('book_id'), '=');
1555
                $tblTmp   = $h_bookshop_booksauthors->getObjects($criteria);
1556
                foreach ($tblTmp as $bookAuthor) {
1557
                    $newBookAuthor = $bookAuthor->xoopsClone();
1558
                    $newBookAuthor->setVar('ba_book_id', $newBookId);
1559
                    $newBookAuthor->setVar('ba_id', 0);
1560
                    $newBookAuthor->setNew();
1561
                    $h_bookshop_booksauthors->insert($newBookAuthor, true);
1562
                }
1563
                // Copie des livres relatifs
1564
                $tblTmp   = array();
1565
                $criteria = new Criteria('related_book_id', $book->getVar('book_id'), '=');
@@ 1567-1573 (lines=7) @@
1564
                $tblTmp   = array();
1565
                $criteria = new Criteria('related_book_id', $book->getVar('book_id'), '=');
1566
                $tblTmp   = $h_bookshop_related->getObjects($criteria);
1567
                foreach ($tblTmp as $related) {
1568
                    $newRelated = $related->xoopsClone();
1569
                    $newRelated->setVar('related_book_id', $newBookId);
1570
                    $newRelated->setVar('related_id', 0);
1571
                    $newRelated->setNew();
1572
                    $h_bookshop_related->insert($newRelated, true);
1573
                }
1574
                bookshop_redirect(_AM_BOOKSHOP_SAVE_OK, $baseurl . '?op=books', 2);
1575
            } else {
1576
                bookshop_redirect(_AM_BOOKSHOP_SAVE_PB, $baseurl . '?op=books', 5);