Пример #1
0
 public function render($tpl = null)
 {
     $app = JFactory::getApplication();
     $this->type = $app->input->getCmd('type');
     $this->id = $app->input->getInt('id');
     $layout = $this->getLayout();
     $this->format = $app->input->get('format');
     $this->view = $app->input->get('view', 'default');
     switch ($this->type) {
         case 'event':
             $this->var = 'event_id';
             break;
     }
     //retrieve task list from model
     $model = new NoteModel();
     if ($layout == "edit") {
         $notes = $model->getNote($this->id);
     } else {
         $notes = $model->getNotes($this->id, $this->type, false);
     }
     $this->notes = $notes;
     $this->categories = NoteHelper::getCategories();
     //display
     echo parent::render();
 }
Пример #2
0
 public function render()
 {
     $app = JFactory::getApplication();
     $type = $app->input->get('type');
     $id = $app->input->get('id');
     $view = $app->input->get('view');
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     //retrieve task list from model
     $model = new NoteModel();
     switch ($view) {
         case "companies":
             $view = "company";
             break;
         case "deals":
             $view = "deal";
             break;
         case "events":
             $view = "event";
             break;
     }
     $notes = $model->getNotes($id, $view, FALSE);
     $this->notes = $notes;
     $this->categories = NoteHelper::getCategories();
     //display
     return parent::render();
 }
Пример #3
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //display toolbar
     $this->toolbar = new Toolbar();
     $this->toolbar->save();
     //document
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . "/src/Cobalt/media/js/cobalt-admin.js");
     /* Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //get model
     $model = new ConfigModel();
     $layout = $this->getLayout();
     $model->set("_layout", $layout);
     //get config
     $config = $model->getConfig();
     //generate timezones
     $list = timezone_identifiers_list();
     $timezones = array();
     foreach ($list as $zone) {
         $timezones[$zone] = $zone;
     }
     //view references
     $this->imap_found = function_exists('imap_open') ? TRUE : FALSE;
     $this->config = $config;
     $this->timezones = $timezones;
     $this->time_formats = DateHelper::getTimeFormats();
     $this->languages = ConfigHelper::getLanguages();
     $this->language = ConfigHelper::getLanguage();
     //display
     return parent::render();
 }
Пример #4
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //display
     return parent::render();
 }
Пример #5
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //menu Links
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //add javascript
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/branding_manager.js');
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     //view refs
     $model = new BrandingModel();
     $themes = $model->getThemes();
     //toolbar buttons
     ToolbarHelper::save('save', 'Save');
     //toolbar items
     $list = array('dashboard', 'deals', 'people', 'companies', 'calendar', 'documents', 'goals', 'reports');
     $this->toolbar_list = $list;
     $this->themes = $themes;
     $this->site_logo = StylesHelper::getSiteLogo();
     $this->site_name = StylesHelper::getSiteName();
     //assign default theme
     foreach ($this->themes as $key => $row) {
         if ($row['assigned']) {
             $document->addScriptDeclaration("var assigned_theme=" . $row['id'] . ";");
         }
     }
     //display
     return parent::render();
 }
Пример #6
0
 public function render()
 {
     $app = JFactory::getApplication();
     //grab model
     $model = new EventModel();
     if ($this->getLayout() == "event_listings" || $this->getLayout() == "list") {
         $events = $model->getEvents();
         $this->events = $events;
     } else {
         //null event
         $event = array();
         $id = null;
         if ($app->input->get('parent_id') && !$app->input->get('id')) {
             $id = $app->input->get('parent_id');
         } else {
             $id = $app->input->get('id');
         }
         //grab event
         if ($id != null) {
             $event = $model->getEvent($id);
         }
         //pass reference
         $this->event = $event;
     }
     if ($app->input->get('association_id')) {
         $this->association_name = CobaltHelper::getAssociationName();
     }
     //display
     echo parent::render();
 }
Пример #7
0
 public function display($tpl = null)
 {
     $model = new MailModel();
     $this->mail = $model->getMail();
     //display
     echo parent::render();
 }
Пример #8
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //site document
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . "/src/Cobalt/media/js/cobalt-admin.js");
     //gather information for view
     $model = new CategoriesModel();
     $layout = $this->getLayout();
     $model->set("_layout", $layout);
     if ($layout && $layout == 'edit') {
         ToolbarHelper::cancel('cancel');
         ToolbarHelper::save('save');
         $this->category = $model->getCategory();
     } else {
         //buttons
         ToolbarHelper::addNew('edit');
         ToolbarHelper::editList('edit');
         ToolbarHelper::deleteList(TextHelper::_('COBALT_CONFIRMATION'), 'remove');
         //view references
         $categories = $model->getCategories();
         $this->categories = $categories;
         // Initialise state variables.
         $state = $model->getState();
         $this->state = $state;
         $this->listOrder = $state->get('Categories.filter_order');
         $this->listDirn = $state->get('Categories.filter_order_Dir');
     }
     //display
     return parent::render();
 }
Пример #9
0
 public function render()
 {
     //japplication
     $app = JFactory::getApplication();
     $id = $app->input->get('id') ? $app->input->get('id') : null;
     $layout = $this->getLayout();
     //get model
     $model = new CompanyModel();
     //layout
     switch ($layout) {
         case "add":
         case "edit":
             $this->company = $model->getCompany();
             $edit_custom_fields_view = ViewHelper::getView('custom', 'edit', 'html');
             $edit_custom_fields_view->type = "company";
             $edit_custom_fields_view->item = $this->company;
             $this->edit_custom_fields_view = $edit_custom_fields_view;
             break;
         case "entry":
             $this->company = $model->getCompany();
             $this->k = 0;
             break;
         case "list":
             $this->companies = $model->getCompanies($id);
             $this->total = $model->getTotal();
             $this->pagination = $model->getPagination();
             $this->state = $model->getState();
             break;
     }
     //display view
     echo parent::render();
 }
Пример #10
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     $app = \Cobalt\Container::fetch('app');
     $document = $app->getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     $configModel = new ConfigModel();
     /** Component version **/
     $installedVersion = ConfigHelper::getVersion();
     $latestVersion = VersionHelper::getLatestVersion();
     $updateUrl = "http://www.cobaltcrm.org/support/login";
     $updatesFeed = $configModel->getUpdatesRSS();
     /** Launch completion **/
     $config = $configModel->getConfig();
     $this->launch_default = $config->launch_default;
     $percentage = $menu['percentage'];
     $this->setup_percent = $percentage;
     /** php version check **/
     $this->php_version = (double) phpversion();
     $this->php_version_check = $this->php_version >= 5.3 ? TRUE : FALSE;
     /** View Ref **/
     $this->installedVersion = $installedVersion;
     $this->latestVersion = $latestVersion;
     $this->updateUrl = $updateUrl;
     $this->updatesFeed = $updatesFeed;
     //display
     return parent::render();
 }
