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

{literal}
<script type="text/javascript">
    $(document).ready(function() {
        $("#tab_container").tabs();
        $('#fiscmonths').change(function() { 
            m = $(this).val() - 1; // months are 0-based
            numdays = Date.getDaysInMonth(2009, m); 
            day = $('#fiscdays').val();
            $('#fiscdays').find('option').remove();
            for (i = 1; i <= numdays; i++) 
                $('#fiscdays').append('<option value="'+i+'">'+i+'<\/option>');
            $('#fiscdays').val(day);
        } );

        h = $(window).height() * 0.9;
        w = $(window).width() * 0.9;
        $(".cbox").colorbox({ iframe: true, height: h, width: w, maxHeight: h, maxWidth: w });
    });
    </script>
{/literal}

<form action="siteconfig.php" method="post" enctype="multipart/form-data">

    <input type="hidden" name="usr_id" value="0">
    <input type="hidden" name="action" value="{$smarty.const.ACTION_SAVECONFIG}">

    <h2>{t}Sitewide configuration settings{/t}</h2>

    <div id="tab_container">
        <ul class="tab_items">
            <li><a href="#cfg-letterhead" rel="cfg-letterhead">{t}Letterhead{/t}</a></li>   
            <li><a href="#cfg-finances" rel="cfg-finances">{t}Finances{/t}</a></li>   
            <li><a href="#cfg-defaultvalues" rel="cfg-defaultvalues">{t}Default values{/t}</a></li>   
            <li><a href="#cfg-layout" rel="cfg-layout">{t}Layout{/t}</a></li>   
            <li><a href="#cfg-charts" rel="cfg-charts">{t}Charts{/t}</a></li>   
            <li><a href="#cfg-pdf" rel="cfg-pdf">{t}PDF Settings{/t}</a></li>   
        </ul>

        <div id="cfg-letterhead" class="tab_content">

            <table cellspacing="0">
                <caption><em>{t}Letterhead{/t}</em></caption>
                <tr>
                    <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>
                    <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>
                    <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>
                    <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>
                    <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>
                    <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>
                    <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>
                    <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>
                    <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>
                    <td>{t}Letterhead logo{/t}</td>
                    <td>
                        {if strlen($config.LETTERHEAD_LOGO_FILE)}
                        <img src="preview.php?id=LETTERHEAD_LOGO_FILE" alt="{$config.LETTERHEAD_LOGO_FILE|wash}"/><br />
                        {$config.LETTERHEAD_LOGO_FILE|wash}<br />
                        {/if}
                        <input type="file" name="logo" class="tinput" size="40" /> 
                    </td>
                </tr>
            </table>
            <input type="submit" name="submit" value="{t}Submit{/t}"> <input type="reset" name="reset" value="{t}Reset{/t}">
        </div>

        <div id="cfg-finances" class="tab_content">
            <table cellspacing="0">
                <caption><em>{t}Finances{/t}</em></caption>
                <tr>
                    <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">
                            {html_options options=$options_months selected=$config.FIN_FISCYEAR_MONTH}
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>{t}Default currency{/t}</td>
                    <td>
                        <select name="cfgitem[DEFAULTCURRENCY]">
                            {html_options options=$options_currencies selected=$config.DEFAULTCURRENCY}
                        </select>
                    </td>
                </tr>
                <tr>
                    <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>
                    <td>{t}Default Late Fee in Percentage (e.g. 1.5){/t}</td>
                    <td><input maxlength="5" size="5" value="{$config.PHPAGA_LATE_FEE|wash}" name="cfgitem[PHPAGA_LATE_FEE]" type="text" class="tinput"></td>
                </tr>
                <tr>
                    <td>{t}Monetary Symbol{/t}</td>
                    <td>
                        <input maxlength="2" size="2" value="{$config.MONETARY_SYMBOL|wash}" name="cfgitem[MONETARY_SYMBOL]" type="text" class="tinput">
                    </td>
                </tr>
                <tr>
                    <td>{t}Show Currency Abbreviation{/t}</td>
                    <td>
                        <select name="cfgitem[SHOW_CURRENCY]">
                            {html_options options=$options_truefalse selected=$config.SHOW_CURRENCY}
                        </select>
                    </td>
                </tr>
            </table>
            <input type="submit" name="submit" value="{t}Submit{/t}"> <input type="reset" name="reset" value="{t}Reset{/t}">
        </div>

        <div id="cfg-defaultvalues" class="tab_content">

            <table cellspacing="0">
                <caption><em>{t}Default values{/t}</em></caption>
                <tr>
                    <td>{t}Default country{/t}</td>
                    <td>
                        <select name="cfgitem[DEFAULTCOUNTRY]">
                            {html_options options=$options_countries selected=$config.DEFAULTCOUNTRY}
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>{t}Default language{/t}</td>
                    <td>
                        <select name="cfgitem[DEFAULTLANGUAGE]">
                            {html_options options=$options_languages selected=$config.DEFAULTLANGUAGE}
                        </select>
                    </td>
                </tr>
                <tr>
                    <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>
            </table>
            <input type="submit" name="submit" value="{t}Submit{/t}"> <input type="reset" name="reset" value="{t}Reset{/t}">
        </div>

        <div id="cfg-layout" class="tab_content">

            <table cellspacing="0">
                <caption><em>{t}Layout{/t}</em></caption>
                <tr>
                    <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>
                    <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>
                    <td>{t}Template set name{/t}</td>
                    <td>
                        <select name="cfgitem[TEMPLATESET]">
                            {html_options options=$options_templatesets selected=$config.TEMPLATESET}
                        </select>
                    </td>
                </tr>
                <tr>
                    <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="cbox" href="help_dateformat.php">?</a> ] </td>
                </tr>
                <tr>
                    <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="cbox" href="help_dateformat.php">?</a> ] </td>
                </tr>
                <tr>
                    <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="cbox" href="help_dateformat.php?type=print">?</a> ] </td>
                </tr>
                <tr>
                    <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="cbox" href="help_dateformat.php">?</a> ] </td>
                </tr>
                <tr>
                    <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="cbox" href="help_dateformat.php">?</a> ] </td>
                </tr>
                <tr>
                    <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>
                    <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>
                    <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>
                    <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>
                    <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>
                    <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>

                <tr>
                    <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>
                    <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>
                    <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>
                    <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>
            </table>
            <input type="submit" name="submit" value="{t}Submit{/t}"> <input type="reset" name="reset" value="{t}Reset{/t}">
        </div>

        <div id="cfg-charts" class="tab_content">

            <table cellspacing="0">
                <caption><em>{t}Charts{/t}</em></caption>
                <tr>
                    <td>{t}Enable Graphviz?{/t}</td>
                    <td>
                        <select name="cfgitem[GRAPHVIZ_ENABLED]">
                            {html_options options=$options_truefalse selected=$config.GRAPHVIZ_ENABLED}
                        </select>
                    </td>
                </tr>
            </table>
            <input type="submit" name="submit" value="{t}Submit{/t}"> <input type="reset" name="reset" value="{t}Reset{/t}">
        </div>

        <div id="cfg-pdf" class="tab_content">

            <table cellspacing="0">
                <caption><em>{t}PDF Settings{/t}</em></caption>
                <tr>
                    <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>
                    <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>
                    <td>{t}An additional line you may want to add (default value){/t}</td>
                    <td><input maxlength="200" size="50" value="{$config.LETTERHEAD_ADDITIONAL_LINE|wash}" name="cfgitem[LETTERHEAD_ADDITIONAL_LINE]" type="text" class="tinput"></td>
                </tr>
                <tr>
                    <td>{t}Invoice template{/t}</td>
                    <td>
                        <select name="cfgitem[PDF_INCOICE_TPL]">
                            {html_options options=$pdfclasses.invoice selected=$config.PDF_INCOICE_TPL}
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>{t}Quotation template{/t}</td>
                    <td>
                        <select name="cfgitem[PDF_QUOTATION_TPL]">
                            {html_options options=$pdfclasses.quotation selected=$config.PDF_QUOTATION_TPL}
                        </select>
                    </td>
                </tr>
            </table>
            <input type="submit" name="submit" value="{t}Submit{/t}"> <input type="reset" name="reset" value="{t}Reset{/t}">
        </div>
    </div>

</form>

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