diff --git a/apps/maarch_entreprise/indexing_searching/search_adv_result.php b/apps/maarch_entreprise/indexing_searching/search_adv_result.php index 78a1139b1092aea336439de00bc9967b06a50ba2..6f2c33d42b9047db570a7939aaf285d7dcd8ee74 100755 --- a/apps/maarch_entreprise/indexing_searching/search_adv_result.php +++ b/apps/maarch_entreprise/indexing_searching/search_adv_result.php @@ -153,7 +153,7 @@ if (count($_REQUEST['meta']) > 0) { $arrayPDO = array_merge($arrayPDO, array(":multifield2" => $multifield)); } - $multifield = \Core\Models\TextFormatModel::normalize(['string' => $multifield]); + $multifield = \SrcCore\models\TextFormatModel::normalize(['string' => $multifield]); $multifield = preg_replace('/\s+/', ' ', $multifield); $arrayPDO = array_merge($arrayPDO, array(":multifield" => "%".$multifield."%")); @@ -482,7 +482,7 @@ if (count($_REQUEST['meta']) > 0) { ."or res_id in (select res_id_master from res_view_attachments where (lower(translate(identifier,'/','')) like lower(:multifieldWelcome) OR lower(identifier) like lower(:multifieldWelcome)) AND status NOT IN ('DEL','OBS','TMP')) " ."or contact_id in (select contact_id from view_contacts where society ilike :multifieldWelcome or contact_firstname ilike :multifieldWelcome or contact_lastname ilike :multifieldWelcome) or (exp_user_id in (select user_id from users where firstname ilike :multifieldWelcome or lastname ilike :multifieldWelcome )))"; - $multifieldWelcome = \Core\Models\TextFormatModel::normalize(['string' => $welcome]); + $multifieldWelcome = \SrcCore\models\TextFormatModel::normalize(['string' => $welcome]); $multifieldWelcome = preg_replace('/\s+/', ' ', $multifieldWelcome); $arrayPDO = array_merge($arrayPDO, array(":multifieldWelcome" => "%".$multifieldWelcome."%")); set_include_path('apps' . DIRECTORY_SEPARATOR diff --git a/core/Models/TextFormatModel.php b/core/Models/TextFormatModel.php deleted file mode 100755 index 8d7aa554105c3c3ca665a7a2a823b19d394ce226..0000000000000000000000000000000000000000 --- a/core/Models/TextFormatModel.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/** -* Copyright Maarch since 2008 under licence GPLv3. -* See LICENCE.txt file at the root folder for more details. -* This file is part of Maarch software. -* -*/ - -/** -* @brief Text Format Model -* @author dev@maarch.org -* @ingroup core -*/ - -namespace Core\Models; - -class TextFormatModel extends TextFormatModelAbstract -{ - // Do your stuff in this class -} diff --git a/modules/convert/Controllers/ProcessFulltextController.php b/modules/convert/Controllers/ProcessFulltextController.php index bfd529235896651cef63cb36c0fcac6d062dc3e4..31661e341113283095c656ed311caec2cb093916 100644 --- a/modules/convert/Controllers/ProcessFulltextController.php +++ b/modules/convert/Controllers/ProcessFulltextController.php @@ -33,10 +33,9 @@ use Docserver\models\DocserverModel; use Docserver\models\ResDocserverModel; use SrcCore\controllers\LogsController; use SrcCore\controllers\StoreController; +use SrcCore\models\TextFormatModel; -//include_once('html2text/html2text.php'); - class ProcessFulltextController { protected $pdftotext; @@ -505,7 +504,7 @@ class ProcessFulltextController private function launchIndexFullText($fileContent, $tempIndexFileDirectory, $Id) { // $IndexFileDirectory is replace by tempIndexFileDirectory - $fileContent = \Core\Models\TextFormatModel::normalize(['string' => $fileContent]); + $fileContent = TextFormatModel::normalize(['string' => $fileContent]); $fileContent = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $fileContent); $indexFileDirectory = (string) $tempIndexFileDirectory; // with version 1.12, we need a string, not an XML element diff --git a/phpunit.xml b/phpunit.xml index a0616131b920483b0e9b4cb02f8dca78a7707ecc..abc289c7bf7ec18509b3a14400b42f3f16efec22 100755 --- a/phpunit.xml +++ b/phpunit.xml @@ -5,6 +5,7 @@ <!--directory>core/Test</directory--> <file>core/Test/ActionControllerTest.php</file> <file>core/Test/BasketControllerTest.php</file> + <file>core/Test/ContactControllerTest.php</file> <file>core/Test/EntityControllerTest.php</file> <file>core/Test/ListTemplateControllerTest.php</file> <file>core/Test/DoctypeControllerTest.php</file> @@ -26,14 +27,11 @@ <whitelist> <directory suffix="Test.php">core/Test</directory> <directory suffix=".php">src</directory> - <directory suffix=".php">core/Controllers</directory> - <directory suffix=".php">core/Models</directory> + <directory suffix=".php">core/Models</directory> <directory suffix=".php">modules/visa/Controllers</directory> <directory suffix=".php">modules/visa/Models</directory> <directory suffix=".php">modules/attachments/Controllers</directory> <directory suffix=".php">modules/attachments/Models</directory> - <directory suffix=".php">modules/entities/Controllers</directory> - <directory suffix=".php">modules/entities/Models</directory> <directory suffix=".php">modules/notes/Models</directory> <directory suffix=".php">modules/convert/Controllers</directory> <directory suffix=".php">modules/convert/Models</directory> diff --git a/src/app/history/controllers/HistoryController.php b/src/app/history/controllers/HistoryController.php index 66bd1bd3c48a940f413e4a1e4d5c2e31e1f180c4..ee854eedaf3b1df78ec2eb00dc962b52f0e0aecc 100644 --- a/src/app/history/controllers/HistoryController.php +++ b/src/app/history/controllers/HistoryController.php @@ -14,8 +14,8 @@ namespace History\controllers; -use Core\Models\TextFormatModel; use Core\Models\ServiceModel; +use SrcCore\models\TextFormatModel; use SrcCore\models\ValidatorModel; use History\models\HistoryModel; use Notification\controllers\NotificationsEventsController; diff --git a/src/core/controllers/LogsController.php b/src/core/controllers/LogsController.php index 584cc67cb2f39243ff0edb1d938739b3c013a26c..3e83b4ff518ee0d80d5f5d953a06015ee3c8159a 100644 --- a/src/core/controllers/LogsController.php +++ b/src/core/controllers/LogsController.php @@ -15,7 +15,7 @@ namespace SrcCore\controllers; -use Core\Models\TextFormatModel; +use SrcCore\models\TextFormatModel; use SrcCore\models\ValidatorModel; if (!defined('_LOG4PHP')) @@ -36,6 +36,7 @@ if (!defined('_LOGGER_NAME_FUNC_DEFAULT')) require_once 'apps/maarch_entreprise/tools/log4php/Logger.php'; +//TODO Cleaning Refactoring class LogsController { protected static function getLoggingMethodConfFile() diff --git a/core/Models/TextFormatModelAbstract.php b/src/core/models/TextFormatModel.php old mode 100755 new mode 100644 similarity index 97% rename from core/Models/TextFormatModelAbstract.php rename to src/core/models/TextFormatModel.php index af8816d5ee049ae59c8cd71b8ae3cd54856f1d79..934c96881dc25bae17e3101a530920ddaa6ca338 --- a/core/Models/TextFormatModelAbstract.php +++ b/src/core/models/TextFormatModel.php @@ -8,14 +8,13 @@ */ /** -* @brief Text Format Model Abstract +* @brief Text Format Model * @author dev@maarch.org -* @ingroup core */ -namespace Core\Models; +namespace SrcCore\models; -class TextFormatModelAbstract +class TextFormatModel { public static function normalize(array $aArgs) {