myobject.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/rollerstorage/ajax/myobject.php
  19. * \brief File to return Ajax response on product list request
  20. */
  21. if (!defined('NOTOKENRENEWAL')) {
  22. define('NOTOKENRENEWAL', 1); // Disables token renewal
  23. }
  24. if (!defined('NOREQUIREMENU')) {
  25. define('NOREQUIREMENU', '1');
  26. }
  27. if (!defined('NOREQUIREHTML')) {
  28. define('NOREQUIREHTML', '1');
  29. }
  30. if (!defined('NOREQUIREAJAX')) {
  31. define('NOREQUIREAJAX', '1');
  32. }
  33. if (!defined('NOREQUIRESOC')) {
  34. define('NOREQUIRESOC', '1');
  35. }
  36. if (!defined('NOCSRFCHECK')) {
  37. define('NOCSRFCHECK', '1');
  38. }
  39. if (!defined('NOREQUIREHTML')) {
  40. define('NOREQUIREHTML', '1');
  41. }
  42. // Load Dolibarr environment
  43. require '../../main.inc.php';
  44. $mode = GETPOST('mode', 'aZ09');
  45. // Security check
  46. restrictedArea($user, 'rollerstorage', 0, 'myobject');
  47. /*
  48. * View
  49. */
  50. dol_syslog("Call ajax rollerstorage/ajax/myobject.php");
  51. top_httphead('application/json');
  52. $arrayresult = array();
  53. // ....
  54. $db->close();
  55. print json_encode($arrayresult);