public function testStatesArray()
 {
     $config = $this->app['config']->get('expendable.state');
     $result = \Distilleries\Expendable\Helpers\StaticLabel::states();
     $this->assertTrue(is_array($result));
     foreach ($config as $key => $value) {
         $this->assertArrayHasKey($key, $result);
     }
 }
Example #2
0
 public function buildForm()
 {
     $this->add($this->model->getKeyName(), 'hidden')->add('email', 'email', ['label' => trans('expendable::form.email'), 'validation' => 'required,custom[email]']);
     $id = $this->model->getKey();
     if (!empty($id)) {
         $this->add('change_password', 'checkbox', ['default_value' => 1, 'label' => trans('expendable::form.change_password_help'), 'checked' => false, 'noInEditView' => true]);
     }
     $this->add('password', 'password', ['label' => trans('expendable::form.password'), 'attr' => ['id' => 'password'], 'validation' => 'required', 'noInEditView' => true])->add('password_match', 'password', ['label' => trans('expendable::form.repeat_password'), 'validation' => 'required,equals[password]', 'noInEditView' => true])->add('status', 'choice', ['choices' => StaticLabel::status(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.status')])->add('role_id', 'choice', ['choices' => Role::getChoice(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.role')])->addDefaultActions();
 }
 public function build()
 {
     $this->add('id');
     $this->add('libelle', null, trans('expendable::datatable.subject'));
     $this->add('body_type', function ($model) {
         return StaticLabel::bodyType($model->body_type);
     }, trans('expendable::datatable.type'));
     $this->add('action', function ($model) {
         return StaticLabel::mailActions($model->action);
     });
     $this->add('cc');
     $this->add('bcc');
     $this->addTranslationAction();
     $this->addDefaultAction();
 }
 public function filters()
 {
     $this->form->add('status', 'choice', ['choices' => StaticLabel::status(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::datatable.status')]);
 }
Example #5
0
 public function buildForm()
 {
     $this->add('id', 'hidden')->add('libelle', 'text', ['validation' => 'required', 'label' => trans('expendable::form.libelle')])->add('initials', 'text', ['validation' => 'required', 'label' => trans('expendable::form.initials')])->add('overide_permission', 'choice', ['choices' => StaticLabel::yesNo(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.allow_automatically_all_permission')]);
     $this->addDefaultActions();
 }
Example #6
0
 public function buildForm()
 {
     $this->add('id', 'hidden')->add('libelle', 'text')->add('iso', 'text')->add('not_visible', 'choice', ['choices' => StaticLabel::yesNo(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.is_visible_for_customer')])->add('is_default', 'choice', ['choices' => StaticLabel::yesNo(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.default_language')])->add('status', 'choice', ['choices' => StaticLabel::status(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.status')]);
     $this->addDefaultActions();
 }
Example #7
0
 public function buildForm()
 {
     $this->add('range', 'datepicker', ['label' => trans('expendable::form.date'), 'validation' => 'required', 'range' => true])->add('type', 'choice', ['choices' => StaticLabel::typeExport(), 'validation' => 'required', 'label' => trans('expendable::form.type')])->addDefaultActions();
 }
Example #8
0
 public function buildForm()
 {
     $this->add($this->model->getKeyName(), 'hidden')->add('libelle', 'text', ['validation' => 'required', 'label' => trans('expendable::form.subject')])->add('body_type', 'choice', ['choices' => StaticLabel::bodyType(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.body_type')])->add('action', 'choice', ['choices' => StaticLabel::mailActions(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.action')])->add('cc', 'tag', ['label' => trans('expendable::form.cc')])->add('bcc', 'tag', ['label' => trans('expendable::form.bcc')])->add('content', 'tinymce', ['validation' => 'required', 'label' => trans('expendable::form.content')])->add('status', 'choice', ['choices' => StaticLabel::status(), 'empty_value' => '-', 'validation' => 'required', 'label' => trans('expendable::form.status')])->addDefaultActions();
 }
Example #9
0
 public function buildForm()
 {
     $this->add('id', 'hidden')->add('libelle', 'text')->add('content', 'tinymce')->add('status', 'choice', ['choices' => StaticLabel::status(), 'empty_value' => '-', 'validation' => 'required', 'label' => 'Status']);
     $this->addDefaultActions();
 }
Example #10
0
 public function buildForm()
 {
     $this->add('libelle', 'text', ['validation' => 'required', 'label' => trans('expendable::form.name'), 'help' => trans('expendable::form.auto_sufix')])->add('state', 'choice', ['choices' => StaticLabel::states(), 'empty_value' => '-', 'label' => trans('expendable::form.state'), 'expanded' => true, 'multiple' => true])->add('models', 'choice', ['choices' => $this->getChoiceModels(), 'empty_value' => '-', 'label' => trans('expendable::form.model')])->add('colon_datatable', 'tag', ['label' => trans('expendable::form.columns'), 'help' => trans('expendable::form.help_colon_datatable')])->add('fields_form', 'tag', ['label' => trans('expendable::form.fields'), 'help' => trans('expendable::form.help_fields_form')])->addDefaultActions();
 }