Skip to content

Commit

Permalink
namespace stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Grissinger committed May 16, 2016
1 parent de3285e commit 46a74d7
Show file tree
Hide file tree
Showing 71 changed files with 100 additions and 94 deletions.
4 changes: 2 additions & 2 deletions controllers/single_page/dashboard/store/products.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ public function save()


if ($data['pID']) {
$this->redirect('/dashboard/store/products/edit/' . $product->getProductID(), 'updated');
$this->redirect('/dashboard/store/products/', 'updated');
} else {
$this->redirect('/dashboard/store/products/edit/' . $product->getProductID(), 'success');
$this->redirect('/dashboard/store/products/', 'success');
}
}//if no errors
}//if post
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Key/StoreOrderKey.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\Attribute\Key;
namespace Concrete\Package\VividStore\Src\Attribute\Key;

use Database;
use \Concrete\Core\Attribute\Value\ValueList as AttributeValueList;
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Key/StoreProductKey.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\Attribute\Key;
namespace Concrete\Package\VividStore\Src\Attribute\Key;

use Database;
use \Concrete\Core\Attribute\Value\ValueList as AttributeValueList;
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Value/StoreOrderValue.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\Attribute\Value;
namespace Concrete\Package\VividStore\Src\Attribute\Value;

use Database;
use \Concrete\Core\Attribute\Value\Value as Value;
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Value/StoreProductValue.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\Attribute\Value;
namespace Concrete\Package\VividStore\Src\Attribute\Value;

use Database;
use \Concrete\Core\Attribute\Value\Value as Value;
Expand Down
9 changes: 7 additions & 2 deletions src/VividStore/Cart/Cart.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Cart;
namespace Concrete\Package\VividStore\Src\VividStore\Cart;

use Session;
use Database;
use \Concrete\Package\VividStore\Src\VividStore\Product\Product as StoreProduct;
use \Concrete\Package\VividStore\Src\VividStore\Shipping\ShippingMethod as StoreShippingMethod;
use \Concrete\Package\VividStore\Src\VividStore\Product\ProductVariation\ProductVariation as StoreProductVariation;
use \Concrete\Package\VividStore\Src\VividStore\Utilities\Calculator as StoreCalculator;

defined('C5_EXECUTE') or die(_("Access Denied."));
class Cart
{
protected static $cart = null;
Expand Down Expand Up @@ -363,4 +363,9 @@ public function createsAccount()

return false;
}
//deprecated
public function getTotal()
{
return StoreCalculator::getGrandTotal();
}
}
2 changes: 1 addition & 1 deletion src/VividStore/Cart/CartModal.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Cart;
namespace Concrete\Package\VividStore\Src\VividStore\Cart;

use \Concrete\Core\Controller\Controller as RouteController;
use View;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Cart/CartTotal.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Cart;
namespace Concrete\Package\VividStore\Src\VividStore\Cart;

use \Concrete\Core\Controller\Controller as RouteController;
use \Concrete\Package\VividStore\Src\VividStore\Utilities\Price as StorePrice;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Customer/Customer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Customer;
namespace Concrete\Package\VividStore\Src\VividStore\Customer;

use Session;
use User;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Group/Group.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Group;
namespace Concrete\Package\VividStore\Src\VividStore\Group;

use Database;

Expand Down
9 changes: 3 additions & 6 deletions src/VividStore/Group/GroupList.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Group;
namespace Concrete\Package\VividStore\Src\VividStore\Group;

use Database;

class GroupList
{
public static function getGroupList()
{
$queryBuilder = Database::get()->getEntityManager()->createQueryBuilder();
return $queryBuilder->select('g')
->from('\Concrete\Package\VividStore\Src\VividStore\Group\Group', 'g')
->getQuery()
->getResult();
$em = Database::get()->getEntityManager();
return $em->createQuery('select g from \Concrete\Package\VividStore\Src\VividStore\Group\Group g')->getResult();
}
}
2 changes: 1 addition & 1 deletion src/VividStore/Order/Order.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Order;
namespace Concrete\Package\VividStore\Src\VividStore\Order;

use Database;
use User;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Order/OrderDiscount.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Order;
namespace Concrete\Package\VividStore\Src\VividStore\Order;


