diff --git a/extension/Documentation/Manual.rst b/extension/Documentation/Manual.rst index fb5fbf191fb327f5eac3fbbde7d72a15a621108b..71f09e73371b9fc688aa2eb8b2a8f437e488f730 100644 --- a/extension/Documentation/Manual.rst +++ b/extension/Documentation/Manual.rst @@ -203,6 +203,14 @@ config.qfq.ini +-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+ | FORM_DATA_ERROR |FORM_DATA_ERROR=generic error | Customizable error message used in validator.js. 'no specific' given | +-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+ +| FORM_BS_COLUMNS | FORM_BS_COLUMNS=12 | The whole form will be wrapped in 'col-md-??'. Default is 12 for 100% | ++-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+ +| FORM_BS_LABEL_COLUMNS | FORM_BS_LABEL_COLUMNS = 3 | Default number of BS columns for the 'label'-column | ++-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+ +| FORM_BS_INPUT_COLUMNS | FORM_BS_INPUT_COLUMNS = 6 | Default number of BS columns for the 'input'-column | ++-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+ +| FORM_BS_NOTE_COLUMNS | FORM_BS_NOTE_COLUMNS = 3 | Default number of BS columns for the 'note'-column | ++-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+ | FORM_BUTTON_ON_CHANGE_CLASS | FORM_BUTTON_ON_CHANGE_CLASS=alert-info btn-info | Color for save button after modification | +-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+ | BASE_URL_PRINT | BASE_URL_PRINT=http://example.com | URL where wkhtmltopdf will fetch the HTML (no parameter, those comes later)| @@ -229,10 +237,12 @@ Example: *typo3conf/config.qfq.ini* ;CSS_CLASS_QFQ_FORM = CSS_CLASS_QFQ_FORM_PILL = qfq-color-grey-1 CSS_CLASS_QFQ_FORM_BODY = qfq-color-grey-2 + ;DATE_FORMAT= yyyy-mm-dd ;FORM_DATA_PATTERN_ERROR = ;FORM_DATA_REQUIRED_ERROR = ;FORM_DATA_MATCH_ERROR = ;FORM_DATA_ERROR = + ;FORM_BS_COLUMNS = 12 ;FORM_BS_LABEL_COLUMNS = 3 ;FORM_BS_INPUT_COLUMNS = 6 ;FORM_BS_NOTE_COLUMNS = 3 @@ -739,6 +749,8 @@ Store: *SYSTEM* - Y +-------------------------+--------------------------------------------------------------------------+ | data-error | defined in config.ini or form definition | +-------------------------+--------------------------------------------------------------------------+ + | bsColumns | defined in config.ini (FORM_BS_COLUMNS) or form definition | + +-------------------------+--------------------------------------------------------------------------+ | bsLabelColumns | defined in config.ini (FORM_BS_LABEL_COLUMNS) or form definition | +-------------------------+--------------------------------------------------------------------------+ | bsInputColumns | defined in config.ini (FORM_BS_INPUT_COLUMNS) or form definition | @@ -994,6 +1006,8 @@ parameter +--------------------------+--------+----------------------------------------------------------------------------------------------------------+ | Name | Type | Description | +==========================+========+==========================================================================================================+ +| bsColumns | int | Wrap the whole form in '<div class="col-md-??"> | ++--------------------------+--------+----------------------------------------------------------------------------------------------------------+ | maxVisiblePill | int | Show pills upto <maxVisiblePill> as button, all further in a drop-down menu. Eg.: maxVisiblePill=3 | +--------------------------+--------+----------------------------------------------------------------------------------------------------------+ | class | string | HTML div with given class, surrounding the whole form. Eg.: class=container-fluid | diff --git a/extension/qfq/qfq/Constants.php b/extension/qfq/qfq/Constants.php index 50f7616dc503d8fea3ece96116141b52e6936571..35c58047a022b626c82a3158b792fa4b79d4dd8f 100644 --- a/extension/qfq/qfq/Constants.php +++ b/extension/qfq/qfq/Constants.php @@ -38,6 +38,8 @@ const FORM_FORWARD_MODE_NO = 'no'; const FORM_FORWARD_MODE_AUTO = 'auto'; const FORM_FORWARD_MODE_PAGE = 'page'; +const F_BS_COLUMNS = 'bsColumns'; + const F_BS_LABEL_COLUMNS = 'bsLabelColumns'; const F_BS_INPUT_COLUMNS = 'bsInputColumns'; const F_BS_NOTE_COLUMNS = 'bsNoteColumns'; @@ -322,6 +324,8 @@ const SYSTEM_FORM_DATA_REQUIRED_ERROR = 'FORM_DATA_REQUIRED_ERROR'; const SYSTEM_FORM_DATA_MATCH_ERROR = 'FORM_DATA_MATCH_ERROR'; const SYSTEM_FORM_DATA_ERROR = 'FORM_DATA_ERROR'; +const SYSTEM_FORM_BS_COLUMNS = 'FORM_BS_COLUMNS'; + const SYSTEM_FORM_BS_LABEL_COLUMNS = 'FORM_BS_LABEL_COLUMNS'; const SYSTEM_FORM_BS_INPUT_COLUMNS = 'FORM_BS_INPUT_COLUMNS'; const SYSTEM_FORM_BS_NOTE_COLUMNS = 'FORM_BS_NOTE_COLUMNS'; diff --git a/extension/qfq/qfq/QuickFormQuery.php b/extension/qfq/qfq/QuickFormQuery.php index 5304b24eb2774bc98f77a0de27c93ac5240d06be..00fe920bb48bebe8027bcf97e4a81aa454e21e00 100644 --- a/extension/qfq/qfq/QuickFormQuery.php +++ b/extension/qfq/qfq/QuickFormQuery.php @@ -283,6 +283,14 @@ class QuickFormQuery { $formAction = new FormAction($this->formSpec, $this->db, $this->phpUnit); switch ($formMode) { case FORM_LOAD: + $formAction->elements($recordId, $this->feSpecAction, FE_TYPE_BEFORE_LOAD); + $data = $build->process($formMode); + $data = Support::wrapTag("<div class='" . 'col-md-' . $this->formSpec[F_BS_COLUMNS] . "'>", $data); + $data = Support::wrapTag("<div class='row'>", $data); + + $formAction->elements($recordId, $this->feSpecAction, FE_TYPE_AFTER_LOAD); + break; + case FORM_UPDATE: $formAction->elements($recordId, $this->feSpecAction, FE_TYPE_BEFORE_LOAD); @@ -529,7 +537,8 @@ class QuickFormQuery { */ private function syncSystemFormConfig(array $formSpec) { - $keys = [F_BS_LABEL_COLUMNS, + $keys = [F_BS_COLUMNS, + F_BS_LABEL_COLUMNS, F_BS_INPUT_COLUMNS, F_BS_NOTE_COLUMNS, F_FE_DATA_PATTERN_ERROR, diff --git a/extension/qfq/qfq/store/Config.php b/extension/qfq/qfq/store/Config.php index 92316a589377b8913907fc80b3de88b18a18e03d..e340223a899fdec82da8bd43fd08a534e72f0dfc 100644 --- a/extension/qfq/qfq/store/Config.php +++ b/extension/qfq/qfq/store/Config.php @@ -55,6 +55,7 @@ class Config { // oldname > newname $setting = [ + [SYSTEM_FORM_BS_COLUMNS, F_BS_COLUMNS], [SYSTEM_FORM_BS_LABEL_COLUMNS, F_BS_LABEL_COLUMNS], [SYSTEM_FORM_BS_INPUT_COLUMNS, F_BS_INPUT_COLUMNS], [SYSTEM_FORM_BS_NOTE_COLUMNS, F_BS_NOTE_COLUMNS], diff --git a/extension/qfq/qfq/store/Store.php b/extension/qfq/qfq/store/Store.php index c4bee36d3ad5a4cb9c01ee36ff4f464852be76dd..22c055792ba39530990d3ea4a4aaaf3af15937ee 100644 --- a/extension/qfq/qfq/store/Store.php +++ b/extension/qfq/qfq/store/Store.php @@ -190,6 +190,7 @@ class Store { // Defaults Support::setIfNotSet($config, SYSTEM_DATE_FORMAT, 'yyyy-mm-dd'); Support::setIfNotSet($config, SYSTEM_SHOW_DEBUG_INFO, 'auto'); + Support::setIfNotSet($config, F_BS_COLUMNS, '12'); Support::setIfNotSet($config, F_BS_LABEL_COLUMNS, '3'); Support::setIfNotSet($config, F_BS_INPUT_COLUMNS, '6'); Support::setIfNotSet($config, F_BS_NOTE_COLUMNS, '3');