[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/include/utils/ -> GetParentGroups.php (source)

   1  <?php
   2  /*********************************************************************************
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9  *
  10   ********************************************************************************/
  11  
  12  /** Class to retreive all the Parent Groups of the specified Group
  13   *
  14   */
  15  class GetParentGroups { 
  16  
  17      var $parent_groups=Array();
  18  
  19      /** to get all the parent vtiger_groups of the specified group
  20       * @params $groupId --> Group Id :: Type Integer
  21           * @returns updates the parent group in the varibale $parent_groups of the class
  22           */
  23  	function getAllParentGroups($groupId)
  24      {
  25          global $adb,$log;
  26          $log->debug("Entering getAllParentGroups(".$groupid.") method...");
  27          $query="select groupid from vtiger_group2grouprel where containsgroupid=".$groupId;
  28          $adb->query($query);
  29          $result=$adb->query($query);
  30          $num_rows=$adb->num_rows($result);
  31          if($num_rows > 0)
  32          {
  33              for($i=0;$i<$num_rows;$i++)
  34              {
  35                  $group_id=$adb->query_result($result,$i,'groupid');
  36                  if(! in_array($group_id,$this->parent_groups))
  37                  {
  38                      $this->parent_groups[]=$group_id;
  39                      $this->getAllParentGroups($group_id);
  40                  }
  41              }
  42          }
  43          $log->debug("Exiting getAllParentGroups method...");
  44      }
  45  }
  46  
  47  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7