Revize 523
Přidáno uživatelem Jiří Sviták před téměř 15 roky(ů)
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'admin has been successfully removed from this device' => 'Správce byl úspěšně odebrán od tohoto zařízení.',
|
||
'admins' => 'Správci',
|
||
'all' => 'Všichni',
|
||
'all redirected' => 'Všichni přesměrovaní',
|
||
'all transfers' => 'Všechny převody',
|
||
'amount' => 'Částka',
|
||
'antenna' => 'Anténa',
|
||
... | ... | |
'import has been successfully finished' => 'Import byl úspěšně dokončen.',
|
||
'import new invoice' => 'Import nové faktury',
|
||
'import results' => 'Výsledky importu',
|
||
'inbound' => 'Příchozí',
|
||
'information' => 'Informace',
|
||
'information about main user' => 'Informace o hlavním uživateli',
|
||
'information about you' => 'Informace o vás',
|
||
... | ... | |
'member id' => 'ID člena',
|
||
'member name' => 'Jméno člena (organizace)',
|
||
'member_name' => 'Jméno člena (organizace)',
|
||
'member not found' => 'Člen nenalezen',
|
||
'members' => 'Členové',
|
||
'members account' => 'Účet člena',
|
||
'members' => 'Členové',
|
||
'membership can be ended only to former member' => 'Členství může být ukončeno jen bývalému členovi.',
|
||
'membership interrupt' => 'Přerušení členství',
|
||
'membership interrupt text' => 'Text pro přerušení členství',
|
||
... | ... | |
'received member fees' => 'Přijaté členské příspěvky',
|
||
'redir' => 'Přesm',
|
||
'redirect' => 'Přesměrovat',
|
||
'redirected only' => 'Jen přesměrovaní',
|
||
'redirection' => 'Přesměrování',
|
||
'redirection enabled' => 'Přesměrování zapnuto',
|
||
'redirection has been successfully set' => 'Přesměrování bylo úspěšně nastaveno.',
|
freenetis/trunk/kohana/application/models/wireless_setting.php | ||
---|---|---|
{
|
||
return self::$db->query("SELECT
|
||
ws.id,
|
||
ws.ssid,
|
||
IFNULL(t1.translated_term, e1.value) AS wmode,
|
||
IFNULL(t2.translated_term, e2.value) AS norm,
|
||
ws.frequence,
|
||
... | ... | |
WHERE ws.iface_id = $iface_id");
|
||
}
|
||
|
||
/**
|
||
* @author Jiri Svitak
|
||
* Function gets one wireless setting. Properties are specified by their id in enum_types.
|
||
* @param $iface_id
|
||
* @return unknown_type
|
||
*/
|
||
public function get_wireless_setting_for_edit($iface_id)
|
||
{
|
||
return self::$db->query("SELECT
|
||
id, wmode, norm, frequence, channel, antenna, polarization
|
||
FROM wireless_settings
|
||
WHERE iface_id = $iface_id");
|
||
}
|
||
|
||
}
|
||
?>
|
freenetis/trunk/kohana/application/models/member.php | ||
---|---|---|
|
||
// filtering by redirection
|
||
public static $all = 1;
|
||
public static $redirected = 2;
|
||
public static $all_redirected = 2;
|
||
public static $membership_interrupt = 3;
|
||
public static $debtors = 4;
|
||
public static $payment_notice = 5;
|
||
public static $optional_message = 6;
|
||
|
||
public function __construct($id = false)
|
||
{
|
||
... | ... | |
if ($key == 'id')
|
||
$where .= "m.id = ".trim($value);
|
||
}
|
||
if ($key == 'redirect' && $value == self::$redirected)
|
||
if ($key == 'redirect' && $value != self::$all)
|
||
{
|
||
if ($where == '')
|
||
$where = 'WHERE m.redirect > 0';
|
||
$where = "WHERE ";
|
||
else
|
||
$where .= ' AND m.redirect > 0';
|
||
$where .= " AND ";
|
||
if ($value == self::$all_redirected)
|
||
$where .= "m.redirect > 0";
|
||
if ($value == self::$membership_interrupt)
|
||
$where .= "m.redirect & 1 = 1";
|
||
if ($value == self::$debtors)
|
||
$where .= "m.redirect & 2 = 2";
|
||
if ($value == self::$payment_notice)
|
||
$where .= "m.redirect & 4 = 4";
|
||
if ($value == self::$optional_message)
|
||
$where .= "m.redirect & 8 = 8";
|
||
}
|
||
}
|
||
return self::$db->query("SELECT
|
||
... | ... | |
if ($key == 'id')
|
||
$where .= "m.id = ".trim($value);
|
||
}
|
||
if ($key == 'redirect' && $value == self::$redirected)
|
||
if ($key == 'redirect' && $value != self::$all)
|
||
{
|
||
if ($where == '')
|
||
$where = 'WHERE m.redirect > 0';
|
||
$where = "WHERE ";
|
||
else
|
||
$where .= ' AND m.redirect > 0';
|
||
$where .= " AND ";
|
||
if ($value == self::$all_redirected)
|
||
$where .= "m.redirect > 0";
|
||
if ($value == self::$membership_interrupt)
|
||
$where .= "m.redirect & 1 = 1";
|
||
if ($value == self::$debtors)
|
||
$where .= "m.redirect & 2 = 2";
|
||
if ($value == self::$payment_notice)
|
||
$where .= "m.redirect & 4 = 4";
|
||
if ($value == self::$optional_message)
|
||
$where .= "m.redirect & 8 = 8";
|
||
}
|
||
}
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
freenetis/trunk/kohana/application/models/transfer.php | ||
---|---|---|
public static $all_transfers = 1;
|
||
public static $without_inner = 2;
|
||
|
||
// types of transfers - inbound / outbound
|
||
public static $inbound_and_outbound = 1;
|
||
public static $inbound = 2;
|
||
public static $outbound = 3;
|
||
|
||
/**
|
||
* Function gets all double-entry transfer. They are shown in day book.
|
||
* @param $limit_from
|
||
... | ... | |
*/
|
||
public function get_transfers($account_id = null, $limit_from = 0, $limit_results = 20, $order_by = 't.id', $order_by_direction = 'ASC', $filter_values = array())
|
||
{
|
||
$where = '';
|
||
if ($filter_values['type'] == self::$inbound)
|
||
$where = "WHERE t.destination_id = $account_id";
|
||
elseif ($filter_values['type'] == self::$outbound)
|
||
$where = "WHERE t.origin_id = $account_id";
|
||
else
|
||
$where = "WHERE t.origin_id = $account_id OR t.destination_id = $account_id";
|
||
foreach($filter_values as $key => $value)
|
||
{
|
||
$where .= ' AND ';
|
||
if ($key != 'submit' && $key != 'type')
|
||
$where .= ' AND ';
|
||
if ($key == 'name')
|
||
$where .= "a.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'text')
|
||
... | ... | |
a.name
|
||
FROM transfers t
|
||
LEFT JOIN accounts a ON a.id = IF(t.origin_id = $account_id, t.destination_id, t.origin_id)
|
||
WHERE t.origin_id = $account_id OR t.destination_id = $account_id
|
||
$where
|
||
ORDER BY $order_by $order_by_direction
|
||
LIMIT $limit_from, $limit_results"
|
||
... | ... | |
*/
|
||
public function count_transfers($account_id = null, $filter_values = array())
|
||
{
|
||
$where = '';
|
||
if ($filter_values['type'] == self::$inbound)
|
||
$where = "WHERE t.destination_id = $account_id";
|
||
elseif ($filter_values['type'] == self::$outbound)
|
||
$where = "WHERE t.origin_id = $account_id";
|
||
else
|
||
$where = "WHERE t.origin_id = $account_id OR t.destination_id = $account_id";
|
||
foreach($filter_values as $key => $value)
|
||
{
|
||
$where .= ' AND ';
|
||
if ($key != 'submit' && $key != 'type')
|
||
$where .= ' AND ';
|
||
if ($key == 'name')
|
||
$where .= "a.name LIKE '%".$value."%' COLLATE utf8_general_ci";
|
||
if ($key == 'text')
|
||
... | ... | |
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM transfers t
|
||
LEFT JOIN accounts a ON a.id = IF(t.origin_id = $account_id, t.destination_id, t.origin_id)
|
||
WHERE t.origin_id = $account_id OR t.destination_id = $account_id
|
||
$where"
|
||
)->current()->total;
|
||
}
|
freenetis/trunk/kohana/application/controllers/members.php | ||
---|---|---|
$types[0] = url_lang::lang('texts.All');
|
||
// types of redirection
|
||
$redir_types[Member_Model::$all] = url_lang::lang('texts.All');
|
||
$redir_types[Member_Model::$redirected] = url_lang::lang('texts.Redirected only');
|
||
$redir_types[Member_Model::$all_redirected] = url_lang::lang('texts.All redirected');
|
||
$redir_types[Member_Model::$membership_interrupt] = url_lang::lang('texts.Membership interrupt');
|
||
$redir_types[Member_Model::$debtors] = url_lang::lang('texts.Debtors');
|
||
$redir_types[Member_Model::$payment_notice] = url_lang::lang('texts.Payment notice');
|
||
$redir_types[Member_Model::$optional_message] = url_lang::lang('texts.Optional message');
|
||
// creates fields for filtering members
|
||
$filter=new Table_Form(url_lang::base()."members/show_all", "get", array(
|
||
new Table_Form_Item('text','name','Name'),
|
freenetis/trunk/kohana/application/controllers/users.php | ||
---|---|---|
|
||
$query = $model_users->get_all_users($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter->values());
|
||
|
||
if ($total_users == 1)
|
||
url::redirect(url_lang::base().'users/show/'.$query->current()->id);
|
||
|
||
$arr_gets = array();
|
||
foreach ($this->input->get() as $key=>$value) $arr_gets[] = $key.'='.$value;
|
||
$query_string = '?'.implode('&',$arr_gets);
|
freenetis/trunk/kohana/application/controllers/transfers.php | ||
---|---|---|
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
|
||
$order_by_direction = 'desc';
|
||
// creates fields for filtering
|
||
$arr_types[Transfer_Model::$inbound_and_outbound] = url_lang::lang('texts.All transfers');
|
||
$arr_types[Transfer_Model::$inbound] = url_lang::lang('texts.Inbound');
|
||
$arr_types[Transfer_Model::$outbound] = url_lang::lang('texts.Outbound');
|
||
$filter=new Table_Form(url_lang::base()."transfers/show_by_account/$account_id", "get", array(
|
||
new Table_Form_Item('text', 'name', 'Counteraccount'),
|
||
new Table_Form_Item('text', 'datetime', 'Date and time'),
|
||
... | ... | |
new Table_Form_Item('text', 'text', 'Text'),
|
||
new Table_Form_Item('text', 'amount', 'Amount'),
|
||
"tr",
|
||
new Table_Form_Item('select', 'type', 'Type', $arr_types),
|
||
"td", new Table_Form_Item('submit', 'submit', 'Filter')
|
||
)
|
||
);
|
||
... | ... | |
foreach ($this->input->get() as $key=>$value)
|
||
$arr_gets[] = $key.'='.$value;
|
||
$query_string = '?'.implode('&',$arr_gets);
|
||
// all types of transfers are shown by default
|
||
$filter_values = $filter->values();
|
||
if (count($filter_values) == 0)
|
||
$filter_values['type'] = Transfer_Model::$inbound_and_outbound;
|
||
// transfers on account
|
||
$transfer_model = new Transfer_Model();
|
||
$total_transfers = $transfer_model->count_transfers($account_id, $filter->values());
|
||
$total_transfers = $transfer_model->count_transfers($account_id, $filter_values);
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_transfers)
|
||
$sql_offset = 0;
|
||
$transfers = $transfer_model->get_transfers($account_id, $sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter->values());
|
||
$transfers = $transfer_model->get_transfers($account_id, $sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter_values);
|
||
// headline
|
||
$headline = url_lang::lang('texts.Transfers of double-entry account');
|
||
// grid of transfers
|
||
... | ... | |
if ($this->acl_check_new('Accounts_Controller', 'transfers'))
|
||
$grid->add_new_button(url_lang::base().'transfers/add/'.$account_id, url_lang::lang('texts.Send money to other account'));
|
||
$grid->order_field('id')->label('ID');
|
||
$grid->order_field('trans_type')->label(url_lang::lang('texts.Type'))->bool(array(url_lang::lang('texts.Arrival'),url_lang::lang('texts.Outbound')));
|
||
$grid->order_field('trans_type')->label(url_lang::lang('texts.Type'))->bool(array(url_lang::lang('texts.Inbound'),url_lang::lang('texts.Outbound')));
|
||
$grid->order_field('name')->label(url_lang::lang('texts.Counteraccount'));
|
||
$grid->order_field('datetime')->label(url_lang::lang('texts.Date and time'));
|
||
$grid->order_field('amount')->label(url_lang::lang('texts.Amount'));
|
freenetis/trunk/kohana/application/controllers/wireless_settings.php | ||
---|---|---|
// form
|
||
$form = new Forge(url_lang::base()."wireless_settings/add/$iface_id", '', 'POST', array('id' => 'article_form'));
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
$form->input('ssid')->label(url_lang::lang('texts.SSID').':');
|
||
$form->dropdown('wmode')->label(url_lang::lang('texts.Mode').':')->options($arr_modes)->rules('required');
|
||
$form->dropdown('norm')->label(url_lang::lang('texts.Norm').':')->options($arr_norms)->rules('required');
|
||
$form->input('frequence')->label(url_lang::lang('texts.Frequence').':');
|
||
... | ... | |
}
|
||
$wireless_model = new Wireless_setting_Model();
|
||
$wireless_model->iface_id = $iface_id;
|
||
$wireless_model->ssid = $form_data['ssid'];
|
||
$wireless_model->wmode = $form_data['wmode'];
|
||
$wireless_model->norm = $form_data['norm'];
|
||
$wireless_model->frequence = $form_data['frequence'];
|
||
... | ... | |
if (!isset($iface_id))
|
||
Controller::warning(PARAMETER);
|
||
// wireless settings
|
||
$wireless_model = new Wireless_setting_Model();
|
||
$wireless = $wireless_model->get_wireless_setting_for_edit($iface_id)->current();
|
||
$wireless = ORM::factory('wireless_setting')->where('iface_id', $iface_id)->find();
|
||
// wireless settings of interface
|
||
$enum_type_model = new Enum_type_Model();
|
||
$arr_modes = $enum_type_model->get_values(Enum_type_Model::$mode_type_id);
|
||
... | ... | |
asort($arr_polarizations);
|
||
// form
|
||
$form = new Forge(url_lang::base()."wireless_settings/edit/$iface_id", '', 'POST', array('id' => 'article_form'));
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
$form->input('ssid')->label(url_lang::lang('texts.SSID').':')->value($wireless->ssid);
|
||
$form->dropdown('wmode')->label(url_lang::lang('texts.Mode').':')->options($arr_modes)->rules('required')->selected($wireless->wmode);
|
||
$form->dropdown('norm')->label(url_lang::lang('texts.Norm').':')->options($arr_norms)->rules('required')->selected($wireless->norm);
|
||
$form->input('frequence')->label(url_lang::lang('texts.Frequence').':')->value($wireless->frequence);
|
||
... | ... | |
{
|
||
$form_data[$key] = htmlspecialchars($value);
|
||
}
|
||
unset($wireless_model);
|
||
$wireless_model = new Wireless_setting_Model();
|
||
$wireless_model->find_by_id($wireless->id);
|
||
$wireless_model = new Wireless_setting_Model($wireless->id);
|
||
$wireless_model->iface_id = $iface_id;
|
||
$wireless_model->ssid = $form_data['ssid'];
|
||
$wireless_model->wmode = $form_data['wmode'];
|
||
$wireless_model->norm = $form_data['norm'];
|
||
$wireless_model->frequence = $form_data['frequence'];
|
freenetis/trunk/kohana/application/controllers/devices.php | ||
---|---|---|
$form->dropdown('segment_id')->label(url_lang::lang('texts.Segment name').':')->options($arr_segments)->rules('required')->selected($selected_segment);
|
||
// wireless settings of interface
|
||
$form->checkbox('add_wireless')->label(url_lang::lang('texts.Save wireless setting'))->value(1);
|
||
$form->input('ssid')->label(url_lang::lang('texts.SSID').':');
|
||
$form->dropdown('wmode')->label(url_lang::lang('texts.Mode').':')->options($arr_modes)->callback(array($this, 'valid_mode'));
|
||
$form->dropdown('norm')->label(url_lang::lang('texts.Norm').':')->options($arr_norms)->callback(array($this, 'valid_norm'));
|
||
$form->input('frequence')->label(url_lang::lang('texts.Frequence').':');
|
||
... | ... | |
{
|
||
$wireless_model = new Wireless_setting_Model();
|
||
$wireless_model->iface_id = $iface_model->id;
|
||
$wireless_model->ssid = $form_data['ssid'];
|
||
$wireless_model->wmode = $form_data['wmode'];
|
||
$wireless_model->norm = $form_data['norm'];
|
||
$wireless_model->frequence = $form_data['frequence'];
|
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql_516.php | ||
---|---|---|
<?php
|
||
$upgrade_sql[516] = array(
|
||
"ALTER TABLE `jobs` CHANGE `description` `description` VARCHAR(65535) NULL DEFAULT NULL"
|
||
);
|
||
?>
|
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql.php | ||
---|---|---|
|
||
// array of sql queries that upgrade database
|
||
$upgrade_sql[get_SVN_rev()] = array(
|
||
"ALTER TABLE `jobs` CHANGE `description` `description` VARCHAR(65535) NULL DEFAULT NULL"
|
||
"ALTER TABLE `wireless_settings` ADD `ssid` VARCHAR( 50 ) NULL DEFAULT NULL AFTER `iface_id` "
|
||
|
||
);
|
||
|
||
?>
|
freenetis/trunk/kohana/application/views/ifaces_show.php | ||
---|---|---|
<th colspan="2"><?php echo url_lang::lang("texts.Wireless setting") ?></th>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang("texts.ID") ?></th>
|
||
<td><?php echo $setting->id ?></td>
|
||
</tr>
|
||
<th><?php echo url_lang::lang("texts.SSID") ?></th>
|
||
<td><?php echo $setting->ssid ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang("texts.Mode") ?></th>
|
||
<td><?php echo $setting->wmode ?></td>
|
Také k dispozici: Unified diff
Pridano filtrovani prevodu na podvojnem ucte - je mozne filtrovat prichozi/odchozi prevody. Rozsireno filtrovani clenu podle jejich presmerovani. V bezdratovych nastavenich pridano SSID.