...
 
Commits (13)
......@@ -177,8 +177,8 @@ var calendar = {
date : dateToShow.getDate(),
//gotoDate:moment(initDate),
editable : false,
eventBackgroundColor: '#FFA200',
textColor: '#fff',
eventBackgroundColor: '#FFA200 !important',
textColor: '#fff !important',
defaultView: calendar.viewMode,
events : [],
eventLimit: 3,
......@@ -301,10 +301,11 @@ var calendar = {
mylog.log("calendar.php globalautocomplete error", data);
},
success: function(data){
mylog.log("calendar.php globalautocomplete success", data);
//mylog.log("calendar.php globalautocomplete success", data);
if(!data){
toastr.error(data.content);
} else {
//mylog.log("calendar.php globalautocomplete success searchObject", searchObject.initType, searchObject.text);
if(typeof calendar != "undefined" && searchObject.initType == "events" && searchObject.text=="")
calendar.addEvents(data.events);
}
......
......@@ -372,8 +372,8 @@ function calculateAgendaWindow(nbMonth){
var today = new Date();
var todayMoment = moment().seconds(0).minute(0).hour(0);
mylog.log('directory.js calculateAgendaWindow today', typeof today, today);
mylog.log('directory.js calculateAgendaWindow today', typeof todayMoment, todayMoment, todayMoment.valueOf());
// mylog.log('directory.js calculateAgendaWindow today', typeof today, today);
// mylog.log('directory.js calculateAgendaWindow today', typeof todayMoment, todayMoment, todayMoment.valueOf());
today = new Date(today.setSeconds(0));
today = new Date(today.setMinutes(0));
today = new Date(today.setHours(0));
......@@ -381,11 +381,11 @@ function calculateAgendaWindow(nbMonth){
//STARTDATE = moment(todayMoment.format()).valueOf();
STARTDATE = today.setDate(today.getDate());
mylog.log('directory.js calculateAgendaWindow today2', typeof today, today);
mylog.log('directory.js calculateAgendaWindow todayMoment', typeof todayMoment, todayMoment.format(), todayMoment.valueOf());
/// mylog.log("directory.js calculateAgendaWindow todayUTC0", typeof todayUTC0, todayUTC0, todayUTC0.format(), todayUTC0.valueOf());
mylog.log('directory.js calculateAgendaWindow STARTDATE', typeof STARTDATE, STARTDATE);
mylog.log('directory.js calculateAgendaWindow end',STARTDATE);
// mylog.log('directory.js calculateAgendaWindow today2', typeof today, today);
// mylog.log('directory.js calculateAgendaWindow todayMoment', typeof todayMoment, todayMoment.format(), todayMoment.valueOf());
// /// mylog.log("directory.js calculateAgendaWindow todayUTC0", typeof todayUTC0, todayUTC0, todayUTC0.format(), todayUTC0.valueOf());
// mylog.log('directory.js calculateAgendaWindow STARTDATE', typeof STARTDATE, STARTDATE);
// mylog.log('directory.js calculateAgendaWindow end',STARTDATE);
searchObject.startDate = Math.floor(STARTDATE / 1000);
......@@ -2685,9 +2685,8 @@ var directory = {
&& typeof costum.app[directory.appKeyParam].map != 'undefined'
&& typeof costum.app[directory.appKeyParam].map.hash != 'undefined'){
mylog.log('headerStr if');
headerStr+= '<button class="lbh-menu-app hidden-xs" data-hash="'+costum.app[directory.appKeyParam].directory.map.hash+'" style="" title="'+trad.showmap+'" alt="'+trad.showmap+'">'+
'<i class="fa fa-map-marker"></i> '+trad.map;
'</button>';
headerStr+= '<a class="lbh-menu-app btn btn-hash-map" href="'+costum.app[directory.appKeyParam].map.hash+'" style="" title="'+trad.showmap+'" alt="'+trad.showmap+'">'+
'<i class="fa fa-map-marker"></i> '+trad.map+'</a>';
} else if( !notNull(directory.costum)
|| typeof directory.costum.header == 'undefined'
|| typeof directory.costum.header.map== 'undefined'
......
......@@ -505,7 +505,7 @@ var searchInterface={
SEARCH ENGINE
-------------------------------*/
constructObjectAndUrl: function(notUrl){
mylog.log("searchInterface.constructObjectAndUrl", searchObject);
mylog.log("searchInterface.constructObjectAndUrl", searchObject, notUrl);
getStatus="";
var searchConstruct={};
if(searchObject.text != "")
......@@ -571,13 +571,13 @@ var searchInterface={
if(searchObject.community != false)
searchConstruct.community = searchObject.community;
// Locality
searchConstruct.locality = getSearchLocalityObject();
searchInterface.countActiveFilters();
// searchConstruct.locality = getSearchLocalityObject();
// searchInterface.countActiveFilters();
//Construct url with all necessar params
if(typeof notUrl == "undefined" ||
notUrl == null ||
notUrl == false)
if(typeof notUrl === "undefined" ||
notUrl === null ||
notUrl === false)
urlCtrl.manageHistory();
return searchConstruct;
},
......
......@@ -7335,6 +7335,67 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$events = Element::getLastEvents("organizations", "5e203fc98b509c36568b4584", 4, "2016-01-23T00:00:00+04:00");
Rest::json($events); exit;
}
public function actionAddZonePF(){
//$level1 = Zone::createLevel("PF", "Polynésie française", "1");
$url = "https://nominatim.openstreetmap.org/details.php?osmtype=R&osmid=3412620&class=boundary&format=json&email=".Yii::app()->params["contactEmail"];
$nominatim = SIG::getUrl($url);
//var_dump(json_decode($nominatim)); exit;
$nominatim = json_decode($nominatim, true);
$zone=array();
$info=array();
$translates=array();
if(!empty($nominatim)){
$zone["name"] = $nominatim["localname"];
$zone["countryCode"] = "PF";
$zone["level"] = array("1");
// $zone["geo"] = SIG::getFormatGeo($nominatim["lat"], $nominatim["lon"]);
// $zone["geoPosition"] = SIG::getFormatGeoPosition($nominatim["lat"], $nominatim["lon"]);
$lat = $nominatim["geometry"]["coordinates"][1];
$lon = $nominatim["geometry"]["coordinates"][0];
$zone["geo"] = SIG::getFormatGeo($lat, $lon);
$zone["geoPosition"] = SIG::getFormatGeoPosition($lat, $lon);
//$zone["geoShape"] = $nominatim["geojson"];
if(!empty($nominatim["osm_id"]))
$zone["osmID"] = $nominatim["osm_id"];
if(!empty($nominatim["extratags"]["wikidata"]))
$zone["wikidataID"] = $nominatim["extratags"]["wikidata"];
if(!empty($nominatim["names"])){
foreach ($nominatim["names"] as $keyName => $valueName) {
$arrayName = explode(":", $keyName);
if(!empty($arrayName[1]) && $arrayName[0] == "name" && strlen($arrayName[1]) == 2 && $nominatim["localname"] != $valueName){
$translates[strtoupper($arrayName[1])] = $valueName;
}
}
}
$info["countryCode"] = $zone["countryCode"];
$info["parentType"] = Zone::COLLECTION;
$info["translates"] = $translates;
$info["origin"] = $nominatim["localname"];
}
$res = array(
"zone" =>$zone,
"info" =>$info
);
// PHDB::insert(Zone::COLLECTION, $zone );
// $info["parentId"] = (String) $zone["_id"];
// PHDB::insert(Zone::TRANSLATE, $info);
// PHDB::update(Zone::COLLECTION,
// array("_id"=>new MongoId((String) $zone["_id"])),
// array('$set' => array("translateId" => (String)$info["_id"]))
// );
Rest::json($res);
}
public function actionCitySaintPierreEtMichellon(){
//$level1 = Zone::createLevel("PF", "Polynésie française", "1");
$city = PHDB::find(City::COLLECTION, array('postalCodes.postalCode'=> '97500'));
Rest::json($city); exit;
}
public function actionBashforeachActiveTags() {
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
......
......@@ -32,7 +32,7 @@ HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesTheme, Yii::app()->requ
$cssAnsScriptFilesModule = array(
'/js/default/calendar.js',
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, Yii::app()->getModule( "co2" )->getAssetsUrl());
HtmlHelper::registerCssAndScriptsFiles( array( '/css/calendar.css') , Yii::app()->theme->baseUrl. '/assets');
$calendarParams=(@Yii::app()->session["paramsConfig"]["pages"]["#agenda"] && @Yii::app()->session["paramsConfig"]["pages"]["#agenda"]["calendar"]) ?Yii::app()->session["paramsConfig"]["pages"]["#agenda"]["calendar"] : null;
if(isset(Yii::app()->session["costum"]) && !empty($calendarParams)){
......
<div class="pod-docs-list">
<?php
$docType=(isset($docType) && !empty($docType)) ? $docType : "file";
if(@$documents && !empty($documents)){
foreach($documents as $key => $d){
if($docType=="file"){
$ref_ext = array(
'jpg'=>array("icon"=>"image", "color"=>"dark"),
'jpeg'=>array("icon"=>"image", "color"=>"dark"),
'png'=>array("icon"=>"image", "color"=>"dark"),
'gif'=>array("icon"=>"image", "color"=>"dark"),
"pdf"=>array("icon"=>"file-pdf-o", "color"=>"red"),
"xls"=>array("icon"=>"table", "color"=>"green"),
"xlsx"=>array("icon"=>"table", "color"=>"green"),
"doc"=>array("icon"=>"file-alt", "color"=>"azure"),
"docx"=>array("icon"=>"file-alt", "color"=>"azure"),
"ppt"=>array("icon"=>"file-powerpoint", "color"=>"orange"),
"pptx"=>array("icon"=>"file-powerpoint", "color"=>"orange"),
"odt"=>array("icon"=>"file-alt", "color"=>"azure"),
"ods"=>array("icon"=>"table", "color"=>"green"),
"odp"=>array("icon"=>"file-powerpoint", "color"=>"orange"),
"csv"=>array("icon"=>"code", "color"=>"gray"));
$ext = strtolower(pathinfo($d["name"], PATHINFO_EXTENSION));
$color=(isset($ref_ext[$ext])) ? $ref_ext[$ext]["color"] : "dark";
$icon=(isset($ref_ext[$ext])) ? $ref_ext[$ext]["icon"] : "file";
?>
<div class='col-xs-12 padding-5 shadow2 margin-top-5 margin-bottom-5' id='<?php echo $key ?>'>
<a href='<?php echo $d["docPath"] ?>' target='_blank' class='link-files pull-left'><i class='fa fa-<?php echo $icon ?> text-<?php echo $color ?>'></i> <?php echo $d["name"] ?></a>
<?php if($edit==true) { ?>
<a href='javascript:;' class='pull-right text-red btn-remove-document' data-id='<?php echo $key ?>'><i class='fa fa-trash'></i> <?php echo Yii::t("common","Delete") ?></a>
<?php } ?>
</div>
<?php
}else{ ?>
<div class='col-xs-12 col-sm-4 padding-5 shadow2 margin-top-5 margin-bottom-5' id='<?php echo $key ?>'>
<img src="<?php echo $d["docPath"] ?>" class="img-responsive">
<span class="col-xs-12 elipsis"><?php echo $d["name"] ?></span>
<?php if($edit==true) { ?>
<a href='javascript:;' class='pull-right text-red btn-remove-document' data-id='<?php echo $key ?>'><i class='fa fa-trash'></i> <?php echo Yii::t("common","Delete") ?></a>
<?php } ?>
</div>
<?php }
}
}else{ ?>
<div class="sub-documents col-lg-12 col-md-12 col-sm-12">
<span>
<i class="fa fa-file-o margin-left-15"></i> <?php echo (($docType=="file") ? Yii::t("cooperation", "No documents"): Yii::t("common", "No images")) ?>
</span>
</div>
<?php
} ?>
</div>
\ No newline at end of file