Пример #11
0
 /**
  * Tests the setPaths method.
  *
  * @return  void
  *
  * @covers  Joomla\View\AbstractHtmlView::setPaths
  * @since   1.0
  */
 public function testSetPaths()
 {
     $paths = new \SplPriorityQueue();
     $paths->insert('bar', 99);
     $result = $this->instance->setPaths($paths);
     $this->assertAttributeSame($paths, 'paths', $this->instance);
     $this->assertSame($this->instance, $result);
 }
Пример #12
0
 public function render($tpl = null)
 {
     //get model and retrieve info
     $model = new EventModel();
     if (TemplateHelper::isMobile()) {
         $model->set('current_events', true);
     }
     $events = $model->getEvents();
     $eventDock = ViewHelper::getView('events', 'dashboard_event_dock', 'phtml', array('events' => $events));
     $dealModel = new DealModel();
     $dealModel->set('_view', 'dashboard');
     $dealModel->set('recent', true);
     $dealModel->set('archived', 0);
     $recentDeals = $dealModel->getDeals();
     $doc = JFactory::getDocument();
     //get data for sales graphs
     $model = new GraphsModel();
     $graph_data = $model->getGraphData();
     $activityHelper = new ActivityHelper();
     $activity = $activityHelper->getActivity();
     //assign results to view
     $this->eventDock = $eventDock;
     $this->graph_data = $graph_data;
     $this->recentDeals = $recentDeals;
     $this->activity = $activity;
     $json = TRUE;
     $peopleModel = new PeopleModel();
     if (TemplateHelper::isMobile()) {
         $dealModel->set('recent', false);
         $totalDeals = $dealModel->getTotal();
         $peopleModel->set('type', 'leads');
         $totalLeads = $peopleModel->getTotal();
         $peopleModel->set('type', 'not_leads');
         $totalContacts = $peopleModel->getTotal();
         $companyModel = new CompanyModel();
         $totalCompanies = $companyModel->getTotal();
         $user = UsersHelper::getLoggedInUser();
         $this->first_name = $user->first_name;
         $this->numEvents = count($events);
         $this->numDeals = $totalDeals;
         $this->numLeads = $totalLeads;
         $this->numContacts = $totalContacts;
         $this->numCompanies = $totalCompanies;
     }
     $peopleNames = $peopleModel->getPeopleNames($json);
     $doc->addScriptDeclaration("var people_names=" . $peopleNames . ";");
     $dealModel = new DealModel();
     $dealNames = $dealModel->getDealNames($json);
     $doc->addScriptDeclaration("var deal_names=" . $dealNames . ";");
     /** get latest activities **/
     $this->latest_activities = ViewHelper::getView('dashboard', 'latest_activities', 'phtml');
     $this->latest_activities->activity = $activity;
     $activityHelper = new ActivityHelper();
     $activity = $activityHelper->getActivity();
     //display
     return parent::render();
 }
Пример #13
0
 public function render($tpl = null)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     //event model
     $model = new EventModel();
     $view = $app->input->get('view');
     $layout = $this->getLayout();
     switch ($layout) {
         case 'event_dock':
             break;
         case 'edit_event':
         case 'edit_task':
             break;
         case 'default':
         default:
             $event_id = $app->input->get('id');
             if ($app->input->get('loc')) {
                 $events = $model->getEvents($app->input->get('loc'), null, $app->input->get($app->input->get('loc') . '_id'));
             } else {
                 $events = $model->getEvents();
             }
             $state = $model->getState();
             $this->event_statuses = EventHelper::getEventStatuses();
             $this->event_types = EventHelper::getEventTypes();
             $this->event_categories = EventHelper::getCategories(TRUE);
             $this->event_due_dates = EventHelper::getEventDueDates();
             $this->event_associations = EventHelper::getEventAssociations();
             $this->event_users = UsersHelper::getUsers(NULL, TRUE);
             $this->event_teams = UsersHelper::getTeams();
             $this->dataTableColumns = $model->getDataTableColumns();
             $document->addScriptDeclaration("\n            loc = 'events';\n            order_url = 'index.php?view=events&layout=list&format=raw&tmpl=component';\n            order_dir = '" . $state->get('Event.' . $view . '_' . $layout . '_' . 'filter_order_Dir') . "';\n            order_col = '" . $state->get('Event.' . $view . '_' . $layout . '_' . 'filter_order') . "';\n            var dataTableColumns = " . json_encode($this->dataTableColumns) . ";");
             $this->state = $state;
             break;
     }
     if ($layout != 'edit_task' || $layout != "edit_event") {
         if (TemplateHelper::isMobile()) {
             $model->set('current_events', true);
             $document->addScriptDeclaration('loc="events";');
         }
     }
     if (TemplateHelper::isMobile() && isset($event_id)) {
         $person_model = new PeopleModel();
         $person_model->set('event_id', $event_id);
         $person_model->set('recent', false);
         $person_model->set('_id', null);
         $this->people = $person_model->getPeople();
     }
     $document->addScriptDeclaration('var layout="' . $layout . '"');
     //assign results to view
     $this->events = $events;
     $this->member_role = UsersHelper::getRole();
     $this->user_id = UsersHelper::getUserId();
     $this->team_id = UsersHelper::getTeamId();
     //display
     return parent::render();
 }
Пример #14
0
 /**
  * Method to render the view.
  *
  * @return  string  The rendered view.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function render()
 {
     $this->basepath = Container::fetch('app')->get('uri.base.host');
     $this->knownLangs = Container::fetch('app')->getLanguage()->getKnownLanguages();
     $this->defaultLang = Container::fetch('app')->getLanguage()->getDefault();
     $this->phpOptions = $this->model->getPhpOptions();
     $this->dboDrivers = $this->model->dboDrivers();
     return parent::render();
 }
 /**
  * Execute the controller.
  *
  * This is a generic method to execute and render a view and is not suitable for tasks.
  *
  * @return  string
  *
  * @since   1.0
  */
 public function execute()
 {
     try {
         // Render our view.
         $contents = $this->view->render();
     } catch (\Exception $e) {
         $contents = $this->getContainer()->get('app')->getDebugger()->renderException($e);
     }
     return $contents;
 }
