示例#1
0
 /**
  * @todo check/fix! // 30-07-2015
  * move to model/controller
  */
 public function canDelete($id)
 {
     // cannot be deleted if assigned to games
     $query = ' SELECT COUNT(id) FROM #__joomleague_match_player ' . ' WHERE teamplayer_id = ' . $this->getDbo()->Quote($id) . ' GROUP BY teamplayer_id ';
     $this->getDbo()->setQuery($query, 0, 1);
     $res = $this->getDbo()->loadResult();
     if ($res) {
         $this->setError(Jtext::sprintf('PLAYER ASSIGNED TO %d GAMES', $res));
         return false;
     }
     // cannot be deleted if has events
     $query = ' SELECT COUNT(id) FROM #__joomleague_match_event ' . ' WHERE teamplayer_id = ' . $this->getDbo()->Quote($id) . ' GROUP BY teamplayer_id ';
     $this->getDbo()->setQuery($query, 0, 1);
     $res = $this->getDbo()->loadResult();
     if ($res) {
         $this->setError(JText::sprintf('%d EVENTS ASSIGNED TO PLAYER', $res));
         return false;
     }
     // cannot be deleted if has stats
     $query = ' SELECT COUNT(id) FROM #__joomleague_match_statistic ' . ' WHERE teamplayer_id = ' . $this->getDbo()->Quote($id) . ' GROUP BY teamplayer_id ';
     $this->getDbo()->setQuery($query, 0, 1);
     $res = $this->getDbo()->loadResult();
     if ($res) {
         $this->setError(JText::sprintf('%d STATS ASSIGNED TO PLAYER', $res));
         return false;
     }
     return true;
 }
示例#2
0
 public static function postMessage($params, $data)
 {
     $attachment = array('message' => $data['message']);
     $message = array();
     if (!class_exists('TwitterOAuth')) {
         require_once dirname(__FILE__) . '/elements/twitter/twitteroauth.php';
     }
     $user = $params->params->get('groupid');
     $checked = 0;
     $log = '';
     $publish = 1;
     if (isset($user->checked)) {
         $checked = 1;
         $twitter = unserialize($params->params->get('access_token'));
         $connection = new TwitterOAuth($params->params->get('app_appid'), $params->params->get('app_secret'), $twitter['oauth_token'], $twitter['oauth_token_secret']);
         $parameters = array('status' => $attachment['message']);
         $status = $connection->post('statuses/update', $parameters);
         if (isset($status->errors)) {
             $log = Jtext::_('PUBLISHED_TWITTER_PROFILE_SENDMESSAGE') . ' <a href="https://twitter.com/' . $user->screen_name . '" target="_blank" style="text-decoration: underline;">' . $user->name . '</a>  - ' . $status->errors[0]->message . ' <br/>';
             $publish = 0;
         } else {
             $log = Jtext::_('PUBLISHED_TWITTER_PROFILE_SENDMESSAGE') . ' <a href="https://twitter.com/' . $user->screen_name . '" target="_blank" style="text-decoration: underline;">' . $user->name . '</a>  - ' . JTEXT::_('PUBLISHED_TWITTER_PROFILE_SENDMESSAGE_SUCCESSFULL') . '<br/>';
             $publish = 1;
         }
     }
     $message['log'] = $log;
     $message['publish'] = $publish;
     $message['checked'] = $checked;
     $message['type'] = 'twitter';
     return $message;
 }
示例#3
0
function pagination_list_footer($list)
{
    static $instancetest = 0;

    // Initialise variables.
    $lang = JFactory::getLanguage();
    $html = "<div class=\"list-footer\">\n";

    //$html .= "\n<div class=\"limit\">".JText::_('JGLOBAL_DISPLAY_NUM').$list['limitfield']."</div>";

    $html .= $list['pageslinks'];
    $html .= "<span>".Jtext::_('TPL_MINIMA_TOTAL')." ".$list['total']." ".Jtext::_('TPL_MINIMA_ITEMS')."</span>";

    //$html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";

    //$html .= "\n<input id=\"limit\" type=\"hidden\" name=\"limit\" value=\"15\" />";

    if ($instancetest == 0) {
        $html .= "\n<input type=\"hidden\" name=\"" . $list['prefix'] . "limitstart\" value=\"".$list['limitstart']."\" />";
    }

    $instancetest = 1;

    $html .= "\n</div>";

    return $html;
}
示例#4
0
 /**
  * Method to delete rows.
  *
  * @param   array  &$pks  An array of item ids.
  *
  * @return  boolean  Returns true on success, false on failure.
  */
 public function delete(&$pks)
 {
     $pks = (array) $pks;
     $user = JFactory::getUser();
     $table = $this->getTable();
     // Iterate the items to delete each one.
     foreach ($pks as $pk) {
         if ($table->load($pk)) {
             // Access checks.
             if (!$user->authorise('core.delete', 'com_templates')) {
                 throw new Exception(JText::_('JERROR_CORE_DELETE_NOT_PERMITTED'));
             }
             // You should not delete a default style
             if ($table->home != '0') {
                 JError::raiseWarning(SOME_ERROR_NUMBER, Jtext::_('COM_TEMPLATES_STYLE_CANNOT_DELETE_DEFAULT_STYLE'));
                 return false;
             }
             if (!$table->delete($pk)) {
                 $this->setError($table->getError());
                 return false;
             }
         } else {
             $this->setError($table->getError());
             return false;
         }
     }
     // Clean cache
     $this->cleanCache();
     return true;
 }
示例#5
0
 function check()
 {
     if (empty($this->submit_key)) {
         $this->setError(Jtext::_('COM_REDFORM_PAYMENT_TABLE_SUBMIT_KEY_IS_REQUIRED'));
         return false;
     }
     return true;
 }
示例#6
0
 public function renderSubmenu($vName = null)
 {
     if (is_null($vName)) {
         $vName = $this->input->getCmd('view', 'cpanel');
     }
     $this->input->set('view', $vName);
     parent::renderSubmenu();
     $toolbar = FOFToolbar::getAnInstance($this->input->getCmd('option', 'com_db8locate'), $this->config);
     $toolbar->appendLink(Jtext::_('COM_DB8LOCATE_SUBMENU_CATEGORIES'), 'index.php?option=com_categories&extension=com_db8locate', $vName == 'categories');
 }
示例#7
0
 public static function postMessage($params, $data)
 {
     $attachment = array('comment' => $data['message'], 'content' => array('title' => $data['name'], 'description' => $data['description'], 'submittedUrl' => $data['link'], 'submitted-image-url' => $data['picture']), 'visibility' => array('code' => 'anyone'));
     $body = $attachment;
     $newArray = array('title' => $body['comment'], 'summary' => '', 'content' => $body['content']);
     $body = $newArray;
     $message = array();
     $groupid = $params->params->get('groupid');
     $access_token = $params->params->get('access_token');
     $log = '';
     $publish = 1;
     $checked = 0;
     foreach ($groupid as $key => $linkedID) {
         $id = $linkedID->id;
         if (isset($linkedID->checked)) {
             $checked = 1;
             $config = array('oauth2_access_token' => $access_token, 'format' => 'json');
             $urlInfo = parse_url('http://api.linkedin.com/v1/groups/' . $id . '/posts?');
             if (isset($urlInfo['query'])) {
                 $query = parse_str($urlInfo['query']);
                 $config = array_merge($config, $query);
             }
             $url = 'https://api.linkedin.com' . $urlInfo['path'] . '?' . http_build_query($config);
             if (!is_string($body)) {
                 $body = json_encode($body);
             }
             $ch = curl_init();
             curl_setopt($ch, CURLOPT_URL, $url);
             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
             curl_setopt($ch, CURLOPT_POST, true);
             curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
             curl_setopt($ch, CURLOPT_HEADER, 0);
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
             curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
             $go = curl_exec($ch);
             $page = json_decode($go);
             if (isset($page->message)) {
                 $log .= Jtext::_('PUBLISHED_LINKEDIN_GROUPS_SENDMESSAGE') . ' <a href="http://www.linkedin.com/groups/Fan-torres-5162538?home=&gid=' . $id . '" target="_blank" style="text-decoration: underline;">' . $linkedID->name . '</a>  - ' . $page->message . ' <br/>';
                 $publish = 0;
             } else {
                 $log .= Jtext::_('PUBLISHED_LINKEDIN_GROUPS_SENDMESSAGE') . ' <a href="http://www.linkedin.com/groups/Fan-torres-5162538?home=&gid=' . $id . '" style="text-decoration: underline;" target="_blank">' . $linkedID->name . '</a> - ' . JTEXT::_('PUBLISHED_LINKEDIN_GROUPS_SENDMESSAGE_SUCCESSFULL') . '<br/>';
                 $publish = 1;
             }
             curl_close($ch);
         }
     }
     $message['log'] = $log;
     $message['publish'] = $publish;
     $message['checked'] = $checked;
     $message['type'] = 'linkedin';
     return $message;
 }
示例#8
0
 function submitinfo()
 {
     jimport('joomla.mail.helper');
     $app =& JFactory::getApplication();
     $params = JComponentHelper::getParams('com_redevent');
     if (!$params->get('enable_moreinfo', 1)) {
         echo Jtext::_('COM_REDEVENT_MOREINFO_ERROR_DISABLED_BY_ADMIN');
         $app->close(403);
     }
     $xref = JRequest::getInt('xref');
     $email = JRequest::getVar('email');
     $model = $this->getModel('details');
     $details = $model->getDetails();
     if ($xref && $email && JMailHelper::isEmailAddress($email)) {
         $mailer =& JFactory::getMailer();
         $mailer->IsHTML(true);
         $mailer->setSubject(JText::sprintf('COM_REDEVENT_MOREINFO_MAIL_SUBJECT', $details->full_title));
         $mailer->AddAddress($app->getCfg('mailfrom'), $app->getCfg('sitename'));
         $mailer->AddReplyTo(array($email, JRequest::getVar('name')));
         $data = array();
         if ($d = JRequest::getVar('name')) {
             $data[] = array(Jtext::_('COM_REDEVENT_MOREINFO_LABEL_NAME'), $d);
         }
         if ($d = JRequest::getVar('email')) {
             $data[] = array(Jtext::_('COM_REDEVENT_MOREINFO_LABEL_EMAIL'), $d);
         }
         if ($d = JRequest::getVar('company')) {
             $data[] = array(Jtext::_('COM_REDEVENT_MOREINFO_LABEL_COMPANY'), $d);
         }
         if ($d = JRequest::getVar('phonenumber')) {
             $data[] = array(Jtext::_('COM_REDEVENT_MOREINFO_LABEL_PHONENUMBER'), $d);
         }
         if ($d = JRequest::getVar('comments')) {
             $data[] = array(Jtext::_('COM_REDEVENT_MOREINFO_LABEL_COMMENTS'), str_replace("\n", "<br/>", $d));
         }
         $table = '<table>';
         foreach ($data as $d) {
             $table .= '<tr><td>' . $d[0] . '</td><td>' . $d[1] . '</td></tr>';
         }
         $table .= '</table>';
         $link = JRoute::_(JURI::base() . RedeventHelperRoute::getDetailsRoute($details->did, $details->xslug));
         $link = JHTML::link($link, $details->full_title);
         $body = JText::sprintf('COM_REDEVENT_MOREINFO_MAIL_BODY', $link, $table);
         $mailer->setBody($body);
         $mailer->send();
     }
     // confirm sending
     JRequest::setVar('view', 'moreinfo');
     Jrequest::setVar('layout', 'final');
     $this->display();
 }
示例#9
0
 /**
  * Method to clone existing Ingredients
  *
  * @return void
  */
 public function duplicate()
 {
     // Check for request forgeries
     Jsession::checkToken() or jexit(JText::_("JINVALID_TOKEN"));
     // Get id(s)
     $pks = $this->input->post->get("cid", array(), "array");
     try {
         if (empty($pks)) {
             throw new Exception(JText::_("COM_AKRECIPES_NO_ELEMENT_SELECTED"));
         }
         ArrayHelper::toInteger($pks);
         $model = $this->getModel();
         $model->duplicate($pks);
         $this->setMessage(Jtext::_("COM_AKRECIPES_ITEMS_SUCCESS_DUPLICATED"));
     } catch (Exception $e) {
         JFactory::getApplication()->enqueueMessage($e->getMessage(), "warning");
     }
     $this->setRedirect("index.php?option=com_akrecipes&view=ingredients");
 }
