+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
$tree = array();
while ($dao->fetch()) {
if (!array_key_exists($dao->child, $tree)) {
- $tree[$dao->child] = array('children' => array(),
+ $tree[$dao->child] = array(
+ 'children' => array(),
'parents' => array(),
);
}
if (!array_key_exists($dao->parent, $tree)) {
- $tree[$dao->parent] = array('children' => array(),
+ $tree[$dao->parent] = array(
+ 'children' => array(),
'parents' => array(),
);
}
$values = array();
foreach (array_keys($tree) as $id) {
- $parents = implode(',', $tree[$id]['parents']);
+ $parents = implode(',', $tree[$id]['parents']);
$children = implode(',', $tree[$id]['children']);
- $parents = $parents == NULL ? 'null' : "'$parents'";
+ $parents = $parents == NULL ? 'null' : "'$parents'";
$children = $children == NULL ? 'null' : "'$children'";
- $sql = "
+ $sql = "
UPDATE civicrm_group
SET parents = $parents ,
children = $children
}";
return $json;
}
+
}