Commit 91bef87a authored by Raph El's avatar Raph El
Browse files

Hotfix sur AdminPublic admin

parent 1006cc30
......@@ -102,7 +102,7 @@ function getCommunexionLabel(){
var level=0;
var nameCommunexion="";
$.each(myScopes.communexion, function(e, v){
if(v.type == "cities")
if(v.type == "city")
nameCommunexion=v.name;
});
$(".communexion-btn-label").html(nameCommunexion);
......
......@@ -557,6 +557,7 @@ class CommunecterController extends Controller
"power" => array('href' => "/ph/co2/app/power", "public" => true),
"superadmin" => array('href' => "/ph/co2/app/superadmin", "public" => false),
"admin" => array('href' => "/ph/co2/app/admin", "public" => true),
"adminpublic" => array('href' => "/ph/co2/app/adminpublic", "public" => true),
"info" => array('href' => "/ph/co2/app/info", "public" => true),
"smartconso" => array('href' => "/ph/co2/app/smartconso", "public" => true),
"city" => array('href' => "/ph/co2/app/city", "public" => false),
......@@ -624,6 +625,7 @@ class CommunecterController extends Controller
if( Yii::app()->controller->id == "adminpublic" && ( !Yii::app()->session[ "userIsAdmin" ] && !Yii::app()->session[ "userIsAdminPublic" ] ) )
throw new CHttpException(403,Yii::t('error','Unauthorized Access.'));
if( Yii::app()->controller->id != "test")
$page = $this->pages[Yii::app()->controller->id][Yii::app()->controller->action->id];
$pagesWithoutLogin = array(
......
......@@ -255,7 +255,7 @@
"#admin": {
"inMenu" : false,
"useHeader" : true,
"useHeader" : false,
"open" : false,
"subdomain" : "admin",
"subdomainName" : "admin",
......@@ -267,7 +267,7 @@
"#adminpublic": {
"inMenu" : false,
"useHeader" : true,
"useHeader" : false,
"open" : false,
"subdomain" : "admin",
"subdomainName" : "admin",
......
......@@ -197,13 +197,20 @@ class AppController extends CommunecterController {
public function actionAdmin($view=null, $dir=null){
CO2Stat::incNbLoad("co2-admin");
$params = array(
"view" => @$view,
"dir" => @$dir,
);
$view = ( !empty($view) ? $view : "index");
$redirect="";
if(Yii::app()->params["CO2DomainName"] == "terla")
$redirect="terla/";
echo $this->renderPartial("../admin/".$redirect."index", $params, true);
echo $this->renderPartial("../admin/".$redirect.$view, $params, true);
}
public function actionAdminpublic($view = null){
CO2Stat::incNbLoad("co2-adminpublic");
$view = ( !empty($view) ? $view : "index");
echo $this->renderPartial("../adminpublic/".$view, array(), true);
}
public function actionChat(){
......
......@@ -4086,6 +4086,48 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
}
echo $nbelement." multiscopes mis a jours / ";
}
public function actionUpdateCPMisingImport(){
ini_set('memory_limit', '-1');
$nbelement = 0 ;
$nbelementtotal = 0 ;
$where = array("source" => array('$exists' => 1), "address.postalCode" => array('$exists' => 0));
$fields = array("name","address");
$orgas = PHDB::find(Organization::COLLECTION, $where, $fields);
foreach ($orgas as $key => $value) {
if(!empty($value["address"]) && empty($value["address"]["postalCode"])){
$city = PHDB::findOneById( City::COLLECTION, $value["address"]["localityId"], array("postalCodes") );
$newAddress = $value["address"];
if(!empty($city) && !empty($city["postalCodes"])){
if( count($city["postalCodes"]) == 1 ) {
$newAddress["postalCode"] = $city["postalCodes"][0]["postalCode"];
}else{
foreach ($city["postalCodes"] as $keyCP => $valueCP) {
$name = strtoupper(str_replace(array("-","é"), array(" ","e"), $newAddress["addressLocality"]));
if(strtoupper($valueCP["name"]) == $name){
echo $valueCP["postalCode"]." CP : <br/>";
$newAddress["postalCode"] = $valueCP["postalCode"];
}
}
}
}
$set =array("address" => $newAddress);
echo $key." Name : ".$value["name"]." : ".(!empty($newAddress["postalCode"]) ? $newAddress["postalCode"] : "NULL")."<br/>";
$res = PHDB::update(Organization::COLLECTION,
array("_id"=>new MongoId($key)),
array('$set' => $set)
);
echo $nbelement." multiscopes mis a jours / ";
$nbelement++;
}
}
}
}
......@@ -15,35 +15,35 @@
<?php if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )) { ?>
<li class="list-group-item col-md-4 col-sm-6 ">
<a class="lbh text-yellow" style="cursor:pointer;" href="#admin.directory">
<a class="lbh text-yellow" style="cursor:pointer;" href="#admin.view.directory">
<i class="fa fa-user fa-2x"></i>
<?php echo Yii::t("admin", "DIRECTORY", null, Yii::app()->controller->module->id); ?>
</a>
</li>
<li class="list-group-item col-md-4 col-sm-6 ">
<a class="lbh text-purple" style="cursor:pointer;" href="#adminpublic.createfile">
<a class="lbh text-purple" style="cursor:pointer;" href="#adminpublic.view.createfile">
<i class="fa fa-upload fa-2x"></i>
<?php echo Yii::t("admin", "IMPORT DATA", null, Yii::app()->controller->module->id); ?>
</a>
</li>
<!-- <li class="list-group-item col-md-4 col-sm-6 ">
<a class="lbh text-red" style="cursor:pointer;" href="#admin.openagenda">
<a class="lbh text-red" style="cursor:pointer;" href="#admin.view.openagenda">
<i class="fa fa-calendar fa-2x"></i>
<?php echo Yii::t("admin", "OPEN AGENDA", null, Yii::app()->controller->module->id); ?>
</a>
</li> -->
<!-- <li class="list-group-item col-md-4 col-sm-6 ">
<a class="lbh text-red" style="cursor:pointer;" href="#admin.checkgeocodage">
<a class="lbh text-red" style="cursor:pointer;" href="#admin.view.checkgeocodage">
<i class="fa fa-map fa-2x"></i>
<?php echo Yii::t("admin", "CHECK GEOCODAGE", null, Yii::app()->controller->module->id); ?>
</a>
</li> -->
<li class="list-group-item col-md-4 col-sm-6 ">
<a class="lbh text-red" style="cursor:pointer;" href="#adminpublic.adddata">
<a class="lbh text-red" style="cursor:pointer;" href="#adminpublic.view.adddata">
<i class="fa fa-plus fa-2x"></i>
<?php echo Yii::t("admin", "ADD DATA", null, Yii::app()->controller->module->id); ?>
</a>
......@@ -57,14 +57,14 @@
</li>
<!-- <li class="list-group-item col-md-4 col-sm-6 ">
<a class="lbh text-green" style="cursor:pointer;" href="#admin.checkcities">
<a class="lbh text-green" style="cursor:pointer;" href="#admin.view.checkcities">
<i class="fa fa-list fa-2x"></i>
<?php echo Yii::t("admin", "CHECK CITIES", null, Yii::app()->controller->module->id); ?>
</a>
</li> -->
<li class="list-group-item col-md-4 col-sm-6 link-to-moderate">
<a class="lbh text-orange" style="cursor:pointer;" href="#admin.moderate.one">
<a class="lbh text-orange" style="cursor:pointer;" href="#admin.view.moderate.one">
<i class="fa fa-check fa-2x"></i>
<?php echo Yii::t("admin", "MODERATION", null, Yii::app()->controller->module->id); ?>
</a>
......@@ -77,13 +77,13 @@
</li>
<li class="list-group-item col-md-4 col-sm-6 ">
<a class="lbh text-yellow" style="cursor:pointer;" href="#admin.mailerrordashboard">
<a class="lbh text-yellow" style="cursor:pointer;" href="#admin.view.mailerrordashboard">
<i class="fa fa-envelope fa-2x"></i>
<?php echo Yii::t("admin", "MAILERROR", null, Yii::app()->controller->module->id); ?>
</a>
</li>
<!-- <li class="list-group-item col-md-4 col-sm-6 ">
<a class="lbh text-yellow" style="cursor:pointer;" href="#admin.cities">
<a class="lbh text-yellow" style="cursor:pointer;" href="#admin.view.cities">
<i class="fa fa-university fa-2x"></i>
<?php echo Yii::t("admin", "CITIES", null, Yii::app()->controller->module->id); ?>
</a>
......
......@@ -9,7 +9,8 @@
<!-- start: PAGE CONTENT -->
<div class="col-lg-offset-1 col-lg-10 col-xs-12 no-padding" id="content-social" style="min-height:700px;">
<div class="col-lg-offset-1 col-lg-10 col-xs-12 padding-15" id="content-social" style="min-height:700px;">
<h2>Admin Public</h2>
<div class="">
<ul class="list-group text-left no-margin">
<?php
......
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