@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | |
49 | 49 | case '_actions_': |
50 | 50 | $box = $W->FlowItems(); |
51 | - if($record->isUpdatable()){ |
|
51 | + if ($record->isUpdatable()) { |
|
52 | 52 | $box->addItem($W->Link('', $App->Controller() |
53 | 53 | ->CustomField() |
54 | 54 | ->edit($record->id)) |
55 | 55 | ->addClass('icon', \Func_Icons::ACTIONS_DOCUMENT_EDIT) |
56 | 56 | ->setOpenMode(WidgetLink::OPEN_DIALOG_AND_RELOAD)); |
57 | 57 | } |
58 | - if($record->isDeletable()){ |
|
58 | + if ($record->isDeletable()) { |
|
59 | 59 | $box->addItem($W->Link('', $App->Controller() |
60 | 60 | ->CustomField() |
61 | 61 | ->confirmDelete($record->id)) |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | |
68 | 68 | case 'mandatory': |
69 | 69 | case 'visible_in_shop': |
70 | - if(self::getRecordFieldValue($record, $fieldPath)){ |
|
70 | + if (self::getRecordFieldValue($record, $fieldPath)) { |
|
71 | 71 | return $W->Label($App->translate('Yes')); |
72 | 72 | } |
73 | - else{ |
|
73 | + else { |
|
74 | 74 | return $W->Label($App->translate('No')); |
75 | 75 | } |
76 | 76 | break; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $this->addColumn(WidgetTableModelViewColumn($recordSet->visible, $App->translate('Visible in list'))->addClass('widget-10em')); |
99 | 99 | $this->addColumn(WidgetTableModelViewColumn('_actions_', '')->setSortable(false) |
100 | 100 | ->addClass('widget-column-thin', 'widget-nowrap', \Func_Icons::ICON_LEFT_SYMBOLIC)); |
101 | - if($App->onlineShop){ |
|
101 | + if ($App->onlineShop) { |
|
102 | 102 | $this->addColumn(WidgetTableModelViewColumn($recordSet->visible_in_shop, $App->translate('Visible in online shop'))); |
103 | 103 | } |
104 | 104 |
@@ -69,8 +69,7 @@ |
||
69 | 69 | case 'visible_in_shop': |
70 | 70 | if(self::getRecordFieldValue($record, $fieldPath)){ |
71 | 71 | return $W->Label($App->translate('Yes')); |
72 | - } |
|
73 | - else{ |
|
72 | + } else{ |
|
74 | 73 | return $W->Label($App->translate('No')); |
75 | 74 | } |
76 | 75 | break; |
@@ -23,16 +23,16 @@ |
||
23 | 23 | */ |
24 | 24 | use Capwelton\Widgets\Widgets\Helpers\WidgetAction; |
25 | 25 | |
26 | -require_once dirname(__FILE__) . '/functions.php'; |
|
26 | +require_once dirname(__FILE__).'/functions.php'; |
|
27 | 27 | |
28 | 28 | $App = app_App(); |
29 | 29 | |
30 | -try{ |
|
30 | +try { |
|
31 | 31 | $controller = $App->Controller(); |
32 | 32 | $action = WidgetAction::fromRequest(); |
33 | 33 | $controller->execute($action); |
34 | 34 | } |
35 | -catch (bab_UnknownActionException $e){ |
|
36 | - die('<div class="app-error">' . $App->translate('We have a problem finding this page...') . '</div>'); |
|
35 | +catch (bab_UnknownActionException $e) { |
|
36 | + die('<div class="app-error">'.$App->translate('We have a problem finding this page...').'</div>'); |
|
37 | 37 | } |
38 | 38 |
@@ -31,8 +31,7 @@ |
||
31 | 31 | $controller = $App->Controller(); |
32 | 32 | $action = WidgetAction::fromRequest(); |
33 | 33 | $controller->execute($action); |
34 | -} |
|
35 | -catch (bab_UnknownActionException $e){ |
|
34 | +} catch (bab_UnknownActionException $e){ |
|
36 | 35 | die('<div class="app-error">' . $App->translate('We have a problem finding this page...') . '</div>'); |
37 | 36 | } |
38 | 37 |
@@ -68,15 +68,15 @@ discard block |
||
68 | 68 | { |
69 | 69 | $main = new \ReflectionClass($this->set); |
70 | 70 | $dependencies = array(); |
71 | - if($main->hasMethod('getRequiredComponents')){ |
|
71 | + if ($main->hasMethod('getRequiredComponents')) { |
|
72 | 72 | $requiredComponents = $this->recordSet()->getRequiredComponents(); |
73 | - foreach ($requiredComponents as $requiredComponent){ |
|
73 | + foreach ($requiredComponents as $requiredComponent) { |
|
74 | 74 | $dependencies['requiredComponents'][] = $requiredComponent; |
75 | 75 | } |
76 | 76 | } |
77 | - if($main->hasMethod('getOptionalComponents')){ |
|
77 | + if ($main->hasMethod('getOptionalComponents')) { |
|
78 | 78 | $optionalComponents = $this->recordSet()->getOptionalComponents(); |
79 | - foreach ($optionalComponents as $optionalComponent){ |
|
79 | + foreach ($optionalComponents as $optionalComponent) { |
|
80 | 80 | $dependencies['optionalComponents'][] = $optionalComponent; |
81 | 81 | } |
82 | 82 | } |
@@ -92,20 +92,20 @@ discard block |
||
92 | 92 | |
93 | 93 | public function getPackageName() |
94 | 94 | { |
95 | - if(! isset($this->packageName) || empty($this->packageName)){ |
|
95 | + if (!isset($this->packageName) || empty($this->packageName)) { |
|
96 | 96 | $packageName = ''; |
97 | 97 | $setRc = new \ReflectionClass($this->set); |
98 | 98 | // Tries to automatically retrieve the package name from the definition.json |
99 | - if($setRc){ |
|
99 | + if ($setRc) { |
|
100 | 100 | // Get definition file path |
101 | 101 | $definitionPathParts = explode('/', $setRc->getFileName()); |
102 | 102 | $definitionPath = implode('/', (array_splice($definitionPathParts, 0, - 3))); |
103 | 103 | $definitionPath .= '/definition.json'; |
104 | 104 | $definitionContent = file_get_contents($definitionPath); |
105 | - if($definitionContent){ |
|
105 | + if ($definitionContent) { |
|
106 | 106 | // Get definition.json content |
107 | 107 | $definitionContent = json_decode($definitionContent, true); |
108 | - if($definitionContent && isset($definitionContent['name'])){ |
|
108 | + if ($definitionContent && isset($definitionContent['name'])) { |
|
109 | 109 | // Get name in definition.json |
110 | 110 | $definitionNameParts = explode('/', $definitionContent['name']); |
111 | 111 | $packageName = $definitionNameParts[count($definitionNameParts) - 1]; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function onUpdate() |
126 | 126 | { |
127 | 127 | $main = new \ReflectionClass($this->set); |
128 | - if($main->hasMethod('onUpdate')){ |
|
128 | + if ($main->hasMethod('onUpdate')) { |
|
129 | 129 | $this->recordSet()->onUpdate(); |
130 | 130 | } |
131 | 131 | } |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function controller($proxy = true) |
137 | 137 | { |
138 | - if(! isset($this->controllerObject)){ |
|
138 | + if (!isset($this->controllerObject)) { |
|
139 | 139 | $this->app->includeRecordController(); |
140 | 140 | $ctrl = $this->controller; |
141 | 141 | $this->controllerObject = new $ctrl($this->app, $this); |
142 | 142 | } |
143 | - if($proxy){ |
|
143 | + if ($proxy) { |
|
144 | 144 | return $this->controllerObject->proxy(); |
145 | 145 | } |
146 | 146 | return $this->controllerObject; |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | public function ui() |
161 | 161 | { |
162 | 162 | $this->app->includeUi(); |
163 | - if(! isset($this->uiObject)){ |
|
163 | + if (!isset($this->uiObject)) { |
|
164 | 164 | $ui = $this->ui; |
165 | - if(! isset($ui)){ |
|
165 | + if (!isset($ui)) { |
|
166 | 166 | return null; |
167 | 167 | } |
168 | 168 | $this->uiObject = new $ui($this->app); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | public function getSetClassName() |
180 | 180 | { |
181 | 181 | $reflectionClass = new \ReflectionClass($this->set); |
182 | - return $this->app->classPrefix . $reflectionClass->getShortName(); |
|
182 | + return $this->app->classPrefix.$reflectionClass->getShortName(); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | public function getRecordClassName() |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | |
196 | 196 | public function getDefinition() |
197 | 197 | { |
198 | - $componentDefinitionObjectName = 'Capwelton\App\\' . $this->getPackageName() . '\ComponentDefinition\ComponentDefinition'; |
|
199 | - if(class_exists($componentDefinitionObjectName)){ |
|
198 | + $componentDefinitionObjectName = 'Capwelton\App\\'.$this->getPackageName().'\ComponentDefinition\ComponentDefinition'; |
|
199 | + if (class_exists($componentDefinitionObjectName)) { |
|
200 | 200 | return new $componentDefinitionObjectName(); |
201 | 201 | } |
202 | 202 | return null; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | public function getLangPath() |
206 | 206 | { |
207 | 207 | $def = $this->getDefinition(); |
208 | - if($def){ |
|
208 | + if ($def) { |
|
209 | 209 | return $def->getLangPath($this->app); |
210 | 210 | } |
211 | 211 | return null; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | public function getStylePath() |
215 | 215 | { |
216 | 216 | $def = $this->getDefinition(); |
217 | - if($def){ |
|
217 | + if ($def) { |
|
218 | 218 | return $def->getStylePath($this->app); |
219 | 219 | } |
220 | 220 | return null; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | public function getScriptPath() |
224 | 224 | { |
225 | 225 | $def = $this->getDefinition(); |
226 | - if($def){ |
|
226 | + if ($def) { |
|
227 | 227 | return $def->getScriptPath($this->app); |
228 | 228 | } |
229 | 229 | return null; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function display() |
36 | 36 | { |
37 | 37 | $App = $this->App(); |
38 | - if(!bab_isUserAdministrator()) { |
|
38 | + if (!bab_isUserAdministrator()) { |
|
39 | 39 | throw new AppAccessException($App->translate('You do not have access to this page')); |
40 | 40 | } |
41 | 41 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function configureSSE() |
75 | 75 | { |
76 | 76 | $App = $this->App(); |
77 | - if(!bab_isUserAdministrator()) { |
|
77 | + if (!bab_isUserAdministrator()) { |
|
78 | 78 | throw new AppAccessException($App->translate('You do not have access to this page')); |
79 | 79 | } |
80 | 80 |
@@ -131,8 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | if(empty($customfield['id'])){ |
133 | 133 | $record = $set->newRecord(); |
134 | - } |
|
135 | - else{ |
|
134 | + } else{ |
|
136 | 135 | $record = $set->get($customfield['id']); |
137 | 136 | } |
138 | 137 | |
@@ -142,8 +141,7 @@ discard block |
||
142 | 141 | $enumvalues[$enumkey] = $set->enumvalues->input($enumvalue); |
143 | 142 | } |
144 | 143 | $record->enumvalues = serialize($enumvalues); |
145 | - } |
|
146 | - else{ |
|
144 | + } else{ |
|
147 | 145 | $record->enumvalues = ''; |
148 | 146 | } |
149 | 147 |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $page->addClass('app-page-editor'); |
103 | 103 | $page->setTitle($App->translate('Edit custom field')); |
104 | 104 | |
105 | - if(null !== $customfield){ |
|
105 | + if (null !== $customfield) { |
|
106 | 106 | $set = $App->CustomFieldSet(); |
107 | 107 | $customfield = $set->request($customfield); |
108 | 108 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | $page->addItem($form); |
113 | 113 | |
114 | - if($customfield instanceof AppCustomField){ |
|
114 | + if ($customfield instanceof AppCustomField) { |
|
115 | 115 | $actionsFrame = $page->ActionsFrame(); |
116 | 116 | $page->addContextItem($actionsFrame); |
117 | 117 | |
@@ -131,21 +131,21 @@ discard block |
||
131 | 131 | |
132 | 132 | $set = $App->CustomFieldSet(); |
133 | 133 | |
134 | - if(empty($customfield['id'])){ |
|
134 | + if (empty($customfield['id'])) { |
|
135 | 135 | $record = $set->newRecord(); |
136 | 136 | } |
137 | - else{ |
|
137 | + else { |
|
138 | 138 | $record = $set->get($customfield['id']); |
139 | 139 | } |
140 | 140 | |
141 | - if('Enum' === $customfield['fieldtype'] || 'Set' === $customfield['fieldtype']){ |
|
141 | + if ('Enum' === $customfield['fieldtype'] || 'Set' === $customfield['fieldtype']) { |
|
142 | 142 | $enumvalues = array(); |
143 | - foreach ($customfield['enumvalues'] as $enumkey => $enumvalue){ |
|
143 | + foreach ($customfield['enumvalues'] as $enumkey => $enumvalue) { |
|
144 | 144 | $enumvalues[$enumkey] = $set->enumvalues->input($enumvalue); |
145 | 145 | } |
146 | 146 | $record->enumvalues = serialize($enumvalues); |
147 | 147 | } |
148 | - else{ |
|
148 | + else { |
|
149 | 149 | $record->enumvalues = ''; |
150 | 150 | } |
151 | 151 | |
@@ -156,11 +156,11 @@ discard block |
||
156 | 156 | |
157 | 157 | // refresh target table structure |
158 | 158 | |
159 | - $object = $record->object . 'Set'; |
|
159 | + $object = $record->object.'Set'; |
|
160 | 160 | $mysqlbackend = new ORMMySqlBackend($GLOBALS['babDB']); |
161 | 161 | |
162 | 162 | $recordSet = $App->$object(); |
163 | - if(method_exists($recordSet, 'useLang')){ |
|
163 | + if (method_exists($recordSet, 'useLang')) { |
|
164 | 164 | // This is necessary if the recordSet constructor uses a setLang(). |
165 | 165 | // We need to revert to multilang fields before synchronizing. |
166 | 166 | $recordSet->useLang(false); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | $sql = $mysqlbackend->setToSql($recordSet); |
170 | 170 | |
171 | - require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php'; |
|
171 | + require_once $GLOBALS['babInstallPath'].'utilit/devtools.php'; |
|
172 | 172 | $synchronize = new \bab_synchronizeSql(); |
173 | 173 | $synchronize->fromSqlString($sql); |
174 | 174 | |
@@ -183,17 +183,17 @@ discard block |
||
183 | 183 | { |
184 | 184 | $App = $this->App(); |
185 | 185 | |
186 | - if(! $customfield){ |
|
186 | + if (!$customfield) { |
|
187 | 187 | throw new AppAccessException($App->translate('Access denied')); |
188 | 188 | } |
189 | 189 | |
190 | 190 | $set = $App->CustomFieldSet(); |
191 | 191 | $record = $set->request($customfield); |
192 | - $object = $record->object . 'Set'; |
|
192 | + $object = $record->object.'Set'; |
|
193 | 193 | $set->delete($set->id->is($customfield)); |
194 | 194 | |
195 | 195 | $recordSet = $App->$object(); |
196 | - if(method_exists($recordSet, 'useLang')){ |
|
196 | + if (method_exists($recordSet, 'useLang')) { |
|
197 | 197 | // This is necessary if the recordSet constructor uses a setLang(). |
198 | 198 | // We need to revert to multilang fields before synchronizing. |
199 | 199 | $recordSet->useLang(false); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $mysqlbackend = new ORMMySqlBackend($GLOBALS['babDB']); |
203 | 203 | $sql = $mysqlbackend->setToSql($recordSet); |
204 | 204 | |
205 | - require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php'; |
|
205 | + require_once $GLOBALS['babInstallPath'].'utilit/devtools.php'; |
|
206 | 206 | $synchronize = new \bab_synchronizeSql(); |
207 | 207 | $synchronize->fromSqlString($sql); |
208 | 208 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | use Capwelton\Widgets\Widgets\Item\WidgetLink; |
27 | 27 | use Capwelton\Widgets\Widgets\Layout\WidgetFlexLayout; |
28 | 28 | use Capwelton\LibApp\Set\AppNotification; |
29 | -require_once APP_CTRL_PATH . '/record.ctrl.php'; |
|
29 | +require_once APP_CTRL_PATH.'/record.ctrl.php'; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * This controller manages actions that can be performed on notifications |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | ->popup($notifBox->getId())); |
57 | 57 | $page->addClass(AppNotification::NOTIFICATION_PORTLET_CLASS); |
58 | 58 | |
59 | - foreach ($notifications as $notification){ |
|
59 | + foreach ($notifications as $notification) { |
|
60 | 60 | $notifBox->addItem($W->Link($notification->title, $this->proxy() |
61 | 61 | ->display($notification->id)) |
62 | 62 | ->setOpenMode(WidgetLink::OPEN_DIALOG)); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $set = $this->getRecordSet(); |
71 | 71 | $record = $set->get($id); |
72 | - if(! $record){ |
|
72 | + if (!$record) { |
|
73 | 73 | return true; |
74 | 74 | } |
75 | 75 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $notifSet = $App->NotificationSet(); |
113 | 113 | |
114 | 114 | $box = $W->FlowItems()->setIconFormat(24, 'center'); |
115 | - if(isset($itemId)){ |
|
115 | + if (isset($itemId)) { |
|
116 | 116 | $box->setId($itemId); |
117 | 117 | } |
118 | 118 | $notifs = $notifSet->selectUserNotifications(); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $box->addItem($btnWidget = $W->FlexItems()) |
125 | 125 | ->setIcon(16, 'left'); |
126 | - if($nbNotif > 0){ |
|
126 | + if ($nbNotif > 0) { |
|
127 | 127 | $btnWidget->addItem($W->Label($nbNotif) |
128 | 128 | ->addClass('notificationNumber')); |
129 | 129 | $btnWidget->addClass('notificationDisplayButton'); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | ->addClass('notificationBoxElements') |
147 | 147 | ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL)); |
148 | 148 | |
149 | - foreach ($notifs as $notif){ |
|
149 | + foreach ($notifs as $notif) { |
|
150 | 150 | $notificationBoxElements->addItem($W->Link($el = $W->FlexItems($W->Label($notif->title) |
151 | 151 | ->addClass('notificationElementTitle'), $W->Label(date('d/m/Y H:i', strtotime($notif->createdOn))) |
152 | 152 | ->addClass('notificationElementDate')) |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | ->display($notif->id)) |
155 | 155 | ->addClass('notificationBoxElement') |
156 | 156 | ->setOpenMode(WidgetLink::OPEN_DIALOG)); |
157 | - if(! empty($notif->description)){ |
|
157 | + if (!empty($notif->description)) { |
|
158 | 158 | $desc = $notif->description; |
159 | - if(strlen($desc) > 40){ |
|
160 | - $desc = trim(substr($desc, 0, 40)) . '...'; |
|
159 | + if (strlen($desc) > 40) { |
|
160 | + $desc = trim(substr($desc, 0, 40)).'...'; |
|
161 | 161 | } |
162 | 162 | $el->addItem($W->Label($desc) |
163 | 163 | ->addClass('notificationElementDescription'), 1); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | $box->addItem($notificationBox); |
171 | 171 | } |
172 | - else{ |
|
172 | + else { |
|
173 | 173 | $notifIcon .= 'webapp-bell-o'; |
174 | 174 | } |
175 | 175 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | $notifSet = $App->NotificationSet(); |
213 | 213 | $notifs = $notifSet->selectUserNotifications(); |
214 | - foreach ($notifs as $notif){ |
|
214 | + foreach ($notifs as $notif) { |
|
215 | 215 | $notif->markAsSeen(); |
216 | 216 | } |
217 | 217 |
@@ -168,8 +168,7 @@ |
||
168 | 168 | ->addClass('notificationElementShowMore')); |
169 | 169 | |
170 | 170 | $box->addItem($notificationBox); |
171 | - } |
|
172 | - else{ |
|
171 | + } else{ |
|
173 | 172 | $notifIcon .= 'webapp-bell-o'; |
174 | 173 | } |
175 | 174 |
@@ -127,15 +127,12 @@ discard block |
||
127 | 127 | $text = $actions->getTitle(); |
128 | 128 | } |
129 | 129 | $html = '<li><a class="icon ' . $actions->getIcon() . '" href="' . $actions->url() . '">' . $text . '</a></li>'; |
130 | - } |
|
131 | - elseif($actions instanceof WidgetLink){ |
|
130 | + } elseif($actions instanceof WidgetLink){ |
|
132 | 131 | $html = '<li>' . $actions->display($canvas) . '</li>'; |
133 | - } |
|
134 | - elseif(is_array($actions)){ |
|
132 | + } elseif(is_array($actions)){ |
|
135 | 133 | if(isset($actions['items'])){ |
136 | 134 | $items = $actions['items']; |
137 | - } |
|
138 | - else{ |
|
135 | + } else{ |
|
139 | 136 | $items = $actions; |
140 | 137 | } |
141 | 138 | foreach ($items as $action){ |
@@ -199,8 +196,7 @@ discard block |
||
199 | 196 | 'label' => $method['label'] |
200 | 197 | ); |
201 | 198 | } |
202 | - } |
|
203 | - catch (\Exception $e){ |
|
199 | + } catch (\Exception $e){ |
|
204 | 200 | unset($types[$index]); |
205 | 201 | continue; |
206 | 202 | } |
@@ -281,8 +277,7 @@ discard block |
||
281 | 277 | if(! $record->isUpdatable()){ |
282 | 278 | throw new AppAccessException($App->translate('You do not have access to this page')); |
283 | 279 | } |
284 | - } |
|
285 | - else{ |
|
280 | + } else{ |
|
286 | 281 | if(! $recordSet->isCreatable()){ |
287 | 282 | throw new AppAccessException($App->translate('You do not have access to this page')); |
288 | 283 | } |
@@ -619,8 +614,7 @@ discard block |
||
619 | 614 | |
620 | 615 | if($this->getFilterVisibility($itemId)){ |
621 | 616 | $filterPanel->addClass('show-filter'); |
622 | - } |
|
623 | - else{ |
|
617 | + } else{ |
|
624 | 618 | $filterPanel->addClass('hide-filter'); |
625 | 619 | } |
626 | 620 | |
@@ -907,8 +901,7 @@ discard block |
||
907 | 901 | session_start(); |
908 | 902 | $_SESSION['modelViewMoreCriterias'][$key] = $fields; |
909 | 903 | session_write_close(); |
910 | - } |
|
911 | - else{ |
|
904 | + } else{ |
|
912 | 905 | $fields = $_SESSION['modelViewMoreCriterias'][$key]; |
913 | 906 | } |
914 | 907 | |
@@ -1217,8 +1210,7 @@ discard block |
||
1217 | 1210 | if(! $record->isUpdatable()){ |
1218 | 1211 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1219 | 1212 | } |
1220 | - } |
|
1221 | - else{ |
|
1213 | + } else{ |
|
1222 | 1214 | if(! $recordSet->isCreatable()){ |
1223 | 1215 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1224 | 1216 | } |
@@ -1260,8 +1252,7 @@ discard block |
||
1260 | 1252 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1261 | 1253 | } |
1262 | 1254 | $editor->setRecord($record); |
1263 | - } |
|
1264 | - else{ |
|
1255 | + } else{ |
|
1265 | 1256 | if(! $recordSet->isCreatable()){ |
1266 | 1257 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1267 | 1258 | } |
@@ -1381,8 +1372,7 @@ discard block |
||
1381 | 1372 | } |
1382 | 1373 | |
1383 | 1374 | $message = $this->getModifedMessage($record); |
1384 | - } |
|
1385 | - else{ |
|
1375 | + } else{ |
|
1386 | 1376 | |
1387 | 1377 | $record = $recordSet->newRecord(); |
1388 | 1378 | |
@@ -1822,8 +1812,7 @@ discard block |
||
1822 | 1812 | $W = bab_Widgets(); |
1823 | 1813 | $filter = $W->getUserConfiguration($tableview->getId() . '/filters/' . $name, 'widgets', false); |
1824 | 1814 | $filterValues = $filter['values']; |
1825 | - } |
|
1826 | - else{ |
|
1815 | + } else{ |
|
1827 | 1816 | $filterValues = null; |
1828 | 1817 | } |
1829 | 1818 | |
@@ -2056,8 +2045,7 @@ discard block |
||
2056 | 2045 | $Ui = $component->ui(); |
2057 | 2046 | $viewClassname = 'FullFrame'; |
2058 | 2047 | $isComponent = true; |
2059 | - } |
|
2060 | - else{ |
|
2048 | + } else{ |
|
2061 | 2049 | $Ui = $App->Ui(); |
2062 | 2050 | $recordClassname = $this->getRecordClassName(); |
2063 | 2051 | $viewClassname = $recordClassname . 'FullFrame'; |
@@ -2078,8 +2066,7 @@ discard block |
||
2078 | 2066 | $view = $record->getBlueprint(); |
2079 | 2067 | } |
2080 | 2068 | $fullFrame->setView($view); |
2081 | - } |
|
2082 | - else{ |
|
2069 | + } else{ |
|
2083 | 2070 | $fullFrame = $Ui->$viewClassname($record->id, $view); |
2084 | 2071 | } |
2085 | 2072 |
@@ -2141,7 +2141,7 @@ |
||
2141 | 2141 | } |
2142 | 2142 | |
2143 | 2143 | header("Content-type: application/json; charset=utf-8"); |
2144 | - echo $collection->output(); |
|
2145 | - die(); |
|
2144 | + echo $collection->output(); |
|
2145 | + die(); |
|
2146 | 2146 | } |
2147 | 2147 | } |
@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | protected function getRecordClassName() |
60 | 60 | { |
61 | 61 | $class = $this->getClass(); |
62 | - if(strpos($class, 'Controller') !== false){ |
|
62 | + if (strpos($class, 'Controller') !== false) { |
|
63 | 63 | $App = $this->App(); |
64 | 64 | $componentName = strtoupper(str_replace('Controller', '', $class)); |
65 | 65 | $component = $App->getComponentByName($componentName); |
66 | - if($component){ |
|
66 | + if ($component) { |
|
67 | 67 | list (, $recordClassname) = explode($App->classPrefix, $component->getRecordClassName()); |
68 | 68 | return $recordClassname; |
69 | 69 | } |
70 | 70 | } |
71 | - if(strpos($class, '_Ctrl')){ |
|
71 | + if (strpos($class, '_Ctrl')) { |
|
72 | 72 | list (, $recordClassname) = explode('_Ctrl', $class); |
73 | 73 | return $recordClassname; |
74 | 74 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | |
91 | 91 | $recordClassname = $this->getRecordClassName(); |
92 | - $recordSetClassname = $recordClassname . 'Set'; |
|
92 | + $recordSetClassname = $recordClassname.'Set'; |
|
93 | 93 | |
94 | 94 | $recordSet = $App->$recordSetClassname(); |
95 | 95 | return $recordSet; |
@@ -132,29 +132,29 @@ discard block |
||
132 | 132 | { |
133 | 133 | $canvas = bab_Widgets()->HtmlCanvas(); |
134 | 134 | $html = ''; |
135 | - if($actions instanceof WidgetAction){ |
|
135 | + if ($actions instanceof WidgetAction) { |
|
136 | 136 | $text = ''; |
137 | - if($showLabel){ |
|
137 | + if ($showLabel) { |
|
138 | 138 | $text = $actions->getTitle(); |
139 | 139 | } |
140 | - $html = '<li><a class="icon ' . $actions->getIcon() . '" href="' . $actions->url() . '">' . $text . '</a></li>'; |
|
140 | + $html = '<li><a class="icon '.$actions->getIcon().'" href="'.$actions->url().'">'.$text.'</a></li>'; |
|
141 | 141 | } |
142 | - elseif($actions instanceof WidgetLink){ |
|
143 | - $html = '<li>' . $actions->display($canvas) . '</li>'; |
|
142 | + elseif ($actions instanceof WidgetLink) { |
|
143 | + $html = '<li>'.$actions->display($canvas).'</li>'; |
|
144 | 144 | } |
145 | - elseif(is_array($actions)){ |
|
146 | - if(isset($actions['items'])){ |
|
145 | + elseif (is_array($actions)) { |
|
146 | + if (isset($actions['items'])) { |
|
147 | 147 | $items = $actions['items']; |
148 | 148 | } |
149 | - else{ |
|
149 | + else { |
|
150 | 150 | $items = $actions; |
151 | 151 | } |
152 | - foreach ($items as $action){ |
|
152 | + foreach ($items as $action) { |
|
153 | 153 | $html .= $this->createMenu($action, true, true); |
154 | 154 | } |
155 | - if(isset($actions['icon'])){ |
|
155 | + if (isset($actions['icon'])) { |
|
156 | 156 | |
157 | - $html = '<li class="dropdown">' . '<a href="#" class="' . $actions['icon'] . ' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' . ($actions['icon'] === 'actions-context-menu'/*\Func_Icons::ACTIONS_CONTEXT_MENU*/ ? '' : '<span class="caret"></span>') . '</a>' . '<ul class="dropdown-menu dropdown-menu-right ' . \Func_Icons::ICON_LEFT_SYMBOLIC . '">' . $html . '</ul>'; |
|
157 | + $html = '<li class="dropdown">'.'<a href="#" class="'.$actions['icon'].' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'.($actions['icon'] === 'actions-context-menu'/*\Func_Icons::ACTIONS_CONTEXT_MENU*/ ? '' : '<span class="caret"></span>').'</a>'.'<ul class="dropdown-menu dropdown-menu-right '.\Func_Icons::ICON_LEFT_SYMBOLIC.'">'.$html.'</ul>'; |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | 'label' => $App->translate('Statistics') |
201 | 201 | ); |
202 | 202 | |
203 | - foreach ($methods as $index => $method){ |
|
204 | - try{ |
|
205 | - $methodName = $recordClassname . $method['method']; |
|
206 | - if($Ui->$methodName()){ |
|
203 | + foreach ($methods as $index => $method) { |
|
204 | + try { |
|
205 | + $methodName = $recordClassname.$method['method']; |
|
206 | + if ($Ui->$methodName()) { |
|
207 | 207 | $types[$index] = array( |
208 | 208 | 'classname' => $methodName, |
209 | 209 | 'icon' => $method['icon'], |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | ); |
212 | 212 | } |
213 | 213 | } |
214 | - catch (\Exception $e){ |
|
214 | + catch (\Exception $e) { |
|
215 | 215 | unset($types[$index]); |
216 | 216 | continue; |
217 | 217 | } |
@@ -232,13 +232,13 @@ discard block |
||
232 | 232 | |
233 | 233 | $availableFields = array(); |
234 | 234 | |
235 | - foreach ($recordSet->getFields() as $name => $field){ |
|
235 | + foreach ($recordSet->getFields() as $name => $field) { |
|
236 | 236 | $fieldName = $field->getName(); |
237 | 237 | $fieldDescription = $field->getDescription(); |
238 | - if(substr($fieldName, 0, 1) !== '_'){ |
|
238 | + if (substr($fieldName, 0, 1) !== '_') { |
|
239 | 239 | $fieldDescription = $App->translate($fieldDescription); |
240 | 240 | } |
241 | - if(empty($fieldDescription)){ |
|
241 | + if (empty($fieldDescription)) { |
|
242 | 242 | $fieldDescription = $fieldName; |
243 | 243 | } |
244 | 244 | $availableFields[$name] = array( |
@@ -287,14 +287,14 @@ discard block |
||
287 | 287 | |
288 | 288 | $recordSet = $this->getEditRecordSet(); |
289 | 289 | |
290 | - if(isset($id)){ |
|
290 | + if (isset($id)) { |
|
291 | 291 | $record = $recordSet->request($id); |
292 | - if(! $record->isUpdatable()){ |
|
292 | + if (!$record->isUpdatable()) { |
|
293 | 293 | throw new AppAccessException($App->translate('You do not have access to this page')); |
294 | 294 | } |
295 | 295 | } |
296 | - else{ |
|
297 | - if(! $recordSet->isCreatable()){ |
|
296 | + else { |
|
297 | + if (!$recordSet->isCreatable()) { |
|
298 | 298 | throw new AppAccessException($App->translate('You do not have access to this page')); |
299 | 299 | } |
300 | 300 | $record = $recordSet->newRecord(); |
@@ -322,12 +322,12 @@ discard block |
||
322 | 322 | $W = bab_Widgets(); |
323 | 323 | |
324 | 324 | $recordClassname = $this->getRecordClassName(); |
325 | - $editorClassname = $recordClassname . 'SectionEditor'; |
|
325 | + $editorClassname = $recordClassname.'SectionEditor'; |
|
326 | 326 | |
327 | 327 | /* @var $editor AppRecordEditor */ |
328 | 328 | $editor = $Ui->$editorClassname($record); |
329 | - if(! isset($itemId)){ |
|
330 | - $itemId = $this->getClass() . '_' . __FUNCTION__; |
|
329 | + if (!isset($itemId)) { |
|
330 | + $itemId = $this->getClass().'_'.__FUNCTION__; |
|
331 | 331 | } |
332 | 332 | $editor->setId($itemId); |
333 | 333 | $editor->setController($this); |
@@ -356,8 +356,8 @@ discard block |
||
356 | 356 | */ |
357 | 357 | public function getModelViewDefaultId($itemId = null) |
358 | 358 | { |
359 | - if(! isset($itemId)){ |
|
360 | - $itemId = $this->getClass() . '_modelView'; |
|
359 | + if (!isset($itemId)) { |
|
360 | + $itemId = $this->getClass().'_modelView'; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | return $itemId; |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | |
386 | 386 | $itemId = $this->getModelViewDefaultId($itemId); |
387 | 387 | |
388 | - if(! isset($type)){ |
|
388 | + if (!isset($type)) { |
|
389 | 389 | $type = $this->getFilteredViewType($itemId); |
390 | 390 | } |
391 | 391 | |
@@ -393,24 +393,24 @@ discard block |
||
393 | 393 | |
394 | 394 | switch ($type) { |
395 | 395 | case 'cards': |
396 | - $tableviewClassname = $recordClassname . 'CardsView'; |
|
396 | + $tableviewClassname = $recordClassname.'CardsView'; |
|
397 | 397 | break; |
398 | 398 | |
399 | 399 | case 'map': |
400 | - $tableviewClassname = $recordClassname . 'MapView'; |
|
400 | + $tableviewClassname = $recordClassname.'MapView'; |
|
401 | 401 | break; |
402 | 402 | |
403 | 403 | case 'calendar': |
404 | - $tableviewClassname = $recordClassname . 'CalendarView'; |
|
404 | + $tableviewClassname = $recordClassname.'CalendarView'; |
|
405 | 405 | break; |
406 | 406 | |
407 | 407 | case 'statistics': |
408 | - $tableviewClassname = $recordClassname . 'StatisticsView'; |
|
408 | + $tableviewClassname = $recordClassname.'StatisticsView'; |
|
409 | 409 | break; |
410 | 410 | |
411 | 411 | case 'table': |
412 | 412 | default: |
413 | - $tableviewClassname = $recordClassname . 'TableView'; |
|
413 | + $tableviewClassname = $recordClassname.'TableView'; |
|
414 | 414 | break; |
415 | 415 | } |
416 | 416 | |
@@ -423,12 +423,12 @@ discard block |
||
423 | 423 | |
424 | 424 | $tableview->setRecordSet($recordSet); |
425 | 425 | $tableview->addDefaultColumns($recordSet); |
426 | - if(isset($filter)){ |
|
426 | + if (isset($filter)) { |
|
427 | 427 | $tableview->setFilterValues($filter); |
428 | 428 | } |
429 | 429 | $filter = $tableview->getFilterValues(); |
430 | 430 | |
431 | - if(isset($filter['showTotal']) && $filter['showTotal']){ |
|
431 | + if (isset($filter['showTotal']) && $filter['showTotal']) { |
|
432 | 432 | $tableview->displaySubTotalRow(true); |
433 | 433 | } |
434 | 434 | |
@@ -442,13 +442,13 @@ discard block |
||
442 | 442 | |
443 | 443 | $tableview->setDataSource($records); |
444 | 444 | |
445 | - if(isset($columns)){ |
|
445 | + if (isset($columns)) { |
|
446 | 446 | $availableColumns = $tableview->getVisibleColumns(); |
447 | 447 | |
448 | 448 | $remainingColumns = array(); |
449 | - foreach ($availableColumns as $availableColumn){ |
|
449 | + foreach ($availableColumns as $availableColumn) { |
|
450 | 450 | $colPath = $availableColumn->getFieldPath(); |
451 | - if(isset($columns[$colPath]) && $columns[$colPath] == '1'){ |
|
451 | + if (isset($columns[$colPath]) && $columns[$colPath] == '1') { |
|
452 | 452 | $remainingColumns[] = $availableColumn; |
453 | 453 | } |
454 | 454 | } |
@@ -468,11 +468,11 @@ discard block |
||
468 | 468 | $App = $this->App(); |
469 | 469 | $Ui = $App->Ui(); |
470 | 470 | $recordClassname = $this->getRecordClassName(); |
471 | - $editorClassname = $recordClassname . 'Editor'; |
|
471 | + $editorClassname = $recordClassname.'Editor'; |
|
472 | 472 | $editor = $Ui->$editorClassname(); |
473 | 473 | |
474 | - if(! isset($itemId)){ |
|
475 | - $itemId = $this->getClass() . '_' . __FUNCTION__; |
|
474 | + if (!isset($itemId)) { |
|
475 | + $itemId = $this->getClass().'_'.__FUNCTION__; |
|
476 | 476 | } |
477 | 477 | $editor->setId($itemId); |
478 | 478 | $editor->setHiddenValue('tg', $App->controllerTg); |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | |
516 | 516 | $viewTypes = $this->getAvailableModelViewTypes(); |
517 | 517 | |
518 | - if(count($viewTypes) > 1){ |
|
518 | + if (count($viewTypes) > 1) { |
|
519 | 519 | $viewsBox = $W->Items(); |
520 | 520 | $viewsBox->setSizePolicy('pull-right'); |
521 | 521 | // $viewsBox->addClass('btn-group', \Func_Icons::ICON_LEFT_16); |
@@ -523,9 +523,9 @@ discard block |
||
523 | 523 | |
524 | 524 | $filteredViewType = $this->getFilteredViewType($tableView->getId()); |
525 | 525 | |
526 | - foreach ($viewTypes as $viewTypeId => $viewType){ |
|
526 | + foreach ($viewTypes as $viewTypeId => $viewType) { |
|
527 | 527 | $viewsBox->addItem($W->Link('', $proxy->setFilteredViewType($tableView->getId(), $viewTypeId)) |
528 | - ->addClass('icon', $viewType['icon'] . ($filteredViewType === $viewTypeId ? ' active' : '')) |
|
528 | + ->addClass('icon', $viewType['icon'].($filteredViewType === $viewTypeId ? ' active' : '')) |
|
529 | 529 | -> |
530 | 530 | // ->setSizePolicy('btn btn-xs btn-default ' . ($filteredViewType === $viewTypeId ? 'active' : '')) |
531 | 531 | setTitle($viewType['label']) |
@@ -533,14 +533,14 @@ discard block |
||
533 | 533 | } |
534 | 534 | } |
535 | 535 | |
536 | - if(method_exists($proxy, 'exportSelect')){ |
|
536 | + if (method_exists($proxy, 'exportSelect')) { |
|
537 | 537 | $toolbar->addItem($W->Link($App->translate('Export'), $proxy->exportSelect($filter)) |
538 | 538 | ->addClass('icon', \Func_Icons::ACTIONS_DOCUMENT_DOWNLOAD) |
539 | 539 | ->setOpenMode(WidgetLink::OPEN_DIALOG) |
540 | 540 | ->setDialogClass('box gradient blue halfSizeDialog')); |
541 | 541 | } |
542 | 542 | |
543 | - if(method_exists($proxy, 'printList')){ |
|
543 | + if (method_exists($proxy, 'printList')) { |
|
544 | 544 | $toolbar->addItem($W->Link($App->translate('Print'), $proxy->printList($filter)) |
545 | 545 | ->addClass('icon', \Func_Icons::ACTIONS_DOCUMENT_PRINT) |
546 | 546 | ->setOpenMode(WidgetLink::OPEN_POPUP)); |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | $W = bab_Widgets(); |
559 | 559 | |
560 | 560 | $filterVisibility = $this->getFilterVisibility($itemId); |
561 | - $filterVisibility = ! $filterVisibility; |
|
562 | - $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility); |
|
561 | + $filterVisibility = !$filterVisibility; |
|
562 | + $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility); |
|
563 | 563 | |
564 | 564 | return true; |
565 | 565 | } |
@@ -571,10 +571,10 @@ discard block |
||
571 | 571 | protected function getFilterVisibility($itemId) |
572 | 572 | { |
573 | 573 | $W = bab_Widgets(); |
574 | - $filterVisibility = $W->getUserConfiguration($itemId . '/filterVisibility'); |
|
575 | - if(! isset($filterVisibility)){ |
|
574 | + $filterVisibility = $W->getUserConfiguration($itemId.'/filterVisibility'); |
|
575 | + if (!isset($filterVisibility)) { |
|
576 | 576 | $filterVisibility = false; |
577 | - $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility); |
|
577 | + $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility); |
|
578 | 578 | } |
579 | 579 | return $filterVisibility; |
580 | 580 | } |
@@ -589,8 +589,8 @@ discard block |
||
589 | 589 | protected function getFilteredViewType($itemId) |
590 | 590 | { |
591 | 591 | $W = bab_Widgets(); |
592 | - $type = $W->getUserConfiguration($itemId . '/viewType'); |
|
593 | - if(! isset($type)){ |
|
592 | + $type = $W->getUserConfiguration($itemId.'/viewType'); |
|
593 | + if (!isset($type)) { |
|
594 | 594 | $type = 'table'; |
595 | 595 | } |
596 | 596 | return $type; |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | public function setFilteredViewType($itemId, $type = null) |
608 | 608 | { |
609 | 609 | $W = bab_Widgets(); |
610 | - $W->setUserConfiguration($itemId . '/viewType', $type); |
|
610 | + $W->setUserConfiguration($itemId.'/viewType', $type); |
|
611 | 611 | |
612 | 612 | return true; |
613 | 613 | } |
@@ -628,17 +628,17 @@ discard block |
||
628 | 628 | |
629 | 629 | $filterPanel = $view->advancedFilterPanel($filter); |
630 | 630 | |
631 | - if($this->getFilterVisibility($itemId)){ |
|
631 | + if ($this->getFilterVisibility($itemId)) { |
|
632 | 632 | $filterPanel->addClass('show-filter'); |
633 | 633 | } |
634 | - else{ |
|
634 | + else { |
|
635 | 635 | $filterPanel->addClass('hide-filter'); |
636 | 636 | } |
637 | 637 | |
638 | 638 | $toolbar = $this->toolbar($view); |
639 | 639 | $listToolbar = $this->listToolbar($view); |
640 | 640 | |
641 | - if($view->isColumnSelectionAllowed()){ |
|
641 | + if ($view->isColumnSelectionAllowed()) { |
|
642 | 642 | $App = $this->App(); |
643 | 643 | $columnSelectionMenu = $W->Link($App->translate('Table configuration'), $this->proxy() |
644 | 644 | ->modelViewColumnSettings($type, $itemId)) |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | $page->setTitle($App->translate('Table configuration')); |
666 | 666 | $W = bab_Widgets(); |
667 | 667 | |
668 | - $currentFilter = $W->getUserConfiguration($itemId . '/filter', 'widgets', false); |
|
668 | + $currentFilter = $W->getUserConfiguration($itemId.'/filter', 'widgets', false); |
|
669 | 669 | |
670 | 670 | $view = $this->modelView(array(), $type, null, $itemId); |
671 | 671 | |
@@ -697,21 +697,21 @@ discard block |
||
697 | 697 | $tableModelViewId = $data['tableModelViewId']; |
698 | 698 | $sessionOnly = isset($data['inSession']) ? $data['inSession'] : false; |
699 | 699 | |
700 | - if(isset($data['pageLength'])){ |
|
701 | - $W->setUserConfiguration($tableModelViewId . '/pageLength', $data['pageLength'], 'widgets', $sessionOnly); |
|
700 | + if (isset($data['pageLength'])) { |
|
701 | + $W->setUserConfiguration($tableModelViewId.'/pageLength', $data['pageLength'], 'widgets', $sessionOnly); |
|
702 | 702 | } |
703 | - if(isset($data['displaySubTotalRow'])){ |
|
704 | - $W->setUserConfiguration($tableModelViewId . '/displaySubTotalRow', $data['displaySubTotalRow'], 'widgets', $sessionOnly); |
|
703 | + if (isset($data['displaySubTotalRow'])) { |
|
704 | + $W->setUserConfiguration($tableModelViewId.'/displaySubTotalRow', $data['displaySubTotalRow'], 'widgets', $sessionOnly); |
|
705 | 705 | } |
706 | - if(isset($data['columns'])){ |
|
707 | - $W->setUserConfiguration($tableModelViewId . '/columns', $data['columns'], 'widgets', $sessionOnly); |
|
706 | + if (isset($data['columns'])) { |
|
707 | + $W->setUserConfiguration($tableModelViewId.'/columns', $data['columns'], 'widgets', $sessionOnly); |
|
708 | 708 | } |
709 | - if(isset($data['currentFilter'])){ |
|
709 | + if (isset($data['currentFilter'])) { |
|
710 | 710 | $filter = json_decode($data['currentFilter'], true); |
711 | - $W->setUserConfiguration($tableModelViewId . '/filter', $filter, 'widgets', $sessionOnly); |
|
711 | + $W->setUserConfiguration($tableModelViewId.'/filter', $filter, 'widgets', $sessionOnly); |
|
712 | 712 | } |
713 | 713 | |
714 | - $this->addReloadSelector('.depends-' . $tableModelViewId); |
|
714 | + $this->addReloadSelector('.depends-'.$tableModelViewId); |
|
715 | 715 | return true; |
716 | 716 | } |
717 | 717 | |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | $tableModelViewId = $data['tableModelViewId']; |
724 | 724 | $sessionOnly = isset($data['inSession']) ? $data['inSession'] : false; |
725 | 725 | |
726 | - $W->deleteUserConfiguration($data['tableModelViewId'] . '/columns', 'widgets', $sessionOnly); |
|
726 | + $W->deleteUserConfiguration($data['tableModelViewId'].'/columns', 'widgets', $sessionOnly); |
|
727 | 727 | |
728 | 728 | $this->addReloadSelector("#{$tableModelViewId}"); |
729 | 729 | return true; |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | |
773 | 773 | $itemMenus = $this->getListItemMenus(); |
774 | 774 | |
775 | - foreach ($itemMenus as $itemMenuId => $itemMenu){ |
|
775 | + foreach ($itemMenus as $itemMenuId => $itemMenu) { |
|
776 | 776 | $page->addItemMenu($itemMenuId, $itemMenu['label'], $itemMenu['action']); |
777 | 777 | } |
778 | 778 | |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | $columns = $tableview->getVisibleColumns(); |
812 | 812 | $column = isset($columns[$col]) ? $columns[$col] : null; |
813 | 813 | |
814 | - if(! isset($column)){ |
|
814 | + if (!isset($column)) { |
|
815 | 815 | return true; |
816 | 816 | } |
817 | 817 | |
@@ -825,8 +825,8 @@ discard block |
||
825 | 825 | $col |
826 | 826 | ))); |
827 | 827 | |
828 | - $filter = $W->getUserConfiguration($key . '/filter', 'widgets', false); |
|
829 | - if(isset($filter[$col])){ |
|
828 | + $filter = $W->getUserConfiguration($key.'/filter', 'widgets', false); |
|
829 | + if (isset($filter[$col])) { |
|
830 | 830 | $widget->setValue($filter[$col]); |
831 | 831 | } |
832 | 832 | |
@@ -842,21 +842,21 @@ discard block |
||
842 | 842 | |
843 | 843 | $key = $data['key']; |
844 | 844 | |
845 | - $filter = $W->getUserConfiguration($key . '/filter', 'widgets', false); |
|
846 | - if(isset($data['moreCriteria']) && $data['moreCriteria']){ |
|
845 | + $filter = $W->getUserConfiguration($key.'/filter', 'widgets', false); |
|
846 | + if (isset($data['moreCriteria']) && $data['moreCriteria']) { |
|
847 | 847 | $filter = array(); |
848 | 848 | } |
849 | - foreach ($data['filter'] as $filterName => $filterValue){ |
|
849 | + foreach ($data['filter'] as $filterName => $filterValue) { |
|
850 | 850 | $filter[$filterName] = $filterValue; |
851 | 851 | } |
852 | - $W->setUserConfiguration($key . '/filter', $filter, 'widgets', false); |
|
852 | + $W->setUserConfiguration($key.'/filter', $filter, 'widgets', false); |
|
853 | 853 | |
854 | 854 | session_start(); |
855 | 855 | $_SESSION['modelViewMoreCriterias'][$key] = array(); |
856 | 856 | unset($_SESSION['modelViewMoreCriterias'][$key]); |
857 | 857 | session_write_close(); |
858 | 858 | |
859 | - $this->addReloadSelector('.depends-' . $key); |
|
859 | + $this->addReloadSelector('.depends-'.$key); |
|
860 | 860 | |
861 | 861 | return true; |
862 | 862 | } |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | $Ui = $App->Ui(); |
868 | 868 | |
869 | 869 | $page = $Ui->Page(); |
870 | - $page->addClass('depends-modelViewMoreCriterias-' . $key); |
|
870 | + $page->addClass('depends-modelViewMoreCriterias-'.$key); |
|
871 | 871 | |
872 | 872 | $page->setTitle($App->translate('Search')); |
873 | 873 | |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | $editor = $Ui->BasicEditor($itemId, $W->VBoxLayout()); |
888 | 888 | $editor->setReloadAction($this->proxy() |
889 | 889 | ->getDisplayListMoreCriteriaEditor($key, $editor->getId())); |
890 | - $editor->addClass('depends-modelViewMoreCriterias-' . $key); |
|
890 | + $editor->addClass('depends-modelViewMoreCriterias-'.$key); |
|
891 | 891 | $editor->addClass('widget-no-close'); |
892 | 892 | $editor->setIconFormat(); |
893 | 893 | $editor->isAjax = true; |
@@ -902,24 +902,24 @@ discard block |
||
902 | 902 | $columns = $tableview->getVisibleColumns(); |
903 | 903 | $filter = $tableview->getFilterValues(); |
904 | 904 | |
905 | - if(! isset($itemId)){ |
|
905 | + if (!isset($itemId)) { |
|
906 | 906 | $editor->setSaveAction($this->proxy() |
907 | 907 | ->saveDisplayListFilter(), $App->translate('Search')); |
908 | 908 | $editor->setCancelAction($this->proxy() |
909 | 909 | ->cancel()); |
910 | 910 | |
911 | 911 | $fields = array(); |
912 | - foreach ($filter as $fieldName => $value){ |
|
913 | - if(empty($value)){ |
|
912 | + foreach ($filter as $fieldName => $value) { |
|
913 | + if (empty($value)) { |
|
914 | 914 | continue; |
915 | 915 | } |
916 | - if(! isset($columns[$fieldName])){ |
|
916 | + if (!isset($columns[$fieldName])) { |
|
917 | 917 | continue; |
918 | 918 | } |
919 | 919 | |
920 | 920 | $column = $columns[$fieldName]; |
921 | 921 | |
922 | - if(! $column->isSearchable()){ |
|
922 | + if (!$column->isSearchable()) { |
|
923 | 923 | continue; |
924 | 924 | } |
925 | 925 | |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | $_SESSION['modelViewMoreCriterias'][$key] = $fields; |
930 | 930 | session_write_close(); |
931 | 931 | } |
932 | - else{ |
|
932 | + else { |
|
933 | 933 | $fields = $_SESSION['modelViewMoreCriterias'][$key]; |
934 | 934 | } |
935 | 935 | |
@@ -937,24 +937,24 @@ discard block |
||
937 | 937 | |
938 | 938 | $nbAlreadyAdded = 0; |
939 | 939 | |
940 | - foreach ($fields as $fieldName => $fieldValue){ |
|
941 | - if(! isset($columns[$fieldName])){ |
|
940 | + foreach ($fields as $fieldName => $fieldValue) { |
|
941 | + if (!isset($columns[$fieldName])) { |
|
942 | 942 | continue; |
943 | 943 | } |
944 | 944 | $column = $columns[$fieldName]; |
945 | 945 | |
946 | - if(! $column->isSearchable()){ |
|
946 | + if (!$column->isSearchable()) { |
|
947 | 947 | continue; |
948 | 948 | } |
949 | 949 | |
950 | 950 | $field = $column->getField(); |
951 | 951 | |
952 | - if($nbAlreadyAdded >= 2){ |
|
952 | + if ($nbAlreadyAdded >= 2) { |
|
953 | 953 | $nbAlreadyAdded = 0; |
954 | 954 | $alreadyFilteredBox = null; |
955 | 955 | } |
956 | 956 | |
957 | - if(! isset($alreadyFilteredBox)){ |
|
957 | + if (!isset($alreadyFilteredBox)) { |
|
958 | 958 | $editor->addItem($alreadyFilteredBox = $W->FlexItems() |
959 | 959 | ->setSizePolicy('customsection-field-box customsection-fieldsgroup-box')); |
960 | 960 | } |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | ->setJustifyContent(WidgetFlexLayout::FLEX_JUSTIFY_CONTENT_SPACE_BETWEEN) |
975 | 975 | ->setAlignItems(WidgetFlexLayout::FLEX_ALIGN_CONTENT_CENTER)) |
976 | 976 | ->addClass('app-customsection-groupedfield app-displaylist-morecriteria-groupedfield')); |
977 | - $nbAlreadyAdded ++; |
|
977 | + $nbAlreadyAdded++; |
|
978 | 978 | |
979 | 979 | $alreadyAddedFilters[$fieldName] = $fieldName; |
980 | 980 | } |
@@ -984,26 +984,26 @@ discard block |
||
984 | 984 | '' |
985 | 985 | ); |
986 | 986 | |
987 | - foreach ($columns as $fieldName => $column){ |
|
988 | - if(! $column->isSearchable()){ |
|
987 | + foreach ($columns as $fieldName => $column) { |
|
988 | + if (!$column->isSearchable()) { |
|
989 | 989 | continue; |
990 | 990 | } |
991 | 991 | |
992 | 992 | $field = $column->getField(); |
993 | 993 | |
994 | - if(isset($alreadyAddedFilters[$fieldName])){ |
|
994 | + if (isset($alreadyAddedFilters[$fieldName])) { |
|
995 | 995 | continue; |
996 | 996 | } |
997 | 997 | |
998 | 998 | $label = $tableview->getFilterLabelWidget($fieldName, $field); |
999 | 999 | $label = trim($label->getText()); |
1000 | - if(empty($label)){ |
|
1000 | + if (empty($label)) { |
|
1001 | 1001 | continue; |
1002 | 1002 | } |
1003 | 1003 | $options[$fieldName] = $label; |
1004 | 1004 | } |
1005 | 1005 | |
1006 | - if(count($options) > 1){ |
|
1006 | + if (count($options) > 1) { |
|
1007 | 1007 | $editor->addItem($W->Html('<hr/>')); |
1008 | 1008 | $editor->addItem($W->FlexItems($W->LabelledWidget($App->translate('Add a new criteria'), $W->Select2() |
1009 | 1009 | ->setOptions($options), 'newField') |
@@ -1020,12 +1020,12 @@ discard block |
||
1020 | 1020 | { |
1021 | 1021 | session_start(); |
1022 | 1022 | $fields = isset($data['filter']) ? $data['filter'] : array(); |
1023 | - if(isset($data['newField']) && ! empty($data['newField'])){ |
|
1023 | + if (isset($data['newField']) && !empty($data['newField'])) { |
|
1024 | 1024 | $newField = $data['newField']; |
1025 | 1025 | unset($data['key']); |
1026 | 1026 | unset($data['moreCriteria']); |
1027 | 1027 | $fields[$newField] = ''; |
1028 | - $this->addReloadSelector('.depends-modelViewMoreCriterias-' . $key); |
|
1028 | + $this->addReloadSelector('.depends-modelViewMoreCriterias-'.$key); |
|
1029 | 1029 | } |
1030 | 1030 | $_SESSION['modelViewMoreCriterias'][$key] = $fields; |
1031 | 1031 | return true; |
@@ -1034,12 +1034,12 @@ discard block |
||
1034 | 1034 | public function removeMoreCriteriaField($key, $field) |
1035 | 1035 | { |
1036 | 1036 | $fields = $_SESSION['modelViewMoreCriterias'][$key]; |
1037 | - if(isset($fields[$field])){ |
|
1037 | + if (isset($fields[$field])) { |
|
1038 | 1038 | unset($fields[$field]); |
1039 | 1039 | session_start(); |
1040 | 1040 | $_SESSION['modelViewMoreCriterias'][$key] = $fields; |
1041 | 1041 | } |
1042 | - $this->addReloadSelector('.depends-modelViewMoreCriterias-' . $key); |
|
1042 | + $this->addReloadSelector('.depends-modelViewMoreCriterias-'.$key); |
|
1043 | 1043 | return true; |
1044 | 1044 | } |
1045 | 1045 | |
@@ -1095,17 +1095,17 @@ discard block |
||
1095 | 1095 | |
1096 | 1096 | switch ($format) { |
1097 | 1097 | case 'xlsx': |
1098 | - $tableview->downloadXlsx($filename . '.xlsx'); |
|
1098 | + $tableview->downloadXlsx($filename.'.xlsx'); |
|
1099 | 1099 | break; |
1100 | 1100 | case 'xls': |
1101 | - $tableview->downloadExcel($filename . '.xls'); |
|
1101 | + $tableview->downloadExcel($filename.'.xls'); |
|
1102 | 1102 | break; |
1103 | 1103 | case 'ssv': |
1104 | - $tableview->downloadCsv($filename . '.csv', ';', $inline, 'Windows-1252'); |
|
1104 | + $tableview->downloadCsv($filename.'.csv', ';', $inline, 'Windows-1252'); |
|
1105 | 1105 | break; |
1106 | 1106 | case 'csv': |
1107 | 1107 | default: |
1108 | - $tableview->downloadCsv($filename . '.csv', ',', $inline, \bab_charset::getIso()); |
|
1108 | + $tableview->downloadCsv($filename.'.csv', ',', $inline, \bab_charset::getIso()); |
|
1109 | 1109 | break; |
1110 | 1110 | } |
1111 | 1111 | } |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | $recordSet = $this->getRecordSet(); |
1172 | 1172 | |
1173 | 1173 | $record = $recordSet->request($id); |
1174 | - if(! $record->isReadable()){ |
|
1174 | + if (!$record->isReadable()) { |
|
1175 | 1175 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1176 | 1176 | } |
1177 | 1177 | |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | |
1180 | 1180 | $recordClassname = $this->getRecordClassName(); |
1181 | 1181 | |
1182 | - $viewClassname = $recordClassname . 'FullFrame'; |
|
1182 | + $viewClassname = $recordClassname.'FullFrame'; |
|
1183 | 1183 | |
1184 | 1184 | $fullFrame = $Ui->$viewClassname($record); |
1185 | 1185 | $fullFrame->setView($view); |
@@ -1191,10 +1191,10 @@ discard block |
||
1191 | 1191 | $mainMenu->setSizePolicy(\Func_Icons::ICON_LEFT_24); |
1192 | 1192 | |
1193 | 1193 | $page = $Ui->Page(); |
1194 | - if(isset($itemId)){ |
|
1194 | + if (isset($itemId)) { |
|
1195 | 1195 | $page->setId($itemId); |
1196 | 1196 | } |
1197 | - $page->addClass('depends-' . $this->getRecordClassName()); |
|
1197 | + $page->addClass('depends-'.$this->getRecordClassName()); |
|
1198 | 1198 | |
1199 | 1199 | $page->addToolbar($mainMenu); |
1200 | 1200 | |
@@ -1233,14 +1233,14 @@ discard block |
||
1233 | 1233 | |
1234 | 1234 | $editor = $this->recordEditor(); |
1235 | 1235 | |
1236 | - if(isset($id)){ |
|
1236 | + if (isset($id)) { |
|
1237 | 1237 | $record = $recordSet->request($id); |
1238 | - if(! $record->isUpdatable()){ |
|
1238 | + if (!$record->isUpdatable()) { |
|
1239 | 1239 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1240 | 1240 | } |
1241 | 1241 | } |
1242 | - else{ |
|
1243 | - if(! $recordSet->isCreatable()){ |
|
1242 | + else { |
|
1243 | + if (!$recordSet->isCreatable()) { |
|
1244 | 1244 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1245 | 1245 | } |
1246 | 1246 | $record = $recordSet->newRecord(); |
@@ -1275,15 +1275,15 @@ discard block |
||
1275 | 1275 | |
1276 | 1276 | $editor = $Ui->TagsEditor(); |
1277 | 1277 | |
1278 | - if(isset($id)){ |
|
1278 | + if (isset($id)) { |
|
1279 | 1279 | $record = $recordSet->request($id); |
1280 | - if(! $record->isUpdatable()){ |
|
1280 | + if (!$record->isUpdatable()) { |
|
1281 | 1281 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1282 | 1282 | } |
1283 | 1283 | $editor->setRecord($record); |
1284 | 1284 | } |
1285 | - else{ |
|
1286 | - if(! $recordSet->isCreatable()){ |
|
1285 | + else { |
|
1286 | + if (!$recordSet->isCreatable()) { |
|
1287 | 1287 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1288 | 1288 | } |
1289 | 1289 | $record = $recordSet->newRecord(); |
@@ -1334,7 +1334,7 @@ discard block |
||
1334 | 1334 | |
1335 | 1335 | $recordTitle = $record->getRecordTitle(); |
1336 | 1336 | |
1337 | - $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"'); |
|
1337 | + $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"'); |
|
1338 | 1338 | return $message; |
1339 | 1339 | } |
1340 | 1340 | |
@@ -1393,45 +1393,45 @@ discard block |
||
1393 | 1393 | $pk = $recordSet->getPrimaryKey(); |
1394 | 1394 | $message = null; |
1395 | 1395 | |
1396 | - if(! empty($data[$pk])){ |
|
1396 | + if (!empty($data[$pk])) { |
|
1397 | 1397 | $record = $recordSet->request($data[$pk]); |
1398 | 1398 | unset($data[$pk]); |
1399 | 1399 | |
1400 | - if(! $record->isUpdatable()){ |
|
1400 | + if (!$record->isUpdatable()) { |
|
1401 | 1401 | throw new AppAccessException('Access denied'); |
1402 | 1402 | } |
1403 | 1403 | |
1404 | 1404 | $message = $this->getModifedMessage($record); |
1405 | 1405 | } |
1406 | - else{ |
|
1406 | + else { |
|
1407 | 1407 | |
1408 | 1408 | $record = $recordSet->newRecord(); |
1409 | 1409 | |
1410 | - if(! $recordSet->isCreatable()){ |
|
1410 | + if (!$recordSet->isCreatable()) { |
|
1411 | 1411 | throw new AppAccessException('Access denied'); |
1412 | 1412 | } |
1413 | 1413 | |
1414 | 1414 | $message = $this->getCreatedMessage(); |
1415 | 1415 | } |
1416 | 1416 | |
1417 | - if(! isset($record)){ |
|
1417 | + if (!isset($record)) { |
|
1418 | 1418 | throw new AppSaveException($App->translate('The record does not exists')); |
1419 | 1419 | } |
1420 | 1420 | |
1421 | - if(! isset($data)){ |
|
1421 | + if (!isset($data)) { |
|
1422 | 1422 | throw new AppSaveException($App->translate('Nothing to save')); |
1423 | 1423 | } |
1424 | 1424 | |
1425 | 1425 | $record->setFormInputValues($data); |
1426 | 1426 | |
1427 | 1427 | $this->preSave($record, $data); |
1428 | - if($record->save()){ |
|
1428 | + if ($record->save()) { |
|
1429 | 1429 | $this->postSave($record, $data); |
1430 | - if(is_string($message)){ |
|
1430 | + if (is_string($message)) { |
|
1431 | 1431 | $this->addToast($message); |
1432 | 1432 | } |
1433 | 1433 | |
1434 | - $this->addReloadSelector('.depends-' . $this->getRecordClassName()); |
|
1434 | + $this->addReloadSelector('.depends-'.$this->getRecordClassName()); |
|
1435 | 1435 | return true; |
1436 | 1436 | } |
1437 | 1437 | |
@@ -1454,16 +1454,16 @@ discard block |
||
1454 | 1454 | |
1455 | 1455 | $record = $recordSet->request($id); |
1456 | 1456 | |
1457 | - if(! $record->isDeletable()){ |
|
1457 | + if (!$record->isDeletable()) { |
|
1458 | 1458 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1459 | 1459 | } |
1460 | 1460 | $deletedMessage = $this->getDeletedMessage($record); |
1461 | 1461 | |
1462 | - if($record->delete()){ |
|
1462 | + if ($record->delete()) { |
|
1463 | 1463 | $this->addToast($deletedMessage); |
1464 | 1464 | } |
1465 | 1465 | |
1466 | - $this->addReloadSelector('.depends-' . $record->getClassName()); |
|
1466 | + $this->addReloadSelector('.depends-'.$record->getClassName()); |
|
1467 | 1467 | |
1468 | 1468 | return true; |
1469 | 1469 | } |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | $page->addClass('app-page-editor'); |
1488 | 1488 | $page->setTitle($App->translate('Deletion')); |
1489 | 1489 | |
1490 | - if(! isset($record)){ |
|
1490 | + if (!isset($record)) { |
|
1491 | 1491 | $page->addItem($W->Label($App->translate('This element does not exists.'))); |
1492 | 1492 | $page->addClass('alert', 'alert-warning'); |
1493 | 1493 | return $page; |
@@ -1500,7 +1500,7 @@ discard block |
||
1500 | 1500 | |
1501 | 1501 | $recordTitle = $record->getRecordTitle(); |
1502 | 1502 | |
1503 | - $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"'; |
|
1503 | + $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"'; |
|
1504 | 1504 | $form->addItem($W->Title($subTitle, 5)); |
1505 | 1505 | |
1506 | 1506 | $form->addItem($W->Title($App->translate('Confirm delete?'), 6)); |
@@ -1509,7 +1509,7 @@ discard block |
||
1509 | 1509 | |
1510 | 1510 | $confirmedAction = $this->proxy()->delete($id); |
1511 | 1511 | $parameters = $confirmedAction->getParameters(); |
1512 | - foreach ($parameters as $key => $value){ |
|
1512 | + foreach ($parameters as $key => $value) { |
|
1513 | 1513 | $form->setHiddenValue($key, $value); |
1514 | 1514 | } |
1515 | 1515 | $form->addButton($W->SubmitButton() |
@@ -1539,20 +1539,20 @@ discard block |
||
1539 | 1539 | |
1540 | 1540 | $record = $recordSet->request($id); |
1541 | 1541 | |
1542 | - if(! $record->isRemovable()){ |
|
1542 | + if (!$record->isRemovable()) { |
|
1543 | 1543 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1544 | 1544 | } |
1545 | 1545 | |
1546 | 1546 | $App = $this->App(); |
1547 | 1547 | $deletedMessage = $App->translate('The element has been moved to the trash'); |
1548 | 1548 | |
1549 | - if($recordSet->delete($recordSet->id->is($record->id), AppTraceableRecord::DELETED_STATUS_IN_TRASH)){ |
|
1550 | - if(is_string($deletedMessage)){ |
|
1549 | + if ($recordSet->delete($recordSet->id->is($record->id), AppTraceableRecord::DELETED_STATUS_IN_TRASH)) { |
|
1550 | + if (is_string($deletedMessage)) { |
|
1551 | 1551 | $this->addToast($deletedMessage); |
1552 | 1552 | } |
1553 | 1553 | } |
1554 | 1554 | |
1555 | - $this->addReloadSelector('.depends-' . $record->getClassName()); |
|
1555 | + $this->addReloadSelector('.depends-'.$record->getClassName()); |
|
1556 | 1556 | |
1557 | 1557 | return true; |
1558 | 1558 | } |
@@ -1580,7 +1580,7 @@ discard block |
||
1580 | 1580 | |
1581 | 1581 | $recordTitle = $record->getRecordTitle(); |
1582 | 1582 | |
1583 | - $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"'; |
|
1583 | + $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"'; |
|
1584 | 1584 | $form->addItem($W->Title($subTitle, 5)); |
1585 | 1585 | |
1586 | 1586 | $form->addItem($W->Title($App->translate('Confirm delete?'), 6)); |
@@ -1589,7 +1589,7 @@ discard block |
||
1589 | 1589 | |
1590 | 1590 | $confirmedAction = $this->proxy()->remove($id); |
1591 | 1591 | $parameters = $confirmedAction->getParameters(); |
1592 | - foreach ($parameters as $key => $value){ |
|
1592 | + foreach ($parameters as $key => $value) { |
|
1593 | 1593 | $form->setHiddenValue($key, $value); |
1594 | 1594 | } |
1595 | 1595 | $form->addButton($W->SubmitButton() |
@@ -1620,12 +1620,12 @@ discard block |
||
1620 | 1620 | $records = $recordSet->select($recordSet->id->is($id), true); |
1621 | 1621 | |
1622 | 1622 | $record = null; |
1623 | - foreach ($records as $record){ |
|
1623 | + foreach ($records as $record) { |
|
1624 | 1624 | } |
1625 | - if(! isset($record)){ |
|
1625 | + if (!isset($record)) { |
|
1626 | 1626 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1627 | 1627 | } |
1628 | - if(! $record->isRestorable()){ |
|
1628 | + if (!$record->isRestorable()) { |
|
1629 | 1629 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1630 | 1630 | } |
1631 | 1631 | |
@@ -1636,7 +1636,7 @@ discard block |
||
1636 | 1636 | $record->save(); |
1637 | 1637 | $this->addToast($deletedMessage); |
1638 | 1638 | |
1639 | - $this->addReloadSelector('.depends-' . $record->getClassName()); |
|
1639 | + $this->addReloadSelector('.depends-'.$record->getClassName()); |
|
1640 | 1640 | |
1641 | 1641 | return true; |
1642 | 1642 | } |
@@ -1656,9 +1656,9 @@ discard block |
||
1656 | 1656 | $records = $recordSet->select($recordSet->id->is($id), true); |
1657 | 1657 | |
1658 | 1658 | $record = null; |
1659 | - foreach ($records as $record){ |
|
1659 | + foreach ($records as $record) { |
|
1660 | 1660 | } |
1661 | - if(! isset($record)){ |
|
1661 | + if (!isset($record)) { |
|
1662 | 1662 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1663 | 1663 | } |
1664 | 1664 | |
@@ -1671,12 +1671,12 @@ discard block |
||
1671 | 1671 | |
1672 | 1672 | $recordTitle = $record->getRecordTitle(); |
1673 | 1673 | |
1674 | - $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"'; |
|
1674 | + $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"'; |
|
1675 | 1675 | $form->addItem($W->Title($subTitle, 5)); |
1676 | 1676 | |
1677 | 1677 | $confirmedAction = $this->proxy()->restore($id); |
1678 | 1678 | $parameters = $confirmedAction->getParameters(); |
1679 | - foreach ($parameters as $key => $value){ |
|
1679 | + foreach ($parameters as $key => $value) { |
|
1680 | 1680 | $form->setHiddenValue($key, $value); |
1681 | 1681 | } |
1682 | 1682 | $form->addButton($W->SubmitButton() |
@@ -1702,12 +1702,12 @@ discard block |
||
1702 | 1702 | $view = $this->modelView($filter, $type, null, $itemId); |
1703 | 1703 | $view->setAjaxAction(); |
1704 | 1704 | |
1705 | - if(isset($filter)){ |
|
1705 | + if (isset($filter)) { |
|
1706 | 1706 | $view->setFilterValues($filter); |
1707 | 1707 | } |
1708 | 1708 | $filter = $view->getFilterValues(); |
1709 | 1709 | |
1710 | - if(isset($filter['showTotal']) && $filter['showTotal']){ |
|
1710 | + if (isset($filter['showTotal']) && $filter['showTotal']) { |
|
1711 | 1711 | $view->displaySubTotalRow(true); |
1712 | 1712 | } |
1713 | 1713 | |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | $page->addItem($trashView); |
1754 | 1754 | |
1755 | 1755 | $itemMenus = $this->getListItemMenus(); |
1756 | - foreach ($itemMenus as $itemMenuId => $itemMenu){ |
|
1756 | + foreach ($itemMenus as $itemMenuId => $itemMenu) { |
|
1757 | 1757 | $page->addItemMenu($itemMenuId, $itemMenu['label'], $itemMenu['action']); |
1758 | 1758 | } |
1759 | 1759 | $page->setCurrentItemMenu('displayTrash'); |
@@ -1779,16 +1779,16 @@ discard block |
||
1779 | 1779 | $registry = bab_getRegistryInstance(); |
1780 | 1780 | |
1781 | 1781 | $userId = '0'; |
1782 | - $registry->changeDirectory('/widgets/user/' . $userId . '/' . $id . '/filters'); |
|
1782 | + $registry->changeDirectory('/widgets/user/'.$userId.'/'.$id.'/filters'); |
|
1783 | 1783 | |
1784 | - while ($filterName = $registry->fetchChildKey()){ |
|
1784 | + while ($filterName = $registry->fetchChildKey()) { |
|
1785 | 1785 | $filters[] = $filterName; |
1786 | 1786 | } |
1787 | 1787 | |
1788 | 1788 | $userId = bab_getUserId(); |
1789 | - $registry->changeDirectory('/widgets/user/' . $userId . '/' . $id . '/filters'); |
|
1789 | + $registry->changeDirectory('/widgets/user/'.$userId.'/'.$id.'/filters'); |
|
1790 | 1790 | |
1791 | - while ($filterName = $registry->fetchChildKey()){ |
|
1791 | + while ($filterName = $registry->fetchChildKey()) { |
|
1792 | 1792 | $filters[] = $filterName; |
1793 | 1793 | } |
1794 | 1794 | |
@@ -1805,15 +1805,15 @@ discard block |
||
1805 | 1805 | { |
1806 | 1806 | $W = bab_Widgets(); |
1807 | 1807 | $tableview = $this->modelView(null, 'table'); |
1808 | - $W->setUserConfiguration($tableview->getId() . '/currentFilterName', $filterName, 'widgets', false); |
|
1808 | + $W->setUserConfiguration($tableview->getId().'/currentFilterName', $filterName, 'widgets', false); |
|
1809 | 1809 | |
1810 | 1810 | $registry = bab_getRegistryInstance(); |
1811 | 1811 | $userId = '0'; |
1812 | - $registry->changeDirectory('/widgets/user/' . $userId . '/' . $tableview->getId() . '/filters'); |
|
1812 | + $registry->changeDirectory('/widgets/user/'.$userId.'/'.$tableview->getId().'/filters'); |
|
1813 | 1813 | $filterValues = $registry->getValue($filterName); |
1814 | 1814 | |
1815 | - if(! $filterValues){ |
|
1816 | - $filterValues = $W->getUserConfiguration($tableview->getId() . '/filters/' . $filterName, 'widgets', false); |
|
1815 | + if (!$filterValues) { |
|
1816 | + $filterValues = $W->getUserConfiguration($tableview->getId().'/filters/'.$filterName, 'widgets', false); |
|
1817 | 1817 | } |
1818 | 1818 | |
1819 | 1819 | $tableview = $this->modelView($filterValues, 'table'); |
@@ -1829,7 +1829,7 @@ discard block |
||
1829 | 1829 | { |
1830 | 1830 | $W = bab_Widgets(); |
1831 | 1831 | $id = $this->getModelViewDefaultId(); |
1832 | - $filter = $W->getUserConfiguration($id . '/currentFilterName', 'widgets', false); |
|
1832 | + $filter = $W->getUserConfiguration($id.'/currentFilterName', 'widgets', false); |
|
1833 | 1833 | |
1834 | 1834 | return $filter; |
1835 | 1835 | } |
@@ -1839,12 +1839,12 @@ discard block |
||
1839 | 1839 | */ |
1840 | 1840 | public function resetFilters($name = null) |
1841 | 1841 | { |
1842 | - if(isset($name)){ |
|
1842 | + if (isset($name)) { |
|
1843 | 1843 | $W = bab_Widgets(); |
1844 | - $filter = $W->getUserConfiguration($tableview->getId() . '/filters/' . $name, 'widgets', false); |
|
1844 | + $filter = $W->getUserConfiguration($tableview->getId().'/filters/'.$name, 'widgets', false); |
|
1845 | 1845 | $filterValues = $filter['values']; |
1846 | 1846 | } |
1847 | - else{ |
|
1847 | + else { |
|
1848 | 1848 | $filterValues = null; |
1849 | 1849 | } |
1850 | 1850 | |
@@ -1871,7 +1871,7 @@ discard block |
||
1871 | 1871 | 'values' => $filterValues |
1872 | 1872 | ); |
1873 | 1873 | |
1874 | - $W->setUserConfiguration($tableview->getId() . '/filters/' . $name, $data, 'widgets', false); |
|
1874 | + $W->setUserConfiguration($tableview->getId().'/filters/'.$name, $data, 'widgets', false); |
|
1875 | 1875 | |
1876 | 1876 | return true; |
1877 | 1877 | } |
@@ -1888,7 +1888,7 @@ discard block |
||
1888 | 1888 | $Ui = $App->Ui(); |
1889 | 1889 | |
1890 | 1890 | $currentFilterName = $this->getCurrentFilterName(); |
1891 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $currentFilterName, 'widgets', false); |
|
1891 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$currentFilterName, 'widgets', false); |
|
1892 | 1892 | |
1893 | 1893 | $page = $Ui->Page(); |
1894 | 1894 | |
@@ -1925,7 +1925,7 @@ discard block |
||
1925 | 1925 | $App = $this->App(); |
1926 | 1926 | $Ui = $App->Ui(); |
1927 | 1927 | |
1928 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false); |
|
1928 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false); |
|
1929 | 1929 | |
1930 | 1930 | $page = $Ui->Page(); |
1931 | 1931 | |
@@ -1963,8 +1963,8 @@ discard block |
||
1963 | 1963 | $page->addItem($filtersBox); |
1964 | 1964 | |
1965 | 1965 | $filterNames = $this->getFilterNames(); |
1966 | - foreach ($filterNames as $filterName){ |
|
1967 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $filterName, 'widgets', false); |
|
1966 | + foreach ($filterNames as $filterName) { |
|
1967 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$filterName, 'widgets', false); |
|
1968 | 1968 | |
1969 | 1969 | $filterBox = $W->HBoxItems() |
1970 | 1970 | ->setVerticalAlign('middle') |
@@ -2003,7 +2003,7 @@ discard block |
||
2003 | 2003 | $App = $this->App(); |
2004 | 2004 | $Ui = $App->Ui(); |
2005 | 2005 | |
2006 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false); |
|
2006 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false); |
|
2007 | 2007 | |
2008 | 2008 | $page = $Ui->Page(); |
2009 | 2009 | |
@@ -2034,7 +2034,7 @@ discard block |
||
2034 | 2034 | $this->requireDeleteMethod(); |
2035 | 2035 | |
2036 | 2036 | $W = bab_Widgets(); |
2037 | - $W->deleteUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false); |
|
2037 | + $W->deleteUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false); |
|
2038 | 2038 | |
2039 | 2039 | return true; |
2040 | 2040 | } |
@@ -2044,7 +2044,7 @@ discard block |
||
2044 | 2044 | $modelView = $this->modelView(); |
2045 | 2045 | $modelView->setHighlightedRows($ids); |
2046 | 2046 | |
2047 | - $this->addReloadSelector('.depends-' . $modelView->getId() . '-HighlightedRecords'); |
|
2047 | + $this->addReloadSelector('.depends-'.$modelView->getId().'-HighlightedRecords'); |
|
2048 | 2048 | |
2049 | 2049 | return true; |
2050 | 2050 | } |
@@ -2054,7 +2054,7 @@ discard block |
||
2054 | 2054 | $modelView = $this->modelView(); |
2055 | 2055 | $modelView->clearHighlightedRows(); |
2056 | 2056 | |
2057 | - $this->addReloadSelector('.depends-' . $modelView->getId() . '-HighlightedRecords'); |
|
2057 | + $this->addReloadSelector('.depends-'.$modelView->getId().'-HighlightedRecords'); |
|
2058 | 2058 | |
2059 | 2059 | return true; |
2060 | 2060 | } |
@@ -2073,34 +2073,34 @@ discard block |
||
2073 | 2073 | $box = $W->VBoxItems(); |
2074 | 2074 | |
2075 | 2075 | $isComponent = false; |
2076 | - if($component = $App->getCurrentComponent()){ |
|
2076 | + if ($component = $App->getCurrentComponent()) { |
|
2077 | 2077 | $Ui = $component->ui(); |
2078 | 2078 | $viewClassname = 'FullFrame'; |
2079 | 2079 | $isComponent = true; |
2080 | 2080 | } |
2081 | - else{ |
|
2081 | + else { |
|
2082 | 2082 | $Ui = $App->Ui(); |
2083 | 2083 | $recordClassname = $this->getRecordClassName(); |
2084 | - $viewClassname = $recordClassname . 'FullFrame'; |
|
2084 | + $viewClassname = $recordClassname.'FullFrame'; |
|
2085 | 2085 | } |
2086 | 2086 | |
2087 | - if($records->count() > 0){ |
|
2087 | + if ($records->count() > 0) { |
|
2088 | 2088 | $box->addItem($W->Link('', $this->proxy() |
2089 | 2089 | ->clearHighlightedRecords()) |
2090 | 2090 | ->setAjaxAction(null, false) |
2091 | 2091 | ->addClass('icon', \Func_Icons::ACTIONS_ARROW_RIGHT_DOUBLE, "app_closeHighlightButton") |
2092 | - ->setSizePolicy(\Func_Icons::ICON_LEFT_32 . ' pull-right')); |
|
2092 | + ->setSizePolicy(\Func_Icons::ICON_LEFT_32.' pull-right')); |
|
2093 | 2093 | |
2094 | - foreach ($records as $record){ |
|
2094 | + foreach ($records as $record) { |
|
2095 | 2095 | |
2096 | - if($isComponent){ |
|
2096 | + if ($isComponent) { |
|
2097 | 2097 | $fullFrame = $Ui->$viewClassname($record); |
2098 | - if(method_exists($record, "getBlueprint")){ |
|
2098 | + if (method_exists($record, "getBlueprint")) { |
|
2099 | 2099 | $view = $record->getBlueprint(); |
2100 | 2100 | } |
2101 | 2101 | $fullFrame->setView($view); |
2102 | 2102 | } |
2103 | - else{ |
|
2103 | + else { |
|
2104 | 2104 | $fullFrame = $Ui->$viewClassname($record->id, $view); |
2105 | 2105 | } |
2106 | 2106 | |
@@ -2109,19 +2109,19 @@ discard block |
||
2109 | 2109 | $box->addClass('box', 'shadow'); |
2110 | 2110 | } |
2111 | 2111 | |
2112 | - $box->addClass('depends-' . $modelView->getId() . '-HighlightedRecords'); |
|
2112 | + $box->addClass('depends-'.$modelView->getId().'-HighlightedRecords'); |
|
2113 | 2113 | $box->setReloadAction($this->proxy() |
2114 | 2114 | ->previewHighlightedRecords($view)); |
2115 | 2115 | return $box; |
2116 | 2116 | } |
2117 | 2117 | |
2118 | - public function search($q = null){ |
|
2118 | + public function search($q = null) { |
|
2119 | 2119 | session_write_close(); |
2120 | 2120 | $set = $this->getRecordSet(); |
2121 | 2121 | $collection = new WidgetSelect2OptionsCollection(); |
2122 | - if($q == null || strlen($q) <= 1){ |
|
2122 | + if ($q == null || strlen($q) <= 1) { |
|
2123 | 2123 | $collection->addOption( |
2124 | - new WidgetSelect2Option(0,$this->App()->translate("Keyword too small")) |
|
2124 | + new WidgetSelect2Option(0, $this->App()->translate("Keyword too small")) |
|
2125 | 2125 | ); |
2126 | 2126 | header("Content-type: application/json; charset=utf-8"); |
2127 | 2127 | echo $collection->output(); |
@@ -2134,7 +2134,7 @@ discard block |
||
2134 | 2134 | $set->$field->contains($q) |
2135 | 2135 | ) |
2136 | 2136 | ); |
2137 | - foreach($records as $r){ |
|
2137 | + foreach ($records as $r) { |
|
2138 | 2138 | $collection->addOption( |
2139 | 2139 | new WidgetSelect2Option($r->id, $r->$field) |
2140 | 2140 | ); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | public function __construct($action, $code = 0) |
29 | 29 | { |
30 | - $message = 'Unknown method "' . $action->getController() . '::' . $action->getMethod() . '"'; |
|
30 | + $message = 'Unknown method "'.$action->getController().'::'.$action->getMethod().'"'; |
|
31 | 31 | parent::__construct($message, $code); |
32 | 32 | } |
33 | 33 | } |
34 | 34 | \ No newline at end of file |
@@ -72,7 +72,7 @@ |
||
72 | 72 | public function getObjectTitle() |
73 | 73 | { |
74 | 74 | $element = app_translate('object'); |
75 | - if($description = $this->getRecordSet()->getDescription()){ |
|
75 | + if ($description = $this->getRecordSet()->getDescription()) { |
|
76 | 76 | $element = mb_strtolower(app_translate($description)); |
77 | 77 | } |
78 | 78 |