Fix #7422 - refinements on notify
[Pman.Admin] / Pman.Tab.AdminTranslations.js
index 847ecdf..724d43e 100644 (file)
@@ -156,14 +156,33 @@ Pman.Tab.AdminTranslations = new Roo.XComponent({
                    return;
                }
                
+               
+               var steps = [ 
+                      'scanProjectBJS',
+                        'scanPmanBJS',
+                        'scanPmanTemplates',
+                        'scanTables',
+                        'syncLanguage'  
+               ];
+               
+               
                var syncTemplate = function(){
+               
+                   var step = steps.shift();
+                   Roo.MessageBox.updateProgress( (5.0 - steps.length) / 5.0, "Running " + step);
+               
                    new Pman.Request({
-                       url : baseURL + '/Admin/UpdateBjsTemplates',
+                       url : baseURL + '/Admin/UpdateBjsTemplates/' + step,
                        method : 'GET',
-                       mask : 'Processing...',
+                       //mask : 'Processing...',
                        timeout : 9000000,
                        success : function()
                        {
+                          if (steps.length > 0 ) { 
+                               syncTemplate();
+                               return;
+                           }
+                           Roo.MessageBox.hide();
                            _this.treepanel.tree.getRootNode().reload();
                        }
                    });
@@ -186,7 +205,27 @@ Pman.Tab.AdminTranslations = new Roo.XComponent({
                    });
                };
                
+              var syncSingleTemplate = function(id){
+                   new Pman.Request({
+                       url : baseURL + '/Roo/Core_template',
+                       method : 'POST',
+                       mask : 'Processing...',
+                       params : {
+                           id : id,
+                           _rescan : 1
+                       }, 
+                       success : function()
+                       {
+                          (function() {
+                               _this.grid.footer.onClick('first');
+                           }).defer(100);
+                       }
+                   });
+               };
+               
+               
                if(typeof(sn.isRoot) != 'undefined' && sn.isRoot){
+                   Roo.MessageBox.progress("Syncing templates", "Starting");
                    syncTemplate();
                    return;
                }
@@ -196,6 +235,10 @@ Pman.Tab.AdminTranslations = new Roo.XComponent({
                    return;
                }
                
+                if(typeof(sn.attributes.id) != 'undefined' && sn.attributes.id * 1> 0){
+                   syncSingleTemplate(sn.attributes.id);
+                   return;
+               }
                
                
                
@@ -220,8 +263,7 @@ Pman.Tab.AdminTranslations = new Roo.XComponent({
                
                Pman.Dialog.Image.show({
                   _url : baseURL + '/Admin/Import/Core_templatestr' 
-                  
-               
+                
                }, function() {
                     _this.treepanel.tree.getRootNode().reload();
                });