Revize 2182
Přidáno uživatelem David Raška před asi 11 roky(ů)
freenetis/branches/1.1/application/controllers/address_points.php | ||
---|---|---|
Controller::error(ACCESS);
|
||
|
||
// country
|
||
$arr_countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
$arr_countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
|
||
// streets
|
||
$arr_streets = array
|
||
... | ... | |
Controller::error(ACCESS);
|
||
|
||
// country
|
||
$arr_countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
|
||
$arr_countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
$arr_countries = $arr_countries + ORM::factory('country')->where('id', $ap->country_id)->select_list('id', 'country_name');
|
||
|
||
// streets
|
||
$arr_streets = array
|
||
(
|
freenetis/branches/1.1/application/controllers/devices.php | ||
---|---|---|
$selected_street_id = $um->member->address_point->street_id;
|
||
$selected_street_number = $um->member->address_point->street_number;
|
||
$selected_town_id = $um->member->address_point->town_id;
|
||
|
||
$selected_street = ($um->member->address_point->street != NULL ?
|
||
$um->member->address_point->street->street." " :
|
||
"");
|
||
$selected_street .= $selected_street_number;
|
||
|
||
if ($um->member->address_point->town != NULL)
|
||
{
|
||
$selected_town = $um->member->address_point->town->town;
|
||
$selected_district = ($um->member->address_point->town->quarter != NULL ?
|
||
$um->member->address_point->town->quarter :
|
||
""
|
||
);
|
||
$selected_zip = $um->member->address_point->town->zip_code;
|
||
}
|
||
else
|
||
{
|
||
$selected_town = "";
|
||
$selected_district = "";
|
||
$selected_zip = "";
|
||
}
|
||
|
||
$gps = $um->member->address_point->get_gps_coordinates();
|
||
|
||
if ($gps)
|
||
... | ... | |
) + Iface_Model::get_wireless_antennas();
|
||
|
||
// country
|
||
$arr_countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
$arr_countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
|
||
// streets
|
||
$arr_streets = array
|
||
... | ... | |
->rules('required')
|
||
->options($arr_countries)
|
||
->style('width:200px')
|
||
->selected(Settings::get('default_country'));
|
||
->selected(($selected_country_id != NULL ? $selected_country_id : Settings::get('default_country')));
|
||
|
||
$group_address->input('town')
|
||
->label(__('Town').' - '.__('District'))
|
||
->rules('required')
|
||
->class('join1');
|
||
->class('join1')
|
||
->value((isset($selected_town) ? $selected_town : ''));
|
||
|
||
$group_address->input('district')
|
||
->class('join2');
|
||
->class('join2')
|
||
->value((isset($selected_district) ? $selected_district : ''));
|
||
|
||
$group_address->input('street')
|
||
->label('Street')
|
||
->rules('required');
|
||
->rules('required')
|
||
->value((isset($selected_street) ? $selected_street : ''));
|
||
|
||
$group_address->input('zip')
|
||
->label('Zip code')
|
||
->rules('required');
|
||
->rules('required')
|
||
->value((isset($selected_zip) ? $selected_zip : ''));
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
$selected_street_id = $um->member->address_point->street_id;
|
||
$selected_street_number = $um->member->address_point->street_number;
|
||
$selected_town_id = $um->member->address_point->town_id;
|
||
|
||
$selected_street = ($um->member->address_point->street != NULL ?
|
||
$um->member->address_point->street->street." " :
|
||
"");
|
||
$selected_street .= $selected_street_number;
|
||
|
||
if ($um->member->address_point->town != NULL)
|
||
{
|
||
$selected_town = $um->member->address_point->town->town;
|
||
$selected_district = ($um->member->address_point->town->quarter != NULL ?
|
||
$um->member->address_point->town->quarter :
|
||
""
|
||
);
|
||
$selected_zip = $um->member->address_point->town->zip_code;
|
||
}
|
||
else
|
||
{
|
||
$selected_town = "";
|
||
$selected_district = "";
|
||
$selected_zip = "";
|
||
}
|
||
|
||
$gps = $um->member->address_point->get_gps_coordinates();
|
||
|
||
if ($gps)
|
||
... | ... | |
asort($types);
|
||
|
||
// country
|
||
$arr_countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
$arr_countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
|
||
// streets
|
||
$arr_streets = array
|
||
... | ... | |
->rules('required')
|
||
->options($arr_countries)
|
||
->style('width:200px')
|
||
->selected(Settings::get('default_country'));
|
||
->selected(($selected_country_id != NULL ? $selected_country_id : Settings::get('default_country')));
|
||
|
||
$group_address->input('town')
|
||
->label(__('Town').' - '.__('District'))
|
||
->rules('required')
|
||
->class('join1');
|
||
->class('join1')
|
||
->value((isset($selected_town) ? $selected_town : ''));
|
||
|
||
$group_address->input('district')
|
||
->class('join2');
|
||
->class('join2')
|
||
->value((isset($selected_district) ? $selected_district : ''));
|
||
|
||
$group_address->input('street')
|
||
->label('Street')
|
||
->rules('required');
|
||
->rules('required')
|
||
->value((isset($selected_street) ? $selected_street : ''));
|
||
|
||
$group_address->input('zip')
|
||
->label('Zip code')
|
||
->rules('required');
|
||
->rules('required')
|
||
->value((isset($selected_zip) ? $selected_zip : ''));
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
$arr_types = ORM::factory('enum_type')->get_values(Enum_type_Model::DEVICE_TYPE_ID);
|
||
|
||
// country
|
||
$arr_countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
|
||
$arr_countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
$arr_countries = $arr_countries + ORM::factory('country')->where('id', $device->address_point->country_id)->select_list('id', 'country_name');
|
||
|
||
// streets
|
||
$arr_streets = array
|
||
(
|
freenetis/branches/1.1/application/controllers/members.php | ||
---|---|---|
$entrance_fee = 0;
|
||
|
||
// countries
|
||
$arr_countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
$arr_countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
|
||
// streets
|
||
$arr_streets = array
|
||
... | ... | |
}
|
||
|
||
// countries
|
||
$arr_countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
$arr_countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
$arr_countries = $arr_countries + ORM::factory('country')->where('id', $member->address_point->country_id)->select_list('id', 'country_name');
|
||
|
||
// streets
|
||
// loads all streets if GET parametr with name 'street_id' exists.
|
freenetis/branches/1.1/application/controllers/phone_operators.php | ||
---|---|---|
}
|
||
|
||
// gets all countries to dropdown
|
||
$countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
$countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
|
||
// form
|
||
$form = new Forge('phone_operators/add');
|
||
... | ... | |
$this->_phone_operator_id = $phone_operator_model->id;
|
||
|
||
// gets all countries to dropdown
|
||
$countries = ORM::factory('country')->select_list('id', 'country_name');
|
||
$countries = ORM::factory('country')->where('enabled', 1)->select_list('id', 'country_name');
|
||
$arr_countries = $arr_countries + ORM::factory('country')->where('id', $phone_operator_model->country_id)->select_list('id', 'country_name');
|
||
|
||
// form
|
||
$form = new Forge('phone_operators/edit/' . $phone_operator_id);
|
freenetis/branches/1.1/application/controllers/registration.php | ||
---|---|---|
|
||
// countries
|
||
$country_model = new Country_Model();
|
||
$arr_countries = $country_model->select_list('id', 'country_name');
|
||
$arr_countries = $country_model->where('enabled', 1)->select_list('id', 'country_name');
|
||
|
||
// streets
|
||
$arr_streets = array
|
freenetis/branches/1.1/application/controllers/settings.php | ||
---|---|---|
->value($timeout)
|
||
->style('width:30px')
|
||
->help('Time threshold in minutes, before module is shown as inactive');
|
||
|
||
|
||
$this->form->group(__('URL settings') . ' ' . help::hint('url_settings'));
|
||
|
||
$this->form->dropdown('protocol')
|
||
... | ... | |
->label('Address point URL')
|
||
->help('address_point_url')
|
||
->value(Settings::get('address_point_url'));
|
||
|
||
$selected_countries = ORM::factory('country')->select('id')->where('enabled', 1)->find_all()->as_array();
|
||
|
||
$this->form->dropdown('enabled_countries[]')
|
||
->label('Enabled countries')
|
||
->options($countries)
|
||
->selected($selected_countries)
|
||
->multiple('multiple')
|
||
->size(10);
|
||
|
||
// load .htaccess sample file
|
||
if (($htaccessFile = @file('.htaccess-sample')) != FALSE)
|
||
... | ... | |
|
||
$issaved = true;
|
||
$message = '';
|
||
|
||
|
||
$issaved = $issaved && ORM::factory('country')->enable_countries($form_data['enabled_countries']);
|
||
|
||
unset($form_data['enabled_countries']);
|
||
|
||
foreach ($form_data as $name => $value)
|
||
{
|
||
if ($name == 'module_status_timeout')
|
freenetis/branches/1.1/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'enable voip' => 'Zapnout VoIP',
|
||
'enable' => 'Zapnout',
|
||
'enabled' => 'Zapnuto',
|
||
'enabled countries' => 'Povolené země',
|
||
'end editing of registrations' => 'Ukončit upravování přihlášek',
|
||
'end membership' => 'Ukončit členství',
|
||
'end membership after end' => 'Ukončit členství po skončení',
|
freenetis/branches/1.1/application/models/country.php | ||
---|---|---|
return $this->where(array
|
||
(
|
||
'country_code IS NOT' => NULL,
|
||
'country_code !=' => ''
|
||
'country_code !=' => '',
|
||
'enabled' => 1
|
||
))->select_list('id', $concat, 'country_code');
|
||
}
|
||
|
||
... | ... | |
return $this->where(array
|
||
(
|
||
'country_code IS NOT' => NULL,
|
||
'country_code !=' => ''
|
||
'country_code !=' => '',
|
||
'enabled' => 1
|
||
))->select_list('id', 'country_code', 'country_code');
|
||
}
|
||
|
||
... | ... | |
return ($query->count() == 1) ? $query->current()->country_code : '';
|
||
}
|
||
|
||
/**
|
||
* Enable countries to use
|
||
*
|
||
* @author David Raška
|
||
* @param array $countries
|
||
*/
|
||
public function enable_countries($countries)
|
||
{
|
||
$result = $this->db->query("
|
||
UPDATE countries
|
||
SET enabled=0;
|
||
");
|
||
|
||
if ($result)
|
||
{
|
||
if (is_array($countries) && count($countries) > 0)
|
||
{
|
||
$countries = array_map('mysql_real_escape_string', $countries);
|
||
|
||
$in = implode(', ', $countries);
|
||
|
||
|
||
$result = $this->db->query("
|
||
UPDATE countries
|
||
SET enabled=1
|
||
WHERE id IN ($in)
|
||
");
|
||
|
||
return (bool)$result;
|
||
}
|
||
else
|
||
{
|
||
return TRUE;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
return FALSE;
|
||
}
|
||
}
|
||
}
|
freenetis/branches/1.1/db_upgrades/upgrade_1.1.0~alpha56.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/
|
||
*
|
||
*/
|
||
|
||
/**
|
||
* This upgrade is not equal to any of previous upgrades
|
||
*
|
||
* @author David Raška
|
||
*/
|
||
$upgrade_equal_to['1.1.0~alpha56'] = array();
|
||
|
||
/**
|
||
* Adds enabled column to countries
|
||
*
|
||
* @author David Raška
|
||
*/
|
||
$upgrade_sql['1.1.0~alpha56'] = array
|
||
(
|
||
"ALTER TABLE `countries` ADD `enabled` TINYINT NOT NULL DEFAULT '1';"
|
||
);
|
freenetis/branches/1.1/version.php | ||
---|---|---|
* The current version of FreenetIS.
|
||
* This value must be changed by developers in a new release of FreenetIS.
|
||
*/
|
||
define('FREENETIS_VERSION', '1.1.0~alpha55');
|
||
define('FREENETIS_VERSION', '1.1.0~alpha56');
|
Také k dispozici: Unified diff
Opravy:
- Oprava predvyplnovani adresy pri pridavani zarizeni
Upravy:
- Moznost vybrani povolenych zemi