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

Batch cressReunion

parent 85ba1c10
......@@ -5575,6 +5575,34 @@ if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
echo "Number of contacts modified : ".$nbUser;
}
}
public function actionCressRéunion() {
if( Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]) )){
$nbUser = 0;
$where3 = array("source.key" => array('$in' => array("CRESS1", "CRESS2", "CRESS3", "CRESS4") ) );
$resElt3 = PHDB::find(Organization::COLLECTION, $where3 , array("name", "source"));
//Rest::json($resElt3); exit ;
foreach ($resElt3 as $key => $value) {
$value["source"]["key"] = "cressReunion";
$value["source"]["keys"][] = "cressReunion";
$res = PHDB::update(Organization::COLLECTION,
array("_id"=>new MongoId($key)),
array('$set' => array("source" => $value["source"]) ) );
if( $res["ok"] == 1 ){
$nbUser++;
} else {
echo "<br/> Error with user id : ".$key;
}
}
//Rest::json($tags); exit;
echo "Number of contacts modified : ".$nbUser;
}
}
}
......
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