Revize 398
Přidáno uživatelem Jiří Sviták před asi 15 roky(ů)
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'additional_contacts_infotext' => 'Další kontaktní informace',
|
||
'additional information' => 'Doplňkové informace',
|
||
'address' => 'Adresa',
|
||
'additional contacts successfully updated' => 'Další kontakty úspěšně uloženy',
|
||
'additional contacts have been successfully updated' => 'Další kontakty úspěšně uloženy',
|
||
'administrate additional contacts' => 'Přidávání/editace dalších kontaktních informací',
|
||
'administration' => 'Administrace',
|
||
'administration of additional contacts' => 'Přidávání/editace dalších kontaktních informací',
|
||
... | ... | |
'antenna' => 'Anténa',
|
||
'applicant' => 'Čekatel na členství',
|
||
'application password' => 'Aplikační heslo',
|
||
'are you sure you want to deduct all entrance fees' => 'Jste si jistí, že chcete strhnout všechny vstupní příspěvky',
|
||
'arrival' => 'Příchozí',
|
||
'assign' => 'Přiřadit',
|
||
'assign transfer' => 'Přiřadit převod',
|
||
... | ... | |
'deduction of entrance fees' => 'Stržení vstupních příspěvků',
|
||
'delete this contact' => 'Smazat tento kontakt',
|
||
'delete_member' => 'Smazat tohoto člena',
|
||
'delete_user' => 'Smazat tohoto uživatele',
|
||
'delete_work' => 'Smazat tuto práci',
|
||
'delete' => 'Smazat',
|
||
'delete wireless setting' => 'Smazat bezdrátové nastavení',
|
||
... | ... | |
'display member' => 'Zobraz člena',
|
||
'display user' => 'Zobraz uživatele',
|
||
'do transfer' => 'Proveď transakci',
|
||
'do you want to delete this device' => 'Chcete smazat toto zařízení',
|
||
'do you want to delete this interface' => 'Chcete smazat toto rozhraní',
|
||
'do you want to delete this ip address' => 'Chcete smazat tuto IP adresu',
|
||
'do you want to delete this port' => 'Chcete smazat tento port',
|
||
'do you want to delete this user' => 'Chcete smazat tohoto uživatele',
|
||
'do you want to delete this vlan interface' => 'Chcete smazat toto VLAN rozhraní',
|
||
'double entry account' => 'Podvojný účet',
|
||
'double-entry accounts' => 'Podvojné účty',
|
||
'due date' => 'Datum splatnosti',
|
||
... | ... | |
'error - not enough money on origin account' => 'Chyba - nedostatek peněz na zdrojovém účtě.',
|
||
'error - some fees have not been deducted' => 'Chyba - některé členské příspěvky nebyly strženy.',
|
||
'error: parameter ID is required!' => 'Chyba: parametr ID je povinný!',
|
||
'export members to xls file' => 'Exportovat členy do xls souboru',
|
||
'export to xls' => 'Exportovat do XLS',
|
||
'export to csv' => 'Exportovat do CSV',
|
||
'fee' => 'Poplatek',
|
||
'fee has been successfully added' => 'Poplatek byl úspěšně uložen',
|
||
'fee has been successfully deleted' => 'Poplatek byl úspěšně smazán',
|
||
... | ... | |
'previous transfer' => 'Předcházející převod',
|
||
'price' => 'Cena',
|
||
'price vat' => 'Cena s DPH',
|
||
'primary user of member cannot be deleted' => 'Primárního uživatele člena nelze smazat.',
|
||
'project account' => 'Účet projektu',
|
||
'project accounts' => 'Projektové účty',
|
||
'purchasers account' => 'Účet odběratelů',
|
||
... | ... | |
'unlogged user' => 'Nepřihlášený uživatel',
|
||
'update' => 'Upravit',
|
||
'upload bank transfers listing' => 'Uploaduj výpis z banky',
|
||
'user identification'=> 'Identifikace uživatele',
|
||
'user successfully added.'=> 'Uživatel úspěšně přidán',
|
||
'user successfully deleted.'=> 'Uživatel úspěšně smazán',
|
||
'user identification' => 'Identifikace uživatele',
|
||
'user successfully added' => 'Uživatel úspěšně přidán',
|
||
'user successfully deleted' => 'Uživatel úspěšně smazán',
|
||
'user successfully updated' => 'Uživatel úspěšně aktualizován',
|
||
'user' => 'Uživatel',
|
||
'user cannot be deleted, he has some dependent items in database' => 'Uživatel nelze smazat, má závislé objekty v databázi.',
|
||
'user identification' => 'Identifikace uživatele',
|
||
'user has been successfully added' => 'Uživatel byl úspěšně přidán.',
|
||
'user has been successfully deleted' => 'Uživatel byl úspěšně smazán.',
|
||
'user has been successfully updated' => 'Uživatel byl úspěšně upraven.',
|
||
'username already exists in database' => 'Uživatelské jméno již v databázi existuje',
|
||
'username or password do not match' => 'Uživatelské jméno nebo heslo nesouhlasí',
|
||
'username' => 'Login',
|
||
... | ... | |
'vlan interface has been successfully saved' => 'VLAN rozhraní bylo úspěšně uloženo.',
|
||
'vlan interface has been successfully updated' => 'VLAN rozhraní bylo úspěšně upraveno.',
|
||
'vlan interface name' => 'Název VLAN rozhraní',
|
||
'vlan interface still has at least one ip address' => 'VLAN rozhraní ještě nejméně jednu IP adresu.',
|
||
'vlan interface still has at least one ip address' => 'VLAN rozhraní má ještě nejméně jednu IP adresu.',
|
||
'vlan interfaces list' => 'Seznam VLAN rozhraní',
|
||
'vlan interfaces' => 'VLAN rozhraní',
|
||
'vlan has been successfully deleted' => 'VLAN byl úspěšně smazán.',
|
freenetis/trunk/kohana/application/models/user.php | ||
---|---|---|
public static $user = 2;
|
||
|
||
protected $belongs_to = array('member');
|
||
protected $has_many = array('contacts','jobs');
|
||
protected $has_many = array('contacts', 'jobs', 'devices');
|
||
|
||
public $arr_sql = array('id' => 'u.id', 'name' => 'u.name', 'surname' => 'u.surname', 'email' => 'u.email', 'phone' => 'u.phone', 'login' => 'u.login', 'member_name' => 'm.name');
|
||
|
||
... | ... | |
{
|
||
return self::$db->query("SELECT id, CONCAT(name,' ',surname) as username FROM users WHERE CONCAT(name,' ',surname) LIKE '" . $user . "%' GROUP BY CONCAT(name,' ',surname)");
|
||
}
|
||
|
||
/**
|
||
* Function searches for items dependent on given user. Used for deleting user.
|
||
* @param $user_id
|
||
* @return unknown_type
|
||
*/
|
||
public function count_dependent_items($user_id)
|
||
{
|
||
return self::$db->query("
|
||
SELECT COUNT(*) AS total FROM
|
||
(
|
||
SELECT d.id
|
||
FROM devices d
|
||
WHERE d.user_id = $user_id
|
||
UNION
|
||
SELECT j.id
|
||
FROM jobs j
|
||
WHERE j.user_id = $user_id
|
||
UNION
|
||
SELECT da.id
|
||
FROM device_admins da
|
||
WHERE da.user_id = $user_id
|
||
UNION
|
||
SELECT de.id
|
||
FROM device_engineers de
|
||
WHERE de.user_id = $user_id
|
||
UNION
|
||
SELECT c.id
|
||
FROM contacts c
|
||
WHERE c.user_id = $user_id
|
||
) di
|
||
")->current()->total;
|
||
}
|
||
}
|
||
|
||
?>
|
freenetis/trunk/kohana/application/controllers/members.php | ||
---|---|---|
$grid->add_new_button(url_lang::base().'members/add', url_lang::lang('texts.Add new member'));
|
||
// xls export of members
|
||
if ($this->acl_check_view(get_class($this), 'members'))
|
||
$grid->add_new_button(url_lang::base().'members/xls_export', url_lang::lang('texts.Export members to xls file'));
|
||
$grid->add_new_button(url_lang::base().'members/xls_export', url_lang::lang('texts.Export to XLS'));
|
||
// csv export of members
|
||
if ($this->acl_check_view(get_class($this), 'members'))
|
||
$grid->add_new_button(url_lang::base().'members/csv_export', url_lang::lang('texts.Export to CSV'));
|
||
$grid->order_field('id')->label('ID');
|
||
$grid->order_field('registration')->label(url_lang::lang('texts.Reg'))->bool(array(url_lang::lang('texts.No'),url_lang::lang('texts.Yes')))->class('center');
|
||
$grid->order_field('name')->label(url_lang::lang('texts.Name'));
|
||
... | ... | |
$user_grid->action_field('id') ->label(url_lang::lang('texts.User'))->url(url_lang::base().'users/show')->action(url_lang::lang('texts.Show'));
|
||
if($this->acl_check_edit('Users_Controller','users',$member_id))
|
||
$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_delete('Users_Controller','users',$member_id))
|
||
$user_grid->action_field('id') ->label(url_lang::lang('texts.User'))->url(url_lang::base().'users/delete')->action(url_lang::lang('texts.Delete'))->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this user').'\');"');
|
||
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))
|
||
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);
|
||
|
||
// membership interrupts
|
||
... | ... | |
|
||
|
||
/**
|
||
* @author Jiri Svitak
|
||
* Export list of members to xls file. Requires library PEAR.
|
||
* @return unknown_type
|
||
*/
|
||
... | ... | |
$workbook->close();
|
||
} // end of xls_export
|
||
|
||
|
||
/**
|
||
* @author Jiri Svitak
|
||
* Function exports list of members to csv file. Rows are separated by newlines and it columns by semicolon.
|
||
* @return unknown_type
|
||
*/
|
||
function csv_export()
|
||
{
|
||
// access rights
|
||
if (!$this->acl_check_view(get_class($this),'members'))
|
||
Controller::Error(1);
|
||
// creates database member model
|
||
$member_model = new Member_Model();
|
||
$members = $member_model->get_all_members_to_export();
|
||
// set content header
|
||
header('Content-type: application/csv');
|
||
$filename = url_lang::lang('texts.Members').'.csv';
|
||
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||
$first = true;
|
||
// yes and no for registration
|
||
$yes = url_lang::lang('texts.yes');
|
||
$no = url_lang::lang('texts.no');
|
||
// this foreach goes through rows
|
||
foreach ($members as $line)
|
||
{
|
||
// first headers of columns will be written
|
||
if ($first)
|
||
{
|
||
foreach ($line as $key => $value)
|
||
{
|
||
$title = url_lang::lang('texts.'.$key);
|
||
if ($title == 'ID')
|
||
$title = 'Číslo';
|
||
echo '"'.$title.'";';
|
||
//echo $key.';';
|
||
}
|
||
echo "\n";
|
||
$first = false;
|
||
}
|
||
// this foreach writes line
|
||
foreach ($line as $key => $value)
|
||
{
|
||
// special case - registration
|
||
if ($key == 'registration')
|
||
{
|
||
if ($value == 1)
|
||
$value = $yes;
|
||
else
|
||
$value = $no;
|
||
}
|
||
echo '"'.$value.'";';
|
||
}
|
||
echo "\n";
|
||
}
|
||
}
|
||
|
||
function get_streets()
|
||
{
|
||
$q = strtolower($this->input->get('q'));
|
freenetis/trunk/kohana/application/controllers/ifaces.php | ||
---|---|---|
if ($this->acl_check_edit('Devices_Controller','iface'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Interface'))->url(url_lang::base().'ifaces/edit')->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller','iface'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Interface'))->url(url_lang::base().'ifaces/delete') ->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Interface'))->url(url_lang::base().'ifaces/delete') ->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this interface').'\');"');
|
||
$grid->datasource( $query );
|
||
$view = new View('template');
|
||
$view->header = new View('base/header');
|
||
... | ... | |
if ($this->acl_check_edit('Devices_Controller','ip_address',$member_id))
|
||
$grid_ip_addresses->action_field('id')->label(url_lang::lang('texts.IP address')) ->url(url_lang::base().'ip_addresses/edit') ->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller','ip_address',$member_id))
|
||
$grid_ip_addresses->action_field('id')->label(url_lang::lang('texts.IP address')) ->url(url_lang::base().'ip_addresses/delete') ->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid_ip_addresses->action_field('id')->label(url_lang::lang('texts.IP address')) ->url(url_lang::base().'ip_addresses/delete') ->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this ip address').'\');"');
|
||
$grid_ip_addresses->datasource( $query );
|
||
|
||
// vlan interfaces
|
||
... | ... | |
if ($this->acl_check_edit('Devices_Controller','vlan_iface',$member_id))
|
||
$grid_VLAN_ifaces->action_field('id')->label(url_lang::lang('texts.VLAN interface'))->url(url_lang::base().'vlan_ifaces/edit') ->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller', 'vlan_iface'))
|
||
$grid_VLAN_ifaces->action_field('id')->label(url_lang::lang('texts.VLAN interface'))->url(url_lang::base().'vlan_ifaces/delete') ->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid_VLAN_ifaces->action_field('id')->label(url_lang::lang('texts.VLAN interface'))->url(url_lang::base().'vlan_ifaces/delete') ->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this vlan interface').'\');"');
|
||
$grid_VLAN_ifaces->datasource( $query );
|
||
$view = new View('template');
|
||
$view->header = new View('base/header');
|
freenetis/trunk/kohana/application/controllers/users.php | ||
---|---|---|
{
|
||
url::redirect(url_lang::base().'users/show_all');
|
||
}
|
||
|
||
function show_all($limit_results = 200, $order_by = 'id', $order_by_direction = 'asc', $page_word = null, $page = 1)
|
||
|
||
/**
|
||
* Function shows all users.
|
||
* @param $limit_results
|
||
* @param $order_by
|
||
* @param $order_by_direction
|
||
* @param $page_word
|
||
* @param $page
|
||
* @return unknown_type
|
||
*/
|
||
function show_all($limit_results = 500, $order_by = 'id', $order_by_direction = 'asc', $page_word = null, $page = 1)
|
||
{
|
||
|
||
if (!$this->acl_check_view(get_class($this),'users'))
|
||
... | ... | |
//'use_paginator' => false,
|
||
//'use_selector' => false,
|
||
'current' => $limit_results, // current selected 'records_per_page' value
|
||
'selector_increace' => 200, // increace
|
||
'selector_min' => 200, // minimum where selector start
|
||
'selector_increace' => 500, // increace
|
||
'selector_min' => 500, // minimum where selector start
|
||
'selector_max_multiplier' => 10,
|
||
'base_url' => Config::item('locale.lang').'/users/show_all/'.$limit_results.'/'.$order_by.'/'.$order_by_direction ,
|
||
'uri_segment' => 'page', // pass a string as uri_segment to trigger former 'label' functionality
|
||
... | ... | |
$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_view(get_class($this),'users'))
|
||
$grid->action_field('member_id') ->label(url_lang::lang('texts.Member')) ->url(url_lang::base().'members/show') ->action(url_lang::lang('texts.Show'));
|
||
// user never should be deleted
|
||
// $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').'\');"');
|
||
//if ($this->acl_check_delete(get_class($this),'users'))
|
||
// $grid->action_field('id')->label(url_lang::lang('texts.User'))->url(url_lang::base().'users/delete')->action(url_lang::lang('texts.Delete'))->script('onclick="return potvrd(\''.url_lang::lang('texts.delete_user').'\');"');
|
||
$grid->datasource($query);
|
||
|
||
$view = new View('template');
|
||
... | ... | |
$view->render(TRUE);
|
||
} // end of show_all function
|
||
|
||
|
||
|
||
/**
|
||
* Function shows users of member.
|
||
* @param $member_id
|
||
* @param $limit_results
|
||
* @param $order_by
|
||
* @param $order_by_direction
|
||
* @param $page_word
|
||
* @param $page
|
||
* @return unknown_type
|
||
*/
|
||
function show_by_member($member_id = NULL, $limit_results = 200, $order_by = 'id', $order_by_direction = 'ASC', $page_word = null, $page = 1)
|
||
{
|
||
|
||
... | ... | |
$grid->action_field('id') ->label(url_lang::lang('texts.User')) ->url(url_lang::base().'users/show') ->action(url_lang::lang('texts.Show'));
|
||
if ($this->acl_check_edit(get_class($this),'users',$member_id))
|
||
$grid->action_field('id') ->label(url_lang::lang('texts.User')) ->url(url_lang::base().'users/edit') ->action(url_lang::lang('texts.Edit'));
|
||
// user never should be deleted
|
||
if ($this->acl_check_delete(get_class($this),'users',$member_id))
|
||
// $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').'\');"');
|
||
$grid->datasource($query);
|
||
|
||
... | ... | |
}
|
||
}
|
||
|
||
|
||
/**
|
||
* Function deletes user.
|
||
* @param $user_id
|
||
* @return unknown_type
|
||
*/
|
||
function delete($user_id = NULL)
|
||
{
|
||
if (isset($user_id))
|
||
{
|
||
$user_model=new User_Model($user_id);
|
||
$member_id = $user_model->member_id;
|
||
|
||
// access control
|
||
if (!$this->acl_check_delete(get_class($this),'users',$member_id)) Controller::error(1);
|
||
|
||
// access rights
|
||
if (!$this->acl_check_delete(get_class($this), 'users', $member_id))
|
||
Controller::error(1);
|
||
// link to location after delete
|
||
$linkback = url_lang::base()."members/show/$member_id";
|
||
// user of "member" type cannot be deleted
|
||
if ($user_model->type == User_Model::$member)
|
||
{
|
||
$this->session->set_flash('message', url_lang::lang('texts.Primary user of member cannot be deleted.'));
|
||
url::redirect($linkback);
|
||
}
|
||
if ($user_model->count_dependent_items($user_id) > 0)
|
||
{
|
||
$this->session->set_flash('message', url_lang::lang('texts.User cannot be deleted, he has some dependent items in database.'));
|
||
url::redirect($linkback);
|
||
}
|
||
if ($user_model->delete())
|
||
{
|
||
$this->session->set_flash('message', url_lang::lang('texts.User successfully deleted.'));
|
||
$this->session->set_flash('message', url_lang::lang('texts.User has been successfully deleted.'));
|
||
}
|
||
else
|
||
{
|
||
$this->session->set_flash('message', url_lang::lang('texts.Error - cant delete user.'));
|
||
}
|
||
url::redirect(url_lang::base().'members/show/'.$member_id);
|
||
url::redirect($linkback);
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
}
|
||
} // end of delete function
|
||
|
||
/**
|
||
* Function edits user.
|
||
* @param $user_id
|
||
* @return unknown_type
|
||
*/
|
||
function edit($user_id = NULL)
|
||
{
|
||
if (isset($user_id))
|
||
... | ... | |
|
||
if ($user_data->save())
|
||
{
|
||
$this->session->set_flash('message', url_lang::lang('texts.User successfully updated.'));
|
||
$this->session->set_flash('message', url_lang::lang('texts.User has been successfully updated.'));
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
$view->footer = new View('base/footer');
|
||
$view->header->menu = Controller::render_menu();
|
||
$view->header->title = url_lang::lang('texts.Display member');
|
||
// $view->header->other_styles = html::stylesheet('media/css/forms.css');
|
||
$view->content->form = $form->html();
|
||
$view->content->user_data = $user_model;
|
||
$view->render(TRUE);
|
||
... | ... | |
}
|
||
} // end of edit function
|
||
|
||
/**
|
||
* Function shows user.
|
||
* @param $user_id
|
||
* @return unknown_type
|
||
*/
|
||
function show($user_id = NULL)
|
||
{
|
||
if (isset($user_id))
|
||
... | ... | |
|
||
} // end of show function
|
||
|
||
/**
|
||
* Function adds user.
|
||
* @param $member_id
|
||
* @return unknown_type
|
||
*/
|
||
function add($member_id = null)
|
||
{
|
||
|
||
... | ... | |
}
|
||
$user_data->type = User_Model::$user;
|
||
$user_data->member_id = $member_id;
|
||
$user_data->application_password = security::generate_password();
|
||
$user_data->application_password = security::generate_password();
|
||
$saved = $user_data->save();
|
||
Controller::insert_phpgacl($user_data->id,$user_data->surname.' '.$user_data->name,$user_data->login,'user');
|
||
|
||
... | ... | |
|
||
if ($saved)
|
||
{
|
||
$this->session->set_flash('message', url_lang::lang('texts.User successfully added.'));
|
||
$this->session->set_flash('message', url_lang::lang('texts.User has been successfully added.'));
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
$view->footer = new View('base/footer');
|
||
$view->header->menu = Controller::render_menu();
|
||
$view->header->title = url_lang::lang('texts.Add new user');
|
||
// $view->header->other_styles = html::stylesheet('media/css/forms.css');
|
||
$view->content->member_id = $member_id;
|
||
$view->content->form = $form->html();
|
||
|
||
... | ... | |
}
|
||
if ($issaved)
|
||
{
|
||
$this->session->set_flash('message', url_lang::lang('texts.Additional contacts successfully updated'));
|
||
$this->session->set_flash('message', url_lang::lang('texts.Additional contacts have been successfully updated'));
|
||
}
|
||
else
|
||
{
|
freenetis/trunk/kohana/application/controllers/ports.php | ||
---|---|---|
if ($this->acl_check_edit('Devices_Controller','port'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Port'))->url(url_lang::base().'ports/edit')->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller','port'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Port'))->url(url_lang::base().'ports/delete')->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Port'))->url(url_lang::base().'ports/delete')->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this port').'\');"');
|
||
$grid->datasource( $query );
|
||
$this->template->content = $grid;
|
||
|
freenetis/trunk/kohana/application/controllers/transfers.php | ||
---|---|---|
if ($this->acl_check_edit('Accounts_Controller', 'transfers'))
|
||
$grid->add_new_button(url_lang::base().'transfers/deduct_fees', url_lang::lang('texts.Deduction of member fees'));
|
||
if ($this->acl_check_edit('Accounts_Controller', 'transfers'))
|
||
$grid->add_new_button(url_lang::base().'transfers/deduct_entrance_fees', url_lang::lang('texts.Deduction of entrance fees'));
|
||
$grid->add_new_button(url_lang::base().'transfers/deduct_entrance_fees', url_lang::lang('texts.Deduction of entrance fees'), array('onclick' => 'return potvrd(\''.url_lang::lang('texts.Are you sure you want to deduct all entrance fees').'\')'));
|
||
$grid->order_field('id')->label('ID');
|
||
$grid->field('origin')->label(url_lang::lang('texts.Origin account'));
|
||
$grid->order_field('o_attribute')->label(url_lang::lang('texts.Type'));
|
||
... | ... | |
if (isset($member_id))
|
||
{
|
||
$member = new Member_Model($member_id);
|
||
$transfer->origin_id = $account_model->get_credit_account_of_member($member_id);
|
||
$ca = $account_model->get_credit_account_of_member($member_id);
|
||
$transfer->origin_id = $ca->id;
|
||
$transfer->destination_id = $infrastructure->id;
|
||
$transfer->datetime = $member->entrance_date;
|
||
$transfer->creation_datetime = $creation_datetime;
|
freenetis/trunk/kohana/application/controllers/vlan_ifaces.php | ||
---|---|---|
if ($this->acl_check_edit('Devices_Controller','vlan_iface'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.VLAN interface'))->url(url_lang::base().'vlan_ifaces/edit') ->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller','vlan_iface'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.VLAN interface'))->url(url_lang::base().'vlan_ifaces/delete') ->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid->action_field('id')->label(url_lang::lang('texts.VLAN interface'))->url(url_lang::base().'vlan_ifaces/delete') ->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this vlan interface').'\');"');
|
||
$grid->datasource( $query );
|
||
$this->template->content = $grid;
|
||
|
freenetis/trunk/kohana/application/controllers/ip_addresses.php | ||
---|---|---|
if ($this->acl_check_edit('Devices_Controller','ip_address'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.IP address'))->url(url_lang::base().'ip_addresses/edit')->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller','ip_address'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.IP address'))->url(url_lang::base().'ip_addresses/delete')->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid->action_field('id')->label(url_lang::lang('texts.IP address'))->url(url_lang::base().'ip_addresses/delete')->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this ip address').'\');"');
|
||
$grid->datasource( $query );
|
||
|
freenetis/trunk/kohana/application/controllers/devices.php | ||
---|---|---|
if ($this->acl_check_edit(get_class($this),'devices'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Device'))->url(url_lang::base().'devices/edit') ->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller', 'devices'))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Device'))->url(url_lang::base().'devices/delete') ->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Device'))->url(url_lang::base().'devices/delete') ->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this device').'\');"');
|
||
$grid->datasource( $query );
|
||
$view = new View('template');
|
||
$view->header = new View('base/header');
|
||
... | ... | |
if ($this->acl_check_edit(get_class($this),'devices',$member_id))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Device'))->url(url_lang::base().'devices/edit')->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller', 'devices', $member_id))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Delete'))->url(url_lang::base().'devices/delete')->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Delete'))->url(url_lang::base().'devices/delete')->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this device').'\');"');
|
||
$grid->datasource($query);
|
||
|
||
$view = new View('template');
|
||
... | ... | |
if ($this->acl_check_edit(get_class($this),'iface',$member_id))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Interface')) ->url(url_lang::base().'ifaces/edit')->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if ($this->acl_check_delete('Devices_Controller', 'iface', $member_id))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Interface')) ->url(url_lang::base().'ifaces/delete')->action(url_lang::lang('texts.Delete'))->class('center');;
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Interface')) ->url(url_lang::base().'ifaces/delete')->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this interface').'\');"');
|
||
$grid->datasource($query);
|
||
$grid_ifaces = $grid;
|
||
unset($grid);
|
||
... | ... | |
if ($this->acl_check_edit(get_class($this),'port',$member_id))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Port'))->url(url_lang::base().'ports/edit')->action(url_lang::lang('texts.Edit'))->class('center');
|
||
if($this->acl_check_delete('Devices_Controller', 'port', $member_id))
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Port'))->url(url_lang::base().'ports/delete')->action(url_lang::lang('texts.Delete'))->class('center');
|
||
$grid->action_field('id')->label(url_lang::lang('texts.Port'))->url(url_lang::base().'ports/delete')->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this port').'\');"');
|
||
$grid->datasource( $query );
|
||
$grid_ports = $grid;
|
||
|
freenetis/trunk/kohana/application/libraries/Grid.php | ||
---|---|---|
$this->$key = $value;
|
||
}
|
||
|
||
public function add_new_button($uri, $label, $separator = '')
|
||
public function add_new_button($uri, $label, $options = array())
|
||
{
|
||
static $first_add_button = true;
|
||
$this->template->add_button = substr($this->template->add_button, 0, strlen($this->template->add_button)-2);
|
||
... | ... | |
$first_add_button = false;
|
||
else
|
||
$this->template->add_button .= '| ';
|
||
$this->template->add_button .= html::anchor($uri, $label).' </span>'.$separator;
|
||
$this->template->add_button .= html::anchor($uri, $label, $options).' </span>';
|
||
}
|
||
|
||
|
Také k dispozici: Unified diff
Pridano potvrzovani mazani pomoci dotazovani. Pridan export clenu do CSV.