fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [16166]


From: nelson . guerra
Subject: [Fmsystem-commits] [16166]
Date: Mon, 16 Jan 2017 17:10:49 -0500 (EST)

Revision: 16166
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16166
Author:   nelson224
Date:     2017-01-16 17:10:49 -0500 (Mon, 16 Jan 2017)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind-2/property/js/portico/import_components.js

Modified: branches/dev-syncromind-2/property/js/portico/import_components.js
===================================================================
--- branches/dev-syncromind-2/property/js/portico/import_components.js  
2017-01-16 08:32:27 UTC (rev 16165)
+++ branches/dev-syncromind-2/property/js/portico/import_components.js  
2017-01-16 22:10:49 UTC (rev 16166)
@@ -72,27 +72,9 @@
         }
     });
        
-       
        $('#template_list').change( function()
        {
-               var oArgs = {menuaction: 
'property.uiimport_components.get_attributes_from_template'};
-               var requestUrl = phpGWLink('index.php', oArgs, true);   
-               
-               var data = {"category_template": $(this).val()};
-               JqueryPortico.execute_ajax(requestUrl,
-                       function(result){
-                               var $el = $("#attribute_name_component_id");
-                               $el.empty();
-                               $.each(result, function(key, value) {
-                                       if (value.selected)
-                                       {
-                                               $el.append($("<option 
selected></option>").attr("value", value.id).text(value.name));
-                                       } else {
-                                               
$el.append($("<option></option>").attr("value", value.id).text(value.name));
-                                       }
-                               });
-                       }, data, "GET", "json"
-               );                              
+               fill_template_attributes('');
        });
        
        $('#relations_step_1').on('click', function ()
@@ -669,9 +651,8 @@
                                if (result.template_id)
                                {
                                        
$('#template_list').val(result.template_id);
+                                       
fill_template_attributes(result.attrib_name_componentID);
                                }
-                               
$('#attribute_name_component_id').val(result.attrib_name_componentID);
-               
                        }, data, "GET", "JSON"
                );
        });
@@ -678,6 +659,28 @@
        
 });
 
+function fill_template_attributes (selected_attribute)
+{
+       var oArgs = {menuaction: 
'property.uiimport_components.get_attributes_from_template'};
+       var requestUrl = phpGWLink('index.php', oArgs, true);   
+
+       var data = {"category_template": $("#template_list").val(), 
"selected_attribute":  selected_attribute};
+       JqueryPortico.execute_ajax(requestUrl,
+               function(result){
+                       var $el = $("#attribute_name_component_id");
+                       $el.empty();
+                       $.each(result, function(key, value) {
+                               if (value.selected)
+                               {
+                                       $el.append($("<option 
selected></option>").attr("value", value.id).text(value.name));
+                               } else {
+                                       
$el.append($("<option></option>").attr("value", value.id).text(value.name));
+                               }
+                       });
+               }, data, "GET", "json"
+       );                      
+}
+       
 function valid_new_attribute (code)
 {
        if ($('#name_' + code).val() == '')




reply via email to

[Prev in Thread] Current Thread [Next in Thread]