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

<script type="text/javascript" src="js/siteconfig.js"></script>
<script type="text/javascript" src="js/ColorPicker2.js"></script>
<script type="text/javascript">
  var cp = new ColorPicker('window'); // Popup window
  var cp2 = new ColorPicker(); // DIV style
</script>

<form action="siteconfig.php" method="post">

{if $admin}
<input type="hidden" name="usr_id" value="0">
{else}
<input type="hidden" name="usr_id" value="{$usr_id}">
{/if}
<input type="hidden" name="action" value="{$smarty.const.ACTION_SAVECONFIG}">
<input type="submit" name="submit" value="{t}Submit{/t}"> <input type="reset" name="reset" value="{t}Reset{/t}">

<table class="stdtable" cellspacing="0" width="80%">

  <caption><em>{if $admin}{t}Sitewide configuration settings{/t}{else}{t}Configuration settings{/t}{/if}</em></caption>

  {if $admin}

  <tr><th colspan="2" class="clhead">{t}Letterhead{/t}</th></tr>

  <tr class="{cycle values="odd,even"}">
    <td>{t}Company name{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LETTERHEAD_COMPANY_NAME|wash}" name="cfgitem[LETTERHEAD_COMPANY_NAME]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td valign="top">{t}Location{/t}</td>
    <td><textarea cols="33" rows="3" name="cfgitem[LETTERHEAD_COMPANY_FULLLOCATION]">{$config.LETTERHEAD_COMPANY_FULLLOCATION|wash}</textarea></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Street address{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LETTERHEAD_COMPANY_STREET|wash}" name="cfgitem[LETTERHEAD_COMPANY_STREET]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}City name, needed for the bill's location and date line{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LETTERHEAD_COMPANY_CITY|wash}" name="cfgitem[LETTERHEAD_COMPANY_CITY]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Phone number{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LETTERHEAD_COMPANY_PHONE|wash}" name="cfgitem[LETTERHEAD_COMPANY_PHONE]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Email address{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LETTERHEAD_COMPANY_EMAIL|wash}" name="cfgitem[LETTERHEAD_COMPANY_EMAIL]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Full company tax number with prefix, e.g. P.IVA 00110022003{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LETTERHEAD_COMPANY_TAXNR|wash}" name="cfgitem[LETTERHEAD_COMPANY_TAXNR]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Company owner's personal tax numer with prefix, e.g. Cod. fisc. ABCZYX00A11B123C{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LETTERHEAD_OWNER_PERSONALTAXNR|wash}" name="cfgitem[LETTERHEAD_OWNER_PERSONALTAXNR]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Footer line, useful e.g. for bank account numbers{/t}</td>
    <td><input maxlength="200" size="50" value="{$config.LETTERHEAD_FOOTER|wash}" name="cfgitem[LETTERHEAD_FOOTER]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Full path to the company logo file{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LETTERHEAD_LOGO_FILE|wash}" name="cfgitem[LETTERHEAD_LOGO_FILE]" type="text" class="tinput"></td>
  </tr>

  <tr><th colspan="2" class="cfinance">{t}Finances{/t}</th></tr>

  <tr class="{cycle values="odd,even"}">
    <td>{t}Fiscal year starts on {/t}</td>
    <td>
      <select name="cfgitem[FIN_FISCYEAR_DAY]" id="fiscdays">
        {html_options options=$options_days selected=$config.FIN_FISCYEAR_DAY}
      </select>

       <select name="cfgitem[FIN_FISCYEAR_MONTH]" id="fiscmonths" onChange="getMonthDays();">
        {html_options options=$options_months selected=$config.FIN_FISCYEAR_MONTH}
      </select>
    </td>
  </tr>

  <tr><th colspan="4" class="cdefault">{t}Default values{/t}</th></tr>

  <tr class="{cycle values="odd,even"}">
    <td>{t}Default country{/t}</td>
    <td>
      <select name="cfgitem[DEFAULTCOUNTRY]">
        {html_options options=$options_countries selected=$config.DEFAULTCOUNTRY}
      </select>
    </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Default currency{/t}</td>
    <td>
      <select name="cfgitem[DEFAULTCURRENCY]">
        {html_options options=$options_currencies selected=$config.DEFAULTCURRENCY}
      </select>
    </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Default language{/t}</td>
    <td>
      <select name="cfgitem[DEFAULTLANGUAGE]">
        {html_options options=$options_languages selected=$config.DEFAULTLANGUAGE}
      </select>
    </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Default billing method plugin{/t}</td>
    <td>
      <select name="cfgitem[DEFAULTBMT]">
        {html_options options=$options_bmt selected=$config.DEFAULTBMT}
      </select>
    </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Default selected project status in dashboard{/t}</td>
    <td>
      <select name="cfgitem[MAIN_SHOW_PRJSTAT]">
        {html_options options=$options_prjstat selected=$config.MAIN_SHOW_PRJSTAT}
      </select>
    </td>
  </tr>

  {/if}

  <tr><th colspan="2" class="clayout">{t}Layout{/t}</th></tr>

  {if $admin}

  <tr class="{cycle values="odd,even"}">
    <td>{t}Site name{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.SITENAME|wash}" name="cfgitem[SITENAME]" type="text" class="tinput"> </td>
  </tr>

  <tr class="{cycle values="odd,even"}">
    <td>{t}Default stylesheet (css) for new users{/t}</td>
    <td>
      <select name="cfgitem[DEFAULT_SKIN]">
        {html_options options=$options_styles selected=$config.DEFAULT_SKIN}
      </select>
    </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Template set name{/t}</td>
    <td>
      <select name="cfgitem[TEMPLATESET]">
        {html_options options=$options_templatesets selected=$config.TEMPLATESET}
      </select>
    </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Display date format (short){/t}</td>
    <td><input maxlength="100" size="50" value="{$config.DATEFORMAT_SHORT|wash}" name="cfgitem[DATEFORMAT_SHORT]" type="text" class="tinput"> [ <a class="ptr" onclick="openwindow('help_dateformat.php')">?</a> ] </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Display date format (long){/t}</td>
    <td><input maxlength="100" size="50" value="{$config.DATEFORMAT_LONG|wash}" name="cfgitem[DATEFORMAT_LONG]" type="text" class="tinput"> [ <a class="ptr" onclick="openwindow('help_dateformat.php')">?</a> ] </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Print date format{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.DATEFORMAT_PRINT|wash}" name="cfgitem[DATEFORMAT_PRINT]" type="text" class="tinput"> [ <a class="ptr" onclick="openwindow('help_dateformat.php?type=print')">?</a> ] </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Display date format (short, time included){/t}</td>
    <td><input maxlength="100" size="50" value="{$config.DATETIMEFORMAT_SHORT|wash}" name="cfgitem[DATETIMEFORMAT_SHORT]" type="text" class="tinput"> [ <a class="ptr" onclick="openwindow('help_dateformat.php')">?</a> ] </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Display date format (long, time included){/t}</td>
    <td><input maxlength="100" size="50" value="{$config.DATETIMEFORMAT_LONG|wash}" name="cfgitem[DATETIMEFORMAT_LONG]" type="text" class="tinput"> [ <a class="ptr" onclick="openwindow('help_dateformat.php')">?</a> ] </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Person's name format for display{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.PENAME_FORMAT|wash}" name="cfgitem[PENAME_FORMAT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Short location format{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.SHORTLOCATION_FORMAT|wash}" name="cfgitem[SHORTLOCATION_FORMAT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Long location format{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.LOCATION_FORMAT|wash}" name="cfgitem[LOCATION_FORMAT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Separator for thousands{/t}</td>
    <td><input maxlength="1" size="1" value="{$config.SEPARATOR_THOUSANDS|wash}" name="cfgitem[SEPARATOR_THOUSANDS]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Separator for decimals{/t}</td>
    <td><input maxlength="1" size="1" value="{$config.SEPARATOR_DECIMALS|wash}" name="cfgitem[SEPARATOR_DECIMALS]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Number of last tasks to be displayed on the summary page{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.SHOWLASTOPERATIONS|wash}" name="cfgitem[SHOWLASTOPERATIONS]" type="text" class="tinput"></td>
  </tr>

  {/if}

  <tr class="{cycle values="odd,even"}">
    <td>{t}Number of records shown per page{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.RECORDS_PERPAGE|wash}" name="cfgitem[RECORDS_PERPAGE]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Maximum number of characters of the task description to be displayed{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.SHOWOPDESCLENGHT|wash}" name="cfgitem[SHOWOPDESCLENGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Maximum number of characters of the task category title to be displayed in lists{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.SHOWOPCATTITLELENGHT|wash}" name="cfgitem[SHOWOPCATTITLELENGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Maximum number of characters of the project title to be displayed in lists{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.SHOWPRJTITLELENGHT|wash}" name="cfgitem[SHOWPRJTITLELENGHT]" type="text" class="tinput"></td>
  </tr>

  {if $admin}

  <tr><th colspan="2" class="cchart">{t}Charts{/t}</th></tr>

  <tr class="{cycle values="odd,even"}">
    <td>{t}Enable Graphviz?{/t}</td>
    <td>
      <select name="cfgitem[GRAPHVIZ_ENABLED]">
        {html_options options=$options_truefalse selected=$config.GRAPHVIZ_ENABLED}
      </select>
    </td>
  </tr>
{*
  <tr class="{cycle values="odd,even"}">
    <td>{t}Image format for plots/graphs {/t}</td>
    <td>
      <select name="cfgitem[IMAGETYPE]">
        {html_options options=$options_imagetypes selected=$config.IMAGETYPE}
      </select>
    </td>
  </tr>
*}

  <tr class="{cycle values="odd,even"}">
    <td>{t}Pie graph style{/t}</td>
    <td>
      <select name="cfgitem[GRAPH_OPCAT_STYLE]">
        {html_options options=$options_graphstyle selected=$config.GRAPH_OPCAT_STYLE}
      </select>
    </td>
  </tr>

  <tr class="{cycle values="odd,even"}">
    <td>{t}Graphs: width for screen output{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.GRAPH_WIDTH|wash}" name="cfgitem[GRAPH_WIDTH]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Graphs: height for screen output{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.GRAPH_HEIGHT|wash}" name="cfgitem[GRAPH_HEIGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Manhours: large graph width{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.MHRSGRAPH_WIDTH|wash}" name="cfgitem[MHRSGRAPH_WIDTH]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Manhours: large graph height{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.MHRSGRAPH_HEIGHT|wash}" name="cfgitem[MHRSGRAPH_HEIGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Manhours: small graph width{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.MHRSGRAPH_SMALL_WIDTH|wash}" name="cfgitem[MHRSGRAPH_SMALL_WIDTH]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Manhours: small graph height{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.MHRSGRAPH_SMALL_HEIGHT|wash}" name="cfgitem[MHRSGRAPH_SMALL_HEIGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Average work time per person per week (in hours){/t}</td>
    <td><input maxlength="3" size="3" value="{$config.MHRSGRAPH_WEEKLY_AVG_HOURS|wash}" name="cfgitem[MHRSGRAPH_WEEKLY_AVG_HOURS]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Line color for the average work time in the manhours graph (leave empty to disable){/t}</td>
    <td>
      <input id="colpick" maxlength="15" size="15" value="{$config.MHRSGRAPH_WEEKLY_AVG_LINECOLOR|wash}" name="cfgitem[MHRSGRAPH_WEEKLY_AVG_LINECOLOR]" type="text" class="tinput">
      <a href="#menu" onclick="cp2.select(document.getElementById('colpick'),'pick2');return false;" name="pick2" id="pick2">{t}pick{/t}</a>
    </td>
  </tr>

{*
  <tr class="{cycle values="odd,even"}">
    <td>{t}Pie graph angle (in degrees){/t}</td>
    <td><input maxlength="4" size="4" value="{$config.GRAPH_OPCAT_ANGLE|wash}" name="cfgitem[GRAPH_OPCAT_ANGLE]" type="text" class="tinput"></td>
  </tr>
*}
  <tr class="{cycle values="odd,even"}">
    <td>{t}Finances graph: width{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.FINGRAPH_WIDTH|wash}" name="cfgitem[FINGRAPH_WIDTH]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Finances graph: height{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.FINGRAPH_HEIGHT|wash}" name="cfgitem[FINGRAPH_HEIGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Company name: max. number of characters displayed in a graph{/t}</td>
    <td><input maxlength="4" size="4" value="{$config.GRAPHSHOWCPNNAMELENGHT|wash}" name="cfgitem[GRAPHSHOWCPNNAMELENGHT]" type="text" class="tinput"></td>
  </tr>

  <tr><th colspan="2" class="cpdf">{t}PDF Settings{/t}</th></tr>

  <tr class="{cycle values="odd,even"}">
    <td>{t}PDF page format{/t}</td>
    <td>
      <select name="cfgitem[PDF_DOCFORMAT]">
        {html_options options=$options_pdfpageformat selected=$config.PDF_DOCFORMAT}
      </select>
    </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}PDF document header font size{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDF_FONT_SIZE_HEADER|wash}" name="cfgitem[PDF_FONT_SIZE_HEADER]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}PDF document normal font size{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDF_FONT_SIZE_NORMAL|wash}" name="cfgitem[PDF_FONT_SIZE_NORMAL]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}PDF document small font size{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDF_FONT_SIZE_SMALL|wash}" name="cfgitem[PDF_FONT_SIZE_SMALL]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Print letterhead by default?{/t}</td>
    <td>
      <select name="cfgitem[PDF_PRINT_LETTERHEAD_DEFAULT]">
        {html_options options=$options_truefalse selected=$config.PDF_PRINT_LETTERHEAD_DEFAULT}
      </select>
    </td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Invoice header,  e.g. Invoice 5 / 08-08-2002{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.BILL_PDF_HEADER|wash}" name="cfgitem[BILL_PDF_HEADER]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Quotation number 3 from 07-07-2002{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.QUOTATION_PDF_HEADER|wash}" name="cfgitem[QUOTATION_PDF_HEADER]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Default quotation footer{/t}</td>
    <td><input maxlength="100" size="50" value="{$config.QUOTATION_PDF_FOOTER|wash}" name="cfgitem[QUOTATION_PDF_FOOTER]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Task description: max. number of characters per line in a pdf document{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDFSHOWOPDESCLENGHT|wash}" name="cfgitem[PDFSHOWOPDESCLENGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Invoice description: max. number of characters per line in a pdf document{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDFSHOWBILLDESCLENGHT|wash}" name="cfgitem[PDFSHOWBILLDESCLENGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Quotation description: max. number of characters per line in a pdf document{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDFSHOWQUOTATIONDESCLENGHT|wash}" name="cfgitem[PDFSHOWQUOTATIONDESCLENGHT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Width of the company logo in the PDF file{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDF_LOGOWIDTH|wash}" name="cfgitem[PDF_LOGOWIDTH]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}PDF document left border{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDF_BORDER_LEFT|wash}" name="cfgitem[PDF_BORDER_LEFT]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}PDF document top border{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.PDF_BORDER_TOP|wash}" name="cfgitem[PDF_BORDER_TOP]" type="text" class="tinput"></td>
  </tr>
{*
  <tr class="{cycle values="odd,even"}">
    <td>{t}Graphs: width for PDF output{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.GRAPH_PDF_WIDTH|wash}" name="cfgitem[GRAPH_PDF_WIDTH]" type="text" class="tinput"></td>
  </tr>
  <tr class="{cycle values="odd,even"}">
    <td>{t}Graphs: height for PDF output{/t}</td>
    <td><input maxlength="6" size="6" value="{$config.GRAPH_PDF_HEIGHT|wash}" name="cfgitem[GRAPH_PDF_HEIGHT]" type="text" class="tinput"></td>
  </tr>
*}
  {/if}

</table>

<input type="submit" name="submit" value="{t}Submit{/t}"> <input type="reset" name="reset" value="{t}Reset{/t}">

</form>
<script type="text/javascript">cp.writeDiv()</script>

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