diff --git a/include/staff/orgs.inc.php b/include/staff/orgs.inc.php index 2f8dab1024c5e6c3342ef51fe4d7c853107b4986..fe805eb739bfa500fe9bf97b292e4f66a95ebb5e 100644 --- a/include/staff/orgs.inc.php +++ b/include/staff/orgs.inc.php @@ -72,7 +72,7 @@ $qhash = md5($query); $_SESSION['orgs_qs_'.$qhash] = $query; ?> <h2><?php echo __('Organizations'); ?></h2> -<div class="pull-left" style="width:700px;"> +<div class="pull-left"> <form action="orgs.php" method="get"> <?php csrf_token(); ?> <input type="hidden" name="a" value="search"> @@ -144,7 +144,7 @@ else ?> <tr id="<?php echo $row['id']; ?>"> <td nowrap> - <input type="checkbox" value="<?php echo $row['id']; ?>" class="mass nowarn"/> + <input type="checkbox" value="<?php echo $row['id']; ?>" class="ckb mass nowarn"/> </td> <td> <a href="orgs.php?id=<?php echo $row['id']; ?>"><?php echo $row['name']; ?></a> </td> <td> <?php echo $row['users']; ?></td> @@ -155,6 +155,22 @@ else } //end of while. endif; ?> </tbody> + <tfoot> + <tr> + <td colspan="7"> + <?php if ($res && $num) { ?> + <?php echo __('Select');?>: + <a id="selectAll" href="#ckb"><?php echo __('All');?></a> + <a id="selectNone" href="#ckb"><?php echo __('None');?></a> + <a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a> + <?php }else{ + echo '<i>'; + echo __('Query returned 0 results.'); + echo '</i>'; + } ?> + </td> + </tr> + </tfoot> </table> <?php if($res && $num): //Show options.. @@ -201,11 +217,14 @@ $(function() { $(':checkbox.mass:checked', $form).each(function() { ids.push($(this).val()); }); - if (ids.length && confirm(__('You sure?'))) { + if (ids.length) { + var submit = function() { $form.find('#action').val(action); $.each(ids, function() { $form.append($('<input type="hidden" name="ids[]">').val(this)); }); $form.find('#selected-count').val(ids.length); $form.submit(); + }; + $.confirm(__('You sure?')).then(submit); } else if (!ids.length) { $.sysAlert(__('Oops'), diff --git a/include/staff/user-view.inc.php b/include/staff/user-view.inc.php index 1111cbf0e33fb7edfb8cce6a09583198b77145e8..1aa93662841de061f66862f95b43f93513013651 100644 --- a/include/staff/user-view.inc.php +++ b/include/staff/user-view.inc.php @@ -28,7 +28,7 @@ $org = $user->getOrganization(); <?php } else { ?> <a id="user-register" class="action-button pull-right user-action" - href="#users/<?php echo $user->getId(); ?>/register"><i class="icon-star"></i> + href="#users/<?php echo $user->getId(); ?>/register"><i class="icon-smile"></i> <?php echo __('Register'); ?></a> <?php } ?> diff --git a/include/staff/users.inc.php b/include/staff/users.inc.php index 900651ea4e65dd7e97f9b1e7beb07b1622ad53c7..3ac970a0d78a909b9b8d3d4cdff488ca09f0212e 100644 --- a/include/staff/users.inc.php +++ b/include/staff/users.inc.php @@ -76,7 +76,7 @@ $_SESSION['users_qs_'.$qhash] = $query; ?> <h2><?php echo __('User Directory'); ?></h2> -<div class="pull-left" style="width:700px;"> +<div class="pull-left"> <form action="users.php" method="get"> <?php csrf_token(); ?> <input type="hidden" name="a" value="search"> @@ -123,7 +123,7 @@ if ('disabled' != $cfg->getClientRegistrationMode()) { ?> <i class="icon-envelope icon-fixed-width"></i> <?php echo __('Send Password Reset Email'); ?></a></li> <li><a class="users-action" href="#register"> - <i class="icon-star icon-fixed-width"></i> + <i class="icon-smile icon-fixed-width"></i> <?php echo __('Register'); ?></a></li> <li><a class="users-action" href="#lock"> <i class="icon-lock icon-fixed-width"></i> @@ -189,7 +189,7 @@ else ?> <tr id="<?php echo $row['id']; ?>"> <td nowrap> - <input type="checkbox" value="<?php echo $row['id']; ?>" class="mass nowarn"/> + <input type="checkbox" value="<?php echo $row['id']; ?>" class="ckb mass nowarn"/> </td> <td> <a class="userPreview" href="users.php?id=<?php echo $row['id']; ?>"><?php @@ -209,6 +209,22 @@ else } //end of while. endif; ?> </tbody> + <tfoot> + <tr> + <td colspan="7"> + <?php if ($res && $num) { ?> + <?php echo __('Select');?>: + <a id="selectAll" href="#ckb"><?php echo __('All');?></a> + <a id="selectNone" href="#ckb"><?php echo __('None');?></a> + <a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a> + <?php }else{ + echo '<i>'; + echo __('Query returned 0 results.'); + echo '</i>'; + } ?> + </td> + </tr> + </tfoot> </table> <?php if($res && $num): //Show options.. @@ -249,19 +265,25 @@ $(function() { return false; }); - var goBaby = function(action) { + var goBaby = function(action, confirmed) { var ids = [], $form = $('form#users-list'); $(':checkbox.mass:checked', $form).each(function() { ids.push($(this).val()); }); - if (ids.length && confirm(__('You sure?'))) { + if (ids.length) { + var submit = function() { $form.find('#action').val(action); $.each(ids, function() { $form.append($('<input type="hidden" name="ids[]">').val(this)); }); $form.find('#selected-count').val(ids.length); $form.submit(); + }; + if (!confirmed) + $.confirm(__('You sure?')).then(submit); + else + submit(); } - else if (!ids.length) { + else { $.sysAlert(__('Oops'), __('You need to select at least one item')); } @@ -276,7 +298,7 @@ $(function() { try { var json = $.parseJSON(json); $form.find('#org_id').val(json.id); - goBaby('setorg'); + goBaby('setorg', true); } catch (e) { console.log(e); } }); diff --git a/scp/js/scp.js b/scp/js/scp.js index 02fe02c6b37f7b9fc3da9b3bc0cbaee41eb4b77e..45186f42991eebc2efcd37fe3d2d562dd3e6c1c3 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -607,6 +607,39 @@ $.sysAlert = function (title, msg, cb) { } }; +$.confirm = function(message, title) { + title = title || __('Please Confirm'); + var D = $.Deferred(), + $popup = $('.dialog#popup'), + hide = function() { + $('#overlay').hide(); + $popup.hide(); + }; + $('div#popup-loading', $popup).hide(); + $('div.body', $popup).empty() + .append($('<h3></h3>').text(title)) + .append($('<a class="close" href="#"><i class="icon-remove-circle"></i></a>')) + .append($('<hr/>')) + .append($('<p class="confirm-action"></p>') + .text(message) + ).append($('<div></div>') + .append($('<b>').text(__('Please confirm to continue.'))) + ).append($('<hr style="margin-top:1em"/>')) + .append($('<p class="full-width"></p>') + .append($('<span class="buttons pull-left"></span>') + .append($('<input type="button" class="close"/>') + .attr('value', __('Cancel')) + .click(function() { hide(); }) + )).append($('<span class="buttons pull-right"></span>') + .append($('<input type="button"/>') + .attr('value', __('OK')) + .click(function() { hide(); D.resolve(); }) + ))).append($('<div class="clear"></div>')); + $('#overlay').fadeIn(); + $popup.show(); + return D.promise(); +}; + $.userLookup = function (url, cb) { $.dialog(url, 201, function (xhr) { var user = $.parseJSON(xhr.responseText);