Code Duplication    Length = 5-6 lines in 8 locations

functions.php 1 location

@@ 1010-1014 (lines=5) @@
1007
{
1008
    $hSavedSearch =& xhelpGetHandler('savedSearch');
1009
1010
    if (is_array($users)) {
1011
        $crit = new Criteria('uid', "(". implode($users, ',') .")", 'IN');
1012
    } else {
1013
        $crit = new Criteria('uid', intval($users));
1014
    }
1015
1016
    $savedSearches = $hSavedSearch->getObjects($crit);
1017

index.php 7 locations

@@ 270-275 (lines=6) @@
267
    unset($depts);
268
269
    //Retrieve all member information for the current page
270
    if (count($all_users)) {
271
        $crit  = new Criteria('uid', "(". implode(array_keys($all_users), ',') .")", 'IN');
272
        $users =& xhelpGetUsers($crit, $displayName);
273
    } else {
274
        $users = array();
275
    }
276
    $sortedTickets =& _updateBatchTicketInfo($sortedTickets, $users, $j);
277
278
    $xoopsOption['template_main'] = 'xhelp_setdept.html';   // Set template
@@ 341-346 (lines=6) @@
338
    unset($oTickets);
339
340
    //Retrieve all member information for the current page
341
    if (count($all_users)) {
342
        $crit  = new Criteria('uid', "(". implode(array_keys($all_users), ',') .")", 'IN');
343
        $users =& xhelpGetUsers($crit, $displayName);
344
    } else {
345
        $users = array();
346
    }
347
    $sortedTickets =& _updateBatchTicketInfo($sortedTickets, $users, $j);
348
349
    //Get Array of priorities/descriptions
@@ 427-432 (lines=6) @@
424
    unset($oTickets);
425
426
    //Retrieve all member information for the current page
427
    if (count($all_users)) {
428
        $crit  = new Criteria('uid', "(". implode(array_keys($all_users), ',') .")", 'IN');
429
        $users =& xhelpGetUsers($crit, $displayName);
430
    } else {
431
        $users = array();
432
    }
433
    $sortedTickets =& _updateBatchTicketInfo($sortedTickets, $users, $j);
434
435
    //Get Array of Status/Descriptions
@@ 509-514 (lines=6) @@
506
    unset($oTickets);
507
508
    //Retrieve all member information for the current page
509
    if (count($all_users)) {
510
        $crit  = new Criteria('uid', "(". implode(array_keys($all_users), ',') .")", 'IN');
511
        $users =& xhelpGetUsers($crit, $displayName);
512
    } else {
513
        $users = array();
514
    }
515
    $sortedTickets =& _updateBatchTicketInfo($sortedTickets, $users, $j);
516
517
    $aOwners = array();
@@ 612-617 (lines=6) @@
609
    unset($oTickets);
610
611
    //Retrieve all member information for the current page
612
    if (count($all_users)) {
613
        $crit  = new Criteria('uid', "(". implode(array_keys($all_users), ',') .")", 'IN');
614
        $users =& xhelpGetUsers($crit, $displayName);
615
    } else {
616
        $users = array();
617
    }
618
    $sortedTickets =& _updateBatchTicketInfo($sortedTickets, $users, $j);
619
620
    //Store tickets in session so they won't be in URL
@@ 718-723 (lines=6) @@
715
    unset($oTickets);
716
717
    //Retrieve all member information for the current page
718
    if (count($all_users)) {
719
        $crit  = new Criteria('uid', "(". implode(array_keys($all_users), ',') .")", 'IN');
720
        $users =& xhelpGetUsers($crit, $displayName);
721
    } else {
722
        $users = array();
723
    }
724
    $sortedTickets =& _updateBatchTicketInfo($sortedTickets, $users, $j);
725
726
    $hiddenvars = array('delete' => _XHELP_BUTTON_SET,        //'tickets' => implode($_POST['tickets'], ','),
@@ 945-950 (lines=6) @@
942
    }
943
944
    //Retrieve all member information for the current page
945
    if (count($all_users)) {
946
        $crit  = new Criteria('uid', "(". implode(array_keys($all_users), ',') .")", 'IN');
947
        $users =& xhelpGetUsers($crit, $displayName);
948
    } else {
949
        $users = array();
950
    }
951
952
    //Update tickets with user information
953
    for($i=0; $i<count($ticketLists);$i++){