Merge lp:~chamindra/sahana-agasti/sahana-relief-0.1 into lp:~sahana-relief-team/sahana-agasti/trunk

Proposed by chamindra
Status: Merged
Merge reported by: chamindra
Merged at revision: not available
Proposed branch: lp:~chamindra/sahana-agasti/sahana-relief-0.1
Merge into: lp:~sahana-relief-team/sahana-agasti/trunk
Diff against target: 693 lines
To merge this branch: bzr merge lp:~chamindra/sahana-agasti/sahana-relief-0.1
Reviewer Review Type Date Requested Status
chamindra Approve
Ajay Kumar Approve
Gavin Treadgold (community) Approve
Review via email: mp+15002@code.launchpad.net
To post a comment you must log in.
Revision history for this message
chamindra (chamindra) wrote :

1) Modified code to work functionally with the messaging module in windows
2) Implemented a new user-friendly SMS protocol for entering map points

e.g. map N35.26272 W120.27373 hospital 30 patients to be evacuated

Response:

Map point hospital confirmed

3) Implemented confirmation notification of map point and other data
4) Updated the SMS help messaging
5) Automatic assignment of feature class and associated icon on situation map based on SMS message
6) Implemented the sharing of KML feeds between Sahana and mods when the KML does not have .kml extension
7) Updated the backend to support the protocol sent by the android application

A few more tweaks are needed on the above to complete

Revision history for this message
Ajay Kumar (ajuonline) :
review: Approve
Revision history for this message
Ajay Kumar (ajuonline) :
review: Needs Resubmitting
Revision history for this message
Gavin Treadgold (gt) wrote :

From a domain (not code perspective) - very keen to have this merge approved. Very useful functionality.

AJ - why did you suggest a resubmit?

review: Approve
Revision history for this message
Ajay Kumar (ajuonline) wrote :

Earlier Approve/Resubmit was done in error :)
OK for merge.

