Commit 30eed01f authored by Charlotte Bataille's avatar Charlotte Bataille
Browse files

Merge branch 'develop' of https://labs.maarch.org/maarch/maarchRM into develop

parents 49916095 84132422
Pipeline #17733 failed with stages
in 22 seconds
# CHANGELOG
## Version 2.8.2
- `Changed` Possibilité d'ajouter des caractères spéciaux dans les identifiants d'organisations.
- `Fixed` Blocage du process d'extraction fulltext si un document était en erreur dans Apache Tika.
- `Changed` Possibilité de rechercher les archives d'un service producteur appartenant à une autre organisation si la liaison du service d'archive et service producteur existe dans un accord de versement.
- `Changed` Possibilité d'empêcher l'opérateur d'archivage d'accéder à toutes les archives du système. Voir point de configuration "ownerIsSuperUser" dans configuration.ini.default.
- `Fixed` Import via connecteur Octave.
## Version 2.8.1
- `Fixed` Impossible de modifier son mot de passe pour un utilisateur nouvellement créé
......
# Migration 2.8.2
## Modification dans la configuration :
### Ajout
Dans la section [recordsManagement], ajout de la directive `ownerIsSuperUser` qui permet de définir si les utilisateurs appartenant au service d'opérateur d'archvivage ont le droit ou non d'accéder à toutes les archives du système. Si `true`, alors les opérateurs ont accès à toutes les archives du système. Si `false`, l'opérateur d'archivage sera considéré comme n'importe quel autre service producteur et aura accès uniquement à ses propres archives dont il est déclaré comme producteur.
# Migration 2.7 vers 2.8
## Vhost :
......
......@@ -223,6 +223,11 @@ class userAccount
$userAccount->accountId = \laabs::newId();
$userAccount->accountType = 'user';
if (!is_null($userAccount->emailAddress) && !filter_var($userAccount->emailAddress, FILTER_VALIDATE_EMAIL)) {
$validationErrors = ["Email malformed"];
throw \laabs::newException("auth/invalidUserInformationException", $validationErrors);
}
$organizationController = \laabs::newController('organization/organization');
if (!is_null($organizations)) {
$organization = $organizationController->read($organizations[0]);
......
......@@ -882,7 +882,9 @@ class digitalResource
file_put_contents($srcfile, $contents);
$fullText .= $fullTextService->getText($srcfile);
try {
$fullText .= $fullTextService->getText($srcfile);
} catch (\Exception $exception) {}
}
}
......
......@@ -119,15 +119,16 @@ class ArchiveTransfer extends abstractMessage
foreach ($confParams as $name => $confParam) {
// Default value
$param = "";
if (isset($confParam["default"])) {
$value = $confParam["default"];
$param = $confParam["default"];
}
if (isset($params[$name]) && $params[$name] !== "") {
$value = $params[$name];
$param = $params[$name];
}
$params[$name] = $value;
$params[$name] = $param;
if ($param == "") {
if (isset($confParam["required"]) && $confParam["required"]) {
......
......@@ -1624,15 +1624,11 @@ class organization
public function getOriginator()
{
$currentService = \laabs::getToken("ORGANIZATION");
if (!$currentService) {
$this->view->addContentFile("recordsManagement/welcome/noWorkingOrg.html");
return $this->view->saveHtml();
}
$ownerOriginatorOrgs = $this->getOwnerOrgsByRole($currentService, 'originator');
$originators = [];
foreach ($ownerOriginatorOrgs as $org) {
foreach ($org->originator as $originator) {
foreach ($org->originators as $originator) {
$originator->ownerOrgName = $org->displayName;
$originators[] = $originator;
}
......@@ -1695,14 +1691,16 @@ class organization
|| ($role == 'originator' && $orgUnit->registrationNumber == $userOrgUnit->registrationNumber)
// Depositor = all
|| $role == 'depositor') {
// $originators = $orgUnit->originators;
if (!isset($userOrgs[(string)$orgUnit->ownerOrgId])) {
$orgObject = $this->read((string)$orgUnit->ownerOrgId);
$userOrgs[(string)$orgObject->orgId] = new \stdClass();
$userOrgs[(string)$orgObject->orgId]->displayName = $orgObject->displayName;
$userOrgs[(string)$orgObject->orgId]->{$role} = [];
$userOrgs[(string)$orgObject->orgId]->originators = [];
}
$userOrgs[(string)$orgObject->orgId]->{$role}[] = $orgUnit;
$userOrgs[(string)$orgObject->orgId]->originators[] = $orgUnit;
}
}
}
......
......@@ -937,7 +937,10 @@ trait archiveModificationTrait
stream_copy_to_stream($handler, $tmpStream);
rewind($tmpStream);
fclose($tmpStream);
$fullText .= $fulltextService->getText($tmpFile, $options) . " ";
try {
$fullText .= $fulltextService->getText($tmpFile, $options) . " ";
} catch (\Exception $exception) {}
unlink($tmpFile);
}
$archive = $this->retrieve($archiveId);
......
......@@ -79,7 +79,7 @@ class archive
$emptyRole = false;
// $ownerOriginatorOrgs = $this->getOwnerOriginatorsOrgs($currentService);
$orgController = \laabs::newController('organization/organization');
/* $orgController = \laabs::newController('organization/organization');
$originators = $orgController->getOriginator();
foreach ($originators as $originator) {
if (!isset($ownerOriginatorOrgs[(string) $originator->ownerOrgId])) {
......@@ -90,7 +90,7 @@ class archive
if (!in_array($originator, $ownerOriginatorOrgs[(string) $originator->ownerOrgId]->originators)) {
$ownerOriginatorOrgs[(string)$originator->ownerOrgId]->originators[] = $originator;
}
}
} */
}
$descriptionSchemeNames = \laabs::callService('recordsManagement/descriptionScheme/read_name_Descriptionfields');
......@@ -125,7 +125,7 @@ class archive
$this->view->setSource("retentionRules", $retentionRules);
$this->view->setSource("emptyRole", $emptyRole);
$this->view->setSource("profiles", $profiles);
$this->view->setSource("organizationsOriginator", $ownerOriginatorOrgs);
// $this->view->setSource("organizationsOriginator", $ownerOriginatorOrgs);
$this->view->setSource("deleteDescription", $deleteDescription);
$this->view->setSource("descriptionScheme", $descriptionSchemeNames);
......@@ -242,6 +242,7 @@ class archive
$archive->hasRights = false;
} else {
$archive->hasRights = $archiveController->checkRights($archive);
// $archive->hasRights = true;
}
} catch (\Exception $e) {
$archive->hasRights = false;
......
......@@ -204,8 +204,8 @@ msgstr "Comptes de service"
msgid "Submit"
msgstr "Valider"
msgid "You must use only letters, numbers and the special character '_'"
msgstr "Vous devez utiliser uniquement les lettres, les chiffres et le caractère spécial '_'"
msgid "You must use only letters, numbers and the special characters ('_','-','/' and '.')"
msgstr "Vous devez utiliser uniquement les lettres, les chiffres et les caractères spéciaux ('_','-','/' et '.')"
msgid "The first and last character must be a letter. You must use only letters and the special character '_'"
msgstr "Les premier et dernier caractères doivent être des lettres. Vous devez utiliser uniquement les lettres et le caractère spécial '_'"
......
......@@ -279,7 +279,7 @@
}
function validateEmail($email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailReg = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;
return emailReg.test($email);
}
......
......@@ -33,7 +33,7 @@
<div class="form-group">
<label>Registration number <span style="color: red">*</span></label>
<input type="text" class="form-control" name="registrationNumber" placeholder="Registration number">
<small class="help-block">You must use only letters, numbers and the special character '_'</small>
<small class="help-block">You must use only letters, numbers and the special characters ('_','-','/' and '.')</small>
</div>
<div class="form-group" id="orgForm_enabled" style="display: none">
<label>Enabled</label>
......@@ -265,7 +265,7 @@
var organization = OrganizationForm.serialize();
var pattern = new RegExp("^[A-Za-z0-9_]*[A-Za-z0-9_]$");
var pattern = new RegExp("^[A-Za-z0-9_/.-]*[A-Za-z0-9_/.-]$");
if(!pattern.test(organization.registrationNumber)) {
return;
......@@ -395,7 +395,7 @@
$("#organization_organizationForm").on("keyup","[name='registrationNumber']", function(){
var input = $(this);
var pattern = new RegExp("^[A-Za-z0-9_]*[A-Za-z0-9]$");
var pattern = new RegExp("^[A-Za-z0-9_/.-]*[A-Za-z0-9/.-]$");
var formGroup = input.closest('.form-group');
if(!input.val()) {
......
......@@ -902,11 +902,10 @@
/* -- EDITION MODAL -- */
var organizations = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('orgName'),
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('displayName'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: {
//url: '/organizations/todisplay?orgUnit=true',
url: '/originator',
url: '/organizations/todisplay?orgUnit=true',
ttl: '0'
},
limit: 100
......
......@@ -41,7 +41,7 @@
<div class="col-sm-8">
<input type="text" class="form-control orgHide" placeholder="Producer" name="originatorOwnerOrgRegNumber"
id="orgTypeahead" />
<select class="form-control hide" name="originatorOwnerOrgId" id="originatorOwnerOrgId">
<!-- <select class="form-control hide" name="originatorOwnerOrgId" id="originatorOwnerOrgId">
<option value="">All</option>
<?merge organizationsOriginator ?>
<div>
......@@ -50,8 +50,10 @@
<?merge .displayName ?>
</option>
</div>
</select>
<select class="form-control hide" name="originatorOrgRegNumber" id="originatorOrgRegNumber">
</select> -->
<input type="hidden" name="originatorOwnerOrgId" id="originatorOwnerOrgId" />
<!-- <select class="form-control hide" name="originatorOrgRegNumber" id="originatorOrgRegNumber">
<option value="">All</option>
<?merge organizationsOriginator ?>
<div>
......@@ -60,7 +62,8 @@
<?merge .displayName ?>
</option>
</div>
</select>
</select> -->
<input type="hidden" name="originatorOrgRegNumber" id="originatorOrgRegNumber" />
</div>
</div>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment