Revize 1866
Přidáno uživatelem Ondřej Fibich před více než 11 roky(ů)
freenetis/trunk/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'monthly payment rate of devices' => 'Měsíční splátka zařízení',
|
||
'more devices' => 'Více zařízení',
|
||
'multiple choice' => 'Vícenásobná volba',
|
||
'must be greater than zero' => 'Musí být větší než nula',
|
||
'must be logged in' => 'Musíte se přihlásit.',
|
||
'must pay regular fee' => 'Platí pravidelný příspěvek',
|
||
'my backups' => 'Moje zálohy',
|
freenetis/trunk/application/controllers/devices.php | ||
---|---|---|
|
||
$group_payment->input('payment_rate')
|
||
->label('Monthly payment rate')
|
||
->rules('valid_numeric');
|
||
->rules('valid_numeric')
|
||
->callback(array($this, 'valid_repayment'));
|
||
|
||
$group_payment->date('buy_date')
|
||
->label('Buy date')
|
||
... | ... | |
|
||
$group_payment->input('payment_rate')
|
||
->label('Monthly payment rate')
|
||
->rules('valid_numeric');
|
||
->rules('valid_numeric')
|
||
->callback(array($this, 'valid_repayment'));
|
||
|
||
$group_payment->date('buy_date')
|
||
->label('Buy date')
|
||
... | ... | |
$group_payment->input('payment_rate')
|
||
->label('Monthly payment rate')
|
||
->rules('valid_numeric')
|
||
->value($device->payment_rate ? $device->payment_rate : '');
|
||
->value($device->payment_rate ? $device->payment_rate : '')
|
||
->callback(array($this, 'valid_repayment'));
|
||
|
||
$group_payment->date('buy_date')
|
||
->label('Buy date')
|
||
... | ... | |
|
||
return $filter_form;
|
||
}
|
||
|
||
/**
|
||
* Validate repayment of device
|
||
*
|
||
* @param Form_Field $input
|
||
*/
|
||
public function valid_repayment($input = NULL)
|
||
{
|
||
if (empty($input) || !is_object($input))
|
||
{
|
||
self::error(PAGE);
|
||
}
|
||
|
||
$price = $this->input->post('price');
|
||
$rate = $input->value;
|
||
|
||
if (!empty($price) && doubleval($rate) <= 0)
|
||
{
|
||
$input->add_error('required', __('Must be greater than zero'));
|
||
}
|
||
}
|
||
|
||
}
|
Také k dispozici: Unified diff
Opravy:
- fixes #488: Validator ceny zarizeni