review: Approve
Revision history for this message
chamindra (chamindra) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'inc/lib_gis/plugins/openlayers/openlayers_fns.php' (properties changed: -x to +x)
2--- inc/lib_gis/plugins/openlayers/openlayers_fns.php 2009-11-10 23:51:44 +0000
3+++ inc/lib_gis/plugins/openlayers/openlayers_fns.php 2009-11-18 18:15:32 +0000
4@@ -521,8 +521,12 @@
5 if (1==$conf["gis_ol_kml_".$i."_enabled"]) {
6 $name = $conf["gis_ol_kml_".$i."_name"];
7 $url = $conf["gis_ol_kml_".$i."_url"];
8- $file=end(explode('/',$url));
9- $ext=end(explode('.',$url));
10+
11+ #$file=end(explode('/',$url));
12+ # Changed to provide a kml extension by default
13+ $file = md5($url).".kml";
14+ $ext = "kml"; #end(explode('.',$url));
15+
16 $path = $dir."/".$file;
17 $ch = curl_init();
18 curl_setopt($ch, CURLOPT_URL,$url);
19
20=== modified file 'inst/setup_pages.inc'
21--- inst/setup_pages.inc 2009-11-10 23:51:44 +0000
22+++ inst/setup_pages.inc 2009-11-18 18:15:32 +0000
23@@ -65,7 +65,8 @@
24 }
25
26 // Check if php-gettext is loaded
27- $value = (extension_loaded('gettext'));
28+ // TODO: Fix this in Portable app
29+/* $value = (extension_loaded('gettext'));
30 $isOK &= $value;
31
32 if ($value) {
33@@ -74,7 +75,7 @@
34 shn_form_label(_t('PHP-gettext Library'), $cross_img."is not installed");
35 echo "<p><br/>$oops_img Sahana needs PHP-gettext for to support local languages. Please install PHP-gettext and restart the webserver. To find out how to do this for your operating system see <a href=\"http://www.sahana.lk/wiki/doku.php?id=manual:install\">Sahana WIKI</a></p>";
36 }
37-
38+*/
39 $value = (extension_loaded('mysql'));
40 $isOK &= $value;
41
42
43=== modified file 'inst/setup_validations.inc'
44--- inst/setup_validations.inc 2009-11-10 23:51:44 +0000
45+++ inst/setup_validations.inc 2009-11-18 18:15:32 +0000
46@@ -48,7 +48,7 @@
47 if (!version_compare(phpversion(), '5', '>')) $continue = false;
48 if (!extension_loaded('gd')) $continue = false;
49 if (!extension_loaded('mysql')) $continue = false;
50- if (!extension_loaded('gettext')) $continue = false;
51+ // TODO: fix gettext in potable apps // if (!extension_loaded('gettext')) $continue = false;
52 if (!is_writable($global['approot'].'www/tmp')) $continue = false;
53 if (!is_writable($global['approot'].'conf')) $continue = false;
54 return $continue;
55
56=== modified file 'mod/msg/lib_sms_errors.inc' (properties changed: -x to +x)
57--- mod/msg/lib_sms_errors.inc 2009-11-10 23:51:44 +0000
58+++ mod/msg/lib_sms_errors.inc 2009-11-18 18:15:32 +0000
59@@ -1,1 +1,47 @@
60-<?php
61/**
62 *
63 * This is a SMS error handler, you can create and manage a SMS error message container
64 * and send the errors via SMS to users accessing Sahana through SMS.
65 * Developers should note the fact that, error message length should preferably be less than 160 characters
66 * which is the standard SMS length. Text greater than 160 characters should also be supported but should
67 * ideally be avoided. Make sure you dont print/echo any message in PHP/HTML as this is supposed to be
68 * dealt via an SMS session, so no echoing of messages. Supress all echo strings or use it for debugging only.
69 * Echoing any strings will break the SMS message text formation and break the session resulting in user not
70 * getting any response to his SMS.
71 *
72 * PHP version 4 and 5
73 *
74 * LICENSE: This source file is subject to LGPL license
75 * that is available through the world-wide-web at the following URI:
76 * http://www.gnu.org/copyleft/lesser.html
77 *
78 * @package moduleAPI
79 * @subpackage errors
80 * @author Ajay Kumar <ajuonline at gmail dot com><aj at mindtakers dot com>
81 * @copyright Lanka Software Foundation - http://www.opensource.lk
82 * @version $Id: lib_sms_errors.inc,v 1.3 2008/11/09 10:52:49 ajuonline Exp $
83 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
84 */
85
86
87
88function _shn_msg_sms_error_code($error_code){
89
90 $error_code_messages = array(
91
92 '1' => 'Invalid SMS Keyword Sent. Kindly send HELP to get the list of keywords.',
93
94 '2' => 'Sahana Server Error. Unable to connect to Data base. Please try later or contact Sahana Admin at.',
95
96 '3' => 'Login Failed : Invalid user name or password.',
97
98 '4' => 'Login Failed : You have been banned by an administrator of the system.',
99
100 '5' => 'Login Failed : This account has been locked. Please contact the Administrator to unlock the account.',
101
102 '6' => 'Login Failed : Password log attacked.',
103
104 '7' => 'Login Failed : Account is not active yet. Contact Administrator to activate your account'
105
106 );
107
108 if(array_key_exists($error_code, $error_code_messages)){
109
110 return $error_code_messages[$error_code];
111
112 }
113
114 else{
115
116 return 0;
117
118 }
119
120}
121
122?>
123\ No newline at end of file
124+<?php
125+/**
126+ *
127+ * This is a SMS error handler, you can create and manage a SMS error message container
128+ * and send the errors via SMS to users accessing Sahana through SMS.
129+ * Developers should note the fact that, error message length should preferably be less than 160 characters
130+ * which is the standard SMS length. Text greater than 160 characters should also be supported but should
131+ * ideally be avoided. Make sure you dont print/echo any message in PHP/HTML as this is supposed to be
132+ * dealt via an SMS session, so no echoing of messages. Supress all echo strings or use it for debugging only.
133+ * Echoing any strings will break the SMS message text formation and break the session resulting in user not
134+ * getting any response to his SMS.
135+ *
136+ * PHP version 4 and 5
137+ *
138+ * LICENSE: This source file is subject to LGPL license
139+ * that is available through the world-wide-web at the following URI:
140+ * http://www.gnu.org/copyleft/lesser.html
141+ *
142+ * @package moduleAPI
143+ * @subpackage errors
144+ * @author Ajay Kumar <ajuonline at gmail dot com><aj at mindtakers dot com>
145+ * @copyright Lanka Software Foundation - http://www.opensource.lk
146+ * @version $Id: lib_sms_errors.inc,v 1.3 2008/11/09 10:52:49 ajuonline Exp $
147+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
148+ */
149+function _shn_msg_sms_error_code($error_code){
150+
151+ $error_code_messages = array(
152+
153+ '1' => 'Invalid SMS Keyword Sent. Kindly send HELP to get the list of keywords.',
154+ 'invalid_keyword' => 'Invalid SMS Keyword Sent. Kindly send HELP to get the list of keywords',
155+
156+ '2' => 'Sahana Server Error. Unable to connect to Data base. Please try later or contact Sahana Admin at.',
157+ '3' => 'Login Failed : Invalid user name or password.',
158+ '4' => 'Login Failed : You have been banned by an administrator of the system.',
159+ '5' => 'Login Failed : This account has been locked. Please contact the Administrator to unlock the account.',
160+ '6' => 'Login Failed : Password log attacked.',
161+ '7' => 'Login Failed : Account is not active yet. Contact Administrator to activate your account'
162+ );
163+ if(array_key_exists($error_code, $error_code_messages)){
164+ return $error_code_messages[$error_code];
165+ }
166+ else{
167+ return 0;
168+ }
169+}
170+?>
171
172=== modified file 'mod/msg/lib_sms_handler.inc' (properties changed: -x to +x)
173--- mod/msg/lib_sms_handler.inc 2009-11-10 23:51:44 +0000
174+++ mod/msg/lib_sms_handler.inc 2009-11-18 18:15:32 +0000
175@@ -1,1 +1,343 @@
176-<?php
177/**
178 *
179 * This library helps in parsing and triggering functions based on SMS Input. A vital component of the framework.
180 * Developers are required to use this library to facilitate SMS based transactions with the Sahana Core.
181 *
182 *
183 * PHP version 4 and 5
184 *
185 * LICENSE: This source file is subject to LGPL license
186 * that is available through the world-wide-web at the following URI:
187 * http://www.gnu.org/copyleft/lesser.html
188 *
189 * @package framework
190 * @subpackage messaging
191 * @author Ajay Kumar <ajuonline at gmail dot com><aj at mindtakers dot com>
192 * @copyright Lanka Software Foundation - http://www.opensource.lk
193 * @version $Id: lib_sms_handler.inc,v 1.2 2008/09/15 13:50:13 franboon Exp $
194 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
195 *
196 */
197
198global $global;
199include_once $global['approot']."/mod/msg/lib_sms_errors.inc";
200include_once $global['approot']."/mod/msg/lib_sms_keywords.inc";
201
202/**
203 * This function will parse the incoming message string sent via GET & POST
204 * Currently this function will be used by Kannel and SMSTools
205 * It returns the array containing all words/strings, as single array values, sent in the SMS seperated by a SPACE
206 * For e.g. For a message string i.e. $message = "login user pass";
207 * $parsed_message[0]="login"
208 * $parsed_message[1]="user"
209 * $parsed_message[2]="pass"
210 */
211
212function _shn_msg_parse_short_message($message){
213
214 $parsed_message=array();
215 $parsed_message = explode(" ", $message);
216 return $parsed_message;
217}
218
219/**
220 * This function will check the first word of the incoming message string
221 * and return the corresponding menu value only.
222 * For. e.g. as per our keyword definition file
223 */
224
225function _shn_msg_sms_keyword_check($keyword, $sender){
226
227 global $global;
228 global $sms_list_keywords;
229 if(is_numeric($keyword)){
230 if(array_key_exists($keyword, $sms_list_keywords)){
231 $keyword_check_result = array ('return' => '1', 'type' => 'number');
232 //echo " Key word valid and is number";
233 return $keyword_check_result;
234 }
235 else{
236 $error_message = _shn_msg_sms_error_code(1);
237 include_once $global['approot']."/mod/msg/plugins/"."$plugin_name"."/handler_"."$plugin_name".".inc";
238 $recipients = array ($sender);//handler_plugin.inc send sms function accepts array as input for recipients
239 shn_msg_plugin_send_sm($recipients, $error_message);
240 //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
241 //echo "<br \>Error SMS: ".$error_message;
242 return 0;
243 }
244 }
245 else{
246 $bool = array_search($keyword, $sms_list_keywords);
247 if(array_search($keyword, $sms_list_keywords)){
248 $keyword_check_result = array ('return' => '1', 'type' => 'word');
249 //echo " key word is valid and is WORD";
250 return $keyword_check_result;
251 }
252 else{
253 $error_message = _shn_msg_sms_error_code(1);
254 include_once $global['approot']."/mod/msg/plugins/"."$plugin_name"."/handler_"."$plugin_name".".inc";
255 $recipients = array ($sender);//handler_plugin.inc send sms function accepts array as input for recipients
256 shn_msg_plugin_send_sm($recipients, $error_message);
257 //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
258 //echo "<br \> Error SMS: ".$error_message;
259 return 0;
260 }
261 }
262}
263
264/**
265 * This function will check the first word of the incoming message string
266 * and return the corresponding menu value only.
267 * For. e.g. as per our keyword definition file
268 */
269
270function _shn_msg_sms_action($parsed_sms, $sender_phone_number){
271
272 global $global;
273 if(("help"==$parsed_sms[0]) || ("911"==$parsed_sms[0])){
274 _shn_msg_sms_help($parsed_sms, $sender_phone_number);
275 }
276
277 elseif(("login"==$parsed_sms[0]) || ("100"==$parsed_sms[0])){
278 _shn_msg_sms_login($parsed_sms, $sender_phone_number);
279 }
280 elseif(("sm"==$parsed_sms[0]) || ("3"==$parsed_sms[0])){
281 if("search"==$parsed_sms[1]){
282 require_once $global['approot'] . "/inc/lib_gis/gis_fns.inc";
283 $keys = array('all' => '1');
284 $features = shn_gis_get_features_in_radius($keys, $parsed_sms[2], $parsed_sms[3], $parsed_sms[4]);
285 //print_r($features);
286 $count = count($features);
287 //echo "<br /> $count <br />";
288
289 if($count){
290 $final_results = array();
291 $i = 1;
292 $message = "Results Found:\n";
293 foreach($features as $a){
294
295
296 //$coords = shn_gis_coord_decode($a[f_coords]);
297 //print_r($coords); @ returns 2 values for 1 input. needed to check with GIS fns and figure out a way
298 array_push($final_results, array("$a[f_name]", "$a[f_description]", "$a[f_coords]", "$a[f_event_date]"));
299 $message .= "$i. Name - $a[f_name]\nDescription: $a[f_description]\nGPS Loc: $a[f_coords]\nTimeStamp: $a[f_event_date]\n";
300 $i++;
301 }
302 }
303 else{
304 $message = "No Situations Found! Please try modifying your search.";
305 }
306
307 //print_r($final_results);
308
309 }
310 elseif("add"==$parsed_sms[1]){
311 //Valid Input SMS format "sm add <name> <description> <gps_coords>"
312 //Sample: "sm add (First Situation) (Description of the first situation) (77,78)"
313 //Restructre parsed SMS Text
314
315 $full_sms_input_text = implode(" ", $parsed_sms);
316 //Re-parsing as per Standard SM ADD format mentioned above
317 //$value = "sm add (First Situation) (Description of the first situation) (77,78)";
318 if (ereg ("(sm) (add) \((.+)\) \((.+)\) \(([0-9]{2,3}),([0-9]{2,3})\)", $full_sms_input_text, $regs))
319 {
320 //print_r($regs);
321
322 // Include for the GIS Database API.
323 require_once $global['approot']."/inc/lib_security/lib_sms_auth.inc";
324 print_r($_SESSION);
325 $f_name = $regs[3];
326 $f_description = $regs[4];
327 $f_author = shn_get_user_details($user_data['user_id']);;
328 $f_event_date = date("Y-m-d H:i:s");
329 $marker_x_lat_coordinate = $regs[5];
330 $marker_y_lng_coordinate = $regs[6];
331 require_once $global['approot']."/inc/lib_gis/gis_fns.inc";
332 // Parse the Coordinates to wkt format.
333 $coords_center = array($marker_x_lat_coordinate, $marker_y_lng_coordinate, 0);
334 $coords = array($coords_center, $coords_center);
335 $coordinates = shn_gis_coord_encode($coords, 'point');
336
337 // Register the values that will make the new feature as an array of key => values.
338 $keys_ = array(
339 'f_type' => 'point',
340 'f_projection' => 'EPSG:900913',
341 'f_coords' => $coordinates,
342 'f_name' => $f_name,
343 'f_description' => $f_description,
344 'f_author' => $f_author,
345 'f_event_date' => $f_event_date,
346 );
347 // print_r($keys_);
348 // Create the Feature.
349 shn_gis_create_feature($keys_);
350
351 } else {
352 $message = "Invalid Input format for SM Add";
353 }
354
355 }
356 else{
357 $message = "Invalid Keyword for SM Module sent. Please retry or send HELP SM to get list of valid arguements.";
358 }
359 include_once $global['approot']."/mod/msg/plugins/"."$plugin_name"."/handler_"."$plugin_name".".inc";
360 $recipients = array ($sender_phone_number);//handler_plugin.inc send sms function accepts array as input for recipients
361 if($message) shn_msg_plugin_send_sm($recipients, $message);
362 //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
363 //echo "<br \> Error SMS: ".$error_message;
364 return 0;
365 }
366
367 else{
368 $error_message = _shn_msg_sms_error_code(1);
369 include_once $global['approot']."/mod/msg/plugins/"."$plugin_name"."/handler_"."$plugin_name".".inc";
370 $recipients = array ($sender_phone_number);//handler_plugin.inc send sms function accepts array as input for recipients
371 shn_msg_plugin_send_sm($recipients, $error_message);
372 //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
373 //echo "<br \> Error SMS: ".$error_message;
374 return 0;
375 }
376}
377
378
379
380/**
381* Function calls specific to the keyword sent are listed here. Module writers should write module specific calls
382* modified for the purpose of SMS here.
383 * E.g. The function should return values which can later be formatted as plain text. No HTML output should be returned as is the case
384 * right now for the Sahana core functions which concentrate on the Web App
385 */
386
387
388/** Action Building Main Menu ***/
389
390function _shn_msg_sms_menu(){
391
392 global $sms_list_keywords;
393 $sms_main_menu = "Sahana Main Menu: \nNumeric Code - Word Code\n";
394 foreach ($sms_list_keywords as $k => $v) {
395 $sms_main_menu .= "[$k] - $v\n";
396 }
397 return $sms_main_menu;
398}
399
400
401/** Action Help - Keyword == help or Numeric Code == 911 **/
402
403function _shn_msg_sms_help($parsed_sms, $sender_phone_number){
404
405 global $global;
406 $sms_main_menu = _shn_msg_sms_menu();
407 include_once $global['approot']."/mod/msg/plugins/"."$plugin_name"."/handler_"."$plugin_name".".inc";
408 $recipients = array ($sender_phone_number);//handler_plugin.inc send sms function accepts array as input for recipients
409 shn_msg_plugin_send_sm($recipients, $sms_main_menu);
410 //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
411 //echo "<br \> Error SMS: ".$error_message;
412 return 0;
413
414}
415
416
417/** Action Login - Keyword == login or Numeric Code == 100 **/
418
419function _shn_msg_sms_login($parsed_sms, $sender_phone_number){
420
421 global $global;
422 require_once $global['approot']."/inc/lib_security/lib_sms_auth.inc";
423 $user_data = _shn_authenticate_user($parsed_sms);
424 shn_session_change($user_data);
425 //print_r($user_data);
426 if(!$user_data['error_code']){
427 $full_name = shn_get_user_details($user_data['user_id']);
428 //echo "<br \>Welcome, <strong>".$full_name."</strong> you are logged in to Sahana System via SMS. yAy!! <br \>";
429 $message = "Welcome, ".$full_name." you are logged in to Sahana System via SMS.\n";
430 $sms_main_menu = _shn_msg_sms_menu();
431 $sms_to_send = $message . $sms_main_menu;
432 include_once $global['approot']."/mod/msg/plugins/"."$plugin_name"."/handler_"."$plugin_name".".inc";
433 $recipients = array ($sender_phone_number);//handler_plugin.inc send sms function accepts array as input for recipients
434 shn_msg_plugin_send_sm($recipients, $sms_to_send);
435 //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
436 //echo "<br \> Error SMS: ".$error_message;
437 return 0;
438 //print_r($_SESSION);
439 $sessid = session_id();
440 //echo $sessid;
441 }
442
443}
444
445?>
446\ No newline at end of file
447+<?php
448+/**
449+ *
450+ * This library helps in parsing and triggering functions based on SMS Input. A vital component of the framework.
451+ * Developers are required to use this library to facilitate SMS based transactions with the Sahana Core.
452+ *
453+ *
454+ * PHP version 4 and 5
455+ *
456+ * LICENSE: This source file is subject to LGPL license
457+ * that is available through the world-wide-web at the following URI:
458+ * http://www.gnu.org/copyleft/lesser.html
459+ *
460+ * @package framework
461+ * @subpackage messaging
462+ * @author Ajay Kumar <ajuonline at gmail dot com><aj at mindtakers dot com>
463+ * @copyright Lanka Software Foundation - http://www.opensource.lk
464+ * @version $Id: lib_sms_handler.inc,v 1.2 2008/09/15 13:50:13 franboon Exp $
465+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
466+ *
467+ */
468+global $global;
469+
470+global $sms_list_keywords;
471+
472+# include_once $global['approot']."/mod/msg/lib_sms_keywords.inc";
473+$sms_list_keywords = array(
474+ '1' => 'login',
475+ '2' => 'map',
476+ '3' => 'sm',
477+ '100' => 'login',
478+ '911' => 'help'
479+);
480+
481+include_once $global['approot']."/mod/msg/lib_sms_errors.inc";
482+include_once $global['approot']."/mod/msg/plugins/"."$plugin_name"."/handler_"."$plugin_name".".inc";
483+/**
484+ * This function will parse the incoming message string sent via GET & POST
485+ * Currently this function will be used by Kannel and SMSTools
486+ * It returns the array containing all words/strings, as single array values, sent in the SMS seperated by a SPACE
487+ * For e.g. For a message string i.e. $message = "login user pass";
488+ * $parsed_message[0]="login"
489+ * $parsed_message[1]="user"
490+ * $parsed_message[2]="pass"
491+ */
492+function _shn_msg_parse_short_message($message){
493+
494+ $parsed_message=array();
495+ $parsed_message = explode(" ", $message);
496+
497+ // convert to lower to handle first letter capitilization
498+ $parsed_message[0] = strtolower($parsed_message[0]);
499+
500+ // DEBUG: parsed message
501+ print_r($parsed_message);
502+
503+ return $parsed_message;
504+}
505+/**
506+ * This function will check the first word of the incoming message string
507+ * and return the corresponding menu value only.
508+ * For. e.g. as per our keyword definition file
509+ */
510+function _shn_msg_sms_keyword_check($keyword, $sender){
511+
512+ global $global;
513+ global $sms_list_keywords;
514+
515+ // check if number entered is a valid keyword
516+ if(is_numeric($keyword)){
517+
518+ if(array_key_exists($keyword, $sms_list_keywords)){
519+
520+ $keyword_check_result = array ('return' => '1', 'type' => 'number');
521+ //echo " Key word valid and is number";
522+ return $keyword_check_result;
523+
524+ } else {
525+
526+ _shn_msg_sms_help("Invalid Number\n", $sender) ;
527+ return 0;
528+ }
529+
530+ } else { //check if keyword is a valid one
531+
532+ $bool = array_search($keyword, $sms_list_keywords);
533+ if(array_search($keyword, $sms_list_keywords)){
534+ $keyword_check_result = array ('return' => '1', 'type' => 'word');
535+ //echo " key word is valid and is WORD";
536+ return $keyword_check_result;
537+ }
538+ else{
539+ _shn_msg_sms_help("Invalid Keyword\n", $sender) ;
540+ return 0;
541+ }
542+ }
543+}
544+/**
545+ * This function will check the first word of the incoming message string
546+ * and return the corresponding menu value only.
547+ * For. e.g. as per our keyword definition file
548+ */
549+function _shn_msg_sms_action($parsed_sms, $sender_phone_number){
550+
551+ global $global;
552+
553+ $keyword0 = $parsed_sms[0];
554+ $keyword1 = strtolower($parsed_sms[1]);
555+ $full_sms_input_text = implode(" ", $parsed_sms);
556+
557+ if (("help"==$keyword0) || ("911"==$keyword0)) {
558+
559+ _shn_msg_sms_help("", $sender_phone_number);
560+ }
561+
562+ elseif (("login"==$keyword0) || ("100"==$keyword0)) {
563+
564+ _shn_msg_sms_login("", $sender_phone_number);
565+
566+ }
567+
568+ elseif ( ("map" == $keyword0) || ("sm" == $keyword0) || ("3" == $keyword0)) {
569+
570+ if ('help' == $keyword1) {
571+
572+ $message = "Type the following:\nmap lat long user title. description\nexample:\nmap n35.7153 w120.7640 hospital granada. building evacuated";
573+
574+ } elseif ("search"==$parsed_sms[1]){
575+
576+ require_once $global['approot'] . "/inc/lib_gis/gis_fns.inc";
577+ $keys = array('all' => '1');
578+ $features = shn_gis_get_features_in_radius($keys, $parsed_sms[2], $parsed_sms[3], $parsed_sms[4]);
579+ //print_r($features);
580+ $count = count($features);
581+ //echo "<br /> $count <br />";
582+
583+ if($count){
584+ $final_results = array();
585+ $i = 1;
586+ $message = "Results Found:\n";
587+ foreach($features as $a){
588+
589+
590+ //$coords = shn_gis_coord_decode($a[f_coords]);
591+ //print_r($coords); @ returns 2 values for 1 input. needed to check with GIS fns and figure out a way
592+ array_push($final_results, array("$a[f_name]", "$a[f_description]", "$a[f_coords]", "$a[f_event_date]"));
593+ $message .= "$i. Name - $a[f_name]\nDescription: $a[f_description]\nGPS Loc: $a[f_coords]\nTimeStamp: $a[f_event_date]\n";
594+ $i++;
595+ }
596+ }
597+ else{
598+ $message = "No Situations Found! Please try modifying your search.";
599+ }
600+
601+ //print_r($final_results);
602+
603+ }
604+
605+ elseif( "add" == $keyword1 ){
606+
607+ //Valid Input SMS format "sm add <name> <description> <gps_coords>"
608+ #if (ereg ("(sm) (add) \((.+)\) \((.+)\) \(([0-9]{2,3}),([0-9]{2,3})\)", $full_sms_input_text, $regs))
609+ if (ereg ("(.+) (add) \((.+):(.+)\) \((.*)\) \(([-+]?([0-9]*\.[0-9]+|[0-9]+)),([-+]?([0-9]*\.[0-9]+|[0-9]+))\)", $full_sms_input_text, $regs))
610+ {
611+ print_r($regs);
612+
613+ // Include for the GIS Database API.
614+ require_once $global['approot']."/inc/lib_security/lib_sms_auth.inc";
615+ print_r($_SESSION);
616+ $f_name = $regs[4];
617+ $f_description = $regs[5];
618+ $f_author = $regs[3];
619+ #$f_author = shn_get_user_details($user_data['user_id']);;
620+ $f_event_date = date("Y-m-d H:i:s");
621+ $marker_long_coordinate = $regs[6];
622+ $marker_lat_coordinate = $regs[8];
623+ require_once $global['approot']."/inc/lib_gis/gis_fns.inc";
624+ // Parse the Coordinates to wkt format.
625+ $coords_center = array($marker_long_coordinate, $marker_lat_coordinate, 0);
626+ $coords = array($coords_center, $coords_center);
627+ $coordinates = shn_gis_coord_encode($coords, 'point');
628+
629+ // Register the values that will make the new feature as an array of key => values.
630+ $keys_ = array(
631+ 'f_type' => 'point',
632+ 'f_projection' => 'EPSG:900913',
633+ 'f_coords' => $coordinates,
634+ 'f_name' => $f_name,
635+ 'f_description' => $f_description,
636+ 'f_author' => $f_author,
637+ 'f_event_date' => $f_event_date,
638+ );
639+ //print_r($keys_);
640+ // Create the Feature.
641+ shn_gis_create_feature($keys_);
642+
643+ $message = "Map point [".$f_name."] added to situation map";
644+
645+
646+ } else {
647+ $message = "Invalid input.\n Use sm add (title) (description) (latitude, longatitude)";
648+ }
649+
650+ } else {
651+
652+ if (ereg ("(map) ([-+nsNS]?)([0-9]*\.[0-9]+|[0-9]+) ([-+ewEW]?)([0-9]*\.[0-9]+|[0-9]+) ([^ ]+) ([^\.]*)\. ?(.*)", $full_sms_input_text, $regs)) {
653+
654+ print_r($regs);
655+ // Include for the GIS Database API.
656+ require_once $global['approot']."/inc/lib_security/lib_sms_auth.inc";
657+ //print_r($_SESSION);
658+ // $f_author = $regs[6];
659+ $f_author = $sender_phone_number;
660+ $f_name = $regs[7];
661+ $f_description = $regs[8];
662+ #$f_author = shn_get_user_details($user_data['user_id']);;
663+ // change the polarity based on NSEW prefix
664+ $f_event_date = date("Y-m-d H:i:s");
665+ $marker_long_coordinate = $regs[3];
666+ if (ereg (strtolower($regs[2]),'s|-')) {
667+ $marker_long_coordinate = -$marker_long_coordinate;
668+ }
669+ $marker_lat_coordinate = $regs[5];
670+ if (ereg (strtolower($regs[4]),'w|-')) {
671+ $marker_lat_coordinate = -$marker_lat_coordinate;
672+ }
673+
674+ require_once $global['approot']."/inc/lib_gis/gis_fns.inc";
675+ // Parse the Coordinates to wkt format.
676+ $coords_center = array($marker_lat_coordinate, $marker_long_coordinate, 0);
677+ $coords = array($coords_center, $coords_center);
678+ $coordinates = shn_gis_coord_encode($coords, 'point');
679+
680+
681+ // Register the values that will make the new feature as an array of key => values.
682+ $keys_ = array(
683+ 'f_type' => 'point',
684+ 'f_projection' => 'EPSG:900913',
685+ 'f_coords' => $coordinates,
686+ 'f_name' => $f_name,
687+ 'f_description' => $f_description,
688+ 'f_author' => $f_author,
689+ 'f_event_date' => $f_event_date,
690+ );
691+
692+ // see if the first keyword can be matched to a class for the marker
693+ $matched_gis_classes =
694+ $global['db']->Execute("SELECT * FROM `gis_feature_class` WHERE `name` LIKE '".$regs[6]."'");
695+ if (null != $matched_gis_classes)
696+ $keys_['f_class'] = $matched_gis_classes->fields('feature_class_uuid');
697+
698+ print_r($keys_);
699+ // Create the Feature.
700+ shn_gis_create_feature($keys_);
701+
702+ $message = "Map point [".$f_name."] added to situation map";
703+ } else {
704+
705+ $message = "Type the following:\nmap lat long user title. description\nexample:\nmap n35.7153 w120.7640 hospital granada. building evacuated";
706+ }
707+ }
708+
709+ $recipients = array ($sender_phone_number);//handler_plugin.inc send sms function accepts array as input for recipients
710+
711+ // if a message is created sent it
712+ if($message) shn_msg_plugin_send_sm($recipients, $message);
713+ //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
714+ //echo "<br \> Error SMS: ".$error_message;
715+ return 0;
716+
717+ }
718+
719+ else{
720+
721+ $error_message = _shn_msg_sms_error_code(1);
722+ $recipients = array ($sender_phone_number);//handler_plugin.inc send sms function accepts array as input for recipients
723+ shn_msg_plugin_send_sm($recipients, $error_message);
724+ //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
725+ //echo "<br \> Error SMS: ".$error_message;
726+ return 0;
727+ }
728+}
729+/**
730+* Function calls specific to the keyword sent are listed here. Module writers should write module specific calls
731+* modified for the purpose of SMS here.
732+ * E.g. The function should return values which can later be formatted as plain text. No HTML output should be returned as is the case
733+ * right now for the Sahana core functions which concentrate on the Web App
734+ */
735+
736+
737+/** Action Building Main Menu ***/
738+function _shn_msg_sms_menu(){
739+
740+ global $sms_list_keywords;
741+ $sms_main_menu = "Use keywords below:\n";
742+# foreach ($sms_list_keywords as $k => $v) {
743+# $sms_main_menu .= "$k-$v\n";
744+# }
745+ $sms_main_menu .= "map - map point\nhelp - general help\n";
746+ $sms_main_menu .= "map help - map syntax\n";
747+ return $sms_main_menu;
748+}
749+
750+/** Action Help - Keyword == help or Numeric Code == 911 **/
751+function _shn_msg_sms_help($prefix_text, $sender_phone_number){
752+
753+ global $global;
754+
755+ $sms_main_menu = _shn_msg_sms_menu();
756+
757+ $recipients = array ($sender_phone_number);//handler_plugin.inc send sms function accepts array as input for recipients
758+ shn_msg_plugin_send_sm($recipients, $prefix_text.$sms_main_menu);
759+ //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
760+
761+ return 0;
762+}
763+
764+/** Action Login - Keyword == login or Numeric Code == 100 **/
765+function _shn_msg_sms_login($parsed_sms, $sender_phone_number){
766+
767+ global $global;
768+ require_once $global['approot']."/inc/lib_security/lib_sms_auth.inc";
769+ $user_data = _shn_authenticate_user($parsed_sms);
770+ shn_session_change($user_data);
771+ //print_r($user_data);
772+ if(!$user_data['error_code']){
773+ $full_name = shn_get_user_details($user_data['user_id']);
774+ //echo "<br \>Welcome, <strong>".$full_name."</strong> you are logged in to Sahana System via SMS. yAy!! <br \>";
775+ $message = "Welcome, ".$full_name." you are logged in to Sahana System via SMS.\n";
776+ $sms_main_menu = _shn_msg_sms_menu();
777+ $sms_to_send = $message . $sms_main_menu;
778+ $recipients = array ($sender_phone_number);//handler_plugin.inc send sms function accepts array as input for recipients
779+ shn_msg_plugin_send_sm($recipients, $sms_to_send);
780+ //shn_msg_store_sent_messages($recipients, $error_message); @todo check the current storage mechanism. smstools_log table
781+ //echo "<br \> Error SMS: ".$error_message;
782+ return 0;
783+ //print_r($_SESSION);
784+ $sessid = session_id();
785+ //echo $sessid;
786+ }
787+
788+}
789+?>
790
791=== modified file 'mod/msg/lib_sms_keywords.inc'
792--- mod/msg/lib_sms_keywords.inc 2009-11-10 23:51:44 +0000
793+++ mod/msg/lib_sms_keywords.inc 2009-11-18 18:15:32 +0000
794@@ -1,5 +1,28 @@
795-<?php
796
797-/**
798 *
799 * This file is a list of valid keywords that the Sahana server will accept through SMS
800 * Developers are required to use this file to list keywords and prepare user manuals for it.
801 * Any changes or additions to the keywords should go in this file.
802 *
803 *
804 * PHP version 4 and 5
805 *
806 * LICENSE: This source file is subject to LGPL license
807 * that is available through the world-wide-web at the following URI:
808 * http://www.gnu.org/copyleft/lesser.html
809 *
810 * @package framework
811 * @subpackage messaging
812 * @author Ajay Kumar <ajuonline at gmail dot com><aj at mindtakers dot com>
813 * @copyright Lanka Software Foundation - http://www.opensource.lk
814 * @version $Id: lib_sms_keywords.inc,v 1.2 2008/09/15 13:50:13 franboon Exp $
815 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
816 *
817 */
818
819//This needs to be done in a more efficient way. By using the 3 letter module codes from the DB?
820-
821-
822-global $sms_list_keywords;
823
824$sms_list_keywords = array('1' => 'mpr', '2' => 'or', '3' => 'sm', '100' => 'login', '911' => 'help');
825
826?>
827\ No newline at end of file
828+<?php
829+/**
830+ *
831+ * This file is a list of valid keywords that the Sahana server will accept through SMS
832+ * Developers are required to use this file to list keywords and prepare user manuals for it.
833+ * Any changes or additions to the keywords should go in this file.
834+ *
835+ *
836+ * PHP version 4 and 5
837+ *
838+ * LICENSE: This source file is subject to LGPL license
839+ * that is available through the world-wide-web at the following URI:
840+ * http://www.gnu.org/copyleft/lesser.html
841+ *
842+ * @package framework
843+ * @subpackage messaging
844+ * @author Ajay Kumar <ajuonline at gmail dot com><aj at mindtakers dot com>
845+ * @copyright Lanka Software Foundation - http://www.opensource.lk
846+ * @version $Id: lib_sms_keywords.inc,v 1.2 2008/09/15 13:50:13 franboon Exp $
847+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
848+ *
849+ */
850+//This needs to be done in a more efficient way. By using the 3 letter module codes from the DB?
851+
852+
853+global $sms_list_keywords;
854+$sms_list_keywords = array('1' => 'mpr', '2' => 'or', '3' => 'sm', '100' => 'login', '911' => 'help');
855+?>
856\ No newline at end of file
857
858=== modified file 'mod/msg/lib_sms_main.inc'
859--- mod/msg/lib_sms_main.inc 2009-11-10 23:51:44 +0000
860+++ mod/msg/lib_sms_main.inc 2009-11-18 18:15:32 +0000
861@@ -1,3 +1,63 @@
862-<?php
863/**
864 *
865* Library functions for implementation independant messaging for SMS
866* Main messaging controller functions with modular plugin architecture irrespective of the SMS Gateway application
867 *
868 *
869 * PHP version 4 and 5
870 *
871 * LICENSE: This source file is subject to LGPL license
872 * that is available through the world-wide-web at the following URI:
873 * http://www.gnu.org/copyleft/lesser.html
874 *
875 * @package framework
876 * @subpackage messaging
877 * @author Ajay Kumar <ajuonline at gmail dot com><aj at mindtakers dot com>
878 * @copyright Lanka Software Foundation - http://www.opensource.lk
879 * @version $Id: lib_sms_main.inc,v 1.2 2008/09/15 13:50:20 franboon Exp $
880 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
881 *
882 */
883
884global $global;
885
886require_once $global['approot']."/mod/msg/lib_sms_keywords.inc";
887require_once $global['approot']."/mod/msg/lib_sms_errors.inc";
888require_once $global['approot']."/mod/msg/lib_sms_handler.inc";
889
890-global $sender_phone_number;
891global $sms_sent_timestamp;
892global $sms_message;
893
894-function shn_msg_push_to_sms_handler($received_message){
895
896 global $global;
897 $sender_phone_number = $received_message['sender'];
898 $sms_sent_timestamp = $received_message['received'];
899 $sms_message = $received_message['message'];
900 //echo "<br \>SMS Sent to main SMS Handler. <br \>From: ".$sender_phone_number;
901 //shn_msg_sms_authenticate($received_message); add authentication function here
902 // if authenticated check keyword
903 $parsed_sms = _shn_msg_parse_short_message($sms_message);
904 //echo "<br \> SMS Text = ".$sms_message;
905 //echo "<br \> Keyword Text = ".$parsed_sms[0];
906 //check for valid keyword
907 $keyword_check_result = _shn_msg_sms_keyword_check($parsed_sms[0], $sender_phone_number);
908 if($keyword_check_result!=0){
909 if($keyword_check_result['type'] == 'number'){
910 //execute_number_menu_function($parsed_sms);
911 //echo "<br \>Key word is Valid and number";
912 _shn_msg_sms_action($parsed_sms, $sender_phone_number);
913 }
914 elseif($keyword_check_result['type'] == 'word'){
915 //execute_word_menu_function($parsed_sms);
916 //echo "<br \>Key word is Valid and WORD <br \>";
917 _shn_msg_sms_action($parsed_sms, $sender_phone_number);
918 }
919 else{
920 //error already sent echo " Keywords is in invalid format";//impossible tho
921 exit;
922 }
923 }
924 else{
925 //error already sent echo " Keyword does not exists in LIST";
926 exit;
927 }
928}
929?>
930\ No newline at end of file
931+<?php
932+/**
933+ *
934+* Library functions for implementation independant messaging for SMS
935+* Main messaging controller functions with modular plugin architecture irrespective of the SMS Gateway application
936+ *
937+ *
938+ * PHP version 4 and 5
939+ *
940+ * LICENSE: This source file is subject to LGPL license
941+ * that is available through the world-wide-web at the following URI:
942+ * http://www.gnu.org/copyleft/lesser.html
943+ *
944+ * @package framework
945+ * @subpackage messaging
946+ * @author Ajay Kumar <ajuonline at gmail dot com><aj at mindtakers dot com>
947+ * @copyright Lanka Software Foundation - http://www.opensource.lk
948+ * @version $Id: lib_sms_main.inc,v 1.2 2008/09/15 13:50:20 franboon Exp $
949+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
950+ *
951+ */
952+global $global;
953+require_once $global['approot']."/mod/msg/lib_sms_keywords.inc";
954+require_once $global['approot']."/mod/msg/lib_sms_errors.inc";
955+require_once $global['approot']."/mod/msg/lib_sms_handler.inc";
956+global $sender_phone_number;
957+global $sms_sent_timestamp;
958+global $sms_message;
959+function shn_msg_push_to_sms_handler($received_message){
960+ global $global;
961+ $sender_phone_number = $received_message['sender'];
962+ $sms_sent_timestamp = $received_message['received'];
963+ $sms_message = $received_message['message'];
964+ //echo "<br \>SMS Sent to main SMS Handler. <br \>From: ".$sender_phone_number;
965+ //shn_msg_sms_authenticate($received_message); add authentication function here
966+ // if authenticated check keyword
967+ $parsed_sms = _shn_msg_parse_short_message($sms_message);
968+ //echo "<br \> SMS Text = ".$sms_message;
969+ //echo "<br \> Keyword Text = ".$parsed_sms[0];
970+ //check for valid keyword
971+ $keyword_check_result = _shn_msg_sms_keyword_check($parsed_sms[0], $sender_phone_number);
972+ if($keyword_check_result!=0){
973+ if($keyword_check_result['type'] == 'number'){
974+ //execute_number_menu_function($parsed_sms);
975+ //echo "<br \>Key word is Valid and number";
976+ _shn_msg_sms_action($parsed_sms, $sender_phone_number);
977+ }
978+ elseif($keyword_check_result['type'] == 'word'){
979+ //execute_word_menu_function($parsed_sms);
980+ //echo "<br \>Key word is Valid and WORD <br \>";
981+ _shn_msg_sms_action($parsed_sms, $sender_phone_number);
982+ }
983+ else{
984+ //error already sent echo " Keywords is in invalid format";//impossible tho
985+ exit;
986+ }
987+ }
988+ else{
989+ //error already sent echo " Keyword does not exists in LIST";
990+ exit;
991+ }
992+}
993+?>
994\ No newline at end of file
995
996=== modified file 'mod/msg/plugins/smstools/handler_smstools.inc' (properties changed: -x to +x)
997--- mod/msg/plugins/smstools/handler_smstools.inc 2009-11-10 23:51:44 +0000
998+++ mod/msg/plugins/smstools/handler_smstools.inc 2009-11-18 18:15:32 +0000
999@@ -29,6 +29,8 @@
1000 global $global;
1001 global $conf;
1002 include_once($global['approot'].'/mod/msg/plugins/smstools/conf.inc');
1003+
1004+ echo "Response Message:".$message;
1005
1006 foreach($recipients as $to){
1007 //Let system handle tmp directory: change to absolute dir if needed
1008
1009=== modified file 'mod/msg/plugins/smstools/smsfwd/smsevent' (properties changed: -x to +x)
1010--- mod/msg/plugins/smstools/smsfwd/smsevent 2009-11-10 23:51:44 +0000
1011+++ mod/msg/plugins/smstools/smsfwd/smsevent 2009-11-18 18:15:32 +0000
1012@@ -137,8 +137,8 @@
1013 echo $RECEIVED;
1014
1015 if [ "$1" == "RECEIVED" ];
1016-then curl "http://localhost/sahana-phase2/www/index.php?mod=msg&act=receive_message&stream=text&plugin=smstools&From=$FROM&Received=$RECEIVED&message=$URLTEXT";
1017+then curl "http://localhost/sahana/www/index.php?mod=msg&act=receive_message&stream=text&plugin=smstools&From=$FROM&Received=$RECEIVED&message=$URLTEXT";
1018
1019 echo $'\n\nSMS posting successful from '$FROM' message: '$TEXT $'\n\n';
1020 fi
1021-fi
1022\ No newline at end of file
1023+fi
1024
1025=== modified file 'mod/sm/main_fns.inc' (properties changed: -x to +x)
1026--- mod/sm/main_fns.inc 2009-11-10 23:51:44 +0000
1027+++ mod/sm/main_fns.inc 2009-11-18 18:15:32 +0000
1028@@ -59,4 +59,87 @@
1029 shn_sm_radius_analyse_process();
1030 }
1031
1032-?>
1033+function shn_text_sm_kml() {
1034+
1035+ global $global;
1036+ $db = $global['db'];
1037+ // write the KML content header
1038+ header("Content-type: application/vnd.google-earth.kml+xml;");
1039+
1040+ $layer=$_REQUEST['layer'];
1041+
1042+ $query="
1043+ select coord_y, coord_x,m.name,url,m.description,icon,placement_date
1044+ from gis_features f
1045+ left join gis_feature_class c on
1046+ (c.feature_class_uuid=f.feature_class_uuid_ref)
1047+ left join gis_feature_class_to_layer cl on
1048+ (c.feature_class_uuid=cl.feature_class_uuid_ref)
1049+ left join gis_layers l on
1050+ (cl.layer_uuid_ref=l.layer_uuid)
1051+ left join gis_feature_metadata m on
1052+ (f.metadata_uuid_ref=m.metadata_uuid)
1053+ ";
1054+ //--where layer_uuid='$layer'
1055+ $r = $db->Execute($query);
1056+# if (!$rs) {
1057+# $message = 'Invalid query: ' . $query . "\n";
1058+# $message .= 'Whole query: ' . $query;
1059+# die($message);
1060+# }
1061+//echo "lat lon title description icon iconSize iconOffset\n";
1062+echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
1063+?>
1064+<kml xmlns="http://www.opengis.net/kml/2.2">
1065+<Document>
1066+<flyToView>0</flyToView>
1067+<?
1068+while (!$r->EOF){
1069+
1070+ $y=$r->fields['coord_y'];
1071+ $x=$r->fields['coord_x'];
1072+ $title=$r->fields['name'];
1073+ $url = $r->fields['url'];
1074+ $desc = $r->fields['description'];
1075+ $icon = $r->fields['icon'];
1076+ if (strlen($url)>1){
1077+ if (preg_match('/^http:/',$url)){
1078+ $url="<br/><a href='".$url."'>Link</a>";
1079+ } else $url="<br/><a href='/".$url."'>Link</a>";
1080+ } else $url=$url;
1081+ $date=date("c",strtotime($r->fields['placement_date']));
1082+?>
1083+<Placemark>
1084+ <name><?=$title?></name>
1085+ <description><![CDATA[
1086+ <?=$desc?><?=$url?>]]></description>
1087+ <Point>
1088+ <coordinates><?=$x.','.$y?>,0</coordinates>
1089+ </Point><?if (strlen($icon)>1){?>
1090+ <Style>
1091+ <IconStyle>
1092+ <Icon>
1093+ <href><?=$icon?></href>
1094+ </Icon>
1095+ </IconStyle>
1096+ </Style><?
1097+} ?><TimeStamp>
1098+ <when><?=$date?></when>
1099+</TimeStamp>
1100+ </Placemark>
1101+<?
1102+//echo join("\t",$r);
1103+//echo "\n";
1104+ $r->MoveNext();
1105+
1106+ }
1107+
1108+?>
1109+</Document>
1110+</kml>
1111+
1112+<?php
1113+}
1114+?>
1115+
1116+

Subscribers

People subscribed via source and target branches

to all changes: