Revize 2229
Přidáno uživatelem Ondřej Fibich před asi 11 roky(ů)
freenetis/branches/1.1/application/controllers/devices.php | ||
---|---|---|
}
|
||
|
||
$old_user_id = $device->user_id;
|
||
|
||
|
||
$device->user_id = $form_data['user_id'];
|
||
$device->name = $form_data['device_name'];
|
||
$device->type = $form_data['type'];
|
||
... | ... | |
}
|
||
|
||
$device->save_throwable();
|
||
|
||
// must be reloaded some sub object may changed
|
||
$device->reload();
|
||
|
||
// add address point if there is no such
|
||
if (!$ap->id)
|
||
... | ... | |
$device->user->member_id, array($ip_address->subnet_id)
|
||
);
|
||
}
|
||
|
||
// change connected from if owner has changed to an applicant
|
||
// and if he is not connected yet
|
||
if ($device->user->member->type == Member_Model::TYPE_APPLICANT && (
|
||
empty($device->user->member->applicant_connected_from) ||
|
||
$device->user->member->applicant_connected_from == '0000-00-00'
|
||
))
|
||
{
|
||
// connected from now
|
||
$device->user->member->applicant_connected_from = date('Y-m-d');
|
||
$device->user->member->save_throwable();
|
||
}
|
||
}
|
||
|
||
// device's payment has been changed
|
||
if (Settings::get('finance_enabled') && $device_payment_changed)
|
||
{
|
||
$member = new Member_Model($member_id);
|
||
|
||
Accounts_Controller::recalculate_device_fees(
|
||
$member->get_credit_account()->id
|
||
$device->user->member->get_credit_account()->id
|
||
);
|
||
}
|
||
|
Také k dispozici: Unified diff
Upravy:
- fixes #794: Vyplneni datum pripojeni pri zmene vlastnika zarizeni