Permalink
Browse files

3.0.1

  • Loading branch information...
1 parent af8c33b commit e6a753c0f5eb76fdb5787cff6748ed21253e06ba Kris Thom White committed Jul 29, 2013
Showing with 1,336 additions and 324 deletions.
  1. +20 −0 _index.php
  2. +24 −0 core/protected/components/ApplicationComponent.php
  3. +1 −0 core/protected/components/Controller.php
  4. +24 −0 core/protected/components/ShoppingCart.php
  5. +100 −3 core/protected/components/helpers.php
  6. +3 −2 core/protected/config/wsver.php
  7. +10 −7 core/protected/controllers/InstallController.php
  8. +8 −3 core/protected/controllers/MyaccountController.php
  9. +5 −0 core/protected/controllers/ProductController.php
  10. +49 −20 core/protected/controllers/SearchController.php
  11. +4 −4 core/protected/controllers/SiteController.php
  12. +5 −0 core/protected/controllers/WishlistController.php
  13. +1 −1 core/protected/extensions/wsamazon/wsamazon.php
  14. +3 −0 core/protected/extensions/wscron/wscron.php
  15. +5 −1 core/protected/extensions/wsmailchimp/wsmailchimp.php
  16. +6 −1 core/protected/extensions/wspayment/cheque/models/chequeAdminForm.php
  17. +17 −2 core/protected/extensions/wspayment/cheque/models/chequeform.php
  18. +7 −1 core/protected/extensions/wspayment/phoneorder/models/phoneorderAdminForm.php
  19. +9 −1 core/protected/extensions/wspayment/phoneorder/models/phoneorderform.php
  20. +17 −12 core/protected/models/Cart.php
  21. +2 −5 core/protected/models/CartItem.php
  22. +7 −3 core/protected/models/Category.php
  23. +64 −0 core/protected/models/Classes.php
  24. +6 −0 core/protected/models/Configuration.php
  25. +1 −0 core/protected/models/Customer.php
  26. +13 −11 core/protected/models/CustomerAddress.php
  27. +4 −0 core/protected/models/Destination.php
  28. +52 −0 core/protected/models/Family.php
  29. +17 −30 core/protected/models/Product.php
  30. +3 −1 core/protected/models/WishlistItem.php
  31. +8 −2 core/protected/models/forms/BaseCheckoutForm.php
  32. +7 −0 core/protected/models/forms/LoginForm.php
  33. +2 −1 core/protected/modules/admin/assets/css/admin.css
  34. +4 −1 core/protected/modules/admin/assets/js/destinationrates.js
  35. +4 −1 core/protected/modules/admin/assets/js/edit.js
  36. +4 −1 core/protected/modules/admin/assets/js/integratedcats.js
  37. +1 −1 core/protected/modules/admin/assets/js/pay.js
  38. +4 −1 core/protected/modules/admin/assets/js/shippingrestrictions.js
  39. +4 −1 core/protected/modules/admin/assets/js/tiers.js
  40. +4 −1 core/protected/modules/admin/assets/js/wishlist.js
  41. +1 −0 core/protected/modules/admin/components/AdminBaseController.php
  42. +4 −3 core/protected/modules/admin/controllers/CustompageController.php
  43. +5 −5 core/protected/modules/admin/controllers/DatabaseadminController.php
  44. +22 −44 core/protected/modules/admin/controllers/DefaultController.php
  45. +3 −6 core/protected/modules/admin/controllers/PaymentsController.php
  46. +3 −5 core/protected/modules/admin/controllers/ShippingController.php
  47. +87 −30 core/protected/modules/admin/controllers/ThemeController.php
  48. +434 −0 core/protected/modules/admin/controllers/UpgradeController.php
  49. +0 −6 core/protected/modules/admin/signatures.php
  50. +1 −0 core/protected/modules/admin/views/databaseadmin/_pay.php
  51. +0 −15 core/protected/modules/admin/views/databaseadmin/customers.php
  52. +1 −16 core/protected/modules/admin/views/databaseadmin/products.php
  53. +0 −15 core/protected/modules/admin/views/databaseadmin/translate.php
  54. +1 −16 core/protected/modules/admin/views/databaseadmin/unpaid.php
  55. +1 −1 core/protected/modules/admin/views/default/index.php
  56. +23 −0 core/protected/modules/admin/views/default/newtemplate.php
  57. +3 −4 core/protected/modules/admin/views/default/newversion.php
  58. +16 −1 core/protected/modules/admin/views/layouts/column1.php
  59. +2 −2 core/protected/modules/admin/views/layouts/license.php
  60. +1 −1 core/protected/modules/admin/views/shipping/countries.php
  61. +7 −2 core/protected/modules/admin/views/shipping/destinations.php
  62. +18 −4 core/protected/modules/admin/views/theme/manage.php
  63. +124 −0 core/protected/modules/admin/views/upgrade/index.php
  64. +7 −1 core/protected/views-cities/cart/_cartitems.php
  65. +1 −1 core/protected/views-cities/custompage/contact.php
  66. +1 −1 core/protected/views-cities/custompage/index.php
  67. +3 −1 core/protected/views-cities/product/index.php
  68. +1 −1 core/protected/views-cities/site/_header.php
  69. +1 −1 core/protected/views-cities/site/error.php
  70. +1 −0 core/themes/brooklyn/config.xml
  71. +1 −1 core/themes/brooklyn/css/style.css
  72. BIN images/header/defaultheader.png
  73. +34 −23 install.php
