1 [%- USE L %][% USE LxERP %][% USE HTML %][%- USE JavaScript -%]
 
   2  <script type="text/javascript" src="js/common.js"></script>
 
   3  <script type="text/javascript">
 
   6  [%- USE warehouses_it = Iterator(SELF.all_warehouses) %][%- FOREACH warehouse = warehouses_it %]
 
   7   { id:   [% warehouse.id %],
 
   9      [% USE bins_it = Iterator(warehouse.bins_sorted) %][% FOREACH bin = bins_it %]
 
  10       { id: [% bin.id %], description: "[% JavaScript.escape(bin.description) %]" }[% UNLESS bins_it.last %],[% END %]
 
  12    ] }[% UNLESS warehouses_it.last %],[% END %]
 
  16 function warehouse_selected(warehouse_id, bin_id, bin_id_name) {
 
  17   // bin_id_name is optional and only used in client_config.html
 
  18   bin_id_name = bin_id_name || 'bin_id';
 
  20   // Remove all bins safe for the empty entry
 
  21   var bin_select = $('#' + bin_id_name);
 
  22   bin_select.find('option').filter('[value!=""]').remove();
 
  24   // Find selected warehouse
 
  25   var warehouse = warehouses.filter(function(elt) { return elt.id == warehouse_id; })[0];
 
  29   // Add bins as options to select.
 
  30   $(warehouse.bins).each(function(idx, bin) {
 
  31     bin_select.append($('<option>', { value: bin.id, selected: bin.id == bin_id }).text(bin.description));
 
  35 function enable_template_controls() {
 
  36   var existing = $('#use_templates_existing').prop('checked');
 
  37   $('#defaults_templates').prop('disabled', !existing);
 
  38   $('#new_templates,#new_master_templates').prop('disabled', existing);
 
  41 function verifyMBSize(elem) {
 
  42   var fsize = parseInt($('#doc_max_filesize_MB').val());
 
  43   $('#defaults_doc_max_filesize').val(fsize*1000000.0);
 
  44   $('#doc_max_filesize_MB').val(fsize);
 
  47 function verifyRootPath(elem) {
 
  48   if ( elem.value == "" ) {
 
  49     elem.value="./documents";
 
  53 function checkavailable_filebackend(elem) {
 
  54   var selval = elem.value;
 
  55   if ( selval == 'Webdav' && $("#defaults_doc_webdav").val() == 0 ) {
 
  56      elem.value = 'Filesystem';
 
  57   } else if ( selval == 'ExtDMS' ) {
 
  58      elem.value = 'Filesystem';
 
  59   } if ( selval == 'DB' && $("#defaults_doc_database").val() == 0 ) {
 
  60      elem.value = 'Filesystem';
 
  62   if ( elem.value == 'Filesystem' && $("#defaults_doc_files").val() == 0 ) {
 
  69   warehouse_selected([% SELF.defaults.warehouse_id || -1 %], [% SELF.defaults.bin_id || -1 %], 'bin_id');
 
  70   warehouse_selected([% SELF.defaults.warehouse_id_ignore_onhand || -1 %], [% SELF.defaults.bin_id_ignore_onhand || -1 %], 'bin_id_ignore_onhand');
 
  72   enable_template_controls();
 
  73   $('#doc_max_filesize_MB').val(parseInt($('#defaults_doc_max_filesize').val())/1000000.0);
 
  74   $('#use_templates_existing,#use_templates_new').change(enable_template_controls);
 
  78 <h1>[% title | html %]</h1>
 
  80 [% PROCESS 'common/flash.html' %]
 
  82 <form action='controller.pl' method='POST'>
 
  83  <div class="tabwidget">
 
  85    <li><a href="#miscellaneous">[% LxERP.t8('Miscellaneous') %]</a></li>
 
  86    <li><a href="#ranges_of_numbers">[% LxERP.t8('Ranges of numbers') %]</a></li>
 
  87    <li><a href="#default_accounts">[% LxERP.t8('Default Accounts') %]</a></li>
 
  88    <li><a href="#posting_configuration">[% LxERP.t8('Posting Configuration') %]</a></li>
 
  89    [% IF FORM.feature_datev %]
 
  90      <li><a href="#datev_check_configuration">[% LxERP.t8('DATEV check configuration') %]</a></li>
 
  92    <li><a href="#orders_deleteable">[% LxERP.t8('Orders / Delivery Orders deleteable') %]</a></li>
 
  93 [%- IF INSTANCE_CONF.get_doc_storage %]
 
  94    <li><a href="#attachments">[% LxERP.t8('Global Attachments') %]</a></li>
 
  96    <li><a href="#warehouse">[% LxERP.t8('Warehouse') %]</a></li>
 
  97    <li><a href="#features">[% LxERP.t8('Features') %]</a></li>
 
 100 [% PROCESS 'client_config/_ranges_of_numbers.html' %]
 
 101 [% PROCESS 'client_config/_default_accounts.html' %]
 
 102 [% PROCESS 'client_config/_posting_configuration.html' %]
 
 103 [% PROCESS 'client_config/_datev_check_configuration.html' %]
 
 104 [% PROCESS 'client_config/_orders_deleteable.html' %]
 
 105 [%- IF INSTANCE_CONF.get_doc_storage %]
 
 106 [% PROCESS 'client_config/_attachments.html' %]
 
 108 [% PROCESS 'client_config/_warehouse.html' %]
 
 109 [% PROCESS 'client_config/_features.html' %]
 
 110 [% PROCESS 'client_config/_miscellaneous.html' %]
 
 113   [%- L.hidden_tag('action',  'ClientConfig/dispatch')  %]
 
 114   [%- L.submit_tag('action_save',  LxERP.t8('Save'))  %]