Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1372

Přidáno uživatelem David Raška před asi 12 roky(ů)

Novinky:
- #137: Pridana podpora vice variabilnich symbolu

Opravy:
- #30: V importu z FIO banky moze byt 0 na zacatku variabilniho symbolu
- #91: V importu z FIO banky se transakce bez variabilniho uz neztrati, ale vlozi do neidentifikovanych plateb
- Odstraneny chyby v parseru Reiffeisen banky
- #130: Ostranena vazba importu na telefonni cisla

Upravy:
- Opraveny nektere preklady

Zobrazit rozdíly:

freenetis/branches/testing/application/i18n/cs_CZ/texts.php
'add subnet to cloud' => 'Přidat podsíť do oblasti',
'add smokeping menu item' => 'Přidat položku menu smokepingu',
'add smokeping record' => 'Přidat záznam smokepingu',
'add variable symbol' => 'Přidat variabilní symbol',
'add voip account' => 'Přidat VoIP účet',
'add vote' => 'Přidat hlas',
'add vote about work' => 'Přidat hlas o práci',
......
'address ranges' => 'Adresní rozsahy',
'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í',
'administrate variable symbols' => 'Přidávání/editace variabilních symbolů',
'administration' => 'Administrace',
'administration of additional contacts' => 'Přidávání/editace dalších kontaktních informací',
'administration of members registrations' => 'Administrace přihlášek členů',
'administration of variable symbols' => 'Přidávání/editace variabilních symbolů',
'admin' => 'Správce',
'admin contacting' => 'Kontaktování správce',
'admin has been successfully added' => 'Správce byl úspěšně přidán.',
......
'canceling of message for redirection' => 'Rušení zprávy pro přesměrování',
'cannot connect to database' => 'Nelze se připojit k databázi',
'cannot delete, there are other records depending on this one' => 'Nelze smazat, na položce jsou závislé jiné záznamy',
'cannot edit, there are other records depending on this one' => 'Nelze upravit, na položce jsou závislé jiné záznamy',
'cannot delete group - it has at least one children group' => 'Nelze smazat skupinu - má alespoň jednu potomkovskou skupinu.',
'cannot enable voip driver, allow `%s` rights for mysql user' => 'Nemohu povolit VoIP ovladač, povolte právo `%s` pro MySQL uživatele',
'cannot find detail dumps' => 'Nemohu nalézt podrobné výpisy.',
......
'edit town' => 'Upravit město',
'edit translation' => 'Upravit překlad',
'edit user' => 'Upravit uživatele',
'edit variable symbol' => 'Upravit variabilní symbol',
'edit vlan interface' => 'Úprava VLAN rozhraní',
'edit vlan' => 'Úprava VLANu',
'edit voicemail' => 'Upravit hlasovou schránku',
......
'error - cant update template' => 'Chyba - nelze upravit šablonu.',
'error - cant update transfer' => 'Chyba - nelze upravit převod.',
'error - cant update user' => 'Chyba - nelze upravit uživatele.',
'error - cant update variable symbols' => 'Chyba - nelze upravit variabilní symboly.',
'error - cant update work' => 'Chyba - nelze upravit práci.',
'error - debtor credit boundary has not been set' => 'Chyba - hranice kreditu pro dlužníka nebyla nastavena.',
'error - during searching long term connections' => 'Chyba - během hledání dlouhotrvajícího připojení.',
......
'user to' => 'Uživatel Komu',
'user login' => 'Login uživatele',
'user_name' => 'Křestní jméno',
'username' => 'Přihl. jméno',
'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',
'users' => 'Uživatelé',
'users has been warned about invoice' => 'Uživatelé byly upozorněni na fakturu',
'users in group' => 'Uživatelé ve skupině',
......
'value has not been entered' => 'Hodnota nebyla zadána.',
'variable symbol' => 'Variabilní symbol',
'variable_symbol' => 'Variabilní symbol',
'variable symbols' => 'Variabilní symboly',
'variable symbol already exists in database' => 'Variabilní symbol už existuje v databázi.',
'variable symbol has been deleted' => 'Variabilní symbol byl úspěšně smazán.',
'variable symbol has been successfully added' => 'Variabilní symbol byl úspěšně přidán.',
'variable symbol has been successfully updated' => 'Variabilní symbol byl úspěšně aktualizován.',
'variable symbol has not been found in the database' => 'Variabilní symbol nebyl nalezen v databázi.',
'variables for monitoring' => 'Proměnné pro monitoring',
'variables for qos' => 'Proměnné pro QoS',
freenetis/branches/testing/application/models/search.php
public function member_variable_symbol($keyword)
{
return $this->db->query("
SELECT m.id, m.variable_symbol AS value,
CONCAT(?, m.variable_symbol) AS `desc`,
SELECT m.id, vs.variable_symbol AS value,
CONCAT(?, vs.variable_symbol) AS `desc`,
CONCAT(IFNULL(t.translated_term,e.value),' ',m.name,IF(mf.id IS NOT NULL,?,'')) AS return_value,
'members/show/' AS link FROM members m
JOIN enum_types e ON m.type = e.id
LEFT JOIN accounts a ON a.member_id = m.id
LEFT JOIN variable_symbols vs ON vs.account_id = a.id
LEFT JOIN translations t ON e.value LIKE t.original_term AND t.lang = 'cs'
JOIN address_points ap ON m.address_point_id = ap.id
JOIN streets s ON ap.street_id = s.id
JOIN towns tw ON ap.town_id = tw.id
LEFT JOIN membership_interrupts mi ON m.id = mi.member_id
LEFT JOIN members_fees mf ON mi.members_fee_id = mf.id AND (mf.activation_date < CURDATE() AND mf.deactivation_date > CURDATE())
WHERE m.variable_symbol LIKE ? COLLATE utf8_general_ci
WHERE vs.variable_symbol LIKE ? COLLATE utf8_general_ci
", array
(
__('Variable symbol') . ": ",
freenetis/branches/testing/application/models/member.php
SELECT
m.id, m.registration, m.registrations, m.name,
s.street, ap.street_number, t.town, t.quarter,
m.variable_symbol, a.id AS aid,
vs.variable_symbol, a.id AS aid,
a.balance, a_comment,
a.comments_thread_id AS a_comments_thread_id,
m.type, m.entrance_date, m.leaving_date, redirect_type,
......
FROM
(
SELECT m.id,
m.name, m.variable_symbol,
m.name,
m.address_point_id,
IF(m.registration = 1, ?, ?) AS registration,
m.registration AS registrations,
......
LEFT JOIN streets s ON ap.street_id = s.id
LEFT JOIN towns t ON ap.town_id = t.id
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
LEFT JOIN variable_symbols vs ON vs.account_id = a.id
LEFT JOIN
(
SELECT
......
FROM
(
SELECT m.id,
m.name, m.variable_symbol,
m.name,
m.address_point_id,
IF(m.registration = 1, ?, ?) AS registration,
IFNULL(t.translated_term, e.value) AS type,
......
LEFT JOIN streets s ON ap.street_id = s.id
LEFT JOIN towns t ON ap.town_id = t.id
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
LEFT JOIN variable_symbols vs ON vs.account_id = a.id
LEFT JOIN comments_threads ct ON a.comments_thread_id = ct.id
LEFT JOIN comments c ON ct.id = c.comments_thread_id
LEFT JOIN users u ON c.user_id = u.id
freenetis/branches/testing/application/models/account.php
/** Other accounts group */
const OTHER = 4;
protected $has_many = array('transfers');
protected $has_many = array('transfers','variable_symbols');
protected $belongs_to = array('member', 'account_attribute', 'comments_thread');
protected $has_and_belongs_to_many = array('bank_accounts');
freenetis/branches/testing/application/controllers/transfers.php
}
$account = new Account_Model($account_id);
$variable_symbol_model = new Variable_Symbol_Model();
if ($account->member_id != 1)
{
$variable_symbols = $variable_symbol_model->find_account_variable_symbols($account->id);
}
if (!$account->id)
Controller::error(RECORD);
......
$view->content->balance = $balance;
$view->content->inbound = $inbound;
$view->content->outbound = $outbound;
$view->content->variable_symbols = $variable_symbols;
$view->content->expiration_date = Members_Controller::get_expiration_date($account);
$view->content->transfers_grid = $transfers_grid;
freenetis/branches/testing/application/controllers/members.php
$filter_form->add('balance')
->table('a')
->type('number');
->type('number')
->callback('decimal_separator_fix');
$filter_form->add('variable_symbol')
->table('vs')
->callback('json/variable_symbol');
$filter_form->add('entrance_date')
......
$contact_model = new Contact_Model();
$enum_type_model = new Enum_type_Model();
$variable_symbol_model = new Variable_Symbol_Model();
// contacts of main user of member
$contacts = $contact_model->find_all_users_contacts($user->id);
$variable_symbols = NULL;
if ($member_id != 1)
{
$variable_symbols = $variable_symbol_model->find_account_variable_symbols($account->id);
}
$contact_types = array();
foreach($contacts as $i => $contact)
......
$view->content->membership_interrupts_grid = $membership_interrupts_grid;
$view->content->contacts = $contacts;
$view->content->contact_types = $contact_types;
$view->content->variable_symbols = $variable_symbols;
$view->content->expiration_date = $expiration_date;
$view->content->account = (isset($account)) ? $account : NULL;
$view->content->comments = (isset($account)) ? $account->get_comments() : '';
......
// id of user who added member
$member->user_id = $this->session->get('user_id');
$member->comment = $form_data['comment'];
$member->variable_symbol = $form_data['variable_symbol'];
//$member->variable_symbol = $form_data['variable_symbol']; //nyní je uložen v samostatné tabulce
$member->entrance_date = date("Y-m-d",$form_data['entrance_date']);
if ($form_data['membername'] == '')
......
// saving account
$account->member_id = $member->id;
$account->save_throwable();
// saving variable symbol
$variable_symbol_model = new Variable_Symbol_Model();
$variable_symbol_model->account_id = $account->id;
$variable_symbol_model->variable_symbol = $form_data['variable_symbol'];
$variable_symbol_model->save_throwable();
// save allowed subnets count of member
$allowed_subnets_count = new Allowed_subnets_count_Model();
......
->value($member->organization_identifier);
}
if ($this->acl_check_edit('Members_Controller', 'var_sym', $member->id) &&
/*if ($this->acl_check_edit('Members_Controller', 'var_sym', $member->id) &&
$member->id != 1)
{
$form->input('variable_symbol')
......
->rules('required|length[1,10]')
->value($member->variable_symbol)
->callback(array($this, 'valid_var_sym'));
}
}*/
if ($this->acl_check_edit(get_class($this), 'address', $member->id))
{
......
if ($this->acl_check_edit(get_class($this), 'organization_id', $member->id))
$member->organization_identifier = $form_data['organization_identifier'];
if ($this->acl_check_edit('Members_Controller', 'var_sym', $member->id) &&
/*if ($this->acl_check_edit('Members_Controller', 'var_sym', $member->id) &&
$member->id != 1)
{
$member->variable_symbol = $form_data['variable_symbol'];
}
}*/
if ($this->acl_check_edit(get_class($this),'locked',$member->id) &&
$member->id != 1)
......
}
$value = trim($input->value);
$member_model = new Member_Model();
$total = $member_model->where(array
(
'variable_symbol' => $value,
'id!=' => $this->_member_id
))->count_all();
$variable_symbol_model = new Variable_Symbol_Model();
$total = $variable_symbol_model->get_variable_symbol_id($value);
if (!preg_match("/^[0-9]{1,10}$/", $value))
{
$input->add_error('required', __('Bad variable symbol format.'));
}
else if ($total != 0)
else if ($total)
{
$input->add_error('required', __(
'Variable symbol already exists in database.'
......
$input->add_error('required', __('This information is required.'));
}
}
/**
* Callback AJAX function to filter's whisper for organization identifier
*
* @author David Raška
*/
public function decimal_separator_fix()
{
$term = $this->input->get('term');
$member_model = new Member_Model();
$members = $member_model->where('organization_identifier !=', '')
->like('organization_identifier', $term)
->groupby('organization_identifier')
->orderby('organization_identifier')
->find_all();
$arr_members = array();
foreach ($members as $member)
$arr_members[] = $member->organization_identifier;
echo json_encode($arr_members);
}
}
freenetis/branches/testing/application/controllers/json.php
public function variable_symbol()
{
$term = $this->input->get('term');
$member_model = new Member_Model();
$members = $member_model->like('variable_symbol', $term)
$variable_symbol_model = new Variable_Symbol_Model();
$variable_symbols = $variable_symbol_model->like('variable_symbol', $term)
->orderby('variable_symbol')
->find_all();
$arr_members = array();
foreach ($members as $member)
$arr_members[] = $member->variable_symbol;
foreach ($variable_symbols as $vs)
$arr_members[] = $vs->variable_symbol;
echo json_encode($arr_members);
}
freenetis/branches/testing/application/controllers/contacts.php
{
status::error('Error - cant update additional contacts');
}
$this->redirect('contacts/show_by_user/' . $user_id);
$this->redirect('contacts/show_by_user/',$user_id);
}
else
{
......
}
}
$this->redirect('contacts/show_by_user/' . $user_id);
$this->redirect('contacts/show_by_user/',$user_id);
}
else
{
......
{
status::warning('Cannot delete, there are other records depending on this one.');
}
$this->redirect('contacts/show_by_user/' . $user_id);
$this->redirect('contacts/show_by_user/',$user_id);
} // end of additional_contacts function
freenetis/branches/testing/application/controllers/devices.php
->label(__('Surname'));
$grid_device_engineers->field('login')
->label(__('Username'));
->label(__('Login name'));
if ($this->acl_check_delete('Devices_Controller', 'engineer', $member_id))
{
......
->label(__('surname'));
$grid_device_admins->field('login')
->label(__('username'));
->label(__('Login name'));
if ($this->acl_check_delete('Devices_Controller', 'engineer', $member_id))
{
freenetis/branches/testing/application/upgrade_sql/upgrade_sql.php
}
/**
* Changes street_number column in order to store differents kinds of PSC
* such as POC. See #80.
* Inserts phone numbers to variable_symbols table
*
* @author Ondřej Fibich
* @return boolean
*/
function upgrade_sql_after()
{
$m = new Variable_Symbol_Model();
$db = Database::instance();
$query = $db->query("SELECT a.id, c.value
FROM contacts c
JOIN users_contacts uc ON uc.contact_id = c.id
JOIN users u ON u.id = uc.user_id
JOIN accounts a ON a.member_id = u.member_id
WHERE c.type = ? AND
a.account_attribute_id = 221100 AND
c.value NOT IN (
SELECT variable_symbol
FROM variable_symbols)", Contact_Model::TYPE_PHONE);
try
{
$m->transaction_start();
foreach ($query as $row)
{
try
{
$db->query("INSERT INTO variable_symbols (account_id,variable_symbol) VALUES (?,?)",$row->id,$row->value);
}
catch (Exception $e)
{
}
}
$m->transaction_commit();
}
catch (Exception $e)
{
$m->transaction_rollback();
return FALSE;
}
return true;
}
/**
* Moves variable symbols to new table
*
* @author David Raška
*/
$upgrade_sql[get_SVN_rev()] = array
(
"ALTER TABLE `address_points` CHANGE `street_number` `street_number` VARCHAR( 50 ) NULL DEFAULT NULL"
);
//create table for variable symbols
"CREATE TABLE IF NOT EXISTS `variable_symbols` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) NOT NULL,
`variable_symbol` varchar(10) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `variable_symbol` (`variable_symbol`),
KEY `account_id` (`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1;",
//set foreign key
"ALTER TABLE variable_symbols
ADD CONSTRAINT `variable_symbols_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE;",
//insert values from members table
"INSERT INTO variable_symbols (account_id,variable_symbol) SELECT a.id, m.variable_symbol
FROM accounts a JOIN members m ON a.member_id = m.id
WHERE m.variable_symbol IS NOT NULL
AND a.account_attribute_id = 221100;",
//remove variable_symbol column from members table
"ALTER TABLE `members` DROP COLUMN `variable_symbol`;",
//create new permission rule
"INSERT INTO acl SELECT MAX(acl_id)+1 AS id, 'Administrators can administer variable symbols' FROM aro_groups_map;",
"INSERT INTO aro_groups_map SELECT MAX(acl_id)+1 AS acl_id, 32 FROM aro_groups_map;",
"INSERT INTO aco_map SELECT MAX(acl_id) AS acl_id, 'delete_all' FROM aro_groups_map;",
"INSERT INTO aco_map SELECT MAX(acl_id) AS acl_id, 'edit_all' FROM aro_groups_map;",
"INSERT INTO aco_map SELECT MAX(acl_id) AS acl_id, 'view_all' FROM aro_groups_map;",
"INSERT INTO aco_map SELECT MAX(acl_id) AS acl_id, 'new_all' FROM aro_groups_map;",
"INSERT INTO axo_sections SELECT MAX(id)+1 AS id,'Variable_Symbols_Controller' AS value,'Variable symbols managing' AS name FROM axo_sections;",
"INSERT INTO axo SELECT MAX(id)+1 AS id,'Variable_Symbols_Controller' AS section_value,'variable_symbols' AS value,'Variable symbols' AS name FROM axo;",
"INSERT INTO axo_map SELECT MAX(acl_id) AS acl_id,'Variable_Symbols_Controller','variable_symbols' FROM aro_groups_map;",
);
freenetis/branches/testing/application/upgrade_sql/upgrade_sql_1365.php
<?php defined('SYSPATH') or die('No direct script access.');
/*
* This file is part of open source system FreeNetIS
* and it is released under GPLv3 licence.
*
* More info about licence can be found:
* http://www.gnu.org/licenses/gpl-3.0.html
*
* More info about project can be found:
* http://www.freenetis.org/
*
*/
/**
* Changes street_number column in order to store differents kinds of PSC
* such as POC. See #80.
*
* @author Ondřej Fibich
*/
$upgrade_sql[1365] = array
(
"ALTER TABLE `address_points` CHANGE `street_number` `street_number` VARCHAR( 50 ) NULL DEFAULT NULL"
);
freenetis/branches/testing/application/libraries/importers/Raiffeisenbank/Parser_Ebanka.php
* Gets data from transparent
*/
protected function get_data_from_transparent()
{
{
$res = $this->result;
if ($res == NULL)
{
$res = new stdClass();
}
$first = true;
$line_nr = 0;
$rb_importer = new RB_Importer();
......
protected function get_data_from_regular()
{
$res = $this->result;
if ($res == NULL)
{
$res = new stdClass();
}
$first = true;
$rb_importer = new RB_Importer();
......
// odstraneni &nbsp;
$field = html_entity_decode($field, ENT_QUOTES, "UTF-8");
$field = str_replace(" ", "", $field);
switch ($field_nr)
{
case 0: // číslo výpisu, každý měsíc od 1 do N
freenetis/branches/testing/application/libraries/importers/Raiffeisenbank/RB_Importer.php
static $suppliers, $operating, $member_fees, $cash;
static $first_pass = true;
$this->stats = new stdClass();
$this->stats->linenr++;
if ($first_pass)
......
// členský příspěvek nebo příjem z faktury odběrateli
// @todo zpracování jiných typů VS u člen. příspěvků (např. ID+CRC16)
// uvedl člen u teto platby jako variabilni symbol (VS) svůj telefon ?
$member = $member_model->where('variable_symbol', $vs)->find();
//$member = $member_model->where('variable_symbol', $vs)->find();
$variable_symbol_model = new Variable_Symbol_Model();
$member = $variable_symbol_model->where('variable_symbol',$vs)->find()->account->member;
if (!$member->id)
{
$member = $member_model->find_member_by_phone($vs);
if (!$member || !$member->id)
{ // find_member_by_phone vrací false, pokud nic nenajde
// ne? zkusime, zda jako VS nezadal svoje member_id + crc16(member_id)
// $member=$member_model->get_member_by_crc_id($vs);
// this function has bugs!!! needs rewrite!!!
$member = $member_model;
$this->stats->unidentified_transfers++;
}
$member = $member_model;
$this->stats->unidentified_transfers++;
}
}
// else { // if platba přijaté faktury - majitele účtu najdeme dle VS na faktuře, až budeme mít modul přijatých faktur}
freenetis/branches/testing/application/libraries/importers/Fio/FioSaver.php
$bt = new Bank_transfer_Model();
$member_model = new Member_Model();
$fee_model = new Fee_Model();
$variable_symbol_model = new Variable_Symbol_Model();
// statistics preparation
$stats["unidentified_nr"] = 0;
......
else
{
// let's identify member
$member = $member_model->where('variable_symbol', $item["vs"])->find();
$member = $variable_symbol_model->where('variable_symbol',(int) $item["vs"])->find()->account->member;
if (!$member->id)
{
$member_id = null;
......
{
$member_id = $member->id;
}
// double-entry incoming transfer
$transfer_id = Transfer_Model::insert_transfer(
$member_fees->id, $account->id, null, $member_id,
freenetis/branches/testing/application/views/members/show.php
</tr>
<?php if ($member->id != 1) { ?>
<tr>
<th><?php echo __('Variable symbol').'&nbsp;'.help::hint('variable_symbol') ?></th>
<td><?php echo $member->variable_symbol ?></td>
<th><?php echo __('Variable symbols').'&nbsp;'.help::hint('variable_symbol') ?></th>
<td>
<?php foreach ($variable_symbols as $i => $variable_s):?>
<?php echo $variable_s->variable_symbol ?><br />
<?php endforeach; ?>
</td>
</tr>
<?php } ?>
<?php if ($this->acl_check_view('Variable_Symbols_Controller', 'variable_symbols') || ($member->id == $this->session->get('user_id') && $this->acl_check_view('Variable_Symbols_Controller', 'variable_symbols', $member->id))) { ?>
<tr>
<td colspan="2"><?php echo html::anchor(url_lang::base().'variable_symbols/show_by_account/'.$account->id,__('Administrate variable symbols')) ?></td>
</tr>
<?php }} ?>
<?php if ($this->acl_check_view('Members_Controller', 'entrance_date', $member->id)) { ?>
<tr>
<th><?php echo __('Entrance date').'&nbsp;'.help::hint('entrance_date') ?></th>
......
<?php } ?>
</table>
<br class = "clear" />
<br />
<br/>
<h3><?php echo __('Users')?></h3>
<?php echo $users_grid ?>
freenetis/branches/testing/application/views/transfers/show_by_account.php
</tr>
<?php if ($account->account_attribute_id == Account_attribute_Model::CREDIT) { ?>
<tr>
<th><?php echo __('Variable symbol')?></th>
<td><?php echo $account->member->variable_symbol ?></td>
<th><?php echo __('Variable symbols')?></th>
<td>
<?php foreach ($variable_symbols as $i => $variable_s):?>
<?php echo $variable_s->variable_symbol ?><br />
<?php endforeach; ?>
</td>
</tr>
<?php if (isset($expiration_date)) { ?>
<tr>
freenetis/branches/testing/system/core/Kohana.php
error_reporting($ER);
// Start output buffering
ob_start(array('Kohana', 'output_buffer'));
ob_start(array('Kohana', 'output_buffer'), 1);
// Save buffering level
self::$buffer_level = ob_get_level();

Také k dispozici: Unified diff