Skip to content

Commit

Permalink
Merge branch '5.1-dev' into fix-contacts-category-levels
Browse files Browse the repository at this point in the history
  • Loading branch information
LadySolveig committed Dec 15, 2023
2 parents 8ececc4 + f36a3e0 commit 068251e
Show file tree
Hide file tree
Showing 201 changed files with 2,705 additions and 2,643 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ hosts:
openldap: 127.0.0.1

services:
- mysql
- iis

before_test:
# Run openldap docker image
- ps: docker pull bitnami/openldap:2.6.3
- ps: docker run --rm --name openldap --publish 1389:1389 --publish 1636:1636 -v ${pwd}\tests\certs:/certificates --env LDAP_ADMIN_USERNAME=admin --env LDAP_ADMIN_PASSWORD=adminpassword --env LDAP_USERS=customuser --env LDAP_PASSWORDS=custompassword --env LDAP_ENABLE_TLS=yes --env LDAP_TLS_CERT_FILE=/certificates/openldap.crt --env LDAP_TLS_KEY_FILE=/certificates/openldap.key --env LDAP_TLS_CA_FILE=/certificates/CA.crt --env BITNAMI_DEBUG=true --env LDAP_CONFIG_ADMIN_ENABLED=yes --env LDAP_CONFIG_ADMIN_USERNAME=admin --env LDAP_CONFIG_ADMIN_PASSWORD=configpassword -d bitnami/openldap:2.6.3
# Database setup for MySQL via PowerShell tools
- ps: Start-Service MySQL80
- >
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS test_joomla;"
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS test_joomla;"
# Wait till slapd has started
- ps: |
$Counter=0
Expand Down
62 changes: 36 additions & 26 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ steps:
- ./libraries/vendor/bin/phan

- name: npm
image: node:18-bullseye-slim
image: node:20-bullseye-slim
depends_on: [ phpcs ]
volumes:
- name: npm-cache
Expand Down Expand Up @@ -286,29 +286,39 @@ steps:
- name: packager
image: joomlaprojects/docker-images:packager
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
FTP_HOSTNAME: ci.joomla.org
FTP_PORT: "21"
FTP_DEST_DIR: /artifacts
FTP_VERIFY: "false"
FTP_SECURE: "true"
HTTP_ROOT: "https://ci.joomla.org/artifacts"
HTTP_ROOT: "https://artifacts.joomla.org/drone"
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
DRONE_COMMIT: DRONE_COMMIT
commands:
- /bin/drone_prepare_package.sh

- name: upload
image: joomlaprojects/docker-images:packager
environment:
package_key:
from_secret: package_key
package_user:
from_secret: package_user
package_host:
from_secret: package_host
package_root:
from_secret: package_root
GITHUB_TOKEN:
from_secret: github_token
commands:
- if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi
- /bin/drone_build.sh
volumes:
- name: reference
path: /reference
when:
repo:
- joomla/joomla-cms
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$package_key" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create package sftp host $package_host user $package_user port 22
- rclone copy ./upload/ package:$package_root/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/downloads/$DRONE_BUILD_NUMBER
- /bin/add_github_status.sh "Download" "Prebuilt packages are available for download." "https://artifacts.joomla.org/drone/${DRONE_REPO}/${DRONE_BRANCH}/${DRONE_PULL_REQUEST}/downloads/${DRONE_BUILD_NUMBER}"

trigger:
repo:
- joomla/joomla-cms

