<!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={t}_CHARSET{/t}" />
    <meta name="robots" content="noarchive,nofollow,noindex" />

    {if (isset($calendar) && $calendar)}
    <script type="text/javascript" src="js/datepicker/js/datepicker.js"></script>
    <link href="js/datepicker/css/datepicker.css" rel="stylesheet" type="text/css">
    {/if}

    <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/AjaxRequest.js"></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}
  </head>
  <body>
    {if $menu}
    <div id="banner">
      <div id="header"><a id="logo" href="/"><img src="img/phpaga/phpaga.png" width="188" height="35" alt="phpaga" /></a><hr /></div>
      <div id="clock"> {$currtime|wash} </div>

      <div id="metanav" class="nav">
        <ul><li class="first"><a href="person.php">{$USR_NAME|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} -->
