Skip to content
Snippets Groups Projects
Commit 02cb791b authored by Jared Hancock's avatar Jared Hancock
Browse files

Fix sprious "oops select at least one item" popup

parent 5273c349
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,7 @@ $users->order_by($order . $order_column); ...@@ -75,7 +75,7 @@ $users->order_by($order . $order_column);
<div class="pull-right"> <div class="pull-right">
<?php if ($thisstaff->hasPerm(User::PERM_CREATE)) { ?> <?php if ($thisstaff->hasPerm(User::PERM_CREATE)) { ?>
<a class="action-button popup-dialog" <a class="green button action-button popup-dialog"
href="#users/add"> href="#users/add">
<i class="icon-plus-sign"></i> <i class="icon-plus-sign"></i>
<?php echo __('Add User'); ?> <?php echo __('Add User'); ?>
...@@ -93,15 +93,8 @@ $users->order_by($order . $order_column); ...@@ -93,15 +93,8 @@ $users->order_by($order . $order_column);
</span> </span>
<div id="action-dropdown-more" class="action-dropdown anchor-right"> <div id="action-dropdown-more" class="action-dropdown anchor-right">
<ul> <ul>
<?php if ($thisstaff->hasPerm(User::PERM_DELETE)) { ?> <?php if ($thisstaff->hasPerm(User::PERM_EDIT)) { ?>
<li><a class="users-action" href="#delete"> <li><a href="#add-to-org" class="users-action">
<i class="icon-trash icon-fixed-width"></i>
<?php echo __('Delete'); ?></a></li>
<?php }
if ($thisstaff->hasPerm(User::PERM_EDIT)) { ?>
<li><a href="#orgs/lookup/form" onclick="javascript:
$.dialog('ajax.php/orgs/lookup/form', 201);
return false;">
<i class="icon-group icon-fixed-width"></i> <i class="icon-group icon-fixed-width"></i>
<?php echo __('Add to Organization'); ?></a></li> <?php echo __('Add to Organization'); ?></a></li>
<?php <?php
...@@ -121,6 +114,11 @@ if ('disabled' != $cfg->getClientRegistrationMode()) { ?> ...@@ -121,6 +114,11 @@ if ('disabled' != $cfg->getClientRegistrationMode()) { ?>
<i class="icon-unlock icon-fixed-width"></i> <i class="icon-unlock icon-fixed-width"></i>
<?php echo __('Unlock'); ?></a></li> <?php echo __('Unlock'); ?></a></li>
<?php } <?php }
if ($thisstaff->hasPerm(User::PERM_DELETE)) { ?>
<li class="danger"><a class="users-action" href="#delete">
<i class="icon-trash icon-fixed-width"></i>
<?php echo __('Delete'); ?></a></li>
<?php }
} # end of registration-enabled? ?> } # end of registration-enabled? ?>
</ul> </ul>
</div> </div>
...@@ -270,9 +268,25 @@ $(function() { ...@@ -270,9 +268,25 @@ $(function() {
$form.submit(); $form.submit();
}; };
var options = {}; var options = {};
if (action === 'delete') if (action === 'delete') {
options['deletetickets'] options['deletetickets']
= __('Also delete all associated tickets and attachments'); = __('Also delete all associated tickets and attachments');
}
else if (action === 'add-to-org') {
$.dialog('ajax.php/orgs/lookup/form', 201, function(xhr, json) {
var $form = $('form#users-list');
try {
var json = $.parseJSON(json),
org_id = $form.find('#org_id');
if (json.id) {
org_id.val(json.id);
goBaby('setorg', true);
}
}
catch (e) { }
});
return;
}
if (!confirmed) if (!confirmed)
$.confirm(__('You sure?'), undefined, options).then(submit); $.confirm(__('You sure?'), undefined, options).then(submit);
else else
...@@ -288,18 +302,6 @@ $(function() { ...@@ -288,18 +302,6 @@ $(function() {
goBaby($(this).attr('href').substr(1)); goBaby($(this).attr('href').substr(1));
return false; return false;
}); });
$(document).on('dialog:close', function(e, json) {
$form = $('form#users-list');
try {
var json = $.parseJSON(json),
org_id = $form.find('#org_id');
if (json.id) {
org_id.val(json.id);
goBaby('setorg', true);
}
}
catch (e) { }
});
}); });
</script> </script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment