Include acl.inc in default.php day/week view

mbrinson wrote on Wednesday, September 20, 2006:

Rod, or anyone else who may know:

Is there a special syntax you need to use when including a file such as acl.inc in the default.php day/week view files?
I’ve tried including it through the smarty template method [-include file="/openemr/library/acl.inc"-] and within the [-php-] section with include_once() but in both cases when I make a call to acl_check() I get a “call to undefined function”

Any help?

Thanks.

sunsetsystems wrote on Thursday, September 21, 2006:

You might check your php log and make sure the include worked.  If I recall correctly you can use "require" instead to cause an error if it does not.

However, you should avoid putting things in the template that could be put into the controller code instead.

Rod
www.sunsetsystems.com

mbrinson wrote on Thursday, September 21, 2006:

I’m sorry to be a nuisance, but would you mind elaborating a little on the controller code?
I’m not familiar with that part yet and how it interfaces with the template for the calendar.

IE: What would be the best method for including the acl.inc in the controller code so that I could, for example, have a permission based on phpgacl that would make the IN, LUNCH, and OUT links not clickable (remove the <a> </a> in code for the template) so that unauthorized users couldn’t accidentally change those events and screw up the calendar.
I just need to be able to make a call to acl_check() from within the template.
What’s the best way to include that in the controller code?