fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15793]


From: nelson . guerra
Subject: [Fmsystem-commits] [15793]
Date: Tue, 4 Oct 2016 03:33:50 +0000 (UTC)

Revision: 15793
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15793
Author:   nelson224
Date:     2016-10-04 03:33:49 +0000 (Tue, 04 Oct 2016)
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  
2016-10-04 03:33:30 UTC (rev 15792)
+++ branches/dev-syncromind-2/property/js/portico/import_components.js  
2016-10-04 03:33:49 UTC (rev 15793)
@@ -7,6 +7,7 @@
        $('.processing-columns').hide();
        $('.processing-import-relations').hide();
        $('.processing-save').hide();
+       $('.get-profile').hide();
        
        $('select#type_id').change( function()
        {
@@ -204,6 +205,7 @@
                                $('#content_lines').empty();
                                $('#content_columns').empty();
                                $('#template_list').prop('disabled', false);
+                               $('#profile_list').prop('disabled', false);
                                
$('#attribute_name_component_id').prop('disabled', false);
                        }
                });
@@ -249,6 +251,7 @@
                                
$('#responsiveTabsDemo').responsiveTabs('disable', 2);
                                
$('#responsiveTabsDemo').responsiveTabs('disable', 3);
                                $('#template_list').prop('disabled', false);
+                               $('#profile_list').prop('disabled', false);
                                
$('#attribute_name_component_id').prop('disabled', false);
                                
                        }, data, "GET", "json"
@@ -281,7 +284,8 @@
                        "step": 3,
                        "sheet_id": $('#sheet_id').val(), 
                        'start_line': 
$('input:radio[name=start_line]:checked').val(),
-                       'template_id': $('#template_list').val()
+                       'template_id': $('#template_list').val(),
+                       'cod_profile': $('#profile_list').val()
                };
                
                $('.processing-start-line').show();
@@ -301,6 +305,7 @@
                                
$('#responsiveTabsDemo').responsiveTabs('activate', 2);
                                
$('#responsiveTabsDemo').responsiveTabs('disable', 3);
                                $('#template_list').prop('disabled', true);
+                               $('#profile_list').prop('disabled', true);
                        
                        }, data, "GET", "json"
                );
@@ -468,6 +473,14 @@
                        alert('Choose Location');
                        return false;
                }
+               if ($('#save_profile:checked').length)
+               {
+                       if 
($('input:radio[name=profile_option_save]:checked').val() == 1 && 
$('#name_profile').val() == '')
+                       {
+                               alert('enter name for profile');
+                               return false;
+                       }
+               }
                
                if (isSendingData())
                {
@@ -479,7 +492,10 @@
                        'save': 1,
                        'location_code': $('#location_code').val(),
                        'location_item_id': $('#location_item_id').val(),
-                       'save_profile': $('#save_profile:checked').length
+                       'save_profile': $('#save_profile:checked').length,
+                       'name_profile': $('#name_profile').val(),
+                       'profile_option_save': 
$('input:radio[name=profile_option_save]:checked').val(),
+                       'cod_profile': $('#cod_profile_selected').val()
                };
                
                $('.processing-save').show();
@@ -524,9 +540,53 @@
                $('#responsiveTabsDemo').responsiveTabs('disable', 2);
                $('#responsiveTabsDemo').responsiveTabs('disable', 3);
                $('#template_list').prop('disabled', false);
+               $('#profile_list').prop('disabled', false);
                $('#attribute_name_component_id').prop('disabled', false);
        });
        
+       $('#profile_list').on('change', function ()
+       {
+               $('#profile_selected').empty();
+               $('#profile_selected').append($("#profile_list 
option:selected").text());
+               $('#cod_profile_selected').val($('#profile_selected').val());
+
+               if ($('#profile_list').val())
+               {
+                       $('#profile_option_save_2').prop('disabled', false);
+                       $('#profile_option_save_2').prop('checked', true);
+                       $('#profile_option_save_1').prop('disabled', true);
+                       $('#name_profile').prop('disabled', true);
+               } else {
+                       $('#profile_option_save_1').prop('disabled', false);
+                       $('#profile_option_save_1').prop('checked', true);
+                       $('#profile_option_save_2').prop('disabled', true);
+                       $('#name_profile').prop('disabled', false);
+               }
+               
+               var oArgs = {menuaction: 
'property.uiimport_components.get_profile'};
+               var requestUrl = phpGWLink('index.php', oArgs, true);
+                
+               var data = {
+                       'cod_profile': $('#profile_list').val()
+               };
+               
+               $('.get-profile').show();
+               
+               JqueryPortico.execute_ajax(requestUrl,
+                       function(result){
+                               
+                               statusSend = false;
+                               $('.get-profile').hide();
+                               if (result.template_id)
+                               {
+                                       
$('#template_list').val(result.template_id);
+                               }
+                               
$('#attribute_name_component_id').val(result.attrib_name_componentID);
+               
+                       }, data, "GET", "JSON"
+               );
+       });
+       
 });
 
 function valid_new_attribute (code)




reply via email to

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