Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 518

Přidáno uživatelem Tomáš Dulík před téměř 15 roky(ů)

Dodelana funkce pro mazani vykazane prace

Zobrazit rozdíly:

freenetis/trunk/kohana/application/controllers/works.php
*
*/
class Works_Controller extends Controller {
protected $user_id = false;
function index()
{
url::redirect(url_lang::base().'works/show_all');
}
/**
* @author Michal Kliment
* Shows all confirmed works with filter
......
$view->render(TRUE);
}
function delete($id = NULL)
{
if (!$this->acl_check_delete('Users_Controller', 'work'))
Controller::error(ACCESS);
if (isset($id))
{
$job_model = new Job_Model($id);
$user_id=$job_model->user_id;
$job_model->delete($id);
if ($job_model->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Work has been successfully deleted').'.');
url::redirect(url_lang::base().'works/show_by_user/'.$user_id);
}
else
{
$this->session->set_flash('message', url_lang::lang('texts.Error - can\'t delete work').'.');
}
}
else
{
Controller::warning(PARAMETER);
}
}
}
?>

Také k dispozici: Unified diff