Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/dev/htdocs/custom/menuconfighelper/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/dev/htdocs/custom/menuconfighelper/js/menuconfighelper.js
/* Copyright (C) 2017      Open-DSI             <support@open-dsi.fr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

function menuconfighelper_add_button_infos(img_element, label_search_url) {
  var button_search = $('td.liste_titre [name="button_search"]');

  if (button_search.length > 0) {
    var button = '<a class="button" id="menuconfighelper_button_infos" href="javascript:;">' + img_element + '</a>';
    button_search.parent().prepend(button);

    $('a#menuconfighelper_button_infos').click(function () {
      menuconfighelper_show_search_url(this, window.location.href,label_search_url);
    });
  }
}

function menuconfighelper_show_search_url(_this, url_base, label_search_url) {
  var form = $(_this).closest("form");

  if (form.length > 0) {
    var url = url_base;
    var parmas = '';
    var invalid_params = [ 'token', 'formfilteraction', 'selectedfields', 'button_search', 'button_removefilter',
                           'action', 'confirmmassaction', 'checkallactions', 'toselect[]' ];

    var found = false;
    form.find(':input').map(function (key, input) {
      var _input = $(input);
      var value = _input.val();
      var isCheckbox = _input.is(':checkbox');

      if (input.name.trim().length > 0 &&
          invalid_params.indexOf(input.name) == -1 && url_base.indexOf(input.name + "=") == -1 &&
          value.length > 0 && value != 0 && value != -1 &&
          (!isCheckbox || (isCheckbox && _input.is(':checked')))) {
        parmas += input.name + "=" + value + "&";
        found = true;
      }
    });

    if (found) {
      url = url_base + (url_base.indexOf('?') == -1 ? '?' : '&') + parmas.substr(0, parmas.length-1);
    }

    window.prompt(label_search_url, url);
  }
}

Hry