Commit 0404e157 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

Merge remote-tracking branch 'origin/development' into development

parents 33ce3b76 e29274bc
......@@ -31,15 +31,16 @@ class LisearchAction extends CAction
$hasMembersP = false;
$searchCrit = array(
"searchType"=> array(Organization::COLLECTION, Project::COLLECTION, Event::COLLECTION, Person::COLLECTION)
"searchType"=> array(Organization::COLLECTION, Project::COLLECTION, Event::COLLECTION, Person::COLLECTION),
"indexMin"=>0,
"indexStep"=>300
);
$crit = "";
$icon = "";
$link = "";
if(@$tag){
$searchCrit["searchTag"]= array($tag);
$searchCrit["searchTags"]= array($tag);
$crit = "TAG : ".$tag;
$icon = "<i class='fa fa-tag'></i> ";
$link = "";
......@@ -75,7 +76,7 @@ class LisearchAction extends CAction
var_dump($list);
} else
*/
$list = Search::globalAutoComplete( $searchCrit );
$list = SearchNew::globalAutoComplete( $searchCrit );
if(isset($list) && @$list["results"]){
foreach ($list["results"] as $key => $value){
......@@ -90,9 +91,9 @@ class LisearchAction extends CAction
Event::COLLECTION,
Person::COLLECTION);
if( @$value['type'] && in_array( $value['type'], $types) ) {
if( @$value['collection'] && in_array( $value['collection'], $types) ) {
if( in_array($value['type'], array( Organization::COLLECTION,Organization::TYPE_BUSINESS , Organization::TYPE_NGO, Organization::TYPE_GROUP, Organization::TYPE_GOV, Organization::TYPE_COOP)) ){
if( in_array($value['collection'], array( Organization::COLLECTION,Organization::TYPE_BUSINESS , Organization::TYPE_NGO, Organization::TYPE_GROUP, Organization::TYPE_GOV, Organization::TYPE_COOP)) ){
// if(!$hasOrga){
// array_push($data, array( "id" => "orgas", "group" => 1, "label" => "ORGANIZATIONS", "level" => 1 ) );
// array_push($links, array( "target" => "orgas", "source" => "search", "strength" => $strength ) );
......@@ -103,7 +104,7 @@ class LisearchAction extends CAction
}
else if ($value['type'] == Event::COLLECTION ){
else if ($value['collection'] == Event::COLLECTION ){
// if(!$hasEvents){
// array_push($data, array( "id" => "events", "group" => 1, "label" => "EVENTS", "level" => 1 ) );
// array_push($links, array( "target" => "events", "source" => "search", "strength" => $strength ) );
......@@ -124,7 +125,7 @@ class LisearchAction extends CAction
// }
else if ($value['type'] == Project::COLLECTION ){
else if ($value['collection'] == Project::COLLECTION ){
// if(!$hasProjects){
// array_push($data, array( "id" => "projects", "group" => 1, "label" => "PROJECTS", "level" => 1 ) );
// array_push($links, array( "target" => "projects", "source" => "search", "strength" => $strength ) );
......
......@@ -21,13 +21,17 @@ class SearchAction extends CAction
$hasMembersP = false;
$searchCrit = array(
"searchType"=> array(Organization::COLLECTION, Project::COLLECTION, Event::COLLECTION, Person::COLLECTION)
"searchType"=> array(Organization::COLLECTION, Project::COLLECTION, Event::COLLECTION, Person::COLLECTION),
"countType"=> array(Organization::COLLECTION, Project::COLLECTION, Event::COLLECTION, Person::COLLECTION),
"indexMin"=>0,
"indexStep"=>300,
"count"=>true
);
$crit = "";
$icon = "";
$link = "";
if(@$tag){
$searchCrit["searchTag"]= array($tag);
$searchCrit["searchTags"]= array($tag);
$crit = "TAG : ".$tag;
$icon = "<i class='fa fa-tag'></i> ";
$link = "";
......@@ -40,7 +44,6 @@ class SearchAction extends CAction
}
else if(@$geo){
$searchCrit["locality"] = array(array( "type"=>"country", "countryCode" => $geo));
//echo "<script> alert( '".var_dump($searchCrit)."' ); </script>";
$crit = "GEO : ".$geo."";
$icon = "<i class='fa fa-map-marker'></i> ";
$link = "";
......@@ -63,8 +66,7 @@ class SearchAction extends CAction
var_dump($list);
} else
*/
$list = Search::globalAutoComplete( $searchCrit );
$list = SearchNew::globalAutoComplete( $searchCrit );
if(isset($list) && @$list["results"]){
foreach ($list["results"] as $key => $value){
$types = array(
......@@ -78,9 +80,9 @@ class SearchAction extends CAction
Event::COLLECTION,
Person::COLLECTION);
if( @$value['type'] && in_array( $value['type'], $types) ) {
if( @$value['collection'] && in_array( $value['collection'], $types) ) {
if( in_array($value['type'], array( Organization::COLLECTION,Organization::TYPE_BUSINESS , Organization::TYPE_NGO, Organization::TYPE_GROUP, Organization::TYPE_GOV, Organization::TYPE_COOP)) ){
if( in_array($value['collection'], array( Organization::COLLECTION,Organization::TYPE_BUSINESS , Organization::TYPE_NGO, Organization::TYPE_GROUP, Organization::TYPE_GOV, Organization::TYPE_COOP)) ){
if(!$hasOrga){
array_push($data, array( "id" => "orgas", "group" => 1, "label" => "ORGANIZATIONS", "level" => 1 ) );
array_push($links, array( "target" => "orgas", "source" => "search", "strength" => $strength ) );
......@@ -91,7 +93,7 @@ class SearchAction extends CAction
}
else if ($value['type'] == Person::COLLECTION ){
else if ($value['collection'] == Person::COLLECTION ){
if(!$hasKnows){
array_push($data, array( "id" => "people", "group" => 1, "label" => "PEOPLE", "level" => 1) );
array_push($links, array( "target" => "people", "source" => "search", "strength" => $strength ) );
......@@ -101,7 +103,7 @@ class SearchAction extends CAction
array_push($links, array( "target" => $key, "source" => "people", "strength" => $strength ,"tags" => @$value["tags"]) );
}
else if ($value['type'] == Event::COLLECTION ){
else if ($value['collection'] == Event::COLLECTION ){
if(!$hasEvents){
array_push($data, array( "id" => "events", "group" => 1, "label" => "EVENTS", "level" => 1 ) );
array_push($links, array( "target" => "events", "source" => "search", "strength" => $strength ) );
......@@ -111,7 +113,7 @@ class SearchAction extends CAction
array_push($links, array( "target" => $key, "source" => "events", "strength" => $strength ) );
}
else if ($value['type'] == Project::COLLECTION ){
else if ($value['collection'] == Project::COLLECTION ){
if(!$hasProjects){
array_push($data, array( "id" => "projects", "group" => 1, "label" => "PROJECTS", "level" => 1 ) );
array_push($links, array( "target" => "projects", "source" => "search", "strength" => $strength ) );
......@@ -132,7 +134,14 @@ class SearchAction extends CAction
}
}
}
$crit .= " (".count($data).")";
if(isset($list["count"])){
$countRes=0;
foreach($list["count"] as $v){
$countRes+=$v;
}
}else
$countRes=count($data);
$crit .= " (".$countRes.")";
$params = array(
'data' => $data,
'links' => $links,
......
......@@ -141,7 +141,7 @@ function open (url) {
smallMenu.openAjaxHTML( baseUrl+'/'+url);
else
// REMETTRE "/ph/"+url; en prod
window.location.href = url;
window.location.href = baseUrl+'/'+url;
}
//create somewhere to put the force directed graph
......@@ -376,7 +376,7 @@ else
tags.forEach(function (t) {
if (t != "") {
document.getElementById("graphtags").innerHTML = document.getElementById("graphtags").innerHTML+ "<a href=\"javascript:open('graph/co/search/tag/"+t+"')\">#"+t+"</a><br/>";
document.getElementById("graphtags").innerHTML = document.getElementById("graphtags").innerHTML+ "<a href=\"javascript:open('graph/co/search/tag/"+ encodeURIComponent(t)+"')\">#"+t+"</a><br/>";
}
})
......
......@@ -291,7 +291,7 @@ function createFluidGraph(type, contextId, dataToD3) {
NGO : {sameAs:"organization", color:"green", icon:"users"},
Association : {sameAs:"organization", color:"green", icon: "group"},
GovernmentOrganization : {col:"organization", color: "red",icon: "university"},
Cooperative : {col:"organization", color: "green",icon: "university"},
Cooperative : {col:"organization", color: "nightblue",icon: "university"},
Group : { col:"organizations",color: "turq",icon: "circle-o"},
event : {col:"events",ctrl:"event",icon : "calendar",titleClass : "bg-orange", color:"orange",bgClass : "bgEvent"},
events : {sameAs:"event"},
......
......@@ -154,7 +154,7 @@ jQuery(document).ready(function() {
NGO : {sameAs:"organization", color:"green", icon:"users"},
Association : {sameAs:"organization", color:"green", icon: "group"},
GovernmentOrganization : {col:"organization", color: "red",icon: "university"},
Cooperative : {col:"organization", color: "green",icon: "industry"},
Cooperative : {col:"organization", color: "nightblue",icon: "industry"},
Group : { col:"organizations",color: "turq",icon: "circle-o"},
event : {col:"events",ctrl:"event",icon : "calendar",titleClass : "bg-orange", color:"orange",bgClass : "bgEvent"},
events : {sameAs:"event"},
......
......@@ -41,10 +41,27 @@
data: <?php echo $id?>barChartData,
options: {
responsive: true,
legend : {display:false}
legend : {display:false},
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
stepSize : 1
},
scaleLabel: {
display: true
}
}]
}
}
});
if (typeof <?php echo $id?>Data.yAxesLabel != "undefined") {
myBar<?php echo $id?>.options.scales.yAxes[0].scaleLabel.display = true;
myBar<?php echo $id?>.options.scales.yAxes[0].scaleLabel.labelString = <?php echo $id?>Data.yAxesLabel;
myBar<?php echo $id?>.update();
}
ctxContainer.onclick = function(evt) {
var activePoints = myBar<?php echo $id?>.getElementsAtEvent(evt);
if (activePoints[0]) {
......
......@@ -131,10 +131,7 @@ jQuery(document).ready(function() {
title: {
display: false,
text : <?php echo $id?>Data.title
},
tooltips: {
}
}
}
};
......
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