Consomar New thread
Rc : 196477 (Tribunal de Casablanca)
Address : 144, Rue Med Smiha, Res. Jawharate Med Smiha - Casablanca
Activity : - la promotion immobiliere ; - tous travaux et tous corps d'etat ; - la prestation de service sous toutes ses formes et de quelque nature qu'elle soit.
', css : { "z-index": "1011", top: "20px", width: "80%", right: "0px", left: "0px" } }); $.ajax ({ type: "POST", url: "societe-ddGeocodage", context : this, data: "url="+url+"&bilid=240933&entid=268968", timeout: 600000, success: function(data) { if(data.success) { callbackGeocodage(mapBackoffice,data.lattitude, data.longitude); } else { notitificateur = noty({text: "erreur lors du traitement : "+ data.error, layout:"topCenter", type:"error"}); notitificateur.setTimeout(6000); $('div#map-google-2').unblock(); } }, error: function(request, errorType, errorThrown) { alert("Erreur lors de la validation"); } });	return false; }); $('#new-comment').click(function(e) { e.preventDefault(); if(!userConnected(e, this)) return; $('#new-review-haut').fadeIn(); }); function doTruncateCommentText() { $('.review-content').jTruncate({ length: 200, minTrail: 0, moreText: "[plus]", lessText: "[moins]", ellipsisText: " ..." }); } //doTruncateCommentText(); $('.go-review').click(function(e) { e.preventDefault(); if(!userConnected(e, this)) return; resetReviewForm($("#new-review-haut").find("form")[0]); resetReviewForm($("#new-review-bas").find("form")[0]); $('.containerToggle').fadeOut(0,function() { $('div#new-review-haut').fadeIn(0);	}); return false; }); function showFiche(idFIche) { $('.containerToggle').fadeOut(0,function() { $('div#'+ idFIche).fadeIn(0);	}); } $('.comment-text').click(function(e) { e.preventDefault(); if(!userConnected(e, this)) return; //$(this).val(""); }); //afficher les 5 premiers commentaires doReviewPaging(DEFAULT_PAGE_SIZE); function validateReviewForm(formId) { var message=""; var form = $(formId); var titre = $(formId).find("#id-review-title-input"); var commentaire = $(formId).find("#ReviewText"); var valid=true; var i = 0; if(!(titre.val()) || titre.val() == titre.attr("placeholder")) { message += "- le champ titre est requis
" + message; } form.find(".submit-error").html(message).show(); } return valid; } function resetReviewForm(formId) { var message = ""; var form = $(formId); form[0].reset(); var titre = $(formId).find("#id-review-title-input"); var commentaire = $(formId).find("#ReviewText"); titre.removeClass("require-vide"); commentaire.removeClass("require-vide"); form.find(".submit-error").hide(); $(".form-new-review").show(); $(".thanks-box").hide(); initFormCommentStars(); } $('.annuler-comment').click(function(e) {	e.preventDefault(); showFiche("fiche"); }); $('.return-to-fiche').click(function(e) {	e.preventDefault(); var parentId=$(this).parents('div[id^="rubrique-new-review"]')[0].id; if(parentId == "new-review-haut") showFiche("fiche"); }); $('.do-another-review').click(function(e) {	e.preventDefault(); $(this).hide(); //on montre le formulaire var parent = $(this).parents('div[id^="rubrique-new-review"]'); parent.find(".return-to-fiche").show(); parent.find("#id-thanks-box").fadeOut(function() { parent.find("#id-form-new-review").show(); }); }); $('.submit-comment').click(function(e) {	e.preventDefault(); if(!userConnected(e, this)) return; var commentBloc = $(this).parents('.new-review'); var formId = commentBloc.find("form")[0]; if(!validateReviewForm(formId)) return; var commentText = commentBloc.find('.comment-text'); var rating = commentBloc.find('.note-rating').children('input').val(); var rating1 = commentBloc.find('.note-rating-1').children('input').val(); var rating2 = commentBloc.find('.note-rating-2').children('input').val(); var rating3 = commentBloc.find('.note-rating-3').children('input').val(); var rating4 = commentBloc.find('.note-rating-4').children('input').val(); var titre = commentBloc.find('.titre'); var commentData = "note=" + rating + "&note1=" + rating1 + "&note2=" + rating2 + "&note3=" + rating3 + "&note4=" + rating4 + "&comment=" + commentText.val() +"&titre="+titre.val() ; $.ajax ( { type: "POST", url: "societe-comment", data: commentData, timeout: 600000, success: function(data) { var parentId = commentBloc[0].id; var returnedComment = $(data); var returnedJson = eval('(' + $(returnedComment.find('.returnedJson')[0]).html() + ')'); $(returnedComment.find('.star')[0]).raty({score: returnedJson.note, readOnly : true, space: false}); $(returnedComment.find('.note1')[0]).raty({score: returnedJson.note1, readOnly : true, space: false}); $(returnedComment.find('.note2')[0]).raty({score: returnedJson.note2, readOnly : true, space: false}); $(returnedComment.find('.note3')[0]).raty({score: returnedJson.note3, readOnly : true, space: false}); $(returnedComment.find('.note4')[0]).raty({score: returnedJson.note4, readOnly : true, space: false}); $('.global-star').raty({'score': returnedJson.noteGlobale, readOnly : true, space: false}); $(".nbrComment").html(returnedJson.nbrComment); $("#list-review").append(returnedComment); commentText.val(''); resetReviewForm(formId); returnedComment.find('.review-content').jTruncate({ length: 200, minTrail: 0, moreText: "[plus]", lessText: "[moins]", ellipsisText: " ..." }); $(".selector-user-"+returnedJson.idMktUser).find(".nombreCommentaireUser").html(returnedJson.nombreCommentaireUser); doReviewPaging(DEFAULT_PAGE_SIZE); //showFiche("fiche"); commentBloc.find("#id-form-new-review").slideUp(function() { commentBloc.find("#id-thanks-box").show(); }); if(parentId != "new-review-bas") { $('.do-another-review').hide(); $('.return-to-fiche').show(); $('body').animate({scrollTop:0}, 'slow'); } else { //lorsqu'on est sur le bloc de commentaire tout en bas de la page $('.do-another-review').show(); $('.return-to-fiche').hide(); } }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } }); }); $('.global-star').each(function(star) { var x = eval('(' + $(this).children('.returnedJson').html() + ')'); $(this).raty({ readOnly : true, score : x? x.note: 0, space: false }); }); function refreshStars() { $('.star').each(function(star) { var x = eval('(' + $(this).children('.returnedJson').html() + ')'); $(this).raty({ readOnly : true, score : x? x.note: 0, space: false }); var review=$(this).parents(".review"); review.find(".note1-existe").hide(); review.find(".note2-existe").hide(); review.find(".note3-existe").hide(); review.find(".note4-existe").hide(); var ratingSpecifiqueExiste = false; if(x.note1 && x.note1!="0") { ratingSpecifiqueExiste = true; review.find(".note1-existe").show(); review.find(".note1").raty( { readOnly : true, score : x? x.note1: 0, space: false }); } if(x.note2 && x.note2!="0" ) { ratingSpecifiqueExiste = true; review.find(".note2-existe").show(); review.find(".note2").raty( { readOnly : true, score : x? x.note2: 0, space: false }); } if(x.note3 && x.note3!="0") { ratingSpecifiqueExiste = true; review.find(".note3-existe").show(); review.find(".note3").raty( { readOnly : true, score : x? x.note3: 0, space: false }); } if(x.note4 && x.note4!="0") { ratingSpecifiqueExiste = true; review.find(".note4-existe").show(); review.find(".note4").raty( { readOnly : true, score : x? x.note4: 0, space: false }); } if(!ratingSpecifiqueExiste) { review.find(".rating-specifique").remove(); } }); } refreshStars(); function initFormCommentStars() { $('.note-rating').raty({ space: false }); $('.note-rating-1').raty({ space: false }); $('.note-rating-2').raty({ space: false }); $('.note-rating-3').raty({ space: false }); $('.note-rating-4').raty({ space: false }); } //initFormCommentStars(); $(".btn-utile").live("click",function(e) { e.preventDefault(); if(!userConnected(e, $(this))) return; var $this = $(this); var review = $this.parents(".review-wrapper"); var messageZone = $this.parents(".wrapper-btn-utile"); var returnedJson = eval('(' + $(review.find('.returnedJson')[0]).html() + ')'); var spinner = $(" ").addClass("ajax-loader-rond").css("visibility", "visible"); $this.replaceWith(spinner); var idUserComment = returnedJson.idMktUser; $.ajax ({ type: "POST", url: "societe-voteutile", context : this, data: "commentId="+returnedJson.id+"&idUser="+idUserComment, timeout: 600000, success: function(data) { //spinner.remove(); messageZone.fadeOut(0,function() { messageZone.html("Merci de votre contribution.").fadeIn(); review.find(".nombreVoteUtile").html(data.nombreVoteUtileCommentaire); $(".selector-user-"+idUserComment).find(".nombreVoteUtileUser").html(data.nombreVoteUtileUser); }); }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } });	}); //trie des commentaires $('.commentaire-trie-date').click(function(e) { e.preventDefault(); var $this = $(this); var order = "recent"; if($this.hasClass("recent")) { order = "ancien"; } else { order = "recent"; } $("#ajax-loader-date").css("visibility","visible"); $.ajax ({ type: "POST", url: "societe-sortcomment", context : this, data: "iIdBil=240933&order=" + order +"&critere=date", timeout: 600000, success: function(data) { $("#ajax-loader-date").css("visibility","hidden"); if($this.hasClass("ancien")) { $this.removeClass("ancien").addClass("recent sprite-review"); } else { $this.removeClass("recent").addClass("ancien sprite-review"); } $("#list-review").empty().append(data); refreshStars(); $(".commentaire-trie-note,.commentaire-trie-vote").removeClass("rating-max rating-min sprite-review"); doTruncateCommentText(); }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } });	}); //trie des commentaires $('.commentaire-trie-note').click(function(e) { e.preventDefault(); var $this = $(this); if($this.hasClass("rating-max")) { order = "max"; } else { order = "min"; } $("#ajax-loader-rating").css("visibility","visible"); $.ajax ({ type: "POST", url: "societe-sortcomment", context : this, data: "iIdBil=240933&order=" + order +"&critere=rating", timeout: 600000, success: function(data) { $("#ajax-loader-rating").css("visibility","hidden"); if($this.hasClass("rating-max")) { $this.removeClass("rating-max").addClass("rating-min sprite-review"); } else { $this.removeClass("rating-min").addClass("rating-max sprite-review"); } $("#list-review").empty().append(data); refreshStars(); $(".commentaire-trie-date,.commentaire-trie-vote").removeClass("recent ancien sprite-review"); doTruncateCommentText(); }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } });	}); //trie des commentaires $('.commentaire-trie-vote').click(function(e) { e.preventDefault(); var $this = $(this); if($this.hasClass("rating-max")) { order = "max"; } else { order = "min"; } $("#ajax-loader-vote").css("visibility","visible"); $.ajax ({ type: "POST", url: "societe-sortcomment", context : this, data: "iIdBil=240933&order=" + order +"&critere=vote", timeout: 600000, success: function(data) { $("#ajax-loader-vote").css("visibility","hidden"); if($this.hasClass("rating-max")) { $this.removeClass("rating-max").addClass("rating-min sprite-review"); } else { $this.removeClass("rating-min").addClass("rating-max sprite-review"); } $("#list-review").empty().append(data); refreshStars(); $(".commentaire-trie-date,.commentaire-trie-note").removeClass("recent ancien sprite-review"); doTruncateCommentText(); }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } });	}); $('.review-popup-close').click(function(e) { e.preventDefault(); closePopup(); }); $('.react-link').live("click",function(e) { e.preventDefault(); var $this= $(this); var review = $this.parents(".review-wrapper"); var returnedJson = eval('(' + $(review.find('.returnedJson')[0]).html() + ')'); if(!userConnected(e, this)) return; $(".review-popup-abus-consult").hide(); $(".review-popup-abus-edit").show(); showPopup("review-popup-abus"); //global varible commentId = returnedJson.id ; reactionLink= $this; }); $('.submit-reaction').click(function(e) { e.preventDefault(); if(!userConnected(e)) return; var commentBloc = $(this).parents('.comment-wrapper').children('.react-comment'); $("#ajax-loader-reaction").css("visibility", "visible"); $.ajax ({ type: "POST", url: "societe-reaction", data: "commentId="+commentId+"&reaction="+$("#textearea-reaction").val()+"&idTypeAbus="+$("#selectIdTypeAbus").val(), context : this, timeout: 600000, success: function(data) { $("#ajax-loader-reaction").css("visibility", "hidden"); $(".review-popup-abus-consult").show(); $(".review-popup-abus-edit").hide(); reactionLink.replaceWith($("").html("Merci pour votre action.")) }, error: function(request, errorType, errorThrown) { alert('Erreur lors de la validation'); } } ); }); $('.next-societe').live("click",function(e) { e.preventDefault(); window.location = "societe-backoffice-next"; return false; }); function doReviewPaging(pageSize) { var nombreReview = jQuery("#list-review").find(".review-wrapper").length; if( nombreReview > 0 ) { $('.pagination').show(); $(".no-comment-found").hide(); $(".comment-found").show(); jQuery(".nombre-commentaire").html(nombreReview +" commentaire"+((nombreReview>1 )?'s':'')+" "); } else { $('.pagination').hide(); $(".no-comment-found").show(); $(".comment-found").hide(); } } });