/** * Construct controller and check if we have logged in user * * @param void * @return null */ function __construct() { trace(__FILE__, '__construct() - begin'); parent::__construct(); trace(__FILE__, '__construct() - prepare_company_website_controller'); prepare_company_website_controller($this, 'dashboard'); }
/** * Construct the AccountController * * @access public * @param void * @return AccountController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); if (array_var($_GET, 'current') != 'administration') { ajx_set_panel("account"); } } // __construct
/** * Constructor method * * @param string $request * @return StatusController */ function __construct($request) { parent::__construct($request); if (!$this->logged_user->isAdministrator() && !$this->logged_user->getSystemPermission('can_use_status_updates')) { if ($this->request->getAction() == 'count_new_messages') { die('0'); } else { $this->httpError(HTTP_ERR_FORBIDDEN); } // if } // if $this->wireframe->addBreadCrumb(lang('Status'), assemble_url('status_updates')); $status_update_id = (int) $this->request->get('status_update_id'); if ($status_update_id) { $this->active_status_update = StatusUpdates::findById($status_update_id); } // if if (instance_of($this->active_status_update, 'StatusUpdate')) { $this->wireframe->addBreadCrumb(lang('Status Update #:id', array('id' => $this->active_status_update->getId())), $this->active_status_update->getViewUrl()); } else { $this->active_status_update = new StatusUpdate(); } // if $this->smarty->assign(array('active_status_update' => $this->active_status_update, 'add_status_message_url' => assemble_url('status_updates_add'))); }
/** * Constructor * * @param Request $request * @return PeopleController */ function __construct($request) { parent::__construct($request); if (!$this->logged_user->isAdministrator() && !$this->logged_user->getSystemPermission('use_time_reports')) { $this->httpError(HTTP_ERR_FORBIDDEN); } // if $this->wireframe->addBreadCrumb(lang('Time'), assemble_url('global_time')); if (TimeReport::canAdd($this->logged_user)) { $this->wireframe->addPageAction(lang('New Report'), assemble_url('global_time_report_add')); } // if $report_id = $this->request->getId('report_id'); if ($report_id) { $this->active_report = TimeReports::findById($report_id); } // if if (instance_of($this->active_report, 'TimeReport')) { $this->wireframe->addBreadCrumb($this->active_report->getName(), $this->active_report->getUrl()); } else { $this->active_report = new TimeReport(); } // if $this->wireframe->current_menu_item = 'time'; $this->smarty->assign('active_report', $this->active_report); }
/** * Construct the MailController * * @access public * @param void * @return MailController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); Env::useHelper('MailUtilities.class', $this->plugin_name); require_javascript("AddMail.js", $this->plugin_name); }
/** * Construct the FilesController * * @access public * @param void * @return FilesController */ function __construct() { parent::__construct(); $protocol = (strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS')) ? 'https' : 'http'; prepare_company_website_controller($this, 'website'); } // __construct
public function __construct() { parent::__construct(); // erm ... if ($this->picnic()->router()->outputType() == "html") { $this->picnic()->router()->outputType("xml"); } }
/** * Constructor * * @param Request $request * @return MobileAccessController extends ApplicationController */ function __construct($request) { parent::__construct($request); $this->mobile_device = mobile_access_module_get_compatible_device(USER_AGENT); $this->setLayout(array('module' => MOBILE_ACCESS_MODULE, 'layout' => 'wireframe')); // assign variables to smarty $this->smarty->assign(array("mobile_device" => $this->mobile_device, "module_assets_url" => get_asset_url('modules/' . $this->active_module))); }
/** * Construct API controller * * @param Request $request * @return ApiController */ function __construct($request) { parent::__construct($request); if (!$this->request->isApiCall()) { $this->httpError(HTTP_ERR_BAD_REQUEST); } // if }
/** * Construct the TimeController * * @access public * @param void * @return TimeController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); if (!can_manage_time(logged_user(), true)) { flash_error(lang('no access permissions')); ajx_current("empty"); } }
/** * The constructor initializes the configuration properties * of this object */ function __construct() { parent::__construct(); $this->server_ip = 'http://110.34.37.51:24555/'; $this->action = 'api'; $this->username = '******'; $this->password = '******'; $this->origin = 'test'; }
function __construct() { trace(__FILE__, '__construct()'); parent::__construct(); trace(__FILE__, '__construct() - prepare_company_website_controller'); prepare_company_website_controller($this, 'project_website'); trace(__FILE__, '__construct() - add textile'); $this->addHelper('textile'); }
/** * Construct the ApplicationController * * @param void * @return ApplicationController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); // Access permissios if(!can_manage_configuration(logged_user())) { flash_error(lang('no access permissions')); ajx_current("empty"); } // if } // __construct
/** * Constructor * * @param Request $request * @return PeopleController */ function __construct($request) { parent::__construct($request); $this->wireframe->addBreadCrumb(lang('People'), assemble_url('people')); $this->wireframe->current_menu_item = 'people'; if (Company::canAdd($this->logged_user)) { $this->wireframe->addPageAction(lang('New Company'), assemble_url('people_companies_add')); } // if }
/** * Construct controller * * @param void * @return null */ function __construct() { parent::__construct(); $this->setLayout('dialog'); $this->addHelper('form'); $this->addHelper('breadcrumbs'); $this->addHelper('pageactions'); $this->addHelper('tabbednavigation'); $this->addHelper('company_website'); $this->addHelper('project_website'); }
function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); ajx_set_panel("administration"); // Access permissios if(!logged_user()->isCompanyAdmin(owner_company())) { flash_error(lang('no access permissions')); ajx_current("empty"); } // if }
/** * Construct the ProjectSettingsController * * @access public * @param void * @return ProjectSettingsController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'project_website'); // Access permissions if (!logged_user()->isAdministrator(owner_company())) { flash_error(lang('no access permissions')); $this->redirectTo('dashboard'); } // if }
/** * Construct admin controller * * @param Request $request * @return AdminController */ function __construct($request) { parent::__construct($request); // Turn off print button in entire administration $this->wireframe->print_button = false; if (!$this->logged_user->isAdministrator()) { $this->httpError(HTTP_ERR_FORBIDDEN); } // if $this->wireframe->addBreadCrumb(lang('Administration'), assemble_url('admin')); $this->wireframe->current_menu_item = 'admin'; }
/** * Construct reminder controller * * @param Request $request * @return RemindersController */ function __construct($request) { parent::__construct($request); $reminder_id = $this->request->getId('reminder_id'); if ($reminder_id) { $this->active_reminder = Reminders::findById($reminder_id); } else { $this->active_reminder = new Reminder(); } // if $this->smarty->assign(array('active_reminder' => $this->active_reminder)); }
/** * Construct project controller * * @param Request $request * @return ProjectController */ function __construct($request) { parent::__construct($request); $this->wireframe->addBreadCrumb(lang('Projects'), assemble_url('projects')); $this->wireframe->current_menu_item = 'projects'; if ($this->controller_name == 'projects' || $this->controller_name == 'project_groups') { if (Project::canAdd($this->logged_user)) { $this->wireframe->addPageAction(lang('New Project'), assemble_url('projects_add')); } // if } // if }
function __construct() { parent::__construct(); if (isset($_SESSION['redis_environment'])) { $port = $this->Config->get("environment", $_SESSION['redis_environment']); if ($port) { lib\redis\RedisClient::setPort($port); } } $this->redis = lib\redis\RedisClient::getPredisObject(); if (isset($_SESSION['redis_db'])) { $this->redis->select(intval($_SESSION['redis_db'])); } }
/** * Constructor * * @param Request $request * @return AttachmentsController */ function __construct($request) { parent::__construct($request); $attachment_id = $this->request->getId('attachment_id'); if ($attachment_id) { $this->active_attachment = Attachments::findById($attachment_id); } // if if (!instance_of($this->active_attachment, 'Attachment')) { $this->active_attachment = new Attachment(); } // if $this->smarty->assign(array('active_attachment' => $this->active_attachment)); }
function __construct($request) { parent::__construct($request); /* * create/modify variables and assign to Smarty */ //example /* $somevariable = 'text'; $this->smarty->assign(array( 'active_project' => $somevariable )); */ }
/** * Construct auth controller * * @param Request $request * @return AuthController */ function __construct($request) { parent::__construct($request); // if user is using mobile device, redirect it to mobile access login page if (module_loaded('mobile_access') && is_mobile_device(USER_AGENT)) { if ($request->matched_route != 'logout') { $this->redirectTo('mobile_access_login'); } else { $this->redirectTo('mobile_access_logout'); } // if } // if $this->setLayout('application'); }
/** * Construct payments controller * * @param Request $request * @return InvoicesController */ function __construct($request) { parent::__construct($request); $payment_id = $this->request->getId('payment_id'); if ($payment_id) { $this->active_payment = Payments::findById($payment_id); } // if if (!instance_of($this->active_payment, 'Payment')) { $this->active_payment = new Payment(); } // if $add_payment_url = assemble_url('payments_add'); $this->wireframe->addPageAction(lang('New Payment'), $add_payment_url); $this->wireframe->addBreadCrumb(lang('Payments'), assemble_url('payments')); $this->smarty->assign(array('active_payment' => $this->active_payment, 'add_payment_url' => $add_payment_url)); js_assign('invoicing_precision', INVOICE_PRECISION); }
/** * Construct the AdministrationController * * @access public * @param void * @return AdministrationController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); //ajx_set_panel("administration"); // Access permissions if (!logged_user()->isExecutiveGroup()) { flash_error(lang('no access permissions')); ajx_current("empty"); } // if //Autentify password if (config_option('ask_administration_autentification')) { $last_login = array_var($_SESSION, 'admin_login', 0); if ($last_login < time() - ADMIN_SESSION_TIMEOUT) { if (array_var($_GET, 'a') != 'password_autentify') { $ref_controller = null; $ref_action = null; $ref_params = array(); foreach ($_GET as $k => $v) { $ref_var_name = $k; switch ($ref_var_name) { case 'c': $ref_controller = $v; break; case 'a': $ref_action = $v; break; default: $ref_params[$ref_var_name] = $v; } // switch } $url = get_url($ref_controller, $ref_action, $ref_params); $this->redirectTo('administration', 'password_autentify', array('url' => $url)); } } else { $_SESSION['admin_login'] = time(); } } //if }
/** * Construct invoices controller * * @param Request $request * @return InvoicesController */ function __construct($request) { parent::__construct($request); if (!$this->logged_user->getSystemPermission('can_manage_invoices')) { $this->httpError(HTTP_ERR_FORBIDDEN); } // if // Warning message about invoices folder existance / writability if (is_dir(INVOICES_WORK_PATH)) { if (!folder_is_writable(INVOICES_WORK_PATH)) { $this->wireframe->addPageMessage(lang('/work/invoices exists, but it is not writable. PDF files will not be generated'), 'error'); } // if } else { $this->wireframe->addPageMessage(lang('/work/invoices folder does not exist. PDF files will not be generated!'), 'error'); } // if $invoice_id = $this->request->getId('invoice_id'); if ($invoice_id) { $this->active_invoice = Invoices::findById($invoice_id); } // if $this->wireframe->addBreadCrumb(lang('Invoices'), assemble_url('invoices')); if (instance_of($this->active_invoice, 'Invoice')) { $this->wireframe->addBreadCrumb($this->active_invoice->getName(), $this->active_invoice->getViewUrl()); } else { $this->active_invoice = new Invoice(); } // if if (Invoice::canAdd($this->logged_user)) { $add_invoice_url = assemble_url('invoices_add'); $this->wireframe->addPageAction(lang('New Invoice'), $add_invoice_url); } else { $add_invoice_url = false; } // if $this->wireframe->current_menu_item = 'invoicing'; $this->smarty->assign(array('active_invoice' => $this->active_invoice, 'add_invoice_url' => $add_invoice_url, 'drafts_count' => Invoices::countDrafts())); js_assign('invoicing_precision', INVOICE_PRECISION); }
/** * Constructor method * * @param string $request * @return StatusController */ function __construct($request) { parent::__construct($request); if (!$this->logged_user->isAdministrator() && !$this->logged_user->getSystemPermission('can_use_incoming_mail_frontend')) { $this->httpError(HTTP_ERR_FORBIDDEN); } // if $this->wireframe->addBreadCrumb(lang('Incoming Mail'), assemble_url('incoming_mail')); $this->wireframe->current_menu_item = 'incoming_mail'; require_once ANGIE_PATH . '/classes/UTF8Converter/init.php'; require_once ANGIE_PATH . '/classes/mailboxmanager/init.php'; use_model('incoming_mail_activity_logs', INCOMING_MAIL_MODULE); $this->active_mail = IncomingMails::findById($this->request->getId('mail_id')); if (!instance_of($this->active_mail, 'IncomingMail')) { $this->active_mail = new IncomingMail(); } else { $this->wireframe->addBreadCrumb($this->active_mail->getSubject(), $this->active_mail->getImportUrl()); } // if $this->wireframe->print_button = false; $this->smarty->assign(array('active_mail' => $this->active_mail)); }
/** * Constructor method * * @param string $request * @return DocumentsCategoriesController */ function __construct($request) { parent::__construct($request); if (!$this->logged_user->isAdministrator() && !$this->logged_user->getSystemPermission('can_use_documents')) { $this->httpError(HTTP_ERR_FORBIDDEN); } // if $this->wireframe->addBreadCrumb(lang('Documents'), assemble_url('documents')); $category_id = $this->request->getId('category_id'); if ($category_id) { $this->active_document_category = DocumentCategories::findById($category_id); } // if if (instance_of($this->active_document_category, 'DocumentCategory')) { $this->wireframe->addBreadCrumb($this->active_document_category->getName(), $this->active_document_category->getViewUrl()); if (Document::canAdd($this->logged_user)) { $add_text_url = assemble_url('documents_add_text', array('category_id' => $this->active_document_category->getId())); $upload_file_url = assemble_url('documents_upload_file', array('category_id' => $this->active_document_category->getId())); } // if } else { $this->active_document_category = new DocumentCategory(); if (Document::canAdd($this->logged_user)) { $add_text_url = assemble_url('documents_add_text'); $upload_file_url = assemble_url('documents_upload_file'); } // if } // if if (Document::canAdd($this->logged_user)) { $this->wireframe->addPageAction(lang('New Text Document'), $add_text_url); $this->wireframe->addPageAction(lang('Upload File'), $upload_file_url); } else { $add_text_url = null; $upload_file_url = null; } // if $this->smarty->assign(array('document_categories_url' => $this->logged_user->isAdministrator() ? assemble_url('document_categories') : null, 'add_category_url' => DocumentCategory::canAdd($this->logged_user) ? assemble_url('document_categories_add') : null, 'add_text_url' => $add_text_url, 'upload_file_url' => $upload_file_url, 'active_document_category' => $this->active_document_category, 'categories' => DocumentCategories::findAll($this->logged_user))); }
/** * Constructor * * @param Request $request * @return PeopleController */ function __construct($request) { parent::__construct($request); $this->wireframe->addBreadCrumb(lang('Recent Pages'), assemble_url('recent_page')); $this->wireframe->current_menu_item = 'recent_page'; /*$tabs = new NamedList(); $tabs->add('overview', array( 'text' => str_excerpt($this->active_project->getName(), 25), 'url' => $this->active_project->getOverviewUrl() )); event_trigger('on_project_tabs', array(&$tabs, &$this->logged_user, &$this->active_project)); $tabs->add('people', array( 'text' => lang('People'), 'url' => $this->active_project->getPeopleUrl(), )); $tabs->add('recent_page', array( 'text' => lang('Recent Pages'), 'url' => assemble_url('recent_page'), )); $this->smarty->assign('page_tabs', $tabs);*/ }