Revize 1210
Přidáno uživatelem Michal Kliment před asi 13 roky(ů)
freenetis/branches/testing/application/models/iface.php | ||
---|---|---|
* @param int $device_id
|
||
* @return MySQL iterator object
|
||
*/
|
||
public function get_all_ifaces_of_device($device_id)
|
||
public function get_all_ifaces_of_device($device_id, $duplicates = FALSE)
|
||
{
|
||
$group_by = '';
|
||
|
||
// removes duplicates
|
||
if (!$duplicates)
|
||
$group_by = 'GROUP BY i.id';
|
||
|
||
return $this->db->query("
|
||
SELECT i.id, i.id AS iface_id, i.segment_id, sg.name AS segment_name,
|
||
i.mac, i.name, i.comment, ip.subnet_id, sb.name as subnet_name,
|
||
... | ... | |
LEFT JOIN segments sg ON i.segment_id = sg.id
|
||
LEFT JOIN subnets sb ON ip.subnet_id = sb.id
|
||
WHERE i.device_id = ?
|
||
$group_by
|
||
ORDER BY i.name
|
||
", array($device_id));
|
||
}
|
freenetis/branches/testing/application/controllers/installation.php | ||
---|---|---|
$bank_fees_account->name = $form_data["account_name"].' - '.__('Bank fees');
|
||
$bank_fees_account->account_attribute_id = Account_attribute_Model::$bank_fees;
|
||
$bank_fees_account->comment = __('Bank fees');
|
||
$bank_fees_account->add($bank_account);
|
||
$bank_fees_account->save();
|
||
$bank_fees_account->add($bank_account);
|
||
|
||
// double-entry account of bank interests
|
||
$bank_interests_account = new Account_Model();
|
||
... | ... | |
$bank_interests_account->name = $form_data["account_name"].' - '.__('Bank interests');
|
||
$bank_interests_account->account_attribute_id = Account_attribute_Model::$bank_interests;
|
||
$bank_interests_account->comment = __('Bank interests');
|
||
$bank_interests_account->add($bank_account);
|
||
$bank_interests_account->save();
|
||
$bank_interests_account->add($bank_account);
|
||
|
||
// other double entry accounts independent of bank account
|
||
// double-entry cash account
|
freenetis/branches/testing/application/controllers/bank_accounts.php | ||
---|---|---|
$doubleentry_bank_account->name = $form_data["account_name"];
|
||
$doubleentry_bank_account->account_attribute_id = Account_attribute_Model::$bank;
|
||
$doubleentry_bank_account->comment = __('Bank accounts');
|
||
$doubleentry_bank_account->add($bank_account);
|
||
$doubleentry_bank_account->save();
|
||
$doubleentry_bank_account->add($bank_account);
|
||
// double-entry account of bank fees
|
||
$bank_fees_account = new Account_Model();
|
||
$bank_fees_account->member_id = $member_id;
|
||
$bank_fees_account->name = $form_data["account_name"].' - '.__('Bank fees');
|
||
$bank_fees_account->account_attribute_id = Account_attribute_Model::$bank_fees;
|
||
$bank_fees_account->comment = __('Bank fees');
|
||
$bank_fees_account->save();
|
||
$bank_fees_account->add($bank_account);
|
||
$bank_fees_account->add($bank_account);
|
||
$bank_fees_account->save();
|
||
// double-entry account of bank interests
|
||
$bank_interests_account = new Account_Model();
|
||
$bank_interests_account->member_id = $member_id;
|
||
$bank_interests_account->name = $form_data["account_name"].' - '.__('Bank interests');
|
||
$bank_interests_account->account_attribute_id = Account_attribute_Model::$bank_interests;
|
||
$bank_interests_account->comment = __('Bank interests');
|
||
$bank_interests_account->add($bank_account);
|
||
$bank_interests_account->save();
|
||
$bank_interests_account->add($bank_account);
|
||
}
|
||
// redirection
|
||
url::redirect(url_lang::base().'bank_accounts/show_all');
|
freenetis/branches/testing/application/controllers/devices.php | ||
---|---|---|
|
||
$this->selector = new Selector (array(
|
||
'selector_max_multiplier' => 20,
|
||
'current' => $limit_results
|
||
'current' => $limit_results,
|
||
'base_url' => Config::get('lang').'/devices/show_by_user/'.$user->id.'/'.
|
||
$limit_results.'/'.$order_by.'/'.$order_by_direction.'/'.
|
||
$page_word.'/'.$page.'#user-devices-advanced-grid'
|
||
));
|
||
|
||
$this->pagination = new Pagination (array(
|
||
'base_url' => Config::get('lang').'/devices/show_by_user/'.$user->id.'/'.
|
||
$limit_results.'/'.$order_by.'/'.$order_by_direction,
|
||
$limit_results.'/'.$order_by.'/'.$order_by_direction.'/'.
|
||
$page_word.'/'.$page.'#user-devices-advanced-grid',
|
||
'total_items' => $total_devices,
|
||
'items_per_page' => $limit_results,
|
||
'uri_segment' => 'page'
|
||
... | ... | |
'grids' => array()
|
||
);
|
||
|
||
$ifaces = $iface_model->get_all_ifaces_of_device($device->id);
|
||
$ifaces = $iface_model->get_all_ifaces_of_device($device->id, TRUE);
|
||
|
||
$grid = new Grid(url_lang::base().'devices', null, array
|
||
(
|
freenetis/branches/testing/application/libraries/Selector.php | ||
---|---|---|
protected $selector_min = 10;
|
||
protected $selector_max_multiplier = 5;
|
||
protected $current = 10;
|
||
protected $base_url = NULL;
|
||
|
||
/**
|
||
* Constructs the Selector object.
|
||
... | ... | |
public function create($style = NULL)
|
||
{
|
||
$style = (isset($style)) ? $style : 'default';
|
||
|
||
$view = new View('selector/'.$style);
|
||
|
||
$view->base_url = ($this->base_url) ? $this->base_url : url_lang::current();
|
||
|
||
$sel_values_array = array();
|
||
for ($i=0;$i<$this->selector_max_multiplier;$i++)
|
||
{
|
||
$sel_values_array[($i * $this->selector_increace)+$this->selector_min] = ($i * $this->selector_increace)+$this->selector_min;
|
||
}
|
||
$view = new View('selector/'.$style);
|
||
$view->sel_values_array = $sel_values_array;
|
||
$view->current = $this->current;
|
||
return $view->render();
|
freenetis/branches/testing/application/views/selector/default.php | ||
---|---|---|
<p class="pagination">
|
||
<?php echo form::open('', array('class' => 'selector', 'method' => 'get')) ?>
|
||
<?php echo form::open($base_url, array('class' => 'selector', 'method' => 'get')) ?>
|
||
<?php echo form::dropdown('record_per_page', $sel_values_array, $current, 'onchange="this.form.submit()"'); ?>
|
||
<?php echo form::close() ?>
|
||
</p>
|
freenetis/branches/testing/system/libraries/Pagination.php | ||
---|---|---|
|
||
// Clean view directory
|
||
$this->directory = trim($this->directory, '/').'/';
|
||
|
||
/**
|
||
* Hack to work with anchor's segment of URL
|
||
*
|
||
* @author Michal Kliment
|
||
*/
|
||
if (strpos($this->base_url, '#') !== FALSE)
|
||
{
|
||
list($this->base_url, $anchor) = explode('#',$this->base_url);
|
||
|
||
if ($anchor != '')
|
||
$anchor = '#'.$anchor;
|
||
}
|
||
else
|
||
$anchor = '';
|
||
|
||
// Start building a generic URL
|
||
$this->url = ($this->base_url == '') ? Router::$segments : explode('/', trim($this->base_url, '/'));
|
||
... | ... | |
|
||
// Create a generic URL with query string and {page} number placeholder
|
||
$this->url[$this->uri_segment - 1] = '{page}';
|
||
$this->url = url::site(implode('/', $this->url)).Router::$query_string;
|
||
$this->url = url::site(implode('/', $this->url)).Router::$query_string.$anchor;
|
||
|
||
$segments = explode("/", Kohana::instance()->uri);
|
||
$segment = (isset($segments[$this->uri_segment-1])) ? $segments[$this->uri_segment-1] : 1;
|
Také k dispozici: Unified diff
Oprava chyb: U zobrazeni zarizeni odstraneni duplicitnich radku rozhrani. Diagnostika chyby u pridavani bankovniho prevodu - na vine byla jina chyba u pridavani samotneho bankovniho uctu - pri vytvoreni nedoslo k vytvoreni patricnich podvojnych uctu.