Compare commits
11 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78a0e9c5d7 | ||
|
|
8941dbacdd | ||
|
|
2301d68434 | ||
|
|
3bc7a371df | ||
|
|
4f5fea4436 | ||
|
|
99a57143b6 | ||
|
|
f3060ed3bf | ||
|
|
91c0aa2f9a | ||
|
|
a0c2cd8db6 | ||
|
|
e5d497fa76 | ||
|
|
c2978f6ab1 |
23 changed files with 650 additions and 15 deletions
58
app/Http/Controllers/BrandController.php
Normal file
58
app/Http/Controllers/BrandController.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Marque;
|
||||
use App\Http\Requests\Bo\UpdateBrandUserRequest;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BrandController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
/** @var \App\Models\User */
|
||||
$user = auth()->user();
|
||||
$user->authorizeRoles(config('roles.const.ADMIN'));
|
||||
|
||||
$brands = Marque::query()->orderBy('libMarq')->get();
|
||||
return view('brands.index')->with([
|
||||
'brands' => $brands
|
||||
]);
|
||||
}
|
||||
|
||||
public function editUsers(Marque $brand)
|
||||
{
|
||||
/** @var \App\Models\User */
|
||||
$user = auth()->user();
|
||||
$user->authorizeRoles(config('roles.const.ADMIN'));
|
||||
|
||||
$userModels = User::all();
|
||||
return view('brands.edit-relations')->with([
|
||||
'brand' => $brand,
|
||||
'brands' => Marque::all(),
|
||||
'userModels' => $userModels,
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateUsers(UpdateBrandUserRequest $request, Marque $brand)
|
||||
{
|
||||
/** @var \App\Models\User */
|
||||
$user = auth()->user();
|
||||
$user->authorizeRoles(config('roles.const.ADMIN'));
|
||||
|
||||
DB::transaction(function () use ($request, $brand) {
|
||||
if ($request->validated('users')) {
|
||||
$brand->users()->sync($request->validated('users'));
|
||||
}
|
||||
return redirect()->route('brands.editUsers', ['brand' => $brand])
|
||||
->with('success', __('Les utilisateurs ont bien été mis à jour'));
|
||||
});
|
||||
return back()->with('error', __('Une erreur est survenue. Veuillez réessayer ultérieurement.'));
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,9 @@ use App\Http\Requests\Bo\LoadMediaRequest;
|
|||
use App\Http\Requests\Bo\ShowInterfaceRequest;
|
||||
use App\Lib\ArcadiaLinkUtilities;
|
||||
use App\Lib\ToolboxHelper;
|
||||
use App\Models\ArcadiaAnglePriseVue;
|
||||
use App\Models\ArcadiaNatureFichier;
|
||||
use App\Models\ArcadiaTypeContenu;
|
||||
use App\Models\Article;
|
||||
use App\Models\Copyright;
|
||||
use App\Models\Dossier;
|
||||
|
|
@ -73,11 +76,15 @@ class MediaController extends Controller
|
|||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\Societe> */
|
||||
$societes = Societe::orderBy('libelle')->get();
|
||||
|
||||
$typesmedia = TypeMedia::all();
|
||||
$langues = Langue::all();
|
||||
$copyrights = Copyright::all();
|
||||
$etiquettes = Etiquette::all();
|
||||
$marques = Marque::all();
|
||||
$typesmedia = TypeMedia::all();
|
||||
$langues = Langue::all();
|
||||
$copyrights = Copyright::all();
|
||||
$etiquettes = Etiquette::all();
|
||||
$marques = Marque::all();
|
||||
$naturesfichier = ArcadiaNatureFichier::all();
|
||||
$typescontenu = ArcadiaTypeContenu::all();
|
||||
$anglesprisevue = ArcadiaAnglePriseVue::all();
|
||||
$tags = Tag::query()->orderBy('libelle')->get();
|
||||
|
||||
/** @var int|null */
|
||||
$dossier_id = $request->d;
|
||||
|
|
@ -122,6 +129,10 @@ class MediaController extends Controller
|
|||
return view('media_manager')->with([
|
||||
'sujets' => $sujets,
|
||||
'typesmedia' => $typesmedia,
|
||||
'naturesfichier' => $naturesfichier,
|
||||
'typescontenu' => $typescontenu,
|
||||
'anglesprisevue' => $anglesprisevue,
|
||||
'tags' => $tags,
|
||||
'langues' => $langues,
|
||||
'copyrights' => $copyrights,
|
||||
'etiquettes' => $etiquettes,
|
||||
|
|
|
|||
|
|
@ -61,9 +61,13 @@ class UpdateMediaRequest extends FormRequest
|
|||
|
||||
// Article.
|
||||
if ($this->sujet_id == 1) {
|
||||
$rules['articles'] = 'present|array|min:0';
|
||||
$rules['articles.*'] = 'array';
|
||||
$rules['articles.*.id'] = 'exists:articles,id';
|
||||
$rules['articles'] = 'present|array|min:0';
|
||||
$rules['articles.*'] = 'array';
|
||||
$rules['articles.*.id'] = 'exists:articles,id';
|
||||
$rules['arcadia_angle_prise_vue_id'] = 'required|exists:arcadia_angle_prise_vues,id';
|
||||
$rules['arcadia_nature_fichier_id'] = 'required|exists:arcadia_nature_fichiers,id';
|
||||
$rules['arcadia_type_contenu_id'] = 'required|exists:arcadia_type_contenus,id';
|
||||
|
||||
}
|
||||
// Marque.
|
||||
if ($this->sujet_id == 2) {
|
||||
|
|
|
|||
43
app/Http/Requests/Bo/UpdateBrandUserRequest.php
Normal file
43
app/Http/Requests/Bo/UpdateBrandUserRequest.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateBrandUserRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the data for validation.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$this->merge([
|
||||
'users' => !$this->users ? null : \explode(',', \strval($this->users))
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'users' => 'nullable|array',
|
||||
'users.*' => 'required|exists:users,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -39,9 +39,7 @@ class XmlArcadiaMediasIn extends XmlJobs
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $nullableFields = [
|
||||
'version'
|
||||
];
|
||||
protected $nullableFields = [];
|
||||
|
||||
/**
|
||||
* Fields that are unique
|
||||
|
|
@ -71,7 +69,7 @@ class XmlArcadiaMediasIn extends XmlJobs
|
|||
$media = Media::withTrashed()->where($uniqueColumnsKey)->firstOrFail();
|
||||
|
||||
$media->arcadia_id = $line['arcadia_id'];
|
||||
$media->version = $line['version'] ?? 1;
|
||||
$media->version = $line['version'];
|
||||
$media->isLocked = false;
|
||||
|
||||
$media->saveOrFail();
|
||||
|
|
|
|||
|
|
@ -217,6 +217,12 @@ class ArcadiaLinkUtilities
|
|||
->appendChild($dom->createCDATASection("$media->copyright_id"));
|
||||
$root->appendChild($dom->createElement('codeVariante'))
|
||||
->appendChild($dom->createCDATASection("$media->variante_id"));
|
||||
$root->appendChild($dom->createElement('codeAnglePriseVue'))
|
||||
->appendChild($dom->createCDATASection($media->arcadiaAngleprisevue->value));
|
||||
$root->appendChild($dom->createElement('codeNatureFichier'))
|
||||
->appendChild($dom->createCDATASection($media->arcadiaNaturefichier->value));
|
||||
$root->appendChild($dom->createElement('codeTypeContenu'))
|
||||
->appendChild($dom->createCDATASection($media->arcadiaTypecontenu->value));
|
||||
$root->appendChild($dom->createElement('dateCreation'))
|
||||
->appendChild($dom->createCDATASection("$media->created_at"));
|
||||
$root->appendChild($dom->createElement('dateModification'))
|
||||
|
|
|
|||
27
app/Models/ArcadiaAnglePriseVue.php
Normal file
27
app/Models/ArcadiaAnglePriseVue.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArcadiaAnglePriseVue extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'value',
|
||||
'label'
|
||||
];
|
||||
|
||||
// * RELATIONSHIPS
|
||||
|
||||
/**
|
||||
* HasMany variantes relation
|
||||
*
|
||||
* Get the media for the ArcadiaAnglePriseVue.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function mediaList()
|
||||
{
|
||||
return $this->hasMany(Media::class);
|
||||
}
|
||||
}
|
||||
27
app/Models/ArcadiaNatureFichier.php
Normal file
27
app/Models/ArcadiaNatureFichier.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArcadiaNatureFichier extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'value',
|
||||
'label'
|
||||
];
|
||||
|
||||
// * RELATIONSHIPS
|
||||
|
||||
/**
|
||||
* HasMany variantes relation
|
||||
*
|
||||
* Get the media for the ArcadiaNatureFichier.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function mediaList()
|
||||
{
|
||||
return $this->hasMany(Media::class);
|
||||
}
|
||||
}
|
||||
27
app/Models/ArcadiaTypeContenu.php
Normal file
27
app/Models/ArcadiaTypeContenu.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArcadiaTypeContenu extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'value',
|
||||
'label'
|
||||
];
|
||||
|
||||
// * RELATIONSHIPS
|
||||
|
||||
/**
|
||||
* HasMany variantes relation
|
||||
*
|
||||
* Get the media for the ArcadiaTypeContenu.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function mediaList()
|
||||
{
|
||||
return $this->hasMany(Media::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -31,7 +31,8 @@ class Marque extends Model
|
|||
*/
|
||||
public function users()
|
||||
{
|
||||
return $this->belongsToMany(User::class);
|
||||
// We have to define foreignPivotKey because primaryKey has been overwritten ...
|
||||
return $this->belongsToMany(User::class, foreignPivotKey:'marque_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@ class Media extends Model
|
|||
'copyright_id',
|
||||
'etiquette_id',
|
||||
'langue_id',
|
||||
'arcadia_angle_prise_vue_id',
|
||||
'arcadia_nature_fichier_id',
|
||||
'arcadia_type_contenu_id',
|
||||
'commentaire',
|
||||
'version',
|
||||
'statut',
|
||||
|
|
@ -461,6 +464,39 @@ class Media extends Model
|
|||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsTo ArcadiaTypeContenu relation
|
||||
* Get the ArcadiaTypeContenu that belongs to the media.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function arcadiaTypecontenu()
|
||||
{
|
||||
return $this->belongsTo(ArcadiaTypeContenu::class, 'arcadia_type_contenu_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsTo ArcadiaAnglePriseVue relation
|
||||
* Get the ArcadiaAnglePriseVue that belongs to the media.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function arcadiaAngleprisevue()
|
||||
{
|
||||
return $this->belongsTo(ArcadiaAnglePriseVue::class, 'arcadia_angle_prise_vue_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsTo ArcadiaNatureFichier relation
|
||||
* Get the ArcadiaNatureFichier that belongs to the media.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function arcadiaNaturefichier()
|
||||
{
|
||||
return $this->belongsTo(ArcadiaNatureFichier::class, 'arcadia_nature_fichier_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* HasMany historiques relation
|
||||
* Get the historiques for the media.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
use App\Models\ArcadiaNatureFichier;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('arcadia_nature_fichiers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('value');
|
||||
$table->string('label');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
ArcadiaNatureFichier::query()->create([
|
||||
'value' => 'Undefined',
|
||||
'label' => 'Non défini'
|
||||
]);
|
||||
ArcadiaNatureFichier::query()->create([
|
||||
'value' => 'A',
|
||||
'label' => 'Photographie d\'un produit en definition standard'
|
||||
]);
|
||||
ArcadiaNatureFichier::query()->create([
|
||||
'value' => 'C',
|
||||
'label' => 'Photographie d\'un produit en Haute Definition'
|
||||
]);
|
||||
ArcadiaNatureFichier::query()->create([
|
||||
'value' => 'H',
|
||||
'label' => 'Mobile Ready Hero Image = autre (dessin, illustration, logotype, pictogramme)'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('arcadia_nature_fichiers');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
use App\Models\ArcadiaAnglePriseVue;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('arcadia_angle_prise_vues', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('value');
|
||||
$table->string('label');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
ArcadiaAnglePriseVue::query()->create([
|
||||
'value' => 'Undefined',
|
||||
'label' => 'Non défini'
|
||||
]);
|
||||
ArcadiaAnglePriseVue::query()->create([
|
||||
'value' => 'C',
|
||||
'label' => 'Centre, angle de plongee 15 degres'
|
||||
]);
|
||||
ArcadiaAnglePriseVue::query()->create([
|
||||
'value' => 'L',
|
||||
'label' => '3/4 gauche'
|
||||
]);
|
||||
ArcadiaAnglePriseVue::query()->create([
|
||||
'value' => 'N',
|
||||
'label' => 'Centre, sans angle de plongee'
|
||||
]);
|
||||
ArcadiaAnglePriseVue::query()->create([
|
||||
'value' => 'R',
|
||||
'label' => '3/4 droit'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('arcadia_angle_prise_vues');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
use App\Models\ArcadiaTypeContenu;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('arcadia_type_contenus', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('value');
|
||||
$table->string('label');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
ArcadiaTypeContenu::query()->create([
|
||||
'value' => 'Undefined',
|
||||
'label' => 'Non défini'
|
||||
]);
|
||||
ArcadiaTypeContenu::query()->create([
|
||||
'value' => 'D',
|
||||
'label' => 'Produit prepare (monte, pour les produits a assembler)'
|
||||
]);
|
||||
ArcadiaTypeContenu::query()->create([
|
||||
'value' => 'G',
|
||||
'label' => 'Mise en situation (produits emballes ou deballes, suggestion de presentation)'
|
||||
]);
|
||||
ArcadiaTypeContenu::query()->create([
|
||||
'value' => '0',
|
||||
'label' => 'Produit nu/deballe'
|
||||
]);
|
||||
ArcadiaTypeContenu::query()->create([
|
||||
'value' => '1',
|
||||
'label' => 'produit emballe/packshot'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('arcadia_type_contenus');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('media', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('arcadia_angle_prise_vue_id')
|
||||
->after('variante_id')
|
||||
->default(1);
|
||||
$table->foreign('arcadia_angle_prise_vue_id')
|
||||
->references('id')
|
||||
->on('arcadia_angle_prise_vues');
|
||||
|
||||
$table->unsignedBigInteger('arcadia_nature_fichier_id')
|
||||
->after('arcadia_angle_prise_vue_id')
|
||||
->default(1);
|
||||
$table->foreign('arcadia_nature_fichier_id')
|
||||
->references('id')
|
||||
->on('arcadia_nature_fichiers');
|
||||
|
||||
$table->unsignedBigInteger('arcadia_type_contenu_id')
|
||||
->after('arcadia_nature_fichier_id')
|
||||
->default(1);
|
||||
$table->foreign('arcadia_type_contenu_id')
|
||||
->references('id')
|
||||
->on('arcadia_type_contenus');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('media', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'arcadia_angle_prise_vue_id',
|
||||
'arcadia_nature_fichier_id',
|
||||
'arcadia_type_contenu_id',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -25,6 +25,13 @@ $(document).ready(function() {
|
|||
tableGlobalSearch('.datatable tr.data_row', search, [1,2,3]);
|
||||
});
|
||||
|
||||
// ---- Gestion des utilisateurs : recherche de marque
|
||||
$(".filter_brand_btn").on('click', function(event) {
|
||||
event.preventDefault();
|
||||
const search = $(".filter_brand_input").val();
|
||||
tableGlobalSearch('.datatable tr.data_row', search, [1,2,3]);
|
||||
});
|
||||
|
||||
// ---- Gestion des dossiers : recherche un dossier
|
||||
$(".filter_dossier_btn").on('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
|
@ -195,6 +202,7 @@ $(document).ready(function() {
|
|||
|
||||
initSelector(".selector_marques");
|
||||
initSelector(".selector_sujets");
|
||||
initSelector(".selector_users");
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@
|
|||
:marques="marques"
|
||||
:etiquettes="etiquettes"
|
||||
:copyrights="copyrights"
|
||||
:naturesfichier="naturesfichier"
|
||||
:typescontenu="typescontenu"
|
||||
:anglesprisevue="anglesprisevue"
|
||||
:tags="tags"
|
||||
@closeEdit="close"
|
||||
/>
|
||||
<MeLinksComponent :currentTab="currentTab" />
|
||||
|
|
@ -125,6 +129,10 @@ export default {
|
|||
this.marques = data.marques;
|
||||
this.etiquettes = data.etiquettes;
|
||||
this.copyrights = data.copyrights;
|
||||
this.naturesfichier = data.naturesfichier;
|
||||
this.typescontenu = data.typescontenu;
|
||||
this.anglesprisevue = data.anglesprisevue;
|
||||
this.tags = data.tags;
|
||||
if (this.open !== undefined) {
|
||||
this.$store.commit({
|
||||
type: "updateMedia",
|
||||
|
|
@ -163,6 +171,10 @@ export default {
|
|||
marques: [],
|
||||
etiquettes: [],
|
||||
copyrights: [],
|
||||
naturesfichier: [],
|
||||
typescontenu: [],
|
||||
anglesprisevue: [],
|
||||
tags: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
|
|
|||
|
|
@ -98,6 +98,66 @@
|
|||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div
|
||||
class="row"
|
||||
v-if="this.oMedia.sujet_id === 1"
|
||||
>
|
||||
<label>Nature du fichier <span>*</span></label>
|
||||
<select
|
||||
id="naturefichier"
|
||||
name="naturefichier"
|
||||
required
|
||||
v-model="oMedia.arcadia_nature_fichier_id"
|
||||
:disabled="oMedia.isLocked || oMedia.arcadia_id !== null"
|
||||
>
|
||||
<option :value="null" selected disabled>
|
||||
Sélectionnez une nature de fichier
|
||||
</option>
|
||||
<option v-for="item in naturesfichier" :value="item.id">
|
||||
{{ item.label }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div
|
||||
class="row"
|
||||
v-if="this.oMedia.sujet_id === 1"
|
||||
>
|
||||
<label>Type de contenu <span>*</span></label>
|
||||
<select
|
||||
id="typecontenu"
|
||||
name="typecontenu"
|
||||
required
|
||||
v-model="oMedia.arcadia_type_contenu_id"
|
||||
:disabled="oMedia.isLocked || oMedia.arcadia_id !== null"
|
||||
>
|
||||
<option :value="null" selected disabled>
|
||||
Sélectionnez un type de contenu
|
||||
</option>
|
||||
<option v-for="item in typescontenu" :value="item.id">
|
||||
{{ item.label }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div
|
||||
class="row"
|
||||
v-if="this.oMedia.sujet_id === 1"
|
||||
>
|
||||
<label>Angle prise de vue <span>*</span></label>
|
||||
<select
|
||||
id="angleprisevue"
|
||||
name="angleprisevue"
|
||||
required
|
||||
v-model="oMedia.arcadia_angle_prise_vue_id"
|
||||
:disabled="oMedia.isLocked || oMedia.arcadia_id !== null"
|
||||
>
|
||||
<option :value="null" selected disabled>
|
||||
Sélectionnez un type de contenu
|
||||
</option>
|
||||
<option v-for="item in anglesprisevue" :value="item.id">
|
||||
{{ item.label }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Langue <span>*</span></label>
|
||||
<select
|
||||
|
|
@ -308,7 +368,7 @@
|
|||
<div class="row">
|
||||
<label>Nuage de tags</label>
|
||||
<v-select
|
||||
:options="[]"
|
||||
:options="tags"
|
||||
label="libelle"
|
||||
:create-option="(item) => ({ id: new Date().getTime(), libelle: item })"
|
||||
v-model="oMedia.tags"
|
||||
|
|
@ -380,7 +440,7 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
|||
export default {
|
||||
name: "MeEditComponent",
|
||||
components: { FontAwesomeIcon },
|
||||
props: ["currentTab", "langues", "societes", "marques", "etiquettes", "copyrights"],
|
||||
props: ["currentTab", "langues", "societes", "marques", "etiquettes", "copyrights", "naturesfichier", "typescontenu", "anglesprisevue", "tags"],
|
||||
computed: {
|
||||
storeMedia() {
|
||||
return this.$store.state.media;
|
||||
|
|
|
|||
41
resources/views/brands/edit-relations.blade.php
Normal file
41
resources/views/brands/edit-relations.blade.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
@extends('layouts.app')
|
||||
@include('layouts.header')
|
||||
@section('content')
|
||||
<main class="user_index template_2col">
|
||||
@include('modules.param-sideMenu')
|
||||
<div class="main_content">
|
||||
@include('modules.flashMessage')
|
||||
<div class="heading">
|
||||
<h1>{{ __('Edition des utilisateurs de la marque') }} : {{ $brand->libMarq }}</h1>
|
||||
</div>
|
||||
{!! Form::model($brand, ['route' => ['brands.updateUsers', $brand], 'enctype' => 'multipart/form-data', 'class' => 'dataform']) !!}
|
||||
@method('PUT')
|
||||
<div class="form-section">
|
||||
{!! Form::label('users', 'Utilisateurs associés') !!}
|
||||
</div>
|
||||
<div class="form-field">
|
||||
{!! Form::label("", "") !!}
|
||||
<div class="selector_form selector_users">
|
||||
{!! Form::text('search', null, ['class' => "selector_filter", 'placeholder' => "Rechercher...", "autocomplete" => "off"]) !!}
|
||||
<div class="selector_list">
|
||||
<ul class="selector_choices" >
|
||||
@foreach ($userModels as $userModel)
|
||||
<li data-value="{{$userModel->id}}" >{{$userModel->firstname}} {{$userModel->lastname}}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<ul class="selector_values" >
|
||||
@foreach ($brand->users as $user)
|
||||
<li data-value="{{$user->id}}" >{{$user->firstname}} {{$user->lastname}}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<input class="selector_dataValues" type="hidden" name="users" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="button-row">
|
||||
{!! Form::submit('Enregistrer', [ 'class' => 'btn']) !!} <a href="{{ route('brands.index') }}" class="btn btn-black ml-10">Retour</a>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</main>
|
||||
@endsection
|
||||
48
resources/views/brands/index.blade.php
Normal file
48
resources/views/brands/index.blade.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
@extends('layouts.app')
|
||||
@include('layouts.header')
|
||||
@section('content')
|
||||
<main class="brand_index template_2col">
|
||||
@include('modules.param-sideMenu')
|
||||
<div class="main_content">
|
||||
@include('modules.flashMessage')
|
||||
<div class="heading">
|
||||
<h1>{{ __('Gestion des marques') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="filter_row group">
|
||||
<div class="right_col">
|
||||
<input type="text" value="" class="filter_brand_input">
|
||||
<a href="#" class="btn btn-black filter_brand_btn">Rechercher une marque</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>CODE</th>
|
||||
<th>LIBELLE</th>
|
||||
<th>ACTIONS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach ($brands as $brand)
|
||||
<tr class="data_row">
|
||||
<td>{{ $brand->codMarq }}</td>
|
||||
<td>{{ $brand->libMarq }}</td>
|
||||
<td>
|
||||
<a href="{{ route('brands.editUsers', $brand) }}" class="btn" title="{{ __('Gérer les relations avec les utilisateurs') }}">
|
||||
{{ __('Gérer les utilisateurs') }}
|
||||
<i class="fas fa-users-cog"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
@endsection
|
||||
|
|
@ -7,6 +7,10 @@
|
|||
'marques' => $marques,
|
||||
'etiquettes' => $etiquettes,
|
||||
'copyrights' => $copyrights,
|
||||
'naturesfichier' => $naturesfichier,
|
||||
'typescontenu' => $typescontenu,
|
||||
'anglesprisevue' => $anglesprisevue,
|
||||
'tags' => $tags,
|
||||
];
|
||||
if(session('autoOpen')) {
|
||||
$dataVue['open'] = session('autoOpen');
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@
|
|||
<span>{{ __('Gestion des utilisateur') }}s</span>
|
||||
<i class="fas fa-users-cog"></i>
|
||||
</a>
|
||||
<a @if(request()->routeIs('brands.*')) class="active" @endif href="{{ route('brands.index') }}">
|
||||
<span>{{ __('Gestion des marques') }}</span>
|
||||
<i class="fas fa-building"></i>
|
||||
</a>
|
||||
<a @if(request()->routeIs('dossier.*')) class="active" @endif href="{{ route('dossier.index') }}">
|
||||
<span>{{ __('Gestion des dossiers') }}</span>
|
||||
<i class="fa-solid fa-folder"></i>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use App\Http\Controllers\ArcadiaLinkController;
|
||||
use App\Http\Controllers\ArticleController;
|
||||
use App\Http\Controllers\BrandController;
|
||||
use App\Http\Controllers\CommonController;
|
||||
use App\Http\Controllers\DossierController;
|
||||
use App\Http\Controllers\MediaController;
|
||||
|
|
@ -57,6 +58,9 @@ Route::group(['middleware' => ['auth']], function () {
|
|||
|
||||
// * Back office .
|
||||
Route::resource('user', UserController::class);
|
||||
Route::get('/brands', [BrandController::class, 'index'])->name('brands.index');
|
||||
Route::get('/brands/{brand}/edit-users', [BrandController::class, 'editUsers'])->name('brands.editUsers');
|
||||
Route::put('/brands/{brand}/edit-users', [BrandController::class, 'updateUsers'])->name('brands.updateUsers');
|
||||
Route::resource('arcadialinks', ArcadiaLinkController::class)->only(['index', 'destroy']);
|
||||
Route::resource('dossier', DossierController::class)->except('show');
|
||||
Route::get('/recovery', [RecoveryController::class, 'index'])->name('recovery.index');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue