Code Duplication    Length = 7-8 lines in 2 locations

class/ticketList.php 1 location

@@ 196-203 (lines=8) @@
193
        $crit->setOrder('ASC');
194
        $globalSearches =& $hSavedSearches->getObjects($crit, true);
195
        $i = 1;
196
        foreach($globalSearches as $search){
197
            $list =& $this->create();
198
            $list->setVar('uid', $uid);
199
            $list->setVar('searchid', $search->getVar('id'));
200
            $list->setVar('weight', $i);
201
            $ret = $this->insert($list, true);
202
            $i++;
203
        }
204
205
        return $ret;
206
    }

functions.php 1 location

@@ 1282-1288 (lines=7) @@
1279
        $ret = $hSavedSearch->insert($newSearch, true);
1280
1281
        $staff =& $hStaff->getObjects(null, true);
1282
        foreach($staff as $stf){
1283
            $list =& $hTicketList->create();
1284
            $list->setVar('uid', $stf->getVar('uid'));
1285
            $list->setVar('searchid', $newSearch->getVar('id'));
1286
            $list->setVar('weight', $i);
1287
            $ret = $hTicketList->insert($list, true);
1288
        }
1289
        $i++;
1290
    }
1291