Commit 7176464d authored by Raph El's avatar Raph El
Browse files

Merge branch 'development' of https://gitlab.adullact.net/pixelhumain/survey into development

parents 783160c8 21177b0e
......@@ -417,11 +417,8 @@ class Form {
public static function canSeeAnswer($userId, $answer, $form, $parentForm){
if(self::canEditAnswer($userId, $answer, $form, $parentForm))
return true;
// else if(Costum::sameFunction("canSeeAnswer", array("answer"=>$answer))){
// return true;
// }
else if(Costum::isSameFunction("canEditAnswer", array("answer"=>$answer)))
return Costum::sameFunction("canEditAnswer", array("answer"=>$answer));
else if(Costum::isSameFunction("canSeeAnswer", array("answer"=>$answer)))
return Costum::sameFunction("canSeeAnswer", array("answer"=>$answer));
return false;
}
public static function canEditAnswer($userId, $answer, $form, $parentForm){
......@@ -752,8 +749,10 @@ class Form {
if( !empty($myAnswers) ) {
if ( !isset($costum["form"]["oneAnswerPerPerson"]) || count($myAnswers) == 0 ) {
if(!isset($costum["form"]["oneAnswerPerPerson"]) || count($myAnswers) == 0){
//si ya qu'une réponse et on la charge directe
if(count($myAnswers) == 1 )
$answer = $myAnswers[ array_keys($myAnswers)[0] ];
......@@ -767,7 +766,7 @@ class Form {
}
}
if( $answer == null && count( $myAnswers ) > 1 && !$params["canEdit"] )
if( $answer == null && count( $myAnswers ) > 1 && !@$params["canEdit"] )
$showForm = false;
//si aucune reponse existe
......
......@@ -157,7 +157,7 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
jQuery(document).ready(function() {
$("#"+uploadAnswerObj.dom).off();
$("#"+uploadAnswerObj.dom).fineUploader({
template: 'qq-template-manual-trigger',
template: ((uploadAnswerObj.docType=="image") ? 'qq-template-gallery' : 'qq-template-manual-trigger'),
paste: {
defaultName: 'pasted_image',
//promptForName:true,
......@@ -265,14 +265,15 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
qq(viewBtn).removeClass("hide");
}*/
var serverPathToFile = responseJSON.docPath,
fileItem = this.getItemByFileId(id);
var viewTnh = qq(fileItem).getByClass("qq-upload-link")[0];
viewTnh.setAttribute("href", serverPathToFile);
// $fileItem.find(".qq-upload-link")
// .attr("href", serverPathToFile)
// .removeClass("hide");
this.setDeleteFileEndpoint(baseUrl+"/"+moduleId+"/document/deletedocumentbyid/id/"+responseJSON.id.$id, id);
fileItem = this.getItemByFileId(id);
var viewTnh = qq(fileItem).getByClass("qq-upload-link")[0];
if(typeof viewTnh != "undefined")
viewTnh.setAttribute("href", serverPathToFile);
// $fileItem.find(".qq-upload-link")
// .attr("href", serverPathToFile)
// .removeClass("hide");
this.setDeleteFileEndpoint(baseUrl+"/"+moduleId+"/document/deletedocumentbyid/id/"+responseJSON.id.$id, id);
if(!responseJSON.result){
toastr.error(trad.somethingwentwrong+" : "+responseJSON.msg );
mylog.error(trad.somethingwentwrong , responseJSON.msg)
......@@ -287,7 +288,7 @@ $initAnswerFiles=Document::getListDocumentsWhere(array(
//when all upload is complete whatever the result
onAllComplete: function(succeeded, failed) {
mylog.log("ooooooooooooo",succeeded,failed);
$("#"+uploadAnswerObj.dom+" _submit").parent().fadeOut(200);
$("#"+uploadAnswerObj.dom+"_submit").parent().fadeOut();
},
onError: function(id) {
toastr.info(trad.somethingwentwrong);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment