<!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" />
    <link rel="stylesheet" type="text/css" title="{$userskin}" media="screen, projection" href="styles/{$userskin}.css" />
    {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>
    {if (isset($calendar) && $calendar)}
    <link rel="stylesheet" type="text/css" media="screen, projection" href="_jsc/calendar-win2k-cold-1.css" />
    <script type="text/javascript" src="_jsc/calendar.js"></script>
    <script type="text/javascript" src="_jsc/lang/calendar-en.js"></script>
    <script type="text/javascript" src="_jsc/calendar-setup.js"></script>
    {/if}
    <link rel="shortcut icon" href="favicon.ico" />
  </head>
  <body>
{*    {if $menu}{include file="menu.tpl.html"}{/if} *}

{if $menu}

 <script type="text/javascript">

      var menu = new Array();

      menu["reports"] = new Array();

      menu["reports"]["main.php"] = "{t}Dashboard{/t}";
      menu["reports"]["projects_timeline.php"] = "{t}Timeline{/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}";
      {/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>

<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"> {$smarty.now|date_format:"%a %d %b %Y %H:%M"} </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="#">{t}Reports{/t}</a></li>
    <li id="navcore" onclick="setmenu('core')"><a href="#">{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="#">{t}Finance{/t}</a></li>
    {/if}
    {if phpaga_user_hasperm($smarty.const.PHPAGA_PERM_MANAGE_SYSSETTINGS)}
    <li id="navadministration" onclick="setmenu('administration')"><a href="#">{t}Administration{/t}</a></li>
    <li class="last" id="navsystem" onclick="setmenu('system')"><a href="#">{t}System{/t}</a></li>
    {/if}

  </ul>
</div>

<div id="main">

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

</div>

</div>

<div id="pagestatus"> {t}Loading...{/t} </div>

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


{/if}


<div id="content">

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