<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
{*<!-- BEGIN {$smarty.template} -->*}
<html>
  <head>
    <title>{$smarty.const.PHPAGA_SITENAME|wash|default:"phpaga"}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="robots" content="noarchive,nofollow,noindex" />

    <link type="text/css" href="js/jquery/ui/css/custom-theme/jquery-ui-1.8.4.custom.css" rel="stylesheet" />	
    <script type="text/javascript" src="js/jquery/jquery.js"></script>
    <script type="text/javascript" src="js/jquery/ui/jquery-ui-1.8.4.custom.min.js"></script>
    {if $LANG != 'en'}
    <script type="text/javascript" src="js/jquery/ui/i18n/jquery.ui.datepicker-{$LANG}.js"></script>
    {/if}
    <script type="text/javascript" src="js/jquery/jquery.sparkline.min.js"></script>

    <link rel="stylesheet" type="text/css" title="{$userskin}" media="screen, projection" href="styles/{$userskin}.css" />
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" title="IE extras" media="screen, projection" href="styles/extra/ie.css" />
    <![endif]-->
    {if (isset($skins) && is_array($skins))}
    {foreach from=$skins item=skin}
    <link rel="alternate stylesheet" type="text/css" href="styles/{$skin}.css" title="{$skin}" />
    {/foreach}
    {/if}
    <script type="text/javascript" src="js/core.js"></script>
    <script type="text/javascript" src="js/date.js"></script>

    <script language="javascript" type="text/javascript" src="js/jquery/tinytips/jquery.tinyTips.js"></script>
    <link rel="stylesheet" type="text/css" media="screen" href="js/jquery/tinytips/styles/tinyTips.css" />

    <!--[if IE]><script language="javascript" type="text/javascript" src="js/jquery/jqplot/excanvas.min.js"></script><![endif]-->
    <script language="javascript" type="text/javascript" src="js/jquery/jqplot/jquery.jqplot.min.js"></script>
    <script type="text/javascript" src="js/jquery/jqplot/plugins/jqplot.dateAxisRenderer.min.js"></script>
    <script type="text/javascript" src="js/jquery/jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>
    <script type="text/javascript" src="js/jquery/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
    <script type="text/javascript" src="js/jquery/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script>
    <script type="text/javascript" src="js/jquery/jqplot/plugins/jqplot.barRenderer.min.js"></script>
    <script type="text/javascript" src="js/jquery/jqplot/plugins/jqplot.pieRenderer.min.js"></script>
    <script type="text/javascript" src="js/jquery/jqplot/plugins/jqplot.highlighter.min.js"></script>

    <link rel="stylesheet" type="text/css" href="js/jquery/jqplot/jquery.jqplot.css" />

    <script type="text/javascript" src="js/charts.js"></script>

    <link rel="stylesheet" type="text/css" href="js/jquery/colorbox/colorbox.css" media="screen" />
    <script src="js/jquery/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>

    <link rel="shortcut icon" href="favicon.ico" />
    {if $menu}
    <script type="text/javascript">

      var menu = new Array();

      menu["reports"] = new Array();
      menu["reports"]["main.php"] = "{t}Dashboard{/t}";
      {if phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_FINANCE)}
      menu["reports"]["finances.php"] = "{t}Finances{/t}";
      menu["reports"]["summary.php"] = "{t}Summary report{/t}";
      {/if}

      menu["core"] = new Array();
      menu["core"]["projects.php"] = "{t}Projects{/t}";
      menu["core"]["operations.php"] = "{t}Tasks{/t}";
      menu["core"]["companies.php"] = "{t}Companies{/t}";
      menu["core"]["persons.php"] = "{t}Persons{/t}";
      menu["core"]["products.php"] = "{t}Products{/t}";

      {if phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_FINANCE) || phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_INVOICES) || phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_QUOTATIONS)}
      menu["finance"] = new Array();
      {if phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_FINANCE)}
      menu["finance"]["finances_unbilled.php"] = "{t}Unbilled hours{/t}";
      {/if}
      {if (phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_INVOICES) || phpaga_user_hasperm($smarty.const.PHPAGA_PERM_MANAGE_INVOICES))}
      menu["finance"]["bills.php"] = "{t}Invoices{/t}";
      menu["finance"]["recurrbills.php"] = "{t}Recurring invoices{/t}";
      {/if}
      {if (phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_QUOTATIONS) || phpaga_user_hasperm($smarty.const.PHPAGA_PERM_MANAGE_QUOTATIONS))}
      menu["finance"]["quotations.php"] = "{t}Quotations{/t}";
      {/if}
      {/if}

      {if phpaga_user_hasperm($smarty.const.PHPAGA_PERM_MANAGE_SYSSETTINGS)}
      menu["administration"] = new Array();
      menu["administration"]["siteconfig.php"] = "{t}Sitewide settings{/t}";
      menu["administration"]["countries.php"] = "{t}Countries{/t}";
      menu["administration"]["currencies.php"] = "{t}Currencies{/t}";
      menu["administration"]["cpncats.php"] = "{t}Company categories{/t}";
      menu["administration"]["jobcats.php"] = "{t}Job categories{/t}";
      menu["administration"]["opcats.php"] = "{t}Task categories{/t}";
      menu["administration"]["pecats.php"] = "{t}Person categories{/t}";
      menu["administration"]["prjcats.php"] = "{t}Project categories{/t}";
      menu["administration"]["prjstatus.php"] = "{t}Project status{/t}";
      menu["administration"]["prodcats.php"] = "{t}Product categories{/t}";
      menu["administration"]["users.php"] = "{t}Users{/t}";
      menu["administration"]["bmt_plugins.php"] = "{t}Billing plugins{/t}";
      menu["administration"]["sysinfo.php"] = "{t}Records{/t}";

      menu["system"] = new Array();
      menu["system"]["syslog.php"] = "{t}Application log{/t}";
      menu["system"]["sysinfo.php"] = "{t}System information{/t}";
      menu["system"]["dbupgrade.php"] = "{t}Database upgrade{/t}";
    {/if}
  </script>
  {/if}
  {literal}
  <script type="text/javascript">
      $(document).ready(function() { 
              var clockTimer = setInterval("clockTimerAction()",60000);
              $('.tTip').tinyTips('paga', 'title'); 
              });
  </script>
  {/literal}
  </head>
  <body>
    {if $menu}
    <div id="banner">
        <div id="header"><h1><a href="./"><span>ph</span>paga</a></h1></div>
      <div id="clock"> {$currtime|wash} </div>

      <div id="metanav" class="nav">
        <ul><li class="first"><a href="person.php">{$USR_NAME|wash} ({$USR_LOGIN|wash})</a></li>
          <li><a href="user.php">{t}Settings{/t}</a></li>
          <li class="last"><a href="./?logout" accesskey="q">{t}Log out{/t}</a></li>
        </ul>
      </div>

    </div>

    <div id="mainnav" class="nav">
      <ul id="navitems">
        <li class="first" id="navreports" onclick="setmenu('reports')"><a href="#menu">{t}Reports{/t}</a></li>
        <li id="navcore" onclick="setmenu('core')"><a href="#menu">{t}Core{/t}</a></li>
        {if phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_FINANCE) || phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_INVOICES) || phpaga_user_hasperm($smarty.const.PHPAGA_PERM_VIEW_QUOTATIONS)}
        <li id="navfinance" onclick="setmenu('finance')"><a href="#menu">{t}Finance{/t}</a></li>
        {/if}
        {if phpaga_user_hasperm($smarty.const.PHPAGA_PERM_MANAGE_SYSSETTINGS)}
        <li id="navadministration" onclick="setmenu('administration')"><a href="#menu">{t}Administration{/t}</a></li>
        <li class="last" id="navsystem" onclick="setmenu('system')"><a href="#menu">{t}System{/t}</a></li>
        {/if}

      </ul>
    </div>

    <div id="main">
      <div id="ctxtnav" class="nav">
      </div>
    </div>

    <div id="pagestatus"><span><img src="img/phpaga/loading.gif" alt="{t}Loading...{/t}">{t}Loading...{/t}</span></div>

    <script type="text/javascript">
      setmenu('{if strlen($menuitem)}{$menuitem}{else}reports{/if}');
    </script>
    {/if}

    <div id="content">
      <div id="mainsect">

<!-- END {$smarty.template} -->
