@@ -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); |
@@ -127,12 +127,10 @@ discard block |
||
| 127 | 127 | $users = array(); |
| 128 | 128 | if(!isset($for)){
|
| 129 | 129 | $users[] = $App->getCurrentUser(); |
| 130 | - } |
|
| 131 | - else if(!is_array($for)){
|
|
| 130 | + } else if(!is_array($for)){
|
|
| 132 | 131 | if($for === 'all'){
|
| 133 | 132 | $users = $App->getLoggedUsers(); |
| 134 | - } |
|
| 135 | - else{
|
|
| 133 | + } else{
|
|
| 136 | 134 | $users[] = $for; |
| 137 | 135 | } |
| 138 | 136 | } |
@@ -166,12 +164,10 @@ discard block |
||
| 166 | 164 | $users = array(); |
| 167 | 165 | if(!isset($for)){
|
| 168 | 166 | $users[] = $App->getCurrentUser(); |
| 169 | - } |
|
| 170 | - else if(!is_array($for)){
|
|
| 167 | + } else if(!is_array($for)){
|
|
| 171 | 168 | if($for === 'all'){
|
| 172 | 169 | $users = $App->getLoggedUsers(); |
| 173 | - } |
|
| 174 | - else{
|
|
| 170 | + } else{
|
|
| 175 | 171 | $users[] = $for; |
| 176 | 172 | } |
| 177 | 173 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @copyright Copyright (c) 2020 by CapWelton ({@link https://www.capwelton.com}) |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | -require_once dirname(__FILE__) . '/functions.php'; |
|
| 24 | +require_once dirname(__FILE__).'/functions.php'; |
|
| 25 | 25 | |
| 26 | 26 | $App = app_App(); |
| 27 | 27 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | |
| 26 | -require_once APP_CTRL_PATH . '/record.ctrl.php'; |
|
| 26 | +require_once APP_CTRL_PATH.'/record.ctrl.php'; |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | {
|
| 72 | 72 | $set = $this->getRecordSet(); |
| 73 | 73 | $record = $set->get($id); |
| 74 | - if(!$record){
|
|
| 74 | + if (!$record) {
|
|
| 75 | 75 | return true; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | if (isset($itemId)) {
|
| 122 | 122 | $box->setId($itemId); |
| 123 | 123 | } |
| 124 | - $notifs = $notifSet->selectUserNotifications(); |
|
| 124 | + $notifs = $notifSet->selectUserNotifications(); |
|
| 125 | 125 | $nbNotif = $notifs->count(); |
| 126 | 126 | $notifIcon = 'icon '; |
| 127 | 127 | $notifClass = 'label label-default'; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | ); |
| 137 | 137 | $btnWidget->addClass('notificationDisplayButton');
|
| 138 | 138 | $notifIcon .= 'webapp-bell-ringing-o'; |
| 139 | - $sizePolicy .=' hasNotification'; |
|
| 139 | + $sizePolicy .= ' hasNotification'; |
|
| 140 | 140 | |
| 141 | 141 | $notificationBox = $W->FlexItems( |
| 142 | 142 | $W->Html('')->addClass('notificationListArrow'),
|
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $notificationBoxElements = $W->FlexItems()->addClass('notificationBoxElements')->setDirection(Widget_FlexLayout::FLEX_DIRECTION_COL)
|
| 155 | 155 | ); |
| 156 | 156 | |
| 157 | - foreach ($notifs as $notif){
|
|
| 157 | + foreach ($notifs as $notif) {
|
|
| 158 | 158 | $notificationBoxElements->addItem( |
| 159 | 159 | $W->Link( |
| 160 | 160 | $el = $W->FlexItems( |
@@ -164,9 +164,9 @@ discard block |
||
| 164 | 164 | $this->proxy()->display($notif->id) |
| 165 | 165 | )->addClass('notificationBoxElement')->setOpenMode(Widget_Link::OPEN_DIALOG)
|
| 166 | 166 | ); |
| 167 | - if(!empty($notif->description)){
|
|
| 167 | + if (!empty($notif->description)) {
|
|
| 168 | 168 | $desc = $notif->description; |
| 169 | - if(strlen($desc) > 40){
|
|
| 169 | + if (strlen($desc) > 40) {
|
|
| 170 | 170 | $desc = trim(substr($desc, 0, 40)).'...'; |
| 171 | 171 | } |
| 172 | 172 | $el->addItem($W->Label($desc)->addClass('notificationElementDescription'), 1);
|
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | $box->addItem($notificationBox); |
| 181 | 181 | } |
| 182 | - else{
|
|
| 182 | + else {
|
|
| 183 | 183 | $notifIcon .= 'webapp-bell-o'; |
| 184 | 184 | } |
| 185 | 185 | |
@@ -218,8 +218,8 @@ discard block |
||
| 218 | 218 | $App = $this->App(); |
| 219 | 219 | |
| 220 | 220 | $notifSet = $App->NotificationSet(); |
| 221 | - $notifs = $notifSet->selectUserNotifications(); |
|
| 222 | - foreach ($notifs as $notif){
|
|
| 221 | + $notifs = $notifSet->selectUserNotifications(); |
|
| 222 | + foreach ($notifs as $notif) {
|
|
| 223 | 223 | $notif->markAsSeen(); |
| 224 | 224 | } |
| 225 | 225 | |
@@ -178,8 +178,7 @@ |
||
| 178 | 178 | ); |
| 179 | 179 | |
| 180 | 180 | $box->addItem($notificationBox); |
| 181 | - } |
|
| 182 | - else{
|
|
| 181 | + } else{
|
|
| 183 | 182 | $notifIcon .= 'webapp-bell-o'; |
| 184 | 183 | } |
| 185 | 184 | |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | * @copyright Copyright (c) 2018 by CANTICO ({@link http://www.cantico.fr}) |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | -require_once dirname(__FILE__) . '/define.php'; |
|
| 25 | -require_once dirname(__FILE__) . '/functions.php'; |
|
| 26 | -require_once dirname(__FILE__) . '/component.class.php'; |
|
| 24 | +require_once dirname(__FILE__).'/define.php'; |
|
| 25 | +require_once dirname(__FILE__).'/functions.php'; |
|
| 26 | +require_once dirname(__FILE__).'/component.class.php'; |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | $this->addonName = 'libapp'; |
| 61 | 61 | $this->addonPrefix = 'app'; |
| 62 | 62 | |
| 63 | - $this->classPrefix = $this->addonPrefix . '_'; |
|
| 64 | - $this->controllerTg = 'addon/' . $this->addonName . '/main'; |
|
| 63 | + $this->classPrefix = $this->addonPrefix.'_'; |
|
| 64 | + $this->controllerTg = 'addon/'.$this->addonName.'/main'; |
|
| 65 | 65 | |
| 66 | 66 | $addon = bab_getAddonInfosInstance($this->addonName); |
| 67 | 67 | $this->phpPath = $addon->getPhpPath(); |
| 68 | 68 | $this->recordSetPath = $this->phpPath; |
| 69 | 69 | $this->ctrlPath = $this->phpPath; |
| 70 | - $this->uiPath = $this->phpPath . 'ui/'; |
|
| 70 | + $this->uiPath = $this->phpPath.'ui/'; |
|
| 71 | 71 | |
| 72 | 72 | $babDB = bab_getDB(); |
| 73 | 73 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | if (class_exists($componentDefinitionObjectName)) { |
| 85 | 85 | $componentDefinition = new $componentDefinitionObjectName; |
| 86 | 86 | $components = $componentDefinition->getComponents($this); |
| 87 | - foreach ($components as $singleName => $singleComponent){ |
|
| 87 | + foreach ($components as $singleName => $singleComponent) { |
|
| 88 | 88 | $this->addComponent($singleName, $singleComponent); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $nbElem = count($componentName); |
| 114 | 114 | $componentName = $componentName[$nbElem - 1]; |
| 115 | 115 | $componentName = strtoupper($componentName); |
| 116 | - if(isset($this->components[$componentName])){ |
|
| 116 | + if (isset($this->components[$componentName])) { |
|
| 117 | 117 | return $this->components[$componentName]; |
| 118 | 118 | } |
| 119 | 119 | return null; |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | public function __get($componentName) |
| 144 | 144 | { |
| 145 | - if(isset($this->components[$componentName])){ |
|
| 145 | + if (isset($this->components[$componentName])) { |
|
| 146 | 146 | return $this->components[$componentName]; |
| 147 | - }else{ |
|
| 147 | + } else { |
|
| 148 | 148 | return null; |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -163,12 +163,12 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | $messages = array(); |
| 165 | 165 | |
| 166 | - foreach ($components as $componentName => $component){ |
|
| 166 | + foreach ($components as $componentName => $component) { |
|
| 167 | 167 | $dependencies = $component->checkDependencies(); |
| 168 | - foreach($dependencies['requiredComponents'] as $requiredComponent){ |
|
| 168 | + foreach ($dependencies['requiredComponents'] as $requiredComponent) { |
|
| 169 | 169 | $messages['requiredComponents'][$componentName][] = $requiredComponent; |
| 170 | 170 | } |
| 171 | - foreach($dependencies['optionalComponents'] as $optionalComponent){ |
|
| 171 | + foreach ($dependencies['optionalComponents'] as $optionalComponent) { |
|
| 172 | 172 | $messages['optionalComponents'][$componentName][] = $optionalComponent; |
| 173 | 173 | } |
| 174 | 174 | } |
@@ -180,9 +180,9 @@ discard block |
||
| 180 | 180 | { |
| 181 | 181 | $components = $this->getComponents(); |
| 182 | 182 | $componentDefinitions = array(); |
| 183 | - foreach ($components as $component){ |
|
| 183 | + foreach ($components as $component) { |
|
| 184 | 184 | $packageName = $component->getPackageName(); |
| 185 | - if(isset($componentDefinitions[$packageName]) && !empty($componentDefinitions[$packageName])){ |
|
| 185 | + if (isset($componentDefinitions[$packageName]) && !empty($componentDefinitions[$packageName])) { |
|
| 186 | 186 | continue; |
| 187 | 187 | } |
| 188 | 188 | $componentDefinitions[$packageName] = $component->getDefinition(); |
@@ -225,8 +225,8 @@ discard block |
||
| 225 | 225 | public function getRecordSetPathname($class) |
| 226 | 226 | { |
| 227 | 227 | // $App->MyRecordSet() -> myrecord.class.php |
| 228 | - $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php'; |
|
| 229 | - return $this->recordSetPath . $file; |
|
| 228 | + $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php'; |
|
| 229 | + return $this->recordSetPath.$file; |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | public function getRecordPathname($class) |
| 239 | 239 | { |
| 240 | 240 | // $App->MyRecord() -> myrecord.class.php |
| 241 | - $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php'; |
|
| 242 | - return $this->recordSetPath . $file; |
|
| 241 | + $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php'; |
|
| 242 | + return $this->recordSetPath.$file; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') { |
| 342 | 342 | $incl = $method; |
| 343 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
| 343 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
| 344 | 344 | |
| 345 | 345 | |
| 346 | 346 | $classname = $this->$classNameMethod(); |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | // We need to revert to multilang fields before synchronizing. |
| 363 | 363 | $set->useLang(false); |
| 364 | 364 | } |
| 365 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
| 365 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | } |
@@ -389,9 +389,9 @@ discard block |
||
| 389 | 389 | '; |
| 390 | 390 | |
| 391 | 391 | $noPackageNames = array(); |
| 392 | - foreach ($this->components as $component){ |
|
| 392 | + foreach ($this->components as $component) { |
|
| 393 | 393 | /* @var $component app_Component */ |
| 394 | - try{ |
|
| 394 | + try { |
|
| 395 | 395 | /* @var $set ORM_RecordSet */ |
| 396 | 396 | $set = $component->recordSet(); |
| 397 | 397 | //Check if the component is not overriden by the addon |
@@ -399,26 +399,26 @@ discard block |
||
| 399 | 399 | //In case the set has been overriden, we simply do nothing here, as it will be instanciated by the synchronizeSql method |
| 400 | 400 | $cmprc = new ReflectionClass($set); |
| 401 | 401 | $componentSetClass = $cmprc->getShortName(); |
| 402 | - if(method_exists($this, $componentSetClass)){ |
|
| 402 | + if (method_exists($this, $componentSetClass)) { |
|
| 403 | 403 | continue; |
| 404 | 404 | } |
| 405 | - if(method_exists($set, 'useLang')){ |
|
| 405 | + if (method_exists($set, 'useLang')) { |
|
| 406 | 406 | // This is necessary if the recordSet constructor uses a setLang(). |
| 407 | 407 | // We need to revert to multilang fields before synchronizing. |
| 408 | 408 | $set->useLang(false); |
| 409 | 409 | } |
| 410 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
| 410 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
| 411 | 411 | |
| 412 | - if(empty($component->getPackageName())){ |
|
| 412 | + if (empty($component->getPackageName())) { |
|
| 413 | 413 | $noPackageNames[] = $component->getName(); |
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | - catch (Exception $e){ |
|
| 416 | + catch (Exception $e) { |
|
| 417 | 417 | |
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - if(!empty($noPackageNames)){ |
|
| 421 | + if (!empty($noPackageNames)) { |
|
| 422 | 422 | $errorMessage = implode(', ', $noPackageNames); |
| 423 | 423 | bab_installWindow::message( |
| 424 | 424 | sprintf( |
@@ -442,18 +442,18 @@ discard block |
||
| 442 | 442 | $synchronize->fromSqlString($sql); |
| 443 | 443 | |
| 444 | 444 | $dependencies = $this->checkComponentsDependencies(); |
| 445 | - foreach ($dependencies['requiredComponents'] as $componentName => $requiredComponents){ |
|
| 446 | - foreach ($requiredComponents as $requiredComponent){ |
|
| 445 | + foreach ($dependencies['requiredComponents'] as $componentName => $requiredComponents) { |
|
| 446 | + foreach ($requiredComponents as $requiredComponent) { |
|
| 447 | 447 | $hasComponent = $this->getComponentByName($requiredComponent); |
| 448 | - if(!$hasComponent){ |
|
| 448 | + if (!$hasComponent) { |
|
| 449 | 449 | bab_installWindow::message(sprintf($this->translate('The component %s is required for the component %s to work. You will encounter fatal errors'), $requiredComponent, $componentName)); |
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | - foreach ($dependencies['optionalComponents'] as $componentName => $optionalComponents){ |
|
| 454 | - foreach ($optionalComponents as $optionalComponent){ |
|
| 453 | + foreach ($dependencies['optionalComponents'] as $componentName => $optionalComponents) { |
|
| 454 | + foreach ($optionalComponents as $optionalComponent) { |
|
| 455 | 455 | $hasComponent = $this->getComponentByName($optionalComponent); |
| 456 | - if(!$hasComponent){ |
|
| 456 | + if (!$hasComponent) { |
|
| 457 | 457 | bab_installWindow::message(sprintf($this->translate('The optional component %s has not been added. The component %s may have reduced functionalities'), $optionalComponent, $componentName)); |
| 458 | 458 | } |
| 459 | 459 | } |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | { |
| 467 | 467 | $components = $this->getComponents(); |
| 468 | 468 | |
| 469 | - foreach ($components as $component){ |
|
| 469 | + foreach ($components as $component) { |
|
| 470 | 470 | $component->onUpdate(); |
| 471 | 471 | } |
| 472 | 472 | |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | |
| 488 | 488 | if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') { |
| 489 | 489 | $incl = $method; |
| 490 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
| 490 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
| 491 | 491 | |
| 492 | 492 | $classname = $this->$classNameMethod(); |
| 493 | 493 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | if (class_exists($classname) && method_exists($this, $call)) { |
| 503 | 503 | $set = $this->$call(); |
| 504 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
| 504 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 | } |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | |
| 516 | 516 | public function includeBase() |
| 517 | 517 | { |
| 518 | - require_once APP_PHP_PATH . 'base.class.php'; |
|
| 518 | + require_once APP_PHP_PATH.'base.class.php'; |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | /** |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | */ |
| 524 | 524 | public function includeRecordSet() |
| 525 | 525 | { |
| 526 | - require_once APP_SET_PATH . 'record.class.php'; |
|
| 526 | + require_once APP_SET_PATH.'record.class.php'; |
|
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | */ |
| 533 | 533 | public function includeTraceableRecordSet() |
| 534 | 534 | { |
| 535 | - require_once APP_SET_PATH . 'traceablerecord.class.php'; |
|
| 535 | + require_once APP_SET_PATH.'traceablerecord.class.php'; |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | { |
| 545 | 545 | static $accessManager = null; |
| 546 | 546 | if (!isset($accessManager)) { |
| 547 | - require_once APP_SET_PATH . 'accessmanager.class.php'; |
|
| 547 | + require_once APP_SET_PATH.'accessmanager.class.php'; |
|
| 548 | 548 | $accessManager = new app_AccessManager($this); |
| 549 | 549 | } |
| 550 | 550 | |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | */ |
| 563 | 563 | public function includeLogSet() |
| 564 | 564 | { |
| 565 | - require_once APP_SET_PATH . 'log.class.php'; |
|
| 565 | + require_once APP_SET_PATH.'log.class.php'; |
|
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | /** |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | */ |
| 579 | 579 | public function LogSetClassName() |
| 580 | 580 | { |
| 581 | - return $this->LogClassName() . 'Set'; |
|
| 581 | + return $this->LogClassName().'Set'; |
|
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | /** |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | */ |
| 601 | 601 | public function includeLinkSet() |
| 602 | 602 | { |
| 603 | - require_once APP_SET_PATH . 'link.class.php'; |
|
| 603 | + require_once APP_SET_PATH.'link.class.php'; |
|
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | /** |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | */ |
| 617 | 617 | public function LinkSetClassName() |
| 618 | 618 | { |
| 619 | - return $this->LinkClassName() . 'Set'; |
|
| 619 | + return $this->LinkClassName().'Set'; |
|
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | /** |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | */ |
| 638 | 638 | public function includeNotificationSet() |
| 639 | 639 | { |
| 640 | - require_once APP_SET_PATH . 'notification.class.php'; |
|
| 640 | + require_once APP_SET_PATH.'notification.class.php'; |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | /** |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | */ |
| 654 | 654 | public function NotificationSetClassName() |
| 655 | 655 | { |
| 656 | - return $this->NotificationClassName() . 'Set'; |
|
| 656 | + return $this->NotificationClassName().'Set'; |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | /** |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | */ |
| 675 | 675 | public function includeSSESet() |
| 676 | 676 | { |
| 677 | - require_once APP_SET_PATH . 'sse.class.php'; |
|
| 677 | + require_once APP_SET_PATH.'sse.class.php'; |
|
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | /** |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | */ |
| 691 | 691 | public function SSESetClassName() |
| 692 | 692 | { |
| 693 | - return $this->SSEClassName() . 'Set'; |
|
| 693 | + return $this->SSEClassName().'Set'; |
|
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | /** |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | public function getRecordSetByRef($recordClassname) |
| 715 | 715 | { |
| 716 | 716 | $recordClassname = str_replace($this->classPrefix, '', $recordClassname); |
| 717 | - $classSet = $recordClassname . 'Set'; |
|
| 717 | + $classSet = $recordClassname.'Set'; |
|
| 718 | 718 | $set = $this->$classSet(); |
| 719 | 719 | return $set; |
| 720 | 720 | } |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | list($recordClassname, $id) = $refParts; |
| 736 | 736 | $set = $this->getRecordSetByRef($recordClassname); |
| 737 | 737 | if (isset($set)) { |
| 738 | - if($noDefaultCriteria){ |
|
| 738 | + if ($noDefaultCriteria) { |
|
| 739 | 739 | $set->setDefaultCriteria(null); |
| 740 | 740 | } |
| 741 | 741 | return $set->get($id); |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | { |
| 755 | 755 | $fullClassName = get_class($record); |
| 756 | 756 | list(, $className) = explode('_', $fullClassName); |
| 757 | - return $className . ':' . $record->id; |
|
| 757 | + return $className.':'.$record->id; |
|
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 | |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | |
| 809 | 809 | //Then, check if current component has a translation |
| 810 | 810 | if ($translation === $str) { |
| 811 | - if($currentComponent = $this->getCurrentComponent()){ |
|
| 811 | + if ($currentComponent = $this->getCurrentComponent()) { |
|
| 812 | 812 | $translator->setAddonName($currentComponent->getPackageName()); |
| 813 | 813 | $translator->setLangPath($currentComponent->getLangPath()); |
| 814 | 814 | $translation = $translator->translate($str, $str_plurals, $number); |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | } |
| 818 | 818 | //Then, check if libapp has a translation |
| 819 | 819 | if ($translation === $str) { |
| 820 | - $translator->setLangPath(null);//Reset lang path |
|
| 820 | + $translator->setLangPath(null); //Reset lang path |
|
| 821 | 821 | $translator->setAddonName('libapp'); |
| 822 | 822 | $translation = $translator->translate($str, $str_plurals, $number); |
| 823 | 823 | } |
@@ -865,16 +865,16 @@ discard block |
||
| 865 | 865 | */ |
| 866 | 866 | public function mailTo($addr, $subject = null, $body = null) |
| 867 | 867 | { |
| 868 | - $mailTo = 'mailto:' . $addr; |
|
| 868 | + $mailTo = 'mailto:'.$addr; |
|
| 869 | 869 | $parameters = array(); |
| 870 | 870 | if (isset($subject)) { |
| 871 | - $parameters[] = 'subject=' . $subject; |
|
| 871 | + $parameters[] = 'subject='.$subject; |
|
| 872 | 872 | } |
| 873 | 873 | if (isset($body)) { |
| 874 | - $parameters[] = 'body=' . $body; |
|
| 874 | + $parameters[] = 'body='.$body; |
|
| 875 | 875 | } |
| 876 | 876 | if (!empty($parameters)) { |
| 877 | - $mailTo .= '?' . implode('&', $parameters); |
|
| 877 | + $mailTo .= '?'.implode('&', $parameters); |
|
| 878 | 878 | } |
| 879 | 879 | |
| 880 | 880 | return $mailTo; |
@@ -925,7 +925,7 @@ discard block |
||
| 925 | 925 | } |
| 926 | 926 | |
| 927 | 927 | $number = number_format($number, $decimals, ',', ' '); |
| 928 | - return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol); |
|
| 928 | + return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol); |
|
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | if (!isset($format)) { |
| 948 | - $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
| 948 | + $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
| 949 | 949 | } |
| 950 | 950 | $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil(); |
| 951 | 951 | |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | */ |
| 967 | 967 | public function includeController() |
| 968 | 968 | { |
| 969 | - require_once APP_PHP_PATH . '/controller.class.php'; |
|
| 969 | + require_once APP_PHP_PATH.'/controller.class.php'; |
|
| 970 | 970 | } |
| 971 | 971 | |
| 972 | 972 | |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | */ |
| 976 | 976 | public function includeRecordController() |
| 977 | 977 | { |
| 978 | - require_once APP_CTRL_PATH . '/record.ctrl.php'; |
|
| 978 | + require_once APP_CTRL_PATH.'/record.ctrl.php'; |
|
| 979 | 979 | } |
| 980 | 980 | |
| 981 | 981 | |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | */ |
| 1016 | 1016 | public function includeUi() |
| 1017 | 1017 | { |
| 1018 | - require_once APP_UI_PATH . 'ui.class.php'; |
|
| 1018 | + require_once APP_UI_PATH.'ui.class.php'; |
|
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | public function Ui() |
| 1028 | 1028 | { |
| 1029 | 1029 | $this->includeUi(); |
| 1030 | - return bab_getInstance($this->classPrefix . 'Ui')->setApp($this); |
|
| 1030 | + return bab_getInstance($this->classPrefix.'Ui')->setApp($this); |
|
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | 1033 | /** |
@@ -1055,34 +1055,34 @@ discard block |
||
| 1055 | 1055 | |
| 1056 | 1056 | case substr($name, -strlen('SetClassName')) === 'SetClassName': |
| 1057 | 1057 | $className = substr($name, 0, strlen($name) - strlen('SetClassName')); |
| 1058 | - if($component = $this->getComponentByName($className)){ |
|
| 1058 | + if ($component = $this->getComponentByName($className)) { |
|
| 1059 | 1059 | return $component->getSetClassName(); |
| 1060 | 1060 | } |
| 1061 | 1061 | $setName = $className.'Set'; |
| 1062 | - return $this->classPrefix . $setName; |
|
| 1062 | + return $this->classPrefix.$setName; |
|
| 1063 | 1063 | |
| 1064 | 1064 | case substr($name, -strlen('ClassName')) === 'ClassName': |
| 1065 | 1065 | $recordName = substr($name, 0, strlen($name) - strlen('ClassName')); |
| 1066 | - if($component = $this->getComponentByName($recordName)){ |
|
| 1066 | + if ($component = $this->getComponentByName($recordName)) { |
|
| 1067 | 1067 | return $component->getRecordClassName(); |
| 1068 | 1068 | } |
| 1069 | - return $this->classPrefix . $recordName; |
|
| 1069 | + return $this->classPrefix.$recordName; |
|
| 1070 | 1070 | |
| 1071 | 1071 | case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set': |
| 1072 | 1072 | $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include'))); |
| 1073 | - if($this->getComponentByName($fileNameBase)){ |
|
| 1073 | + if ($this->getComponentByName($fileNameBase)) { |
|
| 1074 | 1074 | return; |
| 1075 | 1075 | } |
| 1076 | - require_once APP_SET_PATH . $fileNameBase . '.class.php'; |
|
| 1076 | + require_once APP_SET_PATH.$fileNameBase.'.class.php'; |
|
| 1077 | 1077 | return; |
| 1078 | 1078 | |
| 1079 | 1079 | case substr($name, -strlen('Set')) === 'Set': |
| 1080 | - if($component = $this->getComponentByName(substr($name, 0, strlen($name) -strlen('Set')))){ |
|
| 1080 | + if ($component = $this->getComponentByName(substr($name, 0, strlen($name) - strlen('Set')))) { |
|
| 1081 | 1081 | return $component->recordSet(); |
| 1082 | 1082 | } |
| 1083 | - $includeMethod = 'include' . $name; |
|
| 1083 | + $includeMethod = 'include'.$name; |
|
| 1084 | 1084 | $this->$includeMethod(); |
| 1085 | - $setClassNameMethod = $name . 'ClassName'; |
|
| 1085 | + $setClassNameMethod = $name.'ClassName'; |
|
| 1086 | 1086 | $className = $this->$setClassNameMethod(); |
| 1087 | 1087 | $set = new $className($this); |
| 1088 | 1088 | return $set; |
@@ -1090,8 +1090,8 @@ discard block |
||
| 1090 | 1090 | case ($component = $this->getComponentByName($name)) != false: |
| 1091 | 1091 | return $component; |
| 1092 | 1092 | default: |
| 1093 | - $setName = $name . 'Set'; |
|
| 1094 | - $recordClassNameMethod = $name . 'ClassName'; |
|
| 1093 | + $setName = $name.'Set'; |
|
| 1094 | + $recordClassNameMethod = $name.'ClassName'; |
|
| 1095 | 1095 | $recordClassName = $this->$recordClassNameMethod(); |
| 1096 | 1096 | if (isset($arguments[0])) { |
| 1097 | 1097 | if ($arguments[0] instanceof $recordClassName) { |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | { |
| 145 | 145 | if(isset($this->components[$componentName])){ |
| 146 | 146 | return $this->components[$componentName]; |
| 147 | - }else{ |
|
| 147 | + } else{ |
|
| 148 | 148 | return null; |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -412,8 +412,7 @@ discard block |
||
| 412 | 412 | if(empty($component->getPackageName())){ |
| 413 | 413 | $noPackageNames[] = $component->getName(); |
| 414 | 414 | } |
| 415 | - } |
|
| 416 | - catch (Exception $e){ |
|
| 415 | + } catch (Exception $e){ |
|
| 417 | 416 | |
| 418 | 417 | } |
| 419 | 418 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | public function __construct(Func_App $app, $id = null, Widget_Layout $layout = null) |
| 120 | 120 | { |
| 121 | 121 | parent::__construct($app); |
| 122 | - // We simulate inheritance from Widget_VBoxLayout. |
|
| 122 | + // We simulate inheritance from Widget_VBoxLayout. |
|
| 123 | 123 | $W = $this->widgets = bab_Widgets(); |
| 124 | 124 | |
| 125 | 125 | $this->buttonsLayout = $this->buttonsLayout(); |
@@ -1453,21 +1453,21 @@ discard block |
||
| 1453 | 1453 | |
| 1454 | 1454 | |
| 1455 | 1455 | |
| 1456 | - protected function addCustomFields(app_RecordSet $recordSet) |
|
| 1457 | - { |
|
| 1458 | - $customFields = $recordSet->getCustomFields(); |
|
| 1456 | + protected function addCustomFields(app_RecordSet $recordSet) |
|
| 1457 | + { |
|
| 1458 | + $customFields = $recordSet->getCustomFields(); |
|
| 1459 | 1459 | |
| 1460 | 1460 | foreach ($customFields as $customField) { |
| 1461 | 1461 | $fieldname = $customField->fieldname; |
| 1462 | 1462 | $this->addColumn( |
| 1463 | 1463 | widget_TableModelViewColumn($recordSet->$fieldname, $customField->name) |
| 1464 | - ->setSortable(true) |
|
| 1465 | - ->setExportable(true) |
|
| 1466 | - ->setSearchable($customField->searchable) |
|
| 1467 | - ->setVisible($customField->visible) |
|
| 1464 | + ->setSortable(true) |
|
| 1465 | + ->setExportable(true) |
|
| 1466 | + ->setSearchable($customField->searchable) |
|
| 1467 | + ->setVisible($customField->visible) |
|
| 1468 | 1468 | ); |
| 1469 | 1469 | } |
| 1470 | - } |
|
| 1470 | + } |
|
| 1471 | 1471 | |
| 1472 | 1472 | |
| 1473 | 1473 | /** |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | bab_Widgets()->includePhpClass('widget_InputWidget'); |
| 27 | 27 | bab_Widgets()->includePhpClass('widget_TableModelView'); |
| 28 | 28 | |
| 29 | -require_once dirname(__FILE__) . '/ui.helpers.php'; |
|
| 29 | +require_once dirname(__FILE__).'/ui.helpers.php'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @return Widget_Form |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | */ |
| 530 | 530 | protected function getRecordSet() |
| 531 | 531 | { |
| 532 | - if(!isset($this->recordSet)){ |
|
| 532 | + if (!isset($this->recordSet)) { |
|
| 533 | 533 | $this->recordSet = parent::getRecordSet(); |
| 534 | 534 | } |
| 535 | 535 | return $this->recordSet; |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | |
| 666 | 666 | public function addSections($view) |
| 667 | 667 | { |
| 668 | - echo '<!-- VIEW (' . $view . ') -->'; |
|
| 668 | + echo '<!-- VIEW ('.$view.') -->'; |
|
| 669 | 669 | $App = $this->App(); |
| 670 | 670 | $W = bab_Widgets(); |
| 671 | 671 | |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | continue; |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 716 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 717 | 717 | |
| 718 | 718 | if ($currentColumn + $nbCol > 12) { |
| 719 | 719 | $container->addItem($row); |
@@ -745,14 +745,14 @@ discard block |
||
| 745 | 745 | $sizePolicy = 'customsection-field-box '; |
| 746 | 746 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
| 747 | 747 | $sizePolicy .= isset($parameters['transparentBackground']) && $parameters['transparentBackground'] ? 'customsection-field-box-transparentBackground' : ''; |
| 748 | - $displayFieldMethod = '_' . $displayFieldName; |
|
| 748 | + $displayFieldMethod = '_'.$displayFieldName; |
|
| 749 | 749 | |
| 750 | 750 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
| 751 | 751 | $widget = $this->$displayFieldMethod($customSection, $label); |
| 752 | 752 | $item = $widget; |
| 753 | 753 | } |
| 754 | 754 | else { |
| 755 | - if($isGroupField){ |
|
| 755 | + if ($isGroupField) { |
|
| 756 | 756 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
| 757 | 757 | if (method_exists($this, '__fieldsGroup')) { |
| 758 | 758 | $customSection->fieldsLayout = $groupFieldsLayout; |
@@ -761,8 +761,8 @@ discard block |
||
| 761 | 761 | } |
| 762 | 762 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
| 763 | 763 | } |
| 764 | - else{ |
|
| 765 | - try{ |
|
| 764 | + else { |
|
| 765 | + try { |
|
| 766 | 766 | $field = $recordSet->getField($displayFieldName); |
| 767 | 767 | if ($label === '' || $label === '__') { |
| 768 | 768 | $label = $field->getDescription(); |
@@ -824,14 +824,14 @@ discard block |
||
| 824 | 824 | $parameters = $displayField['parameters']; |
| 825 | 825 | $classname = isset($parameters['classname']) ? $parameters['classname'] : ''; |
| 826 | 826 | $label = isset($parameters['label']) && !empty($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : null; |
| 827 | - $displayFieldMethod = '_' . $displayFieldName; |
|
| 827 | + $displayFieldMethod = '_'.$displayFieldName; |
|
| 828 | 828 | $sizePolicy = 'customsection-field-box '; |
| 829 | 829 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
| 830 | 830 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
| 831 | 831 | $item = $this->$displayFieldMethod($customSection, $label); |
| 832 | 832 | } |
| 833 | - else{ |
|
| 834 | - if($isGroupField){ |
|
| 833 | + else { |
|
| 834 | + if ($isGroupField) { |
|
| 835 | 835 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
| 836 | 836 | if (method_exists($this, '__fieldsGroup')) { |
| 837 | 837 | $customSection->fieldsLayout = $groupFieldsLayout; |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | } |
| 841 | 841 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
| 842 | 842 | } |
| 843 | - else{ |
|
| 843 | + else { |
|
| 844 | 844 | try { |
| 845 | 845 | $field = $this->recordSet->getField($displayFieldName); |
| 846 | 846 | if (!isset($label) || empty($label)) { |
@@ -882,14 +882,14 @@ discard block |
||
| 882 | 882 | $groupField = $customSection->getField('_fieldsGroup'.$groupId); |
| 883 | 883 | $recordSet = $this->getRecordSet(); |
| 884 | 884 | |
| 885 | - if(isset($groupField['fields'])){ |
|
| 886 | - foreach ($groupField['fields'] as $field){ |
|
| 885 | + if (isset($groupField['fields'])) { |
|
| 886 | + foreach ($groupField['fields'] as $field) { |
|
| 887 | 887 | $item = null; |
| 888 | 888 | |
| 889 | 889 | $labelField = isset($field['parameters']['label']) ? $field['parameters']['label'] : ''; |
| 890 | 890 | $itemClass = isset($field['parameters']['classname']) ? $field['parameters']['classname'] : ''; |
| 891 | 891 | $displayFieldName = $field['fieldname']; |
| 892 | - $displayFieldMethod = '_' . $displayFieldName; |
|
| 892 | + $displayFieldMethod = '_'.$displayFieldName; |
|
| 893 | 893 | if (method_exists($this, $displayFieldMethod)) { |
| 894 | 894 | $item = $this->$displayFieldMethod($customSection, $labelField); |
| 895 | 895 | } |
@@ -907,7 +907,7 @@ discard block |
||
| 907 | 907 | } |
| 908 | 908 | $item = $this->getValueItem($customSection, $field, $labelField, $item); |
| 909 | 909 | } |
| 910 | - if(isset($item)){ |
|
| 910 | + if (isset($item)) { |
|
| 911 | 911 | $item->addClass('app-customsection-groupedfield'); |
| 912 | 912 | $item->addClass($itemClass); |
| 913 | 913 | $box->addItem($item); |
@@ -1172,7 +1172,7 @@ discard block |
||
| 1172 | 1172 | $row = $W->Items()->setSizePolicy('row'); |
| 1173 | 1173 | foreach ($customSections as $customSection) { |
| 1174 | 1174 | |
| 1175 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 1175 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 1176 | 1176 | |
| 1177 | 1177 | if ($currentColumn + $nbCol > 12) { |
| 1178 | 1178 | $this->addItem($row); |
@@ -1199,7 +1199,7 @@ discard block |
||
| 1199 | 1199 | $parameters = $displayField['parameters']; |
| 1200 | 1200 | $classname = isset($parameters['classname']) ? $parameters['classname'] : ''; |
| 1201 | 1201 | $label = isset($parameters['label']) ? $parameters['label'] : ''; |
| 1202 | - $displayFieldMethod = '_' . $displayFieldName; |
|
| 1202 | + $displayFieldMethod = '_'.$displayFieldName; |
|
| 1203 | 1203 | |
| 1204 | 1204 | if (method_exists($this, $displayFieldMethod)) { |
| 1205 | 1205 | $value = $this->$displayFieldMethod($customSection, $label); |
@@ -1286,7 +1286,7 @@ discard block |
||
| 1286 | 1286 | */ |
| 1287 | 1287 | protected function initHeaderRow(ORM_RecordSet $set) |
| 1288 | 1288 | { |
| 1289 | - require_once $GLOBALS['babInstallPath'] . 'utilit/urlincl.php'; |
|
| 1289 | + require_once $GLOBALS['babInstallPath'].'utilit/urlincl.php'; |
|
| 1290 | 1290 | |
| 1291 | 1291 | bab_functionality::includefile('Icons'); |
| 1292 | 1292 | |
@@ -1318,12 +1318,12 @@ discard block |
||
| 1318 | 1318 | $sizePolicy = 'widget-actions-target'; |
| 1319 | 1319 | |
| 1320 | 1320 | if ($this->isMultiSelect() && $columnPath === '_select_') { |
| 1321 | - $this->toggleCheckAllBox = $W->CheckBox(); |
|
| 1321 | + $this->toggleCheckAllBox = $W->CheckBox(); |
|
| 1322 | 1322 | $this->toggleCheckAllBox->setName('toggleCheckAllBox'); |
| 1323 | 1323 | $this->toggleCheckAllBox->setTitle(widget_translate('Select all on page')); |
| 1324 | 1324 | $this->toggleCheckAllBox->setSizePolicy('condensed'); |
| 1325 | 1325 | $this->toggleCheckAllBox->setCheckedValue(true); |
| 1326 | - if(isset($_SESSION['toggleCheckAllBox'][$this->getId()]) && !empty($_SESSION['toggleCheckAllBox'][$this->getId()]) && $_SESSION['toggleCheckAllBox'][$this->getId()] == 'on'){ |
|
| 1326 | + if (isset($_SESSION['toggleCheckAllBox'][$this->getId()]) && !empty($_SESSION['toggleCheckAllBox'][$this->getId()]) && $_SESSION['toggleCheckAllBox'][$this->getId()] == 'on') { |
|
| 1327 | 1327 | $this->toggleCheckAllBox->setValue(true); |
| 1328 | 1328 | } |
| 1329 | 1329 | $isSearchable = false; |
@@ -1340,9 +1340,9 @@ discard block |
||
| 1340 | 1340 | $direction = ':up'; |
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | - $url = bab_url::mod($this->sortBaseUrl, $this->sortParameterName, $columnPath . $direction); |
|
| 1343 | + $url = bab_url::mod($this->sortBaseUrl, $this->sortParameterName, $columnPath.$direction); |
|
| 1344 | 1344 | if ($anchor = $this->getAnchor()) { |
| 1345 | - $url .= '#' . urlencode($anchor); |
|
| 1345 | + $url .= '#'.urlencode($anchor); |
|
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | 1348 | $columnItem = $W->Link( |
@@ -1354,7 +1354,7 @@ discard block |
||
| 1354 | 1354 | )->addClass('widget-table-column-sorting-action'); |
| 1355 | 1355 | if ($this->sortAjaxAction) { |
| 1356 | 1356 | $columnItem->setAjaxAction( |
| 1357 | - $this->sortAjaxAction->setParameter('sort', $columnPath . $direction), |
|
| 1357 | + $this->sortAjaxAction->setParameter('sort', $columnPath.$direction), |
|
| 1358 | 1358 | '' |
| 1359 | 1359 | ); |
| 1360 | 1360 | } |
@@ -1375,10 +1375,10 @@ discard block |
||
| 1375 | 1375 | $columnItem->addClass('icon', $columnIcon)->setSizePolicy(Func_Icons::ICON_LEFT_16); |
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | - if($isSortable){ |
|
| 1378 | + if ($isSortable) { |
|
| 1379 | 1379 | $sizePolicy .= ' widget-table-column-sortable'; |
| 1380 | 1380 | } |
| 1381 | - if($isSearchable){ |
|
| 1381 | + if ($isSearchable) { |
|
| 1382 | 1382 | if (!isset($this->filterBaseUrl)) { |
| 1383 | 1383 | $this->filterBaseUrl = $this->getRecordControllerProxy()->displayListFilter(); |
| 1384 | 1384 | } |
@@ -1393,7 +1393,7 @@ discard block |
||
| 1393 | 1393 | 0 |
| 1394 | 1394 | ); |
| 1395 | 1395 | $sizePolicy .= ' widget-table-column-searchable'; |
| 1396 | - if(isset($filterValues[$columnPath]) && !empty($filterValues[$columnPath])){ |
|
| 1396 | + if (isset($filterValues[$columnPath]) && !empty($filterValues[$columnPath])) { |
|
| 1397 | 1397 | $sizePolicy .= ' widget-table-column-searched'; |
| 1398 | 1398 | } |
| 1399 | 1399 | } |
@@ -1408,12 +1408,12 @@ discard block |
||
| 1408 | 1408 | } |
| 1409 | 1409 | } |
| 1410 | 1410 | |
| 1411 | - protected function initRow($record, $row){ |
|
| 1412 | - if($this->highlightRows == null){ |
|
| 1411 | + protected function initRow($record, $row) { |
|
| 1412 | + if ($this->highlightRows == null) { |
|
| 1413 | 1413 | $this->highlightRows = $this->getHighlightedRows(); |
| 1414 | 1414 | } |
| 1415 | 1415 | |
| 1416 | - if(in_array($record->id,$this->highlightRows)){ |
|
| 1416 | + if (in_array($record->id, $this->highlightRows)) { |
|
| 1417 | 1417 | $this->addRowClass($row, "app_highlightRow"); |
| 1418 | 1418 | } |
| 1419 | 1419 | $this->addRowClass($row, "app_highlightAvailable"); |
@@ -1443,7 +1443,7 @@ discard block |
||
| 1443 | 1443 | // we try to select one according to the classname prefix. |
| 1444 | 1444 | list($prefix) = explode('_', get_class($this)); |
| 1445 | 1445 | $functionalityName = ucwords($prefix); |
| 1446 | - $this->app = @bab_functionality::get('App/' . $functionalityName); |
|
| 1446 | + $this->app = @bab_functionality::get('App/'.$functionalityName); |
|
| 1447 | 1447 | if (!$this->app) { |
| 1448 | 1448 | $this->app = @bab_functionality::get('App'); |
| 1449 | 1449 | } |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber); |
| 1505 | 1505 | |
| 1506 | 1506 | if (isset($name)) { |
| 1507 | - $this->sortParameterName = $name . '[filter][sort]'; |
|
| 1507 | + $this->sortParameterName = $name.'[filter][sort]'; |
|
| 1508 | 1508 | } else { |
| 1509 | 1509 | $this->sortParameterName = 'filter[sort]'; |
| 1510 | 1510 | } |
@@ -1609,7 +1609,7 @@ discard block |
||
| 1609 | 1609 | |
| 1610 | 1610 | $values = $set->select(); |
| 1611 | 1611 | foreach ($values as $record) { |
| 1612 | - $widget->addOption($record->id, (string)$record->name); |
|
| 1612 | + $widget->addOption($record->id, (string) $record->name); |
|
| 1613 | 1613 | } |
| 1614 | 1614 | |
| 1615 | 1615 | return $widget; |
@@ -1717,11 +1717,11 @@ discard block |
||
| 1717 | 1717 | |
| 1718 | 1718 | foreach ($columns as $fieldName => $column) { |
| 1719 | 1719 | $field = $column->getField(); |
| 1720 | - if (! $column->isSearchable()) { |
|
| 1720 | + if (!$column->isSearchable()) { |
|
| 1721 | 1721 | continue; |
| 1722 | 1722 | } |
| 1723 | 1723 | |
| 1724 | - if (! ($field instanceof ORM_Field)) { |
|
| 1724 | + if (!($field instanceof ORM_Field)) { |
|
| 1725 | 1725 | $field = null; |
| 1726 | 1726 | } |
| 1727 | 1727 | |
@@ -1738,7 +1738,7 @@ discard block |
||
| 1738 | 1738 | $formItem = $this->handleFilterLabel($label, $input); |
| 1739 | 1739 | |
| 1740 | 1740 | // $formItem = $W->Section($label->getText(), $input, 7)->setFoldable(true, true); |
| 1741 | - $formItem->addClass('compact', 'field_' . $fieldName); |
|
| 1741 | + $formItem->addClass('compact', 'field_'.$fieldName); |
|
| 1742 | 1742 | |
| 1743 | 1743 | $mainSearch = (method_exists($column, 'isMainSearch') && $column->isMainSearch()); |
| 1744 | 1744 | |
@@ -1762,7 +1762,7 @@ discard block |
||
| 1762 | 1762 | $W->Link('', $removeColumnsAction) |
| 1763 | 1763 | ->setAjaxAction() |
| 1764 | 1764 | ->addClass('icon', Func_Icons::STATUS_DIALOG_ERROR) |
| 1765 | - ->addAttribute('data-removefor', $column->getFieldPath()) |
|
| 1765 | + ->addAttribute('data-removefor', $column->getFieldPath()) |
|
| 1766 | 1766 | )->setAlignItems(Widget_FlexLayout::FLEX_ALIGN_ITEMS_FLEX_END) |
| 1767 | 1767 | ); |
| 1768 | 1768 | } else { |
@@ -1773,7 +1773,7 @@ discard block |
||
| 1773 | 1773 | } |
| 1774 | 1774 | |
| 1775 | 1775 | |
| 1776 | - if (! $this->submit) { |
|
| 1776 | + if (!$this->submit) { |
|
| 1777 | 1777 | $this->submit = $W->SubmitButton(); |
| 1778 | 1778 | $this->submit->setLabel(widget_translate('Apply filter')); |
| 1779 | 1779 | } |
@@ -1812,7 +1812,7 @@ discard block |
||
| 1812 | 1812 | |
| 1813 | 1813 | |
| 1814 | 1814 | foreach ($filterNames as $filterName) { |
| 1815 | - $filter = $W->getUserConfiguration($controller->getModelViewDefaultId() . '/filters/' . $filterName, 'widgets', false); |
|
| 1815 | + $filter = $W->getUserConfiguration($controller->getModelViewDefaultId().'/filters/'.$filterName, 'widgets', false); |
|
| 1816 | 1816 | |
| 1817 | 1817 | // $this->select->addItem( |
| 1818 | 1818 | // $W->Link( |
@@ -1866,7 +1866,7 @@ discard block |
||
| 1866 | 1866 | $form->setReadOnly(true); |
| 1867 | 1867 | $form->setName('filter'); |
| 1868 | 1868 | $form->colon(); |
| 1869 | - $form->checkUnsaved(false,null); |
|
| 1869 | + $form->checkUnsaved(false, null); |
|
| 1870 | 1870 | |
| 1871 | 1871 | $form->setLayout( |
| 1872 | 1872 | $W->FlowItems( |
@@ -1928,7 +1928,7 @@ discard block |
||
| 1928 | 1928 | // $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber); |
| 1929 | 1929 | |
| 1930 | 1930 | if (isset($name)) { |
| 1931 | - $this->sortParameterName = $name . '[filter][sort]'; |
|
| 1931 | + $this->sortParameterName = $name.'[filter][sort]'; |
|
| 1932 | 1932 | } else { |
| 1933 | 1933 | $this->sortParameterName = 'filter[sort]'; |
| 1934 | 1934 | } |
@@ -2026,7 +2026,7 @@ discard block |
||
| 2026 | 2026 | |
| 2027 | 2027 | $tableview->setCurrentPage(isset($filterValues['pageNumber']) ? $filterValues['pageNumber'] : 0); |
| 2028 | 2028 | |
| 2029 | - $tableview->sortParameterName = $name . '[filter][sort]'; |
|
| 2029 | + $tableview->sortParameterName = $name.'[filter][sort]'; |
|
| 2030 | 2030 | |
| 2031 | 2031 | if (isset($filterValues['sort'])) { |
| 2032 | 2032 | $tableview->setSortField($filterValues['sort']); |
@@ -2357,7 +2357,7 @@ discard block |
||
| 2357 | 2357 | continue; |
| 2358 | 2358 | } |
| 2359 | 2359 | |
| 2360 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 2360 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 2361 | 2361 | |
| 2362 | 2362 | if ($currentColumn + $nbCol > 12) { |
| 2363 | 2363 | $container->addItem($row); |
@@ -2413,19 +2413,19 @@ discard block |
||
| 2413 | 2413 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
| 2414 | 2414 | $sizePolicy .= isset($parameters['transparentBackground']) && $parameters['transparentBackground'] ? 'customsection-field-box-transparentBackground' : ''; |
| 2415 | 2415 | |
| 2416 | - $displayFieldMethod = '_' . $displayFieldName; |
|
| 2416 | + $displayFieldMethod = '_'.$displayFieldName; |
|
| 2417 | 2417 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
| 2418 | 2418 | $item = $this->$displayFieldMethod($customSection, $label); |
| 2419 | 2419 | } |
| 2420 | 2420 | else { |
| 2421 | - if($isGroupField){ |
|
| 2421 | + if ($isGroupField) { |
|
| 2422 | 2422 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
| 2423 | 2423 | if (method_exists($this, '__fieldsGroup')) { |
| 2424 | 2424 | $item = $this->__fieldsGroup($customSection, $groupId, $label); |
| 2425 | 2425 | } |
| 2426 | 2426 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
| 2427 | 2427 | } |
| 2428 | - else{ |
|
| 2428 | + else { |
|
| 2429 | 2429 | try { |
| 2430 | 2430 | $field = $this->recordSet->getField($displayFieldName); |
| 2431 | 2431 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -2453,7 +2453,7 @@ discard block |
||
| 2453 | 2453 | } |
| 2454 | 2454 | } |
| 2455 | 2455 | |
| 2456 | - if ($currentColumn + $nbCol> 0) { |
|
| 2456 | + if ($currentColumn + $nbCol > 0) { |
|
| 2457 | 2457 | $container->addItem($row); |
| 2458 | 2458 | } |
| 2459 | 2459 | } |
@@ -2485,8 +2485,8 @@ discard block |
||
| 2485 | 2485 | $groupField = $customSection->getField('_fieldsGroup'.$groupId); |
| 2486 | 2486 | $originalFieldsLayout = $customSection->fieldsLayout; |
| 2487 | 2487 | $customSection->fieldsLayout = app_CustomSection::FIELDS_LAYOUT_VERTICAL_LABEL; |
| 2488 | - if(isset($groupField['fields'])){ |
|
| 2489 | - foreach ($groupField['fields'] as $field){ |
|
| 2488 | + if (isset($groupField['fields'])) { |
|
| 2489 | + foreach ($groupField['fields'] as $field) { |
|
| 2490 | 2490 | $item = null; |
| 2491 | 2491 | $parameters = $field['parameters']; |
| 2492 | 2492 | $labelField = isset($parameters['label']) ? $parameters['label'] : ''; |
@@ -2496,11 +2496,11 @@ discard block |
||
| 2496 | 2496 | |
| 2497 | 2497 | $displayFieldName = $field['fieldname']; |
| 2498 | 2498 | |
| 2499 | - $displayFieldMethod = '_' . $displayFieldName; |
|
| 2499 | + $displayFieldMethod = '_'.$displayFieldName; |
|
| 2500 | 2500 | if (method_exists($this, $displayFieldMethod)) { |
| 2501 | 2501 | $item = $this->$displayFieldMethod($customSection, $labelField); |
| 2502 | 2502 | } |
| 2503 | - else{ |
|
| 2503 | + else { |
|
| 2504 | 2504 | try { |
| 2505 | 2505 | $field = $this->recordSet->getField($displayFieldName); |
| 2506 | 2506 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -2516,7 +2516,7 @@ discard block |
||
| 2516 | 2516 | $item = null; |
| 2517 | 2517 | } |
| 2518 | 2518 | } |
| 2519 | - if(isset($item)){ |
|
| 2519 | + if (isset($item)) { |
|
| 2520 | 2520 | $item->addClass('app-customsection-groupedfield'); |
| 2521 | 2521 | $item->addClass($itemClass); |
| 2522 | 2522 | } |
@@ -2638,7 +2638,7 @@ discard block |
||
| 2638 | 2638 | |
| 2639 | 2639 | $displayable = $field->output($value); |
| 2640 | 2640 | |
| 2641 | - switch(true) { |
|
| 2641 | + switch (true) { |
|
| 2642 | 2642 | case ($field instanceof ORM_TextField): |
| 2643 | 2643 | $displayable = $W->RichText($displayable)->setRenderingOptions(BAB_HTML_ALL ^ BAB_HTML_P); |
| 2644 | 2644 | break; |
@@ -2758,7 +2758,7 @@ discard block |
||
| 2758 | 2758 | { |
| 2759 | 2759 | $this->modelView = $modelView; |
| 2760 | 2760 | $this->modelViewId = $modelView->getId(); |
| 2761 | - if(!isset($id) || empty($id)){ |
|
| 2761 | + if (!isset($id) || empty($id)) { |
|
| 2762 | 2762 | $id = $this->getDefaultEditorId(); |
| 2763 | 2763 | } |
| 2764 | 2764 | parent::__construct($app, $id, $layout); |
@@ -2806,10 +2806,10 @@ discard block |
||
| 2806 | 2806 | $pagesLengths = array(5, 10, 12, 15, 20, 30, 50, 100, 200, 300, 500, 1000); |
| 2807 | 2807 | |
| 2808 | 2808 | $select = $W->Select(); |
| 2809 | - foreach ($pagesLengths as $pagesLength){ |
|
| 2809 | + foreach ($pagesLengths as $pagesLength) { |
|
| 2810 | 2810 | $select->addOption($pagesLength, $pagesLength); |
| 2811 | 2811 | } |
| 2812 | - $select->setValue($W->getUserConfiguration($this->modelViewId . '/pageLength', 'widgets')); |
|
| 2812 | + $select->setValue($W->getUserConfiguration($this->modelViewId.'/pageLength', 'widgets')); |
|
| 2813 | 2813 | |
| 2814 | 2814 | return $W->LabelledWidget( |
| 2815 | 2815 | $this->App()->translate('Number of lines per page'), |
@@ -2823,7 +2823,7 @@ discard block |
||
| 2823 | 2823 | $W = bab_Widgets(); |
| 2824 | 2824 | |
| 2825 | 2825 | $checkbox = $W->CheckBox(); |
| 2826 | - $checkbox->setValue($W->getUserConfiguration($this->modelViewId . '/displaySubTotalRow', 'widgets')); |
|
| 2826 | + $checkbox->setValue($W->getUserConfiguration($this->modelViewId.'/displaySubTotalRow', 'widgets')); |
|
| 2827 | 2827 | |
| 2828 | 2828 | return $W->LabelledWidget( |
| 2829 | 2829 | $this->App()->translate('Display subtotal rows'), |
@@ -750,8 +750,7 @@ discard block |
||
| 750 | 750 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
| 751 | 751 | $widget = $this->$displayFieldMethod($customSection, $label); |
| 752 | 752 | $item = $widget; |
| 753 | - } |
|
| 754 | - else { |
|
| 753 | + } else { |
|
| 755 | 754 | if($isGroupField){ |
| 756 | 755 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
| 757 | 756 | if (method_exists($this, '__fieldsGroup')) { |
@@ -760,8 +759,7 @@ discard block |
||
| 760 | 759 | $customSection->fieldsLayout = $originalFieldsLayout; |
| 761 | 760 | } |
| 762 | 761 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
| 763 | - } |
|
| 764 | - else{ |
|
| 762 | + } else{ |
|
| 765 | 763 | try{ |
| 766 | 764 | $field = $recordSet->getField($displayFieldName); |
| 767 | 765 | if ($label === '' || $label === '__') { |
@@ -829,8 +827,7 @@ discard block |
||
| 829 | 827 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
| 830 | 828 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
| 831 | 829 | $item = $this->$displayFieldMethod($customSection, $label); |
| 832 | - } |
|
| 833 | - else{ |
|
| 830 | + } else{ |
|
| 834 | 831 | if($isGroupField){ |
| 835 | 832 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
| 836 | 833 | if (method_exists($this, '__fieldsGroup')) { |
@@ -839,8 +836,7 @@ discard block |
||
| 839 | 836 | $customSection->fieldsLayout = $wantedFieldsLayout; |
| 840 | 837 | } |
| 841 | 838 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
| 842 | - } |
|
| 843 | - else{ |
|
| 839 | + } else{ |
|
| 844 | 840 | try { |
| 845 | 841 | $field = $this->recordSet->getField($displayFieldName); |
| 846 | 842 | if (!isset($label) || empty($label)) { |
@@ -892,8 +888,7 @@ discard block |
||
| 892 | 888 | $displayFieldMethod = '_' . $displayFieldName; |
| 893 | 889 | if (method_exists($this, $displayFieldMethod)) { |
| 894 | 890 | $item = $this->$displayFieldMethod($customSection, $labelField); |
| 895 | - } |
|
| 896 | - else if ($recordSet->fieldExist($displayFieldName)) { |
|
| 891 | + } else if ($recordSet->fieldExist($displayFieldName)) { |
|
| 897 | 892 | $field = $recordSet->getField($displayFieldName); |
| 898 | 893 | if ($labelField === '') { |
| 899 | 894 | $labelField = $field->getDescription(); |
@@ -2416,16 +2411,14 @@ discard block |
||
| 2416 | 2411 | $displayFieldMethod = '_' . $displayFieldName; |
| 2417 | 2412 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
| 2418 | 2413 | $item = $this->$displayFieldMethod($customSection, $label); |
| 2419 | - } |
|
| 2420 | - else { |
|
| 2414 | + } else { |
|
| 2421 | 2415 | if($isGroupField){ |
| 2422 | 2416 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
| 2423 | 2417 | if (method_exists($this, '__fieldsGroup')) { |
| 2424 | 2418 | $item = $this->__fieldsGroup($customSection, $groupId, $label); |
| 2425 | 2419 | } |
| 2426 | 2420 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
| 2427 | - } |
|
| 2428 | - else{ |
|
| 2421 | + } else{ |
|
| 2429 | 2422 | try { |
| 2430 | 2423 | $field = $this->recordSet->getField($displayFieldName); |
| 2431 | 2424 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -2499,8 +2492,7 @@ discard block |
||
| 2499 | 2492 | $displayFieldMethod = '_' . $displayFieldName; |
| 2500 | 2493 | if (method_exists($this, $displayFieldMethod)) { |
| 2501 | 2494 | $item = $this->$displayFieldMethod($customSection, $labelField); |
| 2502 | - } |
|
| 2503 | - else{ |
|
| 2495 | + } else{ |
|
| 2504 | 2496 | try { |
| 2505 | 2497 | $field = $this->recordSet->getField($displayFieldName); |
| 2506 | 2498 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | protected function getShapeHtml() |
| 90 | 90 | { |
| 91 | - $path = "M{$this->size} {$this->size} ".number_format($this->size/2, 1).' '.number_format($this->size/6, 1)." L0 {$this->size} Z"; |
|
| 91 | + $path = "M{$this->size} {$this->size} ".number_format($this->size / 2, 1).' '.number_format($this->size / 6, 1)." L0 {$this->size} Z"; |
|
| 92 | 92 | return "<svg height='{$this->size}' width='{$this->size}'> |
| 93 | 93 | <path d='{$path}' fill='{$this->color}'/> |
| 94 | 94 | </svg>"; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | protected function getShapeHtml() |
| 101 | 101 | { |
| 102 | - $val = number_format($this->size/2,1); |
|
| 102 | + $val = number_format($this->size / 2, 1); |
|
| 103 | 103 | return "<svg height='{$this->size}' width='{$this->size}'> |
| 104 | 104 | <circle cx='{$val}' cy='{$val}' r='{$val}' fill='{$this->color}' /> |
| 105 | 105 | </svg>"; |
@@ -70,14 +70,14 @@ |
||
| 70 | 70 | |
| 71 | 71 | $html = "<div class='chip'>"; |
| 72 | 72 | |
| 73 | - if(isset($this->labelIcon)){ |
|
| 73 | + if (isset($this->labelIcon)) { |
|
| 74 | 74 | $icon = $W->Label('')->setIconFormat(16, 'left')->setIcon($this->labelIcon); |
| 75 | 75 | $html .= $icon->display($W->HtmlCanvas()); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $html .= $this->label; |
| 79 | 79 | |
| 80 | - if(isset($this->action)){ |
|
| 80 | + if (isset($this->action)) { |
|
| 81 | 81 | $icon = $W->Link('', $this->action)->setIconFormat(16, 'left')->setOpenMode(Widget_Link::OPEN_DIALOG_AND_RELOAD); |
| 82 | 82 | $icon->setIcon(isset($this->actionIcon) ? $this->actionIcon : Func_Icons::ACTIONS_DIALOG_CANCEL); |
| 83 | 83 | $icon->addClass('chip-right-action'); |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function includeBase() |
| 36 | 36 | { |
| 37 | - require_once APP_UI_PATH . 'base.ui.php'; |
|
| 38 | - require_once APP_UI_PATH . 'ui.helpers.php'; |
|
| 37 | + require_once APP_UI_PATH.'base.ui.php'; |
|
| 38 | + require_once APP_UI_PATH.'ui.helpers.php'; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function includePage() |
| 42 | 42 | { |
| 43 | - require_once APP_UI_PATH . 'page.class.php'; |
|
| 43 | + require_once APP_UI_PATH.'page.class.php'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function __call($name, $arguments) |
@@ -48,22 +48,22 @@ discard block |
||
| 48 | 48 | $App = $this->App(); |
| 49 | 49 | $Ui = $App->Ui(); |
| 50 | 50 | |
| 51 | - if(strpos($name, $App->classPrefix) !== false){ |
|
| 51 | + if (strpos($name, $App->classPrefix) !== false) { |
|
| 52 | 52 | list(, $name) = explode($App->classPrefix, $name); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - if(method_exists($Ui, $name)){ |
|
| 55 | + if (method_exists($Ui, $name)) { |
|
| 56 | 56 | return call_user_func_array(array($Ui, $name), $arguments); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $components = $App->getComponents(); |
| 60 | - foreach ($components as $component){ |
|
| 61 | - try{ |
|
| 60 | + foreach ($components as $component) { |
|
| 61 | + try { |
|
| 62 | 62 | $componentUi = $component->ui(); |
| 63 | - if(isset($componentUi) && method_exists($componentUi, $name)){ |
|
| 63 | + if (isset($componentUi) && method_exists($componentUi, $name)) { |
|
| 64 | 64 | return call_user_func_array(array($componentUi, $name), $arguments); |
| 65 | 65 | } |
| 66 | - }catch(Exception $e){} |
|
| 66 | + } catch (Exception $e) {} |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $rc = new ReflectionClass($this); |
@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | $page->addMessageInfo(); |
| 87 | 87 | |
| 88 | 88 | $addon = $App->getAddon(); |
| 89 | - if($addon){ |
|
| 89 | + if ($addon) { |
|
| 90 | 90 | $components = $App->getComponents(); |
| 91 | - foreach ($components as $component){ |
|
| 91 | + foreach ($components as $component) { |
|
| 92 | 92 | $stylePath = $component->getStylePath(); |
| 93 | - if($stylePath){ |
|
| 93 | + if ($stylePath) { |
|
| 94 | 94 | $page->addStyleSheet($stylePath.'style.css'); |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -133,25 +133,25 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function ExportSelectEditor($id, app_TableModelView $tableview, $filter = null) |
| 135 | 135 | { |
| 136 | - require_once dirname(__FILE__) . '/exportselect.ui.php'; |
|
| 136 | + require_once dirname(__FILE__).'/exportselect.ui.php'; |
|
| 137 | 137 | return new app_ExportSelectEditor($this->App(), $id, $tableview, $filter); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | public function Chip($label, $labelIcon = null, $action = null, $actionIcon = null, $id = null) |
| 141 | 141 | { |
| 142 | - require_once APP_WIDGETS_PATH . 'chip.ui.php'; |
|
| 142 | + require_once APP_WIDGETS_PATH.'chip.ui.php'; |
|
| 143 | 143 | return new app_Chip($this->App(), $label, $labelIcon, $action, $actionIcon, $id); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | public function CustomFieldTableView($id = null) |
| 147 | 147 | { |
| 148 | - require_once APP_UI_PATH . 'customfield.ui.php'; |
|
| 148 | + require_once APP_UI_PATH.'customfield.ui.php'; |
|
| 149 | 149 | return new app_CustomFieldTableView($this->App(), $id); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | public function CustomFieldEditor(app_CustomField $customField = null, $id = null, $layout = null) |
| 153 | 153 | { |
| 154 | - require_once APP_UI_PATH . 'customfield.ui.php'; |
|
| 154 | + require_once APP_UI_PATH.'customfield.ui.php'; |
|
| 155 | 155 | return new app_CustomFieldEditor($this->App(), $customField, $id, $layout); |
| 156 | 156 | } |
| 157 | 157 | |
@@ -175,13 +175,13 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function CriteriaEditor(ORM_Criteria $criteria = null) |
| 177 | 177 | { |
| 178 | - require_once APP_UI_PATH . 'criteria.ui.php'; |
|
| 178 | + require_once APP_UI_PATH.'criteria.ui.php'; |
|
| 179 | 179 | return new app_CriteriaEditor($this->App(), $criteria); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | public function includeShapesUi() |
| 183 | 183 | { |
| 184 | - require_once APP_WIDGETS_PATH . 'shapes.ui.php'; |
|
| 184 | + require_once APP_WIDGETS_PATH.'shapes.ui.php'; |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | public function ShapeSquare($size = 15, $color = 'black') |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | if(isset($componentUi) && method_exists($componentUi, $name)){ |
| 64 | 64 | return call_user_func_array(array($componentUi, $name), $arguments); |
| 65 | 65 | } |
| 66 | - }catch(Exception $e){} |
|
| 66 | + } catch(Exception $e){} |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $rc = new ReflectionClass($this); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $classPrefix = $App->classPrefix; |
| 121 | 121 | |
| 122 | 122 | foreach ($recordSetFields as $fieldName => $recordSetField) { |
| 123 | - if($recordSetField instanceof ORM_ManyRelation){ |
|
| 123 | + if ($recordSetField instanceof ORM_ManyRelation) { |
|
| 124 | 124 | /* @var $recordSetField ORM_ManyRelation */ |
| 125 | 125 | $fieldDescription = $fieldName; |
| 126 | 126 | $path = $fieldName; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | } |
| 157 | - elseif($recordSetField instanceof ORM_FkField){ |
|
| 157 | + elseif ($recordSetField instanceof ORM_FkField) { |
|
| 158 | 158 | /* @var $recordSetField ORM_FkField */ |
| 159 | 159 | $fieldDescription = $fieldName; |
| 160 | 160 | $path = $fieldName; |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | - else{ |
|
| 185 | + else { |
|
| 186 | 186 | /* @var $recordSetField ORM_Field */ |
| 187 | 187 | $fieldName = $recordSetField->getName(); |
| 188 | 188 | $fieldDescription = $recordSetField->getDescription(); |
@@ -153,8 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - } |
|
| 157 | - elseif($recordSetField instanceof ORM_FkField){ |
|
| 156 | + } elseif($recordSetField instanceof ORM_FkField){ |
|
| 158 | 157 | /* @var $recordSetField ORM_FkField */ |
| 159 | 158 | $fieldDescription = $fieldName; |
| 160 | 159 | $path = $fieldName; |
@@ -181,8 +180,7 @@ discard block |
||
| 181 | 180 | $defaultFieldPathes[] = $foreignPath; |
| 182 | 181 | } |
| 183 | 182 | } |
| 184 | - } |
|
| 185 | - else{ |
|
| 183 | + } else{ |
|
| 186 | 184 | /* @var $recordSetField ORM_Field */ |
| 187 | 185 | $fieldName = $recordSetField->getName(); |
| 188 | 186 | $fieldDescription = $recordSetField->getDescription(); |