Commit e91d5c07 authored by Raph El's avatar Raph El
Browse files

Hotfix

parent 76bad0e7
......@@ -5532,6 +5532,49 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
echo "Number of mails with status modified : ".$nbUser;
}
}
public function actionContactToContacts() {
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$nbUser = 0;
$col = array(
Organization::COLLECTION,
Project::COLLECTION,
Event::COLLECTION,
Poi::COLLECTION,
Need::COLLECTION,
Form::COLLECTION,
Form::ANSWER_COLLECTION,
Survey::COLLECTION,
Proposal::COLLECTION,
Classified::COLLECTION,
Action::COLLECTION,
);
$eltsReferenceEmail = array() ;
foreach ($col as $k => $v) {
$where3 = array("contact" => array('$exists' => 1) );
$resElt3 = PHDB::find($v, $where3 , array("name", "contact"));
//Rest::json($resElt3); exit ;
foreach ($resElt3 as $key => $value) {
$res = PHDB::update($v,
array("_id"=>new MongoId($key)),
array('$set' => array("contacts" => $value["contact"]),
'$unset' => array("contact"=>"") ) );
if($res["ok"] == 1){
$nbUser++;
}else{
echo "<br/> Error with user id : ".$key;
}
}
}
//Rest::json($tags); exit;
echo "Number of contacts modified : ".$nbUser;
}
}
}
......
......@@ -13,7 +13,7 @@ $this->renderPartial($layoutPath.'header',
echo "Les actions suivantes ont été excécuté : ";
echo "<ul>";
foreach ($res as $k => $v) {
if(!empty($v) && !empty($v["result"]) && $v["result"] == true){
if(!empty($v) && !empty($v["result"]) && $v["result"] === true){
echo "<li>".$v["msg"]."</li>";
}
}
......
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