Пример #16
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     /** Menu Links **/
     $side_menu = MenuHelper::getMenuModules();
     $this->side_menu = $side_menu;
     //display
     return parent::render();
 }
Пример #17
0
 public function render()
 {
     $app = \Cobalt\Container::fetch('app');
     //get user data and pass to view
     $this->user = $app->getUser();
     $this->user_id = $this->user->get('id');
     $this->user->getEmails();
     //display
     return parent::render();
 }
Пример #18
0
 public function render($tpl = null)
 {
     $app = JFactory::getApplication();
     $deal_id = $app->input->get('deal_id');
     if ($deal_id) {
         $primary_contact_id = DealHelper::getPrimaryContact($deal_id);
         $this->primary_contact_id = $primary_contact_id;
     }
     //display
     return parent::render();
 }
Пример #19
0
 public function render()
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //load model
     $layout = $this->getLayout();
     $model = new FormWizardModel();
     $model->set("_layout", $layout);
     //document
     $document = JFactory::getDocument();
     // Create the toolbar object
     $this->toolbar = new Toolbar();
     //add toolbar buttons to manage users
     if ($layout == 'default') {
         //buttons
         $this->toolbar->addNew();
         $this->toolbar->addDeleteRow();
         ToolbarHelper::addNew('edit');
         ToolbarHelper::editList('edit');
         ToolbarHelper::deleteList(TextHelper::_('COBALT_CONFIRMATION'), 'remove');
         // Initialise variables.
         $this->state = $model->getState();
         $this->forms = $model->getForms();
         $this->listOrder = $this->state->get('Formwizard.filter_order');
         $this->listDirn = $this->state->get('Formwizard.filter_order_Dir');
     } elseif ($layout == 'edit') {
         //buttons
         $this->toolbar->save();
         $this->toolbar->cancel();
         //form
         $form_id = $model->getTempFormId();
         $this->form_id = $form_id;
         $this->form = $model->getForm();
         //form types
         $this->form_types = DropdownHelper::getFormTypes($this->form['type']);
         $fields = array('lead' => DropdownHelper::getFormFields('people'), 'contact' => DropdownHelper::getFormFields('people'), 'deal' => DropdownHelper::getFormFields('deal'), 'company' => DropdownHelper::getFormFields('company'));
         $this->fields = $fields;
         $document->addScriptDeclaration('var fields=' . json_encode($fields));
         //get joomla users to add
         $model = new UsersModel();
         $user_list = $model->getUsers();
         $document->addScriptDeclaration('var user_list=' . json_encode($user_list) . ';');
     }
     //javascripts
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/jquery.base64.js');
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/formwizard.js');
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //display
     return parent::render();
 }
Пример #20
0
 public function render()
 {
     //load model and retrieve events to pass to calendar
     $model = new EventModel();
     $events = $model->getEvents('calendar');
     //pass reference vars to view
     $this->events = json_encode($events);
     $team_members = UsersHelper::getUsers();
     $this->team_members = $team_members;
     //display
     return parent::render();
 }
Пример #21
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //application
     $app = \Cobalt\Container::fetch('app');
     //display title
     $document = JFactory::getDocument();
     //load model
     $layout = $this->getLayout();
     $model = new UsersModel();
     $model->set("_layout", $layout);
     //add toolbar buttons to manage users
     if ($layout == 'default') {
         $this->toolbar = new Toolbar();
         $this->toolbar->addNew();
         $this->toolbar->addDeleteRow();
         //get users
         $users = $model->getUsers();
         // Initialise variables.
         $this->state = $model->getState();
         //assign refs
         $this->users = $users;
         $this->listOrder = $this->state->get('Users.filter_order');
         $this->listDirn = $this->state->get('Users.filter_order_Dir');
     } elseif ($this->getLayout() == 'edit') {
         $model = new UserModel();
         $model->set("_layout", $layout);
         $this->toolbar = new Toolbar();
         $this->toolbar->save();
         $this->toolbar->cancel();
         //get id
         $id = $app->input->getInt('id', null);
         //plugins
         //$app->triggerEvent('onBeforeCRMUserEdit', array(&$id));
         //get user
         $this->user = $model->getUser($id);
         //view data
         $roles = DropdownHelper::getMemberRoles();
         $teamId = UsersHelper::getTeamId($id);
         $teams = UsersHelper::getTeams($teamId);
         $managers = DropdownHelper::getManagers($id);
         $this->member_roles = $roles;
         $this->teams = $teams;
         $this->managers = $managers;
     }
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //display
     return parent::render();
 }
