Code Duplication    Length = 17-19 lines in 2 locations

programs/utilit/workperiod_recover_request.ui.php 2 locations

@@ 233-251 (lines=19) @@
230
	}
231
	
232
	
233
	protected function date_begin()
234
	{
235
		require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
236
		
237
		$delay = BAB_DateTime::now();
238
		$delay->add(absences_getVacationOption('delay_recovery'), BAB_DATETIME_DAY);
239
		
240
		$W = bab_Widgets();
241
		$date = $W->DatePicker()->setMaxDate($delay)->setMandatory(true)->setName('datebegin');
242
		$hours = $W->Select()->setName('hourbegin')->setOptions(absences_hoursList());
243
		
244
		$this->beginDate = $date;
245
		
246
		return $W->FlowItems(
247
			$W->Label(absences_translate('from date'))->setAssociatedWidget($date),
248
			$date,
249
			$hours
250
		)->setSpacing(.5,'em');
251
	}
252
	
253
	
254
	protected function date_end()
@@ 254-270 (lines=17) @@
251
	}
252
	
253
	
254
	protected function date_end()
255
	{
256
	    require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
257
	    
258
	    $delay = BAB_DateTime::now();
259
	    $delay->add(absences_getVacationOption('delay_recovery'), BAB_DATETIME_DAY);
260
	    
261
		$W = bab_Widgets();
262
		$date = $W->DatePicker()->setMinDate($this->beginDate)->setMaxDate($delay)->setMandatory(true)->setName('dateend');
263
		$hours = $W->Select()->setName('hourend')->setOptions(absences_hoursList());
264
		
265
		return $W->FlowItems(
266
			$W->Label(absences_translate('to date'))->setAssociatedWidget($date),
267
			$date,
268
			$hours
269
		)->setSpacing(.5,'em');
270
	}
271
272
	
273