Commit 3ac0b18c authored by ramiandrison gova's avatar ramiandrison gova
Browse files

Merge remote-tracking branch 'origin/master'

parents cd256c23 470fa971
......@@ -235,10 +235,9 @@ adminPanel.views.pledge = function(){
view : "dropdownList",
type : "filters",
name : "Données publiques",
//event : "selectList",
field : "publicDonationData",
action : "filters",
event : "filters",
event : "filters",
keyValue : false,
list : {
"true" : "Données publiques",
......
......@@ -25,22 +25,84 @@ costum[costum.slug] = {
// };
// dyFObj.openForm('project', null, values);
// },
formData : function(data){
//alert("formdata");
mylog.log("formData",data);
//if(dyFObj.editMode){
//alert(e, v){
if(typeof data.state != "undefined"){
if(typeof data.tags == "undefined" || !notNull(data.tags)) data.tags=[];
if(typeof data.state == "string")
data.tags.push(data.state);
else{
$.each(data.state, function(i,tag){
data.tags.push(tag);
});
}
}
if(typeof data.category != "undefined"){
var cat=(data.category=="research") ? "Recherche-action" : "Commun";
if(typeof data.tags == "undefined" || !notNull(data.tags)) data.tags=[];
data.tags.push(cat);
//delete data.mainTag;
}
// if(typeof data.mainTag != "undefined"){
// if(typeof data.tags == "undefined" || !notNull(data.tags)) data.tags=[];
// data.tags.push(data.mainTag);
// //delete data.mainTag;
// }
return data;
},
beforeBuild : function(data) {
ajaxPost(
null,
baseUrl+"/"+moduleId+"/slug/getinfo/key/"+costum.assetsSlug,
null,
function(data){
values={
parent : {}
};
values.parent[data.contextId]={
"name" : costum.assetsSlug,
"type" : data.contextType
};
dyFObj.openForm("project",null,values,null,dyFProject);
}
);
},
afterBuild : function(data){
mylog.log("afterbuild lab !!!");
dataHelper.activateMarkdown("#ajaxFormModal #description");
$("#ajaxFormModal .descriptiontextarea").attr("style","margin-left:15% !important;width:70% !important");
ajaxPost(
null,
baseUrl+"/"+moduleId+"/slug/getinfo/key/"+costum.assetsSlug,
null,
function(data){
costum.typeObj.projects.dynFormCostum.beforeBuild.properties.parent.values={};
costum.typeObj.projects.dynFormCostum.beforeBuild.properties.parent.values[data.contextId]={
"name" : costum.assetsSlug,
"type" : data.contextType
};
}
);
// var dyFProject = {
// beforeBuild : function(data) {
// ajaxPost(
// null,
// baseUrl+"/"+moduleId+"/slug/getinfo/key/"+costum.assetsSlug,
// null,
// function(data){
// values={
// parent : {}
// };
// values.parent[data.contextId]={
// "name" : costum.assetsSlug,
// "type" : data.contextType
// };
// dyFObj.openForm("project",null,values,null,dyFProject);
// }
// );
// }
// };
// dyFProject.beforeBuild();
}
}
};
\ No newline at end of file
......@@ -342,11 +342,22 @@ class FiliereController extends CommunecterController {
$elementType = $request->getPost("element", "");
$source=$_POST["source"];
$priority =isset($_POST["priority"]) ? $_POST["priority"] : null;
$category =isset($_POST["category"]) ? $_POST["category"] : null;
$elements = array();
//var_dump($_POST);
if($elementType=="projects"){
$query = array('parent.'.$id => array('$exists' => true));
$field = ['_id', 'name', 'slug', 'profilImageUrl', 'shortDescription', 'collection'];
if(!empty($category)){
$query["category"]=$category;
array_push($field,"category");
}
// Fields :, ['name', 'slug', 'profilImageUrl', 'shortDescription', 'collection']
$elements = PHDB::find(Project::COLLECTION, array('parent.'.$id => array('$exists' => true)), ['_id', 'name', 'slug', 'profilImageUrl', 'shortDescription', 'collection']);
$elements = PHDB::find(Project::COLLECTION, $query, $field );
}
if($elementType=="crowdfunding"){
......
......@@ -23,9 +23,6 @@
}
},
"css": {
"urls": [
"index.css"
],
"loader": {
"background": "white",
"ring1": {
......@@ -145,6 +142,7 @@
"hash": "#app.search",
"urlExtra": "/page/communs",
"icon" : "creative-commons",
"filterObj":"costum.views.custom.labEnCommuns.filters",
"subdomainName": "Communs",
"results": {
"renderView": "directory.elementPanelHtml",
......@@ -154,10 +152,6 @@
"types": [
"projects"
]
},
"searchObject": {
"indexStep": "30",
"sortBy": "name"
}
}
},
......@@ -362,10 +356,7 @@
"endDate" : {
"inputType" : "datetime",
"placeholder": "Renseignez la date de fin",
"label" : "Date de clôture de la recherche-action",
"rules" : {
"greaterThan": ["#ajaxFormModal #startDate","La date de commencement"]
}
"label" : "Date de clôture de la recherche-action"
},
"state" : {
"label" : "S'agit-il d'une recherche-action en cours ou d'une idée de recherche-action à mener prochainement ?",
......@@ -406,7 +397,7 @@
"color" : "orange",
"name" : "Commun",
"add" : true,
"sameAs" : "projects",
"sameAs" : "project",
"formType" : "common",
"formParent" : "project",
"createLabel" : "Ajouter un commun",
......
......@@ -708,14 +708,40 @@ $explainAAP = "Un appel à projets est un vecteur de financement, un processus d
if (typeof currentAapConfig != "undefined" /*&& currentAapConfig.exist==true*/) // check if aapAlready exists ans make modification only
tplCtx.id = currentAapConfig._id.$id
$.each(aapConfigForm.jsonSchema.properties,function(k,v){
var kk = k.split("-").join("][");
if(v.inputType == 'tags')
tplCtx.value[kk] = $("#" + k).val().split(',');
else
tplCtx.value[kk] = $("#" + k).val();
//var kk = k.split("-").join("][");
//console.log("kk", kk, "v" , v);
if(k == "subForms-aapStep"+indexOfEvaluation+"-params-config-criterions")
tplCtx.value[kk] = formData["subForms-aapStep"+indexOfEvaluation+"-params-config-criterions"];
tplCtx.value[k] = formData["subForms-aapStep"+indexOfEvaluation+"-params-config-criterions"];
else if (k.split("-").length > 1 && k.split("-")[0] != "subForms"){
var spltid = k.split("-");
var spltidobj = spltid.reverse().reduce(function(total, current, index){
var sp = {};
if (index == 0){
sp[current] = $("#" + k).val();
}else {
sp[current] = total;
}
return sp;
}, {});
$.each(spltidobj, function(indx, val){
if (indx == "params"){
$.each(val, function(indx2, val2){
tplCtx.value[indx][indx2] = val2;
});
}else{
tplCtx.value[indx]= val;
}
});
} else {
if(v.inputType == 'tags')
tplCtx.value[k] = $("#" + k).val().split(',');
else
tplCtx.value[k] = $("#" + k).val();
}
});
tplCtx.value["mapping"] = {
"proposition" : "answers.aapStep1.titre",
......@@ -727,6 +753,8 @@ $explainAAP = "Un appel à projets est un vecteur de financement, un processus d
tplCtx.value["parent"] = formData.parent;
mylog.log("save tplCtx", tplCtx);
console.log("zzeeee", currentAapConfig);
if (typeof tplCtx.value == "undefined")
toastr.error('value cannot be empty!');
else {
......
......@@ -38,6 +38,13 @@
}
};
if(pageApp=="recherchesActions"){
paramsFilter.defaults.category="research";
}
else if(pageApp=="communs"){
paramsFilter.defaults.category="common";
}
if(typeof appConfig.results != "undefined")
paramsFilter.results=$.extend({},paramsFilter.results,appConfig.results);
......
......@@ -15,6 +15,7 @@ $paramsData = [
"iconActionColor" => "#ABB76B",
"imageForm" => "circle",
"textPreview" => "En savoir plus",
"category" => null
];
if (isset($blockCms)) {
......@@ -211,6 +212,10 @@ if(isset($this->costum["contextType"]) && isset($this->costum["contextId"])){
options : <?= json_encode(Cms::$icones); ?>,
values : sectionDyf.<?php echo $kunik ?>ParamsData.icon
},
category : {
label : "Catégorie des projets affichés",
values : sectionDyf.<?php echo $kunik ?>ParamsData.category
},
limit : {
label : "Nombre de project afficher",
values : sectionDyf.<?php echo $kunik ?>ParamsData.limit
......@@ -268,6 +273,11 @@ if(isset($this->costum["contextType"]) && isset($this->costum["contextId"])){
id : contextData.id
};
if (notNull(sectionDyf.<?php echo $kunik ?>ParamsData.category)){
params<?= $kunik ?>.category = sectionDyf.<?php echo $kunik ?>ParamsData.category;
}
ajaxPost(
null,
baseUrl+"/costum/filiere/getrelatedelements",
......
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