diff --git a/.gitignore b/.gitignore index ae664ef2e8645ce007c5d2a7d4650cacff22dcb6..cf4b0957983479cfa61b4ba3c3e7c2ff911e6b31 100755 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ apps/maarch_entreprise/xml/log4php.xml .phplint.yml *.log xdelete.sh -test/build/ +test/unitTests/build/ apps/maarch_entreprise/js/angular/main.bundle.js modules/convert/batch/scripts/launch_fulltext_letterbox.sh modules/convert/batch/scripts/launch_convert_letterbox.sh diff --git a/modules/visa/batch/batch_tools.php b/modules/visa/batch/batch_tools.php index 1b758ddd86e64deb73cad657a2541f473b2a6f63..59a310875b1c4e1568454ec04ca0d53d5e594cc8 100755 --- a/modules/visa/batch/batch_tools.php +++ b/modules/visa/batch/batch_tools.php @@ -96,6 +96,18 @@ function Bt_logInDataBase($totalProcessed=0, $totalErrors=0, $info='') $GLOBALS['db']->query($query, $arrayPDO); } + +/** +* Insert in the database a line for history +*/ +function Bt_history($aArgs = []) +{ + $query = "INSERT INTO history (table_name, record_id, event_type, " + . "user_id, event_date, info, id_module, remote_ip, event_id) values(?, ?, ?, ?, CURRENT_TIMESTAMP, ?, ?, ?, ?)"; + $arrayPDO = array($aArgs['table_name'], $aArgs['record_id'], 'UP', 'superadmin', $aArgs['info'], 'visa', 'localhost', 'attachup'); + $GLOBALS['db']->query($query, $arrayPDO); +} + /** * Get the batch if of the batch * @@ -200,6 +212,18 @@ function Bt_refusedSignedMail($aArgs = []) $GLOBALS['db']->query('UPDATE listinstance SET process_date = NULL WHERE res_id = ? AND difflist_type = ?', [$aArgs['resIdMaster'], 'VISA_CIRCUIT']); $GLOBALS['db']->query("UPDATE res_letterbox SET status = '" . $aArgs['refusedStatus'] . "' WHERE res_id = ?", [$aArgs['resIdMaster']]); + + Bt_history([ + 'table_name' => $aArgs['tableAttachment'], + 'record_id' => $aArgs['resIdAttachment'], + 'info' => 'Signature refusée dans le parapheur externe' + ]); + + Bt_history([ + 'table_name' => 'res_letterbox', + 'record_id' => $aArgs['resIdMaster'], + 'info' => 'La signature de la pièce jointe '.$aArgs['resIdAttachment'].' ('.$aArgs['tableAttachment'].') a été refusée dans le parapheur externe' + ]); } function Bt_processVisaWorkflow($aArgs = []) diff --git a/modules/visa/batch/process_mailsFromSignatoryBook.php b/modules/visa/batch/process_mailsFromSignatoryBook.php index a46ce850e0b03ee24a12302fdff835aa2b733d45..1ccc046dbadfaf0802ddfae3c58c330f2f906b9e 100755 --- a/modules/visa/batch/process_mailsFromSignatoryBook.php +++ b/modules/visa/batch/process_mailsFromSignatoryBook.php @@ -262,6 +262,16 @@ foreach ($retrievedMails['isVersion'] as $resId => $value) { $GLOBALS['db']->query("UPDATE res_version_attachments set status = 'TRA' WHERE res_id = ?", [$resId]); Bt_processVisaWorkflow(['res_id_master' => $value->res_id_master]); + Bt_history([ + 'table_name' => 'res_version_attachments', + 'record_id' => $resId, + 'info' => 'Signature validée dans le parapheur externe' + ]); + Bt_history([ + 'table_name' => 'res_letterbox', + 'record_id' => $value->res_id_master, + 'info' => 'La signature de la pièce jointe '.$resId.' (res_version_attachments) a été validée dans le parapheur externe' + ]); } elseif ($value->status == 'refused') { Bt_refusedSignedMail([ 'tableAttachment' => 'res_version_attachments', @@ -292,6 +302,16 @@ foreach ($retrievedMails['noVersion'] as $resId => $value) { $GLOBALS['db']->query("UPDATE res_attachments SET status = 'TRA' WHERE res_id = ?", [$resId]); Bt_processVisaWorkflow(['res_id_master' => $value->res_id_master]); + Bt_history([ + 'table_name' => 'res_attachments', + 'record_id' => $resId, + 'info' => 'Signature validée dans le parapheur externe' + ]); + Bt_history([ + 'table_name' => 'res_letterbox', + 'record_id' => $value->res_id_master, + 'info' => 'La signature de la pièce jointe '.$resId.' (res_attachments) a été validée dans le parapheur externe' + ]); } elseif ($value->status == 'refused') { Bt_refusedSignedMail([ 'tableAttachment' => 'res_attachments', diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index dc02dfb114fb6af2eacf89407a529c37ab8e7eb8..4626994fd4d8ac4c5489670d85b09af1b6d8aab0 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -374,14 +374,10 @@ class ClassLoader $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath.'\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { + foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { + if (0 === strpos($class, $prefix)) { + foreach ($this->prefixDirsPsr4[$prefix] as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { return $file; } } diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index f0157a6ed025c0168a2f595d09a98b800c5ba431..1a28124886db89f1ca3e4fa674cb69a9a17585b3 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,56 +1,21 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: Composer -Upstream-Contact: Jordi Boggiano <j.boggiano@seld.be> -Source: https://github.com/composer/composer -Files: * -Copyright: 2016, Nils Adermann <naderman@naderman.de> - 2016, Jordi Boggiano <j.boggiano@seld.be> -License: Expat +Copyright (c) 2016 Nils Adermann, Jordi Boggiano -Files: src/Composer/Util/TlsHelper.php -Copyright: 2016, Nils Adermann <naderman@naderman.de> - 2016, Jordi Boggiano <j.boggiano@seld.be> - 2013, Evan Coury <me@evancoury.com> -License: Expat and BSD-2-Clause +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: -License: BSD-2-Clause - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - . - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. -License: Expat - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is furnished - to do so, subject to the following conditions: - . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE.