[otrs-cvs] otrs/Kernel/Output/HTML/Standard AdminGenericInterfaceMappingSimple.dtl, 1.1, 1.2

CVS commits notifications of OTRS.org cvs-log at otrs.org
Fri Jun 3 07:32:22 GMT 2011


Comments:
Update of /home/cvs/otrs/Kernel/Output/HTML/Standard
In directory lancelot:/tmp/cvs-serv10361/Kernel/Output/HTML/Standard

Modified Files:
	AdminGenericInterfaceMappingSimple.dtl 
Log Message:
Modified for handling saved values.

Author: cg

Index: AdminGenericInterfaceMappingSimple.dtl
===================================================================
RCS file: /home/cvs/otrs/Kernel/Output/HTML/Standard/AdminGenericInterfaceMappingSimple.dtl,v
retrieving revision 1.1
retrieving revision 1.2
diff -2 -u -d -r1.1 -r1.2
--- AdminGenericInterfaceMappingSimple.dtl	2 Jun 2011 05:47:12 -0000	1.1
+++ AdminGenericInterfaceMappingSimple.dtl	3 Jun 2011 07:32:17 -0000	1.2
@@ -50,30 +50,35 @@
                 <form action="$Env{"CGIHandle"}" method="post" class="Validate PreventMultipleSubmits">
                     <input type="hidden" name="Action" value="$Env{"Action"}"/>
-                    <input type="hidden" name="Subaction" value="$QData{"Action"}Action"/>
+                    <input type="hidden" name="Subaction" value="$QData{"Subaction"}Action"/>
                     <input type="hidden" name="WebserviceID" value="$QData{"WebserviceID"}" id="WebserviceID"/>
                     <input type="hidden" name="CommunicationType" value="$QData{"CommunicationType"}" id="CommunicationType"/>
                     <input type="hidden" name="KeyCounter" value="0" id="KeyCounter"/>
+                    <input type="hidden" name="Operation" value="$QData{"Operation"}" id="KeyCounter"/>
+                    <input type="hidden" name="Invoker" value="$QData{"Invoker"}" id="KeyCounter"/>
+                    <input type="hidden" name="Direction" value="$QData{"Direction"}" id="KeyCounter"/>
                     <div class="WidgetSimple">
                         <div class="Header"
                             <h3>$Text{"Keys"}</h3>
                         </div>
-                        <fieldset class="TableLike FixedLabelSmall SpacingTop">
+                        <fieldset class="TableLike  SpacingTop">
                             <label for="DefaultKeyType">$Text{"Default rule for unmapped keys"}:</label>
                             <div class="Field">
                                 $Data{"DefaultKeyTypeStrg"}
-                                <input id="DefaultKeyMapTo" class="W25pc Hidden $QData{"MaxLengthServerError"}" type="text" maxlength="100" value="$QData{"DefaultKeyMapTo"}" name="DefaultKeyMapTo"/>
-                                <p class="FieldExplanation">$Text{"This rule will apply for all key with no mapping rule."}</p>
+                                <input id="DefaultKeyMapTo" name="DefaultKeyMapTo" class="W25pc Hidden $QData{"MaxLengthServerError"}" type="text" maxlength="100" value="$QData{"DefaultKeyMapTo"}"/>
+                                <p class="FieldExplanation">$Text{"This rule will apply for all keys with no mapping rule."}</p>
                             </div>
                             <div class="Clear"></div>
 
-                            <label for="DefaultKeyType">$Text{"New rule"}:</label>
+                            <label for="DefaultKeyType">$Text{"Default rule for unmapped values"}:</label>
+                            <div class="Field">
+                                $Data{"DefaultValueTypeStrg"}
+                                <input id="DefaultValueMapTo"name="DefaultValueMapTo"  class="W25pc Hidden $QData{"MaxLengthServerError"}" type="text" maxlength="100" value="$QData{"DefaultKeyMapTo"}"/>
+                                <p class="FieldExplanation">$Text{"This rule will apply for all values with no mapping rule."}</p>
+                            </div>
+                            <div class="Clear"></div>
+
+                            <label for="DefaultKeyType">$Text{"New key map"}:</label>
                             <div class="Field">
                                 <span class="NewRule">
-                                    Map key matching the
-                                    $Data{"KeyMapTypeStrg"}
-                                    <input name="KeyName" id="KeyName" class="W20pc" type="text" maxlength="100" value=""/>
-                                    to new name
-                                    <input name="KeyMapNew" id="KeyMapNew" class="W20pc" type="text" maxlength="100" value=""/>
-                                    <span class="Spacing"></span>
                                     <button type="button" id="AddKeyMapping" class="Add" value="Add key mapping">$Text{"Add key mapping"}</button>
                                 </span>
@@ -82,6 +87,82 @@
                         </div>
                         <div class="Content" id="KeyInsert">
-                        </fieldset>
-                    </div>
+
+
+
+
+
+
+
+<!-- dtl:block:KeyTemplate -->
+                            <div class="WidgetSimple Expanded WidgetKey $QData{"Classes"}">
+                                <div class="Header">
+                                    <div class="WidgetAction Toggle">
+                                        <a href="#" title="$JSText{"Show or hide the content"}"></a>
+                                    </div>
+                                    <h3 class="Title"></h3>
+                                    <div class="AdditionalInformation SpacingTopMini">
+                                        <button type="button" id="RemoveKeyMapping" class="Remove" value="Remove key mapping">$Text{"Remove key mapping"}</button>
+                                    </div>
+                                </div>
+                                <div class="Content">
+
+                                    <fieldset class="TableLike FixedLabelSmall">
+                                        <label>$Text{"Key mapping"}:</label>
+                                        <div class="Field">
+                                            Map key matching the
+                                            $Data{"KeyMapTypeStrg"}
+                                            <input name="KeyName$QData{"KeyIndex"}" id="KeyName$QData{"KeyIndex"}" class="W20pc" type="text" maxlength="100" value="$QData{"KeyName"}"/>
+                                            to new name
+                                            <input name="KeyMapNew$QData{"KeyIndex"}" id="KeyMapNew$QData{"KeyIndex"}" class="W20pc NewValue" type="text" maxlength="100" value="$QData{"KeyMapNew"}"/>
+                                        </div>
+                                        <div class="Clear"></div>
+
+                                        <label>Value Mapping</label>
+                                        <div class="Field ValueInsert">
+                                            <input type="hidden" name="ValueCounter" value="0" id="ValueCounter"/>
+                                            <div class="Spacing"></div>
+<!-- dtl:block:ValueTemplateRow -->
+                                            <div class="ValueTemplate Hidden">
+                                                Map values matching the
+                                                $Data{"ValueMapTypeStrg"}
+                                                <input name="ValueName$QData{"ValueIndex"}" id="ValueName$QData{"ValueIndex"}" class="W20pc" type="text" maxlength="100" value="$QData{"ValueName"}"/>
+                                                to new value
+                                                <input name="ValueMapNew$QData{"ValueIndex"}" id="ValueMapNew$QData{"ValueIndex"}" class="W20pc" type="text" maxlength="100" value="$QData{"ValueMapNew"}"/>
+                                                <span class="Spacing"></span>
+                                                <button type="button" id="RemoveValueMapping" class="Remove" value="Remove value mapping">$Text{"Remove value mapping"}</button>
+                                            </div>
+<!-- dtl:block:ValueTemplateRow -->
+                                        </div>
+                                        <div class="Clear"></div>
+
+                                        <label for="DefaultKeyType">$Text{"New key map"}:</label>
+                                        <div class="Field">
+                                            <span class="NewValueMap">
+                                                <button type="button" id="AddValueMapping" class="Add" value="Add Value mapping">$Text{"Add value mapping"}</button>
+                                            </span>
+                                        </div>
+                                        <div class="Clear"></div>
+                                    </fieldset>
+                                </div>
+                            </div>
+<!-- dtl:block:KeyTemplate -->
+
+
+
+<!-- dtl:block:ValueTemplate -->
+                            <div class="ValueTemplate Hidden">
+                                Map values matching the
+                                $Data{"ValueMapTypeStrg"}
+                                <input name="ValueName" id="ValueName" class="W20pc" type="text" maxlength="100" value=""/>
+                                to new value
+                                <input name="ValueMapNew" id="ValueMapNew" class="W20pc" type="text" maxlength="100" value=""/>
+                                <span class="Spacing"></span>
+                                <button type="button" id="RemoveValueMapping" class="Remove" value="Remove value mapping">$Text{"Remove value mapping"}</button>
+                            </div>
+<!-- dtl:block:ValueTemplate -->
+
+
+                        </div>
+                    </fieldset>
 
                     <div class="Field SpacingTop">
@@ -98,58 +179,8 @@
     </div>
 
-    <div class="WidgetSimple Expanded KeyTemplate Hidden WidgetKey">
-        <div class="Header">
-            <div class="WidgetAction Toggle">
-                <a href="#" title="$JSText{"Show or hide the content"}"></a>
-            </div>
-            <h3>title</h3>
-
-            <div class="AdditionalInformation SpacingTopMini">
-                <button type="button" id="RemoveKeyMapping" class="Remove" value="Remove key mapping">$Text{"Remove key mapping"}</button>
-            </div>
-        </div>
-        <div class="Content">
-
-            <fieldset class="TableLike">
-                Map key matching the
-                $Data{"ValueMapTypeStrg"}
-                <input name="KeyName" id="KeyName" class="W20pc" type="text" maxlength="100" value=""/>
-                to new name
-                <input name="KeyMapNew" id="KeyMapNew" class="W20pc" type="text" maxlength="100" value=""/>
-            </fieldset>
-            <div class="WidgetSimple Spacing">
-                <div class="ControlRow">
-                    <h2>Value mapping</h2>
-                    <div class="AdditionalInformation SpacingTopMini">
-                        <button type="button" id="AddKeyMapping" class="Add" value="Add key mapping">$Text{"Add key mapping"}</button>
-                    </div>
-                </div>
-                <fieldset class="TableLike FixedLabelSmall SpacingTop">
-                    <label for="DefaultValueType">$Text{"For unmatched values"}:</label>
-                    <div class="Field">
-                        $Data{"DefaultValueTypeStrg"}
-                        <input id="DefaultValueMapTo" class="W25pc Hidden" type="text" maxlength="100" value="$QData{"DefaultKeyMapTo"}" name="DefaultValueMapTo"/>
-                        <p class="FieldExplanation">$Text{"This rule will apply for all values with no mapping rule."}</p>
-                    </div>
-                    <div class="Field ValueInsert">
-                        <input type="hidden" name="ValueCounter" value="0" id="ValueCounter"/>
-                    </div>
-                    <div class="Clear"></div>
-                </fieldset>
-            </div>
 
-        </div>
-    </div>
 <!--  -->
 
-    <div class="ValueTemplate Hidden">
-        Map values matching the
-        $Data{"ValueMapTypeStrg"}
-        <input name="ValueName" id="ValueName" class="W20pc" type="text" maxlength="100" value=""/>
-        to new value
-        <input name="ValueMapNew" id="ValueMapNew" class="W20pc" type="text" maxlength="100" value=""/>
-        <span class="Spacing"></span>
-        <button type="button" id="RemoveValueMapping" class="Remove" value="Remove value mapping">$Text{"Remove value mapping"}</button>
-    </div>
+
 </div>
 
@@ -182,6 +213,4 @@
         $Clone.removeClass('Hidden ValueTemplate');
 
-
-
         // copy values and change ids and names
         $Clone.find(':input').each(function(){
@@ -198,17 +227,4 @@
                 });
             }
-/*             // copy select value
-            $(this).val( $('#' + ID).val() );
-
-
-            if($(this).hasClass('DefaultKeyType')) {
-                $(this).bind('change', function(){
-                    // call function to hide or show
-                    // MapTo field
-                    ToggleMapTo($(this));
-                });
-                $(this).val('');
-            }
- */
         });
 
@@ -216,15 +232,7 @@
         ValueInsert.append($Clone);
 
-
-
-/*         // reset template row values
-        $('.NewRule').find(':input:not(:button)').attr('value','');
-        $('#KeyName' + KeyCounter).focus();
- */
         // set new value for KeyCounter
         $('#ValueCounter' + KeyCounter).val(ValueCounter);
 
-/*         // init toggle action
-        Core.UI.InitWidgetActionToggle(); */
     return false;
 };
@@ -244,5 +252,5 @@
 
         // add title
-        $Clone.find('h3').html('Mapping for Key' + KeyCounter)
+        $Clone.find('.Title').html('Mapping for Key');
 
         // copy values and change ids and names
@@ -252,12 +260,9 @@
             $(this).attr('name', ID + KeyCounter);
 
-            // copy select value
-            $(this).val( $('#' + ID).val() );
-
             // add event handler to Add button
             if( $(this).hasClass('Add') ) {
                 // bind click function to add button
                 $(this).bind('click', function () {
-                    AddValueMapping( $(this).closest('.WidgetSimple').find('.ValueInsert'), KeyCounter );
+                    AddValueMapping( $(this).closest('fieldset').find('.ValueInsert'), KeyCounter );
                     return false;
                 });
@@ -280,5 +285,11 @@
                     ToggleMapTo($(this));
                 });
-                $(this).val('');
+            }
+
+            if($(this).hasClass('NewValue')) {
+                $(this).bind('change', function(){
+                    // modified title
+                    $(this).closest('.WidgetKey').find('.Title').html( 'Mapping for Key ' + $(this).val() );
+                });
             }
         });
@@ -287,9 +298,7 @@
         $('#KeyInsert').append($Clone);
 
-
-
         // reset template row values
         $('.NewRule').find(':input:not(:button)').attr('value','');
-        $('#DefaultKeyType' + KeyCounter).focus();
+        $('#KeyMapTypeStrg' + KeyCounter).focus();
 
         // set new value for KeyCounter


More information about the cvs-log mailing list