RSS

LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / LuxCal / Comments and Suggestions / Multiples calendars but same users
Posted:  14 Jul 2013 00:21
Hi,

Is it possible to have multiples calendars with users are common to all calendars ?

Greetings.
__________________
JL, luxcal french user, test luxcal on my site
Posted:  14 Jul 2013 19:09
Hi JL,
Currently multiple calendar are fully independent, so each calendar has it's own users table.
I guess it would not be very difficult to share the same users table, but if the admin's database page and the  lctools script should also be aware of this change, it would become slightly more complicated.
Roel
Posted:  15 Jul 2013 21:18   Last Edited By: JL_1978
Hi Roel,

I have a suggestion with an yes/no option named "UsersTableIsOnlyPresentOnDefaultCalendar" in calendar settings but it is 'beastly' and not tested for the moment (my changes are in bold) :

function dbQuery($q,$logError=1) {
    global $calID, $set, $dbPfix;
    if(!empty($set['UsersTableIsOnlyPresentOnDefaultCalendar'])) {
     $q = str_replace(' [db]users', ' ' . $dbPfix . '_users', $q);
     $q = preg_replace('/ [^_]*_users/', ' ' . $dbPfix . '_users', $q);
    }
    $q = str_replace ('[db]',$calID.'_',$q) ; //add database prefix
    $rSet = mysql_query($q);
    if ($logError and $rSet === false) {
        logError('mysql',"MySQL error: ".mysql_error()."nQuery string: {$q}");
        exit("SQL error. See 'logs/mysql.log'");
    }
    return $rSet; //result set
}


what do you think ?

Greetings.
__________________
JL, luxcal french user, test luxcal on my site
Posted:  16 Jul 2013 23:11
Hi JL,

Yes, that looks good. You are a LuxCal expert!
The only thing I don't understand is why do you need this preg_replace? is the str_replace not sufficient?

And of course, as said in my previous post, the databse.php and lctools.php (and maybe others) need to be changed accordingly.

Greetings, Roel
Posted:  17 Jul 2013 02:03
Hi Roel,

I prefer preg_replace because I don't know if futures versions will use only "[db]" or "${calID}_" and if it's sufficient in multiple calendars context.

Do you think that would be enough:

     $q = str_replace(' [db]users', ' ' . $dbPfix . '_users', $q);
     $q = str_replace(' ' . ${calID} . '_users', ' ' . $dbPfix . '_users', $q);


The database.php / lctools.php / wbtools.php could use dbQuery() function instead of mysql_query() in particular inside createDbTable() and init*() functions ?

Greetings.
__________________
JL, luxcal french user, test luxcal on my site
Posted:  19 Jul 2013 14:59
Hello JL,

As a matter of fact, I have nothing against preg_replace. But I thought that just . . .

     $q = str_replace('[db]users', $dbPfix . '_users', $q);

would be enough. I thought the complete line with preg_replace was redundant.

You are right that certain parts of database.php, lctools.php and wbtools.php could also use the dbQuery() function. But when replicating data (lctools.php) and the new "restore" in the database.php files should be aware of what to do with the users table(s).

Greetings, Roel
Posted:  19 Jul 2013 22:12
OK, thank you.
__________________
JL, luxcal french user, test luxcal on my site
Posted:  30 Jul 2013 04:24
A shared user feature where they could access multiple calendars could be quite handy. In my case you could have a user that wants to post in two calendars in nearby cities or towns.

If used in a business environment you could have a manager update multiple calendars without multiple logins.

I noticed you are working on 3.2 now.

Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  31 Jul 2013 21:50   Last Edited By: Roel B.
Hi Dan,
Yes, Version 3.2 has 4 free format additional fields which can be (de)activated by the admin. I'm thinking of giving the admin the possibility to define the format of events (sequence of fields and CRLFs). What do you think?
Roel
Posted:  01 Aug 2013 01:56
Hi Roel,

I think the ability to have the additional fields could come in handy for customizing to meet specific needs. The deactivation feature could be nice. thump_up

If not included, a feature that would be nice for the fields is for admin needs only. Say the admin wants a field to store a phone number for a user, it would be part of the users profile but not displayed in the calendar or something other users would see.

Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  18 Nov 2013 13:16
Firstly let me congratulate all at Luxcal for a excellent calendar implementation, and the new multiple calendar facility is very useful.

I would like add a few thoughts to this discussion topic.  I use luxcal to post eventas for my scout group, but I want to create some seperation between the sections, ie beavers, cubs, scouts, rovers, and an overall calendar for the group.

It would be really useful to have a central User configuration and then have the ability to assign the users to the calendar or calendars as appropriate.  So for example  Parent A has a member in the beaver and scout sections, so they would have access to the group calendar, and the beaver, and scout calendars, while Parent B has members in cubs and scouts so again they would see the group calendar, and then also the cub abd scout calendars

To take this to its logical conclusion, on the calendar view it would be nice to display the events from all the calendars that the user has access to in a single view with the possibility to select individual calendars by selecting the option button.

this might be something to think about for a major release in the future
Posted:  18 Nov 2013 23:26
Yeah, this is would be a nice feature. As suggested, we'll think about it for a next major release.
It's too late to add this to the major release planned for December. It would be nice project for Spring 2014.
Roel
Posted:  30 Jun 2014 13:09
It has been almost a year since this thread was first started so I thought I would see what the thoughts were currently on it? In post #2 of the thread Roel commented.

Quote:


Currently multiple calendar are fully independent, so each calendar has it's own users table.
I guess it would not be very difficult to share the same users table, but if the admin's database page and the  lctools script should also be aware of this change, it would become slightly more complicated.


The multiple calendars in a single database is very handy. Most would only need to post in a single calendar but for numerous scenarios a user might need to post in different calendars within the same database. True they could use the same user id and password for each one but it would require logging in separately.

User's would probably find it much easier with a single log in. You could also have a scenario where someone who is in charge of entering events is going to turn the job over to someone else. They would now have to log into each one and update the account.
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html