diff --git a/blocks/html/embed/requestForm.inc b/blocks/html/embed/requestForm.inc index 9d649b8..ab03845 100644 --- a/blocks/html/embed/requestForm.inc +++ b/blocks/html/embed/requestForm.inc @@ -27,7 +27,7 @@ foreach (Endpoint::$optionalOpen311Fields as $field) {

-
+
Location
@@ -139,6 +139,11 @@ foreach (Endpoint::$optionalOpen311Fields as $field) {
+
Media +

Upload a photo

+ +
+
@@ -160,6 +165,6 @@ foreach (Endpoint::$optionalOpen311Fields as $field) { template->addToAsset('scripts',YUI.'/yui/yui-min.js'); - $this->template->addToAsset('scripts','http://maps.googleapis.com/maps/api/js?sensor=true'); + $this->template->addToAsset('scripts','https://maps.googleapis.com/maps/api/js?sensor=true'); $this->template->addToAsset('scripts',BASE_URL.'/js/map_picker.js'); -?> \ No newline at end of file +?> diff --git a/models/Endpoint.php b/models/Endpoint.php index fcb6f38..9e66cf1 100644 --- a/models/Endpoint.php +++ b/models/Endpoint.php @@ -220,6 +220,9 @@ public function postServiceRequest(array $post, Client $client=null) } } } + if (isset($_FILES['media']['name'])) { + $request['media'] = "@{$_FILES['media']['tmp_name']};type={$_FILES['media']['type']};filename={$_FILES['media']['name']}"; + } $open311 = curl_init("{$this->getUrl()}/requests.xml"); curl_setopt_array($open311, array( CURLOPT_POST=>true, @@ -273,4 +276,4 @@ private function queryServer($url) throw new Exception('endpoints/open311ServerUnReachable'); } } -} \ No newline at end of file +}