Skip to content
Snippets Groups Projects
Commit 0cf35a08 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V3.99: Implement automatic updates (after entering the order number/password

parent c55e1f2b
No related branches found
No related tags found
No related merge requests found
BASE=ordernumber BASE=ordernumber
PLUGINTYPE=vmshopper PLUGINTYPE=vmshopper
VERSION=3.6.1 VERSION=3.99
PLUGINFILES=$(BASE).php ordernumber_helper_joomla.php $(BASE).script.php $(BASE).xml index.html library/ PLUGINFILES=$(BASE).php ordernumber_helper_joomla.php $(BASE).script.php $(BASE).xml index.html library/
......
<?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>";
}
}
...@@ -80,10 +80,14 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="enthält" ...@@ -80,10 +80,14 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="enthält"
PLG_ORDERNUMBER_REPL_OP_STARTS="beginnt mit" PLG_ORDERNUMBER_REPL_OP_STARTS="beginnt mit"
PLG_ORDERNUMBER_REPL_OP_ENDS="endet 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)"
...@@ -79,10 +79,13 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="contains" ...@@ -79,10 +79,13 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="contains"
PLG_ORDERNUMBER_REPL_OP_STARTS="starts with" PLG_ORDERNUMBER_REPL_OP_STARTS="starts with"
PLG_ORDERNUMBER_REPL_OP_ENDS="ends with" PLG_ORDERNUMBER_REPL_OP_ENDS="ends with"
PLG_ORDERNUMBER_FIELDSET_CREDENTIALS="Update credentials" OPENTOOLS_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." 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."
PLG_ORDERNUMBER_ORDERNUMBER="Order number (see order confirmation mail):" OPENTOOLS_ORDERNUMBER="Order number:"
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." 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."
PLG_ORDERNUMBER_ORDERPASS="Order password (see order confirmation mail):" OPENTOOLS_ORDERPASS="Order password:"
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_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)"
...@@ -79,10 +79,13 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="contains" ...@@ -79,10 +79,13 @@ PLG_ORDERNUMBER_REPL_OP_CONTAINS="contains"
PLG_ORDERNUMBER_REPL_OP_STARTS="starts with" PLG_ORDERNUMBER_REPL_OP_STARTS="starts with"
PLG_ORDERNUMBER_REPL_OP_ENDS="ends with" PLG_ORDERNUMBER_REPL_OP_ENDS="ends with"
PLG_ORDERNUMBER_FIELDSET_CREDENTIALS="Update credentials" OPENTOOLS_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." 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."
PLG_ORDERNUMBER_ORDERNUMBER="Order number (see order confirmation mail):" OPENTOOLS_ORDERNUMBER="Order number:"
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." 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."
PLG_ORDERNUMBER_ORDERPASS="Order password (see order confirmation mail):" OPENTOOLS_ORDERPASS="Order password:"
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_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)"
...@@ -269,6 +269,12 @@ class plgVmShopperOrdernumber extends vmShopperPlugin { ...@@ -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.) * 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 { ...@@ -308,6 +314,12 @@ class plgVmShopperOrdernumber extends vmShopperPlugin {
$json['success'] = $this->helper->setCounter($nrtype, $counter, $value); $json['success'] = $this->helper->setCounter($nrtype, $counter, $value);
$json['row'] = $this->helper->counter_modification_create_row($nrtype, $counter, $value); $json['row'] = $this->helper->counter_modification_create_row($nrtype, $counter, $value);
break; 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!): // Also return all messages (in HTML format!):
...@@ -330,10 +342,158 @@ class plgVmShopperOrdernumber extends vmShopperPlugin { ...@@ -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... public function checkUpdateAccess($order_number, $order_pass, $json = array()) {
This function simply is a public wrapper to make this function available to the installer on all VM versions: */ // First, extract the update server URL from the manifest, then load
public function plgVmOnStoreInstallPluginTable($psType, $name='') { // the update XML from the update server, extract the download URL,
return $this->onStoreInstallPluginTable($psType, $name); // 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('&amp;', $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();
}
}
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<authorUrl>http://www.open-tools.net/</authorUrl> <authorUrl>http://www.open-tools.net/</authorUrl>
<copyright>Copyright (C) 2012-2015 Reinhold Kainhofer. All rights reserved.</copyright> <copyright>Copyright (C) 2012-2015 Reinhold Kainhofer. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license> <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> <releaseDate>2015-05-23</releaseDate>
<releaseType>Minor update</releaseType> <releaseType>Minor update</releaseType>
<downloadUrl>http://open-tools.net/virtuemart/advanced-ordernumbers.html</downloadUrl> <downloadUrl>http://open-tools.net/virtuemart/advanced-ordernumbers.html</downloadUrl>
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<files> <files>
<filename plugin="ordernumber">ordernumber.php</filename> <filename plugin="ordernumber">ordernumber.php</filename>
<filename>ordernumber_helper.php</filename>
<filename>ordernumber_helper_joomla.php</filename> <filename>ordernumber_helper_joomla.php</filename>
<filename>ordernumber.script.php</filename> <filename>ordernumber.script.php</filename>
<filename>index.html</filename> <filename>index.html</filename>
...@@ -91,16 +90,17 @@ ...@@ -91,16 +90,17 @@
<field name="replacements" type="VmOrdernumberReplacements" label="" /> <field name="replacements" type="VmOrdernumberReplacements" label="" />
</fieldset> </fieldset>
<fieldset name="update_credentials" label="PLG_ORDERNUMBER_FIELDSET_CREDENTIALS"> <fieldset name="update_credentials" label="OPENTOOLS_FIELDSET_CREDENTIALS" addfieldpath="/plugins/vmshopper/ordernumber/fields">
<field name="credentials_desc" type="spacer" label="PLG_ORDERNUMBER_CREDENTIALS_DESC" /> <field name="credentials_desc" type="spacer" label="OPENTOOLS_CREDENTIALS_DESC" />
<field name="order_number" type="text" default="" label="PLG_ORDERNUMBER_ORDERNUMBER" description="PLG_ORDERNUMBER_ORDERNUMBER_DESC"/> <field name="order_number" type="text" default="" label="OPENTOOLS_ORDERNUMBER" description="OPENTOOLS_ORDERNUMBER_DESC"/>
<field name="order_pass" type="text" default="" label="PLG_ORDERNUMBER_ORDERPASS" description="PLG_ORDERNUMBER_ORDERPASS_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&amp;view=plugin&amp;type=vmshopper&amp;name=ordernumber&amp;format=raw" />
</fieldset> </fieldset>
</fields> </fields>
</config> </config>
<updateservers> <updateservers>
<server type="extension" name="Advanced Ordernumbers for VirtueMart Updates"><![CDATA[http://www.open-tools.net/UpdateServer/index.php?package=Joomla&amp;extension=Ordernumber]]></server> <server type="extension" name="Advanced Ordernumbers for VirtueMart Updates"><![CDATA[http://www.open-tools.net/UpdateServer/index.php?package=Joomla&amp;extension=Ordernumber&amp;file=extension.xml]]></server>
</updateservers> </updateservers>
</extension> </extension>
...@@ -160,15 +160,17 @@ ajax_ordernumber.updateMessages = function(messages, area) { ...@@ -160,15 +160,17 @@ ajax_ordernumber.updateMessages = function(messages, area) {
} }
} }
newmessages.appendTo( "#system-message-container #system-message"); newmessages.appendTo( "#system-message-container #system-message");
} };
ajax_ordernumber.parseAjaxResponse = function(json) { ajax_ordernumber.parseAjaxResponse = function(json) {
return jQuery.parseJSON(json); return jQuery.parseJSON(json);
} };
ajax_ordernumber.modifyAjaxArgs = function (ajaxargs) { ajax_ordernumber.modifyAjaxArgs = function(ajaxargs) {
ajaxargs.dataType="text"; ajaxargs.dataType="text";
ajaxargs.cache=false; ajaxargs.cache=false;
return ajaxargs; return ajaxargs;
}'; };
';
} }
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment