Working Copy
authorwunschtacho <wunschtacho@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 18 Oct 2012 10:33:19 +0000 (10:33 +0000)
committerwunschtacho <wunschtacho@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 18 Oct 2012 10:33:19 +0000 (10:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/powermail_cond/trunk@67260 735d13b6-9817-0410-8766-e36946ffe9aa

.idea/workspace.xml
Classes/Utility/FieldlistingBackend.php
Resources/Public/Js/PowermailCond.js

index ac0ff73..e234df0 100644 (file)
   </component>\r
   <component name="FileEditorManager">\r
     <leaf>\r
-      <file leaf-file-name="PowermailCond.js" pinned="false" current="false" current-in-tab="false">\r
+      <file leaf-file-name="PowermailCond.js" pinned="false" current="true" current-in-tab="true">\r
         <entry file="file://$PROJECT_DIR$/Resources/Public/Js/PowermailCond.js">\r
           <provider selected="true" editor-type-id="text-editor">\r
-            <state line="220" column="43" selection-start="7761" selection-end="7761" vertical-scroll-proportion="-18.16">\r
+            <state line="169" column="78" selection-start="6176" selection-end="6176" vertical-scroll-proportion="0.66812706">\r
               <folding />\r
             </state>\r
           </provider>\r
       <file leaf-file-name="Condition.php" pinned="false" current="false" current-in-tab="false">\r
         <entry file="file://$PROJECT_DIR$/Configuration/TCA/Condition.php">\r
           <provider selected="true" editor-type-id="text-editor">\r
-            <state line="103" column="30" selection-start="3295" selection-end="3295" vertical-scroll-proportion="-10.461538">\r
+            <state line="103" column="30" selection-start="3295" selection-end="3295" vertical-scroll-proportion="-8.5">\r
               <folding />\r
             </state>\r
           </provider>\r
         </entry>\r
       </file>\r
-      <file leaf-file-name="FieldlistingBackend.php" pinned="false" current="true" current-in-tab="true">\r
+      <file leaf-file-name="FieldlistingBackend.php" pinned="false" current="false" current-in-tab="false">\r
         <entry file="file://$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php">\r
           <provider selected="true" editor-type-id="text-editor">\r
-            <state line="56" column="34" selection-start="2198" selection-end="2198" vertical-scroll-proportion="0.4100877">\r
+            <state line="85" column="6" selection-start="3255" selection-end="3255" vertical-scroll-proportion="-15.692307">\r
               <folding />\r
             </state>\r
           </provider>\r
@@ -77,8 +77,8 @@
         <option value="$PROJECT_DIR$/ext_localconf.php" />\r
         <option value="$PROJECT_DIR$/Resources/Public/Css/PowermailCond.css" />\r
         <option value="$PROJECT_DIR$/Configuration/TypoScript/setup.txt" />\r
-        <option value="$PROJECT_DIR$/Resources/Public/Js/PowermailCond.js" />\r
         <option value="$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php" />\r
+        <option value="$PROJECT_DIR$/Resources/Public/Js/PowermailCond.js" />\r
       </list>\r
     </option>\r
   </component>\r
       <created>1350552408102</created>\r
       <updated>1350552408102</updated>\r
     </task>\r
-    <option name="localTasksCounter" value="12" />\r
+    <task id="LOCAL-00012" summary="Working Copy">\r
+      <created>1350554846103</created>\r
+      <updated>1350554846103</updated>\r
+    </task>\r
+    <option name="localTasksCounter" value="13" />\r
     <servers />\r
   </component>\r
   <component name="ToolWindowManager">\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Configuration/TCA/Condition.php">\r
+    <entry file="file://$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="103" column="30" selection-start="3295" selection-end="3295" vertical-scroll-proportion="-10.461538">\r
+        <state line="85" column="6" selection-start="3255" selection-end="3255" vertical-scroll-proportion="-15.692307">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Resources/Public/Js/PowermailCond.js">\r
+    <entry file="file://$PROJECT_DIR$/Configuration/TCA/Condition.php">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="220" column="43" selection-start="7761" selection-end="7761" vertical-scroll-proportion="-18.16">\r
+        <state line="103" column="30" selection-start="3295" selection-end="3295" vertical-scroll-proportion="-8.5">\r
           <folding />\r
         </state>\r
       </provider>\r
     </entry>\r
-    <entry file="file://$PROJECT_DIR$/Classes/Utility/FieldlistingBackend.php">\r
+    <entry file="file://$PROJECT_DIR$/Resources/Public/Js/PowermailCond.js">\r
       <provider selected="true" editor-type-id="text-editor">\r
-        <state line="56" column="34" selection-start="2198" selection-end="2198" vertical-scroll-proportion="0.4100877">\r
+        <state line="169" column="78" selection-start="6176" selection-end="6176" vertical-scroll-proportion="0.66812706">\r
           <folding />\r
         </state>\r
       </provider>\r
index c624fc7..700c61e 100644 (file)
@@ -75,6 +75,34 @@ class Tx_PowermailCond_Utility_FieldlistingBackend {
                                );
                        }
                }
+
+               if (isset($params['config']['itemsProcFunc_addFieldsets'])) { // add fieldsets to selection
+                       $params['items'] = array_merge((array) $params['items'], $this->getFieldsets($formUid)); // add some fieldsets
+               }
+       }
+
+       /**
+        * give me all fieldsets in an array
+        *
+        * @param int $formUid                  Form Uid
+        * @return      array   $arr: all fieldsets with its name and the fieldset uid
+        */
+       private function getFieldsets($formUid) {
+               $arr = array();
+               $select = 'uid, title';
+               $from = 'tx_powermail_domain_model_pages';
+               $where .= 'forms = ' . intval($formUid) . ' AND hidden = 0 AND deleted = 0';
+               $groupBy = '';
+               $orderBy = 'sorting';
+               $limit = '';
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $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;
        }
 
        /**
index 7c211f1..1e04efa 100644 (file)
@@ -152,7 +152,7 @@ function hideField(uid) {
 function hideFieldset(string) {
        var params = string.split(':'); // filter / uid / values
        var values = params[2].split(';'); // value1 / value2 / value3
-       $('powermail_fieldset_' + params[1]).hide(); // hide current fieldset
+       $('.powermail_fieldset_' + params[1]).hide(); // hide current fieldset
        for (var k=0; k < values.length; k++) { // one loop for every field inside the fieldset
                clearValue('.powermail_fieldwrap_' + values[k] + ' .powermail_field'); // clear value of current field
        }