Jump to content
Christophe

Agenda/Calendar

Recommended Posts

Hi,

I help sometimes a small non-profit organization by, among other things, improving the website that I created for them.

Recently they asked me if I could add a functionality.

So, they would like a kind of agenda/calendar. The editor(s) would enter the events, and the members of the association/organization would connect to the website, only to be able to add their names to the list of persons who would attend the event. They would also be able to remove themselves from the list.
Perhaps even the number of persons would be a nice addition, but not obligatory.

The list could only appear on hovering or clicking the mouse, it shouldn't necessarily need to be visible from the beginning.
It should be visible from the other members connected to the website (on the frontend).
Each member should have his/her own account, username and password.

Of course their access to the admin should be very limited and secured. 

I already have some pro modules (even some that I haven't used yet), and I am willing to acquire a new one if it helps.

I'm welcoming every suggestion (even though I already have some ideas and will continue researching).

Have a very nice weekend!

Share this post


Link to post
Share on other sites

Maybe you should have a look at this module http://www.99lime.com/modules/recurme/. I've never needed to use it, but always kept an eye on it in case one day I would. Seems very well put up.

Also check the new Login Register Pro by Ryan https://processwire.com/store/login-register-pro/. Might help you a lot i n case you decide to build all the user interaction in the frontend.

  • Thanks 1

Share this post


Link to post
Share on other sites

In case someone needs it. Part of a PM.

"Here is my "test" code(s) (created and tested in a online php tester) :

First version before adding the name of the days (part):

<?php

setlocale(LC_ALL, 'fr_FR');

$year = "2020"; // change with processwire name
$months_in_year = range(1, 12);

echo "<h2>" . $year . "</h2>";
 
foreach ($months_in_year as $month) {
	$month_name = utf8_encode(strftime('%B', mktime(0, 0, 0, $month))); 
	$days_in_month = date( 't', strtotime( $year . '-' . $month ) );
	
	echo "<em>" . $month . "° mois : " . $days_in_month . " jours</em>";
	
	echo "<h3>" . ucwords($month_name) . "</h3>";	
	
	foreach (range(1, $days_in_month) as $day) {
		echo "<p>" . $day . "</p>";
	}
	echo "<hr />";
}

Second version:

<?php

setlocale(LC_TIME, 'fr_FR.utf8','fra');

$year = "2020"; // change with processwire name
$months_in_year = range(1, 12);

echo "<h2>" . $year . "</h2>";
 
foreach ($months_in_year as $month) {
	$month_name = strftime('%B', mktime(0, 0, 0, $month)); 
	$days_in_month = date( 't', strtotime( $year . '-' . $month ) );
	
	echo "<em>" . $month . "° mois : " . $days_in_month . " jours</em>";
	
	echo "<h3>" . ucwords($month_name) . "</h3>";	
	
	foreach (range(1, $days_in_month) as $day) {
		$day_name = strftime('%A', mktime(0, 0, 0, $month, $day, $year)); 
		echo "<p>" . ucwords($day_name) . " " . $day . "</p>";
	}
	echo "<hr />";
}

setlocale because "Février" for example had accent encoding issues.
Perhaps I won't need it.

[ ucwords() OR ucfirst() ]

mktime will only work correctly until 2038 apparently but I guess it's ok.
(I suppose the Julian system is used by default.)

There was also jddayofweek, for instance, but I couldn't quickly make it work so I tried and did the same as with $month_name

At the beginning I also tried DateTime: a bit."

I'm really not sure how to handle the next steps for the moment.

I've had some suggestions. 

I've been away for some time, not using the computer a lot.
I've created the php calendar/agenda part quite recently. It still needs adjustments.

I still have to figure out how to add one or several events to a day, etc.
And if, for example, I need to have years as pages or not in the admin, or as other fields elsewhere. (I guess at least 2 years should be available (for statistics/an annual report, and the following year).

(Then will come the registered users solution(s) later. I still have several steps before.)

I've just started now with:
Agenda [template agenda]
   Years [template years]
      2020  [template year]
   Events [template events]
      Event 1 [template event]
      Event 2 [template event]

But I'm just beginning again. Perhaps it will change soon.

I don't really know how I managed to create the calendar/agenda part. Just with some suggestions, searches on the Internet and trials and errors. 🙂

Share this post


Link to post
Share on other sites

An update soon.
It seems that I have found a solution for at least the "add one or more events to a day" part.
I have to adjust some php, html, css and other things. Also perhaps to change under which page(s) the template code has to be, under Agenda as it currently is or the pages for the years.
The code is still quite short.

Edited by Christophe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...