php_lib . "/common/format_utils.inc"; require_once $dotorg->php_lib . "/base/common/organization.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/wg_traversal_tree.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/evote.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/dbclasses/o_time_zone.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/wg_search.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/dbclasses/o_wg_public.inc"; ////////////////////////////////////////////////////////////////////// // Ensure user input is clean (base/common/helpers.inc and // validate registered globals (base/common/validate.inc) ////////////////////////////////////////////////////////////////////// $my_sort_type_values = array('ASC', 'DESC'); $my_sort_field_values = array('ballot.name', 'ballot.close_date', 'workgroup.name', 'person.plname', 'd1.submission_date'); $_CLEAN['GET'] = clean($_GET); if (isset($_CLEAN['GET']['sort_field'])) { $sort_field = validateEnum($_CLEAN['GET']['sort_field'], $my_sort_field_values); } if (isset($_CLEAN['GET']['sort_type'])) { $sort_type = validateEnum($_CLEAN['GET']['sort_type'], $my_sort_type_values); } if (isset($_CLEAN['GET']['wg_abbrev'])) { $wg_abbrev = validateAbbrev($_CLEAN['GET']['wg_abbrev']); } if (isset($_CLEAN['GET']['page'])) { $page = validateInteger($_CLEAN['GET']['page']); } if (isset($_CLEAN['GET']['closed_within'])) { $closed_within = validateInteger($_CLEAN['GET']['closed_within']); } ////////////////////////////////////////////////////////////////////// // Declare form variables ////////////////////////////////////////////////////////////////////// if (!isset($wg_abbrev)) $wg_abbrev = ''; if (!isset($ballot_name)) $ballot_name = ''; if (!isset($workgroup_id)) $workgroup_id = 0; if (!isset($page)) $page = ''; if (!isset($sort_type)) $sort_type = ''; if (!isset($sort_field)) $sort_field = ''; if (!isset($closed_within)) $closed_within = ''; ////////////////////////////////////////////////////////////////////// // END OF VARIABLES ////////////////////////////////////////////////////////////////////// // For headers and footers $wg_public = new oWGPublic(); $self_url = rawurlencode($PHP_SELF); // Create person object for authenticated user $person = new oPerson(); $person_id = $person->populateFromLogin(); // Populate the current workgroup $workgroup = new oWorkGroup(); $workgroup_tbl = new oWorkGroupTable(); // If a wg abbreviation has been passed in, find the workgroup if (isset($wg_abbrev) && $wg_abbrev != '') { $found_workgroup = $workgroup_tbl->retrieveObject("abbreviation='$wg_abbrev'", $workgroup); if ($found_workgroup) { $workgroup_id = $workgroup->getValue('id'); $header = $workgroup->getPublicHeader(); $footer = $workgroup->getPublicFooter(); $group_name = $workgroup->getValue('name'); } else { $header = $wg_public->getHeader(); $footer = $wg_public->getFooter(); $group_name = 'Groups'; } } else { $header = $wg_public->getHeader(); $footer = $wg_public->getFooter(); $group_name = 'Groups'; } $header = 'file://'. $_SERVER["DOCUMENT_ROOT"] .'/committees/standard_html_header_nobc'; $footer = 'file://'. $_SERVER["DOCUMENT_ROOT"] .'/committees/standard_html_footer'; // This section includes the standard header $page_title = "$group_name Ballots"; include_remote_header($header, $page_title, 'workgroup'); print "
$pagination
"; } $limit_clause = ""; if ($page != 'all') { $start = $num_per_page * $page; $limit_clause .= " LIMIT $start,$num_per_page"; } $ballots = getBallots($workgroup_ids, $display_shared, $shared_with_wg_ids, $originating_wg_ids, $ballot_state, 0, $order_by, true, $where_clause, 0, false, $limit_clause, false ); printBallotList($ballots, $person_id, false, false, true, false, $name_link, $close_date_link, $workgroup_link, "ballot.php"); // This section includes the standard footer include_remote_footer($footer, 'workgroup');