示例#10
0
 public function threads($thread, $createNew = true)
 {
     $html = $this->_template->getHelper('html');
     $options = array();
     $entities = $this->getService('repos://site/forums.thread')->getQuery()->where('parent_id', '=', $thread->parent->id)->order('last_comment_on', 'DESC')->limit('20')->fetchSet();
     $parameters = array();
     if ($createNew) {
         $options[] = JText::_('COM-FORUMS-POST-CREATE-NEW-THREAD');
         $parameters['selected'] = $thread->id;
     } else {
         $options[] = JText::_('COM-FORUMS-THREAD-SELECT-THREAD');
     }
     $options[-1] = Jtext::_('COM-FORUMS-POST-SPECIFY-THREAD');
     foreach ($entities as $entity) {
         $options[$entity->id] = $entity->title;
     }
     $parameters['options'] = $options;
     return $html->select('tid', $parameters)->class('input-xlarge');
 }
示例#11
0
    protected function addMenuSelection()
    {
        require_once JPATH_COMPONENT . '/helpers/maximenuckhelper.php';
        $canDo = MaximenuckHelper::getActions($this->state->get('filter.parent_id'));
        $menushtml = '';
        // Add a batch button
        if ($canDo->get('core.edit')) {
            $menushtml .= '<div id="toolbar-menu" class="btn-wrapper">';
            foreach ($this->get('Menus') as $menu) {
                $active = $menu->menutype == JFactory::getApplication()->input->get('menutype') ? ' active' : '';
                $menushtml .= '<a href="index.php?option=com_maximenuck&view=migration&menutype=' . $menu->menutype . '"><button class="btn btn-small btn-primary' . $active . '">
						<i class="icon-list-view"></i>
						' . $menu->title . '</button></a>';
            }
        } else {
            $menushtml = Jtext::_('COM_MENUMANAGERCK_NOT_HAVE_RIGHT_TO_EDIT');
        }
        return $menushtml;
    }
示例#12
0
 /**
  * Method to clone existing Categories
  *
  * @return void
  */
 public function duplicate()
 {
     // Check for request forgeries
     Jsession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Get id(s)
     $pks = $this->input->post->get('cid', array(), 'array');
     try {
         if (empty($pks)) {
             throw new Exception(JText::_('COM_VOCAB_NO_ELEMENT_SELECTED'));
         }
         ArrayHelper::toInteger($pks);
         $model = $this->getModel();
         $model->duplicate($pks);
         $this->setMessage(Jtext::_('COM_VOCAB_ITEMS_SUCCESS_DUPLICATED'));
     } catch (Exception $e) {
         JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning');
     }
     $this->setRedirect('index.php?option=com_vocab&view=categories');
 }
 function canDelete($id)
 {
     // the staff cannot be deleted if assigned to games
     $query = ' SELECT COUNT(id) FROM #__joomleague_match_staff ' . ' WHERE team_staff_id = ' . $this->getDbo()->Quote($id) . ' GROUP BY team_staff_id ';
     $this->getDbo()->setQuery($query, 0, 1);
     $res = $this->getDbo()->loadResult();
     if ($res) {
         $this->setError(Jtext::sprintf('STAFF ASSIGNED TO %d GAMES', $res));
         return false;
     }
     // the staff cannot be deleted if has stats
     $query = ' SELECT COUNT(id) FROM #__joomleague_match_staff_statistic ' . ' WHERE team_staff_id = ' . $this->getDbo()->Quote($id) . ' GROUP BY team_staff_id ';
     $this->getDbo()->setQuery($query, 0, 1);
     $res = $this->getDbo()->loadResult();
     if ($res) {
         $this->setError(JText::sprintf('%d STATS ASSIGNED TO STAFF', $res));
         return false;
     }
     return true;
 }
示例#14
0
 protected function getInput()
 {
     if ($this->value != '') {
         $avatar = '<img src="' . JURI::root() . 'images/bt_socialconnect/avatar/' . $this->value . '"/>';
         $html = '<div class=\'imageupload\'>';
         $html .= '<span class="editlinktip hasTip" title="' . htmlspecialchars($avatar) . '">';
         $html .= '<img src=' . JURI::root() . 'images/bt_socialconnect/avatar/' . $this->value . '   style="height:30px"  />';
         $html .= '</span>';
         $html .= '<input type="file" name="upload_image"  class="inputbox" size="22"/>';
         $html .= '</div>';
         $html .= '<div class="clr"></div>';
         $html .= '<label></label>';
         $html .= '<input type="checkbox" class="textbook" name="jform[default_values]" value="">' . Jtext::_('COM_BT_SOCIALCONNECT_DELETE_IMAGE');
         $html .= '<div class="clr"></div>';
     } else {
         $html = '<div class=\'inputupload\'>';
         $html .= '<input type="file" name="upload_image" style="width:230px"  class="inputbox" size="30"/>';
         $html .= '</div>';
     }
     return $html;
 }
