@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | -require_once dirname(__FILE__). '/functions.php'; |
|
| 26 | +require_once dirname(__FILE__) . '/functions.php'; |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | function LibApp_upgrade($sVersionBase, $sVersionIni) |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $sql .= $backend->setToSql($App->LogSet()); |
| 44 | 44 | |
| 45 | - require_once $GLOBALS['babInstallPath'].'utilit/devtools.php'; |
|
| 45 | + require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php'; |
|
| 46 | 46 | $synchronize = new bab_synchronizeSql(); |
| 47 | 47 | |
| 48 | 48 | $synchronize->fromSqlString($sql); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | function LibApp_onDeleteAddon() |
| 55 | 55 | { |
| 56 | - require_once $GLOBALS['babInstallPath'].'utilit/functionalityincl.php'; |
|
| 56 | + require_once $GLOBALS['babInstallPath'] . 'utilit/functionalityincl.php'; |
|
| 57 | 57 | $functionalities = new bab_functionalities(); |
| 58 | 58 | $functionalities->unregister('App'); |
| 59 | 59 | return true; |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | } |
| 147 | 147 | return $returnedValue; |
| 148 | 148 | } else { |
| 149 | - trigger_error('the method '.$name.' does not exists on '.get_class($this).' and there is no widget defined with the setInheritedItem method'); |
|
| 149 | + trigger_error('the method ' . $name . ' does not exists on ' . get_class($this) . ' and there is no widget defined with the setInheritedItem method'); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | public function __construct(Func_App $app, $id = null, Widget_Layout $layout = null) |
| 103 | 103 | { |
| 104 | 104 | parent::__construct($app); |
| 105 | - // We simulate inheritance from Widget_VBoxLayout. |
|
| 105 | + // We simulate inheritance from Widget_VBoxLayout. |
|
| 106 | 106 | $W = $this->widgets = bab_Widgets(); |
| 107 | 107 | |
| 108 | 108 | |
@@ -307,9 +307,9 @@ discard block |
||
| 307 | 307 | $cancelLabel = isset($this->cancelLabel) ? $this->cancelLabel : $App->translate('Cancel'); |
| 308 | 308 | $this->addButton( |
| 309 | 309 | $W->SubmitButton(/*'cancel'*/) |
| 310 | - ->addClass('widget-close-dialog') |
|
| 310 | + ->addClass('widget-close-dialog') |
|
| 311 | 311 | ->setAction($this->cancelAction) |
| 312 | - ->setLabel($cancelLabel) |
|
| 312 | + ->setLabel($cancelLabel) |
|
| 313 | 313 | ); |
| 314 | 314 | } |
| 315 | 315 | |
@@ -1148,21 +1148,21 @@ discard block |
||
| 1148 | 1148 | |
| 1149 | 1149 | |
| 1150 | 1150 | |
| 1151 | - protected function addCustomFields(app_RecordSet $recordSet) |
|
| 1152 | - { |
|
| 1153 | - $customFields = $recordSet->getCustomFields(); |
|
| 1151 | + protected function addCustomFields(app_RecordSet $recordSet) |
|
| 1152 | + { |
|
| 1153 | + $customFields = $recordSet->getCustomFields(); |
|
| 1154 | 1154 | |
| 1155 | 1155 | foreach ($customFields as $customField) { |
| 1156 | 1156 | $fieldname = $customField->fieldname; |
| 1157 | 1157 | $this->addColumn( |
| 1158 | 1158 | widget_TableModelViewColumn($recordSet->$fieldname, $customField->name) |
| 1159 | - ->setSortable(true) |
|
| 1160 | - ->setExportable(true) |
|
| 1161 | - ->setSearchable($customField->searchable) |
|
| 1162 | - ->setVisible($customField->visible) |
|
| 1159 | + ->setSortable(true) |
|
| 1160 | + ->setExportable(true) |
|
| 1161 | + ->setSearchable($customField->searchable) |
|
| 1162 | + ->setVisible($customField->visible) |
|
| 1163 | 1163 | ); |
| 1164 | 1164 | } |
| 1165 | - } |
|
| 1165 | + } |
|
| 1166 | 1166 | |
| 1167 | 1167 | |
| 1168 | 1168 | /** |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | continue; |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 670 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 671 | 671 | |
| 672 | 672 | if ($currentColumn + $nbCol > 12) { |
| 673 | 673 | $this->addItem($row); |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | } |
| 723 | 723 | } |
| 724 | 724 | |
| 725 | - if ($currentColumn + $nbCol> 0) { |
|
| 725 | + if ($currentColumn + $nbCol > 0) { |
|
| 726 | 726 | $this->addItem($row); |
| 727 | 727 | } |
| 728 | 728 | } |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | $row = $W->Items()->setSizePolicy('row'); |
| 995 | 995 | foreach ($customSections as $customSection) { |
| 996 | 996 | |
| 997 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 997 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 998 | 998 | |
| 999 | 999 | if ($currentColumn + $nbCol > 12) { |
| 1000 | 1000 | $this->addItem($row); |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | } |
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | - if ($currentColumn + $nbCol> 0) { |
|
| 1049 | + if ($currentColumn + $nbCol > 0) { |
|
| 1050 | 1050 | $this->addItem($row); |
| 1051 | 1051 | } |
| 1052 | 1052 | } |
@@ -1351,11 +1351,11 @@ discard block |
||
| 1351 | 1351 | |
| 1352 | 1352 | foreach ($columns as $fieldName => $column) { |
| 1353 | 1353 | $field = $column->getField(); |
| 1354 | - if (! $column->isSearchable()) { |
|
| 1354 | + if (!$column->isSearchable()) { |
|
| 1355 | 1355 | continue; |
| 1356 | 1356 | } |
| 1357 | 1357 | |
| 1358 | - if (! ($field instanceof ORM_Field)) { |
|
| 1358 | + if (!($field instanceof ORM_Field)) { |
|
| 1359 | 1359 | $field = null; |
| 1360 | 1360 | } |
| 1361 | 1361 | |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | } |
| 1386 | 1386 | |
| 1387 | 1387 | |
| 1388 | - if (! $this->submit) { |
|
| 1388 | + if (!$this->submit) { |
|
| 1389 | 1389 | $this->submit = $W->SubmitButton(); |
| 1390 | 1390 | $this->submit->setLabel(widget_translate('Filter')); |
| 1391 | 1391 | } |
@@ -1809,7 +1809,7 @@ discard block |
||
| 1809 | 1809 | continue; |
| 1810 | 1810 | } |
| 1811 | 1811 | |
| 1812 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 1812 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 1813 | 1813 | |
| 1814 | 1814 | if ($currentColumn + $nbCol > 12) { |
| 1815 | 1815 | $this->addItem($row); |
@@ -1880,7 +1880,7 @@ discard block |
||
| 1880 | 1880 | } |
| 1881 | 1881 | } |
| 1882 | 1882 | |
| 1883 | - if ($currentColumn + $nbCol> 0) { |
|
| 1883 | + if ($currentColumn + $nbCol > 0) { |
|
| 1884 | 1884 | $this->addItem($row); |
| 1885 | 1885 | } |
| 1886 | 1886 | } |
@@ -1994,7 +1994,7 @@ discard block |
||
| 1994 | 1994 | |
| 1995 | 1995 | $displayable = $field->output($value); |
| 1996 | 1996 | |
| 1997 | - switch(true) { |
|
| 1997 | + switch (true) { |
|
| 1998 | 1998 | case ($field instanceof ORM_TextField): |
| 1999 | 1999 | $displayable = $W->RichText($displayable)->setRenderingOptions(BAB_HTML_ALL ^ BAB_HTML_P); |
| 2000 | 2000 | break; |
@@ -2004,7 +2004,7 @@ discard block |
||
| 2004 | 2004 | break; |
| 2005 | 2005 | |
| 2006 | 2006 | case ($field instanceof ORM_EmailField): |
| 2007 | - $displayable = $W->Link($displayable, 'mailto:'.$displayable); |
|
| 2007 | + $displayable = $W->Link($displayable, 'mailto:' . $displayable); |
|
| 2008 | 2008 | break; |
| 2009 | 2009 | |
| 2010 | 2010 | case ($field instanceof ORM_FkField): |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | // all widget have static id to not change id of others widgets in page |
| 288 | 288 | |
| 289 | - $infoMessages = $_SESSION['app_msginfo']; |
|
| 289 | + $infoMessages = $_SESSION['app_msginfo']; |
|
| 290 | 290 | foreach ($infoMessages as $infoLine) { |
| 291 | 291 | $this->App()->Controller()->addMessage($infoLine); |
| 292 | 292 | } |
@@ -304,6 +304,6 @@ discard block |
||
| 304 | 304 | * @see app.jquery.js#window.babAddonLibApp.numberFormat |
| 305 | 305 | */ |
| 306 | 306 | $this->setMetadata('numberFormatSeparator', mb_substr($str, 1, 1)); |
| 307 | - $this->setMetadata('numberFormatPrecision', mb_strlen($str) -2); |
|
| 307 | + $this->setMetadata('numberFormatPrecision', mb_strlen($str) - 2); |
|
| 308 | 308 | } |
| 309 | 309 | } |
@@ -33,50 +33,50 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | function app_genericSetEditor(ORM_RecordSet $set) |
| 35 | 35 | { |
| 36 | - $O = bab_functionality::get('LibOrm'); |
|
| 37 | - $O->init(); |
|
| 38 | - $W = bab_Widgets(); |
|
| 39 | - $layout = $W->VBoxLayout(); |
|
| 40 | - $layout->setVerticalSpacing(1, 'em'); |
|
| 41 | - |
|
| 42 | - |
|
| 43 | - $fields = $set->getFields(); |
|
| 44 | - |
|
| 45 | - foreach ($fields as $field) { |
|
| 46 | - $description = $field->getDescription(); |
|
| 47 | - if (empty($description)) { |
|
| 48 | - $description = $field->getName(); |
|
| 49 | - } |
|
| 50 | - $fieldLabel = $W->Label($description . ':'); |
|
| 51 | - |
|
| 52 | - if ($field instanceof ORM_DateField) { |
|
| 53 | - $widget = $W->DatePicker(); |
|
| 54 | - } else if ($field instanceof ORM_TimeField) { |
|
| 55 | - $widget = $W->LineEdit()->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
| 56 | - } else if ($field instanceof ORM_StringField) { |
|
| 57 | - $widget = $W->LineEdit()->setSize(min(array(80, $field->getMaxLength()))); |
|
| 58 | - } else if ($field instanceof ORM_EnumField) { |
|
| 59 | - $widget = $W->Select(); |
|
| 60 | - $widget->addOption('', ''); |
|
| 61 | - foreach ($field->getValues() as $key => $text) { |
|
| 62 | - $widget->addOption($key, $text); |
|
| 63 | - } |
|
| 64 | - } else if ($field instanceof ORM_IntField) { |
|
| 65 | - $widget = $W->LineEdit()->setSize(9); |
|
| 66 | - } else if ($field instanceof ORM_TextField) { |
|
| 67 | - $widget = $W->TextEdit()->setColumns(80)->setLines(5); |
|
| 68 | - } else if ($field instanceof ORM_RecordSet) { |
|
| 69 | - $widget = app_genericSetEditor($field); |
|
| 70 | - $widget->addClass('sub-form'); |
|
| 71 | - } else { |
|
| 72 | - $widget = null; |
|
| 73 | - } |
|
| 74 | - if (isset($widget)) { |
|
| 75 | - $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
| 76 | - } |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - return $layout; |
|
| 36 | + $O = bab_functionality::get('LibOrm'); |
|
| 37 | + $O->init(); |
|
| 38 | + $W = bab_Widgets(); |
|
| 39 | + $layout = $W->VBoxLayout(); |
|
| 40 | + $layout->setVerticalSpacing(1, 'em'); |
|
| 41 | + |
|
| 42 | + |
|
| 43 | + $fields = $set->getFields(); |
|
| 44 | + |
|
| 45 | + foreach ($fields as $field) { |
|
| 46 | + $description = $field->getDescription(); |
|
| 47 | + if (empty($description)) { |
|
| 48 | + $description = $field->getName(); |
|
| 49 | + } |
|
| 50 | + $fieldLabel = $W->Label($description . ':'); |
|
| 51 | + |
|
| 52 | + if ($field instanceof ORM_DateField) { |
|
| 53 | + $widget = $W->DatePicker(); |
|
| 54 | + } else if ($field instanceof ORM_TimeField) { |
|
| 55 | + $widget = $W->LineEdit()->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
| 56 | + } else if ($field instanceof ORM_StringField) { |
|
| 57 | + $widget = $W->LineEdit()->setSize(min(array(80, $field->getMaxLength()))); |
|
| 58 | + } else if ($field instanceof ORM_EnumField) { |
|
| 59 | + $widget = $W->Select(); |
|
| 60 | + $widget->addOption('', ''); |
|
| 61 | + foreach ($field->getValues() as $key => $text) { |
|
| 62 | + $widget->addOption($key, $text); |
|
| 63 | + } |
|
| 64 | + } else if ($field instanceof ORM_IntField) { |
|
| 65 | + $widget = $W->LineEdit()->setSize(9); |
|
| 66 | + } else if ($field instanceof ORM_TextField) { |
|
| 67 | + $widget = $W->TextEdit()->setColumns(80)->setLines(5); |
|
| 68 | + } else if ($field instanceof ORM_RecordSet) { |
|
| 69 | + $widget = app_genericSetEditor($field); |
|
| 70 | + $widget->addClass('sub-form'); |
|
| 71 | + } else { |
|
| 72 | + $widget = null; |
|
| 73 | + } |
|
| 74 | + if (isset($widget)) { |
|
| 75 | + $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + return $layout; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
@@ -89,50 +89,50 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | function app_genericSetFilterForm(ORM_RecordSet $set) |
| 91 | 91 | { |
| 92 | - $O = bab_functionality::get('LibOrm'); |
|
| 93 | - $O->init(); |
|
| 94 | - $W = bab_Widgets(); |
|
| 95 | - $layout = $W->FlowLayout(); |
|
| 96 | - $layout->setVerticalSpacing(1, 'em')->setHorizontalSpacing(1, 'em'); |
|
| 97 | - |
|
| 98 | - |
|
| 99 | - $fields = $set->getFields(); |
|
| 100 | - |
|
| 101 | - foreach ($fields as $field) { |
|
| 102 | - $description = $field->getDescription(); |
|
| 103 | - if (empty($description)) { |
|
| 104 | - $description = $field->getName(); |
|
| 105 | - } |
|
| 106 | - $fieldLabel = $W->Label($description . ':'); |
|
| 107 | - |
|
| 108 | - if ($field instanceof ORM_DateField) { |
|
| 109 | - $widget = $W->PeriodPicker(); |
|
| 110 | - } else if ($field instanceof ORM_TimeField) { |
|
| 111 | - $widget = $W->TimePicker(); |
|
| 112 | - } else if ($field instanceof ORM_StringField) { |
|
| 113 | - $widget = $W->LineEdit()->setSize(min(array(15, $field->getMaxLength()))); |
|
| 114 | - } else if ($field instanceof ORM_EnumField) { |
|
| 115 | - $widget = $W->Select(); |
|
| 116 | - $widget->addOption('', ''); |
|
| 117 | - foreach ($field->getValues() as $key => $text) { |
|
| 118 | - $widget->addOption($key, $text); |
|
| 119 | - } |
|
| 120 | - } else if ($field instanceof ORM_IntField) { |
|
| 121 | - $widget = $W->LineEdit()->setSize(9); |
|
| 122 | - } else if ($field instanceof ORM_TextField) { |
|
| 123 | - $widget = $widget = $W->LineEdit()->setSize(15); |
|
| 124 | - } else if ($field instanceof ORM_RecordSet) { |
|
| 125 | - $widget = app_genericSetFilterForm($field); |
|
| 126 | - $widget->addClass('sub-form'); |
|
| 127 | - } else { |
|
| 128 | - $widget = null; |
|
| 129 | - } |
|
| 130 | - if (isset($widget)) { |
|
| 131 | - $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
| 132 | - } |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - return $layout; |
|
| 92 | + $O = bab_functionality::get('LibOrm'); |
|
| 93 | + $O->init(); |
|
| 94 | + $W = bab_Widgets(); |
|
| 95 | + $layout = $W->FlowLayout(); |
|
| 96 | + $layout->setVerticalSpacing(1, 'em')->setHorizontalSpacing(1, 'em'); |
|
| 97 | + |
|
| 98 | + |
|
| 99 | + $fields = $set->getFields(); |
|
| 100 | + |
|
| 101 | + foreach ($fields as $field) { |
|
| 102 | + $description = $field->getDescription(); |
|
| 103 | + if (empty($description)) { |
|
| 104 | + $description = $field->getName(); |
|
| 105 | + } |
|
| 106 | + $fieldLabel = $W->Label($description . ':'); |
|
| 107 | + |
|
| 108 | + if ($field instanceof ORM_DateField) { |
|
| 109 | + $widget = $W->PeriodPicker(); |
|
| 110 | + } else if ($field instanceof ORM_TimeField) { |
|
| 111 | + $widget = $W->TimePicker(); |
|
| 112 | + } else if ($field instanceof ORM_StringField) { |
|
| 113 | + $widget = $W->LineEdit()->setSize(min(array(15, $field->getMaxLength()))); |
|
| 114 | + } else if ($field instanceof ORM_EnumField) { |
|
| 115 | + $widget = $W->Select(); |
|
| 116 | + $widget->addOption('', ''); |
|
| 117 | + foreach ($field->getValues() as $key => $text) { |
|
| 118 | + $widget->addOption($key, $text); |
|
| 119 | + } |
|
| 120 | + } else if ($field instanceof ORM_IntField) { |
|
| 121 | + $widget = $W->LineEdit()->setSize(9); |
|
| 122 | + } else if ($field instanceof ORM_TextField) { |
|
| 123 | + $widget = $widget = $W->LineEdit()->setSize(15); |
|
| 124 | + } else if ($field instanceof ORM_RecordSet) { |
|
| 125 | + $widget = app_genericSetFilterForm($field); |
|
| 126 | + $widget->addClass('sub-form'); |
|
| 127 | + } else { |
|
| 128 | + $widget = null; |
|
| 129 | + } |
|
| 130 | + if (isset($widget)) { |
|
| 131 | + $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
| 132 | + } |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + return $layout; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
@@ -145,47 +145,47 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | function app_LabelledWidget($labelText, Widget_Displayable_Interface $widget) |
| 147 | 147 | { |
| 148 | - $W = bab_Widgets(); |
|
| 149 | - |
|
| 150 | - $label = $W->Label($labelText); |
|
| 151 | - if ($widget instanceof Widget_InputWidget) { |
|
| 152 | - $label->setAssociatedWidget($widget); |
|
| 153 | - } |
|
| 154 | - |
|
| 155 | - if ($widget instanceof Widget_CheckBox) { |
|
| 156 | - $layout = $W->HBoxItems( |
|
| 157 | - $widget->setSizePolicy(Widget_SizePolicy::MINIMUM), |
|
| 158 | - $label |
|
| 159 | - )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
| 160 | - } else { |
|
| 161 | - $layout = $W->VBoxItems( |
|
| 162 | - $label, |
|
| 163 | - $widget |
|
| 164 | - )->setVerticalSpacing(0.5, 'em'); |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - return $layout; |
|
| 148 | + $W = bab_Widgets(); |
|
| 149 | + |
|
| 150 | + $label = $W->Label($labelText); |
|
| 151 | + if ($widget instanceof Widget_InputWidget) { |
|
| 152 | + $label->setAssociatedWidget($widget); |
|
| 153 | + } |
|
| 154 | + |
|
| 155 | + if ($widget instanceof Widget_CheckBox) { |
|
| 156 | + $layout = $W->HBoxItems( |
|
| 157 | + $widget->setSizePolicy(Widget_SizePolicy::MINIMUM), |
|
| 158 | + $label |
|
| 159 | + )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
| 160 | + } else { |
|
| 161 | + $layout = $W->VBoxItems( |
|
| 162 | + $label, |
|
| 163 | + $widget |
|
| 164 | + )->setVerticalSpacing(0.5, 'em'); |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + return $layout; |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | function app_LabelledCheckbox($labelText, $checkboxName, $options = null) |
| 173 | 173 | { |
| 174 | - $W = bab_Widgets(); |
|
| 174 | + $W = bab_Widgets(); |
|
| 175 | 175 | |
| 176 | - $label = $W->Label($labelText)->colon(false); |
|
| 177 | - $checkbox = $W->Checkbox()->setName($checkboxName); |
|
| 178 | - $label->setAssociatedWidget($checkbox); |
|
| 179 | - if (isset($options)) { |
|
| 180 | - $label->setSizePolicy(Widget_SizePolicy::FIXED)->setCanvasOptions($options); |
|
| 181 | - } |
|
| 176 | + $label = $W->Label($labelText)->colon(false); |
|
| 177 | + $checkbox = $W->Checkbox()->setName($checkboxName); |
|
| 178 | + $label->setAssociatedWidget($checkbox); |
|
| 179 | + if (isset($options)) { |
|
| 180 | + $label->setSizePolicy(Widget_SizePolicy::FIXED)->setCanvasOptions($options); |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | - $layout = $W->HBoxItems( |
|
| 184 | - $checkbox->setSizePolicy(Widget_SizePolicy::MINIMUM), |
|
| 185 | - $label |
|
| 186 | - )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
| 183 | + $layout = $W->HBoxItems( |
|
| 184 | + $checkbox->setSizePolicy(Widget_SizePolicy::MINIMUM), |
|
| 185 | + $label |
|
| 186 | + )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
| 187 | 187 | |
| 188 | - return $layout; |
|
| 188 | + return $layout; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
@@ -193,42 +193,42 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | function app_LabelledOrmSelect(ORM_MysqlIterator $iterator, $fieldName, $selectName, $label, $hidden = false, $groupFieldName = null) |
| 195 | 195 | { |
| 196 | - $W = bab_Widgets(); |
|
| 197 | - |
|
| 198 | - if (isset($groupFieldName)) { |
|
| 199 | - $groupPathElements = explode('/', $groupFieldName); |
|
| 200 | - } |
|
| 201 | - |
|
| 202 | - $select = $W->Select()->setName($selectName); |
|
| 203 | - |
|
| 204 | - $select->addOption('', ''); |
|
| 205 | - |
|
| 206 | - $nbOptions = 0; |
|
| 207 | - foreach ($iterator as $record) { |
|
| 208 | - if (isset($record->code)) { |
|
| 209 | - $optionText = $record->code . ' - ' . $record->$fieldName; |
|
| 210 | - } else { |
|
| 211 | - $optionText = $record->$fieldName; |
|
| 212 | - } |
|
| 213 | - if (isset($groupFieldName)) { |
|
| 214 | - $group = $record; |
|
| 215 | - foreach ($groupPathElements as $groupPathElement) { |
|
| 216 | - $group = $group->$groupPathElement; |
|
| 217 | - } |
|
| 218 | - $select->addOption($record->id, $optionText, $group); |
|
| 219 | - } else { |
|
| 220 | - $select->addOption($record->id, $optionText); |
|
| 221 | - } |
|
| 222 | - $nbOptions++; |
|
| 223 | - $lastId = $record->id; |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - if ($nbOptions == 1) { |
|
| 227 | - $select->setValue($lastId); |
|
| 228 | - } |
|
| 229 | - |
|
| 230 | - |
|
| 231 | - return app_LabelledWidget($label, $select); |
|
| 196 | + $W = bab_Widgets(); |
|
| 197 | + |
|
| 198 | + if (isset($groupFieldName)) { |
|
| 199 | + $groupPathElements = explode('/', $groupFieldName); |
|
| 200 | + } |
|
| 201 | + |
|
| 202 | + $select = $W->Select()->setName($selectName); |
|
| 203 | + |
|
| 204 | + $select->addOption('', ''); |
|
| 205 | + |
|
| 206 | + $nbOptions = 0; |
|
| 207 | + foreach ($iterator as $record) { |
|
| 208 | + if (isset($record->code)) { |
|
| 209 | + $optionText = $record->code . ' - ' . $record->$fieldName; |
|
| 210 | + } else { |
|
| 211 | + $optionText = $record->$fieldName; |
|
| 212 | + } |
|
| 213 | + if (isset($groupFieldName)) { |
|
| 214 | + $group = $record; |
|
| 215 | + foreach ($groupPathElements as $groupPathElement) { |
|
| 216 | + $group = $group->$groupPathElement; |
|
| 217 | + } |
|
| 218 | + $select->addOption($record->id, $optionText, $group); |
|
| 219 | + } else { |
|
| 220 | + $select->addOption($record->id, $optionText); |
|
| 221 | + } |
|
| 222 | + $nbOptions++; |
|
| 223 | + $lastId = $record->id; |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + if ($nbOptions == 1) { |
|
| 227 | + $select->setValue($lastId); |
|
| 228 | + } |
|
| 229 | + |
|
| 230 | + |
|
| 231 | + return app_LabelledWidget($label, $select); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | |
@@ -236,106 +236,106 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | function app_OrmWidget(ORM_Field $field) |
| 238 | 238 | { |
| 239 | - $W = bab_Widgets(); |
|
| 239 | + $W = bab_Widgets(); |
|
| 240 | 240 | |
| 241 | 241 | |
| 242 | - if ($field instanceof ORM_DateField) { |
|
| 243 | - $widget = $W->DatePicker(); |
|
| 244 | - } else if ($field instanceof ORM_TimeField) { |
|
| 245 | - $widget = $W->TimeEdit(); //->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
| 246 | - } else if ($field instanceof ORM_EnumField) { |
|
| 247 | - $widget = $W->Select(); |
|
| 242 | + if ($field instanceof ORM_DateField) { |
|
| 243 | + $widget = $W->DatePicker(); |
|
| 244 | + } else if ($field instanceof ORM_TimeField) { |
|
| 245 | + $widget = $W->TimeEdit(); //->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
| 246 | + } else if ($field instanceof ORM_EnumField) { |
|
| 247 | + $widget = $W->Select(); |
|
| 248 | 248 | //// $widget = $W->MultiSelect()->setSingleSelect(); |
| 249 | - $widget->addOption('', ''); |
|
| 250 | - $values = $field->getValues(); |
|
| 251 | - foreach ($values as $key => $value) { |
|
| 252 | - $widget->addOption($key, $value); |
|
| 253 | - } |
|
| 254 | - } else if ($field instanceof ORM_SetField) { |
|
| 255 | - $widget = $W->MultiSelect()->setSelectedList(2); |
|
| 256 | - $values = $field->getValues(); |
|
| 257 | - foreach ($values as $key => $value) { |
|
| 258 | - $widget->addOption($key, $value); |
|
| 259 | - } |
|
| 260 | - } else if ($field instanceof ORM_UserField) { |
|
| 261 | - $widget = $W->SuggestUser() |
|
| 262 | - ->setMinChars(0) |
|
| 263 | - ->setSizePolicy(Func_Icons::ICON_LEFT_16); |
|
| 264 | - } else if ($field instanceof ORM_CurrencyField) { |
|
| 265 | - $widget = $W->LineEdit()->setSize(6)->addClass('widget-input-currency'); |
|
| 266 | - } else if ($field instanceof ORM_BoolField) { |
|
| 267 | - $widget = $W->CheckBox()->setCheckedValue('1'); |
|
| 268 | - } else if ($field instanceof ORM_IntField) { |
|
| 269 | - $widget = $W->LineEdit() |
|
| 270 | - ->setSize(6)->addClass('widget-input-numeric'); |
|
| 271 | - } else if ($field instanceof ORM_EmailField) { |
|
| 272 | - $widget = $W->EmailLineEdit() |
|
| 273 | - ->setMaxSize($field->getMaxLength()); |
|
| 274 | - } else if ($field instanceof ORM_FileField) { |
|
| 275 | - $widget = $W->FilePicker(); |
|
| 276 | - } else if ($field instanceof ORM_StringField) { |
|
| 277 | - $widget = $W->LineEdit() |
|
| 278 | - ->setMaxSize($field->getMaxLength()); |
|
| 279 | - } else if ($field instanceof ORM_TextField) { |
|
| 280 | - $widget = $W->TextEdit() |
|
| 281 | - ->addClass('widget-autoresize'); |
|
| 282 | - } else if ($field instanceof ORM_PkField) { |
|
| 283 | - $widget = $W->Hidden(); |
|
| 284 | - } else if ($field instanceof ORM_FkField) { |
|
| 285 | - $widget = $W->Select(); |
|
| 286 | - $fieldName = $field->getName(); |
|
| 287 | - $parentSet = clone $field->getParentSet(); |
|
| 288 | - $parentSet->join($fieldName); |
|
| 289 | - $set = $parentSet->$fieldName; |
|
| 290 | - $records = $set->select(); |
|
| 291 | - $records->orderAsc($set->name); |
|
| 292 | - $pkName = $set->getPrimaryKey(); |
|
| 293 | - $widget->addOption('', ''); |
|
| 294 | - foreach ($records as $record) { |
|
| 295 | - $widget->addOption($record->$pkName, $record->name); |
|
| 296 | - } |
|
| 297 | - } else if ($field instanceof ORM_RecordSet) { |
|
| 298 | - $widget = $W->Select(); |
|
| 249 | + $widget->addOption('', ''); |
|
| 250 | + $values = $field->getValues(); |
|
| 251 | + foreach ($values as $key => $value) { |
|
| 252 | + $widget->addOption($key, $value); |
|
| 253 | + } |
|
| 254 | + } else if ($field instanceof ORM_SetField) { |
|
| 255 | + $widget = $W->MultiSelect()->setSelectedList(2); |
|
| 256 | + $values = $field->getValues(); |
|
| 257 | + foreach ($values as $key => $value) { |
|
| 258 | + $widget->addOption($key, $value); |
|
| 259 | + } |
|
| 260 | + } else if ($field instanceof ORM_UserField) { |
|
| 261 | + $widget = $W->SuggestUser() |
|
| 262 | + ->setMinChars(0) |
|
| 263 | + ->setSizePolicy(Func_Icons::ICON_LEFT_16); |
|
| 264 | + } else if ($field instanceof ORM_CurrencyField) { |
|
| 265 | + $widget = $W->LineEdit()->setSize(6)->addClass('widget-input-currency'); |
|
| 266 | + } else if ($field instanceof ORM_BoolField) { |
|
| 267 | + $widget = $W->CheckBox()->setCheckedValue('1'); |
|
| 268 | + } else if ($field instanceof ORM_IntField) { |
|
| 269 | + $widget = $W->LineEdit() |
|
| 270 | + ->setSize(6)->addClass('widget-input-numeric'); |
|
| 271 | + } else if ($field instanceof ORM_EmailField) { |
|
| 272 | + $widget = $W->EmailLineEdit() |
|
| 273 | + ->setMaxSize($field->getMaxLength()); |
|
| 274 | + } else if ($field instanceof ORM_FileField) { |
|
| 275 | + $widget = $W->FilePicker(); |
|
| 276 | + } else if ($field instanceof ORM_StringField) { |
|
| 277 | + $widget = $W->LineEdit() |
|
| 278 | + ->setMaxSize($field->getMaxLength()); |
|
| 279 | + } else if ($field instanceof ORM_TextField) { |
|
| 280 | + $widget = $W->TextEdit() |
|
| 281 | + ->addClass('widget-autoresize'); |
|
| 282 | + } else if ($field instanceof ORM_PkField) { |
|
| 283 | + $widget = $W->Hidden(); |
|
| 284 | + } else if ($field instanceof ORM_FkField) { |
|
| 285 | + $widget = $W->Select(); |
|
| 286 | + $fieldName = $field->getName(); |
|
| 287 | + $parentSet = clone $field->getParentSet(); |
|
| 288 | + $parentSet->join($fieldName); |
|
| 289 | + $set = $parentSet->$fieldName; |
|
| 290 | + $records = $set->select(); |
|
| 291 | + $records->orderAsc($set->name); |
|
| 292 | + $pkName = $set->getPrimaryKey(); |
|
| 293 | + $widget->addOption('', ''); |
|
| 294 | + foreach ($records as $record) { |
|
| 295 | + $widget->addOption($record->$pkName, $record->name); |
|
| 296 | + } |
|
| 297 | + } else if ($field instanceof ORM_RecordSet) { |
|
| 298 | + $widget = $W->Select(); |
|
| 299 | 299 | //// $widget = $W->MultiSelect()->setSingleSelect(); |
| 300 | 300 | // $fieldName = $field->getName(); |
| 301 | 301 | // $parentSet = $field->getParentSet(); |
| 302 | 302 | // $parentSet->join($fieldName); |
| 303 | 303 | // $set = $parentSet->$fieldName; |
| 304 | - $records = $field->select(); |
|
| 305 | - $records->orderAsc($field->name); |
|
| 306 | - $pkName = $field->getPrimaryKey(); |
|
| 307 | - $widget->addOption('', ''); |
|
| 308 | - foreach ($records as $record) { |
|
| 309 | - $widget->addOption($record->$pkName, $record->name); |
|
| 310 | - } |
|
| 311 | - } else { |
|
| 312 | - $widget = $W->LineEdit(); |
|
| 313 | - } |
|
| 314 | - |
|
| 315 | - $widget->setName($field->getName()); |
|
| 316 | - |
|
| 317 | - return $widget; |
|
| 304 | + $records = $field->select(); |
|
| 305 | + $records->orderAsc($field->name); |
|
| 306 | + $pkName = $field->getPrimaryKey(); |
|
| 307 | + $widget->addOption('', ''); |
|
| 308 | + foreach ($records as $record) { |
|
| 309 | + $widget->addOption($record->$pkName, $record->name); |
|
| 310 | + } |
|
| 311 | + } else { |
|
| 312 | + $widget = $W->LineEdit(); |
|
| 313 | + } |
|
| 314 | + |
|
| 315 | + $widget->setName($field->getName()); |
|
| 316 | + |
|
| 317 | + return $widget; |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | |
| 321 | 321 | |
| 322 | 322 | function app_LabelledOrmWidget(ORM_Field $field, $label = null, $hidden = false) |
| 323 | 323 | { |
| 324 | - $W = bab_Widgets(); |
|
| 324 | + $W = bab_Widgets(); |
|
| 325 | 325 | |
| 326 | - if ($hidden) { |
|
| 327 | - $widget = $W->Hidden(); |
|
| 328 | - $widget->setName($field->getName()); |
|
| 329 | - return $widget; |
|
| 330 | - } |
|
| 326 | + if ($hidden) { |
|
| 327 | + $widget = $W->Hidden(); |
|
| 328 | + $widget->setName($field->getName()); |
|
| 329 | + return $widget; |
|
| 330 | + } |
|
| 331 | 331 | |
| 332 | - if (is_null($label)) { |
|
| 333 | - $label = $field->getDescription(); |
|
| 334 | - } |
|
| 332 | + if (is_null($label)) { |
|
| 333 | + $label = $field->getDescription(); |
|
| 334 | + } |
|
| 335 | 335 | |
| 336 | - $widget = app_OrmWidget($field); |
|
| 336 | + $widget = app_OrmWidget($field); |
|
| 337 | 337 | |
| 338 | - return app_LabelledWidget($label, $widget); |
|
| 338 | + return app_LabelledWidget($label, $widget); |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |
@@ -351,16 +351,16 @@ discard block |
||
| 351 | 351 | */ |
| 352 | 352 | function app_dateTime(ORM_Field $field, $value) { |
| 353 | 353 | |
| 354 | - $W = bab_functionality::get('Widgets'); |
|
| 355 | - $name = $field->getName(); |
|
| 356 | - $label = $W->Label($field->getDescription()); |
|
| 354 | + $W = bab_functionality::get('Widgets'); |
|
| 355 | + $name = $field->getName(); |
|
| 356 | + $label = $W->Label($field->getDescription()); |
|
| 357 | 357 | |
| 358 | - $frame = app_dateTimeField($name, $label, $value); |
|
| 358 | + $frame = app_dateTimeField($name, $label, $value); |
|
| 359 | 359 | |
| 360 | - return $W->VBoxItems( |
|
| 361 | - $label, |
|
| 362 | - $frame |
|
| 363 | - ); |
|
| 360 | + return $W->VBoxItems( |
|
| 361 | + $label, |
|
| 362 | + $frame |
|
| 363 | + ); |
|
| 364 | 364 | |
| 365 | 365 | } |
| 366 | 366 | |
@@ -374,24 +374,24 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | function app_dateTimeField($fieldName, Widget_Label $label, $value = null) |
| 376 | 376 | { |
| 377 | - $W = bab_functionality::get('Widgets'); |
|
| 377 | + $W = bab_functionality::get('Widgets'); |
|
| 378 | 378 | |
| 379 | - $datepart = $W->DatePicker()->setAssociatedLabel($label)->setName('date'); |
|
| 380 | - $timepart = $W->TimePicker()->setName('time'); |
|
| 379 | + $datepart = $W->DatePicker()->setAssociatedLabel($label)->setName('date'); |
|
| 380 | + $timepart = $W->TimePicker()->setName('time'); |
|
| 381 | 381 | |
| 382 | - if (isset($value)) { |
|
| 382 | + if (isset($value)) { |
|
| 383 | 383 | |
| 384 | - $value = explode(' ', $value); |
|
| 384 | + $value = explode(' ', $value); |
|
| 385 | 385 | |
| 386 | - $datepart->setValue($value[0]); |
|
| 387 | - $timepart->setValue($value[1]); |
|
| 388 | - } |
|
| 386 | + $datepart->setValue($value[0]); |
|
| 387 | + $timepart->setValue($value[1]); |
|
| 388 | + } |
|
| 389 | 389 | |
| 390 | - $datetime = $W->Frame(null, $W->HBoxLayout())->setName($fieldName) |
|
| 391 | - ->addItem($datepart) |
|
| 392 | - ->addItem($timepart); |
|
| 390 | + $datetime = $W->Frame(null, $W->HBoxLayout())->setName($fieldName) |
|
| 391 | + ->addItem($datepart) |
|
| 392 | + ->addItem($timepart); |
|
| 393 | 393 | |
| 394 | - return $datetime; |
|
| 394 | + return $datetime; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public static function register() |
| 127 | 127 | { |
| 128 | - require_once $GLOBALS['babInstallPath'].'utilit/functionalityincl.php'; |
|
| 128 | + require_once $GLOBALS['babInstallPath'] . 'utilit/functionalityincl.php'; |
|
| 129 | 129 | $functionalities = new bab_functionalities(); |
| 130 | 130 | |
| 131 | 131 | $addon = bab_getAddonInfosInstance('libapp'); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | return null; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - require_once $GLOBALS['babInstallPath'].'utilit/devtools.php'; |
|
| 152 | + require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php'; |
|
| 153 | 153 | $mysqlbackend = new ORM_MySqlBackend($GLOBALS['babDB']); |
| 154 | 154 | $sql = 'SET FOREIGN_KEY_CHECKS=0; |
| 155 | 155 | '; |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - require_once $GLOBALS['babInstallPath'].'utilit/devtools.php'; |
|
| 190 | + require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php'; |
|
| 191 | 191 | $synchronize = new bab_synchronizeSql(); |
| 192 | 192 | |
| 193 | 193 | $synchronize->fromSqlString($sql); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | return null; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - require_once $GLOBALS['babInstallPath'].'utilit/devtools.php'; |
|
| 206 | + require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php'; |
|
| 207 | 207 | $mysqlbackend = new ORM_MySqlBackend($GLOBALS['babDB']); |
| 208 | 208 | $sql = ''; |
| 209 | 209 | |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | public function Controller() |
| 695 | 695 | { |
| 696 | 696 | $this->includeController(); |
| 697 | - return bab_getInstance($this->classPrefix.'Controller')->setApp($this); |
|
| 697 | + return bab_getInstance($this->classPrefix . 'Controller')->setApp($this); |
|
| 698 | 698 | } |
| 699 | 699 | |
| 700 | 700 | |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | public function Ui() |
| 735 | 735 | { |
| 736 | 736 | $this->includeUi(); |
| 737 | - return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this); |
|
| 737 | + return bab_getInstance($this->classPrefix . 'Ui'); //->setApp($this); |
|
| 738 | 738 | } |
| 739 | 739 | |
| 740 | 740 | |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | */ |
| 757 | 757 | public function getUploadPath() |
| 758 | 758 | { |
| 759 | - require_once $GLOBALS['babInstallPath'].'utilit/path.class.php'; |
|
| 759 | + require_once $GLOBALS['babInstallPath'] . 'utilit/path.class.php'; |
|
| 760 | 760 | return new bab_Path(bab_getAddonInfosInstance($this->getAddonName())->getUploadPath()); |
| 761 | 761 | } |
| 762 | 762 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $setName = $fkField->getForeignSetName(); |
| 99 | 99 | |
| 100 | 100 | if (!$setName || 'Set' === $setName) { |
| 101 | - throw new Exception('The set name is missing on foreign key field '.$fkFieldName); |
|
| 101 | + throw new Exception('The set name is missing on foreign key field ' . $fkFieldName); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | list($prefix, $appSetName) = $this->extractSetPrefixAndName($setName); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | { |
| 176 | 176 | $App = $this->App(); |
| 177 | 177 | |
| 178 | - $customFieldSet= $App->CustomFieldSet(); |
|
| 178 | + $customFieldSet = $App->CustomFieldSet(); |
|
| 179 | 179 | $object = mb_substr(get_class($this), mb_strlen($App->classPrefix), -mb_strlen('Set')); |
| 180 | 180 | |
| 181 | 181 | $customFields = $customFieldSet->select($customFieldSet->object->is($object)); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function isReadable() |
| 264 | 264 | { |
| 265 | - bab_debug('The query in '.get_class($this).' use the default isReadable() method: none()'); |
|
| 265 | + bab_debug('The query in ' . get_class($this) . ' use the default isReadable() method: none()'); |
|
| 266 | 266 | return $this->none(); |
| 267 | 267 | } |
| 268 | 268 | |
@@ -650,13 +650,13 @@ discard block |
||
| 650 | 650 | */ |
| 651 | 651 | protected function importDate($name, $value) |
| 652 | 652 | { |
| 653 | - if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/',$value)) { |
|
| 653 | + if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $value)) { |
|
| 654 | 654 | return $this->importProperty($name, $value); |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | // try in DD/MM/YYYY format |
| 658 | 658 | |
| 659 | - if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/',$value, $matches)) { |
|
| 659 | + if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/', $value, $matches)) { |
|
| 660 | 660 | |
| 661 | 661 | $value = sprintf('%04d-%02d-%02d', (int) $matches['year'], (int) $matches['month'], (int) $matches['day']); |
| 662 | 662 | |
@@ -337,7 +337,7 @@ |
||
| 337 | 337 | if (empty($rawField)) { |
| 338 | 338 | continue; |
| 339 | 339 | } |
| 340 | - list($fieldName, ) = explode(':', $rawField); |
|
| 340 | + list($fieldName,) = explode(':', $rawField); |
|
| 341 | 341 | |
| 342 | 342 | if ($removedFieldName == $fieldName) { |
| 343 | 343 | continue; |
@@ -1642,7 +1642,7 @@ |
||
| 1642 | 1642 | $W->SubmitButton() |
| 1643 | 1643 | ->setAjaxAction($confirmedAction) |
| 1644 | 1644 | ->setLabel($App->translate('Delete')) |
| 1645 | - ); |
|
| 1645 | + ); |
|
| 1646 | 1646 | $form->addButton($W->SubmitButton()->setLabel($App->translate('Cancel'))->addClass('widget-close-dialog')); |
| 1647 | 1647 | $page->addItem($form); |
| 1648 | 1648 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | if ($showLabel) { |
| 104 | 104 | $text = $actions->getTitle(); |
| 105 | 105 | } |
| 106 | - $html = '<li><a class="icon ' . $actions->getIcon() . '"href="' . $actions->url() . '">' . $text . '</a></li>'; |
|
| 106 | + $html = '<li><a class="icon ' . $actions->getIcon() . '"href="' . $actions->url() . '">' . $text . '</a></li>'; |
|
| 107 | 107 | } elseif (is_array($actions)) { |
| 108 | 108 | if (isset($actions['items'])) { |
| 109 | 109 | $items = $actions['items']; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $recordClassname = $this->getRecordClassName(); |
| 144 | 144 | |
| 145 | - $viewClassname = $recordClassname . 'TableView'; |
|
| 145 | + $viewClassname = $recordClassname . 'TableView'; |
|
| 146 | 146 | if (method_exists($Ui, $viewClassname)) { |
| 147 | 147 | $types['table'] = array( |
| 148 | 148 | 'classname' => $viewClassname, |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | ); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - $viewClassname = $recordClassname . 'CardsView'; |
|
| 154 | + $viewClassname = $recordClassname . 'CardsView'; |
|
| 155 | 155 | if (method_exists($Ui, $viewClassname)) { |
| 156 | 156 | $types['cards'] = array( |
| 157 | 157 | 'classname' => $viewClassname, |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | ); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $viewClassname = $recordClassname . 'MapView'; |
|
| 163 | + $viewClassname = $recordClassname . 'MapView'; |
|
| 164 | 164 | if (method_exists($Ui, $viewClassname)) { |
| 165 | 165 | $types['map'] = array( |
| 166 | 166 | 'classname' => $viewClassname, |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | bab_Sort::asort($availableFields, 'description', bab_Sort::CASE_INSENSITIVE); |
| 257 | 257 | |
| 258 | 258 | foreach ($availableFields as $field) { |
| 259 | - $fieldName = $field['name']; |
|
| 259 | + $fieldName = $field['name']; |
|
| 260 | 260 | $fieldDescription = $field['description']; |
| 261 | 261 | |
| 262 | 262 | $used = isset($allViewFieldNames[$fieldName]); |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | $nbCol = 0; |
| 451 | 451 | foreach ($customSections as $customSection) { |
| 452 | 452 | |
| 453 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 453 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
| 454 | 454 | |
| 455 | 455 | // if ($currentColumn + $nbCol > 12) { |
| 456 | 456 | // $sectionsSection->addItem($row); |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | $fieldItem = $W->FlowItems( |
| 510 | - $W->Label($fieldDescription)->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-80pc' ), |
|
| 510 | + $W->Label($fieldDescription)->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-80pc'), |
|
| 511 | 511 | $W->FlowItems( |
| 512 | 512 | $W->Hidden()->setName($customSection->id . '.' . $fieldId)->setValue($field['name']), |
| 513 | 513 | $W->Link('', $this->proxy()->editDisplayField($customSection->id, $field['name'])) |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | $W->Link('', $this->proxy()->removeDisplayField($customSection->id, $field['name'])) |
| 517 | 517 | ->addClass('icon', Func_Icons::ACTIONS_LIST_REMOVE) |
| 518 | 518 | ->setAjaxAction() |
| 519 | - )->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-20pc widget-align-right widget-actions' ) |
|
| 519 | + )->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-20pc widget-align-right widget-actions') |
|
| 520 | 520 | )->setSizePolicy('widget-list-element widget-actions-target'); |
| 521 | 521 | |
| 522 | 522 | $sectionBox->addItem($fieldItem); |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | header('Content-type: application/json'); |
| 592 | - header('Content-Disposition: attachment; filename="' . $objectName . '.' . ($view === '' ? 'default' : $view) . '.json"'."\n"); |
|
| 592 | + header('Content-Disposition: attachment; filename="' . $objectName . '.' . ($view === '' ? 'default' : $view) . '.json"' . "\n"); |
|
| 593 | 593 | |
| 594 | 594 | $json = bab_json_encode($sectionsValues); |
| 595 | 595 | $json = bab_convertStringFromDatabase($json, bab_charset::UTF_8); |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | $recordSet = $this->getEditRecordSet(); |
| 834 | 834 | |
| 835 | 835 | $recordClassname = $this->getRecordClassName(); |
| 836 | - $editorClassname = $recordClassname . 'SectionEditor'; |
|
| 836 | + $editorClassname = $recordClassname . 'SectionEditor'; |
|
| 837 | 837 | /* @var $editor app_RecordEditor */ |
| 838 | 838 | $editor = $Ui->$editorClassname(); |
| 839 | 839 | if (!isset($itemId)) { |
@@ -914,16 +914,16 @@ discard block |
||
| 914 | 914 | |
| 915 | 915 | switch ($type) { |
| 916 | 916 | case 'cards': |
| 917 | - $tableviewClassname = $recordClassname . 'CardsView'; |
|
| 917 | + $tableviewClassname = $recordClassname . 'CardsView'; |
|
| 918 | 918 | break; |
| 919 | 919 | |
| 920 | 920 | case 'map': |
| 921 | - $tableviewClassname = $recordClassname . 'MapView'; |
|
| 921 | + $tableviewClassname = $recordClassname . 'MapView'; |
|
| 922 | 922 | break; |
| 923 | 923 | |
| 924 | 924 | case 'table': |
| 925 | 925 | default: |
| 926 | - $tableviewClassname = $recordClassname . 'TableView'; |
|
| 926 | + $tableviewClassname = $recordClassname . 'TableView'; |
|
| 927 | 927 | break; |
| 928 | 928 | } |
| 929 | 929 | |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | $Ui = $App->Ui(); |
| 990 | 990 | |
| 991 | 991 | $recordClassname = $this->getRecordClassName(); |
| 992 | - $editorClassname = $recordClassname . 'Editor'; |
|
| 992 | + $editorClassname = $recordClassname . 'Editor'; |
|
| 993 | 993 | $editor = $Ui->$editorClassname(); |
| 994 | 994 | if (!isset($itemId)) { |
| 995 | 995 | $itemId = $this->getClass() . '.' . __FUNCTION__; |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | $W->Link( |
| 1038 | 1038 | '', |
| 1039 | 1039 | $proxy->setFilteredViewType($tableView->getId(), $viewTypeId) |
| 1040 | - )->addClass('icon', $viewType['icon'] . ($filteredViewType=== $viewTypeId ? ' active' : '')) |
|
| 1040 | + )->addClass('icon', $viewType['icon'] . ($filteredViewType === $viewTypeId ? ' active' : '')) |
|
| 1041 | 1041 | // ->setSizePolicy('btn btn-xs btn-default ' . ($filteredViewType === $viewTypeId ? 'active' : '')) |
| 1042 | 1042 | ->setTitle($viewType['label']) |
| 1043 | 1043 | ->setAjaxAction() |
@@ -1307,7 +1307,7 @@ discard block |
||
| 1307 | 1307 | $Ui = $App->Ui(); |
| 1308 | 1308 | |
| 1309 | 1309 | $recordClassname = $this->getRecordClassName(); |
| 1310 | - $fullFrameClassname = $recordClassname . 'FullFrame'; |
|
| 1310 | + $fullFrameClassname = $recordClassname . 'FullFrame'; |
|
| 1311 | 1311 | $fullFrame = $Ui->$fullFrameClassname($record, $view); |
| 1312 | 1312 | |
| 1313 | 1313 | |