Code Duplication    Length = 17-17 lines in 2 locations

app/presenters/BlockPresenter.php 1 location

@@ 171-187 (lines=17) @@
168
	 *
169
	 * @return void
170
	 */
171
	public function actionMail($id)
172
	{
173
		try {
174
			$tutors = $this->getModel()->getTutor($id);
175
			$recipients = $this->parseTutorEmail($tutors);
176
177
			$this->getEmailer()->tutor($recipients, $tutors->guid, 'block');
178
179
			Debugger::log('Sending email to block tutor successfull, result: ' . json_encode($recipients) . ', ' . $tutors->guid, Debugger::INFO);
180
			$this->flashMessage('Email lektorovi byl odeslán..', 'ok');
181
		} catch(Exception $e) {
182
			Debugger::log('Sending email to block tutor failed, result: ' .  $e->getMessage(), Debugger::ERROR);
183
			$this->flashMessage('Email lektorovi nebyl odeslán, result: ' . $e->getMessage(), 'error');
184
		}
185
186
		$this->redirect('Block:edit', $id);
187
	}
188
189
	/**
190
	 * Prepare data for editing

app/presenters/ProgramPresenter.php 1 location

@@ 152-168 (lines=17) @@
149
	/**
150
	 * @return void
151
	 */
152
	public function actionMail($id)
153
	{
154
		try {
155
			$tutors = $this->getModel()->getTutor($id);
156
			$recipients = $this->parseTutorEmail($tutors);
157
158
			$this->getEmailer()->tutor($recipients, $tutors->guid, 'program');
159
160
			Debugger::log('Sending email to program tutor successfull, result: ' . json_encode($recipients) . ', ' . $tutors->guid, Debugger::INFO);
161
			$this->flashMessage('Email lektorovi byl odeslán..', 'ok');
162
		} catch(Exception $e) {
163
			Debugger::log('Sending email to program tutor failed, result: ' .  $e->getMessage(), Debugger::ERROR);
164
			$this->flashMessage('Email lektorovi nebyl odeslán, result: ' . $e->getMessage(), 'error');
165
		}
166
167
		$this->redirect('Program:edit', $id);
168
	}
169
170
	/**
171
	 * View public program