Code Duplication    Length = 4-4 lines in 2 locations

addTicket.php 1 location

@@ 60-63 (lines=4) @@
57
        $crit = new Criteria('','');
58
        $crit->setSort('department');
59
        $departments =& $hDepartments->getObjects($crit);
60
        if(count($departments) == 0){
61
            $message = _XHELP_MESSAGE_NO_DEPTS;
62
            redirect_header(XHELP_BASE_URL."/index.php", 3, $message);
63
        }
64
        $aDept = array();
65
        $myGroups =& $hMember->getGroupsByUser($xoopsUser->getVar('uid'));
66
        if(($xhelp_isStaff) && ($xoopsModuleConfig['xhelp_deptVisibility'] == 0)){     // If staff are not applied

anon_addTicket.php 1 location

@@ 47-50 (lines=4) @@
44
    $crit = new Criteria('','');
45
    $crit->setSort('department');
46
    $departments =& $hDepartments->getObjects($crit);
47
    if(count($departments) == 0){
48
        $message = _XHELP_MESSAGE_NO_DEPTS;
49
        redirect_header(XHELP_BASE_URL.'/index.php', 3, $message);
50
    }
51
52
    //XOOPS_GROUP_ANONYMOUS
53
    foreach($departments as $dept){