/**
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Order/OrderEvent.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Order;
namespace Concrete\Package\VividStore\Src\VividStore\Order;

use \Symfony\Component\EventDispatcher\GenericEvent;

Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Order/OrderItem.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Order;
namespace Concrete\Package\VividStore\Src\VividStore\Order;

use Database;
use Concrete\Package\VividStore\Src\VividStore\Order\Order as StoreOrder;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Order/OrderItemOption.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Order;
namespace Concrete\Package\VividStore\Src\VividStore\Order;


/**
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Order/OrderList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Order;
namespace Concrete\Package\VividStore\Src\VividStore\Order;

use Database;
use Concrete\Core\Search\Pagination\Pagination;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Order/OrderStatus/OrderStatus.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Order\OrderStatus;
namespace Concrete\Package\VividStore\Src\VividStore\Order\OrderStatus;

use \Concrete\Core\Utility\Service\Text as TextHelper;
use Database;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Order/OrderStatus/OrderStatusHistory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Order\OrderStatus;
namespace Concrete\Package\VividStore\Src\VividStore\Order\OrderStatus;

use Database;
use Events;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Payment/Method.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Payment;
namespace Concrete\Package\VividStore\Src\VividStore\Payment;

use Concrete\Core\Foundation\Object as Object;
use Database;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Payment\Methods\AuthNet;
namespace Concrete\Package\VividStore\Src\VividStore\Payment\Methods\AuthNet;

use Core;
use Config;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Payment\Methods\Invoice;
namespace Concrete\Package\VividStore\Src\VividStore\Payment\Methods\Invoice;

use Core;
use Config;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Payment\Methods\PaypalStandard;
namespace Concrete\Package\VividStore\Src\VividStore\Payment\Methods\PaypalStandard;

use Core;
use URL;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Product/Product.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product;
namespace Concrete\Package\VividStore\Src\VividStore\Product;

use Package;
use Page;
Expand Down
34 changes: 18 additions & 16 deletions src/VividStore/Product/ProductFile.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product;
namespace Concrete\Package\VividStore\Src\VividStore\Product;

use Database;
use \Concrete\Package\VividStore\Src\VividStore\Product\Product as StoreProduct;
Expand Down Expand Up @@ -76,21 +76,23 @@ public static function addFilesForProduct(array $files, StoreProduct $product)
{
self::removeFilesForProduct($product);
//add new ones.
foreach ($files['dffID'] as $fileID) {
if (!empty($fileID) && $fileID > 0) {
self::add($product->getProductID(), $fileID);
$fileObj = \File::getByID($fileID);
$fs = \FileSet::getByName("Digital Downloads");
$fs->addFileToSet($fileObj);
$fileObj->resetPermissions(1);
$pk = \Concrete\Core\Permission\Key\FileKey::getByHandle('view_file');
$pk->setPermissionObject($fileObj);
$pao = $pk->getPermissionAssignmentObject();
$groupEntity = \Concrete\Core\Permission\Access\Entity\GroupEntity::getOrCreate(\Group::getByID(GUEST_GROUP_ID));
$pa = $pk->getPermissionAccessObject();
if ($pa) {
$pa->removeListItem($groupEntity);
$pao->assignPermissionAccess($pa);
if(!empty($files['dffID'])) {
foreach ($files['dffID'] as $fileID) {
if (!empty($fileID) && $fileID > 0) {
self::add($product->getProductID(), $fileID);
$fileObj = \File::getByID($fileID);
$fs = \FileSet::getByName("Digital Downloads");
$fs->addFileToSet($fileObj);
$fileObj->resetPermissions(1);
$pk = \Concrete\Core\Permission\Key\FileKey::getByHandle('view_file');
$pk->setPermissionObject($fileObj);
$pao = $pk->getPermissionAssignmentObject();
$groupEntity = \Concrete\Core\Permission\Access\Entity\GroupEntity::getOrCreate(\Group::getByID(GUEST_GROUP_ID));
$pa = $pk->getPermissionAccessObject();
if ($pa) {
$pa->removeListItem($groupEntity);
$pao->assignPermissionAccess($pa);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Product/ProductGroup.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product;
namespace Concrete\Package\VividStore\Src\VividStore\Product;

use Database;
use \Concrete\Package\VividStore\Src\VividStore\Group as StoreGroup;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Product/ProductImage.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product;
namespace Concrete\Package\VividStore\Src\VividStore\Product;

use Database;
use File;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Product/ProductList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product;
namespace Concrete\Package\VividStore\Src\VividStore\Product;

use Concrete\Core\Search\Pagination\Pagination;
use Concrete\Core\Search\ItemList\Database\AttributedItemList;
Expand Down
6 changes: 4 additions & 2 deletions src/VividStore/Product/ProductLocation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product;
namespace Concrete\Package\VividStore\Src\VividStore\Product;

use Database;
use \Concrete\Package\VividStore\Src\VividStore\Product\Product as StoreProduct;
Expand Down Expand Up @@ -69,7 +69,9 @@ public static function addLocationsForProduct(array $locations, StoreProduct $pr
//add new ones.
if (!empty($locations['cID'])) {
foreach ($locations['cID'] as $cID) {
self::add($product->getProductID(), $cID);
if($cID>0) {
self::add($product->getProductID(), $cID);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Product/ProductModal.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product;
namespace Concrete\Package\VividStore\Src\VividStore\Product;

use \Concrete\Core\Controller\Controller;
use View;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Product/ProductOption/ProductOption.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product\ProductOption;
namespace Concrete\Package\VividStore\Src\VividStore\Product\ProductOption;

use \Concrete\Package\VividStore\Src\VividStore\Product\ProductOption\ProductOptionGroup as StoreProductOptionGroup;
use \Concrete\Package\VividStore\Src\VividStore\Product\ProductOption\ProductOptionItem as StoreProductOptionItem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product\ProductOption;
namespace Concrete\Package\VividStore\Src\VividStore\Product\ProductOption;

use Database;
use \Concrete\Package\VividStore\Src\VividStore\Product\Product as StoreProduct;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Product/ProductOption/ProductOptionItem.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product\ProductOption;
namespace Concrete\Package\VividStore\Src\VividStore\Product\ProductOption;

use Database;
use \Concrete\Package\VividStore\Src\VividStore\Product\Product as StoreProduct;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Product/ProductUserGroup.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product;
namespace Concrete\Package\VividStore\Src\VividStore\Product;

use Database;
use \Concrete\Package\VividStore\Src\VividStore\Product\Product as StoreProduct;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product\ProductVariation;
namespace Concrete\Package\VividStore\Src\VividStore\Product\ProductVariation;

use \Concrete\Package\VividStore\Src\VividStore\Product\Product as StoreProduct;
use \Concrete\Package\VividStore\Src\VividStore\Product\ProductVariation\ProductVariationOptionItem as StoreProductVariationOptionItem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Product\ProductVariation;
namespace Concrete\Package\VividStore\Src\VividStore\Product\ProductVariation;

use Database;

Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Promotion/Promotion.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Promotion;
namespace Concrete\Package\VividStore\Src\VividStore\Promotion;


/**
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Promotion/PromotionReward.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Promotion;
namespace Concrete\Package\VividStore\Src\VividStore\Promotion;

use Database;

Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Promotion/PromotionRewardType.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Promotion;
namespace Concrete\Package\VividStore\Src\VividStore\Promotion;

use Database;
use Core;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Promotion/PromotionRewardTypeReward.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Promotion;
namespace Concrete\Package\VividStore\Src\VividStore\Promotion;

use Database;
use Controller;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Promotion\PromotionRewards;
namespace Concrete\Package\VividStore\Src\VividStore\Promotion\PromotionRewards;

use Database;
use Core;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Promotion\PromotionRewards;
namespace Concrete\Package\VividStore\Src\VividStore\Promotion\PromotionRewards;

use Database;
use Core;
Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Promotion/PromotionRule.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Promotion;
namespace Concrete\Package\VividStore\Src\VividStore\Promotion;

use Database;

Expand Down
2 changes: 1 addition & 1 deletion src/VividStore/Promotion/PromotionRuleType.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Concrete\Package\VividStore\src\VividStore\Promotion;
namespace Concrete\Package\VividStore\Src\VividStore\Promotion;

use Database;
use Core;
Expand Down
Loading

0 comments on commit 46a74d7

Please sign in to comment.