loadHTML($v);
+ $doc->loadHTML($this->cleanOutput($v));
$xpath = new DOMXPath($doc);
$class = $xpath->evaluate("string(//div/@class)");
@@ -324,7 +324,7 @@ public function printOrder($o) {
}
} else if (strpos($v, '
loadHTML($v);
+ $doc->loadHTML($this->cleanOutput($v));
$xpath = new DOMXPath($doc);
$src = $xpath->evaluate("string(//img/@data-src)");
$srcAbs = JPATH_ROOT . '/' . $src;
@@ -401,5 +401,11 @@ public function printOrder($o) {
///$printer -> close();
}
+
+ public function cleanOutput($text) {
+
+ $text = str_replace('&', '&', $text);
+ return $text;
+ }
}
?>
\ No newline at end of file
diff --git a/libraries/phocacart/price/price.php b/libraries/phocacart/price/price.php
index 0d184b8a..152c8038 100644
--- a/libraries/phocacart/price/price.php
+++ b/libraries/phocacart/price/price.php
@@ -18,6 +18,7 @@ class PhocacartPrice
protected $price_thousands_sep = '';
protected $price_format = 0;
protected $price_currency_symbol= '';
+ protected $price_currency_title = '';
protected $price_prefix = '';
protected $price_suffix = '';
protected $exchange_rate = 1;
@@ -28,6 +29,10 @@ public function __construct() {
$this->setCurrency();// allways set default, if needed set specific currency when you call setCurrencyMethod
}
+ public function getPriceCurrencyTitle() {
+ return $this->price_currency_title;
+ }
+
public function setCurrency( $id = 0, $orderId = 0) {
@@ -74,6 +79,7 @@ public function setCurrency( $id = 0, $orderId = 0) {
$this->price_thousands_sep = self::$currency[$key]->price_thousands_sep;
$this->price_format = self::$currency[$key]->price_format;
$this->price_currency_symbol= self::$currency[$key]->price_currency_symbol;
+ $this->price_currency_title = self::$currency[$key]->title;
$this->price_prefix = self::$currency[$key]->price_prefix;
$this->price_suffix = self::$currency[$key]->price_suffix;
$this->exchange_rate = self::$currency[$key]->exchange_rate;
@@ -361,15 +367,26 @@ public function roundPrice($price, $type = 'price') {
return $priceR;
}
- public function getPriceItemsShipping($price, $calculationType, $total, $taxId, $tax, $taxCalculationType, $taxTitle = '', $freeShipping = 0, $round = 1, $langPrefix = 'SHIPPING_') {
+ public function getPriceItemsShipping($price, $priceAdditional, $calculationType, $total, $taxId, $tax, $taxCalculationType, $taxTitle = '', $freeShipping = 0, $round = 1, $langPrefix = 'SHIPPING_') {
// PERCENTAGE PRICE OF SHIPPING
// CALCULATED FROM TOTAL - PAYMENT - SHIPPING (TOTAL BEFORE SHIPPING AND PAYMENT PRICE)
// $total[brutto] can be changed e.g. to netto, etc.
+
+ $priceO = array();
+ $priceO['costinfo'] = '';
+
if ($calculationType == 1 && isset($total['brutto'])) {
+ $priceO['costinfo'] = $this->roundPrice($price) . ' %';
$price = $total['brutto'] * $price / 100;
}
+ if ($priceAdditional > 0) {
+ $price = $price + $priceAdditional;
+ $priceO['costinfo'] .= ' + ' . $this->getPriceFormat($priceAdditional);
+ }
+
+ $priceO['costinfo'] = $priceO['costinfo'] != '' ? '('.$priceO['costinfo'].')' : '';
if ($round == 1) {$price = $this->roundPrice($price, 'shipping');}
// Change TAX based on country or region
@@ -379,7 +396,6 @@ public function getPriceItemsShipping($price, $calculationType, $total, $taxId,
$taxTitle = JText::_($taxTitle);
- $priceO = array();
// Define - the function always return all variables so we don't need to check them
$priceO['nettoformat'] = '';
@@ -396,7 +412,7 @@ public function getPriceItemsShipping($price, $calculationType, $total, $taxId,
$priceO['zero'] = 0;
$priceO['freeshipping'] = 0;
- $app = JFactory::getApplication();
+ //$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
$paramsC = PhocacartUtils::getComponentParameters();
$tax_calculation_shipping = $paramsC->get( 'tax_calculation_shipping', 0 );
@@ -417,6 +433,7 @@ public function getPriceItemsShipping($price, $calculationType, $total, $taxId,
$priceO['zero'] = 1;
$priceO['title'] = JText::_('COM_PHOCACART_FREE_SHIPPING');
$priceO['description'] = '';
+ $priceO['costinfo'] = '';
return $priceO;
}
@@ -508,17 +525,29 @@ public function getPriceItemsShipping($price, $calculationType, $total, $taxId,
}
- public function getPriceItemsPayment($price, $calculationType, $total, $taxId, $tax, $taxCalculationType, $taxTitle = '', $freePayment = 0, $round = 1, $langPrefix = 'PAYMENT_') {
+ public function getPriceItemsPayment($price, $priceAdditional, $calculationType, $total, $taxId, $tax, $taxCalculationType, $taxTitle = '', $freePayment = 0, $round = 1, $langPrefix = 'PAYMENT_') {
// PERCENTAGE PRICE OF PAYMENT
// CALCULATED FROM TOTAL - PAYMENT (TOTAL BEFORE PAYMENT PRICE)
// $total[brutto] can be changed e.g. to netto, etc.
+
+
+ $priceO = array();
+ $priceO['costinfo'] = '';
+
if ($calculationType == 1 && isset($total['brutto'])) {
+
+ $priceO['costinfo'] = $this->roundPrice($price) . ' %';
$price = $total['brutto'] * $price / 100;
}
+ if ($priceAdditional > 0) {
+ $price = $price + $priceAdditional;
+ $priceO['costinfo'] .= ' + ' . $this->getPriceFormat($priceAdditional);
+ }
+ $priceO['costinfo'] = $priceO['costinfo'] != '' ? '('.$priceO['costinfo'].')' : '';
if ($round == 1) {$price = $this->roundPrice($price, 'payment');}
@@ -529,8 +558,8 @@ public function getPriceItemsPayment($price, $calculationType, $total, $taxId, $
$taxTitle = JText::_($taxTitle);
- $priceO = array();
- $app = JFactory::getApplication();
+
+ //$app = JFactory::getApplication();
//$paramsC = PhocacartUtils::getComponentParameters();
$paramsC = PhocacartUtils::getComponentParameters();
$tax_calculation_payment = $paramsC->get( 'tax_calculation_payment', 0 );
@@ -564,6 +593,7 @@ public function getPriceItemsPayment($price, $calculationType, $total, $taxId, $
$priceO['zero'] = 1;
$priceO['title'] = JText::_('COM_PHOCACART_FREE_PAYMENT');
$priceO['description'] = '';
+ $priceO['costinfo'] = '';
return $priceO;
}
@@ -639,6 +669,7 @@ public function getPriceItemsPayment($price, $calculationType, $total, $taxId, $
$priceO['brutto'] = $this->roundPrice($priceO['brutto']);
$priceO['tax'] = $this->roundPrice($priceO['tax']);
}
+
return $priceO;
}
diff --git a/libraries/phocacart/product/product.php b/libraries/phocacart/product/product.php
index 71f3de70..ea648d16 100644
--- a/libraries/phocacart/product/product.php
+++ b/libraries/phocacart/product/product.php
@@ -1223,7 +1223,7 @@ public static function getProductKey($id, $attributes = array(), $encode = 1) {
}
- public static function getProductPrice($type = 1, $onlyAvailableProducts = 0) {
+ public static function getProductPrice($type = 1, $onlyAvailableProducts = 0, $lang = '') {
switch($type) {
@@ -1245,6 +1245,10 @@ public static function getProductPrice($type = 1, $onlyAvailableProducts = 0) {
$wheres[] = ' p.published = 1';
+ if ($lang != '' && $lang != '*') {
+ $wheres[] = " p.language = ".$db->quote($lang);
+ }
+
if ($onlyAvailableProducts == 1) {
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
@@ -1268,6 +1272,7 @@ public static function getProductPrice($type = 1, $onlyAvailableProducts = 0) {
$db->setQuery( $q );
$price = $db->loadResult();
+
return $price;
}
@@ -1313,8 +1318,9 @@ public static function getOnlyAvailableProductRules() {
$lefts[] = ' #__phocacart_item_groups AS ga ON p.id = ga.item_id AND ga.type = 3';// type 3 is product
$lefts[] = ' #__phocacart_item_groups AS gc ON c.id = gc.item_id AND gc.type = 2';// type 2 is category
- $rules['wheres'] = $wheres;
- $rules['lefts'] = $lefts;
+ $rules = array();
+ $rules['wheres'] = $wheres;
+ $rules['lefts'] = $lefts;
return $rules;
}
diff --git a/libraries/phocacart/render/js.php b/libraries/phocacart/render/js.php
index f4375856..9a12277a 100644
--- a/libraries/phocacart/render/js.php
+++ b/libraries/phocacart/render/js.php
@@ -19,9 +19,11 @@ private function __construct(){}
public static function renderAjaxDoRequest($text) {
- $s = array();
+ $s = array();
+ $s[] = ' ';
+ $s[] = '/* Function phDoRequest */ ';
$s[] = 'function phDoRequest(url, manager, value) {';
- $s[] = 'var phAjaxTop = \'
\' + \''. htmlspecialchars($text).'\' + \'
\';';
+ $s[] = ' var phAjaxTop = \'
\' + \''. htmlspecialchars($text).'\' + \'
\';';
$s[] = ' jQuery("#ph-ajaxtop").html(phAjaxTop);';
$s[] = ' jQuery("#ph-ajaxtop").show();';
$s[] = ' var dataPost = {};';
@@ -51,6 +53,7 @@ public static function renderAjaxDoRequest($text) {
$s[] = ' }';
$s[] = ' });';
$s[] = '}';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
@@ -58,24 +61,28 @@ public static function renderAjaxDoRequest($text) {
public static function renderAjaxDoRequestAfterChange($url, $manager = 'product', $value = 'imageCreateThumbs') {
//$s[] = ' phDoRequest(\''.$url.'\', \''.$manager.'\', jQuery(this).val());';
$s = array();
+ $s[] = ' ';
$s[] = 'jQuery(document).ready(function() {';
$s[] = ' jQuery( \'.'.$value.'\' ).on("change", function() {';
$s[] = ' phDoRequest(\''.$url.'\', \''.$manager.'\', jQuery(this).val());';
$s[] = ' })';
$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
public static function renderAjaxDoRequestAfterPaste($url, $manager = 'product') {
$s = array();
+ $s[] = ' ';
+ $s[] = '/* Function phAddValue */ ';
$s[] = 'function phAddValue(id, title, titleModal) {';
$s[] = ' document.getElementById(id).value = title;';
//$s[] = ' SqueezeBox.close();';// close
$s[] = ' jQuery(\'.modal\').modal(\'hide\');';
$s[] = ' phDoRequest(\''.$url.'\', \''.$manager.'\', title );';
$s[] = '}';
-
+ $s[] = ' ';
//jQuery('.modal').on('hidden', function () {
// // Do something after close
//});
@@ -124,6 +131,8 @@ public static function renderAjaxAddToCart() {
// ::ACTION - Ajax the form
+ $s[] = ' ';
+ $s[] = '/* Function phDoSubmitFormAddToCart */ ';
$s[] = 'function phDoSubmitFormAddToCart(sFormData) {';
$s[] = ' var phUrl = "'. $urlAjax.'";';
$s[] = ' var phCheckoutView = '.(int)$cView.'';
@@ -233,6 +242,7 @@ public static function renderAjaxAddToCart() {
$s[] = ' phDoSubmitFormAddToCart(sFormData);';
$s[] = ' })';
$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
@@ -267,6 +277,8 @@ public static function renderAjaxUpdateCart() {
// ::ACTION - Ajax the form
+ $s[] = ' ';
+ $s[] = '/* Function phDoSubmitFormUpdateCart */ ';
$s[] = 'function phDoSubmitFormUpdateCart(sFormData) {';
$s[] = ' var phUrl = "'. $urlAjax.'";';
$s[] = ' var phCheckoutView = '.(int)$cView.'';
@@ -335,6 +347,7 @@ public static function renderAjaxUpdateCart() {
$s[] = ' phDoSubmitFormUpdateCart(sFormData);';
$s[] = ' })';
$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
@@ -368,45 +381,48 @@ public static function renderAjaxAddToCompare() {
$urlAjax = JURI::base(true).'/index.php?option=com_phocacart&task=comparison.add&format=json&'. JSession::getFormToken().'=1&comparisonview='.(int)$cView;
//$s[] = 'jQuery(document).ready(function(){';
//$s[] = ' jQuery(".phItemCompareBoxForm").on(\'submit\', function (e) {';
- $s[] = ' function phItemCompareBoxFormAjax(phItemId) {';
- $s[] = ' var phUrl = "'. $urlAjax.'";';
- $s[] = ' var phItem = \'#\' + phItemId;';
- $s[] = ' var phComparisonView = '.(int)$cView.'';
- $s[] = ' var phData = jQuery(phItem).serialize();';
+ $s[] = ' ';
+ $s[] = '/* Function phItemCompareBoxFormAjax */ ';
+ $s[] = 'function phItemCompareBoxFormAjax(phItemId) {';
+ $s[] = ' var phUrl = "'. $urlAjax.'";';
+ $s[] = ' var phItem = \'#\' + phItemId;';
+ $s[] = ' var phComparisonView = '.(int)$cView.'';
+ $s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' ';
- $s[] = ' phRequest = jQuery.ajax({';
- $s[] = ' type: "POST",';
- $s[] = ' url: phUrl,';
- $s[] = ' async: "false",';
- $s[] = ' cache: "false",';
- $s[] = ' data: phData,';
- $s[] = ' dataType:"JSON",';
- $s[] = ' success: function(data){';
- $s[] = ' if (data.status == 1){';
- $s[] = ' jQuery(".phItemCompareBox").html(data.item);';
- $s[] = ' jQuery(".phItemCompareBoxCount").html(data.count);';
+ $s[] = ' phRequest = jQuery.ajax({';
+ $s[] = ' type: "POST",';
+ $s[] = ' url: phUrl,';
+ $s[] = ' async: "false",';
+ $s[] = ' cache: "false",';
+ $s[] = ' data: phData,';
+ $s[] = ' dataType:"JSON",';
+ $s[] = ' success: function(data){';
+ $s[] = ' if (data.status == 1){';
+ $s[] = ' jQuery(".phItemCompareBox").html(data.item);';
+ $s[] = ' jQuery(".phItemCompareBoxCount").html(data.count);';
if ($add_compare_method == 2) {
- $s[] = ' jQuery("body").append(jQuery("#phContainer"));';
- $s[] = ' jQuery("#phContainer").html(data.popup);';
- $s[] = ' jQuery("#phAddToComparePopup").modal();';
+ $s[] = ' jQuery("body").append(jQuery("#phContainer"));';
+ $s[] = ' jQuery("#phContainer").html(data.popup);';
+ $s[] = ' jQuery("#phAddToComparePopup").modal();';
}
if ($add_compare_method == 1) {
// If no popup is displayed we can relaod the page when we are in comparison page
// If popup, this will be done when clicking continue or comparison list
- $s[] = ' if (phComparisonView == 1) {';
+ $s[] = ' if (phComparisonView == 1) {';
$s[] = self::renderOverlay();
- $s[] = ' setTimeout(function() {location.reload();}, 0001);';
- $s[] = ' }';
+ $s[] = ' setTimeout(function() {location.reload();}, 0001);';
+ $s[] = ' }';
}
- $s[] = ' } else {';
+ $s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
- $s[] = ' }';
- $s[] = ' }';
- $s[] = ' })';
+ $s[] = ' }';
+ $s[] = ' }';
+ $s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';
- $s[] = ' }';
+ $s[] = '}';
//$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
}
@@ -439,45 +455,48 @@ public static function renderAjaxRemoveFromCompare() {
$urlAjax = JURI::base(true).'/index.php?option=com_phocacart&task=comparison.remove&format=json&'. JSession::getFormToken().'=1&comparisonview='.(int)$cView;
//$s[] = 'jQuery(document).ready(function(){';
//$s[] = ' jQuery(".phItemCompareBoxForm").on(\'submit\', function (e) {';
- $s[] = ' function phItemRemoveCompareFormAjax(phItemId) {';
- $s[] = ' var phUrl = "'. $urlAjax.'";';
- $s[] = ' var phItem = \'#\' + phItemId;';
- $s[] = ' var phComparisonView = '.(int)$cView.'';
- $s[] = ' var phData = jQuery(phItem).serialize();';
+ $s[] = ' ';
+ $s[] = '/* Function phItemRemoveCompareFormAjax */ ';
+ $s[] = 'function phItemRemoveCompareFormAjax(phItemId) {';
+ $s[] = ' var phUrl = "'. $urlAjax.'";';
+ $s[] = ' var phItem = \'#\' + phItemId;';
+ $s[] = ' var phComparisonView = '.(int)$cView.'';
+ $s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' ';
- $s[] = ' phRequest = jQuery.ajax({';
- $s[] = ' type: "POST",';
- $s[] = ' url: phUrl,';
- $s[] = ' async: "false",';
- $s[] = ' cache: "false",';
- $s[] = ' data: phData,';
- $s[] = ' dataType:"JSON",';
- $s[] = ' success: function(data){';
- $s[] = ' if (data.status == 1){';
- $s[] = ' jQuery(".phItemCompareBox").html(data.item);';
- $s[] = ' jQuery(".phItemCompareBoxCount").html(data.count);';
+ $s[] = ' phRequest = jQuery.ajax({';
+ $s[] = ' type: "POST",';
+ $s[] = ' url: phUrl,';
+ $s[] = ' async: "false",';
+ $s[] = ' cache: "false",';
+ $s[] = ' data: phData,';
+ $s[] = ' dataType:"JSON",';
+ $s[] = ' success: function(data){';
+ $s[] = ' if (data.status == 1){';
+ $s[] = ' jQuery(".phItemCompareBox").html(data.item);';
+ $s[] = ' jQuery(".phItemCompareBoxCount").html(data.count);';
if ($add_compare_method == 2) {
// Display the popup
- $s[] = ' jQuery("#phContainerModuleCompare").html(data.popup);';
- $s[] = ' jQuery("#phRemoveFromComparePopup").modal();';
+ $s[] = ' jQuery("#phContainerModuleCompare").html(data.popup);';
+ $s[] = ' jQuery("#phRemoveFromComparePopup").modal();';
}
if ($add_compare_method == 1) {
// If no popup is displayed we can relaod the page when we are in comparison page
// If popup, this will be done when clicking continue or comparison list
- $s[] = ' if (phComparisonView == 1) {';
+ $s[] = ' if (phComparisonView == 1) {';
$s[] = self::renderOverlay();
- $s[] = ' setTimeout(function() {location.reload();}, 0001);';
- $s[] = ' }';
+ $s[] = ' setTimeout(function() {location.reload();}, 0001);';
+ $s[] = ' }';
}
- $s[] = ' } else {';
+ $s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
- $s[] = ' }';
- $s[] = ' }';
- $s[] = ' })';
+ $s[] = ' }';
+ $s[] = ' }';
+ $s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';
- $s[] = ' }';
+ $s[] = '}';
//$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
}
@@ -511,45 +530,48 @@ public static function renderAjaxAddToWishList() {
$urlAjax = JURI::base(true).'/index.php?option=com_phocacart&task=wishlist.add&format=json&'. JSession::getFormToken().'=1&wishlistview='.(int)$wView;
//$s[] = 'jQuery(document).ready(function(){';
//$s[] = ' jQuery(".phItemWishListBoxForm").on(\'submit\', function (e) {';
- $s[] = ' function phItemWishListBoxFormAjax(phItemId) {';
- $s[] = ' var phUrl = "'. $urlAjax.'";';
- $s[] = ' var phItem = \'#\' + phItemId;';
- $s[] = ' var phWishListView = '.(int)$wView.'';
- $s[] = ' var phData = jQuery(phItem).serialize();';
+ $s[] = ' ';
+ $s[] = '/* Function phItemWishListBoxFormAjax */ ';
+ $s[] = 'function phItemWishListBoxFormAjax(phItemId) {';
+ $s[] = ' var phUrl = "'. $urlAjax.'";';
+ $s[] = ' var phItem = \'#\' + phItemId;';
+ $s[] = ' var phWishListView = '.(int)$wView.'';
+ $s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' ';
- $s[] = ' phRequest = jQuery.ajax({';
- $s[] = ' type: "POST",';
- $s[] = ' url: phUrl,';
- $s[] = ' async: "false",';
- $s[] = ' cache: "false",';
- $s[] = ' data: phData,';
- $s[] = ' dataType:"JSON",';
- $s[] = ' success: function(data){';
- $s[] = ' if (data.status == 1){';
- $s[] = ' jQuery(".phItemWishListBox").html(data.item);';
- $s[] = ' jQuery(".phItemWishListBoxCount").html(data.count);';
+ $s[] = ' phRequest = jQuery.ajax({';
+ $s[] = ' type: "POST",';
+ $s[] = ' url: phUrl,';
+ $s[] = ' async: "false",';
+ $s[] = ' cache: "false",';
+ $s[] = ' data: phData,';
+ $s[] = ' dataType:"JSON",';
+ $s[] = ' success: function(data){';
+ $s[] = ' if (data.status == 1){';
+ $s[] = ' jQuery(".phItemWishListBox").html(data.item);';
+ $s[] = ' jQuery(".phItemWishListBoxCount").html(data.count);';
if ($add_wishlist_method == 2) {
- $s[] = ' jQuery("body").append(jQuery("#phContainer"));';
- $s[] = ' jQuery("#phContainer").html(data.popup);';
- $s[] = ' jQuery("#phAddToWishListPopup").modal();';
+ $s[] = ' jQuery("body").append(jQuery("#phContainer"));';
+ $s[] = ' jQuery("#phContainer").html(data.popup);';
+ $s[] = ' jQuery("#phAddToWishListPopup").modal();';
}
if ($add_wishlist_method == 1) {
// If no popup is displayed we can relaod the page when we are in wishlist page
// If popup, this will be done when clicking continue or wishlist list
- $s[] = ' if (phWishListView == 1) {';
+ $s[] = ' if (phWishListView == 1) {';
$s[] = self::renderOverlay();
- $s[] = ' setTimeout(function() {location.reload();}, 0001);';
- $s[] = ' }';
+ $s[] = ' setTimeout(function() {location.reload();}, 0001);';
+ $s[] = ' }';
}
- $s[] = ' } else {';
+ $s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
- $s[] = ' }';
- $s[] = ' }';
- $s[] = ' })';
+ $s[] = ' }';
+ $s[] = ' }';
+ $s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';
- $s[] = ' }';
+ $s[] = '}';
//$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
}
@@ -583,45 +605,48 @@ public static function renderAjaxRemoveFromWishList() {
$urlAjax = JURI::base(true).'/index.php?option=com_phocacart&task=wishlist.remove&format=json&'. JSession::getFormToken().'=1&wishlistview='.(int)$wView;
//$s[] = 'jQuery(document).ready(function(){';
//$s[] = ' jQuery(".phItemWishListBoxForm").on(\'submit\', function (e) {';
- $s[] = ' function phItemRemoveWishListFormAjax(phItemId) {';
- $s[] = ' var phUrl = "'. $urlAjax.'";';
- $s[] = ' var phItem = \'#\' + phItemId;';
- $s[] = ' var phWishListView = '.(int)$wView.'';
- $s[] = ' var phData = jQuery(phItem).serialize();';
+ $s[] = ' ';
+ $s[] = '/* Function phItemRemoveWishListFormAjax */ ';
+ $s[] = 'function phItemRemoveWishListFormAjax(phItemId) {';
+ $s[] = ' var phUrl = "'. $urlAjax.'";';
+ $s[] = ' var phItem = \'#\' + phItemId;';
+ $s[] = ' var phWishListView = '.(int)$wView.'';
+ $s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' ';
- $s[] = ' phRequest = jQuery.ajax({';
- $s[] = ' type: "POST",';
- $s[] = ' url: phUrl,';
- $s[] = ' async: "false",';
- $s[] = ' cache: "false",';
- $s[] = ' data: phData,';
- $s[] = ' dataType:"JSON",';
- $s[] = ' success: function(data){';
- $s[] = ' if (data.status == 1){';
- $s[] = ' jQuery(".phItemWishListBox").html(data.item);';
- $s[] = ' jQuery(".phItemWishListBoxCount").html(data.count);';
+ $s[] = ' phRequest = jQuery.ajax({';
+ $s[] = ' type: "POST",';
+ $s[] = ' url: phUrl,';
+ $s[] = ' async: "false",';
+ $s[] = ' cache: "false",';
+ $s[] = ' data: phData,';
+ $s[] = ' dataType:"JSON",';
+ $s[] = ' success: function(data){';
+ $s[] = ' if (data.status == 1){';
+ $s[] = ' jQuery(".phItemWishListBox").html(data.item);';
+ $s[] = ' jQuery(".phItemWishListBoxCount").html(data.count);';
if ($add_wishlist_method == 2) {
// Display the popup
- $s[] = ' jQuery("#phContainerModuleWishList").html(data.popup);';
- $s[] = ' jQuery("#phRemoveFromWishListPopup").modal();';
+ $s[] = ' jQuery("#phContainerModuleWishList").html(data.popup);';
+ $s[] = ' jQuery("#phRemoveFromWishListPopup").modal();';
}
if ($add_wishlist_method == 1) {
// If no popup is displayed we can relaod the page when we are in wishlist page
// If popup, this will be done when clicking continue or wishlist list
- $s[] = ' if (phWishListView == 1) {';
+ $s[] = ' if (phWishListView == 1) {';
$s[] = self::renderOverlay();
- $s[] = ' setTimeout(function() {location.reload();}, 0001);';
- $s[] = ' }';
+ $s[] = ' setTimeout(function() {location.reload();}, 0001);';
+ $s[] = ' }';
}
- $s[] = ' } else {';
+ $s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
- $s[] = ' }';
- $s[] = ' }';
- $s[] = ' })';
+ $s[] = ' }';
+ $s[] = ' }';
+ $s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';
- $s[] = ' }';
+ $s[] = '}';
//$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
}
@@ -655,34 +680,36 @@ public static function renderAjaxQuickViewBox() {
$urlAjax = JURI::base(true).'/index.php?option=com_phocacart&view=item&format=json&tmpl=component&'. JSession::getFormToken().'=1';
//$s[] = 'jQuery(document).ready(function(){';
//$s[] = ' jQuery(".phItemCompareBoxForm").on(\'submit\', function (e) {';
- $s[] = ' function phItemQuickViewBoxFormAjax(phItemId) {';
- $s[] = ' var phUrl = "'. $urlAjax.'";';
- $s[] = ' var phItem = \'#\' + phItemId;';
- //$s[] = ' var phComparisonView = '.(int)$cView.'';
- $s[] = ' var phData = jQuery(phItem).serialize();';
+ $s[] = ' ';
+ $s[] = '/* Function phItemQuickViewBoxFormAjax */ ';
+ $s[] = 'function phItemQuickViewBoxFormAjax(phItemId) {';
+ $s[] = ' var phUrl = "'. $urlAjax.'";';
+ $s[] = ' var phItem = \'#\' + phItemId;';
+ //$s[] = ' var phComparisonView = '.(int)$cView.'';
+ $s[] = ' var phData = jQuery(phItem).serialize();';
$s[] = ' ';
- $s[] = ' phRequest = jQuery.ajax({';
- $s[] = ' type: "POST",';
- $s[] = ' url: phUrl,';
- $s[] = ' async: "false",';
- $s[] = ' cache: "false",';
- $s[] = ' data: phData,';
- $s[] = ' dataType:"JSON",';
- $s[] = ' success: function(data){';
- $s[] = ' if (data.status == 1){';
+ $s[] = ' phRequest = jQuery.ajax({';
+ $s[] = ' type: "POST",';
+ $s[] = ' url: phUrl,';
+ $s[] = ' async: "false",';
+ $s[] = ' cache: "false",';
+ $s[] = ' data: phData,';
+ $s[] = ' dataType:"JSON",';
+ $s[] = ' success: function(data){';
+ $s[] = ' if (data.status == 1){';
//$s[] = ' jQuery("#phItemCompareBox").html(data.item);';
- //$s[] = ' jQuery("#phQuickViewPopupBody").html(data.popup);'; added in ajax
- /////$s[] = ' jQuery("#phContainer").html(data.popup); ';
- $s[] = ' jQuery(".phjItemQuick.phjProductAttribute").remove(); ';// Clear attributes from dom when ajax reload
- $s[] = ' jQuery("body").append(jQuery("#phContainer"));';
- $s[] = ' jQuery("#phContainer").html(data.popup); ';
+ //$s[] = ' jQuery("#phQuickViewPopupBody").html(data.popup);'; added in ajax
+ /////$s[] = ' jQuery("#phContainer").html(data.popup); ';
+ $s[] = ' jQuery(".phjItemQuick.phjProductAttribute").remove(); ';// Clear attributes from dom when ajax reload
+ $s[] = ' jQuery("body").append(jQuery("#phContainer"));';
+ $s[] = ' jQuery("#phContainer").html(data.popup); ';
- /////$s[] = ' jQuery("#phQuickViewPopup").modal();';
- $s[] = ' jQuery("body").append(jQuery("#phQuickViewPopup"));';
- $s[] = ' jQuery("#phQuickViewPopup").modal();';
+ /////$s[] = ' jQuery("#phQuickViewPopup").modal();';
+ $s[] = ' jQuery("body").append(jQuery("#phQuickViewPopup"));';
+ $s[] = ' jQuery("#phQuickViewPopup").modal();';
if ($load_chosen == 1) {
// TO DO
@@ -692,8 +719,8 @@ public static function renderAjaxQuickViewBox() {
// we lost the select boxes on mobiles
//$s[] = ' jQuery(\'select\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';//Reload Chosen
// This seems to work
- //$s[] = ' jQuery(\'select\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';
- $s[] = ' jQuery(\'select\').chosen(\'destroy\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';
+ //$s[] = ' jQuery(\'select\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';
+ $s[] = ' jQuery(\'select\').chosen(\'destroy\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';
}
if ($dynamic_change_price == 1) {
@@ -702,17 +729,18 @@ public static function renderAjaxQuickViewBox() {
$s[] = 'phChangeAttributeType(\'ItemQuick\');';// Recreate the select attribute (color, image) after AJAX
- $s[] = ' '. $media->loadTouchSpin('quantity');// Touch spin for input
+ $s[] = ' '. $media->loadTouchSpin('quantity');// Touch spin for input
- $s[] = ' } else {';
+ $s[] = ' } else {';
//$s[] = ' // Don\'t change the price box';
- $s[] = ' }';
- $s[] = ' }';
- $s[] = ' })';
+ $s[] = ' }';
+ $s[] = ' }';
+ $s[] = ' })';
//$s[] = ' e.preventDefault();';
//$s[] = ' return false;';
- $s[] = ' }';
+ $s[] = '}';
//$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
@@ -748,31 +776,32 @@ public static function renderAjaxChangeProductPriceByOptions($id = 0, $typeView
$urlAjax = JURI::base(true).'/index.php?option=com_phocacart&task=checkout.changepricebox&format=json&'. JSession::getFormToken().'=1';
-
- $s[] = ' function phAjaxChangePrice'.$typeView.'(phProductId, phDataA1, phDataA2){';
- $s[] = ' var phUrl = "'. $urlAjax.'";';
- $s[] = ' var phId = phProductId;'. "\n";
- $s[] = ' var phIdItem = "#phItemPriceBox'.$typeView.'" + phProductId;';
- $s[] = ' var phClass = "'.$class.'";';
- $s[] = ' var phTypeView = "'.$typeView.'";';
-
- $s[] = ' var phData = \'id=\'+phId+\'&\'+phDataA1+\'&\'+phDataA2+\'&\'+\'class=\'+phClass+\'&\'+\'typeview=\'+phTypeView;';
- $s[] = ' jQuery.ajax({';
- $s[] = ' type: "POST",';
- $s[] = ' url: phUrl,';
- $s[] = ' async: "false",';
- $s[] = ' cache: "false",';
- $s[] = ' data: phData,';
- $s[] = ' dataType:"JSON",';
- $s[] = ' success: function(data){';
- $s[] = ' if (data.status == 1){';
- $s[] = ' jQuery(phIdItem).html(data.item);';
- $s[] = ' } else {';
- //$s[] = ' // Don\'t change the price box, don't render any error message
- $s[] = ' }';
- $s[] = ' }';
- $s[] = ' })';
- $s[] = ' }';
+ $s[] = ' ';
+ $s[] = '/* Function phAjaxChangePrice */ ';
+ $s[] = 'function phAjaxChangePrice'.$typeView.'(phProductId, phDataA1, phDataA2){';
+ $s[] = ' var phUrl = "'. $urlAjax.'";';
+ $s[] = ' var phId = phProductId;'. "\n";
+ $s[] = ' var phIdItem = "#phItemPriceBox'.$typeView.'" + phProductId;';
+ $s[] = ' var phClass = "'.$class.'";';
+ $s[] = ' var phTypeView = "'.$typeView.'";';
+
+ $s[] = ' var phData = \'id=\'+phId+\'&\'+phDataA1+\'&\'+phDataA2+\'&\'+\'class=\'+phClass+\'&\'+\'typeview=\'+phTypeView;';
+ $s[] = ' jQuery.ajax({';
+ $s[] = ' type: "POST",';
+ $s[] = ' url: phUrl,';
+ $s[] = ' async: "false",';
+ $s[] = ' cache: "false",';
+ $s[] = ' data: phData,';
+ $s[] = ' dataType:"JSON",';
+ $s[] = ' success: function(data){';
+ $s[] = ' if (data.status == 1){';
+ $s[] = ' jQuery(phIdItem).html(data.item);';
+ $s[] = ' } else {';
+ //$s[] = ' // Don\'t change the price box, don't render any error message
+ $s[] = ' }';
+ $s[] = ' }';
+ $s[] = ' })';
+ $s[] = '}';
$s[] = ' ';
$s[] = 'jQuery(document).ready(function(){';
@@ -827,6 +856,7 @@ public static function renderAjaxChangeProductPriceByOptions($id = 0, $typeView
$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
@@ -855,46 +885,48 @@ public static function renderAjaxChangeProductStockByOptions($id = 0, $typeView
$urlAjax = JURI::base(true).'/index.php?option=com_phocacart&task=checkout.changestockbox&format=json&'. JSession::getFormToken().'=1';
- $s[] = ' function phAjaxChangeStock'.$typeView.'(phProductId, phDataA1, phDataA2){';
- $s[] = ' var phUrl = "'. $urlAjax.'";';
- $s[] = ' var phId = phProductId;'. "\n";
- $s[] = ' var phIdItem = "#phItemStockBox'.$typeView.'" + phProductId;';
- $s[] = ' var phProductAddToCart = ".phProductAddToCart'.$typeView.'" + phProductId;';// display or hide add to cart button
- $s[] = ' var phProductAddToCartIcon = ".phProductAddToCartIcon'.$typeView.'" + phProductId;';// display or hide add to cart icon
- $s[] = ' var phClass = "'.$class.'";';
- $s[] = ' var phTypeView = "'.$typeView.'";';
-
- $s[] = ' var phData = \'id=\'+phId+\'&\'+phDataA1+\'&\'+phDataA2+\'&\'+\'class=\'+phClass+\'&\'+\'typeview=\'+phTypeView;';
- $s[] = ' jQuery.ajax({';
- $s[] = ' type: "POST",';
- $s[] = ' url: phUrl,';
- $s[] = ' async: "false",';
- $s[] = ' cache: "false",';
- $s[] = ' data: phData,';
- $s[] = ' dataType:"JSON",';
- $s[] = ' success: function(data){';
- $s[] = ' if (data.status == 1){';
+ $s[] = ' ';
+ $s[] = '/* Function phAjaxChangeStock */ ';
+ $s[] = 'function phAjaxChangeStock'.$typeView.'(phProductId, phDataA1, phDataA2){';
+ $s[] = ' var phUrl = "'. $urlAjax.'";';
+ $s[] = ' var phId = phProductId;'. "\n";
+ $s[] = ' var phIdItem = "#phItemStockBox'.$typeView.'" + phProductId;';
+ $s[] = ' var phProductAddToCart = ".phProductAddToCart'.$typeView.'" + phProductId;';// display or hide add to cart button
+ $s[] = ' var phProductAddToCartIcon = ".phProductAddToCartIcon'.$typeView.'" + phProductId;';// display or hide add to cart icon
+ $s[] = ' var phClass = "'.$class.'";';
+ $s[] = ' var phTypeView = "'.$typeView.'";';
+
+ $s[] = ' var phData = \'id=\'+phId+\'&\'+phDataA1+\'&\'+phDataA2+\'&\'+\'class=\'+phClass+\'&\'+\'typeview=\'+phTypeView;';
+ $s[] = ' jQuery.ajax({';
+ $s[] = ' type: "POST",';
+ $s[] = ' url: phUrl,';
+ $s[] = ' async: "false",';
+ $s[] = ' cache: "false",';
+ $s[] = ' data: phData,';
+ $s[] = ' dataType:"JSON",';
+ $s[] = ' success: function(data){';
+ $s[] = ' if (data.status == 1){';
if ($hide_add_to_cart_stock == 1) {
- $s[] = ' if (data.stock < 1) {';
- //$s[] = ' jQuery(phProductAddToCart).hide();';
- $s[] = ' jQuery(phProductAddToCart).css(\'visibility\', \'hidden\');';
- $s[] = ' jQuery(phProductAddToCartIcon).css(\'display\', \'none\');';
+ $s[] = ' if (data.stock < 1) {';
+ //$s[] = ' jQuery(phProductAddToCart).hide();';
+ $s[] = ' jQuery(phProductAddToCart).css(\'visibility\', \'hidden\');';
+ $s[] = ' jQuery(phProductAddToCartIcon).css(\'display\', \'none\');';
- $s[] = ' } else {';
- //$s[] = ' jQuery(phProductAddToCart).show();';
- $s[] = ' jQuery(phProductAddToCart).css(\'visibility\', \'visible\');';
- $s[] = ' jQuery(phProductAddToCartIcon).css(\'display\', \'block\');';
- $s[] = ' }';
+ $s[] = ' } else {';
+ //$s[] = ' jQuery(phProductAddToCart).show();';
+ $s[] = ' jQuery(phProductAddToCart).css(\'visibility\', \'visible\');';
+ $s[] = ' jQuery(phProductAddToCartIcon).css(\'display\', \'block\');';
+ $s[] = ' }';
}
- $s[] = ' jQuery(phIdItem).html(data.item);';
- $s[] = ' } else {';
+ $s[] = ' jQuery(phIdItem).html(data.item);';
+ $s[] = ' } else {';
//$s[] = ' // Don\'t change the price box, don't render any error message
- $s[] = ' }';
- $s[] = ' }';
- $s[] = ' })';
- $s[] = ' }';
+ $s[] = ' }';
+ $s[] = ' }';
+ $s[] = ' })';
+ $s[] = '}';
$s[] = ' ';
$s[] = 'jQuery(document).ready(function(){';
@@ -929,6 +961,7 @@ public static function renderAjaxChangeProductStockByOptions($id = 0, $typeView
$s[] = ' })';
$s[] = '})';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
@@ -960,6 +993,8 @@ public static function renderSubmitPaginationTopForm($urlAjax, $outputDiv) {
self::renderPhocaAttribute();// needed because of phChangeAttributeType()
// ::ACTION Ajax for top pagination: pagination/ordering/layouttype
+ $s[] = ' ';
+ $s[] = '/* Function phDoSubmitFormPaginationTop */ ';
$s[] = 'function phDoSubmitFormPaginationTop(sFormData, phUrlJs) {';
//$s[] = ' e.preventDefault();';
@@ -968,38 +1003,38 @@ public static function renderSubmitPaginationTopForm($urlAjax, $outputDiv) {
//if (PhocacartUtils::isView('pos')) {
// $s[] = ' var phUrl = phAddSuffixToUrl(window.location.href, \'format=raw\');';
//} else {
- $s[] = ' var phUrl = "'. $urlAjax.'";';
+ $s[] = ' var phUrl = "'. $urlAjax.'";';
//}
- $s[] = ' phUrl = typeof phUrlJs !== "undefined" ? phUrlJs : phUrl;';
- $s[] = ' phRequest = jQuery.ajax({';
- $s[] = ' type: "POST",';
- $s[] = ' url: phUrl,';
- //$s[] = ' async: false,';
- $s[] = ' async: true,';
- $s[] = ' cache: "false",';
- $s[] = ' data: sFormData,';
- $s[] = ' dataType:"HTML",';
- $s[] = ' success: function(data){';
- $s[] = ' jQuery("'.$outputDiv.'").html(data);';
+ $s[] = ' phUrl = typeof phUrlJs !== "undefined" ? phUrlJs : phUrl;';
+ $s[] = ' phRequest = jQuery.ajax({';
+ $s[] = ' type: "POST",';
+ $s[] = ' url: phUrl,';
+ //$s[] = ' async: false,';
+ $s[] = ' async: true,';
+ $s[] = ' cache: "false",';
+ $s[] = ' data: sFormData,';
+ $s[] = ' dataType:"HTML",';
+ $s[] = ' success: function(data){';
+ $s[] = ' jQuery("'.$outputDiv.'").html(data);';
if (PhocacartUtils::isView('pos')) {
- $s[] = ' phPosManagePage()';
+ $s[] = ' phPosManagePage()';
}
if ($load_chosen) {
- //$s[] = ' jQuery(\'select\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';
- $s[] = ' jQuery(\'select\').chosen(\'destroy\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';
+ //$s[] = ' jQuery(\'select\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';
+ $s[] = ' jQuery(\'select\').chosen(\'destroy\').chosen({disable_search_threshold : 10,allow_single_deselect : true});';
}
if ($equal_height) {
- //$s[] = ' jQuery(\'.ph-thumbnail-c.grid\').matchHeight();';// FLEXBOX USED
+ //$s[] = ' jQuery(\'.ph-thumbnail-c.grid\').matchHeight();';// FLEXBOX USED
}
$s[] = 'phChangeAttributeType();';// Recreate the select attribute (color, image) after AJAX
$s[] = $overlay1['end'];
- $s[] = ' }';
- $s[] = ' })';
+ $s[] = ' }';
+ $s[] = ' })';
//$s[] = ' e.preventDefault();';
$s[] = ' return false;';
@@ -1019,6 +1054,7 @@ public static function renderSubmitPaginationTopForm($urlAjax, $outputDiv) {
$s[] = ' phDoSubmitFormPaginationTop(sFormData, phUrl);';
$s[] = ' })';
$s[] = '})';
+ $s[] = ' ';
// ::EVENT (CLICK) Pagination - Clicking on Start Prev 1 2 3 Next End
@@ -1041,9 +1077,12 @@ public static function renderSubmitPaginationTopForm($urlAjax, $outputDiv) {
$s[] = ' e.preventDefault();';
$s[] = ' })';
$s[] = '})';
+ $s[] = ' ';
}
// ::EVENT (CHANGE) Automatically reload of the pagination/ordering form Clicking on Ordering and Display Num
+ $s[] = ' ';
+ $s[] = '/* Function phEventChangeFormPagination */ ';
$s[] = 'function phEventChangeFormPagination(sForm, sItem) {';
$s[] = ' var phA = 1;';// Full Overlay Yes
@@ -1077,6 +1116,7 @@ public static function renderSubmitPaginationTopForm($urlAjax, $outputDiv) {
}
$s[] = '}';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
@@ -1610,6 +1650,7 @@ public static function searchPosByCategory() {
$s[] = '})';*/
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
+
}
@@ -1822,7 +1863,9 @@ public static function getPriceFormatJavascript($price_decimals, $price_dec_symb
JFactory::getDocument()->addScript(JURI::root(true).'/media/com_phocacart/js/number_format.js');
$s = array();
- $s[] = ' function phGetPriceFormat($price) {';
+ $s[] = ' ';
+ $s[] = '/* Function phGetPriceFormat*/ ';
+ $s[] = 'function phGetPriceFormat($price) {';
$s[] = ' var $negative = 0;';
$s[] = ' if ($price < 0) {';
$s[] = ' $negative = 1;';
@@ -1858,7 +1901,8 @@ public static function getPriceFormatJavascript($price_decimals, $price_dec_symb
$s[] = ' } else {';
$s[] = ' return "'.$price_prefix.'" + $price + "'.$price_suffix.'";';
$s[] = ' }';
- $s[] = ' }';
+ $s[] = '}';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
}
@@ -1868,7 +1912,8 @@ public static function renderFilterRange($min, $max, $priceFrom, $priceTo) {
$s = array();
- $s[] = ' jQuery(document).ready(function(){';
+ $s[] = ' ';
+ $s[] = 'jQuery(document).ready(function(){';
$s[] = ' jQuery( "#phPriceFilterRange" ).slider({';
$s[] = ' range: true,';
$s[] = ' min: '.$min.',';
@@ -1902,7 +1947,8 @@ public static function renderFilterRange($min, $max, $priceFrom, $priceTo) {
$s[] = ' jQuery( "#phPriceFilterRange" ).slider({values: [from,to]});';
$s[] = ' })';
- $s[] = ' });';
+ $s[] = '});';
+ $s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n", $s));
diff --git a/libraries/phocacart/render/media.php b/libraries/phocacart/render/media.php
index 1ebc5250..f2bef192 100644
--- a/libraries/phocacart/render/media.php
+++ b/libraries/phocacart/render/media.php
@@ -103,8 +103,8 @@ public function loadTouchSpin($name) {
$js = ' jQuery("input[name=\''.$name.'\']:visible").TouchSpin({';
$js .= ' verticalbuttons: true,';
if ($this->p['quantity_input_spinner'] == 2) {
- $js .= ' verticalup: \'
x\',';
- $js .= ' verticaldown: \'
x\',';
+ $js .= ' verticalup: \'
\',';
+ $js .= ' verticaldown: \'
\',';
} else {
$js .= ' verticalup: \'
\',';
$js .= ' verticaldown: \'
\',';
diff --git a/libraries/phocacart/shipping/shipping.php b/libraries/phocacart/shipping/shipping.php
index b7045289..44986332 100644
--- a/libraries/phocacart/shipping/shipping.php
+++ b/libraries/phocacart/shipping/shipping.php
@@ -54,7 +54,7 @@ public function getPossibleShippingMethods($amountNetto, $amountBrutto, $quantit
}
- $columns = 's.id, s.tax_id, s.cost, s.calculation_type, s.title, s.description, s.image, s.access,'
+ $columns = 's.id, s.tax_id, s.cost, s.cost_additional, s.calculation_type, s.title, s.description, s.image, s.access,'
.' s.active_amount, s.active_quantity, s.active_zone, s.active_country, s.active_region,'
.' s.active_weight, s.active_size,'
.' s.lowest_amount, s.highest_amount, s.minimal_quantity, s.maximal_quantity, s.lowest_weight,'
@@ -63,7 +63,7 @@ public function getPossibleShippingMethods($amountNetto, $amountBrutto, $quantit
.' GROUP_CONCAT(DISTINCT r.region_id) AS region,'
.' GROUP_CONCAT(DISTINCT c.country_id) AS country,'
.' GROUP_CONCAT(DISTINCT z.zone_id) AS zone';
- $groupsFull = 's.id, s.tax_id, s.cost, s.calculation_type, s.title, s.description, s.image, s.access,'
+ $groupsFull = 's.id, s.tax_id, s.cost, s.cost_additional, s.calculation_type, s.title, s.description, s.image, s.access,'
.' s.active_amount, s.active_quantity, s.active_zone, s.active_country, s.active_region,'
.' s.active_weight, s.active_size,'
.' s.lowest_amount, s.highest_amount, s.minimal_quantity, s.maximal_quantity, s.lowest_weight,'
@@ -296,7 +296,7 @@ public function getShippingMethod($shippingId) {
$db = JFactory::getDBO();
- $query = ' SELECT s.id, s.tax_id, s.cost, s.calculation_type, s.title, s.description, s.image,'
+ $query = ' SELECT s.id, s.tax_id, s.cost, s.cost_additional, s.calculation_type, s.title, s.description, s.image,'
.' t.id as taxid, t.title as taxtitle, t.tax_rate as taxrate, t.calculation_type as taxcalculationtype'
.' FROM #__phocacart_shipping_methods AS s'
.' LEFT JOIN #__phocacart_taxes AS t ON t.id = s.tax_id'
diff --git a/libraries/phocacart/specification/specification.php b/libraries/phocacart/specification/specification.php
index fdc7d9ad..1b2c6178 100644
--- a/libraries/phocacart/specification/specification.php
+++ b/libraries/phocacart/specification/specification.php
@@ -243,7 +243,7 @@ public static function getSpecificationGroupsAndSpecifications($productId) {
}
- public static function getAllSpecificationsAndValues($ordering = 1, $onlyAvailableProducts = 0) {
+ public static function getAllSpecificationsAndValues($ordering = 1, $onlyAvailableProducts = 0, $lang = '') {
$db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 6);
@@ -260,10 +260,21 @@ public static function getAllSpecificationsAndValues($ordering = 1, $onlyAvailab
$lefts[] = ' #__phocacart_specification_groups AS sg ON s.group_id = sg.id';
if ($onlyAvailableProducts == 1) {
+
+ if ($lang != '' && $lang != '*') {
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('p.language', $lang);
+ }
+
$lefts[] = ' #__phocacart_products AS p ON s.product_id = p.id';
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
$lefts = array_merge($lefts, $rules['lefts']);
+ } else {
+
+ if ($lang != '' && $lang != '*') {
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('p.language', $lang);
+ $lefts[] = ' #__phocacart_products AS p ON s.product_id = p.id';
+ }
}
$query = 'SELECT '.$columns
diff --git a/libraries/phocacart/tag/tag.php b/libraries/phocacart/tag/tag.php
index 8c0d4711..91bfb95e 100644
--- a/libraries/phocacart/tag/tag.php
+++ b/libraries/phocacart/tag/tag.php
@@ -38,7 +38,7 @@ public static function getTags($itemId, $select = 0) {
return $tags;
}
- public static function getAllTags($ordering = 1, $onlyAvailableProducts = 0) {
+ public static function getAllTags($ordering = 1, $onlyAvailableProducts = 0, $lang = '') {
/* $db = JFactory::getDBO();
$orderingText = PhocacartOrdering::getOrderingText($ordering, 3);
@@ -63,12 +63,27 @@ public static function getAllTags($ordering = 1, $onlyAvailableProducts = 0) {
$wheres[] = ' t.published = 1';
+
+
if ($onlyAvailableProducts == 1) {
+
+ if ($lang != '' && $lang != '*') {
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('p.language', $lang);
+ }
+
$lefts[] = ' #__phocacart_tags_related AS tr ON tr.tag_id = t.id';
$lefts[] = ' #__phocacart_products AS p ON tr.item_id = p.id';
$rules = PhocacartProduct::getOnlyAvailableProductRules();
$wheres = array_merge($wheres, $rules['wheres']);
$lefts = array_merge($lefts, $rules['lefts']);
+
+ } else {
+
+ if ($lang != '' && $lang != '*') {
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('p.language', $lang);
+ $lefts[] = ' #__phocacart_tags_related AS tr ON tr.tag_id = t.id';
+ $lefts[] = ' #__phocacart_products AS p ON tr.item_id = p.id';
+ }
}
$q = ' SELECT DISTINCT '.$columns
diff --git a/libraries/phocacart/tax/tax.php b/libraries/phocacart/tax/tax.php
index a4650e21..73c27256 100644
--- a/libraries/phocacart/tax/tax.php
+++ b/libraries/phocacart/tax/tax.php
@@ -12,6 +12,23 @@
class PhocacartTax
{
+
+ public static function getAllTaxes() {
+
+
+
+ $db = JFactory::getDBO();
+ $q = 'SELECT t.id, t.title, t.tax_rate'
+ . ' FROM #__phocacart_taxes as t'
+ //. ' LEFT JOIN #__phocacart_tax_countries AS tc ON tc.tax_id = t.id AND tc.country_id = '.(int)$countryId
+ //. ' WHERE tc.country_id = '.(int)$id
+ . ' ORDER BY t.ordering ASC';
+ $db->setQuery($q) ;
+ $items = $db->loadAssocList('id');
+
+ return $items;
+
+ }
// All taxes by country
public static function getTaxesByCountry($countryId) {
diff --git a/libraries/phocacart/text/text.php b/libraries/phocacart/text/text.php
index e3b6c195..2ed5e51a 100644
--- a/libraries/phocacart/text/text.php
+++ b/libraries/phocacart/text/text.php
@@ -53,13 +53,19 @@ public static function completeText($body, $replace, $type = 1) {
$body = isset($replace['invoicedate']) ? str_replace('{invoicedate}', $replace['invoicedate'], $body) : $body;
$body = isset($replace['totaltopay']) ? str_replace('{totaltopay}', $replace['totaltopay'], $body) : $body;
+
$body = isset($replace['orderyear']) ? str_replace('{orderyear}', $replace['orderyear'], $body) : $body;
$body = isset($replace['ordermonth']) ? str_replace('{ordermonth}', $replace['ordermonth'], $body) : $body;
$body = isset($replace['orderday']) ? str_replace('{orderday}', $replace['orderday'], $body) : $body;
$body = isset($replace['ordernumbertxt']) ? str_replace('{ordernumbertxt}', $replace['ordernumbertxt'], $body) : $body;
-
+
+ $body = isset($replace['bankaccountnumber']) ? str_replace('{bankaccountnumber}', $replace['bankaccountnumber'], $body) : $body;
+ $body = isset($replace['iban']) ? str_replace('{iban}', $replace['iban'], $body) : $body;
+ $body = isset($replace['bicswift']) ? str_replace('{bicswift}', $replace['bicswift'], $body) : $body;
+ $body = isset($replace['totaltopaynoformat']) ? str_replace('{totaltopaynoformat}', $replace['totaltopaynoformat'], $body) : $body;
+ $body = isset($replace['currencycode']) ? str_replace('{currencycode}', $replace['currencycode'], $body) : $body;
return $body;
}
@@ -95,6 +101,9 @@ public static function completeTextFormFields($body, $bas, $type = 1) {
public static function prepareReplaceText($order, $orderId, $common, $bas){
+
+
+ $pC = JComponentHelper::getParams( 'com_phocacart' );
$config = JFactory::getConfig();
$price = new PhocacartPrice();
$price->setCurrency($common->currency_code, $orderId);
@@ -131,6 +140,7 @@ public static function prepareReplaceText($order, $orderId, $common, $bas){
$r['shippingtitle'] = PhocacartOrderView::getShippingTitle($common);
$r['dateshipped'] = PhocacartOrderView::getDateShipped($common);
$r['customercomment'] = $common->comment;
+ $r['currencycode'] = $common->currency_code;
$r['websitename'] = $config->get( 'sitename' );
$r['websiteurl'] = JURI::root();
@@ -139,9 +149,13 @@ public static function prepareReplaceText($order, $orderId, $common, $bas){
$r['invoicenumber'] = PhocacartOrder::getInvoiceNumber($orderId, $common->date, $common->invoice_number);
$r['receiptnumber'] = PhocacartOrder::getReceiptNumber($orderId, $common->date, $common->receipt_number);
$r['paymentreferencenumber']= PhocacartOrder::getPaymentReferenceNumber($orderId, $common->date, $common->invoice_prn);
- $r['invoiceduedate'] = PhocacartOrder::getInvoiceDueDate($orderId, $common->date, $common->invoice_due_date);
- $r['invoicedate'] = $common->invoice_date;
+ $r['invoiceduedate'] = PhocacartOrder::getInvoiceDueDate($orderId, $common->date, $common->invoice_due_date, 'Y-m-d');
+ //$r['invoiceduedateyear'] = PhocacartOrder::getInvoiceDueDate($orderId, $common->date, $common->invoice_due_date, 'Y');
+ //$r['invoiceduedatemonth'] = PhocacartOrder::getInvoiceDueDate($orderId, $common->date, $common->invoice_due_date, 'm');
+ //$r['invoiceduedateday'] = PhocacartOrder::getInvoiceDueDate($orderId, $common->date, $common->invoice_due_date, 'd');
+ $r['invoicedate'] = PhocacartOrder::getInvoiceDate($orderId, $common->invoice_date, 'Y-m-d');
$totalToPay = isset($totalBrutto[0]->amount) ? $totalBrutto[0]->amount : 0;
+ $r['totaltopaynoformat'] = number_format($totalToPay, 2, '.', '');
$r['totaltopay'] = $price->getPriceFormat($totalToPay, 0, 1);
$dateO = PhocacartDate::splitDate($common->date);
$r['orderyear'] = $dateO['year'];
@@ -150,6 +164,11 @@ public static function prepareReplaceText($order, $orderId, $common, $bas){
$r['ordernumbertxt'] = JText::_('COM_PHOCACART_ORDER_NR');
+ $r['bankaccountnumber'] = $pC->get( 'bank_account_number', '' );
+ $r['iban'] = $pC->get( 'iban', '' );
+ $r['bicswift'] = $pC->get( 'bic_swift', '' );
+
+
return $r;
}
diff --git a/libraries/phocacart/utils/batchhelper.php b/libraries/phocacart/utils/batchhelper.php
index 9ba41b67..3be41002 100644
--- a/libraries/phocacart/utils/batchhelper.php
+++ b/libraries/phocacart/utils/batchhelper.php
@@ -51,7 +51,7 @@ public static function storeProductItems($idSource, $idDest) {
PhocacartDiscountProduct::storeDiscountsById((int)$idDest, $dA, 1);
// Advanced Stock Options
- $aSOA = PhocacartAttribute::storeCombinationsById($idSource, 1);
+ $aSOA = PhocacartAttribute::getCombinationsStockById($idSource, 1);
PhocacartAttribute::storeCombinationsById((int)$idDest, $aSOA, 1);
// Customer groups
diff --git a/libraries/phocacart/utils/settings.php b/libraries/phocacart/utils/settings.php
index 06228804..6f76ec46 100644
--- a/libraries/phocacart/utils/settings.php
+++ b/libraries/phocacart/utils/settings.php
@@ -278,5 +278,33 @@ public static function getShopType() {
return $type;
}
+ public static function getShopTypes() {
+
+ return array(
+ 0 => JText::_('COM_PHOCACART_ALL'),
+ 1 => JText::_('COM_PHOCACART_ONLINE_SHOP'),
+ 2 => JText::_('COM_PHOCACART_POS')
+ );
+ }
+
+ public static function getLangQuery($column, $lang) {
+
+ $db = JFactory::getDbo();
+ // Possible settings
+ //$pC = JComponentHelper::getParams( 'com_phocacart' );
+ //$filter_lang_type = $pC->get( 'filter_lang_type', 2 );
+ //$type1 = ' ' . $db->quoteName($column) . ' = '.$db->quote($lang);
+ $type2 = ' ' . $db->quoteName($column) . ' IN ('.$db->quote($lang).','.$db->quote('*').')';
+
+ /*if ($filter_lang_type == 1) {
+ return $type1;
+ } else {
+ return $type2;
+ }*/
+
+ return $type2;
+ }
+
+
}
?>
\ No newline at end of file
diff --git a/media/css/administrator/37.css b/media/css/administrator/37.css
index f52b761e..ade35c65 100644
--- a/media/css/administrator/37.css
+++ b/media/css/administrator/37.css
@@ -30,13 +30,16 @@ body.com_phocacart #toolbar [class*=" icon-new"] {
margin: 0 0px 0 -6px;
}
-body.com_phocacart #toolbar .ph-icon-wizard {
+body.com_phocacart #toolbar .ph-icon-wizard ,
+body.com_phocacart #toolbar .ph-icon-text,
+body.com_phocacart #toolbar .ph-icon-pdf {
border-right: 0px;
background: transparent;
margin: 0 4px 0 -2px;
}
+
body.com_phocacart .chzn-container-single .chzn-single div {
background-color: #fff;
border-left: 0px;
diff --git a/media/css/administrator/phocacart.css b/media/css/administrator/phocacart.css
index c558e63b..b5d96b42 100644
--- a/media/css/administrator/phocacart.css
+++ b/media/css/administrator/phocacart.css
@@ -601,6 +601,10 @@ table.ph-table-download-links tr th.link {
float: left;
}
+.ph-inline-param .field-calendar {
+ display: inline;
+}
+
/* Charts */
.ph-chart-canvas-holder {
padding:5px;
@@ -835,9 +839,10 @@ border-radius: 2px;
.view-phocacartexports [class^="icon-"].ph-icon-export::before,
.view-phocacartexports [class*=" icon-"].ph-icon-export::before,*/
-#ph-icon-wizard.ph-icon-wizard::before
- {
+#ph-icon-text.ph-icon-text::before,
+#ph-icon-pdf.ph-icon-pdf::before,
+#ph-icon-wizard.ph-icon-wizard::before {
font-family: "Glyphicons Halflings";
font-style: normal;
}
@@ -1137,4 +1142,56 @@ td,
.ph-no-wrap {
white-space: nowrap;
+}
+
+table.ph-report-table {
+ padding: 3px;
+ border: 1px solid #f0f0f0;
+ width: 100%;
+}
+
+table.ph-report-table,
+table.ph-report-table tr,
+table.ph-report-table tr td {
+ padding: 3px;
+ border: 1px solid #f0f0f0;
+}
+
+table.ph-report-table tr th {
+ padding: 5px;
+ color: #129ED9;
+ border: 1px solid #f0f0f0;
+ border-bottom: 3px solid #129ED9;
+
+}
+
+table.ph-report-table tr td {
+ padding: 0.2em 1em;
+}
+
+.ph-report-brutto,
+.ph-report-tax,
+.ph-report-netto,
+.ph-report-rounding {
+ text-align: right;
+}
+.ph-report-currency {
+ text-align: center;
+}
+
+table.ph-report-table tr#phReportTotalRow0{
+ border-top: 3px solid #f0f0f0;
+}
+table.ph-report-table tr.ph-report-total-row td {
+ background: #ffffbf;
+ vertical-align: top;
+ text-align: right;
+ padding: 0.2em 1em;
+ font-weight: bold;
+}
+table.ph-report-table tr.ph-report-total-row td.ph-report-total-col1 {
+ text-align: left;
+ padding: 0.2em 1em;
+ font-weight: bold;
+ vertical-align: middle;
}
\ No newline at end of file
diff --git a/media/css/administrator/phocacartcustom.css b/media/css/administrator/phocacartcustom.css
index 136e0ee4..bcac64b3 100644
--- a/media/css/administrator/phocacartcustom.css
+++ b/media/css/administrator/phocacartcustom.css
@@ -37,6 +37,14 @@
text-shadow: none !important;
}
+.btn-toolbar .btn.btn-danger {
+ color: #fff !important;
+ background-color: #F76397 !important;
+
+ box-shadow: none !important;
+ text-shadow: none !important;
+}
+
.btn {
border: 1px solid #DEDEDE !important;
background: #fff !important;
diff --git a/media/css/administrator/phocacarttheme.css b/media/css/administrator/phocacarttheme.css
index 48a073ea..afcd6184 100644
--- a/media/css/administrator/phocacarttheme.css
+++ b/media/css/administrator/phocacarttheme.css
@@ -1,5 +1,5 @@
.admin.com_phocacart {
- /*font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;*/
+ font-family: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
#j-main-container {
@@ -591,6 +591,14 @@
margin-top: 2px;
}
.nav.nav-list li:nth-child(29):before {
+ font-family: 'Glyphicons Halflings';
+ color: #8c0069;
+ content: "\e032";
+ float:left;
+ margin-right: 5px;
+ margin-top: 2px;
+}
+.nav.nav-list li:nth-child(30):before {
font-family: 'Glyphicons Halflings';
color: #fb1000;
content: "\e210";
@@ -599,7 +607,7 @@
margin-top: 2px;
}
-.nav.nav-list li:nth-child(30):before {
+.nav.nav-list li:nth-child(31):before {
font-family: 'Glyphicons Halflings';
color: #668099;
content: "\e169";
@@ -607,7 +615,7 @@
margin-right: 5px;
margin-top: 2px;
}
-.nav.nav-list li:nth-child(31):before {
+.nav.nav-list li:nth-child(32):before {
font-family: 'Glyphicons Halflings';
color: #669999;
content: "\e170";
@@ -616,7 +624,7 @@
margin-top: 2px;
}
-.nav.nav-list li:nth-child(32):before {
+.nav.nav-list li:nth-child(33):before {
font-family: 'Glyphicons Halflings';
color: #c0c0c0;
content: "\e056";
@@ -625,7 +633,7 @@
margin-top: 2px;
}
-.nav.nav-list li:nth-child(33):before {
+.nav.nav-list li:nth-child(34):before {
font-family: 'Glyphicons Halflings';
color: #3378cc;
content: "\e086";
@@ -634,7 +642,7 @@
margin-top: 2px;
}
-.nav.nav-list li:nth-child(34):before {
+.nav.nav-list li:nth-child(35):before {
font-family: 'Glyphicons Halflings';
color: #2693ff;
content: "\e010";
@@ -643,7 +651,7 @@
margin-top: 2px;
}
-.nav.nav-list li:nth-child(35):before {
+.nav.nav-list li:nth-child(36):before {
font-family: 'Glyphicons Halflings';
color: #b30059;
content: "\e008";
@@ -652,7 +660,7 @@
margin-top: 2px;
}
-.nav.nav-list li:nth-child(36):before {
+.nav.nav-list li:nth-child(37):before {
font-family: 'Glyphicons Halflings';
color: #b35900;
content: "\e157";
@@ -661,7 +669,7 @@
margin-top: 2px;
}
-.nav.nav-list li:nth-child(37):before {
+.nav.nav-list li:nth-child(38):before {
font-family: 'Glyphicons Halflings';
color: #ff9326;
content: "\e237";
diff --git a/media/css/main.css b/media/css/main.css
index 1cb41e81..053483c8 100644
--- a/media/css/main.css
+++ b/media/css/main.css
@@ -1593,7 +1593,8 @@ h3.gridlist {
/*height: 100%;*/
display: flex;
- flex: 1 1 100%;
+ /*flex: 1 1 100%;*/
+ flex: 1 1 auto;
flex-direction: column;
}
@@ -1611,6 +1612,8 @@ h3.gridlist {
.row-flex.grid .row-item .ph-item-box .ph-thumbnail-c .ph-item-content .phItemQuickViewBoxForm{
}
+
+
.ph-item-action{
display: flex;
flex-direction: row;
diff --git a/media/images/administrator/b-pc.png b/media/images/administrator/b-pc.png
index 49ccf3f1..f8ca2db9 100644
Binary files a/media/images/administrator/b-pc.png and b/media/images/administrator/b-pc.png differ
diff --git a/media/js/chartjs/index.html b/media/js/chartjs/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/media/js/chartjs/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/media/js/chosen/LICENSE.md b/media/js/chosen/LICENSE.md
new file mode 100644
index 00000000..5e1332c1
--- /dev/null
+++ b/media/js/chosen/LICENSE.md
@@ -0,0 +1,23 @@
+#### Chosen
+- by Patrick Filler for [Harvest](http://getharvest.com)
+- Copyright (c) 2011-2016 by Harvest
+
+Available for use under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/media/js/chosen/chosen-sprite.png b/media/js/chosen/chosen-sprite.png
index 3611ae4a..c57da70b 100644
Binary files a/media/js/chosen/chosen-sprite.png and b/media/js/chosen/chosen-sprite.png differ
diff --git a/media/js/chosen/chosen.css b/media/js/chosen/chosen.css
index 2b7bb925..5ae6fc94 100644
--- a/media/js/chosen/chosen.css
+++ b/media/js/chosen/chosen.css
@@ -2,9 +2,9 @@
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
-Version 1.7.0
+Version 1.8.7
Full source at https://github.com/harvesthq/chosen
-Copyright (c) 2011-2017 Harvest http://getharvest.com
+Copyright (c) 2011-2018 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
@@ -23,7 +23,8 @@ This file is generated by `grunt build`, do not edit it by hand.
}
.chosen-container * {
- box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
}
.chosen-container .chosen-drop {
@@ -34,12 +35,17 @@ This file is generated by `grunt build`, do not edit it by hand.
border: 1px solid #aaa;
border-top: 0;
background: #fff;
- box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
+ -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
clip: rect(0, 0, 0, 0);
+ -webkit-clip-path: inset(100% 100%);
+ clip-path: inset(100% 100%);
}
.chosen-container.chosen-with-drop .chosen-drop {
clip: auto;
+ -webkit-clip-path: none;
+ clip-path: none;
}
.chosen-container a {
@@ -72,9 +78,11 @@ This file is generated by `grunt build`, do not edit it by hand.
border: 1px solid #aaa;
border-radius: 5px;
background-color: #fff;
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #fff), color-stop(50%, #f6f6f6), color-stop(52%, #eee), to(#f4f4f4));
background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
background-clip: padding-box;
- box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
+ -webkit-box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
color: #444;
text-decoration: none;
white-space: nowrap;
@@ -163,6 +171,8 @@ This file is generated by `grunt build`, do not edit it by hand.
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
position: absolute;
clip: rect(0, 0, 0, 0);
+ -webkit-clip-path: inset(100% 100%);
+ clip-path: inset(100% 100%);
}
/* @end */
@@ -201,6 +211,7 @@ This file is generated by `grunt build`, do not edit it by hand.
.chosen-container .chosen-results li.highlighted {
background-color: #3875d7;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
color: #fff;
}
@@ -237,6 +248,7 @@ This file is generated by `grunt build`, do not edit it by hand.
height: auto;
border: 1px solid #aaa;
background-color: #fff;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #eee), color-stop(15%, #fff));
background-image: linear-gradient(#eee 1%, #fff 15%);
cursor: text;
}
@@ -259,7 +271,8 @@ This file is generated by `grunt build`, do not edit it by hand.
outline: 0;
border: 0 !important;
background: transparent !important;
- box-shadow: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
color: #999;
font-size: 100%;
font-family: sans-serif;
@@ -276,11 +289,13 @@ This file is generated by `grunt build`, do not edit it by hand.
max-width: 100%;
border-radius: 3px;
background-color: #eeeeee;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), to(#eee));
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-size: 100% 19px;
background-repeat: repeat-x;
background-clip: padding-box;
- box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
+ -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
color: #333;
line-height: 13px;
cursor: default;
@@ -309,6 +324,7 @@ This file is generated by `grunt build`, do not edit it by hand.
padding-right: 5px;
border: 1px solid #ccc;
background-color: #e4e4e4;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), to(#eee));
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
color: #666;
}
@@ -336,15 +352,18 @@ This file is generated by `grunt build`, do not edit it by hand.
/* @group Active */
.chosen-container-active .chosen-single {
border: 1px solid #5897fb;
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active.chosen-with-drop .chosen-single {
border: 1px solid #aaa;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #eee), color-stop(80%, #fff));
background-image: linear-gradient(#eee 20%, #fff 80%);
- box-shadow: 0 1px 0 #fff inset;
+ -webkit-box-shadow: 0 1px 0 #fff inset;
+ box-shadow: 0 1px 0 #fff inset;
}
.chosen-container-active.chosen-with-drop .chosen-single div {
@@ -358,7 +377,8 @@ This file is generated by `grunt build`, do not edit it by hand.
.chosen-container-active .chosen-choices {
border: 1px solid #5897fb;
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active .chosen-choices li.search-field input[type="text"] {
diff --git a/media/js/chosen/chosen.jquery.min.js b/media/js/chosen/chosen.jquery.min.js
index 1749a1c3..4ad16475 100644
--- a/media/js/chosen/chosen.jquery.min.js
+++ b/media/js/chosen/chosen.jquery.min.js
@@ -1,2 +1,3 @@
-/* Chosen v1.7.0 | (c) 2011-2017 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
-(function(){var a,b,c,d,e,f=function(a,b){return function(){return a.apply(b,arguments)}},g={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},a.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},a.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},a}(),d.select_to_array=function(a){var b,c,e,f,g;for(c=new d,g=a.childNodes,e=0,f=g.length;f>e;e++)b=g[e],c.add_node(b);return c.parsed},b=function(){function a(b,c){this.form_field=b,this.options=null!=c?c:{},this.label_click_handler=f(this.label_click_handler,this),a.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return a.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null!=this.options.hide_results_on_select?this.options.hide_results_on_select:!0},a.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||a.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||a.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||a.default_no_result_text},a.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"
"+a.group_label+""+a.html:a.html},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},a.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},a.prototype.label_click_handler=function(a){return this.is_multiple?this.container_mousedown(a):this.activate_field()},a.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},a.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},a.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.get_search_regex(a),b=this.get_highlight_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)c=l[j],c.search_match=!1,f=null,this.include_option_in_results(c)&&(c.group&&(c.group_match=!1,c.active_options=0),null!=c.group_array_index&&this.results_data[c.group_array_index]&&(f=this.results_data[c.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),c.search_text=c.group?c.label:c.html,(!c.group||this.group_search)&&(c.search_match=this.search_string_match(c.search_text,d),c.search_match&&!c.group&&(e+=1),c.search_match?(g.length&&(h=c.search_text.search(b),i=c.search_text.substr(0,h+g.length)+""+c.search_text.substr(h+g.length),c.search_text=i.substr(0,h)+"
"+i.substr(h)),null!=f&&(f.group_match=!0)):null!=c.group_array_index&&this.results_data[c.group_array_index].search_match&&(c.search_match=!0)));return this.result_clear_highlight(),1>e&&g.length?(this.update_results_content(""),this.no_results(g)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},a.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},a.prototype.get_highlight_regex=function(a){var b,c;return b=this.search_contains?"":"\\b",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},a.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},a.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},a.prototype.choices_click=function(a){return a.preventDefault(),this.activate_field(),this.results_showing||this.is_disabled?void 0:this.results_show()},a.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 27:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},a.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:a.preventDefault(),this.results_showing&&this.result_select(a);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},a.prototype.clipboard_event_checker=function(a){var b=this;if(!this.is_disabled)return setTimeout(function(){return b.results_search()},50)},a.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},a.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},a.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},a.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},a.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},a.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},a.prototype.get_single_html=function(){return'\n '+this.default_text+'\n
\n\n'},a.prototype.get_multi_html=function(){return'\n'},a.prototype.get_no_results_html=function(a){return'\n '+this.results_none_found+" "+a+"\n"},a.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)?!1:!0},a.default_multiple_text="Select Some Options",a.default_single_text="Select an Option",a.default_no_result_text="No results match",a}(),a=jQuery,a.fn.extend({chosen:function(d){return b.browser_is_supported()?this.each(function(b){var e,f;return e=a(this),f=e.data("chosen"),"destroy"===d?void(f instanceof c&&f.destroy()):void(f instanceof c||e.data("chosen",new c(this,d)))}):this}}),c=function(b){function c(){return e=c.__super__.constructor.apply(this,arguments)}return h(c,b),c.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},c.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("",c),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},c.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},c.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){a.container_mousedown(b)}),this.container.bind("touchend.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.close_field(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},c.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.unbind("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},c.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_field)},c.prototype.container_mousedown=function(b){var c;if(!this.is_disabled)return!b||"mousedown"!==(c=b.type)&&"touchstart"!==c||this.results_showing||b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},c.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},c.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},c.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},c.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},c.prototype.activate_field=function(){return this.is_disabled?void 0:(this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus())},c.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},c.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=d.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},c.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},c.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},c.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},c.prototype.update_results_content=function(a){return this.search_results.html(a)},c.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},c.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},c.prototype.set_label_behavior=function(){return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",this.label_click_handler):void 0},c.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},c.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},c.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},c.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},c.prototype.choice_build=function(b){var c,d,e=this;return c=a("",{"class":"search-choice"}).html(""+this.choice_label(b)+""),b.disabled?c.addClass("search-choice-disabled"):(d=a("",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},c.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},c.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},c.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field?this.results_hide():void 0},c.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},c.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(!this.is_multiple||this.hide_results_on_select&&!a.metaKey&&!a.ctrlKey)&&(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},c.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},c.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},c.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")):void 0},c.prototype.get_search_field_value=function(){return this.search_field.val()},c.prototype.get_search_text=function(){return this.escape_html(a.trim(this.get_search_field_value()))},c.prototype.escape_html=function(b){return a("").text(b).html()},c.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},c.prototype.no_results=function(a){var b;return b=this.get_no_results_html(a),this.search_results.append(b),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},c.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},c.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},c.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},c.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},c.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},c.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i;if(this.is_multiple){for(e={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},f=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"],h=0,i=f.length;i>h;h++)d=f[h],e[d]=this.search_field.css(d);return c=a("").css(e),c.text(this.get_search_field_value()),a("body").append(c),g=c.width()+25,c.remove(),b=this.container.outerWidth(),g=Math.min(b-10,g),this.search_field.width(g)}},c.prototype.trigger_form_field_change=function(a){return this.form_field_jq.trigger("input",a),this.form_field_jq.trigger("change",a)},c}(b)}).call(this);
\ No newline at end of file
+/* Chosen v1.8.7 | (c) 2011-2018 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
+
+(function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},o={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s"+this.escape_html(t.group_label)+""+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t"+this.escape_html(s)+""+this.escape_html(p)),null!=a&&(a.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),_<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t
0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){if(!this.is_disabled)return setTimeout(function(t){return function(){return t.results_search()}}(this),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'\n '+this.default_text+'\n
\n\n'},t.prototype.get_multi_html=function(){return'\n'},t.prototype.get_no_results_html=function(t){return'\n '+this.results_none_found+" "+this.escape_html(t)+"\n"},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={"class":e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("touchend.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mousedown.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("mouseup.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mouseenter.chosen",function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.on("mouseleave.chosen",function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.on("mouseup.chosen",function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.on("mouseover.chosen",function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.on("mouseout.chosen",function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.search_results.on("touchstart.chosen",function(t){return function(e){t.search_results_touchstart(e)}}(this)),this.search_results.on("touchmove.chosen",function(t){return function(e){t.search_results_touchmove(e)}}(this)),this.search_results.on("touchend.chosen",function(t){return function(e){t.search_results_touchend(e)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(t){return function(e){t.close_field(e)}}(this)),this.search_field.on("blur.chosen",function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.on("keyup.chosen",function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.on("keydown.chosen",function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.on("focus.chosen",function(t){return function(e){t.input_focus(e)}}(this)),this.search_field.on("cut.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.search_field.on("paste.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(t){return function(e){t.choices_click(e)}}(this)):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),r=this.search_results.scrollTop(),n=i+r,s=this.result_highlight.position().top+this.search_results.scrollTop(),(e=s+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i;return s=t("",{"class":"search-choice"}).html(""+this.choice_label(e)+""),e.disabled?s.addClass("search-choice-disabled"):((i=t("",{"class":"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(t=e.length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}).call(this);
\ No newline at end of file
diff --git a/media/js/swiper/index.html b/media/js/swiper/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/media/js/swiper/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/media/js/touchspin/index.html b/media/js/touchspin/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/media/js/touchspin/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/models/fields/phocacartorderstatus.php b/models/fields/phocacartorderstatus.php
index af30121d..51808ac6 100644
--- a/models/fields/phocacartorderstatus.php
+++ b/models/fields/phocacartorderstatus.php
@@ -7,7 +7,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
-//JLoader::registerPrefix('Phocacart', JPATH_ADMINISTRATOR . '/components/com_phocacart/libraries/phocacart');
+JLoader::registerPrefix('Phocacart', JPATH_ADMINISTRATOR . '/components/com_phocacart/libraries/phocacart');
class JFormFieldPhocacartOrderstatus extends JFormField
{
diff --git a/models/forms/phocacartpayment.xml b/models/forms/phocacartpayment.xml
index e7ea0d6d..2c141c56 100644
--- a/models/forms/phocacartpayment.xml
+++ b/models/forms/phocacartpayment.xml
@@ -20,6 +20,7 @@
+
diff --git a/models/forms/phocacartshipping.xml b/models/forms/phocacartshipping.xml
index 9b4269b7..ce83c1da 100644
--- a/models/forms/phocacartshipping.xml
+++ b/models/forms/phocacartshipping.xml
@@ -22,6 +22,8 @@
+
+
diff --git a/models/phocacarteditstatus.php b/models/phocacarteditstatus.php
index 4403306d..90c28439 100644
--- a/models/phocacarteditstatus.php
+++ b/models/phocacarteditstatus.php
@@ -107,7 +107,7 @@ public function editStatus($data) {
$notify = PhocacartOrderStatus::changeStatus((int)$data['id'], (int)$data['status_id'], '', $notifyUser, $notifyOther, (int)$data['email_send'], $data['stock_movements'], $data['change_user_group'], $data['change_points_needed'], $data['change_points_received']);
- PhocacartOrderStatus::setHistory((int)$data['id'], (int)$data['status_id'], (int)$notify, $data['comment']);
+ PhocacartOrderStatus::setHistory((int)$data['id'], (int)$data['status_id'], (int)$notify, $data['comment_history']);
return $row->id;
diff --git a/models/phocacartitem.php b/models/phocacartitem.php
index dfdeb8e9..cb6816f9 100644
--- a/models/phocacartitem.php
+++ b/models/phocacartitem.php
@@ -547,10 +547,15 @@ protected function batchCopy($value, $pks, $contexts)
$dataCat2 = array_merge($dataCat, $currentDataCat);
// 2) Remove duplicates
$dataCat2 = array_unique($dataCat2);
- // 3) Remove the source category - we copy product from source category and the product is included in source category
+
+
+
+ /*
+ * Yes when copying - we duplicate the item intentionally
+ * // 3) Remove the source category - we copy product from source category and the product is included in source category
// so don't copy it again to not get duplicates in the same category
$currentCatidA = array(0 => (int)$currentCatid);
- $dataCat2 = array_diff($dataCat2, $currentCatidA);
+ $dataCat2 = array_diff($dataCat2, $currentCatidA);*/
PhocacartCategoryMultiple::storeCategories($dataCat2, (int)$newId);
@@ -569,7 +574,7 @@ protected function batchCopy($value, $pks, $contexts)
* @param integer $value The new category ID.
* @param array $pks An array of row IDs.
*
- * @return booelan True if successful, false otherwise and internal error is set.
+ * @return bool True if successful, false otherwise and internal error is set.
*
* @since 11.1
*/
diff --git a/models/phocacartorder.php b/models/phocacartorder.php
index d2d7a010..51fdfa4f 100644
--- a/models/phocacartorder.php
+++ b/models/phocacartorder.php
@@ -101,6 +101,8 @@ public function save($data) {
$dform = $app->input->get('dform', array(), 'array');
+
+
// Shipping, Billing
if(!empty($jform)) {
diff --git a/models/phocacartpayment.php b/models/phocacartpayment.php
index cfc43dfc..f0322bb0 100644
--- a/models/phocacartpayment.php
+++ b/models/phocacartpayment.php
@@ -40,7 +40,8 @@ protected function loadFormData() {
if (empty($data)) {
$data = $this->getItem();
$price = new PhocacartPrice();
- $data->cost = $price->cleanPrice($data->cost);
+ $data->cost = $price->cleanPrice($data->cost);
+ $data->cost_additional = $price->cleanPrice($data->cost_additional);
}
return $data;
}
@@ -54,6 +55,7 @@ protected function prepareTable($table) {
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
$table->cost = PhocacartUtils::replaceCommaWithPoint($table->cost);
+ $table->cost_additional = PhocacartUtils::replaceCommaWithPoint($table->cost_additional);
$table->lowest_amount = PhocacartUtils::replaceCommaWithPoint($table->lowest_amount);
$table->highest_amount = PhocacartUtils::replaceCommaWithPoint($table->highest_amount);
diff --git a/models/phocacartreport.php b/models/phocacartreport.php
new file mode 100644
index 00000000..735e1d92
--- /dev/null
+++ b/models/phocacartreport.php
@@ -0,0 +1,26 @@
+
\ No newline at end of file
diff --git a/models/phocacartreports.php b/models/phocacartreports.php
new file mode 100644
index 00000000..9096e374
--- /dev/null
+++ b/models/phocacartreports.php
@@ -0,0 +1,177 @@
+getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+/* $accessId = $app->getUserStateFromRequest($this->context.'.filter.access', 'filter_access', null, 'int');
+ $this->setState('filter.access', $accessId);*/
+
+ $state = $app->getUserStateFromRequest($this->context.'.filter.state', 'filter_published', '', 'string');
+ $this->setState('filter.state', $state);
+
+ $language = $app->getUserStateFromRequest($this->context.'.filter.language', 'filter_language', '');
+ $this->setState('filter.language', $language);
+
+ $currency = $app->getUserStateFromRequest($this->context.'.filter.currency', 'filter_currency', '');
+ $this->setState('filter.currency', $currency);
+
+
+ $shopType = $app->getUserStateFromRequest($this->context.'.filter.shop_type', 'filter_shop_type', '');
+ $this->setState('filter.shop_type', $shopType);
+
+ //$order = $app->getUserStateFromRequest($this->context.'.filter.order', 'filter_order', '');
+ //$this->setState('filter.order', $order);
+
+ $date_from = $app->getUserStateFromRequest($this->context.'.filter.date_from', 'filter_date_from', PhocacartDate::getCurrentDate(30), 'string');
+ $this->setState('filter.date_from', $date_from);
+
+ $date_to = $app->getUserStateFromRequest($this->context.'.filter.date_to', 'filter_date_to', PhocacartDate::getCurrentDate(), 'string');
+ $this->setState('filter.date_to', $date_to);
+
+
+
+ // Load the parameters.
+ $params = JComponentHelper::getParams('com_phocacart');
+ $this->setState('params', $params);
+
+
+
+ // List state information.
+ parent::populateState('a.date', 'desc');
+ }
+
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':'.$this->getState('filter.search');
+ //$id .= ':'.$this->getState('filter.access');
+ $id .= ':'.$this->getState('filter.state');
+ $id .= ':'.$this->getState('filter.date_from');
+ $id .= ':'.$this->getState('filter.date_to');
+ $id .= ':'.$this->getState('filter.currency');
+ $id .= ':'.$this->getState('filter.shop_type');
+
+ return parent::getStoreId($id);
+ }
+
+ protected function getListQuery() {
+
+ $db = $this->getDbo();
+ $query = $db->getQuery(true);
+
+ $query->select(
+ $this->getState(
+ 'list.select',
+ ///// -- 'a.id, DATE(a.date) AS date_only, COUNT(DATE(a.date)) AS count_orders'
+ //'DATE(a.date) AS date_only, COUNT(DATE(a.date)) AS count_orders'
+ 'a.id, a.date, a.order_number, a.currency_id, a.currency_code, a.currency_exchange_rate, a.type'
+ )
+ );
+ $query->from('`#__phocacart_orders` AS a');
+
+ //$query->select('SUM(t.amount) AS order_amount');
+ //$query->join('LEFT', '#__phocacart_order_total AS t ON a.id=t.order_id');
+ //$query->where('t.type = \'brutto\'' );
+
+ // Filter by order status
+ /* $whereOrderStatus = '';
+ if (!PhocacartStatistics::setWhereByOrderStatus($whereOrderStatus)) {
+ $dummyQuery = 'SELECT "" AS date_only, 0 AS count_orders FROM `#__phocacart_orders`';
+ return $dummyQuery;
+ }
+ if ($whereOrderStatus != '') {
+ $query->where( $whereOrderStatus );
+ }*/
+
+ // TOTAL
+ /*$query->select('tn.amount AS total_netto');
+ $query->join('LEFT', '#__phocacart_order_total AS tn ON a.id = tn.order_id');
+ $query->where('tn.type = '.$db->quote('netto'));
+
+ $query->select('SUM(tv.amount) AS total_vat');
+ $query->join('LEFT', '#__phocacart_order_total AS tv ON a.id = tv.order_id');
+ $query->where('tv.type = '.$db->quote('tax'));
+
+ $query->select('tb.amount AS total_brutto, tb.amount_currency AS total_brutto_currency');
+ $query->join('LEFT', '#__phocacart_order_total AS tb ON a.id = tb.order_id');
+ $query->where('tb.type = '.$db->quote('brutto'));*/
+
+ // USERS
+ $query->select('ou.name_first AS user_name_first, ou.name_last AS user_name_last, ou.company AS user_company, ou.vat_1 AS user_vat_1,'
+ .' ou.address_1 AS user_address_1, ou.city AS user_city, ou.zip AS user_zip, co.title AS user_country');
+ $query->join('LEFT', '#__phocacart_order_users AS ou ON a.id = ou.order_id');
+ $query->join('LEFT', '#__phocacart_countries AS co ON ou.country = co.id');
+
+
+ // Filter by search in title
+ $dateFrom = $this->getState('filter.date_from', PhocacartDate::getCurrentDate(30));
+ $dateTo = $this->getState('filter.date_to', PhocacartDate::getCurrentDate());
+
+
+ if ($dateTo != '' && $dateFrom != '') {
+ $dateFrom = $db->Quote($dateFrom);
+ $dateTo = $db->Quote($dateTo);
+ $query->where('DATE(a.date) >= '.$dateFrom.' AND DATE(a.date) <= '.$dateTo );
+ }
+
+ $currency = $this->getState('filter.currency', 0);
+ if ($currency > 0) {
+ $query->where('a.currency_id = '.(int)$currency );
+ }
+ $shopType = $this->getState('filter.shop_type', 0);
+ if ($shopType > 0) {
+ $query->where('a.type = '.(int)$shopType );
+ }
+
+
+ ///// -- $query->group('DATE(a.date), a.id');
+ //$query->group('DATE(a.date)');
+ $query->group('a.id');
+
+
+
+ $orderCol = $this->state->get('list.ordering', 'a.date');
+ $orderDirn = $this->state->get('list.direction', 'DESC');
+
+ $query->order($db->escape($orderCol.' '.$orderDirn));
+
+ //echo nl2br(str_replace('#__', 'jos_', $query->__toString()));
+ return $query;
+ }
+}
+?>
\ No newline at end of file
diff --git a/models/phocacartshipping.php b/models/phocacartshipping.php
index 269100a1..50bbce68 100644
--- a/models/phocacartshipping.php
+++ b/models/phocacartshipping.php
@@ -40,7 +40,8 @@ protected function loadFormData() {
if (empty($data)) {
$data = $this->getItem();
$price = new PhocacartPrice();
- $data->cost = $price->cleanPrice($data->cost);
+ $data->cost = $price->cleanPrice($data->cost);
+ $data->cost_additional = $price->cleanPrice($data->cost_additional);
}
return $data;
}
@@ -54,6 +55,7 @@ protected function prepareTable($table) {
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
$table->cost = PhocacartUtils::replaceCommaWithPoint($table->cost);
+ $table->cost_additional = PhocacartUtils::replaceCommaWithPoint($table->cost_additional);
$table->lowest_weight = PhocacartUtils::replaceCommaWithPoint($table->lowest_weight);
$table->highest_weight = PhocacartUtils::replaceCommaWithPoint($table->highest_weight);
$table->lowest_volume = PhocacartUtils::replaceCommaWithPoint($table->lowest_volume);
diff --git a/phocacart.xml b/phocacart.xml
index b2b83b4f..997a2846 100644
--- a/phocacart.xml
+++ b/phocacart.xml
@@ -2,12 +2,12 @@
Phoca Cart
Jan Pavelka (www.phoca.cz)
- 17/05/2018
+ 10/08/2018
www.phoca.cz
Jan Pavelka
GNU/GPL
- 3.1.0
+ 3.1.1
Phoca Cart
install/script.php
@@ -86,6 +86,7 @@
+
diff --git a/site/controller.php b/site/controller.php
index 4639a0dc..9d3d0249 100644
--- a/site/controller.php
+++ b/site/controller.php
@@ -24,6 +24,7 @@ public function display($cachable = false, $urlparams = false)
$this->getView('feed', 'xml');
}*/
+
//$paramsC = JComponentHelper::getParams('com_phocacart');
$app = JFactory::getApplication();
$paramsC = $app->getParams();
diff --git a/site/controllers/pos.json.php b/site/controllers/pos.json.php
index b3aa29f6..bad92108 100644
--- a/site/controllers/pos.json.php
+++ b/site/controllers/pos.json.php
@@ -639,6 +639,25 @@ public function order() {
$app = JFactory::getApplication();
$item = array();
+
+ $item = array();
+ $item['amount_tendered'] = $this->input->get( 'phAmountTendered', '', 'string' );
+ $item['amount_pay'] = $this->input->get( 'phTotalAmount', '', 'string' );
+ //$item['amount_change'] = $this->input->get( 'phAmountChange', '', 'string' );
+
+
+ if ($item['amount_pay'] > 0 && $item['amount_tendered'] > 0) {
+ $item['amount_change'] = $item['amount_tendered'] - $item['amount_pay'];
+ } else if ($item['amount_pay'] > 0) {
+
+ $item['amount_tendered']= 0;
+ $item['amount_change'] = 0;
+ } else {
+ $item['amount_tendered']= 0;
+ $item['amount_pay'] = 0;
+ $item['amount_change'] = 0;
+ }
+
$params = $app->getParams();
$pos_server_print = $params->get( 'pos_server_print', 0 );
@@ -670,7 +689,7 @@ public function order() {
$order = new PhocacartOrder();
$order->setType(array(0,2));
- $orderMade = $order->saveOrderMain('');
+ $orderMade = $order->saveOrderMain($item);
if(!$orderMade) {
diff --git a/site/controllers/question.php b/site/controllers/question.php
index 7061ae30..7de3758e 100644
--- a/site/controllers/question.php
+++ b/site/controllers/question.php
@@ -54,11 +54,11 @@ function submit() {
// *** SECURITY
// Default session test always enabled!
- $valid = $session->get('form_id', NULL, 'phocacart');
- $session->clear('form_id', 'phocacart');
+ $valid = $session->get('form_id', NULL, $namespace);
+ $session->clear('form_id', $namespace);
if (!$valid){
$app->setUserState('com_phocacart.question.data', '');
- $session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ $session->clear('time', $namespace);
PhocacartLog::add(1, 'Ask a Question - Not valid session', $productId, 'IP: '. $data['ip'].', User ID: '.$user->id . ', User Name: '.$user->username);
//jexit(JText::_('COM_PHOCACART_POSSIBLE_SPAM_DETECTED'));
@@ -81,7 +81,7 @@ function submit() {
if ($params->get('hidden_field_id') == 'fieldnotvalid') {
$app->setUserState('com_phocacart.question.data', '');
- $session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ $session->clear('time', $namespace);
PhocacartLog::add(1, 'Ask a Question - Hidden Field Error', $productId, 'IP: '. $data['ip'].', User ID: '.$user->id . ', User Name: '.$user->unsername);
throw new Exception(JText::_('COM_PHOCACART_POSSIBLE_SPAM_DETECTED'), 500);
@@ -91,7 +91,7 @@ function submit() {
// Hidden field was filled
if (isset($data[$hiddenField]) && $data[$hiddenField] != '') {
$app->setUserState('com_phocacart.question.data', '');
- $session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ $session->clear('time', $namespace);
PhocacartLog::add(1, 'Ask a Question - Hidden Field Filled', $productId, 'IP: '. $data['ip'].', User ID: '.$user->id . ', User Name: '.$user->unsername);
throw new Exception(JText::_('COM_PHOCACART_POSSIBLE_SPAM_DETECTED'), 500);
@@ -122,7 +122,7 @@ function submit() {
}
if (($this->input->get('view') != 'question') || ($this->input->get('option') != 'com_phocacart') || ($task != 'submit')) {
$app->setUserState('com_phocacart.question.data', '');
- $session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ $session->clear('time', $namespace);
PhocacartLog::add(1, 'Ask a Question - No Phoca Cart part', $productId, 'IP: '. $data['ip'].', User ID: '.$user->id . ', User Name: '.$user->unsername);
throw new Exception(JText::_('COM_PHOCACART_POSSIBLE_SPAM_DETECTED'), 500);
@@ -132,7 +132,7 @@ function submit() {
// *** SECURITY
// Check Time
if((int)$params->get('enable_time_check_question', 0) > 0) {
- $time = $session->get('time', null, 'phccrt'.$params->get('session_suffix'));
+ $time = $session->get('time', null, $namespace);
$delta = time() - $time;
if($params->get('enable_time_check_question', 0) && $delta <= (int)$params->get('enable_time_check_question', 0)) {
@@ -160,7 +160,7 @@ function submit() {
//$app->redirect(JRoute::_($uri));
$app->setUserState('com_phocacart.question.data', '');
- $session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ $session->clear('time', $namespace);
PhocacartLog::add(1, 'Ask a Question - IP Ban', $productId, 'IP: '. $data['ip'].', User ID: '.$user->id . ', User Name: '.$user->unsername);
throw new Exception(JText::_('COM_PHOCACART_POSSIBLE_SPAM_DETECTED'), 500);
@@ -173,7 +173,7 @@ function submit() {
$form = $model->getForm();
if (!$form) {
$app->setUserState('com_phocacart.question.data', '');
- $session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ $session->clear('time', $namespace);
PhocacartLog::add(1, 'Ask a Question - Model not loaded', $productId, 'IP: '. $data['ip'].', User ID: '.$user->id . ', User Name: '.$user->unsername.', Message: '.$model->getError());
throw new Exception($model->getError(), 500);
@@ -205,7 +205,7 @@ function submit() {
/* if (($errors[$i] instanceof \Exception) && ($errors[$i]->getCode() == E_ERROR)) {
$app->setUserState('com_phocacart.question.data', '');
- $session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ $session->clear('time', $namespace);
PhocacartLog::add(1, 'Ask a Question - Validate errors', $productId, 'IP: '. $data['ip'].', User ID: '.$user->id . ', User Name: '.$user->username);
@@ -304,7 +304,7 @@ function submit() {
$msg = JText::_( 'COM_PHOCACART_THANK_YOU_FOR_LEAVING_INFORMATION_ASKING_QUESTION' );
} else {
$app->setUserState('com_phocacart.question.data', '');
- $session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ $session->clear('time', $namespace);
PhocacartLog::add(1, 'Ask a Question - Model store error', $productId, 'IP: '. $data['ip'].', User ID: '.$user->id . ', User Name: '.$user->unsername.', Message: '.$model->getError());
@@ -316,7 +316,7 @@ function submit() {
// Flush the data from the session
$app->setUserState('com_phocacart.question.data', '');
- //$session->clear('time', 'phccrt'.$params->get('session_suffix'));
+ //$session->clear('time', $namespace);
$app->setUserState('com_phocacart.question.data', 'success_post_saved');
$app->enqueueMessage($msg, 'success');
$this->setRedirect($uri->toString());
diff --git a/site/layouts/cart_cart.php b/site/layouts/cart_cart.php
index 135d0372..49ae58e6 100644
--- a/site/layouts/cart_cart.php
+++ b/site/layouts/cart_cart.php
@@ -13,6 +13,7 @@
// Component parameters params
// Module parameters paramsmodule
+$p = array();
$p['tax_calculation'] = $d['params']->get( 'tax_calculation', 0 );
$p['stock_checkout'] = $d['params']->get( 'stock_checkout', 0 );
$p['stock_checking'] = $d['params']->get( 'stock_checking', 0 );
diff --git a/site/layouts/cart_checkout.php b/site/layouts/cart_checkout.php
index 223defa1..0f11ccba 100644
--- a/site/layouts/cart_checkout.php
+++ b/site/layouts/cart_checkout.php
@@ -546,7 +546,6 @@
if (isset($pC['nettoformat']) && $pC['nettoformat'] != '' && isset($pC['nettotxt'])/* && $pC['nettotxt'] != '' can be empty */) {
- $pC['nettotxt'] = $pC['nettotxt'] != '' ? ' - ' : '';
echo '';
echo '
';
echo '
'.$pC['title']. PhocacartUtils::addSeparator($pC['nettotxt']).'
';
diff --git a/site/layouts/form_filter_checkbox.php b/site/layouts/form_filter_checkbox.php
index 2bd8a01a..2cb529a5 100644
--- a/site/layouts/form_filter_checkbox.php
+++ b/site/layouts/form_filter_checkbox.php
@@ -10,8 +10,13 @@
$d = $displayData;
$displayData = null;
$dParamAttr = str_replace(array('[',']'), '', $d['param']);
-?>
-
+
+
+// to hide as default
+// class="glyphicon glyphicon-triangle-bottom" ==> class="glyphicon glyphicon-triangle-right"
+// class="panel-collapse collapse in" ==> class="panel-collapse collapse"
+
+?>
diff --git a/site/layouts/form_search.php b/site/layouts/form_search.php
index 4658a14d..a6bf697c 100644
--- a/site/layouts/form_search.php
+++ b/site/layouts/form_search.php
@@ -15,13 +15,15 @@
$checkedAll = '';
$checkedFilter = '';
-$js = 'jQuery(document).ready(function(){'."\n";
+$js = ' '. "\n";
+$js .= 'jQuery(document).ready(function(){'."\n";
$js .= ' jQuery("#'.$d['id'].$d['paramname'].'").keyup(function(event){'."\n";
$js .= ' if(event.keyCode == 13){'."\n";
$js .= ' jQuery("#'.$d['id'].$d['paramname'].'Btn'.'").click();'."\n";
$js .= ' }'."\n";
$js .= ' });'."\n";
$js .= '});'."\n";
+$js .= ' '. "\n";
$document = JFactory::getDocument();
$document->addScriptDeclaration($js);
diff --git a/site/layouts/order.bak.php b/site/layouts/order.bak.php
new file mode 100644
index 00000000..d7d20cf6
--- /dev/null
+++ b/site/layouts/order.bak.php
@@ -0,0 +1,828 @@
+get( 'store_title', '' );
+$store_logo = $d['params']->get( 'store_logo', '' );
+$store_info = $d['params']->get( 'store_info', '' );
+$store_info = PhocacartRenderFront::renderArticle($store_info, $d['format']);
+//$invoice_prefix = $d['params']->get( 'invoice_prefix', '');
+//$invoice_number_format = $d['params']->get( 'invoice_number_format', '');
+//$invoice_number_chars = $d['params']->get( 'invoice_number_chars', 12);
+$invoice_tp = $d['params']->get( 'invoice_terms_payment', '');
+$display_discount_price_product = $d['params']->get( 'display_discount_price_product', 1);
+
+$store_title_pos = $d['params']->get( 'store_title_pos', '' );
+$store_logo_pos = $d['params']->get( 'store_logo_pos', '' );
+$store_info_pos = $d['params']->get( 'store_info_pos', '' );
+$store_info_footer_pos = $d['params']->get( 'store_info_footer_pos', '' );
+
+// Used in Phoca PDF Phocacart plugin because of converting the TCPDF QR code into html
+//$pdf_invoice_qr_code = $d['params']->get( 'pdf_invoice_qr_code', '' );
+$pdf_invoice_signature_image = $d['params']->get( 'pdf_invoice_signature_image', '' );
+$pdf_invoice_qr_information = $d['params']->get( 'pdf_invoice_qr_information', '' );
+$invoice_global_top_desc = $d['params']->get( 'invoice_global_top_desc', 0 );// Article ID
+$invoice_global_middle_desc = $d['params']->get( 'invoice_global_middle_desc', 0 );
+$invoice_global_bottom_desc = $d['params']->get( 'invoice_global_bottom_desc', 0 );
+/*
+ * FORMAT
+ */
+// FORMAT - HTML
+$box = 'class="ph-idnr-box"';
+$table = 'class="ph-idnr-box-in"';
+$pho1 = $pho12 = 'class="pho1"';
+$pho2 = $pho22 = 'class="pho2"';
+$pho3 = $pho32 = 'class="pho3"';
+$pho4 = $pho42 = 'class="pho4"';
+$pho5 = $pho52 = 'class="pho5"';
+$pho6 = $pho62 = 'class="pho6"';
+$pho7 = $pho72 = 'class="pho7"';
+$pho6Sep = $pho6Sep2 = 'class="pho6 ph-idnr-sep"';
+$pho7Sep = $pho7Sep2 = 'class="pho7 ph-idnr-sep"';
+$pho8 = $pho82 = 'class="pho8"';
+$pho9 = $pho92 = 'class="pho9"';
+$pho10 = $pho102 = 'class="pho10"';
+$pho11 = $pho112 = 'class="pho11"';
+$pho12 = $pho122 = 'class="pho12"';
+$sep = $sep2 = 'class="ph-idnr-sep"';
+$bBox = 'class="ph-idnr-billing-box"';
+$bBoxIn = 'class="ph-idnr-billing-box-in"';
+$sBox = 'class="ph-idnr-shipping-box"';
+$sBoxIn = 'class="ph-idnr-shipping-box-in"';
+$boxIn = 'class="ph-idnr-box-in"';
+$hProduct = 'class="ph-idnr-header-product"';
+$bProduct = 'class="ph-idnr-body-product"';
+$sepH = 'class="ph-idnr-sep-horizontal"';
+$totalF = 'class="ph-idnr-total"';
+$toPayS = 'class="ph-idnr-to-pay"';
+$toPaySV = 'class="ph-idnr-to-pay-value"';
+$bDesc = 'class="ph-idnr-body-desc"';
+$hrSmall = 'class="ph-idnr-hr-small"';
+$bQrInfo = '';
+$firstRow = '';
+
+
+// POS RECEIPT
+$pR = false;
+
+if ($d['format'] == 'raw' && $d['type'] == 4) {
+ $pR = true;
+ $oPr = array();
+ $pP = new PhocacartPosPrint(0);
+
+
+}
+
+if ($d['format'] == 'pdf') {
+ // FORMAT PDF
+ $box = '';
+ $table = 'style="width: 100%; font-size: 80%;padding:3px;margin-top:-200px"';
+ $pho1 = 'style="width: 8.3333%;"';
+ $pho2 = 'style="width: 8.3333%;"';
+ $pho3 = 'style="width: 8.3333%;"';
+ $pho4 = 'style="width: 8.3333%;"';
+ $pho5 = 'style="width: 8.3333%;"';
+ $pho6 = 'style="width: 8.3333%;"';
+ $pho7 = 'style="width: 8.3333%;"';
+ $pho6Sep = 'style="width: 3%;"';
+ $pho7Sep = 'style="width: 3%;"';
+ $pho8 = 'style="width: 8.3333%;"';
+ $pho9 = 'style="width: 8.3333%;"';
+ $pho10 = 'style="width: 8.3333%;"';
+ $pho11 = 'style="width: 8.3333%;"';
+ $pho12 = 'style="width: 8.3333%;"';
+ $sep = 'style="width: 3%;"';
+
+ $pho12 = 'style="width: 9%;"';
+ $pho22 = 'style="width: 9%;"';
+ $pho32 = 'style="width: 9%;"';
+ $pho42 = 'style="width: 9%;"';
+ $pho52 = 'style="width: 9%;"';
+ $pho62 = 'style="width: 9%;"';
+ $pho72 = 'style="width: 9%;"';
+ $pho6Sep2 = 'style="width: 5%;"';
+ $pho7Sep2 = 'style="width: 5%;"';
+ $pho82 = 'style="width: 9%;"';
+ $pho92 = 'style="width: 9%;"';
+ $pho102 = 'style="width: 9%;"';
+ $pho112 = 'style="width: 9%;"';
+ $pho122 = 'style="width: 9%;"';
+ $seps2 = 'style="width: 10%;"';
+
+
+ $bBox = 'style="border: 1pt solid #dddddd;"';
+ $bBoxIn = 'style=""';
+ $sBox = 'style="border: 1pt solid #dddddd;"';
+ $sBoxIn = 'style=""';
+ //$boxIn = 'style="width: 100%; font-family: sans-serif, arial; font-size: 60%;padding:3px 1px;"';
+ $boxIn = 'style="width: 100%; font-size: 60%;padding:1px 1px;"';
+ $hProduct = 'style="white-space:nowrap;font-weight: bold;background-color: #dddddd;"';
+ $bProduct = 'style="white-space:nowrap;"';
+ $sepH = 'style="border-top: 1pt solid #dddddd;"';
+ $totalF = 'style=""';
+ $toPayS = 'style="background-color: #eeeeee;padding: 20px;"';
+ $toPaySV = 'style="background-color: #eeeeee;padding: 20px;text-align:right;"';
+ $firstRow = 'style="font-size:0pt;"';
+
+ $bDesc = 'style="padding: 2px 0px 0px 0px;margin:0;font-size:60%;"';
+ $hrSmall = 'style="font-size:30%;"';
+ $bQrInfo = 'style="font-size: 70%"';
+
+} else if ($d['format'] == 'mail') {
+
+ // FORMAT EMAIL
+ $box = '';
+ //$table = 'style="width: 100%; font-family: sans-serif, arial; font-size: 90%;"';
+ $table = 'style="width: 100%; font-size: 90%;"';
+ $pho1 = 'style="width: 8.3333%;"';
+ $pho2 = 'style="width: 8.3333%;"';
+ $pho3 = 'style="width: 8.3333%;"';
+ $pho4 = 'style="width: 8.3333%;"';
+ $pho5 = 'style="width: 8.3333%;"';
+ $pho6 = 'style="width: 8.3333%;"';
+ $pho7 = 'style="width: 8.3333%;"';
+ $pho6Sep = 'style="width: 3%;"';
+ $pho7Sep = 'style="width: 3%;"';
+ $pho8 = 'style="width: 8.3333%;"';
+ $pho9 = 'style="width: 8.3333%;"';
+ $pho10 = 'style="width: 8.3333%;"';
+ $pho11 = 'style="width: 8.3333%;"';
+ $pho12 = 'style="width: 8.3333%;"';
+ $sep = 'style="width: 3%;"';
+
+ $pho12 = 'style="width: 9%;"';
+ $pho22 = 'style="width: 9%;"';
+ $pho32 = 'style="width: 9%;"';
+ $pho42 = 'style="width: 9%;"';
+ $pho52 = 'style="width: 9%;"';
+ $pho62 = 'style="width: 9%;"';
+ $pho72 = 'style="width: 9%;"';
+ $pho6Sep2 = 'style="width: 5%;"';
+ $pho7Sep2 = 'style="width: 5%;"';
+ $pho82 = 'style="width: 9%;"';
+ $pho92 = 'style="width: 9%;"';
+ $pho102 = 'style="width: 9%;"';
+ $pho112 = 'style="width: 9%;"';
+ $pho122 = 'style="width: 9%;"';
+ $seps2 = 'style="width: 10%;"';
+
+ $bBox = 'style="border: 1px solid #ddd;padding: 10px;"';
+ $bBoxIn = 'style=""';
+ $sBox = 'style="border: 1px solid #ddd;padding: 10px;"';
+ $sBoxIn = 'style=""';
+ //$boxIn = 'style="width: 100%; font-family: sans-serif, arial; font-size: 90%;"';
+ $boxIn = 'style="width: 100%; font-size: 90%;"';
+ $hProduct = 'style="white-space:nowrap;padding: 5px;font-weight: bold;background: #ddd;"';
+ $bProduct = 'style="white-space:nowrap;padding: 5px;"';
+ $sepH = 'style="border-top: 1px solid #ddd;"';
+ $totalF = 'style=""';
+ $toPayS = 'style="background-color: #eeeeee;padding: 20px;"';
+ $toPaySV = 'style="background-color: #eeeeee;padding: 20px;text-align:right;"';
+ $firstRow = '';
+
+}
+
+
+// -----------
+// R E N D E R
+// -----------
+$o = array();
+$o[] = '';
+
+
+// -----------
+// 1. PART
+// -----------
+$o[] = '
';
+
+$o[] = '';
+$o[] = ' | | | | ';
+$o[] = ' | | | | ';
+$o[] = ' | | | | ';
+$o[] = '
';
+
+
+// -----------
+// HEADER LEFT
+// -----------
+$o[] = '';
+if ($store_title != '') {
+ $o[] = ''.$store_title.'';
+}
+if ($store_logo != '') {
+ $o[] = '';
+}
+if ($store_info != '') {
+ $o[] = ''.$store_info.' ';
+}
+$o[] = ' | ';
+
+$o[] = ' | ';
+
+
+// -----------
+// HEADER RIGHT
+// -----------
+$o[] = '';
+if ($d['type'] == 1) {
+ $o[] = ''.JText::_('COM_PHOCACART_ORDER').'';
+ $o[] = ''.JText::_('COM_PHOCACART_ORDER_NR').': '.PhocacartOrder::getOrderNumber($d['common']->id, $d['common']->date, $d['common']->order_number).' ';
+ $o[] = ''.JText::_('COM_PHOCACART_ORDER_DATE').': '.JHtml::date($d['common']->date, 'DATE_FORMAT_LC4').' ';
+} else if ($d['type'] == 2) {
+
+ $o[] = ''.JText::_('COM_PHOCACART_INVOICE').'';
+ $o[] = ''.JText::_('COM_PHOCACART_INVOICE_NR').': '.PhocacartOrder::getInvoiceNumber($d['common']->id, $d['common']->date, $d['common']->invoice_number).' ';
+ $o[] = ''.JText::_('COM_PHOCACART_INVOICE_DATE').': '.JHtml::date($d['common']->invoice_date, 'DATE_FORMAT_LC4').' ';
+ $o[] = ''.JText::_('COM_PHOCACART_INVOICE_DUE_DATE').': '.PhocacartOrder::getInvoiceDueDate($d['common']->id, $d['common']->date, $d['common']->invoice_due_date, 'DATE_FORMAT_LC4').' ';
+ $o[] = ''.JText::_('COM_PHOCACART_PAYMENT_REFERENCE_NUMBER').': '.PhocacartOrder::getPaymentReferenceNumber($d['common']->id, $d['common']->date, $d['common']->invoice_prn).' ';
+
+} else if ($d['type'] == 3) {
+ $o[] = ''.JText::_('COM_PHOCACART_DELIVERY_NOTE').'';
+ $o[] = ''.JText::_('COM_PHOCACART_ORDER_NR').': '.PhocacartOrder::getOrderNumber($d['common']->id, $d['common']->date, $d['common']->order_number).' ';
+ $o[] = ''.JText::_('COM_PHOCACART_ORDER_DATE').': '.JHtml::date($d['common']->date, 'DATE_FORMAT_LC4').' ';
+
+}
+
+$o[] = ' ';
+if (isset($d['common']->paymenttitle) && $d['common']->paymenttitle != '') {
+ $o[] = ''.JText::_('COM_PHOCACART_PAYMENT').': '.$d['common']->paymenttitle.' ';
+}
+
+if ($d['type'] == 2 && $invoice_tp != '') {
+ $o[] = ''.JText::_('COM_PHOCACART_TERMS_OF_PAYMENT').': '.$invoice_tp.' ';
+}
+
+if (isset($d['common']->shippingtitle) && $d['common']->shippingtitle != '') {
+ $o[] = ''.JText::_('COM_PHOCACART_SHIPPING').': '.$d['common']->shippingtitle.' ';
+}
+
+$o[] = ' |
';
+
+$o[] = ' |
';
+
+
+// POS HEADER
+if ($pR) {
+ $oPr[] = $pP->printImage($store_logo_pos);
+}
+if ($pR) {
+ $storeTitlePos = array();
+ if ($store_title_pos != '') {
+ $storeTitlePos = explode("\n", $store_title_pos);
+ }
+ $oPr[] = $pP->printFeed(1);
+ $oPr[] = $pP->printLine($storeTitlePos, 'pDoubleSizeCenter');
+ $oPr[] = $pP->printFeed(1);
+}
+if ($pR) {
+ $storeInfoPos = array();
+ if ($store_info_pos != '') {
+ $storeInfoPos = explode("\n", $store_info_pos);
+ }
+ $oPr[] = $pP->printLine($storeInfoPos, 'pCenter');
+}
+
+
+
+
+// -----------
+// BILLING AND SHIPPING HEADER
+// -----------
+$o[] = ''.JText::_('COM_PHOCACART_BILLING_ADDRESS').' | ';
+$o[] = ' | ';
+$o[] = ''.JText::_('COM_PHOCACART_SHIPPING_ADDRESS').' |
';
+
+
+// -----------
+// BILLING
+// -----------
+$ob = array();
+
+if (!empty($d['bas']['b'])) {
+ $v = $d['bas']['b'];
+ if ($v['company'] != '') { $ob[] = ''.$v['company'].'
';}
+ $name = array();
+ if ($v['name_degree'] != '') { $name[] = $v['name_degree'];}
+ if ($v['name_first'] != '') { $name[] = $v['name_first'];}
+ if ($v['name_first'] != '') { $name[] = $v['name_middle'];}
+ if ($v['name_first'] != '') { $name[] = $v['name_last'];}
+ if (!empty($name)) {$ob[] = '' . implode("\n", $name).'
';}
+ if ($v['address_1'] != '') { $ob[] = $v['address_1'].'
';}
+ if ($v['address_2'] != '') { $ob[] = $v['address_2'].'
';}
+ $city = array();
+ if ($v['zip'] != '') { $city[] = $v['zip'];}
+ if ($v['city'] != '') { $city[] = $v['city'];}
+ if (!empty($city)) {$ob[] = implode("\n", $city).'
';}
+ //echo '
';
+ if (!empty($v['regiontitle'])) {$ob[] = $v['regiontitle'].'
';}
+ if (!empty($v['countrytitle'])) {$ob[] = $v['countrytitle'].'
';}
+ //echo '
';
+ if ($v['vat_1'] != '') { $ob[] = '
'.JText::_('COM_PHOCACART_VAT1').': '. $v['vat_1'].'
';}
+ if ($v['vat_2'] != '') { $ob[] = JText::_('COM_PHOCACART_VAT2').': '.$v['vat_2'].'
';}
+
+
+}
+
+
+// -----------
+// SHIPPING
+// -----------
+$os = array();
+if (!empty($d['bas']['s'])) {
+ $v = $d['bas']['s'];
+ if ($v['company'] != '') { $os[] = ''.$v['company'].'
';}
+ $name = array();
+ if ($v['name_degree'] != '') { $name[] = $v['name_degree'];}
+ if ($v['name_first'] != '') { $name[] = $v['name_first'];}
+ if ($v['name_first'] != '') { $name[] = $v['name_middle'];}
+ if ($v['name_first'] != '') { $name[] = $v['name_last'];}
+ if (!empty($name)) {$os[] = '' . implode("\n", $name).'
';}
+ if ($v['address_1'] != '') { $os[] = $v['address_1'].'
';}
+ if ($v['address_2'] != '') { $os[] = $v['address_2'].'
';}
+ $city = array();
+ if ($v['zip'] != '') { $city[] = $v['zip'];}
+ if ($v['city'] != '') { $city[] = $v['city'];}
+ if (!empty($city)) {$os[] = implode("\n", $city).'
';}
+ //echo '
';
+ if (!empty($v['regiontitle'])) {$os[] = $v['regiontitle'].'
';}
+ if (!empty($v['countrytitle'])) {$os[] = $v['countrytitle'].'
';}
+ //echo '
';
+ if ($v['vat_1'] != '') { $os[] = '
'.JText::_('COM_PHOCACART_VAT1').': '. $v['vat_1'].'
';}
+ if ($v['vat_2'] != '') { $os[] = JText::_('COM_PHOCACART_VAT2').': '.$v['vat_2'].'
';}
+}
+
+
+// BILLING OUTPUT
+$o[] = '';
+$o[] = implode("\n", $ob);
+$o[] = ' | ';
+$o[] = ' | ';
+
+
+// SHIPPING OUTPUT
+$o[] = '';
+if ((isset($d['bas']['b']['ba_sa']) && $d['bas']['b']['ba_sa'] == 1) || (isset($d['bas']['s']['ba_sa']) && $d['bas']['s']['ba_sa'] == 1)) {
+ $o[] = implode("\n", $ob);
+} else {
+ $o[] = implode("\n", $os);
+}
+$o[] = ' |
';
+//$o[] = ' |
';
+$o[] = '
';
+
+
+// -----------------------
+// INVOICE TOP DESCRIPTION
+// -----------------------
+$hrSmallTop = 0;
+if ($d['type'] == 2) {
+ if ((int)$invoice_global_top_desc > 0) {
+ $invoice_global_top_desc_article = PhocacartRenderFront::renderArticle((int)$invoice_global_top_desc);
+ if ($invoice_global_top_desc_article != '') {
+ $o[] = '
';
+ $hrSmallTop = 1;
+ $invoice_global_top_desc_article = PhocacartPdf::skipStartAndLastTag($invoice_global_top_desc_article, 'p');
+ //$o[] = '
'.$invoice_global_top_desc_article.'
';
+ $o[] = '
'.$invoice_global_top_desc_article.' |
';
+ }
+ }
+ if ($d['common']->invoice_spec_top_desc != '') {
+ $o[] = $hrSmallTop == 1 ? '' : '
';
+ $invoice_spec_top_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_top_desc, 'p');
+ //$o[] = '
'.$invoice_spec_top_desc_article.'
';
+ $o[] = '
'.$invoice_spec_top_desc_article.' |
';
+ }
+}
+
+
+// -----------
+// 2. PART
+// -----------
+$o[] = '
';
+$o[] = '';
+$o[] = ' | | | | ';
+$o[] = ' | | | | ';
+$o[] = ' | | | | ';
+$o[] = '
';
+
+
+$dDiscount = 0; // Display Discount (Coupon, cnetto)
+$cTitle = 3; // Colspan Title
+
+
+$p = array();
+if (!empty($d['products'])) {
+
+ // Prepare header and body
+ foreach ($d['products'] as $k => $v) {
+ if ($v->damount > 0) {
+ $dDiscount = 1;
+ $cTitle = 2;
+ }
+ }
+
+ if ($d['type'] == 3) {
+ $cTitle = 10;
+ }
+
+ $p[] = '';
+ $p[] = ''.JText::_('COM_PHOCACART_SKU').' | ';
+ $p[] = ''.JText::_('COM_PHOCACART_ITEM').' | ';
+ $p[] = ''.JText::_('COM_PHOCACART_QTY').' | ';
+
+ if ($d['type'] != 3) {
+ $p[] = ''.JText::_('COM_PHOCACART_PRICE_UNIT').' | ';
+ if ($dDiscount == 1) {
+ $p[] = ''.JText::_('COM_PHOCACART_DISCOUNT').' | ';
+ }
+ $p[] = ''.JText::_('COM_PHOCACART_PRICE_EXCL_TAX').' | ';
+ $p[] = ''.JText::_('COM_PHOCACART_TAX').' | ';
+ $p[] = ''.JText::_('COM_PHOCACART_PRICE_INCL_TAX').' | ';
+ }
+ $p[] = '
';
+
+ if ($pR) { $oPr[] = $pP->printSeparator(); }
+
+ foreach($d['products'] as $k => $v) {
+
+ // $codes = PhocacartProduct::getProductCodes((int)$v->product_id);
+ // echo $codes['isbn']; getting codes like isbn, ean, jpn, serial_number from product
+ // codes are the latest stored in database not codes which were valid in date of order
+ $p[] = '';
+ $p[] = ''.$v->sku.' | ';
+ $p[] = ''.$v->title.' | ';
+
+ if ($pR) { $oPr[] = $pP->printLineColumns(array($v->sku, $v->title), 1); }
+
+ $p[] = ''.$v->quantity.' | ';
+
+
+ $netto = (int)$v->quantity * $v->netto;
+ $nettoUnit = $v->netto;
+ $tax = (int)$v->quantity * $v->tax;
+ $brutto = (int)$v->quantity * $v->brutto;
+ if ($d['type'] != 3) {
+ $p[] = ''.$d['price']->getPriceFormat($v->netto).' | ';
+
+ /*if ($dDiscount == 1) {
+ if ($v->dtype == 0) {
+ $dAmount = $v->netto - $v->dnetto;
+ if ($dAmount > 0 && $v->dnetto > 0) {
+ $dAmount = '- '. $d['price']->getPriceFormat($dAmount);
+ } else {
+ $dAmount = '';
+ }
+ } else if ($v->dtype == 1) {
+ if ($v->damount > 0) {
+ $dAmount = $v->damount . ' %';
+ } else {
+ $dAmount = '';
+ }
+ }
+ $p[] = ''.$dAmount.' | ';
+ }
+
+ if ($v->dnetto > 0 ) {
+ $netto = (int)$v->quantity * $v->dnetto;
+ } else {
+ $netto = (int)$v->quantity * $v->netto;
+ }*/
+
+ $p[] = ''.$d['price']->getPriceFormat($netto).' | ';
+ /*
+ if ($v->dtax > 0) {
+ $tax = (int)$v->quantity * $v->dtax;
+ } else {
+ $tax = (int)$v->quantity * $v->tax;
+ }*/
+
+ $p[] = ''.$d['price']->getPriceFormat($tax).' | ';
+ /*
+ if ($v->dbrutto > 0) {
+ $brutto = (int)$v->quantity * $v->dbrutto;
+ } else {
+ $brutto = (int)$v->quantity * $v->brutto;
+ }*/
+
+ $p[] = ''.$d['price']->getPriceFormat($brutto).' | ';
+
+ }
+ $p[] = '
';
+
+
+
+
+ if (!empty($v->attributes)) {
+ $p[] = '';
+ $p[] = ' | ';
+ $p[] = '';
+ foreach ($v->attributes as $k2 => $v2) {
+ $p[] = '- '.$v2->attribute_title .' '.$v2->option_title.'
';
+
+ if ($pR) { $oPr[] = $pP->printLineColumns(array(' - ' .$v2->attribute_title .' '.$v2->option_title)); }
+
+ }
+ $p[] = ' | ';
+ $p[] = ' | ';
+ $p[] = '
';
+ }
+
+ if ($pR) {
+ $brutto = (int)$v->quantity * $v->brutto;
+ $oPr[] = $pP->printLineColumns(array((int)$v->quantity . ' x ' . $d['price']->getPriceFormat($v->brutto), $d['price']->getPriceFormat($brutto)));
+ }
+
+ $lastSaleNettoUnit = array();
+ $lastSaleNetto = array();
+ $lastSaleTax = array();
+ $lastSaleBrutto = array();
+ if (!empty($d['discounts'][$v->product_id_key]) && $d['type'] != 3) {
+
+ $lastSaleNettoUnit[$v->product_id_key] = $nettoUnit;
+ $lastSaleNetto[$v->product_id_key] = $netto;
+ $lastSaleTax[$v->product_id_key] = $tax;
+ $lastSaleBrutto[$v->product_id_key] = $brutto;
+
+
+ foreach($d['discounts'][$v->product_id_key] as $k3 => $v3) {
+
+ $nettoUnit3 = $v3->netto;
+ $netto3 = (int)$v->quantity * $v3->netto;
+ $tax3 = (int)$v->quantity * $v3->tax;
+ $brutto3 = (int)$v->quantity * $v3->brutto;
+
+ $saleNettoUnit = $lastSaleNettoUnit[$v->product_id_key] - $nettoUnit3;
+ $saleNetto = $lastSaleNetto[$v->product_id_key] - $netto3;
+ $saleTax = $lastSaleTax[$v->product_id_key] - $tax3;
+ $saleBrutto = $lastSaleBrutto[$v->product_id_key] - $brutto3;
+
+ $lastSaleNettoUnit[$v->product_id_key] = $nettoUnit3;
+ $lastSaleNetto[$v->product_id_key] = $netto3;
+ $lastSaleTax[$v->product_id_key] = $tax3;
+ $lastSaleBrutto[$v->product_id_key] = $brutto3;
+
+ if ($display_discount_price_product == 2) {
+
+ $p[] = '';
+ $p[] = ' | ';
+ $p[] = ''.$v3->title.' | ';
+ $p[] = ' | ';
+ $p[] = ''.$d['price']->getPriceFormat($saleNettoUnit, 1).' | ';
+ $p[] = ''.$d['price']->getPriceFormat($saleNetto, 1).' | ';
+ $p[] = ''.$d['price']->getPriceFormat($saleTax, 1).' | ';
+ $p[] = ''.$d['price']->getPriceFormat($saleBrutto, 1).' | ';
+ $p[] = '
';
+
+ if ($pR) {
+ $oPr[] = $pP->printLineColumns(array($v3->title, $d['price']->getPriceFormat($saleBrutto, 1)));
+ }
+ } else if ($display_discount_price_product == 1) {
+
+ $p[] = '';
+ $p[] = ' | ';
+ $p[] = ''.$v3->title.' | ';
+ $p[] = ' | ';
+ $p[] = ''.$d['price']->getPriceFormat($nettoUnit3).' | ';
+ $p[] = ''.$d['price']->getPriceFormat($netto3).' | ';
+ $p[] = ''.$d['price']->getPriceFormat($tax3).' | ';
+ $p[] = ''.$d['price']->getPriceFormat($brutto3).' | ';
+ $p[] = '
';
+
+ if ($pR) {
+ $oPr[] = $pP->printLineColumns(array($v3->title, $d['price']->getPriceFormat($brutto3)));
+ }
+ }
+
+ }
+ }
+
+ }
+
+ if ($pR) { $oPr[] = $pP->printSeparator(); }
+
+}
+
+$o[] = implode("\n", $p);
+
+
+
+$o[] = ' |
';
+
+
+// -----------
+// TOTAL
+// -----------
+$t = array();
+$toPay = 0;
+
+if (!empty($d['total'])) {
+ foreach($d['total'] as $k => $v) {
+
+ if($v->amount == 0 && $v->amount_currency == 0 && $v->type != 'brutto') {
+ // Don't display coupon if null
+
+ } else if ($v->type == 'netto') {
+ $t[] = '';
+ $t[] = ' | ';
+ $t[] = ''.$v->title.' | ';
+ $t[] = ''.$d['price']->getPriceFormat($v->amount).' | ';
+ $t[] = '
';
+
+ if ($pR) { $oPr[] = $pP->printLineColumns(array($v->title, $d['price']->getPriceFormat($v->amount))); }
+
+ } else if ($v->type == 'brutto') {
+
+ // Brutto or Brutto currency
+ $amount = (isset($v->amount_currency) && $v->amount_currency > 0) ? $d['price']->getPriceFormat($v->amount_currency, 0, 1) : $d['price']->getPriceFormat($v->amount);
+
+ $t[] = '';
+ $t[] = ' | ';
+ $t[] = ''.$v->title.' | ';
+ $t[] = ''.$amount.' | ';
+ $t[] = '
';
+
+
+ if ($pR) {
+ $oPr[] = $pP->printSeparator();
+ $oPr[] = $pP->printLineColumns(array($v->title, $amount), 0, 'pDoubleSize');
+ $oPr[] = $pP->printFeed(2);
+ }
+
+ } else if ($v->type == 'rounding') {
+
+ // Rounding or rounding currency
+ $amount = (isset($v->amount_currency) && $v->amount_currency > 0) ? $d['price']->getPriceFormat($v->amount_currency, 0, 1) : $d['price']->getPriceFormat($v->amount);
+
+ $t[] = '';
+ $t[] = ' | ';
+ $t[] = ''.$v->title.' | ';
+ $t[] = ''.$amount.' | ';
+ $t[] = '
';
+
+ if ($pR) { $oPr[] = $pP->printLineColumns(array($v->title, $amount)); }
+
+
+ } else {
+ $t[] = '';
+ $t[] = ' | ';
+ $t[] = ''.$v->title.' | ';
+ $t[] = ''.$d['price']->getPriceFormat($v->amount).' | ';
+ $t[] = '
';
+
+ if ($pR) { $oPr[] = $pP->printLineColumns(array($v->title, $d['price']->getPriceFormat($v->amount))); }
+ }
+
+ if ($v->type == 'brutto' && $d['type'] == 2) {
+ $toPay = $v->amount;
+ }
+ }
+}
+
+if ($d['type'] != 3) {
+ $o[] = implode("\n", $t);
+}
+
+
+$o[] = ' |
';
+
+// -----------
+// TO PAY
+// -----------
+if ($toPay > 0) {
+ $o[] = '';
+ $o[] = ' | ';
+ $o[] = ''.JText::_('COM_PHOCACART_TO_PAY').' | ';
+ $o[] = ''.$d['price']->getPriceFormat($toPay).' | ';
+ $o[] = '
';
+}
+
+
+$o[] = '
';// End box in
+
+
+// -----------------------
+// INVOICE MIDDLE DESCRIPTION
+// -----------------------
+$hrSmallMiddle = 0;
+if ($d['type'] == 2) {
+ if ((int)$invoice_global_middle_desc > 0) {
+ $invoice_global_middle_desc_article = PhocacartRenderFront::renderArticle((int)$invoice_global_middle_desc);
+ if ($invoice_global_middle_desc_article != '') {
+ $o[] = '
';
+ $hrSmallMiddle = 1;
+ $invoice_global_middle_desc_article = PhocacartPdf::skipStartAndLastTag($invoice_global_middle_desc_article, 'p');
+ //$o[] = '
'.$invoice_global_middle_desc_article.'
';
+ $o[] = '
'.$invoice_global_middle_desc_article.' |
';
+ }
+ }
+ if ($d['common']->invoice_spec_middle_desc != '') {
+ $o[] = $hrSmallMiddle == 1 ? '' : '
';
+ $invoice_spec_middle_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_middle_desc, 'p');
+ //$o[] = '
'.$invoice_spec_middle_desc_article.'
';
+ $o[] = '
'.$invoice_spec_middle_desc_article.' |
';
+ }
+}
+
+
+// -----------------------
+// INVOICE QR CODE, STAMP IMAGE
+// -----------------------
+if ($d['format'] == 'pdf' && $d['type'] == 2 && ($d['qrcode'] != '' || $pdf_invoice_signature_image != '')) {
+ $o[] = '
';
+ $o[] = '
';// End box in
+ $o[] = '';
+
+
+ if ($pdf_invoice_qr_information != '') {
+ $o[] = ''.$pdf_invoice_qr_information . ' ';
+ }
+
+ if ($d['qrcode'] != '') {
+ $o[] = '{phocapdfqrcode|'.urlencode($d['qrcode']).'}';
+ }
+ $o[] = ' | ';
+ if ($pdf_invoice_signature_image != '') {
+ $o[] = '';
+ }
+ $o[] = ' |
';
+ $o[] = '
';
+}
+
+// -----------------------
+// INVOICE BOTTOM DESCRIPTION
+// -----------------------
+$hrSmallBottom = 0;
+if ($d['type'] == 2) {
+ if ((int)$invoice_global_bottom_desc > 0) {
+ $invoice_global_bottom_desc_article = PhocacartRenderFront::renderArticle((int)$invoice_global_bottom_desc);
+ if ($invoice_global_bottom_desc_article != '') {
+ $o[] = '
';
+ $hrSmallBottom = 1;
+ $invoice_global_bottom_desc_article = PhocacartPdf::skipStartAndLastTag($invoice_global_bottom_desc_article, 'p');
+ //$o[] = '
'.$invoice_global_bottom_desc_article.'
';
+ $o[] = '
'.$invoice_global_bottom_desc_article.' |
';
+ }
+ }
+ if ($d['common']->invoice_spec_bottom_desc != '') {
+ $o[] = $hrSmallBottom == 1 ? '' : '
';
+ $invoice_spec_bottom_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_bottom_desc, 'p');
+ //$o[] = '
'.$invoice_spec_bottom_desc_article.'
';
+ $o[] = '
'.$invoice_spec_bottom_desc_article.' |
';
+ }
+}
+
+
+
+$o[] = '
';// End box
+
+
+// POS FOOTER
+if ($pR) {
+
+
+ $oPr[] = $pP->printLine(array(JText::_('COM_PHOCACART_RECEIPT_NR').': '.PhocacartOrder::getReceiptNumber($d['common']->id, $d['common']->date, $d['common']->receipt_number)), 'pLeft');
+ $oPr[] = $pP->printLine(array(JText::_('COM_PHOCACART_PURCHASE_DATE').': '.JHtml::date($d['common']->date, 'DATE_FORMAT_LC5')), 'pLeft');
+ $oPr[] = $pP->printFeed(1);
+
+ $storeInfoFooterPos = array();
+ if ($store_info_footer_pos != '') {
+ $storeInfoFooterPos = explode("\n", $store_info_footer_pos);
+ }
+ $oPr[] = $pP->printLine($storeInfoFooterPos, 'pCenter');
+}
+
+if ($pR) {
+ //$oPr2 = implode("\n", $oPr);
+ $oPr2 = implode("", $oPr);// new rows set in print library
+ echo $oPr2;
+} else {
+ $o2 = implode("\n", $o);
+ echo $o2;
+}
+
+
+?>
\ No newline at end of file
diff --git a/site/layouts/order.php b/site/layouts/order.php
index a2c02319..5a9778f3 100644
--- a/site/layouts/order.php
+++ b/site/layouts/order.php
@@ -31,7 +31,7 @@
$store_info = $d['params']->get( 'store_info', '' );
$store_info = PhocacartRenderFront::renderArticle($store_info, $d['format']);
//$invoice_prefix = $d['params']->get( 'invoice_prefix', '');
-//$invoice_number_format = $d['params']->get( 'invoice_number_format', '{prefix}{orderdate}{orderid}');
+//$invoice_number_format = $d['params']->get( 'invoice_number_format', '');
//$invoice_number_chars = $d['params']->get( 'invoice_number_chars', 12);
$invoice_tp = $d['params']->get( 'invoice_terms_payment', '');
$display_discount_price_product = $d['params']->get( 'display_discount_price_product', 1);
@@ -402,7 +402,14 @@
// -----------------------
$hrSmallTop = 0;
if ($d['type'] == 2) {
- if ((int)$invoice_global_top_desc > 0) {
+
+
+ if ($d['common']->invoice_spec_top_desc != '') {
+ $o[] = $hrSmallTop == 1 ? '' : '
';
+ $invoice_spec_top_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_top_desc, 'p');
+ //$o[] = ''.$invoice_spec_top_desc_article.'
';
+ $o[] = ''.$invoice_spec_top_desc_article.' |
';
+ } else if ((int)$invoice_global_top_desc > 0) {
$invoice_global_top_desc_article = PhocacartRenderFront::renderArticle((int)$invoice_global_top_desc);
if ($invoice_global_top_desc_article != '') {
$o[] = '
';
@@ -412,12 +419,6 @@
$o[] = '
'.$invoice_global_top_desc_article.' |
';
}
}
- if ($d['common']->invoice_spec_top_desc != '') {
- $o[] = $hrSmallTop == 1 ? '' : '
';
- $invoice_spec_top_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_top_desc, 'p');
- //$o[] = '
'.$invoice_spec_top_desc_article.'
';
- $o[] = '
'.$invoice_spec_top_desc_article.' |
';
- }
}
@@ -726,7 +727,13 @@
// -----------------------
$hrSmallMiddle = 0;
if ($d['type'] == 2) {
- if ((int)$invoice_global_middle_desc > 0) {
+
+ if ($d['common']->invoice_spec_middle_desc != '') {
+ $o[] = $hrSmallMiddle == 1 ? '' : '
';
+ $invoice_spec_middle_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_middle_desc, 'p');
+ //$o[] = '
'.$invoice_spec_middle_desc_article.'
';
+ $o[] = '
'.$invoice_spec_middle_desc_article.' |
';
+ } else if ((int)$invoice_global_middle_desc > 0) {
$invoice_global_middle_desc_article = PhocacartRenderFront::renderArticle((int)$invoice_global_middle_desc);
if ($invoice_global_middle_desc_article != '') {
$o[] = '
';
@@ -736,12 +743,6 @@
$o[] = '
'.$invoice_global_middle_desc_article.' |
';
}
}
- if ($d['common']->invoice_spec_middle_desc != '') {
- $o[] = $hrSmallMiddle == 1 ? '' : '
';
- $invoice_spec_middle_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_middle_desc, 'p');
- //$o[] = '
'.$invoice_spec_middle_desc_article.'
';
- $o[] = '
'.$invoice_spec_middle_desc_article.' |
';
- }
}
@@ -773,7 +774,13 @@
// -----------------------
$hrSmallBottom = 0;
if ($d['type'] == 2) {
- if ((int)$invoice_global_bottom_desc > 0) {
+
+ if ($d['common']->invoice_spec_bottom_desc != '') {
+ $o[] = $hrSmallBottom == 1 ? '' : '
';
+ $invoice_spec_bottom_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_bottom_desc, 'p');
+ //$o[] = '
'.$invoice_spec_bottom_desc_article.'
';
+ $o[] = '
'.$invoice_spec_bottom_desc_article.' |
';
+ } else if ((int)$invoice_global_bottom_desc > 0) {
$invoice_global_bottom_desc_article = PhocacartRenderFront::renderArticle((int)$invoice_global_bottom_desc);
if ($invoice_global_bottom_desc_article != '') {
$o[] = '
';
@@ -783,12 +790,6 @@
$o[] = '
'.$invoice_global_bottom_desc_article.' |
';
}
}
- if ($d['common']->invoice_spec_bottom_desc != '') {
- $o[] = $hrSmallBottom == 1 ? '' : '
';
- $invoice_spec_bottom_desc_article = PhocacartPdf::skipStartAndLastTag($d['common']->invoice_spec_bottom_desc, 'p');
- //$o[] = '
'.$invoice_spec_bottom_desc_article.'
';
- $o[] = '
'.$invoice_spec_bottom_desc_article.' |
';
- }
}
@@ -799,6 +800,16 @@
// POS FOOTER
if ($pR) {
+
+
+ if (isset($d['common']->amount_tendered) && $d['common']->amount_tendered > 0 && isset($d['common']->amount_change) && ($d['common']->amount_change > 0 || $d['common']->amount_change == 0)) {
+ //$oPr[] = $pP->printLine(array(JText::_('COM_PHOCACART_RECEIPT_AMOUNT_TENDERED').': '.$d['price']->getPriceFormat($d['common']->amount_tendered)), 'pLeft');
+ //$oPr[] = $pP->printLine(array(JText::_('COM_PHOCACART_RECEIPT_AMOUNT_CHANGED').': '.$d['price']->getPriceFormat($d['common']->amount_change)), 'pLeft');
+ $oPr[] = $pP->printLineColumns(array(JText::_('COM_PHOCACART_RECEIPT_AMOUNT_TENDERED').': ', $d['price']->getPriceFormat($d['common']->amount_tendered)));
+ $oPr[] = $pP->printLineColumns(array(JText::_('COM_PHOCACART_RECEIPT_AMOUNT_CHANGED').': ', $d['price']->getPriceFormat($d['common']->amount_change)));
+ $oPr[] = $pP->printFeed(1);
+ }
+
$oPr[] = $pP->printLine(array(JText::_('COM_PHOCACART_RECEIPT_NR').': '.PhocacartOrder::getReceiptNumber($d['common']->id, $d['common']->date, $d['common']->receipt_number)), 'pLeft');
$oPr[] = $pP->printLine(array(JText::_('COM_PHOCACART_PURCHASE_DATE').': '.JHtml::date($d['common']->date, 'DATE_FORMAT_LC5')), 'pLeft');
diff --git a/site/models/category.php b/site/models/category.php
index 5ded910e..3a2aef62 100644
--- a/site/models/category.php
+++ b/site/models/category.php
@@ -130,8 +130,9 @@ protected function getItemListQuery($categoryId, $count = 0) {
$wheres[] = " c.type IN (0,1)";// type: common, onlineshop, pos
if ($this->getState('filter.language')) {
- $wheres[] = ' a.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
+ $lang = JFactory::getLanguage()->getTag();
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('a.language', $lang);
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
$itemOrdering = $this->getItemOrdering();
@@ -237,7 +238,8 @@ protected function getCategoriesQuery($categoryId, $subcategories = FALSE) {
$wheres[] = " c.type IN (0,1)";// type: common, onlineshop, pos
if ($this->getState('filter.language')) {
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
+ $lang = JFactory::getLanguage()->getTag();
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
if ($subcategories) {
diff --git a/site/models/item.php b/site/models/item.php
index 6fb79331..dbefab03 100644
--- a/site/models/item.php
+++ b/site/models/item.php
@@ -91,8 +91,9 @@ private function getItemQueryOrdering($ordering, $catid, $direction) {
$wheres[] = " (gc.group_id IN (".$userGroups.") OR gc.group_id IS NULL)";
if ($this->getState('filter.language')) {
- $wheres[] = ' a.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
+ $lang = JFactory::getLanguage()->getTag();
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('a.language', $lang);
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
if ($p['hide_products_out_of_stock'] == 1) {
@@ -206,8 +207,9 @@ function getCategoryQuery($itemId, $catId) {
$wheres[] = " c.type IN (0,1)";// type: common, onlineshop, pos
if ($this->getState('filter.language')) {
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
+ $lang = JFactory::getLanguage()->getTag();
+ //$wheres[] = PhocacartUtilsSettings::getLangQuery('a.language', $lang);
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
if ((int)$catId > 0) {
diff --git a/site/models/items.php b/site/models/items.php
index 5afe7bc2..90b447b2 100644
--- a/site/models/items.php
+++ b/site/models/items.php
@@ -133,8 +133,9 @@ protected function getItemListQuery($count = 0) {
if ($this->getState('filter.language')) {
- $wheres[] = ' a.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
+ $lang = JFactory::getLanguage()->getTag();
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('a.language', $lang);
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
$itemOrdering = $this->getItemOrdering();
@@ -312,7 +313,8 @@ protected function getCategoriesQuery( $categoryId, $subcategories = FALSE ) {
$wheres[] = " (gc.group_id IN (".$userGroups.") OR gc.group_id IS NULL)";
if ($this->getState('filter.language')) {
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
+ $lang = JFactory::getLanguage()->getTag();
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
if ($subcategories) {
diff --git a/site/models/pos.php b/site/models/pos.php
index 54bdf325..d42a8092 100644
--- a/site/models/pos.php
+++ b/site/models/pos.php
@@ -251,8 +251,11 @@ protected function getItemListQuery($count = 0) {
$wheres[] = ' c.published = 1';
$wheres[] = ' c.type IN (0,2)';// default categories or pos categories only
if ($this->getState('filter.language')) {
- $wheres[] = ' a.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
+
+
+ $lang = JFactory::getLanguage()->getTag();
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('a.language', $lang);
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
$itemOrdering = $this->getItemOrdering();
@@ -657,7 +660,9 @@ protected function getCategoriesQuery( $categoryId, $subcategories = FALSE ) {
$wheres[] = " (gc.group_id IN (".$userGroups.") OR gc.group_id IS NULL)";
if ($this->getState('filter.language')) {
- $wheres[] = ' c.language IN ('.$this->_db->Quote(JFactory::getLanguage()->getTag()).','.$this->_db->Quote('*').')';
+ $lang = JFactory::getLanguage()->getTag();
+
+ $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang);
}
if ($subcategories) {
diff --git a/site/views/category/tmpl/default.php b/site/views/category/tmpl/default.php
index d71051ec..ec64621b 100644
--- a/site/views/category/tmpl/default.php
+++ b/site/views/category/tmpl/default.php
@@ -424,11 +424,7 @@
echo $icon['addtocart'];
}
- if ($this->t['cv_display_description'] == 1 && $v->description != '') {
- echo '
';
- echo JHtml::_('content.prepare', $v->description);
- echo '
';// end desc
- }
+
// REVIEW - STAR RATING
if ((int)$this->t['display_star_rating'] > 0) {
@@ -439,6 +435,12 @@
echo $layoutR->render($d);
}
+ if ($this->t['cv_display_description'] == 1 && $v->description != '') {
+ echo '
';
+ echo JHtml::_('content.prepare', $v->description);
+ echo '
';// end desc
+ }
+
// VIEW PRODUCT BUTTON
echo '
';
@@ -526,11 +528,7 @@
//echo '
';// end caption
- if ($this->t['cv_display_description'] == 1 && $v->description != '') {
- echo '
';
- echo JHtml::_('content.prepare', $v->description);
- echo '
';// end desc
- }
+
// REVIEW - STAR RATING
if ((int)$this->t['display_star_rating'] > 0) {
@@ -541,6 +539,12 @@
echo $layoutR->render($d);
}
+ if ($this->t['cv_display_description'] == 1 && $v->description != '') {
+ echo '
';
+ echo JHtml::_('content.prepare', $v->description);
+ echo '
';// end desc
+ }
+
echo '
';
// :L: PRICE
diff --git a/site/views/checkout/tmpl/default_payment.php b/site/views/checkout/tmpl/default_payment.php
index a5de0732..a6e5a788 100644
--- a/site/views/checkout/tmpl/default_payment.php
+++ b/site/views/checkout/tmpl/default_payment.php
@@ -105,7 +105,7 @@
$checked = 'checked="checked"';
}
- $priceI = $price->getPriceItemsPayment($v->cost, $v->calculation_type, $total[0], $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1, '');
+ $priceI = $price->getPriceItemsPayment($v->cost, $v->cost_additional, $v->calculation_type, $total[0], $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1, '');
echo '
';
echo '
';
@@ -122,6 +122,8 @@
echo '
';
+
+
if ($this->t['display_payment_desc'] && $v->description != '') {
echo '
'.JHtml::_('content.prepare', $v->description).'
';
}
@@ -154,6 +156,12 @@
echo '
'.$priceI['bruttotxt'].'
';
echo '
'.$priceI['bruttoformat'].'
';
}
+
+ if ($priceI['costinfo'] != '') {
+ echo '
';
+ echo '
'.$priceI['costinfo'].'
';
+
+ }
}
echo '
';
diff --git a/site/views/checkout/tmpl/default_shipping.php b/site/views/checkout/tmpl/default_shipping.php
index 9f5e5e11..07e2049c 100644
--- a/site/views/checkout/tmpl/default_shipping.php
+++ b/site/views/checkout/tmpl/default_shipping.php
@@ -81,7 +81,7 @@
echo '
';
- if ($this->t['shippingmethod']['image'] != '') {
+ if (isset($this->t['shippingmethod']['image']) && $this->t['shippingmethod']['image'] != '') {
echo '
';
}
@@ -143,7 +143,7 @@
$checked = 'checked="checked"';
}
- $priceI = $price->getPriceItemsShipping($v->cost, $v->calculation_type, $total[0], $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1, '');
+ $priceI = $price->getPriceItemsShipping($v->cost, $v->cost_additional, $v->calculation_type, $total[0], $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1, '');
echo '
';
echo '
';
@@ -191,6 +191,12 @@
echo '
'.$priceI['bruttotxt'].'
';
echo '
'.$priceI['bruttoformat'].'
';
}
+
+ if ($priceI['costinfo'] != '') {
+ echo '
';
+ echo '
'.$priceI['costinfo'].'
';
+
+ }
}
echo '
';
diff --git a/site/views/item/tmpl/default.php b/site/views/item/tmpl/default.php
index 93ebe91f..19de1d5d 100644
--- a/site/views/item/tmpl/default.php
+++ b/site/views/item/tmpl/default.php
@@ -192,6 +192,7 @@
// Set stock: product, variations, or advanced stock status
$class_btn = '';
$class_icon = '';
+
if ($this->t['display_stock_status'] == 1 || $this->t['display_stock_status'] == 3) {
$stock = PhocacartStock::getStockItemsChangedByAttributes($this->t['stock_status'], $this->t['attr_options'], $x);
diff --git a/site/views/items/tmpl/default.php b/site/views/items/tmpl/default.php
index dd83e491..929bf70d 100644
--- a/site/views/items/tmpl/default.php
+++ b/site/views/items/tmpl/default.php
@@ -416,11 +416,7 @@
echo $icon['addtocart'];
}
- if ($this->t['cv_display_description'] == 1 && $v->description != '') {
- echo '
';
- echo JHtml::_('content.prepare', $v->description);
- echo '
';// end desc
- }
+
// REVIEW - STAR RATING
if ((int)$this->t['display_star_rating'] > 0) {
@@ -431,6 +427,12 @@
echo $layoutR->render($d);
}
+ if ($this->t['cv_display_description'] == 1 && $v->description != '') {
+ echo '
';
+ echo JHtml::_('content.prepare', $v->description);
+ echo '
';// end desc
+ }
+
// VIEW PRODUCT BUTTON
echo '
';
@@ -512,11 +514,7 @@
echo PhocacartRenderFront::renderProductHeader($this->t['product_name_link'], $v, 'item', '', $lt);
//echo '
';// end caption
- if ($this->t['cv_display_description'] == 1 && $v->description != '') {
- echo '
';
- echo JHtml::_('content.prepare', $v->description);
- echo '
';// end desc
- }
+
// REVIEW - STAR RATING
if ((int)$this->t['display_star_rating'] > 0) {
@@ -527,6 +525,12 @@
echo $layoutR->render($d);
}
+ if ($this->t['cv_display_description'] == 1 && $v->description != '') {
+ echo '
';
+ echo JHtml::_('content.prepare', $v->description);
+ echo '
';// end desc
+ }
+
echo '
';
// :L: PRICE
diff --git a/site/views/pos/tmpl/default_main_content_orders.php b/site/views/pos/tmpl/default_main_content_orders.php
index 2f6463d2..26dfce88 100644
--- a/site/views/pos/tmpl/default_main_content_orders.php
+++ b/site/views/pos/tmpl/default_main_content_orders.php
@@ -26,10 +26,13 @@
echo '
';
foreach ($this->items as $v) {
+
+ $orderNumber = isset($v->order_number) && $v->order_number != '' ? $v->order_number : false;
+
echo '
';
echo '
';
- echo '
'.PhocacartOrder::getOrderNumber($v->id, $v->date, $v->order_number).'
';
+ echo '
'.PhocacartOrder::getOrderNumber($v->id, $v->date, $orderNumber).'
';
echo '
';
echo '
';
diff --git a/site/views/pos/tmpl/default_main_content_payment.php b/site/views/pos/tmpl/default_main_content_payment.php
index 1d78eab0..8c0ac8ed 100644
--- a/site/views/pos/tmpl/default_main_content_payment.php
+++ b/site/views/pos/tmpl/default_main_content_payment.php
@@ -37,9 +37,12 @@
echo '
';
echo '
';
-echo '
'; // end row
+echo '
'; // end row-vac
+
+echo '
';
echo '
';
-echo '';
+
echo '
';
echo '
';
echo '
';
+echo '
';// end row-vac
+
+echo '';
+
echo '
';// end ph-pos-payment-box
diff --git a/site/views/pos/tmpl/default_main_content_payment_methods.php b/site/views/pos/tmpl/default_main_content_payment_methods.php
index 317e9a28..c40d257b 100644
--- a/site/views/pos/tmpl/default_main_content_payment_methods.php
+++ b/site/views/pos/tmpl/default_main_content_payment_methods.php
@@ -26,7 +26,7 @@
$checked = 'checked="checked"';
}
- $priceI = $price->getPriceItemsPayment($v->cost, $v->calculation_type, $this->t['total'][0], $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1, '');
+ $priceI = $price->getPriceItemsPayment($v->cost, $v->cost_additional, $v->calculation_type, $this->t['total'][0], $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1, '');
echo '
';
diff --git a/site/views/pos/tmpl/default_main_content_products.php b/site/views/pos/tmpl/default_main_content_products.php
index 50df29a0..8aeb3ccf 100644
--- a/site/views/pos/tmpl/default_main_content_products.php
+++ b/site/views/pos/tmpl/default_main_content_products.php
@@ -183,11 +183,12 @@
$dAb['typeview'] = 'Pos';
$dAb['price'] = $price;
- // Attribute is required and we don't display it in category/items view, se we need to redirect to detail view
+ // Attribute is required and we don't display it in category/items view, so we need to redirect to detail view
+ // NOT IN POS
$dA['selectoptions'] = 0;
- if (isset($v->attribute_required) && $v->attribute_required == 1 && $this->t['pos_hide_attributes'] == 1) {
+ /*if (isset($v->attribute_required) && $v->attribute_required == 1 && $this->t['pos_hide_attributes'] == 1) {
$dA['selectoptions'] = 1;
- }
+ }*/
diff --git a/site/views/pos/tmpl/default_main_content_shipping_methods.php b/site/views/pos/tmpl/default_main_content_shipping_methods.php
index e9de4fa3..0a8ecf8f 100644
--- a/site/views/pos/tmpl/default_main_content_shipping_methods.php
+++ b/site/views/pos/tmpl/default_main_content_shipping_methods.php
@@ -26,7 +26,7 @@
$checked = 'checked="checked"';
}
- $priceI = $price->getPriceItemsShipping($v->cost, $v->calculation_type, $this->t['total'][0], $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1, '');
+ $priceI = $price->getPriceItemsShipping($v->cost, $v->cost_additional, $v->calculation_type, $this->t['total'][0], $v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1, '');
echo '
';
if ($v->image != '') {
diff --git a/site/views/question/tmpl/default.php b/site/views/question/tmpl/default.php
index fa435fdb..de7b2773 100644
--- a/site/views/question/tmpl/default.php
+++ b/site/views/question/tmpl/default.php
@@ -56,6 +56,9 @@
echo '
'. $this->t['question_description']. '
';
}
?>
+
+
+
-
\ No newline at end of file
+
+
+setTimeout(function () { window.close();}, 1000);
+
+*/ ?>
\ No newline at end of file
diff --git a/site/views/question/view.html.php b/site/views/question/view.html.php
index 758f34ef..7b0e4801 100644
--- a/site/views/question/view.html.php
+++ b/site/views/question/view.html.php
@@ -49,7 +49,7 @@ public function display($tpl = null) {
// Security
$namespace = 'phccrt' . $this->p->get('session_suffix');
- $session->set('form_id', PhocacartUtils::getRandomString(mt_rand(6,10)), 'phocacart');
+ $session->set('form_id', PhocacartUtils::getRandomString(mt_rand(6,10)), $namespace);
if((int)$this->p->get('enable_time_check_question', 0) > 0) {
$sesstime = $session->get('time', time(), $namespace);
diff --git a/update/sql/mysql/3.1.1.sql b/update/sql/mysql/3.1.1.sql
new file mode 100644
index 00000000..fd460ef1
--- /dev/null
+++ b/update/sql/mysql/3.1.1.sql
@@ -0,0 +1,7 @@
+ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `sku` varchar(255) NOT NULL DEFAULT '';
+ALTER TABLE `#__phocacart_product_stock` ADD COLUMN `ean` varchar(15) NOT NULL DEFAULT '';
+ALTER TABLE `#__phocacart_payment_methods` ADD COLUMN `cost_additional` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
+ALTER TABLE `#__phocacart_shipping_methods` ADD COLUMN `cost_additional` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
+ALTER TABLE `#__phocacart_orders` ADD COLUMN `amount_pay` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
+ALTER TABLE `#__phocacart_orders` ADD COLUMN `amount_tendered` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
+ALTER TABLE `#__phocacart_orders` ADD COLUMN `amount_change` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0';
diff --git a/views/phocacartcategory/tmpl/edit.php b/views/phocacartcategory/tmpl/edit.php
index b90ad143..491d529d 100644
--- a/views/phocacartcategory/tmpl/edit.php
+++ b/views/phocacartcategory/tmpl/edit.php
@@ -30,7 +30,7 @@ function phCheckRequestStatus(i, task) {
phCheckRequestStatus(i, task);
}, 1000);
} else {
- if (task == 't['task'] ?>.cancel' || task == 'phocacartwizard.backtowizard' || document.formvalidator.isValid(document.id('adminForm'))) {
+ if (task == 't['task'] ?>.cancel' || task == 'phocacartwizard.backtowizard' || document.formvalidator.isValid(document.getElementById('adminForm'))) {
form->getField('description')->save(); ?>
Joomla.submitform(task, document.getElementById('adminForm'));
} else {
diff --git a/views/phocacartcountry/tmpl/edit.php b/views/phocacartcountry/tmpl/edit.php
index f4081865..37ebc675 100644
--- a/views/phocacartcountry/tmpl/edit.php
+++ b/views/phocacartcountry/tmpl/edit.php
@@ -17,7 +17,7 @@
?>