Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] GSoC 2018 Enhance Users Project #21441

Closed
Closed
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
da6af42
added the access field to user
alexandraciobica May 16, 2018
0f853d5
added access column in users list and option in batch processing
alexandraciobica May 17, 2018
f94be7c
deleted var_dump
alexandraciobica May 22, 2018
4be07b4
merge with master
alexandraciobica May 22, 2018
1fdb588
Fixed pr requirements
alexandraciobica May 30, 2018
3d3a76f
Changes after code review
alexandraciobica Jun 1, 2018
7f8e09f
Changes after code review
alexandraciobica Jun 2, 2018
5a01763
Merge branch 'master' into access_field_admin
bembelimen Jun 10, 2018
5f0d478
Merge pull request #1 from joomla-projects/access_field_admin
bembelimen Jun 10, 2018
7c43e1b
Groups in the list view and clean links (#2)
alexandraciobica Jun 13, 2018
8ed3675
Modified templates
alexandraciobica Jun 13, 2018
9a429e3
user view
alexandraciobica Jun 15, 2018
27db2a6
added user name to breadcrumbs
alexandraciobica Jun 15, 2018
ee2ef0f
Added checks in user view for bredcrumbs
alexandraciobica Jun 18, 2018
407e23e
user default.xml
alexandraciobica Jun 18, 2018
6bf4abc
user details menu item
alexandraciobica Jun 18, 2018
cb9f8bf
cleanning
alexandraciobica Jun 18, 2018
b677cd0
added breadcrumb for user name
alexandraciobica Jun 18, 2018
13b9d66
newline
alexandraciobica Jun 18, 2018
2d35a86
revert breadcrumbs from this branch
alexandraciobica Jun 18, 2018
52616cd
add schema to views
alexandraciobica Jun 18, 2018
10c02cd
newline
alexandraciobica Jun 18, 2018
9aaff70
revert changes not needed
alexandraciobica Jun 18, 2018
0a91048
newline
alexandraciobica Jun 18, 2018
29d512d
Merge pull request #6 from joomla-projects/improve_views
bembelimen Jun 18, 2018
56641fe
Merge branch 'staging' into breadcrumbs
bembelimen Jun 19, 2018
7208525
Merge pull request #5 from joomla-projects/breadcrumbs
bembelimen Jun 19, 2018
bbcf061
added show/hide group title in users list
alexandraciobica Jun 19, 2018
35648b8
added page heading
alexandraciobica Jun 19, 2018
0aedfc6
added the real group name
alexandraciobica Jun 19, 2018
7e9c604
Update HtmlView.php
laoneo Jun 20, 2018
cc990f3
Added contact form to user
alexandraciobica Jul 12, 2018
d0daaa7
Merge branch 'master' of github.com:joomla-projects/gsoc18_enhance_us…
alexandraciobica Jul 12, 2018
a5669d2
Merge branch 'staging' of github.com:joomla-projects/gsoc18_enhance_u…
alexandraciobica Jul 12, 2018
853ac65
Fixes after the merge
alexandraciobica Jul 16, 2018
20d91ca
Added captcha, custom reply param and global configuration to the use…
alexandraciobica Jul 16, 2018
59c81b7
codestyle fix
alexandraciobica Jul 16, 2018
83c9b14
Merge branch 'master' of github.com:joomla-projects/gsoc18_enhance_us…
alexandraciobica Jul 16, 2018
35596d6
Merge branch 'staging' of github.com:joomla-projects/gsoc18_enhance_u…
alexandraciobica Jul 16, 2018
aac4ed9
Made form extendable with custom fields
alexandraciobica Jul 16, 2018
d0cfbf9
Add newline
alexandraciobica Jul 17, 2018
fcc816c
Moved jexec
alexandraciobica Jul 17, 2018
c42d1f1
Added newlines and removed spaces
alexandraciobica Jul 17, 2018
fa384e1
Removed extra tabs
alexandraciobica Jul 17, 2018
9cc70ae
Merge pull request #16 from joomla-projects/user_form
bembelimen Jul 30, 2018
5462f6c
Merge pull request #3 from joomla-projects/details_menu_item
bembelimen Jul 30, 2018
0d9acd6
Merge branch 'staging' of github.com:joomla-projects/gsoc18_enhance_u…
alexandraciobica Jul 30, 2018
61576c3
Merge branch 'show_group_title' of github.com:joomla-projects/gsoc18_…
alexandraciobica Jul 30, 2018
50c8a10
Merge pull request #9 from joomla-projects/show_group_title
bembelimen Jul 30, 2018
941152d
Merge branch 'staging' of github.com:joomla-projects/gsoc18_enhance_u…
alexandraciobica Aug 1, 2018
5055849
Merge branch '4.0-dev' of github.com:joomla/joomla-cms into gsoc18_en…
alexandraciobica Aug 6, 2018
033748f
Merge branch '4.0-dev' of github.com:joomla/joomla-cms into gsoc18_en…
alexandraciobica Aug 7, 2018
3283f92
Merge branch '4.0-dev' into gsoc18_enhance_users
laoneo Aug 7, 2018
2125549
Changes after code review
alexandraciobica Aug 8, 2018
b0813c8
Merge branch '4.0-dev' of github.com:alexandraciobica/joomla-cms into…
alexandraciobica Aug 8, 2018
55e9c87
Merge branch 'gsoc18_enhance_users' of github.com:alexandraciobica/jo…
alexandraciobica Aug 8, 2018
918ede3
Remove blank line
alexandraciobica Aug 8, 2018
9a1d66c
Changes after code review
alexandraciobica Aug 8, 2018
ca24e1a
Changes after code review
alexandraciobica Aug 8, 2018
920b517
Changes after code review
alexandraciobica Aug 8, 2018
b238702
Merge branch '4.0-dev' into gsoc18_enhance_users
rdeutz Aug 8, 2018
5480741
Merge branch '4.0-dev' into gsoc18_enhance_users
rdeutz Aug 8, 2018
4ed905c
Merge branch '4.0-dev' into gsoc18_enhance_users
rdeutz Aug 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--
-- Add access column for access levels #__users
--

ALTER TABLE `#__users` ADD COLUMN `access` int(10) unsigned NOT NULL DEFAULT 0;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "#__users" ADD COLUMN "access" bigint NOT NULL DEFAULT 0;
1 change: 1 addition & 0 deletions administrator/components/com_users/Helper/UsersHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ public static function getContexts()

$contexts = array(
'com_users.user' => Text::_('COM_USERS'),
'com_users.contact' => Text::_('COM_USERS_FIELDS_CONTEXT_CONTACT'),
);

return $contexts;
Expand Down
10 changes: 10 additions & 0 deletions administrator/components/com_users/Model/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,16 @@ public function batch($commands, $pks, $contexts)
$done = true;
}