示例#15
0
 /**
  * ResponseReceived()
  * From the payment page, the user returns to the shop. The order email is sent, and the cart emptied.
  *
  * @author Valerie Isaksen
  *
  */
 function PaymentResponseReceived()
 {
     if (!class_exists('vmPSPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
     }
     JPluginHelper::importPlugin('vmpayment');
     $return_context = "";
     $dispatcher = JDispatcher::getInstance();
     $html = "";
     $paymentResponse = Jtext::_('COM_VIRTUEMART_CART_THANKYOU');
     $returnValues = $dispatcher->trigger('plgVmOnPaymentResponseReceived', array('html' => &$html, &$paymentResponse));
     // 	JRequest::setVar('paymentResponse', Jtext::_('COM_VIRTUEMART_CART_THANKYOU'));
     // 	JRequest::setVar('paymentResponseHtml', $html);
     $view = $this->getView('pluginresponse', 'html');
     $layoutName = JRequest::getVar('layout', 'default');
     $view->setLayout($layoutName);
     $view->assignRef('paymentResponse', $paymentResponse);
     $view->assignRef('paymentResponseHtml', $html);
     // Display it all
     $view->display();
 }
示例#16
0
 public static function postMessage($params, $data)
 {
     $attachment = array('access_token' => $data['access_token'], 'message' => $data['message'], 'name' => $data['name'], 'link' => $data['link'], 'description' => $data['description'], 'picture' => $data['picture']);
     $message = array();
     $fbpages = $params->params->get('groupid');
     $log = '';
     $publish = 1;
     $checked = 0;
     foreach ($fbpages as $key => $pages) {
         $id = $pages->id;
         //Replace accesstoken to fanpage
         $attachment['access_token'] = $pages->access_token;
         if (isset($pages->checked)) {
             $checked = 1;
             $url = "https://graph.facebook.com/{$id}/feed";
             $ch = curl_init();
             curl_setopt($ch, CURLOPT_URL, $url);
             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
             curl_setopt($ch, CURLOPT_POST, true);
             curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
             curl_setopt($ch, CURLOPT_HEADER, 0);
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
             $go = curl_exec($ch);
             $page = json_decode($go);
             if (isset($page->error)) {
                 $log .= Jtext::_('PUBLISHED_FACEBOOK_PAGES_SENDMESSAGE') . ' <a href="https://www.facebook.com/' . $id . '" target="_blank" style="text-decoration: underline;">' . $pages->name . '</a>  - ' . $page->error->message . ' <br/>';
                 $publish = 0;
             } else {
                 $log .= Jtext::_('PUBLISHED_FACEBOOK_PAGES_SENDMESSAGE') . ' <a href="https://www.facebook.com/' . $id . '" target="_blank" style="text-decoration: underline;">' . $pages->name . '</a>  - ' . JTEXT::_('PUBLISHED_FACEBOOK_PAGES_SENDMESSAGE_SUCCESSFULL') . '<br/>';
             }
             curl_close($ch);
         }
     }
     $message['log'] = $log;
     $message['publish'] = $publish;
     $message['checked'] = $checked;
     $message['type'] = 'facebook';
     return $message;
 }
示例#17
0
 public function add()
 {
     $mainframe = JFactory::getApplication();
     $option = $this->input->getCmd('option', 'com_tracks');
     $db = JFactory::getDBO();
     $individualid = $this->input->getInt("individualid", 0);
     $name = $this->input->get("quickadd", '', 'request', 'string');
     $srid = $this->input->getInt("subround_id", 0);
     $projectid = $mainframe->getUserState($option . "project");
     // add the new individual as their name was sent through.
     if (!$individualid) {
         $model = FOFModel::getAnInstance('Individuals', 'TracksModel');
         $name = explode(" ", $name);
         $firstname = ucfirst(array_shift($name));
         $lastname = ucfirst(implode(" ", $name));
         $data = array("first_name" => $firstname, "last_name" => $lastname);
         $res = $model->save($data);
         if (!$res) {
             $msg = Jtext::_('COM_TRACKS_Error_adding_individual') . ': ' . $model->getError();
             $this->setRedirect("index.php?option=com_tracks&view=subroundresults&subround_id=" . $srid, $msg, 'error');
         }
         $individualid = $model->getId();
     }
     // check if indivual belongs to project
     $query = ' SELECT individual_id FROM #__tracks_projects_individuals ' . ' WHERE project_id = ' . $db->Quote($projectid) . '   AND individual_id = ' . $db->Quote($individualid);
     $db->setQuery($query);
     $res = $db->loadResult();
     if (!$res) {
         $db->setQuery("INSERT INTO #__tracks_projects_individuals (individual_id, project_id) VALUES (" . $individualid . ", " . $projectid . ")");
         $db->query();
     }
     // assign the individual to the subround.
     if ($individualid && $srid) {
         $db->setQuery("INSERT INTO #__tracks_rounds_results (individual_id, subround_id) VALUES (" . $individualid . ", " . $srid . ")");
         $db->query();
     }
     $this->setRedirect("index.php?option=com_tracks&view=subroundresults&subround_id=" . $srid);
 }
示例#18
0
 /**
  * save assigned individuals
  *
  * @return bool
  *
  * @throws Exception
  */
 public function saveassign()
 {
     $project_id = $this->input->getInt('project_id', 0);
     $cid = $this->input->get('cid', '', 'array');
     $numbers = $this->input->get('number', '', 'array');
     $team_id = $this->input->get('team_id', '', 'array');
     JArrayHelper::toInteger($cid);
     JArrayHelper::toInteger($team_id);
     if (count($cid) < 1) {
         throw new Exception(JText::_('COM_TRACKS_Select_an_individual_to_assign'), 500);
     }
     $rows = array();
     foreach ($cid as $k => $id) {
         $row = new stdclass();
         $row->individual_id = $cid[$k];
         $row->team_id = $team_id[$k];
         $row->number = $numbers[$k];
         $row->project_id = $project_id;
         $rows[] = $row;
     }
     $msg = '';
     $model = $this->getModel('projectindividuals');
     $model->setState('project_id', $project_id);
     $assigned = $model->assign($rows);
     if ($assigned === false) {
         $msg = $model->getError(true);
         $link = 'index.php?option=com_tracks&view=individuals';
         $this->setRedirect($link, $msg);
     } else {
         $msg = Jtext::sprintf('COM_TRACKS_D_INDIVIDUALS_ADDED_TO_PROJECT', $assigned);
         $app = JFactory::getApplication();
         $option = $app->input->getCmd('option', 'com_tracks');
         $app->setUserState($option . 'project', $project_id);
         $link = 'index.php?option=com_tracks&view=projectindividuals';
         $this->setRedirect($link, $msg);
     }
     return true;
 }
示例#19
0
 /**
  * Creates the output
  *
  * @since 0.5
  * @param int $tpl
  */
 function display($tpl = null)
 {
     $params = JComponentHelper::getParams('com_redevent');
     if (!$params->get('enable_moreinfo', 1)) {
         echo Jtext::_('COM_REDEVENT_MOREINFO_ERROR_DISABLED_BY_ADMIN');
         return;
     }
     if ($this->getLayout() == 'final') {
         return $this->_displayFinal($tpl);
     }
     $xref = JRequest::getInt('xref');
     $uri =& JFactory::getUri();
     $document = JFactory::getDocument();
     $user =& Jfactory::getUser();
     if (!$xref) {
         echo JText::_('COM_REDEVENT_MOREINFO_ERROR_MISSING_XREF');
     }
     $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/moreinfo.css');
     $this->assign('xref', $xref);
     $this->assign('action', JRoute::_(RedeventHelperRoute::getMoreInfoRoute($xref)));
     $this->assignRef('user', $user);
     parent::display($tpl);
 }
 function ShipmentResponseReceived()
 {
     // TODO: not ready yet
     JPluginHelper::importPlugin('vmshipment');
     $return_context = "";
     $dispatcher = JDispatcher::getInstance();
     $html = "";
     $shipmentResponse = Jtext::_('COM_VIRTUEMART_CART_THANKYOU');
     $dispatcher->trigger('plgVmOnShipmentResponseReceived', array('html' => &$html, &$shipmentResponse));
     /*
     // 	JRequest::setVar('paymentResponse', Jtext::_('COM_VIRTUEMART_CART_THANKYOU'));
     // 	JRequest::setVar('paymentResponseHtml', $html);
     $view = $this->getView('pluginresponse', 'html');
     $layoutName = JRequest::getVar('layout', 'default');
     $view->setLayout($layoutName);
     
     $view->assignRef('shipmentResponse', $shipmentResponse);
     $view->assignRef('shipmentResponseHtml', $html);
     
     // Display it all
     $view->display();
     */
 }
示例#21
0
 /**
  * @return bool|null
  */
 function plgVmOnUserPaymentCancel()
 {
     if (!class_exists('VirtueMartModelOrders')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
     }
     $order_number = JRequest::getString('on', '');
     $virtuemart_paymentmethod_id = JRequest::getInt('pm', '');
     if (empty($order_number) or empty($virtuemart_paymentmethod_id) or !$this->selectedThisByMethodId($virtuemart_paymentmethod_id)) {
         return NULL;
     }
     if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($order_number))) {
         return NULL;
     }
     if (!($paymentTable = $this->getDataByOrderId($virtuemart_order_id))) {
         return NULL;
     }
     VmInfo(Jtext::_('VMPAYMENT_PAYPAL_PAYMENT_CANCELLED'));
     $session = JFactory::getSession();
     $return_context = $session->getId();
     if (strcmp($paymentTable->paypal_custom, $return_context) === 0) {
         $this->handlePaymentUserCancel($virtuemart_order_id);
     }
     return TRUE;
 }
