Skip to content

Commit

Permalink
UPDATE: Convert IsNew to Flag System
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Rudy committed Nov 4, 2014
1 parent 67ad9b6 commit b7ac769
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/Pages/Listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class Listing extends Page implements HiddenClass {
//basic sale data
'Status' => "Enum('Available,Sold,Closed,Unavailable')", //Listing Availabilty (see onBeforeWrite)
'Feature' => 'Boolean', //Flag to define if the listing is considerd a "Feature Listing"
'IsNew' => 'Boolean', //Flag to define if a listing is considerd New
'IsNew' => 'Boolean', //Flag to define if a listing is considerd New DEPRECIATED
'Flag' => "Enum('None,New,Exclusive')", //Optoinal Listing Flags for secial cases (New Listings and Exclusives)
'MLS' => "Varchar(100)", //MLS number for primary board (see AddiionalMLS)
'ListingType' => "Enum('Residential,Condo,Commercial')", //Type of property based of TREB IDX classification
'SaleOrRent' => "Enum('Sale,Lease')", //If listing is classified as a For Sale or For Rent
Expand Down Expand Up @@ -189,7 +190,8 @@ public function getCMSFields() {
DropdownField::create("Status", "Status", singleton('Listing')->dbObject('Status')->enumValues())->addExtraClass('noborder'),
DropdownField::create("SaleOrRent", "Sale Or Rent", array("Sale" => "Sale", "Lease" => "Lease"))->addExtraClass('noborder'),
CheckboxField::create("Feature")->addExtraClass('noborder'),
CheckboxField::create("IsNew")->addExtraClass('noborder'),
//CheckboxField::create("IsNew")->addExtraClass('noborder'),
DropdownField::create("Flag", "Listing Flag", singleton('Listing')->dbObject('Flag')->enumValues())->addExtraClass('noborder'),
TextField::create("MLS", "MLS Number"),
)
);
Expand Down Expand Up @@ -822,7 +824,7 @@ function ShowListingsPage() {


public function UpcomingOpenHouse() {
$OpenHouses = $this->OpenHouseDates()->filter(array("OpenHouseDate:greaterThan" => strtotime("today")));
$OpenHouses = $this->OpenHouseDates()->filter(array("OpenHouseDate:GreaterThanOrEqual" => strtotime("today")));
return $OpenHouses->count() ? $OpenHouses : false;
}

Expand Down

0 comments on commit b7ac769

Please sign in to comment.