Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

    <script>
        $(function(){
            $('#add_statuscode').button({
                icons: 
                {
                    primary: "ui-icon-plus"
                }
            }).click(add_statuscode);
            $('.del_code').button({
                icons:
                {
                    primary:"ui-icon-trash"
                }
            }).click(del_code_row);
            function add_statuscode()
            {
                anz=$('.code').length;
                $('#code_table').append("<tr class='rechts code' id='code_row_"+anz+"'><td><input type='text' name='code["+anz+"][key]'></td><td><input type='text' name='code["+anz+"][value]'></td><td><input type='text' name='code["+anz+"][iamge]'><input type='hidden' name='code["+anz+"][id]' value='"+anz+"'></td><td><button class='delete' id='del_code_"+anz+"'></button></tr>");
                $('#del_code_'+anz).button({
                    icons:
                    {
                        primary:"ui-icon-trash"
                    }
                }).click(del_code_row);
                return false;         
            }
            function del_code_row()
            {
                id=this.id.split("_");
                $('#code_row_'+id[2]).remove();
                return false;
            }
        });
    </script>
    <form method="post" id="lager_form">
        <table width="100%">
            <tr>
                <td class="links">Name</td>
                <td class="rechts">
                    <input type="text" name="l_name" value="{$lager.name}" id="f_l_name">
                </td>
            </tr>
            <tr>
                <td class="links">Rang</td>
                <td class="rechts">
                    <input type="text" name="l_rang" id="f_l_rang" value="{$lager.rang}">
                </td>
            </tr>
            <tr>
                <td class="links">Artikel bestellbar?</td>
                <td>
                    <input type="hidden" name="l_id" value="{$lager.id}" id="f_l_id">
                    <input type="hidden" name="l_lieferant_id" value="{$lager.lieferanten_id}">
                    <input type="hidden" name="l_bestellbar" value="0">
                    <input type="checkbox" name="l_bestellbar" value="1" id="f_l_bestellbar" {if $lager.bestellbar==1}checked="checked"{/if}>
                </td>
            </tr>
            {if isset($user_rechte.bestellwesen.lieferanten.verf_codes)}
            <tr>
                <td class="links">Verfügbarkeits-Codes:</td>
                <td class="rechts">
                    <table width="100%" id="code_table">
                        <tr class="links">
                            <td>Code</td>
                            <td>enstrpicht-Text</td>
                            <td>Bildnummer</td>
                            <td>
                                <button id="add_statuscode"></button>
                            </td>
                        </tr>
                        {section loop=$lager.verf_codes name=c_ind}
                        <tr class="rechts code" id="code_row_{$lager.verf_codes[c_ind].id}">
                            <td>
                                <input type="text" name="code[{$lager.verf_codes[c_ind].id}][key]" value="{$lager.verf_codes[c_ind].key}">
                            </td>
                            <td>
                                <input type="text" name="code[{$lager.verf_codes[c_ind].id}][value]" value="{$lager.verf_codes[c_ind].value}">
                            </td>
                            <td>
                                <input type="text" name="code[{$lager.verf_codes[c_ind].id}][image]" value="{$lager.verf_codes[c_ind].image}">
                                <input type="hidden" name="code[{$lager.verf_codes[c_ind].id}][id]" value="{$lager.verf_codes[c_ind].id}">
                            </td>
                            <td>
                                <button id="delete_code_{$lager.verf_codes[c_ind].id}" class="del_code"></button>
                            </td>
                        </tr>
                        {sectionelse}
                        <tr class="rechts code">
                            <td>
                                <input type="text" name="code[0][key]" value="0">
                            </td>
                            <td>
                                <input type="text" name="code[0][value]">
                            </td>
                            <td>
                                <input type="text" name="code[0][image]" value="0">
                                <input type="hidden" name="code[0][id]" value="0">
                            </td>
                        </tr>
                        {/section}
                    </table>
                </td>
            </tr>
            {/if}
        </table>
        <input type="hidden" name="mode" value="{if $lager.id}update{else}save{/if}">
    </form>