Commit 9e5aec84 authored by Clément Damiens's avatar Clément Damiens

up up 
parent 8b419a00
......@@ -2986,33 +2986,25 @@ var directory = {
},
createBtnHtml : function(){
btn="";
if(searchType.length > 1){
if(searchObject.types.length > 1){
btn+='<a href="javascript:;" class="btn margin-left-5 btn-add pull-right text-green-k" '+
'data-target="#dash-create-modal" '+
'data-toggle="modal">'+
'<i class="fa fa-plus-circle"></i> '+trad.createpage+
'</a>';
}else if(searchType[0]=="persons"){
}else if(searchObject.types[0]=="persons"){
btn+='<a href="#element.invite" class="btn text-yellow lbhp btn-add pull-right">'+
'<i class="fa fa-plus-circle"></i> '+trad.invitesomeone+
'</a>';
}else{
addType=searchType[0];
typeForm =addType;
objInApp=(typeof typeObj[addType].sameAs != "undefined") ? typeObj[typeObj[addType].sameAs]: typeObj[addType];
//typeForm=typeObj[typeObj[addType].sameAs].ctrl;
subData="";
if($.inArray(addType, ["NGO", "Group","LocalBusiness","GovernmentOrganization"])>0){
subData="data-ktype='"+addType+"' ";
typeForm="organization";
}
mylog.log("addType", addType);
//labelPlus=(typeof typeObj[addType].sameAs != "undefined") ? headerParams[addType].label : trad["add"+addType];
btn+='<button class="btn btn-open-form margin-left-5 btn-add pull-right text-white bg-'+objInApp.color+'" '+
'data-type="'+objInApp.typeForm+'" '+
elt=directory.getTypeObj(searchObject.types[0]);
subData="";
if(typeof elt.formSubType != "undefined")
subData="data-form-subtype='"+elt.formSubType+"'";
btn+='<button class="btn btn-open-form margin-left-5 btn-add pull-right text-white bg-'+elt.color+'" '+
'data-form-type="'+elt.formType+'" '+
subData+'>'+
'<i class="fa fa-plus-circle"></i> '+objInApp.labelCreate+
'<i class="fa fa-plus-circle"></i> '+elt.createLabel+
'</button>';
}
return btn;
......@@ -3260,32 +3252,22 @@ var directory = {
subData="";
mylog.log("addType", addType);
// addType=searchType[0];
typeForm =addType;
objInApp=(typeof typeObj[addType].sameAs != "undefined") ? typeObj[typeObj[addType].sameAs]: typeObj[addType];
//typeForm=typeObj[typeObj[addType].sameAs].ctrl;
elt=directory.getTypeObj(addType);//(typeof typeObj[addType].sameAs != "undefined") ? typeObj[typeObj[addType].sameAs]: typeObj[addType];
subData="";
if($.inArray(addType, ["NGO", "Group","LocalBusiness","GovernmentOrganization"])>0){
subData="data-ktype='"+addType+"' ";
typeForm="organization";
}
mylog.log("addType", addType);
// if($.inArray(addType, ["NGO", "Group","LocalBusiness","GovernmentOrganization"])>0){
// subData="data-ktype='"+addType+"' ";
// typeForm="organization";
//}else if(typeForm != "ressources" && typeForm != "poi" && typeForm != "places" && typeForm != "classifieds" && typeForm != "cities" && typeForm != "interop")
//typeForm=typeObj[typeObj[addType].sameAs].ctrl;
if(typeof elt.formSubType != "undefined")
subData="data-form-subtype='"+elt.formSubType+"'";
if(typeof themeParams.add == "undefined"
|| (typeof themeParams.add != "undefined" && typeof themeParams.add[typeForm] != "undefined")){
mylog.log("addType", addType);
//labelPlus=(typeof headerParams[addType].label != "undefined") ? headerParams[addType].label : trad["add"+addType];
btn='<button class="btn btn-open-form text-'+objInApp.color+' tooltips" padding-5 no-margin '+
'data-form-type="'+objInApp.formType+'" '+
btn='<button class="btn btn-open-form text-'+elt.color+' tooltips" padding-5 no-margin '+
'data-form-type="'+elt.formType+'" '+
subData+
'data-toggle="tooltip" data-placement="top" '+
'title="" style="border: none;background-color: white;"> '+
'<h5 class="no-margin">'+
'<i class="fa fa-plus-circle"></i> '+objInApp.createLabel+
'<i class="fa fa-plus-circle"></i> '+elt.createLabel+
'</h5>'+
'</button>';
}
......@@ -3691,6 +3673,18 @@ var directory = {
elt.color=typeObj[e].color;
else if(typeof typeObj[e].sameAs != "undefined")
elt.color=typeObj[typeObj[e].sameAs].color;
if(typeof typeObj[e].formType != "undefined")
elt.formType=typeObj[e].formType;
else if(typeof typeObj[e].sameAs != "undefined")
elt.formType=typeObj[typeObj[e].sameAs].formType;
if(typeof typeObj[e].formSubType != "undefined")
elt.formSubType=typeObj[e].formSubType;
else if(typeof typeObj[e].sameAs != "undefined" && typeof typeObj[typeObj[e].sameAs].formSubType != "undefined")
elt.formSubType=typeObj[typeObj[e].sameAs].formSubType;
if(typeof typeObj[e].createLabel != "undefined")
elt.createLabel=typeObj[e].createLabel;
else if(typeof typeObj[e].sameAs != "undefined")
elt.createLabel=typeObj[typeObj[e].sameAs].createLabel;
}
console.log("icccccccccccccci", elt);
return elt;
......
......@@ -18,7 +18,7 @@ dynForm = {
},
},
beforeSave : function(){
if( $("#ajaxFormModal #section").val() )
$("#ajaxFormModal #type").val($("#ajaxFormModal #section").val());
......@@ -35,7 +35,8 @@ dynForm = {
});
},
afterSave : function(){
listObject=$(uploadObj.domTarget).fineUploader('getUploads');
dyFObj.commonAfterSave();
/*listObject=$(uploadObj.domTarget).fineUploader('getUploads');
goToUpload=false;
if(listObject.length > 0){
$.each(listObject, function(e,v){
......@@ -48,7 +49,7 @@ dynForm = {
else {
dyFObj.closeForm();
urlCtrl.loadByHash( (uploadObj.gotoUrl) ? uploadObj.gotoUrl : location.hash );
}
}*/
},
canSubmitIf : function () {
return ( $("#ajaxFormModal #type").val() ) ? true : false ;
......
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