@@ -21,26 +21,26 @@ discard block |
||
21 | 21 | $shared_filehandler = $this->getKernel()->useModule('filemanager'); |
22 | 22 | |
23 | 23 | if (isset($_GET['return_redirect_id'])) { |
24 | - $redirect = Intraface_Redirect::factory($this->getKernel(), 'return'); |
|
25 | - $file_id = $redirect->getParameter('file_handler_id'); |
|
26 | - |
|
27 | - $intranet = new IntranetAdministration($this->getKernel()); |
|
28 | - $filehandler = new FileHandler($this->getKernel(), intval($file_id)); |
|
29 | - if ($filehandler->get('id') != 0) { |
|
30 | - |
|
31 | - $type = $filehandler->get('file_type'); |
|
32 | - if ($type['mime_type'] == 'image/jpeg' || $type['mime_type'] == 'image/pjpeg') { |
|
33 | - $values = $intranet->get(); |
|
34 | - $values['pdf_header_file_id'] = $filehandler->get('id'); |
|
35 | - $intranet->update($values); |
|
36 | - } else { |
|
37 | - $filehandler->error->set('Header should be a .jpg image - got '. $filehandler->get('file_type')); |
|
38 | - } |
|
39 | - } |
|
24 | + $redirect = Intraface_Redirect::factory($this->getKernel(), 'return'); |
|
25 | + $file_id = $redirect->getParameter('file_handler_id'); |
|
26 | + |
|
27 | + $intranet = new IntranetAdministration($this->getKernel()); |
|
28 | + $filehandler = new FileHandler($this->getKernel(), intval($file_id)); |
|
29 | + if ($filehandler->get('id') != 0) { |
|
30 | + |
|
31 | + $type = $filehandler->get('file_type'); |
|
32 | + if ($type['mime_type'] == 'image/jpeg' || $type['mime_type'] == 'image/pjpeg') { |
|
33 | + $values = $intranet->get(); |
|
34 | + $values['pdf_header_file_id'] = $filehandler->get('id'); |
|
35 | + $intranet->update($values); |
|
36 | + } else { |
|
37 | + $filehandler->error->set('Header should be a .jpg image - got '. $filehandler->get('file_type')); |
|
38 | + } |
|
39 | + } |
|
40 | 40 | } |
41 | - $intranet = $this->getIntranetMaintenance(); |
|
42 | - $values = $intranet->get(); |
|
43 | - $address = $intranet->address->get(); |
|
41 | + $intranet = $this->getIntranetMaintenance(); |
|
42 | + $values = $intranet->get(); |
|
43 | + $address = $intranet->address->get(); |
|
44 | 44 | |
45 | 45 | $smarty = $this->template->create(dirname(__FILE__) . '/templates/intranet-edit'); |
46 | 46 | return $smarty->render($this, array('intranet' => $intranet, 'kernel' => $this->getKernel())); |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | { |
60 | 60 | $modul = $this->getKernel()->module('administration'); |
61 | 61 | $shared_filehandler = $this->getKernel()->useModule('filemanager'); |
62 | - $intranet = $this->getIntranetMaintenance(); |
|
63 | - $values = $_POST; |
|
62 | + $intranet = $this->getIntranetMaintenance(); |
|
63 | + $values = $_POST; |
|
64 | 64 | |
65 | - $filehandler = new FileHandler($this->getKernel()); |
|
66 | - $filehandler->createUpload(); |
|
67 | - if ($filehandler->upload->isUploadFile('new_pdf_header_file') && $id = $filehandler->upload->upload('new_pdf_header_file')) { |
|
65 | + $filehandler = new FileHandler($this->getKernel()); |
|
66 | + $filehandler->createUpload(); |
|
67 | + if ($filehandler->upload->isUploadFile('new_pdf_header_file') && $id = $filehandler->upload->upload('new_pdf_header_file')) { |
|
68 | 68 | $filehandler->load(); |
69 | 69 | |
70 | 70 | $type = $filehandler->get('file_type'); |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | $intranet->error->set('Header should be a .jpg image - got ' . $type['mime_type']); |
75 | 75 | $filehandler->delete(); |
76 | 76 | } |
77 | - } |
|
77 | + } |
|
78 | 78 | |
79 | 79 | if ($intranet->update($values)) { |
80 | 80 | $address_values = $_POST; |
81 | 81 | $address_values['name'] = $_POST['address_name']; |
82 | - if ($intranet->address->validate($address_values) && $intranet->address->save($address_values)) { |
|
83 | - if (isset($_POST['choose_file']) && $this->getKernel()->user->hasModuleAccess('filemanager')) { |
|
84 | - $module_filemanager = $this->getKernel()->useModule('filemanager'); |
|
85 | - $redirect = Intraface_Redirect::factory($this->getKernel(), 'go'); |
|
86 | - $url = $redirect->setDestination($module_filemanager->getPath().'select_file?images=1'); |
|
87 | - $redirect->askParameter('file_handler_id'); |
|
88 | - return new k_SeeOther($url); |
|
89 | - } |
|
82 | + if ($intranet->address->validate($address_values) && $intranet->address->save($address_values)) { |
|
83 | + if (isset($_POST['choose_file']) && $this->getKernel()->user->hasModuleAccess('filemanager')) { |
|
84 | + $module_filemanager = $this->getKernel()->useModule('filemanager'); |
|
85 | + $redirect = Intraface_Redirect::factory($this->getKernel(), 'go'); |
|
86 | + $url = $redirect->setDestination($module_filemanager->getPath().'select_file?images=1'); |
|
87 | + $redirect->askParameter('file_handler_id'); |
|
88 | + return new k_SeeOther($url); |
|
89 | + } |
|
90 | 90 | return new k_SeeOther($this->url()); |
91 | - } |
|
91 | + } |
|
92 | 92 | } |
93 | 93 | |
94 | - return $this->render(); |
|
94 | + return $this->render(); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | function getKernel() |
98 | 98 | { |
99 | - return $this->context->getKernel(); |
|
99 | + return $this->context->getKernel(); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | function getFilehandler() |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | function renderHtml() |
13 | 13 | { |
14 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/intranet'); |
|
14 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/intranet'); |
|
15 | 15 | return $smarty->render($this); |
16 | 16 | } |
17 | 17 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $values['pdf_header_file_id'] = $filehandler->get('id'); |
35 | 35 | $intranet->update($values); |
36 | 36 | } else { |
37 | - $filehandler->error->set('Header should be a .jpg image - got '. $filehandler->get('file_type')); |
|
37 | + $filehandler->error->set('Header should be a .jpg image - got '.$filehandler->get('file_type')); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $values = $intranet->get(); |
43 | 43 | $address = $intranet->address->get(); |
44 | 44 | |
45 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/intranet-edit'); |
|
45 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/intranet-edit'); |
|
46 | 46 | return $smarty->render($this, array('intranet' => $intranet, 'kernel' => $this->getKernel())); |
47 | 47 | } |
48 | 48 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ($type['mime_type'] == 'image/jpeg' || $type['mime_type'] == 'image/pjpeg') { |
72 | 72 | $values['pdf_header_file_id'] = $id; |
73 | 73 | } else { |
74 | - $intranet->error->set('Header should be a .jpg image - got ' . $type['mime_type']); |
|
74 | + $intranet->error->set('Header should be a .jpg image - got '.$type['mime_type']); |
|
75 | 75 | $filehandler->delete(); |
76 | 76 | } |
77 | 77 | } |
@@ -28,6 +28,6 @@ |
||
28 | 28 | |
29 | 29 | function getKernel() |
30 | 30 | { |
31 | - return $this->context->getKernel(); |
|
31 | + return $this->context->getKernel(); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | \ No newline at end of file |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | function renderHtml() |
24 | 24 | { |
25 | - $smarty = $this->template->create(dirname(__FILE__) . '/templates/index'); |
|
25 | + $smarty = $this->template->create(dirname(__FILE__).'/templates/index'); |
|
26 | 26 | return $smarty->render($this); |
27 | 27 | } |
28 | 28 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | global $_setting; |
55 | 55 | |
56 | - require_once dirname(__FILE__) . '/config/setting_kernel.php'; |
|
56 | + require_once dirname(__FILE__).'/config/setting_kernel.php'; |
|
57 | 57 | |
58 | 58 | $this->db = new DB_Sql; |
59 | 59 | $this->system = &$_setting; // don't remove the & - otherwise it will not work |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | private function loadSettings() |
171 | 171 | { |
172 | 172 | $this->settings = array(); |
173 | - $this->db->query("SELECT setting, value, sub_id, user_id FROM setting WHERE intranet_id = " . $this->db->quote($this->intranet_id, 'integer')." AND (user_id = ".$this->db->quote($this->user_id, 'integer')." OR user_id = 0)"); |
|
173 | + $this->db->query("SELECT setting, value, sub_id, user_id FROM setting WHERE intranet_id = ".$this->db->quote($this->intranet_id, 'integer')." AND (user_id = ".$this->db->quote($this->user_id, 'integer')." OR user_id = 0)"); |
|
174 | 174 | while ($this->db->nextRecord()) { |
175 | 175 | $this->settings[$this->intranet_id][$this->db->f('user_id')][$this->db->f('setting')][$this->db->f('sub_id')] = $this->db->f('value'); |
176 | 176 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | function isSettingSet($type, $setting, $sub_id = 0) |
267 | 267 | { |
268 | 268 | if ($this->checkSystem($setting) && $this->checkType($type)) { |
269 | - switch($type) { |
|
269 | + switch ($type) { |
|
270 | 270 | case 'user': |
271 | 271 | if ($this->checkLogin()) { |
272 | 272 | $this->db->query("SELECT value FROM setting WHERE setting = \"".$setting."\" AND intranet_id = ".$this->intranet_id." AND user_id = ".$this->user_id." AND sub_id = ".intval($sub_id)); |
@@ -144,8 +144,8 @@ |
||
144 | 144 | function new_Cache_Lite() |
145 | 145 | { |
146 | 146 | $options = array( |
147 | - 'cacheDir' => PATH_CACHE, |
|
148 | - 'lifeTime' => 3600 |
|
147 | + 'cacheDir' => PATH_CACHE, |
|
148 | + 'lifeTime' => 3600 |
|
149 | 149 | ); |
150 | 150 | |
151 | 151 | return new Cache_Lite($options); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | $db = MDB2::singleton(DB_DSN, array('persistent' => true)); |
24 | 24 | if (PEAR::isError($db)) { |
25 | - throw new Exception($db->getMessage() . $db->getUserInfo()); |
|
25 | + throw new Exception($db->getMessage().$db->getUserInfo()); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | $db->setFetchMode(MDB2_FETCHMODE_ASSOC); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | //always check for errors. In this examples, error checking is omitted |
81 | 81 | //to make the example concise. |
82 | 82 | if (PEAR::isError($translation)) { |
83 | - throw new Exception('Could not start Translation ' . $translation->getMessage()); |
|
83 | + throw new Exception('Could not start Translation '.$translation->getMessage()); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | // set the group of strings you want to fetch from |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | // %url% will be replaced with the targeted url |
100 | 100 | //$this->translation->outputString = '%stringID% (%pageID_url%)'; //default: '%stringID%' |
101 | 101 | $translation->outputString = '%stringID%'; |
102 | - $translation->url = ''; //same as default |
|
103 | - $translation->emptyPrefix = ''; //default: empty string |
|
104 | - $translation->emptyPostfix = ''; //default: empty string |
|
102 | + $translation->url = ''; //same as default |
|
103 | + $translation->emptyPrefix = ''; //default: empty string |
|
104 | + $translation->emptyPostfix = ''; //default: empty string |
|
105 | 105 | return $translation; |
106 | 106 | } |
107 | 107 |
@@ -226,20 +226,20 @@ |
||
226 | 226 | { |
227 | 227 | return array( |
228 | 228 | 1 => array( |
229 | - 'label' => 'system', |
|
230 | - 'dir' => '/system/', |
|
229 | + 'label' => 'system', |
|
230 | + 'dir' => '/system/', |
|
231 | 231 | 'name' => 'Web 2.0', |
232 | 232 | 'description' => 'Spr�lsk, vildt og pastel.' |
233 | 233 | ), |
234 | 234 | 2 => array( |
235 | - 'label' => 'newsystem', |
|
236 | - 'dir' => '/newsystem/', |
|
235 | + 'label' => 'newsystem', |
|
236 | + 'dir' => '/newsystem/', |
|
237 | 237 | 'name' => 'Standard', |
238 | 238 | 'description' => 'Standard.' |
239 | 239 | ), |
240 | 240 | 3 => array( |
241 | - 'label' => 'black', |
|
242 | - 'dir' => '/black/', |
|
241 | + 'label' => 'black', |
|
242 | + 'dir' => '/black/', |
|
243 | 243 | 'name' => 'Den sorte ridder', |
244 | 244 | 'description' => 'Det gamle tema. Nydeligt og kedeligt.' |
245 | 245 | ) |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | // menuen |
88 | 88 | $this->menu = array(); |
89 | 89 | $i = 0; |
90 | - $this->menu[$i]['name'] = $this->t('dashboard', 'dashboard');; |
|
90 | + $this->menu[$i]['name'] = $this->t('dashboard', 'dashboard'); ; |
|
91 | 91 | $this->menu[$i]['url'] = url('/core/restricted/'); |
92 | 92 | $i++; |
93 | 93 | $res = $this->db->query("SELECT name, menu_label, name FROM module WHERE active = 1 AND show_menu = 1 ORDER BY menu_index"); |
94 | 94 | foreach ($res->fetchAll() as $row) { |
95 | 95 | if ($this->kernel->user->hasModuleAccess($row['name'])) { |
96 | 96 | $this->menu[$i]['name'] = $this->t($row['name'], $row['name']); |
97 | - $this->menu[$i]['url'] = url('/core/restricted/module/' . $row["name"]); |
|
97 | + $this->menu[$i]['url'] = url('/core/restricted/module/'.$row["name"]); |
|
98 | 98 | $i++; |
99 | 99 | } |
100 | 100 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if ($all_submenu[$i]['sub_access'] != '') { |
111 | 111 | $sub = explode(":", $all_submenu[$i]['sub_access']); |
112 | 112 | |
113 | - switch($sub[0]) { |
|
113 | + switch ($sub[0]) { |
|
114 | 114 | case 'sub_access': |
115 | 115 | if ($this->kernel->user->hasSubAccess($this->primary_module->module_name, $sub[1])) { |
116 | 116 | $access = true; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | if ($access) { |
135 | 135 | $this->submenu[$j]['name'] = $this->t($all_submenu[$i]['label'], $this->primary_module->getName()); |
136 | - $this->submenu[$j]['url'] = $this->primary_module->getPath(). $all_submenu[$i]['url']; |
|
136 | + $this->submenu[$j]['url'] = $this->primary_module->getPath().$all_submenu[$i]['url']; |
|
137 | 137 | $j++; |
138 | 138 | } |
139 | 139 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $javascript = ''; |
144 | 144 | if (!empty($this->javascript_path) AND count($this->javascript_path) > 0) { |
145 | 145 | for ($i = 0, $max = count($this->javascript_path); $i < $max; $i++) { |
146 | - $javascript .= '<script type="text/javascript" src="'.$this->javascript_path[$i].'"></script>' . "\n"; |
|
146 | + $javascript .= '<script type="text/javascript" src="'.$this->javascript_path[$i].'"></script>'."\n"; |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | /* |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $this->usermenu[1]['url'] = url('/core/restricted/switchintranet'); |
199 | 199 | } |
200 | 200 | } |
201 | - $this->usermenu[2]['name'] = $this->t('control panel', 'common');; |
|
201 | + $this->usermenu[2]['name'] = $this->t('control panel', 'common'); ; |
|
202 | 202 | $this->usermenu[2]['url'] = url('/core/restricted/module/controlpanel'); |
203 | 203 | |
204 | 204 | //include(PATH_INCLUDE_IHTML.'/intraface/bottom.php'); |
@@ -171,12 +171,12 @@ |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | $data = array('contact_id' => $debtor->getContact()->getId(), |
174 | - 'subject' => $subject, |
|
175 | - 'body' => $body, |
|
176 | - 'from_email' => $this->kernel->intranet->address->get('email'), |
|
177 | - 'from_name' => $this->kernel->intranet->address->get('name'), |
|
178 | - 'type_id' => 13, // onlinepayment |
|
179 | - 'belong_to' => $payment_id); |
|
174 | + 'subject' => $subject, |
|
175 | + 'body' => $body, |
|
176 | + 'from_email' => $this->kernel->intranet->address->get('email'), |
|
177 | + 'from_name' => $this->kernel->intranet->address->get('name'), |
|
178 | + 'type_id' => 13, // onlinepayment |
|
179 | + 'belong_to' => $payment_id); |
|
180 | 180 | |
181 | 181 | if (!$email->save($data)) { |
182 | 182 | throw new Exception('Could not save email to onlinepayment'); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | if (!$payment_id = $onlinepayment->save($values)) { |
133 | 133 | // this is probably a little to hard reaction. |
134 | - throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt ' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
134 | + throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt '.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | if ($onlinepayment->get('status') == 'authorized') { |
@@ -154,20 +154,20 @@ discard block |
||
154 | 154 | |
155 | 155 | $settings = Doctrine::getTable('Intraface_modules_onlinepayment_Language')->findOneByIntranetId($kernel->intranet->getId()); |
156 | 156 | |
157 | - $subject = $settings->getConfirmationEmailSubject($shop->getLanguage()) . ' (#' . $payment_id . ')'; |
|
158 | - $body = $settings->getConfirmationEmailBody($shop->getLanguage()) . "\n\n" . $this->kernel->intranet->address->get('name'); |
|
157 | + $subject = $settings->getConfirmationEmailSubject($shop->getLanguage()).' (#'.$payment_id.')'; |
|
158 | + $body = $settings->getConfirmationEmailBody($shop->getLanguage())."\n\n".$this->kernel->intranet->address->get('name'); |
|
159 | 159 | |
160 | 160 | } catch (Exception $e) { |
161 | 161 | } |
162 | 162 | |
163 | 163 | if (empty($subject)) { |
164 | - $subject = 'Payment confirmation / betalingsbekræftelse (#' . $payment_id . ')'; |
|
164 | + $subject = 'Payment confirmation / betalingsbekræftelse (#'.$payment_id.')'; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | if (empty($body)) { |
168 | - $body = 'We have received your payment for order #' .$debtor->getId(). '.' . "\n\n"; |
|
169 | - $body .= 'Vi har modtaget din betaling for ordre #' .$debtor->getId(). '.'; |
|
170 | - $body .= "\n\nYours sincerely / Venlig hilsen\n". $this->kernel->intranet->address->get('name'); |
|
168 | + $body = 'We have received your payment for order #'.$debtor->getId().'.'."\n\n"; |
|
169 | + $body .= 'Vi har modtaget din betaling for ordre #'.$debtor->getId().'.'; |
|
170 | + $body .= "\n\nYours sincerely / Venlig hilsen\n".$this->kernel->intranet->address->get('name'); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $data = array('contact_id' => $debtor->getContact()->getId(), |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | if (!$email->queue()) { |
186 | 186 | $this->error->merge($email->error->getMessage()); |
187 | - throw new Exception('Could not send email to ' . $debtor->getContact()->getId()); |
|
187 | + throw new Exception('Could not send email to '.$debtor->getContact()->getId()); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | return true; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | if (!$payment_id = $onlinepayment->create()) { |
206 | 206 | // this is probably a little to hard reaction |
207 | - throw new XML_RPC2_FaultException('onlinepayment could not be created' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
207 | + throw new XML_RPC2_FaultException('onlinepayment could not be created'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | return $this->prepareResponseData($payment_id); |
@@ -114,12 +114,12 @@ |
||
114 | 114 | $body .= "\n\nYours sincerely / Venlig hilsen\n". $this->kernel->intranet->address->get('name'); |
115 | 115 | |
116 | 116 | $data = array('contact_id' => $debtor->getContact()->getId(), |
117 | - 'subject' => $subject, |
|
118 | - 'body' => $body, |
|
119 | - 'from_email' => $this->kernel->intranet->address->get('email'), |
|
120 | - 'from_name' => $this->kernel->intranet->address->get('name'), |
|
121 | - 'type_id' => 13, // onlinepayment |
|
122 | - 'belong_to' => $payment_id); |
|
117 | + 'subject' => $subject, |
|
118 | + 'body' => $body, |
|
119 | + 'from_email' => $this->kernel->intranet->address->get('email'), |
|
120 | + 'from_name' => $this->kernel->intranet->address->get('name'), |
|
121 | + 'type_id' => 13, // onlinepayment |
|
122 | + 'belong_to' => $payment_id); |
|
123 | 123 | |
124 | 124 | if (!$email->save($data)) { |
125 | 125 | throw new Exception('Could not save email to onlinepayment');; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | if (!$payment_id = $onlinepayment->save($values)) { |
97 | 97 | // this is probably a little to hard reaction. |
98 | - throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt ' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
98 | + throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt '.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $this->sendEmailOnOnlinePayment($debtor, $payment_id); |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | $this->kernel->useShared('email'); |
109 | 109 | $email = new Email($this->kernel); |
110 | 110 | |
111 | - $subject = 'Payment confirmation / betalingsbekræftelse (#' . $payment_id . ')'; |
|
112 | - $body = 'We have received your payment for order #' .$debtor->getId(). '.' . "\n\n"; |
|
113 | - $body .= 'Vi har modtaget din betaling for ordre #' .$debtor->getId(). '.'; |
|
114 | - $body .= "\n\nYours sincerely / Venlig hilsen\n". $this->kernel->intranet->address->get('name'); |
|
111 | + $subject = 'Payment confirmation / betalingsbekræftelse (#'.$payment_id.')'; |
|
112 | + $body = 'We have received your payment for order #'.$debtor->getId().'.'."\n\n"; |
|
113 | + $body .= 'Vi har modtaget din betaling for ordre #'.$debtor->getId().'.'; |
|
114 | + $body .= "\n\nYours sincerely / Venlig hilsen\n".$this->kernel->intranet->address->get('name'); |
|
115 | 115 | |
116 | 116 | $data = array('contact_id' => $debtor->getContact()->getId(), |
117 | 117 | 'subject' => $subject, |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | 'belong_to' => $payment_id); |
123 | 123 | |
124 | 124 | if (!$email->save($data)) { |
125 | - throw new Exception('Could not save email to onlinepayment');; |
|
125 | + throw new Exception('Could not save email to onlinepayment'); ; |
|
126 | 126 | return false; |
127 | 127 | } |
128 | 128 | |
129 | 129 | if (!$email->queue()) { |
130 | 130 | $this->error->merge($email->error->getMessage()); |
131 | - throw new Exception('Could not send email to ' . $debtor->getContact()->getId());; |
|
131 | + throw new Exception('Could not send email to '.$debtor->getContact()->getId()); ; |
|
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | if (!$payment_id = $onlinepayment->create()) { |
153 | 153 | // this is probably a little to hard reaction |
154 | - throw new XML_RPC2_FaultException('onlinepayment could not be created' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
154 | + throw new XML_RPC2_FaultException('onlinepayment could not be created'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | return $this->prepareResponseData($payment_id); |
@@ -183,12 +183,12 @@ |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | $data = array('contact_id' => $debtor->getContact()->getId(), |
186 | - 'subject' => $subject, |
|
187 | - 'body' => $body, |
|
188 | - 'from_email' => $this->kernel->intranet->address->get('email'), |
|
189 | - 'from_name' => $this->kernel->intranet->address->get('name'), |
|
190 | - 'type_id' => 13, // onlinepayment |
|
191 | - 'belong_to' => $payment_id); |
|
186 | + 'subject' => $subject, |
|
187 | + 'body' => $body, |
|
188 | + 'from_email' => $this->kernel->intranet->address->get('email'), |
|
189 | + 'from_name' => $this->kernel->intranet->address->get('name'), |
|
190 | + 'type_id' => 13, // onlinepayment |
|
191 | + 'belong_to' => $payment_id); |
|
192 | 192 | |
193 | 193 | if (!$email->save($data)) { |
194 | 194 | throw new Exception('Could not save email to onlinepayment'); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | if (!$payment_id = $onlinepayment->save($values)) { |
135 | 135 | // this is probably a little to hard reaction. |
136 | - throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt ' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
136 | + throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt '.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | if ($onlinepayment->get('status') == 'authorized') { |
@@ -166,20 +166,20 @@ discard block |
||
166 | 166 | // @todo: Change with gateway. |
167 | 167 | $settings = $doctrine->getTable('Intraface_modules_onlinepayment_Language')->findOneByIntranetId($kernel->intranet->getId()); |
168 | 168 | |
169 | - $subject = $settings->getConfirmationEmailSubject($shop->getLanguage()) . ' (#' . $payment_id . ')'; |
|
170 | - $body = $settings->getConfirmationEmailBody($shop->getLanguage()) . "\n\n" . $this->kernel->intranet->address->get('name'); |
|
169 | + $subject = $settings->getConfirmationEmailSubject($shop->getLanguage()).' (#'.$payment_id.')'; |
|
170 | + $body = $settings->getConfirmationEmailBody($shop->getLanguage())."\n\n".$this->kernel->intranet->address->get('name'); |
|
171 | 171 | |
172 | 172 | } catch (Exception $e) { |
173 | 173 | } |
174 | 174 | |
175 | 175 | if (empty($subject)) { |
176 | - $subject = 'Payment confirmation / betalingsbekræftelse (#' . $payment_id . ')'; |
|
176 | + $subject = 'Payment confirmation / betalingsbekræftelse (#'.$payment_id.')'; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | if (empty($body)) { |
180 | - $body = 'We have received your payment for order #' .$debtor->getId(). '.' . "\n\n"; |
|
181 | - $body .= 'Vi har modtaget din betaling for ordre #' .$debtor->getId(). '.'; |
|
182 | - $body .= "\n\nYours sincerely / Venlig hilsen\n". $this->kernel->intranet->address->get('name'); |
|
180 | + $body = 'We have received your payment for order #'.$debtor->getId().'.'."\n\n"; |
|
181 | + $body .= 'Vi har modtaget din betaling for ordre #'.$debtor->getId().'.'; |
|
182 | + $body .= "\n\nYours sincerely / Venlig hilsen\n".$this->kernel->intranet->address->get('name'); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | $data = array('contact_id' => $debtor->getContact()->getId(), |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | if (!$email->queue()) { |
198 | 198 | $this->error->merge($email->error->getMessage()); |
199 | - throw new Exception('Could not send email to ' . $debtor->getContact()->getId()); |
|
199 | + throw new Exception('Could not send email to '.$debtor->getContact()->getId()); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | return true; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | if (!$payment_id = $onlinepayment->create()) { |
218 | 218 | // this is probably a little to hard reaction |
219 | - throw new XML_RPC2_FaultException('onlinepayment could not be created' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
219 | + throw new XML_RPC2_FaultException('onlinepayment could not be created'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | return $this->prepareResponseData($payment_id); |
@@ -119,12 +119,12 @@ |
||
119 | 119 | $body .= "\n\nYours sincerely / Venlig hilsen\n". $this->kernel->intranet->address->get('name'); |
120 | 120 | |
121 | 121 | $data = array('contact_id' => $debtor->getContact()->getId(), |
122 | - 'subject' => $subject, |
|
123 | - 'body' => $body, |
|
124 | - 'from_email' => $this->kernel->intranet->address->get('email'), |
|
125 | - 'from_name' => $this->kernel->intranet->address->get('name'), |
|
126 | - 'type_id' => 13, // onlinepayment |
|
127 | - 'belong_to' => $payment_id); |
|
122 | + 'subject' => $subject, |
|
123 | + 'body' => $body, |
|
124 | + 'from_email' => $this->kernel->intranet->address->get('email'), |
|
125 | + 'from_name' => $this->kernel->intranet->address->get('name'), |
|
126 | + 'type_id' => 13, // onlinepayment |
|
127 | + 'belong_to' => $payment_id); |
|
128 | 128 | |
129 | 129 | if (!$email->save($data)) { |
130 | 130 | throw new Exception('Could not save email to onlinepayment');; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | if (!$payment_id = $onlinepayment->save($values)) { |
100 | 100 | // this is probably a little to hard reaction. |
101 | - throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt ' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
101 | + throw new XML_RPC2_FaultException('Onlinebetaling kunne ikke blive gemt '.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($onlinepayment->get('status') == 'authorized') { |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | $this->kernel->useShared('email'); |
114 | 114 | $email = new Email($this->kernel); |
115 | 115 | |
116 | - $subject = 'Payment confirmation / betalingsbekræftelse (#' . $payment_id . ')'; |
|
117 | - $body = 'We have received your payment for order #' .$debtor->getId(). '.' . "\n\n"; |
|
118 | - $body .= 'Vi har modtaget din betaling for ordre #' .$debtor->getId(). '.'; |
|
119 | - $body .= "\n\nYours sincerely / Venlig hilsen\n". $this->kernel->intranet->address->get('name'); |
|
116 | + $subject = 'Payment confirmation / betalingsbekræftelse (#'.$payment_id.')'; |
|
117 | + $body = 'We have received your payment for order #'.$debtor->getId().'.'."\n\n"; |
|
118 | + $body .= 'Vi har modtaget din betaling for ordre #'.$debtor->getId().'.'; |
|
119 | + $body .= "\n\nYours sincerely / Venlig hilsen\n".$this->kernel->intranet->address->get('name'); |
|
120 | 120 | |
121 | 121 | $data = array('contact_id' => $debtor->getContact()->getId(), |
122 | 122 | 'subject' => $subject, |
@@ -127,13 +127,13 @@ discard block |
||
127 | 127 | 'belong_to' => $payment_id); |
128 | 128 | |
129 | 129 | if (!$email->save($data)) { |
130 | - throw new Exception('Could not save email to onlinepayment');; |
|
130 | + throw new Exception('Could not save email to onlinepayment'); ; |
|
131 | 131 | return false; |
132 | 132 | } |
133 | 133 | |
134 | 134 | if (!$email->queue()) { |
135 | 135 | $this->error->merge($email->error->getMessage()); |
136 | - throw new Exception('Could not send email to ' . $debtor->getContact()->getId());; |
|
136 | + throw new Exception('Could not send email to '.$debtor->getContact()->getId()); ; |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | if (!$payment_id = $onlinepayment->create()) { |
158 | 158 | // this is probably a little to hard reaction |
159 | - throw new XML_RPC2_FaultException('onlinepayment could not be created' . strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
159 | + throw new XML_RPC2_FaultException('onlinepayment could not be created'.strtolower(implode(', ', $onlinepayment->error->getMessage())), -4); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | return $this->prepareResponseData($payment_id); |