6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
9/24/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#3905] Add maxevents parameter to monthlist Block
*
Your Email Address
*
Spam protection
Enter the letters below:
\ /.__ .__.. .. . >< [__)[__]|\/|| | / \[__)| || ||__|
Comment
> The following patch adds a maxevents parameter to the monthlist > Block, which allows you to limit the total number of events displayed > in the block. > > > > > > --- monthlist.php (revision 67) > > +++ monthlist.php (working copy) > > @@ -23,7 +23,10 @@ > > 'default' => '__all'), > > 'months' => array('name' => _("Months Ahead"), > > 'type' => 'int', > > - 'default' => 2)); > > + 'default' => 2), > > + 'maxevents' => array('name' => _("Maximum > number of events to display (0 = no limit)"), > > + 'type' => 'int', > > + 'default' => 0)); > > $params['calendar']['values']['__all'] = _("All Visible"); > > foreach (Kronolith::listCalendars() as $id => $cal) { > > $params['calendar']['values'][$id] = $cal->get('name'); > > @@ -79,6 +82,7 @@ > > $endDate->mday, $endDate->month, > $endDate->year); > > > > /* Loop through the days. */ > > + $totalevents = 0; > > for ($i = 0; $i < $days; $i++) { > > $day = &new Kronolith_Day($startDate->month, $today + $i); > > $today_stamp = $day->getStamp(); > > @@ -86,6 +90,10 @@ > > continue; > > } > > > > + if(($this->_params['maxevents'] > 0) && ($totalevents >= > $this->_params['maxevents'])) { > > + break; > > + } > > + > > $firstevent = true; > > > > /* Output month header. */ > > @@ -156,6 +164,8 @@ > > $html .= '</strong>'; > > } > > $html .= '</td></tr>'; > > + > > + $totalevents++; > > } > > }
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers