@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | // all widget have static id to not change id of others widgets in page |
288 | 288 | |
289 | - $infoMessages = $_SESSION['app_msginfo']; |
|
289 | + $infoMessages = $_SESSION['app_msginfo']; |
|
290 | 290 | foreach ($infoMessages as $infoLine) { |
291 | 291 | $this->App()->Controller()->addMessage($infoLine); |
292 | 292 | } |
@@ -304,6 +304,6 @@ discard block |
||
304 | 304 | * @see app.jquery.js#window.babAddonLibApp.numberFormat |
305 | 305 | */ |
306 | 306 | $this->setMetadata('numberFormatSeparator', mb_substr($str, 1, 1)); |
307 | - $this->setMetadata('numberFormatPrecision', mb_strlen($str) -2); |
|
307 | + $this->setMetadata('numberFormatPrecision', mb_strlen($str) - 2); |
|
308 | 308 | } |
309 | 309 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if (empty($description)) { |
48 | 48 | $description = $field->getName(); |
49 | 49 | } |
50 | - $fieldLabel = $W->Label($description . ':'); |
|
50 | + $fieldLabel = $W->Label($description.':'); |
|
51 | 51 | |
52 | 52 | if ($field instanceof ORM_DateField) { |
53 | 53 | $widget = $W->DatePicker(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | if (empty($description)) { |
104 | 104 | $description = $field->getName(); |
105 | 105 | } |
106 | - $fieldLabel = $W->Label($description . ':'); |
|
106 | + $fieldLabel = $W->Label($description.':'); |
|
107 | 107 | |
108 | 108 | if ($field instanceof ORM_DateField) { |
109 | 109 | $widget = $W->PeriodPicker(); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $nbOptions = 0; |
207 | 207 | foreach ($iterator as $record) { |
208 | 208 | if (isset($record->code)) { |
209 | - $optionText = $record->code . ' - ' . $record->$fieldName; |
|
209 | + $optionText = $record->code.' - '.$record->$fieldName; |
|
210 | 210 | } else { |
211 | 211 | $optionText = $record->$fieldName; |
212 | 212 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if (null === $url) { |
113 | 113 | $script = '<script type="text/javascript">'; |
114 | 114 | if (isset($message)) { |
115 | - $script .= 'alert("' . bab_toHtml($message, BAB_HTML_JS) . '");'; |
|
115 | + $script .= 'alert("'.bab_toHtml($message, BAB_HTML_JS).'");'; |
|
116 | 116 | } |
117 | 117 | $script .= 'history.back();'; |
118 | 118 | $script .= '</script>'; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $url = $url->url(); |
125 | 125 | } |
126 | 126 | if (!empty($babBody->msgerror)) { |
127 | - $url .= '&msgerror=' . urlencode($babBody->msgerror); |
|
127 | + $url .= '&msgerror='.urlencode($babBody->msgerror); |
|
128 | 128 | } |
129 | 129 | if (isset($message)) { |
130 | 130 | $lines = explode("\n", $message); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | - header('Location: ' . $url); |
|
136 | + header('Location: '.$url); |
|
137 | 137 | die; |
138 | 138 | } |
139 | 139 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | function app_fileUploadError($error) |
167 | 167 | { |
168 | - switch($error) { |
|
168 | + switch ($error) { |
|
169 | 169 | case UPLOAD_ERR_OK: |
170 | 170 | return null; |
171 | 171 |
@@ -94,7 +94,7 @@ |
||
94 | 94 | public function hasNoAccess(app_RecordSet $recordSet, $accessType, $user = null) |
95 | 95 | { |
96 | 96 | $criterion = $this->getAccessCriterion($recordSet, $accessType, $user); |
97 | - if (! $criterion instanceof ORM_FalseCriterion) { |
|
97 | + if (!$criterion instanceof ORM_FalseCriterion) { |
|
98 | 98 | return false; |
99 | 99 | } |
100 | 100 | return true; |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | return parent::delete($criteria); |
244 | 244 | } |
245 | 245 | |
246 | - require_once $GLOBALS['babInstallPath'] . '/utilit/dateTime.php'; |
|
246 | + require_once $GLOBALS['babInstallPath'].'/utilit/dateTime.php'; |
|
247 | 247 | $now = BAB_DateTime::now()->getIsoDateTime(); |
248 | 248 | |
249 | 249 | $records = $this->select($criteria); |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | return parent::save($record); |
280 | 280 | } |
281 | 281 | |
282 | - require_once $GLOBALS['babInstallPath'] . '/utilit/dateTime.php'; |
|
282 | + require_once $GLOBALS['babInstallPath'].'/utilit/dateTime.php'; |
|
283 | 283 | |
284 | 284 | $now = BAB_DateTime::now()->getIsoDateTime(); |
285 | 285 | |
@@ -309,11 +309,11 @@ discard block |
||
309 | 309 | */ |
310 | 310 | private function uuid() |
311 | 311 | { |
312 | - return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', |
|
313 | - mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), |
|
314 | - mt_rand( 0, 0x0fff ) | 0x4000, |
|
315 | - mt_rand( 0, 0x3fff ) | 0x8000, |
|
316 | - mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); |
|
312 | + return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', |
|
313 | + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), |
|
314 | + mt_rand(0, 0x0fff) | 0x4000, |
|
315 | + mt_rand(0, 0x3fff) | 0x8000, |
|
316 | + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | /** |
@@ -384,10 +384,10 @@ discard block |
||
384 | 384 | */ |
385 | 385 | class app_TraceableRecord extends app_Record |
386 | 386 | { |
387 | - const DELETED_STATUS_EXISTING = 0; // Normal status of a record |
|
388 | - const DELETED_STATUS_DELETED = 1; // Record is deleted by retrievable by admin |
|
389 | - const DELETED_STATUS_IN_TRASH = 2; // Record is deleted by retrievable by authorized users |
|
390 | - const DELETED_STATUS_DRAFT = 3; // Status is in draft (not yet created) |
|
387 | + const DELETED_STATUS_EXISTING = 0; // Normal status of a record |
|
388 | + const DELETED_STATUS_DELETED = 1; // Record is deleted by retrievable by admin |
|
389 | + const DELETED_STATUS_IN_TRASH = 2; // Record is deleted by retrievable by authorized users |
|
390 | + const DELETED_STATUS_DRAFT = 3; // Status is in draft (not yet created) |
|
391 | 391 | |
392 | 392 | public static function getDeletedStatuses() |
393 | 393 | { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @copyright Copyright (c) 2008 by CANTICO ({@link http://www.cantico.fr}) |
22 | 22 | */ |
23 | 23 | |
24 | -require_once APP_CTRL_PATH . '/record.ctrl.php'; |
|
24 | +require_once APP_CTRL_PATH.'/record.ctrl.php'; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * This controller manages actions that can be performed on custom fields |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $W->Link( |
40 | 40 | $App->translate('Add a custom field'), |
41 | 41 | $this->proxy()->edit() |
42 | - )->addClass('icon', Func_Icons::ACTIONS_LIST_ADD) |
|
42 | + )->addClass('icon', Func_Icons::ACTIONS_LIST_ADD) |
|
43 | 43 | ->setOpenMode(Widget_Link::OPEN_DIALOG_AND_RELOAD) |
44 | 44 | ); |
45 | 45 |
@@ -119,7 +119,7 @@ |
||
119 | 119 | throw new app_SaveException($this->App()->translate('The name is mandatory')); |
120 | 120 | } |
121 | 121 | |
122 | - return '_' . $name; |
|
122 | + return '_'.$name; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | -require_once dirname(__FILE__). '/functions.php'; |
|
27 | +require_once dirname(__FILE__).'/functions.php'; |
|
28 | 28 | |
29 | 29 | |
30 | 30 | function LibApp_upgrade($sVersionBase, $sVersionIni) |
@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | |
81 | 81 | $babBody = bab_getBody(); |
82 | 82 | $addon = bab_getAddonInfosInstance('libapp'); |
83 | - $babBody->addStyleSheet($addon->getStylePath() . '/styles.css'); |
|
84 | - $babBody->addJavascriptFile($addon->getTemplatePath() . 'libapp.js'); |
|
83 | + $babBody->addStyleSheet($addon->getStylePath().'/styles.css'); |
|
84 | + $babBody->addJavascriptFile($addon->getTemplatePath().'libapp.js'); |
|
85 | 85 | |
86 | 86 | $App = app_App(); |
87 | - if($App->isSSEEnabled()){ |
|
88 | - $babBody->addJavascriptFile($addon->getTemplatePath() . 'notification.js'); |
|
89 | - if(bab_isUserLogged()){ |
|
87 | + if ($App->isSSEEnabled()) { |
|
88 | + $babBody->addJavascriptFile($addon->getTemplatePath().'notification.js'); |
|
89 | + if (bab_isUserLogged()) { |
|
90 | 90 | $babBody->babecho('<script>window.libapp={"sseServerUrl": "'.$App->Controller()->SSE()->server()->url().'"}</script>'); |
91 | 91 | $babBody->addJavascriptFile($addon->getTemplatePath().'sse.js'); |
92 | 92 | } |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | $addonPhpPath = $addon->getPhpPath(); |
113 | 113 | |
114 | 114 | require_once $GLOBALS['babInstallPath'].'utilit/functionalityincl.php'; |
115 | - require_once dirname(__FILE__) . '/portletbackend.class.php'; |
|
115 | + require_once dirname(__FILE__).'/portletbackend.class.php'; |
|
116 | 116 | $functionalities = new bab_functionalities(); |
117 | - $functionalities->registerClass('Func_PortletBackend_App', $addonPhpPath . 'portletbackend.class.php'); |
|
117 | + $functionalities->registerClass('Func_PortletBackend_App', $addonPhpPath.'portletbackend.class.php'); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | \ No newline at end of file |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | public function selectUserSSE($user = null) |
62 | 62 | { |
63 | - if(!isset($user)){ |
|
63 | + if (!isset($user)) { |
|
64 | 64 | $App = $this->App(); |
65 | 65 | $user = $App->getCurrentUser(); |
66 | 66 | } |
@@ -82,29 +82,29 @@ discard block |
||
82 | 82 | $userSSEReloads = $this->select($this->user->is($user)->_AND_($this->type->is(app_SSE::TYPE_RELOAD_SELECTOR))); |
83 | 83 | $reloadSelectors = array(); |
84 | 84 | $now = date('Y-m-d H:i:s'); |
85 | - foreach ($userSSEReloads as $sseMsg){ |
|
85 | + foreach ($userSSEReloads as $sseMsg) { |
|
86 | 86 | $reloadSelectors[] = $sseMsg->data; |
87 | - if($delete && $now > date($sseMsg->deleteOn)){ |
|
87 | + if ($delete && $now > date($sseMsg->deleteOn)) { |
|
88 | 88 | $sseMsg->delete(); |
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | - if(!empty($reloadSelectors)){ |
|
92 | + if (!empty($reloadSelectors)) { |
|
93 | 93 | $sseData .= '"reloadSelector":'.bab_json_encode($reloadSelectors); |
94 | 94 | $hasData = true; |
95 | 95 | } |
96 | 96 | |
97 | 97 | $userSSEBrowserNotifications = $this->select($this->user->is($user)->_AND_($this->type->is(app_SSE::TYPE_BROWSER_NOTIFICATION))); |
98 | 98 | $browserNotifications = array(); |
99 | - foreach ($userSSEBrowserNotifications as $sseMsg){ |
|
99 | + foreach ($userSSEBrowserNotifications as $sseMsg) { |
|
100 | 100 | $browserNotifications[] = $sseMsg->data; |
101 | - if($delete){ |
|
101 | + if ($delete) { |
|
102 | 102 | $sseMsg->delete(); |
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
106 | - if(!empty($browserNotifications)){ |
|
107 | - if($hasData){ |
|
106 | + if (!empty($browserNotifications)) { |
|
107 | + if ($hasData) { |
|
108 | 108 | $sseData .= ', '; |
109 | 109 | } |
110 | 110 | $sseData .= '"browserNotifications":'.bab_json_encode($browserNotifications); |
@@ -125,20 +125,20 @@ discard block |
||
125 | 125 | { |
126 | 126 | $App = $this->App(); |
127 | 127 | $users = array(); |
128 | - if(!isset($for)){ |
|
128 | + if (!isset($for)) { |
|
129 | 129 | $users[] = $App->getCurrentUser(); |
130 | 130 | } |
131 | - else if(!is_array($for)){ |
|
132 | - if($for === 'all'){ |
|
131 | + else if (!is_array($for)) { |
|
132 | + if ($for === 'all') { |
|
133 | 133 | $users = $App->getLoggedUsers(); |
134 | 134 | } |
135 | - else{ |
|
135 | + else { |
|
136 | 136 | $users[] = $for; |
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
140 | 140 | $deleteOn = self::getDeleteOn(); |
141 | - foreach ($users as $user){ |
|
141 | + foreach ($users as $user) { |
|
142 | 142 | $record = $this->newRecord(); |
143 | 143 | $record->user = $user; |
144 | 144 | $record->data = $reloadSelector; |
@@ -164,20 +164,20 @@ discard block |
||
164 | 164 | { |
165 | 165 | $App = $this->App(); |
166 | 166 | $users = array(); |
167 | - if(!isset($for)){ |
|
167 | + if (!isset($for)) { |
|
168 | 168 | $users[] = $App->getCurrentUser(); |
169 | 169 | } |
170 | - else if(!is_array($for)){ |
|
171 | - if($for === 'all'){ |
|
170 | + else if (!is_array($for)) { |
|
171 | + if ($for === 'all') { |
|
172 | 172 | $users = $App->getLoggedUsers(); |
173 | 173 | } |
174 | - else{ |
|
174 | + else { |
|
175 | 175 | $users[] = $for; |
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
179 | 179 | $deleteOn = self::getDeleteOn(); |
180 | - foreach ($users as $user){ |
|
180 | + foreach ($users as $user) { |
|
181 | 181 | $record = $this->newRecord(); |
182 | 182 | $record->user = $user; |
183 | 183 | $record->data = bab_json_encode($data); |