Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2641a546

Von Hans P. Schlaepfer vor mehr als 3 Jahren hinzugefügt

  • ID 2641a5460a7513b8680a2ded27f304488780e658
  • Vorgänger 5bb3b100
  • Nachfolger 7ce093c0

Neues Design 2019 Standard-Code templates/webpages/client_config/form.html

Unterschiede anzeigen:

templates/webpages/client_config/form.html
1
 <script type="text/javascript" src="js/common.js"></script>
2
 <script type="text/javascript">
3
  <!--
4
var warehouses = [
5
 [%- USE warehouses_it = Iterator(SELF.all_warehouses) %][%- FOREACH warehouse = warehouses_it %]
6
  { id:   [% warehouse.id %],
7
    bins: [
8
     [% USE bins_it = Iterator(warehouse.bins_sorted) %][% FOREACH bin = bins_it %]
9
      { id: [% bin.id %], description: "[% JavaScript.escape(bin.description) %]" }[% UNLESS bins_it.last %],[% END %]
10
     [% END %]
11
   ] }[% UNLESS warehouses_it.last %],[% END %]
12
 [% END %]
13
];
14

  
15
function warehouse_selected(warehouse_id, bin_id, bin_id_name) {
16
  // bin_id_name is optional and only used in client_config.html
17
  bin_id_name = bin_id_name || 'bin_id';
18

  
19
  // Remove all bins safe for the empty entry
20
  var bin_select = $('#' + bin_id_name);
21
  bin_select.find('option').filter('[value!=""]').remove();
22

  
23
  // Find selected warehouse
24
  var warehouse = warehouses.filter(function(elt) { return elt.id == warehouse_id; })[0];
25
  if (!warehouse)
26
    return;
27

  
28
  // Add bins as options to select.
29
  $(warehouse.bins).each(function(idx, bin) {
30
    bin_select.append($('<option>', { value: bin.id, selected: bin.id == bin_id }).text(bin.description));
31
  });
32
}
33

  
34
function enable_template_controls() {
35
  var existing = $('#use_templates_existing').prop('checked');
36
  $('#defaults_templates').prop('disabled', !existing);
37
  $('#new_templates,#new_master_templates').prop('disabled', existing);
38
}
39

  
40
function verifyMBSize(elem) {
41
  var fsize = parseInt($('#doc_max_filesize_MB').val());
42
  $('#defaults_doc_max_filesize').val(fsize*1000000.0);
43
  $('#doc_max_filesize_MB').val(fsize);
44
}
45

  
46
function verifyRootPath(elem) {
47
  if ( elem.value == "" ) {
48
    elem.value="./documents";
49 1
[% USE L %]
50 2
[% USE LxERP %]
51 3
[% USE HTML %]
52 4
[% USE JavaScript %]
53 5
[% USE T8 %]
54 6

  
7
<script type="text/javascript" src="js/common.js"></script>
8
<script type="text/javascript"><!--
9

  
10
  var warehouses = [
11
   [% USE warehouses_it = Iterator(SELF.all_warehouses) %][% FOREACH warehouse = warehouses_it %]
12
    { id:   [% warehouse.id %],
13
      bins: [
14
       [% USE bins_it = Iterator(warehouse.bins_sorted) %][% FOREACH bin = bins_it %]
15
        { id: [% bin.id %], description: "[% JavaScript.escape(bin.description) %]" }[% UNLESS bins_it.last %],[% END %]
16
       [% END %]
17
     ] }[% UNLESS warehouses_it.last %],[% END %]
18
   [% END %]
19
  ];
20

  
21
  function warehouse_selected(warehouse_id, bin_id, bin_id_name) {
22
    // bin_id_name is optional and only used in client_config.html
23
    bin_id_name = bin_id_name || 'bin_id';
24

  
25
    // Remove all bins safe for the empty entry
26
    var bin_select = $('#' + bin_id_name);
27
    bin_select.find('option').filter('[value!=""]').remove();
28

  
29
    // Find selected warehouse
30
    var warehouse = warehouses.filter(function(elt) { return elt.id == warehouse_id; })[0];
31
    if (!warehouse)
32
      return;
33

  
34
    // Add bins as options to select.
35
    $(warehouse.bins).each(function(idx, bin) {
36
      bin_select.append($('<option>', { value: bin.id, selected: bin.id == bin_id }).text(bin.description));
37
    });
55 38
  }
56
}
57 39

  
58
function checkavailable_filebackend(elem) {
59
  var selval = elem.value;
60
  if ( selval == 'Webdav' && $("#defaults_doc_webdav").val() == 0 ) {
61
     elem.value = 'Filesystem';
40
  function enable_template_controls() {
41
    var existing = $('#use_templates_existing').prop('checked');
42
    $('#defaults_templates').prop('disabled', !existing);
43
    $('#new_templates,#new_master_templates').prop('disabled', existing);
62 44
  }
63
  if ( elem.value == 'Filesystem' && $("#defaults_doc_files").val() == 0 ) {
64
     elem.value = 'None';
45

  
46
  function verifyMBSize(elem) {
47
    var fsize = parseInt($('#doc_max_filesize_MB').val());
48
    $('#defaults_doc_max_filesize').val(fsize*1000000.0);
49
    $('#doc_max_filesize_MB').val(fsize);
65 50
  }
66
  return false;
67
}
68

  
69
$(function() {
70
  warehouse_selected([% SELF.defaults.warehouse_id || -1 %], [% SELF.defaults.bin_id || -1 %], 'bin_id');
71
  warehouse_selected([% SELF.defaults.warehouse_id_ignore_onhand || -1 %], [% SELF.defaults.bin_id_ignore_onhand || -1 %], 'bin_id_ignore_onhand');
72
  warehouse_selected([% SELF.defaults.stocktaking_warehouse_id || -1 %], [% SELF.defaults.stocktaking_bin_id || -1 %], 'stocktaking_bin_id');
73

  
74
  enable_template_controls();
75
  $('#doc_max_filesize_MB').val(parseInt($('#defaults_doc_max_filesize').val())/1000000.0);
76
  $('#use_templates_existing,#use_templates_new').change(enable_template_controls);
77
})
78
    -->
79
 </script>
51

  
52
  function verifyRootPath(elem) {
53
    if ( elem.value == "" ) {
54
      elem.value="./documents";
55
    }
56
  }
57

  
58
  function checkavailable_filebackend(elem) {
59
    var selval = elem.value;
60
    if ( selval == 'Webdav' && $("#defaults_doc_webdav").val() == 0 ) {
61
       elem.value = 'Filesystem';
62
    }
63
    if ( elem.value == 'Filesystem' && $("#defaults_doc_files").val() == 0 ) {
64
       elem.value = 'None';
65
    }
66
    return false;
67
  }
68

  
69
  $(function() {
70
    warehouse_selected([% SELF.defaults.warehouse_id || -1 %], [% SELF.defaults.bin_id || -1 %], 'bin_id');
71
    warehouse_selected([% SELF.defaults.warehouse_id_ignore_onhand || -1 %], [% SELF.defaults.bin_id_ignore_onhand || -1 %], 'bin_id_ignore_onhand');
72
    warehouse_selected([% SELF.defaults.stocktaking_warehouse_id || -1 %], [% SELF.defaults.stocktaking_bin_id || -1 %], 'stocktaking_bin_id');
73

  
74
    enable_template_controls();
75
    $('#doc_max_filesize_MB').val(parseInt($('#defaults_doc_max_filesize').val())/1000000.0);
76
    $('#use_templates_existing,#use_templates_new').change(enable_template_controls);
77
  })
78

  
79
--></script>
80
    
80 81
<h1>[% title | html %]</h1>
81 82

  
82 83
[% INCLUDE 'common/flash.html' %]
......
84 85
<form action='controller.pl' method='POST' id='form'>
85 86
 <div class="tabwidget">
86 87
  <ul>
87
   <li><a href="#miscellaneous">[% LxERP.t8('Miscellaneous') %]</a></li>
88
   <li><a href="#ranges_of_numbers">[% LxERP.t8('Ranges of numbers') %]</a></li>
89
   <li><a href="#default_accounts">[% LxERP.t8('Default Accounts') %]</a></li>
90
   <li><a href="#posting_configuration">[% LxERP.t8('Posting Configuration') %]</a></li>
91
   [% IF FORM.feature_datev %]
92
     <li><a href="#datev_check_configuration">[% LxERP.t8('DATEV configuration') %]</a></li>
93
   [% END %]
94
   <li><a href="#orders_deleteable">[% LxERP.t8('Orders / Delivery Orders deleteable') %]</a></li>
95
[%- IF INSTANCE_CONF.get_doc_storage %]
96
   <li><a href="#attachments">[% LxERP.t8('Global Attachments') %]</a></li>
97
[%- END %]
98
   <li><a href="#warehouse">[% LxERP.t8('Warehouse') %]</a></li>
99
   <li><a href="#features">[% LxERP.t8('Features') %]</a></li>
100
   <li><a href="#stocktaking">[% LxERP.t8('Stocktaking') %]</a></li>
88
    <li><a href="#miscellaneous">[% LxERP.t8('Miscellaneous') %]</a></li>
89
    <li><a href="#ranges_of_numbers">[% LxERP.t8('Ranges of numbers') %]</a></li>
90
    <li><a href="#default_accounts">[% LxERP.t8('Default Accounts') %]</a></li>
91
    <li><a href="#posting_configuration">[% LxERP.t8('Posting Configuration') %]</a></li>
92
    [% IF FORM.feature_datev %]
93
      <li><a href="#datev_check_configuration">[% LxERP.t8('DATEV configuration') %]</a></li>
94
    [% END %]
95
    <li><a href="#orders_deleteable">[% LxERP.t8('Orders / Delivery Orders deleteable') %]</a></li>
96
    [% IF INSTANCE_CONF.get_doc_storage %]
97
      <li><a href="#attachments">[% LxERP.t8('Global Attachments') %]</a></li>
98
    [% END %]
99
    <li><a href="#warehouse">[% LxERP.t8('Warehouse') %]</a></li>
100
    <li><a href="#features">[% LxERP.t8('Features') %]</a></li>
101
    <li><a href="#stocktaking">[% LxERP.t8('Stocktaking') %]</a></li>
101 102
  </ul>
102 103

  
103
[% PROCESS 'client_config/_ranges_of_numbers.html' %]
104
[% PROCESS 'client_config/_default_accounts.html' %]
105
[% PROCESS 'client_config/_posting_configuration.html' %]
106
[% PROCESS 'client_config/_datev_check_configuration.html' %]
107
[% PROCESS 'client_config/_orders_deleteable.html' %]
108
[%- IF INSTANCE_CONF.get_doc_storage %]
109
[% PROCESS 'client_config/_attachments.html' %]
110
[%- END %]
111
[% PROCESS 'client_config/_warehouse.html' %]
112
[% PROCESS 'client_config/_features.html' %]
113
[% PROCESS 'client_config/_stocktaking.html' %]
114
[% PROCESS 'client_config/_miscellaneous.html' %]
104
  [% PROCESS 'client_config/_ranges_of_numbers.html' %]
105
  [% PROCESS 'client_config/_default_accounts.html' %]
106
  [% PROCESS 'client_config/_posting_configuration.html' %]
107
  [% PROCESS 'client_config/_datev_check_configuration.html' %]
108
  [% PROCESS 'client_config/_orders_deleteable.html' %]
109
  [% IF INSTANCE_CONF.get_doc_storage %]
110
    [% PROCESS 'client_config/_attachments.html' %]
111
  [% END %]
112
  [% PROCESS 'client_config/_warehouse.html' %]
113
  [% PROCESS 'client_config/_features.html' %]
114
  [% PROCESS 'client_config/_stocktaking.html' %]
115
  [% PROCESS 'client_config/_miscellaneous.html' %]
115 116
 </div>
116 117
</form>

Auch abrufbar als: Unified diff