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

@@ 3001-3027 (lines=27) @@
2998
 * @param	int		$id_entry
2999
 * @return string
3000
 */
3001
function absences_vacEntryQuantity($id_entry)
3002
{
3003
	global $babDB;
3004
3005
	$res = $babDB->db_query("
3006
			SELECT
3007
			SUM(e.quantity) quantity,
3008
			r.quantity_unit
3009
			FROM
3010
			absences_entries_elem e,
3011
			absences_rights r
3012
			WHERE
3013
			e.id_entry =".$babDB->quote($id_entry)."
3014
			AND r.id = e.id_right
3015
			GROUP BY r.quantity_unit
3016
			ORDER BY r.quantity_unit DESC
3017
			"
3018
	);
3019
3020
	$list = array();
3021
	while ($arr = $babDB->db_fetch_assoc($res))
3022
	{
3023
		$list[] = absences_quantity($arr['quantity'], $arr['quantity_unit']);
3024
	}
3025
3026
	return implode(', ', $list);
3027
}
3028
3029
3030