示例#22
0
 function renderMailLayout()
 {
     $this->setLayout('mail_html_question');
     $this->comment = JRequest::getString('comment');
     $vendorModel = VmModel::getModel('vendor');
     $this->vendor = $vendorModel->getVendor();
     $this->subject = Jtext::_('COM_VIRTUEMART_QUESTION_ABOUT') . $this->product->product_name;
     $this->vendorEmail = $this->user['email'];
     // in this particular case, overwrite the value for fix the recipient name
     $this->vendor->vendor_name = $this->user['name'];
     //$this->vendorName= $this->user['email'];
     if (VmConfig::get('order_mail_html')) {
         $tpl = 'mail_html_question';
     } else {
         $tpl = 'mail_raw_question';
     }
     $this->setLayout($tpl);
     parent::display();
 }
示例#23
0
    function getDisplayTab($tab, $user, $ui) {

        $my = JFactory::getUser();
        $database = &JFactory::getDBO();

        if ($my->id != $user->user_id || !$my->id) {
            return;
        }

        $componentPath = JPATH_SITE . DS . 'components' . DS . 'com_bids';

        require_once($componentPath.DS.'options.php');
        $cfg = new BidConfig();

        require_once($componentPath . DS . 'helpers' . DS . 'tools.php');
        require_once($componentPath . DS . 'thefactory' . DS . 'front.userprofile.php');
        require_once($componentPath . DS . 'helpers' . DS . 'profile.php');


        JModel::addIncludePath($componentPath . DS . 'models');

        $bidsUserModel = JModel::getInstance('user','bidsModel');
        $bidsUserModel->loadUser($my->id);
        $bidsProfile = $bidsUserModel->get('profile');

        $balance = $bidsUserModel->getBalance();

        //here begins output
        $html =
        '<div>
            <table width="100%">
                <tr>
                    <td colspan="4">';

                        if($cfg->bid_opt_enable_acl) {
                            $sellerImg = JURI::root() . 'components/com_bids/images/f_can_sell'.( !empty($bidsProfile->isSeller) ? '1':'2').'.gif';
                            $html .= '<div style="width:120px;float:left;">'.
                                           JHTML::image($sellerImg,'','style="margin-right:50px;" border="0"').
                                       '</div>';
                            $bidderImg = JURI::root() . 'components/com_bids/images/f_can_buy'.( !empty($bidsProfile->isBidder) ? '1':'2').'.gif';
                            $html .= '<div style="width:120px;float:left;">'.
                                           JHTML::image($bidderImg,'','style="margin-right:60px;" border="0"').
                                       '</div>';
                        }
                        elseif(!empty($bidsProfile->powerseller)) {
                            $sellerImg = JURI::root() . 'components/com_bids/images/f_can_sell'.( !empty($bidsProfile->isSeller) ? '1':'2').'.gif';
                            $html .= '<div style="width:120px;float:left;">'.
                                           JHTML::image($sellerImg,'','style="margin-right:50px;" border="0"').
                                       '</div>';
                        }

                        $verifiedImg = JURI::root() . 'components/com_bids/images/verified_'.( !empty($bidsProfile->verified) ? '1':'0').'.gif';
                        $html .= '<div style="width:120px;float:left;">'.
                                       JHTML::image($verifiedImg,'','style="margin-right:50px;" border="0"').
                                   '</div>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">';

                        if($cfg->bid_opt_enable_acl) {
                            if (!empty($bidsProfile->isSeller)){
                                $html .= "<div style='width:120px;float:left;'>" . Jtext::_('COM_BIDS_acl_group_seller') . ":" . ($bidsProfile->powerseller ? JText::_('Powerseller') : JText::_('Seller'))  . "</div>";
                            } else {
                                $html .= "<div style='width:120px;float:left;'>" . Jtext::_('COM_BIDS_acl_group_seller') . ":" . ($bidsProfile->isSeller ? Jtext::_('COM_BIDS_YES') : Jtext::_('COM_BIDS_no') ) . "</div>";
                            }
                            $html .= "<div style='width:120px;float:left;'>" . Jtext::_('COM_BIDS_acl_group_bidder') . ":" . ($bidsProfile->isBidder ? Jtext::_('COM_BIDS_YES') : Jtext::_('COM_BIDS_no') ) . "</div>";
                        }
                        elseif(!empty($bidsProfile->powerseller)) {
                            $html .= "<div style='width:120px;float:left;'>" . Jtext::_('COM_BIDS_acl_group_seller') . ":" . ($bidsProfile->powerseller ? JText::_('Powerseller') : JText::_('Seller'))  . "</div>";
                        }
                        $html .= "<div style='width:120px;float:left;'>" . Jtext::_('COM_BIDS_user_verified') . ":" . ( (isset($bidsProfile->verified) && $bidsProfile->verified) ? Jtext::_('COM_BIDS_YES') : Jtext::_('COM_BIDS_no') ) . "</div>".

                    '</td>
                </tr>
                <tr>
                    <td colspan="4">';

        $tasklist = array(
            'newauction' => 'f_newauction.png',
            'myauctions' => 'f_myauctions.png ',
            'mybids' => 'f_mybids.png',
            'mywonbids' => 'f_mywonbids.png',
            'mywatchlist' => 'f_mywatchlist.png',
            'listcats' => 'f_listcats.png',
            'listauctions' => 'f_listauctions.png',
            'search' => 'f_search.png'
        );
        $keys = array_keys($tasklist);

        $html .= '<table width="100%">
                    <tr>';
                    for ($i = 0; $i < count($keys) / 2; $i++) {
                        $f_task = JRoute::_("index.php?option=com_bids&task=" . $keys[$i]);
                        $html .= "<td width='100'><a href='$f_task'><img src='" . JURI::root() . "components/com_bids/images/menu/" . $tasklist[$keys[$i]] . "' border=0></a></td>";
                    }
        $html .=    '</tr>
                    <tr>';

                    for ($i = count($keys) / 2; $i < count($keys); $i++) {
                        $f_task = JRoute::_("index.php?option=com_bids&task=" . $keys[$i]);
                        $html .= "<td width='100'><a href='$f_task'><img src='" . JURI::root() . "components/com_bids/images/menu/" . $tasklist[$keys[$i]] . "' border=0></a></td>";
                    }
        $html .=    '</tr>
                </table>
            </td>
        </tr>';

        $html .= '<tr>
            <td>
                <div class="auction_credits">'.
                    JText::_('COM_BIDS_YOUR_CURRENT_BALANCE_IS').'&nbsp'.
                    $balance->balance.'&nbsp;'.$balance->currency.
                '</div>
                <div>
                    <a href="'.BidsHelperRoute::getAddFundsRoute().'">'.
                     JText::_('COM_BIDS_ADD_FUNDS_TO_YOUR_BALANCE').
                     '</a>
                </div>
                 <div>
                     <a href="'.BidsHelperRoute::getPaymentsHistoryRoute().'">'.
                      JText::_('COM_BIDS_SEE_MY_PAYMENTS_HISTORY').
                      '</a>
                 </div>
            </td>
        </tr>';


        $html .=
            '</table>
        </div>';

        return $html;
    }
