Revize 1497
Přidáno uživatelem David Raška před více než 12 roky(ů)
freenetis/branches/network/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'error - cant parse invoice' => 'Chyba - nelze parsovat fakturu.',
|
||
'error - cant change voicemail' => 'Chyba - nelze změnit hlasovou schránku.',
|
||
'error - cant remove interface' => 'Chyba - nelze odstranit rozhraní.',
|
||
'error - cant remove vlan' => 'Chyba - nelze odstranit vlan.',
|
||
'error - cant restore membership' => 'Chyba - nelze obnovit členství.',
|
||
'error - cant set redirection' => 'Chyba - nelze nastavit přesměrování.',
|
||
'error - cant update account' => 'Chyba - nelze upravit účet.',
|
||
... | ... | |
'vlan can be only tagged or untagged' => 'VLAN může být buď tagovaný nebo netagovaný.',
|
||
'vlan count' => 'Počet VLANů',
|
||
'vlan detail' => 'Detail VLANu',
|
||
'vlan has been successfully removed' => 'VLAN byl úspěšně odstraněn.',
|
||
'vlan interface' => 'VLAN rozhraní',
|
||
'vlan interface detail' => 'Detail VLAN rozhraní',
|
||
'vlan interface has been successfully deleted' => 'VLAN rozhraní bylo úspěšně smazáno.',
|
freenetis/branches/network/application/helpers/callback.php | ||
---|---|---|
*/
|
||
public static function email_subject_field ($item, $name)
|
||
{
|
||
echo "<span class='help' title='".$item->body."'>".$item->subject."</span>";
|
||
$body = preg_replace('<(br|BR)( ?\/)?>', '\n', $item->body);
|
||
$body = strip_tags($body);
|
||
echo "<span class='help' title='".$body."'>".$item->subject."</span>";
|
||
}
|
||
|
||
/**
|
freenetis/branches/network/application/helpers/condition.php | ||
---|---|---|
{
|
||
return ($item->special_type_id != Fee_Model::MEMBERSHIP_INTERRUPT);
|
||
}
|
||
|
||
/**
|
||
* Check if current row is default vlan.
|
||
*
|
||
* @author David Raska
|
||
* @param object $item Data row
|
||
* @return boolean
|
||
*/
|
||
public static function is_not_default_vlan($item)
|
||
{
|
||
return ($item->port_vlan != 1);
|
||
}
|
||
}
|
freenetis/branches/network/application/models/iface.php | ||
---|---|---|
*/
|
||
public function get_wireless_mode($mode = NULL)
|
||
{
|
||
if (!$mode && isset($this))
|
||
if (!$mode && isset($this->id))
|
||
{
|
||
$mode = $this->wireless_mode;
|
||
}
|
freenetis/branches/network/application/models/vlan.php | ||
---|---|---|
", array( __('Port') . ' ', Iface_Model::TYPE_PORT, $vlan_id, $vlan_id));
|
||
}
|
||
|
||
/**
|
||
* Gets all VLANs of interface
|
||
*
|
||
* @param integer $iface_id
|
||
* @return Mysql_Result
|
||
*/
|
||
public function get_all_vlans_of_iface($iface_id = null)
|
||
{
|
||
// query
|
||
return $this->db->query("
|
||
SELECT v.name, v.tag_802_1q, iv.tagged, iv.port_vlan, iv.vlan_id
|
||
FROM vlans v
|
||
LEFT JOIN ifaces_vlans iv ON iv.vlan_id = v.id
|
||
WHERE iv.iface_id = ?
|
||
GROUP BY v.id
|
||
", $iface_id);
|
||
}
|
||
|
||
public function get_default_vlan_of_interface($iface_id = null)
|
||
{
|
||
// query
|
||
$result = $this->db->query("
|
||
SELECT v.name, v.id
|
||
FROM vlans v
|
||
LEFT JOIN ifaces_vlans iv ON iv.vlan_id = v.id
|
||
WHERE iv.iface_id = ?
|
||
AND iv.port_vlan = 1
|
||
GROUP BY v.id
|
||
", $iface_id);
|
||
|
||
if ($result)
|
||
return $result->current();
|
||
else
|
||
return NULL;
|
||
}
|
||
|
||
}
|
freenetis/branches/network/application/models/ifaces_vlan.php | ||
---|---|---|
AND `iface_id` = ?
|
||
", $bridge_iface_id, $iface_id);
|
||
}
|
||
|
||
/**
|
||
* Function removes vlan from port
|
||
*
|
||
* @param integer $port_iface_id
|
||
* @param integer $vlan_id
|
||
*/
|
||
public function remove_vlan_from_port($port_iface_id = null, $vlan_id = null)
|
||
{
|
||
return $this->db->query("
|
||
DELETE
|
||
FROM `ifaces_vlans`
|
||
WHERE `vlan_id` = ?
|
||
AND `iface_id` = ?
|
||
", $vlan_id, $port_iface_id);
|
||
}
|
||
}
|
freenetis/branches/network/application/controllers/ifaces.php | ||
---|---|---|
$view->content = new View('ifaces/show');
|
||
|
||
$detail = '';
|
||
$port_vlan = '';
|
||
|
||
switch ($iface->type)
|
||
{
|
||
... | ... | |
$grid->datasource($ifaces);
|
||
$detail = $grid;
|
||
break;
|
||
case Iface_Model::TYPE_PORT:
|
||
$vl = new Vlan_Model();
|
||
$vlans = $vl->get_all_vlans_of_iface($iface_id);
|
||
$port_vlan = $vl->get_default_vlan_of_interface($iface_id);
|
||
|
||
// grid
|
||
$grid = new Grid('devices', null, array
|
||
(
|
||
'use_paginator' => false,
|
||
'use_selector' => false,
|
||
'total_items' => count($vlans)
|
||
));
|
||
|
||
$grid->field('name')
|
||
->label('VLAN name');
|
||
|
||
$grid->field('tag_802_1q')
|
||
->class('center');
|
||
|
||
$grid->callback_field('tagged')
|
||
->callback('callback::boolean')
|
||
->label('Tagged VLAN')
|
||
->class('center');
|
||
|
||
$actions = $grid->grouped_action_field();
|
||
|
||
$actions->add_action('vlan_id')
|
||
->icon_action('show')
|
||
->url('vlans/show')
|
||
->class('popup_link');
|
||
|
||
$actions->add_conditional_action('vlan_id')
|
||
->icon_action('delete')
|
||
->condition('is_not_default_vlan')
|
||
->url('vlans/remove_from_port/'.$iface->id)
|
||
->class('delete_link');
|
||
|
||
|
||
$grid->datasource($vlans);
|
||
$detail = $grid;
|
||
break;
|
||
};
|
||
|
||
$view->content->iface = $iface;
|
||
$view->content->detail = $detail;
|
||
$view->content->headline = $headline;
|
||
$view->content->port_vlan = $port_vlan;
|
||
$view->render(TRUE);
|
||
} // end of show
|
||
|
freenetis/branches/network/application/controllers/email_queues.php | ||
---|---|---|
$sql_offset, (int)$limit_results, $order_by, $order_by_direction,
|
||
$filter_form->as_sql()
|
||
);
|
||
|
||
$sql = $filter_form->as_sql();
|
||
if (!empty($sql)) {
|
||
echo $email_queue_model->get_last_sql_query();
|
||
//die;
|
||
}
|
||
// headline
|
||
$headline = __('List of all sent e-mails');
|
||
|
freenetis/branches/network/application/controllers/vlans.php | ||
---|---|---|
}
|
||
|
||
/**
|
||
* Function removes vlan from port
|
||
*
|
||
* @param integer $bridge_iface_id
|
||
* @param integer $iface_id
|
||
*/
|
||
public function remove_from_port($port_iface_id = null, $vlan_id = null)
|
||
{
|
||
// bad parameter
|
||
if (!is_numeric($port_iface_id) || !is_numeric($vlan_id))
|
||
{
|
||
Controller::warning(PARAMETER);
|
||
}
|
||
|
||
$iface = new Iface_Model($port_iface_id);
|
||
$vlan = new Vlan_Model($vlan_id);
|
||
|
||
// iface doesn't exist
|
||
if (!$iface->id || !$vlan->id)
|
||
{
|
||
Controller::error(RECORD);
|
||
}
|
||
|
||
//remove iface from bridge
|
||
$iv = new Ifaces_vlan_Model();
|
||
|
||
$delete_state = $iv->remove_vlan_from_port($port_iface_id,$vlan_id);
|
||
|
||
if ($delete_state)
|
||
{
|
||
status::success('VLAN has been successfully removed.');
|
||
}
|
||
else
|
||
{
|
||
status::error('Error - cant remove VLAN.');
|
||
}
|
||
|
||
$this->redirect(Path::instance()->previous());
|
||
}
|
||
|
||
/**
|
||
* Callback function to validate tag 802.1Q
|
||
*
|
||
* @author Michal Kliment
|
||
... | ... | |
$input->add_error('required', __('There is already some VLAN with this tag.'));
|
||
}
|
||
}
|
||
|
||
|
||
}
|
freenetis/branches/network/application/views/ifaces/show.php | ||
---|---|---|
<th><?php echo __('Device name') ?></th>
|
||
<td><?php echo html::anchor('devices/show/'.$iface->device->id, $iface->device->name)?></td>
|
||
</tr>
|
||
<?php if (isset($port_vlan->id)): ?>
|
||
<tr>
|
||
<th><?php echo __('Port VLAN ').help::hint('port_vlan') ?></th>
|
||
<td><?php echo html::anchor(url_lang::base().'vlans/show/'.$port_vlan->id,$port_vlan->name) ?></td>
|
||
</tr>
|
||
<?php endif; ?>
|
||
<?php if (Iface_Model::type_has_mac_address($iface->type)): ?>
|
||
<tr>
|
||
<th><?php echo __('MAC address') ?></th>
|
Také k dispozici: Unified diff
Opravy:
- Oprava zobrazeni predmetu emailu
Upravy:
- Pridany detaily o portu k rozhrani