if (!empty($commands['assetgroup_id']))
{
if (!$this->batchAccess($commands['assetgroup_id'], $pks, $contexts))
{
return false;
}

$done = true;
}

if (!$done)
{
$this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
Expand Down
12 changes: 11 additions & 1 deletion administrator/components/com_users/Model/UsersModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
'range',
'lastvisitrange',
'state',
'access', 'a.access', 'access_level',
);
}

Expand Down Expand Up @@ -100,6 +101,9 @@ protected function populateState($ordering = 'a.name', $direction = 'asc')

$this->setState('filter.excluded', $excluded);

$access = $app->input->getInt('access');
$this->setState('filter.access', $access);

// Load the parameters.
$params = ComponentHelper::getParams('com_users');
$this->setState('params', $params);
Expand Down Expand Up @@ -129,6 +133,7 @@ protected function getStoreId($id = '')
$id .= ':' . $this->getState('filter.state');
$id .= ':' . $this->getState('filter.group_id');
$id .= ':' . $this->getState('filter.range');
$id .= ':' . $this->getState('filter.access');

return parent::getStoreId($id);
}
Expand Down Expand Up @@ -299,6 +304,10 @@ protected function getListQuery()
}
}

// Join over the asset groups.
$query->select($db->quoteName('ag.title') . ' AS access_level')
->leftJoin('#__viewlevels AS ag ON ag.id = a.access');