Пример #22
0
 public function render()
 {
     //application
     $app = JFactory::getApplication();
     //get layout requested to load correct data and pass references
     $layout = $this->getLayout();
     $func = "_display_" . $layout;
     if (function_exists($this->{$func})) {
         $this->{$func}();
     }
     //display
     echo parent::render();
 }
Пример #23
0
 public function render()
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     // Create toolbar
     $this->toolbar = new Toolbar();
     //document
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     $layout = $this->getLayout();
     //gather information for view
     $model = new StatusesModel();
     $model->set("_layout", $layout);
     $this->pagination = $model->getPagination();
     if ($layout && $layout == 'edit') {
         //toolbar buttons
         $this->toolbar->cancel();
         $this->toolbar->save();
         //javascripts
         $document->addScript(JURI::base() . 'src/Cobalt/media/js/bootstrap-colorpicker.js');
         //stylesheets
         $document->addStylesheet(JURI::base() . 'src/Cobalt/media/css/bootstrap-colorpicker.css');
         //get status
         $this->status = $model->getStatus();
         //script declarations
         if ($this->status['color'] != null) {
             $document->addScriptDeclaration('var status_color = "' . $this->status['color'] . '";');
         } else {
             $document->addScriptDeclaration('var status_color = "ff0000";');
         }
     } else {
         //buttons
         $this->toolbar->addNew();
         ToolbarHelper::editList('edit');
         $this->toolbar->addDeleteRow();
         //statuses
         $statuses = $model->getStatuses();
         $this->statuses = $statuses;
         // Initialise state variables.
         $state = $model->getState();
         $this->state = $state;
         $this->listOrder = $this->state->get('Statuses.filter_order');
         $this->listDirn = $this->state->get('Statuses.filter_order_Dir');
         $this->saveOrder = $this->listOrder == 'c.ordering';
     }
     //display
     return parent::render();
 }
Пример #24
0
 public function render($tpl = null)
 {
     $app = \Cobalt\Container::fetch('app');
     $doc = $app->getDocument();
     $doc->addScript(JURI::base() . 'src/Cobalt/media/js/import_manager.js');
     if (count($_FILES) > 0) {
         $model = new ImportModel();
         foreach ($_FILES as $file) {
             $import_data = $model->readCSVFile($file['tmp_name']);
         }
         $this->headers = $import_data['headers'];
         unset($import_data['headers']);
         $this->import_data = $import_data;
         if (count($import_data) > 500) {
             switch ($app->input->get('import_type')) {
                 case "company":
                     $view = "companies";
                     $import_model = "company";
                     break;
                 case "people":
                     $view = "people";
                     $import_model = "people";
                     break;
                 case "deals":
                     $view = "deals";
                     $import_model = "deal";
                     break;
             }
             if ($model->importCSVData($import_data, $import_model)) {
                 $success = "SUCCESSFULLY";
             } else {
                 $success = "UNSUCCESSFULLY";
                 $view = "import&import_type=" . $app->input->get('import_type');
             }
             $msg = TextHelper::_('COBALT_' . $success . '_IMPORTED_ITEMS');
             $app->redirect(RouteHelper::_('index.php?view=' . $view), $msg);
         }
         $doc->addScriptDeclaration('import_length=' . count($import_data) . ';');
     }
     $import_type = $app->input->get('import_type');
     $import_header = ucwords(TextHelper::_('COBALT_IMPORT_' . $import_type));
     $this->import_type = $import_type;
     $this->import_header = $import_header;
     if ($this->getLayout() == 'default') {
         $this->setLayout('import');
     }
     //display
     return parent::render();
 }
Пример #25
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //Add styles for iframe popup
     echo "<link href='" . JURI::base() . "src/Cobalt/media/css/style.css' type='text/css' rel='stylesheet' />";
     echo "<link href='" . JURI::base() . "src/Cobalt/media/css/bootstrap.min.css' type='text/css' rel='stylesheet' />";
     //import document
     if (is_array($_FILES) && count($_FILES) > 0) {
         $model = new DocumentsModel();
         $model->upload();
     }
     //display
     return parent::render();
 }
