Code Duplication    Length = 21-26 lines in 4 locations

programs/utilit/agentlist.ui.php 1 location

@@ 389-412 (lines=24) @@
386
    }
387
    
388
    
389
    protected function organization()
390
    {
391
        require_once dirname(__FILE__).'/organization.class.php';
392
        $W = bab_Widgets();
393
        
394
        $select = $W->Select();
395
        $select->addOption('', '');
396
        
397
        $collections = new absences_OrganizationIterator();
398
        
399
        if (0 === $collections->count()) {
400
            return null;
401
        }
402
        
403
        foreach($collections as $collection) {
404
            $select->addOption($collection->id, $collection->name);
405
        }
406
        
407
        return $W->LabelledWidget(
408
            absences_translate('Organization'),
409
            $select,
410
            __FUNCTION__
411
        );
412
    }
413
    
414
    protected function idcol()
415
    {

programs/utilit/archive.ui.php 1 location

@@ 230-250 (lines=21) @@
227
	
228
	
229
230
	protected function organization()
231
	{
232
	    $W = bab_Widgets();
233
	    $select = $W->Select()->addClass('absences-select');
234
	     
235
	    $select->addOption('', absences_translate('On all organizations'));
236
	     
237
	    require_once dirname(__FILE__).'/organization.class.php';
238
	     
239
	    $I = new absences_OrganizationIterator();
240
	    foreach($I as $org) {
241
	        $select->addOption($org->id, $org->name);
242
	    }
243
	
244
	     
245
	    return $W->LabelledWidget(
246
	        absences_translate('Organization'),
247
	        $select,
248
	        __FUNCTION__
249
	    );
250
	}
251
	
252
}

programs/utilit/statistics.ui.php 1 location

@@ 56-80 (lines=25) @@
53
54
55
56
	protected function addFields()
57
	{
58
		global $babDB;
59
		$W = bab_Widgets();
60
		
61
		require_once dirname(__FILE__).'/organization.class.php';
62
		$resOrganization = new absences_OrganizationIterator();
63
64
		$orgaSelect = $W->Select();
65
		$orgaSelect->addOption('','');
66
67
		foreach ($resOrganization as $organization) {
68
			$orgaSelect->addOption($organization->id, $organization->name);
69
		}
70
71
		$this->addItem(
72
			$W->LabelledWidget(
73
				absences_translate('Organization'),
74
				$orgaSelect,
75
				'organization'
76
			)
77
		);
78
79
80
	}
81
82
	protected function addButtons()
83
	{

programs/utilit/vacincl.php 1 location

@@ 3167-3192 (lines=26) @@
3164
	/**
3165
	 * 
3166
	 */
3167
	protected function organization()
3168
	{
3169
	    require_once dirname(__FILE__).'/organization.class.php';
3170
	    
3171
	    $W = bab_Widgets();
3172
	    $select = $W->Select();
3173
	    $select->addOption('', '');
3174
	    
3175
	    $collections = new absences_OrganizationIterator();
3176
	    
3177
	    if (0 === $collections->count()) {
3178
	        return null;
3179
	    }
3180
	    
3181
	    
3182
	    foreach($collections as $collection) {
3183
	        $select->addOption($collection->id, $collection->name);
3184
	    }
3185
	    
3186
	    return $W->LabelledWidget(
3187
            absences_translate('Organization'),
3188
            $select,
3189
            'organization'
3190
	    );
3191
	    
3192
	}
3193
	
3194
	
3195