<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/5.2/engine/Shopware/Components/Plugin/schema/config.xsd">
    <label>Automatic PDF creation (and/or sending)</label>
    <label lang="de">Automatische PDFs Erstellung (und/oder Versand)</label>
    <label lang="fr">Création (et/ou envoi) automatique de PDFs</label>
    <elements>

        <element type="button">
            <name>WeloAutomaticCreated</name>
            <label><![CDATA[<b>Documents that should be created</b>]]></label>
            <label lang="de"><![CDATA[<b>Dokumente, die erstellt werden sollen</b>]]></label>
            <label lang="fr"><![CDATA[<b>Documents à créer</b>]]></label>
        </element>

        <element type="textarea" scope="shop">
            <name>WeloAutomaticDocumentsCreate</name>
            <label>Names of the documents (one line per entry)</label>
            <label lang="de">Namen der Dokumente (eine Zeile pro Eingabe)</label>
            <label lang="fr">Noms des documents (une ligne par entrée)</label>
            <value>Rechnung
Lieferschein
Gutschrift
Stornorechnung
            </value>
            <description>Just type the names of the documents you want to be created.</description>
            <description lang="de">Nur Namen der zu erstellten Dokumenten eingeben.</description>
        </element>

        <element type="button">
            <name>WeloAutomaticSent</name>
            <label><![CDATA[<b>Documents that should be created and sent</b>]]></label>
            <label lang="de"><![CDATA[<b>Dokumente, die erstellt und gesendet werden sollen</b>]]></label>
            <label lang="fr"><![CDATA[<b>Documents à créer et à envoyer</b>]]></label>
        </element>

        <element type="textarea" scope="shop">
            <name>WeloAutomaticDocumentsSend</name>
            <label>Names of the documents (one line per entry)</label>
            <label lang="de">Namen der Dokumente (eine Zeile pro Eingabe)</label>
            <label lang="fr">Noms des documents (une ligne par entrée)</label>
            <value>Rechnung
Lieferschein
Gutschrift
Stornorechnung
            </value>
            <description>Just type the names of the documents you want to be created.</description>
            <description lang="de">Nur Namen der zu erstellten Dokumenten eingeben.</description>
        </element>
        <element type="button">
            <name>WeloAutomaticAttributes</name>
            <label><![CDATA[<b>Attributes that should be displayed on the documents</b>]]></label>
            <label lang="de"><![CDATA[<b>Attribute, die auf Dokumente angezeigt werden sollen</b>]]></label>
            <label lang="fr"><![CDATA[<b>Attributs à afficher sur les documents</b>]]></label>
        </element>

        <element type="combo" scope="shop">
            <name>WeloAutomaticDocumentsAttributes</name>
            <label>Choose the attributes</label>
            <label lang="de">Attribute auswählen</label>
            <label lang="fr">Sélectionnez les attributs</label>
            <store><![CDATA[Ext.define('Welo.WeloAutomaticDocuments.Documents', {
                extend: 'Ext.data.Store',
                fields: [
                    { name:'id', type: 'int' },
                    { name:'columnName', type: 'string' }
                ],
                autoLoad: true,
                pageSize: 25,
                proxy: {
                    type: 'ajax',
                    url: window.location.href.substr(0, window.location.href.indexOf('backend')) + 'backend/AttributeData/list?raw=1&table=s_articles_attributes',
                    reader: {
                        type: 'json',
                        root: 'data',
                        totalProperty: 'total'
                    }
                }
                }).create();//new ]]>
            </store>
            <options>
                <multiSelect>true</multiSelect>
                <valueField>columnName</valueField>
                <displayField>columnName</displayField>
            </options>
        </element>

        <element type="combo" scope="shop">
            <name>WeloAutomaticDocumentsAttributeLimit</name>
            <label>Choose the attribute</label>
            <label lang="de">Attribut auswählen</label>
            <label lang="fr">Sélectionnez l'attribut</label>
            <description lang="de">
                <![CDATA[
                    Dieses Attribut wird verwendet, um die Generierung von Dokumenten einzuschränken.
                    Das Attribut enthält durch Kommas getrennte Dokument-IDs.
                ]]>
            </description>
            <description lang="en">
                <![CDATA[
                    This attribute is used to restrict the generation of documents.
                    The attribute contains comma separated document IDs.
                ]]>
            </description>
            <description lang="fr">
                <![CDATA[
                    Cet attribut est utilisé pour restreindre la génération de documents.
                    L'attribut contient les identifiants de document séparés par des virgules.
                ]]>
            </description>
            <store><![CDATA[Ext.define('Welo.WeloAutomaticDocuments.Documents', {
                extend: 'Ext.data.Store',
                fields: [
                    { name:'id', type: 'int' },
                    { name:'columnName', type: 'string' }
                ],
                autoLoad: true,
                pageSize: 25,
                proxy: {
                    type: 'ajax',
                    url: window.location.href.substr(0, window.location.href.indexOf('backend')) + 'backend/AttributeData/list?raw=1&table=s_order_attributes',
                    reader: {
                        type: 'json',
                        root: 'data',
                        totalProperty: 'total'
                    }
                }
                }).create();//new ]]>
            </store>
            <options>
                <valueField>columnName</valueField>
                <displayField>columnName</displayField>
            </options>
        </element>
    </elements>
</config>

