diff --git a/config.xml b/config.xml index ed543e1a..58c76b9e 100644 --- a/config.xml +++ b/config.xml @@ -622,7 +622,7 @@ --> - + @@ -692,6 +692,10 @@ + + + + @@ -843,7 +847,7 @@ @@ -980,7 +984,7 @@ -recaptcha_request_method + @@ -1067,8 +1071,25 @@ recaptcha_request_method + + + + + + + + + + + + + + + + +
@@ -1125,6 +1146,12 @@ recaptcha_request_method
+ + + + + + @@ -1156,9 +1183,9 @@ recaptcha_request_method - - - + + +
diff --git a/controllers/phocacartreports.php b/controllers/phocacartreports.php new file mode 100644 index 00000000..584b3522 --- /dev/null +++ b/controllers/phocacartreports.php @@ -0,0 +1,18 @@ + true)); + return $model; + } +} +?> \ No newline at end of file diff --git a/extensions/components/components.json b/extensions/components/components.json index 5e5288bc..c277a0bf 100644 --- a/extensions/components/components.json +++ b/extensions/components/components.json @@ -1 +1 @@ -{"name":"Phoca","website":"https:\/\/www.phoca.cz","type":"components","extensions":[{"name":"Phoca Cart","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.1.0","description":"E-commerce extension for Joomla! CMS","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/3.1.0\/com_phocacart_v3.1.0.zip","price":"","obtaintype":"1","type":"component","element":"com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""}]} \ No newline at end of file +{"name":"Phoca","website":"https:\/\/www.phoca.cz","type":"components","extensions":[{"name":"Phoca Cart","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.1.1","description":"E-commerce extension for Joomla! CMS","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/3.1.1\/com_phocacart_v3.1.1.zip","price":"","obtaintype":"1","type":"component","element":"com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""}]} \ No newline at end of file diff --git a/extensions/languages/img/it.png b/extensions/languages/img/it.png new file mode 100644 index 00000000..2d785a71 Binary files /dev/null and b/extensions/languages/img/it.png differ diff --git a/extensions/languages/languages.json b/extensions/languages/languages.json index 2b766311..7675324f 100644 --- a/extensions/languages/languages.json +++ b/extensions/languages/languages.json @@ -1 +1 @@ -{"name":"Phoca","website":"https:\/\/www.phoca.cz","type":"components","extensions":[{"name":"Brazilian (Portuguese)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/br.png","link":"","version":"3.0.0","description":"Brazilian language package","developer":"Daniel","developerlink":"","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/pt-BR.com_phocacart-j3.zip","price":"","obtaintype":"2","type":"file","element":"pt-BR.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Bulgarian (\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/bg.png","link":"http:\/\/www.cmsbg.info","version":"3.0.0","description":"Bulgarian language package","developer":"Stefan Ilivanov","developerlink":"http:\/\/www.cmsbg.info","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/bg-BG_cart_3.0.1_Work_in_progress.zip","price":"","obtaintype":"2","type":"file","element":"bg-BG.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Czech (\u010ce\u0161tina)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/cz.png","link":"https:\/\/www.bongovo.cz\/ke-stazeni\/category\/131-phoca-cart","version":"3.0.0","description":"Czech language package","developer":"Bongovo.cz","developerlink":"https:\/\/www.bongovo.cz\/","download":"https:\/\/www.bongovo.cz\/ke-stazeni\/category\/131-phoca-cart","price":"","obtaintype":"3","type":"file","element":"cs-CZ.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Finnish (suomen kieli)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/fi.png","link":"https:\/\/jokioistenmuseorautatie.fi\/en\/phoca-cart-finnish-translation","version":"3.0.2","description":"Finnish language package","developer":"JTe","developerlink":"https:\/\/jokioistenmuseorautatie.fi","download":"https:\/\/jokioistenmuseorautatie.fi\/en\/phoca-cart-finnish-translation","price":"","obtaintype":"2","type":"file","element":"fi-FI.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"German (Deutsch)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/de.png","link":"http:\/\/www.reisefotografien.eu\/downloads\/category\/203-phoca-cart-komponente","version":"3.0.3","description":"German language package","developer":"Reisefotografien.eu","developerlink":"http:\/\/www.reisefotografien.eu\/","download":"http:\/\/www.reisefotografien.eu\/downloads\/category\/203-phoca-cart-komponente","price":"","obtaintype":"2","type":"file","element":"de-DE.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Russian (\u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/ru.png","link":"","version":"3.0.0","description":"Russian language package","developer":"Igor Fomin","developerlink":"http:\/\/www.scorpion.odessa.ua\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/ru_RU.com_phocacart-j3.zip","price":"","obtaintype":"2","type":"file","element":"ru-RU.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Slovak (sloven\u010dina)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/sk.png","link":"https:\/\/www.bongovo.cz\/ke-stazeni\/category\/131-phoca-cart","version":"3.0.0","description":"Slovak language package","developer":"Bongovo.cz","developerlink":"https:\/\/www.bongovo.cz\/","download":"https:\/\/www.bongovo.cz\/ke-stazeni\/category\/131-phoca-cart","price":"","obtaintype":"3","type":"file","element":"sk-SK.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Spanish (espa\u00f1ol)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/es.png","link":"","version":"3.0.0","description":"Spanish language package","developer":"redlo","developerlink":"","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/es-ES.com_phocacart-j3_v2.zip","price":"","obtaintype":"2","type":"file","element":"es-ES.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""}]} \ No newline at end of file +{"name":"Phoca","website":"https:\/\/www.phoca.cz","type":"components","extensions":[{"name":"Brazilian (Portuguese)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/br.png","link":"","version":"3.0.0","description":"Brazilian language package","developer":"Daniel","developerlink":"","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/pt-BR.com_phocacart-j3.zip","price":"","obtaintype":"2","type":"file","element":"pt-BR.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Bulgarian (\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/bg.png","link":"http:\/\/www.cmsbg.info","version":"3.0.0","description":"Bulgarian language package","developer":"Stefan Ilivanov","developerlink":"http:\/\/www.cmsbg.info","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/bg-BG_cart_3.0.1_Work_in_progress.zip","price":"","obtaintype":"2","type":"file","element":"bg-BG.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Czech (\u010ce\u0161tina)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/cz.png","link":"https:\/\/www.bongovo.cz\/ke-stazeni\/category\/131-phoca-cart","version":"3.0.0","description":"Czech language package","developer":"Bongovo.cz","developerlink":"https:\/\/www.bongovo.cz\/","download":"https:\/\/www.bongovo.cz\/ke-stazeni\/category\/131-phoca-cart","price":"","obtaintype":"3","type":"file","element":"cs-CZ.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Finnish (suomen kieli)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/fi.png","link":"https:\/\/jokioistenmuseorautatie.fi\/en\/phoca-cart-finnish-translation","version":"3.0.2","description":"Finnish language package","developer":"JTe","developerlink":"https:\/\/jokioistenmuseorautatie.fi","download":"https:\/\/jokioistenmuseorautatie.fi\/en\/phoca-cart-finnish-translation","price":"","obtaintype":"2","type":"file","element":"fi-FI.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"German (Deutsch)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/de.png","link":"http:\/\/www.reisefotografien.eu\/downloads\/category\/203-phoca-cart-komponente","version":"3.0.3","description":"German language package","developer":"Reisefotografien.eu","developerlink":"http:\/\/www.reisefotografien.eu\/","download":"http:\/\/www.reisefotografien.eu\/downloads\/category\/203-phoca-cart-komponente","price":"","obtaintype":"2","type":"file","element":"de-DE.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Italian (Italiano)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/it.png","link":"","version":"3.0.0","description":"Italian language package","developer":"Alessandro","developerlink":"","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/it-IT.com_phocacart-j3.zip","price":"","obtaintype":"2","type":"file","element":"it-IT.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Russian (\u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/ru.png","link":"","version":"3.0.0","description":"Russian language package","developer":"Igor Fomin","developerlink":"http:\/\/www.scorpion.odessa.ua\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/ru_RU.com_phocacart-j3.zip","price":"","obtaintype":"2","type":"file","element":"ru-RU.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Slovak (sloven\u010dina)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/sk.png","link":"https:\/\/www.bongovo.cz\/ke-stazeni\/category\/131-phoca-cart","version":"3.0.0","description":"Slovak language package","developer":"Bongovo.cz","developerlink":"https:\/\/www.bongovo.cz\/","download":"https:\/\/www.bongovo.cz\/ke-stazeni\/category\/131-phoca-cart","price":"","obtaintype":"3","type":"file","element":"sk-SK.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Spanish (espa\u00f1ol)","image":"https:\/\/raw.githubusercontent.com\/PhocaCz\/PhocaCart\/master\/extensions\/languages\/img\/es.png","link":"","version":"3.0.0","description":"Spanish language package","developer":"redlo","developerlink":"","download":"https:\/\/github.com\/PhocaCz\/PhocaCart\/releases\/download\/languages\/es-ES.com_phocacart-j3_v2.zip","price":"","obtaintype":"2","type":"file","element":"es-ES.com_phocacart","folder":"","compatibility":"3","added":"","updated":"","featured":""}]} \ No newline at end of file diff --git a/extensions/modules/modules.json b/extensions/modules/modules.json index 50582afb..67d7d871 100644 --- a/extensions/modules/modules.json +++ b/extensions/modules/modules.json @@ -1 +1 @@ -{"name":"Phoca","website":"https:\/\/www.phoca.cz","type":"modules","extensions":[{"name":"Brands","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-brands-module","version":"3.1.0","description":"Displaying of list of manufacturers (brands)","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartBrandsModule\/releases\/download\/3.1.0\/mod_phocacart_brands_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_brands","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Cart","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-cart-module","version":"3.1.0","description":"Displaying of ordered products in module position","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartCartModule\/releases\/download\/3.1.0\/mod_phocacart_cart_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_cart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Category","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-category-module","version":"3.1.0","description":"Displaying of tree of Phoca Cart categories","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartCategoryModule\/releases\/download\/3.1.0\/mod_phocacart_category_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_category","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Compare","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-compare-module","version":"3.1.0","description":"Displaying of products in comparison list","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartCompareModule\/releases\/download\/3.1.0\/mod_phocacart_compare_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_compare","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Currency","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-currency-module","version":"3.1.0","description":"Displaying of currency selector in module position","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartCurrencyModule\/releases\/download\/3.1.0\/mod_phocacart_currency_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_currency","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Filter","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-filter-module","version":"3.1.0","description":"Displaying of filter form in module position to filter products","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartFilterModule\/releases\/download\/3.1.0\/mod_phocacart_filter_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_filter","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Product","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-product-module","version":"3.1.0","description":"Displaying of products in module position","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartProductModule\/releases\/download\/3.1.0\/mod_phocacart_product_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_product","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Product Scroller","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-product-scroller-module","version":"3.1.0","description":"Displaying of product scroll slider of Phoca Cart products.","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartProductScrollerModule\/releases\/download\/3.1.0\/mod_phocacart_product_scroller_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_product_scroller","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Search","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-search-module","version":"3.1.0","description":"Displaying of search form in module position to search products","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartSearchModule\/releases\/download\/3.1.0\/mod_phocacart_search_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_search","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Wish List","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-wish-list-module","version":"3.1.0","description":"Displaying of products in wish list","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartWishListModule\/releases\/download\/3.1.0\/mod_phocacart_wishlist_v3.1.0.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_wishlist","folder":"","compatibility":"3","added":"","updated":"","featured":""}]} \ No newline at end of file +{"name":"Phoca","website":"https:\/\/www.phoca.cz","type":"modules","extensions":[{"name":"Brands","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-brands-module","version":"3.1.1","description":"Displaying of list of manufacturers (brands)","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartBrandsModule\/releases\/download\/3.1.1\/mod_phocacart_brands_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_brands","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Cart","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-cart-module","version":"3.1.1","description":"Displaying of ordered products in module position","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartCartModule\/releases\/download\/3.1.1\/mod_phocacart_cart_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_cart","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Category","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-category-module","version":"3.1.1","description":"Displaying of tree of Phoca Cart categories","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartCategoryModule\/releases\/download\/3.1.1\/mod_phocacart_category_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_category","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Compare","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-compare-module","version":"3.1.1","description":"Displaying of products in comparison list","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartCompareModule\/releases\/download\/3.1.1\/mod_phocacart_compare_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_compare","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Currency","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-currency-module","version":"3.1.1","description":"Displaying of currency selector in module position","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartCurrencyModule\/releases\/download\/3.1.1\/mod_phocacart_currency_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_currency","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Filter","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-filter-module","version":"3.1.1","description":"Displaying of filter form in module position to filter products","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartFilterModule\/releases\/download\/3.1.1\/mod_phocacart_filter_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_filter","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Product","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-product-module","version":"3.1.1","description":"Displaying of products in module position","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartProductModule\/releases\/download\/3.1.1\/mod_phocacart_product_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_product","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Product Scroller","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-product-scroller-module","version":"3.1.1","description":"Displaying of product scroll slider of Phoca Cart products.","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartProductScrollerModule\/releases\/download\/3.1.1\/mod_phocacart_product_scroller_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_product_scroller","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Search","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-search-module","version":"3.1.1","description":"Displaying of search form in module position to search products","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartSearchModule\/releases\/download\/3.1.1\/mod_phocacart_search_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_search","folder":"","compatibility":"3","added":"","updated":"","featured":""},{"name":"Wish List","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phoca-cart-wish-list-module","version":"3.1.1","description":"Displaying of products in wish list","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/github.com\/PhocaCz\/PhocaCartWishListModule\/releases\/download\/3.1.1\/mod_phocacart_wishlist_v3.1.1.zip","price":"","obtaintype":"1","type":"module","element":"mod_phocacart_wishlist","folder":"","compatibility":"3","added":"","updated":"","featured":""}]} \ No newline at end of file diff --git a/extensions/plugins/plugins.json b/extensions/plugins/plugins.json index 16cec0d2..1500d010 100644 --- a/extensions/plugins/plugins.json +++ b/extensions/plugins/plugins.json @@ -1 +1 @@ -{"name":"Phoca","website":"https:\/\/www.phoca.cz","type":"plugins","extensions":[{"name":"Payment - 2Checkout","image":"https:\/\/www.norrnext.com\/images\/icons\/2checkout-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/2checkout-inline-for-phoca-cart","version":"1.0.1","description":"ayment method providing integration to 2Checkout","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/2checkout-inline-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"2co_inline","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Authorize.Net","image":"https:\/\/www.norrnext.com\/images\/icons\/authorize-net-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/authorize-net-for-phoca-cart","version":"1.0.0","description":"Payment method providing integration to Authorize.net","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/authorize-net-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"authorize","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Cash On Delivery","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.0.3","description":"Cash On Delivery payment plugin for Phoca Cart","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/www.phoca.cz\/download\/category\/100-phoca-cart-component","price":"","obtaintype":"2","type":"plugin","element":"paypal_standard","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - PayPal Standard","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.0.3","description":"PayPal Standard payment plugin for Phoca Cart","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/www.phoca.cz\/download\/category\/100-phoca-cart-component","price":"","obtaintype":"2","type":"plugin","element":"cash_on_delivery","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Robokassa","image":"https:\/\/www.norrnext.com\/images\/icons\/robokassa-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/robokassa-for-phoca-cart","version":"1.0.0","description":"Payment method providing integration to Robokassa (Russia)","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/robokassa-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"robokassa","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Sberbank","image":"https:\/\/www.norrnext.com\/images\/icons\/sberbank-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/sberbank-for-phoca-cart","version":"1.0.0","description":"Payment method providing integration to Sberbank","developer":"Norrnext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/sberbank-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"sberbank","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Stripe","image":"https:\/\/www.norrnext.com\/images\/icons\/stripe-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/stripe-for-phoca-cart","version":"1.0.1","description":"Payment method providing integration to Stripe","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/stripe-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"stripe","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Yandex Kassa","image":"https:\/\/www.norrnext.com\/images\/icons\/yandex-kassa-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/yandex-kassa-for-phoca-cart","version":"1.0.2","description":"Payment method providing integration to Yandex Kassa (Russia)","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/yandex-kassa-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"yandex_kassa","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - eWAY","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/marathonsoftware.com.au\/products\/joomla-products\/190-eway-for-phoca-cart","version":"1.0.0","description":"Payment method that uses the eWAY payment gateway","developer":"Marathon Software","developerlink":"https:\/\/marathonsoftware.com.au\/","download":"https:\/\/marathonsoftware.com.au\/products\/joomla-products\/190-eway-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"eway","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Shipping - Standard","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.0.3","description":"Standard shipping plugin for Phoca Cart","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/www.phoca.cz\/download\/category\/100-phoca-cart-component","price":"","obtaintype":"2","type":"plugin","element":"shipping_standard","folder":"pcs","compatibility":"3","added":"","updated":"","featured":""},{"name":"View - Default","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.0.3","description":"Default view plugin for Phoca Cart","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/www.phoca.cz\/download\/category\/100-phoca-cart-component","price":"","obtaintype":"2","type":"plugin","element":"default","folder":"pcv","compatibility":"3","added":"","updated":"","featured":""}]} \ No newline at end of file +{"name":"Phoca","website":"https:\/\/www.phoca.cz","type":"plugins","extensions":[{"name":"Payment - 2Checkout","image":"https:\/\/www.norrnext.com\/images\/icons\/2checkout-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/2checkout-inline-for-phoca-cart","version":"1.0.1","description":"ayment method providing integration to 2Checkout","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/2checkout-inline-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"2co_inline","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Authorize.Net","image":"https:\/\/www.norrnext.com\/images\/icons\/authorize-net-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/authorize-net-for-phoca-cart","version":"1.0.0","description":"Payment method providing integration to Authorize.net","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/authorize-net-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"authorize","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Cash On Delivery","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.0.3","description":"Cash On Delivery payment plugin for Phoca Cart","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/www.phoca.cz\/download\/category\/100-phoca-cart-component","price":"","obtaintype":"2","type":"plugin","element":"paypal_standard","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - PayPal Standard","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.0.3","description":"PayPal Standard payment plugin for Phoca Cart","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/www.phoca.cz\/download\/category\/100-phoca-cart-component","price":"","obtaintype":"2","type":"plugin","element":"cash_on_delivery","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Robokassa","image":"https:\/\/www.norrnext.com\/images\/icons\/robokassa-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/robokassa-for-phoca-cart","version":"1.0.0","description":"Payment method providing integration to Robokassa (Russia)","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/robokassa-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"robokassa","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Sberbank","image":"https:\/\/www.norrnext.com\/images\/icons\/sberbank-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/sberbank-for-phoca-cart","version":"1.0.0","description":"Payment method providing integration to Sberbank","developer":"Norrnext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/sberbank-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"sberbank","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Stripe","image":"https:\/\/www.norrnext.com\/images\/icons\/stripe-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/stripe-for-phoca-cart","version":"1.1.1","description":"Payment method providing integration to Stripe","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/stripe-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"stripe","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Yandex Kassa","image":"https:\/\/www.norrnext.com\/images\/icons\/yandex-kassa-for-phoca-cart48.png","link":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/yandex-kassa-for-phoca-cart","version":"1.0.2","description":"Payment method providing integration to Yandex Kassa (Russia)","developer":"NorrNext","developerlink":"https:\/\/www.norrnext.com\/","download":"https:\/\/www.norrnext.com\/phoca-cart-extensions\/yandex-kassa-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"yandex_kassa","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - Yandex Kassa for Phoca Cart","image":"http:\/\/seoprosto.net\/images\/seoprosto\/soft\/SPN-Yandex-kassa-for-phoca-cart-48x48.png ","link":"http:\/\/seoprosto.net\/services\/software\/joomla-phocacart-yandex-kassa","version":"1.0.1","description":"Plugin provides integration Phoca Cart with payment service Yandex Kassa","developer":"Sergey Kuznetsov","developerlink":"http:\/\/seoprosto.net\/services\/software","download":"http:\/\/seoprosto.net\/other\/download?download=11:joomla-phoca-cart-plagin-yandeks-kassa","price":"","obtaintype":"2","type":"plugin","element":"spn_yandex_kassa","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Payment - eWAY","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/marathonsoftware.com.au\/products\/joomla-products\/190-eway-for-phoca-cart","version":"1.0.0","description":"Payment method that uses the eWAY payment gateway","developer":"Marathon Software","developerlink":"https:\/\/marathonsoftware.com.au\/","download":"https:\/\/marathonsoftware.com.au\/products\/joomla-products\/190-eway-for-phoca-cart","price":"","obtaintype":"0","type":"plugin","element":"eway","folder":"pcp","compatibility":"3","added":"","updated":"","featured":""},{"name":"Shipping - Standard","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.0.3","description":"Standard shipping plugin for Phoca Cart","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/www.phoca.cz\/download\/category\/100-phoca-cart-component","price":"","obtaintype":"2","type":"plugin","element":"shipping_standard","folder":"pcs","compatibility":"3","added":"","updated":"","featured":""},{"name":"View - Default","image":"..\/media\/com_phocacart\/images\/administrator\/pc.png","link":"https:\/\/www.phoca.cz\/phocacart","version":"3.0.3","description":"Default view plugin for Phoca Cart","developer":"Phoca","developerlink":"https:\/\/www.phoca.cz\/","download":"https:\/\/www.phoca.cz\/download\/category\/100-phoca-cart-component","price":"","obtaintype":"2","type":"plugin","element":"default","folder":"pcv","compatibility":"3","added":"","updated":"","featured":""}]} \ No newline at end of file diff --git a/helpers/phocacartreports.php b/helpers/phocacartreports.php new file mode 100644 index 00000000..ed74ae6a --- /dev/null +++ b/helpers/phocacartreports.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/install/sql/mysql/install.utf8.sql b/install/sql/mysql/install.utf8.sql index 14fcd675..378f8beb 100644 --- a/install/sql/mysql/install.utf8.sql +++ b/install/sql/mysql/install.utf8.sql @@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_categories` ( `image` varchar(255) NOT NULL DEFAULT '', `title_feed` varchar(255) NOT NULL DEFAULT '', `type` tinyint(3) NOT NULL default '0', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -27,11 +27,11 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_categories` ( `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `count` int(11) NOT NULL DEFAULT '0', `hits` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `metatitle` varchar(255) NOT NULL DEFAULT '', - `metakey` text NOT NULL, - `metadesc` text NOT NULL, - `metadata` text NOT NULL, + `metakey` text NOT NULL DEFAULT '', + `metadesc` text NOT NULL DEFAULT '', + `metadata` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `cat_idx` (`published`,`access`), @@ -50,8 +50,8 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_products` ( `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `type` tinyint(3) NOT NULL default '0', - `description` text NOT NULL, - `description_long` text NOT NULL, + `description` text NOT NULL DEFAULT '', + `description_long` text NOT NULL DEFAULT '', `price` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', `price_original` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', `length` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0', @@ -71,7 +71,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_products` ( `min_quantity_calculation` int(11) NOT NULL DEFAULT '0', `stockstatus_a_id` int(11) NOT NULL DEFAULT '0', `stockstatus_n_id` int(11) NOT NULL DEFAULT '0', - `availability` text NOT NULL, + `availability` text NOT NULL DEFAULT '', `sku` varchar(255) NOT NULL DEFAULT '', `upc` varchar(15) NOT NULL DEFAULT '', `ean` varchar(15) NOT NULL DEFAULT '', @@ -90,7 +90,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_products` ( `public_download_text` varchar(255) NOT NULL DEFAULT '', `featured` tinyint(1) NOT NULL DEFAULT '0', `allow_upload` tinyint(1) NOT NULL DEFAULT '0', - `custom_text` text NOT NULL, + `custom_text` text NOT NULL DEFAULT '', `download_token` char(64) NOT NULL DEFAULT '', `download_folder` varchar(255) NOT NULL DEFAULT '', `download_file` varchar(255) NOT NULL DEFAULT '', @@ -106,11 +106,11 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_products` ( `sales` int(11) NOT NULL DEFAULT '0', `points_received` int(11) NOT NULL DEFAULT '0', `points_needed` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `metatitle` varchar(255) NOT NULL DEFAULT '', - `metakey` text NOT NULL, - `metadesc` text NOT NULL, - `metadata` text NOT NULL, + `metakey` text NOT NULL DEFAULT '', + `metadesc` text NOT NULL DEFAULT '', + `metadata` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `product_idx` (`published`,`access`), @@ -163,13 +163,13 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_product_discounts` ( `quantity_to` int(11) NOT NULL DEFAULT '0', `available_quantity` int(11) NOT NULL DEFAULT '0', `available_quantity_user` int(11) NOT NULL DEFAULT '0', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `access` int(11) unsigned NOT NULL DEFAULT '0', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -195,8 +195,8 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_product_point_groups` ( CREATE TABLE IF NOT EXISTS `#__phocacart_product_stock` ( `id` int(11) NOT NULL auto_increment, `product_id` int(11) NOT NULL DEFAULT '0', - `product_key` text NOT NULL, - `attributes` text NOT NULL, + `product_key` text NOT NULL DEFAULT '', + `attributes` text NOT NULL DEFAULT '', `stock` int(11) NOT NULL DEFAULT '0', `image` varchar(255) NOT NULL DEFAULT '', `image_small` varchar(255) NOT NULL DEFAULT '', @@ -228,7 +228,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_attributes` ( `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_product` (`product_id`), @@ -258,7 +258,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_attribute_values` ( `ean` varchar(15) NOT NULL DEFAULT '', `type` tinyint(1) NOT NULL DEFAULT '0', `default_value` tinyint(1) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_attribute` (`attribute_id`) , KEY `idx_alias` (`alias`), @@ -277,14 +277,14 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_specifications` ( `group_id` int(11) NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', - `value` text NOT NULL, + `value` text NOT NULL DEFAULT '', `alias_value` varchar(255) NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_product` (`product_id`) , @@ -303,7 +303,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_specification_groups` ( `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_language` (`language`) @@ -332,7 +332,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_countries` ( `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -350,7 +350,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_regions` ( `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -367,7 +367,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_zones` ( `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -388,15 +388,16 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_shipping_methods` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tax_id` int(11) NOT NULL DEFAULT '0', `cost` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', + `cost_additional` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', `calculation_type` tinyint(1) NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', `type` tinyint(3) NOT NULL default '0', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `tracking_title` varchar(255) NOT NULL DEFAULT '', - `tracking_description` text NOT NULL, + `tracking_description` text NOT NULL DEFAULT '', `tracking_link` varchar(255) NOT NULL DEFAULT '', `lowest_weight` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0', @@ -437,7 +438,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_shipping_methods` ( `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `default` tinyint(1) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', INDEX (`published`), PRIMARY KEY (`id`) @@ -467,13 +468,13 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_manufacturers` ( `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', `link` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_language` (`language`) @@ -486,14 +487,14 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_stock_statuses` ( `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', `title_feed` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `type` tinyint(1) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -506,12 +507,12 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_tags` ( `image` varchar(255) NOT NULL DEFAULT '', `link_ext` varchar(255) NOT NULL DEFAULT '', `link_cat` int(11) unsigned NOT NULL DEFAULT '0', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -536,7 +537,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_taxes` ( `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -583,7 +584,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_currencies` ( `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -608,13 +609,13 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_coupons` ( `category_filter` tinyint(1) NOT NULL DEFAULT '1', `product_filter` tinyint(1) NOT NULL DEFAULT '1', `type` tinyint(3) NOT NULL default '0', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `access` int(11) unsigned NOT NULL DEFAULT '0', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -666,13 +667,13 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_discounts` ( `category_filter` tinyint(1) NOT NULL DEFAULT '1', `product_filter` tinyint(1) NOT NULL DEFAULT '1', `type` tinyint(3) NOT NULL default '0', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `access` int(11) unsigned NOT NULL DEFAULT '0', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -694,13 +695,14 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_payment_methods` ( `id` int(11) NOT NULL auto_increment, `tax_id` int(11) NOT NULL DEFAULT '0', `cost` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', + `cost_additional` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', `operator` char(1) NOT NULL DEFAULT '0', `calculation_type` tinyint(1) NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', `type` tinyint(3) NOT NULL default '0', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `lowest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', `highest_amount` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', `active_amount` tinyint(1) NOT NULL DEFAULT '0', @@ -716,7 +718,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_payment_methods` ( `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `default` tinyint(1) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -754,7 +756,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_reviews` ( `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `name` varchar(255) NOT NULL DEFAULT '', - `review` text NOT NULL, + `review` text NOT NULL DEFAULT '', `rating` int(1) NOT NULL, `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', @@ -770,7 +772,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_form_fields` ( `title` varchar(50) NOT NULL DEFAULT '', `alias` varchar(50) NOT NULL DEFAULT '', `label` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `id_input` varchar(50) NOT NULL DEFAULT '', `type` varchar(50) NOT NULL DEFAULT '', `type_default` tinyint(3) NOT NULL DEFAULT '0', @@ -786,7 +788,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_form_fields` ( `unique` tinyint(1) NOT NULL DEFAULT '0', `preicon` varchar(100) NOT NULL DEFAULT '', `format` varchar(50) NOT NULL DEFAULT '', - `additional` text NOT NULL, + `additional` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `display_billing` tinyint(1) NOT NULL DEFAULT '0', `display_shipping` tinyint(1) NOT NULL DEFAULT '0', @@ -796,7 +798,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_form_fields` ( `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `access` int(11) unsigned NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -844,7 +846,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_users` ( /* CREATE TABLE IF NOT EXISTS `#__phocacart_cart` ( `user_id` int(11) NOT NULL DEFAULT '0', - `cart` text NOT NULL, + `cart` text NOT NULL DEFAULT '', `shipping` int(11) NOT NULL DEFAULT '0', `coupon` int(11) NOT NULL DEFAULT '0', `payment` int(11) NOT NULL DEFAULT '0', @@ -860,7 +862,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_cart_multiple` ( `unit_id` int(11) NOT NULL DEFAULT '0', `section_id` int(11) NOT NULL DEFAULT '0', `loyalty_card_number` varchar(30) NOT NULL DEFAULT '', - `cart` text NOT NULL, + `cart` text NOT NULL DEFAULT '', `shipping` int(11) NOT NULL DEFAULT '0', `coupon` int(11) NOT NULL DEFAULT '0', `payment` int(11) NOT NULL DEFAULT '0', @@ -877,7 +879,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_order_statuses` ( `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `stock_movements` char(1) NOT NULL DEFAULT '', `change_user_group` tinyint(1) NOT NULL DEFAULT '0', @@ -885,9 +887,9 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_order_statuses` ( `change_points_received` tinyint(1) NOT NULL DEFAULT '0', `email_customer` tinyint(1) NOT NULL DEFAULT '0', - `email_others` text NOT NULL, - `email_text` text NOT NULL, - `email_text_others` text NOT NULL, + `email_others` text NOT NULL DEFAULT '', + `email_text` text NOT NULL DEFAULT '', + `email_text_others` text NOT NULL DEFAULT '', `email_subject` varchar(255) NOT NULL DEFAULT '', `email_subject_others` varchar(255) NOT NULL DEFAULT '', `email_send` int(2) NOT NULL DEFAULT '0', @@ -896,7 +898,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_order_statuses` ( `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `type` tinyint(1) NOT NULL DEFAULT '0', `download` tinyint(1) NOT NULL DEFAULT '0', `language` char(7) NOT NULL DEFAULT '', @@ -918,6 +920,11 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_orders` ( `discount_id` int(11) NOT NULL DEFAULT '0', `currency_id` int(11) NOT NULL DEFAULT '0', + `amount_pay` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', + `amount_tendered` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', + `amount_change` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', + + `type` tinyint(3) NOT NULL default '0', `vendor_id` int(11) NOT NULL DEFAULT '0', `ticket_id` int(11) NOT NULL DEFAULT '0', @@ -932,20 +939,20 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_orders` ( `unit_volume` varchar(50) NOT NULL DEFAULT '', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', - `comment` text NOT NULL, + `comment` text NOT NULL DEFAULT '', `ip` varchar(40) NOT NULL DEFAULT '', `user_agent` varchar(255) NOT NULL DEFAULT '', `tracking_id` int(11) NOT NULL DEFAULT '0', `tracking_title` varchar(255) NOT NULL DEFAULT '', - `tracking_description_custom` text NOT NULL, + `tracking_description_custom` text NOT NULL DEFAULT '', `tracking_link_custom` varchar(255) NOT NULL DEFAULT '', `tracking_number` varchar(255) NOT NULL DEFAULT '', `tracking_date_shipped` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `reference_field1` varchar(128) NOT NULL DEFAULT '', `reference_field2` varchar(128) NOT NULL DEFAULT '', - `reference_data` text NOT NULL, + `reference_data` text NOT NULL DEFAULT '', `order_number` varchar(64) NOT NULL DEFAULT '', `receipt_number` varchar(64) NOT NULL DEFAULT '', @@ -955,9 +962,9 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_orders` ( `invoice_due_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `invoice_prn` varchar(64) NOT NULL DEFAULT '', - `invoice_spec_top_desc` text NOT NULL, - `invoice_spec_middle_desc` text NOT NULL, - `invoice_spec_bottom_desc` text NOT NULL, + `invoice_spec_top_desc` text NOT NULL DEFAULT '', + `invoice_spec_middle_desc` text NOT NULL DEFAULT '', + `invoice_spec_bottom_desc` text NOT NULL DEFAULT '', `privacy` tinyint(1) NOT NULL default '0', @@ -967,7 +974,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_orders` ( `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -977,7 +984,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_order_users` ( `order_id` int(11) NOT NULL DEFAULT '0', `user_token` char(64) NOT NULL DEFAULT '', `user_address_id` int(11) NOT NULL DEFAULT '0', - `user_groups` text NOT NULL, + `user_groups` text NOT NULL DEFAULT '', `type` tinyint(1) NOT NULL DEFAULT '0', `ba_sa` tinyint(1) NOT NULL DEFAULT '0', `name_first` varchar(100) NOT NULL DEFAULT '', @@ -1008,7 +1015,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_order_products` ( `order_id` int(11) NOT NULL DEFAULT '0', `product_id` int(11) NOT NULL DEFAULT '0', `category_id` int(11) NOT NULL DEFAULT '0', - `product_id_key` text NOT NULL, + `product_id_key` text NOT NULL DEFAULT '', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `sku` varchar(255) NOT NULL DEFAULT '', @@ -1047,7 +1054,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_order_attributes` ( `attribute_title` varchar(255) NOT NULL DEFAULT '', `option_title` varchar(255) NOT NULL DEFAULT '', `type` tinyint(1) NOT NULL DEFAULT '0', - `option_value` text NOT NULL, + `option_value` text NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `order_id` (`order_id`) ) DEFAULT CHARSET=utf8; @@ -1086,7 +1093,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_order_product_discounts` ( `order_product_id` int(11) NOT NULL DEFAULT '0', `discount_id` int(11) NOT NULL DEFAULT '0', `category_id` int(11) NOT NULL DEFAULT '0', - `product_id_key` text NOT NULL, + `product_id_key` text NOT NULL DEFAULT '', `type` tinyint(3) NOT NULL default '0', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', @@ -1162,13 +1169,13 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_logs` ( `alias` varchar(255) NOT NULL DEFAULT '', `ip` varchar(20) NOT NULL default '', `incoming_page` varchar(255) NOT NULL, - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_language` (`language`) @@ -1180,14 +1187,14 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_feeds` ( `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, - `header` text NOT NULL, - `footer` text NOT NULL, + `description` text NOT NULL DEFAULT '', + `header` text NOT NULL DEFAULT '', + `footer` text NOT NULL DEFAULT '', `root` varchar(64) NOT NULL DEFAULT '', `item` varchar(64) NOT NULL DEFAULT '', - `item_params` text NOT NULL, - `feed_params` text NOT NULL, - `params` text NOT NULL, + `item_params` text NOT NULL DEFAULT '', + `feed_params` text NOT NULL DEFAULT '', + `params` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -1206,7 +1213,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_wishlists` ( `user_id` int(11) NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', - `wishlist` text NOT NULL, + `wishlist` text NOT NULL DEFAULT '', `ip` varchar(40) NOT NULL DEFAULT '', `user_agent` varchar(255) NOT NULL DEFAULT '', `quantity` int(11) NOT NULL DEFAULT '0', @@ -1217,7 +1224,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_wishlists` ( `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_product_user` (`product_id`, `user_id`) ) DEFAULT CHARSET=utf8; @@ -1235,14 +1242,14 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_questions` ( `ip` varchar(20) NOT NULL default '', `title` varchar(200) NOT NULL default '', `alias` varchar(255) NOT NULL default '', - `message` text NOT NULL, + `message` text NOT NULL DEFAULT '', `date` datetime NOT NULL default '0000-00-00 00:00:00', `privacy` tinyint(1) NOT NULL default '0', `published` tinyint(1) NOT NULL default '0', `checked_out` int(11) NOT NULL default '0', `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL default '', PRIMARY KEY (`id`), KEY `published` (`published`) @@ -1256,7 +1263,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_import` ( `row_id` int(11) NOT NULL default '0', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', - `item` text NOT NULL, + `item` text NOT NULL DEFAULT '', `type` int(3) NOT NULL default '0', `file_type` int(3) NOT NULL default '0', PRIMARY KEY (`id`) @@ -1269,7 +1276,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_export` ( `row_id` int(11) NOT NULL default '0', `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', - `item` text NOT NULL, + `item` text NOT NULL DEFAULT '', `type` int(3) NOT NULL default '0', `file_type` int(3) NOT NULL default '0', PRIMARY KEY (`id`) @@ -1291,7 +1298,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_hits` ( `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -1301,7 +1308,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_groups` ( `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `display_price` tinyint(1) unsigned NOT NULL DEFAULT '0', `display_price_method` tinyint(3) unsigned NOT NULL DEFAULT '0', `minimum_sum` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', @@ -1314,7 +1321,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_groups` ( `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -1328,13 +1335,13 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_reward_points` ( `alias` varchar(255) NOT NULL DEFAULT '', `points` int(11) NOT NULL DEFAULT '0', `type` tinyint(3) NOT NULL default '0', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) DEFAULT CHARSET=utf8; @@ -1380,14 +1387,14 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_vendors` ( `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `access` int(11) unsigned NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `cat_idx` (`published`,`access`), @@ -1403,14 +1410,14 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_sections` ( `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `access` int(11) unsigned NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `cat_idx` (`published`,`access`), @@ -1427,16 +1434,16 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_units` ( `title` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `image` varchar(255) NOT NULL DEFAULT '', - `description` text NOT NULL, + `description` text NOT NULL DEFAULT '', `class_name` varchar(255) NOT NULL DEFAULT '', - `custom_css` text NOT NULL, + `custom_css` text NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', `checked_out` int(11) unsigned NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ordering` int(11) NOT NULL DEFAULT '0', `access` int(11) unsigned NOT NULL DEFAULT '0', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `params` text NOT NULL, + `params` text NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `cat_idx` (`published`,`access`), @@ -1497,7 +1504,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- UTF-8 test: ä,ö,ü - +-- Using text NOT NULL DEFAULT '' instead of text NOT NULL DEFAULT '' NOT NULL because of possible problems with strict rules: Field 'text' doesn't have a default value -- ---------------- -- ALPHA1 -> ALPHA2 @@ -1505,7 +1512,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `type` tinyint(1) NOT NULL DEFAULT '0' added - `#__phocacart_order_statuses` -- `download` tinyint(1) NOT NULL DEFAULT '0' added - `#__phocacart_order_statuses` --- `email_text` text added - `#__phocacart_order_statuses` +-- `email_text` text NOT NULL DEFAULT '' added - `#__phocacart_order_statuses` -- `email_subject` varchar(255) added - `#__phocacart_order_statuses` -- `email_send` int(2) NOT NULL DEFAULT '0' - `#__phocacart_order_statuses` -- `type` tinyint(1) NOT NULL DEFAULT '0' added - `#__phocacart_stock_statuses` @@ -1582,14 +1589,14 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `id` int(11) NOT NULL AUTO_INCREMENT, -- `title` varchar(255) NOT NULL DEFAULT '', -- `alias` varchar(255) NOT NULL DEFAULT '', --- `description` text NOT NULL, --- `header` text NOT NULL, --- `footer` text NOT NULL, +-- `description` text NOT NULL DEFAULT '', +-- `header` text NOT NULL DEFAULT '', +-- `footer` text NOT NULL DEFAULT '', -- `root` varchar(64) NOT NULL DEFAULT '', -- `item` varchar(64) NOT NULL DEFAULT '', --- `item_params` text NOT NULL, --- `feed_params` text NOT NULL, --- `params` text NOT NULL, +-- `item_params` text NOT NULL DEFAULT '', +-- `feed_params` text NOT NULL DEFAULT '', +-- `params` text NOT NULL DEFAULT '', -- `published` tinyint(1) NOT NULL DEFAULT '0', -- `checked_out` int(11) unsigned NOT NULL DEFAULT '0', -- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', @@ -1693,7 +1700,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- ALTER TABLE `#__phocacart_attribute_values` ADD `color` varchar(50) NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_attribute_values` ADD `type` tinyint(1) NOT NULL DEFAULT '0'; --- ALTER TABLE `#__phocacart_attribute_values` ADD `params` text; +-- ALTER TABLE `#__phocacart_attribute_values` ADD `params` text NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_attribute_values` ADD `image_small` varchar(255) NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_attribute_values` ADD `image_medium` varchar(255) NOT NULL DEFAULT ''; @@ -1717,7 +1724,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -- `ordering` int(11) NOT NULL DEFAULT '0', -- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', --- `params` text NOT NULL, +-- `params` text NOT NULL DEFAULT '', -- PRIMARY KEY (`id`), -- KEY `idx_product_user` (`product_id`, `user_id`) --) DEFAULT CHARSET=utf8; @@ -1735,13 +1742,13 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `ip` varchar(20) NOT NULL default '', -- `title` varchar(200) NOT NULL default '', -- `alias` varchar(255) NOT NULL default '', --- `message` text NOT NULL, +-- `message` text NOT NULL DEFAULT '', -- `date` datetime NOT NULL default '0000-00-00 00:00:00', -- `published` tinyint(1) NOT NULL default '0', -- `checked_out` int(11) NOT NULL default '0', -- `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00', -- `ordering` int(11) NOT NULL DEFAULT '0', --- `params` text NOT NULL, +-- `params` text NOT NULL DEFAULT '', -- `language` char(7) NOT NULL default '', -- PRIMARY KEY (`id`), -- KEY `published` (`published`) @@ -1751,7 +1758,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- RC3 -> RC4 -- --------- --- ALTER TABLE `#__phocacart_wishlists` ADD `wishlist` text; +-- ALTER TABLE `#__phocacart_wishlists` ADD `wishlist` text NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_attribute_values` ADD `default_value` tinyint(1) NOT NULL DEFAULT '0'; -- ALTER TABLE `#__phocacart_products` ADD `public_download_file` varchar(255) NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_products` ADD `public_download_text` varchar(255) NOT NULL DEFAULT ''; @@ -1767,7 +1774,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `row_id` int(11) NOT NULL default '0', -- `title` varchar(255) NOT NULL DEFAULT '', -- `alias` varchar(255) NOT NULL DEFAULT '', --- `item` text NOT NULL, +-- `item` text NOT NULL DEFAULT '', -- `type` int(3) NOT NULL default '0', -- `file_type` int(3) NOT NULL default '0', -- PRIMARY KEY (`id`) @@ -1780,7 +1787,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `row_id` int(11) NOT NULL default '0', -- `title` varchar(255) NOT NULL DEFAULT '', -- `alias` varchar(255) NOT NULL DEFAULT '', --- `item` text NOT NULL, +-- `item` text NOT NULL DEFAULT '', -- `type` int(3) NOT NULL default '0', -- `file_type` int(3) NOT NULL default '0', -- PRIMARY KEY (`id`) @@ -1802,7 +1809,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -- `ordering` int(11) NOT NULL DEFAULT '0', -- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', --- `params` text NOT NULL, +-- `params` text NOT NULL DEFAULT '', -- PRIMARY KEY (`id`) -- ) DEFAULT CHARSET=utf8; @@ -1863,7 +1870,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `checked_out` int(11) unsigned NOT NULL DEFAULT '0', -- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -- `ordering` int(11) NOT NULL DEFAULT '0', --- `params` text NOT NULL, +-- `params` text NOT NULL DEFAULT '', -- `language` char(7) NOT NULL DEFAULT '', -- PRIMARY KEY (`id`) -- ) DEFAULT CHARSET=utf8; @@ -1896,13 +1903,13 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `quantity_to` int(11) NOT NULL DEFAULT '0', -- `available_quantity` int(11) NOT NULL DEFAULT '0', -- `available_quantity_user` int(11) NOT NULL DEFAULT '0', --- `description` text NOT NULL, +-- `description` text NOT NULL DEFAULT '', -- `access` int(11) unsigned NOT NULL DEFAULT '0', -- `published` tinyint(1) NOT NULL DEFAULT '0', -- `checked_out` int(11) unsigned NOT NULL DEFAULT '0', -- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -- `ordering` int(11) NOT NULL DEFAULT '0', --- `params` text NOT NULL, +-- `params` text NOT NULL DEFAULT '', -- `language` char(7) NOT NULL DEFAULT '', -- PRIMARY KEY (`id`) -- ) DEFAULT CHARSET=utf8; @@ -1924,13 +1931,13 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `quantity_to` int(11) NOT NULL DEFAULT '0', -- `available_quantity` int(11) NOT NULL DEFAULT '0', -- `available_quantity_user` int(11) NOT NULL DEFAULT '0', --- `description` text NOT NULL, +-- `description` text NOT NULL DEFAULT '', -- `access` int(11) unsigned NOT NULL DEFAULT '0', -- `published` tinyint(1) NOT NULL DEFAULT '0', -- `checked_out` int(11) unsigned NOT NULL DEFAULT '0', -- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -- `ordering` int(11) NOT NULL DEFAULT '0', --- `params` text NOT NULL, +-- `params` text NOT NULL DEFAULT '', -- `language` char(7) NOT NULL DEFAULT '', -- PRIMARY KEY (`id`) -- ) DEFAULT CHARSET=utf8; @@ -1975,7 +1982,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `order_product_id` int(11) NOT NULL DEFAULT '0', -- `discount_id` int(11) NOT NULL DEFAULT '0', -- `category_id` int(11) NOT NULL DEFAULT '0', --- `product_id_key` text NOT NULL, +-- `product_id_key` text NOT NULL DEFAULT '', -- `type` tinyint(3) NOT NULL default '0', -- `title` varchar(255) NOT NULL DEFAULT '', -- `alias` varchar(255) NOT NULL DEFAULT '', @@ -1997,8 +2004,8 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- CREATE TABLE IF NOT EXISTS `#__phocacart_product_stock` ( -- `id` int(11) NOT NULL auto_increment, -- `product_id` int(11) NOT NULL DEFAULT '0', --- `product_key` text NOT NULL, --- `attributes` text NOT NULL, +-- `product_key` text NOT NULL DEFAULT '', +-- `attributes` text NOT NULL DEFAULT '', -- `stock` int(11) NOT NULL DEFAULT '0', -- PRIMARY KEY (`id`) -- ) DEFAULT CHARSET=utf8; @@ -2030,7 +2037,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `title` varchar(255) NOT NULL DEFAULT '', -- `alias` varchar(255) NOT NULL DEFAULT '', -- `image` varchar(255) NOT NULL DEFAULT '', --- `description` text NOT NULL, +-- `description` text NOT NULL DEFAULT '', -- `display_price` tinyint(1) unsigned NOT NULL DEFAULT '0', -- `display_price_method` tinyint(3) unsigned NOT NULL DEFAULT '0', -- `minimum_sum` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0', @@ -2043,7 +2050,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `checked_out` int(11) unsigned NOT NULL DEFAULT '0', -- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -- `ordering` int(11) NOT NULL DEFAULT '0', --- `params` text NOT NULL, +-- `params` text NOT NULL DEFAULT '', -- `language` char(7) NOT NULL DEFAULT '', -- PRIMARY KEY (`id`) -- ) DEFAULT CHARSET=utf8; @@ -2095,13 +2102,13 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- `alias` varchar(255) NOT NULL DEFAULT '', -- `points` int(11) NOT NULL DEFAULT '0', -- `type` tinyint(3) NOT NULL default '0', --- `description` text NOT NULL, +-- `description` text NOT NULL DEFAULT '', -- `published` tinyint(1) NOT NULL DEFAULT '0', -- `checked_out` int(11) unsigned NOT NULL DEFAULT '0', -- `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -- `ordering` int(11) NOT NULL DEFAULT '0', -- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', --- `params` text NOT NULL, +-- `params` text NOT NULL DEFAULT '', -- PRIMARY KEY (`id`) -- ) DEFAULT CHARSET=utf8; @@ -2115,7 +2122,7 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- ALTER TABLE `#__phocacart_cart` ADD `reward` int(11) NOT NULL DEFAULT '0'; -- ALTER TABLE `#__phocacart_form_fields` ADD `type_default` tinyint(3) NOT NULL DEFAULT '0'; --- ALTER TABLE `#__phocacart_order_users` ADD `user_groups` text; +-- ALTER TABLE `#__phocacart_order_users` ADD `user_groups` text NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_order_products` ADD `default_price` DECIMAL( 10, 4 ) NOT NULL DEFAULT '0'; @@ -2148,12 +2155,12 @@ INSERT INTO `#__phocacart_groups` (`id`, `title`, `published`, `display_price`, -- ALTER TABLE `#__phocacart_shipping_methods` ADD `default` tinyint(1) NOT NULL DEFAULT '0'; -- ALTER TABLE `#__phocacart_payment_methods` ADD `default` tinyint(1) NOT NULL DEFAULT '0'; -- ALTER TABLE `#__phocacart_shipping_methods` ADD `tracking_title` varchar(255) NOT NULL DEFAULT ''; --- ALTER TABLE `#__phocacart_shipping_methods` ADD `tracking_description` text; +-- ALTER TABLE `#__phocacart_shipping_methods` ADD `tracking_description` text NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_shipping_methods` ADD `tracking_link` varchar(255) NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_orders` ADD `tracking_id` int(11) NOT NULL DEFAULT '0'; -- ALTER TABLE `#__phocacart_orders` ADD `tracking_title` varchar(255) NOT NULL DEFAULT ''; --- ALTER TABLE `#__phocacart_orders` ADD `tracking_description_custom` text; +-- ALTER TABLE `#__phocacart_orders` ADD `tracking_description_custom` text NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_orders` ADD `tracking_link_custom` varchar(255) NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_orders` ADD `tracking_number` varchar(255) NOT NULL DEFAULT ''; -- ALTER TABLE `#__phocacart_orders` ADD `tracking_date_shipped` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'; diff --git a/language/en-GB/en-GB.com_phocacart.ini b/language/en-GB/en-GB.com_phocacart.ini index 3a426a25..14e4384b 100644 --- a/language/en-GB/en-GB.com_phocacart.ini +++ b/language/en-GB/en-GB.com_phocacart.ini @@ -16,6 +16,38 @@ COM_PHOCACART_ORDER_PAYMENT_PROCESSED_ADDITIONAL_INFO="" COM_PHOCACART_ORDER_PAYMENT_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO="" COM_PHOCACART_ORDER_PAYMENT_CANCELED_ADDITIONAL_INFO="" + +;[3.1.1 BETA] +COM_PHOCACART_FIELD_REPORT_HEADER_LABEL="Report Header" +COM_PHOCACART_FIELD_REPORT_HEADER_DESC="Set report header" +COM_PHOCACART_REPORT_OPTIONS_LABEL="Report Options" +COM_PHOCACART_FIELD_REPORT_DISPLAY_TAX_LABEL="Report - Display Tax" +COM_PHOCACART_FIELD_REPORT_DISPLAY_TAX_DESC="Set if tax will be displayed in reports" +COM_PHOCACART_FIELD_REPORT_DISPLAY_ROUNDING_LABEL="Report - Display Rounding" +COM_PHOCACART_FIELD_REPORT_DISPLAY_ROUNDING_DESC="Set if rounding will be displayed in reports" +COM_PHOCACART_REPORT="Report" +COM_PHOCACART_VIEW_REPORT_PDF="View Report (PDF)" +COM_PHOCACART_VIEW_REPORT_HTML="View Report (HTML)" +COM_PHOCACART_ONLINE_SHOP="Online Shop" +COM_PHOCACART_SELECT_CURRENCY="Select currency" +COM_PHOCACART_AMOUNT_EXCLUDING_TAX="Amount (excl. tax)" +COM_PHOCACART_AMOUNT_TAX="Amount (tax)" +COM_PHOCACART_AMOUNT_INCLUDING_TAX="Amount (incl. tax)" +COM_PHOCACART_REPORTS="Reports" +COM_PHOCACART_FIELD_BANK_ACCOUNT_NUMBER_LABEL="Bank Account Number" +COM_PHOCACART_FIELD_BANK_ACCOUNT_NUMBER_DESC="Set bank account number" +COM_PHOCACART_FIELD_IBAN_LABEL="IBAN" +COM_PHOCACART_FIELD_IBAN_DESC="Set IBAN" +COM_PHOCACART_FIELD_BIC_SWIFT_LABEL="BIC/SWIFT" +COM_PHOCACART_FIELD_BIC_SWIFT_DESC="Set BIC/SWIFT" +COM_PHOCACART_RECEIPT_AMOUNT_TENDERED="Amount tendered" +COM_PHOCACART_RECEIPT_AMOUNT_CHANGED="Amount changed" +COM_PHOCACART_FIELD_ADDITIONAL_COSTS_SHIPPING_METHOD_LABEL="Additional Costs" +COM_PHOCACART_FIELD_ADDITIONAL_COSTS_SHIPPING_METHOD_DESC="Set additional costs for shipping method. This is a fixed amount added to the cost of the shipping method." +COM_PHOCACART_FIELD_ADDITIONAL_COSTS_PAYMENT_METHOD_LABEL="Additional Costs" +COM_PHOCACART_FIELD_ADDITIONAL_COSTS_PAYMENT_METHOD_DESC="Set additional costs for payment method. This is a fixed amount added to the cost of the payment method." +COM_PHOCACART_FIELD_DEFAULT_ORDER_STATUS_LABEL="Default Order Status" +COM_PHOCACART_FIELD_DEFAULT_ORDER_STATUS_DESC="Set default order status. This status will be set as default when ordering products." ;[3.1.0] COM_PHOCACART_ERROR_YOU_NEED_TO_AGREE_TO_PRIVACY_TERMS_AND_CONDITIONS="Error - you need to agree to privacy terms and conditions" COM_PHOCACART_FIELD_ASK_QUESTION_PRIVACY_CHECKBOX_LABEL="Ask Question Privacy Checkbox Label Text" @@ -54,13 +86,13 @@ COM_PHOCACART_FIELD_INVOICE_SPECIFIC_TOP_DESCRIPTION_DESC="Set invoice specific COM_PHOCACART_FIELD_INVOICE_SPECIFIC_MIDDLE_DESCRIPTION_LABEL="Invoice Specific Middle Description" COM_PHOCACART_FIELD_INVOICE_SPECIFIC_MIDDLE_DESCRIPTION_DESC="Set invoice specific middle description" COM_PHOCACART_FIELD_INVOICE_SPECIFIC_BOTTOM_DESCRIPTION_LABEL="Invoice Specific Bottom Description" -COM_PHOCACART_FIELD_INVOICE_SPECIFIC_BOTTOM_DESCRIPTION_LABEL="Set invoice specific bottom description" +COM_PHOCACART_FIELD_INVOICE_SPECIFIC_BOTTOM_DESCRIPTION_DESC="Set invoice specific bottom description" COM_PHOCACART_FIELD_INVOICE_GLOBAL_TOP_DESCRIPTION_LABEL="Invoice Global Top Description" COM_PHOCACART_FIELD_INVOICE_GLOBAL_TOP_DESCRIPTION_DESC="Set invoice global top description" COM_PHOCACART_FIELD_INVOICE_GLOBAL_MIDDLE_DESCRIPTION_LABEL="Invoice Global Middle Description" COM_PHOCACART_FIELD_INVOICE_GLOBAL_MIDDLE_DESCRIPTION_DESC="Set invoice global middle description" COM_PHOCACART_FIELD_INVOICE_GLOBAL_BOTTOM_DESCRIPTION_LABEL="Invoice Global Bottom Description" -COM_PHOCACART_FIELD_INVOICE_GLOBAL_BOTTOM_DESCRIPTION_LABEL="Set invoice global bottom description" +COM_PHOCACART_FIELD_INVOICE_GLOBAL_BOTTOM_DESCRIPTION_DESC="Set invoice global bottom description" COM_PHOCACART_FIELD_PDF_INVOICE_QR_CODE_LABEL="PDF Invoice QR Code" COM_PHOCACART_FIELD_PDF_INVOICE_QR_CODE_DESC="Set PDF invoice QR code" COM_PHOCACART_WISH_LIST_IS_EMPTY="Wish list is empty" diff --git a/layouts/product_import.php b/layouts/product_import.php index 8305f534..62b0e522 100644 --- a/layouts/product_import.php +++ b/layouts/product_import.php @@ -471,6 +471,14 @@ function filter_xml($matches) { if (isset($v['item']) && $v['item'] != '') { $pcAP = str_getcsv($v['item'], ';', '"'); if (!empty($pcAH) && !empty($pcAP)) { + + $cPcAH = count($pcAH); + $cPcAP = count($pcAP); + if ($cPcAH > $cPcAP) { + $pcAP = array_pad($pcAP, $cPcAH, ''); + } else if ($cPcAH < $cPcAP) { + $pcAH = array_pad($pcAH, $cPcAP, ''); + } $data = array_combine($pcAH, $pcAP); $data['tax_id'] = array(); diff --git a/layouts/report.php b/layouts/report.php new file mode 100644 index 00000000..7e4d7a28 --- /dev/null +++ b/layouts/report.php @@ -0,0 +1,277 @@ +get( 'report_display_tax', 1); +$p['report_display_rounding'] = $d['params']->get( 'report_display_rounding', 1); +$p['report_header'] = $d['params']->get( 'report_header', ''); + + +// STYLE +$cRDoc = 'class="ph-report-doc"'; +$cRHead = 'class="ph-report-header"'; +$cRDate = 'class="ph-report-date"'; +$cRT = 'class="ph-report-table"'; +$cRTRH = 'class="ph-report-table-row-header"'; +$cRTRHC = 'class="ph-report-table-row-header-col"'; +$cRTRI = 'class="ph-report-table-row-items"'; +$cRD = 'class="ph-report-date"'; +$cRON = 'class="ph-report-order-number"'; +$cRC = 'class="ph-report-customer"'; +$cRB = 'class="ph-report-bold"'; +$cRCur = 'class="ph-report-currency"'; +$cRNetto = 'class="ph-report-netto"'; +$cRTax = 'class="ph-report-tax"'; +$cRBrutto = 'class="ph-report-brutto"'; +$cRRounding = 'class="ph-report-rounding"'; +$cRTotalR = 'class="ph-report-total-row"'; +$cRTotalC1 = 'class="ph-report-total-col1"'; +$cRTotalC2 = 'class="ph-report-total-col2"'; +switch($d['format']) { + + case 'raw': + + + $cRDoc = 'style="font-family: sans-serif,arial;"'; + $cRHead = 'style="padding: 3px;"'; + $cRDate = 'style="padding: 3px;"'; + $cRT = 'style="border: 1px solid #f0f0f0;border-collapse:collapse;font-size:90%;width:100%"'; + $cRTRH = 'style="border: 1px solid #f0f0f0;padding:3px;"'; + $cRTRHC = 'style="border: 1px solid #f0f0f0;padding:3px;background: #f7f7f7;"'; + $cRTRI = 'style=""'; + $cRD = 'style="text-align:center;border: 1px solid #f0f0f0;padding:5px;"'; + $cRON = 'style="text-align:center;border: 1px solid #f0f0f0;padding:5px;"'; + $cRC = 'style="text-align:left;border: 1px solid #f0f0f0;padding:5px;"'; + $cRB = 'style="font-weight:bold"'; + $cRCur = 'style="text-align:center;border: 1px solid #f0f0f0;padding:5px;"'; + $cRNetto = 'style="text-align:right;border: 1px solid #f0f0f0;padding:5px;"'; + $cRTax = 'style="text-align:right;border: 1px solid #f0f0f0;padding:5px;"'; + $cRBrutto = 'style="text-align:right;border: 1px solid #f0f0f0;padding:5px;"'; + $cRRounding = 'style="text-align:right;border: 1px solid #f0f0f0;padding:5px;"'; + $cRTotalR = 'style="background: #ffffbf;vertical-align:top;text-align:right;font-weight:bold;border: 1px solid #f0f0f0;padding:5px;"'; + $cRTotalC1 = 'style="text-align:left;vertical-align:left;border: 1px solid #f0f0f0;padding:5px;"'; + $cRTotalC2 = 'style="border: 1px solid #f0f0f0;padding:3px;"'; + + break; + + case 'pdf': + + $cRDoc = 'style="font-family: sans-serif,arial;"'; + $cRHead = 'style="font-family: sans-serif,arial;margin: 0pt;padding: 0pt;"'; + $cRDate = 'style="font-family: sans-serif,arial;margin: 0pt;padding: 0pt;"'; + $cRT = 'style="border: 1pt solid #f0f0f0;border-collapse:collapse;font-size:60%;width:100%" cellpadding="1"'; + $cRTRH = 'style="border: 1pt solid #f0f0f0;"'; + $cRTRHC = 'style="border: 1pt solid #f0f0f0;background-color: #f7f7f7;font-size: 90%"'; + $cRTRI = 'style=""'; + $cRD = 'style="text-align:center;border: 1pt solid #f0f0f0;"'; + $cRON = 'style="text-align:center;border: 1pt solid #f0f0f0;"'; + $cRC = 'style="text-align:left;border: 1pt solid #f0f0f0;padding:5px;"'; + $cRB = 'style="font-weight:bold"'; + $cRCur = 'style="text-align:center;border: 1pt solid #f0f0f0;"'; + $cRNetto = 'style="text-align:right;border: 1pt solid #f0f0f0;"'; + $cRTax = 'style="text-align:right;border: 1pt solid #f0f0f0;"'; + $cRBrutto = 'style="text-align:right;border: 1pt solid #f0f0f0;"'; + $cRRounding = 'style="text-align:right;border: 1pt solid #f0f0f0;"'; + $cRTotalR = 'style="background-color: #ffffbf;vertical-align:top;text-align:right;font-weight:bold;border: 1pt solid #f0f0f0;"'; + $cRTotalC1 = 'style="text-align:left;vertical-align:left;border: 1pt solid #f0f0f0;"'; + $cRTotalC2 = 'style="border: 1pt solid #f0f0f0;"'; + + break; + + default: + break; +} + +echo '
';// start doc + + +if ($d['format'] == 'raw' || $d['format'] == 'pdf') { + + + $header = PhocacartRenderFront::renderArticle($p['report_header'], $d['format']); + if ($header != '') { + echo '
'; + echo $header; + echo '
'; + } + + echo '
'; + echo JText::_('COM_PHOCACART_DATE') . ': '; + echo $d['date_from'] . ' - ' . $d['date_to']; + echo '
'; + + + +} + +// HEADER +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +if ($p['report_display_tax'] == 1) { + echo ''; + echo ''; +} +if ($p['report_display_rounding'] == 1) { + echo ''; +} +if ($p['report_display_tax'] == 1) { + echo ''; +} else { + echo ''; +} + +echo ''; + +// ITEMS +foreach($d['items'] as $k => $v) { + + echo ''; + + // Date + echo ''; + + // Order Number + echo ''; + + // Customer + echo ''; + + // Currency + echo ''; + + + // Total + $price->setCurrency($v->currency_id, $v->id); + + // Netto + if ($p['report_display_tax'] == 1) { + echo ''; + + // Tax + echo ''; + } + + // Rounding + if ($p['report_display_rounding'] == 1) { + echo ''; + } + + + // Brutto + echo ''; + + + echo ''; +} + + +// TOTAL +if (!empty($d['total'])) { + $i = 0; + foreach ($d['total'] as $k => $v) { + + $netto = $brutto = $rounding = $tax = 0; + $nettoTxt = $bruttoTxt = $roundingTxt = $taxTxt = ''; + if (!empty($v)) { + $price->setCurrency($k); + echo ''; + + echo ''; + + if (isset($v['brutto'])) { + $brutto = $v['brutto']; + $bruttoTxt = $price->getPriceFormat($v['brutto'], 0, 1); + } + $rounding = isset($v['rounding']) ? $price->getPriceFormat($v['rounding'], 0, 1) : ''; + if (isset($v['rounding'])) { + $rounding = $v['rounding']; + $roundingTxt = $price->getPriceFormat($v['rounding'], 0, 1); + } + + if (!empty($v['tax'])) { + $taxTxt = ''; + foreach($v['tax'] as $kT => $vT) { + $tax += $vT; + $taxTxt .= isset($taxes[$kT]['title']) ? $taxes[$kT]['title'] . ': ' : ''; + $taxTxt .= $price->getPriceFormat($vT,0,1) . '
'; + } + } + + + + $netto = $brutto - $rounding - $tax; + $nettoTxt = $price->getPriceFormat($netto, 0, 1); + + if ($p['report_display_tax'] == 1) { + echo ''; + echo ''; + } + + if ($p['report_display_rounding'] == 1) { + echo ''; + } + echo ''; + + + + echo ''; + } + $i++; + } +} + + + +echo '
'.JText::_('COM_PHOCACART_DATE').''.JText::_('COM_PHOCACART_ORDER_NUMBER').''.JText::_('COM_PHOCACART_CUSTOMER').''.JText::_('COM_PHOCACART_CURRENCY').''.JText::_('COM_PHOCACART_AMOUNT_EXCLUDING_TAX').''.JText::_('COM_PHOCACART_AMOUNT_TAX').''.JText::_('COM_PHOCACART_ROUNDING').''.JText::_('COM_PHOCACART_AMOUNT_INCLUDING_TAX').''.JText::_('COM_PHOCACART_AMOUNT').'
'; + $dateTime = new DateTime($v->date); + echo $dateTime->format('Y-m-d'); + echo ''.$v->order_number.''; + echo isset($v->user_company) && $v->user_company != '' ? $v->user_company . '
' : ''; + echo isset($v->user_vat_1) && $v->user_vat_1 != '' ? '('.JText::_('COM_PHOCACART_VAT_NUMBER').': ' . $v->user_vat_1 . ')
' : ''; + echo '' . $v->user_name_first . ' ' . $v->user_name_last . '
'; + + echo isset($v->user_address_1) && $v->user_address_1 != '' ? $v->user_address_1 . '
' : ''; + echo isset($v->user_zip) && $v->user_zip != '' ? ' ' . $v->user_zip : ''; + echo isset($v->user_city) && $v->user_city != '' ? ' ' . $v->user_city . '
' : ''; + echo isset($v->user_country) && $v->user_country != '' ? ' ' . $v->user_country : ''; + echo '
'.$v->currency_code.''; + if (isset($v->brutto)) { + $v->rouding = isset($v->rounding) ? $v->rounding : 0; + $v->taxsum = isset($v->taxsum) ? $v->taxsum : 0; + + $netto = $v->brutto - $v->rounding - $v->taxsum; + echo $price->getPriceFormat($netto, 0, 1); + } + echo ''; + if (!empty($v->tax)) { + foreach($v->tax as $kT => $vT) { + echo isset($taxes[$kT]['title']) ? $taxes[$kT]['title'] . ': ' : ''; + echo $price->getPriceFormat($vT,0,1) . '
'; + } + } + echo '
'; + echo isset($v->rounding) ? $price->getPriceFormat($v->rounding, 0, 1): ''; + echo ''; + echo isset($v->brutto) ? $price->getPriceFormat($v->brutto, 0, 1): ''; + echo '
'; + echo '' . JText::_('COM_PHOCACART_TOTAL'). ' '; + echo '('. $price->getPriceCurrencyTitle(). ')'; + echo ''.$nettoTxt.''.$taxTxt.''.$roundingTxt.''.$bruttoTxt.'
'; + +echo '
';// end doc + +echo '

 

'; \ No newline at end of file diff --git a/libraries/phocacart/attribute/attribute.php b/libraries/phocacart/attribute/attribute.php index a88b58a3..e43bd5f0 100644 --- a/libraries/phocacart/attribute/attribute.php +++ b/libraries/phocacart/attribute/attribute.php @@ -572,7 +572,7 @@ public static function getAttributesAndOptions($productId) { - public static function getAllAttributesAndOptions($ordering = 1, $onlyAvailableProducts = 0) { + public static function getAllAttributesAndOptions($ordering = 1, $onlyAvailableProducts = 0, $lang = '') { $db = JFactory::getDBO(); $orderingText = PhocacartOrdering::getOrderingText($ordering, 5); @@ -589,10 +589,21 @@ public static function getAllAttributesAndOptions($ordering = 1, $onlyAvailableP $lefts[] = ' #__phocacart_attributes AS at ON at.id = v.attribute_id'; if ($onlyAvailableProducts == 1) { + + if ($lang != '' && $lang != '*') { + $wheres[] = PhocacartUtilsSettings::getLangQuery('p.language', $lang); + } + $lefts[] = ' #__phocacart_products AS p ON at.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 at.product_id = p.id'; + } } $q = ' SELECT '.$columns @@ -1182,12 +1193,12 @@ public static function getCombinationsStockById($productId, $returnArray = 0) { .' ORDER BY a.id'; $db->setQuery($query); if ($returnArray) { - $discounts = $db->loadAssocList(); + $items = $db->loadAssocList(); } else { - $discounts = $db->loadObjectList(); + $items = $db->loadObjectList(); } - return $discounts; + return $items; } public static function storeCombinationsById($productId, $aosArray, $new = 0) { @@ -1198,6 +1209,7 @@ public static function storeCombinationsById($productId, $aosArray, $new = 0) { $notDeleteItems = array(); + if (!empty($aosArray)) { $values = array(); foreach($aosArray as $k => $v) { diff --git a/libraries/phocacart/cart/cart.php b/libraries/phocacart/cart/cart.php index bf69bfb9..03f5d6f9 100644 --- a/libraries/phocacart/cart/cart.php +++ b/libraries/phocacart/cart/cart.php @@ -877,7 +877,7 @@ public function addShippingCosts($shippingId = 0) { } $price = new PhocacartPrice(); - $priceI = $price->getPriceItemsShipping($sI->cost, $sI->calculation_type, $this->total[0], $sI->taxid, $sI->taxrate, $sI->taxcalculationtype, $sI->taxtitle, $sI->freeshipping, 1, ''); + $priceI = $price->getPriceItemsShipping($sI->cost, $sI->cost_additional, $sI->calculation_type, $this->total[0], $sI->taxid, $sI->taxrate, $sI->taxcalculationtype, $sI->taxtitle, $sI->freeshipping, 1, ''); // CALCULATION $calc = new PhocacartCartCalculation(); @@ -914,7 +914,7 @@ public function addPaymentCosts($paymentId = 0) { } $price = new PhocacartPrice(); - $priceI = $price->getPriceItemsPayment($pI->cost, $pI->calculation_type, $this->total[0], $pI->taxid, $pI->taxrate, $pI->taxcalculationtype, $pI->taxtitle, $pI->freepayment, 1, ''); + $priceI = $price->getPriceItemsPayment($pI->cost, $pI->cost_additional, $pI->calculation_type, $this->total[0], $pI->taxid, $pI->taxrate, $pI->taxcalculationtype, $pI->taxtitle, $pI->freepayment, 1, ''); // CALCULATION diff --git a/libraries/phocacart/category/category.php b/libraries/phocacart/category/category.php index dd94cab3..84cb10e4 100644 --- a/libraries/phocacart/category/category.php +++ b/libraries/phocacart/category/category.php @@ -13,6 +13,7 @@ final class PhocacartCategory { + private static $categoryA = array(); private static $categoryF = array(); private static $categoryP = array(); @@ -224,13 +225,16 @@ public static function categoryTree($d, $r = 0, $pk = 'parent_id', $k = 'id', $c $m[$e[$pk]][] = array_merge($e, array($c => &$m[$e[$k]])); } //return $m[$r][0]; // remove [0] if there could be more than one root nodes - return $m[$r]; + if (isset($m[$r])) { + return $m[$r]; + } + return 0; } public static function nestedToUl($data, $currentCatid = 0) { $result = array(); - if (sizeof($data) > 0) { + if (!empty($data) && count($data) > 0) { $result[] = '
    '; foreach ($data as $k => $v) { $link = JRoute::_(PhocacartRoute::getCategoryRoute($v['id'], $v['alias'])); @@ -258,8 +262,7 @@ public static function nestedToUl($data, $currentCatid = 0) { public static function nestedToCheckBox($data, $d, $currentCatid = 0) { $result = array(); - - if (sizeof($data) > 0) { + if (!empty($data) && count($data) > 0) { $result[] = '
      '; foreach ($data as $k => $v) { @@ -284,9 +287,9 @@ public static function nestedToCheckBox($data, $d, $currentCatid = 0) { return implode($result); } - public static function getCategoryTreeFormat($ordering = 1, $display = '', $hide = '', $type = array(0,1)) { + public static function getCategoryTreeFormat($ordering = 1, $display = '', $hide = '', $type = array(0,1), $lang = '') { - $cis = str_replace(',', '', 'o'.$ordering .'d'. $display .'h'. $hide); + $cis = str_replace(',', '', 'o'.$ordering .'d'. $display .'h'. $hide. 'l'. $lang); if( empty(self::$categoryF[$cis])) { /* phocacart import('phocacart.ordering.ordering');*/ $itemOrdering = PhocacartOrdering::getOrderingText($ordering,1); @@ -299,6 +302,10 @@ public static function getCategoryTreeFormat($ordering = 1, $display = '', $hide $wheres[] = " (gc.group_id IN (".$userGroups.") OR gc.group_id IS NULL)"; $wheres[] = " c.published = 1"; + if ($lang != '' && $lang != '*') { + $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang); + } + if (!empty($type) && is_array($type)) { $wheres[] = " c.type IN (".implode(',', $type).")"; } @@ -332,9 +339,9 @@ public static function getCategoryTreeFormat($ordering = 1, $display = '', $hide return self::$categoryF[$cis]; } - public static function getCategoryTreeArray($ordering = 1, $display = '', $hide = '', $type = array(0,1)) { + public static function getCategoryTreeArray($ordering = 1, $display = '', $hide = '', $type = array(0,1), $lang = '') { - $cis = str_replace(',', '', 'o'.$ordering .'d'. $display .'h'. $hide); + $cis = str_replace(',', '', 'o'.$ordering .'d'. $display .'h'. $hide . 'l'. $lang); if( empty(self::$categoryA[$cis])) { /*phocacart import('phocacart.ordering.ordering');*/ $itemOrdering = PhocacartOrdering::getOrderingText($ordering,1); @@ -347,6 +354,9 @@ public static function getCategoryTreeArray($ordering = 1, $display = '', $hide $wheres[] = " (gc.group_id IN (".$userGroups.") OR gc.group_id IS NULL)"; $wheres[] = " c.published = 1"; + if ($lang != '' && $lang != '*') { + $wheres[] = PhocacartUtilsSettings::getLangQuery('c.language', $lang); + } if (!empty($type) && is_array($type)) { $wheres[] = " c.type IN (".implode(',', $type).")"; diff --git a/libraries/phocacart/filter/filter.php b/libraries/phocacart/filter/filter.php index bcc5f89b..39ad8353 100644 --- a/libraries/phocacart/filter/filter.php +++ b/libraries/phocacart/filter/filter.php @@ -29,6 +29,7 @@ class PhocacartFilter public $ordering_specification = 1; public $manufacturer_title = ''; + public $filter_language = 0; public function __construct() {} @@ -45,9 +46,16 @@ public function renderList() { $layout5 = new JLayoutFile('form_filter_image', null, array('component' => 'com_phocacart')); + $language = ''; + if ($this->filter_language == 1) { + $lang = JFactory::getLanguage(); + $language = $lang->getTag(); + } + $pathProductImage = PhocacartPath::getPath('productimage'); // =FILTER= + $data = array(); $data['getparams'] = array(); //-CATEGORY- ACTIVE CATEGORY @@ -81,7 +89,7 @@ public function renderList() { $data['uniquevalue']= 0; if ((int)$this->category == 2) { - $data['items'] = PhocacartCategory::getCategoryTreeArray(); + $data['items'] = PhocacartCategory::getCategoryTreeArray(1, '', '', array(0,1), $language); $data['output'] = PhocacartCategory::nestedToCheckBox($data['items'], $data); if (!empty($data['items'])) { @@ -118,7 +126,7 @@ public function renderList() { if ($this->tag) { /*phocacart import('phocacart.tag.tag');*/ - $data['items'] = PhocacartTag::getAllTags($this->ordering_tag, 1); + $data['items'] = PhocacartTag::getAllTags($this->ordering_tag, 1, $language); } if (!empty($data['items'])) { @@ -135,7 +143,7 @@ public function renderList() { if ($this->manufacturer) { /*phocacart import('phocacart.manufacturer.manufacturer');*/ - $data['items'] = PhocacartManufacturer::getAllManufacturers($this->ordering_manufacturer, 1); + $data['items'] = PhocacartManufacturer::getAllManufacturers($this->ordering_manufacturer, 1, $language); } if (!empty($data['items'])) { @@ -145,7 +153,7 @@ public function renderList() { // -ATTRIBUTES- AVAILABLE PRODUCTS ONLY - Yes if ($this->attributes) { /*phocacart import('phocacart.attribute.attribute');*/ - $attributes = PhocacartAttribute::getAllAttributesAndOptions($this->ordering_attribute, 1); + $attributes = PhocacartAttribute::getAllAttributesAndOptions($this->ordering_attribute, 1, $language); if (!empty($attributes)) { foreach($attributes as $k => $v) { @@ -182,7 +190,7 @@ public function renderList() { // -SPECIFICATIONS- AVAILABLE PRODUCTS ONLY - Yes if ($this->specifications) { /*phocacart import('phocacart.specification.specification');*/ - $specifications = PhocacartSpecification::getAllSpecificationsAndValues($this->ordering_specification, 1); + $specifications = PhocacartSpecification::getAllSpecificationsAndValues($this->ordering_specification, 1, $language); if (!empty($specifications)) { foreach($specifications as $k => $v) { $data = array(); diff --git a/libraries/phocacart/manufacturer/manufacturer.php b/libraries/phocacart/manufacturer/manufacturer.php index 0a690d7e..65247be8 100644 --- a/libraries/phocacart/manufacturer/manufacturer.php +++ b/libraries/phocacart/manufacturer/manufacturer.php @@ -12,7 +12,9 @@ class PhocacartManufacturer { - public static function getAllManufacturers($ordering = 1, $onlyAvailableProducts = 0) { + + + public static function getAllManufacturers($ordering = 1, $onlyAvailableProducts = 0, $lang = '') { $db = JFactory::getDBO(); $orderingText = PhocacartOrdering::getOrderingText($ordering, 4); @@ -27,11 +29,27 @@ public static function getAllManufacturers($ordering = 1, $onlyAvailableProducts $wheres[] = ' m.published = 1'; + if ($lang != '' && $lang != '*') { + + $wheres[] = PhocacartUtilsSettings::getLangQuery('m.language', $lang); + } + if ($onlyAvailableProducts == 1) { + + if ($lang != '' && $lang != '*') { + $wheres[] = PhocacartUtilsSettings::getLangQuery('p.language', $lang); + } + $lefts[] = ' #__phocacart_products AS p ON m.id = p.manufacturer_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 m.id = p.manufacturer_id'; + } } $q = ' SELECT DISTINCT '.$columns diff --git a/libraries/phocacart/order/calculation.php b/libraries/phocacart/order/calculation.php new file mode 100644 index 00000000..ab69118c --- /dev/null +++ b/libraries/phocacart/order/calculation.php @@ -0,0 +1,207 @@ +posbruttocalculation = PhocacartPos::isPos() ? $paramsC->get( 'pos_brutto_calculation', 1 ) : 0; + } + + public function getItems() { + return $this->items; + } + + public function getTotal() { + return $this->total; + } + + public function getCurrencies() { + return $this->currencies; + } + + + public function calculateOrderItems($items) { + + $itemsIdA = array();// array of all items IDs - only IDs - ALL ASKED ORDERS + $itemsIdS = '';// string of all items IDs used in SQL query IN + $itemsId = array();// all items sorted by ID - the ID is the key of the array + $itemsTotal = array();// ALL TOTAL ROWS OF EACH ASKED ORDER ITEMS + + //$price = new PhocacartPrice(); + //$price->getPriceFormat($v['amount'],0,1); + + if (!empty($items)) { + foreach($items as $k => $v) { + $id = (int)$v->id; + $itemsIdA[] = $id; + $itemsId[$id] = $v; + $currencyId = $v->currency_id; + if ($currencyId > 0 && !isset($currency[$currencyId])) { + $this->currencies[$currencyId] = $v->currency_code; + } + } + + if (!empty($itemsIdA)) { + $itemsIdS = implode(',', $itemsIdA); + } + + if ($itemsIdS != '') { + $itemsTotal = PhocacartOrder::getItemsTotal($itemsIdS); + } + + $this->items = $itemsId; + + /* $itemsTotalSorted = array(); + if (!empty($itemsTotal)) { + foreach($itemsTotal as $k => $v) { + $id = $v['id']; + $orderId = $v['order_id']; + + $itemsTotalSorted[$orderId][$id] = $v; + } + }*/ + + + if (!empty($itemsTotal)) { + + + // Define defaults so we can add (+) + foreach($this->currencies as $k => $v) { + $this->total[$k]['brutto'] = 0; + $this->total[$k]['netto'] = 0; + $this->total[$k]['rounding'] = 0; + $this->total[$k]['discount'] = 0; + // no tax here as there are different rates for tax + } + + + foreach($itemsTotal as $k => $v) { + + + + $id = $v['order_id']; + $itemId = $v['item_id']; //for example, there can be different types of VAT: 5% 10% 20% + $currencyId = $this->items[$id]->currency_id; + $r = $this->items[$id]->currency_exchange_rate; + + + + switch($v['type']) { + + case 'brutto': + $brutto = isset($v['amount_currency']) && $v['amount_currency'] > 0 ? $v['amount_currency'] : $v['amount'] * $r; + if (isset($this->items[$id]->brutto)) { + $this->items[$id]->brutto += $brutto; + } else { + $this->items[$id]->brutto = $brutto; + } + $this->total[$currencyId]['brutto'] += $brutto; + break; + + + case 'sbrutto': + case 'pbrutto': + case 'dbrutto': + + break; + + + + case 'snetto': + case 'pnetto': + case 'netto': + + $netto = $v['amount']*$r; + if (isset($this->items[$id]->netto)) { + $this->items[$id]->netto += $netto; + + } else { + $this->items[$id]->netto = $netto; + } + $this->total[$currencyId]['netto'] += $netto; + break; + + case 'rounding': + + $rounding = isset($v['amount_currency']) && $v['amount_currency'] > 0 ? $v['amount_currency'] : $v['amount']*$r; + if (isset($this->items[$id]->rounding)) { + $this->items[$id]->rounding += $rounding; + } else { + $this->items[$id]->rounding = $rounding; + } + + $this->total[$currencyId]['rounding'] += $rounding; + break; + + case 'stax': + case 'ptax': + case 'tax': + $tax = $v['amount']*$r; + if (isset($this->items[$id]->tax[$itemId])) { + $this->items[$id]->tax[$itemId] += $tax; + } else { + $this->items[$id]->tax[$itemId] = $tax; + } + + if (isset($this->items[$id]->taxsum)) { + $this->items[$id]->taxsum += $tax;// sum of all taxes in one order + } else { + $this->items[$id]->taxsum = $tax;// sum of all taxes in one order + } + + if (isset($this->total[$currencyId]['tax'][$itemId])) { + $this->total[$currencyId]['tax'][$itemId] += $tax; + } else { + $this->total[$currencyId]['tax'][$itemId] = $tax; + } + + + break; + + case 'dnetto': + $dNetto = $v['amount']*$r; + if (isset($this->items[$id]->discount)) { + $this->items[$id]->discount += $dNetto; + + } else { + $this->items[$id]->discount = $dNetto; + + } + $this->total[$currencyId]['discount'] += $dNetto; + break; + + } + } + + return true; + + } + + return false; + } + + } +} +?> \ No newline at end of file diff --git a/libraries/phocacart/order/order.php b/libraries/phocacart/order/order.php index 665e2dca..06fb580b 100644 --- a/libraries/phocacart/order/order.php +++ b/libraries/phocacart/order/order.php @@ -1,4 +1,6 @@ getTotal(); - + // -------------------- // TERMS AND CONDITIONS, PRIVACY // -------------------- @@ -88,7 +90,9 @@ public function saveOrderMain($data) { // -------------------- // CHECK GUEST USER // -------------------- - if ((!isset($user->id) || (isset($user->id) && $user->id < 1)) && $guest == false) { + + if ((!isset($user->id) || (isset($user->id) && $user->id < 1)) && $guest == false && !PhocacartPos::isPos()) { + $msg =JText::_('COM_PHOCACART_GUEST_CHECKOUT_DISABLED') . $msgSuffix; $app->enqueueMessage($msg, 'error'); return false; @@ -187,7 +191,7 @@ public function saveOrderMain($data) { // SET STATUS - $statusId = 1;// Ordered (Pending) + $statusId = $pC->get( 'default_order_status', 1 );// Ordered (Pending) as default $dispatcher = JEventDispatcher::getInstance(); $plugin = JPluginHelper::importPlugin('pcp', htmlspecialchars(strip_tags($payment['method']))); if ($plugin) { @@ -198,9 +202,18 @@ public function saveOrderMain($data) { $d['status_id'] = $statusId;// no plugin or no event found } - + $d['type'] = PhocacartType::getTypeByTypeArray($this->type); + // Data order + $d['comment'] = isset($data['phcomment']) ? $data['phcomment'] : ''; + $d['privacy'] = isset($data['privacy']) ? (int)$data['privacy'] : ''; + + // Data POS + $d['amount_pay'] = isset($data['amount_pay']) ? $data['amount_pay'] : 0; + $d['amount_tendered'] = isset($data['amount_tendered']) ? $data['amount_tendered'] : 0; + $d['amount_change'] = isset($data['amount_change']) ? $data['amount_change'] : 0; + $d['published'] = 1; $d['shipping_id'] = (int)$shippingId; $d['payment_id'] = (int)$payment['id']; @@ -208,8 +221,6 @@ public function saveOrderMain($data) { $d['currency_id'] = (int)$currency->id; $d['currency_code'] = $currency->code; $d['currency_exchange_rate']= $currency->exchange_rate; - $d['comment'] = $data['comment']; - $d['privacy'] = (int)$data['privacy']; $d['ip'] = (!empty($_SERVER['REMOTE_ADDR'])) ? (string) $_SERVER['REMOTE_ADDR'] : ''; $user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? (string) $_SERVER['HTTP_USER_AGENT'] : ''; $d['user_agent'] = substr($user_agent, 0, 200); @@ -601,7 +612,7 @@ public function saveOrderMain($data) { $d2['amount'] = $v['tax']; $d2['ordering'] = $ordering; $d2['published']= 1; - $d2['item_id'] = 0; + $d2['item_id'] = (int)$k;// ID (Type) of VAT (10% or 20%) $this->saveOrderTotal($d2); $ordering++; } @@ -1469,7 +1480,7 @@ public static function getInvoiceNumber($orderId, $date = false, $invoiceNumber /* $order_date = $orderDate != '' ? $orderDate : self::getOrderDate($orderId); $invoice_prefix = $invoicePrefix != '' ? $invoicePrefix : $paramsC->get('invoice_prefix', ''); - $invoice_number_format = $invoiceNumberFormat != '' ? $invoiceNumberFormat : $paramsC->get( 'invoice_number_format', '{prefix}{orderdate}{orderid}'); + $invoice_number_format = $invoiceNumberFormat != '' ? $invoiceNumberFormat : $paramsC->get( 'invoice_number_format', ''); $invoice_number_chars = $invoiceNumberChars != '' ? $invoiceNumberChars : $paramsC->get( 'invoice_number_chars', 12); @@ -1565,7 +1576,7 @@ public static function getPaymentReferenceNumber($orderId, $date = false, $prmNu return $o; } - public static function getInvoiceDueDate($id, $date = false, $dueDate = false, $formatOutput = '') { + public static function getInvoiceDueDate($orderId, $date = false, $dueDate = false, $formatOutput = '') { if ($dueDate) { if ($formatOutput != '') { @@ -1589,6 +1600,49 @@ public static function getInvoiceDueDate($id, $date = false, $dueDate = false, $ } else { return $dateTime->format('Y-m-d h:m:s'); } - } + } + + public static function getInvoiceDate($orderId, $date = false, $formatOutput = '') { + + $date = !$date ? self::getOrderDate($orderId) : $date; + + $dateTime = new DateTime($date); + + if ($formatOutput != '') { + return JHtml::date($dateTime->format('Y-m-d h:m:s'), $formatOutput); + } else { + return $dateTime->format('Y-m-d h:m:s'); + } + } + + /** + * + * @param string $oIdS - order IDs separated by comma + * @return array + * + * Get all total items by selected order Ids + * e.g. Order 1 -> total 1 (netto), total 2 (vat), total 3(brutton), etc. + */ + + public static function getItemsTotal($oIdS = '') { + + $db = JFactory::getDBO(); + $wheres = array(); + if ($oIdS != '') { + $wheres[] = 'a.order_id IN ('.$oIdS.')'; + } + + $query = 'SELECT a.id, a.order_id, a.item_id, a.title, a.type, a.amount, a.amount_currency' + . ' FROM #__phocacart_order_total AS a'; + if (!empty($wheres)) { + $query .= ' WHERE ' . implode( ' AND ', $wheres ); + } + $db->setQuery($query); + + + $items = $db->loadAssocList(); + return $items; + + } } \ No newline at end of file diff --git a/libraries/phocacart/order/render.php b/libraries/phocacart/order/render.php index 9c1ddfa1..1781038d 100644 --- a/libraries/phocacart/order/render.php +++ b/libraries/phocacart/order/render.php @@ -103,6 +103,7 @@ public function render($id, $type = 1, $format = 'html', $token = '', $pos = 0) if ($type == 2 && $format == 'pdf') { $r = PhocacartText::prepareReplaceText($order, $id, $d['common'], $d['bas']); $d['qrcode'] = PhocacartText::completeText($pdf_invoice_qr_code, $r, 1); + } //if ($type == 4 && $format == 'raw') { diff --git a/libraries/phocacart/order/status.php b/libraries/phocacart/order/status.php index 7ac455f9..8bcbbc51 100644 --- a/libraries/phocacart/order/status.php +++ b/libraries/phocacart/order/status.php @@ -90,6 +90,7 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not $app = JFactory::getApplication(); $order = new PhocacartOrderView(); $common = $order->getItemCommon($orderId); + $orderNumber= PhocacartOrder::getOrderNumber($orderId, $common->date); $bas = $order->getItemBaS($orderId, 1); //$totalBrutto= $order->getItemTotal($orderId, 0, 'brutto'); $status = self::getStatus($statusId); @@ -442,10 +443,12 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not $r['name'] = $name; $r['name_others'] = ''; + + // EMAIL CUSTOMER if ($status['email_subject'] != '') { - $emailSubject = PhocacartEmail::completeMail($status['email_subject'], $r, 1); + $emailSubject = PhocacartText::completeText($status['email_subject'], $r, 1); $subject = $emailSubject;// .' ' . JText::_('COM_PHOCACART_ORDER_NR'). ': '.$r['ordernumber']; } else if ($status['title'] != '') { @@ -453,7 +456,7 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not } // EMAIL OTHERS if ($status['email_subject_others'] != '') { - $emailSubjectO = PhocacartEmail::completeMail($status['email_subject_others'], $r, 2); + $emailSubjectO = PhocacartText::completeText($status['email_subject_others'], $r, 2); $subjectOthers = $emailSubjectO;// .' ' . JText::_('COM_PHOCACART_ORDER_NR'). ': '.$r['ordernumber']; } else if ($status['title'] != '') { $subjectOthers = $sitename. ' - ' .$status['title'].' ' . JText::_('COM_PHOCACART_ORDER_NR'). ': '.$r['ordernumber']; @@ -471,9 +474,10 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not $body = PhocacartText::completeTextFormFields($body, $bas['s'], 2); $bodyOthers = PhocacartText::completeTextFormFields($bodyOthers, $bas['s'], 2); - + + // PDF $pdfV = array(); $attachmentContent = ''; @@ -506,7 +510,7 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not if ($pdfV['pdf'] == 1 && ($attachment_format == 1 || $attachment_format == 2)) { $staticData = array(); - $orderNumber = PhocacartOrder::getOrderNumber($orderId, $common->date); + //$orderNumber = PhocacartOrder::getOrderNumber($orderId, $common->date); $staticData['option'] = 'com_phocacart'; $staticData['title'] = JText::_('COM_PHOCACART_ORDER_NR'). ': '. $orderNumber; $staticData['file'] = '';// Must be empty to not save the pdf to server @@ -573,6 +577,15 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not break; } + + + JPluginHelper::importPlugin( 'system' ); + $dispatcher = JEventDispatcher::getInstance(); + JPluginHelper::importPlugin('plgSystemMultilanguagesck'); + $dispatcher->trigger('onChangeText', array(&$subject)); + $dispatcher->trigger('onChangeText', array(&$subjectOthers)); + $dispatcher->trigger('onChangeText', array(&$body)); + $dispatcher->trigger('onChangeText', array(&$bodyOthers)); //} @@ -587,7 +600,7 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not // body (custom text) --> don't add status message /*if ($body == '') { - $body = JText::_('COM_PHOCACART_ORDER_NR'). ': '.$orderNr .' - '. JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ': '.$status['title']; + $body = JText::_('COM_PHOCACART_ORDER_NR'). ': '.$orderNumber .' - '. JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ': '.$status['title']; }*/ $notify = 0; @@ -595,7 +608,7 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not // CUSTOMERS if ($recipient != '' && JMailHelper::isEmailAddress($recipient)) { if ($emptyBody == 1) { - $body = JText::_('COM_PHOCACART_ORDER_NR'). ': '.$orderNr .' - '. JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ': '.$status['title'] . '
      '. $body; + $body = JText::_('COM_PHOCACART_ORDER_NR'). ': '.$orderNumber .' - '. JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ': '.$status['title'] . '
      '. $body; } // Notify @@ -611,7 +624,7 @@ public static function changeStatus( $orderId, $statusId, $orderToken = '', $not // OTHERS if ($recipientOthers != '' && JMailHelper::isEmailAddress($recipientOthers)) { if ($emptyBodyOthers == 1) { - $bodyOthers = JText::_('COM_PHOCACART_ORDER_NR'). ': '.$orderNr .' - '. JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ': '.$status['title'] . '
      '. $bodyOthers; + $bodyOthers = JText::_('COM_PHOCACART_ORDER_NR'). ': '.$orderNumber .' - '. JText::_('COM_PHOCACART_ORDER_STATUS_CHANGED_TO') . ': '.$status['title'] . '
      '. $bodyOthers; } $notifyOthers = PhocacartEmail::sendEmail('', '', $recipientOthers, $subjectOthers, $bodyOthers, true, null, $bcc, $attachmentContent, $attachmentName); diff --git a/libraries/phocacart/payment/payment.php b/libraries/phocacart/payment/payment.php index 3d48c3c4..dd6178e7 100644 --- a/libraries/phocacart/payment/payment.php +++ b/libraries/phocacart/payment/payment.php @@ -67,7 +67,7 @@ public function getPossiblePaymentMethods($amountNetto, $amountBrutto, $country, } - $columns = 'p.id, p.tax_id, p.cost, p.calculation_type, p.title, p.image, p.access, p.description,' + $columns = 'p.id, p.tax_id, p.cost, p.cost_additional, p.calculation_type, p.title, p.image, p.access, p.description,' .' p.active_amount, p.active_zone, p.active_country, p.active_region, p.active_shipping,' .' p.lowest_amount, p.highest_amount, p.default,' .' t.id as taxid, t.title as taxtitle, t.tax_rate as taxrate, t.calculation_type as taxcalculationtype,' @@ -75,7 +75,7 @@ public function getPossiblePaymentMethods($amountNetto, $amountBrutto, $country, .' GROUP_CONCAT(DISTINCT c.country_id) AS country,' .' GROUP_CONCAT(DISTINCT z.zone_id) AS zone,' .' GROUP_CONCAT(DISTINCT s.shipping_id) AS shipping'; - $groupsFull = 'p.id, p.tax_id, p.cost, p.calculation_type, p.title, p.image, p.access, p.description,' + $groupsFull = 'p.id, p.tax_id, p.cost, p.cost_additional, p.calculation_type, p.title, p.image, p.access, p.description,' .' p.active_amount, p.active_zone, p.active_country, p.active_region, p.active_shipping,' .' p.lowest_amount, p.highest_amount, p.default,' .' t.id, t.title, t.tax_rate, t.calculation_type'; @@ -288,7 +288,7 @@ public function getPaymentMethod($paymentId) { .' LIMIT 1'; $db->setQuery($query);*/ - $query = ' SELECT p.id, p.tax_id, p.cost, p.calculation_type, p.title, p.image, p.method, p.params, p.description, ' + $query = ' SELECT p.id, p.tax_id, p.cost, p.cost_additional, p.calculation_type, p.title, p.image, p.method, p.params, p.description, ' .' t.id as taxid, t.title as taxtitle, t.tax_rate as taxrate, t.calculation_type as taxcalculationtype' .' FROM #__phocacart_payment_methods AS p' .' LEFT JOIN #__phocacart_taxes AS t ON t.id = p.tax_id' diff --git a/libraries/phocacart/pdf/pdf.php b/libraries/phocacart/pdf/pdf.php index 85da9176..cb25084f 100644 --- a/libraries/phocacart/pdf/pdf.php +++ b/libraries/phocacart/pdf/pdf.php @@ -23,8 +23,10 @@ public static function skipStartAndLastTag($text, $tag = 'p') { $pattern = "=^<".$tag.">(.*)$=i"; preg_match($pattern, $text, $matches); - return $matches[1]; - + if (isset($matches[1])) { + return $matches[1]; + } + return $text; } } ?> \ No newline at end of file diff --git a/libraries/phocacart/pos/print.php b/libraries/phocacart/pos/print.php index cbd8c868..791ee1c3 100644 --- a/libraries/phocacart/pos/print.php +++ b/libraries/phocacart/pos/print.php @@ -263,7 +263,7 @@ public function printOrder($o) { if (strpos($v, '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
      \n \n
        \n
        '},a.prototype.get_multi_html=function(){return'
          \n
        • \n \n
        • \n
        \n
        \n
          \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;t0?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
          \n \n
            \n
            '},t.prototype.get_multi_html=function(){return'
              \n
            • \n \n
            • \n
            \n
            \n
              \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 @@ COM_PHOCACART_WISH_LISTS COM_PHOCACART_QUESTIONS COM_PHOCACART_STATISTICS + COM_PHOCACART_REPORTS COM_PHOCACART_HITS COM_PHOCACART_IMPORT COM_PHOCACART_EXPORT 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" + +?>
              ';// 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']. '
              '; } ?> + + +
               
              @@ -125,4 +128,9 @@
              -
              \ 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 @@ ?>