View
@@ -0,0 +1,20 @@
+<?php
+
+// change the following paths if necessary
+$yii=dirname(__FILE__).'/core/framework/yii.php';
+$config=dirname(__FILE__).'/config/main.php';
+
+if(!file_exists($config))
+{
+ header("Location: install.php");
+ exit;
+}
+
+//To put Web Store in Debug mode (Required for trace logging), uncomment the following two lines
+//defined('YII_DEBUG') or define('YII_DEBUG',true);
+//defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
+
+require_once($yii);
+
+Yii::createWebApplication($config)->run();
+
@@ -0,0 +1,24 @@
+<?php
+/*
+ * Empty event handlers so we can extend without causing errors
+ */
+class ApplicationComponent extends CApplicationComponent {
+
+
+
+ //For CEventProduct,CEventPhoto,CEventOrder
+ public function onSaveProduct($event) {}
+ public function onUpdateInventory($event) {}
+ public function onActionProductView($event) {}
+ public function onDownloadOrders($event) {}
+ public function OnActionUploadProduct($event) {}
+ public function OnActionUploadPrice($event) {}
+
+ public function OnActionUploadPhoto($event) {}
+ public function OnActionUploadInventory($event) {}
+ public function OnActionVerifyProductUpload($event) {}
+ public function OnActionVerifyProductUpdate($event) {}
+ public function OnActionListOrders($event) {}
+
+
+}
@@ -120,6 +120,7 @@ public function init() {
}
Yii::app()->shoppingcart->UpdateMissingProducts();
+ Yii::app()->shoppingcart->RevalidatePromoCode();
//Run other functions to create some data we always need
$this->buildGoogle();
@@ -397,6 +397,30 @@ public function UpdateMissingProducts()
/**
+ * Make sure our promo code still applies
+ */
+ public function RevalidatePromoCode()
+ {
+ if ($this->model->fk_promo_id)
+ {
+ $objPromo = PromoCode::model()->findByPk($this->model->fk_promo_id);
+ $objPromo->validatePromocode('code',null);
+ $arrErrors = $objPromo->getErrors();
+ $errCount = count($arrErrors);
+ if ($errCount>0)
+ {
+ Yii::app()->user->setFlash('error',
+ Yii::t('cart','Promo Code {promocode} removed. {reason}',
+ array('{promocode}'=>"<strong>".$objPromo->code."</strong>",
+ '{reason}'=>_xls_convert_errors_display(_xls_convert_errors($arrErrors)))));
+ $this->model->fk_promo_id = NULL;
+ $this->model->ResetDiscounts();
+ }
+ }
+ }
+
+
+ /**
* Disassociate the cart with the current session. Should be done after payment
* is complete but before redirecting to receipt.
*/
@@ -54,6 +54,18 @@ function _xls_site_url($strUrlPath = '') {
return _xls_site_dir($usessl) . '/' . $strUrlPath;
}
+function _xls_theme_config($theme)
+{
+ $fnOptions = YiiBase::getPathOfAlias('webroot')."/themes/".$theme."/config.xml";
+
+ if (file_exists($fnOptions))
+ {
+ $strXml = file_get_contents($fnOptions);
+ return new SimpleXMLElement($strXml);
+ } else return null;
+
+}
+
function _xls_regionalize($str)
{
$c = Yii::app()->params['DEFAULT_COUNTRY'];
@@ -132,7 +144,13 @@ function _xls_get_events($strEventHandler)
$objModules = $dataProvider->getData();
foreach ($objModules as $module)
- Yii::import('ext.'.$module->module.".".$module->module);
+ {
+ //See if the extension actually exists either in custom file or our core
+ if(file_exists(Yii::getPathOfAlias('custom.extensions.'.$module->module.".".$module->module).".php"))
+ Yii::import('custom.extensions.'.$module->module.".".$module->module);
+ elseif(file_exists(Yii::getPathOfAlias('ext.'.$module->module.".".$module->module).".php"))
+ Yii::import('ext.'.$module->module.".".$module->module);
+ }
return $objModules;
}
@@ -177,7 +195,7 @@ function _xls_convert_errors_display($arrErrors)
$strReturn = "\n";
foreach ($arrErrors as $key=>$value)
{
- $strReturn .= $key.": ".$value."\n";
+ $strReturn .= $value."\n";
}
return $strReturn;
@@ -1369,7 +1387,9 @@ function _xls_is_ipad() {
*/
function _xls_is_iphone() {
- if (strpos($_SERVER['HTTP_USER_AGENT'],'iPhone') || strpos($_SERVER['HTTP_USER_AGENT'],'iPod'))
+ if(isset($_SERVER['HTTP_USER_AGENT']) &&
+ strpos($_SERVER['HTTP_USER_AGENT'],'iPhone') ||
+ strpos($_SERVER['HTTP_USER_AGENT'],'iPod'))
return true;
else return false;
}
@@ -1404,6 +1424,60 @@ function _xls_avail_languages()
}
+function _xls_check_version()
+{
+ $url = "http://updater.lightspeedretail.com";
+ //$url = "http://www.lsvercheck.site";
+
+
+ $storeurl = Yii::app()->createAbsoluteUrl("/");
+ $storeurl = str_replace("http://","",$storeurl);
+ $storeurl = str_replace("https://","",$storeurl);
+
+ $oXML = _xls_theme_config(Yii::app()->theme->name);
+
+ if(!is_null($oXML))
+ {
+ $strTheme = Yii::app()->theme->name;
+ $strThemeVersion = _xls_number_only((string)$oXML->version);
+ if(isset($oXML->noupdate) && $oXML->noupdate=='true' && $strTheme != "brooklyn")
+ $strThemeVersion="noupdate";
+
+ } else {
+ $strTheme = "unknown";
+ $strThemeVersion="noupdate";
+ }
+ $data['webstore'] = array(
+ 'version' => XLSWS_VERSIONBUILD,
+ 'customer' => $storeurl,
+ 'type' => (_xls_get_conf('LIGHTSPEED_HOSTING')==1 ? "hosted" : "self"),
+ 'theme' => $strTheme,
+ 'themeversion' => $strThemeVersion,
+ 'schema' => _xls_get_conf('DATABASE_SCHEMA_VERSION')
+
+ );
+ $json = json_encode($data);
+
+ $ch = curl_init($url);
+
+ curl_setopt($ch, CURLOPT_VERBOSE, 1);
+
+ curl_setopt($ch, CURLOPT_HEADER, false);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 15);
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
+ curl_setopt($ch, CURLOPT_HTTPHEADER,
+ array("Content-type: application/json"));
+ curl_setopt($ch, CURLOPT_POST, true);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
+
+ $resp = curl_exec($ch);
+ curl_close($ch);
+ return $resp;
+}
+
function _xls_parse_language($string)
{
$pattern = "|<".Yii::app()->language.".*>(.*)</".Yii::app()->language.">|U";
@@ -1738,3 +1812,26 @@ function recurse_copy($src,$dst) {
}
closedir($dir);
}
+function rrmdir($dir) {
+ if (is_dir($dir)) {
+ $files = scandir($dir);
+ foreach ($files as $file)
+ if ($file != "." && $file != "..") rrmdir("$dir/$file");
+ rmdir($dir);
+ }
+ else if (file_exists($dir)) unlink($dir);
+}
+
+// Function to Copy folders and files
+function rcopy($src, $dst) {
+ if (file_exists ( $dst ))
+ rrmdir ( $dst );
+ if (is_dir ( $src )) {
+ mkdir ( $dst );
+ $files = scandir ( $src );
+ foreach ( $files as $file )
+ if ($file != "." && $file != "..")
+ rcopy ( "$src/$file", "$dst/$file" );
+ } else if (file_exists ( $src ))
+ copy ( $src, $dst );
+}
@@ -1,4 +1,5 @@
<?php
-define('XLSWS_VERSION', '3.0.0.1');
-define('XLSWS_VERSIONBUILD', 3001);
+define('XLSWS_VERSION', '3.0.1');
+define('XLSWS_VERSIONBUILD', 3010);
+define('XLSWS_BUILDDATE', '2013-07-29 14:18:41');
@@ -75,11 +75,12 @@ public function actionFixlink()
public function actionExportConfig()
{
+ if(isset($_GET['debug']))
+ Yii::log("Exporting Configuration", 'error', 'application.'.__CLASS__.".".__FUNCTION__);
+
Configuration::exportConfig();
Configuration::exportLogging();
-
-
echo json_encode(array('result'=>"success"));
}
@@ -90,11 +91,12 @@ public function actionUpgrade()
{
$this->online = _xls_number_only($_POST['online']);
-
+ if(isset($_GET['debug']))
+ Yii::log("InstallController on line ".$this->online, 'error', 'application.'.__CLASS__.".".__FUNCTION__);
if ($this->online==1) $retval = $this->actionConvertStart();
- if ($this->online==2) $retval = $this->actionConvertAddressBook();
- if ($this->online==8) $retval = $this->actionConvertModules();
- if ($this->online>=9 && $this->online<=13) $retval = $this->actionConvertGoogle();
+ if ($this->online==2) $retval = $this->actionConvertAddressBook();
+ if ($this->online==8) $retval = $this->actionConvertModules();
+ if ($this->online>=9 && $this->online<=13) $retval = $this->actionConvertGoogle();
if ($this->online==14) $retval = $this->actionConvertKeywordsToTags();
if ($this->online==15) $retval = $this->actionConvertFamilies();
if ($this->online==16) $retval = $this->actionConvertClasses();
@@ -121,7 +123,8 @@ public function actionUpgrade()
*/
protected function actionConvertStart()
{
-
+ if(isset($_GET['debug']))
+ Yii::log("Exporting Configuration", 'error', 'application.'.__CLASS__.".".__FUNCTION__);
Configuration::exportConfig();
Configuration::exportLogging();
@@ -44,7 +44,7 @@ public function actionIndex()
$model = Customer::GetCurrent();
$this->breadcrumbs = array(
- 'My Account'=>$this->createUrl("/myaccount"),
+ Yii::t('global','My Account')=>$this->createUrl("/myaccount"),
);
$this->render('index',array('model'=>$model));
@@ -151,8 +151,8 @@ public function actionEdit()
}
$this->breadcrumbs = array(
- 'My Account'=>$this->createUrl("/myaccount"),
- 'Edit'=>$this->createUrl("myaccount/edit"),
+ Yii::t('global','My Account')=>$this->createUrl("/myaccount"),
+ Yii::t('global','Edit Account')=>$this->createUrl("myaccount/edit"),
);
$model->password = null; //don't bother sending password to form
@@ -166,6 +166,11 @@ public function actionAddress()
if (Yii::app()->user->isGuest)
$this->redirect($this->createUrl("/myaccount"));
+ $this->breadcrumbs = array(
+ Yii::t('global','My Account')=>$this->createUrl("/myaccount"),
+ Yii::t('global','Add an address')=>$this->createUrl("myaccount/address"),
+ );
+
$model = new CustomerAddress();
$model->country_id = _xls_get_conf('DEFAULT_COUNTRY',224);
$checkout = new CheckoutForm();
@@ -87,6 +87,11 @@ public function actionView() {
$this->CanonicalUrl = $this->createAbsoluteUrl($model->Link);
$this->returnUrl = $this->CanonicalUrl;
$model->intQty=1;
+
+ //Raise any events first
+ $objEvent = new CEventProduct(get_class($this),'onActionProductView',$model);
+ _xls_raise_events('CEventProduct',$objEvent);
+
$this->render('index',array(
'model'=>$model,
'WishlistAddForm'=>$objWishlistAddForm,
Oops, something went wrong.

0 comments on commit e6a753c

Please sign in to comment.