Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1012

Přidáno uživatelem Michal Kliment před více než 13 roky(ů)

Merge z testingu do trunku: Oprava ukladani GPS u pridavani/editace zarizeni. Dalsi mensi opravy.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'add admin to redirection module' => 'Přidat správce do modulu přesměrování',
'add address point' => 'Přidat adresní bod',
'add backup' => 'Přidat zálohu',
'add comment' => 'Přidat komentář k finančnímu stavu člena',
'add comment to financial state of member' => 'Přidat komentář k finančnímu stavu člena',
'add comment to work' => 'Přidat komentář k práci',
'add contact' => 'Přidat kontakt',
'add member fee payment by cash' => 'Přidat platbu členského příspěvku hotově',
'add new' => 'Přidat nový',
......
'direction' => 'Směr',
'directory "static" is not writable, change access rights' => 'Adresář "static" není zapisovatelný, změňte přístupová práva.',
'directory "upload" is not writable, change access rights' => 'Adresář "upload" není zapisovatelný, změňte přístupová práva.',
'directory "media/images" is not writable, change access rights to be able upload your own logo' => 'Adresář "media/images" není zapisovatelný, změňte přístupové práva pro možnost nahrát vlastní logo.',
'disable this subnet' => 'Zakázat tuto podsíť',
'disabled' => 'Vypnuto',
'disagree' => 'Nesouhlas',
freenetis/trunk/kohana/application/i18n/cs_CZ/help.php
'recalculate_account_balances' => 'Primárním zdrojem o stavu financí v systému jsou převody. Zůstatky na účtech byly dříve pokaždé počítány na požádání z převodů. Nyní si každý účet ukládá svůj zůstatek kvůli vyšší rychlosti. Tuto funkci použijete v případě přechodu na verzi systému, která tuto optimalizaci obsahuje.',
'recalculate_fees' => 'Pro primární strhávání členských příspěvků používejte funkci pro globální strhávání členských příspěvků v Účetním deníku. Tuto funkci používejte opatrně a to jen v případě, že máte správně strženy všechny členské příspěvky pro všechny členy od založení sdružení až po současné datum. Pak můžete tomuto členovi přepočítat stržení členských příspěvků v případě, že u něj došlo k nutnosti je přepočítat, např. chybné datum vstupu, vznikla nutnost přidat přerušení členství apod.',
'recalculate_entrance_fees' => 'Pro primární strhávání vstupních příspěvků používejte funkci pro globální strhávání v účetním deníku. Tuto funkci používejte jen v případě, že došlo k nějakému omylu, například, že měl zaplatit vstupní a pak se ukázalo, že nemusel.',
'registration_logo' => 'Jedná se o logo sdružení, které se zobrazí v levém horním rohu vyexportované přihlášky',
'service' => 'Je-li pro tuto IP adresu zapnuta služba, pak je tato IP adresa využívána pro Radius. Typicky jde o IP adresy aktivních síťových prvků, na které je se možné pomocí Radiusu přihlásit.',
'subnet_owner' => 'IP adresy, jenž nejsou v systému, patřící do podsítě budou přiřazeni k tomuto členovi-vlastníkovi. Na tyto podsítě se tedy nevztahuje přesměrování Neznámé zařízení - neznámé IP adresy jsou přiřazeni k členovi.',
'subnet_used_ips' => 'Jedná se procentuální vyjádření využití IP adres v podsíti. Červené zbarvení značí docházející IP adresy, zelené pak nevyužitou podsít (zbytečně velká?).',
freenetis/trunk/kohana/application/helpers/valid.php
}
}
/**
* Checks whether string is valid GPS string
*
* @author Michal Kliment
* @param string $str
* @return boolean
*/
public static function gps_string ($str)
{
if ($str == '')
return true;
$c = explode(" ",trim($str));
if (count($c) != 2)
return false;
if (substr(trim($c[0]),-2,1) != 'N' || substr(trim($c[1]),-1) != 'E')
return false;
$north_gps = substr(trim($c[0]),0,-2);
$east_gps = substr(trim($c[1]), 0, -1);
return (gps::is_valid_degrees_coordinate($north_gps) && gps::is_valid_degrees_coordinate($east_gps));
}
} // End valid
freenetis/trunk/kohana/application/helpers/callback.php
echo "<span class='help' title='".$item->a_comment."'><img src='".url::base()."media/images/icons/comment.png'></span>";
if (isset($item->member_id) && $item->member_id != 1)
echo ' '.html::anchor (url_lang::base() . (($item->a_comments_thread_id) ? 'comments/add/'.$item->a_comments_thread_id : 'comments_threads/add/account/'.$item->aid), html::image(array('src' => url::base().'media/images/ico_add.gif')), array('title' => url_lang::lang('texts.Add comment')));
echo ' '.html::anchor (url_lang::base() . (($item->a_comments_thread_id) ? 'comments/add/'.$item->a_comments_thread_id : 'comments_threads/add/account/'.$item->aid), html::image(array('src' => url::base().'media/images/ico_add.gif')), array('title' => url_lang::lang('texts.Add comment to financial state of member')));
}
/**
freenetis/trunk/kohana/application/controllers/transfers.php
));
$url = ($account->comments_thread_id) ? url_lang::base().'comments/add/'.$account->comments_thread_id : url_lang::base().'comments_threads/add/account/'.$account->id;
$comments_grid->add_new_button($url, url_lang::lang('texts.Add comment'));
$comments_grid->add_new_button($url, url_lang::lang('texts.Add comment to financial state of member'));
//$comments_grid->field('id')->label('ID');
$comments_grid->field('text')->label(url_lang::lang('texts.Text'));
freenetis/trunk/kohana/application/controllers/settings.php
$this->form = new Forge(url_lang::base()."settings/registration_export", '', 'POST', array('id' => 'article_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
$this->form->group('')->label(url_lang::lang('texts.Export of registration'));
$this->form->upload('registration_logo')->label(url_lang::lang('texts.Logo').':')->rules('allow[jpg]')->directory('media/images/')->new_name('logo.jpg');
// directory is writable
if (is_writable('media/images'))
$this->form->upload('registration_logo')->label(url_lang::lang('texts.Logo').':')->rules('allow[jpg]')->directory('media/images/')->new_name('logo.jpg')->help(help::hint('registration_logo'));
$this->form->html_textarea('registration_info')->label(url_lang::lang('texts.Info').':')->rows(5)->cols(100)->value($this->settings->get('registration_info'));
$this->form->html_textarea('registration_license')->label(url_lang::lang('texts.License').':')->rows(5)->cols(100)->value($this->settings->get('registration_license'));
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
......
$view->content->headline = url_lang::lang('texts.Export of registration');
$message = $this->session->get_once('message');
if (!empty($message))
$view->content->message = $message;
$view->content->message = $message;
// directory is not writable
if (!is_writable('media/images'))
$view->content->warning = url_lang::lang('texts.Directory "media/images" is not writable, change access rights to be able upload your own logo.');
$view->render(TRUE);
}
freenetis/trunk/kohana/application/controllers/works.php
));
$url = ($work->comments_thread_id) ? url_lang::base().'comments/add/'.$work->comments_thread_id : url_lang::base().'comments_threads/add/job/'.$work->id;
$comments_grid->add_new_button($url, url_lang::lang('texts.Add comment'));
$comments_grid->add_new_button($url, url_lang::lang('texts.Add comment to work'));
$comments_grid->field('text')->label(url_lang::lang('texts.Text'));
$comments_grid->callback_field('user_id')->label(url_lang::lang('texts.User'))->callback('callback::user_field');
......
$links = html::anchor(url_lang::base().'work_reports/show/'.$work->job_report_id, url_lang::lang('texts.Back to the work report'));
}
if ($this->acl_check_view('Comments_Controller', 'works', $work->user->member_id))
{
$comment_model = new Comment_Model();
$comments = $comment_model->get_all_comments_by_comments_thread($work->comments_thread_id);
$comments_grid = new Grid(url_lang::base().'members', null,array(
'separator' => '<br /><br />',
'use_paginator' => false,
'use_selector' => false,
));
$url = ($work->comments_thread_id) ? url_lang::base().'comments/add/'.$work->comments_thread_id : url_lang::base().'comments_threads/add/job/'.$work->id;
$comments_grid->add_new_button($url, url_lang::lang('texts.Add comment to work'));
$comments_grid->field('text')->label(url_lang::lang('texts.Text'));
$comments_grid->callback_field('user_id')->label(url_lang::lang('texts.User'))->callback('callback::user_field');
$comments_grid->field('datetime')->label(url_lang::lang('texts.Time'));
$comments_grid->callback_field('user_id')->label(url_lang::lang('texts.Edit'))->callback('callback::edit_field','comments');
$comments_grid->callback_field('user_id')->label(url_lang::lang('texts.Delete'))->callback('callback::delete_field','comments');
$comments_grid->datasource($comments);
}
$view = new View('main');
$view->title = url_lang::lang('texts.Show work');
$view->breadcrumbs = implode(' » ', $this->breadcrumbs);
......
$view->content->sums = $sums;
$view->content->state_text = $state_text;
$view->content->percents = $percents;
if ($this->acl_check_view('Comments_Controller', 'works', $work->user->member_id))
$view->content->comments_grid = $comments_grid;
$view->render(TRUE);
}
freenetis/trunk/kohana/application/controllers/devices.php
$grid_ports->action_field('id')->label(url_lang::lang('texts.Port'))->url(url_lang::base().'ports/delete')->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this port').'\');"');
$grid_ports->datasource($ports);
$gps = "";
if (! empty ($device->address_point->gps))
{
$gps_result = ORM::factory('address_point')->get_gps_coordinates($device->address_point->id);
if (! empty($gps_result))
{
$gps = gps::degrees($gps_result->gpsx, $gps_result->gpsy, true);
}
}
$sections = array(
'interfaces' => url_lang::lang('texts.Interfaces'),
'vlan_interfaces' => url_lang::lang('texts.Vlan interfaces'),
......
$view->content->table_vlan_ifaces = $grid_vlan_ifaces;
$view->content->table_ports = $grid_ports;
$view->content->table_ip_addresses = $grid_ips;
$view->content->gps = $gps;
$view->content->sec_links = implode(' | ', $sec_links);
$view->render(TRUE);
} // end of show
......
$form->input('payment_rate')->label(url_lang::lang('texts.Monthly payment rate').':')->rules('valid_numeric');
$form->date('buy_date')->label(url_lang::lang('texts.Buy date').':')->years(date('Y')-100, date('Y'));
$form->group('')->label(url_lang::lang('texts.Address'));
$form->input('GPS')->label(url_lang::lang('texts.GPS').':')->rules('length[3,100]')->value($selected_GPS);
$form->input('GPS')->label(url_lang::lang('texts.GPS').':')->rules('valid_gps_string')->value($selected_GPS);
$form->dropdown('street_id')->label(url_lang::lang('texts.Street').':')->options($arr_streets)->selected($selected_street_id)->add_button('streets');
$form->input('street_number')->label(url_lang::lang('texts.Street number').':')->rules('length[1,50]|valid_numeric')->value($selected_street_number);
$form->dropdown('town_id')->label(url_lang::lang('texts.Town').':')->rules('required')->options($arr_towns)->selected($selected_town_id)->add_button('towns');
......
$device_model->comment = htmlspecialchars($form_data["comment"]);
$address_point_model = new Address_point_Model();
$address_point = $address_point_model->exist_address_point($form_data["town_id"], $form_data["street_id"], $form_data["street_number"]);
$address_point = $address_point_model->exist_address_point(Settings::get('default_country'), $form_data["town_id"], $form_data["street_id"], $form_data["street_number"]);
if (!$address_point->id)
{
$address_point->town_id = $form_data["town_id"];
$address_point->street_id = $form_data["street_id"];
$address_point->street_number = $form_data["street_number"];
$address_point->clear();
$address_point->country_id = Settings::get('default_country');
$address_point->town_id = $form_data["town_id"];
$address_point->street_id = $form_data["street_id"];
$address_point->street_number = $form_data["street_number"];
$address_point->save();
}
$address_point->gps = $form_data["GPS"];
if (isset($form_data['GPS']) && $form_data['GPS'] != '')
{
list($north_gps, $east_gps) = explode(" ",$form->GPS->value);
$north_gps = substr(trim($north_gps),0,-2);
$east_gps = substr(trim($east_gps), 0, -1);
$address_point->save();
$gpsx = doubleval($north_gps);
$gpsy = doubleval($east_gps);
if (gps::is_valid_degrees_coordinate($north_gps))
$gpsx = gps::degrees2real($north_gps);
if (gps::is_valid_degrees_coordinate($east_gps))
$gpsy = gps::degrees2real($east_gps);
$address_point->update_gps_coordinates($address_point->id, $gpsx, $gpsy);
}
// delete gps
else
{
$address_point->gps = '';
$address_point->save();
}
$device_model->address_point_id = $address_point->id;
$device_saved = $device_model->save();
......
$form->input('payment_rate')->label(url_lang::lang('texts.Monthly payment rate').':')->rules('valid_numeric');
$form->date('buy_date')->label(url_lang::lang('texts.Buy date').':')->years(date('Y')-100, date('Y'));
$form->group('')->label(url_lang::lang('texts.Address'));
$form->input('GPS')->label(url_lang::lang('texts.GPS').':')->rules('length[3,100]')->value($selected_GPS);
$form->input('GPS')->label(url_lang::lang('texts.GPS').':')->rules('valid_gps_string')->value($selected_GPS);
$form->dropdown('street_id')->label(url_lang::lang('texts.street').':')->options($arr_streets)->selected($selected_street_id)->add_button('streets');
$form->input('street_number')->label(url_lang::lang('texts.street number').':')->rules('length[1,50]|valid_numeric')->value($selected_street_number);
$form->dropdown('town_id')->label(url_lang::lang('texts.town').':')->rules('required')->options($arr_towns)->selected($selected_town_id)->add_button('towns');
......
->callback(array($this, 'valid_ip'));
$form->dropdown('subnet_id')->label(url_lang::lang('texts.Select subnet name').':')->rules('required')
->options($arr_subnets_names)->selected($selected_subnet)->add_button('subnets');
// submit button
$form->submit('submit')->value(url_lang::lang('texts.Save'));
special::required_forge_style($form, ' *', 'required');
......
$device_model->comment = htmlspecialchars($form_data["comment"]);
$address_point_model = new Address_point_Model();
$address_point = $address_point_model->exist_address_point($form_data["town_id"], $form_data["street_id"], $form_data["street_number"]);
$address_point = $address_point_model->exist_address_point(Settings::get('default_country'), $form_data["town_id"], $form_data["street_id"], $form_data["street_number"]);
if (!$address_point->id)
{
$address_point->town_id = $form_data["town_id"];
$address_point->street_id = $form_data["street_id"];
$address_point->street_number = $form_data["street_number"];
$address_point->clear();
$address_point->country_id = Settings::get('default_country');
$address_point->town_id = $form_data["town_id"];
$address_point->street_id = $form_data["street_id"];
$address_point->street_number = $form_data["street_number"];
$address_point->save();
}
$address_point->gps = $form_data["GPS"];
if (isset($form_data['GPS']) && $form_data['GPS'] != '')
{
list($north_gps, $east_gps) = explode(" ",$form->GPS->value);
$north_gps = substr(trim($north_gps),0,-2);
$east_gps = substr(trim($east_gps), 0, -1);
$address_point->save();
$gpsx = doubleval($north_gps);
$gpsy = doubleval($east_gps);
if (gps::is_valid_degrees_coordinate($north_gps))
$gpsx = gps::degrees2real($north_gps);
if (gps::is_valid_degrees_coordinate($east_gps))
$gpsy = gps::degrees2real($east_gps);
$address_point->update_gps_coordinates($address_point->id, $gpsx, $gpsy);
}
// delete gps
else
{
$address_point->gps = '';
$address_point->save();
}
$device_model->address_point_id = $address_point->id;
$device_saved = $device_model->save();
......
Controller::error(RECORD);
if (!$this->acl_check_edit(get_class($this),'devices',$device->user->member_id))
Controller::error(ACCESS);
$gps = '';
if ($device->address_point->gps != '')
{
$gps_result = ORM::factory('address_point')->get_gps_coordinates($device->address_point->id);
if (! empty($gps_result))
{
$gps = gps::degrees($gps_result->gpsx,$gps_result->gpsy,FALSE);
}
}
$user_model = new User_Model;
$users = $user_model->select('id','name','surname','login')->orderby('id')->find_all();
......
$form->input('payment_rate')->label(url_lang::lang('texts.Monthly payment rate').':')->rules('valid_numeric')->value($device->payment_rate);
$form->date('buy_date')->label(url_lang::lang('texts.Buy date').':')->years(date('Y')-100, date('Y'))->value(strtotime($device->buy_date));
$form->group('')->label(url_lang::lang('texts.Address'));
$form->input('GPS')->label(url_lang::lang('texts.GPS').':')->rules('length[3,100]')->value($device->address_point->gps);
$form->input('GPS')->label(url_lang::lang('texts.GPS').':')->rules('valid_gps_string')->value($gps);
$form->dropdown('street_id')->label(url_lang::lang('texts.Street').':')->options($arr_streets)->selected($device->address_point->street_id)->add_button('streets');
$form->input('street_number')->label(url_lang::lang('texts.Street number').':')->rules('length[1,50]|valid_numeric')->value($device->address_point->street_number);
$form->dropdown('town_id')->label(url_lang::lang('texts.Town').':')->rules('required')->options($arr_towns)->selected($device->address_point->town_id)->add_button('towns');
......
$device->buy_date = date('Y-m-d', $form_data["buy_date"]);
$address_point_model = new Address_point_Model();
$address_point = $address_point_model->exist_address_point($form_data["town_id"], $form_data["street_id"], $form_data["street_number"]);
$address_point = $address_point_model->exist_address_point(Settings::get('default_country'), $form_data["town_id"], $form_data["street_id"], $form_data["street_number"]);
if (!$address_point->id)
{
$address_point->clear();
$address_point->country_id = Settings::get('default_country');
$address_point->town_id = $form_data["town_id"];
$address_point->street_id = $form_data["street_id"];
$address_point->street_number = $form_data["street_number"];
$address_point->save();
}
$address_point->gps = $form_data["GPS"];
$address_point->save();
if (isset($form_data['GPS']) && $form_data['GPS'] != '')
{
list($north_gps, $east_gps) = explode(" ",$form->GPS->value);
$north_gps = substr(trim($north_gps),0,-2);
$east_gps = substr(trim($east_gps), 0, -1);
$gpsx = doubleval($north_gps);
$gpsy = doubleval($east_gps);
if (gps::is_valid_degrees_coordinate($north_gps))
$gpsx = gps::degrees2real($north_gps);
if (gps::is_valid_degrees_coordinate($east_gps))
$gpsy = gps::degrees2real($east_gps);
$address_point->update_gps_coordinates($address_point->id, $gpsx, $gpsy);
}
// delete gps
else
{
$address_point->gps = '';
$address_point->save();
}
$device->address_point_id = $address_point->id;
$device_saved = $device->save();
freenetis/trunk/kohana/application/controllers/comments.php
$breadcrumbs[] = html::anchor (url_lang::base().'members/show_all', url_lang::lang('texts.Members'));
$breadcrumbs[] = html::anchor(url_lang::base().'members/show/'.$parent->member_id,"ID ".$parent->member->id." - ".$parent->member->name);
$breadcrumbs[] = html::anchor ($link_back_url, url_lang::lang('texts.Transfers'));
$breadcrumbs[] = url_lang::lang('texts.Add comment');
$breadcrumbs[] = $title = url_lang::lang('texts.Add comment to financial state of member');
break;
case 'job':
// access control
......
}
$breadcrumbs[] = ($this->acl_check_view('Users_Controller', 'work',$parent->user->member_id)) ? html::anchor (url_lang::base().'works/show/'.$parent->id, url_lang::lang('texts.ID').' '.$parent->id) : url_lang::lang('texts.ID').' '.$parent->id;
}
$breadcrumbs[] = url_lang::lang('texts.Add comment');
$breadcrumbs[] = $title = url_lang::lang('texts.Add comment to work');
break;
default:
Controller::error(RECORD);
......
}
$view = new View('main');
$view->title = url_lang::lang('texts.Add comment');
$view->title = $title;
$view->breadcrumbs = implode(' » ', $breadcrumbs);
$view->content = new View('form');
$view->content->headline = url_lang::lang('texts.Add comment');
$view->content->headline = $title;
$view->content->link_back = '';
$view->content->form = $form->html();
$view->render(TRUE);
freenetis/trunk/kohana/application/views/members_show.php
echo html::anchor(url_lang::base().'transfers/add_member_fee_payment_by_cash/'.$member->id, html::image(array('src' => url::base().'media/images/icons/purse.png')), array('title' => url_lang::lang('texts.Add member fee payment by cash')));
if ($this->acl_check_view ('Members_Controller','comment',$member->id))
echo html::anchor(($account->comments_thread_id ? (url_lang::base().'comments/add/'.$account->comments_thread_id) : (url_lang::base().'comments_threads/add/account/'.$account->id)), html::image(array('src' => url::base().'media/images/icons/comment_add.png')), array('title' => url_lang::lang('texts.Add comment'))) ?>
echo html::anchor(($account->comments_thread_id ? (url_lang::base().'comments/add/'.$account->comments_thread_id) : (url_lang::base().'comments_threads/add/account/'.$account->id)), html::image(array('src' => url::base().'media/images/icons/comment_add.png')), array('title' => url_lang::lang('texts.Add comment to financial state of member'))) ?>
</td>
</tr>
<?php if (isset($expiration_date)) { ?>
freenetis/trunk/kohana/application/views/settings.php
<h3 class="clear"><?php echo $headline ?></h3>
<br />
<?php echo (isset($warning) && $warning != '') ? '<p class="red">'.$warning.'</p><br />' : '' ?>
<?php echo $content ?>
<?php echo (isset($additional_info) && $additional_info!='') ? '<br /><br />'.$additional_info : '' ?>
freenetis/trunk/kohana/application/views/devices_show.php
echo $device->address_point->town->zip_code;
?></td>
</tr>
<?php if ($gps != ''): ?>
<tr>
<th><?php echo url_lang::lang('texts.GPS') ?></th>
<td><?php echo gps::degrees_from_str($device->address_point->gps, true) ?> <?php // echo html::anchor('http://www.mapy.cz/#z=14@st=s@sss=1@mm=FP@ssq=loc:'.$device->gps, url_lang::lang('texts.Map'), 'target="_blank" title="mapy.cz"') ?></td>
<td><?php echo $gps ?> <?php // echo html::anchor('http://www.mapy.cz/#z=14@st=s@sss=1@mm=FP@ssq=loc:'.$device->gps, url_lang::lang('texts.Map'), 'target="_blank" title="mapy.cz"') ?></td>
</tr>
<?php endif ?>
<tr>
<th><?php echo url_lang::lang('texts.Comment') ?></th>
<td><?php echo $device->comment ?></td>

Také k dispozici: Unified diff