示例#24
0
			<div id="div_awd_attached_img">		
			</div>
			<div id="div_awd_attached_info">
				<span class="editable" id="awd_attached_title"></span><br>
				<span id="awd_attached_file"></span><br>
				<span class="editable" id="awd_attached_des"></span>
				<br>
				<br>
				<div class="awd_attached_attribute">
					<label style="float:left"><img src="<?php echo JURI::base();?>components/com_awdwall/images/prev.png" id="prev" onclick="prev_img();" alt="" /><img src="<?php echo JURI::base();?>components/com_awdwall/images/next.png" id="next" onclick="next_img();" alt="" /></label>				
					<div id="count_text">
						<span id="count_img_active">1</span> <?php echo Jtext::_('of'); ?> <span id="sum_img"></span>
					</div>
					<br/>
					<br/>
					<input onclick="no_img()" type="checkbox" value="check" id="hidden_img" name="hidden_img" /> <?php echo Jtext::_('Hidden image thumb'); ?>
				</div>
			</div>
			<input type="hidden" id="count_img" />
			<input type="hidden" name="url_root" value="<?php echo JURI::base();?>" id="url_root" />
			<div style="display:none;" id="txtHint"></div>
		</div>
		<!-- video form -->
		<div class="attach_link clearfix message info" style="display:none;" id="awd_video_form" >

		<span class="close"><a href="javascript:void(0);" onClick="closeVideoBox();">x</a></span>
<BR />
		<div style="float:left; width:100%;">
		
		<div style="float:left;padding-right:20px;  ">
			<div class="vicons"><a href="http://www.youtube.com/" title="<?php echo JText::_('YouTube');?>" alt="<?php echo JText::_('YouTube');?>" target="_blank"><img src="<?php echo JURI::base();?>components/com_awdwall/images/vicons/youtube.png" /></a></div>
