'tc', 2 => 'sc', 3 => 'special', 4 => 'tc', 5 => NULL, 6 => 'marketing', ); // Committee images are specific to this script $workgroup_image_list = array( 'join-tc' => 'join_tc.gif', 'tc-page' => 'committee_button.gif', 'join-sc' => 'join_sc.gif', 'sc-page' => 'subcommittee_button.gif', 'join-group' => 'join-group.png', 'members-page' => 'members-page.png', ); /* BEGIN KAVI INIT CODE */ require_once getenv("PHP_DOTORG_INIT"); require_once $dotorg->php_lib . "/common/format_utils.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/dbclasses/o_document_state.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/dbclasses/o_folder.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/dbclasses/o_workgroup.inc"; require_once $dotorg->php_lib . "/base/common/dbclasses/o_person.inc"; // Instantiate Kavi objects $workgroup = new oWorkGroup(); $workgroup_tbl = new oWorkGroupTable(); $person = new oPerson(); $person_tbl = new oPersonTable(); $_CLEAN['GET'] = clean($_GET); if (!isset($_CLEAN['GET']['wg_abbrev'])) { // Exit all further processing if we have no workgroup abbreviation // Send to committees page header($_SERVER["SERVER_PROTOCOL"] ." 302 Not Found"); header("Location: //www.oasis-open.org/committees"); exit(); } $wg_abbrev = $_CLEAN['GET']['wg_abbrev']; $result = $workgroup_tbl->retrieveObject("abbreviation='$wg_abbrev'", $workgroup); if (!$result || !$workgroup->isVisible($public_visibility)) { // Exit all further processing if we have an invalid workgroup abbreviation header($_SERVER["SERVER_PROTOCOL"] ." 404 Not Found"); header("Location: //www.oasis-open.org/page-not-found"); exit(); } /* END KAVI INIT CODE */ // If we haven't exited by now, we have a presumably valid workgroup objects // set a boolean switch that we can use throughout our logic $workgroup_is_active = ($workgroup->getValue('active') == 'true')? true : false; $workgroup_type_id = $workgroup->getValue('workgroup_type_id'); // Let's try to build our workgroup $workgroup_array = array( 'abbreviation' => $wg_abbrev, 'id' => $workgroup->getValue('id'), 'name' => $workgroup->getValue('name'), 'type_id' => $workgroup_type_id, 'type' => $workgroup_types[$workgroup_type_id], 'is_active' => $workgroup_is_active, 'join_button' => '', 'page_button' => '', 'type_abbreviation' => '', 'capped_type' => '', 'list_archive' => '', 'comment_archive' => '', 'path' => '', ); // Committee/Subcommittee differentiation defaults to TC $workgroup_array['join_button'] = $workgroup_image_list['join-tc']; $workgroup_array['page_button'] = $workgroup_image_list['tc-page']; $workgroup_array['type_abbreviation'] = "TC"; $workgroup_array['capped_type'] = $workgroup_array['type_abbreviation']; // Committee/Subcommittee differentiation: if SC, switch images and abbreviation if ($workgroup_array['type'] == "sc") { $workgroup_array['join_button'] = $workgroup_image_list['join-sc']; $workgroup_array['page_button'] = $workgroup_image_list['sc-page']; $workgroup_array['type_abbreviation'] = "SC"; $workgroup_array['capped_type'] = $workgroup_array['type_abbreviation']; // Workgroup is a subcommittee, so get its parent $oParent = $workgroup->getParent(); $workgroup_array['parent_name'] = $oParent->getValue('name'); $workgroup_array['parent_abbreviation'] = $oParent->getValue('abbreviation'); } // Marketing groups get no abbreviation for TC/SC // While Marketing groups have parents, we don't care about those (for now) if ($workgroup_array['type'] == "marketing") { $workgroup_array['join_button'] = $workgroup_image_list['join-group']; $workgroup_array['page_button'] = $workgroup_image_list['members-page']; $workgroup_array['type_abbreviation'] = "group"; $workgroup_array['capped_type'] = ucfirst($workgroup_array['type_abbreviation']); } // Special handling for Member Sections or Steering Committees if ($workgroup_array['type'] == 'special') { if (substr($workgroup_array['abbreviation'], -3) == '-ms' || substr($workgroup_array['abbreviation'], -3) == '-sc') { $workgroup_array['type'] = 'special-ms-sc'; } } $workgroup_array['list_archive'] = $wg_abbrev; // override with values from our LEGACY lookup if (isset($legacy_list_archives[$wg_abbrev])) { $workgroup_array['list_archive'] = $legacy_list_archives[$wg_abbrev]; } $workgroup_array['comment_archive'] = "{$wg_abbrev}-comment"; // figure out the archive location value for LEGACY exceptions if (isset($legacy_comment_list [$wg_abbrev])) { $workgroup_array['comment_archive'] = $legacy_comment_list [$wg_abbrev]; } // figure out the kavi workgroup path for legacy exceptions $workgroup_array['path'] = $wg_abbrev; if (isset($legacy_workgroup_path[$wg_abbrev])) { $workgroup_array['path'] = $legacy_workgroup_path[$wg_abbrev]; } /** * Create a nav that differentiates between our various types of groups * * @param Accepts the $workgroup array * * @returns an HTML-formatted list of links */ function generate_committee_nav_links($workgroup) { $links = array(); // Display link to parent TC if workgroup is a SC if ($workgroup['type'] == 'sc') { $links['parent'] = 'Parent TC Page'; } // Display Charter only if workgroup is a TC or a non-member section/non-steering committee special if ($workgroup['type'] == 'tc' || $workgroup['type'] == 'special' || $workgroup['type'] == 'marketing') { $charter = '/committees/'. $workgroup['abbreviation'] .'/charter.php'; if (file_exists($_SERVER['DOCUMENT_ROOT'] . $charter)) { $links['charter'] = 'Charter'; } } // Display Parent TC's IPR page link if workgroup is a SC if ($workgroup['type'] == 'tc') { $links['ipr'] = 'IPR Statement'; } elseif ($workgroup['type'] == 'sc') { $links['ipr'] = 'TC IPR Statement'; } // Display FAQ only if workgroup is a TC or a non-member section/non-steering committee special if ($workgroup['type'] == 'tc' || $workgroup['type'] == 'special') { $faq = '/committees/'. $workgroup['abbreviation'] .'/faq.php'; if (file_exists($_SERVER['DOCUMENT_ROOT'] . $faq)) { $links['faq'] = 'FAQ'; } if ($workgroup['abbreviation'] === "ubl") { $links['faq'] = 'FAQ'; } } // All active workgroups get membership pages if ($workgroup['is_active']) { $links['membership'] = 'Membership'; } if ($workgroup['type_id'] == '4') { $links['obligation'] = 'Obligated Members'; } // everyone gets an archive $links['archives'] = 'Email Archives'; // Display Comments Archive link only if workgroup is a TC or TAB if ($workgroup['type'] == 'tc' || $workgroup['abbreviation'] == 'tab') { $links['comments'] = 'Comments Archive'; } // everyone gets Docs and Schedule links $links['ballots'] = 'Ballots'; $links['documents'] = 'Documents'; $links['calendar'] = 'Schedule'; if ($workgroup['type'] == 'tc' || $workgroup['type'] == 'special' || $workgroup['type'] == 'marketing') { // Display Minutes only if workgroup is a TC or a non-member section/non-steering committee special // Hiding Minutes per Mary's request // $links['minutes'] = 'Minutes'; // Display Press page only if workgroup is a TC or a non-member section/non-steering committee special $press = '/committees/'. $workgroup['abbreviation'] . '/press.php'; if (file_exists($_SERVER['DOCUMENT_ROOT'] . $press)) { $links['press'] = 'Press'; } } // now output our links wrapped in presentation layer HTML and CSS $related_links_list = ""; foreach ($links as $k => $v) { $related_links_list .= << HTML; } return $related_links_list; } /** * Looks for a logo file and generates the appropriate HTML for display * * @param Accepts the $workgroup array and the base includes directory path * * @returns an HTML-formatted image */ function generate_logo($workgroup, $file_path) { $logo = NULL; $found_file = FALSE; $workgroup_abbreviation = $workgroup['abbreviation']; if ($workgroup['type'] == 'sc') { $workgroup_abbreviation = $workgroup['parent_abbreviation']; } $relative_path = "/committees/$workgroup_abbreviation/"; // If group has a logo, or is a subcommittee and parent has a logo, // generate the logo HTML $logo_image_dir = $file_path . $relative_path; $logo_pattern = '/^logo\.(png|jpe?g|gif)$/'; // open directory // look for file named logo.png|jpe?g|gif if ($handle = @opendir($logo_image_dir)) { while (false !== ($file = readdir($handle))) { if (preg_match($logo_pattern, $file, $matches)) { $logo_file = "logo.". $matches[1]; $found_file = TRUE; break; } } closedir($handle); } // CDN support; if the file is not available locally, try in the CDN if (!$found_file) { $host = $_SERVER['HTTP_HOST']; if (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && !empty($_SERVER['HTTP_X_FORWARDED_HOST'])) { $host = $_SERVER['HTTP_X_FORWARDED_HOST']; } // We support limited types $logo_extension_pattern = array( "png", "jpeg", "jpg", "gif", ); foreach ($logo_extension_pattern as $extension) { $logo_file = "logo.". $extension; if (cdn_url_exists("https://". $host . $relative_path . $logo_file)) { $found_file = TRUE; break; } } } if ($found_file) { $logo = ''. $workgroup['name'] .''; } return $logo; } function cdn_url_exists($url) { $headers = @get_headers($url, 1); if (is_array($headers)) { if (preg_match('#^HTTP/\d+\.\d+\s+2\d\d\s+.*$#', $headers[0])) { return TRUE; } elseif (preg_match('#^HTTP/\d+\.\d+\s+3\d\d\s+.*$#', $headers[0]) && preg_match('#^HTTP/\d+\.\d+\s+2\d\d\s+.*$#', $headers[1])) { return TRUE; } else { return FALSE; } } return FALSE; } /** * Workgroup buttons for joining, going to members only pages, or commenting * Buttons differ for active or inactive groups * * @param Accepts the $workgroup array * * @returns an HTML-formatted set of linked images */ function generate_buttons($workgroup) { // we have figured out by now what type of committee we are serving, so finally create a set of images to use $workgroup_page_image = << HTML; $comment_image = << HTML; $join_image = << HTML; $buttons = <<$workgroup_page_image HTML; $comment_button = <<$comment_image HTML; if ($workgroup['type'] == 'tc' || $workgroup['type'] == 'sc' || $workgroup['abbreviation'] == 'tab') { $buttons .= $comment_button; } if ($workgroup['is_active']) { $buttons = "$join_image\n   " . $buttons; } return $buttons; } /** * Kavi SQL */ /* Fetch the notes from the database */ $sql = $workgroup_tbl->database->query("select note from workgroup where abbreviation = '". $workgroup_array['abbreviation'] ."'"); $records = mysql_fetch_array($sql); if ( $records[0] ) { $workgroup_note = $records[0]; } else { $workgroup_note = ""; } /* Fetch Sponsors for active workgroups */ // Check to see if TC is active before outputting sponsor block (issue #7774) $workgroup_sponsor_block = ""; if ($workgroup_array['is_active'] && $workgroup_array['abbreviation'] != "tca" && $workgroup_array['abbreviation'] != "tab") { // This code block, and the script in general were updated // as part of issue #6483 $tmpTable = array(); $sql1 = " SELECT DISTINCT c.comp_name FROM company c, person p, workgroup_person wp, workgroup_role wr, workgroup w WHERE c.comp_id = p.comp_id AND wp.person_id = p.person_id AND wp.workgroup_id = w.id AND wr.id = wp.workgroup_role_id AND w.abbreviation= '". $workgroup_array['abbreviation'] ."' AND wp.workgroup_role_id != 4 AND wp.workgroup_role_id != 6 AND wp.workgroup_role_id != 7 "; $resultSet = $workgroup_tbl->database->query($sql1); while ($row = @mysql_fetch_array($resultSet)) { array_push($tmpTable, $row[0]); // $tmpTable will contain all companies with a Member, Secretary, or Chair } // Added DISTINCT to prevent the same company from coming up twice // for the TC participant list (resolving issue #7230 $sql2 = " SELECT DISTINCT c.name, c.url FROM company c, company_type ct, company_type_types ctt WHERE ctt.name like ('%sponsor%') AND ctt.rtype_id=ct.my_rtype AND ct.left_key=c.item_key AND c.status='active' ORDER BY c.name "; $result = array(); mysql_select_db('kavi_live_members'); $resultSet = mysql_query($sql2); while ($row = @mysql_fetch_array($resultSet)) { if (in_array($row[0],$tmpTable)) { array_push($result, array('company' => $row[0], 'url' => $row[1])); } } if (count($result)) { $workgroup_sponsor_block = ""; $workgroup_sponsor_block_inner = ""; $workgroup_sponsor_block_prefix = <<

