<commit_before><?php

/**
 * User
 *
 * @author <NAME> <<EMAIL>>
 * @link http://inji.ru/
 * @copyright 2015 <NAME>
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
 */

namespace Users;

class User extends \Model
{
    static $cur;
    public static $objectName = "Пользователь";
    static $labels = [
        'login' => 'Логин',
        'mail' => 'E-Mail',
        'pass' => '<PASSWORD>',
        'parent_id' => 'Пригласивший',
        'group_id' => 'Группа',
        'role_id' => 'Роль',
        'admin_text' => 'Комментарий администратора',
        'activation' => 'Код активации',
        'blocked' => 'Заблокирован',
        'date_last_active' => 'Последняя активность',
        'date_create' => 'Дата регистрации',
    ];
    static $cols = [
        'login' => ['type' => 'text'],
        'mail' => ['type' => 'email'],
        'pass' => ['type' => 'password'],
        'parent_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'parent'],
        'group_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'group'],
        'role_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'role'],
        'admin_text' => ['type' => 'html'],
        'activation' => ['type' => 'text'],
        'blocked' => ['type' => 'bool',],
        'date_last_active' => ['type' => 'dateTime'],
        'date_create' => ['type' => 'dateTime']
    ];
    static $dataManagers = [
        'manager' => [
            'options' => [
                'access' => [
                    'groups' => [
                        3
                    ]
                ]
            ],
            'cols' => [
                'mail',
                'info:first_name',
                'info:last_name',
                'group_id',
                'role_id',
                'date_last_active',
                'date_create',
            ],
            'sortable' => [
                'mail',
                'info:first_name',
                'info:last_name',
                'group_id',
                'role_id',
                'date_last_active',
                'date_create'
            ],
            'filters' => [
                'mail',
                'info:first_name',
                'info:last_name',
                'role_id',
                'date_last_active',
                'date_create',
            ],
            'searchableCols' => ['mail']
        ],
    ];
    static $forms = [
        'manager' => [
            'inputs' => [
                'userSearch' => [
                    'type' => 'search',
                    'source' => 'relation',
                    'relation' => 'parent',
                    'label' => 'Пригласивший',
                    'cols' => [
                        'info:first_name',
                        'info:last_name',
                        'info:middle_name',
                        'mail'
                    ],
                    'col' => 'parent_id',
                ],
                'pass' => [
                    'type' => 'changePassword'
                ]
            ],
            'map' => [
                ['login', 'mail',],
                ['group_id', 'role_id'],
                ['userSearch', 'blocked'],
                ['pass'],
                ['activation'],
                ['admin_text'],
                ['form:info:manager']
            ]
        ],
        'profile' => [
            'options' => [
                'access' => [
                    'groups' => [
                        3
                    ],
                    'self' => true
                ]
            ],
            'map' => [
                ['pass'],
                ['form:info:manager']
            ]
        ]
    ];

    static function relations()
    {
        return [
            'group' => [<commit_msg>change password<commit_after><?php

/**
 * User
 *
 * @author <NAME> <<EMAIL>>
 * @link http://inji.ru/
 * @copyright 2015 <NAME>
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
 */

namespace Users;

class User extends \Model
{
    static $cur;
    public static $objectName = "Пользователь";
    static $labels = [
        'login' => 'Логин',
        'mail' => 'E-Mail',
        'pass' => '<PASSWORD>',
        'parent_id' => 'Пригласивший',
        'group_id' => 'Группа',
        'role_id' => 'Роль',
        'admin_text' => 'Комментарий администратора',
        'activation' => 'Код активации',
        'blocked' => 'Заблокирован',
        'date_last_active' => 'Последняя активность',
        'date_create' => 'Дата регистрации',
    ];
    static $cols = [
        'login' => ['type' => 'text'],
        'mail' => ['type' => 'email'],
        'pass' => ['type' => 'password'],
        'parent_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'parent'],
        'group_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'group'],
        'role_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'role'],
        'admin_text' => ['type' => 'html'],
        'activation' => ['type' => 'text'],
        'blocked' => ['type' => 'bool',],
        'date_last_active' => ['type' => 'dateTime'],
        'date_create' => ['type' => 'dateTime']
    ];
    static $dataManagers = [
        'manager' => [
            'options' => [
                'access' => [
                    'groups' => [
                        3
                    ]
                ]
            ],
            'cols' => [
                'mail',
                'info:first_name',
                'info:last_name',
                'group_id',
                'role_id',
                'date_last_active',
                'date_create',
            ],
            'sortable' => [
                'mail',
                'info:first_name',
                'info:last_name',
                'group_id',
                'role_id',
                'date_last_active',
                'date_create'
            ],
            'filters' => [
                'mail',
                'info:first_name',
                'info:last_name',
                'role_id',
                'date_last_active',
                'date_create',
            ],
            'searchableCols' => ['mail']
        ],
    ];
    static $forms = [
        'manager' => [
            'inputs' => [
                'userSearch' => [
                    'type' => 'search',
                    'source' => 'relation',
                    'relation' => 'parent',
                    'label' => 'Пригласивший',
                    'cols' => [
                        'info:first_name',
                        'info:last_name',
                        'info:middle_name',
                        'mail'
                    ],
                    'col' => 'parent_id',
                ],
                'pass' => [
                    'type' => 'changePassword'
                ]
            ],
            'map' => [
                ['login', 'mail',],
                ['group_id', 'role_id'],
                ['userSearch', 'blocked'],
                ['pass'],
                ['activation'],
                ['admin_text'],
            //['form:info:manager']
            ]
        ],
        'profile' => [
            'options' => [
                'access' => [
                    'groups' => [
                        3
                    ],
                    'self' => true
                ]
            ],
            'inputs' => [
                'pass' => [
                    'type' => 'changePassword'
                ]
            ],
            'map' => [
                ['pass'],
                ['form:info:manager']
            ]
        ]
    ];

    static function relations()
    {
        return [
            'group' => [
{'fraction_non_alphanumeric': 0.17086007702182285, 'fraction_numerical': 0.0015404364569961489, 'mean_word_length': 1.0837122225193903, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 148, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1349928', 'n_tokens_mistral': 2265, 'n_tokens_neox': 2185, 'n_words': 365}