Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 721

Přidáno uživatelem Ondřej Fibich před asi 14 roky(ů)

Pridana moznost zasilani upozornovani zainteresovaneho uzivatele na telefonni fakturu adminem pomoci vnitrni posty a automaticke zpravy.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/mail.php
'work_add' => "Do systému byla přidána práce uživatele <b>%s</b>. Prohlédnout si ji a hlasovat o ní můžete <b><a href='%s'>zde</a></b>.<br /><br /> Prosím neodpovídejte na tuto zprávu, byla vygenerována automaticky systémem.",
'work_update' => "V systému byla aktualizována práce uživatele <b>%s</b>. Prohlédnout si ji a hlasovat o ní můžete <b><a href='%s'>zde</a></b>.<br /><br /> Prosím neodpovídejte na tuto zprávu, byla vygenerována automaticky systémem.",
'work_delete' => "V systému byla smazána práce uživatele <b>%s</b> s textem %s.<br /><br /> Prosím neodpovídejte na tuto zprávu, byla vygenerována automaticky systémem.",
'phone_invoice_warning' => "Do systému byla přidána faktura k telefonu, na níž se nachází i Vaše číslo %s.<br /><br />V rozhraní <a href='%s'><b>Moje telefoní účty</b></a> prosím vyplňte, které telefonní hovory a služby byly soukromé a firemní.",
);
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'my backups' => 'Moje zálohy',
'my devices' => 'Moje zařízení',
'my ip address' => 'Moje IP adresa',
'my mail' => 'Moje pošta',
'my phone invoices' => 'Moje účty za telefon',
'my profile' => 'Můj profil',
'my transfers' => 'Moje převody',
......
'phone number' => 'Telefoní číslo',
'phone number user' => 'Telefoní číslo uživatele',
'phone registration status' => 'Stav registrace telefonu',
'phone invoice for number %s in period from %s to %s' => 'Telefoní faktura za číslo %s v období od %s do %s',
'phone invoices' => 'Telefoní faktury',
'phone invoices of user' => 'Telefoní faktury uživatele',
'phones in invoice' => 'Telefoní čísla ve faktuře',
......
'secondary dns' => 'Sekundární DNS.',
'section' => 'Sekce',
'send' => 'Odeslat',
'send mail warning to users related with invoice' => 'Odeslat upozornění uživatelům spojených s fakturou',
'send message' => 'Odeslat zprávu',
'segment detail' => 'Detail segmentu',
'segment has been successfully saved' => 'Segment byl úspěšně uložen.',
......
'user has been successfully added' => 'Uživatel byl úspěšně přidán.',
'user has been successfully deleted' => 'Uživatel byl úspěšně smazán.',
'user has been successfully updated' => 'Uživatel byl úspěšně upraven.',
'users has been warned about invoice' => 'Uživatelé byly upozorněni na fakturu',
'user name' => 'Uživatelské jméno',
'user_name' => 'Křestní jméno',
'username already exists in database' => 'Uživatelské jméno již v databázi existuje',
freenetis/trunk/kohana/application/controllers/phone_invoices.php
}
/**
* Sends warning to users which numbers are on invoice.
* @see Mail_messages_Model
* @param integer $phone_invoice_id
*/
public function post_mail_warning($phone_invoice_id)
{
if (! $this->acl_check_new('Phone_invoices_Controller', 'mail_warning'))
{
Controller::error(ACCESS);
}
if (intval($phone_invoice_id) <= 0)
{
Controller::warning(PARAMETER);
}
$phone_invoice_model = new Phone_invoice_Model($phone_invoice_id);
if (!$phone_invoice_model->id)
{
Controller::error(RECORD);
}
$phone_invoice_user_model = new Phone_invoice_user_Model();
$phone_invoice_users = $phone_invoice_user_model->get_all_invoice_users($phone_invoice_model->id);
$mail_messsage_model = new Mail_message_Model();
foreach ($phone_invoice_users as $phone_invoice_user)
{
if ($phone_invoice_user->user_id == 0)
{
continue;
}
$mail_messsage_model->from_id = $this->session->get('user_id');
$mail_messsage_model->to_id = $phone_invoice_user->user_id;
$mail_messsage_model->time = date('Y-m-d H:i:s');
$mail_messsage_model->from_deleted = 1;// user to can delete it
$mail_messsage_model->subject = url_lang::lang(
'texts.Phone invoice for number %s in period from %s to %s', array(
$phone_invoice_user->phone_number,
$phone_invoice_model->billing_period_from,
$phone_invoice_model->billing_period_to
)
);
$mail_messsage_model->body = url_lang::lang(
'mail.phone_invoice_warning', array(
$phone_invoice_user->phone_number,
url_lang::base() . 'phone_invoices/show_by_user/' . $phone_invoice_user->user_id
)
);
$mail_messsage_model->save();
$mail_messsage_model->clear();
}
$this->session->set_flash('message', url_lang::lang('texts.Users has been warned about invoice.'));
url::redirect(url_lang::base().'phone_invoices/show/'.$phone_invoice_id);
}
/**
* Displays users phone invoices
* @param integer $user_id
*/
freenetis/trunk/kohana/application/views/phone_invoices/show.php
<th><?php echo url_lang::lang('texts.Total price') ?></th>
<td><b><?php echo number_format($total_price, 2, ',', ' ') ?></b></td>
</tr>
<?php if (! $phone_invoice->locked && $this->acl_check_new('Phone_invoices_Controller', 'mail_warning')): ?>
<tr>
<th><?php echo html::image(array('src'=>'media/images/inbox.png')); ?></th>
<th><?php echo html::anchor(url_lang::base().'phone_invoices/post_mail_warning/'.$phone_invoice->id, url_lang::lang('texts.Send mail warning to users related with invoice')) ?></th>
</tr>
<?php endif; ?>
<tr>
<th><?php echo html::image(array('src'=>'media/images/locked.png')); ?></th>
<th><?php echo html::anchor(url_lang::base().'phone_invoices/lock_set/'.$phone_invoice->id, $phone_invoice->locked ? url_lang::lang('texts.Unlock invoice') : url_lang::lang('texts.Lock invoice')) ?></th>
</tr>

Také k dispozici: Unified diff