dynamic / silverstripe-elemental-customer-service
Showing 1 of 3 files from the diff.

@@ -24,16 +24,6 @@
Loading
24 24
     */
25 25
    private static $icon = 'font-icon-info-circled';
26 26
27 -
    /**
28 -
     * @var string
29 -
     */
30 -
    private static $singular_name = 'Customer Service Element';
31 -
32 -
    /**
33 -
     * @var string
34 -
     */
35 -
    private static $plural_name = 'Customer Service Elements';
36 -
37 27
    /**
38 28
     * @var string
39 29
     */
@@ -43,26 +33,44 @@
Loading
43 33
     * @var array
44 34
     */
45 35
    private static $db = [
46 -
        'Title' => 'Varchar(255)',
36 +
        'LocationName' => 'Varchar(255)',
47 37
        'Website' => 'Varchar(255)',
48 38
        'Phone' => 'Varchar(40)',
49 39
        'Email' => 'Varchar(255)',
50 40
        'Fax' => 'Varchar(45)',
51 41
    ];
52 42
43 +
    /**
44 +
     * @param bool $includerelations
45 +
     * @return array
46 +
     */
47 +
    public function fieldLabels($includerelations = true)
48 +
    {
49 +
        $labels = parent::fieldLabels($includerelations);
50 +
51 +
        $labels['LocationName'] = _t(__CLASS__.'.LocationNameLabel', 'Location Name');
52 +
        $labels['Website'] = _t(__CLASS__ . '.WebsiteLabel', 'Website');
53 +
        $labels['Phone'] = _t(__CLASS__ . '.PhoneLabel', 'Phone');
54 +
        $labels['Email'] = _t(__CLASS__ . '.EmailLabel', 'Email');
55 +
        $labels['Fax'] = _t(__CLASS__ . '.FaxLabel', 'Fax');
56 +
57 +
        return $labels;
58 +
    }
59 +
53 60
    /**
54 61
     * @return FieldList
55 62
     */
56 63
    public function getCMSFields()
57 64
    {
58 65
        $this->beforeUpdateCMSFields(function (FieldList $fields) {
59 -
            $fields->dataFieldByName('Title')
60 -
                ->setTitle('Name');
61 -
62 66
            if ($website = $fields->dataFieldByName('Website')) {
63 67
                $website->setAttribute('placeholder', 'http://');
64 68
            }
65 -
            $fields->replaceField('Email', EmailField::create('Email'));
69 +
            $fields->replaceField(
70 +
                'Email',
71 +
                EmailField::create('Email')
72 +
                    ->setTitle($this->fieldLabel('Email'))
73 +
            );
66 74
        });
67 75
68 76
        return parent::getCMSFields();
Files Complexity Coverage
src 7 70.37%
Project Totals (2 files) 7 70.37%
44.2
TRAVIS_PHP_VERSION=7.1
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading