Working Copy
authorwunschtacho <wunschtacho@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 16 Oct 2012 15:24:16 +0000 (15:24 +0000)
committerwunschtacho <wunschtacho@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 16 Oct 2012 15:24:16 +0000 (15:24 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/powermail_cond/trunk@67135 735d13b6-9817-0410-8766-e36946ffe9aa

27 files changed:
.idea/workspace.xml
Classes/Utility/FieldlistingBackend.php
Configuration/TCA/Condition.php [new file with mode: 0644]
Configuration/TCA/Conditions.php [deleted file]
Configuration/TCA/Rule.php [new file with mode: 0644]
Configuration/TCA/Rules.php [deleted file]
Resources/Private/Language/locallang_db.xml
doc/manual.sxw [deleted file]
ext_tables.php
ext_tables.sql
files/js/powermail_cond.js [deleted file]
files/static/constants.txt [deleted file]
files/static/setup.txt [deleted file]
lib/class.tx_powermailcond_ajaxFieldList_eid.php [deleted file]
lib/class.tx_powermailcond_ajaxWriteInSession_eid.php [deleted file]
lib/class.tx_powermailcond_div.php [deleted file]
lib/class.tx_powermailcond_fields_be.php [deleted file]
lib/class.tx_powermailcond_pidContainer.php [deleted file]
oldDoc/manual.sxw [new file with mode: 0644]
oldFiles/js/powermail_cond.js [new file with mode: 0644]
oldFiles/static/constants.txt [new file with mode: 0644]
oldFiles/static/setup.txt [new file with mode: 0644]
oldLib/class.tx_powermailcond_ajaxFieldList_eid.php [new file with mode: 0644]
oldLib/class.tx_powermailcond_ajaxWriteInSession_eid.php [new file with mode: 0644]
oldLib/class.tx_powermailcond_div.php [new file with mode: 0644]
oldLib/class.tx_powermailcond_fields_be.php [new file with mode: 0644]
oldLib/class.tx_powermailcond_pidContainer.php [new file with mode: 0644]

index ad48d01..07c22a0 100644 (file)
@@ -2,31 +2,27 @@
 <project version="4">\r
   <component name="ChangeListManager">\r
     <list default="true" readonly="true" id="500e5988-e13b-4ba1-8a60-e63a97f737a1" name="Default" comment="">\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Classes/Utility" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Classes" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Configuration/TCA" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Configuration" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources/Private/Language" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources/Private" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources/Public/Icons" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources/Public" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Configuration/TCA/Conditions.php" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Configuration/TCA/Rules.php" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources/Private/.htaccess" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_condition.xml" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_rule.xml" />\r
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Resources/Private/Language/locallang_db.xml" />\r
-      <change type="DELETED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\locallang_db.xml" afterPath="" />\r
-      <change type="DELETED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\tca.php" afterPath="" />\r
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />\r
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/vcs.xml" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\Configuration\TCA\Conditions.php" afterPath="$PROJECT_DIR$/Configuration/TCA/Condition.php" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\Configuration\TCA\Rules.php" afterPath="$PROJECT_DIR$/Configuration/TCA/Rule.php" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\files\js\powermail_cond.js" afterPath="$PROJECT_DIR$/oldFiles/js/powermail_cond.js" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\files\static\constants.txt" afterPath="$PROJECT_DIR$/oldFiles/static/constants.txt" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\files\static\setup.txt" afterPath="$PROJECT_DIR$/oldFiles/static/setup.txt" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\lib\class.tx_powermailcond_ajaxFieldList_eid.php" afterPath="$PROJECT_DIR$/oldLib/class.tx_powermailcond_ajaxFieldList_eid.php" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\lib\class.tx_powermailcond_ajaxWriteInSession_eid.php" afterPath="$PROJECT_DIR$/oldLib/class.tx_powermailcond_ajaxWriteInSession_eid.php" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\lib\class.tx_powermailcond_div.php" afterPath="$PROJECT_DIR$/oldLib/class.tx_powermailcond_div.php" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\lib\class.tx_powermailcond_fields_be.php" afterPath="$PROJECT_DIR$/oldLib/class.tx_powermailcond_fields_be.php" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\lib\class.tx_powermailcond_pidContainer.php" afterPath="$PROJECT_DIR$/oldLib/class.tx_powermailcond_pidContainer.php" />\r
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />\r
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ext_emconf.php" afterPath="$PROJECT_DIR$/ext_emconf.php" />\r
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php" afterPath="$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php" />\r
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Resources/Private/Language/locallang_db.xml" afterPath="$PROJECT_DIR$/Resources/Private/Language/locallang_db.xml" />\r
       <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ext_tables.php" afterPath="$PROJECT_DIR$/ext_tables.php" />\r
-      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\icon_tx_powermailcond_conditions.gif" afterPath="$PROJECT_DIR$/Resources/Public/Icons/icon_tx_powermailcond_conditions.gif" />\r
-      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\icon_tx_powermailcond_rules.gif" afterPath="$PROJECT_DIR$/Resources/Public/Icons/icon_tx_powermailcond_rules.gif" />\r
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/ext_tables.sql" afterPath="$PROJECT_DIR$/ext_tables.sql" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\doc\manual.sxw" afterPath="$PROJECT_DIR$/oldDoc/manual.sxw" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\doc" afterPath="$PROJECT_DIR$/oldDoc" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\files\js" afterPath="$PROJECT_DIR$/oldFiles/js" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\files\static" afterPath="$PROJECT_DIR$/oldFiles/static" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\files" afterPath="$PROJECT_DIR$/oldFiles" />\r
+      <change type="MOVED" beforePath="C:\Users\einpraegsam\PhpstormProjects\powermail_cond@powermailt347.in2code.de\lib" afterPath="$PROJECT_DIR$/oldLib" />\r
     </list>\r
     <ignored path="powermail_cond@powermailt347.in2code.de.iws" />\r
     <ignored path=".idea/workspace.xml" />\r
     <favorites_list name="powermail_cond@powermailt347.in2code.de" />\r
   </component>\r
   <component name="FileEditorManager">\r
-    <leaf>\r
-      <file leaf-file-name="ext_tables.php" pinned="false" current="true" current-in-tab="true">\r
-        <entry file="file://$PROJECT_DIR$/ext_tables.php">\r
-          <provider selected="true" editor-type-id="text-editor">\r
-            <state line="59" column="93" selection-start="2513" selection-end="2513" vertical-scroll-proportion="1.0732807">\r
-              <folding />\r
-            </state>\r
-          </provider>\r
-        </entry>\r
-      </file>\r
-      <file leaf-file-name="locallang_db.xml" pinned="false" current="false" current-in-tab="false">\r
-        <entry file="file://$PROJECT_DIR$/Resources/Private/Language/locallang_db.xml">\r
-          <provider selected="true" editor-type-id="text-editor">\r
-            <state line="4" column="35" selection-start="145" selection-end="145" vertical-scroll-proportion="0.0">\r
-              <folding />\r
-            </state>\r
-          </provider>\r
-        </entry>\r
-      </file>\r
-      <file leaf-file-name="Conditions.php" pinned="false" current="false" current-in-tab="false">\r
-        <entry file="file://$PROJECT_DIR$/Configuration/TCA/Conditions.php">\r
-          <provider selected="true" editor-type-id="text-editor">\r
-            <state line="163" column="76" selection-start="6090" selection-end="6090" vertical-scroll-proportion="-12.392157">\r
-              <folding />\r
-            </state>\r
-          </provider>\r
-        </entry>\r
-      </file>\r
-      <file leaf-file-name="Rules.php" pinned="false" current="false" current-in-tab="false">\r
-        <entry file="file://$PROJECT_DIR$/Configuration/TCA/Rules.php">\r
-          <provider selected="true" editor-type-id="text-editor">\r
-            <state line="91" column="76" selection-start="4488" selection-end="4488" vertical-scroll-proportion="-30.333334">\r
-              <folding />\r
-            </state>\r
-          </provider>\r
-        </entry>\r
-      </file>\r
-    </leaf>\r
+    <leaf />\r
   </component>\r
   <component name="FindManager">\r
     <FindUsagesManager>\r
       <list>\r
         <option value="$PROJECT_DIR$/ext_localconf.php" />\r
         <option value="$PROJECT_DIR$/ext_emconf.php" />\r
-        <option value="$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php" />\r
         <option value="$PROJECT_DIR$/tca.php" />\r
         <option value="$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermail_domain_model_condition.xml" />\r
         <option value="$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_condition.xml" />\r
-        <option value="$PROJECT_DIR$/Resources/Private/Language/locallang_db.xml" />\r
         <option value="$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_rule.xml" />\r
-        <option value="$PROJECT_DIR$/Configuration/TCA/Conditions.php" />\r
         <option value="$PROJECT_DIR$/Configuration/TCA/Rules.php" />\r
+        <option value="$PROJECT_DIR$/Configuration/TCA/Conditions.php" />\r
+        <option value="$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php" />\r
+        <option value="$PROJECT_DIR$/Configuration/TCA/Rule.php" />\r
+        <option value="$PROJECT_DIR$/ext_tables.sql" />\r
         <option value="$PROJECT_DIR$/ext_tables.php" />\r
+        <option value="$PROJECT_DIR$/Configuration/TCA/Condition.php" />\r
+        <option value="$PROJECT_DIR$/Resources/Private/Language/locallang_db.xml" />\r
       </list>\r
     </option>\r
   </component>\r
               <option name="myItemId" value="Resources" />\r
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
             </PATH_ELEMENT>\r
-            <PATH_ELEMENT>\r
-              <option name="myItemId" value="Public" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
-            </PATH_ELEMENT>\r
-            <PATH_ELEMENT>\r
-              <option name="myItemId" value="Icons" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
-            </PATH_ELEMENT>\r
           </PATH>\r
           <PATH>\r
             <PATH_ELEMENT>\r
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
             </PATH_ELEMENT>\r
             <PATH_ELEMENT>\r
-              <option name="myItemId" value="lib" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
-            </PATH_ELEMENT>\r
-          </PATH>\r
-          <PATH>\r
-            <PATH_ELEMENT>\r
-              <option name="myItemId" value="powermail_cond@powermailt347.in2code.de" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />\r
-            </PATH_ELEMENT>\r
-            <PATH_ELEMENT>\r
-              <option name="myItemId" value="powermail_cond@powermailt347.in2code.de" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
-            </PATH_ELEMENT>\r
-            <PATH_ELEMENT>\r
               <option name="myItemId" value="Configuration" />\r
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
             </PATH_ELEMENT>\r
               <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
             </PATH_ELEMENT>\r
           </PATH>\r
-          <PATH>\r
-            <PATH_ELEMENT>\r
-              <option name="myItemId" value="powermail_cond@powermailt347.in2code.de" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />\r
-            </PATH_ELEMENT>\r
-            <PATH_ELEMENT>\r
-              <option name="myItemId" value="powermail_cond@powermailt347.in2code.de" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
-            </PATH_ELEMENT>\r
-            <PATH_ELEMENT>\r
-              <option name="myItemId" value="Classes" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
-            </PATH_ELEMENT>\r
-            <PATH_ELEMENT>\r
-              <option name="myItemId" value="Utility" />\r
-              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />\r
-            </PATH_ELEMENT>\r
-          </PATH>\r
         </subPane>\r
       </pane>\r
     </panes>\r
         <option name="PhingTarget" enabled="false" />\r
       </method>\r
     </configuration>\r
+    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">\r
+      <method>\r
+        <option name="PhingTarget" enabled="false" />\r
+      </method>\r
+    </configuration>\r
     <configuration default="true" type="JavascriptDebugSession" factoryName="Remote">\r
       <JSRemoteDebuggerConfigurationSettings>\r
         <option name="engineId" />\r
       <created>1350394416165</created>\r
       <updated>1350394416165</updated>\r
     </task>\r
+    <task id="LOCAL-00001" summary="Working Copy">\r
+      <created>1350398340012</created>\r
+      <updated>1350398340012</updated>\r
+    </task>\r
+    <option name="localTasksCounter" value="2" />\r
     <servers />\r
   </component>\r
   <component name="ToolWindowManager">\r
     <frame x="1592" y="-262" width="1936" height="1096" extended-state="6" />\r
     <editor active="false" />\r
     <layout>\r
-      <window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32917964" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />\r
       <window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />\r
+      <window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32917964" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />\r
       <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />\r
-      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />\r
-      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />\r
       <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />\r
-      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20917822" sideWeight="0.67082036" order="0" side_tool="false" content_ui="combo" />\r
       <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />\r
-      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />\r
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />\r
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />\r
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />\r
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />\r
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />\r
+      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20917822" sideWeight="0.67082036" order="0" side_tool="false" content_ui="combo" />\r
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />\r
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />\r
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />\r
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />\r
     <breakpoint-manager />\r
   </component>\r
   <component name="editorHistoryManager">\r
-    <entry file="file://$PROJECT_DIR$/ext_tables.sql">\r
+    <entry file="file://D:/SVN/powermail@forge/Configuration/TCA/Pages.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
         <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/ext_emconf.php">\r
+    <entry file="file://D:/SVN/powermail@forge/Resources/Private/Language/locallang_csh_tx_powermail_domain_model_forms.xml">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="14" column="141" selection-start="608" selection-end="608" vertical-scroll-proportion="0.1134594">\r
+        <state line="12" column="22" selection-start="0" selection-end="992" vertical-scroll-proportion="0.21748401">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/lib/class.tx_powermailcond_fields_be.php">\r
+    <entry file="file://D:/SVN/powermail@forge/Resources/Private/Language/locallang_db.xml">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="31" column="34" selection-start="1231" selection-end="4290" vertical-scroll-proportion="0.18640351">\r
+        <state line="10" column="41" selection-start="0" selection-end="26641" vertical-scroll-proportion="0.18123667">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://D:/SVN/powermail@forge/Classes/Utility/Div.php">\r
+    <entry file="file://$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_condition.xml">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="0" column="0" selection-start="0" selection-end="1215" vertical-scroll-proportion="-0.0">\r
+        <state line="12" column="91" selection-start="0" selection-end="628" vertical-scroll-proportion="0.21748401">\r
+          <folding />\r
+        </state>\r
+      </provider>\r
+    </entry>\r
+    <entry file="file://$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_rule.xml">\r
+      <provider selected="true" editor-type-id="text-editor">\r
+        <state line="12" column="87" selection-start="556" selection-end="556" vertical-scroll-proportion="0.21748401">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
     <entry file="file://$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="41" column="47" selection-start="1426" selection-end="1426" vertical-scroll-proportion="-12.423077">\r
+        <state line="43" column="18" selection-start="1538" selection-end="1538" vertical-scroll-proportion="0.39144737">\r
           <folding>\r
             <element signature="n#getFieldsets#0;n#Tx_PowermailCond_Utility_FieldlistingBackend#0;n#!!top" expanded="false" />\r
             <element signature="n#valuesFromPowermailSelectbox#0;n#Tx_PowermailCond_Utility_FieldlistingBackend#0;n#!!top" expanded="false" />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/ext_localconf.php">\r
+    <entry file="file://D:/SVN/powermail@forge/ext_tables.sql">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="13" column="0" selection-start="265" selection-end="265" vertical-scroll-proportion="0.24232456">\r
+        <state line="85" column="61" selection-start="2799" selection-end="2831" vertical-scroll-proportion="0.5618337">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://D:/SVN/powermail@forge/Configuration/TCA/Pages.php">\r
+    <entry file="file://D:/SVN/powermail@forge/Configuration/TCA/Answers.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
         <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://D:/SVN/powermail@forge/ext_tables.php">\r
+    <entry file="file://$PROJECT_DIR$/ext_tables.sql">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="82" column="3" selection-start="2545" selection-end="2709" vertical-scroll-proportion="-12.423077">\r
+        <state line="25" column="8" selection-start="850" selection-end="850" vertical-scroll-proportion="0.45309168">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://D:/SVN/powermail@forge/Resources/Private/Language/locallang_csh_tx_powermail_domain_model_forms.xml">\r
+    <entry file="file://D:/SVN/powermail@forge/Configuration/FlexForms/flexform_pi1.xml">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="12" column="22" selection-start="0" selection-end="992" vertical-scroll-proportion="0.21748401">\r
+        <state line="25" column="251" selection-start="735" selection-end="933" vertical-scroll-proportion="0.45945945">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://D:/SVN/powermail@forge/Resources/Private/Language/locallang_db.xml">\r
-      <provider selected="true" editor-type-id="text-editor">\r
-        <state line="10" column="41" selection-start="0" selection-end="26641" vertical-scroll-proportion="0.18123667">\r
-          <folding />\r
-        </state>\r
-      </provider>\r
-    </entry>\r
-    <entry file="file://$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_condition.xml">\r
+    <entry file="file://$PROJECT_DIR$/ext_tables.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="12" column="91" selection-start="0" selection-end="628" vertical-scroll-proportion="0.21748401">\r
+        <state line="36" column="6" selection-start="1512" selection-end="1512" vertical-scroll-proportion="0.5997807">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_rule.xml">\r
+    <entry file="file://D:/SVN/powermail@forge/ext_tables.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="12" column="87" selection-start="556" selection-end="556" vertical-scroll-proportion="0.21748401">\r
+        <state line="163" column="10" selection-start="5883" selection-end="5930" vertical-scroll-proportion="0.74561405">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Configuration/TCA/Rules.php">\r
+    <entry file="file://D:/SVN/powermail@forge/Configuration/TCA/Fields.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="91" column="76" selection-start="4488" selection-end="4488" vertical-scroll-proportion="-30.333334">\r
+        <state line="199" column="14" selection-start="7056" selection-end="7106" vertical-scroll-proportion="0.567297">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Configuration/TCA/Conditions.php">\r
+    <entry file="file://$PROJECT_DIR$/Resources/Private/Language/locallang_db.xml">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="163" column="76" selection-start="6090" selection-end="6090" vertical-scroll-proportion="-12.392157">\r
+        <state line="51" column="85" selection-start="3753" selection-end="3753" vertical-scroll-proportion="0.22068231">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Resources/Private/Language/locallang_db.xml">\r
+    <entry file="file://$PROJECT_DIR$/Configuration/TCA/Rule.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="4" column="35" selection-start="145" selection-end="145" vertical-scroll-proportion="0.0">\r
+        <state line="0" column="5" selection-start="5" selection-end="5" vertical-scroll-proportion="-0.0567297">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/ext_tables.php">\r
+    <entry file="file://$PROJECT_DIR$/Configuration/TCA/Condition.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="59" column="93" selection-start="2513" selection-end="2513" vertical-scroll-proportion="1.0732807">\r
+        <state line="100" column="139" selection-start="3240" selection-end="3240" vertical-scroll-proportion="0.6429366">\r
           <folding />\r
         </state>\r
       </provider>\r
index a5df967..d1906bb 100644 (file)
@@ -39,7 +39,40 @@ class Tx_PowermailCond_Utility_FieldlistingBackend {
         * @param       object  $pObj: Parent Object
         * @return      void
         */
-       public function fieldname(&$params, $pObj) {
+       public function getFieldname(&$params, $pObj) {
+               $where = '1 AND pid = ' . intval($params['row']['pid']) . ' AND hidden = 0 AND deleted = 0';
+               $where = '';
+               if (isset($params['config']['itemsProcFuncValue'])) { // additional where clause
+                       $where = 'formtype IN (' . $params['config']['itemsProcFuncValue'] . ')';
+               }
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $select = 'uid, title',
+                       $from = 'tx_powermail_domain_model_fields',
+                       $where,
+                       $groupBy = '',
+                       $orderBy = 'sorting',
+                       $limit = ''
+               );
+               if ($res) {
+                       $params['items'][] = array('powermail Fields', '--div--');
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                               $params['items'][] = array($pObj->sL($row['title']) . ' (' . $row['uid'] . ')', $row['uid']);
+                       }
+               }
+
+               if (isset($params['config']['itemsProcFunc_addFieldsets'])) { // add fieldsets to selection
+                       $params['items'] = array_merge((array) $params['items'], $this->getFieldsets($params['row']['pid'])); // add some fieldsets
+               }
+       }
+
+       /**
+        * show all fields in the backend
+        *
+        * @param       array   $params: Params
+        * @param       object  $pObj: Parent Object
+        * @return      void
+        */
+       public function oldFieldname(&$params, $pObj) {
                $where = '1';
                if (isset($params['config']['itemsProcFuncValue'])) { // additional where clause
                        $where = 'formtype IN (' . $params['config']['itemsProcFuncValue'] . ')';
diff --git a/Configuration/TCA/Condition.php b/Configuration/TCA/Condition.php
new file mode 100644 (file)
index 0000000..3a9186e
--- /dev/null
@@ -0,0 +1,193 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+$TCA['tx_powermailcond_domain_model_condition'] = array (
+       'ctrl' => $TCA['tx_powermailcond_domain_model_condition']['ctrl'],
+       'interface' => array (
+               'showRecordFieldList' => 'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,title,targetField,actions,filterSelectField,rules,conjunction,form'
+       ),
+       'types' => array (
+               '1' => array('showitem' => '--palette--;x;1, form, targetField, --palette--;x;2, rules, conjunction')
+       ),
+       'palettes' => array (
+               '1' => array('showitem' => 'title, hidden'),
+               '2' => array('showitem' => 'actions, filterSelectField'),
+               'canNotCollapse' => '1'
+       ),
+       'columns' => array (
+               'sys_language_uid' => array (
+                       'exclude' => 1,
+                       'label'  => 'LLL:EXT:lang/locallang_general.xml:LGL.language',
+                       'config' => array (
+                               'type'                => 'select',
+                               'foreign_table'       => 'sys_language',
+                               'foreign_table_where' => 'ORDER BY sys_language.title',
+                               'items' => array(
+                                       array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
+                                       array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
+                               )
+                       )
+               ),
+               'l18n_parent' => array (
+                       'displayCond' => 'FIELD:sys_language_uid:>:0',
+                       'exclude'     => 1,
+                       'label'       => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
+                       'config'      => array (
+                               'type'  => 'select',
+                               'items' => array (
+                                       array('', 0),
+                               ),
+                               'foreign_table'       => 'tx_powermailcond_conditions',
+                               'foreign_table_where' => 'AND tx_powermailcond_conditions.pid=###CURRENT_PID### AND tx_powermailcond_conditions.sys_language_uid IN (-1,0)',
+                       )
+               ),
+               'l18n_diffsource' => array (
+                       'config' => array (
+                               'type' => 'passthrough'
+                       )
+               ),
+               'hidden' => array (
+                       'exclude' => 1,
+                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
+                       'config'  => array (
+                               'type'    => 'check',
+                               'default' => '0'
+                       )
+               ),
+               'starttime' => array (
+                       'exclude' => 1,
+                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
+                       'config'  => array (
+                               'type'     => 'input',
+                               'size'     => '8',
+                               'max'      => '20',
+                               //'eval'     => 'date',
+                               'default'  => '0',
+                               'checkbox' => '0'
+                       )
+               ),
+               'endtime' => array (
+                       'exclude' => 1,
+                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime',
+                       'config'  => array (
+                               'type'     => 'input',
+                               'size'     => '8',
+                               'max'      => '20',
+                               //'eval'     => 'date',
+                               'checkbox' => '0',
+                               'default'  => '0',
+                               'range'    => array (
+                                       'upper' => mktime(0, 0, 0, 12, 31, 2020),
+                                       'lower' => mktime(0, 0, 0, date('m')-1, date('d'), date('Y'))
+                               )
+                       )
+               ),
+               'title' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.title',
+                       'config' => Array (
+                               'type' => 'input',
+                               'size' => '30',
+                       )
+               ),
+               'form' => array(
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.form',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.form.pleaseChoose', '')
+                               ),
+                               'maxitems' => '1',
+                               'size' => '1',
+                               'minitems' => 1,
+                               'requestUpdate' => 1,
+                               'foreign_table' => 'tx_powermail_domain_model_forms',
+                               'foreign_table_where' => 'AND tx_powermail_domain_model_forms.deleted = 0 AND tx_powermail_domain_model_forms.hidden = 0 AND tx_powermail_domain_model_forms.sys_language_uid = 0 order by tx_powermail_domain_model_forms.title'
+                       )
+               ),
+               'targetField' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField.I.0', '0'),
+                               ),
+                               'itemsProcFunc' => 'Tx_PowermailCond_Utility_FieldlistingBackend->getFieldname',
+                               'itemsProcFunc_addFieldsets' => 1, // add fieldsets
+                               'size' => 1,
+                               'maxitems' => 1,
+                               'eval' => 'required'
+                       ),
+                       'displayCond' => 'FIELD:form:>:0'
+               ),
+               'actions' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.main', '--div--'), // title main
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.0', '0'), // hide
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.1', '1'), // unhide
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.additional', '--div--'), // title additional
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.2', '2'), // filter selectbox
+                               ),
+                               'size' => 1,
+                               'maxitems' => 1,
+                       ),
+                       'displayCond' => 'FIELD:form:>:0'
+               ),
+               'filterSelectField' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.filterSelectField',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                               ),
+                               'itemsProcFunc' => 'tx_powermailcond_fields_be->valuesFromPowermailSelectbox',
+                               'size' => 4,
+                               'maxitems' => 1000
+                       ),
+                       'displayCond' => 'FIELD:actions:IN:2,FIELD:form:>:0' // show only if ops value is greater than 1
+               ),
+               'rules' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.rules',
+                       'config' => Array (
+                               'type' => 'inline',
+                               'foreign_table' => 'tx_powermailcond_domain_model_rule',
+                               'foreign_table_where' => 'AND tx_powermailcond_domain_model_rule.pid=###CURRENT_PID### ORDER BY tx_powermailcond_domain_model_rule.sorting',
+                               'foreign_field' => 'conditions',
+                               'maxitems' => 99,
+                               'appearance' => array(
+                                       'collapseAll' => 1,
+                                       'expandSingle' => 1,
+                                       'useSortable' => 1,
+                                       'newRecordLinkAddTitle' => 1,
+                                       'newRecordLinkPosition' => 'both',
+                               ),
+                       ),
+                       'displayCond' => 'FIELD:form:>:0'
+               ),
+               'conjunction' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.1', 'OR'), // OR
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.0', 'AND'), // AND
+                               ),
+                               'size' => 1,
+                               'maxitems' => 1,
+                       ),
+                       'displayCond' => 'FIELD:form:>:0'
+               ),
+       ),
+);
+
+?>
\ No newline at end of file
diff --git a/Configuration/TCA/Conditions.php b/Configuration/TCA/Conditions.php
deleted file mode 100644 (file)
index 3ae4dfa..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-if (!defined ('TYPO3_MODE')) {
-       die ('Access denied.');
-}
-
-$TCA['tx_powermailcond_conditions'] = array (
-       'ctrl' => $TCA['tx_powermailcond_conditions']['ctrl'],
-       'interface' => array (
-               'showRecordFieldList' => 'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,title,targetField,actions,filterSelectField,rules,conjunction'
-       ),
-       'types' => array (
-               '0' => array('showitem' => '--palette--;;1, targetField, --palette--;;2, rules, conjunction, sys_language_uid, l18n_parent, l18n_diffsource')
-       ),
-       'palettes' => array (
-               '1' => array('showitem' => 'title, starttime, endtime, hidden'),
-               '2' => array('showitem' => 'actions, filterSelectField')
-       ),
-       'feInterface' => $TCA['tx_powermailcond_conditions']['feInterface'],
-       'columns' => array (
-               'sys_language_uid' => array (
-                       'exclude' => 1,
-                       'label'  => 'LLL:EXT:lang/locallang_general.xml:LGL.language',
-                       'config' => array (
-                               'type'                => 'select',
-                               'foreign_table'       => 'sys_language',
-                               'foreign_table_where' => 'ORDER BY sys_language.title',
-                               'items' => array(
-                                       array('LLL:EXT:lang/locallang_general.xml:LGL.allLanguages', -1),
-                                       array('LLL:EXT:lang/locallang_general.xml:LGL.default_value', 0)
-                               )
-                       )
-               ),
-               'l18n_parent' => array (
-                       'displayCond' => 'FIELD:sys_language_uid:>:0',
-                       'exclude'     => 1,
-                       'label'       => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
-                       'config'      => array (
-                               'type'  => 'select',
-                               'items' => array (
-                                       array('', 0),
-                               ),
-                               'foreign_table'       => 'tx_powermailcond_conditions',
-                               'foreign_table_where' => 'AND tx_powermailcond_conditions.pid=###CURRENT_PID### AND tx_powermailcond_conditions.sys_language_uid IN (-1,0)',
-                       )
-               ),
-               'l18n_diffsource' => array (
-                       'config' => array (
-                               'type' => 'passthrough'
-                       )
-               ),
-               'hidden' => array (
-                       'exclude' => 1,
-                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
-                       'config'  => array (
-                               'type'    => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'starttime' => array (
-                       'exclude' => 1,
-                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
-                       'config'  => array (
-                               'type'     => 'input',
-                               'size'     => '8',
-                               'max'      => '20',
-                               //'eval'     => 'date',
-                               'default'  => '0',
-                               'checkbox' => '0'
-                       )
-               ),
-               'endtime' => array (
-                       'exclude' => 1,
-                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime',
-                       'config'  => array (
-                               'type'     => 'input',
-                               'size'     => '8',
-                               'max'      => '20',
-                               //'eval'     => 'date',
-                               'checkbox' => '0',
-                               'default'  => '0',
-                               'range'    => array (
-                                       'upper' => mktime(0, 0, 0, 12, 31, 2020),
-                                       'lower' => mktime(0, 0, 0, date('m')-1, date('d'), date('Y'))
-                               )
-                       )
-               ),
-               'title' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.title',
-                       'config' => Array (
-                               'type' => 'input',
-                               'size' => '30',
-                       )
-               ),
-               'targetField' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField',
-                       'config' => Array (
-                               'type' => 'select',
-                               'items' => Array (
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField.I.0', '0'),
-                               ),
-                               'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',
-                               'itemsProcFunc_addFieldsets' => 1, // add fieldsets
-                               'size' => 1,
-                               'maxitems' => 1,
-                               'eval' => 'required'
-                       )
-               ),
-               'actions' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action',
-                       'config' => Array (
-                               'type' => 'select',
-                               'items' => Array (
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.main', '--div--'), // title main
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.0', '0'), // hide
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.1', '1'), // unhide
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.additional', '--div--'), // title additional
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.2', '2'), // filter selectbox
-                               ),
-                               'size' => 1,
-                               'maxitems' => 1,
-                       )
-               ),
-               'filterSelectField' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.filterSelectField',
-                       'config' => Array (
-                               'type' => 'select',
-                               'items' => Array (
-                               ),
-                               'itemsProcFunc' => 'tx_powermailcond_fields_be->valuesFromPowermailSelectbox',
-                               'size' => 4,
-                               'maxitems' => 1000
-                       ),
-                       'displayCond' => 'FIELD:actions:IN:2' // show only if ops value is greater than 1
-               ),
-               'rules' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.rules',
-                       'config' => Array (
-                               'type' => 'inline',
-                               'foreign_table' => 'tx_powermailcond_rules',
-                               'foreign_table_where' => 'AND tx_powermailcond_rules.pid=###CURRENT_PID### ORDER BY tx_powermailcond_rules.uid',
-                               'foreign_field' => 'conditions',
-                               'maxitems' => 99,
-                               'appearance' => array(
-                                       'collapseAll' => 1,
-                                       'expandSingle' => 1,
-                                       'useSortable' => 1,
-                                       'newRecordLinkAddTitle' => 1,
-                                       'newRecordLinkPosition' => 'both',
-                               ),
-                       )
-               ),
-               'conjunction' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction',
-                       'config' => Array (
-                               'type' => 'select',
-                               'items' => Array (
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.1', 'OR'), // OR
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.0', 'AND'), // AND
-                               ),
-                               'size' => 1,
-                               'maxitems' => 1,
-                       )
-               ),
-       ),
-);
-
-?>
\ No newline at end of file
diff --git a/Configuration/TCA/Rule.php b/Configuration/TCA/Rule.php
new file mode 100644 (file)
index 0000000..fc23906
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
+
+$TCA['tx_powermailcond_domain_model_rule'] = array (
+       'ctrl' => $TCA['tx_powermailcond_domain_model_rule']['ctrl'],
+       'interface' => array (
+               'showRecordFieldList' => 'hidden,startField,ops,condstring,equalField'
+       ),
+       'types' => array (
+               '0' => array('showitem' => '--palette--;;1,startField,--palette--;;2')
+       ),
+       'palettes' => array (
+               '1' => array('showitem' => 'title, hidden'),
+               '2' => array('showitem' => 'ops,condstring,equalField')
+       ),
+       'columns' => array (
+               'hidden' => array (
+                       'exclude' => 1,
+                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
+                       'config'  => array (
+                               'type'    => 'check',
+                               'default' => '0'
+                       )
+               ),
+               'title' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.title',
+                       'config' => Array (
+                               'type' => 'input',
+                               'size' => '30',
+                       )
+               ),
+               'startField' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.startField',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.startField.I.0', '0'),
+                               ),
+                               'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',
+                               'itemsProcFuncValue' => '"text","textarea","select","radio","check"', // allow only this types of fields in selector
+                               'size' => 1,
+                               'maxitems' => 1,
+                               'eval' => 'required'
+                       )
+               ),
+               'ops' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       //Array('', ''), // empty
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operators', '--div--'), // title operators
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.0', '0'), // is set
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.1', '1'), // is not set
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonValue', '--div--'), // title operatorsComparisonValue
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.2', '2'), // contains
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.3', '3'), // contains not
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.4', '4'), // is
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.5', '5'), // is not
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.6', '6'), // is greater than
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.7', '7'), // is less than
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonField', '--div--'), // title operatorsComparisonField
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.8', '8'), // contains value from field
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.9', '9'), // contains not value from field
+                               ),
+                               'size' => 1,
+                               'maxitems' => 1
+                       )
+               ),
+               'condstring' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.condstring',
+                       'config' => Array (
+                               'type' => 'text',
+                               'cols' => '30',
+                               'rows' => '2',
+                       ),
+                       'displayCond' => 'FIELD:ops:IN:2,3,4,5,6,7' // show only if ops value is greater than 1
+               ),
+               'equalField' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.equalField',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.equalField.I.0', '0'),
+                               ),
+                               'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',
+                               'itemsProcFuncValue' => '"text","textarea","select","radio"', // allow only this types of fields in selector
+                               'size' => 1,
+                               'maxitems' => 1
+                       ),
+                       'displayCond' => 'FIELD:ops:IN:8,9' // show only if ops value is greater than 1
+               ),
+       ),
+);
+
+?>
\ No newline at end of file
diff --git a/Configuration/TCA/Rules.php b/Configuration/TCA/Rules.php
deleted file mode 100644 (file)
index db00ef7..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-if (!defined ('TYPO3_MODE')) {
-       die ('Access denied.');
-}
-
-$TCA['tx_powermailcond_rules'] = array (
-       'ctrl' => $TCA['tx_powermailcond_rules']['ctrl'],
-       'interface' => array (
-               'showRecordFieldList' => 'hidden,startField,ops,condstring,equalField'
-       ),
-       'types' => array (
-               '0' => array('showitem' => '--palette--;;1,startField,--palette--;;2')
-       ),
-       'palettes' => array (
-               '1' => array('showitem' => 'title, hidden'),
-               '2' => array('showitem' => 'ops,condstring,equalField')
-       ),
-       'feInterface' => $TCA['tx_powermailcond_rules']['feInterface'],
-       'columns' => array (
-               'hidden' => array (
-                       'exclude' => 1,
-                       'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
-                       'config'  => array (
-                               'type'    => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'title' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.title',
-                       'config' => Array (
-                               'type' => 'input',
-                               'size' => '30',
-                       )
-               ),
-               'startField' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.startField',
-                       'config' => Array (
-                               'type' => 'select',
-                               'items' => Array (
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.startField.I.0', '0'),
-                               ),
-                               'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',
-                               'itemsProcFuncValue' => '"text","textarea","select","radio","check"', // allow only this types of fields in selector
-                               'size' => 1,
-                               'maxitems' => 1,
-                               'eval' => 'required'
-                       )
-               ),
-               'ops' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator',
-                       'config' => Array (
-                               'type' => 'select',
-                               'items' => Array (
-                                       //Array('', ''), // empty
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operators', '--div--'), // title operators
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.0', '0'), // is set
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.1', '1'), // is not set
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonValue', '--div--'), // title operatorsComparisonValue
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.2', '2'), // contains
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.3', '3'), // contains not
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.4', '4'), // is
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.5', '5'), // is not
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.6', '6'), // is greater than
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.7', '7'), // is less than
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonField', '--div--'), // title operatorsComparisonField
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.8', '8'), // contains value from field
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.9', '9'), // contains not value from field
-                               ),
-                               'size' => 1,
-                               'maxitems' => 1
-                       )
-               ),
-               'condstring' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.condstring',
-                       'config' => Array (
-                               'type' => 'text',
-                               'cols' => '30',
-                               'rows' => '2',
-                       ),
-                       'displayCond' => 'FIELD:ops:IN:2,3,4,5,6,7' // show only if ops value is greater than 1
-               ),
-               'equalField' => Array (
-                       'exclude' => 1,
-                       'label' => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.equalField',
-                       'config' => Array (
-                               'type' => 'select',
-                               'items' => Array (
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.equalField.I.0', '0'),
-                               ),
-                               'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',
-                               'itemsProcFuncValue' => '"text","textarea","select","radio"', // allow only this types of fields in selector
-                               'size' => 1,
-                               'maxitems' => 1
-                       ),
-                       'displayCond' => 'FIELD:ops:IN:8,9' // show only if ops value is greater than 1
-               ),
-       ),
-);
-
-?>
\ No newline at end of file
index 683f834..32bdbb3 100644 (file)
@@ -8,6 +8,8 @@
                <languageKey index="default" type="array">
                        <label index="tx_powermailcond_conditions">Conditions</label>
                        <label index="tx_powermailcond_conditions.title">Title</label>
+                       <label index="tx_powermailcond_conditions.form">Form</label>
+                       <label index="tx_powermailcond_conditions.form.pleaseChoose">Please choose...</label>
                        <label index="tx_powermailcond_conditions.targetField">Which field is affected (target field)?</label>
                        <label index="tx_powermailcond_conditions.targetField.I.0">Please choose...</label>
                        <label index="tx_powermailcond_conditions.action">What should happen to the chosen field?</label>
@@ -46,6 +48,8 @@
                <languageKey index="de" type="array">
                        <label index="tx_powermailcond_conditions">Bedingungen</label>
                        <label index="tx_powermailcond_conditions.title">Bezeichnung</label>
+                       <label index="tx_powermailcond_conditions.form">Formular</label>
+                       <label index="tx_powermailcond_conditions.form.pleaseChoose">Bitte wählen...</label>
                        <label index="tx_powermailcond_conditions.targetField">Welches Feld ist betroffen (Zielfeld)?</label>
                        <label index="tx_powermailcond_conditions.targetField.I.0">Bitte wählen...</label>
                        <label index="tx_powermailcond_conditions.action">Was soll mit dem gewählten Feld passieren?</label>
diff --git a/doc/manual.sxw b/doc/manual.sxw
deleted file mode 100644 (file)
index 1d9116d..0000000
Binary files a/doc/manual.sxw and /dev/null differ
index 55ff88a..3fe1a68 100644 (file)
@@ -12,9 +12,9 @@ if (TYPO3_MODE == 'BE') {
 t3lib_extMgm::addStaticFile($_EXTKEY, 'files/static/', 'Main TypoScript');
 
 // Configuration for Conditions
-t3lib_extMgm::addLLrefForTCAdescr('tx_powermail_domain_model_forms', 'EXT:powermail_cond/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_condition.xml');
-t3lib_extMgm::allowTableOnStandardPages('tx_powermailcond_conditions');
-$TCA['tx_powermailcond_conditions'] = array (
+t3lib_extMgm::addLLrefForTCAdescr('tx_powermailcond_domain_model_condition', 'EXT:powermail_cond/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_condition.xml');
+t3lib_extMgm::allowTableOnStandardPages('tx_powermailcond_domain_model_condition');
+$TCA['tx_powermailcond_domain_model_condition'] = array (
        'ctrl' => array (
                'title'     => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions',
                'label'     => 'title',
@@ -31,19 +31,16 @@ $TCA['tx_powermailcond_conditions'] = array (
                        'starttime' => 'starttime',
                        'endtime' => 'endtime'
                ),
-               'requestUpdate' => 'actions',
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Conditions.php',
-               'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . '/Resources/Public/Icons/icon_tx_powermailcond_conditions.gif'
+               'requestUpdate' => 'actions,form',
+               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Condition.php',
+               'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . '/Resources/Public/Icons/icon_tx_powermailcond_conditions.gif',
        ),
-       'feInterface' => array (
-               'fe_admin_fieldList' => 'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,title,targetField,actions,rules,conjunction',
-       )
 );
 
 // Configuration for Rules
-t3lib_extMgm::addLLrefForTCAdescr('tx_powermail_domain_model_forms', 'EXT:powermail_cond/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_rule.xml');
-t3lib_extMgm::allowTableOnStandardPages('tx_powermailcond_rules');
-$TCA['tx_powermailcond_rules'] = array (
+t3lib_extMgm::addLLrefForTCAdescr('tx_powermailcond_domain_model_rule', 'EXT:powermail_cond/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_rule.xml');
+t3lib_extMgm::allowTableOnStandardPages('tx_powermailcond_domain_model_rule');
+$TCA['tx_powermailcond_domain_model_rule'] = array (
        'ctrl' => array (
                'title'     => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules',
                'label'     => 'title',
@@ -56,12 +53,9 @@ $TCA['tx_powermailcond_rules'] = array (
                        'disabled' => 'hidden'
                ),
                'requestUpdate' => 'ops',
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Rules.php',
+               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Rule.php',
                'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . '/Resources/Public/Icons/icon_tx_powermailcond_rules.gif'
        ),
-       'feInterface' => array (
-               'fe_admin_fieldList' => 'hidden,startField,ops,condstring'
-       )
 );
 
 ?>
\ No newline at end of file
index dff3fec..390d895 100644 (file)
@@ -1,7 +1,7 @@
 #\r
-# Table structure for table 'tx_powermailcond_conditions'\r
+# Table structure for table 'tx_powermailcond_domain_model_condition'\r
 #\r
-CREATE TABLE tx_powermailcond_conditions (\r
+CREATE TABLE tx_powermailcond_domain_model_condition (\r
        uid int(11) NOT NULL auto_increment,\r
        pid int(11) DEFAULT '0' NOT NULL,\r
        tstamp int(11) DEFAULT '0' NOT NULL,\r
@@ -15,23 +15,25 @@ CREATE TABLE tx_powermailcond_conditions (
        hidden tinyint(4) DEFAULT '0' NOT NULL,\r
        starttime int(11) DEFAULT '0' NOT NULL,\r
        endtime int(11) DEFAULT '0' NOT NULL,\r
+\r
+       rules int(11) DEFAULT '0' NOT NULL,\r
+\r
        title tinytext NOT NULL,\r
        targetField tinytext NOT NULL,\r
        actions tinytext NOT NULL,\r
        filterSelectField tinytext NOT NULL,\r
        conjunction tinytext NOT NULL,\r
-       rules int(11) DEFAULT '0' NOT NULL,\r
+       form int(11) DEFAULT '0' NOT NULL,\r
        \r
        PRIMARY KEY (uid),\r
        KEY parent (pid)\r
 );\r
 \r
 \r
-\r
 #\r
-# Table structure for table 'tx_powermailcond_rules'\r
+# Table structure for table 'tx_powermailcond_domain_model_rule'\r
 #\r
-CREATE TABLE tx_powermailcond_rules (\r
+CREATE TABLE tx_powermailcond_domain_model_rule (\r
        uid int(11) NOT NULL auto_increment,\r
        pid int(11) DEFAULT '0' NOT NULL,\r
        tstamp int(11) DEFAULT '0' NOT NULL,\r
@@ -40,11 +42,13 @@ CREATE TABLE tx_powermailcond_rules (
        sorting int(10) DEFAULT '0' NOT NULL,\r
        deleted tinyint(4) DEFAULT '0' NOT NULL,\r
        hidden tinyint(4) DEFAULT '0' NOT NULL,\r
+\r
+       conditions int(11) DEFAULT '0' NOT NULL,\r
+\r
        title tinytext NOT NULL,\r
        startField int(11) DEFAULT '0' NOT NULL,\r
        ops int(11) DEFAULT '0' NOT NULL,\r
        condstring text NOT NULL,\r
-       conditions int(11) DEFAULT '0' NOT NULL,\r
        equalField int(11) DEFAULT '0' NOT NULL,\r
        \r
        PRIMARY KEY (uid),\r
diff --git a/files/js/powermail_cond.js b/files/js/powermail_cond.js
deleted file mode 100644 (file)
index 2d09b8f..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-$(document).ready(function() {
-       var fieldsOnChange = '.powermail_text, .powermail_textarea, .powermail_select, .powermail_radio, .powermail_check'; // all fields with events
-       if ($('form.tx_powermail_pi1_form').length > 0) { // only if the powermail form is on the page (not for confirmation page)
-               checkConditions(0); // check if something should be changed
-       }
-       
-       // save values via ajax to session
-       $(fieldsOnChange).change(function() {
-               //var url = self.location.href;
-               var pid = $('#powermail_cond_pid_container').val();
-               var url = '/index.php';
-               var timestamp = Number(new Date()); // timestamp is needed for a internet explorer workarround (always change a parameter)
-               var value = $(this).val(); // current value
-               var uid = $(this).attr('id').substr(3); // current uid (without "uid")
-               if ($(this).attr('type') == 'radio') { // if field is a radiobutton
-                       var tmp_uid = uid.split('_'); // split on _
-                       uid = tmp_uid[0]; // we want only the uid (not the subuid)
-               }
-               var name = $(this).attr('name');
-               if (this.type == 'checkbox' && this.checked == false) { // no checkbox workarround
-                       value = '';
-               }
-               if (name.indexOf('tx_powermail_pi1') == '-1') { // if checkbox workarround from powermail
-                       var value = $('#' + name.substr(6)).val();
-                       var uid = $('#' + name.substr(6)).attr('id').substr(3);
-               }
-               var params = 'eID=' + 'powermailcond_saveToSession' + '&id=' + pid + '&tx_powermailcond_pi1[uid]=' + uid + '&tx_powermailcond_pi1[value]=' + value + '&ts=' + timestamp;
-               
-               $.ajax({
-                       type: 'GET', // type
-                       url: url, // send to this url
-                       data: params, // add params
-                       cache: false, // disable cache (for ie)
-                       success: function(data) { // return values
-                               if (data != '') { // if there is a response
-                                       //alert(data); // alert the response
-                                       $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in change function:' + data);
-                               }
-                               checkConditions(uid); // check if something should be changed
-                       }
-               });
-       });
-       
-});
-
-/**
- * Main function to check conditions and do something (if necessary)
- *
- * @param      integer uid: Field uid (if available)
- * @return     void
- */
-function checkConditions(uid) {
-       //var url = self.location.href;
-       var pid = $('#powermail_cond_pid_container').val();
-       var url = '/index.php';
-       var params = '';
-       if (uid > 0) {
-               params += '&tx_powermailcond_pi1[uid]=' + uid;
-       }
-       $.ajax({
-               type: 'GET', // type
-               url: url, // send to this url
-               data: 'eID=' + 'powermailcond_getFieldStatus' + params + '&id=' + pid, // add params
-               cache: false, // disable cache (for ie)
-               beforeSend: function() {
-                       document.body.style.cursor = 'progress'; // change cursor to busy
-               },
-               complete: function() {
-                       document.body.style.cursor = 'auto'; // normal cursor
-               },
-               success: function(data) { // return values
-                       if (data != 'nochange') {
-                               $('.powermail_select option').show(); // show all options at the beginning
-                               $('.powermail_select option').removeAttr('disabled'); // enable all options at the beginning
-                               if (data != '') { // if there is a response
-                                       if (data.length < 500) { // stop if wrong result (maybe complete t3 page)
-                                               doAction(data); // hide all given fields
-                                       }
-                               } else { // if there is no response
-                                       $('.tx_powermail_pi1_fieldwrap_html').show(); // show all fields
-                                       $('.tx-powermail-pi1_fieldset').show(); // show all fieldsets at the beginning
-                               }
-                       }
-               },
-               error: function() {
-                       //alert("Error in powermail_cond.js:\n");
-                       $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in checkCondtions function by opening the url ' + url + '?' + data);
-               }
-       });
-}
-
-/**
- * Do some actions (hide and/or filter)
- *
- * @param      string  list: commaseparated list with uids (1,2,3)
- * @return     void
- */
-function doAction(list) {
-       $('.tx_powermail_pi1_fieldwrap_html').show(); // show all fields at the beginning
-       $('.tx-powermail-pi1_fieldset').show(); // show all fieldsets at the beginning
-       
-       var uid = list.split(',');
-       if (uid.length < 1) { 
-               return false; // stop process   
-       }
-       for (i=0; i<uid.length; i++) { // one loop for every affected field
-               if (uid[i].indexOf('fieldset:') != '-1') { // fieldset part
-                       hideFieldset(uid[i]);
-               } else if (uid[i].indexOf('filter:') != '-1') { // filter part
-                       filterSelection(uid[i]);
-               } else { // fields part
-                       hideField(uid[i]);
-               }
-       }
-}
-
-/**
- * Hide some fields and clear there value
- *
- * @param      string  string: mix of uid and values (fieldset:5:12;13;14)
- * @return     void
- */
-function hideFieldset(string) {
-       var params = string.split(':'); // filter / uid / values
-       var values = params[2].split(';'); // value1 / value2 / value3
-       $('fieldset.tx-powermail-pi1_fieldset_' + params[1]).hide(); // hide current fieldset
-       for (k=0; k<values.length; k++) { // one loop for every field inside the fieldset
-               clearValue('.powermail_uid' + values[k]); // clear value of current field
-       }
-}
-
-/**
- * Hide some fields and clear there value
- *
- * @param      integer uid: uid of the element
- * @return     void
- */
-function hideField(uid) {
-       $('div.tx_powermail_pi1_fieldwrap_html_' + uid).hide(); // hide current field
-       if ($('.powermail_uid' + uid).val() != '') { // only if value is not yet empty
-               clearValue('.powermail_uid' + uid); // clear value of current field
-               clearSession(uid); // clear value of current field
-       }
-}
-
-/**
- * Hide some fields and clear there value
- *
- * @param      string  string: mix of uid and values (filter:123:Value1;Value2;Value3)
- * @return     void
- */
-function filterSelection(string) {
-       var params = string.split(':'); // filter / uid / values
-       var values = params[2].split(';'); // value1 / value2 / value3
-       $('select.powermail_uid' + params[1] + ' option').hide(); // disable all options
-       $('select.powermail_uid' + params[1] + ' option').attr('disabled', 'disabled'); // disable all options
-       
-       for (j=0; j<values.length; j++) { // one loop for every option in select field
-               $('select.powermail_uid' + params[1] + ' option:contains(' + values[j] + ')').show(); // show this option
-               $('select.powermail_uid' + params[1] + ' option:contains(' + values[j] + ')').removeAttr('disabled'); // enable this option
-       }
-       
-       var valueSelected = $('select.powermail_uid' + params[1] + ' option:selected').val(); // give me the value of the selected option
-       if (params[2].indexOf(valueSelected) == '-1') { // if current selected value is one of the not allowed options
-               $('select.powermail_uid' + params[1]).get(0).selectedIndex = 0; // remove selection (because the selected option is not allowed)
-       }
-}
-
-/**
- * Clear value of an inputfield, set selectedIndex to 0 for selection and so on
- *
- * @param      string  selection: selection for jQuery (e.g. input.powermail)
- * @return     void
- */
-function clearValue(selection) {
-       if ($(selection).attr('type') == 'radio' || $(selection).attr('type') == 'checkbox') {
-               $(selection).attr('checked', false);
-       } else {
-               $(selection).val('');
-       }
-}
-
-/**
- * Clear session of a uid
- *
- * @param      integer uid: uid of the element
- * @return     void
- */
-function clearSession(uid) {
-       //var url = self.location.href;
-       var pid = $('#powermail_cond_pid_container').val();
-       var url = '/index.php';
-       var timestamp = Number(new Date()); // timestamp is needed for a internet explorer workarround (always change a parameter)
-       var params = 'eID=' + 'powermailcond_saveToSession' + '&id=' + pid + '&tx_powermailcond_pi1[uid]=' + uid + '&tx_powermailcond_pi1[value]=&ts=' + timestamp;
-       
-       $.ajax({
-               type: 'GET', // type
-               url: url, // send to this url
-               data: params, // add params
-               cache: false, // disable cache (for ie)
-               success: function(data) { // return values
-                       if (data != '') { // if there is a response
-                               //alert(data); // alert the response
-                               $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in clearSession function:' + data);
-                       }
-                       checkConditions(uid); // check if something should be changed
-               }
-       });
-};
\ No newline at end of file
diff --git a/files/static/constants.txt b/files/static/constants.txt
deleted file mode 100644 (file)
index 7840948..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Unbenanntes Dokument</title>
-</head>
-
-<body>
-</body>
-</html>
diff --git a/files/static/setup.txt b/files/static/setup.txt
deleted file mode 100644 (file)
index 716786c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-page.headerData.3131 = TEXT
-page.headerData.3131.value (
-       <meta http-equiv="expires" content="0" />
-       <meta http-equiv="cache-control" content="no-cache" />
-       <meta http-equiv="pragma" content="no-cache" />
-)
-page.includeJSFooter.powermail_cond = EXT:powermail_cond/files/js/powermail_cond.js
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_ajaxFieldList_eid.php b/lib/class.tx_powermailcond_ajaxFieldList_eid.php
deleted file mode 100644 (file)
index ccddd0b..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-require_once(PATH_t3lib . 'class.t3lib_befunc.php');
-require_once(PATH_t3lib . 'stddb/tables.php');
-require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
-require_once(PATH_tslib . 'class.tslib_pibase.php');
-require_once(PATH_tslib . 'class.tslib_fe.php');
-require_once(PATH_t3lib . 'class.t3lib_page.php');
-require_once(t3lib_extMgm::extPath('powermail_cond') . 'lib/class.tx_powermailcond_div.php'); // load div class
-
-/**
- * This class tells jQuery which field are allowed in which are not allowed
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage tx_powermailcond_ajaxWriteInSession_eid
- */
-class tx_powermailcond_ajaxFieldList_eid extends tslib_pibase {
-
-       public $extKey = 'powermail_cond'; // Extension key
-       public $prefixId = 'tx_powermailcond_pi1';
-       public $piVars;
-       private $content = '';
-       
-       /**
-        * Return list with fields which are not allowed (should be hidden)
-        *
-        * @return      string  $content:       commaseparated field list (1,2,3) 
-        *                                                              complex list could be:
-        *                                                              filter:12:option1;option2,12,13,fieldset:2:18;19 
-        *                                                              explanation - filter select.uid12, hide uid12, hide uid3, hide fieldset uid2 and clear uid18 and uid19
-        */
-    public function main() {
-               $this->cObj = $this->getCObj(); // enable TSFE globals
-               $conditions = $this->getConditionsFromThisPage(); // get conditions from database
-               $targetFields = $this->div->getStartFields($conditions); // get all startfields in an array
-               if ($this->piVars['uid'] > 0 && !in_array($this->piVars['uid'], $targetFields)) { // if current field uid given and this
-                       return 'nochange';
-               }
-               
-               foreach ((array) $conditions as $targetUid => $conf) { // one loop for every single target field
-                       $content .= $this->checkRules($conf) . ','; // add list to content object
-               }
-               
-               $content = t3lib_div::rm_endcomma($content); // remove last ,
-               $content = t3lib_div::uniqueList($content); // remove double values
-               
-               return $content;
-    }
-       
-       /**
-        * Preflight function checks the rules if there should be an action (show/hide) or not
-        *
-        * @param       array   $conf: Configuration of current field
-        * @return      boolean true:hide false:show(nothing)
-        */
-       public function checkRules($conf) {
-               $content = '';
-               $do = 0; // start with 0
-               if ($conf[0]['conjunction'] == 'AND') {
-                       $do = 1; // start with 1
-               }
-               
-               foreach ((array) $conf as $key => $subconf) { // one loop for every rule of current target field
-                       $ttcontentUid = $this->div->getTtcontentUid($conf[$key]['startField']);
-                       
-                       // special case: hide a field from the beginning
-                       if ($conf[$key]['actions'] == 1) { // show
-                               $content .= $this->getFieldsFromFieldset($conf[$key]['targetField'], $ttcontentUid) . ',';
-                       }
-                        
-                       // operations
-                       $act = 0;
-                       $startFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['startField']]; // get startfield value from session
-                       if (is_array($startFieldSession)) { // if second level
-                               $startFieldSession = implode(',', $startFieldSession); // get all values in a commaseparated list
-                       }
-                       switch ($conf[$key]['ops']) {
-                               case 0: // "not empty"
-                                       if ($startFieldSession != '') { // if start field value in session is not empty
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       } 
-                                       break;
-                                       
-                               case 1: // "empty"
-                                       if ($startFieldSession == '') { // if start field value in session is empty
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       } 
-                                       break;
-                                       
-                               case 2: // "contains"
-                                       if (stristr($startFieldSession, $conf[$key]['condstring'])) { // if start field value in session contains condstring
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       } 
-                                       break;
-                                       
-                               case 3: // "not contains"
-                                       if (!stristr($startFieldSession, $conf[$key]['condstring'])) { // if start field value in session contains not condstring
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       } 
-                                       break;
-                                       
-                               case 4: // "is"
-                                       if ($startFieldSession === $conf[$key]['condstring']) { // if start field value in session === condstring
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       } 
-                                       break;
-                                       
-                               case 5: // "is not"
-                                       if ($startFieldSession !== $conf[$key]['condstring']) { // if start field value in session is not condstring
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       } 
-                                       break;
-                                       
-                               case 6: // "is greater than"
-                                       if (intval($startFieldSession) > intval($conf[$key]['condstring'])) { // if start field value in session is greater than condstring
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       } 
-                                       break;
-                                       
-                               case 7: // "is less than"
-                                       if (intval($startFieldSession) < intval($conf[$key]['condstring'])) { // if start field value in session is greater than condstring
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       }
-                                       break;
-                                       
-                               case 8: // "contains value from field"
-                                       $comparisonFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['equalField']]; // get comparisonfield value from session
-                                       if (stristr($comparisonFieldSession, $startFieldSession)) {
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       }
-                                       break;
-                                       
-                               case 9: // "contains not value from field"
-                                       $comparisonFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['equalField']]; // get comparisonfield value from session
-                                       if (!stristr($comparisonFieldSession, $startFieldSession)) {
-                                               $act = 1;
-                                               $tmp_conf = $conf[$key];
-                                       }
-                                       break;
-                       }
-                       
-                       $do = $this->setDo(($act ? 1 : 0), $do, $conf[$key]['conjunction']); // $do = 1;
-               }
-               
-               $content = $this->doAction($do, $content, $ttcontentUid, $tmp_conf); // add new field if needed
-               return t3lib_div::rm_endcomma($content); // return commaseparated list
-       }
-       
-       /**
-        * This function return current field uid if this field should be hidden (and removes value from session)
-        *
-        * @param       boolean $do: If something should be done or not
-        * @param       string  $content: List with all fields which should be hidden
-        * @param       integer $ttcontentUid: UID of this tt_content
-        * @param       array   $conf: Configuration of current field
-        * @return      string list
-        */
-       public function doAction($do, $content, $ttcontentUid, $conf) {
-               if (!$do) {
-                       return $content;
-               }
-               
-               switch ($conf['actions']) {
-                       case 0: // hide
-                               $this->div->saveInSession(array('uid' . $conf['targetField'] => ''), 'powermail_' . $ttcontentUid); // remove value from session of this field
-                               $content .= $this->getFieldsFromFieldset($conf['targetField'], $ttcontentUid, 1) . ','; // hide this field
-                               break;
-                               
-                       case 1: // show
-                               $content = t3lib_div::rmFromList($this->getFieldsFromFieldset($conf['targetField'], $ttcontentUid), $content); // remove from hidelist (show this field)
-                               break;
-                               
-                       case 2: // filter from selectbox
-                               $content .= 'filter:' . $conf['targetField'] . ':' . str_replace(',', ';', $conf['filterSelectField']);
-                               break;
-               }
-               
-               return $content;
-       }
-       
-       /**
-        * Set a value to 0 or 1 depending on previous value and on conjunction (AND/OR)
-        *
-        * @param       boolean $newStatus: New status
-        * @param       boolean $oldStatus: Old status
-        * @param       string  $conjunction: AND or OR
-        * @return      boolean
-        */
-       private function setDo($newStatus, $oldStatus = 0, $conjunction = 'OR') {
-               //t3lib_div::debug(array($newStatus, $oldStatus), $conjunction);
-               if ($conjunction == 'OR') {
-                       if ($newStatus || $oldStatus) {
-                               return 1;
-                       } else {
-                               return 0;
-                       }
-               } elseif ($conjunction == 'AND') {
-                       if ($newStatus && $oldStatus) {
-                               return 1;
-                       } else {
-                               return 0;
-                       }
-               }
-       }
-       
-       /**
-        * get condition as array from current page
-        *
-        * @return      array   $arr: Array with all conditions of the current page
-        */
-       private function getConditionsFromThisPage() {
-               $arr = array();
-               $pid = t3lib_div::_GET('id');
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // Get all rules to current field
-                       'tx_powermailcond_conditions.targetField, tx_powermailcond_conditions.actions, tx_powermailcond_conditions.conjunction, tx_powermailcond_conditions.filterSelectField, tx_powermailcond_rules.startField, tx_powermailcond_rules.ops, tx_powermailcond_rules.condstring, tx_powermailcond_rules.equalField',
-                       'tx_powermailcond_conditions LEFT JOIN tx_powermailcond_rules ON tx_powermailcond_conditions.uid = tx_powermailcond_rules.conditions',
-                       $where_clause = (intval($pid) ? 'tx_powermailcond_conditions.pid = ' . intval($pid) : '1') . $this->cObj->enableFields('tx_powermailcond_conditions') . $this->cObj->enableFields('tx_powermailcond_rules'),
-                       $groupBy = 'tx_powermailcond_rules.uid',
-                       $orderBy = '',
-                       $limit = '1000'
-               );
-               if ($res) { // If there is a result
-                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // One loop for every rule on current page
-                               $arr[$row['targetField']][] = $row;
-                       }
-                       
-                       return $arr;
-               }
-       }
-       
-       /**
-        * Get all fields in a commaseparated list from a fieldset uid
-        *
-        * @param       integer $uid: Fieldset UID
-        * @param       integer $ttcontentUid: UID of this tt_content
-        * @param       boolean $clearSession: Clear cache of each of this fields
-        * @return      string  $list: Commaseparated List with field uids
-        */
-       private function getFieldsFromFieldset($uid, $ttcontentUid, $clearSession = 0) {
-               if (is_numeric($uid)) { // if this uid don't contains fs (for fs123)
-                       return $uid;
-               }
-               
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (
-                       'tx_powermail_fields.uid',
-                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset',
-                       $where = 'tx_powermail_fieldsets.uid = ' . intval(str_replace('fieldset:', '', $uid)),
-                       $groupBy = '',
-                       $orderBy = '',
-                       $limit = '1000'
-               );
-               if ($res) { // If there is a result
-                       $uids = '';
-                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // One loop for every field
-                               $uids .= $row['uid'] . ';';
-                               $this->div->saveInSession(array('uid' . $row['uid'] => ''), 'powermail_' . $ttcontentUid); // remove value from session of this field
-                       }
-               }
-               
-               if (!isset($uids)) {
-                       return $uid;
-               }
-               
-               return $uid . ':' . substr($uids, 0, -1); // return without last ;
-       }
-       
-       /**
-        * Initialize cObj and TSFE Globals
-        *
-        * @return      object  cObj
-        */
-       private function getCObj() {
-               $this->piVars = t3lib_div::_GET($this->prefixId);
-               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
-               $userObj = tslib_eidtools::initFeUser();                                            
-               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
-               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 0, 0, true);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-               
-               return t3lib_div::makeInstance('tslib_cObj');
-    }
-       
-}
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxFieldList_eid.php'])    {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxFieldList_eid.php']);
-}
-
-$SOBE = t3lib_div::makeInstance('tx_powermailcond_ajaxFieldList_eid'); // make instance
-echo $SOBE->main(); // print content
-?>
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php b/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php
deleted file mode 100644 (file)
index 1f8449b..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-require_once(PATH_t3lib . 'class.t3lib_befunc.php');
-require_once(PATH_t3lib . 'stddb/tables.php');
-require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
-require_once(PATH_tslib . 'class.tslib_pibase.php');
-require_once(t3lib_extMgm::extPath('powermail_cond') . 'lib/class.tx_powermailcond_div.php'); // load div class
-
-/**
- * This class is for storing values to the session on every fieldchange (via AJAX)
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage tx_powermailcond_ajaxWriteInSession_eid
- */
-class tx_powermailcond_ajaxWriteInSession_eid extends tslib_pibase {
-
-       public $extKey = 'powermail_cond'; // Extension key
-       public $prefixId = 'tx_powermailcond_pi1';
-       private $debug = false;
-       
-       /**
-        * Write values to session - main method called via AJAX
-        * Call this with index.php?id=97&eID=powermailcond_ajax&tx_powermailcond_pi1[uid]=5&tx_powermailcond_pi1[value]=test
-        *
-        * @return      void
-        */
-    public function main() {
-               // config
-               $this->getCObj(); // enable TSFE globals
-               $GLOBALS['TSFE']->sesData = tslib_eidtools::initFeUser();
-               $piVars = t3lib_div::_GP($this->prefixId); // GET param
-               $uids = t3lib_div::trimExplode('_', $piVars['uid']);
-               $uid = intval($uids[0]); // uid of current field
-               $value = htmlspecialchars($piVars['value']); // value from current field
-               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
-               $ttcontent_uid = $this->div->getTtcontentUid($uid); // get tt_content uid to current field
-               
-               // start
-               if ($uid == 0) {
-                       return false;
-               }
-               if (isset($uids[1])) { // second level
-                       $oldSession = array();
-                       $arr['uid' . $uid] = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontent_uid]['uid' . $uid];
-                       $arr['uid' . $uid][$uids[1]] = $value;
-                       $this->div->saveInSession($arr, 'powermail_' . $ttcontent_uid); // save values to session
-               } else { // first level
-                       $arr = array(
-                               'uid' . $uid => $value
-                       );
-                       $this->div->saveInSession($arr, 'powermail_' . $ttcontent_uid); // save values to session
-               }
-               
-               if ($this->debug) {
-                       t3lib_div::debug($arr, 'powermail_' . $ttcontent_uid);
-               }
-    }
-       
-       /**
-        * Get tt_content UID from field UID
-        *
-        * @param       integer $fuid: UID of tx_powermail_fields
-        * @return      integer $uid: tt_content UID
-        */
-       private function getTtcontentUid($fuid) {
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // DB query
-                       'tt_content.uid',
-                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset LEFT JOIN tt_content ON tx_powermail_fieldsets.tt_content = tt_content.uid',
-                       'tx_powermail_fields.uid = ' . intval($fuid),
-                       '',
-                       '',
-                       1
-               );
-               if (!$res) { // If there is a result
-                       return false;
-               }
-
-               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-               return $row['uid'];
-       }
-       
-       /**
-        * Initialize cObj and TSFE Globals
-        *
-        * @return      object  cObj
-        */
-       private function getCObj() {
-               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
-               $userObj = tslib_eidtools::initFeUser();                                            
-               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
-               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 32, 0, true);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-               
-               return t3lib_div::makeInstance('tslib_cObj');
-    }
-       
-}
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php'])       {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php']);
-}
-
-$SOBE = t3lib_div::makeInstance('tx_powermailcond_ajaxWriteInSession_eid'); // make instance
-echo $SOBE->main(); // print content
-?>
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_div.php b/lib/class.tx_powermailcond_div.php
deleted file mode 100644 (file)
index 945b94f..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * This class is for misc stuff and could be called from all other methods of this extension
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage tx_powermailcond_div
- */
-class tx_powermailcond_div {
-
-       public $extKey = 'powermail_cond'; // Extension key
-       public $prefixId = 'tx_powermailcond_pi1';
-       
-       /**
-        * Write values to session
-        *
-        * @param       array   $array: Array for session store
-        * @param       string  $sesName: Session name
-        * @return      void
-        */
-       public function saveInSession($array, $sesName) {
-               // get current stored values from session
-               $oldArray = $GLOBALS['TSFE']->fe_user->getKey('ses', $sesName);
-               
-               // merge old with new values
-               $array = array_merge((array) $oldArray, (array) $array);
-               
-               // store new session
-               $GLOBALS['TSFE']->fe_user->setKey('ses', $sesName, $array); // Generate Session with piVars array
-               $GLOBALS['TSFE']->storeSessionData(); // Save session
-       }
-       
-       /**
-        * Return all values from the session (could be used for debugging, etc..)
-        *
-        * @param       string  $sesName: Session name
-        * @return      array   $array: with session values
-        */
-       public function getAllSessionValues($sesName) {
-               // get current stored values from session
-               $array = $GLOBALS['TSFE']->fe_user->getKey('ses', $sesName);
-               return $array;
-       }
-       
-       /**
-        * Get tt_content UID from field UID
-        *
-        * @param       integer $fuid: UID of tx_powermail_fields
-        * @return      integer $uid: tt_content UID
-        */
-       public function getTtcontentUid($fuid) {
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // DB query
-                       'tt_content.uid',
-                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset LEFT JOIN tt_content ON tx_powermail_fieldsets.tt_content = tt_content.uid',
-                       'tx_powermail_fields.uid = ' . intval($fuid),
-                       '',
-                       '',
-                       1
-               );
-               if (!$res) { // If there is a result
-                       return false;
-               }
-
-               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-               return $row['uid'];
-       }
-       
-       /**
-        * Write values to session
-        *
-        * @param       array   $conf: Configuration Array
-        * @return      array   $array: With all Startfields
-        */
-       public function getStartFields($conf) {
-               $array = array();
-               foreach ((array) $conf as $confLevel1) {
-                       foreach ((array) $confLevel1 as $confLevel2) {
-                               if (!empty($confLevel2['startField'])) {
-                                       $array[] = $confLevel2['startField'];
-                               }
-                       }
-               }
-               return $array;
-       }
-       
-}
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php'])  {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php']);
-}
-?>
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_fields_be.php b/lib/class.tx_powermailcond_fields_be.php
deleted file mode 100644 (file)
index e83d38e..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010 Alex Kellner <alexander.kellner@in2code.de>, in2code.
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Class/Function which manipulates the item-array for table/field tx_powermailcond_rules_fieldname.
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage tx_powermailcond_fields_be
- */
-class tx_powermailcond_fields_be {
-       
-       /**
-        * show all fields in the backend
-        *
-        * @param       array   $params: Params
-        * @param       object  $pObj: Parent Object
-        * @return      void
-        */
-       public function fieldname(&$params, $pObj)      {
-               $where = '1';
-               if (isset($params['config']['itemsProcFuncValue'])) { // additional where clause
-                       $where = 'formtype IN (' . $params['config']['itemsProcFuncValue'] . ')';
-               }
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                       $select = 'uid, title',
-                       $from = 'tx_powermail_fields',
-                       $where .= ' AND pid = ' . intval($params['row']['pid']) . ' AND hidden = 0 AND deleted = 0',
-                       $groupBy = '',
-                       $orderBy = 'sorting',
-                       $limit = ''
-               );
-               if ($res) {
-                       $params['items'][] = array('powermail Fields', '--div--');
-                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               $params['items'][] = array($pObj->sL($row['title']) . ' (' . $row['uid'] . ')', $row['uid']);
-                       }
-               }
-               
-               if (isset($params['config']['itemsProcFunc_addFieldsets'])) { // add fieldsets to selection
-                       $params['items'] = array_merge((array) $params['items'], $this->getFieldsets($params['row']['pid'])); // add some fieldsets
-               }
-       }
-       
-       /**
-        * give me all fieldsets in an array
-        *
-        * @param       integer $pid: Page ID
-        * @return      array   $arr: all fieldsets with its name and the fieldset uid
-        */
-       public function getFieldsets($pid) {
-               $arr = array();
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                       $select = 'uid, title',
-                       $from = 'tx_powermail_fieldsets',
-                       $where .= 'pid = ' . intval($pid) . ' AND hidden = 0 AND deleted = 0',
-                       $groupBy = '',
-                       $orderBy = 'sorting',
-                       $limit = ''
-               );
-               if ($res) {
-                       $arr[] = array('powermail Fieldsets', '--div--');
-                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                               $arr[] = array($row['title'] . ' (' . $row['uid'] . ')', 'fieldset:' . $row['uid']);
-                       }
-               }
-               return $arr;
-       }
-       
-       /**
-        * List values of a powermail selectorbox
-        *
-        * @param       array   $params: Params
-        * @param       object  $pObj: Parent Object
-        * @return      void
-        */
-       public function valuesFromPowermailSelectbox(&$params, $pObj) {
-               // Get targetField UID
-               $gParams = t3lib_div::_GET('edit');
-               $gParams2 = $gParams['tx_powermailcond_conditions'];
-               foreach ((array) $gParams2 as $uid => $actions) {
-                       $thisConditionsUid = $uid;
-               }
-               $targetField = $pObj->cachedTSconfig['tx_powermailcond_conditions:' . $thisConditionsUid]['_THIS_ROW']['targetField'];
-               
-               // Read values from powermail 
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                       $select = 'flexform',
-                       $from = 'tx_powermail_fields',
-                       $where = 'uid = ' . intval($targetField),
-                       $groupBy = '',
-                       $orderBy = '',
-                       $limit = '1'
-               );
-               if ($res) {
-                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-               }
-               
-               // Change xml to a readable format
-               $arr = (array) t3lib_div::xml2array($row['flexform']);
-               $optionlist = $arr['data']['sDEF']['lDEF']['options']['vDEF'];
-               $options = t3lib_div::trimExplode("\n", $optionlist, 1);
-               
-               // write params
-               foreach ((array) $options as $option) {
-                       $params['items'][] = array(htmlspecialchars($option), htmlspecialchars($option));
-               }
-       }
-}
-
-
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/class.tx_powermailcond_fields_be.php'])        {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/class.tx_powermailcond_fields_be.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/lib/class.tx_powermailcond_pidContainer.php b/lib/class.tx_powermailcond_pidContainer.php
deleted file mode 100644 (file)
index 5bdd86b..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2011 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * This class adds a pid container hidden field at the end of a powermail form
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage tx_powermailcond_pidContainer
- */
-class tx_powermailcond_pidContainer {
-
-       public $extKey = 'powermail_cond'; // Extension key
-       public $prefixId = 'tx_powermailcond_pi1';
-       
-       /**
-        * Return all values from the session (could be used for debugging, etc..)
-        *
-        * @param       array   Outer Marker Array
-        * @param       array   Subpart Array
-        * @param       array   TypoScript configuration
-        * @param       object  Parent object
-        * @return      void
-        */
-       public function PM_FormWrapMarkerHook($markerArray, &$subpartArray, $conf, $pObj) {
-               if (isset($subpartArray['###POWERMAIL_CONTENT###'])) {
-                       $subpartArray['###POWERMAIL_CONTENT###'] .= '<input type="hidden" id="powermail_cond_pid_container" name="powermail_cond_pid_container" value="' . intval($GLOBALS['TSFE']->id) . '" />';
-               }
-       }
-       
-}
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php'])  {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php']);
-}
-?>
\ No newline at end of file
diff --git a/oldDoc/manual.sxw b/oldDoc/manual.sxw
new file mode 100644 (file)
index 0000000..1d9116d
Binary files /dev/null and b/oldDoc/manual.sxw differ
diff --git a/oldFiles/js/powermail_cond.js b/oldFiles/js/powermail_cond.js
new file mode 100644 (file)
index 0000000..2d09b8f
--- /dev/null
@@ -0,0 +1,209 @@
+$(document).ready(function() {
+       var fieldsOnChange = '.powermail_text, .powermail_textarea, .powermail_select, .powermail_radio, .powermail_check'; // all fields with events
+       if ($('form.tx_powermail_pi1_form').length > 0) { // only if the powermail form is on the page (not for confirmation page)
+               checkConditions(0); // check if something should be changed
+       }
+       
+       // save values via ajax to session
+       $(fieldsOnChange).change(function() {
+               //var url = self.location.href;
+               var pid = $('#powermail_cond_pid_container').val();
+               var url = '/index.php';
+               var timestamp = Number(new Date()); // timestamp is needed for a internet explorer workarround (always change a parameter)
+               var value = $(this).val(); // current value
+               var uid = $(this).attr('id').substr(3); // current uid (without "uid")
+               if ($(this).attr('type') == 'radio') { // if field is a radiobutton
+                       var tmp_uid = uid.split('_'); // split on _
+                       uid = tmp_uid[0]; // we want only the uid (not the subuid)
+               }
+               var name = $(this).attr('name');
+               if (this.type == 'checkbox' && this.checked == false) { // no checkbox workarround
+                       value = '';
+               }
+               if (name.indexOf('tx_powermail_pi1') == '-1') { // if checkbox workarround from powermail
+                       var value = $('#' + name.substr(6)).val();
+                       var uid = $('#' + name.substr(6)).attr('id').substr(3);
+               }
+               var params = 'eID=' + 'powermailcond_saveToSession' + '&id=' + pid + '&tx_powermailcond_pi1[uid]=' + uid + '&tx_powermailcond_pi1[value]=' + value + '&ts=' + timestamp;
+               
+               $.ajax({
+                       type: 'GET', // type
+                       url: url, // send to this url
+                       data: params, // add params
+                       cache: false, // disable cache (for ie)
+                       success: function(data) { // return values
+                               if (data != '') { // if there is a response
+                                       //alert(data); // alert the response
+                                       $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in change function:' + data);
+                               }
+                               checkConditions(uid); // check if something should be changed
+                       }
+               });
+       });
+       
+});
+
+/**
+ * Main function to check conditions and do something (if necessary)
+ *
+ * @param      integer uid: Field uid (if available)
+ * @return     void
+ */
+function checkConditions(uid) {
+       //var url = self.location.href;
+       var pid = $('#powermail_cond_pid_container').val();
+       var url = '/index.php';
+       var params = '';
+       if (uid > 0) {
+               params += '&tx_powermailcond_pi1[uid]=' + uid;
+       }
+       $.ajax({
+               type: 'GET', // type
+               url: url, // send to this url
+               data: 'eID=' + 'powermailcond_getFieldStatus' + params + '&id=' + pid, // add params
+               cache: false, // disable cache (for ie)
+               beforeSend: function() {
+                       document.body.style.cursor = 'progress'; // change cursor to busy
+               },
+               complete: function() {
+                       document.body.style.cursor = 'auto'; // normal cursor
+               },
+               success: function(data) { // return values
+                       if (data != 'nochange') {
+                               $('.powermail_select option').show(); // show all options at the beginning
+                               $('.powermail_select option').removeAttr('disabled'); // enable all options at the beginning
+                               if (data != '') { // if there is a response
+                                       if (data.length < 500) { // stop if wrong result (maybe complete t3 page)
+                                               doAction(data); // hide all given fields
+                                       }
+                               } else { // if there is no response
+                                       $('.tx_powermail_pi1_fieldwrap_html').show(); // show all fields
+                                       $('.tx-powermail-pi1_fieldset').show(); // show all fieldsets at the beginning
+                               }
+                       }
+               },
+               error: function() {
+                       //alert("Error in powermail_cond.js:\n");
+                       $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in checkCondtions function by opening the url ' + url + '?' + data);
+               }
+       });
+}
+
+/**
+ * Do some actions (hide and/or filter)
+ *
+ * @param      string  list: commaseparated list with uids (1,2,3)
+ * @return     void
+ */
+function doAction(list) {
+       $('.tx_powermail_pi1_fieldwrap_html').show(); // show all fields at the beginning
+       $('.tx-powermail-pi1_fieldset').show(); // show all fieldsets at the beginning
+       
+       var uid = list.split(',');
+       if (uid.length < 1) { 
+               return false; // stop process   
+       }
+       for (i=0; i<uid.length; i++) { // one loop for every affected field
+               if (uid[i].indexOf('fieldset:') != '-1') { // fieldset part
+                       hideFieldset(uid[i]);
+               } else if (uid[i].indexOf('filter:') != '-1') { // filter part
+                       filterSelection(uid[i]);
+               } else { // fields part
+                       hideField(uid[i]);
+               }
+       }
+}
+
+/**
+ * Hide some fields and clear there value
+ *
+ * @param      string  string: mix of uid and values (fieldset:5:12;13;14)
+ * @return     void
+ */
+function hideFieldset(string) {
+       var params = string.split(':'); // filter / uid / values
+       var values = params[2].split(';'); // value1 / value2 / value3
+       $('fieldset.tx-powermail-pi1_fieldset_' + params[1]).hide(); // hide current fieldset
+       for (k=0; k<values.length; k++) { // one loop for every field inside the fieldset
+               clearValue('.powermail_uid' + values[k]); // clear value of current field
+       }
+}
+
+/**
+ * Hide some fields and clear there value
+ *
+ * @param      integer uid: uid of the element
+ * @return     void
+ */
+function hideField(uid) {
+       $('div.tx_powermail_pi1_fieldwrap_html_' + uid).hide(); // hide current field
+       if ($('.powermail_uid' + uid).val() != '') { // only if value is not yet empty
+               clearValue('.powermail_uid' + uid); // clear value of current field
+               clearSession(uid); // clear value of current field
+       }
+}
+
+/**
+ * Hide some fields and clear there value
+ *
+ * @param      string  string: mix of uid and values (filter:123:Value1;Value2;Value3)
+ * @return     void
+ */
+function filterSelection(string) {
+       var params = string.split(':'); // filter / uid / values
+       var values = params[2].split(';'); // value1 / value2 / value3
+       $('select.powermail_uid' + params[1] + ' option').hide(); // disable all options
+       $('select.powermail_uid' + params[1] + ' option').attr('disabled', 'disabled'); // disable all options
+       
+       for (j=0; j<values.length; j++) { // one loop for every option in select field
+               $('select.powermail_uid' + params[1] + ' option:contains(' + values[j] + ')').show(); // show this option
+               $('select.powermail_uid' + params[1] + ' option:contains(' + values[j] + ')').removeAttr('disabled'); // enable this option
+       }
+       
+       var valueSelected = $('select.powermail_uid' + params[1] + ' option:selected').val(); // give me the value of the selected option
+       if (params[2].indexOf(valueSelected) == '-1') { // if current selected value is one of the not allowed options
+               $('select.powermail_uid' + params[1]).get(0).selectedIndex = 0; // remove selection (because the selected option is not allowed)
+       }
+}
+
+/**
+ * Clear value of an inputfield, set selectedIndex to 0 for selection and so on
+ *
+ * @param      string  selection: selection for jQuery (e.g. input.powermail)
+ * @return     void
+ */
+function clearValue(selection) {
+       if ($(selection).attr('type') == 'radio' || $(selection).attr('type') == 'checkbox') {
+               $(selection).attr('checked', false);
+       } else {
+               $(selection).val('');
+       }
+}
+
+/**
+ * Clear session of a uid
+ *
+ * @param      integer uid: uid of the element
+ * @return     void
+ */
+function clearSession(uid) {
+       //var url = self.location.href;
+       var pid = $('#powermail_cond_pid_container').val();
+       var url = '/index.php';
+       var timestamp = Number(new Date()); // timestamp is needed for a internet explorer workarround (always change a parameter)
+       var params = 'eID=' + 'powermailcond_saveToSession' + '&id=' + pid + '&tx_powermailcond_pi1[uid]=' + uid + '&tx_powermailcond_pi1[value]=&ts=' + timestamp;
+       
+       $.ajax({
+               type: 'GET', // type
+               url: url, // send to this url
+               data: params, // add params
+               cache: false, // disable cache (for ie)
+               success: function(data) { // return values
+                       if (data != '') { // if there is a response
+                               //alert(data); // alert the response
+                               $('form.tx_powermail_pi1_form').append('Error in powermail_cond.js in clearSession function:' + data);
+                       }
+                       checkConditions(uid); // check if something should be changed
+               }
+       });
+};
\ No newline at end of file
diff --git a/oldFiles/static/constants.txt b/oldFiles/static/constants.txt
new file mode 100644 (file)
index 0000000..7840948
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Unbenanntes Dokument</title>
+</head>
+
+<body>
+</body>
+</html>
diff --git a/oldFiles/static/setup.txt b/oldFiles/static/setup.txt
new file mode 100644 (file)
index 0000000..716786c
--- /dev/null
@@ -0,0 +1,7 @@
+page.headerData.3131 = TEXT
+page.headerData.3131.value (
+       <meta http-equiv="expires" content="0" />
+       <meta http-equiv="cache-control" content="no-cache" />
+       <meta http-equiv="pragma" content="no-cache" />
+)
+page.includeJSFooter.powermail_cond = EXT:powermail_cond/files/js/powermail_cond.js
\ No newline at end of file
diff --git a/oldLib/class.tx_powermailcond_ajaxFieldList_eid.php b/oldLib/class.tx_powermailcond_ajaxFieldList_eid.php
new file mode 100644 (file)
index 0000000..ccddd0b
--- /dev/null
@@ -0,0 +1,330 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+require_once(PATH_t3lib . 'class.t3lib_befunc.php');
+require_once(PATH_t3lib . 'stddb/tables.php');
+require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
+require_once(PATH_tslib . 'class.tslib_pibase.php');
+require_once(PATH_tslib . 'class.tslib_fe.php');
+require_once(PATH_t3lib . 'class.t3lib_page.php');
+require_once(t3lib_extMgm::extPath('powermail_cond') . 'lib/class.tx_powermailcond_div.php'); // load div class
+
+/**
+ * This class tells jQuery which field are allowed in which are not allowed
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_ajaxWriteInSession_eid
+ */
+class tx_powermailcond_ajaxFieldList_eid extends tslib_pibase {
+
+       public $extKey = 'powermail_cond'; // Extension key
+       public $prefixId = 'tx_powermailcond_pi1';
+       public $piVars;
+       private $content = '';
+       
+       /**
+        * Return list with fields which are not allowed (should be hidden)
+        *
+        * @return      string  $content:       commaseparated field list (1,2,3) 
+        *                                                              complex list could be:
+        *                                                              filter:12:option1;option2,12,13,fieldset:2:18;19 
+        *                                                              explanation - filter select.uid12, hide uid12, hide uid3, hide fieldset uid2 and clear uid18 and uid19
+        */
+    public function main() {
+               $this->cObj = $this->getCObj(); // enable TSFE globals
+               $conditions = $this->getConditionsFromThisPage(); // get conditions from database
+               $targetFields = $this->div->getStartFields($conditions); // get all startfields in an array
+               if ($this->piVars['uid'] > 0 && !in_array($this->piVars['uid'], $targetFields)) { // if current field uid given and this
+                       return 'nochange';
+               }
+               
+               foreach ((array) $conditions as $targetUid => $conf) { // one loop for every single target field
+                       $content .= $this->checkRules($conf) . ','; // add list to content object
+               }
+               
+               $content = t3lib_div::rm_endcomma($content); // remove last ,
+               $content = t3lib_div::uniqueList($content); // remove double values
+               
+               return $content;
+    }
+       
+       /**
+        * Preflight function checks the rules if there should be an action (show/hide) or not
+        *
+        * @param       array   $conf: Configuration of current field
+        * @return      boolean true:hide false:show(nothing)
+        */
+       public function checkRules($conf) {
+               $content = '';
+               $do = 0; // start with 0
+               if ($conf[0]['conjunction'] == 'AND') {
+                       $do = 1; // start with 1
+               }
+               
+               foreach ((array) $conf as $key => $subconf) { // one loop for every rule of current target field
+                       $ttcontentUid = $this->div->getTtcontentUid($conf[$key]['startField']);
+                       
+                       // special case: hide a field from the beginning
+                       if ($conf[$key]['actions'] == 1) { // show
+                               $content .= $this->getFieldsFromFieldset($conf[$key]['targetField'], $ttcontentUid) . ',';
+                       }
+                        
+                       // operations
+                       $act = 0;
+                       $startFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['startField']]; // get startfield value from session
+                       if (is_array($startFieldSession)) { // if second level
+                               $startFieldSession = implode(',', $startFieldSession); // get all values in a commaseparated list
+                       }
+                       switch ($conf[$key]['ops']) {
+                               case 0: // "not empty"
+                                       if ($startFieldSession != '') { // if start field value in session is not empty
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 1: // "empty"
+                                       if ($startFieldSession == '') { // if start field value in session is empty
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 2: // "contains"
+                                       if (stristr($startFieldSession, $conf[$key]['condstring'])) { // if start field value in session contains condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 3: // "not contains"
+                                       if (!stristr($startFieldSession, $conf[$key]['condstring'])) { // if start field value in session contains not condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 4: // "is"
+                                       if ($startFieldSession === $conf[$key]['condstring']) { // if start field value in session === condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 5: // "is not"
+                                       if ($startFieldSession !== $conf[$key]['condstring']) { // if start field value in session is not condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 6: // "is greater than"
+                                       if (intval($startFieldSession) > intval($conf[$key]['condstring'])) { // if start field value in session is greater than condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       } 
+                                       break;
+                                       
+                               case 7: // "is less than"
+                                       if (intval($startFieldSession) < intval($conf[$key]['condstring'])) { // if start field value in session is greater than condstring
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       }
+                                       break;
+                                       
+                               case 8: // "contains value from field"
+                                       $comparisonFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['equalField']]; // get comparisonfield value from session
+                                       if (stristr($comparisonFieldSession, $startFieldSession)) {
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       }
+                                       break;
+                                       
+                               case 9: // "contains not value from field"
+                                       $comparisonFieldSession = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontentUid]['uid' . $conf[$key]['equalField']]; // get comparisonfield value from session
+                                       if (!stristr($comparisonFieldSession, $startFieldSession)) {
+                                               $act = 1;
+                                               $tmp_conf = $conf[$key];
+                                       }
+                                       break;
+                       }
+                       
+                       $do = $this->setDo(($act ? 1 : 0), $do, $conf[$key]['conjunction']); // $do = 1;
+               }
+               
+               $content = $this->doAction($do, $content, $ttcontentUid, $tmp_conf); // add new field if needed
+               return t3lib_div::rm_endcomma($content); // return commaseparated list
+       }
+       
+       /**
+        * This function return current field uid if this field should be hidden (and removes value from session)
+        *
+        * @param       boolean $do: If something should be done or not
+        * @param       string  $content: List with all fields which should be hidden
+        * @param       integer $ttcontentUid: UID of this tt_content
+        * @param       array   $conf: Configuration of current field
+        * @return      string list
+        */
+       public function doAction($do, $content, $ttcontentUid, $conf) {
+               if (!$do) {
+                       return $content;
+               }
+               
+               switch ($conf['actions']) {
+                       case 0: // hide
+                               $this->div->saveInSession(array('uid' . $conf['targetField'] => ''), 'powermail_' . $ttcontentUid); // remove value from session of this field
+                               $content .= $this->getFieldsFromFieldset($conf['targetField'], $ttcontentUid, 1) . ','; // hide this field
+                               break;
+                               
+                       case 1: // show
+                               $content = t3lib_div::rmFromList($this->getFieldsFromFieldset($conf['targetField'], $ttcontentUid), $content); // remove from hidelist (show this field)
+                               break;
+                               
+                       case 2: // filter from selectbox
+                               $content .= 'filter:' . $conf['targetField'] . ':' . str_replace(',', ';', $conf['filterSelectField']);
+                               break;
+               }
+               
+               return $content;
+       }
+       
+       /**
+        * Set a value to 0 or 1 depending on previous value and on conjunction (AND/OR)
+        *
+        * @param       boolean $newStatus: New status
+        * @param       boolean $oldStatus: Old status
+        * @param       string  $conjunction: AND or OR
+        * @return      boolean
+        */
+       private function setDo($newStatus, $oldStatus = 0, $conjunction = 'OR') {
+               //t3lib_div::debug(array($newStatus, $oldStatus), $conjunction);
+               if ($conjunction == 'OR') {
+                       if ($newStatus || $oldStatus) {
+                               return 1;
+                       } else {
+                               return 0;
+                       }
+               } elseif ($conjunction == 'AND') {
+                       if ($newStatus && $oldStatus) {
+                               return 1;
+                       } else {
+                               return 0;
+                       }
+               }
+       }
+       
+       /**
+        * get condition as array from current page
+        *
+        * @return      array   $arr: Array with all conditions of the current page
+        */
+       private function getConditionsFromThisPage() {
+               $arr = array();
+               $pid = t3lib_div::_GET('id');
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // Get all rules to current field
+                       'tx_powermailcond_conditions.targetField, tx_powermailcond_conditions.actions, tx_powermailcond_conditions.conjunction, tx_powermailcond_conditions.filterSelectField, tx_powermailcond_rules.startField, tx_powermailcond_rules.ops, tx_powermailcond_rules.condstring, tx_powermailcond_rules.equalField',
+                       'tx_powermailcond_conditions LEFT JOIN tx_powermailcond_rules ON tx_powermailcond_conditions.uid = tx_powermailcond_rules.conditions',
+                       $where_clause = (intval($pid) ? 'tx_powermailcond_conditions.pid = ' . intval($pid) : '1') . $this->cObj->enableFields('tx_powermailcond_conditions') . $this->cObj->enableFields('tx_powermailcond_rules'),
+                       $groupBy = 'tx_powermailcond_rules.uid',
+                       $orderBy = '',
+                       $limit = '1000'
+               );
+               if ($res) { // If there is a result
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // One loop for every rule on current page
+                               $arr[$row['targetField']][] = $row;
+                       }
+                       
+                       return $arr;
+               }
+       }
+       
+       /**
+        * Get all fields in a commaseparated list from a fieldset uid
+        *
+        * @param       integer $uid: Fieldset UID
+        * @param       integer $ttcontentUid: UID of this tt_content
+        * @param       boolean $clearSession: Clear cache of each of this fields
+        * @return      string  $list: Commaseparated List with field uids
+        */
+       private function getFieldsFromFieldset($uid, $ttcontentUid, $clearSession = 0) {
+               if (is_numeric($uid)) { // if this uid don't contains fs (for fs123)
+                       return $uid;
+               }
+               
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (
+                       'tx_powermail_fields.uid',
+                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset',
+                       $where = 'tx_powermail_fieldsets.uid = ' . intval(str_replace('fieldset:', '', $uid)),
+                       $groupBy = '',
+                       $orderBy = '',
+                       $limit = '1000'
+               );
+               if ($res) { // If there is a result
+                       $uids = '';
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { // One loop for every field
+                               $uids .= $row['uid'] . ';';
+                               $this->div->saveInSession(array('uid' . $row['uid'] => ''), 'powermail_' . $ttcontentUid); // remove value from session of this field
+                       }
+               }
+               
+               if (!isset($uids)) {
+                       return $uid;
+               }
+               
+               return $uid . ':' . substr($uids, 0, -1); // return without last ;
+       }
+       
+       /**
+        * Initialize cObj and TSFE Globals
+        *
+        * @return      object  cObj
+        */
+       private function getCObj() {
+               $this->piVars = t3lib_div::_GET($this->prefixId);
+               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
+               $userObj = tslib_eidtools::initFeUser();                                            
+               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
+               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 0, 0, true);
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+               
+               return t3lib_div::makeInstance('tslib_cObj');
+    }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxFieldList_eid.php'])    {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxFieldList_eid.php']);
+}
+
+$SOBE = t3lib_div::makeInstance('tx_powermailcond_ajaxFieldList_eid'); // make instance
+echo $SOBE->main(); // print content
+?>
\ No newline at end of file
diff --git a/oldLib/class.tx_powermailcond_ajaxWriteInSession_eid.php b/oldLib/class.tx_powermailcond_ajaxWriteInSession_eid.php
new file mode 100644 (file)
index 0000000..1f8449b
--- /dev/null
@@ -0,0 +1,135 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+require_once(PATH_t3lib . 'class.t3lib_befunc.php');
+require_once(PATH_t3lib . 'stddb/tables.php');
+require_once(t3lib_extMgm::extPath('cms', 'ext_tables.php'));
+require_once(PATH_tslib . 'class.tslib_pibase.php');
+require_once(t3lib_extMgm::extPath('powermail_cond') . 'lib/class.tx_powermailcond_div.php'); // load div class
+
+/**
+ * This class is for storing values to the session on every fieldchange (via AJAX)
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_ajaxWriteInSession_eid
+ */
+class tx_powermailcond_ajaxWriteInSession_eid extends tslib_pibase {
+
+       public $extKey = 'powermail_cond'; // Extension key
+       public $prefixId = 'tx_powermailcond_pi1';
+       private $debug = false;
+       
+       /**
+        * Write values to session - main method called via AJAX
+        * Call this with index.php?id=97&eID=powermailcond_ajax&tx_powermailcond_pi1[uid]=5&tx_powermailcond_pi1[value]=test
+        *
+        * @return      void
+        */
+    public function main() {
+               // config
+               $this->getCObj(); // enable TSFE globals
+               $GLOBALS['TSFE']->sesData = tslib_eidtools::initFeUser();
+               $piVars = t3lib_div::_GP($this->prefixId); // GET param
+               $uids = t3lib_div::trimExplode('_', $piVars['uid']);
+               $uid = intval($uids[0]); // uid of current field
+               $value = htmlspecialchars($piVars['value']); // value from current field
+               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
+               $ttcontent_uid = $this->div->getTtcontentUid($uid); // get tt_content uid to current field
+               
+               // start
+               if ($uid == 0) {
+                       return false;
+               }
+               if (isset($uids[1])) { // second level
+                       $oldSession = array();
+                       $arr['uid' . $uid] = $GLOBALS['TSFE']->fe_user->sesData['powermail_' . $ttcontent_uid]['uid' . $uid];
+                       $arr['uid' . $uid][$uids[1]] = $value;
+                       $this->div->saveInSession($arr, 'powermail_' . $ttcontent_uid); // save values to session
+               } else { // first level
+                       $arr = array(
+                               'uid' . $uid => $value
+                       );
+                       $this->div->saveInSession($arr, 'powermail_' . $ttcontent_uid); // save values to session
+               }
+               
+               if ($this->debug) {
+                       t3lib_div::debug($arr, 'powermail_' . $ttcontent_uid);
+               }
+    }
+       
+       /**
+        * Get tt_content UID from field UID
+        *
+        * @param       integer $fuid: UID of tx_powermail_fields
+        * @return      integer $uid: tt_content UID
+        */
+       private function getTtcontentUid($fuid) {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // DB query
+                       'tt_content.uid',
+                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset LEFT JOIN tt_content ON tx_powermail_fieldsets.tt_content = tt_content.uid',
+                       'tx_powermail_fields.uid = ' . intval($fuid),
+                       '',
+                       '',
+                       1
+               );
+               if (!$res) { // If there is a result
+                       return false;
+               }
+
+               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               return $row['uid'];
+       }
+       
+       /**
+        * Initialize cObj and TSFE Globals
+        *
+        * @return      object  cObj
+        */
+       private function getCObj() {
+               $this->div = t3lib_div::makeInstance('tx_powermailcond_div'); // Create new instance for div class
+               $userObj = tslib_eidtools::initFeUser();                                            
+               $temp_TSFEclassName = t3lib_div::makeInstance('tslib_fe');
+               $GLOBALS['TSFE'] = new $temp_TSFEclassName($TYPO3_CONF_VARS, 32, 0, true);
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+               
+               return t3lib_div::makeInstance('tslib_cObj');
+    }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php'])       {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_ajaxWriteInSession_eid.php']);
+}
+
+$SOBE = t3lib_div::makeInstance('tx_powermailcond_ajaxWriteInSession_eid'); // make instance
+echo $SOBE->main(); // print content
+?>
\ No newline at end of file
diff --git a/oldLib/class.tx_powermailcond_div.php b/oldLib/class.tx_powermailcond_div.php
new file mode 100644 (file)
index 0000000..945b94f
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * This class is for misc stuff and could be called from all other methods of this extension
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_div
+ */
+class tx_powermailcond_div {
+
+       public $extKey = 'powermail_cond'; // Extension key
+       public $prefixId = 'tx_powermailcond_pi1';
+       
+       /**
+        * Write values to session
+        *
+        * @param       array   $array: Array for session store
+        * @param       string  $sesName: Session name
+        * @return      void
+        */
+       public function saveInSession($array, $sesName) {
+               // get current stored values from session
+               $oldArray = $GLOBALS['TSFE']->fe_user->getKey('ses', $sesName);
+               
+               // merge old with new values
+               $array = array_merge((array) $oldArray, (array) $array);
+               
+               // store new session
+               $GLOBALS['TSFE']->fe_user->setKey('ses', $sesName, $array); // Generate Session with piVars array
+               $GLOBALS['TSFE']->storeSessionData(); // Save session
+       }
+       
+       /**
+        * Return all values from the session (could be used for debugging, etc..)
+        *
+        * @param       string  $sesName: Session name
+        * @return      array   $array: with session values
+        */
+       public function getAllSessionValues($sesName) {
+               // get current stored values from session
+               $array = $GLOBALS['TSFE']->fe_user->getKey('ses', $sesName);
+               return $array;
+       }
+       
+       /**
+        * Get tt_content UID from field UID
+        *
+        * @param       integer $fuid: UID of tx_powermail_fields
+        * @return      integer $uid: tt_content UID
+        */
+       public function getTtcontentUid($fuid) {
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery ( // DB query
+                       'tt_content.uid',
+                       'tx_powermail_fieldsets LEFT JOIN tx_powermail_fields ON tx_powermail_fieldsets.uid = tx_powermail_fields.fieldset LEFT JOIN tt_content ON tx_powermail_fieldsets.tt_content = tt_content.uid',
+                       'tx_powermail_fields.uid = ' . intval($fuid),
+                       '',
+                       '',
+                       1
+               );
+               if (!$res) { // If there is a result
+                       return false;
+               }
+
+               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               return $row['uid'];
+       }
+       
+       /**
+        * Write values to session
+        *
+        * @param       array   $conf: Configuration Array
+        * @return      array   $array: With all Startfields
+        */
+       public function getStartFields($conf) {
+               $array = array();
+               foreach ((array) $conf as $confLevel1) {
+                       foreach ((array) $confLevel1 as $confLevel2) {
+                               if (!empty($confLevel2['startField'])) {
+                                       $array[] = $confLevel2['startField'];
+                               }
+                       }
+               }
+               return $array;
+       }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php']);
+}
+?>
\ No newline at end of file
diff --git a/oldLib/class.tx_powermailcond_fields_be.php b/oldLib/class.tx_powermailcond_fields_be.php
new file mode 100644 (file)
index 0000000..e83d38e
--- /dev/null
@@ -0,0 +1,138 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010 Alex Kellner <alexander.kellner@in2code.de>, in2code.
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Class/Function which manipulates the item-array for table/field tx_powermailcond_rules_fieldname.
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_fields_be
+ */
+class tx_powermailcond_fields_be {
+       
+       /**
+        * show all fields in the backend
+        *
+        * @param       array   $params: Params
+        * @param       object  $pObj: Parent Object
+        * @return      void
+        */
+       public function fieldname(&$params, $pObj)      {
+               $where = '1';
+               if (isset($params['config']['itemsProcFuncValue'])) { // additional where clause
+                       $where = 'formtype IN (' . $params['config']['itemsProcFuncValue'] . ')';
+               }
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $select = 'uid, title',
+                       $from = 'tx_powermail_fields',
+                       $where .= ' AND pid = ' . intval($params['row']['pid']) . ' AND hidden = 0 AND deleted = 0',
+                       $groupBy = '',
+                       $orderBy = 'sorting',
+                       $limit = ''
+               );
+               if ($res) {
+                       $params['items'][] = array('powermail Fields', '--div--');
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                               $params['items'][] = array($pObj->sL($row['title']) . ' (' . $row['uid'] . ')', $row['uid']);
+                       }
+               }
+               
+               if (isset($params['config']['itemsProcFunc_addFieldsets'])) { // add fieldsets to selection
+                       $params['items'] = array_merge((array) $params['items'], $this->getFieldsets($params['row']['pid'])); // add some fieldsets
+               }
+       }
+       
+       /**
+        * give me all fieldsets in an array
+        *
+        * @param       integer $pid: Page ID
+        * @return      array   $arr: all fieldsets with its name and the fieldset uid
+        */
+       public function getFieldsets($pid) {
+               $arr = array();
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $select = 'uid, title',
+                       $from = 'tx_powermail_fieldsets',
+                       $where .= 'pid = ' . intval($pid) . ' AND hidden = 0 AND deleted = 0',
+                       $groupBy = '',
+                       $orderBy = 'sorting',
+                       $limit = ''
+               );
+               if ($res) {
+                       $arr[] = array('powermail Fieldsets', '--div--');
+                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                               $arr[] = array($row['title'] . ' (' . $row['uid'] . ')', 'fieldset:' . $row['uid']);
+                       }
+               }
+               return $arr;
+       }
+       
+       /**
+        * List values of a powermail selectorbox
+        *
+        * @param       array   $params: Params
+        * @param       object  $pObj: Parent Object
+        * @return      void
+        */
+       public function valuesFromPowermailSelectbox(&$params, $pObj) {
+               // Get targetField UID
+               $gParams = t3lib_div::_GET('edit');
+               $gParams2 = $gParams['tx_powermailcond_conditions'];
+               foreach ((array) $gParams2 as $uid => $actions) {
+                       $thisConditionsUid = $uid;
+               }
+               $targetField = $pObj->cachedTSconfig['tx_powermailcond_conditions:' . $thisConditionsUid]['_THIS_ROW']['targetField'];
+               
+               // Read values from powermail 
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $select = 'flexform',
+                       $from = 'tx_powermail_fields',
+                       $where = 'uid = ' . intval($targetField),
+                       $groupBy = '',
+                       $orderBy = '',
+                       $limit = '1'
+               );
+               if ($res) {
+                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               }
+               
+               // Change xml to a readable format
+               $arr = (array) t3lib_div::xml2array($row['flexform']);
+               $optionlist = $arr['data']['sDEF']['lDEF']['options']['vDEF'];
+               $options = t3lib_div::trimExplode("\n", $optionlist, 1);
+               
+               // write params
+               foreach ((array) $options as $option) {
+                       $params['items'][] = array(htmlspecialchars($option), htmlspecialchars($option));
+               }
+       }
+}
+
+
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/class.tx_powermailcond_fields_be.php'])        {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/class.tx_powermailcond_fields_be.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/oldLib/class.tx_powermailcond_pidContainer.php b/oldLib/class.tx_powermailcond_pidContainer.php
new file mode 100644 (file)
index 0000000..5bdd86b
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2011 Alexander Kellner <alexander.kellner@in2code.de>, in2code.
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * This class adds a pid container hidden field at the end of a powermail form
+ *
+ * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
+ * @package    TYPO3
+ * @subpackage tx_powermailcond_pidContainer
+ */
+class tx_powermailcond_pidContainer {
+
+       public $extKey = 'powermail_cond'; // Extension key
+       public $prefixId = 'tx_powermailcond_pi1';
+       
+       /**
+        * Return all values from the session (could be used for debugging, etc..)
+        *
+        * @param       array   Outer Marker Array
+        * @param       array   Subpart Array
+        * @param       array   TypoScript configuration
+        * @param       object  Parent object
+        * @return      void
+        */
+       public function PM_FormWrapMarkerHook($markerArray, &$subpartArray, $conf, $pObj) {
+               if (isset($subpartArray['###POWERMAIL_CONTENT###'])) {
+                       $subpartArray['###POWERMAIL_CONTENT###'] .= '<input type="hidden" id="powermail_cond_pid_container" name="powermail_cond_pid_container" value="' . intval($GLOBALS['TSFE']->id) . '" />';
+               }
+       }
+       
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/powermail_cond/lib/class.tx_powermailcond_div.php']);
+}
+?>
\ No newline at end of file