Page 1 of 1

Problem with dashboard

PostPosted: Sun Oct 17, 2010 1:12 pm
by jbrnz
I have a dashboard for a site I am building. I used the tutorial page on the site to set it up.

I have creating dashboards for different apps before, but have never had this problem:

the dashboard.html template will not show I just get a blank main_column when the table is loaded after login.

Table delegate:
Code: Select all
class tables_dashboard {
        function getPermissions(&$record){
        if ( getUser() ){
            return Dataface_PermissionsTool::ALL();
        }
        return null;
    }


Application delegate:
Code: Select all
function beforeHandleRequest(){
        $app =& Dataface_Application::getInstance();
        $query =& $app->getQuery();
    if ( $query['-table'] == 'dashboard' and ($query['-action'] == 'browse' or $query['-action'] == 'list') ){
        $query['-action'] == 'dashboard';
        }
    }


Actions:
Code: Select all
class actions_dashboard {
    function handle(&$params){
        df_display(array('Contacts'=>$Contacts), 'dashboard.html');
    }


I have the default_action=find in my conf.ini and in my actions.ini

[dashboard]
permission=view

Any suggestions for what might be the problem

Thanks

Re: Problem with dashboard

PostPosted: Thu Oct 21, 2010 9:31 am
by shannah
You've posted everything except dashboard.html file. Most likely you have a type on the name of the fill_slot tag in there... but can't say for sure unless I saw it.

Re: Problem with dashboard

PostPosted: Fri Oct 22, 2010 9:14 pm
by jbrnz
I new I forgot something

Code: Select all
{use_macro file="Dataface_Main_Template.html"}
    {fill_slot name="main_column"}
        <h1>ContactManager</h1>
       
        <p>
            <ul>
                <li><img src="{$ENV.DATAFACE_URL}/images/add_icon.gif"/>
                    <a href="{$ENV.DATAFACE_SITE_HREF}?-table=Contacts&-action=new">
                        Create New Contact</a>
                </li>
                <li><img src="{$ENV.DATAFACE_URL}/images/edit.gif"/>
                   Edit existing contacts:
                   <select onchange="window.location.href=this.options[this.selectedIndex].value">
                    <option value="">Select ...</option>
                    {foreach from=$Contacts item=Contact}
                        <option value="{$Contacts->getURL('-action=edit')}">
                            {$Contacts->getTitle()}
                        </option>
                   
                    {/foreach}
                </select>
                </li>               
            </ul>
    {/fill_slot}
{/use_macro}


I also forgot that before I uploaded the table delegate for the dashboard I added another function to the dashboard.php table delegate to output some html on the page. Would this have any impact on the template?

additional function in table delegate:
Code: Select all
function block__before_left_column(){
        echo '
      my html
      ';
    }


thank you

Re: Problem with dashboard

PostPosted: Fri Oct 22, 2010 9:15 pm
by jbrnz
I new I forgot something

Code: Select all
{use_macro file="Dataface_Main_Template.html"}
    {fill_slot name="main_column"}
        <h1>ContactManager</h1>
       
        <p>
            <ul>
                <li><img src="{$ENV.DATAFACE_URL}/images/add_icon.gif"/>
                    <a href="{$ENV.DATAFACE_SITE_HREF}?-table=Contacts&-action=new">
                        Create New Contact</a>
                </li>
                <li><img src="{$ENV.DATAFACE_URL}/images/edit.gif"/>
                   Edit existing contacts:
                   <select onchange="window.location.href=this.options[this.selectedIndex].value">
                    <option value="">Select ...</option>
                    {foreach from=$Contacts item=Contact}
                        <option value="{$Contacts->getURL('-action=edit')}">
                            {$Contacts->getTitle()}
                        </option>
                   
                    {/foreach}
                </select>
                </li>               
            </ul>
    {/fill_slot}
{/use_macro}


I also forgot that before I uploaded the table delegate for the dashboard I added another function to the dashboard.php table delegate to output some html on the page. Would this have any impact on the template?

additional function in table delegate:
Code: Select all
function block__before_left_column(){
        echo '
      my html
      ';
    }


thank you

Re: Problem with dashboard

PostPosted: Fri Oct 22, 2010 9:55 pm
by shannah
You may want to check your error log. It is possible that it is running into an error somewhere inside your template and is just crapping out. Do you see the footer? or just the header?

Re: Problem with dashboard

PostPosted: Fri Oct 22, 2010 10:28 pm
by jbrnz
Everything shows up except the dashboard.html template for the main column. Everything except for the main column template.

I checked my error log and I did have some authentication tool errors all referring to the same line of code. I had to restart apache and remove the dashboard, so my log is empty currently, but I will try it again to see what shows up.

Just out of curiosity, and because I have users who are restricted to readonly access and I may not have logged in as admin as I think about it, should I change the:

Code: Select all
function getPermissions(&$record){
        if ( getUser() ){
            return Dataface_PermissionsTool::ALL();
        }
        return null;
    }


to something else in order to let admin and readonly users access the dashboard the same way? I have not had any trouble with permissions using a dashboard in the past, but I am curious. I will keep digging.

Thanks