Commit c7ec53cb authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

Merge remote-tracking branch 'origin/development' into development

parents da0deecd 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){
......@@ -761,7 +758,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