示例#25
0
 /**
  * Proceeds the simple payment
  *
  * @param string $resp
  * @param array  $submitted_values
  * @return object Message object
  *
  */
 function _handleResponse($response, $submitted_values, $order, $payment_name)
 {
     $delimiter = $this->_authorizenet_params['delim_char'];
     $encap_char = $this->_authorizenet_params['encap_char'];
     if ($response) {
         // Split Array
         if ($encap_char) {
             //$response_array = explode($encap_char . $delimiter . $encap_char, substr($response, 1, -1));
             $response_array = explode($encap_char, $response);
         } else {
             $response_array = explode($delimiter, $response);
         }
         /**
          * If AuthorizeNet doesn't return a delimited response.
          */
         if (count($response_array) < 10) {
             $this->approved = FALSE;
             $this->error = TRUE;
             $error_message = JText::_('VMPAYMENT_AUTHORIZENET_UNKNOWN') . $response;
             // send email to vendor
             $this->sendEmailToVendorAndAdmins(JText::_('VMPAYMENT_AUTHORIZENET_ERROR_EMAIL_SUBJECT'), $error_message);
             return $error_message;
         }
         $authorizeNetResponse['response_code'] = $response_array[0];
         $this->approved = $authorizeNetResponse['response_code'] == self::APPROVED;
         $this->declined = $authorizeNetResponse['response_code'] == self::DECLINED;
         $this->error = $authorizeNetResponse['response_code'] == self::ERROR;
         $this->held = $authorizeNetResponse['response_code'] == self::HELD;
         $authorizeNetResponse['response_subcode'] = $response_array[1];
         $authorizeNetResponse['response_reason_code'] = $response_array[2];
         $authorizeNetResponse['response_reason_text'] = $response_array[3];
         $authorizeNetResponse['authorization_code'] = $response_array[4];
         $authorizeNetResponse['avs_response'] = $response_array[5];
         //Address Verification Service
         $authorizeNetResponse['transaction_id'] = $response_array[6];
         $authorizeNetResponse['invoice_number'] = $response_array[7];
         $authorizeNetResponse['description'] = $response_array[8];
         if ($this->approved) {
             $authorizeNetResponse['amount'] = $response_array[9];
             $authorizeNetResponse['method'] = $response_array[10];
             $authorizeNetResponse['transaction_type'] = $response_array[11];
             $authorizeNetResponse['customer_id'] = $response_array[12];
             $authorizeNetResponse['first_name'] = $response_array[13];
             $authorizeNetResponse['last_name'] = $response_array[14];
             $authorizeNetResponse['company'] = $response_array[15];
             $authorizeNetResponse['address'] = $response_array[16];
             $authorizeNetResponse['city'] = $response_array[17];
             $authorizeNetResponse['state'] = $response_array[18];
             $authorizeNetResponse['zip_code'] = $response_array[19];
             $authorizeNetResponse['country'] = $response_array[20];
             $authorizeNetResponse['phone'] = $response_array[21];
             $authorizeNetResponse['fax'] = $response_array[22];
             $authorizeNetResponse['email_address'] = $response_array[23];
             $authorizeNetResponse['ship_to_first_name'] = $response_array[24];
             $authorizeNetResponse['ship_to_last_name'] = $response_array[25];
             $authorizeNetResponse['ship_to_company'] = $response_array[26];
             $authorizeNetResponse['ship_to_address'] = $response_array[27];
             $authorizeNetResponse['ship_to_city'] = $response_array[28];
             $authorizeNetResponse['ship_to_state'] = $response_array[29];
             $authorizeNetResponse['ship_to_zip_code'] = $response_array[30];
             $authorizeNetResponse['ship_to_country'] = $response_array[31];
             $authorizeNetResponse['tax'] = $response_array[32];
             $authorizeNetResponse['duty'] = $response_array[33];
             $authorizeNetResponse['freight'] = $response_array[34];
             $authorizeNetResponse['tax_exempt'] = $response_array[35];
             $authorizeNetResponse['purchase_order_number'] = $response_array[36];
             $authorizeNetResponse['md5_hash'] = $response_array[37];
             $authorizeNetResponse['card_code_response'] = $response_array[38];
             $authorizeNetResponse['cavv_response'] = $response_array[39];
             //// cardholder_authentication_verification_response
             $authorizeNetResponse['account_number'] = $response_array[50];
             $authorizeNetResponse['card_type'] = $response_array[51];
             $authorizeNetResponse['split_tender_id'] = $response_array[52];
             $authorizeNetResponse['requested_amount'] = $response_array[53];
             $authorizeNetResponse['balance_on_card'] = $response_array[54];
         }
         /*
          * check the amount is the same as the amount sent
          */
         /* SUBCODE?? */
         $this->approved = $authorizeNetResponse['response_code'] == self::APPROVED;
         $this->declined = $authorizeNetResponse['response_code'] == self::DECLINED;
         $this->error = $authorizeNetResponse['response_code'] == self::ERROR;
         $this->held = $authorizeNetResponse['response_code'] == self::HELD;
         // Set custom fields: not used yet: could put the return context
         /*
          if ($count = count($custom_fields)) {
          $custom_fields_response = array_slice($response_array, -$count, $count);
          $i = 0;
          foreach ($custom_fields as $key => $value) {
          $this->$key = $custom_fields_response[$i];
          $i++;
          }
          }
         */
         $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($authorizeNetResponse['invoice_number']);
         if (!$virtuemart_order_id) {
             $this->approved = FALSE;
             $this->error = TRUE;
             $this->logInfo(JText::sprintf('VMPAYMENT_AUTHORIZENET_NO_ORDER_NUMBER', $authorizeNetResponse['invoice_number']), 'ERROR');
             //$this->sendEmailToVendorAndAdmins(JText::sprintf('VMPAYMENT_AUTHORIZENET_NO_ORDER_NUMBER', $authorizeNetResponse['invoice_number']), JText::sprintf('VMPAYMENT_AUTHORIZENET_ERROR_WHILE_PROCESSING_PAYMENT', $authorizeNetResponse['invoice_number']));
             $html = Jtext::sprintf('VMPAYMENT_AUTHORIZENET_ERROR', $authorizeNetResponse['response_reason_text'], $authorizeNetResponse['response_code']) . "<br />";
             $this->logInfo($html, 'PAYMENT DECLINED');
             return $html;
         }
         if ($this->error or $this->declined) {
             // Prepare data that should be stored in the database
             $dbValues['authorizenet_response_response_code'] = $authorizeNetResponse['response_code'];
             $dbValues['authorizenet_response_response_subcode'] = $authorizeNetResponse['response_subcode'];
             $dbValues['authorizenet_response_response_reason_code'] = $authorizeNetResponse['response_reason_code'];
             $dbValues['authorizenet_response_response_reason_text'] = $authorizeNetResponse['response_reason_text'];
             //$this->storePSPluginInternalData($dbValues, 'id', true);
             $html = Jtext::sprintf('VMPAYMENT_AUTHORIZENET_ERROR', $authorizeNetResponse['response_reason_text'], $authorizeNetResponse['response_code']) . "<br />";
             $this->logInfo($html, 'PAYMENT DECLINED');
             return $html;
         }
     } else {
         $this->approved = FALSE;
         $this->error = TRUE;
         $this->logInfo(JText::_('VMPAYMENT_AUTHORIZENET_CONNECTING_ERROR'), 'ERROR');
         $this->sendEmailToVendorAndAdmins(JText::_('VMPAYMENT_AUTHORIZENET_ERROR_EMAIL_SUBJECT'), JText::_('VMPAYMENT_AUTHORIZENET_CONNECTING_ERROR'));
         return JText::_('VMPAYMENT_AUTHORIZENET_CONNECTING_ERROR');
     }
     // Prep
     // get all know columns of the table
     $db = JFactory::getDBO();
     $query = 'SHOW COLUMNS FROM `' . $this->_tablename . '` ';
     $db->setQuery($query);
     $columns = $db->loadResultArray(0);
     foreach ($authorizeNetResponse as $key => $value) {
         $table_key = 'authorizenet_response_' . $key;
         if (in_array($table_key, $columns)) {
             $response_fields[$table_key] = $value;
         }
     }
     $response_fields['virtuemart_order_id'] = $virtuemart_order_id;
     $response_fields['invoice_number'] = $authorizeNetResponse['invoice_number'];
     $response_fields['authorizeresponse_raw'] = $response;
     $this->storePSPluginInternalData($response_fields, 'virtuemart_order_id', TRUE);
     $currencyModel = VmModel::getModel('Currency');
     $currency = $currencyModel->getCurrency($order['details']['BT']->user_currency_id);
     $html = '<table class="adminlist">' . "\n";
     $html .= $this->getHtmlRow('AUTHORIZENET_PAYMENT_NAME', $payment_name);
     $html .= $this->getHtmlRow('AUTHORIZENET_ORDER_NUMBER', $authorizeNetResponse['invoice_number']);
     $html .= $this->getHtmlRow('AUTHORIZENET_AMOUNT', $authorizeNetResponse['amount'] . ' ' . $currency->currency_name);
     //$html .= $this->getHtmlRow('AUTHORIZENET_RESPONSE_AUTHORIZATION_CODE', $authorizeNetResponse['authorization_code']);
     $html .= $this->getHtmlRow('AUTHORIZENET_RESPONSE_TRANSACTION_ID', $authorizeNetResponse['transaction_id']);
     $html .= '</table>' . "\n";
     $this->logInfo(JText::_('VMPAYMENT_AUTHORIZENET_ORDER_NUMBER') . " " . $authorizeNetResponse['invoice_number'] . ' payment approved', 'message');
     return $html;
 }
示例#26
0
function addSportsType()
{
    $result = false;
    $db = JFactory::getDbo();
    echo JText::sprintf('Adding the sports-type [%1$s] to table [%2$s] if it does not exist yet!', '<strong>' . 'Soccer' . '</strong>', '<strong>' . '#__joomleague_sports_type' . '</strong>');
    $query = "SELECT id FROM #__joomleague_sports_type WHERE name='Soccer'";
    $db->setQuery($query);
    if (!($dbresult = $db->loadObject())) {
        // Add new sportstype Soccer to #__joomleague_sports_type
        $queryAdd = "INSERT INTO #__joomleague_sports_type (`name`) VALUES ('Soccer')";
        $db->setQuery($queryAdd);
        $result = $db->execute();
    }
    echo PrintStepResult($result) . '<br />';
    if (!$result) {
        echo Jtext::_('DO NOT WORRY... Surely the sports-type soccer was already existing in your database!!!') . '<br />';
    }
    return '';
}
示例#27
0
	var xmlhttp
	function GetXmlHttpObject() {
		if (window.XMLHttpRequest) {
			// code for IE7+, Firefox, Chrome, Opera, Safari
			return new XMLHttpRequest();
		}
		if (window.ActiveXObject) {
			// code for IE6, IE5
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
		return null;
	}

	function resetOrderId() {
		if (!confirm("<?php 
echo Jtext::_('COM_REDSHOP_CONFIRM_ORDER_ID_RESET');
?>
 ")) {
			return false;
		}
		else {
			xmlhttp = GetXmlHttpObject();
			if (xmlhttp == null) {
				alert("Your browser does not support XMLHTTP!");
				return;
			}
			var url = 'index.php?option=com_redshop&view=configuration&task=resetOrderId&sid=' + Math.random();
			xmlhttp.onreadystatechange = function () {
				if (xmlhttp.readyState == 4) {
					alert("<?php 
echo JText::_('COM_REDSHOP_SUCCESSFULLY_RESET_ORDER_ID');
示例#28
0
    ?>
</li>
                    <?php 
}
?>
                </ul>
                <ul class="item-properties">
                    <?php 
if ($this->checkPosition('square-gen')) {
    ?>
                        <li><?php 
    echo Jtext::_('ALEX_SQUARE') . '<b>' . '</b>';
    ?>
</li>
                        <li><?php 
    echo Jtext::_('ALEX_SQUARE_GEN') . '<b>' . $this->renderPosition('square-gen') . '</b>';
    ?>
</li>
                    <?php 
}
?>
                </ul>

                <div class="row">
                    <div class="icons-wrap-full col-sm-12 col-xs-12">
                        <?php 
if ($this->checkPosition('tab-map')) {
    ?>
                            <div><a class="icon map-icon" href="#map" title="Посмотреть на карте"> </a></div>
                        <?php 
}
示例#29
0
	<div class="post-item-m">

		<?php 
if ($row->isFeatured) {
    ?>
		<h2 id="title-<?php 
    echo $row->id;
    ?>
" class="blog-title<?php 
    echo $row->isFeatured ? ' featured' : '';
    ?>
 rip mbs">
			<!-- Show a featured tag if the entry is featured -->
			<sup class="tag-featured"><?php 
    echo Jtext::_('COM_EASYBLOG_FEATURED_FEATURED');
    ?>
</sup>
		</h2>
		<?php 
}
?>

		<!-- Post content -->
		<div class="blog-tweet"><?php 
echo $row->text;
?>
</div>

		<!-- joomla content plugin call -->
		<?php 
 function _displayPopulate($tpl)
 {
     $app = JFactory::getApplication();
     $document = Jfactory::getDocument();
     $uri = JFactory::getURI();
     $model = $this->getModel();
     $projectws =& $this->get('Data', 'projectws');
     $document->setTitle(JText::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TITLE'));
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript('components/com_joomleague/assets/js/populate.js?v=' . $version);
     $lists = array();
     $options = array(JHTML::_('select.option', 0, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_SINGLE_ROUND_ROBIN')), JHTML::_('select.option', 1, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_DOUBLE_ROUND_ROBIN')), JHTML::_('select.option', 2, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_TOURNAMENT_ROUND_ROBIN')));
     $lists['scheduling'] = JHTML::_('select.genericlist', $options, 'scheduling', '', 'value', 'text');
     //TODO-add error message - what if there are no teams assigned to the project
     $teams = $this->get('projectteams');
     $options = array();
     foreach ($teams as $t) {
         $options[] = JHTML::_('select.option', $t->projectteam_id, $t->text);
     }
     $lists['teamsorder'] = JHTML::_('select.genericlist', $options, 'teamsorder[]', 'multiple="multiple" size="20"');
     $this->assignRef('projectws', $projectws);
     $this->assignRef('request_url', $uri->toString());
     $this->assignRef('lists', $lists);
     $this->addToolbar_Populate();
     parent::display($tpl);
 }