Code Duplication    Length = 19-20 lines in 3 locations

programs/exportvac.php 1 location

@@ 309-327 (lines=19) @@
306
	}
307
308
309
	protected function types()
310
	{
311
	    $W = bab_Widgets();
312
	    global $babDB;
313
314
	    $select = $W->Multiselect();
315
	    $select->setHeadersDisplay();
316
317
	    $res = $babDB->db_query('SELECT * FROM absences_types ORDER BY name');
318
	    while($arr = $babDB->db_fetch_assoc($res)) {
319
	        $select->addOption($arr['id'], $arr['name']);
320
	    }
321
322
	    return $W->LabelledWidget(
323
    	    absences_translate('Vacation type'),
324
    	    $select,
325
	        'types'
326
    	);
327
	}
328
329
330

programs/utilit/right.ui.php 2 locations

@@ 405-424 (lines=20) @@
402
	}
403
	
404
	
405
	private function type_select($empty = false)
406
	{
407
		$W = bab_Widgets();
408
		global $babDB;
409
		
410
		$select = $W->Select();
411
		
412
		if ($empty)
413
		{
414
			$select->addOption('0', '');
415
		}
416
		
417
		$res = $babDB->db_query('SELECT id, name FROM absences_types ORDER BY name');
418
		while ($arr = $babDB->db_fetch_assoc($res))
419
		{
420
			$select->addOption($arr['id'], $arr['name']);
421
		}
422
		
423
		return $select;
424
	}
425
	
426
	
427
	private function multiType()
@@ 679-698 (lines=20) @@
676
	 * Right group
677
	 * @return Widget_LabelledWidget
678
	 */
679
	protected function id_rgroup()
680
	{
681
		$W = bab_Widgets();
682
		global $babDB;
683
	
684
		$select = $W->Select();
685
		$select->addOption(0, absences_translate('None'));
686
	
687
		$res = $babDB->db_query('SELECT id, name FROM absences_rgroup ORDER BY name');
688
		while ($arr = $babDB->db_fetch_assoc($res))
689
		{
690
			$select->addOption($arr['id'], $arr['name']);
691
		}
692
	
693
		return $W->LabelledWidget(
694
				absences_translate('Right group'),
695
				$select,
696
				__FUNCTION__
697
		);
698
	}
699
	
700
	
701