';
@@ -190,45 +203,36 @@ jQuery(document).ready(function() {
userDetails += '
{/literal}{'Expand all albums'|translate}{literal}';
- userDetails += '
';
- jQuery.each(truefalse, function(value, label) {
- var checked = '';
- if (user.expand == value) {
- checked = ' checked="checked"';
- }
- userDetails += '
';
- });
+ var checked = '';
+ if (user.expand == 'true') {
+ checked = ' checked="checked"';
+ }
+ userDetails += '
';
userDetails += '
';
- userDetails += '
{/literal}{'Show number of comments'|translate}{literal}';
- userDetails += '
';
- jQuery.each(truefalse, function(value, label) {
- var checked = '';
- if (user.show_nb_comments == value) {
- checked = ' checked="checked"';
- }
- userDetails += '
';
- });
+ var checked = '';
+ if (user.show_nb_comments == 'true') {
+ checked = ' checked="checked"';
+ }
+ userDetails += '
';
userDetails += '
';
- userDetails += '
';
+ userDetails += '
';
- userDetails += '
';
+ userDetails += '
✔ User updated';
+ userDetails += '
';
userDetails += '

'
userDetails += '';
jQuery("#user"+userId).append(userDetails);
+ jQuery(".chzn-select").chosen();
}
else {
console.log('error loading user details');
@@ -242,18 +246,49 @@ jQuery(document).ready(function() {
return '

';
}
+ jQuery(document).on('change', '.userProperties input, .userProperties select', function() {
+ var userId = jQuery(this).parentsUntil('form').parent().find('input[name=user_id]').val();
+
+ jQuery('#user'+userId+' input[type=submit]').show();
+ jQuery('#user'+userId+' .infos').hide();
+ });
+
jQuery(document).on('click', '.userProperties input[type=submit]', function() {
var userId = jQuery(this).data('user_id');
+ var formData = jQuery('#user'+userId+' form').serialize();
+
+ if (jQuery('#user'+userId+' form select[name="group_id[]"] option:selected').length == 0) {
+ formData += '&group_id=-1';
+ }
+
+ if (!jQuery('#user'+userId+' form input[name=enabled_high]').is(':checked')) {
+ formData += '&enabled_high=false';
+ }
+
+ if (!jQuery('#user'+userId+' form input[name=expand]').is(':checked')) {
+ formData += '&expand=false';
+ }
+
+ if (!jQuery('#user'+userId+' form input[name=show_nb_hits]').is(':checked')) {
+ formData += '&show_nb_hits=false';
+ }
+
+ if (!jQuery('#user'+userId+' form input[name=show_nb_comments]').is(':checked')) {
+ formData += '&show_nb_comments=false';
+ }
+
jQuery.ajax({
url: "ws.php?format=json&method=pwg.users.setInfo",
type:"POST",
- data: jQuery('#user'+userId+' form').serialize(),
+ data: formData,
beforeSend: function() {
jQuery('#user'+userId+' .submitWait').show();
},
success:function(data) {
jQuery('#user'+userId+' .submitWait').hide();
+ jQuery('#user'+userId+' input[type=submit]').hide();
+ jQuery('#user'+userId+' .infos').show();
},
error:function(XMLHttpRequest, textStatus, errorThrows) {
jQuery('#user'+userId+' .submitWait').hide();
@@ -304,6 +339,24 @@ jQuery(document).ready(function() {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "admin/user_list_backend.php",
+ "oLanguage": {
+ "sProcessing": "Traitement en cours...",
+ "sLengthMenu": "Afficher _MENU_ éléments",
+ "sZeroRecords": "Aucun élément à afficher",
+ "sInfo": "Affichage des élements _START_ à _END_ sur _TOTAL_",
+ "sInfoEmpty": "Affichage de l'élement 0 à 0 sur 0 éléments",
+ "sInfoFiltered": "
(filtré de _MAX_ éléments au total{/literal}{if $is_a_guest}
dans la version complète{/if}{literal})",
+ "sInfoPostFix": "",
+ "sSearch": "Rechercher",
+ "sLoadingRecords": "Téléchargement...",
+ "sUrl": "",
+ "oPaginate": {
+ "sFirst": "Premier",
+ "sPrevious": "← Précédent",
+ "sNext": "Suivant →",
+ "sLast": "Dernier"
+ }
+ },
"fnDrawCallback": function( oSettings ) {
jQuery("#userList input[type=checkbox]").each(function() {
var user_id = jQuery(this).data("user_id");
@@ -531,15 +584,24 @@ jQuery(document).ready(function() {
.dataTables_wrapper, .dataTables_info {clear:none;}
table.dataTable {clear:right;padding-top:10px;}
.dataTable td img {margin-bottom: -6px;margin-left: -6px;}
+.paginate_enabled_previous, .paginate_enabled_previous:hover, .paginate_disabled_previous, .paginate_enabled_next, .paginate_enabled_next:hover, .paginate_disabled_next {background:none;}
+.paginate_enabled_previous, .paginate_enabled_next {color:#005E89 !important;}
+.paginate_enabled_previous:hover, .paginate_enabled_next:hover {color:#D54E21 !important; text-decoration:underline !important;}
+
+.paginate_disabled_next, .paginate_enabled_next {padding-right:3px;}
.bulkAction {margin-top:10px;}
#addUserForm p {margin-left:0;}
#applyActionBlock .actionButtons {margin-left:0;}
span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border-radius:5px;}
-.userProperties {max-width:850px;}
-.userProperties fieldset {border-width:0; border-top-width:1px;}
-.userProperties fieldset legend {margin-left:-20px;padding-left:0;}
+.userProperties {max-width:730px;}
+.userPropertiesContainer {border-top:1px solid #ddd;margin-top:1em;}
+.userPropertiesSet {width:350px;float:left;padding-top:5px}
+.userPropertiesSetTitle {font-weight:bold;margin-bottom:1em;}
+.userPrefs {border-left:1px solid #ddd;padding-left:10px;}
.userProperty {width:220px;float:left;margin-bottom:15px;}
+
+.userActions {float:right;text-align:right;}
{/literal}
@@ -600,6 +662,7 @@ span.infos, span.errors {background-image:none; padding:2px 5px; margin:0;border
{'Username'|@translate} |
{'Status'|@translate} |
{'Email address'|@translate} |
+
{'registration date'|@translate} |
diff --git a/admin/user_list_backend.php b/admin/user_list_backend.php
index 8b9734b07..1a2509c6a 100644
--- a/admin/user_list_backend.php
+++ b/admin/user_list_backend.php
@@ -11,7 +11,7 @@ include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
-$aColumns = array('id', 'username', 'status', 'mail_address');
+$aColumns = array('id', 'username', 'status', 'mail_address', 'registration_date');
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";