Commit 71996e8a authored by Alexandre Morin's avatar Alexandre Morin

Merge branch 'fix/2.3.4' into 'master'

Fix/2.3.4

See merge request !141
parents 38b5dca3 c0fb52ca
......@@ -162,7 +162,7 @@ blacklistUserStories = "[
'adminArchive/adminStorageRule'
]"
csrfWhiteList = "['user/login', '/user/password']"
csrfWhiteList = "['user/login', 'user/password']"
csrfConfig = '{
"cookieName" : "CSRF",
"tokenLength" : 32
......
......@@ -305,10 +305,10 @@ trait archiveEntryTrait
}
}
$this->manageFileplanPosition($archive);
$this->completeManagementMetadata($archive);
$this->manageFileplanPosition($archive);
if (empty($archive->descriptionClass) && isset($this->currentArchivalProfile->descriptionClass)) {
$archive->descriptionClass = $this->currentArchivalProfile->descriptionClass;
}
......
......@@ -68,7 +68,7 @@ class orgTree
*/
public function index($organizations, $orgType)
{
$orgRole = \laabs::configuration('organization')['orgUnitRoles'];;
$orgRole = \laabs::configuration('organization')['orgUnitRoles'];
$this->view->addContentFile("organization/organizationIndex.html");
$communicationMeans = \laabs::callService("contact/communicationMean/readIndex");
......@@ -77,14 +77,14 @@ class orgTree
$serviceLevel = \laabs::callService('recordsManagement/serviceLevel/readIndex');
// Sort archival profile by reference
usort($archivalProfile, function($a, $b){
usort($archivalProfile, function ($a, $b) {
return strcmp($a->reference, $b->reference);
});
if(\laabs::getToken("ORGANIZATION") && \laabs::getToken("ORGANIZATION")->orgRoleCodes){
$addOrganizationRight = in_array('owner',\laabs::getToken("ORGANIZATION")->orgRoleCodes);
if (\laabs::getToken("ORGANIZATION") && \laabs::getToken("ORGANIZATION")->orgRoleCodes) {
$addOrganizationRight = in_array('owner', \laabs::getToken("ORGANIZATION")->orgRoleCodes);
} else {
$addOrganizationRight = true;
$addOrganizationRight = false;
}
$adminOrg = \laabs::callService('auth/userAccount/readHasprivilege', "adminFunc/adminOrganization");
......@@ -106,12 +106,12 @@ class orgTree
$this->view->translate();
/*if (sizeof($organizations) != 0) {
$tree = $this->contructTree($organizations);
$tree = $this->contructTree($organizations);
if ($tree != null) {
$orgList = $this->view->getElementsByClass('dataTree')->item(0);
$orgList->appendChild($tree);
}
if ($tree != null) {
$orgList = $this->view->getElementsByClass('dataTree')->item(0);
$orgList->appendChild($tree);
}
}*/
return $this->view->saveHtml();
......@@ -129,16 +129,16 @@ class orgTree
/*
$html = '';
if (sizeof($organizations) > 0) {
$tree = $this->contructTree($organizations);
//$this->view->appendChild($tree);
foreach ($tree->childNodes as $branch) {
$html .= $this->view->saveHtml($branch);
}
$tree = $this->contructTree($organizations);
//$this->view->appendChild($tree);
foreach ($tree->childNodes as $branch) {
$html .= $this->view->saveHtml($branch);
}
}
return $html;
*/
*/
$this->view->addContentFile("organization/orgTree.html");
$this->view->setSource("adminOrg", $adminOrg);
$this->view->setSource("organizations", $organizations);
......@@ -199,7 +199,7 @@ class orgTree
$orgElement->appendChild($childrenContainer);
if (!empty($organization->organization)) {
$this->mergeOrgUnits($organization, $childrenContainer, $orgFragmentTemplate, $orgUnitFragmentTemplate, $personFragmentTemplate, $serviceFragmentTemplate, $contactFragmentTemplate);
$this->mergeOrgUnits($organization, $childrenContainer, $orgFragmentTemplate, $orgUnitFragmentTemplate, $personFragmentTemplate, $serviceFragmentTemplate, $contactFragmentTemplate);
}
if (!empty($organization->userPosition)) {
......@@ -244,7 +244,6 @@ class orgTree
$this->view->merge($orgUnitFragment, $orgUnit);
$orgUnitItem = $container->appendChild($orgUnitFragment);
if (!empty($orgUnit->organization) || isset($orgUnit->userPosition) && !empty($orgUnit->userPosition) || isset($orgUnit->servicePosition) && !empty($orgUnit->orgContact)) {
$childrenContainer = $this->view->createElement('ul');
$orgUnitItem->appendChild($childrenContainer);
......@@ -325,14 +324,14 @@ class orgTree
protected function addOrganizatonToFilePlan($organizations, $parentNode, $document)
{
foreach ($organizations as $organization) {
if(!$organization->isOrgUnit){
if (!$organization->isOrgUnit) {
$orgNode = $document->createElement('Organization', (string) $organization->displayName);
} else {
$orgNode = $document->createElement('Activity');
}
$orgNode->setAttribute('registrationNumber', $organization->registrationNumber);
if ($organization->organization){
if ($organization->organization) {
$this->addOrganizatonToFilePlan($organization->organization, $orgNode, $document);
}
......@@ -355,7 +354,7 @@ class orgTree
protected function addProfileToFilePlan($profiles, $parentNode, $document)
{
foreach ($profiles as $profile) {
if ($profile=="*") {
if ($profile == "*") {
continue;
}
......@@ -363,7 +362,7 @@ class orgTree
$profileNode->setAttribute('reference', (string) $profile->reference);
$profileNode->setAttribute('retentionRuleCode', (string) $profile->retentionRuleCode);
if ($profile->containedProfiles){
if ($profile->containedProfiles) {
$this->addProfileToFilePlan($profile->containedProfiles, $profileNode, $document);
}
......@@ -521,10 +520,11 @@ class orgTree
return json_encode($organization);
}
public function orgList($organizations){
public function orgList($organizations)
{
$orgs = [];
foreach ($organizations as $org){
$orgs [] = $org;
foreach ($organizations as $org) {
$orgs[] = $org;
}
return json_encode($orgs);
......
......@@ -452,3 +452,5 @@ msgstr "Le fichier conteneur est non conforme."
msgid "Journal file cannot be written"
msgstr "Le journal ne peut pas être écrit"
msgid "You're not allowed to create an organization"
msgstr "Vous n'êtes pas autorisé à créer une organisation"
......@@ -41,7 +41,7 @@
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-4 control-label" for="status">Status</label>
<label class="col-sm-4 control-label">Status</label>
<div class="btn-group col-sm-6" data-toggle="buttons" >
<label class="btn btn-info active status" title="all">
<input type="radio" id="all" name="status" value="all" checked>All
......@@ -140,7 +140,8 @@
clear: function() {
this.form.find('input[type=text]').val('');
this.form.find('select').prop('selectedIndex', 0);
$('#eventName').data('event-path')
$('#eventName').data('event-path', "");
$('#accountTypeahead').data('accountid', "");
this.form.find('.wordingAll').click();
this.form.find('.status :first').click();
......@@ -165,6 +166,20 @@
EventSearchForm.clear();
});
$("#eventName").on("keyup", function () {
if (!$(this).val()) {
$("#eventName").val("");
$("#eventName").data('event-path', "");
}
});
$("#accountTypeahead").on("keyup", function () {
if (!$(this).val()) {
$('#accountTypeahead').val('');
$('#accountTypeahead').data('accountid', "");
}
});
// checkBox button
$("#eventSearchForm").on('click', '.status', function () {
$('#eventSearchForm').find('.status').removeClass('btn-info active').addClass('btn-default');
......
......@@ -52,7 +52,7 @@
this.fromFolder = FilePlan.selectedNode;
}
var folderName = toFolder.find('b:first').text();
var folderName = toFolder.find('b:first').text().trim()
if (folderName.length > 30) { folderName = folderName.substring(0,27)+'...' }
if (archives.length == 1) {
......
<li id="[?merge .orgId ?]" class="organization"
<li id="[?merge .registrationNumber ?]" class="organization"
data-path="[?merge .displayName ?]"
data-orgregnumber="[?merge .registrationNumber ?]"
data-archivalprofiles="[?merge .archivalProfiles.json() ?]"
......
......@@ -39,7 +39,10 @@ DeleteConfirmationModal = {
var message = $('#deleteFolderMessage_txt').text();
message = message.replace("%1$s", '<i class="text-primary">'+ this.target.find('b:first').text() +'<\/i>');
folderName=this.target.find('b:first').text().trim()
if (folderName.length > 30) { folderName = folderName.substring(0,27)+'...' }
message = message.replace("%1$s", '<i class="text-primary">'+ folderName +'<\/i>');
this.messageDiv.html(message);
modal.modal();
......
......@@ -278,7 +278,7 @@ FulltextSearchForm = {
// Standard text (name, keywords...)
if (value !== '') {
query.description[name] = name+'="'+value+'"';
query.description[name] = name+'="'+value.trim()+'"';
}
break;
......@@ -315,12 +315,13 @@ FulltextSearchForm = {
}
$('#app_maarchRM_main').keypress(function (e) {
if (e.which != 13) {
if (e.which != 13 || document.getElementById("searchForm_inputSearchBtn").disabled == true) {
return;
}
e.preventDefault();
FulltextSearchForm.search();
});
});
$('#profileSelection').on('click', 'a', function() {
var profileSelection = $('#profileSelection');
......
Markdown is supported
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