BMLT Root Server
Functions | Variables
search_results_csv.php File Reference

This file represents a View layer of the BMLT MVC pattern. It will do a meeting search, and return the results as comma-separated values (CSV). It is not an object-oriented file, and is quite simple to use. For many people, the procedural View Layer files may be all they need to see. The object-oriented stuff is encapsulated within. More...

Go to the source code of this file.

Functions

if(!isset($g_format_dictionary)||!is_array($g_format_dictionary)||!count($g_format_dictionary)) bmlt_populate_format_dictionary ()
 This reads in the server format codes, and populates the format dictionary with the NAWS IDs. More...
 
 DisplaySearchResultsCSV ($in_http_vars, &$return_array=null, &$return_geocode=null, &$return_results=null, $in_supress_hidden_concat=false, $in_editor_only=false)
 This function does a search, then builds a CSV result, with each row being a meeting. The first row is a row of keys. More...
 
 ReturnNAWSFormatCSV ($in_http_vars, &$server)
 Returns the CSV file in NAWS format. More...
 
 ReturnNAWSDeletedMeetings (&$server, $in_transfer_dictionary, $in_services)
 Returns deleted meetings with NAWS IDs. More...
 
 BMLT_FuncNAWSReturnPublishedStatus ($in_meeting_id, &$server)
 Returns '' or '1', if the meeting is unpublished or not (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnOpenOrClosed ($in_meeting_id, &$server)
 Returns 'OPEN' or 'CLOSED', if the meeting is open or closed (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnWheelchair ($in_meeting_id, &$server)
 Returns 'TRUE' or 'FALSE', if the meeting is or is not wheelchair-accessible (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnInst ($in_meeting_id, &$server)
 Returns 'TRUE' or 'FALSE', if the meeting is or is not an institution meeting (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnWeekday ($in_meeting_id, &$server)
 Returns the string for the weekday the meeting gathers (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnTime ($in_meeting_id, &$server)
 Returns the string for the weekday the meeting gathers (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnLanguage1 ($in_meeting_id, &$server)
 Returns the string for the first alternative language (if any) More...
 
 BMLT_FuncNAWSReturnMeetingNAWSID ($in_meeting_id, &$server)
 Returns the string for the NAWS ID for the meeting (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnMeetingTown ($in_meeting_id, &$server)
 Returns the string for the town field the meeting (used for the NAWS format). This may use the borough name, instead. More...
 
 BMLT_FuncNAWSReturnLastMeetingChangeTime ($in_meeting_id, &$server)
 Returns the latest changed date for the given meeting. More...
 
 BMLT_FuncNAWSReturnMeetingServiceBodyNAWSID ($in_meeting_id, &$server)
 Returns the string for the NAWS ID for the meeting's Service Body (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnNonNawsFormats ($in_meeting_id, &$server)
 Returns a string of all formats that don't map to NAWS codes. More...
 
 BMLT_FuncNAWSReturnDirections ($in_meeting_id, &$server)
 Returns a string of location_info and comments fields. More...
 
 BMLT_FuncNAWSReturnFormat1 ($in_meeting_id, &$server)
 Returns the string for the first format (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnFormat2 ($in_meeting_id, &$server)
 Returns the string for the second format (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnFormat3 ($in_meeting_id, &$server)
 Returns the string for the third format (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnFormat4 ($in_meeting_id, &$server)
 Returns the string for the fourth format (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnFormat5 ($in_meeting_id, &$server)
 Returns the string for the fifth format (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnFormat ($n, $in_meeting_id, &$server)
 Returns the string for the n-th format (used for the NAWS format) More...
 
 BMLT_FuncNAWSReturnMeetingServiceBodyName ($in_meeting_id, &$server)
 Returns the string for the name for the meeting's Service Body (used for the NAWS format) More...
 

Variables

global $g_format_dictionary
 This is a dictionary used to translate formats to NAWS format. It uses the format shared IDs in the server's language. More...
 

Detailed Description

This file represents a View layer of the BMLT MVC pattern. It will do a meeting search, and return the results as comma-separated values (CSV). It is not an object-oriented file, and is quite simple to use. For many people, the procedural View Layer files may be all they need to see. The object-oriented stuff is encapsulated within.

The way you use this file is to call DisplaySearchResultsCSV with an array that contains values that specify the search.

This file is part of the Basic Meeting List Toolbox (BMLT).

Find out more at: https://bmlt.app

BMLT is free software: you can redistribute it and/or modify it under the terms of the MIT License.

BMLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MIT License for more details.

You should have received a copy of the MIT License along with this code. If not, see https://opensource.org/licenses/MIT.

Definition in file search_results_csv.php.

Function Documentation

BMLT_FuncNAWSReturnDirections (   $in_meeting_id,
$server 
)

Returns a string of location_info and comments fields.

Returns
A string The location_info and comments fields.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1168 of file search_results_csv.php.

References $ret, and $server.

1171  {
1172 
1173  $ret = "";
1174 
1175  if ($in_meeting_id instanceof c_comdef_meeting) {
1176  $the_meeting = $in_meeting_id;
1177  } else {
1178  $the_meeting = $server->GetOneMeeting($in_meeting_id);
1179  }
1180 
1181  if ($the_meeting instanceof c_comdef_meeting) {
1182  $ret = trim($the_meeting->GetMeetingDataValue('location_info'));
1183 
1184  if ($the_meeting->GetMeetingDataValue('comments')) {
1185  if ($ret) {
1186  $ret .= ", ";
1187  }
1188  $ret .= trim($the_meeting->GetMeetingDataValue('comments'));
1189  }
1190  }
1191 
1192  return $ret;
1193 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnFormat (   $n,
  $in_meeting_id,
$server 
)

Returns the string for the n-th format (used for the NAWS format)

Returns
A string The format code, in NAWS form.
Parameters
$nwhich format
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1266 of file search_results_csv.php.

References $g_format_dictionary, and $server.

Referenced by BMLT_FuncNAWSReturnFormat1(), BMLT_FuncNAWSReturnFormat2(), BMLT_FuncNAWSReturnFormat3(), BMLT_FuncNAWSReturnFormat4(), and BMLT_FuncNAWSReturnFormat5().

1270  {
1271  global $g_format_dictionary;
1272  if ($in_meeting_id instanceof c_comdef_meeting) {
1273  $the_meeting = $in_meeting_id;
1274  } else {
1275  $the_meeting = $server->GetOneMeeting($in_meeting_id);
1276  }
1277  if ($the_meeting instanceof c_comdef_meeting) {
1278  // $formats is an array of the formats for this meeting as they are stored in the BMLT database.
1279  // $naws_formats is an array of the NAWS versions of these formats - note that not everything in $formats
1280  // will have a corresponding NAWS versions. Also there can also be several BMLT formats that map
1281  // to the same NAWS format -- in this case, only include one NAWS format.
1282  // This function is a bit stupid, since it gets called up to 5 times for the 5 possible NAWS formats --
1283  // more aesthetic (and slightly more efficient) would be to just call it once. However, efficiency is not
1284  // terribly important here since this just gets called when producing an export spreadsheet.
1285  $formats = $the_meeting->GetMeetingDataValue('formats');
1286  $naws_formats = [];
1287  if (is_array($formats) && count($formats)) {
1288  foreach ($g_format_dictionary as $n_format => $b_formats) {
1289  if (($n_format != 'OPEN') && ($n_format != 'CLOSED') && ($n_format != 'WCHR')) {
1290  foreach ($b_formats as $b_format) {
1291  if (isset($formats[$b_format]) && !in_array($n_format, $naws_formats)) {
1292  array_push($naws_formats, $n_format);
1293  }
1294  }
1295  }
1296  }
1297  }
1298  if ($n > count($naws_formats)) {
1299  return null;
1300  } else {
1301  return $naws_formats[$n-1];
1302  }
1303  }
1304 }
A class to hold a single meeting object.
global $g_format_dictionary
This is a dictionary used to translate formats to NAWS format. It uses the format shared IDs in the s...
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnFormat1 (   $in_meeting_id,
$server 
)

Returns the string for the first format (used for the NAWS format)

Returns
A string The format code, in NAWS form.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1201 of file search_results_csv.php.

References $server, and BMLT_FuncNAWSReturnFormat().

1204  {
1205  return BMLT_FuncNAWSReturnFormat(1, $in_meeting_id, $server);
1206 }
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnFormat($n, $in_meeting_id, &$server)
Returns the string for the n-th format (used for the NAWS format)
BMLT_FuncNAWSReturnFormat2 (   $in_meeting_id,
$server 
)

Returns the string for the second format (used for the NAWS format)

Returns
A string The format code, in NAWS form.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1214 of file search_results_csv.php.

References $server, and BMLT_FuncNAWSReturnFormat().

1217  {
1218  return BMLT_FuncNAWSReturnFormat(2, $in_meeting_id, $server);
1219 }
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnFormat($n, $in_meeting_id, &$server)
Returns the string for the n-th format (used for the NAWS format)
BMLT_FuncNAWSReturnFormat3 (   $in_meeting_id,
$server 
)

Returns the string for the third format (used for the NAWS format)

Returns
A string The format code, in NAWS form.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1227 of file search_results_csv.php.

References $server, and BMLT_FuncNAWSReturnFormat().

1230  {
1231  return BMLT_FuncNAWSReturnFormat(3, $in_meeting_id, $server);
1232 }
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnFormat($n, $in_meeting_id, &$server)
Returns the string for the n-th format (used for the NAWS format)
BMLT_FuncNAWSReturnFormat4 (   $in_meeting_id,
$server 
)

Returns the string for the fourth format (used for the NAWS format)

Returns
A string The format code, in NAWS form.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1240 of file search_results_csv.php.

References $server, and BMLT_FuncNAWSReturnFormat().

1243  {
1244  return BMLT_FuncNAWSReturnFormat(4, $in_meeting_id, $server);
1245 }
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnFormat($n, $in_meeting_id, &$server)
Returns the string for the n-th format (used for the NAWS format)
BMLT_FuncNAWSReturnFormat5 (   $in_meeting_id,
$server 
)

Returns the string for the fifth format (used for the NAWS format)

Returns
A string The format code, in NAWS form.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1253 of file search_results_csv.php.

References $server, and BMLT_FuncNAWSReturnFormat().

1256  {
1257  return BMLT_FuncNAWSReturnFormat(5, $in_meeting_id, $server);
1258 }
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnFormat($n, $in_meeting_id, &$server)
Returns the string for the n-th format (used for the NAWS format)
BMLT_FuncNAWSReturnInst (   $in_meeting_id,
$server 
)

Returns 'TRUE' or 'FALSE', if the meeting is or is not an institution meeting (used for the NAWS format)

Returns
A string, 'TRUE' or 'FALSE' (It will always be FALSE).
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 895 of file search_results_csv.php.

References $ret.

898  {
899  $ret = 'FALSE';
900 
901  return $ret;
902 }
$ret
Definition: contact.php:226
BMLT_FuncNAWSReturnLanguage1 (   $in_meeting_id,
$server 
)

Returns the string for the first alternative language (if any)

Returns
A string.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 965 of file search_results_csv.php.

References $ret, and $server.

968  {
969  $ret = '';
970 
971  if ($in_meeting_id instanceof c_comdef_meeting) {
972  $the_meeting = $in_meeting_id;
973  } else {
974  $the_meeting = $server->GetOneMeeting($in_meeting_id);
975  }
976 
977  if ($the_meeting instanceof c_comdef_meeting) {
978  $formats = $the_meeting->GetMeetingDataValue('formats');
979  $lang = $server->GetLocalLang();
980 
981  if (is_array($formats) && count($formats)) {
982  foreach ($formats as $format) {
983  if ($format instanceof c_comdef_format) {
984  if ('LANG' == $format->GetWorldID()) {
985  $ret = strtoupper(trim($format->GetKey()));
986  break;
987  }
988  }
989  }
990  }
991  }
992 
993  return $ret;
994 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
A Class for Format Codes.
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnLastMeetingChangeTime (   $in_meeting_id,
$server 
)

Returns the latest changed date for the given meeting.

Returns
a date in ISO form ('2013-01-31').
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1060 of file search_results_csv.php.

References $ret, and $server.

1063  {
1064  $ret = null;
1065 
1066  $changes_obj = $server->GetChangesFromIDAndType('c_comdef_meeting', $in_meeting_id);
1067 
1068  if ($changes_obj instanceof c_comdef_changes) {
1069  $changes_objects = $changes_obj->GetChangesObjects();
1070 
1071  if (is_array($changes_objects) && count($changes_objects)) {
1072  $last_date = 0;
1073  foreach ($changes_objects as $change) {
1074  $last_date = max($last_date, $change->GetChangeDate());
1075  }
1076 
1077  if ($last_date) {
1078  $ret = date('n/j/y', $last_date);
1079  }
1080  }
1081  }
1082 
1083  return $ret;
1084 }
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
A class to hold a collection of c_comdef_change objects.
BMLT_FuncNAWSReturnMeetingNAWSID (   $in_meeting_id,
$server 
)

Returns the string for the NAWS ID for the meeting (used for the NAWS format)

Returns
A string The meeting ID, in NAWS form (G0000000).
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1002 of file search_results_csv.php.

References $ret, and $server.

1005  {
1006  $ret = null;
1007  if ($in_meeting_id instanceof c_comdef_meeting) {
1008  $the_meeting = $in_meeting_id;
1009  } else {
1010  $the_meeting = $server->GetOneMeeting($in_meeting_id);
1011  }
1012 
1013  if ($the_meeting instanceof c_comdef_meeting) {
1014  $ret = trim($the_meeting->GetMeetingDataValue('worldid_mixed'));
1015  }
1016 
1017  return $ret;
1018 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnMeetingServiceBodyName (   $in_meeting_id,
$server 
)

Returns the string for the name for the meeting's Service Body (used for the NAWS format)

Returns
A string The Service Body name.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1312 of file search_results_csv.php.

References $ret, $server, c_comdef_service_body__ASC__, and c_comdef_service_body__RSC__.

1315  {
1316  $ret = null;
1317 
1318  if ($in_meeting_id instanceof c_comdef_meeting) {
1319  $the_meeting = $in_meeting_id;
1320  } else {
1321  $the_meeting = $server->GetOneMeeting($in_meeting_id);
1322  }
1323 
1324  if ($the_meeting instanceof c_comdef_meeting) {
1325  $service_body = $the_meeting->GetServiceBodyObj();
1326 
1327  while (!$ret && ($service_body instanceof c_comdef_service_body)) {
1328  if (($service_body->GetSBType() == c_comdef_service_body__ASC__) || ($service_body->GetSBType() == c_comdef_service_body__RSC__)) {
1329  $ret = $service_body->GetLocalName();
1330  } else {
1331  $service_body = $service_body->GetOwnerIDObject();
1332  }
1333  }
1334  }
1335 
1336  return $ret;
1337 }
A Class for Service Body Objects.
A class to hold a single meeting object.
$ret
Definition: contact.php:226
const c_comdef_service_body__RSC__
const c_comdef_service_body__ASC__
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnMeetingServiceBodyNAWSID (   $in_meeting_id,
$server 
)

Returns the string for the NAWS ID for the meeting's Service Body (used for the NAWS format)

Returns
A string The Service Body ID, in NAWS form (RG/AR0000000).
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1092 of file search_results_csv.php.

References $ret, $server, c_comdef_service_body__ASC__, c_comdef_service_body__RSC__, and sprintf().

1095  {
1096  $ret = null;
1097 
1098  if ($in_meeting_id instanceof c_comdef_meeting) {
1099  $the_meeting = $in_meeting_id;
1100  } else {
1101  $the_meeting = $server->GetOneMeeting($in_meeting_id);
1102  }
1103 
1104  if ($the_meeting instanceof c_comdef_meeting) {
1105  $service_body = $the_meeting->GetServiceBodyObj();
1106 
1107  $ret2 = intval(preg_replace('|\D*?|', '', trim($service_body->GetWorldID())));
1108 
1109  if ($service_body instanceof c_comdef_service_body) {
1110  if ($service_body->GetSBType() == c_comdef_service_body__ASC__) {
1111  if ($ret2) {
1112  $ret = sprintf('AR%05d', $ret2);
1113  }
1114  } elseif ($service_body->GetSBType() == c_comdef_service_body__RSC__) {
1115  if ($ret2) {
1116  $ret = sprintf('RG%03d', $ret2);
1117  }
1118  }
1119  }
1120  }
1121 
1122  return $ret;
1123 }
A Class for Service Body Objects.
A class to hold a single meeting object.
$ret
Definition: contact.php:226
function sprintf()
Definition: installer.js:873
const c_comdef_service_body__RSC__
const c_comdef_service_body__ASC__
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnMeetingTown (   $in_meeting_id,
$server 
)

Returns the string for the town field the meeting (used for the NAWS format). This may use the borough name, instead.

Returns
A string The meeting town.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1026 of file search_results_csv.php.

References $ret, and $server.

1029  {
1030  $ret = null;
1031  if ($in_meeting_id instanceof c_comdef_meeting) {
1032  $the_meeting = $in_meeting_id;
1033  } else {
1034  $the_meeting = $server->GetOneMeeting($in_meeting_id);
1035  }
1036 
1037  if ($the_meeting instanceof c_comdef_meeting) {
1038  // Our first choice is the borough/ku.
1039  $ret = trim($the_meeting->GetMeetingDataValue('location_city_subsection'));
1040 
1041  if (!$ret) {
1042  $ret = trim($the_meeting->GetMeetingDataValue('location_municipality'));
1043  }
1044 
1045  // If all else fails, we use the neighborhood.
1046  if (!$ret) {
1047  $ret = trim($the_meeting->GetMeetingDataValue('location_neighborhood'));
1048  }
1049  }
1050 
1051  return $ret;
1052 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnNonNawsFormats (   $in_meeting_id,
$server 
)

Returns a string of all formats that don't map to NAWS codes.

Returns
A string The format codes name_string.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 1131 of file search_results_csv.php.

References $ret, and $server.

1134  {
1135 
1136  $ret = "";
1137 
1138  if ($in_meeting_id instanceof c_comdef_meeting) {
1139  $the_meeting = $in_meeting_id;
1140  } else {
1141  $the_meeting = $server->GetOneMeeting($in_meeting_id);
1142  }
1143 
1144  if ($the_meeting instanceof c_comdef_meeting) {
1145  $formats = $the_meeting->GetMeetingDataValue('formats');
1146 
1147  if (is_array($formats) && count($formats)) {
1148  foreach ($formats as $format) {
1149  if ($format != null && !$format->GetWorldID()) {
1150  $ret .= $format->GetLocalName();
1151  $ret .= ',';
1152  }
1153  }
1154 
1155  $ret = rtrim($ret, ',');
1156  }
1157  }
1158 
1159  return $ret;
1160 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnOpenOrClosed (   $in_meeting_id,
$server 
)

Returns 'OPEN' or 'CLOSED', if the meeting is open or closed (used for the NAWS format)

Returns
A string, 'OPEN' or 'CLOSED'.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID). This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 816 of file search_results_csv.php.

References $g_format_dictionary, $ret, $server, and c_comdef_server\GetLocalStrings().

819  {
820  global $g_format_dictionary;
821 
822  $localized_strings = c_comdef_server::GetLocalStrings();
823 
824  $ret = $localized_strings['default_closed_status'] ? 'CLOSED' : 'OPEN'; // This is the default closed/open status.
825  $opposite = $localized_strings['default_closed_status'] ? 'OPEN' : 'CLOSED';
826 
827  if ($in_meeting_id instanceof c_comdef_meeting) {
828  $the_meeting = $in_meeting_id;
829  } else {
830  $the_meeting = $server->GetOneMeeting($in_meeting_id);
831  }
832 
833  $ids = $g_format_dictionary[$opposite];
834 
835  if ($the_meeting instanceof c_comdef_meeting) {
836  $formats = $the_meeting->GetMeetingDataValue('formats');
837 
838  if (is_array($formats) && count($formats) && is_array($ids)) {
839  foreach ($ids as $id) {
840  if (isset($formats[$id])) {
841  $ret = $opposite;
842  break;
843  }
844  }
845  }
846  }
847 
848  return $ret;
849 }
static GetLocalStrings($in_lang_enum=null)
This gets the appropriate language files, and puts all the the strings into an associative array...
A class to hold a single meeting object.
global $g_format_dictionary
This is a dictionary used to translate formats to NAWS format. It uses the format shared IDs in the s...
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnPublishedStatus (   $in_meeting_id,
$server 
)

Returns '' or '1', if the meeting is unpublished or not (used for the NAWS format)

Returns
A string, '' or '1'.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID). This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 791 of file search_results_csv.php.

References $ret, and $server.

794  {
795  $ret = '';
796 
797  if ($in_meeting_id instanceof c_comdef_meeting) {
798  $the_meeting = $in_meeting_id;
799  } else {
800  $the_meeting = $server->GetOneMeeting($in_meeting_id);
801  }
802 
803  if ($the_meeting instanceof c_comdef_meeting) {
804  $ret = $the_meeting->IsPublished() ? '' : '1';
805  }
806 
807  return $ret;
808 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnTime (   $in_meeting_id,
$server 
)

Returns the string for the weekday the meeting gathers (used for the NAWS format)

Returns
A string (the time, in pure military time - no seconds).
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 937 of file search_results_csv.php.

References $ret, and $server.

940  {
941  $ret = null;
942 
943  if ($in_meeting_id instanceof c_comdef_meeting) {
944  $the_meeting = $in_meeting_id;
945  } else {
946  $the_meeting = $server->GetOneMeeting($in_meeting_id);
947  }
948 
949  if ($the_meeting instanceof c_comdef_meeting) {
950  $ret = explode(':', $the_meeting->GetMeetingDataValue('start_time'));
951  if (is_array($ret) && count($ret) > 1) {
952  $ret = $ret[0].$ret[1];
953  }
954  }
955 
956  return $ret;
957 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnWeekday (   $in_meeting_id,
$server 
)

Returns the string for the weekday the meeting gathers (used for the NAWS format)

Returns
A string ('Monday' - 'Friday').
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 910 of file search_results_csv.php.

References $ret, and $server.

913  {
914  $ret = null;
915 
916  $weekdays = array ( null, 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' );
917 
918  if ($in_meeting_id instanceof c_comdef_meeting) {
919  $the_meeting = $in_meeting_id;
920  } else {
921  $the_meeting = $server->GetOneMeeting($in_meeting_id);
922  }
923 
924  if ($the_meeting instanceof c_comdef_meeting) {
925  $ret = $weekdays[$the_meeting->GetMeetingDataValue('weekday_tinyint')];
926  }
927 
928  return $ret;
929 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
BMLT_FuncNAWSReturnWheelchair (   $in_meeting_id,
$server 
)

Returns 'TRUE' or 'FALSE', if the meeting is or is not wheelchair-accessible (used for the NAWS format)

Returns
A string, 'TRUE' or 'FALSE'.
Parameters
$in_meeting_idThe ID of the meeting (internal DB ID) This can also be a meeting object.
$serverA reference to an instance of c_comdef_server

Definition at line 857 of file search_results_csv.php.

References $g_format_dictionary, $ret, and $server.

860  {
861  global $g_format_dictionary;
862 
863  $ret = 'FALSE';
864 
865  if ($in_meeting_id instanceof c_comdef_meeting) {
866  $the_meeting = $in_meeting_id;
867  } else {
868  $the_meeting = $server->GetOneMeeting($in_meeting_id);
869  }
870 
871  $ids = $g_format_dictionary['WCHR'];
872 
873  if ($the_meeting instanceof c_comdef_meeting) {
874  $formats = $the_meeting->GetMeetingDataValue('formats');
875 
876  if (is_array($formats) && count($formats) && is_array($ids)) {
877  foreach ($ids as $id) {
878  if (isset($formats[$id])) {
879  $ret = 'TRUE';
880  break;
881  }
882  }
883  }
884  }
885 
886  return $ret;
887 }
A class to hold a single meeting object.
global $g_format_dictionary
This is a dictionary used to translate formats to NAWS format. It uses the format shared IDs in the s...
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
if (!isset($g_format_dictionary)||!is_array($g_format_dictionary)||!count($g_format_dictionary)) bmlt_populate_format_dictionary ( )

This reads in the server format codes, and populates the format dictionary with the NAWS IDs.

If you wish to override this, simply set this up in your /get-config.php file. That will supersede this. Actually... this block of code never, ever gets hit because the above call to bmlt_populate_format_dictionary will always set $g_format_dictionary. We should... probably remove it?

< This is a dictionary used to translate formats to NAWS format. It uses the format shared IDs in the server's language.

Definition at line 84 of file search_results_csv.php.

References $g_format_dictionary, $local_strings, $server, c_comdef_server\GetLocalStrings(), c_comdef_server\GetServer(), and c_comdef_server\MakeServer().

85 {
86  global $g_format_dictionary; ///< This is a dictionary used to translate formats to NAWS format. It uses the format shared IDs in the server's language.
87 
88  // first accumulate a local array of formats in $dict
89  $dict = [];
91  $localized_strings = c_comdef_server::GetLocalStrings();
92  $formats_array = c_comdef_server::GetServer()->GetFormatsObj()->GetFormatsArray();
93 
94  foreach ($formats_array['en'] as $format) {
95  if ($format instanceof c_comdef_format) {
96  $world_id = $format->GetWorldID();
97  $shared_id = $format->GetSharedID();
98  if ($world_id && $shared_id) {
99  if (array_key_exists($world_id, $dict)) {
100  array_push($dict[$world_id], $shared_id);
101  } else {
102  $dict[$world_id] = array( $shared_id );
103  }
104  }
105  }
106  }
107  // add all the formats in $dict to $g_format_dictionary, putting the preferred formats first (in the same
108  // order as in naws_export_formats_at_front)
109  $g_format_dictionary = [];
111  $preferred = $local_strings['naws_export_formats_at_front'];
112  foreach ($preferred as $id) {
113  if (array_key_exists($id, $dict)) {
114  $g_format_dictionary[$id] = $dict[$id];
115  }
116  }
117  foreach ($dict as $id => $val) {
118  if (!in_array($id, $preferred)) {
119  $g_format_dictionary[$id] = $dict[$id];
120  }
121  }
122 }
static GetLocalStrings($in_lang_enum=null)
This gets the appropriate language files, and puts all the the strings into an associative array...
$local_strings
Definition: index.php:6
global $g_format_dictionary
This is a dictionary used to translate formats to NAWS format. It uses the format shared IDs in the s...
A Class for Format Codes.
$server
Definition: GetLangs.php:25
static MakeServer()
This is the factory for the server instantiation. It makes sure that only one instance exists...
DisplaySearchResultsCSV (   $in_http_vars,
$return_array = null,
$return_geocode = null,
$return_results = null,
  $in_supress_hidden_concat = false,
  $in_editor_only = false 
)

This function does a search, then builds a CSV result, with each row being a meeting. The first row is a row of keys.

Returns
a string, containing CSV data, with the first row a key header.
Parameters
$return_arrayIf this is supplied, then the result will be saved in this as an array. It must be an empty array, supplied by reference.
$return_resultsIf supplied, should point to an array that will be filled with the actual meeting objects that comprise the result.
$in_supress_hidden_concatIf true, then hidden fields will not have their prompts encoded
$in_editor_onlyIf true, then only meetings for which the current logged-in user can edit/observe are returned.

Definition at line 130 of file search_results_csv.php.

References $lang_enum, $ret, c_comdef_meeting\GetAllMeetingKeys(), c_comdef_server\GetLocalStrings(), c_comdef_server\GetServer(), GetURLToMainServerDirectory(), and SetUpSearch().

Referenced by GetSearchResults(), c_comdef_admin_ajax_handler\GetSearchResults(), c_comdef_admin_xml_handler\process_meeting_search(), and ReturnNAWSFormatCSV().

302  {
303  $ret = null;
304  require_once(dirname(__FILE__).'/c_comdef_meeting_search_manager.class.php');
305 
306  $search_manager = new c_comdef_meeting_search_manager;
307 
308  if ($search_manager instanceof c_comdef_meeting_search_manager) {
309  $localized_strings = c_comdef_server::GetLocalStrings();
310 
311  $lang_enum = c_comdef_server::GetServer()->GetLocalLang();
312 
313  // This can be changed in the auto config.
314  include(dirname(__FILE__).'/../../server/config/get-config.php');
315 
316  if (isset($in_http_vars['lang_enum']) && $in_http_vars['lang_enum']) {
317  $lang_enum = $in_http_vars['lang_enum'];
318  }
319 
320  if (!isset($in_http_vars['results_per_page'])) {
321  $in_http_vars['results_per_page'] = 0;
322  }
323 
324  if (isset($default_sort_key) && !isset($in_http_vars['sort_key']) && !isset($in_http_vars['sort_keys'])) {
325  $in_http_vars['sort_key'] = $default_sort_key;
326  }
327 
328  if ((!isset($in_http_vars['sort_dir']) || ( ($in_http_vars['sort_dir'] != 'desc') && ($in_http_vars['sort_dir'] != 'asc') ) ) && !isset($in_http_vars['sort_keys'])) {
329  $in_http_vars['sort_dir'] = 'asc';
330  }
331 
332  SetUpSearch($search_manager, $in_http_vars);
333 
334  if (isset($in_http_vars['page_size'])) {
335  $search_manager->SetResultsPerPage($in_http_vars['page_size']);
336  }
337 
338  if (isset($in_http_vars['sort_dir'])) {
339  $sort_dir_desc = ($in_http_vars['sort_dir'] == "desc") ? true : false;
340 
341  if (isset($localized_strings['default_sorts']) && isset($in_http_vars['sort_key']) && isset($sort_dir_desc) && !isset($in_http_vars['sort_keys'])) {
342  $search_manager->SetSort($localized_strings['default_sorts'][$in_http_vars['sort_key']], $sort_dir_desc, 0);
343  }
344  }
345 
346  $search_manager->DoSearch();
347 
348  $long = null;
349  $lat = null;
350 
351  if (isset($in_http_vars['long_val'])) {
352  $long = $in_http_vars['long_val'];
353  }
354 
355  if (isset($in_http_vars['lat_val'])) {
356  $lat = $in_http_vars['lat_val'];
357  }
358 
359  if (isset($in_http_vars['geo_width'])) {
360  $my_radius = $in_http_vars['geo_width'];
361  } elseif (isset($in_http_vars['geo_width_km'])) {
362  $my_radius = $in_http_vars['geo_width_km'];
363  }
364 
365  if (isset($my_radius) && ($my_radius < 0)) {
366  $my_radius = $search_manager->GetRadius($localized_strings['dist_units'] == 'mi');
367  }
368 
369  if (isset($return_geocode)) {
370  $return_geocode = nil;
371 
372  if ($search_manager->GetRadius(false)) {
373  $return_geocode['radius'] = $search_manager->GetRadius(false);
374  $return_geocode['longitude'] = $search_manager->GetLongitude();
375  $return_geocode['latitude'] = $search_manager->GetLatitude();
376  }
377  }
378 
379  $num_pages = $search_manager->GetNumberOfPages();
380  $num_results = $search_manager->GetNumberOfResults();
381 
382  $page_no = 1;
383 
384  if (isset($in_http_vars['page_num']) && (0 < intval($in_http_vars['page_num']))) {
385  $page_no = intval($in_http_vars['page_num']);
386  }
387 
388  if (1 > intval($page_no)) {
389  $page_no = 1;
390  }
391 
392  if ($page_no > $num_pages) {
393  $page_no = $num_pages;
394  }
395 
396  $page_data = $search_manager->GetPageOfResults($page_no);
397 
398  if ($page_data instanceof c_comdef_meeting_search_manager) {
400  // This is a required one for data export.
401  if (!in_array('meeting_name', $keys)) {
402  $keys[] = 'meeting_name';
403  }
404 
405  $keys[] = 'root_server_uri';
406  $keys[] = 'format_shared_id_list';
407 
408  $ret = '"'.join('","', $keys).'"';
409 
410  $formats = c_comdef_server::GetServer()->GetFormatsObj();
411  $formats_keys = array();
412  $formats_keys_header = array();
413 
414  $ret .= "\n";
415 
416  $in_ar = $page_data->GetSearchResultsAsArray();
417 
418  if (isset($return_results) && is_array($return_results)) {
419  $return_results = $in_ar;
420  }
421 
422  foreach ($in_ar as &$mtg_obj) {
423  $line = array();
424  $formats_ar = $formats_keys;
425 
426  if ($mtg_obj instanceof c_comdef_meeting) {
427  if (!$in_editor_only || $mtg_obj->UserCanObserve()) {
428  $format_shared_id_list = array();
429  $first = true;
430  foreach ($keys as $key) {
431  if (trim($key)) {
432  $val = $mtg_obj->GetMeetingDataValue($key);
433 
434  if (($key == 'meeting_name') && !$val) { // No meeting name results in a generic "NA Meeting" as the name.
435  $val = $localized_strings['comdef_server_admin_strings']['Value_Prompts']['generic'];
436  }
437 
438  if ($key == 'lang_enum' && isset($in_http_vars['lang_enum']) && $in_http_vars['lang_enum']) {
439  // Override the native lang_enum for the meeting with the requested language if present in http_vars
440  // (Does this ever matter??)
441  $val = $in_http_vars['lang_enum'];
442  }
443 
444  if (isset($val)) {
445  if (($key == 'formats')) {
446  if (is_array($val) && count($val)) {
447  $v_ar = array();
448  foreach ($val as $format) {
449  if ($format instanceof c_comdef_format) {
450  // $format will be one of the meeting's formats in the native server language. If it's already
451  // in the correct language, just add its key to $v_ar and its id to $format_shared_id_list.
452  // Otherwise see if there is a version of the format in the other language (stored in $lang_enum). If there is,
453  // push the key for the format in the other language onto $v_ar instead. Note that the key might be different
454  // in different languages. If there isn't a version of the format in the other language, just skip it.
455  $id = $format->GetSharedID();
456  if ($format->GetLocalLang() == $lang_enum) {
457  array_push($v_ar, $format->GetKey());
458  array_push($format_shared_id_list, $id);
459  } else {
460  $fs = $formats->GetFormatsBySharedIDCode($id);
461  if (array_key_exists($lang_enum, $fs)) {
462  $localized_format = $fs[$lang_enum];
463  array_push($v_ar, $localized_format->GetKey());
464  array_push($format_shared_id_list, $id);
465  }
466  }
467  }
468  }
469  $val = join(',', $v_ar);
470  $val = preg_replace('|"|', '\\"', preg_replace('|[\r\n\t]+|', ' ', $val));
471  } elseif (is_string($val)) {
472  $val = preg_replace('|"|', '\\"', preg_replace('|[\r\n\t]+|', ' ', $val));
473  }
474  }
475 
476  if (($key == 'formats') && $val) {
477  $f_list = explode(',', $val);
478 
479  if (is_array($f_list) && count($f_list)) {
480  foreach ($f_list as $format) {
481  $formats_ar[$format] = 1;
482  }
483  }
484  }
485 
486  if ($val) {
487  if ($mtg_obj->IsItemHidden($key)) {
488  if ($mtg_obj->UserCanObserve()) {
489  if (!$in_supress_hidden_concat && !isset($in_http_vars['simple_other_fields'])) {
490  $val = preg_replace('|.*?\#\@\-\@\#|', '', $mtg_obj->GetMeetingDataValue($key)); // Strip out any old accidentally introduced separators.
491  $val = 'observer_only#@-@#'.$mtg_obj->GetMeetingDataPrompt($key).'#@-@#'.$val;
492  }
493  } else {
494  $val = '';
495  }
496  } else {
497  switch ($key) {
498  // We don't do anything for the standard fields.
499  case 'distance_in_miles':
500  case 'distance_in_km':
501  case 'id_bigint':
502  case 'worldid_mixed':
503  case 'shared_group_id_bigint':
504  case 'service_body_bigint':
505  case 'weekday_tinyint':
506  case 'start_time':
507  case 'duration_time':
508  case 'time_zone':
509  case 'formats':
510  case 'lang_enum':
511  case 'longitude':
512  case 'latitude':
513  case 'published':
514  case 'email_contact':
515  case 'meeting_name':
516  case 'location_text':
517  case 'location_info':
518  case 'location_street':
519  case 'location_city_subsection':
520  case 'location_neighborhood':
521  case 'location_municipality':
522  case 'location_sub_province':
523  case 'location_province':
524  case 'location_postal_code_1':
525  case 'location_nation':
526  case 'comments':
527  case 'virtual_meeting_link':
528  case 'virtual_meeting_additional_info':
529  case 'phone_meeting_number':
530  break;
531 
532  // The rest get the prompt/value treatment, unless otherwise requested.
533  default:
534  if ($val && !isset($in_http_vars['simple_other_fields'])) {
535  $val = preg_replace('|.*?\#\@\-\@\#|', '', $val); // Strip out any old accidentally introduced separators.
536  $val = $mtg_obj->GetMeetingDataPrompt($key).'#@-@#'.$val;
537  }
538  break;
539  }
540  }
541  }
542  } else {
543  $val = '';
544  }
545 
546  $val = trim(preg_replace("|[\n\r]+|", "; ", $val));
547 
548  $line[$key] = $val;
549  }
550  }
551 
552  if (!isset($line['duration_time']) || !$line['duration_time'] || ($line['duration_time'] == '00:00:00')) {
553  $line['duration_time'] = $localized_strings['default_duration_time'];
554  }
555 
556  if (isset($format_shared_id_list) && is_array($format_shared_id_list) && count($format_shared_id_list)) {
557  sort($format_shared_id_list);
558  $line['format_shared_id_list'] = implode(',', $format_shared_id_list);
559  }
560 
561  $line['root_server_uri'] = dirname(dirname(GetURLToMainServerDirectory(true)));
562 
563  if (is_array($line) && count($line)) {
564  if (is_array($return_array)) {
565  array_push($return_array, $line);
566  }
567 
568  $ret .= '"'.join('","', $line).'"';
569 
570  $ret .= "\n";
571  }
572  }
573  }
574  }
575  }
576  }
577 
578  return $ret;
579 }
static GetLocalStrings($in_lang_enum=null)
This gets the appropriate language files, and puts all the the strings into an associative array...
SetUpSearch(&$in_search_manager, &$in_http_vars)
This function sets up the search manager to do the specified search. It does not actually do the sear...
A class to hold a single meeting object.
static GetAllMeetingKeys()
Returns an array of strings, containing the keys (table columns) used for all meetings (specified in ...
$ret
Definition: contact.php:226
A Class for Format Codes.
$lang_enum
Definition: index.php:23
GetURLToMainServerDirectory($inAllowHTTPS=true)
Returns a URL (HTTP) to the main_server directory (or renamed).
A class to control the basic common functionality of all meeting searches.
ReturnNAWSDeletedMeetings ( $server,
  $in_transfer_dictionary,
  $in_services 
)

Returns deleted meetings with NAWS IDs.

This queries every deleted meeting. The meetings returned are not restricted to the search parameters, and may repeat from previous dumps. Only meetings that had World IDs are returned.

Returns
An array of World IDs and change dates. These each represent deleted meetings.
Parameters
$serverA reference to an instance of c_comdef_server
$in_transfer_dictionaryThe transfer dictionary
$in_servicesAny Service body IDs

Definition at line 719 of file search_results_csv.php.

References $ret, and $server.

Referenced by ReturnNAWSFormatCSV().

723  {
724  $ret = null;
725 
726  // We start by getting all the meetings that have been deleted (Could be quite a few).
727  $changes = $server->GetChangesFromOTypeAndCType('c_comdef_meeting', 'comdef_change_type_delete');
728 
729  if ($changes instanceof c_comdef_changes) {
730  $ret = array();
731  $c_array = $changes->GetChangesObjects();
732 
733  if (is_array($c_array) && count($c_array)) {
734  foreach ($c_array as &$change) {
735  $b_obj = $change->GetBeforeObject();
736  if ($b_obj instanceof c_comdef_meeting) {
737  $line = null;
738  if (!$server->GetOneMeeting($b_obj->GetID())) { // Must be currently deleted.
739  if (is_array($in_services) && count($in_services)) {
740  $found = false;
741  reset($in_services);
742  foreach ($in_services as $sb_id) {
743  if (!$found) {
744  if (intval($b_obj->GetServiceBodyID()) == intval($sb_id)) {
745  $found = true;
746  }
747  }
748  }
749  }
750 
751  $value = intval(preg_replace('|\D*?|', '', $b_obj->GetMeetingDataValue('worldid_mixed')));
752 
753  if ($value && $found) {
754  foreach ($in_transfer_dictionary as $key => $value2) {
755  if (($key != 'Delete')) {
756  $value1 = null;
757  // See if this is a function.
758  if (function_exists($value2) && is_callable($value2) && preg_match('|^BMLT_FuncNAWSReturn|', $value2)) {
759  if ($value2 == 'BMLT_FuncNAWSReturnLastMeetingChangeTime') {
760  $value1 = date('n/j/y', $change->GetChangeDate());
761  } else {
762  $value1 = $value2($b_obj, $server);
763  }
764  } else // See if we just transfer the value with no change.
765  {
766  $value1 = $b_obj->GetMeetingDataValue($value2);
767  }
768  } else {
769  $value1 = 'D';
770  }
771 
772  $line[$key] = $value1;
773  }
774  }
775  }
776 
777  array_push($ret, $line);
778  }
779  }
780  }
781  }
782  return $ret;
783 }
A class to hold a single meeting object.
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
A class to hold a collection of c_comdef_change objects.
ReturnNAWSFormatCSV (   $in_http_vars,
$server 
)

Returns the CSV file in NAWS format.

Returns
A string, consisting of a CSV file, in the format required by NAWS.
Parameters
$in_http_varsThe HTTP GET and POST parameters.
$serverA reference to an instance of c_comdef_server

Definition at line 600 of file search_results_csv.php.

References $ret, $server, DisplaySearchResultsCSV(), and ReturnNAWSDeletedMeetings().

Referenced by CSVHandleNawsDump().

603  {
604  // This is a dictionary that is used to translate the meeting data from the BMLT format to the NAWS format.
605  $transfer_dictionary = array( 'Committee' => 'BMLT_FuncNAWSReturnMeetingNAWSID',
606  'CommitteeName' => 'meeting_name',
607  'AddDate' => null,
608  'AreaRegion' => 'BMLT_FuncNAWSReturnMeetingServiceBodyNAWSID',
609  'ParentName' => 'BMLT_FuncNAWSReturnMeetingServiceBodyName',
610  'ComemID' => null,
611  'ContactID' => null,
612  'ContactName' => null,
613  'CompanyName' => null,
614  'ContactAddrID' => null,
615  'ContactAddress1' => null,
616  'ContactAddress2' => null,
617  'ContactCity' => null,
618  'ContactState' => null,
619  'ContactZip' => null,
620  'ContactCountry' => null,
621  'ContactPhone' => null,
622  'MeetingID' => null,
623  'Room' => 'BMLT_FuncNAWSReturnNonNawsFormats',
624  'Closed' => 'BMLT_FuncNAWSReturnOpenOrClosed',
625  'WheelChr' => 'BMLT_FuncNAWSReturnWheelchair',
626  'Day' => 'BMLT_FuncNAWSReturnWeekday',
627  'Time' => 'BMLT_FuncNAWSReturnTime',
628  'Language1' => 'BMLT_FuncNAWSReturnLanguage1',
629  'Language2' => null,
630  'Language3' => null,
631  'LocationId' => null,
632  'Place' => 'location_text',
633  'Address' => 'location_street',
634  'City' => 'BMLT_FuncNAWSReturnMeetingTown',
635  'LocBorough' => 'location_neighborhood',
636  'State' => 'location_province',
637  'Zip' => 'location_postal_code_1',
638  'Country' => 'location_nation',
639  'Directions' => 'BMLT_FuncNAWSReturnDirections',
640  'Institutional' => 'BMLT_FuncNAWSReturnInst',
641  'Format1' => 'BMLT_FuncNAWSReturnFormat1',
642  'Format2' => 'BMLT_FuncNAWSReturnFormat2',
643  'Format3' => 'BMLT_FuncNAWSReturnFormat3',
644  'Format4' => 'BMLT_FuncNAWSReturnFormat4',
645  'Format5' => 'BMLT_FuncNAWSReturnFormat5',
646  'Delete' => null,
647  'LastChanged' => 'BMLT_FuncNAWSReturnLastMeetingChangeTime',
648  'Longitude' => 'longitude',
649  'Latitude' => 'latitude',
650  'ContactGP' => null,
651  'PhoneMeetingNumber' => 'phone_meeting_number',
652  'VirtualMeetingLink' => 'virtual_meeting_link',
653  'VirtualMeetingInfo' => 'virtual_meeting_additional_info',
654  'TimeZone' => 'time_zone',
655  'bmlt_id' => 'id_bigint',
656  'unpublished' => 'BMLT_FuncNAWSReturnPublishedStatus'
657  );
658 
659  $ret = null;
660 
661  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) )) {
662  $in_http_vars['geo_width'] = $in_http_vars['advanced_radius'];
663  } elseif (!( 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')) {
664  $in_http_vars['lat_val'] = null;
665  $in_http_vars['long_val'] = null;
666  } elseif (!isset($in_http_vars['geo_loc']) || $in_http_vars['geo_loc'] != 'yes') {
667  if (!isset($in_http_vars['geo_width'])) {
668  $in_http_vars['geo_width'] = 0;
669  }
670  }
671  $ret_array = array (); // If we supply an array as a second parameter, we will get the dump returned in a two-dimensional array.
672  DisplaySearchResultsCSV($in_http_vars, $ret_array); // Start off by getting the CSV dump in the same manner as the normal CSV dump.
673 
674  if (is_array($ret_array) && count($ret_array)) {
675  $ret = '"'.join('","', array_keys($transfer_dictionary)).'"'; // This is the header line.
676  foreach ($ret_array as $one_meeting) {
677  if (is_array($one_meeting) && count($one_meeting)) {
678  $line = array();
679  foreach ($transfer_dictionary as $key => $value) {
680  // See if this is a function.
681  if (function_exists($value) && is_callable($value) && preg_match('|^BMLT_FuncNAWSReturn|', $value)) {
682  $value = $value($one_meeting['id_bigint'], $server);
683  } elseif (isset($one_meeting[$value])) { // See if we just transfer the value with no change.
684  $value = $one_meeting[$value];
685  }
686  array_push($line, $value);
687  }
688 
689  if (is_array($line) && count($line)) {
690  $ret .= "\n".'"'.join('","', $line).'"';
691  }
692  }
693  }
694  }
695 
696  $del_meetings = ReturnNAWSDeletedMeetings($server, $transfer_dictionary, $in_http_vars['services']); // We append deleted meetings to the end.
697 
698  if (is_array($del_meetings) && count($del_meetings)) {
699  foreach ($del_meetings as $one_meeting) {
700  if (is_array($one_meeting) && count($one_meeting)) {
701  $ret .= "\n".'"'.join('","', $one_meeting).'"';
702  }
703  }
704  }
705 
706  return $ret;
707 }
$ret
Definition: contact.php:226
$server
Definition: GetLangs.php:25
DisplaySearchResultsCSV($in_http_vars, &$return_array=null, &$return_geocode=null, &$return_results=null, $in_supress_hidden_concat=false, $in_editor_only=false)
This function does a search, then builds a CSV result, with each row being a meeting. The first row is a row of keys.
ReturnNAWSDeletedMeetings(&$server, $in_transfer_dictionary, $in_services)
Returns deleted meetings with NAWS IDs.

Variable Documentation

global $g_format_dictionary

This is a dictionary used to translate formats to NAWS format. It uses the format shared IDs in the server's language.

Definition at line 32 of file search_results_csv.php.

Referenced by BMLT_FuncNAWSReturnFormat(), BMLT_FuncNAWSReturnOpenOrClosed(), BMLT_FuncNAWSReturnWheelchair(), and bmlt_populate_format_dictionary().