Commit d8109107 authored by Clément Damiens's avatar Clément Damiens
Browse files

Merged branch master into development

parents 2f22565a c6d1be89
......@@ -859,8 +859,9 @@ var urlCtrl = {
window.location.href = urlObj.goto;
return false;
}
checkMenu(urlObj, hash);
endPoint = urlCtrl.loadableUrls[urlIndex];
mylog.log("jsController 2",endPoint,"login",endPoint.login,endPoint.hash );
if( typeof endPoint.login == undefined || !endPoint.login || ( endPoint.login && userId ) )
......@@ -896,6 +897,7 @@ var urlCtrl = {
if( endPoint.preaction && typeof endPoint.preaction == "function")
res = endPoint.preaction(hash);
//hash can be iliased
if (endPoint.hash)
hash = hash.replace(urlIndex, endPoint.hash);
if(hash.indexOf("?") >= 0){
......@@ -907,6 +909,7 @@ var urlCtrl = {
if(extraParams.indexOf("#") >= 0){
extraParams=extraParams.replace( "#","%hash%" );
}
path = urlCtrl.convertToPath(hash);
pathT = path.split('/');
//open path in a modal (#openModal)
......@@ -923,14 +926,18 @@ var urlCtrl = {
//console.log(">>>>>>>>>>>>>>>>>>> module path",path);
}
// console.log(">>>>>>>>>>>>>>>>>>> mod",mod,"> path : ",path,"> urlExtra : ",urlExtra,"> extraParams : ",extraParams);
// alert(baseUrl+'/'+ mod +path+urlExtra+extraParams);
showAjaxPanel( baseUrl+'/'+ mod +path+urlExtra+extraParams, endPoint.title,endPoint.icon, res,endPoint );
if(path == "dda" && extraParams != "" && urlCtrl.firstLoad ){
if(path == "dda" && extraParams != "" ){
urlCtrl.afterLoad = function() {
extraParams = extraParams.substring(1);
extraParamsT = extraParams.split(".");
uiCoop.prepPreview(extraParamsT[0],extraParamsT[1],null,extraParamsT[2],extraParamsT[3],null);
typeProp= (extraParamsT[0]=="proposals") ? "proposal": extraParamsT[0];
uiCoop.getCoopDataPreview(typeProp,extraParamsT[1]/*, function(){
onchangeClick=false;
location.hash="#dda?"+typeProp+"."+extraParamsT[1];
}*/);
//uiCoop.prepPreview(extraParamsT[0],extraParamsT[1],null,extraParamsT[2],extraParamsT[3],null);
}
}
}
......
......@@ -160,7 +160,6 @@ function autoCompleteSearch(indexMin, indexMax, callBack){
$(".btn-start-search").addClass("bg-azure");
$(".btn-start-search").removeClass("bg-dark");
//if(indexMin > 0)
if(indexMin==0 || (typeof pageEvent != "undefined" && pageEvent)){
simpleScroll(scrollH, 400);
$("#dropdown_search").html("<div class='col-md-12 col-sm-12 text-center search-loader text-dark'>"+
......@@ -293,15 +292,15 @@ function autoCompleteSearch(indexMin, indexMax, callBack){
if(searchObject.initType == "events" && typeof showResultInCalendar != "undefined" && searchObject.text=="")
showResultInCalendar(results);
if(mapElements.length==0) mapElements = results;
else $.extend(mapElements, results);
if(mapElements.length==0 || indexMin == 0)
mapElements = results;
else
$.extend(mapElements, results);
if(location.hash == "#search" && searchObject.types.length > 1)
directory.switcherViewer(mapElements);
else
directory.switcherViewer(results);
//affiche les éléments sur la carte
console.log("mapElements", results);
Sig.clearMap();
Sig.showMapElements(Sig.map, mapElements, "search", "Résultats de votre recherche");
......@@ -664,6 +663,12 @@ function initPageTable(number){
$(".all-coop-detail-desc"+coopId).toggleClass('hide');
});
$(".btn-coopfilter").off().click(function(){
$(".coopFilter").addClass('hidden');
$("."+$(this).data("filter")+"Filter").removeClass('hidden');
directory.sortSearch('.coopFilter:not(.hidden)');
});
$(".openCoopPanelHtml").off().click(function(){
mylog.log("HERE .openCoopPanelHtml");
var coopType = $(this).data("coop-type");
......@@ -672,7 +677,8 @@ function initPageTable(number){
var parentId = $(this).data("coop-parentid");
var parentType = $(this).data("coop-parenttype");
var afterLoad = null;
location.hash="#dda?"+coopType+"."+coopId+"."+parentId+"."+parentType;
onchangeClick=false;
location.hash="#dda?"+coopType+"."+coopId;//+"."+parentId+"."+parentType;
uiCoop.prepPreview(coopType,coopId,idParentRoom,parentId,parentType,afterLoad);
if( $(this).data("coop-section") ){
coopSection = $(this).data("coop-section");
......@@ -2549,11 +2555,25 @@ var directory = {
var thisId = typeof params["_id"] != "undefined" &&
typeof params["_id"]["$id"] != "undefined" ? params["_id"]["$id"] :
typeof params["id"] != "undefined" ? params["id"] : "";
var filterClass = "";
var sortData = "";
if(typeof params.votes != "undefined"){
if(typeof params.votes.up != "undefined"){
filterClass += " upFilter";
sortData += " data-sort='"+params.votes.up.length+"' ";
}
if(typeof params.votes.down != "undefined"){
filterClass += " downFilter";
sortData += " data-sort='"+params.votes.down.length+"'";
}
}
str = "";
if(size == "S")
str += "<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12 blockCoop"+thisId+" coop-wraper margin-bottom-10 ' style='word-wrap: break-word; overflow:hidden;'>";
str += "<div class='col-lg-4 col-md-4 col-sm-6 col-xs-12 blockCoop"+thisId+" "+filterClass+" coopFilter coop-wraper margin-bottom-10 ' "+sortData+" style='word-wrap: break-word; '>";
else
str += "<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12 coop-wraper margin-bottom-10 ' style='word-wrap: break-word; overflow:hidden;'>";
str += "<div class='col-xs-12 coop-wraper margin-bottom-10 coopFilter "+filterClass+" ' "+sortData+" style='word-wrap: break-word;'>";
linkParams = " data-coop-type='"+ params.type + "' "+
" data-coop-id='"+ thisId + "' "+
......@@ -2585,9 +2605,9 @@ var directory = {
// NAME
if(name != ""){
str += '<a href="javascript:;" class="openCoopPanelHtml" style="text-decoration:none;" '+linkParams+' >'+
'<h4 class="panel-title tooltips letter-turq" data-toggle="tooltip" data-placement="top" data-original-title="'+name+'">'+
'<h4 class="panel-title tooltips letter-turq" data-toggle="tooltip" data-placement="bottom" data-original-title="'+name+'">'+
'<i class="fa '+ params.ico + '"></i> '+
( (name.length > 140) ? name.substring(0,30)+"..." : name ) + '</h4></a>';
( (name.length > 100) ? name.substring(0,100)+"..." : name ) + '</h4></a>';
}
......@@ -3097,15 +3117,23 @@ var directory = {
titleSize=(searchObject.initType=="classifieds") ? "col-md-8 col-sm-6" : "col-md-9 col-sm-8";
toolsSize=(searchObject.initType=="classifieds") ? "col-md-4 col-sm-6" : "col-md-3 col-sm-4";
headerFilters = "";
if( typeof custom != "undefined" && custom != null && typeof custom.filters != 'undefined'
&& typeof custom.filters.searchFilters != 'undefined'){
$.each(custom.filters.searchFilters,function(k,p) {
colorClass = (typeof p.colorClass != "unde") ? p.colorClass : "";
headerFilters += "<a href='javascript:;' data-filter='"+k+"' class='btn-coopfilter btn btn-xs "+colorClass+"'> "+p.label+"</a> ";
});
}
headerStr +='<div class="col-xs-12 margin-bottom-10">'+
'<h4 class="elipsis '+titleSize+' col-xs-10 no-padding">'+
"<i class='fa fa-angle-down'></i> " + countHeader + " "+resultsStr+" "+
'<small>'+
directory.searchTypeHtml()+
'</small>'+
'</h4>'+
'<small>'+directory.searchTypeHtml()+'</small>'+
headerFilters+
'</h4>'+
'<div class="'+toolsSize+' col-xs-2 pull-right no-padding text-right headerSearchTools" style="padding-top:3px !important;">';
// TODO CLEM :: ADD SURVEY
// if(searchObject.types.length == 1 && searchObject.types[0]=="vote"){
......@@ -3151,8 +3179,17 @@ var directory = {
}
headerStr+= '</div>';
}
return headerStr;
},
sortSearch : function(what) {
var $wrapper = $('#dropdown_search');
$wrapper.find(what).sort(function (a, b) {
return +a.dataset.sort - +b.dataset.sort;
})
.appendTo( $wrapper );
},
checkImage : function($this){
// $.each(res, function(i,v){
// if($("#entity"+i+" .container-img-profil .img-responsive").length){
......@@ -3352,6 +3389,8 @@ var directory = {
directory.colPos = "left";
if(typeof data == "object" && data!=null){
$.each(data, function(i, params) {
if(i!="count"){
......@@ -3608,6 +3647,7 @@ var directory = {
params.type == "actions" ||
params.type == "resolutions" ||
params.type == "rooms"){
if(location.hash.indexOf('#dda') == 0)
str += directory.coopPanelHtml(params,null,"S");
else
......
......@@ -244,6 +244,10 @@ function buildNotifications(list, element, event, elementType, elementId)
url=url[1];
}
url = "#"+url.replace(/\//g, ".");
if(url.indexOf("#page.type.proposals") >= 0){
hasHProp=url.split(".");
url="#dda?proposals."+hasHProp[4];
}
momentNotif=notifObj.timeAgo;
var icon = (typeof notifObj.notify != "undefined") ? notifObj.notify.icon : "fa-bell";
var displayName = (typeof notifObj.notify != "undefined") ? notifObj.notify.displayName : "Undefined notification";
......
......@@ -44,7 +44,8 @@ var settings = {
if(hidden) $('.btn-group-'+field+' > button[value="hide"]').addClass('active');
});
$.each(typePreferencesBool, function(field, typePrefB){
if(notNull(preferences) && typeof preferences[typePrefB] != "undefined" && preferences[typePrefB] == true)
mylog.log("pref ", field, typePrefB, preferences)
if(notNull(preferences) && typeof preferences[typePrefB] != "undefined" && ( preferences[typePrefB] == true || preferences[typePrefB] == "true") )
$('.btn-group-'+typePrefB+' > button[value="true"]').addClass('active');
else
$('.btn-group-'+typePrefB+' > button[value="false"]').addClass('active');
......
......@@ -6,6 +6,13 @@ dynForm = {
onLoads : {
sub : function(){
dyFInputs.setSub("bg-url");
if(typeof contextData != "undefined" && contextData != null){
$("#parentId").val(contextData.id);
$("#parentType").val(contextData.type);
}
},
},
afterSave : function(){
......
......@@ -91,12 +91,13 @@ function getFileItem(k,v, edit){
titleDoc="";
if(notNull(v.name))
titleDoc=v.name;
var htmlThumbail = '<li class="content_file '+k+' col-sm-12 col-md-12 col-xs-12 no-padding" data-cat="1" id="'+v.id+'">'+
idDoc=v._id.$id;
var htmlThumbail = '<li class="content_file '+k+' col-sm-12 col-md-12 col-xs-12 no-padding" data-cat="1" id="'+idDoc+'">'+
' <div class="portfolio-item">';
if(edit){
htmlThumbail += '<div class="checkbox-content pull-left">'+
'<label>'+
'<input type="checkbox" class="checkPhoto checkbox-info" data-value="'+v.id+'">'+
'<input type="checkbox" class="checkPhoto checkbox-info" data-value="'+idDoc+'">'+
'<span class="cr"><i class="cr-icon fa fa-check"></i></span>'+
'</label>'+
'</div>';
......@@ -109,7 +110,7 @@ function getFileItem(k,v, edit){
' <i class="fa fa-upload"></i>'+
' </a>';
if(edit){
htmlThumbail+= ' <a href="javascript:;" onclick="updateDocument(\''+v.id+'\', \''+titleDoc+'\')">' +
htmlThumbail+= ' <a href="javascript:;" onclick="updateDocument(\''+idDoc+'\', \''+titleDoc+'\')">' +
' <i class="fa fa-pencil"></i>'+
' </a>';
}
......
......@@ -673,7 +673,9 @@ class CommunecterController extends Controller
}*/
//managed public and private sections through a url manager
if( Yii::app()->controller->id == "admin" && !Yii::app()->session[ "userIsAdmin" ] )
if( Yii::app()->controller->id == "admin" && !Yii::app()->session[ "userIsAdmin" ]
&& (!@Yii::app()->session[ "custom" ] || !@Yii::app()->session[ "custom" ]["admins"]
|| !Yii::app()->session[ "custom" ]["admins"][Yii::app()->session["userId"]]))
throw new CHttpException(403,Yii::t('error','Unauthorized Access.'));
if( Yii::app()->controller->id == "adminpublic" && ( !Yii::app()->session[ "userIsAdmin" ] && !Yii::app()->session[ "userIsAdminPublic" ] ) )
......
......@@ -182,7 +182,7 @@
<div class="col-md-12 col-sm-12 col-xs-12" id="navigationAdmin">
<div class="col-md-12 col-sm-12 col-xs-12 text-center">
<img src="<?php echo $logo ?>"
class="" height="100"><br/>
class="img-responsive" height="100"><br/>
<h3><?php echo $title ?></h3>
</div>
<?php
......@@ -192,7 +192,7 @@
id="div-select-create">
<div class="col-md-12 col-sm-12 col-xs-12 padding-15 shadow2 bg-white ">
<h4 class="text-center margin-top-15" style="">
<h4 class="text-center margin-top-15">
<a class="btn btn-link pull-right text-dark" id="btn-close-select-create" style="margin-top:-10px;">
<i class="fa fa-times-circle fa-2x"></i>
</a>
......@@ -224,7 +224,7 @@
<?php foreach(Yii::app()->session["paramsConfig"]["adminPanel"] as $key => $v){
if((!isset($v["super"]) || empty($v["super"]) || Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]))) && $key!="add"){
if(!isset($v["sourceKey"]) || (isset(Yii::app()->session["custom"]) && isset(Yii::app()->session["custom"]["sourceKey"]))){?>
<li class="list-group-item col-md-4 col-sm-6 ">
<li class="list-group-item col-md-4 col-sm-6 col-xs-12">
<a href="javascript:;" class="<?php echo $v["class"] ?>" id="<?php echo $v["id"] ?>" style="cursor:pointer;">
<i class="fa fa-<?php echo $v["icon"] ?> fa-2x"></i>
<?php echo Yii::t("admin", $v["label"]); ?>
......
......@@ -79,6 +79,10 @@ if( @$_GET["el"] || @$custom )
if(@$el["custom"]["metaImg"]){
$c["metaImg"] = Yii::app()->getRequest()->getBaseUrl(true).Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl().$el["custom"]["metaImg"];
}
if(@$el["custom"]["logoMin"]){
$c["logoMin"] = Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl().$el["custom"]["logoMin"];
}
if (@$el["custom"]["favicon"])
$c["favicon"] = Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl().$el["custom"]["favicon"];
$c["admins"]= Element::getCommunityByTypeAndId($c["type"], $c["id"], Person::COLLECTION,"isAdmin");
......@@ -280,6 +284,11 @@ if( @Yii::app()->session['custom'] ){ ?>
}
});
}
str+="@media (max-width: 767px){"+
"#mainNav{margin-top:0px !important;}"+
"#mainNav .menu-btn-top{font-size:22px !important}}"+
"#mainNav .logo-menutop{height:40px}"+
"}";
str+="</style>";
$("head").append(str);
......
......@@ -292,9 +292,10 @@ HtmlHelper::registerCssAndScriptsFiles($cssJs, Yii::app()->getRequest()->getBase
if($parentType == Form::COLLECTION){
?>
<a href="<?php echo Yii::app()->getRequest()->getBaseUrl(true) ?>/survey/co/members/id/<?php echo $id; ?>/session/<?php echo $_GET["session"]; ?>" class="btn btn-success margin-top-20 col-xs-12 " id="btn-home" style="font-size:20px;"><i class="fa fa-home"></i> <?php echo Yii::t("invite","See the community") ?></a>
<?php } else /*if($parentType != Person::COLLECTION) */ {?>
<?php } else if($parentType == Proposal::COLLECTION){?>
<button class="btn btn-success margin-top-20 col-xs-12" data-dismiss="modal"><i class="fa fa-users" ></i> <?php echo Yii::t("invite","Close invite") ?></button>
<?php } else /*if($parentType != Person::COLLECTION) */ {?>
<button class="btn btn-success margin-top-20 col-xs-12 link-to-community"><i class="fa fa-users"></i> <?php echo Yii::t("invite","See the community") ?></button>
<?php } ?>
</div>
......@@ -355,6 +356,7 @@ HtmlHelper::registerCssAndScriptsFiles($cssJs, Yii::app()->getRequest()->getBase
$("#modal-invite #divResult").show();
$("#modal-invite #dropdown-result").show();
}
} else {
toastr.error(tradDynForm.pleaseValidateTheCurrentInvites);
}
......
Supports Markdown
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