diff --git a/Makefile b/Makefile index fad84c98ed2e46c8cedea6ea3cb0c3ae5d1cfbf6..c3d42f393abae014574c7e06204a825a20348cad 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BASE=taxreport PLUGINTYPE=vmextended -VERSION=0.1 +VERSION=0.2 PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html # $(BASE)/ diff --git a/controllers/taxreport.php b/controllers/taxreport.php index b2dd9f1d44b9cfb5507220b32c43aaf0c30da7c2..2bedc00e51e5b06ad491ef0bdd605f34ef44eb47 100644 --- a/controllers/taxreport.php +++ b/controllers/taxreport.php @@ -9,7 +9,7 @@ class VirtuemartControllerTaxReport extends VmController { function __construct(){ parent::__construct(); // Add the proper view pathes... - $this->addViewPath(JPATH_PLUGINS.DS . 'vmextended' . DS . 'taxreport' . DS . 'views'); + $this->addViewPath(JPATH_PLUGINS.DS . 'vmextended' . DS . 'taxreport' . DS . 'views' . DS . 'taxreport'); } } diff --git a/taxreport.php b/taxreport.php index 2f886b93c4d227e2369d2f91ec65633668b3ce49..f8fe1a10f55628be0ef11c1ef246e4e26f52f91d 100644 --- a/taxreport.php +++ b/taxreport.php @@ -9,16 +9,24 @@ class plgVmExtendedTaxReport extends vmExtendedPlugin { public function __construct (&$subject, $config=array()) { parent::__construct($subject, $config); $this->_path = JPATH_PLUGINS.DS.'vmextended'.DS.$this->getName(); - JPlugin::loadLanguage('plg_vmextended_'.$this->getName()); + $this->loadLanguage('plg_vmextended_'.$this->getName()); } public function onVmAdminController ($controller) { if ($controller == 'taxreport'/*$this->getName()*/) { - VmModel::addIncludePath($this->_path . DS . 'models'); - // TODO: Make sure the model exists. We probably should find a better way to load this automatically! - // Currently, some path config seems missing, so the model is not found by default. - require_once($this->_path.DS.'models'.DS.'taxreport.php'); + VmModel::addIncludePath($this->_path . DS . 'models', 'VirtueMartModel'); require_once($this->_path.DS.'controllers'.DS.'taxreport.php'); + + // In later VM versions, we can/should execute the controller here rather than letting virtuemart.php do the job: + $_class = 'VirtueMartController'.ucfirst($controller); + if(!class_exists($_class)){ + vmError('Serious Error could not find controller '.$_class,'Serious error, unable to find class'); + $app = vFactory::getApplication(); + $app->redirect('index.php?option=com_virtuemart'); + } + $controller = new $_class(); + $controller->execute(vRequest::getCmd('task', $controller)); + $controller->redirect(); return true; } } diff --git a/taxreport.xml b/taxreport.xml index 59c79443212788e8754f23b4a73b9981f9b76002..ced2c1bb7acfe34d468b42350a5abdf7ba713db5 100644 --- a/taxreport.xml +++ b/taxreport.xml @@ -7,9 +7,9 @@ <authorUrl>http://www.open-tools.net/</authorUrl> <copyright>Copyright (C) 2015 Reinhold Kainhofer. All rights reserved.</copyright> <license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license> - <version>0.1</version> - <releaseDate>2015-04-01</releaseDate> - <releaseType>Initial Release</releaseType> + <version>0.2</version> + <releaseDate>2016-04-02</releaseDate> + <releaseType>Update</releaseType> <downloadUrl>http://www.open-tools.net</downloadUrl> <description>VMEXT_TAXREPORT_DESC</description> @@ -39,5 +39,9 @@ <params addpath="/administrator/components/com_virtuemart/elements" > <param type="vmjpluginwarning" /> </params> + + <updateservers> + <server type="extension" name="VM Tax Report Updates"><![CDATA[http://open-tools.net/UpdateServer/index.php?package=Joomla&extension=TaxReport]]></server> + </updateservers> </extension> diff --git a/views/taxreport/view.html.php b/views/taxreport/view.html.php index 663dbc099dbdafbf5737c0633e408e3544b1fb19..2806dce78d069f0267f7e3739cf127b1bc003eb2 100644 --- a/views/taxreport/view.html.php +++ b/views/taxreport/view.html.php @@ -13,7 +13,11 @@ if(!defined('VM_VERSION') or VM_VERSION < 3){ class VirtuemartViewTaxReport extends VmViewAdmin { function __construct(){ parent::__construct(); - $this->_addPath('template', JPATH_PLUGINS.DS . 'vmextended' . DS . 'taxreport' . DS . 'views' . DS . $this->getName() . DS . 'tmpl'); + $nm = "taxreport"; + $this->addLayoutPath($nm, JPATH_PLUGINS.DS . 'vmextended' . DS . 'taxreport' . DS . 'views' . DS . $nm . DS . 'tmpl'); +// $this->_addPath('template', JPATH_PLUGINS.DS . 'vmextended' . DS . 'taxreport' . DS . 'views' . DS . $this->getName() . DS . 'tmpl'); +// VmConfig::$echoDebug = 1; +// vmdebug("<pre>VirtuemartViewTaxReport, pathes: ".print_r(self::$_paths,1)."</pre>"); } function display($tpl = null){ @@ -24,7 +28,9 @@ class VirtuemartViewTaxReport extends VmViewAdmin { vRequest::setvar('task',''); $this->SetViewTitle('TAXREPORT'); - $model = VmModel::getModel(); + $model = VmModel::getModel('taxreport'); +// VmConfig::$echoDebug = 1; +// vmdebug("<pre>display, model=".print_r($model,1)."</pre>"); $this->addStandardDefaultViewLists($model); $myCurrencyDisplay = CurrencyDisplay::getInstance();