Code Duplication    Length = 18-18 lines in 2 locations

api/v1/dept_api.php 2 locations

@@ 108-125 (lines=18) @@
105
    echo json_encode($ret);
106
}
107
108
function getShiftsForDepartment($id)
109
{
110
    global $app;
111
    $dept = getDepartmentByID($id);
112
    if($dept === false)
113
    {
114
        $app->notFound();
115
    }
116
    $filter = new \Data\Filter('departmentID eq '.$dept['departmentID']);
117
    $dataSet = DataSetFactory::get_data_set('fvs');
118
    $dataTable = $dataSet['shifts'];
119
    $ret = $dataTable->read($filter, $app->odata->select);
120
    if($ret === false || !isset($ret[0]))
121
    {
122
        $ret = array();
123
    }
124
    echo json_encode($ret);
125
}
126
127
function getRolesForDepartment($id)
128
{
@@ 127-144 (lines=18) @@
124
    echo json_encode($ret);
125
}
126
127
function getRolesForDepartment($id)
128
{
129
    global $app;
130
    $dept = getDepartmentByID($id);
131
    if($dept === false)
132
    {
133
        $app->notFound();
134
    }
135
    $filter = new \Data\Filter('departmentID eq '.$dept['departmentID']);
136
    $dataSet = DataSetFactory::get_data_set('fvs');
137
    $dataTable = $dataSet['roles'];
138
    $ret = $dataTable->read($filter, $app->odata->select);
139
    if($ret === false || !isset($ret[0]))
140
    {
141
        $ret = array();
142
    }
143
    echo json_encode($ret);
144
}
145
146