${workgroup_array['capped_type']} Participants

Representing these OASIS Foundationals and Sponsors:

HTML; foreach ($result as $sponsor) { $workgroup_sponsor_block_inner .= <<${sponsor['company']} HERE; } $workgroup_sponsor_block = $workgroup_sponsor_block_prefix . $workgroup_sponsor_block_inner . $workgroup_sponsor_block_suffix; } // end if } // end if $related_links_prefix = <<

Related links

HTML; $tc_logo = generate_logo($workgroup_array, $BASE_INCLUDE_DIR); $related_links_list = generate_committee_nav_links($workgroup_array); $related_links = $related_links_prefix . $related_links_list . $related_links_suffix; $right = ""; if (isset($search_block) && !empty($search_block)) { $right .= $search_block; } if (isset($related_links) && !empty($related_links)) { $right .= $related_links; } if (isset($workgroup_sponsor_block) && !empty($workgroup_sponsor_block)) { $right .= $workgroup_sponsor_block; } $title = $workgroup_array['name']; $head_title = $title ." | OASIS"; $content_inner = ""; $content_inner .= '
'. generate_buttons($workgroup_array) .'
'; $workgroup_description = $workgroup->getValue('description'); if ($workgroup_description) { $workgroup_description = nl2br($workgroup_description); $workgroup_description = '

'. $workgroup_description .'

'; } $chair_output = ""; if ($workgroup_array['is_active']) { $chair_output = "\n

\n"; // display the contact info for any chairs we have by default $workgroup_role = new oWorkGroupRole(); $workgroup_role_chair_id = $workgroup_role->getChairId(); $query = "SELECT workgroup_person.person_id, workgroup_role.name FROM workgroup_person, workgroup_role WHERE workgroup_person.workgroup_id=". $workgroup_array['id'] ." AND workgroup_person.workgroup_role_id=workgroup_role.id AND workgroup_role.chair_flag = 'true' AND workgroup_role.id != 7 ORDER BY workgroup_role.id ASC"; $result = $person_tbl->database->query($query); if (!$result) { $chair_output .= "No chairs found.\n"; } else { while (list ($person_id, $role_name) = mysql_fetch_array($result)) { $found_person = $person_tbl->retrieveObject("person_id=$person_id",$person); if ($found_person) { $name = $person->getFullName(DEFAULT_FULL_NAME_LEN, false, false, false, true); $email = $person->getEmailLink(); if ($email) { $name = "$name, $email"; } $chair_output .= "$name, $role_name
"; } else { $name = "Person $person_id"; $chair_output .= "$name, $role_name
"; } } } $chair_output .= '

'; } $content_inner .= $workgroup_description . $chair_output; if ($workgroup_note) { $conversion_encoding = mb_detect_encoding($workgroup_note, "UTF-8,ISO-8859-1,WINDOWS-1252", true); if ($conversion_encoding !== "UTF-8") { $workgroup_note = iconv("WINDOWS-1252", "UTF-8//TRANSLIT", $workgroup_note); } $content_inner .= $workgroup_note; } $content_prefix = <<
HTML; $comment_suffix = ""; if ($workgroup_array['type'] == 'tc' || $workgroup_array['type'] == 'sc' || $workgroup_array['abbreviation'] == 'tab') { $comment_suffix = << Providing Feedback: OASIS welcomes feedback on its technical activities from potential users, developers, and others to better assure the interoperability and quality of OASIS work.

HTML; } $content_suffix = << $comment_suffix
HTML; $content = $content_prefix . $content_inner . $content_suffix; ?> <?php print $head_title; ?>