Revize 125
Přidáno uživatelem Michal Kliment před asi 16 roky(ů)
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'back to all subnets' => 'Zpět na seznam podsítí',
|
||
'back to detail' => 'Zpět na detail',
|
||
'back to device parameters' => 'Zpět na parametry zařízení',
|
||
'back to devices list' => 'Zpět na seznam zařízení',
|
||
'back to devices list' => 'Zpět na seznam zařízení',
|
||
'back to devices list of this member' => 'Zpět na seznam zařízení tohoto člena',
|
||
'back to devices list of the member' => 'Zpět na seznam zařízení člena',
|
||
'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 members.'=> 'Zpět na seznam členů',
|
||
'back to list of members'=> 'Zpět na seznam členů',
|
||
'back to login' => 'Zpět na přihlášení',
|
||
'back to ports list' => 'Zpět na seznam portů',
|
||
'back to segments list' => 'Zpět na seznam segmentů',
|
||
'back to the member.'=> 'Zpět na profil člena',
|
||
'back to the member'=> 'Zpět na profil člena',
|
||
'back to the user'=> 'Zpět na uživatele',
|
||
'back to this member.'=> 'Zpět na profil člena',
|
||
'back to the members transfers.'=> 'Zpět na transakce člena',
|
||
... | ... | |
'contact informations'=> 'Kontaktní informace',
|
||
'contact value'=> 'Data kontaktu',
|
||
'cookies must be anabled.'=> 'Musí být zapnuty cookies.',
|
||
'create new devices' => 'Vytvořit nové zařízení',
|
||
'create new interface' => 'Vytvořit nové rozraní',
|
||
'create new devices' => 'Vytvořit nové zařízení',
|
||
'create new devices for member' => 'Vytvořit nové zařízení pro člena',
|
||
'create new interface' => 'Vytvořit nové rozhraní',
|
||
'create new ip address' => 'Vytvořit novou IP adresu',
|
||
'create new port' => 'Vytvořit nový port',
|
||
'create new segment' => 'Vytvořit nový segment',
|
||
... | ... | |
'device is successfully saved' => 'Zařízení bylo úspěšně uloženo.',
|
||
'device is successfully updated' => 'Zařízení bylo úspěšně upraveno.',
|
||
'device name' => 'Název zařízení',
|
||
'devices list' => 'Seznam zařízení',
|
||
'devices list' => 'Seznam zařízení',
|
||
'devices list of member' => 'Seznam zařízení člena',
|
||
'devices' => 'Zařízení',
|
||
'display member'=> 'Zobraz člena',
|
||
'display member'=> 'Zobraz člena',
|
||
'display user'=> 'Zobraz uživatele',
|
||
'do transfer'=> 'Proveď transakci',
|
||
'double entry account'=> 'Podvojný účet',
|
||
'duplex' => 'Duplexní',
|
freenetis/trunk/kohana/application/controllers/members.php | ||
---|---|---|
function show($member_id = NULL, $order_by = 'member_id', $order_by_direction = 'ASC')
|
||
{
|
||
if (isset($member_id))
|
||
{
|
||
{
|
||
|
||
|
||
$model_members = new Member_Model();
|
||
$member_data = $model_members->get_member($member_id)->current();
|
||
// print_r($member_data);
|
freenetis/trunk/kohana/application/controllers/devices.php | ||
---|---|---|
//----- SHOW_ALL --------------------------------------------------------------
|
||
//=============================================================================
|
||
function show_all($limit_results = 500, $order_by = 'id', $order_by_direction = 'ASC')
|
||
{
|
||
{
|
||
|
||
$this->session->del('ssMember_id');
|
||
|
||
$device_model = new Device_Model;
|
||
|
||
$total_devices = $device_model->count_all_devices(); // count all members in database
|
||
... | ... | |
Controller::error();
|
||
} else {
|
||
|
||
$device_model = new Device_Model;
|
||
$device_model = new Device_Model;
|
||
$member = new Member_Model($member_id);
|
||
|
||
$this->session->set('ssMember_id',$member_id);
|
||
|
||
// get new selector
|
||
if (is_numeric($this->input->get('record_per_page')))
|
||
... | ... | |
'url_array_ofset' => 1
|
||
|
||
));
|
||
|
||
$grid->add_new_button(url_lang::base().'devices/add', url_lang::lang('texts.add new device').' ');
|
||
$grid->add_new_button(url_lang::base().'members/show/'.$member_id, url_lang::lang('texts.back to the member'));
|
||
$grid->order_field('id')->label('ID')->class('center');
|
||
$grid->order_field('name')->label(url_lang::lang('texts.name'));
|
||
$grid->order_field('type')->label(url_lang::lang('texts.type'));
|
||
... | ... | |
|
||
$view->content = new View('show_all');
|
||
$view->content->table = $this->template->content;
|
||
$view->content->headline = url_lang::lang('texts.Devices list');
|
||
$view->content->headline = url_lang::lang('texts.Devices list of member').' '.$member->name;
|
||
|
||
|
||
$view->footer = new View('base/footer');
|
||
|
||
... | ... | |
Controller::error();
|
||
}
|
||
|
||
$ssMember_id = $this->session->get('ssMember_id');
|
||
|
||
$enum_type_model = new Enum_type_Model();
|
||
|
||
$device_type = $enum_type_model->get_value($device->type);
|
||
... | ... | |
$view->content->set('arr_ip',$arr_ip);
|
||
$view->content->table_device_admins = $grid_device_admins;
|
||
$view->content->table_ifaces = $grid_ifaces;
|
||
$view->content->table_ports = $grid_ports;
|
||
$view->content->link_back = html::anchor(url_lang::base().'devices/show_all/', url_lang::lang('texts.Back to devices list'));
|
||
$view->content->table_ports = $grid_ports;
|
||
|
||
if($ssMember_id)
|
||
{
|
||
$view->content->link_back = html::anchor(url_lang::base().'devices/show_by_member/'.$ssMember_id, url_lang::lang('texts.Back to devices list of the member'));
|
||
}
|
||
else
|
||
{
|
||
$view->content->link_back = html::anchor(url_lang::base().'devices/show_all/', url_lang::lang('texts.Back to devices list'));
|
||
}
|
||
|
||
|
||
$view->footer = new View('base/footer');
|
||
... | ... | |
//=============================================================================
|
||
function add()
|
||
{
|
||
|
||
|
||
$ssMember_id = $this->session->get('ssMember_id');
|
||
|
||
$form = new Forge(url_lang::base()."devices/add", '', 'POST', array('id' => 'article_form'));
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
|
||
$form->group('')->label(url_lang::lang('texts.Basic data'));
|
||
|
||
$model_user = new User_Model;
|
||
$users = $model_user->select('id','name','surname','login')->orderby('id')->find_all();
|
||
$arr_users[0] = '----- '.url_lang::lang('texts.select user').' -----';
|
||
$model_user = new User_Model;
|
||
|
||
if($ssMember_id)
|
||
{
|
||
$member = new Member_Model($ssMember_id);
|
||
$users = $model_user->select('id','name','surname','login')->orderby('id')->find_all_by_member_id($ssMember_id);
|
||
}
|
||
else
|
||
{
|
||
$users = $model_user->select('id','name','surname','login')->orderby('id')->find_all();
|
||
$arr_users[0] = '----- '.url_lang::lang('texts.select user').' -----';
|
||
}
|
||
|
||
|
||
foreach ($users as $user) {
|
||
$arr_users[$user->id] = $user->surname.' '.$user->name.' - '.$user->login;
|
||
}
|
||
asort($arr_users);
|
||
|
||
$engineers = $model_user->select('id','name','surname','login')->orderby('id')->find_all();
|
||
$arr_engineers[0] = '----- '.url_lang::lang('texts.select user').' -----';
|
||
|
||
foreach ($engineers as $engineer) {
|
||
$arr_engineers[$engineer->id] = $engineer->surname.' '.$engineer->name.' - '.$engineer->login;
|
||
}
|
||
asort($arr_engineers);
|
||
|
||
$enum_type_model = new Enum_type_Model();
|
||
$types = $enum_type_model->get_values(Enum_type_Model::id_type_of_device);
|
||
$types[0] = '----- '.url_lang::lang('texts.select type').' -----';
|
||
... | ... | |
$form->input('GPS')->label(url_lang::lang('texts.GPS').':')->rules('length[3,100]');
|
||
$form->input('location_address')->label(url_lang::lang('texts.location address').':')->rules('length[3,254]');
|
||
$form->input('location_details')->label(url_lang::lang('texts.location details').':')->rules('length[3,254]');
|
||
$form->textarea('comment')->label(url_lang::lang('texts.comment').':')->rules('length[0,254]');
|
||
$form->textarea('comment')->label(url_lang::lang('texts.comment').':')->rules('length[0,254]');
|
||
$form->dropdown('first_engineer_id')->label(url_lang::lang('texts.engineer').' 1:')->options($arr_engineers)->rules('required')->selected($this->session->get('user_id'));
|
||
$form->dropdown('second_engineer_id')->label(url_lang::lang('texts.engineer').' 2:')->options($arr_engineers);
|
||
|
||
$form->submit('submit')->value(url_lang::lang('texts.Save'));
|
||
special::required_forge_style($form, ' *', 'required');
|
||
... | ... | |
$form_data = $form->as_array();
|
||
|
||
$device_model = new Device_Model();
|
||
$device_engineer_model = new Device_engineer_Model();
|
||
|
||
|
||
//foreach($form_data as $key => $value)
|
||
//{
|
||
// $device_model->$key = htmlspecialchars($value);
|
||
//}
|
||
|
||
$engineers_data[] = $form_data["first_engineer_id"];
|
||
if($form_data["second_engineer_id"]>0) $engineers_data[] = $form_data["second_engineer_id"];
|
||
|
||
$device_model->user_id = htmlspecialchars($form_data["user_id"]);
|
||
$device_model->name = htmlspecialchars($form_data["name"]);
|
||
$device_model->type = htmlspecialchars($form_data["type"]);
|
||
... | ... | |
|
||
$device_saved = $device_model->save();
|
||
|
||
$device_engineer_model->device_id = $device_model->id;
|
||
$device_engineer_model->user_id = $this->session->get('user_id');
|
||
$device_engineer_saved = TRUE;
|
||
|
||
$device_engineer_saved = $device_engineer_model->save();
|
||
foreach($engineers_data as $engineer_data) {
|
||
|
||
$device_engineer_model = new Device_engineer_Model();
|
||
$device_engineer_model->device_id = $device_model->id;
|
||
$device_engineer_model->user_id = $engineer_data;
|
||
|
||
$device_engineer_saved = $device_engineer_saved && $device_engineer_model->save();
|
||
|
||
}
|
||
|
||
unset($form_data);
|
||
//$device_model->save()
|
||
... | ... | |
// $view->content = new View('content', $data);
|
||
|
||
$view->content = new View('form');
|
||
$view->content->form = $form->html();
|
||
$view->content->link_back = html::anchor(url_lang::base().'devices/show_all/', url_lang::lang('texts.Back to devices list'));
|
||
$view->content->headline = url_lang::lang('texts.Create new devices');
|
||
$view->content->form = $form->html();
|
||
|
||
if($ssMember_id)
|
||
{
|
||
$view->content->link_back = html::anchor(url_lang::base().'devices/show_by_member/'.$ssMember_id, url_lang::lang('texts.Back to devices list of this member'));
|
||
$view->content->headline = url_lang::lang('texts.Create new devices for member').' '.$member->name;
|
||
}
|
||
else
|
||
{
|
||
$view->content->link_back = html::anchor(url_lang::base().'devices/show_all/', url_lang::lang('texts.Back to devices list'));
|
||
$view->content->headline = url_lang::lang('texts.Create new devices');
|
||
}
|
||
|
||
|
||
|
||
$view->footer = new View('base/footer');
|
||
|
freenetis/trunk/kohana/application/views/show_device.php | ||
---|---|---|
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.User') ?></th>
|
||
<td><?php echo $device->user->name.' '.$device->user->surname ?></td>
|
||
<td><?php echo html::anchor(url_lang::base().'users/show/'.$device->user->id,$device->user->name.' '.$device->user->surname); ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Device name') ?></th>
|
freenetis/trunk/kohana/application/views/members_add.php | ||
---|---|---|
<h2><?php echo url_lang::lang('texts.Add new member') ?></h2><br />
|
||
<?php echo html::anchor(url_lang::base().'members/show_all/',url_lang::lang('texts.Back to list of members.')) ?>
|
||
<?php echo html::anchor(url_lang::base().'members/show_all/',url_lang::lang('texts.Back to list of members')) ?>
|
||
<br /><br />
|
||
|
||
|
Také k dispozici: Unified diff
i18n/cs_CZ/texts.php - pridany nove preklady, nektere preklady byly zase
opraveny
controllers/members.php - u funkce show pridano ulozeni ID clena do
sessionu pro pozdejsi praci
controllers/devices.php - nejvice zmen, pridana moznost uvedeni
pripojujicich techniku, vsechny funkce rozdilne podle existence ID clena
v session (napr. pri zobrazeni urciteho zobrazeni funkci show a
existence ID clena v session navratovy odkaz smeruje na vypis zarizeni
clena a ne na vypis vsech zarizeni atd.)
views/show_devices.php - policko s jmenem uzivatele zmeneno na odkaz, ktery smeruje na profil daneho
uzivatele