Commit Graph

203 Commits

Author SHA1 Message Date
julienfastre 1de944f838 Merge branch 'master' into add_gitlab_ci
Conflicts:
	.gitignore
2015-12-24 15:00:00 +01:00
julienfastre 09a69765b9 adding test for customFieldRendering function 2015-12-23 23:46:44 +01:00
julienfastre 3e5a90c36c escaping argument 2015-12-23 23:46:15 +01:00
julienfastre 573697d8c7 improve function isEmptyValue + tests 2015-12-18 00:22:09 +01:00
julienfastre 24f9db6ae7 fix bug in changing custom field option
bug description :

> if you change the options of a custom field choice (i.e. from a
> multiple to a single, removing or adding allow_other), the data
> representation change and do not match with the expected
> representation of the form.

This commit fix this bug by switching the data representation to the
current options.
2015-12-17 23:50:24 +01:00
julienfastre 9867cca632 improve rendering of cfgroup index 2015-12-17 22:16:06 +01:00
julienfastre 60dc11caed translation in choices name 2015-12-17 22:12:50 +01:00
julienfastre cbc66dc0f0 allow choosing empty value in CFLongChoice 2015-12-17 22:07:28 +01:00
julienfastre 9c622bc852 improve cfgroup rendering to show title only if necessary
If the value `chill_custom_fields.show_empty_values_in_views` is false,
the title is shown only if a field has been filled "below" the title.
2015-12-17 07:46:06 +01:00
julienfastre 0a1898e9a7 take into account the different type of choices in empty value 2015-12-16 20:25:40 +01:00
julienfastre fe73a64e9d Add possibility to hide empty value in customfield group view rendering
A new parameter is defined :

```
chill_custom_fields:
    show_empty_values_in_views = true|false
```

A new method is added to CustomFieldInterface: `isEmptyValue`. To ease
the dev of new classes, an AbstractCustomField class is created, which
implements the most commons function (currently, only isEmptyValue).

A new Twig Filter is added: `chill_custom_field_is_empty`

The twig filter `chill_custom_fields_group_widget` has a new possibility
in array option : `show_empty`. Default to
chill_custom_fields.show_empty_values_in_view. May be forced by
true/false.
2015-12-15 11:11:36 +01:00
julienfastre 9ca2be78eb use localize translatable string function to render label widget 2015-12-15 10:06:05 +01:00
julienfastre faf4583383 Merge branch 'custom_field_long_choice' 2015-12-11 11:48:14 +01:00
julienfastre 09439f4e77 Merge branch 'required_fields' into 'master'
add a required field to custom fields type

ref Chill-project/Chill-CustomFields#17

Add a `required` column to the `customfield` table, add a `required` field in customfieldsGroup form.

If the customfield is required, the field is marked as required in the customfield type (when the form is compiled). Although, for compound type (like choices) it is necessary to mark the type manually as required.

See merge request !8
2015-12-11 11:46:51 +01:00
julienfastre 4f13ec6959 add a custom field long choice basic
The `custom field long choice` aim to provide a way to deal with choices
with a big possibilities.

The `custom field long choice` allow :
- to persist different options in the database ;
- each option has a key, a text (translatable string), and eventually a
  parent, and an internal_key
- every key can be activate or not. If the parent is inactivated, all
  childs are inactivated
- the internal key have two purposes :
    - link to an external csv file, with their own key ;
    - add a special class to results, to allow custom layout.

Currently, the field exists, but some elements are missing :

- a script for CSV import
- possibility to select multiple items
- edition of options
- handle of option without parents
- tests are missing
2015-12-11 11:43:39 +01:00
julienfastre 3230659a4b add a required field to custom fields type
ref Chill-project/Chill-CustomFields#17
2015-12-10 17:16:59 +01:00
julienfastre b88bb50b56 Merge branch 'marcu/Chill-CustomFields-master'
Merge request Chill-project/Chill-CustomFields!5

Conflicts:
	Resources/views/Form/fields.html.twig
2015-12-10 15:44:20 +01:00
julienfastre af3bc324c2 Merge branch 'add_number_field' into 'master'
add a number field

The field has three option :

- lesser or equal than. If null, this option is ignored ;
- greather or equal than. If null, this options is ignored ;
- precision : the number of decimal after the number ;
- text after the field : a text to show after the field.

The field is rendered as an HTML integer input if precision = 0, or a
symfony number field if precision > 0.

ref chill-project/Chill-CustomFields#11

See merge request !6
2015-12-10 15:15:17 +01:00
julienfastre 4f2b605efc add a number field
The field has three option :

- lesser or equal than. If null, this option is ignored ;
- greather or equal than. If null, this options is ignored ;
- precision : the number of decimal after the number ;
- text after the field : a text to show after the field.

