Code Duplication    Length = 20-20 lines in 2 locations

programs/utilit/right.ui.php 1 location

@@ 303-322 (lines=20) @@
300
	}
301
	
302
	
303
	protected function addButtons()
304
	{
305
		$W = bab_Widgets();
306
		
307
		$button = $W->FlowItems(
308
			$W->SubmitButton()->setName('cancel')->setLabel(absences_translate('Cancel')),
309
			$W->SubmitButton()->setName('save')->setLabel(absences_translate('Save'))
310
		)->setSpacing(1,'em');
311
		
312
		if (isset($this->right))
313
		{
314
			$button->addItem(
315
				$W->SubmitButton()
316
					->setConfirmationMessage(absences_translate('Do you really want to delete the vacation right?'))
317
					->setName('delete')->setLabel(absences_translate('Delete'))
318
			);
319
		}
320
		
321
		$this->addItem($button);
322
	}
323
	
324
	
325
	

programs/utilit/workperiod_type.ui.php 1 location

@@ 102-121 (lines=20) @@
99
	
100
	
101
	
102
	protected function addButtons()
103
	{
104
		$W = bab_Widgets();
105
	
106
		$button = $W->FlowItems(
107
				$W->SubmitButton()->setName('cancel')->setLabel(absences_translate('Cancel')),
108
				$W->SubmitButton()->setName('save')->setLabel(absences_translate('Save'))
109
		)->setSpacing(1,'em');
110
		
111
		if (isset($this->type))
112
		{
113
			$button->addItem(
114
					$W->SubmitButton()
115
					->setConfirmationMessage(absences_translate('Do you really want to delete the type?'))
116
					->setName('delete')->setLabel(absences_translate('Delete'))
117
			);
118
		}
119
	
120
		$this->addItem($button);
121
	}
122
}