Пример #1
0
 /**
  * Get title of the link to binding interface
  *
  * @param Integer $ugroupId Id of the user group
  *
  * @return String
  */
 public function getLinkTitle($ugroupId)
 {
     $ugroup = new ProjectUGroup(array('ugroup_id' => $ugroupId));
     if ($ugroup->isBound()) {
         $action = 'update_binding';
     } else {
         $action = 'add_binding';
     }
     return '- ' . $GLOBALS['Language']->getText('project_ugroup_binding', $action);
 }
Пример #2
0
 /**
  * Get the list of source ugroups by project
  *
  * @param Integer $sourceProject Id of the current soucrce project
  * @param ProjectUGroup  $currentSource Currently bound ugroup
  *
  * @return Array
  */
 private function getUgroupList($sourceProject, ProjectUGroup $currentSource = null)
 {
     $ugroupList = array();
     $selected = false;
     $ugroups = ugroup_db_get_existing_ugroups($sourceProject);
     while ($ugroup = db_fetch_array($ugroups)) {
         $userGroup = new ProjectUGroup(array('ugroup_id' => $ugroup['ugroup_id']));
         if (!$userGroup->isBound()) {
             if ($currentSource && $currentSource->getId() == $ugroup['ugroup_id']) {
                 $selected = true;
             }
             $ugroupList[] = array('ugroup_id' => $ugroup['ugroup_id'], 'name' => $ugroup['name'], 'selected' => $selected);
         }
     }
     return $ugroupList;
 }