The field is rendered as an HTML integer input if precision = 0, or a
symfony number field if precision > 0.

ref chill-project/Chill-CustomFields#11
2015-12-08 19:45:04 +01:00
Marc Ducobu 373edab629 CustomFields/CustomFieldInterface.php : Improving the doc 2015-12-08 11:42:38 +01:00
Marc Ducobu ebfb24a3eb Refactoring CustomFields/CustomFieldChoice.php : removing useless linereturn 2015-12-08 11:42:05 +01:00
Marc Ducobu 57fbd54a9c Removing the choice_with_other_widget that is alreay defined in the main bundle 2015-12-08 11:41:34 +01:00
julienfastre 6eb6117c14 Merge branch 'fix_#12' into 'master'
remove 'empty_data' which cause conflict with transformer

this blocked the possibility to uncheck the 'active' field on the
choice.

Should fix chill-project/Chill-CustomFields#12

See merge request !3
2015-12-01 10:30:57 +01:00
julienfastre c4d2c5e691 fix composer.json 2015-11-30 22:39:30 +01:00
julienfastre f18b384a06 remove 'empty_data' which cause conflict with transformer
this blocked the possibility to uncheck the 'active' field on the
choice.
2015-11-30 22:33:15 +01:00
julienfastre 9a41052cf1 Merge branch 'fix_admin_interface' into 'master'
Layout of index page for customfieldsgroup

Fix chill-project/custom-fields#2 and chill-project/custom-fields#3

This is a test to see how works merge request in gitlab.

See merge request !1
2015-11-30 22:18:41 +01:00
julienfastre 97475ca3b6 fix test for config according to new dev deps 2015-11-30 22:13:59 +01:00
julienfastre 4c328d0aae remove dump informations 2015-11-30 22:12:59 +01:00
julienfastre 9b5544beaf create test for custom fields group complete scenario
a deps is added on the bundle "person" in order to make test working.
2015-11-30 22:10:04 +01:00
julienfastre c9ca7c1e1b fix creation of custom field without cfgroup id 2015-11-30 21:31:58 +01:00
julienfastre 2401270754 add flash message for custom fields group 2015-11-27 14:29:38 +01:00
julienfastre 46173231d2 adding flash messages for customfield 2015-11-27 14:18:19 +01:00
julienfastre cbf9cee65c clean code of usnused methods 2015-11-27 13:51:36 +01:00
julienfastre fa3245b99b add a btn on edit link 2015-11-27 13:42:06 +01:00
julienfastre bf99b68a2a Improve rendering of options and fields 2015-11-27 13:37:07 +01:00
julienfastre f24a088a0d [wip] re-introduce 'add element' functionality 2015-11-25 21:26:30 +01:00
julienfastre b96076022f [wip] layout of custom field edition
[ci skip]
2015-11-25 08:45:17 +01:00
julienfastre cbcc722c0d remove the field "customFieldsGroup" on custom field creation
The customFieldsGroup field is hidden when creating a new customFields.

The customFieldsGroup is retrieved from the url (`customFieldsGroup` value in the URL).

This should ease the task for administrator and be consistent with the UI which group customFields into customFieldsGroup.
2015-11-08 21:18:03 +01:00
julienfastre 421f54e194 remove code for custom fields default group CRUD
The CRUD of default groups is handled now by the custom fields index page. The CRUD is not necessary.
2015-11-08 18:52:28 +01:00
julienfastre 3e23c1f156 show options in show view 2015-11-08 18:47:16 +01:00
julienfastre 0dcf2c33f0 create custom fields default group from new layout 2015-11-08 17:59:43 +01:00
julienfastre 41c47df0c3 remove delete action and form 2015-11-07 09:56:28 +01:00
julienfastre 45d34dc312 fix customfieldsgroup edit view 2015-11-07 09:51:36 +01:00
julienfastre e1435d0883 fix form to jump to create a custom field 2015-11-07 09:38:12 +01:00
julienfastre 59ce457131 add a title 2015-11-07 08:59:57 +01:00
julienfastre 043f5a1eaf fix show page 2015-11-05 23:49:22 +01:00
julienfastre bb1e690bec fix "create" page with translation and layout 2015-11-05 22:41:54 +01:00
julienfastre 9d65ca5088 layout of index page for customfieldsgroup
- add a "default" column (according to chill-project/custom-fields#3 )
- translation
2015-10-31 17:55:10 +01:00
Marc Ducobu 7cf270cee4 Removing travis config file 2015-10-30 15:57:27 +01:00
Marc Ducobu 5e211b3f06 Adding ref to the dov 2015-10-30 15:56:43 +01:00