Projekt

Obecné

Profil

« Předchozí | Další » 

Revize c1bdc1c4

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

Release 1.1.0

Zobrazit rozdíly:

application/controllers/js.php
$this->view->render(TRUE);
}
/**
* @see MY_Controller#is_preprocesor_enabled()
*/
protected function is_preprocesor_enabled()
{
return FALSE;
}
/***************** Methods for javascript queries *************************/
private function _js_address_points_add()
......
$this->address_point_gps();
}
private function _js_bank_accounts_auto_down_settings_add()
{
$this->time_activity_rule();
}
private function _js_device_templates_edit($device_template_id = NULL)
{
$dtm = new Device_template_Model($device_template_id);
......
}
}
private function _js_devices_add($user_id = NULL)
private function _js_devices()
{
$this->ip_addresses_complete();
}
private function _js_devices_add($user_id = NULL, $connection_request_id = NULL)
{
$user = new User_Model($user_id);
......
$user_id = User_Model::ASSOCIATION;
}
$this->address_point_streets();
$this->address_point_gps();
$cr_model = new Connection_request_Model($connection_request_id);
if (Address_points_Controller::is_address_point_server_active())
{
$this->address_point_whisperer();
$this->address_point_whisperer_gps();
}
else
{
$this->address_point_streets();
$this->address_point_gps();
}
$subnet = new Subnet_Model();
$device = new Device_Model();
$this->views['devices_add'] = View::factory('js/devices_add');
$this->views['devices_add']->arr_subnets = $subnet->select_list_by_net();
$this->views['devices_add']->arr_gateway_subnets = arr::from_objects($subnet->get_all_subnets_with_gateway());
$this->views['devices_add']->arr_devices = $device->select_list_device_with_user($user_id);
$this->views['devices_add']->connection_request_model = ($cr_model->loaded) ? $cr_model : NULL;
}
private function _js_devices_add_simple()
{
$this->address_point_streets();
$this->address_point_gps();
if (Address_points_Controller::is_address_point_server_active())
{
$this->address_point_whisperer();
$this->address_point_whisperer_gps();
}
else
{
$this->address_point_streets();
$this->address_point_gps();
}
}
private function _js_devices_add_filter()
......
private function _js_devices_edit()
{
$this->address_point_streets();
$this->address_point_gps();
if (Address_points_Controller::is_address_point_server_active())
{
$this->address_point_whisperer_gps();
$this->address_point_whisperer();
}
else
{
$this->address_point_streets();
$this->address_point_gps();
}
}
private function _js_devices_ports_vlans_settings ($device_id = NULL, $vlan_id = NULL)
{
$this->views['devices_ports_vlans_settings'] = View::factory('js/devices_ports_vlans_settings');
$this->views['devices_ports_vlans_settings']->vlan_id = $vlan_id;
}
private function _js_devices_map()
{
$action = '';
......
$this->views['devices_map']->name = $name;
}
private function _js_devices_topology($device_id)
{
$this->views['devices_add'] = View::factory('js/devices_topology');
$this->views['devices_add']->device_id = $device_id;
}
private function _js_ifaces_add($device_id = null, $itype = null,
$add_button = FALSE, $connect_type = NULL)
{
$this->views['ifaces_add'] = View::factory('js/ifaces_add');
$this->views['ifaces_add']->iface_id = NULL;
$this->views['ifaces_add']->device_id = $device_id;
$this->views['ifaces_add']->itype = $itype;
$this->views['ifaces_add']->add_button = $add_button;
......
$this->views['ifaces_edit'] = View::factory('js/ifaces_add');
$this->views['ifaces_edit']->device_id = $iface->device_id;
$this->views['ifaces_edit']->iface_id = $iface->id;
$this->views['ifaces_edit']->itype = $type;
$this->views['ifaces_edit']->add_button = $add_button;
$this->views['ifaces_edit']->connect_type = $connect_type;
......
}
}
private function _js_invoices_add()
{
$this->invoice_form();
$this->members_ares();
}
private function _js_invoices_edit()
{
$this->invoice_form();
}
private function _js_ip_addresses()
{
$this->ip_addresses_complete();
}
private function _js_mail_write_message()
{
// load users for autocomplete
$um = new User_Model();
$user_list = $um
->select_list('login', "CONCAT(surname, ' ', COALESCE(name,''), ' - ', login)", 'surname');
$result = array();
foreach ($user_list AS $login => $user)
{
$result[] = array(
'login' => $login,
'value' => $user
);
}
$this->views['mail_write_message'] = View::factory('js/mail_write_message');
$this->views['mail_write_message']->users_list = json_encode($result);
}
private function _js_members()
{
$this->members_ares();
}
private function _js_members_add()
{
$this->address_point_streets();
$this->address_point_gps();
if (Address_points_Controller::is_address_point_server_active())
{
$this->address_point_whisperer_gps();
$this->address_point_whisperer();
}
else
{
$this->address_point_streets();
$this->address_point_gps();
}
$this->domicile_toogle();
$this->member_type();
}
private function _js_members_approve_applicant($applicant_id)
{
$applicant = new Member_Model($applicant_id);
if ($applicant && $applicant->id)
{
$this->views['members_approve_applicant'] = View::factory('js/members_approve_applicant');
$this->views['members_approve_applicant']->applicant_connected_from = $applicant->applicant_connected_from;
}
}
private function _js_members_edit()
{
$this->address_point_streets();
$this->address_point_gps();
if (Address_points_Controller::is_address_point_server_active())
{
$this->address_point_whisperer_gps();
$this->address_point_whisperer();
}
else
{
$this->address_point_streets();
$this->address_point_gps();
}
$this->domicile_toogle();
$this->member_type();
}
private function _js_members_fees_add($member_id = NULL, $fee_type_id = NULL)
......
// fee_id is not set (or it is not numeric)
else
{
$fees = $fee_model->get_all_fees('type_id');
$total_fees = $fee_model->count_all();
$fees = $fee_model->get_all_fees(0, $total_fees, 'type_id');
}
$this->views['members_fees_add'] = View::factory('js/members_fees_add');
......
$this->notification_activate();
}
private function _js_messages_auto_settings_add()
{
$this->time_activity_rule();
}
private function _js_notifications_cloud()
{
$this->notification_activate();
}
private function _js_notifications_device()
{
$this->notification_activate();
}
private function _js_notifications_devices()
{
$this->notification_activate();
}
private function _js_notifications_member()
{
$this->notification_activate();
......
$this->notification_activate();
}
private function _js_phone_invoices_import()
{
$types = Parser_Phone_Invoice::get_parser_input_types();
$files = Parser_Phone_Invoice::get_parser_upload_files();
$this->views['phone_invoices_import'] = View::factory('js/phone_invoices_import');
$this->views['phone_invoices_import']->types = json_encode($types);
$this->views['phone_invoices_import']->files = json_encode($files);
}
private function _js_registration()
{
$this->address_point_streets();
$this->address_point_gps();
if (Address_points_Controller::is_address_point_server_active())
{
$this->address_point_whisperer();
$this->address_point_whisperer_gps();
}
else
{
$this->address_point_streets();
$this->address_point_gps();
}
}
private function _js_settings_system()
{
$modules = array();
foreach (Settings_Controller::$modules as $module => $module_info)
{
foreach ($module_info['dependencies'] as $dependency)
{
$value = $module_info['name'];
$key = Settings_Controller::$modules[$dependency]['name'];
if (!isset($modules[$key]))
$modules[$key] = array();
$modules[$key][] = $value;
}
}
$this->views['settings_system'] = View::factory('js/settings_system');
$this->views['settings_system']->modules = $modules;
}
private function _js_transfers_add_from_account($origin_account_id = NULL)
{
$this->views['transfers_add_from_account'] = View::factory('js/transfers_add_from_account');
$this->views['transfers_add_from_account']->origin_account_id = $origin_account_id;
}
private function _js_transfers_payment_calculator($account_id = NULL)
{
$member_id = NULL;
......
$this->views['users_show'] = View::factory('js/users_show')->render();
}
private function _js_users_show_work_report($work_id = NULL)
{
$this->views['users_show_work_report'] = View::factory('js/work_reports_show')->render();
}
private function _js_voip_show($user_id = NULL)
{
$this->voip_calculator($user_id);
......
View::factory('js/__pieces/address_point_street')->render();
}
/**
* Adds javascript for GPS filling in address point
*/
private function address_point_whisperer_gps()
{
$this->views['__pieces_gps'] =
View::factory('js/__pieces/whisperer_gps')->render();
}
/**
* Adds javascript for loading address points using json
*/
private function address_point_whisperer()
{
$this->views['__pieces_address_point_database'] =
View::factory('js/__pieces/address_point_database');
$this->views['__pieces_address_point_database']->url = Settings::get('address_point_url');
}
/**
* Adds javascript for toogling domicicles
*/
......
}
/**
* Adds javascript for handling of member type. (Form is changed according to type)
* Adds javascript for adding or editing of invoice.
*
* @author Jan Dubina
*/
private function invoice_form()
{
$this->views['__pieces_invoice'] =
View::factory('js/__pieces/invoice')->render();
}
/**
* Adds javascript for handling of time activity rule attributes.
*
* @author Ondřej Fibich
*/
private function member_type()
private function time_activity_rule()
{
$this->views['__pieces_member_type'] =
View::factory('js/__pieces/member_type')->render();
$this->views['__pieces_time_activity_rule'] =
View::factory('js/__pieces/time_activity_rule')->render();
}
/**
......
View::factory('js/__pieces/work_report_form_functions')->render();
}
/**
* Adds javascript for notification messages
*/
private function notification_activate()
{
$this->views['__pieces_notification_activate'] =
View::factory('js/__pieces/notification_activate')->render();
$this->views['__pieces_notification_message'] =
View::factory('js/__pieces/notification_message')->render();
}
/**
* Adds javascript for IP address adding/editing
*/
private function ip_addresses_complete()
{
$this->views['__pieces_ip_addresses_complete'] =
View::factory('js/__pieces/ip_addresses_complete')->render();
}
/**
* Adds javascript for loading member's data from ARES
*/
private function members_ares()
{
$this->views['__pieces_members_ares'] =
View::factory('js/__pieces/members_ares')->render();
}
}

Také k dispozici: Unified diff