Revize 1679
Přidáno uživatelem David Raška před asi 12 roky(ů)
freenetis/branches/testing/application/controllers/json.php | ||
---|---|---|
|
||
echo json_encode($arr_ifaces);
|
||
}
|
||
|
||
/**
|
||
* Function return address of given user
|
||
*
|
||
* @author David Raska
|
||
*/
|
||
public function get_user_address()
|
||
{
|
||
$user_id = (int) $this->input->get('user_id');
|
||
|
||
if ($user_id)
|
||
{
|
||
$um = new User_Model($user_id);
|
||
|
||
$result = array(
|
||
'country_id' => $um->member->address_point->country_id,
|
||
'town_id' => $um->member->address_point->town_id,
|
||
'street_id' => $um->member->address_point->street_id,
|
||
'street_number' => $um->member->address_point->street_number,
|
||
);
|
||
|
||
echo json_encode($result);
|
||
}
|
||
}
|
||
|
||
}
|
freenetis/branches/testing/application/controllers/js.php | ||
---|---|---|
$this->views['devices_add']->arr_devices = $device->select_list_device_with_user($user_id);
|
||
}
|
||
|
||
private function _js_devices_add_simple()
|
||
{
|
||
$this->address_point_streets();
|
||
$this->address_point_gps();
|
||
}
|
||
|
||
private function _js_devices_add_filter()
|
||
{
|
||
$this->views['devices_add'] = View::factory('js/devices_add_filter');
|
freenetis/branches/testing/application/controllers/devices.php | ||
---|---|---|
{
|
||
$selected_engineer = $found_engineer->id;
|
||
}
|
||
|
||
$arr_users[$um->id] = $um->get_name_with_login();
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
$selected_street_id = 0;
|
||
$selected_street_number = '';
|
||
$selected_town_id = 0;
|
||
|
||
$arr_users = array
|
||
(
|
||
NULL => '----- '.__('select user').' -----'
|
||
) + $um->select_list_grouped();
|
||
}
|
||
|
||
$arr_users = array
|
||
(
|
||
NULL => '----- '.__('select user').' -----'
|
||
) + $um->select_list_grouped();
|
||
|
||
// enum types for device
|
||
$enum_type_model = new Enum_type_Model();
|
||
$types = $enum_type_model->get_values(Enum_type_Model::DEVICE_TYPE_ID);
|
freenetis/branches/testing/application/views/js/__pieces/address_point_street.php | ||
---|---|---|
$('#domicile_town_id').trigger('change');
|
||
});
|
||
|
||
$('#user_id').live('change', function()
|
||
{
|
||
$.ajax({
|
||
url: '<?php echo url_lang::base() ?>json/get_user_address',
|
||
async: false,
|
||
data: {user_id: $(this).val()},
|
||
dataType: 'json',
|
||
success: function(data)
|
||
{
|
||
$('#town_id').val(data['town_id']).change();
|
||
$('#street_id').val(data['street_id']);
|
||
$('#country_id').val(data['country_id']);
|
||
$('#street_number').val(data['street_number']).change();
|
||
}
|
||
});
|
||
});
|
||
|
||
function town_dropdown_change(el)
|
||
{
|
||
var val = parseInt(el.val(), 10);
|
Také k dispozici: Unified diff
Opravy:
- #298: Oprava moznosti vybrat uzivatele
Upravy:
- Pri vyberu clena u pridani zarizeni se nacita adresa uzivatele do adresy zarizeni