Merge branch 'master' into feature-25562/PV21_Datenbankstruktur_fuer_Vertraege_und_Gehaelter

- remove popper from composer introduced in branch feature-25562, but master included bootstrap.bundle in the meanwhile to have popper available
This commit is contained in:
Harald Bamberger
2023-05-25 11:04:20 +02:00
45 changed files with 1096 additions and 301 deletions
+75
View File
@@ -0,0 +1,75 @@
<?php
/**
* Copyright (C) 2022 fhcomplete.net
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
require_once(dirname(__FILE__).'/../../vendor/nategood/httpful/bootstrap.php');
/**
* Simple client to call the signature server
*/
class SignatureLib
{
// -------------------------------------------------------------------------------------------------
// Public static methods
/**
* Returns the list of signature inside the given file
*/
public static function list($inputFileName)
{
try
{
// Get the content of the given file
$inputFileContent = file_get_contents($inputFileName);
if ($inputFileContent === false) // if failed
{
error_log('An error occurred while getting the content from: '.$inputFileName);
}
else
{
// Posts the given file content + file name and expects a response in JSON format
$resultPost = \Httpful\Request::post(SIGNATUR_URL.'/'.SIGNATUR_LIST_API)
->sendsJson()
->authenticateWith(SIGNATUR_USER, SIGNATUR_PASSWORD)
->body('{"filename": "'.basename($inputFileName).'", "content": "'.base64_encode($inputFileContent).'"}')
->expectsJson()
->send();
}
}
catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception
{
error_log($cee->getMessage());
}
catch (Exception $e) // any other exception
{
error_log($e->getMessage());
}
// If the response is fine
if (isset($resultPost->body) && is_object($resultPost->body)
&& isset($resultPost->body->retval) && is_array($resultPost->body->retval))
{
return $resultPost->body->retval;
}
// Otherwise return a null as error
return null;
}
}
+1 -5
View File
@@ -60,11 +60,7 @@
if ($bootstrap3 === true) generateJSsInclude('vendor/twbs/bootstrap3/dist/js/bootstrap.min.js');
// Bootstrap 5 JS
if ($bootstrap5 === true)
{
generateJSsInclude('vendor/popperjs/popperjs2/core@2');
generateJSsInclude('vendor/twbs/bootstrap5/dist/js/bootstrap.min.js');
}
if ($bootstrap5 === true) generateJSsInclude('vendor/twbs/bootstrap5/dist/js/bootstrap.bundle.min.js');
// Moment JS
if ($momentjs2 === true)