<?php
/**
 * @package BILLETS
 * @link 	http://www.dioscouri.com
 * @license GNU/GPLv2
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.application.component.view' );

/**
 * Billets View
 *
 * @package BILLETS
 */
class BilletsViewTicket extends JView {
	/**
	 * Billets view display method
	 * @return void
	 **/
	 // **********************************************
	function display($tpl = null) {
		global $mainframe;
        jimport('joomla.utilities.date');
        
        JToolBarHelper::title( JText::_( _BILLETS_ ), 'billets' );
		// JHTML::_('stylesheet', 'billets.css', 'administrator/components/com_billets/css/');
 
		//get the data
		$row		= &$this->get('Data');
		$messages	= &$this->get('Messages');
		$user		= &$this->get('User');
		$types		= &$this->get('Types');
		
		if ($isNew = ($row->id < 1)) { 
			$text = $isNew ? JText::_( _BILLETS_NEW ) : JText::_( _BILLETS_EDIT );
			JToolBarHelper::title(   JText::_( _BILLETS_NEWTICKET ), 'billets' );

			JToolBarHelper::save('savenew');
			if ($isNew)  {
				JToolBarHelper::cancel();
			} else {
				// for existing items the button is renamed `close`
				JToolBarHelper::cancel( 'cancel', _BILLETS_CLOSE );
			}
			
			
		}
		
		$this->assignRef('row', $row);
		$this->assignRef('messages', $messages);
		$this->assignRef('user', $user);
		$this->assignRef('types', $types);

		parent::display($tpl);

    }
	 // **********************************************

}
// ************************************************************************