---
kind: pipeline
Expand All @@ -335,8 +345,8 @@ steps:
from_secret: nightly_user
nightly_host:
from_secret: nightly_host
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- export MINORVERSION=${DRONE_BRANCH%-*}
- mkdir -p ~/.ssh
Expand All @@ -349,15 +359,15 @@ steps:
- rclone delete nightly:/home/devj/public_html/nightlies/ --include "Joomla_$MINORVERSION.*"
- rclone delete nightly:/home/devj/public_html/cache/com_content/
- rclone copy ./transfer/ nightly:/home/devj/public_html/nightlies/
- /bin/notify
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.1](https://developer.joomla.org/nightly-builds.html) successfully built."}' $MATTERMOST_NIGHTLY_HOOK

- name: buildfailure
image: joomlaprojects/docker-images:packager
environment:
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- /bin/notify
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.1](https://developer.joomla.org/nightly-builds.html) FAILED to built."}' $MATTERMOST_NIGHTLY_HOOK
when:
status:
- failure
Expand All @@ -372,6 +382,6 @@ trigger:

---
kind: signature
hmac: 45b19b7430edc5ec922ef32c2f2dcb284c7cbf7ba55eb295ba4d877cee0fe5a4
hmac: 5814cadc441b90eec51da0aa32cd29ff1014c4d759841cc70063b5e9245d2b08

...
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php

/**
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Actionlogs\Administrator\Field;

use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Database\ParameterType;

/**
* Field to load a list of all users that have logged actions
*
* @since __DEPLOY_VERSION__
*/
class UserlogtypeField extends ListField
{
/**
* The form field type.
*
* @var string
* @since __DEPLOY_VERSION__
*/
protected $type = 'UserLogType';

/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since __DEPLOY_VERSION__
*/
public function getOptions()
{
$db = $this->getDatabase();
$user = Factory::getApplication()->getIdentity();
$query = $db->getQuery(true)
->select($db->quoteName('extensions'))
->from($db->quoteName('#__action_logs_users'))
->where($db->quoteName('user_id') . ' = :userid')
->bind(':userid', $user->id, ParameterType::INTEGER);

$extensions = $db->setQuery($query)->loadColumn();
$userExt = [];
$params = ComponentHelper::getParams('com_actionlogs');
$globalExt = $params->get('loggable_extensions', []);

if (!empty($extensions)) {
$userExt = substr($extensions[0], 2);
$userExt = substr($userExt, 0, -2);
$userExt = explode('","', $userExt);
}

$common = array_merge($globalExt, array_intersect($globalExt, $userExt));
$options = [];

foreach ($common as $extension) {
ActionlogsHelper::loadTranslationFiles($extension);
$extensionName = Text::_($extension);
$options[ApplicationHelper::stringURLSafe($extensionName) . '_' . $extension] = HTMLHelper::_('select.option', $extension, $extensionName);
}

ksort($options);

return array_merge(parent::getOptions(), array_values($options));
}
}
14 changes: 14 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -2194,6 +2194,16 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/media/system/css/sortablelist.css',
'/media/system/css/sortablelist.min.css',
'/media/system/css/sortablelist.min.css.gz',
// From 5.0.0 to 5.1.0-alpha1
'/administrator/components/com_banners/tmpl/banners/default_batch_footer.php',
'/administrator/components/com_contact/tmpl/contacts/default_batch_footer.php',
'/administrator/components/com_fields/tmpl/fields/default_batch_footer.php',
'/administrator/components/com_fields/tmpl/groups/default_batch_footer.php',
'/administrator/components/com_menus/tmpl/items/default_batch_footer.php',
'/administrator/components/com_modules/tmpl/modules/default_batch_footer.php',
'/administrator/components/com_newsfeeds/tmpl/newsfeeds/default_batch_footer.php',
'/administrator/components/com_tags/tmpl/tags/default_batch_footer.php',
'/administrator/components/com_users/tmpl/users/default_batch_footer.php',
];

$folders = [
Expand Down Expand Up @@ -2488,6 +2498,10 @@ public function updateAssets($installer)
// List all components added since 4.0
$newComponents = [
// Components to be added here
'com_guidedtours',
'com_mails',
'com_scheduler',
'com_workflow',
];

foreach ($newComponents as $component) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ protected function addToolbar(): void
&& $user->authorise('core.edit.state', 'com_banners')
) {
$childBar->popupButton('batch', 'JTOOLBAR_BATCH')
->selector('collapseModal')
->popupType('inline')
->textHeader(Text::_('COM_BANNERS_BATCH_OPTIONS'))
->url('#joomla-dialog-batch')
->modalWidth('800px')
->modalHeight('fit-content')
->listCheck(true);
}
}
Expand Down
10 changes: 1 addition & 9 deletions administrator/components/com_banners/tmpl/banners/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,7 @@
&& $user->authorise('core.edit', 'com_banners')
&& $user->authorise('core.edit.state', 'com_banners')
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
[
'title' => Text::_('COM_BANNERS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
],
$this->loadTemplate('batch_body')
); ?>
<template id="joomla-dialog-batch"><?php echo $this->loadTemplate('batch_body'); ?></template>
<?php endif; ?>
<?php endif; ?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;

/** @var \Joomla\Component\Banners\Administrator\View\Banners\HtmlView $this */

$published = (int) $this->state->get('filter.published');
?>


<div class="p-3">
<div class="row">
<?php if (Multilanguage::isEnabled()) : ?>
Expand All @@ -45,3 +45,8 @@
<?php endif; ?>
</div>
</div>
<div class="btn-toolbar p-3">
<joomla-toolbar-button task="banner.batch" class="ms-auto">
<button type="button" class="btn btn-success"><?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?></button>
</joomla-toolbar-button>
</div>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php

/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;

extract($displayData);

/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to. <fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var string $dataAttribute Miscellaneous data attributes preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg, data-*
* @var string $valueTitle
* @var array $canDo
* @var string[] $urls
* @var string[] $modalTitles
* @var string $language
*/

// Do nothing when propagate is disabled
if (empty($canDo['propagate'])) {
return;
}

// Scripts for backward compatibility
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('field.modal-fields');
$wa->addInlineScript(
'window.jSelectCategory_' . $id . ' = function (id, title, object) {
window.processModalSelect("Category", "' . $id . '", id, title, "", object);
}',
['name' => 'inline.select_category_' . $id],
['type' => 'module']
);
Text::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED');

// Language propagate callback name
// Strip off language tag at the end
$tagLength = strlen($language);
$callbackFunctionStem = substr("jSelectCategory_" . $id, 0, -$tagLength);

?>

<button type="button" class="btn btn-primary" <?php echo $value ? '' : 'hidden'; ?>
title="<?php echo $this->escape(Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_TIP')); ?>"
data-show-when-value="1"
onclick="Joomla.propagateAssociation('<?php echo $id; ?>', '<?php echo $callbackFunctionStem; ?>')">
<span class="icon-sync" aria-hidden="true"></span> <?php echo Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON'); ?>
</button>

0 comments on commit 068251e

Please sign in to comment.