Commit d91268b1 authored by Raph El's avatar Raph El

Hotfix parent et organizer update

parent 71f2f610
......@@ -341,6 +341,7 @@ function bindAboutPodElement() {
count=Object.keys(contextData.parent).length;
htmlAbout="";
$.each(contextData.parent, function(e, v){
mylog.log("modif parent each" , e, v);
heightImg=(count>1) ? 35 : 25;
imgIcon = (typeof v.profilThumbImageUrl != "undefined" && v.profilThumbImageUrl!="" ) ? baseUrl+"/"+v.profilThumbImageUrl: assetPath + "/images/thumb/default_"+v.type+".png";
htmlAbout+='<a href="#page.type.'+v.type+'.id.'+e+'" class="lbh tooltips" ';
......@@ -350,7 +351,7 @@ function bindAboutPodElement() {
if(count==1) htmlAbout+=v.name;
htmlAbout+="</a>";
});
htmlHeader = ((contextData.type == typeObj.event.col) ? trad["Planned on"] : tradCategory.carriedby ) ;
htmlHeader = ((contextData.type == typeObj.event.col) ? tradCategory["Planned on"] : tradCategory.carriedby ) ;
htmlHeader += " : "+htmlAbout;
}
else if(notEmpty(contextData.parentId) && contextData.parentId != "dontKnow"){
......@@ -358,10 +359,11 @@ function bindAboutPodElement() {
'<i class="fa fa-'+dyFInputs.get(contextData.parentType).icon+'"></i> '+
contextData.parent.name+'</a><br/>';
htmlHeader =((contextData.type == typeObj.event.col) ? trad["Planned on"] : tradCategory.carriedby ) ;
htmlHeader =((contextData.type == typeObj.event.col) ? tradCategory["Planned on"] : tradCategory.carriedby ) ;
htmlHeader += htmlAbout;
}
mylog.log("modif parent html" , htmlAbout);
mylog.log("modif parent htmlHeader" , htmlHeader);
$("#parentAbout").html(htmlAbout);
$("#parentHeader").html(htmlHeader);
}
......@@ -373,11 +375,13 @@ function bindAboutPodElement() {
//contextData.organizerId = data.resultGoods.values.organizer.organizerId;
//contextData.organizerType = data.resultGoods.values.organizer.organizerType;
var html = "<i>"+trad["notSpecified"]+"</i>";
var htmlAbout = "<i>"+trad["notSpecified"]+"</i>";
var htmlHeader = "";
if(notEmpty(contextData.organizer) && Object.keys(contextData.organizer).length > 0){
count=Object.keys(contextData.organizer).length;
htmlAbout="";
$.each(contextData.organizer, function(e, v){
mylog.log("modif organizer each" , e, v);
heightImg=(count>1) ? 35 : 25;
imgIcon = (typeof v.profilThumbImageUrl != "undefined" && v.profilThumbImageUrl!="" ) ? baseUrl+"/"+v.profilThumbImageUrl: assetPath + "/images/thumb/default_"+v.type+".png";
htmlAbout+='<a href="#page.type.'+v.type+'.id.'+e+'" class="lbh tooltips" ';
......@@ -390,13 +394,14 @@ function bindAboutPodElement() {
htmlHeader =tradDynForm.organizedby + " " + htmlAbout;
}
else if(notEmpty(contextData.organizerId) && contextData.organizerId!="dontKnow"){
html = '<a href="#page.type.'+contextData.organizerType+'.id.'+contextData.organizerId+'" class="lbh">'+
htmlAbout = '<a href="#page.type.'+contextData.organizerType+'.id.'+contextData.organizerId+'" class="lbh">'+
'<i class="fa fa-'+dyFInputs.get(contextData.organizerType).icon+'"></i> '+
data.resultGoods.values.organizer.organizer.name+'</a><br/>';
htmlHeader = tradDynForm.organizedby + " : " + html;
}
$("#organizerAbout").html(html);
mylog.log("modif organizer html" , htmlAbout);
mylog.log("modif organizer htmlHeader" , htmlHeader);
$("#organizerAbout").html(htmlAbout);
$("#organizerHeader").html(htmlHeader);
}
}
......@@ -484,8 +489,14 @@ function bindAboutPodElement() {
};
if(contextData.type==typeObj.event.col){
form.dynForm.jsonSchema.properties.parent.init= function(){
finder.init("parent", false, ["events"], form.dynForm.jsonSchema.properties.parent.values, true,
function(){
var finderParams = {
id : "parent",
multiple : false,
initType : ["events"],
values : form.dynForm.jsonSchema.properties.parent.values,
update : true
};
finder.init(finderParams, function(){
$.each(finder.selectedItems, function(e, v){
startDateParent=v.startDate;
endDateParent=v.endDate;
......@@ -498,8 +509,23 @@ function bindAboutPodElement() {
}
$("#parentstartDate").html("<i class='fa fa-warning'></i> "+tradDynForm.eventparentStartDate+" : "+moment( startDateParent ).format('DD/MM/YYYY HH:mm'));
$("#parentendDate").html("<i class='fa fa-warning'></i> "+tradDynForm.eventparentEndDate+" : "+moment( endDateParent ).format('DD/MM/YYYY HH:mm'));
}
);
});
// finder.init("parent", false, ["events"], form.dynForm.jsonSchema.properties.parent.values, true,
// function(){
// $.each(finder.selectedItems, function(e, v){
// startDateParent=v.startDate;
// endDateParent=v.endDate;
// });
// $("#startDateParent").val(startDateParent);
// $("#endDateParent").val(endDateParent);
// if($("#parentstartDate").length <= 0){
// $("#ajaxFormModal #startDate").after("<span id='parentstartDate'><i class='fa fa-warning'></i> "+tradDynForm.eventparentStartDate+" : "+ moment( startDateParent ,"YYYY-MM-DD HH:mm").format('DD/MM/YYYY HH:mm')+"</span>");
// $("#ajaxFormModal #endDate").after("<span id='parentendDate'><i class='fa fa-warning'></i> "+tradDynForm.eventparentEndDate+" : "+ moment( endDateParent /*,"YYYY-MM-DD HH:mm"*/).format('DD/MM/YYYY HH:mm')+"</span>");
// }
// $("#parentstartDate").html("<i class='fa fa-warning'></i> "+tradDynForm.eventparentStartDate+" : "+moment( startDateParent ).format('DD/MM/YYYY HH:mm'));
// $("#parentendDate").html("<i class='fa fa-warning'></i> "+tradDynForm.eventparentEndDate+" : "+moment( endDateParent ).format('DD/MM/YYYY HH:mm'));
// }
// );
}
}
}
......@@ -516,7 +542,16 @@ function bindAboutPodElement() {
};
if(contextData.type==typeObj.event.col){
form.dynForm.jsonSchema.properties.organizer.init= function(){
finder.init("organizer", true, ["projects", "organizations"], form.dynForm.jsonSchema.properties.organizer.values, true);
var finderParams = {
id : "organizer",
multiple : true,
initType : ["projects", "organizations"],
values : form.dynForm.jsonSchema.properties.organizer.values,
update : true
};
finder.init(finderParams);
//finder.init("organizer", true, ["projects", "organizations"], form.dynForm.jsonSchema.properties.organizer.values, true);
}
}
//form.dynForm.jsonSchema.properties.organizerId = dyFInputs.organizerId(contextData.parentId, contextData.parentType);
......
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