How to customize the behavior of Agendav according to user profile ?

47 views
Skip to first unread message

GRUSON Christophe

unread,
Feb 19, 2013, 2:50:03 PM2/19/13
to agend...@googlegroups.com
Hi to all,

I'm new to Agendav and codeigniter. I think it's great & i would like to customize its behavior.

if  i've 2 differents category of users (admin user and end user), i would like the behavior bze different according the profile of the user.

For instance ,  if an admin click on a empty date on the calendar, the create event dialog open (default behavior) but this action done by a end user must do nothing because he can't create new event

And if a admin click on existing event, he open it (default behavior) but if a user click on it , i want he see a different dialog (eg. with a button "I want to partipate").

These modifications must be made in controllers , in views  ?


Jorge López Pérez

unread,
Feb 21, 2013, 11:51:22 AM2/21/13
to agend...@googlegroups.com
Hi Christophe,

El 19/02/13 20:50, GRUSON Christophe escribió:

> These modifications must be made in controllers , in views ?

Those modifications should be made mainly on the client part (i.e.
JavaScript). Unfortunately, current AgenDAV JS code is kind of messy and
would require lots of work to do this. and besides aintaining it would
be a hell for you.

I don't know when I'll have enough time to accomplish it, but I'd like
to start using a MVC framework client-side, such as Backbone or Ember.

Regards.

--
Jorge López Pérez
http://adobo.org
Jabber: jor...@jabberes.org

GRUSON Christophe

unread,
Feb 22, 2013, 4:53:23 AM2/22/13
to AgenDAV development
Thanks for your answer Jorge.

i looked into the app.js and it's a bit complicated for me.

I wondered if a couldn't send a ajax post to the server and modify
javacript acccording to the response.

Ex. IsUserProfile('action','CreateEvent') = TRUE then "generate
dialog and create dialog"
or IsUserPorfile('profile','client') = true then generate a
specific dialog

Do you think it need lot of work ?
> Jabber: jorg...@jabberes.org

Jorge López Pérez

unread,
Feb 27, 2013, 3:11:30 AM2/27/13
to agend...@googlegroups.com
Hi Gruson,

El 22/02/13 10:53, GRUSON Christophe escribió:

> I wondered if a couldn't send a ajax post to the server and modify
> javacript acccording to the response.
>
> Ex. IsUserProfile('action','CreateEvent') = TRUE then "generate
> dialog and create dialog"
> or IsUserPorfile('profile','client') = true then generate a
> specific dialog
>
> Do you think it need lot of work ?

You can make it simpler (and save lots of bandwidth) if you define a JS
variable inside the js_generator controller with those values, depending
on current user permissions.

Modifying the app.js code then would only require checking that variable
and generating a different dialog in case it has certain values.

I think the most difficult part of this modification would be coding the
new dialog, but if you have a look at app.js to see how it generates
other dialogs you should get along fine :-)

Regards.

--
Jorge López Pérez
http://adobo.org
jabber: jor...@jabberes.org
Reply all
Reply to author
Forward
0 new messages