finish set photo on bijou, wip save bijou rapport with photos or not on frontend
This commit is contained in:
parent
5591a21ac2
commit
1d943f7505
@ -258,3 +258,7 @@
|
|||||||
border-radius: 0 0 5px 5px;
|
border-radius: 0 0 5px 5px;
|
||||||
color: white
|
color: white
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.photoBijouUpload{
|
||||||
|
all: inherit !important;
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2783,7 +2783,7 @@ class PageController extends Controller {
|
|||||||
$fileContent = file_get_contents($_FILES["photo"]["tmp_name"]);
|
$fileContent = file_get_contents($_FILES["photo"]["tmp_name"]);
|
||||||
$this->storage->newFile($fullPath,$fileContent);
|
$this->storage->newFile($fullPath,$fileContent);
|
||||||
$this->myDb->saveBijouxPhoto($bijouxId,$filename,$photoName);
|
$this->myDb->saveBijouxPhoto($bijouxId,$filename,$photoName);
|
||||||
return true;
|
return $fullPath;
|
||||||
}
|
}
|
||||||
catch(\OCP\Files\NotFoundException $e) { }
|
catch(\OCP\Files\NotFoundException $e) { }
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import "../css/mycss.css";
|
|||||||
|
|
||||||
import { globalConfiguration } from "./modules/mainFunction.mjs";
|
import { globalConfiguration } from "./modules/mainFunction.mjs";
|
||||||
import "./listener/main_listener";
|
import "./listener/main_listener";
|
||||||
import { setDefuntCover,getBibliotheques, getBijouxById, getHypodermiquesyId, getObservationsById, getproduits, saveAttestationPacemaker,exportCareCertificate, saveRapportBijoux, saveRapportSoin, updateDB } from "./modules/ajaxRequest.mjs";
|
import { setDefuntCover, setBijouxPhoto,getBibliotheques, getBijouxById, getHypodermiquesyId, getObservationsById, getproduits, saveAttestationPacemaker,exportCareCertificate, saveRapportBijoux, saveRapportSoin, updateDB } from "./modules/ajaxRequest.mjs";
|
||||||
|
|
||||||
let bibliotheques = [];
|
let bibliotheques = [];
|
||||||
let sortedBibliotheques = [];
|
let sortedBibliotheques = [];
|
||||||
@ -103,6 +103,14 @@ window.addEventListener("DOMContentLoaded", function () {
|
|||||||
rapportBijouxBtn.addEventListener("click", function(){
|
rapportBijouxBtn.addEventListener("click", function(){
|
||||||
saveRapportBijoux({ numdefunt: defuntid });
|
saveRapportBijoux({ numdefunt: defuntid });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".photoBijouUpload").on("change", function () {
|
||||||
|
let fileInput = this;
|
||||||
|
let file = fileInput.files[0];
|
||||||
|
let bijouxId = $(this).data("id");
|
||||||
|
setBijouxPhoto(bijouxId,file);
|
||||||
|
getBijouxById();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
function loadBibliotheques(response) {
|
function loadBibliotheques(response) {
|
||||||
|
|||||||
@ -512,9 +512,18 @@ export function getBijouxById() {
|
|||||||
}).done(function (response, code) {
|
}).done(function (response, code) {
|
||||||
$('#bijoux tbody').empty();
|
$('#bijoux tbody').empty();
|
||||||
$.each(JSON.parse(response), function (arrayID, myresp) {
|
$.each(JSON.parse(response), function (arrayID, myresp) {
|
||||||
|
let photo = myresp.photo;
|
||||||
|
let photoHtml = "";
|
||||||
|
if(photo != null){
|
||||||
|
photoHtml = '<td><label style="padding-right:5px;">'+myresp.photo_name+'</label><input type="file" accept="image/png, image/gif, image/jpeg" class="photoBijouUpload" data-id="' + myresp.bdid + '"></td>'
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
photoHtml = '<td><input type="file" accept="image/png, image/gif, image/jpeg" class="photoBijouUpload" data-id="' + myresp.bdid + '"></td>';
|
||||||
|
}
|
||||||
$('#bijoux tbody').append('<tr>'+
|
$('#bijoux tbody').append('<tr>'+
|
||||||
'<td><div class="editable" data-table="bijou_defunt" data-column="designation" data-id="' + myresp.bdid + '">' + ((myresp.designation.length === 0) ? '-' : myresp.designation) + '</div></td>' +
|
'<td><div class="editable" data-table="bijou_defunt" data-column="designation" data-id="' + myresp.bdid + '">' + ((myresp.designation.length === 0) ? '-' : myresp.designation) + '</div></td>' +
|
||||||
'<td><div class="editable" data-table="bijou_defunt" data-column="commentaire" data-id="' + myresp.bdid + '">' + ((myresp.commentaire.length === 0) ? '-' : myresp.commentaire) + '</div></td>' +
|
'<td><div class="editable" data-table="bijou_defunt" data-column="commentaire" data-id="' + myresp.bdid + '">' + ((myresp.commentaire.length === 0) ? '-' : myresp.commentaire) + '</div></td>' +
|
||||||
|
photoHtml +
|
||||||
'<td><div data-html2canvas-ignore data-modifier="getBijouxById" data-id="' + myresp.bdid + '" data-table="bijou_defunt" class="deleteItem icon-delete"></div></td>'+
|
'<td><div data-html2canvas-ignore data-modifier="getBijouxById" data-id="' + myresp.bdid + '" data-table="bijou_defunt" class="deleteItem icon-delete"></div></td>'+
|
||||||
'</tr>'
|
'</tr>'
|
||||||
);
|
);
|
||||||
@ -830,3 +839,34 @@ export function exportClientDevisByMonthAndYearToPdf(clientId,year,month) {
|
|||||||
showError(t('gestion', "Erreur dans la génération de devis multiple"));
|
showError(t('gestion', "Erreur dans la génération de devis multiple"));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bijoux photo
|
||||||
|
* @param {*} bijouxId
|
||||||
|
* @param {*} file
|
||||||
|
*/
|
||||||
|
export function setBijouxPhoto(bijouxId,file) {
|
||||||
|
if(file){
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append("bijouxId", bijouxId);
|
||||||
|
formData.append("photo", file);
|
||||||
|
$.ajax({
|
||||||
|
url: baseUrl + '/defunt/uploadFileToBijoux',
|
||||||
|
type: 'POST',
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
data: formData
|
||||||
|
}).done(function (response) {
|
||||||
|
if(response != null) {
|
||||||
|
showSuccess('Sauvegardé dans' + response);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showError(t('gestion', "Erreur dans l'assignation de photo sur ce bijou"));
|
||||||
|
}).fail(function (response, code) {
|
||||||
|
showError(t('gestion', "Erreur dans la génération de devis multiple"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
showError(t('gestion', "Veuillez choisir une image"))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
@ -447,6 +447,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Désignation</th>
|
<th>Désignation</th>
|
||||||
<th><?php p($l->t('Comment'));?></th>
|
<th><?php p($l->t('Comment'));?></th>
|
||||||
|
<th><?php p($l->t('Photo'));?></th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user