Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 403

Přidáno uživatelem Roman Ševčík před více než 15 roky(ů)

Rozpracovana verze integrace Voip, freenetis propojen s asteriskem a pridany zakladni operace.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/states.php
'page not found' => 'Strana nenalezena',
'parameter required' => 'Vyžadován parametr',
'please check settings' => 'Prosím zkontrolujte nastavení',
'this group do not exist' => 'Tato skupina neexistuje'
'this record do not exist' => 'Tato skupina neexistuje'
);
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'account transfers' => 'Převody účtu',
'account type' => 'Typ účtu',
'account overview' => 'Přehled účtů',
'activate' => 'Aktivovat',
'add' => 'Přidat',
'add new account' => 'Přidat nový účet',
'add new bank account of association' => 'Přidat nový bankovní účet sdružení',
......
'new transfer' => 'Nový převod',
'new transfer from account' => 'Nový převod z účtu',
'no' => 'ne',
'nonactive' => 'Neaktivní',
'none' => 'žádný',
'non-member' => 'Nečlen',
'non-statutory member' => 'Člen bez statusu',
freenetis/trunk/kohana/application/controllers/members.php
$mi_grid->action_field('id') ->label(url_lang::lang('texts.Membership interrupts'))->url(url_lang::base().'membership_interrupts/delete')->action(url_lang::lang('texts.Delete'));
$mi_grid->datasource($mis);
// nefungovalo to, tak jsem to zakomentoval - Jura
/*
$voip_sip = new Voip_sip_Model();
$voip = $voip_sip->get_all_record_by_member($member_id);
$voip = $voip_sip->get_all_record_by_member_limited($member_id);
$voip_grid = new Grid(url_lang::base().'members', null, array(
'separator' => '<br /><br />',
'use_paginator' => false,
......
));
//$voip_grid->order_field('id')->label('ID');
$voip_grid->field('name')->label(url_lang::lang('texts.Number'));
$voip_grid->action_field('id')->label(url_lang::lang('texts.Account'))->url(url_lang::base().'voip/show')->action(url_lang::lang('texts.Show'));
$voip_grid->action_field('user_id')->label(url_lang::lang('texts.Account'))->url(url_lang::base().'voip/show')->action(url_lang::lang('texts.Show'));
$voip_grid->action_field('user_id')->label(url_lang::lang('texts.User'))->url(url_lang::base().'users/show')->action(url_lang::lang('texts.Show'));
$voip_grid->datasource($voip);
*/
$view = new View('template');
$view->header = new View('base/header');
......
$view->header->title = url_lang::lang('texts.Display member');
$view->header->menu = Controller::render_menu();
$view->content->users = $user_grid;
// toto taky
$view->content->voip = '';//$voip_grid;
$view->content->voip = $voip_grid;
$view->content->mis = $mi_grid;
$view->content->account_balance = $account_balance;
foreach($member_data as $key=>$val)
freenetis/trunk/kohana/application/controllers/users.php
$arr_contact_types[$i] = $enum_type_model->get_value($contact->type);
}
$voip_sip = new Voip_sip_Model();
$voip = $voip_sip->get_record_by_user_limited($user_id);
if ($voip->count() == 0)
{
$voip = '<span style="color:red;">'.url_lang::lang('texts.Nonactive').'</span> - '.html::anchor(url_lang::base().'voip/add/'.$user_id, url_lang::lang('texts.Activate'));
}
else
{
$voip = html::anchor(url_lang::base().'voip/show/'.$voip->current()->user_id,$voip->current()->name);
}
$view = new View('template');
$view->header = new View('base/header');
$view->content = new View('users/show');
......
$view->content->contacts = $contacts;
$view->content->contact_types = $arr_contact_types;
$view->content->message = $this->session->get_once('message');
$view->content->voip = $voip;
$view->render(TRUE);
}
freenetis/trunk/kohana/application/controllers/voip.php
public function index()
{
url::redirect(url_lang::base().'voip/show_all');
}
function show_all($limit_results = 500, $order_by = 'id', $order_by_direction = 'desc', $page_word = null, $page = 1)
function show_all($limit_results = 500, $order_by = 'user_id', $order_by_direction = 'asc', $page_word = null, $page = 1)
{
// get new selector
if (is_numeric($this->input->get('record_per_page')))
......
// parameters control
$allowed_order_type = array('id', 'name', 'user_id');
if (!in_array(strtolower($order_by), $allowed_order_type))
$order_by = 'id';
$order_by = 'user_id';
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
$order_by_direction = 'desc';
$order_by_direction = 'asc';
$model_voip_sip = new Voip_sip_Model();
$total_voip_sip = $model_voip_sip->count_all_records();
if (($sql_offset = ($page - 1) * $limit_results) > $total_voip_sip)
$sql_offset = 0;
$all_voip_sip = $model_voip_sip->get_all_records($sql_offset, (int)$limit_results, $order_by, $order_by_direction);
$all_voip_sip = $model_voip_sip->get_all_records_limited($sql_offset, (int)$limit_results, $order_by, $order_by_direction);
$headline = url_lang::lang('texts.VoIP');
$grid = new Grid(url_lang::base().'voip', null, array(
'use_paginator' => true,
......
$grid->order_field('id')->label('ID');
$grid->order_field('name')->label(url_lang::lang('texts.Number'));
//$grid->action_field('id')->label(url_lang::lang('texts.VoIP'))->url(url_lang::base().'voip/show')->action(url_lang::lang('texts.Show'));
$grid->action_field('id')->label(url_lang::lang('texts.Account'))->url(url_lang::base().'voip/edit')->action(url_lang::lang('texts.Edit'));
$grid->action_field('user_id')->label(url_lang::lang('texts.Account'))->url(url_lang::base().'voip/show')->action(url_lang::lang('texts.Show'));
$grid->action_field('user_id')->label(url_lang::lang('texts.User'))->url(url_lang::base().'users/show')->action(url_lang::lang('texts.Show'));
$grid->datasource($all_voip_sip);
$view = new View('template');
......
$view->render(TRUE);
}
function show($voip_id)
function show($user_id = NULL)
{
if (!isset($voip_id))
if (!isset($user_id))
Controller::warning(1);
$voip_sip = new Voip_sip_Model();
$voip = $voip_sip->get_record_by_user_limited($user_id);
if ($voip->count() == 0)
Controller::error(4);
$voip = $voip_sip->get_record_by_user($user_id);
//echo Str_Replace(
// Array("á","č","ď","é","ě","í","ľ","ň","ó","ř","š","ť","ú","ů","ý ","ž","Á","Č","Ď","É","Ě","Í","Ľ","Ň","Ó","Ř","Š","Ť","Ú","Ů","Ý","Ž") ,
// Array("a","c","d","e","e","i","l","n","o","r","s","t","u","u","y ","z","A","C","D","E","E","I","L","N","O","R","S","T","U","U","Y","Z") ,
/// 'ěščřžýáíé');
//$text = "příliš žluťoučký kůň úpěl ďábelské ódy"
//echo(StrTr($text, "ÁÄČÇĎÉĚËÍŇÓÖŘŠŤÚŮÜÝŽáäčçďéěëíňóöřšťúůüýž", "AACCDEEEINOORSTUUUYZaaccdeeeinoorstuuuyz"));
if(valid::ip($voip->current()->ipaddr) == true)
$link_status = '<b style="color:green;">'.url_lang::lang('texts.Registered').'</b>';
else
$link_status = '<b style="color:red;">'.url_lang::lang('texts.Not registered').'</b>';
$view = new View('template');
$view->header = new View('base/header');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Show VoIP');
$view->content = new View('voip/show');
$view->content->headline = url_lang::lang('texts.Show VoIP');
$view->content->voip = $voip->current();
$view->content->link_status = $link_status;
$view->footer = new View('base/footer');
$view->render(TRUE);
}
function edit($user_id = NULL)
{
if (!isset($user_id))
Controller::warning(1);
$voip_sip = new Voip_sip_Model();
$voip = $voip_sip->get_record_by_user_limited($user_id);
if ($voip->count() == 0)
Controller::error(4);
}
function add($user_id = NULL)
{
if (!isset($user_id))
Controller::warning(1);
$voip_sip = new Voip_sip_Model();
$voip = $voip_sip->get_record_by_user_limited($user_id);
if ($voip->count() == 0)
Controller::error(4);
}
}
freenetis/trunk/kohana/application/libraries/MY_Controller.php
break;
case 4:
$message = url_lang::lang('states.This group do not exist');
$message = url_lang::lang('states.This record do not exist');
$this->showbox( $message, $this->ICON_ERROR, $content);
break;
......
<li>'.html::anchor(url_lang::base().'vlans', url_lang::lang('texts.Vlans')).'</li>
<li>'.html::anchor(url_lang::base().'ip_addresses', url_lang::lang('texts.IP addresses')).'</li>
<li>'.html::anchor(url_lang::base().'subnets', url_lang::lang('texts.Subnets')).'</li>
<li>'.html::anchor(url_lang::base().'voip', url_lang::lang('texts.VoIP')).'</li>
</ul>
</li>
';
freenetis/trunk/kohana/application/views/users/show.php
<th><?php echo url_lang::lang('texts.Address') ?></th>
<td><?php echo $user_data->member->street.' '.$user_data->member->street_number.'<br />'.$user_data->member->ZIP_code.' '.$user_data->member->town ?></td>
</tr>
<tr>
<th><?php echo url_lang::lang('texts.VoIP') ?></th>
<td><?php echo $voip ?></td>
</tr>
<?php foreach ($contacts as $i => $contact):?>
<tr>
<th><?php echo $contact_types[$i] ?></th>

Také k dispozici: Unified diff