Fixed new_agent
This commit is contained in:
parent
fbccb4ac6b
commit
3c95d17482
|
@ -149,7 +149,7 @@ if (is_ajax()) {
|
|||
|
||||
ui_require_javascript_file('openlayers.pandora');
|
||||
|
||||
$new_agent = (bool) get_parameter('new_agent');
|
||||
$new_agent = (empty($id_agente)) ? true : false;
|
||||
|
||||
if (! isset($id_agente) && ! $new_agent) {
|
||||
db_pandora_audit('ACL Violation', 'Trying to access agent manager witout an agent');
|
||||
|
@ -1222,6 +1222,7 @@ ui_require_jquery_file('bgiframe');
|
|||
|
||||
$(document).ready (function() {
|
||||
|
||||
var $id_agent = '<?php echo $id_agente; ?>';
|
||||
var previous_primary_group_select;
|
||||
$("#grupo").on('focus', function () {
|
||||
previous_primary_group_select = this.value;
|
||||
|
@ -1276,12 +1277,14 @@ ui_require_jquery_file('bgiframe');
|
|||
}
|
||||
});
|
||||
|
||||
paint_qrcode(
|
||||
"<?php echo ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente); ?>",
|
||||
"#qr_code_agent_view",
|
||||
128,
|
||||
128
|
||||
);
|
||||
if (typeof $id_agent !== 'undefined' && $id_agent !== '0') {
|
||||
paint_qrcode(
|
||||
"<?php echo ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente); ?>",
|
||||
"#qr_code_agent_view",
|
||||
128,
|
||||
128
|
||||
);
|
||||
}
|
||||
$("#text-agente").prop('readonly', true);
|
||||
|
||||
});
|
||||
|
|
|
@ -754,7 +754,6 @@ if (check_acl($config['id_user'], 0, 'AW')) {
|
|||
// Create agent button.
|
||||
echo '<div style="text-align: right;">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
html_print_input_hidden('new_agent', 1);
|
||||
html_print_submit_button(
|
||||
__('Create agent'),
|
||||
'crt-2',
|
||||
|
|
|
@ -902,7 +902,6 @@ if (!empty($table->data)) {
|
|||
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AM')) {
|
||||
echo '<div style="text-align: right; float: right;">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
html_print_input_hidden('new_agent', 1);
|
||||
html_print_submit_button(__('Create agent'), 'crt', false, 'class="sub next"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
@ -913,7 +912,6 @@ if (!empty($table->data)) {
|
|||
ui_print_info_message([ 'no_close' => true, 'message' => __('There are no defined agents') ]);
|
||||
echo '<div style="text-align: right; float: right;">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
html_print_input_hidden('new_agent', 1);
|
||||
html_print_submit_button(__('Create agent'), 'crt', false, 'class="sub next"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
|
Loading…
Reference in New Issue