Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 397

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

Dodelany (snad) kompletne prace a jejich administrace. Nyni se jiz kdokoliv muze cokoliv vykazat...

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'back to the member' => 'Zpět na profil člena',
'back to the members transfers' => 'Zpět na převody člena',
'back to the user' => 'Zpět na uživatele',
'back to the work' => 'Zpět k práci',
'back to this account' => 'Zpět na tento účet',
'back to this user' => 'Zpět na tohoto uživatele',
'back to transfers of member' => 'Zpět na převody člena',
......
'confirm' => 'Potvrdit',
'confirm password' => 'Heslo znovu',
'confirm new password' => 'Nové heslo znovu',
'confirm work' => 'Potvrdit práci',
'confirm the work' => 'Potvrdit práci',
'confirmed' => 'Potvrzeno',
'confirmed by' => 'Potvrzeno od',
'confirmed time' => 'Čas potvrzení',
'confirmed works' => 'Potvrzené práce',
'constant symbol' => 'Konstantní symbol',
'contact data' => 'Kontaktní údaje',
......
'qos rate' => 'Rate (limit-at) pro QoS',
'quantity' => 'Množství',
'quarter' => 'Městská část',
'rating' => 'Ohodnocení',
'really delete this account' => 'Opravdu smazat tento účet',
'received member fees' => 'Přijaté členské příspěvky',
'reg' => 'Přih.',
......
'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 his works' => 'Zobrazit jeho práce',
'show invoice' => 'Zobrazit fakturu',
'show invoice item' => 'Zobrazit položku faktury',
'show transfer' => 'ukaž transakci',
......
'wireless setting has been successfully updated' => 'Bezdrátové nastavení bylo úspěšně upraveno.',
'work confirmation' => 'Potvrzení práce',
'work has been successfully added' => 'Práce byla úspěšně přidána',
'work has been successfully confirmed' => 'Práce byla úspěšně potvrzena',
'work has been successfully deleted' => 'Práce byla úspěšně smazána',
'work has been successfully updated' => 'Práce byla úspěšně akutualizována',
'work hasn\'t been successfully confirmed' => 'Práce nebyla úspěšně akutualizována',
'works' => 'Práce',
'write email' => 'Napsat e-mail',
'wrong password' => 'Špatné heslo',
freenetis/trunk/kohana/application/models/job.php
if ($where=='') $where.='WHERE j.confirmed_by_id IS NOT NULL';
else $where.=' AND 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
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, t.creation_datetime as confirm_time, t.amount as rating FROM jobs j
LEFT JOIN users u ON j.user_id = u.id
LEFT JOIN transfers t ON j.transfer_id = t.id
LEFT JOIN users c ON j.confirmed_by_id = c.id '.$where.' ORDER BY '.$order_by.' '.$order_by_direction);
}
......
public function get_all_confirmed_works_by_member_id($member_id)
{
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
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, t.creation_datetime as confirm_time, t.amount as rating FROM jobs j
LEFT JOIN users u ON j.user_id = u.id
LEFT JOIN transfers t ON j.transfer_id = t.id
LEFT JOIN users c ON j.confirmed_by_id = c.id WHERE j.confirmed_by_id IS NOT NULL AND u.member_id = '.$member_id);
}
freenetis/trunk/kohana/application/models/account.php
return self::$db->query("SELECT id
FROM accounts
WHERE member_id = $member_id AND account_attribute_id = ".Account_attribute_Model::$credit)
->current()->id;
->current();
}
/**
freenetis/trunk/kohana/application/controllers/members.php
$user_grid->action_field('id') ->label(url_lang::lang('texts.User'))->url(url_lang::base().'users/edit')->action(url_lang::lang('texts.Edit'));
if ($this->acl_check_edit('Users_Controller', 'password', $member_id))
$user_grid->action_field('id') ->label(url_lang::lang('texts.Password'))->url(url_lang::base().'users/change_password')->action(url_lang::lang('texts.Edit'));
if ($this->acl_check_edit('Users_Controller', 'application_password', $member_id))
$user_grid->action_field('id') ->label(url_lang::lang('texts.Application password'))->url(url_lang::base().'users/change_application_password')->action(url_lang::lang('texts.Edit'));
// $user_grid->action_field('id') ->label(url_lang::lang('texts.Delete'))->url(url_lang::base().'users/delete')->action(url_lang::lang('texts.Delete'))->script('onclick="return potvrd(\''.url_lang::lang('texts.delete_user').'\');"');;
$user_grid->datasource($users);
freenetis/trunk/kohana/application/controllers/settings.php
// page title
$this->form->input('title')->label(url_lang::lang('texts.Page title').':')->rules('length[3,40]|required')->value($this->setting->title);
// currency
$this->form->input('currency')->label(url_lang::lang('texts.Currency').':')->rules('length[3,40]|required')->value($this->setting->currency);
// self-registration
$this->form->radio('self_registration')->label(url_lang::lang('texts.Self-registration').':')->options(array('1'=>url_lang::lang('texts.Yes'),'0'=>url_lang::lang('texts.No')))->default($this->setting->self_registration);
freenetis/trunk/kohana/application/controllers/works.php
$limit_results = (int) $this->input->get('record_per_page');
// parameters control
$allowed_order_type = array('id','user_name','description','date','hours','km','confirmed');
$allowed_order_type = array('id','user_name','description','date','hours','km','confirm_user','confirm_time','rating');
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';
......
$grid->order_field('hours')->label(url_lang::lang('texts.Hours'));
$grid->order_field('km')->label(url_lang::lang('texts.Km'));
$grid->order_field('confirm_user')->label(url_lang::lang('texts.Confirmed by'));
$grid->order_field('confirm_time')->label(url_lang::lang('texts.Confirmed time'));
$grid->order_field('rating')->label(url_lang::lang('texts.Rating'));
// access control
if ($this->acl_check_view('Users_Controller','work'))
......
$confirmed_grid->field('hours')->label(url_lang::lang('texts.Hours'));
$confirmed_grid->field('km')->label(url_lang::lang('texts.Km'));
$confirmed_grid->field('confirm_user')->label(url_lang::lang('texts.Confirmed by'));
$confirmed_grid->field('confirm_time')->label(url_lang::lang('texts.Confirmed time'));
$confirmed_grid->field('rating')->label(url_lang::lang('texts.Rating'));
// access control
if ($this->acl_check_view('Users_Controller','work',$member_id))
......
Controller::error(1);
$confirmed_by = new User_Model($work->confirmed_by_id);
$transfer = new Transfer_Model($work->transfer_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->content = new View('works/show');
$view->content->work = $work;
$view->content->confirmed_by = $confirmed_by;
$view->content->transfer = $transfer;
$view->content->link_back = $link_back;
$view->footer = new View('base/footer');
$view->render(TRUE);
......
if (!$this->acl_check_confirm('Users_Controller','work',$work->user->member_id))
Controller::error(1);
/**
* @todo finish confirm + transfer
*/
$this->form = new Forge(url_lang::base().'works/confirm/'.$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->input('rating')->label(url_lang::lang('texts.Rating').':')->rules('required|length[0,250]|valid_numeric');
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
special::required_forge_style($this->form, ' *', 'required');
// creates form
if ($this->form->validate())
{
$form_data = $this->form->as_array();
// creates new work
$work = new Job_Model($work_id);
$work->confirmed_by_id = $this->session->get('user_id');
$account_model = new Account_Model();
// finding of operating account
$operating_account = $account_model->get_operating_account();
// findind of account of member
$member_account = $account_model->get_credit_account_of_member($work->user->member_id);
// creates new transfer
$transfer = new Transfer_Model();
$transfer->origin_id = $operating_account->id;
$transfer->destination_id = $member_account->id;
$transfer->datetime = date('Y-m-d');
$transfer->creation_datetime = date('Y-m-d H:i:s');
$transfer->text = $work->description;
$transfer->amount = $form_data["rating"];
$transfer_saved = $transfer->save();
$work->transfer_id = $transfer->id;
$work_saved = $work->save();
// success
if ($work_saved && $transfer_saved)
{
$this->session->set_flash('message', url_lang::lang('texts.Work has been successfully confirmed').'.');
}
else
{
$this->session->set_flash('message', url_lang::lang('texts.Work hasn\'t been successfully confirmed').'.');
}
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.Confirm the work');
$view->header->menu = Controller::render_menu();
$view->content = new View('works/confirm');
$view->content->link_back = html::anchor(url_lang::base().'works/show/'.$work_id,url_lang::lang('texts.Back to the work'));
$view->content->form = $this->form->html();
$view->footer = new View('base/footer');
$view->render(TRUE);
}
freenetis/trunk/kohana/application/views/members/show.php
if ($this->acl_check_edit('Members_Controller', 'members', $member_data->member_id))
$links[] = html::anchor(url_lang::base().'members/edit/'.$member_data->member_id,url_lang::lang('texts.Edit member'));
if ($this->acl_check_edit('Users_Controller', 'password', $member_data->id))
$links[] = html::anchor(url_lang::base().'users/change_password/'.$member_data->id, url_lang::lang('texts.Change password'));
//if ($this->acl_check_edit('Users_Controller', 'password', $member_data->id))
// $links[] = html::anchor(url_lang::base().'users/change_password/'.$member_data->id, url_lang::lang('texts.Change password'));
if ($this->acl_check_edit('Users_Controller', 'application_password', $member_data->id))
$links[] = html::anchor(url_lang::base().'users/change_application_password/'.$member_data->id, url_lang::lang('texts.Change application password'));
//if ($this->acl_check_edit('Users_Controller', 'application_password', $member_data->id))
// $links[] = html::anchor(url_lang::base().'users/change_application_password/'.$member_data->id, url_lang::lang('texts.Change application password'));
if ($this->acl_check_view('Devices_Controller', 'devices', $member_data->member_id))
$links[] = html::anchor(url_lang::base().'devices/show_by_member/'.$member_data->member_id,url_lang::lang('texts.Show his devices'));
......
if ($this->acl_check_view('Accounts_Controller', 'transfers', $member_data->member_id))
$links[] = html::anchor(url_lang::base().'transfers/show_by_member/'.$member_data->member_id,url_lang::lang('texts.Show his transfers'));
if ($this->acl_check_view('Users_Controller', 'work', $member_data->member_id))
$links[] = html::anchor(url_lang::base().'works/show_by_member/'.$member_data->member_id,url_lang::lang('texts.Show his works'));
if ($member_data->entrance_fee_left != 0 && $this->acl_check_edit('Members_Controller', 'en_fee_left', $member_data->member_id))
$links[] = html::anchor(url_lang::base().'transfers/deduct_entrance_fees/'.$member_data->member_id, url_lang::lang('texts.Deduct entrance fee'));
freenetis/trunk/kohana/application/views/works/confirm.php
<h2><?php echo url_lang::lang('texts.Confirm the work') ?></h2><br />
<?php echo $link_back ?>
<br /><br />
<?php echo $form ?>
freenetis/trunk/kohana/application/views/works/show.php
<th><?php echo url_lang::lang('texts.Confirmed by') ?></th>
<td><?php echo html::anchor(url_lang::base().'users/show/'.$confirmed_by->id,$confirmed_by->name.' '.$confirmed_by->surname) ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Confirmed time') ?></th>
<td><?php echo $transfer->creation_datetime ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.Rating') ?></th>
<td><?php echo $transfer->amount.' '.$this->setting->currency ?></td>
</tr>
<?php endif ?>
</table>

Také k dispozici: Unified diff