mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
#3133 fast add user select
This commit is contained in:
parent
7e93deea32
commit
c3cc0cd12a
@ -322,6 +322,8 @@ return [
|
|||||||
'upload_files' => 'Upload Files',
|
'upload_files' => 'Upload Files',
|
||||||
'additional_fields' => 'Additional Fields',
|
'additional_fields' => 'Additional Fields',
|
||||||
'ad_location' => 'Ad Location',
|
'ad_location' => 'Ad Location',
|
||||||
|
'owner' => 'Owner',
|
||||||
|
'default_owner_instruction' => 'The owner will default to the current user if no user is selected',
|
||||||
|
|
||||||
'free' => 'Free',
|
'free' => 'Free',
|
||||||
'ad_date' => 'Ad Date',
|
'ad_date' => 'Ad Date',
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Adv\Form;
|
<?php namespace Visiosoft\AdvsModule\Adv\Form;
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
|
||||||
|
use Anomaly\UsersModule\User\UserModel;
|
||||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||||
|
|
||||||
class SimpleAdvFormBuilder extends FormBuilder
|
class SimpleAdvFormBuilder extends FormBuilder
|
||||||
@ -8,6 +9,15 @@ class SimpleAdvFormBuilder extends FormBuilder
|
|||||||
protected $model = AdvModel::class;
|
protected $model = AdvModel::class;
|
||||||
|
|
||||||
protected $fields = [
|
protected $fields = [
|
||||||
|
"created_by_id" => [
|
||||||
|
'label' => 'visiosoft.module.advs::field.owner',
|
||||||
|
'instructions' => 'visiosoft.module.advs::field.default_owner_instruction',
|
||||||
|
"type" => "anomaly.field_type.relationship",
|
||||||
|
"config" => [
|
||||||
|
"related" => UserModel::class,
|
||||||
|
"mode" => "lookup",
|
||||||
|
]
|
||||||
|
],
|
||||||
'name',
|
'name',
|
||||||
'price',
|
'price',
|
||||||
'currency',
|
'currency',
|
||||||
|
|||||||
@ -11,6 +11,10 @@ class SimpleAdvFormHandler
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$builder->getFormValue('created_by_id')) {
|
||||||
|
$builder->setFormValue('created_by_id', auth()->id());
|
||||||
|
}
|
||||||
|
|
||||||
$builder->saveForm();
|
$builder->saveForm();
|
||||||
|
|
||||||
$ad = $advRepository->find($builder->getFormEntryId());
|
$ad = $advRepository->find($builder->getFormEntryId());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user