Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostico committed Nov 8, 2024
2 parents 0b48db3 + 72ba1dd commit 58fe3a1
Show file tree
Hide file tree
Showing 75 changed files with 285 additions and 242 deletions.
48 changes: 24 additions & 24 deletions INSTALL/matecat.sql
Original file line number Diff line number Diff line change
Expand Up @@ -786,36 +786,36 @@ CREATE TABLE `projects`
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `qa_archived_reports`
-- Table structure for table `project_templates`
--

DROP TABLE IF EXISTS `project_templates`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `project_templates` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`is_default` tinyint(1) NOT NULL DEFAULT '0',
`uid` bigint(20) NOT NULL,
`id_team` int(11) NOT NULL,
`speech2text` tinyint(1) NOT NULL DEFAULT '0',
`lexica` tinyint(1) NOT NULL DEFAULT '0',
`tag_projection` tinyint(1) NOT NULL DEFAULT '0',
`pretranslate_100` tinyint(1) NOT NULL DEFAULT '0',
`pretranslate_101` tinyint(1) NOT NULL DEFAULT '1',
`get_public_matches` tinyint(1) NOT NULL DEFAULT '0',
`segmentation_rule` varchar(255) DEFAULT NULL,
`cross_language_matches` text,
`tm` text,
`mt` text,
`payable_rate_template_id` int(11) DEFAULT NULL,
`qa_model_template_id` int(11) DEFAULT NULL,
`filters_xliff_config_template_id` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`modified_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uid_name_idx` (`uid`,`name`),
KEY `uid_idx` (`uid`)
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`is_default` tinyint(1) NOT NULL DEFAULT '0',
`uid` bigint(20) NOT NULL,
`id_team` int(11) NOT NULL,
`pretranslate_100` tinyint(1) NOT NULL DEFAULT '0',
`pretranslate_101` tinyint(1) NOT NULL DEFAULT '1',
`get_public_matches` tinyint(1) NOT NULL DEFAULT '0',
`segmentation_rule` varchar(255) DEFAULT NULL,
`tm` text,
`mt` text,
`payable_rate_template_id` int(11) DEFAULT NULL,
`qa_model_template_id` int(11) DEFAULT NULL,
`filters_template_id` int(11) DEFAULT NULL,
`xliff_config_template_id` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`modified_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`subject` varchar(255) DEFAULT NULL,
`source_language` varchar(45) DEFAULT NULL,
`target_language` varchar(2048) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uid_name_idx` (`uid`,`name`),
KEY `uid_idx` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/API/App/Authentication/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class LoginController extends AbstractStatefulKleinController {

use RateLimiterTrait;

public function logout() {
$this->broadcastLogout();
public function directLogout() {
$this->logout();
$this->response->code( 200 );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getUser(): ?Users_UserStruct {
}

public function broadcastLogout() {
AuthenticationHelper::destroyAuthentication( $_SESSION );
$this->logout();
$queueHandler = new AMQHandler();
$message = json_encode( [
'_type' => 'logout',
Expand All @@ -77,4 +77,8 @@ public function broadcastLogout() {
$queueHandler->publishToTopic( INIT::$SSE_NOTIFICATIONS_QUEUE_NAME, new Message( $message ) );
}

public function logout(){
AuthenticationHelper::destroyAuthentication( $_SESSION );
}

}
2 changes: 1 addition & 1 deletion lib/Controller/API/V1/StatsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

use API\Commons\KleinController;
use API\Commons\Validators\ChunkPasswordValidator;
use CatUtils;
use API\V2\Validators\LoginValidator;
use CatUtils;
use Jobs_JobStruct;
use WordCount\WordCountStruct;

Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/API/V2/ActivityLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use ActivityLog\ActivityLogDao;
use ActivityLog\ActivityLogStruct;
use API\Commons\KleinController;
use API\Commons\Validators\ChunkPasswordValidator;
use API\Commons\Validators\ProjectPasswordValidator;
use API\V2\Json\Activity;
use Exception;
use ReflectionException;
use API\Commons\Validators\ChunkPasswordValidator;
use API\Commons\Validators\ProjectPasswordValidator;

class ActivityLogController extends KleinController {

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/BaseChunkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace API\V2;

use API\Commons\KleinController;
use Jobs_JobStruct;
use Jobs_JobDao;
use Jobs_JobStruct;
use LQA\ChunkReviewDao;
use ReflectionException;

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/ChangePasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

use API\Commons\Validators\LoginValidator;
use CatUtils;
use Jobs_JobStruct;
use Database;
use Exception;
use Features\ReviewExtended\ReviewUtils;
use Jobs_JobDao;
use Jobs_JobStruct;
use LQA\ChunkReviewDao;
use Projects_ProjectDao;
use Projects_ProjectStruct;
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/API/V2/ChunkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
namespace API\V2;

use API\Commons\Validators\ChunkPasswordValidator;
use API\Commons\Validators\ProjectAccessValidator;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\ProjectAccessValidator;
use API\V2\Json\Chunk;
use Jobs_JobStruct;
use Constants_JobStatus;
use Exception;
use Exceptions\NotFoundException;
use Jobs_JobDao;
use Jobs_JobStruct;
use Projects_ProjectStruct;
use Translations_SegmentTranslationDao;
use Utils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use API\Commons\Validators\ChunkPasswordValidator;
use API\Commons\Validators\LoginValidator;
use API\V2\Json\SegmentVersion as JsonFormatter;
use Jobs_JobStruct;
use Features\TranslationVersions\Model\TranslationVersionDao;
use Jobs_JobStruct;


class ChunkTranslationVersionController extends BaseChunkController {
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/CommentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

use API\Commons\Validators\ChunkPasswordValidator;
use API\Commons\Validators\LoginValidator;
use Jobs_JobStruct;
use Comments_CommentDao;
use Exception;
use Jobs_JobStruct;

class CommentsController extends BaseChunkController {

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/JobMergeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
namespace API\V2;
use API\Commons\Exceptions\NotFoundException;
use API\Commons\KleinController;
use API\Commons\Validators\ProjectPasswordValidator;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\ProjectPasswordValidator;
use Jobs_JobStruct;
use ProjectManager;

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/JobSplitController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use API\Commons\Exceptions\NotFoundException;
use API\Commons\Exceptions\UnprocessableException;
use API\Commons\KleinController;
use API\Commons\Validators\ProjectPasswordValidator;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\ProjectPasswordValidator;
use Exception;
use Jobs_JobStruct;
use ProjectManager;
Expand Down
1 change: 0 additions & 1 deletion lib/Controller/API/V2/ProjectCompletionStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use API\Commons\KleinController;
use API\Commons\Validators\ProjectPasswordValidator;
use API\Commons\Validators\ProjectValidator;
use API\Commons\Validators\LoginValidator;
use Features\ProjectCompletion\Model\ProjectCompletionStatusModel;
use Projects_ProjectStruct;

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/ProjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace API\V2;

use API\Commons\KleinController;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\ProjectAccessValidator;
use API\Commons\Validators\ProjectPasswordValidator;
use API\Commons\Validators\LoginValidator;
use API\V2\Json\Project;
use API\V2\Json\ProjectAnonymous;
use Constants_JobStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@


use API\Commons\Validators\JobPasswordValidator;
use API\Commons\Validators\SegmentTranslation;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\SegmentTranslation;
use API\V2\Json\SegmentVersion;
use Chunks_ChunkDao;
use Features\TranslationVersions\Model\TranslationVersionDao;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/SegmentVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace API\V2;

use API\Commons\Validators\JobPasswordValidator;
use API\Commons\Validators\SegmentValidator;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\SegmentValidator;
use API\V2\Json\SegmentVersion as JsonFormatter;
use Features\TranslationVersions\Model\TranslationVersionDao;

Expand Down
2 changes: 0 additions & 2 deletions lib/Controller/API/V2/TeamMembersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@

namespace API\V2;

use API\Commons\Authentication\AuthenticationHelper;
use API\Commons\KleinController;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\TeamAccessValidator;
use API\V2\Json\Membership;
use Bootstrap;
use Exception;
use ReflectionException;
use TeamModel;
Expand Down
2 changes: 0 additions & 2 deletions lib/Controller/API/V2/TeamsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
namespace API\V2;


use API\Commons\Authentication\AuthenticationHelper;
use API\Commons\Error;
use API\Commons\Exceptions\AuthorizationError;
use API\Commons\KleinController;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\TeamAccessValidator;
use API\V2\Json\Team;
use Bootstrap;
use Exception;
use InvalidArgumentException;
use ReflectionException;
Expand Down
2 changes: 0 additions & 2 deletions lib/Controller/API/V2/TeamsProjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
namespace API\V2;


use API\Commons\Authentication\AuthenticationHelper;
use API\Commons\Exceptions\AuthorizationError;
use API\Commons\Exceptions\NotFoundException;
use API\Commons\KleinController;
Expand All @@ -18,7 +17,6 @@
use API\Commons\Validators\TeamAccessValidator;
use API\Commons\Validators\TeamProjectValidator;
use API\V2\Json\Project;
use Bootstrap;
use Exception;
use Exceptions\ValidationError;
use ManageUtils;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V2/UrlsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
namespace API\V2;

use API\Commons\KleinController;
use API\Commons\Validators\ProjectPasswordValidator;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\ProjectPasswordValidator;
use API\V2\Json\ProjectUrls;
use DataAccess\ShapelessConcreteStruct;

Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V3/ChunkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
use API\Commons\Validators\LoginValidator;
use API\V2\BaseChunkController;
use API\V3\Json\Chunk;
use Jobs_JobStruct;
use Exception;
use Exceptions\NotFoundException;
use Jobs_JobStruct;
use Projects_ProjectStruct;

class ChunkController extends BaseChunkController {
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V3/CountWordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
namespace API\V3;

use API\Commons\Exceptions\ValidationError;
use API\Commons\Validators\LoginValidator;
use API\Commons\KleinController;
use API\Commons\Validators\LoginValidator;
use CatUtils;
use Langs\Languages;
use LQA\SizeRestriction\SizeRestriction;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/API/V3/FileInfoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
use API\Commons\Validators\ChunkPasswordValidator;
use API\Commons\Validators\LoginValidator;
use API\V2\BaseChunkController;
use Jobs_JobStruct;
use Exceptions\ValidationError;
use Files\FilesInfoUtility;
use Jobs_JobStruct;
use Projects_ProjectStruct;
use TaskRunner\Exceptions\EndQueueException;
use TaskRunner\Exceptions\ReQueueException;
Expand Down
1 change: 0 additions & 1 deletion lib/Controller/API/V3/PayableRateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Klein\Response;
use PayableRates\CustomPayableRateDao;
use PayableRates\CustomPayableRateStruct;
use ReflectionException;
use Swaggest\JsonSchema\InvalidValue;
use Validator\Errors\JSONValidatorException;
use Validator\Errors\JsonValidatorGenericException;
Expand Down
4 changes: 0 additions & 4 deletions lib/Controller/API/V3/SegmentAnalysisController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
use CatUtils;
use Chunks_ChunkDao;
use DataAccess_IDaoStruct;
use Database;
use Exception;
use Exceptions\NotFoundException;
use Features\ReviewExtended\ReviewUtils;
use Jobs_JobDao;
use Jobs_JobStruct;
use LQA\EntryDao;
use Pagination\Pager;
use Pagination\PaginationParameters;
use Projects\ProjectTemplateStruct;
use Projects_ProjectDao;
use Projects_ProjectStruct;
use ReflectionException;
Expand Down
3 changes: 0 additions & 3 deletions lib/Controller/API/V3/StatusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace API\V3;

use API\App\Json\Analysis\AnalysisProject;
use API\Commons\Exceptions\AuthenticationError;
use API\Commons\Exceptions\NotFoundException;
use API\Commons\KleinController;
use API\Commons\Validators\LoginValidator;
use API\Commons\Validators\ProjectPasswordValidator;
use Constants_JobStatus;
use Exceptions\ValidationError;
use Model\Analysis\Status;
use Projects_ProjectDao;

Expand Down
1 change: 0 additions & 1 deletion lib/Model/Comments/CommentDao.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use Comments\OpenThreadsStruct;
use DataAccess\ShapelessConcreteStruct;

class Comments_CommentDao extends DataAccess_AbstractDao {

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/Files/FilesJobDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Files;

use Jobs_JobStruct;
use DataAccess_AbstractDao;
use Database;
use Files_FileStruct;
use Jobs_JobStruct;
use PDO;

class FilesJobDao extends DataAccess_AbstractDao {
Expand Down
1 change: 0 additions & 1 deletion lib/Model/FilesStorage/IFilesStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FilesStorage;

use Jobs_JobStruct;
use Exception;
use FilesStorage\Exceptions\FileSystemException;

Expand Down
Loading

0 comments on commit 58fe3a1

Please sign in to comment.