Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a871ab4c

Von Sven Schöling vor fast 13 Jahren hinzugefügt

  • ID a871ab4c8f39081adf0d850d26d7dce44636355c
  • Vorgänger c69b3d4d
  • Nachfolger a82451ee

CGI::Ajax aus am/list_accounts entfernt.

Unterschiede anzeigen:

bin/mozilla/am.pl
43 43
use SL::Iconv;
44 44
use SL::TODO;
45 45
use SL::Printer;
46
use CGI::Ajax;
47 46
use CGI;
48 47

  
49 48
require "bin/mozilla/common.pl";
......
495 494
    $ca->{link_edit_account} = $link_edit_account . '&id=' . E($ca->{id});
496 495
  }
497 496

  
498
  # Ajax
499
  my $pjx = new CGI::Ajax('list_account_details' => build_std_url('action=list_account_details'));
500

  
501
  # Eneable AJAX debuging
502
  #$pjx->DEBUG(1);
503
  #$pjx->JSDEBUG(1);
504

  
505
  push(@ { $form->{AJAX} }, $pjx);
506

  
507 497
  $form->use_stylesheet("list_accounts.css");
508 498
  $form->{title}       = $locale->text('Chart of Accounts');
509 499

  
......
586 576
  }
587 577

  
588 578
  $form->{title} = $locale->text('Chart of Accounts');
589
  $form->header();
590 579

  
591
  print $form->parse_html_template('am/list_account_details');
580
  print $form->ajax_response_header, $form->parse_html_template('am/list_account_details');
592 581

  
593 582
  $main::lxdebug->leave_sub();
594 583

  
templates/webpages/am/list_accounts.html
1 1
[%- USE T8 %]
2
[% USE HTML %]<body>
3

  
4
 <br/><div id='pjxdebugrequest'></div><br/>
5

  
6
 <div class="coa_listtop">[% title %]</div>
7

  
8
 <br />
2
[%- USE HTML %]
3
<body>
4
 <h1>[% title %]</h1>
9 5

  
10 6
 <table width="100%">
11 7

  
......
18 14
   <col width="10%">
19 15
  </colgroup>
20 16

  
21
  <tr class="coa_listheading">
22
   <td class="coa_listheading_element">[% 'Account' | $T8 %]</td>
23
   <td colspan="3" class="coa_listheading_element">[% 'Description (Click on Description for details)' | $T8 %]</td>
24
   <td class="coa_listheading_element">[% 'Debit' | $T8 %]</td>
25
   <td class="coa_listheading_element">[% 'Credit' | $T8 %]</td>
17
  <tr class="listheading">
18
   <th>[% 'Account' | $T8 %]</td>
19
   <th colspan="3">[% 'Description (Click on Description for details)' | $T8 %]</td>
20
   <th>[% 'Debit' | $T8 %]</td>
21
   <th>[% 'Credit' | $T8 %]</td>
26 22
  </tr>
27 23

  
28
  [% SET row_odd = '1' %][% FOREACH row = CA %]
29

  
30
  [% IF row.heading %]
31
  <tr>
32
   <td class="accountlistheading"><a href="[% row.link_edit_account %]">[% HTML.escape(row.accno) %]</a></td>
33
   <td colspan="5" class="accountlistheading">[% HTML.escape(row.description) %]</td>
24
[%- FOREACH row = CA %]
25
 [%- IF row.heading %]
26
  <tr class="listheading">
27
   <td><a href="[% row.link_edit_account %]">[% row.accno | html %]</a></td>
28
   <td colspan="5">[% row.description | html %]</td>
34 29
  </tr>
35

  
36
  [% ELSE %]
37

  
38
  <tr class="coa_listrow[% IF row_odd %]1[% SET row_odd = '0' %][% ELSE %]0[% SET row_odd = '1' %][% END %]">
39

  
40
   <td class="coa_account_header">
41
    <b><a href="[% row.link_edit_account %]" >[% HTML.escape(row.accno) %]</a></b>
42
   </td>
43

  
44
   <input type="hidden" name="chart_id" value="[% HTML.escape(row.id) %]" id="chart_id_[% HTML.escape(row.id) %]" >
45
   <td colspan="3" id="accountcontent[% HTML.escape(row.id) %]-title" class="coa_account_header_sc"
46
       onclick="list_account_details( ['chart_id_[% HTML.escape(row.id) %]'], ['ajaxcontent[% HTML.escape(row.id) %]'] )">
47
    [% HTML.escape(row.description) %]
48
   </td>
49

  
50
    <td class="coa_account_header"><div class="coa_amount">[% HTML.escape(row.debit) %]</div></td>
51
    <td class="coa_account_header"><div class="coa_amount">[% HTML.escape(row.credit) %]</div>
52
    </td>
30
 [% ELSE %]
31
  <tr class="listrow[% loop.count % 2 %]">
32
   <td><b><a href="[% row.link_edit_account %]">[% row.accno | html %]</a></b></td>
33
   <td colspan="3" onclick="account_details([% row.id %])">[% row.description | html %]</td>
34
   <td class='numeric'>[% row.debit | html %]</td>
35
   <td class='numeric'>[% row.credit | html %]</td>
53 36
  </tr>
54 37

  
55
  <tr class="coa_detail">
56
   <td colspan="6" width="100%"><div id="ajaxcontent[% HTML.escape(row.id) %]"></div></td>
38
  <tr id="ajaxrow[% row.id %]" style="display:none", onclick="$(this).toggle()">
39
   <td colspan="6" width="100%"><div id="ajaxcontent[% row.id %]"></div></td>
57 40
  </tr>
58

  
59
  [% END %]
60

  
61
  [% END %]
41
 [% END %]
42
[% END %]
62 43

  
63 44
 </table>
64 45

  
65 46
</body>
47
<script type='text/javascript'>
48
  function account_details(id) {
49
    $.ajax({
50
      url: 'am.pl?action=list_account_details',
51
      data: { args: id },
52
      dataType: 'html',
53
      success: function (data) { $('#ajaxcontent' + id).html(data) },
54
    });
55
    $('#ajaxrow' + id).toggle();
56
  }
57
</script>
58

  
59

  
66 60
</html>

Auch abrufbar als: Unified diff