|
1
|
|
|
<?php |
|
2
|
|
|
/* For licensing terms, see /license.txt */ |
|
3
|
|
|
|
|
4
|
|
|
namespace Chamilo\CoreBundle\Settings; |
|
5
|
|
|
|
|
6
|
|
|
use Chamilo\CoreBundle\Form\Type\YesNoType; |
|
7
|
|
|
use Sylius\Bundle\SettingsBundle\Schema\SchemaInterface; |
|
8
|
|
|
use Sylius\Bundle\SettingsBundle\Schema\SettingsBuilderInterface; |
|
9
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Class GradebookSettingsSchema |
|
13
|
|
|
* @package Chamilo\CoreBundle\Settings |
|
14
|
|
|
*/ |
|
15
|
|
|
class TicketSettingsSchema extends AbstractSettingsSchema |
|
16
|
|
|
{ |
|
17
|
|
|
/** |
|
18
|
|
|
* {@inheritdoc} |
|
19
|
|
|
*/ |
|
20
|
|
|
public function buildSettings(SettingsBuilderInterface $builder) |
|
21
|
|
|
{ |
|
22
|
|
|
$builder |
|
23
|
|
|
->setDefaults( |
|
24
|
|
|
[ |
|
25
|
|
|
'show_terms_if_profile_completed' => 'false', |
|
26
|
|
|
'ticket_allow_category_edition' => 'false', |
|
27
|
|
|
'ticket_allow_student_add' => 'false', |
|
28
|
|
|
'ticket_send_warning_to_all_admins' => 'false', |
|
29
|
|
|
'ticket_warn_admin_no_user_in_category' => 'false', |
|
30
|
|
|
] |
|
31
|
|
|
); |
|
32
|
|
|
|
|
33
|
|
|
$allowedTypes = [ |
|
34
|
|
|
'show_terms_if_profile_completed' => ['string'] |
|
35
|
|
|
]; |
|
36
|
|
|
$this->setMultipleAllowedTypes($allowedTypes, $builder); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* {@inheritdoc} |
|
41
|
|
|
*/ |
|
42
|
|
|
public function buildForm(FormBuilderInterface $builder) |
|
43
|
|
|
{ |
|
44
|
|
|
$builder |
|
45
|
|
|
->add('show_terms_if_profile_completed', YesNoType::class) |
|
46
|
|
|
->add('ticket_allow_category_edition', YesNoType::class) |
|
47
|
|
|
->add('ticket_allow_student_add') |
|
48
|
|
|
->add('ticket_send_warning_to_all_admins', YesNoType::class) |
|
49
|
|
|
->add('ticket_warn_admin_no_user_in_category', YesNoType::class) |
|
50
|
|
|
; |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
|