예제 #1
0
 /**
  * @todo rebuild with List and JS operations
  * @todo move to admin
  * @throws GroupIDMissingException
  */
 public static function list_group_admin_organisation_units($group_id)
 {
     if (is_numeric($group_id)) {
         $template = new HTMLTemplate("organisation_unit/admin/dialog/list_group_admin.html");
         $paramquery = $_GET;
         $paramquery['action'] = "add_organisation_unit";
         $params = http_build_query($paramquery, '', '&');
         $template->set_var("add_ou_params", $params);
         $organisation_unit_array = OrganisationUnit::list_entries_by_group_id($group_id);
         $organisation_unit_content_array = array();
         $counter = 0;
         if (is_array($organisation_unit_array) and count($organisation_unit_array) >= 1) {
             foreach ($organisation_unit_array as $key => $value) {
                 $organisation_unit = new OrganisationUnit($value);
                 $paramquery = $_GET;
                 $paramquery['action'] = "delete_organisation_unit";
                 $paramquery['key'] = $value;
                 $params = http_build_query($paramquery, '', '&');
                 $organisation_unit_content_array[$counter]['name'] = $organisation_unit->get_name();
                 $organisation_unit_content_array[$counter]['delete_params'] = $params;
                 $counter++;
             }
             $template->set_var("no_ou", false);
         } else {
             $template->set_var("no_ou", true);
         }
         $template->set_var("ou", $organisation_unit_content_array);
         $template->output();
     } else {
         throw new GroupIDMissingException();
     }
 }
예제 #2
0
파일: user.io.php 프로젝트: suxinde2009/www
 /**
  * @throws GroupIDMissingException
  */
 public static function group_details()
 {
     if ($_GET['id']) {
         $group = new Group($_GET['id']);
         $template = new HTMLTemplate("base/user/group_details.html");
         $template->set_var("name", $group->get_name());
         $user_array = Group::list_group_releated_users($_GET['id']);
         $user_content_array = array();
         $counter = 0;
         if (is_array($user_array) and count($user_array) >= 1) {
             foreach ($user_array as $key => $value) {
                 $user = new User($value);
                 $paramquery = $_GET;
                 $paramquery['dialog'] = "user_detail";
                 $paramquery['id'] = $value;
                 $params = http_build_query($paramquery, '', '&');
                 $user_content_array[$counter]['username'] = $user->get_username();
                 $user_content_array[$counter]['fullname'] = $user->get_full_name(false);
                 $user_content_array[$counter]['params'] = $params;
                 $counter++;
             }
             $template->set_var("no_user", false);
         } else {
             $template->set_var("no_user", true);
         }
         $template->set_var("user", $user_content_array);
         $organisation_unit_array = OrganisationUnit::list_entries_by_group_id($_GET['id']);
         $organisation_unit_content_array = array();
         $counter = 0;
         if (is_array($organisation_unit_array) and count($organisation_unit_array) >= 1) {
             foreach ($organisation_unit_array as $key => $value) {
                 $organisation_unit = new OrganisationUnit($value);
                 $organisation_unit_content_array[$counter]['name'] = $organisation_unit->get_name();
                 $counter++;
             }
             $template->set_var("no_ou", false);
         } else {
             $template->set_var("no_ou", true);
         }
         $template->set_var("ou", $organisation_unit_content_array);
         $template->output();
     } else {
         throw new GroupIDMissingException();
     }
 }