// Filter the items over the group id if set.
$groupId = $this->getState('filter.group_id');
$groups = $this->getState('filter.groups');
Expand All @@ -324,7 +333,8 @@ protected function getListQuery()
'a.resetCount',
'a.otpKey',
'a.otep',
'a.requireReset'
'a.requireReset',
'a.access'
)
)
);
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_users/View/Users/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ protected function getSortFields()
'a.username' => Text::_('JGLOBAL_USERNAME'),
'a.block' => Text::_('COM_USERS_HEADING_ENABLED'),
'a.activation' => Text::_('COM_USERS_HEADING_ACTIVATED'),
'access_level' => Text::_('JGRID_HEADING_ACCESS'),
'a.email' => Text::_('JGLOBAL_EMAIL'),
'a.lastvisitDate' => Text::_('COM_USERS_HEADING_LAST_VISIT_DATE'),
'a.registerDate' => Text::_('COM_USERS_HEADING_REGISTRATION_DATE'),
Expand Down
110 changes: 108 additions & 2 deletions administrator/components/com_users/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,112 @@
/>
</fieldset>

<fieldset
name="Contact_Form"
label="COM_USERS_CONFIG_FIELD_CONTACT_FORM"
description="COM_USERS_CONFIG_FIELD_INDIVIDUAL_CONTACT_DESC"
>
<field
name="captcha"
type="plugins"
label="COM_USERS_CONFIG_FIELD_CAPTCHA_LABEL"
folder="captcha"
filter="cmd"
useglobal="true"
>
<option value="0">JOPTION_DO_NOT_USE</option>
</field>

<field
name="show_email_form"
type="radio"
label="COM_USERS_FIELD_EMAIL_SHOW_FORM_LABEL"
class="switcher"
default="1"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>

<field
name="show_email_copy"
type="radio"
label="COM_USERS_FIELD_EMAIL_EMAIL_COPY_LABEL"
default="0"
class="switcher"
showon="show_email_form:1"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>

<field
name="banned_email"
type="textarea"
label="COM_USERS_CONFIG_FIELD_BANNED_EMAIL_LABEL"
description="COM_USERS_CONFIG_FIELD_BANNED_EMAIL_DESC"
default=""
rows="3"
cols="30"
showon="show_email_form:1"
/>

<field
name="banned_subject"
type="textarea"
label="COM_USERS_CONFIG_FIELD_BANNED_SUBJECT_LABEL"
description="COM_USERS_CONFIG_FIELD_BANNED_SUBJECT_DESC"
default=""
rows="3"
cols="30"
showon="show_email_form:1"
/>

<field
name="banned_text"
type="textarea"
label="COM_USERS_CONFIG_FIELD_BANNED_TEXT_LABEL"
description="COM_USERS_CONFIG_FIELD_BANNED_TEXT_DESC"
default=""
rows="3"
cols="30"
showon="show_email_form:1"
/>

<field
name="validate_session"
type="radio"
label="COM_USERS_FIELD_CONFIG_SESSION_CHECK_LABEL"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move label above class

class="switcher"
default="1"
showon="show_email_form:1"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="custom_reply"
type="radio"
label="COM_USERS_CONFIG_FIELD_CUSTOM_REPLY_LABEL"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move label above class

class="switcher"
default="0"
showon="show_email_form:1"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="redirect"
type="text"
label="COM_USERS_FIELD_CONFIG_REDIRECT_LABEL"
default=""
size="30"
showon="show_email_form:1"
/>
</fieldset>

<fieldset
name="user_notes_history"
label="COM_USERS_CONFIG_FIELD_NOTES_HISTORY" >
Expand Down Expand Up @@ -213,7 +319,7 @@
<fieldset
name="massmail"
label="COM_USERS_MASS_MAIL"
description="COM_USERS_MASS_MAIL_DESC">
description="COM_USERS_MASS_MAIL_DESC" >

