Subversion-Projekte lars-tiefland.webanos.zeldi.de

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

{extends file="index.tpl"}
{block name="maincontent"}
    <!-- $Id: index.tpl 87 2023-05-20 23:09:43Z lars $ BEGIN -->
    <button class="neu" id="vportale_0" title="neues Portal anlegen">Neues Portal anlegen</button>
    <table style="width: 100%" id="vPortale">
        <thead>
        <tr>
            <td>Name</td>
            <td>Art</td>
            <td>Aktion</td>
        </tr>
        </thead>
        <tbody>
        {foreach $salesPortals as $salesPortal}
            <tr class="{cycle values=",gerade"}">
                <td>{$salesPortal->name}</td>
                <td>{$salesPortal->sales_portal_type->type}</td>
                <td>
                    <button class="edit" id="edit_{$salesPortal->id}">Ändern</button>
                    <button class="del" id="del_{$salesPortal->id}_{$salesPortal->name}">Löschen</button>
                </td>
            </tr>
        {/foreach}
        </tbody>
    </table>
    <div id="vportale_dlg" title="Verkaufsportal ändern / hinzufügen">
    </div>
    <div id="vportale_del_dlg" style="display:none">
        Wollen Sie dieses Portal wirklich löschen?
    </div>
    <script>
        $(function (){
            $('#vPortale').dataTable({
                "language": {
                    "url": "/js/DataTables-1.10.19/German.json"
                },
                "columnDefs": [
                    { "searchable": false, "targets": [ 2 ] },
                    { "orderable": false, "targets": [ 2 ] }
                ]
            });
            $('.neu').uibutton({
                icons:{
                    primary:"ui-icon-plus"
                }
            }).click(edit_vportale);
            $('.edit').uibutton({
                icons:{
                    primary:"ui-icon-pencil"
                }
            }).click(edit_vportale);
            $('.del').uibutton({
                icons:{
                    primary:"ui-icon-trash"
                }
            }).click(del_vportale);
            $('#vportale_dlg').dialog({
                autoOpen:false,
                modal:true,
                resizable:false,
                width:700,
                buttons:{
                    "speichern": function(){
                        $('#vportale_content').load("vportale.php",$('#vportale_form').serializeArray());
                        $(this).dialog("close");
                    }
                }
            })
        });
        function edit_vportale()
        {
            let vp_id = this.id;
            vp_id = vp_id.split("_");
            vp_id = vp_id[1];
            //(vp_id);
            let url="/vportale/salesPortals/create";
            if(vp_id > 0)
            {
                url="/vportale/salesPortals/"+vp_id+"/edit";
            }
            $('#vportale_dlg').load(url).dialog("open");
        }
        function del_vportale()
        {
            let vp_id = this.id;
            vp_id = vp_id.split("_");
            let vp_name = vp_id[2];
            vp_id = vp_id[1];
            //(vp_id);
            //$('#vportale_dlg').load("vportale.php?action=del&id="+vp_id).dialog("open");
            $('#vportale_del_dlg').dialog({
                modal:true,
                width:400,
                resizable:false,
                title:"Verkaufsportal "+vp_name+" löschen",
                buttons:{
                    "Nein":function()
                    {
                        $(this).dialog("close");
                    },
                    "Ja":function()
                    {
                        $('#vportale_content').load("vportale.php?action=del&id="+vp_id);
                        $(this).dialog("close");
                    }
                }
            })
        }
    </script>
    <!-- $Id: index.tpl 87 2023-05-20 23:09:43Z lars $ END -->
{/block}