Skip to content

Commit 9e3179d

Browse files
committed
Fix future date handling for membership / boardentries
Display URL's as links
1 parent b4c1101 commit 9e3179d

File tree

9 files changed

+27
-4
lines changed

9 files changed

+27
-4
lines changed

com_clubmanagement.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<creationDate>December 2017</creationDate>
77
<copyright>(C) 2017 Norbert Kuemin</copyright>
88
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
9-
<version>3.0.18</version>
9+
<version>3.0.19</version>
1010
<description>COM_CLUBMANAGEMENT_XML_DESC</description>
1111

1212
<install>

site/models/boardentries.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,12 @@ protected function getListQuery() {
130130
$publicity = $this->paramsMenuEntry->get('publicity');
131131
$catid = $this->paramsMenuEntry->get('catid');
132132
if ($state == "current") {
133-
array_push($where,"(".$db->quoteName('b.end')." IS NULL OR ".$db->quoteName('b.end')." = '0000-00-00')");
133+
array_push($where,"(".$db->quoteName('b.end')." IS NULL OR ".$db->quoteName('b.end')." = '0000-00-00' OR DATE(".$db->quoteName('b.end').") >= NOW())");
134134
}
135135
if ($state == "closed") {
136136
array_push($where,$db->quoteName('b.end')." IS NOT NULL");
137137
array_push($where,$db->quoteName('b.end')." <> '0000-00-00'");
138+
array_push($where,"DATE(".$db->quoteName('b.end').") < NOW()");
138139
}
139140
if (is_array($job)) {
140141
array_push($where,$db->quoteName('b.job')." IN (".implode(", ",$db->quote($job)).")");

site/models/memberships.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ protected function getListQuery() {
127127
$publicity = $this->paramsMenuEntry->get('publicity');
128128
$catid = $this->paramsMenuEntry->get('catid');
129129
if ($state == "current") {
130-
array_push($where,"(".$db->quoteName('m.end')." IS NULL OR ".$db->quoteName('m.end')." = '0000-00-00')");
130+
array_push($where,"(".$db->quoteName('m.end')." IS NULL OR ".$db->quoteName('m.end')." = '0000-00-00' OR DATE(".$db->quoteName('m.end').") >= NOW())");
131131
}
132132
if ($state == "closed") {
133133
array_push($where,$db->quoteName('m.end')." IS NOT NULL");
134134
array_push($where,$db->quoteName('m.end')." <> '0000-00-00'");
135+
array_push($where,"DATE(".$db->quoteName('m.end').") < NOW()");
135136
}
136137
if (is_array($membertype)) {
137138
array_push($where,$db->quoteName('m.type')." IN (".implode(", ",$db->quote($membertype)).")");

site/views/boardentries/tmpl/address.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@
9898
if ($lines[$i]) { $lines[$i] .= " "; }
9999
if ($details && ($this->paramsMenuEntry->get( 'detail_column_link' ) == $field) && ($data != "")) {
100100
$data = "<a href=\"".$uri->toString()."\" class=\"modal\" rel=\"{handler: 'iframe', size: {x: ".$this->paramsMenuComponent->get( 'detail_width' ).", y: ".$this->paramsComponent->get( 'detail_height' )."}}\">".$data."</a>";
101+
} else {
102+
if ($field == 'person_url') {
103+
$data = '<a href="'.$data.'" target="_new">'.$data.'</a>';
104+
}
101105
}
102106
$lines[$i] .= $data;
103107
$lines[$i] = trim($lines[$i]);

site/views/boardentries/tmpl/card.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ function getImageDir($imageDir) {
121121
if ($lines[$i]) { $lines[$i] .= ' '; }
122122
if ($details && ($this->paramsMenuEntry->get('detail_column_link') == $field) && ($data != '')) {
123123
$data = '<a href="'.$uri->toString().'" class="modal" rel="{handler: \'iframe\', size: {x: '.$detailWidth.', y: '.$detailHeight.'}}">'.$data.'</a>';
124+
} else {
125+
if ($field == 'person_url') {
126+
$data = '<a href="'.$data.'" target="_new">'.$data.'</a>';
127+
}
124128
}
125129
$lines[$i] .= $data;
126130
$lines[$i] = trim($lines[$i]);

site/views/boardentries/tmpl/default.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@
120120
if ($details && (($detailColumn == "") || ($detailColumn == $field))) {
121121
echo "<a href=\"".$uri->toString()."\" class=\"modal\" rel=\"{handler: 'iframe', size: {x: ".$detailWidth.", y: ".$detailHeight."}}\">".$data."</a>";
122122
} else {
123+
if ($field == 'person_url') {
124+
$data = '<a href="'.$data.'" target="_new">'.$data.'</a>';
125+
}
123126
echo $data;
124127
}
125128
echo "</td>";

site/views/memberships/tmpl/address.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@
104104
if ($lines[$i]) { $lines[$i] .= " "; }
105105
if ($details && ($this->paramsMenuEntry->get( 'detail_column_link' ) == $field) && ($data != "")) {
106106
$data = "<a href=\"".$uri->toString()."\" class=\"modal\" rel=\"{handler: 'iframe', size: {x: ".$this->paramsMenuComponent->get('detail_width').", y: ".$this->paramsComponent->get('detail_height')."}}\">".$data."</a>";
107+
} else {
108+
if ($field == 'person_url') {
109+
$data = '<a href="'.$data.'" target="_new">'.$data.'</a>';
110+
}
107111
}
108112
$lines[$i] .= $data;
109113
$lines[$i] = trim($lines[$i]);

site/views/memberships/tmpl/card.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,14 @@ function getImageDir($imageDir) {
112112
} else {
113113
if (isset($row[$field])) { $data = $row[$field]; }
114114
}
115-
116115
if (strlen($data) > 0) {
117116
if ($lines[$i]) { $lines[$i] .= " "; }
118117
if ($details && ($this->paramsMenuEntry->get('detail_column_link') == $field) && ($data != "")) {
119118
$data = '<a href="'.$uri->toString().'" class="modal" rel="{handler: \'iframe\', size: {x: '.$detailWidth.', y: '.$detailHeight.'}}">'.$data.'</a>';
119+
} else {
120+
if ($field == 'person_url') {
121+
$data = '<a href="'.$data.'" target="_new">'.$data.'</a>';
122+
}
120123
}
121124
$lines[$i] .= $data;
122125
$lines[$i] = trim($lines[$i]);

site/views/memberships/tmpl/default.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
if ($details && (($detailColumn == "") || ($detailColumn == $field))) {
117117
echo "<a href=\"".$uri->toString()."\" class=\"modal\" rel=\"{handler: 'iframe', size: {x: ".$detailWidth.", y: ".$detailHeight."}}\">".$data."</a>";
118118
} else {
119+
if ($field == 'person_url') {
120+
$data = '<a href="'.$data.'" target="_new">'.$data.'</a>';
121+
}
119122
echo $data;
120123
}
121124
echo "</td>";

0 commit comments

Comments
 (0)