diff --git a/Makefile b/Makefile index 5b9f8cd41faabb8bcbfd50f3102a5a56aa4b9bd8..42509f1bea97fd718dca24df2e9ff122f63b2943 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BASE=ordernumber PLUGINTYPE=vmshopper -VERSION=3.6.1 +VERSION=3.99 PLUGINFILES=$(BASE).php ordernumber_helper_joomla.php $(BASE).script.php $(BASE).xml index.html library/ diff --git a/fields/vmupdatecredentialscheck.php b/fields/vmupdatecredentialscheck.php new file mode 100644 index 0000000000000000000000000000000000000000..b6b393d379505d3e2ddfaf772d7856707431d45f --- /dev/null +++ b/fields/vmupdatecredentialscheck.php @@ -0,0 +1,152 @@ +<?php +defined('_JEXEC') or die(); +/** + * + * @package VirtueMart + * @subpackage Plugins - Fields + * @author Reinhold Kainhofer, Open Tools + * @link http://www.open-tools.net + * @copyright Copyright (c) 2016 Reinhold Kainhofer. All rights reserved. + * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt + * VirtueMart is free software. This version may have been modified pursuant + * to the GNU General Public License, and as distributed it includes or + * is derivative of works licensed under the GNU General Public License or + * other free or open source software licenses. + */ + +defined('DS') or define('DS', DIRECTORY_SEPARATOR); +if (!class_exists( 'VmConfig' )) + require(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php'); +VmConfig::loadConfig(); + +class JFormFieldVmUpdateCredentialsCheck extends JFormField { + var $_name = 'vmUpdateCredentialsCheck'; + + // VM2 on J2 works, VM3 on J3 works out of the box, but + // VM3 on J2 does NOT work by simply calling vmJsApi::jQuery, because + // the JS is never added to the page header, so we have to add this manually + public function loadjQuery() { + vmJsApi::jQuery(); + // TODO: jquery::ui available only in J3: + if (version_compare(JVERSION, '3.0', 'lt')) { + } else { + JHtml::_('jquery.ui', array('core', 'sortable')); + } + // If we are on Joomla 2.5 and VM 3, manually add the script declarations + // cached in vmJsApi to the document header: + if (version_compare(JVERSION, '3.0', 'lt') && defined('VM_VERSION') && VM_VERSION>=3) { + $document = JFactory::getDocument(); + $scripts = vmJsApi::getJScripts(); + foreach ($scripts as $name => $jsToAdd) { + if($jsToAdd['written']) continue; + $file = $jsToAdd['script'] ? $jsToAdd['script'] : $name; + + if(strpos($file,'/')!==0){ + $file = vmJsApi::setPath($file,false,''); + } else if(strpos($file,'//')!==0){ + $file = JURI::root(true).$file; + } + + $ver = ''; + if(!empty($jsToAdd['ver'])) $ver = '?vmver='.$jsToAdd['ver']; + $document->addScript( $file .$ver,"text/javascript",$jsToAdd['defer'],$jsToAdd['async'] ); + vmJsApi::removeJScript($name); + } + } + } + + protected function getJavaScript() { + return " +var credentials_ajaxurl = \"".$this->element["ajaxurl"]."\"; +var credentials_updateMessages = function(messages, area) { + jQuery( \"#system-message-container #system-message .\"+area+\"-message\").remove(); + var newmessages = jQuery( messages ).find(\"div.alert, .message\").addClass(area+\"-message\"); + if (!jQuery( \"#system-message-container #system-message\").length && newmessages.length) { + if (jQuery(newmessages).first().prop(\"tagName\")==\"dt\") { // Joomla 2.x: + jQuery( \"#system-message-container\" ).append( \"<dl id=\'system-message\'></div>\" ); + } else { + jQuery( \"#system-message-container\" ).append( \"<div id=\'system-message\'></div>\" ); + } + } + newmessages.appendTo( \"#system-message-container #system-message\"); +}; + +var checkUpdateCredentialsError = function() { + alert (\"".JText::_('OPENTOOLS_CHECK_CREDENTIALS_ERROR')."\"); +} + +var checkUpdateCredentials = function () { + var ordernumber = jQuery('#jform_params_order_number').val(); + var orderpass = jQuery('#jform_params_order_pass').val(); + + var ajaxargs = { + type: \"POST\", + dataType: \"text\", + url: credentials_ajaxurl, + data: { + action: \"check_update_access\", + order_number: ordernumber, + order_pass: orderpass + }, + + success: function ( json ) { + try { + json = jQuery.parseJSON(json); + credentials_updateMessages(json['messages'], 'ordernumber'); + } catch (e) { + checkUpdateCredentialsError(); + return; + } + var success=0; + if (json.success>0) { + success=1; + } + jQuery('#update_credentials_hidden_checked').val(success); + jQuery('.credentials_checked') + .removeClass('credentials_checked_0') + .removeClass('credentials_checked_1') + .addClass('credentials_checked_'+success); + }, + error: function() { checkUpdateCredentialsError(); }, + complete: function() { }, + }; + jQuery.ajax(ajaxargs); +}; +jQuery(document).ready (function () { + jQuery('#jform_params_order_number').focusout(checkUpdateCredentials); + jQuery('#jform_params_order_pass').focusout(checkUpdateCredentials); +}); + +"; + } + + protected function getCSS() { + return " +div.credentials_checked { + padding: 10px 5px; +} +div.credentials_checked_0 { + background-color: #FFD0D0; +} +div.credentials_checked_1 { + background-color: #D0FFD0; +} +a#credentials_check { +} + +"; + } + protected function getInput() { + $this->loadjQuery(); + + $doc = JFactory::getDocument(); + $doc->addScriptDeclaration($this->getJavaScript()); + $doc->addStyleDeclaration($this->getCSS()); + + if ($this->value!=1) { + $this->value=0; + } +// if ($this->value==1) { + return "<input type='hidden' id=\"update_credentials_hidden_checked\" name='".$this->name."' value='".$this->value."' /><div class='credentials_checked credentials_checked_".$this->value."'><a href=\"#\" class=\"btn btn-info credentials_check\" id=\"credentials_check\" onclick=\"checkUpdateCredentials()\" >".JText::_('OPENTOOLS_CHECK_CREDENTIALS')."</a></div>"; + } +} diff --git a/language/de-DE/de-DE.plg_vmshopper_ordernumber.ini b/language/de-DE/de-DE.plg_vmshopper_ordernumber.ini index e127846accf6eab0af96e483bae3a547a843af61..97cae2dc59dedac2312137d1240162d48566310c 100644 --- a/language/de-DE/de-DE.plg_vmshopper_ordernumber.ini +++ b/language/de-DE/de-DE.plg_vmshopper_ordernumber.ini @@ -80,10 +80,14 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="enthält" PLG_ORDERNUMBER_REPL_OP_STARTS="beginnt mit" PLG_ORDERNUMBER_REPL_OP_ENDS="endet mit" -PLG_ORDERNUMBER_FIELDSET_CREDENTIALS="Automatische Aktualisierung" -PLG_ORDERNUMBER_CREDENTIALS_DESC="Bitte geben Sie hier die Bestellungsnummer und -passwort ein, die Sie in der Bestellbestätigung (per Mail) von <a href="https://www.open-tools.net/">open-tools.net</a> erhalten haben. Wird keine gültige Kombination eingegeben, ist die Funktionalität der Erweiterung in keiner Weise eingeschränkt, jedoch stehen keine automatischen Aktualisierungen zur Verfügung." -PLG_ORDERNUMBER_ORDERNUMBER="Bestellungsnummer (lt. Rechnung):" -PLG_ORDERNUMBER_ORDERNUMBER_DESC="Bitte geben Sie hier die Bestellungsnummer Ihres Kaufs der Erweiterung auf open-tools.net an. Wenn keine gültige Kombination aus Bestellungsnummer und -passwort angegeben wird, funktioniert die Erweiterung dennoch, jedoch sind keine automatischen Aktualisierungen möglich." -PLG_ORDERNUMBER_ORDERPASS="Bestellungspassword (lt. Rechnung):" -PLG_ORDERNUMBER_ORDERPASS_DESC="Bitte geben Sie hier das Bestellungspasswort Ihres Kaufs der Erweiterung auf open-tools.net an. Wenn keine gültige Kombination aus Bestellungsnummer und -passwort angegeben wird, funktioniert die Erweiterung dennoch, jedoch sind keine automatischen Aktualisierungen möglich." +OPENTOOLS_FIELDSET_CREDENTIALS="Automatische Aktualisierung" +OPENTOOLS_CREDENTIALS_DESC="Bitte geben Sie hier die Bestellungsnummer und -passwort ein, die Sie in der Bestellbestätigung (per Mail) von <a href="https://www.open-tools.net/">open-tools.net</a> erhalten haben. Wird keine gültige Kombination eingegeben, ist die Funktionalität der Erweiterung in keiner Weise eingeschränkt, jedoch stehen keine automatischen Aktualisierungen zur Verfügung." +OPENTOOLS_ORDERNUMBER="Bestellungsnummer:" +OPENTOOLS_ORDERNUMBER_DESC="Bitte geben Sie hier die Bestellungsnummer Ihres Kaufs der Erweiterung auf open-tools.net an. Wenn keine gültige Kombination aus Bestellungsnummer und -passwort angegeben wird, funktioniert die Erweiterung dennoch, jedoch sind keine automatischen Aktualisierungen möglich." +OPENTOOLS_ORDERPASS="Bestellungspassword:" +OPENTOOLS_ORDERPASS_DESC="Bitte geben Sie hier das Bestellungspasswort Ihres Kaufs der Erweiterung auf open-tools.net an. Wenn keine gültige Kombination aus Bestellungsnummer und -passwort angegeben wird, funktioniert die Erweiterung dennoch, jedoch sind keine automatischen Aktualisierungen möglich." +OPENTOOLS_CHECK_CREDENTIALS="Zugangsdaten überprüfen und speichern" +OPENTOOLS_CHECK_CREDENTIALS_ERROR="Konnte Zugangsdaten nicht überprüfen. Bitte stellen Sie sicher, dass die Erweiterung in Joomla freigegeben ist!" +OPENTOOLS_XMLMANIFEST_ERROR="Konnte die XML-Manifest-Datei der Erweiterung nicht laden (%s)" +OPENTOOLS_UPDATESCRIPT_ERROR="Konnte die Aktualisierungsinformationen nicht laden (%s)" diff --git a/language/en-GB/en-GB.plg_vmshopper_ordernumber.ini b/language/en-GB/en-GB.plg_vmshopper_ordernumber.ini index d70ac7a74e6ded896cfb1b60d77bd7ae4487ad55..b22875c59212d7f3fa270bb86d6e87bbb786199f 100644 --- a/language/en-GB/en-GB.plg_vmshopper_ordernumber.ini +++ b/language/en-GB/en-GB.plg_vmshopper_ordernumber.ini @@ -79,10 +79,13 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="contains" PLG_ORDERNUMBER_REPL_OP_STARTS="starts with" PLG_ORDERNUMBER_REPL_OP_ENDS="ends with" -PLG_ORDERNUMBER_FIELDSET_CREDENTIALS="Update credentials" -PLG_ORDERNUMBER_CREDENTIALS_DESC="Please enter your order number and the order password, which can be found in the order confirmation mail you received after your purchase at <a href="https://www.open-tools.net/">open-tools.net</a>. If you do not enter a valid combination, the plugin will continue to work, but automatic updates will only be provided with a valid order number and password." -PLG_ORDERNUMBER_ORDERNUMBER="Order number (see order confirmation mail):" -PLG_ORDERNUMBER_ORDERNUMBER_DESC="Please enter the order number of your purchase at open-tools.net to get access to automatic updates. If no valid order number and password is entered, the plugin will still work, but automatic updates will not be available." -PLG_ORDERNUMBER_ORDERPASS="Order password (see order confirmation mail):" -PLG_ORDERNUMBER_ORDERPASS_DESC="Please enter the order password of your purchase at open-tools.net to get access to automatic updates. If no valid order number and password is entered, the plugin will still work, but automatic updates will not be available." - +OPENTOOLS_FIELDSET_CREDENTIALS="Update credentials" +OPENTOOLS_CREDENTIALS_DESC="Please enter your order number and the order password, which can be found in the order confirmation mail you received after your purchase at <a href="https://www.open-tools.net/">open-tools.net</a>. If you do not enter a valid combination, the plugin will continue to work, but automatic updates will only be provided with a valid order number and password." +OPENTOOLS_ORDERNUMBER="Order number:" +OPENTOOLS_ORDERNUMBER_DESC="Please enter the order number of your purchase at open-tools.net to get access to automatic updates. If no valid order number and password is entered, the plugin will still work, but automatic updates will not be available." +OPENTOOLS_ORDERPASS="Order password:" +OPENTOOLS_ORDERPASS_DESC="Please enter the order password of your purchase at open-tools.net to get access to automatic updates. If no valid order number and password is entered, the plugin will still work, but automatic updates will not be available." +OPENTOOLS_CHECK_CREDENTIALS="Check and save update credentials" +OPENTOOLS_CHECK_CREDENTIALS_ERROR="Unable to check the download credentials. Please make sure that the plugin is enabled in your Joomla installation!" +OPENTOOLS_XMLMANIFEST_ERROR="Unable to load the plugin manifest file (%s)" +OPENTOOLS_UPDATESCRIPT_ERROR="Unable to load the update information from the update server (%s)" diff --git a/language/en-GB/en-GB.plg_vmshopper_ordernumber.sys.ini b/language/en-GB/en-GB.plg_vmshopper_ordernumber.sys.ini index d70ac7a74e6ded896cfb1b60d77bd7ae4487ad55..b22875c59212d7f3fa270bb86d6e87bbb786199f 100644 --- a/language/en-GB/en-GB.plg_vmshopper_ordernumber.sys.ini +++ b/language/en-GB/en-GB.plg_vmshopper_ordernumber.sys.ini @@ -79,10 +79,13 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="contains" PLG_ORDERNUMBER_REPL_OP_STARTS="starts with" PLG_ORDERNUMBER_REPL_OP_ENDS="ends with" -PLG_ORDERNUMBER_FIELDSET_CREDENTIALS="Update credentials" -PLG_ORDERNUMBER_CREDENTIALS_DESC="Please enter your order number and the order password, which can be found in the order confirmation mail you received after your purchase at <a href="https://www.open-tools.net/">open-tools.net</a>. If you do not enter a valid combination, the plugin will continue to work, but automatic updates will only be provided with a valid order number and password." -PLG_ORDERNUMBER_ORDERNUMBER="Order number (see order confirmation mail):" -PLG_ORDERNUMBER_ORDERNUMBER_DESC="Please enter the order number of your purchase at open-tools.net to get access to automatic updates. If no valid order number and password is entered, the plugin will still work, but automatic updates will not be available." -PLG_ORDERNUMBER_ORDERPASS="Order password (see order confirmation mail):" -PLG_ORDERNUMBER_ORDERPASS_DESC="Please enter the order password of your purchase at open-tools.net to get access to automatic updates. If no valid order number and password is entered, the plugin will still work, but automatic updates will not be available." - +OPENTOOLS_FIELDSET_CREDENTIALS="Update credentials" +OPENTOOLS_CREDENTIALS_DESC="Please enter your order number and the order password, which can be found in the order confirmation mail you received after your purchase at <a href="https://www.open-tools.net/">open-tools.net</a>. If you do not enter a valid combination, the plugin will continue to work, but automatic updates will only be provided with a valid order number and password." +OPENTOOLS_ORDERNUMBER="Order number:" +OPENTOOLS_ORDERNUMBER_DESC="Please enter the order number of your purchase at open-tools.net to get access to automatic updates. If no valid order number and password is entered, the plugin will still work, but automatic updates will not be available." +OPENTOOLS_ORDERPASS="Order password:" +OPENTOOLS_ORDERPASS_DESC="Please enter the order password of your purchase at open-tools.net to get access to automatic updates. If no valid order number and password is entered, the plugin will still work, but automatic updates will not be available." +OPENTOOLS_CHECK_CREDENTIALS="Check and save update credentials" +OPENTOOLS_CHECK_CREDENTIALS_ERROR="Unable to check the download credentials. Please make sure that the plugin is enabled in your Joomla installation!" +OPENTOOLS_XMLMANIFEST_ERROR="Unable to load the plugin manifest file (%s)" +OPENTOOLS_UPDATESCRIPT_ERROR="Unable to load the update information from the update server (%s)" diff --git a/ordernumber.php b/ordernumber.php index 5d66981afc18b92e38b4381175788ba4717b84fa..58054c02390f6107bce5ad9406ddf5641d1adbc7 100644 --- a/ordernumber.php +++ b/ordernumber.php @@ -269,6 +269,12 @@ class plgVmShopperOrdernumber extends vmShopperPlugin { } + /* In versions before VM 2.6.8, the onStoreInstallPluginTable function was protected, so the installer couldn't call it to create the plugin table... + This function simply is a public wrapper to make this function available to the installer on all VM versions: */ + public function plgVmOnStoreInstallPluginTable($psType, $name='') { + return $this->onStoreInstallPluginTable($psType, $name); + } + /** * plgVmOnSelfCallBE ... Called to execute some plugin action in the backend (e.g. set/reset dl counter, show statistics etc.) */ @@ -308,6 +314,12 @@ class plgVmShopperOrdernumber extends vmShopperPlugin { $json['success'] = $this->helper->setCounter($nrtype, $counter, $value); $json['row'] = $this->helper->counter_modification_create_row($nrtype, $counter, $value); break; + + case "check_update_access": + $order_number = vRequest::getString('order_number'); + $order_pass = vRequest::getString('order_pass'); + $json = $this->checkUpdateAccess($order_number, $order_pass, $json); + break; } // Also return all messages (in HTML format!): @@ -330,10 +342,158 @@ class plgVmShopperOrdernumber extends vmShopperPlugin { } - /* In versions before VM 2.6.8, the onStoreInstallPluginTable function was protected, so the installer couldn't call it to create the plugin table... - This function simply is a public wrapper to make this function available to the installer on all VM versions: */ - public function plgVmOnStoreInstallPluginTable($psType, $name='') { - return $this->onStoreInstallPluginTable($psType, $name); + public function checkUpdateAccess($order_number, $order_pass, $json = array()) { + // First, extract the update server URL from the manifest, then load + // the update XML from the update server, extract the download URL, + // append the order number and password and check whether access is + // possible. + $json['success'] = FALSE; + $xml = simplexml_load_file($this->_xmlFile); + if (!$xml || !isset($xml->updateservers)) { + JFactory::getApplication()->enqueueMessage(JText::sprintf('OPENTOOLS_XMLMANIFEST_ERROR', $this->_xmlFile), 'error'); + return $json; + } + $updateservers = $xml->updateservers; + foreach ($updateservers->children() as $server) { + if ($server->getName()!='server') { + JFactory::getApplication()->enqueueMessage(JText::sprintf('OPENTOOLS_XMLMANIFEST_ERROR', $this->_xmlFile), 'error'); + continue; + } + $updateurl = html_entity_decode((string)$server); + $updatescript = simplexml_load_file($updateurl); + if (!$updatescript) { + JFactory::getApplication()->enqueueMessage(JText::sprintf('OPENTOOLS_UPDATESCRIPT_ERROR', $updateurl), 'error'); + continue; + } + $urls = $updatescript->xpath('/updates/update/downloads/downloadurl'); + while (list( , $node) = each($urls)) { + $downloadurl = (string)($node); + if ($order_number) { + $downloadurl .= (parse_url($downloadurl, PHP_URL_QUERY) ? '&' : '?') . 'order_number=' . urlencode($order_number); + } + if ($order_pass) { + $downloadurl .= (parse_url($downloadurl, PHP_URL_QUERY) ? '&' : '?') . 'order_pass=' . urlencode($order_pass); + } + $downloadurl .= (parse_url($downloadurl, PHP_URL_QUERY) ? '&' : '?') . 'check_access=1'; + + $headers = get_headers($downloadurl); + list($version, $status_code, $msg) = explode(' ',$headers[0], 3); + + // Check the HTTP Status code + switch($status_code) { + case 200: + $json['success'] = TRUE; + JFactory::getApplication()->enqueueMessage($msg, 'message'); + $this->setupUpdateCredentials($order_number, $order_pass); + break; + default: + JFactory::getApplication()->enqueueMessage($msg, 'error'); + // Clear the credentials... + $this->setupUpdateCredentials("", ""); + break; + } + $this->setAndSaveParams(array( + 'update_credentials_checked'=>$json['success'], + 'order_number' => $order_number, + 'order_pass' => $order_pass, + )); + } + } + return $json; } + protected function setAndSaveParams($params) { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('extension_id') + ->from('#__extensions') + ->where('folder = '.$db->quote($this->_type)) + ->where('element = '.$db->quote($this->_name)) + ->where('type =' . $db->quote('plugin')) + ->order('ordering'); + + $plugin = $db->setQuery($query)->loadObject(); + if (!$plugin) + return; + $pluginId=$plugin->extension_id; + + foreach ($params as $param=>$parvalue) { + $this->params->set($param, $parvalue); + } + + $extensions = JTable::getInstance('extension'); + $extensions->load($pluginId); + $extensions->bind(array('params' => $this->params->toString())); + + // check and store + if (!$extensions->check()) { + $this->setError($extensions->getError()); + return false; + } + if (!$extensions->store()) { + $this->setError($extensions->getError()); + return false; + } + } + + + function setupUpdateCredentials($ordernumber, $orderpass) { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('extension_id AS id') + ->from('#__extensions') + ->where('folder = '.$db->quote($this->_type)) + ->where('element = '.$db->quote($this->_name)) + ->where('type =' . $db->quote('plugin')) + ->order('ordering'); + + $plugin = $db->setQuery($query)->loadObject(); + if (empty($plugin)) + return; + + $ordernumber = preg_replace("/[^-A-Za-z0-9_]/", '', $ordernumber); + $orderpass = preg_replace("/[^-A-Za-z0-9_]/", '', $orderpass); + + $extra_query = array(); + if ($ordernumber!='') { + $extra_query[] = 'order_number='.preg_replace("/[^-A-Za-z0-9_]/", '', $ordernumber); + } + if ($orderpass!='') { + $extra_query[] = 'order_pass='.preg_replace("/[^-A-Za-z0-9_]/", '', $orderpass); + } + $extra_query = implode('&', $extra_query); + + // The following code is based on Nicholas K. Dionysopoulos' Joomla Pull request: + // https://github.com/joomla/joomla-cms/pull/2508 + + // Load the update site record, if it exists + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('update_site_id AS id') + ->from($db->qn('#__update_sites_extensions')) + ->where($db->qn('extension_id').' = '.$db->q($plugin->id)); + $db->setQuery($query); + $updateSites = $db->loadObjectList(); + + foreach ($updateSites as $updateSite) { + // Update the update site record + $query = $db->getQuery(true) + ->update($db->qn('#__update_sites')) + ->set('extra_query = '.$db->q($extra_query)) + ->set('last_check_timestamp = 0') + ->where($db->qn('update_site_id').' = '.$db->q($updateSite->id)); + $db->setQuery($query); + $db->execute(); + + // Delete any existing updates (essentially flushes the updates cache for this update site) + $query = $db->getQuery(true) + ->delete($db->qn('#__updates')) + ->where($db->qn('update_site_id').' = '.$db->q($updateSite->id)); + $db->setQuery($query); + $db->execute(); + } + + } + + } diff --git a/ordernumber.xml b/ordernumber.xml index d15b619d866181cc1021e628b498a4073263d207..3c478d735b5b92bfdbc691260db99f559f584855 100644 --- a/ordernumber.xml +++ b/ordernumber.xml @@ -7,7 +7,7 @@ <authorUrl>http://www.open-tools.net/</authorUrl> <copyright>Copyright (C) 2012-2015 Reinhold Kainhofer. All rights reserved.</copyright> <license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license> - <version>3.6.1</version> + <version>3.99</version> <releaseDate>2015-05-23</releaseDate> <releaseType>Minor update</releaseType> <downloadUrl>http://open-tools.net/virtuemart/advanced-ordernumbers.html</downloadUrl> @@ -16,7 +16,6 @@ <files> <filename plugin="ordernumber">ordernumber.php</filename> - <filename>ordernumber_helper.php</filename> <filename>ordernumber_helper_joomla.php</filename> <filename>ordernumber.script.php</filename> <filename>index.html</filename> @@ -91,16 +90,17 @@ <field name="replacements" type="VmOrdernumberReplacements" label="" /> </fieldset> - <fieldset name="update_credentials" label="PLG_ORDERNUMBER_FIELDSET_CREDENTIALS"> - <field name="credentials_desc" type="spacer" label="PLG_ORDERNUMBER_CREDENTIALS_DESC" /> - <field name="order_number" type="text" default="" label="PLG_ORDERNUMBER_ORDERNUMBER" description="PLG_ORDERNUMBER_ORDERNUMBER_DESC"/> - <field name="order_pass" type="text" default="" label="PLG_ORDERNUMBER_ORDERPASS" description="PLG_ORDERNUMBER_ORDERPASS_DESC"/> + <fieldset name="update_credentials" label="OPENTOOLS_FIELDSET_CREDENTIALS" addfieldpath="/plugins/vmshopper/ordernumber/fields"> + <field name="credentials_desc" type="spacer" label="OPENTOOLS_CREDENTIALS_DESC" /> + <field name="order_number" type="text" default="" label="OPENTOOLS_ORDERNUMBER" description="OPENTOOLS_ORDERNUMBER_DESC"/> + <field name="order_pass" type="text" default="" label="OPENTOOLS_ORDERPASS" description="OPENTOOLS_ORDERPASS_DESC"/> + <field name="update_credentials_checked" type="vmUpdateCredentialsCheck" label="" ajaxurl="index.php?option=com_virtuemart&view=plugin&type=vmshopper&name=ordernumber&format=raw" /> </fieldset> - </fields> + </fields> </config> <updateservers> - <server type="extension" name="Advanced Ordernumbers for VirtueMart Updates"><![CDATA[http://www.open-tools.net/UpdateServer/index.php?package=Joomla&extension=Ordernumber]]></server> + <server type="extension" name="Advanced Ordernumbers for VirtueMart Updates"><![CDATA[http://www.open-tools.net/UpdateServer/index.php?package=Joomla&extension=Ordernumber&file=extension.xml]]></server> </updateservers> </extension> diff --git a/ordernumber_helper_joomla.php b/ordernumber_helper_joomla.php index 88d940f548fd133d2465f919bd078933f73f3f9f..1ebc1dd7c0554435afeb656c73d21f001b40e983 100644 --- a/ordernumber_helper_joomla.php +++ b/ordernumber_helper_joomla.php @@ -160,15 +160,17 @@ ajax_ordernumber.updateMessages = function(messages, area) { } } newmessages.appendTo( "#system-message-container #system-message"); -} +}; ajax_ordernumber.parseAjaxResponse = function(json) { return jQuery.parseJSON(json); -} -ajax_ordernumber.modifyAjaxArgs = function (ajaxargs) { +}; +ajax_ordernumber.modifyAjaxArgs = function(ajaxargs) { ajaxargs.dataType="text"; ajaxargs.cache=false; return ajaxargs; -}'; +}; + +'; } diff --git a/releases/plg_vmshopper_ordernumber_v3.99.zip b/releases/plg_vmshopper_ordernumber_v3.99.zip new file mode 100644 index 0000000000000000000000000000000000000000..07967949e733c80d540e2655c4bdd6c0cd82a28c Binary files /dev/null and b/releases/plg_vmshopper_ordernumber_v3.99.zip differ