Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Working towards including used formats in search results.

  • Loading branch information...
commit 513f388b1ae325970b8b5e2473770bdd7b4436e4 1 parent b8bd4c7
Chris M authored
View
4 main_server/c_comdef_mainpage.txt.php
@@ -4,7 +4,7 @@
<div style="height:24px"></div>
<div style="height:80px;background-color: #0013d2;background-image:url(../images/DocHeader.gif);background-position:center top;background-repeat:no-repeat"></div>
- \version 1.9.1 (Main Root Server)
+ \version 1.10 (Main Root Server)
\license This code is completely open and free. You may access it by
<a href="http://magshare.org/bmlt-the-basic-meeting-list-toolbox/">visiting the BMLT Project Site</a>.
@@ -295,7 +295,7 @@
- Our ears are wide open. Please contact us at webmaster -at- magnaws.com if you find any vulnerabilities.
<h2 id="docs_release_notes">RELEASE NOTES:</h2>
- - - 1.9.1 Release
+ - - 1.10 Release
- Removed the "Ag" code from the "primer" database, because it is a somewhat controversial format. However, it can easily be replaced by Service bodies that install the server.
- March 24, 2012 - 1.9 Release
View
7 main_server/client/c_comdef_meeting_search_manager.class.php
@@ -1019,13 +1019,11 @@ function &GetSearchResults_Obj( $in_new_search = false ///< If this is set to tr
// See if we need to make a new search. Only the root can do a new search.
if ( (null == $this->_my_root) && (true == $in_new_search) || (null == $this->_search_results) )
{
- $this->ClearSearch();
-
+ $this->_search_results = null;
+
// Basic error checking.
if ( $this->_my_server instanceof c_comdef_server )
{
- $this->_search_results = null;
-
// If we have an ID array, then we skip everything else, and just search for those IDs.
if ( is_array ( $this->_meeting_id_array ) && count ( $this->_meeting_id_array ) )
{
@@ -1111,7 +1109,6 @@ function &GetSearchResults_Obj( $in_new_search = false ///< If this is set to tr
$search_rect = $this->GetSquareForRadius($weekdays);
// Do the main database search first.
- $this->_search_results = null;
$null_me = null;
$this->_search_results = c_comdef_server::GetMeetings ( $service_bodies,
View
10 main_server/client/html/search_results_csv.php
@@ -243,12 +243,13 @@ function DisplaySearchResultsCSV ( $in_http_vars, /**< The various HTTP GET and
search criteria are ignored.
*/
&$return_array = null, ///< If this is supplied, then the result will be saved in this as an array. It must be an empty array, supplied by reference.
- &$return_geocode = null /**< If this is supplied, the response will be an associative array, with the search center and radius.
+ &$return_geocode = null, /**< If this is supplied, the response will be an associative array, with the search center and radius.
It will return:
- 'radius' The radius of the search, in Km
- 'longitude' The longitude of the search center
- 'latitude' Th latitude of the search center
- */
+ */
+ &$return_results = null ///< If supplied, should point to an array that will be filled with the actual meeting objects that comprise the result.
)
{
$ret = null;
@@ -390,6 +391,11 @@ function DisplaySearchResultsCSV ( $in_http_vars, /**< The various HTTP GET and
$ret .= ',"'.join ( '","', $formats_keys_header ).'"'."\n";
$in_ar =& $page_data->GetSearchResultsAsArray ( );
+ if ( isset ( $return_results ) && is_array ( $return_results ) )
+ {
+ $return_results = $in_ar;
+ }
+
foreach ( $in_ar as &$mtg_obj )
{
$line = array();
View
54 main_server/client_interface/csv/csv.php
@@ -62,7 +62,8 @@ function parse_redirect (
switch ( $http_vars['switcher'] )
{
case 'GetSearchResults':
- $result2 = GetSearchResults ( $http_vars );
+ $formats_ar = array();
+ $result2 = GetSearchResults ( $http_vars, $formats_ar );
if ( isset ( $http_vars['xml_data'] ) )
{
@@ -70,6 +71,20 @@ function parse_redirect (
$xsd_uri = 'http://'.htmlspecialchars ( str_replace ( '/client_interface/xml', '/client_interface/xsd', $_SERVER['SERVER_NAME'].dirname ( $_SERVER['SCRIPT_NAME'] ).'/GetSearchResults.php' ) );
$result .= "<meetings xmlns=\"http://".$_SERVER['SERVER_NAME']."\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://".$_SERVER['SERVER_NAME']." $xsd_uri\">";
$result .= TranslateToXML ( $result2 );
+ if ( $formats_ar && is_array ( $formats_ar ) && count ( $formats_ar ) )
+ {
+ $xsd_uri = 'http://'.htmlspecialchars ( str_replace ( '/client_interface/xml', '/client_interface/xsd', $_SERVER['SERVER_NAME'].dirname ( $_SERVER['SCRIPT_NAME'] ).'/GetFormats.php' ) );
+ $result .= "<formats>";
+ $lang = null;
+
+ if ( isset ( $http_vars['lang_enum'] ) )
+ {
+ $lang = $http_vars['lang_enum'];
+ }
+ $result3 = GetFormats ( $server, $lang, $formats_ar );
+ $result .= TranslateToXML ( $result3 );
+ $result .= "</formats>";
+ }
$result .= "</meetings>";
}
elseif ( isset ( $http_vars['json_data'] ) )
@@ -172,7 +187,8 @@ function parse_redirect (
\returns CSV data, with the first row a key header.
*/
function GetSearchResults (
- $in_http_vars ///< The HTTP GET and POST parameters.
+ $in_http_vars, ///< The HTTP GET and POST parameters.
+ &$formats_ar ///< This will return the formats used in this search.
)
{
if ( !( isset ( $in_http_vars['geo_width'] ) && $in_http_vars['geo_width'] ) && isset ( $in_http_vars['bmlt_search_type'] ) && ($in_http_vars['bmlt_search_type'] == 'advanced') && isset ( $in_http_vars['advanced_radius'] ) && isset ( $in_http_vars['advanced_mapmode'] ) && $in_http_vars['advanced_mapmode'] && ( floatval ( $in_http_vars['advanced_radius'] != 0.0 ) ) && isset ( $in_http_vars['lat_val'] ) && isset ( $in_http_vars['long_val'] ) && ( (floatval ( $in_http_vars['lat_val'] ) != 0.0) || (floatval ( $in_http_vars['long_val'] ) != 0.0) ) )
@@ -195,7 +211,25 @@ function GetSearchResults (
require_once ( dirname ( __FILE__ ).'/../../client/html/search_results_csv.php' );
$geocode_results = null;
$ignore_me = null;
- $result = DisplaySearchResultsCSV ( $in_http_vars, $ignore_me, $geocode_results );
+ $meeting_objects = array();
+ $result = DisplaySearchResultsCSV ( $in_http_vars, $ignore_me, $geocode_results, $meeting_objects );
+
+ if ( is_array ( $meeting_objects ) && count ( $meeting_objects ) && is_array ( $formats_ar ) )
+ {
+ foreach ( $meeting_objects as $one_meeting )
+ {
+ $formats = $one_meeting->GetMeetingDataValue('formats');
+
+ foreach ( $formats as $format )
+ {
+ if ( $format )
+ {
+ $formats_ar[$format->GetSharedID()] = $format;
+ }
+ }
+ }
+ }
+
if ( isset ( $in_http_vars['data_field_key'] ) && $in_http_vars['data_field_key'] )
{
// At this point, we have everything in a CSV. We separate out just the field we want.
@@ -241,8 +275,9 @@ function GetSearchResults (
\returns CSV data, with the first row a key header.
*/
function GetFormats (
- &$server, ///< A reference to an instance of c_comdef_server
- $in_lang = null ///< The language of the formats to be returned.
+ &$server, ///< A reference to an instance of c_comdef_server
+ $in_lang = null, ///< The language of the formats to be returned.
+ $in_formats = null //< If supplied, an already-fetched array of formats.
)
{
$my_keys = array ( 'key_string',
@@ -280,7 +315,14 @@ function GetFormats (
$ret .= '"'.implode ( '","', $my_keys )."\"\n";
foreach ( $langs as $key => $value )
{
- $format_array = $formats_obj->GetFormatsByLanguage ( $key );
+ if ( $in_formats )
+ {
+ $format_array = $formats_obj->GetFormatsByLanguage ( $key );
+ }
+ else
+ {
+ $format_array = $in_formats;
+ }
if ( is_array ( $format_array ) && count ( $format_array ) )
{
View
2  main_server/client_interface/serverInfo.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<bmltInfo>
<serverVersion>
- <readableString>1.9.1</readableString>
+ <readableString>1.10</readableString>
</serverVersion>
</bmltInfo>
Please sign in to comment.
Something went wrong with that request. Please try again.