<field
name="mailSubjectPrefix"
Expand Down Expand Up @@ -263,7 +369,7 @@
<fieldset name="integration"
label="JGLOBAL_INTEGRATION_LABEL"
description="COM_USERS_CONFIG_INTEGRATION_SETTINGS_DESC"
>
>

<field
name="custom_fields_enable"
Expand Down
12 changes: 0 additions & 12 deletions administrator/components/com_users/forms/fields/user.xml

This file was deleted.

85 changes: 85 additions & 0 deletions administrator/components/com_users/forms/user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@
readonly="true"
/>

<field
name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
size="1"
/>

</fieldset>
<field name="groups" type="hidden" />
<field name="twofactor" type="hidden" />
Expand Down Expand Up @@ -203,5 +210,83 @@

</fieldset>

<fieldset name="email" label="COM_USERS_FIELDSET_CONTACT_LABEL">

<field
name="show_email_form"
type="list"
label="COM_USERS_FIELD_EMAIL_SHOW_FORM_LABEL"
useglobal="true"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank line.

>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>

<field
name="show_email_copy"
type="list"
label="COM_USERS_FIELD_EMAIL_EMAIL_COPY_LABEL"
useglobal="true"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>

<field
name="banned_email"
type="textarea"
label="COM_USERS_FIELD_EMAIL_BANNED_EMAIL_LABEL"
description="COM_USERS_FIELD_EMAIL_BANNED_EMAIL_DESC"
rows="3"
cols="30"
/>

<field
name="banned_subject"
type="textarea"
label="COM_USERS_FIELD_EMAIL_BANNED_SUBJECT_LABEL"
description="COM_USERS_FIELD_EMAIL_BANNED_SUBJECT_DESC"
rows="3"
cols="30"
/>

<field
name="banned_text"
type="textarea"
label="COM_USERS_FIELD_EMAIL_BANNED_TEXT_LABEL"
description="COM_USERS_FIELD_EMAIL_BANNED_TEXT_DESC"
rows="3"
cols="30"
/>

<field
name="validate_session"
type="list"
label="COM_USERS_FIELD_CONFIG_SESSION_CHECK_LABEL"
useglobal="true"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="custom_reply"
type="list"
label="COM_USERS_CONFIG_FIELD_CUSTOM_REPLY_LABEL"
useglobal="true"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="redirect"
type="text"
label="COM_USERS_FIELD_CONFIG_REDIRECT_LABEL"
size="30"
/>
</fieldset>

</fields>
</form>
6 changes: 6 additions & 0 deletions administrator/components/com_users/tmpl/users/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<th scope="col" style="width:12%" class="nowrap text-center">
<?php echo Text::_('COM_USERS_HEADING_GROUPS'); ?>
</th>
<th scope="col" style="width:10%" class="nowrap d-none d-md-table-cell text-center">
<?php echo Text::_('JGRID_HEADING_ACCESS'); ?>
</th>
<th scope="col" style="width:12%" class="nowrap d-none d-lg-table-cell text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_EMAIL', 'a.email', $listDirn, $listOrder); ?>
</th>
Expand Down Expand Up @@ -148,6 +151,9 @@
<?php echo nl2br($item->group_names); ?>
<?php endif; ?>
</td>
<td class="small d-none d-md-table-cell text-center">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please indent to match the surrounding code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is aligned correctly in my editor, I don't know why here is not..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're using spaces for indents, the rest of the file is using tabs.

<?php echo $this->escape($item->access_level); ?>
</td>
<td class="d-none d-lg-table-cell break-word text-center">
<?php echo PunycodeHelper::emailToUTF8($this->escape($item->email)); ?>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<?php echo HTMLHelper::_('select.options', HTMLHelper::_('user.groups')); ?>
</select>
</div>
<div class="form-group col-md-6">
<?php echo HTMLHelper::_('batch.access'); ?>
</div>
</div>
<div class="form-group">
<label><?php echo Text::_('COM_USERS_REQUIRE_PASSWORD_RESET'); ?></label>
Expand Down
Loading