Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1211

Přidáno uživatelem Jiří Sviták před asi 13 roky(ů)

pridano tlacitko pro zruseni vsech presmerovani dane zpravy

Zobrazit rozdíly:

freenetis/branches/testing/application/i18n/cs_CZ/texts.php
'activated number has not been changed' => 'Aktivované číslo již nelze změnit',
'activated redirection' => 'Aktivované přesměrování',
'activated redirections' => 'Aktivovaná přesměrování',
'activated redirections of this message have been successfuly deactivated' => 'Aktivovaná přesměrování této zprávy byla úspěšně deaktivována.',
'activation date' => 'Datum aktivace',
'active' => 'Aktivní',
'active member' => 'Aktivní člen',
freenetis/branches/testing/application/helpers/callback.php
}
/**
* Deactivates all activated redirections for given message.
* @param <type> $item
* @param <type> $name
*/
static function message_deactivate_field($item, $name)
{
$message = new Message_Model($item->id);
if ($message->type == Message_Model::CONTACT_INFORMATION
|| $message->type == Message_Model::CANCEL_MESSAGE
|| $message->type == Message_Model::UNKNOWN_DEVICE_MESSAGE)
{
echo '&nbsp;';
}
else
{
echo html::anchor(url_lang::base().'messages/deactivate/'.$message->id, __('Deactivate'));
}
}
/**
* Field for deleting messages. Only user messages are allowed to be deleted.
* @author Jiri Svitak
* @param unknown_type $item
freenetis/branches/testing/application/models/message.php
'email_count' => $email_count
);
}
/**
* Deactivates all redirections of given message.
* @author Jiri Svitak
* @param <type> $message_id
*/
public function deactivate_message($message_id)
{
$message_id = intval($message_id);
$this->db->query("DELETE FROM messages_ip_addresses WHERE message_id = ".$message_id);
}
/**
* Returns id of message by given type
*
* @author Michal Kliment
freenetis/branches/testing/application/controllers/messages.php
->label(__('Activate'))
->callback('callback::message_activate_field');
}
if ($this->acl_check_edit('Messages_Controller', 'message'))
{
$grid->callback_field('id')
->label(__('Deactivate'))
->callback('callback::message_deactivate_field');
}
if ($this->acl_check_edit('Messages_Controller', 'message'))
{
......
}
$message_model = new Message_Model();
$user_id = $this->session->get('user_id');
//try
try
{
//$message_model->transaction_start();
// choose which message to update
......
default:
Controller::warning(PARAMETER);
}
//$message_model->transaction_commit();
$message_model->transaction_commit();
$info_message = __('Redirection "%s" for %d IP addresses have been activated.',
array
......
status::success($info_message, FALSE);
url::redirect(url_lang::base().'messages/show_all');
}
/*
catch (Exception $e)
{
$message_model->transaction_rollback();
status::error('Error - cant set redirection.');
url::redirect(url_lang::base().'messages/show_all');
}
*
*/
}
/**
* Deactivates all redirections for given message.
*
* @author Jiri Svitak
* @param integer $message_id
*/
public function deactivate($message_id = NULL)
{
if (!$this->acl_check_edit('Messages_Controller', 'message'))
Controller::error(ACCESS);
// param check
if (!$message_id || !is_numeric($message_id))
{
Controller::warning(PARAMETER);
}
// preparation
$message = new Message_Model($message_id);
if (!$message || !$message->id)
{
Controller::error(RECORD);
}
$message_model = new Message_Model();
$message_model->deactivate_message($message_id);
status::success(__("Activated redirections of this message have been successfuly deactivated."));
url::redirect(url_lang::base().'messages/show_all');
}
}

Také k dispozici: Unified diff