fix phpunit (#29696)

* fix phpunit

* fix phpunit

* fix phpunit
This commit is contained in:
Frédéric FRANCE 2024-05-15 18:07:05 +02:00 committed by GitHub
parent 271624de1b
commit 83c04db0ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 20 deletions

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -83,7 +84,7 @@ if (empty($reshook)) {
if (is_array($file['name']) && count($file['name']) > 0) {
foreach ($file['name'] as $i => $name) {
if (empty($file['tmp_name'][$i]) || (getDolGlobalInt('MAIN_UPLOAD_DOC') * 1000) <= filesize($file['tmp_name'][$i])) {
setEventMessage($file['name'][$i].' : '.$langs->trans(empty($file['tmp_name'][$i]) ? 'ErrorFailedToSaveFile' : 'MaxSizeForUploadedFiles'));
setEventMessage($file['name'][$i].' : '.$langs->trans(empty($file['tmp_name'][$i]) ? 'ErrorFailedToSaveFile' : 'MaxSizeForUploadedFiles'), 'errors');
unset($file['name'][$i], $file['type'][$i], $file['tmp_name'][$i], $file['error'][$i], $file['size'][$i]);
}
}

View File

@ -1,5 +1,6 @@
<?php
/*
/* Copyright (C) 2024 Frédéric France <frederic.france@free.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

View File

@ -99,7 +99,7 @@ $upload_dir = $conf->webhook->multidir_output[isset($object->entity) ? $object->
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->webhook->enabled)) {
if (!isModEnabled('webhook')) {
accessforbidden();
}
if (!$permissiontoread) {
@ -159,7 +159,7 @@ if (empty($reshook)) {
if ($action == 'testsendtourl' && $permissiontoadd) {
$triggercode = GETPOST("triggercode");
$url = GETPOST("url");
$jsondata = GETPOST("jsondata", "restrcithtml");
$jsondata = GETPOST("jsondata", "restricthtml");
if (empty($url)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Url")), null, 'errors');
@ -211,22 +211,6 @@ $help_url = '';
llxHeader('', $title, $help_url, '', 0, 0, $arrayofjs, $arrayofcss);
// Example : Adding jquery code
// print '<script type="text/javascript">
// jQuery(document).ready(function() {
// function init_myfunc()
// {
// jQuery("#myid").removeAttr(\'disabled\');
// jQuery("#myid").attr(\'disabled\',\'disabled\');
// }
// init_myfunc();
// jQuery("#mybutton").click(function() {
// init_myfunc();
// });
// });
// </script>';
// Part to create
if ($action == 'create') {
if (empty($permissiontoadd)) {