Skip to content

Commit 297293b

Browse files
committed
[spalenque] - #14552 * changes in speaker bureau
1 parent 28916ef commit 297293b

4 files changed

Lines changed: 72 additions & 50 deletions

File tree

speaker_bureau/code/ui/SpeakerListPage.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ function profile()
9494
if (is_numeric($SpeakerID)) {
9595
// Check to make sure there's a member with the current id
9696
if ($Profile = $this->findSpeaker($SpeakerID)) {
97+
$country = $Profile->Member() ? $Profile->Member()->Country : $Profile->Country;
98+
$Profile->CountryName = CountryCodes::countryCode2name($country);
9799
$data["Profile"] = $Profile;
98100
//return our $Data to use on the page
99101
return $this->getViewer('profile')->process
@@ -185,7 +187,6 @@ public function results()
185187
$empty_search = true;
186188
$where_string = "PresentationSpeaker.AvailableForBureau = 1";
187189

188-
189190
if ($spoken_language = $this->getSearchQuery('spoken_language')) {
190191
$empty_search = false;
191192
$languages = "'" . implode("','", $spoken_language) . "'";
@@ -198,10 +199,14 @@ public function results()
198199
$where_string .= " AND Countries.Name IN ({$countries})";
199200
}
200201

201-
if ($travel_preference = $this->getSearchQuery('travel_preference')) {
202+
if ($city = $this->getSearchQuery('city')) {
203+
$empty_search = false;
204+
$where_string .= " AND Member.City = '{$city}'";
205+
}
206+
207+
if ($zipcode = $this->getSearchQuery('zipcode')) {
202208
$empty_search = false;
203-
$preferences = "'" . implode("','", $travel_preference) . "'";
204-
$where_string .= " AND Countries2.Name IN ({$preferences})";
209+
$where_string .= " AND Member.Postcode = '{$zipcode}'";
205210
}
206211

207212
if ($query = $this->getSearchQuery('search_query')) {
@@ -236,7 +241,8 @@ public function results()
236241
->leftJoin("Language", "Language.ID = PresentationSpeaker_Languages.LanguageID")
237242
->leftJoin("SpeakerTravelPreference", "SpeakerTravelPreference.SpeakerID = PresentationSpeaker.ID")
238243
->leftJoin("Countries", "Countries2.Code = SpeakerTravelPreference.Country", "Countries2")
239-
->where($where_string);
244+
->where($where_string)
245+
->sort('PresentationSpeaker.LastName');
240246

241247
// No Member was found
242248
if (!isset($Results) || $Results->count() == 0) {

speaker_bureau/templates/Layout/SpeakerListPage.ss

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,32 @@
1414
<label class="left" for="filters" style="margin: 20px 0 10px 0;">Or Filter</label>
1515
(search results will match at least one of the options selected for every filter)
1616

17-
<div class="filters">
18-
Spoken Language:
19-
<select id="spoken_language" name="spoken_language[]" multiple="multiple">
20-
<% loop AvailableLanguages %>
21-
<option value="$Language">$Language</option>
22-
<% end_loop %>
23-
</select>
24-
25-
Country of Origin:
26-
<select id="country_origin" name="country_origin[]" multiple="multiple">
27-
<% loop AvailableCountries %>
28-
<option value="$Country">$Country</option>
29-
<% end_loop %>
30-
</select>
31-
32-
<% cached 'COUNTRIES' %>
33-
Travel Preference:
34-
<select id="travel_preference" name="travel_preference[]" multiple="multiple">
35-
<% loop AvailableTravelCountries %>
36-
<option value="$Country">$Country</option>
37-
<% end_loop %>
38-
</select>
39-
<% end_cached %>
17+
<div class="filters row">
18+
<div class="col-md-3">
19+
Spoken Language:
20+
<select id="spoken_language" name="spoken_language[]" multiple="multiple">
21+
<% loop AvailableLanguages %>
22+
<option value="$Language">$Language</option>
23+
<% end_loop %>
24+
</select>
25+
</div>
26+
<div class="col-md-3">
27+
Country of Origin:
28+
<select id="country_origin" name="country_origin[]" multiple="multiple">
29+
<% loop AvailableCountries %>
30+
<option value="$Country">$Country</option>
31+
<% end_loop %>
32+
</select>
33+
</div>
34+
<div class="col-md-3">
35+
City:
36+
<input class="form-control input-sm" id="city" name="city">
37+
</div>
38+
<div class="col-md-3">
39+
Zip Code:
40+
<input class="form-control input-sm" id="zipcode" name="zipcode">
41+
</div>
42+
4043
</div>
4144

4245
<input type="submit" class="btn btn-default" value="Go"/>

speaker_bureau/templates/Layout/SpeakerListPage_profile.ss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@
2222
<strong>Date Joined: </strong> $Created.Month $Created.format(d), $Created.Year
2323
</div>
2424
<div class="span-4">
25-
<strong>Country: </strong> $Country
25+
<strong>Country: </strong> $CountryName
2626
</div>
27+
<% if $Member.Exists %>
28+
<div class="span-4">
29+
<strong>Home Town: </strong> $Member.City
30+
</div>
31+
<div class="span-4">
32+
<strong>Zip Code: </strong> $Member.Postcode
33+
</div>
34+
<% end_if %>
2735
<div class="span-4">
2836
<strong>Registered for Upcoming
2937
Summit: </strong> <% if RegisteredForSummit %> $Summit.Name <% else %> No <% end_if %>

speaker_bureau/templates/Layout/SpeakerListPage_results.ss

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,32 @@
1111
<label class="left" for="filters" style="margin: 20px 0 10px 0;">Or Filter</label>
1212
(search results will match at least one of the options selected for every filter)
1313

14-
<div class="filters">
15-
Spoken Language:
16-
<select id="spoken_language" name="spoken_language[]" multiple="multiple">
17-
<% loop AvailableLanguages %>
18-
<option value="$Language" $Top.optionSelected('spoken_language',$Language) >$Language</option>
19-
<% end_loop %>
20-
</select>
21-
22-
Country of Origin:
23-
<select id="country_origin" name="country_origin[]" multiple="multiple">
24-
<% loop AvailableCountries %>
25-
<option value="$Country" $Top.optionSelected('country_origin',$Country) >$Country</option>
26-
<% end_loop %>
27-
</select>
28-
29-
Travel Preference:
30-
<select id="travel_preference" name="travel_preference[]" multiple="multiple">
31-
<% loop AvailableTravelCountries %>
32-
<option value="$Country" $Top.optionSelected('travel_preference',$Country) >$Country</option>
33-
<% end_loop %>
34-
</select>
14+
<div class="filters row">
15+
<div class="col-md-3">
16+
Spoken Language:
17+
<select id="spoken_language" name="spoken_language[]" multiple="multiple">
18+
<% loop AvailableLanguages %>
19+
<option value="$Language" $Top.optionSelected('spoken_language',$Language) >$Language</option>
20+
<% end_loop %>
21+
</select>
22+
</div>
23+
<div class="col-md-3">
24+
Country of Origin:
25+
<select id="country_origin" name="country_origin[]" multiple="multiple">
26+
<% loop AvailableCountries %>
27+
<option value="$Country" $Top.optionSelected('country_origin',$Country) >$Country</option>
28+
<% end_loop %>
29+
</select>
30+
</div>
31+
<div class="col-md-3">
32+
City:
33+
<input class="form-control input-sm" id="city" name="city" value="{$Top.getSearchQuery('city')}">
34+
</div>
35+
<div class="col-md-3">
36+
Zip Code:
37+
<input class="form-control input-sm" id="zipcode" name="zipcode" value="{$Top.getSearchQuery('zipcode')}">
38+
</div>
39+
3540
</div>
3641

3742
<input type="submit" class="btn btn-default" value="Go"/>

0 commit comments

Comments
 (0)