Progress genauer anzeigen
[kivitendo-erp.git] / templates / webpages / csv_import / _deferred_results.html
1 [%- USE L %]
2 [%- USE T8 %]
3 [%- USE HTML %]
4
5 <h2>[% 'Import Status' | $T8 %]</h2>
6
7 [% PROCESS 'common/flash.html' %]
8 <div id='progress_description'></div>
9 <div id='progressbar'></div>
10 <script type='text/javascript'>
11   function reload_results () {
12     $.ajax({
13       url: 'controller.pl',
14       data: {
15         action: 'CsvImport/result',
16         'profile.type': '[% SELF.profile.type %]',
17         job: '[% SELF.background_job.id %]'
18       },
19       success: function(data) { $('#results').html(data) },
20       error: function(e) { alert(e) },
21     });
22   }
23 [%- UNLESS SELF.background_job.data_as_hash.progress < 0 %]
24   $(document).ready(function(){
25     $('#progress_description').html('[% SELF.background_job.data_as_hash.progress.plan.${SELF.background_job.data_as_hash.progress.phase} %] / [% SELF.background_job.data_as_hash.progress.num_phases %] [% SELF.background_job.data_as_hash.progress.phase | $T8 | html %]');
26     $('#progressbar').progressbar({ value: [% SELF.background_job.data_as_hash.progress.progress * 1 %] });
27     window.setTimeout(reload_results, 100);
28   })
29 [%- END %]
30 </script>