Permalink
Browse files

Merge pull request #30 from MarkMaldaba/HideParkingStuffIfUnused

Hide parking stuff if unused
  • Loading branch information...
2 parents 28267b2 + 05e8c8d commit 51548049ad999f4f131b5095f0d2b2ee28632da0 @phpfreak committed Nov 16, 2012
@@ -607,7 +607,11 @@ function getToggleFavoriteUrl($redirect_to = null) {
* @return null
*/
function getReserveParkingSpaceUrl() {
- return config_option('parking space reservation url', '').'?license_plate='.$this->getLicensePlate();
+ $url = trim(config_option('parking space reservation url', ''));
+ if ($url != '') {
+ $url .= '?license_plate=' . $this->getLicensePlate();
+ }
+ return $url;
} // getReserveParkingSpaceUrl
/**
@@ -26,7 +26,10 @@
<?php
$options = array();
if (logged_user()->isMemberOfOwnerCompany()) {
- $options[] = '<a href="' . $contact->getReserveParkingSpaceUrl() . '">' . lang('reserve parking space') . '</a>';
+ $parkingurl = trim($contact->getReserveParkingSpaceUrl());
+ if ($parkingurl != '') {
+ $options[] = '<a href="' . $parkingurl . '">' . lang('reserve parking space') . '</a>';
+ }
$options[] = '<a href="' . $contact->getShowMapUrl() . '">' . lang('show map') . '</a>';
$options[] = '<a href="' . logged_user()->getContact()->getShowRouteUrl($contact) . '">' . lang('show route') . '</a>';
}

0 comments on commit 5154804

Please sign in to comment.