|
@@ 93-110 (lines=18) @@
|
| 90 |
|
* |
| 91 |
|
* @return void |
| 92 |
|
*/ |
| 93 |
|
public function actionCreate() |
| 94 |
|
{ |
| 95 |
|
try { |
| 96 |
|
$postData = $this->getHttpRequest()->getPost(); |
| 97 |
|
$postData['meeting'] = $this->getMeetingId(); |
| 98 |
|
|
| 99 |
|
$guid = $this->getVisitorService()->create($postData); |
| 100 |
|
$result = $this->sendRegistrationSummary($postData, $guid); |
| 101 |
|
|
| 102 |
|
Debugger::log('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result), Debugger::INFO); |
| 103 |
|
$this->flashMessage('Účastník(' . $guid . ') byl úspěšně vytvořen.', 'ok'); |
| 104 |
|
} catch(Exception $e) { |
| 105 |
|
Debugger::log('Creation of visitor('. $guid .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
| 106 |
|
$this->flashMessage('Creation of visitor failed, result: ' . $e->getMessage(), 'error'); |
| 107 |
|
} |
| 108 |
|
|
| 109 |
|
$this->redirect('Visitor:listing'); |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
/** |
| 113 |
|
* Process data from editing |
|
@@ 118-137 (lines=20) @@
|
| 115 |
|
* @param integer $id |
| 116 |
|
* @return void |
| 117 |
|
*/ |
| 118 |
|
public function actionUpdate($id) |
| 119 |
|
{ |
| 120 |
|
try { |
| 121 |
|
$postData = $this->getHttpRequest()->getPost(); |
| 122 |
|
$postData['meeting'] = $this->getMeetingId(); |
| 123 |
|
$postData['visitor'] = $id; |
| 124 |
|
|
| 125 |
|
$result = $this->getVisitorService()->update($id, $postData); |
| 126 |
|
|
| 127 |
|
//$result = $this->sendRegistrationSummary($visitor, $guid); |
| 128 |
|
|
| 129 |
|
Debugger::log('Modification of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
| 130 |
|
$this->flashMessage('Účastník(' . $id . ') byl úspěšně upraven.', 'ok'); |
| 131 |
|
} catch(Exception $e) { |
| 132 |
|
Debugger::log('Modification of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
| 133 |
|
$this->flashMessage('Modification of visitor failed, result: ' . $e->getMessage(), 'error'); |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
$this->redirect('Visitor:listing'); |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
/** |
| 140 |
|
* @param int $id |