Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2351

Přidáno uživatelem David Raška před asi 10 roky(ů)

Upravy:
- refs #930: Pridani pocitadla znaku SMS do editoru upozorneni

Zobrazit rozdíly:

freenetis/branches/1.2/application/controllers/js.php
$this->notification_activate();
}
private function _js_messages_edit()
{
$this->views['messages_edit'] = View::factory('js/__pieces/sms_message_counter');
}
private function _js_messages_auto_settings_add()
{
$this->time_activity_rule();
......
$this->views['settings_system']->modules = $modules;
}
private function _js_sms_send()
{
$this->views['sms_send'] = View::factory('js/__pieces/sms_message_counter');
}
private function _js_transfers_add_from_account($origin_account_id = NULL)
{
$this->views['transfers_add_from_account'] = View::factory('js/transfers_add_from_account');
freenetis/branches/1.2/application/controllers/messages.php
->rules('length[1,760]')
->style('width: 100%; max-width: 633px; height: 150px')
->value($message->sms_text);
$form->input('counter')
->style('width:100%; max-width: 633px;');
}
$form->submit('Edit');
freenetis/branches/1.2/application/controllers/sms.php
$form->dateselect('stamp')
->label(__('Date') . ':');
$form->textarea('text')
$form->textarea('sms_text')
->label('Text')
->rules('length[1,760]|required')
->style('width: 530px; height: 150px');
......
$sms->sms_message_id = $form_data['s_id'];
$sms->stamp = date('Y-m-d H:i:s', time());
$sms->send_date = date('Y-m-d H:i:s', $form_data['stamp']);
$sms->text = text::cs_utf2ascii($form_data['text']);
$sms->text = text::cs_utf2ascii($form_data['sms_text']);
$sms->sender = $form_data['sender_number'];
$sms->receiver = $phone;
$sms->driver = $form_data['sms_driver'];
freenetis/branches/1.2/application/i18n/cs_CZ/texts.php
'count of allowed subnets has been successfully updated' => 'Počet povolených podsítí byl úspěšně aktualizován.',
'count of members' => 'Počet členů',
'count of works' => 'Počet prací',
'counter' => 'Počítadlo',
'counteraccount' => 'Protiúčet',
'counteraccount bank code' => 'Kód banky protiúčtu',
'counteraccount name' => 'Název protiúčtu',
freenetis/branches/1.2/application/views/js/sms_send.php
<?php
/**
* SMS send javascript view.
*
* @author Roman Sevcik, Ondrej Fibich
*/
// IDE complementation
if (FALSE): ?><script type="text/javascript"><?php endif
?>
var maxpartsize = 156 - 4;
var maxparts = 5;
var totalmaxlen = maxparts * maxpartsize;
function count_char(form)
{
form.counter.disabled=true;
var message = form.text;
var text_length = message.value.length;
var text_left = totalmaxlen - message.value.length;
var parts = Math.ceil(text_length/maxpartsize).toString();
if (text_left < 0)
{
text_left = 0;
text_length = totalmaxlen;
parts = maxparts;
alert('<?php echo __('Message is too long') ?>!');
}
form.counter.value =
'<?php echo __('Written is', '', 2) ?> ' + text_length +
' <?php echo __('and', '', 1) ?> <?php echo __('have left', '', 1) ?> ' + text_left +
' <?php echo __('chars', '', 1) ?>. ' +
'<?php echo __('Message will be splited to', '', 2) ?> ' +
parts + ' SMS.';
}
count_char(document.sms_form);
$('#text').keyup(function ()
{
count_char(document.sms_form)
});
freenetis/branches/1.2/application/views/js/__pieces/sms_message_counter.php
<?php
/**
* SMS send javascript view.
*
* @author Roman Sevcik, Ondrej Fibich
*/
// IDE complementation
if (FALSE): ?><script type="text/javascript"><?php endif
?>
var maxpartsize = 156 - 4;
var maxparts = 5;
var totalmaxlen = maxparts * maxpartsize;
function count_char(form)
{
form.counter.disabled=true;
var message = form.sms_text;
var text_length = message.value.length;
var text_left = totalmaxlen - message.value.length;
var parts = Math.ceil(text_length/maxpartsize).toString();
if (text_left < 0)
{
text_left = 0;
text_length = totalmaxlen;
parts = maxparts;
alert('<?php echo __('Message is too long') ?>!');
}
form.counter.value =
'<?php echo __('Written is', '', 2) ?> ' + text_length +
' <?php echo __('and', '', 1) ?> <?php echo __('have left', '', 1) ?> ' + text_left +
' <?php echo __('chars', '', 1) ?>. ' +
'<?php echo __('Message will be splited to', '', 2) ?> ' +
parts + ' SMS.';
}
count_char($('#sms_text').parents('form')[0]);
$('#sms_text').keyup(function ()
{
count_char($(this).parents('form')[0]);
});

Také k dispozici: Unified diff