Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
{extends file="index.tpl"}
2
{block name="maincontent"}
3
    <!-- $Id: index.tpl 87 2023-05-20 23:09:43Z lars $ BEGIN -->
4
    <button class="neu" id="vportale_0" title="neues Portal anlegen">Neues Portal anlegen</button>
5
    <table style="width: 100%" id="vPortale">
6
        <thead>
7
        <tr>
8
            <td>Name</td>
9
            <td>Art</td>
10
            <td>Aktion</td>
11
        </tr>
12
        </thead>
13
        <tbody>
14
        {foreach $salesPortals as $salesPortal}
15
            <tr class="{cycle values=",gerade"}">
16
                <td>{$salesPortal->name}</td>
17
                <td>{$salesPortal->sales_portal_type->type}</td>
18
                <td>
19
                    <button class="edit" id="edit_{$salesPortal->id}">Ändern</button>
20
                    <button class="del" id="del_{$salesPortal->id}_{$salesPortal->name}">Löschen</button>
21
                </td>
22
            </tr>
23
        {/foreach}
24
        </tbody>
25
    </table>
26
    <div id="vportale_dlg" title="Verkaufsportal ändern / hinzufügen">
27
    </div>
28
    <div id="vportale_del_dlg" style="display:none">
29
        Wollen Sie dieses Portal wirklich löschen?
30
    </div>
31
    <script>
32
        $(function (){
33
            $('#vPortale').dataTable({
34
                "language": {
35
                    "url": "/js/DataTables-1.10.19/German.json"
36
                },
37
                "columnDefs": [
38
                    { "searchable": false, "targets": [ 2 ] },
39
                    { "orderable": false, "targets": [ 2 ] }
40
                ]
41
            });
42
            $('.neu').uibutton({
43
                icons:{
44
                    primary:"ui-icon-plus"
45
                }
46
            }).click(edit_vportale);
47
            $('.edit').uibutton({
48
                icons:{
49
                    primary:"ui-icon-pencil"
50
                }
51
            }).click(edit_vportale);
52
            $('.del').uibutton({
53
                icons:{
54
                    primary:"ui-icon-trash"
55
                }
56
            }).click(del_vportale);
57
            $('#vportale_dlg').dialog({
58
                autoOpen:false,
59
                modal:true,
60
                resizable:false,
61
                width:700,
62
                buttons:{
63
                    "speichern": function(){
64
                        $('#vportale_content').load("vportale.php",$('#vportale_form').serializeArray());
65
                        $(this).dialog("close");
66
                    }
67
                }
68
            })
69
        });
70
        function edit_vportale()
71
        {
72
            let vp_id = this.id;
73
            vp_id = vp_id.split("_");
74
            vp_id = vp_id[1];
75
            //(vp_id);
76
            let url="/vportale/salesPortals/create";
77
            if(vp_id > 0)
78
            {
79
                url="/vportale/salesPortals/"+vp_id+"/edit";
80
            }
81
            $('#vportale_dlg').load(url).dialog("open");
82
        }
83
        function del_vportale()
84
        {
85
            let vp_id = this.id;
86
            vp_id = vp_id.split("_");
87
            let vp_name = vp_id[2];
88
            vp_id = vp_id[1];
89
            //(vp_id);
90
            //$('#vportale_dlg').load("vportale.php?action=del&id="+vp_id).dialog("open");
91
            $('#vportale_del_dlg').dialog({
92
                modal:true,
93
                width:400,
94
                resizable:false,
95
                title:"Verkaufsportal "+vp_name+" löschen",
96
                buttons:{
97
                    "Nein":function()
98
                    {
99
                        $(this).dialog("close");
100
                    },
101
                    "Ja":function()
102
                    {
103
                        $('#vportale_content').load("vportale.php?action=del&id="+vp_id);
104
                        $(this).dialog("close");
105
                    }
106
                }
107
            })
108
        }
109
    </script>
110
    <!-- $Id: index.tpl 87 2023-05-20 23:09:43Z lars $ END -->
111
{/block}