Skip to content

Commit

Permalink
Merge pull request #1950 from xibosignage/develop
Browse files Browse the repository at this point in the history
Release 3.3.7
  • Loading branch information
dasgarner authored Aug 1, 2023
2 parents 591c039 + 7fc7054 commit 19bea76
Show file tree
Hide file tree
Showing 62 changed files with 84 additions and 64 deletions.
4 changes: 2 additions & 2 deletions lib/Controller/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Copyright (C) 2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -319,7 +319,7 @@ public function grid(Request $request, Response $response)
'url' => $this->urlFor($request, 'campaign.edit.form', ['id' => $campaign->campaignId]),
'text' => __('Edit'),
);
} else if ($campaign->type === 'ad' && $this->getUser()->featureEnabled('ad.campaigns')) {
} else if ($campaign->type === 'ad' && $this->getUser()->featureEnabled('ad.campaign')) {
$campaign->buttons[] = [
'id' => 'campaign_button_edit',
'linkType' => '_self',
Expand Down
27 changes: 17 additions & 10 deletions lib/Controller/Folder.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/*
* Copyright (c) 2022 Xibo Signage Ltd
* Copyright (C) 2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -85,6 +85,7 @@ public function displayPage(Request $request, Response $response)
*/
public function grid(Request $request, Response $response, $folderId = null)
{
$params = $this->getSanitizer($request->getParams());
// Should we return information for a specific folder?
if ($folderId !== null) {
$folder = $this->folderFactory->getById($folderId);
Expand All @@ -99,7 +100,15 @@ public function grid(Request $request, Response $response, $folderId = null)
// Show a tree view of all folders.
$rootFolder = $this->folderFactory->getById(1);
$rootFolder->a_attr['title'] = __('Right click a Folder for further Options');
$this->buildTreeView($rootFolder, $this->getUser()->homeFolderId);

// homeFolderId,
// do we show tree for current user
// or a specified user?
$homeFolderId = ($params->getInt('homeFolderId') !== null)
? $params->getInt('homeFolderId')
: $this->getUser()->homeFolderId;

$this->buildTreeView($rootFolder, $homeFolderId);
return $response->withJson([$rootFolder]);
}
}
Expand Down Expand Up @@ -357,7 +366,10 @@ private function decorateWithButtons($folder)
{
$user = $this->getUser();

if ($user->featureEnabled('folder.add') && $user->checkViewable($folder)) {
if ($user->featureEnabled('folder.add')
&& $user->checkViewable($folder)
&& (!$folder->isRoot() || $user->isSuperAdmin())
) {
$folder->buttons['create'] = true;
}

Expand Down Expand Up @@ -430,12 +442,7 @@ public function move(Request $request, Response $response, $folderId)
}

if ($folder->parentId === $newParentFolder->getId() && $params->getCheckbox('merge') !== 1) {
throw new InvalidArgumentException(
__(
'This Folder is already a sub-folder of the selected Folder,
if you wish to move its content to the parent Folder, please check the merge checkbox.'
)
);
throw new InvalidArgumentException(__('This Folder is already a sub-folder of the selected Folder, if you wish to move its content to the parent Folder, please check the merge checkbox.'));//phpcs:ignore
}

// if we need to merge contents of the folder, dispatch an event that will move every object inside the folder
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ public function delete(Request $request, Response $response, $id)
* name="playlistId",
* in="formData",
* description="A playlistId to add this uploaded media to",
* type="int",
* type="integer",
* required=false
* ),
* @SWG\Parameter(
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/User.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/*
* Copyright (C) 2022 Xibo Signage Ltd
* Copyright (C) 2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -1910,7 +1910,7 @@ public function permissions(Request $request, Response $response, $entity, $id)

if ($object->canChangeOwner()) {
$object->setOwner($ownerId);
$object->save(['notify' => false, 'manageDynamicDisplayLinks' => false]);
$object->save(['notify' => false, 'manageDynamicDisplayLinks' => false, 'validate' => false]);
} else {
throw new ConfigurationException(__('Cannot change owner on this Object'));
}
Expand Down
5 changes: 4 additions & 1 deletion lib/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,10 @@ public function save($options = [])
} else if ($options['passwordUpdate']) {
$this->updatePassword();
$this->audit($this->userId, 'User updated password', false);
} else if ($this->hash() != $this->hash || $this->hasPropertyChanged('twoFactorRecoveryCodes')) {
} else if ($this->hash() != $this->hash
|| $this->hasPropertyChanged('twoFactorRecoveryCodes')
|| $this->hasPropertyChanged('password')
) {
$this->update();
$this->audit($this->userId, 'User updated');
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Factory/DisplayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Copyright (C) 2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -620,7 +620,7 @@ public function query($sortOrder = null, $filterBy = [])
}
}

if (is_array($sortOrder) && ($sortOrder != ['`member`'] && $sortOrder != ['`member` DESC'] )) {
if (is_array($sortOrder) && (!in_array('`member`', $sortOrder) && !in_array('`member` DESC', $sortOrder))) {
$order .= 'ORDER BY ' . implode(',', $sortOrder);
}

Expand Down
8 changes: 4 additions & 4 deletions lib/Factory/DisplayGroupFactory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/*
* Copyright (c) 2022 Xibo Signage Ltd
* Copyright (C) 2022-2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -463,7 +463,7 @@ public function query($sortOrder = null, $filterBy = [])
if ($parsedBody->getInt('displayGroupIdMembers') !== null) {
$members = [];
foreach ($this->getStore()->select($select . $body, $params) as $row) {
$displayGroupId = $parsedBody->getInt($row['displayGroupId']);
$displayGroupId = $this->getSanitizer($row)->getInt('displayGroupId');
$parentId = $parsedBody->getInt('displayGroupIdMembers');

if ($this->getStore()->exists('SELECT `childId` FROM `lkdgdg` WHERE `parentId` = :parentId AND `childId` = :childId AND `depth` = 1',
Expand Down Expand Up @@ -513,7 +513,7 @@ public function query($sortOrder = null, $filterBy = [])
}
}

if (is_array($sortOrder) && ($sortOrder != ['`member`'] && $sortOrder != ['`member` DESC'] )) {
if (is_array($sortOrder) && (!in_array('`member`', $sortOrder) && !in_array('`member` DESC', $sortOrder))) {
$order .= ' ORDER BY ' . implode(',', $sortOrder);
}

Expand Down
6 changes: 3 additions & 3 deletions lib/Factory/UserGroupFactory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/*
* Copyright (C) 2022 Xibo Signage Ltd
* Copyright (C) 2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -787,7 +787,7 @@ public function getFeatures()
'folder.add' => [
'feature' => 'folder.add',
'group' => 'folders',
'title' => __('Create new Folders')
'title' => __('Allow users to create Sub-Folders under Folders they have access to. (Except the Root Folder)')
],
'folder.modify' => [
'feature' => 'folder.modify',
Expand Down
2 changes: 1 addition & 1 deletion lib/Helper/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
class Environment
{
public static $WEBSITE_VERSION_NAME = '3.3.6';
public static $WEBSITE_VERSION_NAME = '3.3.7';
public static $XMDS_VERSION = '6';
public static $XLF_VERSION = 3;
public static $VERSION_REQUIRED = '7.2.9';
Expand Down
15 changes: 10 additions & 5 deletions lib/Middleware/Handlers.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* Copyright (C) 2020 Xibo Signage Ltd
/*
* Copyright (C) 2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -195,8 +195,13 @@ public static function webErrorHandler($container)
$template = 'error';
}

return $twig->render($response, $template . '.twig', array_merge($viewParams, $exceptionData))
->withStatus($statusCode);
try {
return $twig->render($response, $template . '.twig', array_merge($viewParams, $exceptionData))
->withStatus($statusCode);
} catch (\Exception $exception) {
$response->getBody()->write('Fatal error');
return $response->withStatus(500);
}
}
}
};
Expand Down
Binary file modified locale/af.mo
Binary file not shown.
Binary file modified locale/ar.mo
Binary file not shown.
Binary file modified locale/bg.mo
Binary file not shown.
Binary file modified locale/ca.mo
Binary file not shown.
Binary file modified locale/cs.mo
Binary file not shown.
Binary file modified locale/da.mo
Binary file not shown.
Binary file modified locale/de.mo
Binary file not shown.
41 changes: 21 additions & 20 deletions locale/default.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-06 11:51+0100\n"
"POT-Creation-Date: 2023-07-31 17:51+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -15299,7 +15299,7 @@ msgid "Cannot modify root folder."
msgstr ""

#: cache/e1/e12568f445a23579c43fcfebd85ce8eee11d450b2050aad01f770f474b1d3218.php:430
#: lib/Controller/Folder.php:329
#: lib/Controller/Folder.php:338
msgid "Cannot remove Folder with content"
msgstr ""

Expand Down Expand Up @@ -18714,7 +18714,7 @@ msgstr ""
#: lib/Controller/DisplayGroup.php:706 lib/Controller/DisplayGroup.php:2531
#: lib/Controller/DataSet.php:622 lib/Controller/Notification.php:575
#: lib/Controller/Campaign.php:605 lib/Controller/Campaign.php:1337
#: lib/Controller/Module.php:735 lib/Controller/Folder.php:204
#: lib/Controller/Module.php:735 lib/Controller/Folder.php:213
#: lib/Controller/Playlist.php:707 lib/Controller/DataSetColumn.php:386
#: lib/Controller/Tag.php:356 lib/Controller/Layout.php:549
#: lib/Controller/Help.php:191 lib/Controller/DisplayProfile.php:303
Expand All @@ -18731,7 +18731,7 @@ msgstr ""
#: lib/Controller/DataSet.php:917 lib/Controller/ScheduleReport.php:429
#: lib/Controller/Notification.php:705 lib/Controller/Campaign.php:912
#: lib/Controller/MenuBoard.php:465 lib/Controller/Module.php:379
#: lib/Controller/Module.php:848 lib/Controller/Folder.php:272
#: lib/Controller/Module.php:848 lib/Controller/Folder.php:281
#: lib/Controller/Playlist.php:892 lib/Controller/Transition.php:159
#: lib/Controller/Library.php:1353 lib/Controller/DataSetColumn.php:594
#: lib/Controller/Tag.php:506 lib/Controller/Connector.php:201
Expand All @@ -18753,7 +18753,7 @@ msgstr ""
#: lib/Controller/DataSet.php:1008 lib/Controller/ScheduleReport.php:467
#: lib/Controller/Notification.php:764 lib/Controller/Campaign.php:991
#: lib/Controller/SavedReport.php:290 lib/Controller/MenuBoard.php:542
#: lib/Controller/Module.php:983 lib/Controller/Folder.php:334
#: lib/Controller/Module.php:983 lib/Controller/Folder.php:343
#: lib/Controller/Playlist.php:973 lib/Controller/Library.php:961
#: lib/Controller/DataSetColumn.php:684 lib/Controller/Tag.php:632
#: lib/Controller/Layout.php:967 lib/Controller/MenuBoardCategory.php:498
Expand Down Expand Up @@ -19436,41 +19436,40 @@ msgstr ""
msgid "Switched to Normal Mode"
msgstr ""

#: lib/Controller/Folder.php:101
#: lib/Controller/Folder.php:102
msgid "Right click a Folder for further Options"
msgstr ""

#: lib/Controller/Folder.php:136
#: lib/Controller/Folder.php:145
msgid "Private Folder"
msgstr ""

#: lib/Controller/Folder.php:259
#: lib/Controller/Folder.php:268
msgid "Cannot edit root Folder"
msgstr ""

#: lib/Controller/Folder.php:318
#: lib/Controller/Folder.php:327
msgid "Cannot remove root Folder"
msgstr ""

#: lib/Controller/Folder.php:329
#: lib/Controller/Folder.php:338
msgid "Reassign objects from this Folder before deleting."
msgstr ""

#: lib/Controller/Folder.php:422
#: lib/Controller/Folder.php:434
msgid "Please select different folder, cannot move Folder to the same Folder"
msgstr ""

#: lib/Controller/Folder.php:428
#: lib/Controller/Folder.php:440
msgid ""
"Please select different folder, cannot move Folder inside of one of its sub-"
"folders"
msgstr ""

#: lib/Controller/Folder.php:435
#: lib/Controller/Folder.php:445
msgid ""
"This Folder is already a sub-folder of the selected Folder,\n"
" if you wish to move its content to the parent Folder, "
"please check the merge checkbox."
"This Folder is already a sub-folder of the selected Folder, if you wish to "
"move its content to the parent Folder, please check the merge checkbox."
msgstr ""

#: lib/Controller/DataSetData.php:156
Expand Down Expand Up @@ -21125,15 +21124,15 @@ msgstr ""
msgid "Library Quota must be a positive number."
msgstr ""

#: lib/Entity/User.php:1083
#: lib/Entity/User.php:1086
msgid "Provided Object not under permission management"
msgstr ""

#: lib/Entity/User.php:1340
#: lib/Entity/User.php:1343
msgid "You have exceeded your library quota"
msgstr ""

#: lib/Entity/User.php:1358
#: lib/Entity/User.php:1361
msgid "Your password does not meet the required complexity"
msgstr ""

Expand Down Expand Up @@ -22197,7 +22196,9 @@ msgid "View Folder Tree on Grids and Forms"
msgstr ""

#: lib/Factory/UserGroupFactory.php:790
msgid "Create new Folders"
msgid ""
"Allow users to create Sub-Folders under Folders they have access to. (Except "
"the Root Folder)"
msgstr ""

#: lib/Factory/UserGroupFactory.php:795
Expand Down
Binary file modified locale/el.mo
Binary file not shown.
Binary file modified locale/en_GB.mo
Binary file not shown.
Binary file modified locale/es.mo
Binary file not shown.
Binary file modified locale/et.mo
Binary file not shown.
Binary file modified locale/eu.mo
Binary file not shown.
Binary file modified locale/fa.mo
Binary file not shown.
Binary file modified locale/fi.mo
Binary file not shown.
Binary file modified locale/fr.mo
Binary file not shown.
Binary file modified locale/he.mo
Binary file not shown.
Binary file modified locale/hi.mo
Binary file not shown.
Binary file modified locale/hr.mo
Binary file not shown.
Binary file modified locale/hu.mo
Binary file not shown.
Binary file modified locale/id.mo
Binary file not shown.
Binary file modified locale/it.mo
Binary file not shown.
Binary file modified locale/ja.mo
Binary file not shown.
Binary file modified locale/ko.mo
Binary file not shown.
Binary file modified locale/ku.mo
Binary file not shown.
Binary file modified locale/lb.mo
Binary file not shown.
Binary file modified locale/lo.mo
Binary file not shown.
Binary file modified locale/lt.mo
Binary file not shown.
Binary file modified locale/nb.mo
Binary file not shown.
Binary file modified locale/nl.mo
Binary file not shown.
Binary file modified locale/nl_NL.mo
Binary file not shown.
Binary file modified locale/pl.mo
Binary file not shown.
Binary file modified locale/pt.mo
Binary file not shown.
Binary file modified locale/pt_BR.mo
Binary file not shown.
Binary file modified locale/ro.mo
Binary file not shown.
Binary file modified locale/ru.mo
Binary file not shown.
Binary file modified locale/sk.mo
Binary file not shown.
Binary file modified locale/sl.mo
Binary file not shown.
Binary file modified locale/sr@latin.mo
Binary file not shown.
Binary file modified locale/sv.mo
Binary file not shown.
Binary file modified locale/th.mo
Binary file not shown.
Binary file modified locale/tr.mo
Binary file not shown.
Binary file modified locale/vi.mo
Binary file not shown.
Binary file modified locale/zh_CN.mo
Binary file not shown.
Binary file modified locale/zh_TW.mo
Binary file not shown.
Loading

0 comments on commit 19bea76

Please sign in to comment.