Code Duplication    Length = 12-27 lines in 2 locations

programs/planning.php 1 location

@@ 235-246 (lines=12) @@
232
233
234
235
function absences_getPlanningValues($id)
236
{     
237
    require_once $GLOBALS['babInstallPath'].'admin/acl.php';
238
    global $babDB;
239
    
240
    $res = $babDB->db_query('SELECT * FROM absences_custom_planning WHERE id='.$babDB->quote($id));
241
    $arr = $babDB->db_fetch_assoc($res);
242
    
243
    $arr['groups'] = aclGetRightsString('absences_custom_planning_groups', $id);
244
    
245
    return $arr;
246
}
247
248
249

programs/utilit/vacincl.php 1 location

@@ 2974-3000 (lines=27) @@
2971
 * @param	int		$id_entry
2972
 * @return string
2973
 */
2974
function absences_vacEntryQuantity($id_entry)
2975
{
2976
	global $babDB;
2977
2978
	$res = $babDB->db_query("
2979
			SELECT
2980
			SUM(e.quantity) quantity,
2981
			r.quantity_unit
2982
			FROM
2983
			absences_entries_elem e,
2984
			absences_rights r
2985
			WHERE
2986
			e.id_entry =".$babDB->quote($id_entry)."
2987
			AND r.id = e.id_right
2988
			GROUP BY r.quantity_unit
2989
			ORDER BY r.quantity_unit DESC
2990
			"
2991
	);
2992
2993
	$list = array();
2994
	while ($arr = $babDB->db_fetch_assoc($res))
2995
	{
2996
		$list[] = absences_quantity($arr['quantity'], $arr['quantity_unit']);
2997
	}
2998
2999
	return implode(', ', $list);
3000
}
3001
3002
3003