Merge branch 'trunk'
This commit is contained in:
commit
89973ff2a0
24 changed files with 71448 additions and 363 deletions
47
app/Console/Commands/SendMediasModificationsReport.php
Normal file
47
app/Console/Commands/SendMediasModificationsReport.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Jobs\SendMediasModificationsReport as JobsSendMediasModificationsReport;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class SendMediasModificationsReport extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'medias:sendreport';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Run the SendMediasModificationsReport Manually';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->info('Running the Job, this could take some time.');
|
||||
$job = new JobsSendMediasModificationsReport();
|
||||
$job->console = $this;
|
||||
$job->handle();
|
||||
$this->info('Job completed');
|
||||
}
|
||||
}
|
||||
49
app/Console/Commands/reindexElasticOneMedia.php
Normal file
49
app/Console/Commands/reindexElasticOneMedia.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Media;
|
||||
|
||||
class reindexElasticOneMedia extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'medias:reindexone {media_id}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->info('Reindexation du media '.$this->argument('media_id').' dans Elasticsearch...');
|
||||
$media = Media::withTrashed()->find($this->argument('media_id'));
|
||||
$esExist = Media::searchByQuery(array('match' => array('arcadia_id' => "$media->arcadia_id")));
|
||||
if ($esExist->totalHits() > 0) {
|
||||
$media->removeFromIndex();
|
||||
}
|
||||
$media->addToIndex();
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Auth;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Models\Sujet;
|
||||
use App\Models\Setting;
|
||||
use App\Models\Format;
|
||||
use App\Models\Media;
|
||||
use App\Models\Typemedia;
|
||||
|
|
@ -23,6 +24,7 @@ use App\Models\Recherche;
|
|||
use App\Models\Historique;
|
||||
use App\Models\Panier;
|
||||
use App\Http\Traits\MediaTools;
|
||||
use App\Models\FormatRestriction;
|
||||
|
||||
class MediaController extends Controller
|
||||
{
|
||||
|
|
@ -902,6 +904,8 @@ class MediaController extends Controller
|
|||
$n->taille = $this->formatBytes($this->get_file_size($destinationPath . $filename));
|
||||
|
||||
$im = new \imagick($destinationPath . $filename);
|
||||
//pour dev sous windows (pour cause de bug sur imagick avec les chemins relatifs)
|
||||
//$im = new \imagick(realpath($destinationPath.$filename));
|
||||
$resolutions = $im->getImageResolution();
|
||||
$n->resolution = round($resolutions['x'] * 2.54, 2);
|
||||
$imageprops = $im->getImageGeometry();
|
||||
|
|
@ -976,11 +980,108 @@ class MediaController extends Controller
|
|||
return json_encode($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérification des clés pour liaison arcadia avant création, mise à jour
|
||||
*
|
||||
*/
|
||||
public function checkRefKey(Request $request)
|
||||
{
|
||||
Auth::user()->authorizeRoles([config('roles.const.ADMIN')]);
|
||||
$media_id = $request->input('media_id');
|
||||
$media = Media::find($media_id);
|
||||
//il faut check les dimensions de l'image
|
||||
//pour les cas sujet, type vue, type media qui nous interesse
|
||||
$code_sujet = $media->sujet_id;
|
||||
$type_vue = $media->typevue_id;
|
||||
$type_media = $media->typemedia_id;
|
||||
$extension = $media->extension;
|
||||
$largeur = $media->largeur;
|
||||
$hauteur = $media->hauteur;
|
||||
|
||||
//on récupère les restrictions par défaut
|
||||
$defaultwidth = Setting::where('key', 'default_size_restriction_width')->first();
|
||||
if(empty($defaultwidth->value)) {
|
||||
$checkwidth = null;
|
||||
} else {
|
||||
$checkwidth = $defaultwidth->value;
|
||||
}
|
||||
|
||||
$defaultheight = Setting::where('key', 'default_size_restriction_height')->first();
|
||||
if(empty($defaultheight->value)) {
|
||||
$checkheight = null;
|
||||
} else {
|
||||
$checkheight = $defaultheight->value;
|
||||
}
|
||||
|
||||
$defaultmime = Setting::where('key', 'default_mime_restriction')->first();
|
||||
if(empty($defaultmime->value)) {
|
||||
$checkmime = array();
|
||||
} else {
|
||||
$checkmime = explode(',', $defaultmime->value);
|
||||
}
|
||||
|
||||
//si on est sur un sujet arcadia (donc pas le sujet Groupe par exemple)
|
||||
if ($media->sujet->sujet_arcadia) {
|
||||
//le check est requis
|
||||
$format_restriction = FormatRestriction::query();
|
||||
$format_restriction = $format_restriction->selectRaw(
|
||||
'*,(CASE WHEN ISNULL(sujet_id) THEN 0 ELSE 3 END) + (CASE WHEN ISNULL(typevues_id) THEN 0 ELSE 2 END) + (CASE WHEN ISNULL(typemedias_id) THEN 0 ELSE 1 END) AS wght')
|
||||
->where(
|
||||
function ($q) use ($code_sujet) {
|
||||
$q->where('sujet_id', $code_sujet)
|
||||
->orWhereNull('sujet_id');
|
||||
})
|
||||
->where(
|
||||
function ($q) use ($type_vue) {
|
||||
$q->where('typevues_id', $type_vue)
|
||||
->orWhereNull('typevues_id');
|
||||
})
|
||||
->where(
|
||||
function ($q) use ($type_media) {
|
||||
$q->where('typemedias_id', $type_media)
|
||||
->orWhereNull('typemedias_id');
|
||||
})
|
||||
->orderBy('wght', 'DESC');
|
||||
|
||||
$format_restriction = $format_restriction->first();
|
||||
|
||||
if(!$format_restriction) {
|
||||
//aucune nouvelle restriction trouvée
|
||||
} else {
|
||||
$checkwidth = $format_restriction->in_width;
|
||||
$checkheight = $format_restriction->in_height;
|
||||
if(empty($format_restriction->in_mimes)) {
|
||||
$checkmime = array();
|
||||
} else {
|
||||
$checkmime = explode(',', $format_restriction->in_mimes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//vérification du mime
|
||||
if(in_array($extension, $checkmime) || empty($checkmime)) {
|
||||
//pass
|
||||
//verification de la largeur
|
||||
if($largeur == $checkwidth || is_null($checkwidth)) {
|
||||
//pass
|
||||
//vérification hauteur
|
||||
if($hauteur == $checkheight || is_null($checkheight)) {
|
||||
//pass
|
||||
//tout est OK
|
||||
} else {
|
||||
//fail hauteur
|
||||
return json_encode(array('status' => false, 'error' => "Les dimensions requises sont 1800px par 1800px, veuillez charger un autre média"));
|
||||
}
|
||||
} else {
|
||||
//fail largeur
|
||||
return json_encode(array('status' => false, 'error' => "Les dimensions requises sont 1800px par 1800px, veuillez charger un autre média"));
|
||||
}
|
||||
} else {
|
||||
//fail type de fichier
|
||||
return json_encode(array('status' => false, 'error' => "Le type de fichier doit être ". implode(', ', $checkmime) .", veuillez charger un autre média"));
|
||||
}
|
||||
}
|
||||
|
||||
if ($media) {
|
||||
$refs = ArcadiaLink::getRefKey($media);
|
||||
if (count($refs) > 0){
|
||||
|
|
|
|||
|
|
@ -12,294 +12,107 @@ use App\Models\Historique;
|
|||
use App\Http\Traits\MediaTools;
|
||||
|
||||
|
||||
class UploadController extends Controller {
|
||||
class UploadController extends Controller
|
||||
{
|
||||
|
||||
use MediaTools;
|
||||
use MediaTools;
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
// ---- Vérification du token de sécurité
|
||||
$token = $request->get('token');
|
||||
if($token != env('TOKEN_DEPOT', "c8c4613a-236c-4b06-95f6-a9c9c6c18861")) return abort(404);
|
||||
public function index(Request $request)
|
||||
{
|
||||
// ---- Vérification du token de sécurité
|
||||
$token = $request->get('token');
|
||||
if($token != env('TOKEN_DEPOT', "c8c4613a-236c-4b06-95f6-a9c9c6c18861")) { return abort(404);
|
||||
}
|
||||
|
||||
$sites = Site::orderBy('libelle')->get();
|
||||
return view('upload.show')->with([
|
||||
'sites'=> $sites,
|
||||
]);
|
||||
}
|
||||
$sites = Site::orderBy('libelle')->get();
|
||||
return view('upload.show')->with(
|
||||
[
|
||||
'sites'=> $sites,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function storeMedia(Request $request)
|
||||
{
|
||||
$uid = $request->input('uid');
|
||||
$sujet_id = $request->input('sujet_id');
|
||||
$dossier_id = $request->input('dossier_id');
|
||||
$replaceMediaId = $request->input('replaceMediaId');
|
||||
if($dossier_id == 0) $dossier_id = NULL;
|
||||
|
||||
$headers = $request->headers->all();
|
||||
$acceptFileTypes = array('gif','jpeg', 'jpg','png','mp4','mp3','psd','ai','svg','pdf');
|
||||
|
||||
if ($request->hasFile('files')) {
|
||||
$filesa = [];
|
||||
$file = $request->file('files');
|
||||
|
||||
foreach($file as $files){
|
||||
$is_last_chunk = false;
|
||||
$is_chunked_upload = !empty($headers['content-range']);
|
||||
if ($is_chunked_upload) {
|
||||
if (preg_match('|(\d+)/(\d+)|', $headers['content-range'][0], $range)) {
|
||||
if ($range[1] == $range[2] - 1) {
|
||||
$is_last_chunk = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$extension = strtolower($files->getClientOriginalExtension());
|
||||
$originalName = str_replace( ".".$extension, "", $files->getClientOriginalName());
|
||||
if (!in_array($extension, $acceptFileTypes)) return array("false");
|
||||
|
||||
if($is_chunked_upload){
|
||||
$filename = $uid."_".$range[1].".".$extension;
|
||||
}else{
|
||||
$filename = $uid.'.'.$extension;
|
||||
}
|
||||
|
||||
$uploadPath = public_path() . '/uploads/';
|
||||
$files->move($uploadPath, $filename);
|
||||
|
||||
// si c'est le dernier morceux d'un fichier
|
||||
if($is_last_chunk){
|
||||
if($dossier = opendir($uploadPath)){
|
||||
$dirFiles = array();
|
||||
// on compile tous les chunk du fichier
|
||||
while(false !== ($fichier = readdir($dossier))){
|
||||
if($fichier != '.' && $fichier != '..' ){
|
||||
if(strpos($fichier,$uid) !== false){
|
||||
$dirFiles[$fichier] = str_replace(".".$extension, "", str_replace($uid."_", "", $fichier));
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dossier);
|
||||
// on les trie pour les assembler dans le bon ordre
|
||||
asort ($dirFiles, SORT_NUMERIC );
|
||||
// on les assemble dans un fichier final
|
||||
$filename = $uid . '.' . $extension;
|
||||
foreach($dirFiles as $key => $fichier) {
|
||||
$file = fopen($uploadPath.$key, 'rb');
|
||||
$buff = fread($file, filesize($uploadPath.$key));
|
||||
fclose($file);
|
||||
|
||||
$final = fopen($uploadPath.$filename, 'a');
|
||||
$write = fwrite($final, $buff);
|
||||
fclose($final);
|
||||
|
||||
unlink($uploadPath.$key);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// si c'est le dernier morceau d'un fichier ou que c'est un envoi simple
|
||||
if($is_last_chunk || !$is_chunked_upload ){
|
||||
|
||||
$destinationPath = $this->get_mediaFolder()."/";
|
||||
|
||||
// si on upload un média pour remplacer un fichier par un autre
|
||||
if($replaceMediaId != 0){
|
||||
// on récupère le média à modifier
|
||||
$media= Media::where('id', $replaceMediaId)->first();
|
||||
|
||||
// On déplace le fichier dans le répertoire des médias
|
||||
Storage::move("uploads/".$filename, $destinationPath.$filename);
|
||||
|
||||
// supprime les fichiers médias stockés sur disque
|
||||
$filesfF= Storage::files($media->folder."/");
|
||||
$filepath = preg_quote($media->folder.$media->uid, '/');
|
||||
$matchingFiles = preg_grep('/^'.$filepath.'/', $filesfF);
|
||||
Storage::delete($matchingFiles);
|
||||
|
||||
$media->isDefault = 0;
|
||||
$media->save();
|
||||
|
||||
}else{
|
||||
// On déplace le fichier dans le répertoire des médias
|
||||
Storage::move("uploads/".$filename, $destinationPath.$filename);
|
||||
|
||||
// on créé un média en bdd
|
||||
$media = new Media();
|
||||
$media->dossier_id = $dossier_id;
|
||||
$media->sujet_id = $sujet_id;
|
||||
// Par défaut FR
|
||||
$media->langue_id = 1;
|
||||
// Par défaut propriété de la marque
|
||||
$media->copyright_id = 3;
|
||||
}
|
||||
|
||||
$media->extension = $extension;
|
||||
$media->folder = $destinationPath;
|
||||
if($replaceMediaId == 0){
|
||||
$media->libelle = mb_substr($originalName, 0, 50, "UTF-8");
|
||||
$media->created_by= Auth::user()->id;
|
||||
}
|
||||
$media->uid = $uid;
|
||||
$media->taille = $this->formatBytes($this->get_file_size($destinationPath.$filename));
|
||||
|
||||
switch ($extension) {
|
||||
// Photo (1)
|
||||
case 'gif':
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
case 'png':
|
||||
case 'ai':
|
||||
case 'pdf':
|
||||
case 'psd':
|
||||
$media->typemedia_id = 1;
|
||||
$im = new \imagick($destinationPath.$filename);
|
||||
|
||||
if(in_array($extension, array("pdf", "ai", "psd", "gif")) ){
|
||||
$im->setIteratorIndex(0);
|
||||
}
|
||||
|
||||
$resolutions = $im->getImageResolution();
|
||||
$media->resolution = round($resolutions['x'] * 2.54);
|
||||
$imageprops = $im->getImageGeometry();
|
||||
$media->largeur = $imageprops['width'];
|
||||
$media->hauteur = $imageprops['height'];
|
||||
|
||||
if($media->resolution != 0){
|
||||
$media->largeur_mm = ceil(($media->largeur * 2.54 / $media->resolution)*10);
|
||||
$media->hauteur_mm = ceil(($media->hauteur * 2.54 / $media->resolution)*10);
|
||||
}else{
|
||||
$media->largeur_mm = "";
|
||||
$media->hauteur_mm = "";
|
||||
}
|
||||
$media->save();
|
||||
$im->destroy();
|
||||
|
||||
// ---- Creation des vignettes de base
|
||||
$this->create_sys_thumb($media);
|
||||
// ---- Creation des vignettes en lien avec le sujet du média
|
||||
if(isset($sujet_id) ){
|
||||
$this->create_thumb($media);
|
||||
}
|
||||
break;
|
||||
// Illustration/Vectorielle (2)
|
||||
case 'svg':
|
||||
$media->typemedia_id = 2;
|
||||
$media->save();
|
||||
break;
|
||||
// Vidéo (3)
|
||||
case 'mp4':
|
||||
$media->typemedia_id =3 ;
|
||||
$getID3 = new \getID3;
|
||||
if($fileInfo = $getID3->analyze($destinationPath.$filename)){
|
||||
$media->largeur = $fileInfo['video']['resolution_x'];
|
||||
$media->hauteur = $fileInfo['video']['resolution_y'];
|
||||
$media->duree = $fileInfo['playtime_string'];
|
||||
}
|
||||
$media->save();
|
||||
break;
|
||||
// Audio (4)
|
||||
case 'mp3':
|
||||
$media->typemedia_id = 4;
|
||||
$getID3 = new \getID3;
|
||||
if($fileInfo = $getID3->analyze($destinationPath.$filename)){
|
||||
$media->duree= $fileInfo['playtime_string'];
|
||||
}
|
||||
$media->save();
|
||||
break;
|
||||
}
|
||||
|
||||
$id = $media->id;
|
||||
$media = Media::find($id);
|
||||
// ---- Index dans Elasticsearch
|
||||
$media = Media::where('id', $media->id)->first();
|
||||
$media->addToIndex();
|
||||
|
||||
// ---- Historique des actions
|
||||
$historique = new historique();
|
||||
if($user = Auth::user()){
|
||||
$historique->user_id = $user->id;
|
||||
}
|
||||
$historique->media_id = $media->id;
|
||||
if($replaceMediaId == 0){
|
||||
$historique->type = "Création";
|
||||
$historique->description = "Média ajouté";
|
||||
}else{
|
||||
$historique->type = "Modification";
|
||||
$historique->description = "Le média a été remplacé";
|
||||
}
|
||||
$historique->save();
|
||||
|
||||
$filest = array();
|
||||
$filest['name'] = $filename;
|
||||
$filest['uid'] = $uid;
|
||||
$filest['libelle'] = $media->libelle;
|
||||
$filest['id'] = $media->id;
|
||||
$filest['folder'] = $media->folder;
|
||||
$filest['extension'] = $media->extension;
|
||||
$filest['typemedia_id'] = $media->typemedia_id;
|
||||
|
||||
$filesa['files'][]=$filest;
|
||||
}
|
||||
}
|
||||
return $filesa;
|
||||
}
|
||||
}
|
||||
|
||||
public function storeMediaV2(Request $request)
|
||||
public function storeMedia(Request $request)
|
||||
{
|
||||
$uid = $request->input('uid');
|
||||
$sujet_id = $request->input('sujet_id');
|
||||
$dossier_id = $request->input('dossier_id');
|
||||
$replaceMediaId = $request->input('replaceMediaId');
|
||||
if($dossier_id == 0) $dossier_id = NULL;
|
||||
if($dossier_id == 0) { $dossier_id = null;
|
||||
}
|
||||
|
||||
$filesa = [];
|
||||
$headers = $request->headers->all();
|
||||
$acceptFileTypes = array('gif','jpeg', 'jpg','png','mp4','mp3','psd','ai','svg','pdf');
|
||||
|
||||
if (!$uid)
|
||||
$uid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
|
||||
if ($request->hasFile('files')) {
|
||||
$filesa = [];
|
||||
$file = $request->file('files');
|
||||
|
||||
$file = $request->file('files');
|
||||
if (!empty($file)) {
|
||||
$extension = strtolower($file->getClientOriginalExtension());
|
||||
$originalName = str_replace( ".".$extension, "", $file->getClientOriginalName());
|
||||
if (!in_array($extension, $acceptFileTypes)) return array("false");
|
||||
foreach($file as $files){
|
||||
$is_last_chunk = false;
|
||||
$is_chunked_upload = !empty($headers['content-range']);
|
||||
if ($is_chunked_upload) {
|
||||
if (preg_match('|(\d+)/(\d+)|', $headers['content-range'][0], $range)) {
|
||||
if ($range[1] == $range[2] - 1) {
|
||||
$is_last_chunk = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array($extension, $acceptFileTypes)) return array("error" => "Ce type de fichier n'est pas accepté.");
|
||||
$extension = strtolower($files->getClientOriginalExtension());
|
||||
$originalName = str_replace(".".$extension, "", $files->getClientOriginalName());
|
||||
if (!in_array($extension, $acceptFileTypes)) { return array("false");
|
||||
}
|
||||
|
||||
// check the error status
|
||||
if ($file->getError() != 0) {
|
||||
Log::error('error ' . $file->getError() . ' in file ' . $request->resumableFilename);
|
||||
}
|
||||
if($is_chunked_upload) {
|
||||
$filename = $uid."_".$range[1].".".$extension;
|
||||
}else{
|
||||
$filename = $uid.'.'.$extension;
|
||||
}
|
||||
|
||||
// init the destination file (format <filename.ext>.part<#chunk>
|
||||
// the file is stored in a temporary directory
|
||||
if(isset($request->resumableIdentifier) && trim($request->resumableIdentifier)!=''){
|
||||
$temp_dir = 'uploads/' . $request->resumableIdentifier;
|
||||
}
|
||||
$dest_file = $temp_dir . '/' . $request->resumableFilename . '.part' . $request->resumableChunkNumber;
|
||||
$uploadPath = public_path() . '/uploads/';
|
||||
$files->move($uploadPath, $filename);
|
||||
|
||||
// create the temporary directory
|
||||
if (!is_dir($temp_dir)) {
|
||||
mkdir($temp_dir, 0777, true);
|
||||
}
|
||||
// si c'est le dernier morceux d'un fichier
|
||||
if($is_last_chunk) {
|
||||
if($dossier = opendir($uploadPath)) {
|
||||
$dirFiles = array();
|
||||
// on compile tous les chunk du fichier
|
||||
while(false !== ($fichier = readdir($dossier))){
|
||||
if($fichier != '.' && $fichier != '..' ) {
|
||||
if(strpos($fichier, $uid) !== false) {
|
||||
$dirFiles[$fichier] = str_replace(".".$extension, "", str_replace($uid."_", "", $fichier));
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dossier);
|
||||
// on les trie pour les assembler dans le bon ordre
|
||||
asort($dirFiles, SORT_NUMERIC);
|
||||
// on les assemble dans un fichier final
|
||||
$filename = $uid . '.' . $extension;
|
||||
foreach($dirFiles as $key => $fichier) {
|
||||
$file = fopen($uploadPath.$key, 'rb');
|
||||
$buff = fread($file, filesize($uploadPath.$key));
|
||||
fclose($file);
|
||||
|
||||
// move the temporary file
|
||||
if (!move_uploaded_file($file->getPathname(), $dest_file)) {
|
||||
Log::error('Error saving (move_uploaded_file) chunk ' . $request->resumableChunkNumber.' for file ' . $request->resumableFilename);
|
||||
} else {
|
||||
$filename = $uid . '.' . $extension;
|
||||
// check if all the parts present, and create the final destination file
|
||||
$isLast = $this->createFileFromChunks($temp_dir, $request->resumableFilename, $request->resumableChunkSize, $request->resumableTotalSize, $request->resumableTotalChunks, $filename);
|
||||
if ($isLast){
|
||||
$final = fopen($uploadPath.$filename, 'a');
|
||||
$write = fwrite($final, $buff);
|
||||
fclose($final);
|
||||
|
||||
unlink($uploadPath.$key);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// si c'est le dernier morceau d'un fichier ou que c'est un envoi simple
|
||||
if($is_last_chunk || !$is_chunked_upload ) {
|
||||
|
||||
$destinationPath = $this->get_mediaFolder()."/";
|
||||
|
||||
// si on upload un média pour remplacer un fichier par un autre
|
||||
if($replaceMediaId != 0){
|
||||
if($replaceMediaId != 0) {
|
||||
// on récupère le média à modifier
|
||||
$media= Media::where('id', $replaceMediaId)->first();
|
||||
|
||||
|
|
@ -331,7 +144,7 @@ class UploadController extends Controller {
|
|||
|
||||
$media->extension = $extension;
|
||||
$media->folder = $destinationPath;
|
||||
if($replaceMediaId == 0){
|
||||
if($replaceMediaId == 0) {
|
||||
$media->libelle = mb_substr($originalName, 0, 50, "UTF-8");
|
||||
$media->created_by= Auth::user()->id;
|
||||
}
|
||||
|
|
@ -340,68 +153,68 @@ class UploadController extends Controller {
|
|||
|
||||
switch ($extension) {
|
||||
// Photo (1)
|
||||
case 'gif':
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
case 'png':
|
||||
case 'ai':
|
||||
case 'pdf':
|
||||
case 'psd':
|
||||
$media->typemedia_id = 1;
|
||||
$im = new \imagick($destinationPath.$filename);
|
||||
case 'gif':
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
case 'png':
|
||||
case 'ai':
|
||||
case 'pdf':
|
||||
case 'psd':
|
||||
$media->typemedia_id = 1;
|
||||
$im = new \imagick($destinationPath.$filename);
|
||||
|
||||
if(in_array($extension, array("pdf", "ai", "psd", "gif")) ){
|
||||
$im->setIteratorIndex(0);
|
||||
}
|
||||
if(in_array($extension, array("pdf", "ai", "psd", "gif")) ) {
|
||||
$im->setIteratorIndex(0);
|
||||
}
|
||||
|
||||
$resolutions = $im->getImageResolution();
|
||||
$media->resolution = round($resolutions['x'] * 2.54);
|
||||
$imageprops = $im->getImageGeometry();
|
||||
$media->largeur = $imageprops['width'];
|
||||
$media->hauteur = $imageprops['height'];
|
||||
$resolutions = $im->getImageResolution();
|
||||
$media->resolution = round($resolutions['x'] * 2.54);
|
||||
$imageprops = $im->getImageGeometry();
|
||||
$media->largeur = $imageprops['width'];
|
||||
$media->hauteur = $imageprops['height'];
|
||||
|
||||
if($media->resolution != 0){
|
||||
$media->largeur_mm = ceil(($media->largeur * 2.54 / $media->resolution)*10);
|
||||
$media->hauteur_mm = ceil(($media->hauteur * 2.54 / $media->resolution)*10);
|
||||
}else{
|
||||
$media->largeur_mm = "";
|
||||
$media->hauteur_mm = "";
|
||||
}
|
||||
$media->save();
|
||||
$im->destroy();
|
||||
if($media->resolution != 0) {
|
||||
$media->largeur_mm = ceil(($media->largeur * 2.54 / $media->resolution)*10);
|
||||
$media->hauteur_mm = ceil(($media->hauteur * 2.54 / $media->resolution)*10);
|
||||
}else{
|
||||
$media->largeur_mm = "";
|
||||
$media->hauteur_mm = "";
|
||||
}
|
||||
$media->save();
|
||||
$im->destroy();
|
||||
|
||||
// ---- Creation des vignettes de base
|
||||
$this->create_sys_thumb($media);
|
||||
// ---- Creation des vignettes en lien avec le sujet du média
|
||||
if(isset($sujet_id) ){
|
||||
$this->create_thumb($media);
|
||||
}
|
||||
break;
|
||||
// ---- Creation des vignettes de base
|
||||
$this->create_sys_thumb($media);
|
||||
// ---- Creation des vignettes en lien avec le sujet du média
|
||||
if(isset($sujet_id) ) {
|
||||
$this->create_thumb($media);
|
||||
}
|
||||
break;
|
||||
// Illustration/Vectorielle (2)
|
||||
case 'svg':
|
||||
$media->typemedia_id = 2;
|
||||
$media->save();
|
||||
break;
|
||||
case 'svg':
|
||||
$media->typemedia_id = 2;
|
||||
$media->save();
|
||||
break;
|
||||
// Vidéo (3)
|
||||
case 'mp4':
|
||||
$media->typemedia_id =3 ;
|
||||
$getID3 = new \getID3;
|
||||
if($fileInfo = $getID3->analyze($destinationPath.$filename)){
|
||||
$media->largeur = $fileInfo['video']['resolution_x'];
|
||||
$media->hauteur = $fileInfo['video']['resolution_y'];
|
||||
$media->duree = $fileInfo['playtime_string'];
|
||||
}
|
||||
$media->save();
|
||||
break;
|
||||
case 'mp4':
|
||||
$media->typemedia_id =3 ;
|
||||
$getID3 = new \getID3;
|
||||
if($fileInfo = $getID3->analyze($destinationPath.$filename)) {
|
||||
$media->largeur = $fileInfo['video']['resolution_x'];
|
||||
$media->hauteur = $fileInfo['video']['resolution_y'];
|
||||
$media->duree = $fileInfo['playtime_string'];
|
||||
}
|
||||
$media->save();
|
||||
break;
|
||||
// Audio (4)
|
||||
case 'mp3':
|
||||
$media->typemedia_id = 4;
|
||||
$getID3 = new \getID3;
|
||||
if($fileInfo = $getID3->analyze($destinationPath.$filename)){
|
||||
$media->duree= $fileInfo['playtime_string'];
|
||||
}
|
||||
$media->save();
|
||||
break;
|
||||
case 'mp3':
|
||||
$media->typemedia_id = 4;
|
||||
$getID3 = new \getID3;
|
||||
if($fileInfo = $getID3->analyze($destinationPath.$filename)) {
|
||||
$media->duree= $fileInfo['playtime_string'];
|
||||
}
|
||||
$media->save();
|
||||
break;
|
||||
}
|
||||
|
||||
$id = $media->id;
|
||||
|
|
@ -412,11 +225,209 @@ class UploadController extends Controller {
|
|||
|
||||
// ---- Historique des actions
|
||||
$historique = new historique();
|
||||
if($user = Auth::user()){
|
||||
if($user = Auth::user()) {
|
||||
$historique->user_id = $user->id;
|
||||
}
|
||||
$historique->media_id = $media->id;
|
||||
if($replaceMediaId == 0){
|
||||
if($replaceMediaId == 0) {
|
||||
$historique->type = "Création";
|
||||
$historique->description = "Média ajouté";
|
||||
}else{
|
||||
$historique->type = "Modification";
|
||||
$historique->description = "Le média a été remplacé";
|
||||
}
|
||||
$historique->save();
|
||||
|
||||
$filest = array();
|
||||
$filest['name'] = $filename;
|
||||
$filest['uid'] = $uid;
|
||||
$filest['libelle'] = $media->libelle;
|
||||
$filest['id'] = $media->id;
|
||||
$filest['folder'] = $media->folder;
|
||||
$filest['extension'] = $media->extension;
|
||||
$filest['typemedia_id'] = $media->typemedia_id;
|
||||
|
||||
$filesa['files'][]=$filest;
|
||||
}
|
||||
}
|
||||
return $filesa;
|
||||
}
|
||||
}
|
||||
|
||||
public function storeMediaV2(Request $request)
|
||||
{
|
||||
$uid = $request->input('uid');
|
||||
$sujet_id = $request->input('sujet_id');
|
||||
$dossier_id = $request->input('dossier_id');
|
||||
$replaceMediaId = $request->input('replaceMediaId');
|
||||
if($dossier_id == 0) { $dossier_id = null;
|
||||
}
|
||||
|
||||
$filesa = [];
|
||||
$acceptFileTypes = array('gif','jpeg', 'jpg','png','mp4','mp3','psd','ai','svg','pdf');
|
||||
|
||||
if (!$uid) {
|
||||
$uid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
|
||||
}
|
||||
|
||||
$file = $request->file('files');
|
||||
if (!empty($file)) {
|
||||
$extension = strtolower($file->getClientOriginalExtension());
|
||||
$originalName = str_replace(".".$extension, "", $file->getClientOriginalName());
|
||||
if (!in_array($extension, $acceptFileTypes)) { return array("false");
|
||||
}
|
||||
|
||||
if (!in_array($extension, $acceptFileTypes)) { return array("error" => "Ce type de fichier n'est pas accepté.");
|
||||
}
|
||||
|
||||
// check the error status
|
||||
if ($file->getError() != 0) {
|
||||
Log::error('error ' . $file->getError() . ' in file ' . $request->resumableFilename);
|
||||
}
|
||||
|
||||
// init the destination file (format <filename.ext>.part<#chunk>
|
||||
// the file is stored in a temporary directory
|
||||
if(isset($request->resumableIdentifier) && trim($request->resumableIdentifier)!='') {
|
||||
$temp_dir = 'uploads/' . $request->resumableIdentifier;
|
||||
}
|
||||
$dest_file = $temp_dir . '/' . $request->resumableFilename . '.part' . $request->resumableChunkNumber;
|
||||
|
||||
// create the temporary directory
|
||||
if (!is_dir($temp_dir)) {
|
||||
mkdir($temp_dir, 0777, true);
|
||||
}
|
||||
|
||||
// move the temporary file
|
||||
if (!move_uploaded_file($file->getPathname(), $dest_file)) {
|
||||
Log::error('Error saving (move_uploaded_file) chunk ' . $request->resumableChunkNumber.' for file ' . $request->resumableFilename);
|
||||
} else {
|
||||
$filename = $uid . '.' . $extension;
|
||||
// check if all the parts present, and create the final destination file
|
||||
$isLast = $this->createFileFromChunks($temp_dir, $request->resumableFilename, $request->resumableChunkSize, $request->resumableTotalSize, $request->resumableTotalChunks, $filename);
|
||||
if ($isLast) {
|
||||
|
||||
$destinationPath = $this->get_mediaFolder()."/";
|
||||
|
||||
// si on upload un média pour remplacer un fichier par un autre
|
||||
if($replaceMediaId != 0) {
|
||||
// on récupère le média à modifier
|
||||
$media= Media::where('id', $replaceMediaId)->first();
|
||||
|
||||
// On déplace le fichier dans le répertoire des médias
|
||||
Storage::move("uploads/".$filename, $destinationPath.$filename);
|
||||
|
||||
// supprime les fichiers médias stockés sur disque
|
||||
$filesfF= Storage::files($media->folder."/");
|
||||
$filepath = preg_quote($media->folder.$media->uid, '/');
|
||||
$matchingFiles = preg_grep('/^'.$filepath.'/', $filesfF);
|
||||
Storage::delete($matchingFiles);
|
||||
|
||||
$media->isDefault = 0;
|
||||
$media->save();
|
||||
|
||||
}else{
|
||||
// On déplace le fichier dans le répertoire des médias
|
||||
Storage::move("uploads/".$filename, $destinationPath.$filename);
|
||||
|
||||
// on créé un média en bdd
|
||||
$media = new Media();
|
||||
$media->dossier_id = $dossier_id;
|
||||
$media->sujet_id = $sujet_id;
|
||||
// Par défaut FR
|
||||
$media->langue_id = 1;
|
||||
// Par défaut propriété de la marque
|
||||
$media->copyright_id = 3;
|
||||
}
|
||||
|
||||
$media->extension = $extension;
|
||||
$media->folder = $destinationPath;
|
||||
if($replaceMediaId == 0) {
|
||||
$media->libelle = mb_substr($originalName, 0, 50, "UTF-8");
|
||||
$media->created_by= Auth::user()->id;
|
||||
}
|
||||
$media->uid = $uid;
|
||||
$media->taille = $this->formatBytes($this->get_file_size($destinationPath.$filename));
|
||||
|
||||
switch ($extension) {
|
||||
// Photo (1)
|
||||
case 'gif':
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
case 'png':
|
||||
case 'ai':
|
||||
case 'pdf':
|
||||
case 'psd':
|
||||
$media->typemedia_id = 1;
|
||||
$im = new \imagick($destinationPath . $filename);
|
||||
//$im = new \imagick(realpath($destinationPath.$filename));
|
||||
|
||||
if(in_array($extension, array("pdf", "ai", "psd", "gif")) ) {
|
||||
$im->setIteratorIndex(0);
|
||||
}
|
||||
|
||||
$resolutions = $im->getImageResolution();
|
||||
$media->resolution = round($resolutions['x'] * 2.54);
|
||||
$imageprops = $im->getImageGeometry();
|
||||
$media->largeur = $imageprops['width'];
|
||||
$media->hauteur = $imageprops['height'];
|
||||
|
||||
if($media->resolution != 0) {
|
||||
$media->largeur_mm = ceil(($media->largeur * 2.54 / $media->resolution)*10);
|
||||
$media->hauteur_mm = ceil(($media->hauteur * 2.54 / $media->resolution)*10);
|
||||
}else{
|
||||
$media->largeur_mm = "";
|
||||
$media->hauteur_mm = "";
|
||||
}
|
||||
$media->save();
|
||||
$im->destroy();
|
||||
|
||||
// ---- Creation des vignettes de base
|
||||
$this->create_sys_thumb($media);
|
||||
// ---- Creation des vignettes en lien avec le sujet du média
|
||||
if(isset($sujet_id) ) {
|
||||
$this->create_thumb($media);
|
||||
}
|
||||
break;
|
||||
// Illustration/Vectorielle (2)
|
||||
case 'svg':
|
||||
$media->typemedia_id = 2;
|
||||
$media->save();
|
||||
break;
|
||||
// Vidéo (3)
|
||||
case 'mp4':
|
||||
$media->typemedia_id =3 ;
|
||||
$getID3 = new \getID3;
|
||||
if($fileInfo = $getID3->analyze($destinationPath.$filename)) {
|
||||
$media->largeur = $fileInfo['video']['resolution_x'];
|
||||
$media->hauteur = $fileInfo['video']['resolution_y'];
|
||||
$media->duree = $fileInfo['playtime_string'];
|
||||
}
|
||||
$media->save();
|
||||
break;
|
||||
// Audio (4)
|
||||
case 'mp3':
|
||||
$media->typemedia_id = 4;
|
||||
$getID3 = new \getID3;
|
||||
if($fileInfo = $getID3->analyze($destinationPath.$filename)) {
|
||||
$media->duree= $fileInfo['playtime_string'];
|
||||
}
|
||||
$media->save();
|
||||
break;
|
||||
}
|
||||
|
||||
$id = $media->id;
|
||||
$media = Media::find($id);
|
||||
// ---- Index dans Elasticsearch
|
||||
$media = Media::where('id', $media->id)->first();
|
||||
$media->addToIndex();
|
||||
|
||||
// ---- Historique des actions
|
||||
$historique = new historique();
|
||||
if($user = Auth::user()) {
|
||||
$historique->user_id = $user->id;
|
||||
}
|
||||
$historique->media_id = $media->id;
|
||||
if($replaceMediaId == 0) {
|
||||
$historique->type = "Création";
|
||||
$historique->description = "Média ajouté";
|
||||
}else{
|
||||
|
|
@ -432,16 +443,17 @@ class UploadController extends Controller {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Check if all the parts exist, and
|
||||
* gather all the parts of the file together
|
||||
* @param string $temp_dir - the temporary directory holding all the parts of the file
|
||||
* @param string $fileName - the original file name
|
||||
* @param string $chunkSize - each chunk size (in bytes)
|
||||
* @param string $totalSize - original file size (in bytes)
|
||||
*
|
||||
* @param string $temp_dir - the temporary directory holding all the parts of the file
|
||||
* @param string $fileName - the original file name
|
||||
* @param string $chunkSize - each chunk size (in bytes)
|
||||
* @param string $totalSize - original file size (in bytes)
|
||||
* @return bool
|
||||
*/
|
||||
private function createFileFromChunks($temp_dir, $fileName, $chunkSize, $totalSize, $total_files, $finalName) {
|
||||
private function createFileFromChunks($temp_dir, $fileName, $chunkSize, $totalSize, $total_files, $finalName)
|
||||
{
|
||||
|
||||
// count all the parts of this file
|
||||
$total_files_on_server_size = 0;
|
||||
|
|
@ -479,12 +491,13 @@ class UploadController extends Controller {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Delete a directory RECURSIVELY
|
||||
*
|
||||
* @param string $dir - directory path
|
||||
* @link http://php.net/manual/en/function.rmdir.php
|
||||
* @link http://php.net/manual/en/function.rmdir.php
|
||||
*/
|
||||
private function rrmdir($dir) {
|
||||
private function rrmdir($dir)
|
||||
{
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
|
|
|
|||
62
app/Jobs/SendMediasModificationsReport.php
Normal file
62
app/Jobs/SendMediasModificationsReport.php
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\Media;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use App\Mail\SendMediaReportMail;
|
||||
use App\Models\Sujet;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
|
||||
class SendMediasModificationsReport implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//Gather Medias to report
|
||||
//filtered by subject (2,4)
|
||||
$now = Carbon::now();
|
||||
$yesterday = $now->subDay(1);
|
||||
$arSujets = [];
|
||||
$onesujet = Sujet::find(2);
|
||||
array_push($arSujets, $onesujet->libelle);
|
||||
$onesujet = Sujet::find(4);
|
||||
array_push($arSujets, $onesujet->libelle);
|
||||
|
||||
$sujets = implode(', ', $arSujets);
|
||||
|
||||
$medias = Media::whereDate('updated_at', '>=', $yesterday)
|
||||
->whereIn('sujet_id', [2,4])
|
||||
->get();
|
||||
//send mail
|
||||
$toMailSetting = Setting::where('key', 'media_report_to_mail')->first();
|
||||
if(empty($toMailSetting->value)) {
|
||||
//pas d'envoi car pas de mail cible
|
||||
} else {
|
||||
$email = $toMailSetting->value;
|
||||
Mail::to($email)->send(new SendMediaReportMail($medias,$yesterday,$sujets));
|
||||
}
|
||||
}
|
||||
}
|
||||
41
app/Mail/SendMediaReportMail.php
Normal file
41
app/Mail/SendMediaReportMail.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class SendMediaReportMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($medias,$yesterday,$sujets)
|
||||
{
|
||||
$this->medias = $medias;
|
||||
$this->yesterday = $yesterday;
|
||||
$this->sujets = $sujets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$now = Carbon::now();
|
||||
$medias = $this->medias;
|
||||
$yesterday = $this->yesterday;
|
||||
$sujets = $this->sujets;
|
||||
|
||||
return $this->subject("Rapport d'activité DAM - " . $now->formatLocalized('%d %B %Y à %H:%M'))->view('mails.send-media-report', compact('medias','yesterday','sujets'));
|
||||
}
|
||||
}
|
||||
10
app/Models/FormatRestriction.php
Normal file
10
app/Models/FormatRestriction.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FormatRestriction extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
10
app/Models/Setting.php
Normal file
10
app/Models/Setting.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Setting extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
|
|
@ -26,5 +26,13 @@ class AppServiceProvider extends ServiceProvider
|
|||
if($this->app->environment("prod")){
|
||||
\URL::forceScheme("https");
|
||||
}
|
||||
|
||||
if (config('app.env') !== 'local') {
|
||||
setlocale(LC_TIME, config('app.locale') . "_" . strtoupper(config('app.locale')) . '.utf8');
|
||||
}
|
||||
|
||||
if (config('app.env') === 'local') {
|
||||
setlocale(LC_TIME, strtoupper(config('app.locale')) . "_" . config('app.locale') . '.utf8');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ class CreateMarquesTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::create('marques', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->bigIncrements('codMarq');
|
||||
$table->string('libMarq', 50);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateFormatRestrictionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('format_restrictions', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('sujet_id')->nullable();
|
||||
$table->foreign('sujet_id')
|
||||
->references('codeSujet')->on('sujets');
|
||||
$table->unsignedBigInteger('typevues_id')->nullable();
|
||||
$table->foreign('typevues_id')
|
||||
->references('codeTypevue')->on('typevues');
|
||||
$table->unsignedBigInteger('typemedias_id')->nullable();
|
||||
$table->foreign('typemedias_id')
|
||||
->references('codeTypemedia')->on('typemedias');
|
||||
$table->integer('in_mimes')->nullable();
|
||||
$table->integer('in_width')->nullable();
|
||||
$table->integer('in_height')->nullable();
|
||||
$table->integer('out_mimes')->nullable();
|
||||
$table->integer('out_width')->nullable();
|
||||
$table->integer('out_height')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('format_restrictions');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\SettingsSeeder;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('key');
|
||||
$table->string('value');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
$seeder = new SettingsSeeder;
|
||||
$seeder->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('settings');
|
||||
}
|
||||
}
|
||||
37
database/seeds/SettingsSeeder.php
Normal file
37
database/seeds/SettingsSeeder.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SettingsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$default_width = new Setting();
|
||||
$default_width->key = "default_size_restriction_width";
|
||||
$default_width->value = "1800";
|
||||
$default_width->save();
|
||||
|
||||
$default_height = new Setting();
|
||||
$default_height->key = "default_size_restriction_height";
|
||||
$default_height->value = "1800";
|
||||
$default_height->save();
|
||||
|
||||
$default_mime = new Setting();
|
||||
$default_mime->key = "default_mime_restriction";
|
||||
$default_mime->value = "png";
|
||||
$default_mime->save();
|
||||
|
||||
$media_report_to_mail = new Setting();
|
||||
$media_report_to_mail->key = "media_report_to_mail";
|
||||
$media_report_to_mail->value = "blandine.durand-gratian@ldc.fr";
|
||||
$media_report_to_mail->save();
|
||||
}
|
||||
}
|
||||
15637
public/css/app.css
vendored
15637
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
54604
public/js/app.js
vendored
54604
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
6
resources/js/app.js
vendored
6
resources/js/app.js
vendored
|
|
@ -99,7 +99,8 @@ const store = new Vuex.Store({
|
|||
typesvariantes: [],
|
||||
formats: [],
|
||||
grabbed: [],
|
||||
baskets: []
|
||||
baskets: [],
|
||||
mediaTab: 'preview'
|
||||
},
|
||||
mutations: {
|
||||
Reload (state, payload) {
|
||||
|
|
@ -134,6 +135,9 @@ const store = new Vuex.Store({
|
|||
},
|
||||
updateFormats (state, payload) {
|
||||
state.formats = payload.formats;
|
||||
},
|
||||
changeMediaTab (state,payload) {
|
||||
state.mediaTab = payload.tab;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -140,6 +140,11 @@
|
|||
type: 'updateMedia',
|
||||
media: response.data.datas
|
||||
});
|
||||
//switch to edit tab
|
||||
this.$store.commit({
|
||||
type: 'changeMediaTab',
|
||||
tab: 'edit'
|
||||
});
|
||||
} else {
|
||||
$.fancyMessage({title: "Dupliquer un média", message: response.data.error, type: "error"});
|
||||
}
|
||||
|
|
@ -264,6 +269,7 @@
|
|||
|
||||
this.r.on('fileAdded', this.uploadFileAdded);
|
||||
this.r.on('fileSuccess', this.uploadFileSuccess);
|
||||
this.r.on('fileError', this.uploadFileError);
|
||||
this.r.on('complete', this.uploadFileComplete);
|
||||
this.r.assignBrowse(this.$refs.fileupload);
|
||||
},
|
||||
|
|
@ -283,10 +289,6 @@
|
|||
uploadFileSuccess(file, message) {
|
||||
this.uploadedFiles.push(JSON.parse(message));
|
||||
this.removeFile(file);
|
||||
},
|
||||
uploadFileComplete() {
|
||||
this.closeUploadFrom();
|
||||
this.$loading.hide();
|
||||
$.fancybox.close();
|
||||
$.fancybox.open({
|
||||
src : '#ListUploadedFiles',
|
||||
|
|
@ -297,6 +299,35 @@
|
|||
animationEffect : 'material',
|
||||
}
|
||||
});
|
||||
console.log('file success');
|
||||
},
|
||||
uploadFileComplete() {
|
||||
this.closeUploadFrom();
|
||||
this.$loading.hide();
|
||||
//$.fancybox.close();
|
||||
// $.fancybox.open({
|
||||
// src : '#ListUploadedFiles',
|
||||
// type : 'inline',
|
||||
// opts : {
|
||||
// modal: true,
|
||||
// animationDuration : 350,
|
||||
// animationEffect : 'material',
|
||||
// }
|
||||
// });
|
||||
console.log('complete');
|
||||
},
|
||||
uploadFileError(file, message) {
|
||||
this.closeUploadFrom();
|
||||
this.$loading.hide();
|
||||
$.fancybox.close();
|
||||
let error = JSON.parse(message);
|
||||
console.log(error);
|
||||
console.log(error.files)
|
||||
$.fancyMessage({
|
||||
title: "Erreur lors du téléchargement",
|
||||
message: error.files[0],
|
||||
type: "error"
|
||||
});
|
||||
},
|
||||
createMedias() {
|
||||
this.$loading.show({delay: 0});
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@
|
|||
<li v-for="item in folders"
|
||||
:class="item.parent_id === null ? 'dd-item dd3-item parent' : 'dd-item dd3-item'"
|
||||
:data-id="item.id">
|
||||
<div
|
||||
:class="item.parent_id === null ? 'dd-handle dd3-handle no-handle' : 'dd-handle dd3-handle'"></div>
|
||||
<div :class="handleClass(item)" @click="toggle(item)"></div>
|
||||
<div @click="selectFolder(item)" @drop="moveMedia($event, item)" @dragover.prevent @dragenter.prevent
|
||||
:class="item.id === storeFolder ? 'dd3-content selected' : 'dd3-content'">
|
||||
<input type="text" value="" class="input_rename" maxlength="100">
|
||||
|
|
@ -20,12 +19,11 @@
|
|||
<i v-if="item.system === 0" :class="item.favoris === true ? 'fas fa-star' : 'fal fa-star'"
|
||||
@click="toggleFav(item)"></i>
|
||||
</div>
|
||||
<ol v-if="item.sousdossiers.length > 0" class='dd-list'>
|
||||
<ol v-if="item.sousdossiers.length > 0" class='dd-list' :parent-id="item.id">
|
||||
<li v-for="item2 in item.sousdossiers"
|
||||
:class="item2.parent_id === null ? 'dd-item dd3-item parent' : 'dd-item dd3-item'"
|
||||
:data-id="item2.id">
|
||||
<div
|
||||
:class="item2.parent_id === null ? 'dd-handle dd3-handle no-handle' : 'dd-handle dd3-handle'"></div>
|
||||
<div :class="handleClass(item2)" @click="toggle(item2)"></div>
|
||||
<div @click="selectFolder(item2)" @drop="moveMedia($event, item2)" @dragover.prevent @dragenter.prevent
|
||||
:class="item2.id === storeFolder ? 'dd3-content selected' : 'dd3-content'">
|
||||
<input type="text" value="" class="input_rename" maxlength="100">
|
||||
|
|
@ -35,7 +33,7 @@
|
|||
:class="item2.favoris === true ? 'fas fa-star' : 'fal fa-star'"
|
||||
@click="toggleFav(item2)"></i>
|
||||
</div>
|
||||
<ol v-if="item2.sousdossiers.length > 0" class='dd-list'>
|
||||
<ol v-if="item2.sousdossiers.length > 0" class='dd-list' :parent-id="item2.id">
|
||||
<li v-for="item3 in item2.sousdossiers"
|
||||
:class="item3.parent_id === null ? 'dd-item dd3-item parent' : 'dd-item dd3-item'"
|
||||
:data-id="item3.id">
|
||||
|
|
@ -78,7 +76,7 @@
|
|||
},
|
||||
storeGrabbed() {
|
||||
return this.$store.state.grabbed
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -96,7 +94,7 @@
|
|||
if (this.storeFolder === 0) {
|
||||
this.selectFolder({id: 0, libelle: 'racine'});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
initFolders(toSelectFolder = false) {
|
||||
|
|
@ -199,6 +197,34 @@
|
|||
$.fancyMessage({title : "Attention", message : "Erreur lors du déplacement, merci d'actualiser la page.", type : "error"});
|
||||
});
|
||||
}
|
||||
},
|
||||
handleClass(item) {
|
||||
let dd3_handle = false;
|
||||
let no_handle = false;
|
||||
let openable = false;
|
||||
let opened = false;
|
||||
if( item.sousdossiers.length > 0 ) {
|
||||
if($("[parent-id='"+ item.id +"']").css('display') != 'none') {
|
||||
opened = true;
|
||||
} else {
|
||||
openable = true;
|
||||
}
|
||||
} else {
|
||||
//icone dossier simple sans action
|
||||
dd3_handle = true;
|
||||
no_handle = true;
|
||||
}
|
||||
return {
|
||||
'id' : item.id,
|
||||
'dd-handle' : true,
|
||||
'dd3-handle' : dd3_handle,
|
||||
'no-handle' : no_handle,
|
||||
'openable' : openable,
|
||||
'opened' : opened,
|
||||
}
|
||||
},
|
||||
toggle(item) {
|
||||
$("[parent-id='"+ item.id +"']").toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,13 +69,24 @@
|
|||
},
|
||||
storeRole () {
|
||||
return this.$store.state.role
|
||||
},
|
||||
currentTab: {
|
||||
get: function() {
|
||||
return this.$store.state.mediaTab
|
||||
},
|
||||
set: function(value) {
|
||||
this.$store.commit({
|
||||
type: 'changeMediaTab',
|
||||
tab: value
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
data (){
|
||||
return {
|
||||
display: false,
|
||||
defaultTab: 'preview',
|
||||
currentTab: 'preview'
|
||||
//currentTab: 'preview'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -147,11 +158,81 @@
|
|||
type: 'updateMedia',
|
||||
media: JSON.parse(message)
|
||||
});
|
||||
//on vient d'upload un fichier.
|
||||
// Si c'est lié a Arcadia on check les clés refs
|
||||
if (this.storeMedia.arcadia_id !== null) {
|
||||
//le media n'est pas lock car on a pu upload mais on vérifie quand meme
|
||||
if (this.storeMedia.isLocked === 0) {
|
||||
this.CheckRefKey(this.SaveMedia);
|
||||
}
|
||||
}
|
||||
this.$loading.hide();
|
||||
},
|
||||
uploadFileComplete() {
|
||||
alert("Media uploadé !");
|
||||
},
|
||||
CheckRefKey(callback) {
|
||||
axios.post('/ajax/check-ref-key', {
|
||||
media_id: this.storeMedia.id
|
||||
}).then(response => {
|
||||
if (response.data === false) {
|
||||
$.fancybox.close();
|
||||
$.fancyMessage({
|
||||
title: "Erreur",
|
||||
message: "Vous devez avoir au minimum 1 clé de référentiel.",
|
||||
type: "error"
|
||||
});
|
||||
} else {
|
||||
//update de la fiche vers arcadia
|
||||
if(response.data.status===false) {
|
||||
$.fancyMessage({
|
||||
title: "Erreur",
|
||||
message: response.data.error,
|
||||
type: "error"
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
$.fancybox.close();
|
||||
$.fancyMessage({
|
||||
title: "Erreur",
|
||||
message: "Erreur lors de l'opération, merci d'actualiser la page.",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
},
|
||||
SaveMedia() {
|
||||
axios.post('/ajax/save-media', {
|
||||
media: this.storeMedia
|
||||
}).then(response => {
|
||||
this.$loading.hide();
|
||||
if (response.data.status === true) {
|
||||
this.$store.commit({
|
||||
type: 'updateMedia',
|
||||
media: response.data.datas
|
||||
});
|
||||
$.fancyMessage({
|
||||
title: "Sauvegarde d'un média",
|
||||
message: "Les données ont bien été enregistrées",
|
||||
type: "info"
|
||||
});
|
||||
} else {
|
||||
$.fancyMessage({title: "Sauvegarde d'un média", message: response.data.error, type: "error"});
|
||||
}
|
||||
}).catch(function (error) {
|
||||
this.$loading.hide();
|
||||
$.fancybox.close();
|
||||
$.fancyMessage({
|
||||
title: "Sauvegarde d'un média",
|
||||
message: "Erreur lors de l'opération, merci d'actualiser la page.",
|
||||
type: "error"
|
||||
});
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@
|
|||
<tbody>
|
||||
<tr v-for="item in oMedia.articles">
|
||||
<td class="col_lib">{{item.noArt}} : {{item.libCcial}}</td>
|
||||
<td class="col_famVente">{{item.codFamVte}}</td>
|
||||
<td class="col_marque">{{item.codMarq}}</td>
|
||||
<td class="col_famVente">{{item.codFamVte}} - {{item.libFamVte}}</td>
|
||||
<td class="col_marque">{{item.codMarq}} - {{ item.libMarq }}</td>
|
||||
<td class="col_gencodAdm">{{item.codGencodAdm}}</td>
|
||||
<td class="col_gencodSymb">{{item.codGencodSymb}}</td>
|
||||
<td class="col_gencodPds">{{item.codGencodPds}}</td>
|
||||
|
|
@ -293,12 +293,22 @@
|
|||
type: "error"
|
||||
});
|
||||
} else {
|
||||
let result = confirm("Êtes-vous sur de vouloir lancer le traitement ?");
|
||||
if (result !== true){
|
||||
if(response.data.status===false) {
|
||||
this.$loading.hide();
|
||||
$.fancyMessage({
|
||||
title: "Erreur",
|
||||
message: response.data.error,
|
||||
type: "error"
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
let result = confirm("Êtes-vous sur de vouloir lancer le traitement ?");
|
||||
if (result !== true){
|
||||
this.$loading.hide();
|
||||
return false;
|
||||
}
|
||||
callback();
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
|
|
|
|||
6
resources/js/panier.js
vendored
6
resources/js/panier.js
vendored
|
|
@ -24,6 +24,12 @@ $(document).ready(function() {
|
|||
$(this).attr('aria-grabbed',!JSON.parse($(this).attr('aria-grabbed')));
|
||||
});
|
||||
|
||||
// ---- Select all medias in basket
|
||||
$('.public_basket .btn_basket_select_all').on('click',function(event){
|
||||
event.preventDefault();
|
||||
$('div.imageItem').attr('aria-grabbed',true);
|
||||
});
|
||||
|
||||
// ---- Propriétés d'un panier
|
||||
$('.public_basket .btn_basket_Info').on('click',function(event){
|
||||
event.preventDefault();
|
||||
|
|
|
|||
34
resources/sass/partials/nestable.scss
vendored
34
resources/sass/partials/nestable.scss
vendored
|
|
@ -234,12 +234,12 @@
|
|||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.dd3-handle {
|
||||
.dd3-handle, .openable, .opened {
|
||||
position: absolute;
|
||||
margin: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
cursor: move;
|
||||
cursor: pointer;
|
||||
width: 30px;
|
||||
text-indent: 30px;
|
||||
white-space: nowrap;
|
||||
|
|
@ -267,6 +267,36 @@
|
|||
font-size: 13px;
|
||||
}
|
||||
|
||||
.openable:before {
|
||||
content: '\f0da';
|
||||
font-family: "Font Awesome 5 Pro";
|
||||
font-weight: 900;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
text-indent: 0;
|
||||
color: $white;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.opened:before {
|
||||
content: '\f0d7';
|
||||
font-family: "Font Awesome 5 Pro";
|
||||
font-weight: 900;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
text-indent: 0;
|
||||
color: $white;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dd-empty {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
|||
209
resources/views/mails/send-media-report.blade.php
Normal file
209
resources/views/mails/send-media-report.blade.php
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
<!doctype html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
|
||||
<head>
|
||||
<title>
|
||||
</title>
|
||||
<!--[if !mso]><!-- -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<!--<![endif]-->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type="text/css">
|
||||
#outlook a {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
table,
|
||||
td {
|
||||
border-collapse: collapse;
|
||||
mso-table-lspace: 0pt;
|
||||
mso-table-rspace: 0pt;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
height: auto;
|
||||
line-height: 100%;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
-ms-interpolation-mode: bicubic;
|
||||
}
|
||||
|
||||
p {
|
||||
display: block;
|
||||
margin: 13px 0;
|
||||
}
|
||||
</style>
|
||||
<!--[if mso]>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
<o:AllowPNG/>
|
||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||
</o:OfficeDocumentSettings>
|
||||
</xml>
|
||||
<![endif]-->
|
||||
<!--[if lte mso 11]>
|
||||
<style type="text/css">
|
||||
.mj-outlook-group-fix { width:100% !important; }
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if !mso]><!-->
|
||||
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
|
||||
<style type="text/css">
|
||||
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
|
||||
</style>
|
||||
<!--<![endif]-->
|
||||
<style type="text/css">
|
||||
@media only screen and (min-width:480px) {
|
||||
.mj-column-per-100 {
|
||||
width: 100% !important;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div style="">
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600"
|
||||
>
|
||||
<tr>
|
||||
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||
<![endif]-->
|
||||
<div style="background:#f0f0f0;background-color:#f0f0f0;margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#f0f0f0;background-color:#f0f0f0;width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
<tr>
|
||||
|
||||
<td
|
||||
class="" style="vertical-align:top;width:600px;"
|
||||
>
|
||||
<![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;font-weight:bold;line-height:1;text-align:left;color:#626262;">DAM - Rapport d'activité</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600"
|
||||
>
|
||||
<tr>
|
||||
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||
<![endif]-->
|
||||
<div style="margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
<tr>
|
||||
|
||||
<td
|
||||
class="" style="vertical-align:top;width:600px;"
|
||||
>
|
||||
<![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:helvetica;font-size:14px;line-height:1;text-align:left;color:#F45E43;">Bonjour, <br /><br /> Voici les médias modifiés depuis le {{ $yesterday->formatLocalized('%d %B %Y à %H:%M') }}<br /> Pour les sujets : {{ $sujets }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<p style="border-top:solid 4px #F45E43;font-size:1px;margin:0px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:solid 4px #F45E43;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;table-layout:auto;width:100%;border:none;">
|
||||
<tr style="border-bottom:1px solid #ecedee;text-align:left;padding:15px 0;">
|
||||
<th style="padding: 0 15px 0 0;">Media</th>
|
||||
<th style="padding: 0 15px;">Lien</th>
|
||||
<th style="padding: 0 0 0 15px;">Modifié/Créé le</th>
|
||||
</tr>
|
||||
@foreach ($medias as $media)
|
||||
<tr>
|
||||
<td style="padding: 0 15px 0 0;">{{ $media->libelle }}</td>
|
||||
<td style="padding: 0 15px;"> <a href="{{ route('media.show', $media->uid) }}">fiche media</a> </td>
|
||||
<td style="padding: 0 0 0 15px;"> {{ $media->updated_at->formatLocalized('%d %B %Y à %H:%M') }} </td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
{{ $panier->libelle }}
|
||||
</div>
|
||||
<div class="basket_Info">
|
||||
<a href="#" class="btn_basket_select_all" title="Selectionner tous les medias"><i class="fas fa-check-circle"></i></a>
|
||||
<a href="#" class="btn_basket_download" title="Téléchargez des médias"><i class="fas fa-arrow-circle-down"></i></a>
|
||||
<a class="btn_basket_Info"title="Informations sur ce panier" href="#"><i class="fas fa-info-circle"></i></a>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue