2012-08-28 42 views
1

選擇與Typo腳本我有這個條件:與條件

[globalVar = TSFE:fe_user|sesData|get_car = Katowice] 
    get_carpid = TEXT 
    get_carpid.value = 27 
[global] 

而這個選擇:

plugin.Tx_Formhandler.settings.predef.formhandler-multistep-forms.markers.input_readonly_a_price = CONTENT 
plugin.Tx_Formhandler.settings.predef.formhandler-multistep-forms.markers.input_readonly_a_price { 
      table = tx_pricelist_prices_full 
      select { 
       pidInList = 27 
       orderBy = uid 
       selectFields = uid, group_a_1_3 
       # possible conditions 
       where = (tx_pricelist_prices_full.uid='1' AND hidden='0' AND deleted='0') 
      } 
      renderObj = COA 
      renderObj { 
       #value 
       1 = TEXT 
       1.insertData = 1 
       1.data = field:group_a_1_3 
       2 = TEXT 
       2.value = * 
       3 = TEXT 
       3.insertData = 1 
       3.data = TSFE:fe_user|sesData|finish_day   
       stdWrap.prioriCalc = 1 
      } 
} 

如何使用定義get_carpid在SELECT符合pidInList = get_carpid

感謝您的任何幫幫我!

回答

1

您可以創建一個cObject CASE。但這隻會對工作[A-ZA-Z0-9_-]

# TS Setup 
... snip ... 
pidInList.cObject = CASE 
pidInList.cObject { 
    key.data = TSFE:fe_user|sesData|get_car 
    key.case = lower 
    default = TEXT 
    default.value = 0 

    # special chars are not allowed 
    katowice = TEXT 
    katowice.value = 27 
} 
... snip ... 

不同的可能性是使用常量:

# TS Constants 
[globalVar = TSFE:fe_user|sesData|get_car = Katowice] 
    get_carpid = 27 
[globalVar = TSFE:fe_user|sesData|get_car = Lublin] 
    get_carpid = 28 
[global] 

# TS Setup 
... snip ... 
pidInList = {$get_carpid} 
... snip ... 

第一個解決方案是更Typo腳本的樂趣,第二個更容易新手 - 我猜:)

+0

第二個解決方案工作很棒:) – Adrian