Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 355

Přidáno uživatelem Michal Kliment před asi 15 roky(ů)

Pridana dalsi funkce edit pro editaci jednotlivych praci, mirne prepsan vypis vsech praci - nyni je rozdelen do dvou. Prvni vypisuje vsechny potvrzene a druhy vsechny nepotrvzene...

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'back to interface parameters' => 'Zpět na parametry rozhraní',
'back to interfaces list' => 'Zpět na seznam rozhraní',
'back to ip addresses list' => 'Zpět na seznam IP adres',
'back to list of all confirmed works' => 'Zpět na seznam všech potvrzených prací',
'back to list of all devices' => 'Zpět na seznam všech zařízení',
'back to list of all fees' => 'Zpět na seznam všech poplatků',
'back to list of all invoices' => 'Zpět na seznam všech faktur',
'back to list of all works' => 'Zpět na seznam všech prací',
'back to list of all unconfirmed works' => 'Zpět na seznam všech nepotvrzených prací',
'back to list of enum types' => 'Zpět na seznam všech výčtů',
'back to list of groups' => 'Zpět na seznam skupin',
'back to list of members' => 'Zpět na seznam členů',
......
'item(s) have been successfully added' => 'položka(ek) bylo úspěšně přidáno',
'language' => 'Jazyk',
'leaving date' => 'Datum vystoupení',
'list of all confirmed works' => 'Seznam všech potvrzených prací',
'list of all invoices' => 'Seznam všech faktur',
'list of all members' => 'Seznam všech členů',
'list of all transactions' => 'Seznam všech převodů',
'list of all unconfirmed works' => 'Seznam všech nepotvrzených prací',
'list of all users' => 'Seznam všech uživatelů',
'list of all works' => 'Seznam všech prací',
'list of users of member' => 'Seznam uživatelů člena',
'location address' => 'Adresa umístění',
'location details' => 'Detaily umístění',
......
'send to member' => 'Pošli členovi',
'service' => 'Služba',
'settings' => 'Nastavení',
'show all confirmed works' => 'Zobraz všechnny potvrzené práce',
'show all transfers on the account' => 'Ukaž všechny převody tohoto účtu',
'show all unconfirmed works' => 'Zobraz všechnny nepotvrzené práce',
'show his transfers' => 'Zobrazit jeho převody',
'show his devices' => 'Zobrazit jeho zařízení',
'show invoice' => 'Zobrazit fakturu',
freenetis/trunk/kohana/application/models/job.php
/**
* @author Michal Kliment
* Returns all works depending on filter values
* Returns all confirmed works depending on filter values
* @param $limit_from
* @param $limit_results
* @param $order_by
......
* @param $filter_values
* @return ORM Iterator
*/
public function get_all_works($limit_from = 0, $limit_results = 50, $order_by = 'id', $order_by_direction = 'ASC', $filter_values = array())
public function get_all_confirmed_works($limit_from = 0, $limit_results = 50, $order_by = 'id', $order_by_direction = 'ASC', $filter_values = array())
{
......
$year = $filter_values['year'];
$where .= ($where!='WHERE ') ? ' AND j.date LIKE \''.$year.'-%\'' : 'j.date LIKE \''.$year.'-%\'';
}
if (isset($filter_values['confirmed']))
if ($where=='') $where.='WHERE j.confirmed_by_id IS NOT NULL';
else $where.='j.confirmed_by_id IS NOT NULL';
return self::$db->query('SELECT j.id, concat(u.name,\' \',u.surname) as user_name, j.description, j.date, j.hours, j.km, concat(c.name,\' \',c.surname) as confirm_user FROM jobs j
LEFT JOIN users u ON j.user_id = u.id
LEFT JOIN users c ON j.confirmed_by_id = c.id '.$where.' ORDER BY '.$order_by.' '.$order_by_direction);
}
public function get_all_unconfirmed_works($limit_from = 0, $limit_results = 50, $order_by = 'id', $order_by_direction = 'ASC', $filter_values = array())
{
$where = (count($filter_values)) ? 'WHERE ' : '';
if (isset($filter_values['user_id'])) $where .= 'u.id = '.$filter_values['user_id'];
if (isset($filter_values['description'])) $where .= ($where!='WHERE ') ? ' AND j.description LIKE \'%'.$filter_values['description'].'%\'' : 'j.description LIKE \'%'.$filter_values['description'].'%\'';
if (isset($filter_values['day']))
{
if ($filter_values['confirmed'] == 1)
{
$where .= ($where!='WHERE ') ? ' AND j.confirmed_by_id IS NOT NULL' : 'j.confirmed_by_id IS NOT NULL';
}
else
{
$where .= ($where!='WHERE ') ? ' AND j.confirmed_by_id IS NULL' : 'j.confirmed_by_id IS NULL';
}
$day = ($filter_values['day']>9) ? $filter_values['day'] : '0'.$filter_values['day'];
$where .= ($where!='WHERE ') ? ' AND j.date LIKE \'%-'.$day.'\'' : 'j.date LIKE \'%-'.$day.'\'';
}
return self::$db->query('SELECT j.id, concat(u.name,\' \',u.surname) as user_name, j.description, j.date, j.hours, j.km, j.confirmed_by_id as confirmed FROM jobs j
LEFT JOIN users u ON j.user_id = u.id '.$where.' ORDER BY '.$order_by.' '.$order_by_direction);
if (isset($filter_values['month']))
{
$month = ($filter_values['month']>9) ? $filter_values['month'] : '0'.$filter_values['month'];
$where .= ($where!='WHERE ') ? ' AND j.date LIKE \'%-'.$month.'-%\'' : 'j.date LIKE \'%-'.$month.'-%\'';
}
if (isset($filter_values['year']))
{
$year = $filter_values['year'];
$where .= ($where!='WHERE ') ? ' AND j.date LIKE \''.$year.'-%\'' : 'j.date LIKE \''.$year.'-%\'';
}
if ($where=='') $where.='WHERE j.confirmed_by_id IS NULL';
else $where.='j.confirmed_by_id IS NULL';
return self::$db->query('SELECT j.id, concat(u.name,\' \',u.surname) as user_name, j.description, j.date, j.hours, j.km, concat(c.name,\' \',c.surname) as confirm_user FROM jobs j
LEFT JOIN users u ON j.user_id = u.id
LEFT JOIN users c ON j.confirmed_by_id = c.id '.$where.' ORDER BY '.$order_by.' '.$order_by_direction);
}
/**
......
* @param $filter_values
* @return count of all works
*/
public function count_all_works($filter_values = array())
public function count_all_confirmed_works($filter_values = array())
{
$where = (count($filter_values)) ? 'WHERE ' : '';
if (isset($filter_values['user_id'])) $where .= 'u.id = '.$filter_values['user_id'];
......
$year = $filter_values['year'];
$where .= ($where!='WHERE ') ? ' AND j.date LIKE \''.$year.'-%\'' : 'j.date LIKE \''.$year.'-%\'';
}
if (isset($filter_values['confirmed']))
if ($where=='') $where.='WHERE j.confirmed_by_id IS NOT NULL';
else $where.='j.confirmed_by_id IS NOT NULL';
$works = self::$db->query('SELECT j.id, concat(u.name,\' \',u.surname) as user_name, j.description, j.date, j.hours, j.km FROM jobs j
LEFT JOIN users u ON j.user_id = u.id '.$where);
return count($works);
}
public function count_all_unconfirmed_works($filter_values = array())
{
$where = (count($filter_values)) ? 'WHERE ' : '';
if (isset($filter_values['user_id'])) $where .= 'u.id = '.$filter_values['user_id'];
if (isset($filter_values['description'])) $where .= ($where!='WHERE ') ? ' AND j.description LIKE \'%'.$filter_values['description'].'%\'' : 'j.description LIKE \'%'.$filter_values['description'].'%\'';
if (isset($filter_values['day']))
{
if ($filter_values['confirmed'] == 1)
{
$where .= ($where!='WHERE ') ? ' AND j.confirmed_by_id IS NOT NULL' : 'j.confirmed_by_id IS NOT NULL';
}
else
{
$where .= ($where!='WHERE ') ? ' AND j.confirmed_by_id IS NULL' : 'j.confirmed_by_id IS NULL';
}
$day = ($filter_values['day']>9) ? $filter_values['day'] : '0'.$filter_values['day'];
$where .= ($where!='WHERE ') ? ' AND j.date LIKE \'%-'.$day.'\'' : 'j.date LIKE \'%-'.$day.'\'';
}
if (isset($filter_values['month']))
{
$month = ($filter_values['month']>9) ? $filter_values['month'] : '0'.$filter_values['month'];
$where .= ($where!='WHERE ') ? ' AND j.date LIKE \'%-'.$month.'-%\'' : 'j.date LIKE \'%-'.$month.'-%\'';
}
if (isset($filter_values['year']))
{
$year = $filter_values['year'];
$where .= ($where!='WHERE ') ? ' AND j.date LIKE \''.$year.'-%\'' : 'j.date LIKE \''.$year.'-%\'';
}
if ($where=='') $where.='WHERE j.confirmed_by_id IS NULL';
else $where.='j.confirmed_by_id IS NULL';
$works = self::$db->query('SELECT j.id, concat(u.name,\' \',u.surname) as user_name, j.description, j.date, j.hours, j.km FROM jobs j
LEFT JOIN users u ON j.user_id = u.id '.$where);
freenetis/trunk/kohana/application/controllers/works.php
/**
* @author Michal Kliment
* Shows all works (confirmed or unconfirmed) with filter
* Shows all confirmed works with filter
* @param $limit_results
* @param $order_by
* @param $order_by_direction
......
"td",
new Table_Form_Item('select','month','Month', $months),
"tr",
new Table_Form_Item('select','year','Year', $years),
"td",
new Table_Form_Item('select','confirmed','Confirmed', array(0 => '---', 1 => url_lang::lang('texts.Yes'), 2 => url_lang::lang('texts.No'))),
new Table_Form_Item('select','year','Year', $years),
"tr",
"td",
new Table_Form_Item('submit','submit','Filter')
......
$filter_values = $filter->values();
$total_works = $work_model->count_all_works($filter_values);
$total_works = $work_model->count_all_confirmed_works($filter_values);
if (($sql_offset = ($page - 1) * $limit_results) > $total_works)
$sql_offset = 0;
$works = $work_model->get_all_works($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter_values);
$works = $work_model->get_all_confirmed_works($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter_values);
$arr_gets = array();
foreach ($this->input->get() as $key=>$value)
......
$query_string = '?'.implode('&',$arr_gets);
// create grid
$grid = new Grid(url_lang::base().'works/show_all', '', array(
$grid = new Grid(url_lang::base().'works/show_all', url_lang::lang('texts.List of all confirmed works'), array(
//'separator' => '',
'use_paginator' => true,
'use_selector' => true,
......
if ($this->acl_check_new('Users_Controller','work'))
$grid->add_new_button(url_lang::base().'works/add', url_lang::lang('texts.Add new work'));
$grid->add_new_button(url_lang::base().'works/show_all_unconfirmed', url_lang::lang('texts.Show all unconfirmed works'));
$grid->order_field('id')->label(url_lang::lang('texts.Id'));
$grid->order_field('user_name')->label(url_lang::lang('texts.User'));
$grid->order_field('description')->label(url_lang::lang('texts.Description'));
$grid->order_field('date')->label(url_lang::lang('texts.Date'));
$grid->order_field('hours')->label(url_lang::lang('texts.Hours'));
$grid->order_field('km')->label(url_lang::lang('texts.Km'));
$grid->order_field('confirmed')->label(url_lang::lang('texts.Confirmed'))->bool(array(url_lang::lang('texts.No'),url_lang::lang('texts.Yes')))->class('center');
$grid->order_field('confirm_user')->label(url_lang::lang('texts.Confirmed by'));
if ($this->acl_check_view('Users_Controller','work'))
$grid->action_field('id')->label(url_lang::lang('texts.Show')) ->url(url_lang::base().'works/show') ->action(url_lang::lang('texts.Show'))->class('center');
......
$view = new View('template');
$view->header = new View('base/header');
$view->header->title = url_lang::lang('texts.List of all works');
$view->header->title = url_lang::lang('texts.List of all confirmed works');
$view->header->menu = Controller::render_menu();
$view->content = new View('show_all');
$view->content->headline = url_lang::lang('texts.List of all works');
$view->content->headline = '';
$view->content->table = $filter->view.'<br />'.$grid;
$view->footer = new View('base/footer');
$view->render(TRUE);
}
function show_all_unconfirmed($limit_results = 200, $order_by = 'id', $order_by_direction = 'ASC', $page_word = null, $page = 1)
{
if (!$this->acl_check_view('Users_Controller','work'))
Controller::error(1);
// gets new selector
if (is_numeric($this->input->get('record_per_page')))
$limit_results = (int) $this->input->get('record_per_page');
// parameters control
$allowed_order_type = array('id','user_name','description','date','hours','km','confirmed');
if (!in_array(strtolower($order_by), $allowed_order_type)) $order_by = 'id';
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc') $order_by_direction = 'asc';
$work_model = new Job_Model();
$users = $work_model->get_all_users();
$arr_users = arr::from_objects($users);
$arr_users[0] = '---';
asort($arr_users);
$days = date::days(1);
$days[0] = '---';
asort($days);
$months = date::months();
$months[0] = '---';
asort($months);
$years = date::years(date('Y')-10,date('Y'));
$years[0] = '---';
asort($years);
$filter=new Table_Form(url_lang::base()."works/show_all_unconfirmed", "get", array(
new Table_Form_Item('select','user_id','User', $arr_users),
"td",
new Table_Form_Item('text','description','Description'),
"tr",
new Table_Form_Item('select','day','Day', $days),
"td",
new Table_Form_Item('select','month','Month', $months),
"tr",
new Table_Form_Item('select','year','Year', $years),
"tr",
"td",
new Table_Form_Item('submit','submit','Filter')
)
);
$filter_values = $filter->values();
$total_works = $work_model->count_all_unconfirmed_works($filter_values);
if (($sql_offset = ($page - 1) * $limit_results) > $total_works)
$sql_offset = 0;
$works = $work_model->get_all_unconfirmed_works($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter_values);
$arr_gets = array();
foreach ($this->input->get() as $key=>$value)
$arr_gets[] = $key.'='.$value;
$query_string = '?'.implode('&',$arr_gets);
// create grid
$grid = new Grid(url_lang::base().'works/show_all', url_lang::lang('texts.List of all unconfirmed works'), array(
//'separator' => '',
'use_paginator' => true,
'use_selector' => true,
'current' => $limit_results, //current selected 'records_per_page' value
'selector_increace' => 200, // increace
'selector_min' => 200, // minimum where selector start
'selector_max_multiplier' => 10,
'uri_segment' => 'page', // pass a string as uri_segment to trigger former 'label' functionality
'total_items' => $total_works, // use db count query here of course
'items_per_page' => $limit_results, // it may be handy to set defaults for stuff like this in config/pagination.php
'style' => 'classic',
'order_by' => $order_by,
'order_by_direction' => $order_by_direction,
'limit_results' => $limit_results,
'query_string' => $query_string
));
// access control
if ($this->acl_check_new('Users_Controller','work'))
$grid->add_new_button(url_lang::base().'works/add', url_lang::lang('texts.Add new work'));
$grid->add_new_button(url_lang::base().'works/show_all', url_lang::lang('texts.Show all confirmed works'));
$grid->order_field('id')->label(url_lang::lang('texts.Id'));
$grid->order_field('user_name')->label(url_lang::lang('texts.User'));
$grid->order_field('description')->label(url_lang::lang('texts.Description'));
$grid->order_field('date')->label(url_lang::lang('texts.Date'));
$grid->order_field('hours')->label(url_lang::lang('texts.Hours'));
$grid->order_field('km')->label(url_lang::lang('texts.Km'));
if ($this->acl_check_view('Users_Controller','work'))
$grid->action_field('id')->label(url_lang::lang('texts.Show')) ->url(url_lang::base().'works/show') ->action(url_lang::lang('texts.Show'))->class('center');
if ($this->acl_check_edit('Users_Controller','work'))
$grid->action_field('id')->label(url_lang::lang('texts.Edit')) ->url(url_lang::base().'works/edit') ->action(url_lang::lang('texts.Edit'))->class('center');
if ($this->acl_check_edit('Users_Controller','work'))
$grid->action_field('id')->label(url_lang::lang('texts.Delete')) ->url(url_lang::base().'works/delete') ->action(url_lang::lang('texts.Delete'))->class('center');
$grid->datasource($works);
$view = new View('template');
$view->header = new View('base/header');
$view->header->title = url_lang::lang('texts.List of all unconfirmed works');
$view->header->menu = Controller::render_menu();
$view->content = new View('show_all');
$view->content->headline = '';
$view->content->table = $filter->view.'<br />'.$grid;
$view->footer = new View('base/footer');
$view->render(TRUE);
}
/**
* @author Michal Kliment
* Shows one work
......
$confirmed_by = new User_Model($work->confirmed_by_id);
$link_back = ($work->confirmed_by_id) ? html::anchor(url_lang::base().'works',url_lang::lang('texts.Back to list of all confirmed works')) : html::anchor(url_lang::base().'works/show_all_unconfirmed',url_lang::lang('texts.Back to list of all unconfirmed works'));
$view = new View('template');
$view->header = new View('base/header');
$view->header->title = url_lang::lang('texts.Show work');
......
$view->content = new View('works/show');
$view->content->work = $work;
$view->content->confirmed_by = $confirmed_by;
$view->content->link_back = $link_back;
$view->footer = new View('base/footer');
$view->render(TRUE);
}
......
$view->footer = new View('base/footer');
$view->render(TRUE);
}
function uncorfirmed()
{
if (!$this->acl_check_new('Users_Controller', 'work')) Controller::error(1);
$work_data = new Job_Model();
$unc_works = $work_data->where('confirmed_by_id IS NULL')->find_all();
$grid = new Grid(url_lang::base().'works', null,array(
'separator' => '<br />',
'use_paginator' => false,
'use_selector' => false
));
$grid->field('id')->label('ID');
$grid->field('description')->label(url_lang::lang('texts.Description'));
$grid->field('hours')->label(url_lang::lang('texts.Hours'));
$grid->action_field('id') ->label(url_lang::lang('texts.Confirm'))->url(url_lang::base().'works/confirm_work')->action(url_lang::lang('texts.Confirm'));
$grid->action_field('id') ->label(url_lang::lang('texts.Edit'))->url(url_lang::base().'users/edit_work')->action(url_lang::lang('texts.Edit'));
$grid->action_field('id') ->label(url_lang::lang('texts.Delete'))->url(url_lang::base().'users/delete_work')->action(url_lang::lang('texts.Delete'))->script('onclick="return potvrd(\''.url_lang::lang('texts.delete_work').'\');"');;
//print_r($model_works->get_wokrs($user_id)->current());die();
$grid->datasource( $unc_works );
$view = new View('template');
$view->header = new View('base/header');
$view->content = new View('works_unconfirmed');
$view->content->grid = $grid;
$view->footer = new View('base/footer');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Unconfirmed works');
$view->content->message = $this->session->get_once('message');
function edit($work_id = NULL)
{
$work = new Job_Model($work_id);
if (!$work_id || !$work->id || $work->confirmed_by_id) url::redirect(url_lang::base().'works');
// access control
if (!$this->acl_check_edit('Users_Controller','work',$work->user->member_id))
Controller::error(1);
$user_model = new User_Model();
// gets all user's names
$users = $user_model->get_all_user_names();
// transforms array of objects to classic array
$arr_users = arr::from_objects($users);
// creates form
$this->form = new Forge(url_lang::base().'works/edit/'.$work_id, '', 'POST', array('id' => 'article_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
$this->form->group('')->label(url_lang::lang('texts.Basic information'));
$this->form->dropdown('user_id')->label(url_lang::lang('texts.User'))->options($arr_users)->rules('required')->selected($work->user_id);
$this->form->textarea('description')->label(url_lang::lang('texts.Description').':')->rules('required|length[0,250]')->value($work->description);
$this->form->date('date')->label(url_lang::lang('texts.Date').':')->years(date('Y')-10, date('Y'))->rules('required')->value(strtotime($work->date));
$this->form->input('hours')->label(url_lang::lang('texts.Hours').':')->rules('required|length[0,250]|valid_numeric')->value($work->hours);
$this->form->input('km')->label(url_lang::lang('texts.Km').':')->rules('length[0,250]|valid_numeric')->value($work->km);
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
special::required_forge_style($this->form, ' *', 'required');
if ($this->form->validate())
{
$form_data = $this->form->as_array();
// creates new work
$work = new Job_Model($work_id);
$work->user_id = $form_data['user_id'];
$work->description = $form_data['description'];
$work->date = date('Y-m-d', $form_data['date']);
$work->hours = $form_data['hours'];
$work->km = $form_data['km'];
// success
if ($work->save())
{
$this->session->set_flash('message', url_lang::lang('texts.Work has been successfully updated').'.');
}
url::redirect(url_lang::base().'works/show_all');
}
$view = new View('template');
$view->header = new View('base/header');
$view->header->title = url_lang::lang('texts.Edit the work');
$view->header->menu = Controller::render_menu();
$view->content = new View('works/edit');
$view->content->form = $this->form->html();
$view->footer = new View('base/footer');
$view->render(TRUE);
} // end of uncorfirmed function
function confirm_work($work_id)
{
if (!$this->gacl_class->acl_check('freenetis', 'view_all', 'all', $_SESSION['username'],get_class($this),'work_confirm')) Controller::error(1);
if (isset($work_id))
{
$work_data = new Job_Model($work_id);
}
$model_account = new Account_Model();
$accounts = $model_account->where('type!=\'master\' AND type!=\'bank\' AND owner_id='.$work_data->user->member->id)->find_all();
foreach ($accounts as $account)
{
$arr_accounts[$account->id] = $account->name.' ('.$account->type.')';
function confirm($work_id)
{
$work = new Job_Model($work_id);
} //*/
$form = new Forge(url_lang::base().'works/confirm_work/'.$work_id, '', 'POST', array('id' => 'article_form'));
$form->group('')->label(url_lang::lang('texts.Transfer information'));
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
$form->dropdown('account')->label(url_lang::lang('texts.Members account').':')->options($arr_accounts);
$form->input('amount')->label(url_lang::lang('texts.Amount').':')->rules('required|length[0,50]|valid_numeric')->value('0');
$form->textarea('comment')->label(url_lang::lang('texts.Comment').':')->rules('length[0,250]');
$form->submit('submit')->value(url_lang::lang('texts.Do transfer'));
special::required_forge_style($form, ' *', 'required');
if (!$work_id || !$work->id) url::redirect(url_lang::base().'works');
if($form->validate())
{
$form_data = $form->as_array();
$model_transfer = new Money_transfer_Model();
$model_account->clear();
$model_account->where('type=\'operating\'')->find();
$operating_acc_id = $model_account->id;
foreach($form_data as $key => $value)
{
$form_data[$key] = htmlspecialchars($value);
}
$model_transfer->origin_id = $operating_acc_id;
$model_transfer->destination_id = $form_data['account'];
$model_transfer->text = $form_data['comment'];
$model_transfer->amount = (float)$form_data['amount'];
$all_right = false;
$all_right = $model_transfer->save();
$work_data->transfer_id = $model_transfer->id;
$work_data->confirmed_by_id = $this->session->get('user_id');
if ($work_data->save() && $all_right)
{
$model_account->clear();
$model_account->find($form_data['account']);
if ($model_account->type=='analytic')
{
$model_members = new Member_Model($model_account->owner_id);
$model_members->current_credit = (float)$model_members->current_credit + (float)$form_data['amount'];
$model_members->save();
unset($model_members);
}
$this->session->set_flash('message', url_lang::lang('texts.The transfer successfully done.'));
}
else
{
$this->session->set_flash('message', url_lang::lang('texts.Error - cant do the transfer.'));
}
url::redirect(url_lang::base().'works/uncorfirmed');
}
else
{
$view->form = new View('registration');
$view = new View('template');
$view->header = new View('base/header');
$view->content = new View('works_confirm');
$view->footer = new View('base/footer');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Work confirmation');
$view->content->form = $form->html();
$view->content->work_data = $work_data;
//$view->content->acc_id = $acc_id;
// access control
if (!$this->acl_check_confirm('Users_Controller','work',$work->user->member_id))
Controller::error(1);
$view->render(TRUE);
}
}
else
{
Controller::warning(1);
}
}
}
}
?>
freenetis/trunk/kohana/application/views/works/show.php
<h2><?php echo url_lang::lang('texts.Show work') ?></h2>
<?php
$links = array();
$links[] = html::anchor(url_lang::base().'works',url_lang::lang('texts.Back to list of all works'));
$links[] = $link_back;
if ($this->acl_check_edit('Users_Controller','work',$work->user->member_id) && !$work->confirmed_by_id)
$links[] = html::anchor(url_lang::base().'works/edit/'.$work->id,url_lang::lang('texts.Edit'));
freenetis/trunk/kohana/application/views/works/edit.php
<h2><?php echo url_lang::lang('texts.Edit the work') ?></h2><br />
<?php echo html::anchor(url_lang::base().'works/show_all_unconfirmed', url_lang::lang('texts.Back to list of all unconfirmed works')) ?>
<br /><br />
<?php echo $form ?>

Také k dispozici: Unified diff