[% META title = 'device' %]

  <div id="headimg">
    <img src="/grafik/area.jpg" width="869" height="69" alt="" />
  </div>
  <div id="headtxt">Konfigurieren Sie Ihre Endgeräte.</div>
  
  <div id="main">
      
    <div id="topmsg">
        <p> [% messages.topmsg %] </p>
    </div>
    <div id="toperr">
        <p> [% messages.toperr %] </p>
        <p> [% messages.prov_error %] </p>
    </div>
 
    <div class="sperrehead"> 
        <h3>Gerätezuordnung</h3>
        <h2 class="umleitungfuer">Einstellungen für [% active_number %]</h2>
    </div>

    <div id="spalten31">
        
    <div class="spalte1">

        <div class="spalte1 content">
            
            <form class="anmelden feinstellungen">
			    <ul class="menueinstellungen">
                    <li><a href="/autosubscriber">Benutzer</a></li>
                    <li class="on"><a href="/autodevice">Endgeräte</a></li>
                </ul>
                <fieldset class="adminlistehead">
                    <p>
                        Hier können Sie Ihren Nebenstellen ein Endgerät zuordnen.
                    </p>
                </fieldset>
            </form>

            <h2>Endgerät einrichten</h2>

            <div class="einrichtunghw">
            
                <img src="/grafik/spa942.jpg" width="260" height="224" alt="" class="imgleft" />
                <div class="right">
                    <h4>Bitte tragen Sie die Mac-Adresse Ihres Telefons ein</h4>
                    <p>
                        Die Mac-Adresse ist eine Nummer und befindet sich auf der Unterseite Ihres Geräts.
                    </p>
                    <form method="post" action="/autodevice/savephone">
                        <fieldset>

                            <label for="fmac">Mac-Adresse</label>
                            <input type="text" size="20" class="input20" id="fmac" name="mac" value="[% cphone.mac %]"/><br />
                        </fieldset>
                        <fieldset>
                            <label for="fip">IP-Adresse</label>
                            <input type="text" size="20" class="input20" id="fip" name="ip" value="[% cphone.ip %]"/>
                            <br />
                        </fieldset>
                        <fieldset>
                            <label for="fdw">Durchwahl</label>
                            <select id="fdw" name="fdw" class="input20">
                                <option value="0"></option>
                                [% FOREACH subscriber IN subscribers %]
                                    [% FOREACH extension = subscriber.extensions %]
                                        [% IF extension.subscriber_id == cphone.extid %]
                                            <option value="[% extension.username %]" selected>[% extension.preferences.extension %][% " (" _ extension.autoconf_displayname _ ")" IF extension.autoconf_displayname %]</option>
                                        [% ELSIF !extension.unit %]
                                            <option value="[% extension.username %]">[% extension.preferences.extension %][% " (" _ extension.autoconf_displayname _ ")" IF extension.autoconf_displayname %]</option>
                                        [% END %]
                                    [% END %]
                                [% END %]
                            </select>

                            <br />
                        </fieldset>

                        [% IF morephones == 1 %]
                        <div class="aconflinkbold">
                            <label for="fnext">Weiteres Telefon konfigurieren</label>
                            <input type="image" class="hidden" src="/grafik/dot_trans.gif" alt="" id="fnext" name="fnext" value="1"/>
                        </div>
                        <br/>
                        oder
                        <br/>
                        [% END %]
                        <div class="aconflinkbold">
                            <label for="fdone">Konfiguration fertigstellen</label>
                            <input type="image" class="hidden" src="/grafik/dot_trans.gif" alt="" id="fdone" name="fdone" value="1"/>
                        </div>


                    </form>
                    <br clear="all" />

                </div>
            </div>


        </div>
    </div>

    <div class="spalte2">
        <table class="devlist">
        [% IF unit.model %]
            <tr>
                <td class="adminimg">
                    <img class="okprodimg" src="/grafik/ok_system.gif" width="22" height="22" alt="25" />
                </td>
                <td>
                    [% unit.mac %]
                </td>
                <td>
                    <form method="post" action="/autodevice/deldev">
                        <input type="hidden" name="duser" value="[% unit.username %]"/>
                        <input type="image" src="/grafik/delete.gif" alt="Gerät löschen" class="noborder" id="delphone[% unit.id %]" name="delphone" value="1"/>
                    </form>
                </td>
                <td>
                    <form method="post" action="/autodevice/index">
                        <input type="hidden" name="did" value="[% unit.id %]"/>
                        <input type="image" src="/grafik/edit.gif" alt="Gerät editieren" class="noborder" id="editdev[% unit.id %]" name="editdev" value="1"/>
                    </form>
                </td>
                <td>
                    <a href="http://[% unit.ip %]/admin/resync?[% unit.sync_url %]" target="_blank">
                        <img src="/grafik/schritte_ok.gif" width="22" alt="Synchronisieren" class="noborder"/>
                    </a>
                </td>
            </tr>
        [% END %]
        [% FOREACH phone IN phones %]
            <tr [% IF phone.mac == cphone.mac %]class="active" [% END %]>
                <td class="adminimg">
                    <img class="okprodimg" src="/grafik/ok_phone.gif" width="22" height="22" alt="25" />
                </td>
                <td>
                    [% phone.mac %]
                </td>
                <td>
                    <form method="post" action="/autodevice/deldev">
                        <input type="hidden" name="duser" value="[% phone.username %]"/>
                        <input type="image" src="/grafik/delete.gif" alt="Gerät löschen" class="noborder" id="delphone[% phone.id %]" name="delphone" value="1"/>
                    </form>
                </td>
                <td>
                    <form method="post" action="/autodevice/savespa">
                        <input type="hidden" name="mac" value="[% unit.mac %]"/>
                        <input type="hidden" name="ip" value="[% unit.ip%]"/>
                        <input type="hidden" name="fxs1" value="[% unit.fxs1_subscriber_id %]"/>
                        <input type="hidden" name="fxs2" value="[% unit.fxs2_subscriber_id %]"/>
                        <input type="hidden" name="fmodel" value="[% unit.model %]"/>
                        <input type="hidden" name="editid" value="[% phone.id %]"/>
                        <input type="image" src="/grafik/edit.gif" alt="Gerät editieren" class="noborder" id="editphone[% phone.id %]" name="editphone" value="1"/>
                    </form>
                </td>
                <td>
                    <a href="http://[% phone.ip %]/admin/resync?[% phone.sync_url %]" target="_blank">
                        <img src="/grafik/schritte_ok.gif" width="22" alt="Synchronisieren" class="noborder"/>
                    </a>
                </td>
            </tr>
        [% END %]
        </table>
    </div>

</div>

</div>
<br clear="all" />

