diff --git a/app/Http/Controllers/MediaController.php b/app/Http/Controllers/MediaController.php index 6ba47b4..26b0d8e 100644 --- a/app/Http/Controllers/MediaController.php +++ b/app/Http/Controllers/MediaController.php @@ -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,14 @@ 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(); /** @var int|null */ $dossier_id = $request->d; @@ -122,6 +128,9 @@ class MediaController extends Controller return view('media_manager')->with([ 'sujets' => $sujets, 'typesmedia' => $typesmedia, + 'naturesfichier' => $naturesfichier, + 'typescontenu' => $typescontenu, + 'anglesprisevue' => $anglesprisevue, 'langues' => $langues, 'copyrights' => $copyrights, 'etiquettes' => $etiquettes, diff --git a/app/Http/Requests/Bo/Ajax/UpdateMediaRequest.php b/app/Http/Requests/Bo/Ajax/UpdateMediaRequest.php index 14de2ad..57bad0d 100644 --- a/app/Http/Requests/Bo/Ajax/UpdateMediaRequest.php +++ b/app/Http/Requests/Bo/Ajax/UpdateMediaRequest.php @@ -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) { diff --git a/app/Lib/ArcadiaLinkUtilities.php b/app/Lib/ArcadiaLinkUtilities.php index 9a96b80..7273b1b 100644 --- a/app/Lib/ArcadiaLinkUtilities.php +++ b/app/Lib/ArcadiaLinkUtilities.php @@ -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')) diff --git a/app/Models/ArcadiaAnglePriseVue.php b/app/Models/ArcadiaAnglePriseVue.php new file mode 100644 index 0000000..2d052ca --- /dev/null +++ b/app/Models/ArcadiaAnglePriseVue.php @@ -0,0 +1,27 @@ +hasMany(Media::class); + } +} diff --git a/app/Models/ArcadiaNatureFichier.php b/app/Models/ArcadiaNatureFichier.php new file mode 100644 index 0000000..5162b32 --- /dev/null +++ b/app/Models/ArcadiaNatureFichier.php @@ -0,0 +1,27 @@ +hasMany(Media::class); + } +} diff --git a/app/Models/ArcadiaTypeContenu.php b/app/Models/ArcadiaTypeContenu.php new file mode 100644 index 0000000..c00f17f --- /dev/null +++ b/app/Models/ArcadiaTypeContenu.php @@ -0,0 +1,27 @@ +hasMany(Media::class); + } +} diff --git a/app/Models/Media.php b/app/Models/Media.php index b65a88c..6b5ddff 100644 --- a/app/Models/Media.php +++ b/app/Models/Media.php @@ -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. diff --git a/database/migrations/2026_05_06_144656_create_nature_fichiers_table.php b/database/migrations/2026_05_06_144656_create_nature_fichiers_table.php new file mode 100644 index 0000000..7a71198 --- /dev/null +++ b/database/migrations/2026_05_06_144656_create_nature_fichiers_table.php @@ -0,0 +1,51 @@ +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'); + } +}; diff --git a/database/migrations/2026_05_06_144713_create_angle_prise_vues_table.php b/database/migrations/2026_05_06_144713_create_angle_prise_vues_table.php new file mode 100644 index 0000000..e22c5b7 --- /dev/null +++ b/database/migrations/2026_05_06_144713_create_angle_prise_vues_table.php @@ -0,0 +1,55 @@ +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'); + } +}; diff --git a/database/migrations/2026_05_06_144729_create_type_contenus_table.php b/database/migrations/2026_05_06_144729_create_type_contenus_table.php new file mode 100644 index 0000000..8e8be3f --- /dev/null +++ b/database/migrations/2026_05_06_144729_create_type_contenus_table.php @@ -0,0 +1,55 @@ +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'); + } +}; diff --git a/database/migrations/2026_05_06_153355_add_new_relations_to_media.php b/database/migrations/2026_05_06_153355_add_new_relations_to_media.php new file mode 100644 index 0000000..62f2314 --- /dev/null +++ b/database/migrations/2026_05_06_153355_add_new_relations_to_media.php @@ -0,0 +1,55 @@ +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', + ]); + }); + } +}; diff --git a/resources/js/components/media-manager/media-editor/MmEditComponent.vue b/resources/js/components/media-manager/media-editor/MmEditComponent.vue index e506a9c..53a4819 100644 --- a/resources/js/components/media-manager/media-editor/MmEditComponent.vue +++ b/resources/js/components/media-manager/media-editor/MmEditComponent.vue @@ -89,6 +89,9 @@ :marques="marques" :etiquettes="etiquettes" :copyrights="copyrights" + :naturesfichier="naturesfichier" + :typescontenu="typescontenu" + :anglesprisevue="anglesprisevue" @closeEdit="close" /> @@ -125,6 +128,9 @@ 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; if (this.open !== undefined) { this.$store.commit({ type: "updateMedia", @@ -163,6 +169,9 @@ export default { marques: [], etiquettes: [], copyrights: [], + naturesfichier: [], + typescontenu: [], + anglesprisevue: [], }; }, watch: { diff --git a/resources/js/components/media-manager/media-editor/tabs/MeEditComponent.vue b/resources/js/components/media-manager/media-editor/tabs/MeEditComponent.vue index 81aff6e..3c485de 100644 --- a/resources/js/components/media-manager/media-editor/tabs/MeEditComponent.vue +++ b/resources/js/components/media-manager/media-editor/tabs/MeEditComponent.vue @@ -98,6 +98,66 @@ +
+ + +
+
+ + +
+
+ + +