Code Duplication    Length = 7-24 lines in 2 locations

programs/planning.php 1 location

@@ 376-382 (lines=7) @@
373
    $url->location();
374
}
375
376
function absences_getPlanningName($id)
377
{
378
    global $babDB;
379
    $res = $babDB->db_query("SELECT name FROM absences_custom_planning WHERE id=".$babDB->quote($id));
380
    $arr = $babDB->db_fetch_assoc($res);
381
    return $arr['name'];
382
}
383
384
function absences_getPlanningUsers($id)
385
{

programs/utilit/organization.class.php 1 location

@@ 185-208 (lines=24) @@
182
	 * this method must not modify the organizations ID
183
	 * 
184
	 */
185
	public static function createFromDirectory()
186
	{
187
	    global $babDB;
188
	    
189
	    $res = $babDB->db_query("
190
	        SELECT 
191
	           e.organisationname name, 
192
	           o.id 
193
	        
194
	        FROM bab_dbdir_entries e
195
	               LEFT JOIN absences_organization o ON o.name LIKE e.organisationname, 
196
	           absences_personnel p 
197
	        WHERE e.id_user=p.id_user 
198
	           AND e.organisationname<>'' 
199
	        
200
	        GROUP BY organisationname
201
	    ");
202
	    
203
	    while ($arr = $babDB->db_fetch_assoc($res)) {
204
	        $org = new absences_Organization();
205
	        $org->setRow($arr);
206
	        $org->save();
207
	    }
208
	}
209
	
210
}
211