Пример #26
0
 public function render()
 {
     //app
     $app = JFactory::getApplication();
     //document
     $document = JFactory::getDocument();
     //javascripts
     if ($this->getLayout() == 'header') {
         $document->addScriptDeclaration('var base_url = "' . JURI::base() . '";');
     }
     //mobile detection
     $this->isMobile = TemplateHelper::isMobile();
     $this->isDashboard = $app->input->get('view') == 'dashboard' ? true : false;
     return parent::render();
 }
Пример #27
0
 public function render($tpl = null)
 {
     $app = JFactory::getApplication();
     //get model
     $model = new DocumentModel();
     $documents = $model->getDocuments($app->input->get('document_id'));
     $state = $model->getState();
     $layout = $this->getLayout();
     if ($app->input->get('document_id') && $layout != "document_row") {
         $documents = $documents[0];
     }
     //assign refs
     $this->documents = $documents;
     $this->state = $state;
     //display view
     echo parent::render();
 }
Пример #28
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //document
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/custom_manager.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //model
     $model = new DealCustomModel();
     //gather information for view
     $layout = $this->getLayout();
     $model->set("_layout", $layout);
     $this->pagination = $model->getPagination();
     if ($layout && $layout == 'edit') {
         //toolbar
         ToolbarHelper::cancel('cancel');
         ToolbarHelper::save('save');
         //assign view info
         $this->custom_types = DropdownHelper::getCustomTypes('deal');
         $this->custom = $model->getItem();
         if ($this->custom['type'] != null) {
             $document->addScriptDeclaration('var type = "' . $this->custom['type'] . '";');
         }
     } else {
         //buttons
         ToolbarHelper::addNew('edit');
         ToolbarHelper::editList('edit');
         ToolbarHelper::deleteList(TextHelper::_('COBALT_CONFIRMATION'), 'delete');
         //assign view info
         $custom = $model->getCustom();
         $this->custom_fields = $custom;
         // Initialise state variables.
         $state = $model->getState();
         $this->state = $state;
         $this->listOrder = $this->state->get('Dealcustom.filter_order');
         $this->listDirn = $this->state->get('Dealcustom.filter_order_Dir');
         $this->saveOrder = $this->listOrder == 'c.ordering';
     }
     //display
     return parent::render();
 }
Пример #29
0
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     // Create toolbar
     $this->toolbar = new Toolbar();
     //javascripts
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //gather information for view
     $model = new TemplatesModel();
     //get layout
     $layout = $this->getLayout();
     $model->set("_layout", $layout);
     //filter for layout type
     if ($layout == "edit") {
         //toolbar buttons
         $this->toolbar->cancel();
         $this->toolbar->save();
         //javascripts
         $document->addScript(JURI::base() . 'src/Cobalt/media/js/template_manager.js');
         //assign view data
         $this->template_types = DropdownHelper::getTemplateTypes();
         $this->template = $model->getTemplate();
     } else {
         //buttons
         $this->toolbar->addNew();
         ToolbarHelper::editList('edit');
         $this->toolbar->addDeleteRow();
         $templates = $model->getTemplates();
         $this->templates = $templates;
         // Initialise state variables.
         $state = $model->getState();
         $this->state = $state;
         $this->listOrder = $this->state->get('Templates.filter_order');
         $this->listDirn = $this->state->get('Templates.filter_order_Dir');
     }
     //display
     return parent::render();
 }
Пример #30
0
 public function render($tpl = null)
 {
     $app = JFactory::getApplication();
     $deal_id = $app->input->get('deal_id');
     $event_id = $app->input->get('event_id');
     $companyId = $app->input->get('company_id');
     $model = new PeopleModel();
     $model->set('deal_id', $deal_id);
     $model->set('event_id', $event_id);
     $model->set('company_id', $companyId);
     $contacts = $model->getContacts();
     $this->contacts = $contacts;
     if ($deal_id) {
         $primary_contact_id = DealHelper::getPrimaryContact($deal_id);
         $this->primary_contact_id = $primary_contact_id;
     }
     //display view
     echo parent::render();
 }