Esempio n. 1
0
 public function display($tpl = null)
 {
     $userId = JFactory::getUser()->get("id");
     if (!$userId) {
         $this->app->enqueueMessage(JText::_("COM_CROWDFUNDING_ERROR_NOT_LOG_IN"), "notice");
         $this->app->redirect(JRoute::_("index.php?option=com_users&view=login", false));
         return;
     }
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     // Get params
     /** @var  $params Joomla\Registry\Registry */
     $params = $this->state->get("params");
     $this->params = $params;
     if (!empty($this->items)) {
         // Get currency
         $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->params->get("project_currency"));
         $this->amount = new Crowdfunding\Amount($this->params);
         $this->amount->setCurrency($currency);
     }
     // Prepare filters
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $this->saveOrder = strcmp($this->listOrder, 'a.ordering') != 0 ? false : true;
     $this->userId = JFactory::getUser()->get("id");
     $this->redirectUrl = CrowdfundingHelperRoute::getTransactionsRoute();
     $this->prepareDocument();
     parent::display($tpl);
 }
Esempio n. 2
0
 public function display($tpl = null)
 {
     $this->app = JFactory::getApplication();
     $this->option = $this->app->input->get('option');
     $userId = JFactory::getUser()->get('id');
     if (!$userId) {
         $this->app->enqueueMessage(JText::_('COM_CROWDFUNDING_ERROR_NOT_LOG_IN'), 'notice');
         $this->app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
         return;
     }
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     /** @var  $params Joomla\Registry\Registry */
     if (is_array($this->items) and count($this->items) > 0) {
         $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->params->get('project_currency'));
         $this->amount = new Crowdfunding\Amount($this->params);
         $this->amount->setCurrency($currency);
     }
     // Prepare filters
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $this->saveOrder = strcmp($this->listOrder, 'a.ordering') === 0;
     $this->userId = JFactory::getUser()->get('id');
     $this->redirectUrl = CrowdfundingHelperRoute::getTransactionsRoute();
     $this->prepareDocument();
     parent::display($tpl);
 }
Esempio n. 3
0
foreach ($this->items as $item) {
    $classRow = !$item->reward_state ? "" : 'class="success"';
    $socialProfileLink = !$this->socialProfiles ? null : $this->socialProfiles->getLink($item->receiver_id);
    ?>
                        <tr <?php 
    echo $classRow;
    ?>
>
                            <td>
                                <?php 
    echo JHtml::_('crowdfunding.socialProfileLink', $socialProfileLink, $item->name);
    ?>
                            </td>
                            <td class="hidden-phone">
                                <a href="<?php 
    echo JRoute::_(CrowdfundingHelperRoute::getTransactionsRoute() . "&filter_search=id:" . $item->transaction_id);
    ?>
">
                                    <?php 
    echo $item->txn_id;
    ?>
                                </a>
                            </td>
                            <td class="text-center">
                                <?php 
    $canEdit = $this->userId != $item->receiver_id ? false : true;
    echo JHtml::_('crowdfunding.reward', $item->reward_id, $item->reward_name, $item->transaction_id, $item->reward_state, $canEdit, $this->redirectUrl);
    ?>
                            </td>
                        </tr>
                        <?php