Zum Inhalt springen

Powermail dropdown ergebnis in fremde Tabelle schreiben

Erstellt am 24. März 2015 · 2 Antworten · letzte Antwort am 25. März 2015

Tags: Powermail, Datenbank, Frage

mchenzi ·

Hallo
Habe folgendes.... Ausgeben ins Dropdown Feld geht aber speichern geht nicht

# Choose Category from Table
lib.category = COA
lib.category {
10 = TEXT
10.value = <label for="powermail_field_certified" class="powermail_label" title="">Category</label>
20 = CONTENT
20.wrap = <select class="form-control powermail_select" id="category" name="tx_powermail_pi1[category]" size="1">|</select>
20 {
table = tx_ososeamaerketplace_domain_model_producetype
select.pidInList = 43
select = orderBy = produce_category
renderObj = COA
renderObj {
10 = COA
10{
10 = TEXT
10 {
field = uid
wrap = <option value="|">
}
20 = TEXT
20 {
field = produce_category
wrap = |</option>
}
}
}
}
}

Nur das speichern geht nicht

plugin.tx_powermail.settings.setup.dbEntry.tx_ososeamaerketplace_domain_model_selling{
_enable = TEXT
_enable.value = 1
pid = TEXT
pid.value = 43

tstamp = TEXT
tstamp.data = date:U
produce = TEXT
produce.field = produce
category = TEXT
category.data = TSFE:tx_ososeamaerketplace_domain_model_producetype|sesData|powermail_2|uid2
}

powermail_2 die ID des Content Elements ist 2 und uid2 das ist das Feld in POwermail

mchenzi ·

Habe es dann doch gelöst....
HIer wird das Feld erstellt

# Choose Category from Table 
    lib.producecategory = COA
    lib.producecategory {
    		10 = TEXT
    		10.value = <label for="powermail_field_producecategory" name="tx_powermail_pi1[field][producecategory]" class="powermail_label" title="">Category</label>
    		20 = CONTENT
    		20.wrap = <select class="form-control powermail_select" id="producecategory" name="tx_powermail_pi1[field][producecategory]" size="1">|</select>
    		20 {
    			table = tx_ososeamaerketplace_domain_model_producecategory
    			select.pidInList = 43
    			select = orderBy = producecategory
    			renderObj = COA
    			renderObj {
    				10 = COA
    				10{
    					10 = TEXT
                                10 {
                                        field = uid
                                        wrap = <option value="|">
                                }
                        20 = TEXT
                        20 {
                                        field = producecategory
                                        wrap = |</option>
                                }
    				}
    			}
    		}
    }

Hier die userFunc

<?php
class user_ososea_func {
    public function implodeProduceCategory() {          
        $cats = $_POST['tx_powermail_pi1']['field']['producecategory'];
        return $cats;
    }
}
?>

und hier das schreiben in die DB

includeLibs.user_ososea_func = fileadmin/09_ts/user_ososea_func.php 
plugin.tx_powermail.settings.setup.dbEntry.tx_ososeamaerketplace_domain_model_selling{
            _enable = TEXT
            _enable.value = 1
            pid = TEXT
            pid.value = 43     
            tstamp = TEXT
            tstamp.data = date:U
            produce = TEXT
            produce.field = produce     
            producecategory = TEXT
	    producecategory {
	          preUserFunc = user_ososea_func->implodeProduceCategory
	        }
            description = TEXT
            description.field = description  
            location = TEXT
            location.field = location     
            amount = TEXT
            amount.field = amount
            until = TEXT
            until.field = until
            price = TEXT
            price.field = price  
            contactperson = TEXT
            contactperson.field = contactperson 
            contactemail = TEXT
            contactemail.field = contactemail   
            image = TEXT
            image.field = image
            feuser = TEXT
            feuser.data = TSFE:fe_user|user|uid
}

Also das geht jetzt.

Für die nachwelt. Also for the english community if you want to write into DB powermail userfunction select field external Table with Relation.