Beispiel #1
0
 /**
  * Create the top level 'Reports' item in the navigation tree.
  *
  * @param int $domain_id
  *
  * @return bool|\CRM_Core_DAO
  */
 public static function createOrUpdateTopLevelReportsNavItem($domain_id)
 {
     $id = NULL;
     $dao = new CRM_Core_BAO_Navigation();
     $dao->name = 'Reports';
     $dao->domain_id = $domain_id;
     // The first selectAdd clears it - so that we only retrieve the one field.
     $dao->selectAdd();
     $dao->selectAdd('id');
     if ($dao->find(TRUE)) {
         $id = $dao->id;
     }
     $nav = self::createReportNavItem('Reports', NULL, NULL, NULL, 'access CiviReport', $id, $domain_id);
     return $nav;
 }