Exemple #1
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get("params");
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->state->params->get("project_currency"));
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Get rewards number
     $usersIds = array();
     foreach ($this->items as $item) {
         $usersIds[] = $item->id;
     }
     // Get number of rewards.
     $statistics = new Crowdfunding\Statistics\Users(JFactory::getDbo(), $usersIds);
     $this->projects = $statistics->getProjectsNumber();
     $this->amounts = $statistics->getAmounts();
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->form = $this->get('Form');
     $this->importType = $this->state->get("import.context");
     switch ($this->importType) {
         case "locations":
             $this->legend = JText::_("COM_CROWDFUNDING_IMPORT_LOCATIONS_DATA");
             $this->uploadTask = "import.locations";
             break;
         case "countries":
             $this->legend = JText::_("COM_CROWDFUNDING_IMPORT_COUNTRIES_DATA");
             $this->uploadTask = "import.countries";
             break;
         case "states":
             $this->legend = JText::_("COM_CROWDFUNDING_IMPORT_STATES_DATA");
             $this->uploadTask = "import.states";
             break;
         default:
             // Currencies
             $this->legend = JText::_("COM_CROWDFUNDING_IMPORT_CURRENCY_DATA");
             $this->uploadTask = "import.currencies";
             break;
     }
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->importType);
     // Prepare actions
     $this->addToolbar();
     $this->setDocument();
     parent::display($tpl);
 }
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get("params");
     // Get currencies
     $currencies = array();
     foreach ($this->items as $item) {
         $currencies[] = $item->txn_currency;
     }
     $currencies = array_unique($currencies);
     if (!empty($currencies)) {
         $options = new Joomla\Registry\Registry();
         $options->set("locale_intl", $this->params->get("locale_intl"));
         $options->set("amount_format", $this->params->get("amount_format"));
         $this->currencies = new Crowdfunding\Currencies(JFactory::getDbo(), $options);
         $this->currencies->loadByCode($currencies);
     }
     $this->amount = new Crowdfunding\Amount($this->params);
     // Get enabled specefic plugins.
     $extensions = new Prism\Extensions(JFactory::getDbo(), $this->specificPlugins);
     $this->enabledSpecificPlugins = $extensions->getEnabled();
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     $this->sidebar = JHtmlSidebar::render();
 }
Exemple #5
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     // Add submenu
     CrowdfundingHelper::addSubmenu('projects');
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived' => false)), 'value', 'text', $this->state->get('filter.state'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Exemple #6
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     $filters = Crowdfunding\Filters::getInstance(JFactory::getDbo());
     $types = $filters->getLogTypes();
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', $types, 'value', 'text', $this->state->get('filter.type'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Exemple #7
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Exemple #8
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     // Get log files and count them.
     $logFiles = new Crowdfunding\Log\Files($this->includeFiles);
     $logFiles->load();
     $this->numberLogFilse = count($logFiles);
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
 public function display($tpl = null)
 {
     $this->option = JFactory::getApplication()->input->get('option');
     $this->state = $this->get('State');
     $this->params = $this->state->get('params');
     $this->version = new Crowdfunding\Version();
     // Load Prism library version
     if (!class_exists('Prism\\Version')) {
         $this->prismVersion = JText::_('COM_CROWDFUNDING_PRISM_LIBRARY_DOWNLOAD');
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, '<')) {
             $this->prismVersionLowerMessage = JText::_('COM_CROWDFUNDING_PRISM_LIBRARY_LOWER_VERSION');
         }
     }
     // Get popular projects.
     $this->popular = new Crowdfunding\Statistics\Projects\Popular(JFactory::getDbo());
     $this->popular->load(array('limit' => 5));
     // Get popular most funded.
     $this->mostFunded = new Crowdfunding\Statistics\Projects\MostFunded(JFactory::getDbo());
     $this->mostFunded->load(array('limit' => 5));
     // Get latest started.
     $options = array('limit' => 10, 'order_by' => 'funding_start', 'order_direction' => 'DESC');
     $this->latestStarted = new Crowdfunding\Statistics\Projects\Latest(JFactory::getDbo());
     $this->latestStarted->load($options);
     // Get latest created.
     $options = array('limit' => 10, 'order_by' => 'created', 'order_direction' => 'DESC');
     $this->latestCreated = new Crowdfunding\Statistics\Projects\Latest(JFactory::getDbo());
     $this->latestCreated->load($options);
     // Get currency.
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->params->get('project_currency'));
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get("params");
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->state->params->get("project_currency"));
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Add submenu
     CrowdfundingHelper::addSubmenu("projects");
     $projectId = $this->state->get("project_id");
     $this->projectTitle = CrowdfundingHelper::getProjectTitle($projectId);
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Exemple #11
0
 public function display($tpl = null)
 {
     $this->state = $this->get("State");
     $this->params = $this->state->get("params");
     $this->version = new Crowdfunding\Version();
     // Load ITPrism library version
     if (!class_exists("Prism\\Version")) {
         $this->prismVersion = JText::_("COM_CROWDFUNDING_PRISM_LIBRARY_DOWNLOAD");
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, "<")) {
             $this->prismVersionLowerMessage = JText::_("COM_CROWDFUNDING_PRISM_LIBRARY_LOWER_VERSION");
         }
     }
     // Get popular projects.
     $this->popular = new Crowdfunding\Statistics\Projects\Popular(JFactory::getDbo());
     $this->popular->load(5);
     // Get popular most funded.
     $this->mostFunded = new Crowdfunding\Statistics\Projects\MostFunded(JFactory::getDbo());
     $this->mostFunded->load(5);
     // Get latest started.
     $this->latestStarted = new Crowdfunding\Statistics\Projects\Latest(JFactory::getDbo());
     $this->latestStarted->load(5);
     // Get latest created.
     $this->latestCreated = new Crowdfunding\Statistics\Projects\Latest(JFactory::getDbo());
     $this->latestCreated->loadByCreated(5);
     // Get currency.
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->params->get("project_currency"));
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
 public function display($tpl = null)
 {
     $this->option = JFactory::getApplication()->input->get('option');
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $this->money = $this->getMoneyFormatter($this->params);
     // Get user IDs.
     $usersIds = Prism\Utilities\ArrayHelper::getIds($this->items);
     // Get the number of user's project.
     $statistics = new Crowdfunding\Statistics\Users(JFactory::getDbo(), $usersIds);
     $this->projects = $statistics->getProjectsNumber();
     $this->amounts = $statistics->getAmounts();
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     // Create object Filters and load some filters options.
     $filters = Crowdfunding\Filters::getInstance(JFactory::getDbo());
     // Get payment services.
     $paymentServices = $filters->getPaymentServices();
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_PAYMENT_SERVICES'), 'filter_payment_service', JHtml::_('select.options', $paymentServices, 'value', 'text', $this->state->get('filter.payment_service'), true));
     // Get payment statuses.
     $this->paymentStatuses = $filters->getPaymentStatuses();
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_PAYMENT_STATUS'), 'filter_payment_status', JHtml::_('select.options', $this->paymentStatuses, 'value', 'text', $this->state->get('filter.payment_status'), true));
     // Get reward states.
     $rewardDistributionStatuses = $filters->getRewardDistributionStatuses();
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_REWARD_STATUS'), 'filter_reward_state', JHtml::_('select.options', $rewardDistributionStatuses, 'value', 'text', $this->state->get('filter.reward_state'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Exemple #14
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     CrowdfundingHelper::addSubmenu($this->getName());
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     // Prepare options
     $approvedOptions = array(JHtml::_('select.option', 1, JText::_('COM_CROWDFUNDING_APPROVED')), JHtml::_('select.option', 0, JText::_('COM_CROWDFUNDING_DISAPPROVED')));
     $featuredOptions = array(JHtml::_('select.option', 1, JText::_('COM_CROWDFUNDING_FEATURED')), JHtml::_('select.option', 0, JText::_('COM_CROWDFUNDING_NOT_FEATURED')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived' => false)), 'value', 'text', $this->state->get('filter.state'), true));
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_APPROVED_STATUS'), 'filter_approved', JHtml::_('select.options', $approvedOptions, 'value', 'text', $this->state->get('filter.approved'), true));
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_FEATURED_STATUS'), 'filter_featured', JHtml::_('select.options', $featuredOptions, 'value', 'text', $this->state->get('filter.featured'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_crowdfunding'), 'value', 'text', $this->state->get('filter.category_id')));
     $filters = Crowdfunding\Filters::getInstance(JFactory::getDbo());
     $typesOptions = $filters->getProjectsTypes();
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_TYPE'), 'filter_type_id', JHtml::_('select.options', $typesOptions, 'value', 'text', $this->state->get('filter.type_id')));
     $this->sidebar = JHtmlSidebar::render();
 }