Skip to content

Commit

Permalink
fix activities
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarzin committed May 1, 2023
1 parent b5ae591 commit 6e79800
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 187 deletions.
55 changes: 0 additions & 55 deletions resources/views/admin/activities/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
@section('scripts')

<script>
Dropzone.autoDiscover = false;
$(document).ready(function () {
Expand All @@ -113,60 +112,6 @@
}
);
var image_uploader = new Dropzone("#dropzoneFileUpload", {
url: '/admin/documents/store',
headers: { 'x-csrf-token': '{{csrf_token()}}' },
params: { },
maxFilesize: 10,
// acceptedFiles: ".jpeg,.jpg,.png,.gif",
addRemoveLinks: true,
timeout: 50000,
removedfile: function(file)
{
console.log("remove file " + file.name + " " + file.id);
$.ajax({
headers: {
'X-CSRF-TOKEN': '{{csrf_token()}}'
},
type: 'GET',
url: '{{ url( "/admin/documents/delete" ) }}'+"/"+file.id,
success: function (data){
console.log("File has been successfully removed");
},
error: function(e) {
console.log("File not removed");
console.log(e);
}});
// console.log('{{ url( "/documents/delete" ) }}'+"/"+file.id+']');
var fileRef;
return (fileRef = file.previewElement) != null ?
fileRef.parentNode.removeChild(file.previewElement) : void 0;
},
success: function(file, response)
{
file.id=response.id;
console.log("success response");
console.log(response);
},
error: function(file, response)
{
console.log("error response");
console.log(response);
return false;
},
init: function () {
//Add existing files into dropzone
var existingFiles = [
@foreach(session()->get("documents") as $document)
{ name: "{{ $document->filename }}", size: {{ $document->size }}, id: {{ $document->id }} },
@endforeach
];
for (i = 0; i < existingFiles.length; i++) {
this.emit("addedfile", existingFiles[i]);
this.emit("complete", existingFiles[i]);
}
}
});
});
</script>
@endsection
56 changes: 0 additions & 56 deletions resources/views/admin/activities/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@

<script>
Dropzone.autoDiscover = false;
$(document).ready(function () {
var allEditors = document.querySelectorAll('.ckeditor');
Expand All @@ -114,60 +112,6 @@
}
);
var image_uploader = new Dropzone("#dropzoneFileUpload", {
url: '/admin/documents/store',
headers: { 'x-csrf-token': '{{csrf_token()}}' },
params: { 'activity': '{{ $activity->id }}' },
maxFilesize: 10,
// acceptedFiles: ".jpeg,.jpg,.png,.gif",
addRemoveLinks: true,
timeout: 50000,
removedfile: function(file)
{
console.log("remove file " + file.name + " " + file.id);
$.ajax({
headers: {
'X-CSRF-TOKEN': '{{csrf_token()}}'
},
type: 'GET',
url: '{{ url( "/admin/documents/delete" ) }}'+"/"+file.id,
success: function (data){
console.log("File has been successfully removed");
},
error: function(e) {
console.log("File not removed");
console.log(e);
}});
// console.log('{{ url( "/documents/delete" ) }}'+"/"+file.id+']');
var fileRef;
return (fileRef = file.previewElement) != null ?
fileRef.parentNode.removeChild(file.previewElement) : void 0;
},
success: function(file, response)
{
file.id=response.id;
console.log("success response");
console.log(response);
},
error: function(file, response)
{
console.log("error response");
console.log(response);
return false;
},
init: function () {
//Add existing files into dropzone
var existingFiles = [
@foreach ($activity->documents as $document)
{ name: "{{ $document->filename }}", size: {{ $document->size }}, id: {{ $document->id }} },
@endforeach
];
for (i = 0; i < existingFiles.length; i++) {
this.emit("addedfile", existingFiles[i]);
this.emit("complete", existingFiles[i]);
}
}
});
});
</script>
@endsection
76 changes: 0 additions & 76 deletions resources/views/admin/activities/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,69 +49,6 @@
{!! $activity->description !!}
</td>
</tr>
<tr>
<th>
{{ trans('cruds.activity.fields.responsible') }}
</th>
<td>
{!! $activity->responsible !!}
</td>
</tr>

<tr>
<th>
{{ trans('cruds.activity.fields.purpose') }}
</th>
<td>
{!! $activity->purpose !!}
</td>
</tr>

<tr>
<th>
{{ trans('cruds.activity.fields.categories') }}
</th>
<td>
{!! $activity->categories !!}
</td>
</tr>

<tr>
<th>
{{ trans('cruds.activity.fields.recipients') }}
</th>
<td>
{!! $activity->recipients !!}
</td>
</tr>


<tr>
<th>
{{ trans('cruds.activity.fields.transfert') }}
</th>
<td>
{!! $activity->transfert !!}
</td>
</tr>

<tr>
<th>
{{ trans('cruds.activity.fields.retention') }}
</th>
<td>
{!! $activity->retention !!}
</td>
</tr>

<tr>
<th>
{{ trans('cruds.activity.fields.controls') }}
</th>
<td>
{!! $activity->controls !!}
</td>
</tr>

<tr>
<th>
Expand Down Expand Up @@ -141,19 +78,6 @@
</td>
</tr>

<tr>
<th>
{{ trans('cruds.activity.fields.documents') }}
</th>
<td>
@foreach($activity->documents as $document)
<a href="{{ route('admin.documents.show', $document->id) }}">{{ $document->filename }}</a>
@if (!$loop->last)
,
@endif
@endforeach
</td>
</tr>

</tbody>
</table>
Expand Down
13 changes: 13 additions & 0 deletions resources/views/admin/reports/information_system.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,19 @@
<td width="20%"><b>{{ trans('cruds.activity.fields.description') }}</b></td>
<td>{!! $activity->description !!}</td>
</tr>
<tr>
<td>
<b>{{ trans('cruds.activity.fields.processes') }}</b>
</td>
<td>
@foreach($activity->activitiesProcesses as $process)
<a href="#PROCESS{{ $process->id }}">{{ $process->identifiant }}</a>
@if (!$loop->last)
,
@endif
@endforeach
</td>
</tr>
<tr>
<td>
<b>{{ trans('cruds.activity.fields.operations') }}</b>
Expand Down

0 comments on commit 6e79800

Please sign in to comment.