diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..73ed97db3 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at support@bagisto.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/README.md b/README.md index 71c8a1f4e..404a12870 100755 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Bagisto is using power of both of these frameworks and making best out of it out **Run this Command** to download the project on to your local machine or server: ->> Note: If you have downloaded zip file then ignore this. +> Note: If you have downloaded zip file then ignore this. ~~~ composer create-project bagisto/bagisto @@ -89,11 +89,12 @@ default. **Run these Commands Below** ->> Run this command below, if installing from the zip else skip: +> Run this command, in case installing from the zip else skip this command (no need to run this command if you are creating project through composer): ~~~ composer install ~~~ +> Continue run these command below: ~~~ php artisan migrate ~~~ @@ -115,6 +116,14 @@ composer dump-autoload > That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory. +> **Note: you can fetch your admin panel by follow below url:** +~~~ +http(s)://example.com/admin/login +~~~ +~~~ +email:admin@example.com +password:admin123 +~~~ ### 5. License Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE). diff --git a/config/datagrid.php b/config/datagrid.php index c9b1ddc6c..aeaf51a57 100644 --- a/config/datagrid.php +++ b/config/datagrid.php @@ -5,7 +5,7 @@ return [ /** * Default Select Value */ - 'select' => 'id', + 'default_index' => 'id', /** * Default OrderBy @@ -13,8 +13,9 @@ return [ * * Accepted Values = Array */ 'order' => [ - 'column' => 'id', - 'direction' => 'desc' + 'default' => 'descending', + 'descending' => 'desc', + 'ascending' => 'asc' ], /** @@ -29,7 +30,7 @@ return [ * * Accepted Value = integer */ - // 'pagination' => 10, + 'paginate' => false, 'operators' => [ 'eq' => "=", @@ -84,6 +85,6 @@ return [ 7 => "orders", 8 => "limit", 9 => "offset", - 10 => "lock", + 10 => "lock" ] ]; \ No newline at end of file diff --git a/packages/Webkul/API/Http/Controllers/Customer/AddressController.php b/packages/Webkul/API/Http/Controllers/Customer/AddressController.php index 633ce6dec..8bfabb0f9 100755 --- a/packages/Webkul/API/Http/Controllers/Customer/AddressController.php +++ b/packages/Webkul/API/Http/Controllers/Customer/AddressController.php @@ -28,7 +28,7 @@ class AddressController extends Controller $this->customerAddress = $customerAddress; - if(auth()->guard('customer')->check()) { + if (auth()->guard('customer')->check()) { $this->customer = auth()->guard('customer')->user(); } else { $this->customer['message'] = 'unauthorized'; @@ -46,7 +46,7 @@ class AddressController extends Controller * @return response JSON */ public function get() { - if($this->customer == false) { + if ($this->customer == false) { return response()->json($this->customer, 401); } else { $addresses = $this->customer->addresses; @@ -56,7 +56,7 @@ class AddressController extends Controller } public function getDefault() { - if($this->customer == false) { + if ($this->customer == false) { return response()->json($this->customer, 401); } else { $defaultAddress = $this->customer->default_address; @@ -89,13 +89,13 @@ class AddressController extends Controller $cust_id['customer_id'] = $this->customer->id; $data = array_merge($cust_id, $data); - if($this->customer->addresses->count() == 0) { + if ($this->customer->addresses->count() == 0) { $data['default_address'] = 1; } $result = $this->customerAddress->create($data); - if($result) { + if ($result) { return response()->json(true, 200); } else { return response()->json(false, 200); @@ -111,11 +111,11 @@ class AddressController extends Controller public function makeDefault($id) { $defaultAddress = $this->customer->default_address; - if($defaultAddress != null && $defaultAddress->count() > 0) { + if ($defaultAddress != null && $defaultAddress->count() > 0) { $defaultAddress->update(['default_address' => 0]); } - if($this->customerAddress->find($id)->default_address == 1) { + if ($this->customerAddress->find($id)->default_address == 1) { return response()->json(false, 200); } diff --git a/packages/Webkul/API/Http/Controllers/Customer/AuthController.php b/packages/Webkul/API/Http/Controllers/Customer/AuthController.php index d0b1976b0..5cdd21aeb 100755 --- a/packages/Webkul/API/Http/Controllers/Customer/AuthController.php +++ b/packages/Webkul/API/Http/Controllers/Customer/AuthController.php @@ -26,8 +26,8 @@ class AuthController extends Controller public function create() { $data = request()->except('_token'); - if(!auth()->guard('customer')->check()) { - if(!auth()->guard('customer')->attempt($data)) { + if (! auth()->guard('customer')->check()) { + if (! auth()->guard('customer')->attempt($data)) { return response()->json(['message' => 'unauthenticated', 'details' => 'invalid creds'], 401); } else { return response()->json(['message' => 'authenticated', 'user' => auth()->guard('customer')->user()], 200); diff --git a/packages/Webkul/API/Http/Controllers/Customer/CustomerController.php b/packages/Webkul/API/Http/Controllers/Customer/CustomerController.php index b2bf1203b..3888fb25f 100755 --- a/packages/Webkul/API/Http/Controllers/Customer/CustomerController.php +++ b/packages/Webkul/API/Http/Controllers/Customer/CustomerController.php @@ -23,7 +23,7 @@ class CustomerController extends Controller public function __construct() { - if(auth()->guard('customer')->check()) { + if (auth()->guard('customer')->check()) { $this->customer = auth()->guard('customer')->user(); } else { $this->customer['message'] = 'unauthorized'; @@ -63,10 +63,10 @@ class CustomerController extends Controller $data = collect(request()->all())->toArray(); - if($data['oldpassword'] == null) { + if ($data['oldpassword'] == null) { $data = collect(request()->input())->except([ 'oldpassword', 'password', 'password_confirmation'])->toArray(); } else { - if(Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) { + if (Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) { $data = collect(request()->input())->toArray(); $data['password'] = bcrypt($data['password']); @@ -77,7 +77,7 @@ class CustomerController extends Controller $result = $this->customer->update($data); - if($result) { + if ($result) { return response()->json(true, 200); } else { return response()->json(false, 200); @@ -92,7 +92,7 @@ class CustomerController extends Controller public function getAllCart() { $carts = $this->customer->carts; - if($cart->count() > 0) { + if ($cart->count() > 0) { return response()->json(['message' => 'successful','items' => $cart], 200); } else { return response()->json(['message' => 'empty', 'items' => null], 200); @@ -102,11 +102,11 @@ class CustomerController extends Controller public function getActiveCart() { $cart = Cart::getCart(); - if($cart == null) { + if ($cart == null) { return response()->json(['message' => 'empty', 'items' => 'null']); } - if($cart->count() > 0 ) { + if ($cart->count() > 0 ) { return response()->json(['message' => 'success', 'items' => $cart]); } else { return response()->json(['message' => 'empty', 'items' => 'null']); diff --git a/packages/Webkul/API/Http/Controllers/Customer/WishlistController.php b/packages/Webkul/API/Http/Controllers/Customer/WishlistController.php index d2fbd9446..3f10f1545 100755 --- a/packages/Webkul/API/Http/Controllers/Customer/WishlistController.php +++ b/packages/Webkul/API/Http/Controllers/Customer/WishlistController.php @@ -24,7 +24,7 @@ class WishlistController extends Controller public function __construct(Product $product, Wishlist $wishlist) { - if(auth()->guard('customer')->check()) { + if (auth()->guard('customer')->check()) { $this->product = $product; $this->wishlist = $wishlist; $this->customer = auth()->guard('customer')->user(); @@ -43,7 +43,7 @@ class WishlistController extends Controller { $wishlist = $this->customer->wishlist_items; - if($wishlist->count() > 0) { + if ($wishlist->count() > 0) { return response()->json($wishlist, 200); } else { return response()->json(['message' => 'Wishlist Empty', 'Items' => null], 200); @@ -67,14 +67,14 @@ class WishlistController extends Controller ]; //accidental case if some one adds id of the product in the anchor tag amd gives id of a variant. - if($product->parent_id != null) { + if ($product->parent_id != null) { $data['product_id'] = $productId = $product->parent_id; } $checked = $this->wishlist->findWhere(['channel_id' => core()->getCurrentChannel()->id, 'product_id' => $productId, 'customer_id' => auth()->guard('customer')->user()->id]); - if($checked->isEmpty()) { - if($wishlistItem = $this->wishlist->create($data)) { + if ($checked->isEmpty()) { + if ($wishlistItem = $this->wishlist->create($data)) { return response()->json(['message' => 'Successfully Added Item To Wishlist', 'items' => $wishlistItem], 200); } else { return response()->json(['message' => 'Error! Cannot Add Item To Wishlist', 'items' => null], 401); @@ -93,7 +93,7 @@ class WishlistController extends Controller { $result = $this->wishlist->deleteWhere(['customer_id' => auth()->guard('customer')->user()->id, 'channel_id' => core()->getCurrentChannel()->id, 'id' => $itemId]); - if($result) { + if ($result) { return response()->json(['message' => 'Item Successfully Removed From Wishlist', 'status' => $result]); } else { return response()->json(['message' => 'Error! While Removing Item From Wishlist', 'status' => $result]); diff --git a/packages/Webkul/API/Http/Controllers/Product/ReviewController.php b/packages/Webkul/API/Http/Controllers/Product/ReviewController.php index 0f7140e9f..dcbce5f01 100755 --- a/packages/Webkul/API/Http/Controllers/Product/ReviewController.php +++ b/packages/Webkul/API/Http/Controllers/Product/ReviewController.php @@ -89,7 +89,7 @@ class ReviewController extends Controller $result = $this->productReview->create($data); - if($result) { + if ($result) { return response()->json(['message' => 'success', 'status' => $result]); } else { return response()->json(['message' => 'failed', 'status' => $result]); diff --git a/packages/Webkul/API/Http/Controllers/Shop/CartController.php b/packages/Webkul/API/Http/Controllers/Shop/CartController.php index 836aec630..eef1404f6 100755 --- a/packages/Webkul/API/Http/Controllers/Shop/CartController.php +++ b/packages/Webkul/API/Http/Controllers/Shop/CartController.php @@ -39,7 +39,7 @@ class CartController extends Controller public function get() { $cart = Cart::getCart(); - if($cart == null || $cart == 'null') { + if ($cart == null || $cart == 'null') { return response()->json(['message' => 'empty', 'items' => null]); } @@ -54,7 +54,7 @@ class CartController extends Controller public function add($id) { $result = Cart::add($id, request()->all()); - if($result) { + if ($result) { Cart::collectTotals(); return response()->json(['message' => 'successful', 'items' => Cart::getCart()->items]); @@ -84,7 +84,7 @@ class CartController extends Controller public function onePage() { $cart = Cart::getCart(); - if($cart == null || $cart == 'null') { + if ($cart == null || $cart == 'null') { return response()->json(['message' => 'empty', 'items' => null]); } @@ -102,13 +102,13 @@ class CartController extends Controller public function updateOnePage() { $request = request()->except('_token'); - foreach($request['qty'] as $id => $quantity) { - if($quantity <= 0) { + foreach ($request['qty'] as $id => $quantity) { + if ($quantity <= 0) { return response()->json(['message' => 'Illegal Quantity', 'status' => 'error']); } } - foreach($request['qty'] as $key => $value) { + foreach ($request['qty'] as $key => $value) { $item = $this->cartItem->findOneByField('id', $key); $data['quantity'] = $value; diff --git a/packages/Webkul/Admin/publishable/assets/css/admin.css b/packages/Webkul/Admin/publishable/assets/css/admin.css index d4b2be071..8f7f3bc94 100755 --- a/packages/Webkul/Admin/publishable/assets/css/admin.css +++ b/packages/Webkul/Admin/publishable/assets/css/admin.css @@ -1 +1 @@ -@import url(https://fonts.googleapis.com/css?family=Montserrat:400,500);body{margin:0;color:#3a3a3a;font-family:Montserrat,sans-serif;font-size:14px;font-weight:500;position:static;min-height:100%}.navbar-top{height:60px;background:#fff;font-size:0;-webkit-box-shadow:0 3px 6px 0 rgba(0,0,0,.05);box-shadow:0 3px 6px 0 rgba(0,0,0,.05);border-bottom:1px solid hsla(0,0%,64%,.2);position:fixed;left:0;right:0;z-index:5}.navbar-top .navbar-top-left{width:50%;height:60px;display:inline-block;vertical-align:middle}.navbar-top .navbar-top-left .brand-logo{padding:10px}.navbar-top .navbar-top-right{width:50%;height:60px;text-align:right;display:inline-block;vertical-align:middle}.navbar-top .navbar-top-right .profile-info{display:inline-block;vertical-align:middle;text-align:left;min-width:50px;padding:12px 0;margin:0 25px 0 30px;font-size:15px;cursor:pointer;position:relative}.navbar-top .navbar-top-right .profile-info .dropdown-list{top:63px}.navbar-top .navbar-top-right .profile-info .name{color:#000311;display:block;text-align:left}.navbar-top .navbar-top-right .profile-info .role{font-size:14px;color:#8e8e8e;display:block;text-align:left}.navbar-top .navbar-top-right .profile-info i.icon{margin-left:10px}.navbar-left{position:absolute;top:60px;bottom:0;width:90px;padding-top:20px;height:auto;border-right:1px solid hsla(0,0%,64%,.2);z-index:2}.navbar-left ul.menubar li.menu-item{height:90px;padding:10px 5px;font-size:11px;text-align:center;text-transform:uppercase}.navbar-left ul.menubar li.menu-item a{color:#a2a2a2}.navbar-left ul.menubar li.menu-item.active a{color:#0041ff}.content-container{padding-left:90px;position:absolute;margin-top:60px;top:0;right:0;left:0;bottom:0;overflow-x:hidden;overflow-y:auto}.content-container .aside-nav{width:280px;position:fixed;top:60px;bottom:0;border-right:1px solid hsla(0,0%,64%,.2);background:#f8f9fa;padding-top:10px;overflow-y:auto;z-index:4}.content-container .aside-nav a{padding:15px;display:block;color:#000311}.content-container .aside-nav .active a{background:#fff;border-top:1px solid hsla(0,0%,64%,.2);border-bottom:1px solid hsla(0,0%,64%,.2)}.content-container .aside-nav .active i{float:right}.content-container .content-wrapper{padding:25px 25px 25px 305px}.content-container .content{padding:25px 0}.content-container .content.full-page{padding:25px}.content-container .content .page-header{display:inline-block;margin-bottom:20px;width:100%}.content-container .content .page-header .page-title{float:left}.content-container .content .page-header .page-title h1{margin-bottom:0;vertical-align:middle;display:inline-block}.content-container .content .page-header .page-action{float:right}.content-container .content .page-header .page-action *{display:inline-block}.content-container .content .page-header .page-action a{margin-left:25px}.content-container .content .page-header .control-group{width:180px;display:inline-block;margin-bottom:0;margin-left:20px}.content-container .content .page-header .control{width:100%;margin:0}.content-container .content .page-content{width:100%;display:inline-block}.control-group label{width:70%}.control-group label .locale{float:right;color:#8e8e8e}.control-group .mce-tinymce{margin-top:10px;margin-bottom:5px}.dashboard .page-header{margin-bottom:0!important;padding-bottom:15px;border-bottom:1px solid hsla(0,0%,64%,.2)}.dashboard .page-content{margin-top:15px}.dashboard .card{height:445px;background:#fff;border:1px solid #e7e7e7;-webkit-box-shadow:0 5px 10px 2px rgba(0,0,0,.08);box-shadow:0 5px 10px 2px rgba(0,0,0,.08);border-radius:2px;padding:20px 0 0 20px}.dashboard .card .card-title{font-size:14px;color:#a2a2a2;letter-spacing:-.26px;text-transform:uppercase}.dashboard .card .card-info{width:100%;height:100%;display:inline-block}.dashboard .card .card-info.center{text-align:center}.dashboard .card .card-info ul li{border-bottom:1px solid hsla(0,0%,64%,.2);width:100%;display:inline-block;padding:10px 0;position:relative}.dashboard .card .card-info ul li .image{height:60px;width:60px;float:left;margin-right:15px}.dashboard .card .card-info ul li .image.product{background:#f2f2f2}.dashboard .card .card-info ul li .image img{width:100%}.dashboard .card .card-info ul li .description{margin-top:10px}.dashboard .card .card-info ul li .description .name{color:#0041ff}.dashboard .card .card-info ul li .description .info{color:#3a3a3a;margin-top:5px}.dashboard .card .card-info ul li .icon.angle-right-icon{position:absolute;right:30px;top:50%;margin-top:-8px}.dashboard .card .card-info ul li:last-child{border-bottom:0}.dashboard .card .card-info .no-result-found{margin-top:146px}.dashboard .card .card-info .no-result-found p{margin:0;color:#a2a2a2}.dashboard .dashboard-stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));grid-auto-rows:auto;grid-column-gap:30px;grid-row-gap:15px}.dashboard .dashboard-stats .dashboard-card{height:100px;background:#fff;border:1px solid #e7e7e7;-webkit-box-shadow:0 5px 10px 2px rgba(0,0,0,.08);box-shadow:0 5px 10px 2px rgba(0,0,0,.08);border-radius:5px;position:relative;padding:15px}.dashboard .dashboard-stats .dashboard-card .title{font-size:14px;color:#a2a2a2;text-transform:uppercase}.dashboard .dashboard-stats .dashboard-card .data{padding-top:3px;font-size:32px;color:#0041ff}.dashboard .dashboard-stats .dashboard-card .data .progress{font-size:14px;color:#8e8e8e;float:right;margin-top:9px}.dashboard .dashboard-stats .dashboard-card .data .progress .icon{vertical-align:middle}.dashboard .graph-stats{margin-top:30px;width:100%;display:inline-block}.dashboard .graph-stats .left-card-container{float:left;width:75%;padding-right:9px}.dashboard .graph-stats .right-card-container{float:left;width:25%;padding-left:21px}.dashboard .sale-stock{width:100%;display:inline-block;display:grid;grid-template-columns:repeat(auto-fill,minmax(435px,1fr));grid-auto-rows:auto;grid-column-gap:30px;grid-row-gap:15px;margin-top:30px}.sale-container .sale-section{font-size:16px}.sale-container .sale-section .secton-title{font-size:18px;color:#8e8e8e;padding:15px 0;border-bottom:1px solid hsla(0,0%,64%,.2)}.sale-container .sale-section .section-content{display:block;padding:20px 0}.sale-container .sale-section .section-content .row{display:block;padding:7px 0}.sale-container .sale-section .section-content .row .title{width:200px;color:#3a3a3a;letter-spacing:-.26px;display:inline-block}.sale-container .sale-section .section-content .row .value{color:#3a3a3a;letter-spacing:-.26px;display:inline-block}.sale-container .table .qty-row{display:block;margin-bottom:5px}.sale-container .table .qty-row:last-child{margin-bottom:0}.sale-container .table .radio{margin:0}.sale-container .sale-summary{margin-top:2%;height:130px;float:right}.sale-container .sale-summary tr td{padding:5px 8px}.sale-container .sale-summary tr.bold{font-weight:600;font-size:15px}.sale-container .sale-summary tr.border td{border-bottom:1px solid hsla(0,0%,64%,.2)}.stars{margin-top:5px}.stars .icon{width:16px;height:16px}.export{cursor:pointer}.export .export-icon{position:relative;top:10px}.export span{margin-left:2px}.rtl{direction:rtl}.rtl .navbar-top .navbar-top-right{text-align:left}.rtl .navbar-top .navbar-top-right .profile-info{margin:0 30px 0 25px}.rtl .navbar-top .navbar-top-right .profile-info i.icon{margin-left:0;margin-right:10px}.rtl .navbar-left{border-left:1px solid hsla(0,0%,64%,.2);border-right:none}.rtl .content-container{padding-right:90px;padding-left:0}.rtl .content-container .content .page-header .page-title{float:right}.rtl .content-container .content .page-header .page-action{float:left}.rtl .content-container .content .page-header .control-group{margin-right:20px;margin-left:0}.rtl .content-container .content .page-header .control-group.date:after{margin-top:6px;position:absolute;margin-right:-35px}.rtl .content-container .content .page-header .control-group.date:last-child{margin-left:0}.rtl .content-container .content-wrapper{padding:25px 305px 25px 25px}.rtl .content-container .aside-nav .active i{float:left;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .dashboard .dashboard-stats .dashboard-card .data span{float:left}.rtl .dashboard .card{padding:20px 20px 0 0}.rtl .dashboard .card .card-info ul li .image{float:right;margin-right:0;margin-left:15px}.rtl .dashboard .card .card-info ul li .icon.angle-right-icon{left:30px;right:auto;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .dashboard .graph-stats .left-card-container{float:right;padding-right:0}.rtl .dashboard .graph-stats .right-card-container{float:right;padding-left:0;padding-right:30px}.rtl .sale-container .sale-summary{float:left}.rtl .grid-container .filter-wrapper .filter-row-one .search-filter{border:2px solid #c7c7c7}.rtl .grid-container .filter-wrapper .filter-row-one .search-filter .control{border:none;padding-right:10px}.rtl .grid-container .filter-wrapper .filter-row-one .search-filter .ic-wrapper{border:none;padding-top:2px;padding-right:5px}.rtl .grid-container .filter-wrapper .filter-row-two .filter-one{margin-right:0}.rtl .grid-container .filter-wrapper .filter-row-two .filter-one .filter-name{margin-right:0;margin-left:5px}.rtl .grid-container .filter-wrapper .filter-row-two .filter-one .filter-value{padding-right:5px;padding-left:0}.rtl .grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header span{padding-right:5px}.rtl .grid-container .table tbody td.action a:first-child{margin-left:10px;margin-right:0}.rtl .table table{text-align:right}.rtl .dropdown-list.bottom-right{left:0;right:auto}.rtl .dropdown-list .dropdown-container{text-align:right}.rtl .accordian .accordian-header .icon{float:left}.rtl .tree-container .tree-item{padding-right:30px}.rtl .tree-container .tree-item .expand-icon,.rtl .tree-container .tree-item .folder-icon{margin-left:10px;margin-right:0}.rtl .tree-container>.tree-item{padding-right:0}.rtl .radio .radio-view{margin-left:5px}.rtl .image-wrapper .image-item{margin-right:0;margin-left:20px}.rtl .image-wrapper .image-item .remove-image{margin-right:0}.rtl .control-group label.required:before{content:"*";color:#fc6868;font-weight:700}.rtl .control-group label.required:after{content:none}.rtl .control-group label .locale{float:left}.rtl .control-group.date:after{margin-top:15px;position:absolute;margin-right:-35px}.rtl .pagination .page-item .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)} \ No newline at end of file +@import url(https://fonts.googleapis.com/css?family=Montserrat:400,500);body{margin:0;color:#3a3a3a;font-family:Montserrat,sans-serif;font-size:14px;font-weight:500;position:static;min-height:100%}::-webkit-scrollbar{width:12px}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px hsla(0,0%,100%,.3);border-radius:10px}::-webkit-scrollbar-thumb{border-radius:10px;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.5)}.navbar-top{height:60px;background:#fff;font-size:0;-webkit-box-shadow:0 3px 6px 0 rgba(0,0,0,.05);box-shadow:0 3px 6px 0 rgba(0,0,0,.05);border-bottom:1px solid hsla(0,0%,64%,.2);position:fixed;left:0;right:0;z-index:5}.navbar-top .navbar-top-left{width:50%;height:60px;display:inline-block;vertical-align:middle}.navbar-top .navbar-top-left .brand-logo{padding:10px}.navbar-top .navbar-top-right{width:50%;height:60px;text-align:right;display:inline-block;vertical-align:middle}.navbar-top .navbar-top-right .profile-info{display:inline-block;vertical-align:middle;text-align:left;min-width:50px;padding:12px 0;margin:0 25px 0 30px;font-size:15px;cursor:pointer;position:relative}.navbar-top .navbar-top-right .profile-info .dropdown-list{top:63px}.navbar-top .navbar-top-right .profile-info .name{color:#000311;display:block;text-align:left}.navbar-top .navbar-top-right .profile-info .role{font-size:14px;color:#8e8e8e;display:block;text-align:left}.navbar-top .navbar-top-right .profile-info i.icon{margin-left:10px}.navbar-left{position:absolute;top:60px;bottom:0;width:90px;padding-top:20px;height:auto;border-right:1px solid hsla(0,0%,64%,.2);z-index:2}.navbar-left ul.menubar li.menu-item{height:90px;padding:10px 5px;font-size:11px;text-align:center;text-transform:uppercase}.navbar-left ul.menubar li.menu-item a{color:#a2a2a2}.navbar-left ul.menubar li.menu-item.active a{color:#0041ff}.content-container{padding-left:90px;position:absolute;margin-top:60px;top:0;right:0;left:0;bottom:0;overflow-x:hidden;overflow-y:auto}.content-container .aside-nav{width:280px;position:fixed;top:60px;bottom:0;border-right:1px solid hsla(0,0%,64%,.2);background:#f8f9fa;padding-top:10px;overflow-y:auto;z-index:4}.content-container .aside-nav a{padding:15px;display:block;color:#000311}.content-container .aside-nav .active a{background:#fff;border-top:1px solid hsla(0,0%,64%,.2);border-bottom:1px solid hsla(0,0%,64%,.2)}.content-container .aside-nav .active i{float:right}.content-container .content-wrapper{padding:25px 25px 25px 305px}.content-container .content{margin-top:25px}.content-container .content.full-page{padding:25px}.content-container .content .page-header{display:inline-block;margin-bottom:20px;width:100%}.content-container .content .page-header .page-title{float:left}.content-container .content .page-header .page-title h1{margin-bottom:0;vertical-align:middle;display:inline-block}.content-container .content .page-header .page-action{float:right}.content-container .content .page-header .page-action *{display:inline-block}.content-container .content .page-header .page-action a{margin-left:25px}.content-container .content .page-header .control-group{width:180px;display:inline-block;margin-bottom:0;margin-left:20px}.content-container .content .page-header .control{width:100%;margin:0}.content-container .content .page-content{width:100%;display:inline-block}.control-group label{width:70%}.control-group label .locale{float:right;color:#8e8e8e}.control-group .mce-tinymce{margin-top:10px;margin-bottom:5px}.dashboard .page-header{margin-bottom:0!important;padding-bottom:15px;border-bottom:1px solid hsla(0,0%,64%,.2)}.dashboard .page-content{margin-top:15px}.dashboard .card{height:445px;background:#fff;border:1px solid #e7e7e7;-webkit-box-shadow:0 5px 10px 2px rgba(0,0,0,.08);box-shadow:0 5px 10px 2px rgba(0,0,0,.08);border-radius:2px;padding:20px 0 0 20px}.dashboard .card .card-title{font-size:14px;color:#a2a2a2;letter-spacing:-.26px;text-transform:uppercase}.dashboard .card .card-info{width:100%;height:100%;display:inline-block}.dashboard .card .card-info.center{text-align:center}.dashboard .card .card-info ul li{border-bottom:1px solid hsla(0,0%,64%,.2);width:100%;display:inline-block;padding:10px 0;position:relative}.dashboard .card .card-info ul li .image{height:60px;width:60px;float:left;margin-right:15px}.dashboard .card .card-info ul li .image.product{background:#f2f2f2}.dashboard .card .card-info ul li .image img{width:100%}.dashboard .card .card-info ul li .description{margin-top:10px}.dashboard .card .card-info ul li .description .name{color:#0041ff}.dashboard .card .card-info ul li .description .info{color:#3a3a3a;margin-top:5px}.dashboard .card .card-info ul li .icon.angle-right-icon{position:absolute;right:30px;top:50%;margin-top:-8px}.dashboard .card .card-info ul li:last-child{border-bottom:0}.dashboard .card .card-info .no-result-found{margin-top:146px}.dashboard .card .card-info .no-result-found p{margin:0;color:#a2a2a2}.dashboard .dashboard-stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));grid-auto-rows:auto;grid-column-gap:30px;grid-row-gap:15px}.dashboard .dashboard-stats .dashboard-card{height:100px;background:#fff;border:1px solid #e7e7e7;-webkit-box-shadow:0 5px 10px 2px rgba(0,0,0,.08);box-shadow:0 5px 10px 2px rgba(0,0,0,.08);border-radius:5px;position:relative;padding:15px}.dashboard .dashboard-stats .dashboard-card .title{font-size:14px;color:#a2a2a2;text-transform:uppercase}.dashboard .dashboard-stats .dashboard-card .data{padding-top:3px;font-size:32px;color:#0041ff}.dashboard .dashboard-stats .dashboard-card .data .progress{font-size:14px;color:#8e8e8e;float:right;margin-top:9px}.dashboard .dashboard-stats .dashboard-card .data .progress .icon{vertical-align:middle}.dashboard .graph-stats{margin-top:30px;width:100%;display:inline-block}.dashboard .graph-stats .left-card-container{float:left;width:75%;padding-right:9px}.dashboard .graph-stats .right-card-container{float:left;width:25%;padding-left:21px}.dashboard .sale-stock{width:100%;display:inline-block;display:grid;grid-template-columns:repeat(auto-fill,minmax(435px,1fr));grid-auto-rows:auto;grid-column-gap:30px;grid-row-gap:15px;margin-top:30px}.sale-container .sale-section{font-size:16px}.sale-container .sale-section .secton-title{font-size:18px;color:#8e8e8e;padding:15px 0;border-bottom:1px solid hsla(0,0%,64%,.2)}.sale-container .sale-section .section-content{display:block;padding:20px 0}.sale-container .sale-section .section-content .row{display:block;padding:7px 0}.sale-container .sale-section .section-content .row .title{width:200px;color:#3a3a3a;letter-spacing:-.26px;display:inline-block}.sale-container .sale-section .section-content .row .value{color:#3a3a3a;letter-spacing:-.26px;display:inline-block}.sale-container .table .qty-row{display:block;margin-bottom:5px}.sale-container .table .qty-row:last-child{margin-bottom:0}.sale-container .table .radio{margin:0}.sale-container .sale-summary{margin-top:2%;height:130px;float:right}.sale-container .sale-summary tr td{padding:5px 8px}.sale-container .sale-summary tr.bold{font-weight:600;font-size:15px}.sale-container .sale-summary tr.border td{border-bottom:1px solid hsla(0,0%,64%,.2)}.stars{margin-top:5px}.stars .icon{width:16px;height:16px}.export{cursor:pointer}.export .export-icon{position:relative;top:10px}.export span{margin-left:2px}.rtl{direction:rtl}.rtl .navbar-top .navbar-top-right{text-align:left}.rtl .navbar-top .navbar-top-right .profile-info{margin:0 30px 0 25px}.rtl .navbar-top .navbar-top-right .profile-info i.icon{margin-left:0;margin-right:10px}.rtl .navbar-left{border-left:1px solid hsla(0,0%,64%,.2);border-right:none}.rtl .content-container{padding-right:90px;padding-left:0}.rtl .content-container .content .page-header .page-title{float:right}.rtl .content-container .content .page-header .page-action{float:left}.rtl .content-container .content .page-header .control-group{margin-right:20px;margin-left:0}.rtl .content-container .content .page-header .control-group.date:after{margin-top:6px;position:absolute;margin-right:-35px}.rtl .content-container .content .page-header .control-group.date:last-child{margin-left:0}.rtl .content-container .content-wrapper{padding:25px 305px 25px 25px}.rtl .content-container .aside-nav .active i{float:left;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .dashboard .dashboard-stats .dashboard-card .data span{float:left}.rtl .dashboard .card{padding:20px 20px 0 0}.rtl .dashboard .card .card-info ul li .image{float:right;margin-right:0;margin-left:15px}.rtl .dashboard .card .card-info ul li .icon.angle-right-icon{left:30px;right:auto;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.rtl .dashboard .graph-stats .left-card-container{float:right;padding-right:0}.rtl .dashboard .graph-stats .right-card-container{float:right;padding-left:0;padding-right:30px}.rtl .sale-container .sale-summary{float:left}.rtl .grid-container .filter-wrapper .filter-row-one .search-filter{border:2px solid #c7c7c7}.rtl .grid-container .filter-wrapper .filter-row-one .search-filter .control{border:none;padding-right:10px}.rtl .grid-container .filter-wrapper .filter-row-one .search-filter .ic-wrapper{border:none;padding-top:2px;padding-right:5px}.rtl .grid-container .filter-wrapper .filter-row-two .filter-one{margin-right:0}.rtl .grid-container .filter-wrapper .filter-row-two .filter-one .filter-name{margin-right:0;margin-left:5px}.rtl .grid-container .filter-wrapper .filter-row-two .filter-one .filter-value{padding-right:5px;padding-left:0}.rtl .grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header span{padding-right:5px}.rtl .grid-container .table tbody td.action a:first-child{margin-left:10px;margin-right:0}.rtl .table table{text-align:right}.rtl .dropdown-list.bottom-right{left:0;right:auto}.rtl .dropdown-list .dropdown-container{text-align:right}.rtl .accordian .accordian-header .icon{float:left}.rtl .tree-container .tree-item{padding-right:30px}.rtl .tree-container .tree-item .expand-icon,.rtl .tree-container .tree-item .folder-icon{margin-left:10px;margin-right:0}.rtl .tree-container>.tree-item{padding-right:0}.rtl .radio .radio-view{margin-left:5px}.rtl .image-wrapper .image-item{margin-right:0;margin-left:20px}.rtl .image-wrapper .image-item .remove-image{margin-right:0}.rtl .control-group label.required:before{content:"*";color:#fc6868;font-weight:700}.rtl .control-group label.required:after{content:none}.rtl .control-group label .locale{float:left}.rtl .control-group.date:after{margin-top:15px;position:absolute;margin-right:-35px}.rtl .pagination .page-item .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)} \ No newline at end of file diff --git a/packages/Webkul/Admin/publishable/assets/mix-manifest.json b/packages/Webkul/Admin/publishable/assets/mix-manifest.json index 0161eb3be..55e257eec 100755 --- a/packages/Webkul/Admin/publishable/assets/mix-manifest.json +++ b/packages/Webkul/Admin/publishable/assets/mix-manifest.json @@ -1,4 +1,4 @@ { "/js/admin.js": "/js/admin.js?id=c70dacdf945a32e04b77", - "/css/admin.css": "/css/admin.css?id=d40a640933cbcc121f1d" + "/css/admin.css": "/css/admin.css?id=3e790c2215bf5c60ac21" } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Config/acl.php b/packages/Webkul/Admin/src/Config/acl.php index 084205d45..245f39447 100755 --- a/packages/Webkul/Admin/src/Config/acl.php +++ b/packages/Webkul/Admin/src/Config/acl.php @@ -3,147 +3,142 @@ return [ [ 'key' => 'dashboard', - 'name' => 'Dashboard', + 'name' => 'admin::app.acl.dashboard', 'route' => 'admin.dashboard.index', 'sort' => 1 ], [ 'key' => 'sales', - 'name' => 'Sales', + 'name' => 'admin::app.acl.sales', 'route' => 'admin.sales.orders.index', 'sort' => 2 ], [ 'key' => 'sales.orders', - 'name' => 'Orders', + 'name' => 'admin::app.acl.orders', 'route' => 'admin.sales.orders.index', 'sort' => 1 ], [ 'key' => 'sales.invoices', - 'name' => 'Invoices', + 'name' => 'admin::app.acl.invoices', 'route' => 'admin.sales.invoices.index', 'sort' => 2 ], [ 'key' => 'sales.shipments', - 'name' => 'Shipments', + 'name' => 'admin::app.acl.shipments', 'route' => 'admin.sales.shipments.index', 'sort' => 3 ], [ 'key' => 'catalog', - 'name' => 'Catalog', + 'name' => 'admin::app.acl.catalog', 'route' => 'admin.catalog.index', 'sort' => 3 ], [ 'key' => 'catalog.products', - 'name' => 'Products', + 'name' => 'admin::app.acl.products', 'route' => 'admin.catalog.products.index', 'sort' => 1 ], [ 'key' => 'catalog.categories', - 'name' => 'Categories', + 'name' => 'admin::app.acl.categories', 'route' => 'admin.catalog.categories.index', 'sort' => 2 ], [ 'key' => 'catalog.attributes', - 'name' => 'Attributes', + 'name' => 'admin::app.acl.attributes', 'route' => 'admin.catalog.attributes.index', 'sort' => 3 ], [ 'key' => 'catalog.families', - 'name' => 'Families', + 'name' => 'admin::app.acl.attribute-families', 'route' => 'admin.catalog.families.index', 'sort' => 4 ], [ 'key' => 'customers', - 'name' => 'Customers', + 'name' => 'admin::app.acl.customers', 'route' => 'admin.customers.index', 'sort' => 4 ], [ 'key' => 'customers.customers', - 'name' => 'Customers', + 'name' => 'admin::app.acl.customers', 'route' => 'admin.customers.index', 'sort' => 1 ], [ 'key' => 'customers.groups', - 'name' => 'Groups', + 'name' => 'admin::app.acl.groups', 'route' => 'admin.groups.index', 'sort' => 2 ], [ 'key' => 'customers.reviews', - 'name' => 'Reviews', + 'name' => 'admin::app.acl.reviews', 'route' => 'admin.customers.reviews.index', 'sort' => 3 ], [ 'key' => 'configuration', - 'name' => 'Configure', + 'name' => 'admin::app.acl.configure', 'route' => 'admin.account.edit', - 'sort' => 1 - ], [ - 'key' => 'configuration', - 'name' => 'Configure', - 'route' => 'admin.account.edit', - 'sort' => 1 + 'sort' => 5 ], [ 'key' => 'settings', - 'name' => 'Settings', + 'name' => 'admin::app.acl.settings', 'route' => 'admin.users.index', 'sort' => 6 ], [ 'key' => 'settings.locales', - 'name' => 'Locales', + 'name' => 'admin::app.acl.locales', 'route' => 'admin.locales.index', 'sort' => 1 ], [ 'key' => 'settings.currencies', - 'name' => 'Currencies', + 'name' => 'admin::app.acl.currencies', 'route' => 'admin.currencies.index', 'sort' => 2 ], [ 'key' => 'settings.exchange_rates', - 'name' => 'Exchange Rates', + 'name' => 'admin::app.acl.exchange-rates', 'route' => 'admin.exchange_rates.index', 'sort' => 3 ], [ 'key' => 'settings.inventory_sources', - 'name' => 'Inventory Sources', + 'name' => 'admin::app.acl.inventory-sources', 'route' => 'admin.inventory_sources.index', 'sort' => 4 ], [ 'key' => 'settings.channels', - 'name' => 'Channels', + 'name' => 'admin::app.acl.channels', 'route' => 'admin.channels.index', 'sort' => 5 ], [ 'key' => 'settings.users', - 'name' => 'Users', + 'name' => 'admin::app.acl.users', 'route' => 'admin.users.index', 'sort' => 6 ], [ 'key' => 'settings.users.users', - 'name' => 'Users', + 'name' => 'admin::app.acl.users', 'route' => 'admin.users.index', 'sort' => 1 ], [ 'key' => 'settings.users.roles', - 'name' => 'Roles', + 'name' => 'admin::app.acl.roles', 'route' => 'admin.roles.index', 'sort' => 1 ], [ 'key' => 'settings.sliders', - 'name' => 'Sliders', + 'name' => 'admin::app.acl.sliders', 'route' => 'admin.sliders.index', 'sort' => 7 ], [ 'key' => 'settings.taxes', - 'name' => 'Taxes', + 'name' => 'admin::app.acl.taxes', 'route' => 'admin.tax-categories.index', 'sort' => 8 ], [ 'key' => 'settings.taxes.tax-categories', - 'name' => 'Tax Categories', + 'name' => 'admin::app.acl.tax-categories', 'route' => 'admin.tax-categories.index', 'sort' => 1 ], [ 'key' => 'settings.taxes.tax-rates', - 'name' => 'Tax Rates', + 'name' => 'admin::app.acl.tax-rates', 'route' => 'admin.tax-rates.index', 'sort' => 2 ] diff --git a/packages/Webkul/Admin/src/Config/menu.php b/packages/Webkul/Admin/src/Config/menu.php index 326e1db13..47e0a11ea 100755 --- a/packages/Webkul/Admin/src/Config/menu.php +++ b/packages/Webkul/Admin/src/Config/menu.php @@ -3,176 +3,176 @@ return [ [ 'key' => 'dashboard', - 'name' => 'Dashboard', + 'name' => 'admin::app.layouts.dashboard', 'route' => 'admin.dashboard.index', 'sort' => 1, 'icon-class' => 'dashboard-icon', ], [ 'key' => 'sales', - 'name' => 'Sales', + 'name' => 'admin::app.layouts.sales', 'route' => 'admin.sales.orders.index', 'sort' => 2, 'icon-class' => 'sales-icon', ], [ 'key' => 'sales.orders', - 'name' => 'Orders', + 'name' => 'admin::app.layouts.orders', 'route' => 'admin.sales.orders.index', 'sort' => 1, 'icon-class' => '', ], [ 'key' => 'sales.shipments', - 'name' => 'Shipments', + 'name' => 'admin::app.layouts.shipments', 'route' => 'admin.sales.shipments.index', 'sort' => 2, 'icon-class' => '', ], [ 'key' => 'sales.invoices', - 'name' => 'Invoices', + 'name' => 'admin::app.layouts.invoices', 'route' => 'admin.sales.invoices.index', 'sort' => 3, 'icon-class' => '', ], [ 'key' => 'catalog', - 'name' => 'Catalog', + 'name' => 'admin::app.layouts.catalog', 'route' => 'admin.catalog.products.index', 'sort' => 3, 'icon-class' => 'catalog-icon', ], [ 'key' => 'catalog.products', - 'name' => 'Products', + 'name' => 'admin::app.layouts.products', 'route' => 'admin.catalog.products.index', 'sort' => 1, 'icon-class' => '', ], [ 'key' => 'catalog.categories', - 'name' => 'Categories', + 'name' => 'admin::app.layouts.categories', 'route' => 'admin.catalog.categories.index', 'sort' => 2, 'icon-class' => '', ], [ 'key' => 'catalog.attributes', - 'name' => 'Attributes', + 'name' => 'admin::app.layouts.attributes', 'route' => 'admin.catalog.attributes.index', 'sort' => 3, 'icon-class' => '', ], [ 'key' => 'catalog.families', - 'name' => 'Families', + 'name' => 'admin::app.layouts.attribute-families', 'route' => 'admin.catalog.families.index', 'sort' => 4, 'icon-class' => '', ], [ 'key' => 'customers', - 'name' => 'Customers', + 'name' => 'admin::app.layouts.customers', 'route' => 'admin.customer.index', 'sort' => 4, 'icon-class' => 'customer-icon', ], [ 'key' => 'customers.customers', - 'name' => 'Customers', + 'name' => 'admin::app.layouts.customers', 'route' => 'admin.customer.index', 'sort' => 1, 'icon-class' => '', ], [ 'key' => 'customers.groups', - 'name' => 'Groups', + 'name' => 'admin::app.layouts.groups', 'route' => 'admin.groups.index', 'sort' => 2, 'icon-class' => '', ], [ 'key' => 'customers.reviews', - 'name' => 'Reviews', + 'name' => 'admin::app.layouts.reviews', 'route' => 'admin.customer.review.index', 'sort' => 3, 'icon-class' => '', ], [ 'key' => 'customers.subscribers', - 'name' => 'Newsletter Subscription', + 'name' => 'admin::app.layouts.newsletter-subscriptions', 'route' => 'admin.customers.subscribers.index', 'sort' => 4, 'icon-class' => '', ], [ 'key' => 'configuration', - 'name' => 'Configure', + 'name' => 'admin::app.layouts.configure', 'route' => 'admin.configuration.index', 'sort' => 5, 'icon-class' => 'configuration-icon', ], [ 'key' => 'settings', - 'name' => 'Settings', + 'name' => 'admin::app.layouts.settings', 'route' => 'admin.locales.index', 'sort' => 6, 'icon-class' => 'settings-icon', ], [ 'key' => 'settings.locales', - 'name' => 'Locales', + 'name' => 'admin::app.layouts.locales', 'route' => 'admin.locales.index', 'sort' => 1, 'icon-class' => '', ], [ 'key' => 'settings.currencies', - 'name' => 'Currencies', + 'name' => 'admin::app.layouts.currencies', 'route' => 'admin.currencies.index', 'sort' => 2, 'icon-class' => '', ], [ 'key' => 'settings.exchange_rates', - 'name' => 'Exchange Rates', + 'name' => 'admin::app.layouts.exchange-rates', 'route' => 'admin.exchange_rates.index', 'sort' => 3, 'icon-class' => '', ], [ 'key' => 'settings.inventory_sources', - 'name' => 'Inventory Sources', + 'name' => 'admin::app.layouts.inventory-sources', 'route' => 'admin.inventory_sources.index', 'sort' => 4, 'icon-class' => '', ], [ 'key' => 'settings.channels', - 'name' => 'Channels', + 'name' => 'admin::app.layouts.channels', 'route' => 'admin.channels.index', 'sort' => 5, 'icon-class' => '', ], [ 'key' => 'settings.users', - 'name' => 'Users', + 'name' => 'admin::app.layouts.users', 'route' => 'admin.users.index', 'sort' => 6, 'icon-class' => '', ], [ 'key' => 'settings.users.users', - 'name' => 'Users', + 'name' => 'admin::app.layouts.users', 'route' => 'admin.users.index', 'sort' => 1, 'icon-class' => '', ], [ 'key' => 'settings.users.roles', - 'name' => 'Roles', + 'name' => 'admin::app.layouts.roles', 'route' => 'admin.roles.index', 'sort' => 2, 'icon-class' => '', ], [ 'key' => 'settings.sliders', - 'name' => 'Sliders', + 'name' => 'admin::app.layouts.sliders', 'route' => 'admin.sliders.index', 'sort' => 7, 'icon-class' => '', ], [ 'key' => 'settings.taxes', - 'name' => 'Taxes', + 'name' => 'admin::app.layouts.taxes', 'route' => 'admin.tax-categories.index', 'sort' => 8, 'icon-class' => '', ], [ 'key' => 'settings.taxes.tax-categories', - 'name' => 'Tax Categories', + 'name' => 'admin::app.layouts.tax-categories', 'route' => 'admin.tax-categories.index', 'sort' => 1, 'icon-class' => '', ], [ 'key' => 'settings.taxes.tax-rates', - 'name' => 'Tax Rates', + 'name' => 'admin::app.layouts.tax-rates', 'route' => 'admin.tax-rates.index', 'sort' => 2, 'icon-class' => '', diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php index fa7a936c3..8fa4f484c 100755 --- a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php @@ -2,18 +2,21 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * AttributeDataGrid class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class AttributeDataGrid extends AbsGrid +class AttributeDataGrid extends DataGrid { - public $allColumns = []; + protected $itemsPerPage = 5; //overriding the default items per page + + protected $index = 'id'; //the column that needs to be treated as index column + public function prepareQueryBuilder() { @@ -22,16 +25,11 @@ class AttributeDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'attributeId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +38,7 @@ class AttributeDataGrid extends AbsGrid $this->addColumn([ 'index' => 'code', - 'alias' => 'attributeCode', - 'label' => 'Code', + 'label' => trans('admin::app.datagrid.code'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +47,7 @@ class AttributeDataGrid extends AbsGrid $this->addColumn([ 'index' => 'admin_name', - 'alias' => 'attributeAdminName', - 'label' => 'Name', + 'label' => trans('admin::app.datagrid.admin-name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -60,8 +56,7 @@ class AttributeDataGrid extends AbsGrid $this->addColumn([ 'index' => 'type', - 'alias' => 'attributeType', - 'label' => 'Type', + 'label' => trans('admin::app.datagrid.type'), 'type' => 'string', 'sortable' => true, 'searchable' => true, @@ -70,14 +65,13 @@ class AttributeDataGrid extends AbsGrid $this->addColumn([ 'index' => 'is_required', - 'alias' => 'attributeRequired', - 'label' => 'Required', + 'label' => trans('admin::app.datagrid.required'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, 'width' => '100px', - 'wrapper' => function($value){ - if($value == 1) + 'wrapper' => function($value) { + if ($value == 1) return 'True'; else return 'False'; @@ -86,14 +80,13 @@ class AttributeDataGrid extends AbsGrid $this->addColumn([ 'index' => 'is_unique', - 'alias' => 'attributeIsUnique', - 'label' => 'Unique', + 'label' => trans('admin::app.datagrid.unique'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, 'width' => '100px', - 'wrapper' => function($value){ - if($value == 1) + 'wrapper' => function($value) { + if ($value == 1) return 'True'; else return 'False'; @@ -102,14 +95,13 @@ class AttributeDataGrid extends AbsGrid $this->addColumn([ 'index' => 'value_per_locale', - 'alias' => 'attributeValuePerLocale', - 'label' => 'Locale Based', + 'label' => trans('admin::app.datagrid.per-locale'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, 'width' => '100px', - 'wrapper' => function($value){ - if($value == 1) + 'wrapper' => function($value) { + if ($value == 1) return 'True'; else return 'False'; @@ -118,14 +110,13 @@ class AttributeDataGrid extends AbsGrid $this->addColumn([ 'index' => 'value_per_channel', - 'alias' => 'attributeValuePerChannel', - 'label' => 'Channel Based', + 'label' => trans('admin::app.datagrid.per-channel'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, 'width' => '100px', - 'wrapper' => function($value){ - if($value == 1) + 'wrapper' => function($value) { + if ($value == 1) return 'True'; else return 'False'; @@ -133,7 +124,8 @@ class AttributeDataGrid extends AbsGrid ]); } - public function prepareActions() { + public function prepareActions() + { $this->addAction([ 'type' => 'Edit', 'route' => 'admin.catalog.attributes.edit', @@ -147,10 +139,12 @@ class AttributeDataGrid extends AbsGrid ]); } - public function prepareMassActions() { + public function prepareMassActions() + { $this->addMassAction([ 'type' => 'delete', 'action' => route('admin.catalog.attributes.massdelete'), + 'label' => 'Delete', 'method' => 'DELETE' ]); } diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php index 2c8adeff9..a5c728b26 100755 --- a/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php @@ -2,18 +2,20 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * AttributeFamilyDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class AttributeFamilyDataGrid extends AbsGrid +class AttributeFamilyDataGrid extends DataGrid { - public $allColumns = []; + protected $itemsPerPage = 5; + + protected $index = 'id'; //the column that needs to be treated as index column public function prepareQueryBuilder() { @@ -22,16 +24,11 @@ class AttributeFamilyDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'attributeFamilyId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +37,7 @@ class AttributeFamilyDataGrid extends AbsGrid $this->addColumn([ 'index' => 'code', - 'alias' => 'attributeFamilyCode', - 'label' => 'Code', + 'label' => trans('admin::app.datagrid.code'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +46,7 @@ class AttributeFamilyDataGrid extends AbsGrid $this->addColumn([ 'index' => 'name', - 'alias' => 'attributeFamilyName', - 'label' => 'Name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 8665cab42..105fc4b51 100755 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -2,36 +2,31 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * CategoryDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class CategoryDataGrid extends AbsGrid +class CategoryDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'category_id'; //the column that needs to be treated as index column public function prepareQueryBuilder() { - $queryBuilder = DB::table('categories as cat')->select('cat.id', 'ct.name', 'cat.position', 'cat.status', 'ct.locale')->leftJoin('category_translations as ct', 'cat.id', '=', 'ct.category_id'); + $queryBuilder = DB::table('categories as cat')->select('cat.id as category_id', 'ct.name as category_name', 'cat.position as category_position', 'cat.status as category_status', 'ct.locale as category_locale')->leftJoin('category_translations as ct', 'cat.id', '=', 'ct.category_id'); $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ - 'index' => 'cat.id', - 'alias' => 'catId', - 'label' => 'ID', + 'index' => 'category_id', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,9 +34,8 @@ class CategoryDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'ct.name', - 'alias' => 'catName', - 'label' => 'Name', + 'index' => 'category_name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -49,9 +43,8 @@ class CategoryDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'cat.position', - 'alias' => 'catPosition', - 'label' => 'Position', + 'index' => 'category_position', + 'label' => trans('admin::app.datagrid.position'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -59,15 +52,14 @@ class CategoryDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'cat.status', - 'alias' => 'catStatus', - 'label' => 'Status', + 'index' => 'category_status', + 'label' => trans('admin::app.datagrid.status'), 'type' => 'boolean', 'sortable' => true, 'searchable' => true, 'width' => '100px', - 'wrapper' => function($value){ - if($value == 1) + 'wrapper' => function($value) { + if ($value == 1) return 'Active'; else return 'Inactive'; @@ -75,9 +67,8 @@ class CategoryDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'ct.locale', - 'alias' => 'catLocale', - 'label' => 'Locale', + 'index' => 'category_locale', + 'label' => trans('admin::app.datagrid.locale'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, diff --git a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php index a3ba4f12c..4c25f82da 100755 --- a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Channel Data Grid class + * ChannelDataGrid class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class ChannelDataGrid extends AbsGrid +class ChannelDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; //the column that needs to be treated as index column public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class ChannelDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'channelId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class ChannelDataGrid extends AbsGrid $this->addColumn([ 'index' => 'code', - 'alias' => 'channelCode', - 'label' => 'Code', + 'label' => trans('admin::app.datagrid.code'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +44,7 @@ class ChannelDataGrid extends AbsGrid $this->addColumn([ 'index' => 'name', - 'alias' => 'channelName', - 'label' => 'Name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -60,8 +53,7 @@ class ChannelDataGrid extends AbsGrid $this->addColumn([ 'index' => 'hostname', - 'alias' => 'channelHostname', - 'label' => 'Hostname', + 'label' => trans('admin::app.datagrid.hostname'), 'type' => 'string', 'sortable' => true, 'searchable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php deleted file mode 100755 index 32679093a..000000000 --- a/packages/Webkul/Admin/src/DataGrids/CountryDataGrid.php +++ /dev/null @@ -1,113 +0,0 @@ - @prashant-webkul - * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class CountryDataGrid extends AbsGrid -{ - public $allColumns = []; - - public function prepareQueryBuilder() - { - $queryBuilder = DB::table('countries')->select('id')->addSelect($this->columns); - - $this->setQueryBuilder($queryBuilder); - } - - public function addColumns() - { - $this->addColumn([ - 'column' => 'id', - 'alias' => 'countryId', - 'label' => 'ID', - 'type' => 'number', - 'searchable' => false, - 'sortable' => true, - 'width' => '40px' - ]); - - $this->addColumn([ - 'column' => 'code', - 'alias' => 'countryCode', - 'label' => 'Code', - 'type' => 'string', - 'searchable' => true, - 'sortable' => true, - 'width' => '100px' - ]); - - $this->addColumn([ - 'column' => 'name', - 'alias' => 'countryName', - 'label' => 'Name', - 'type' => 'string', - 'searchable' => true, - 'sortable' => true, - 'width' => '100px' - ]); - - $this->addColumn([ - 'column' => 'status', - 'alias' => 'countryStatus', - 'label' => 'Status', - 'type' => 'number', - 'sortable' => true, - 'searchable' => true, - 'width' => '100px' - ]); - } - - public function prepareActions() { - $this->prepareAction([ - 'type' => 'Edit', - 'route' => 'admin.catalog.products.edit', - 'icon' => 'icon pencil-lg-icon' - ]); - - $this->prepareAction([ - 'type' => 'Delete', - 'route' => 'admin.catalog.products.delete', - 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), - 'icon' => 'icon trash-icon' - ]); - } - - public function prepareMassActions() { - // $this->prepareMassAction([ - // 'type' => 'delete', - // 'action' => route('admin.catalog.products.massdelete'), - // 'method' => 'DELETE' - // ]); - - // $this->prepareMassAction([ - // 'type' => 'update', - // 'action' => route('admin.catalog.products.massupdate'), - // 'method' => 'PUT', - // 'options' => [ - // 0 => true, - // 1 => false, - // ] - // ]); - } - - public function render() - { - $this->addColumns(); - - $this->prepareActions(); - - $this->prepareMassActions(); - - $this->prepareQueryBuilder(); - - return view('ui::testgrid.table')->with('results', ['records' => $this->getCollection(), 'columns' => $this->allColumns, 'actions' => $this->actions, 'massactions' => $this->massActions]); - } -} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php index c1a9e11d7..02652f0b1 100755 --- a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Currency Data Grid class + * CurrencyDataGrid class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class CurrencyDataGrid extends AbsGrid +class CurrencyDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; //the column that needs to be treated as index column public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class CurrencyDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'currencyId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class CurrencyDataGrid extends AbsGrid $this->addColumn([ 'index' => 'name', - 'alias' => 'currencyName', - 'label' => 'Name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +44,7 @@ class CurrencyDataGrid extends AbsGrid $this->addColumn([ 'index' => 'code', - 'alias' => 'currencyCode', - 'label' => 'Code', + 'label' => trans('admin::app.datagrid.code'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php index 463534b67..4b7869173 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php @@ -2,36 +2,33 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Currency Data Grid class + * CustomerDataGrid class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class CustomerDataGrid extends AbsGrid +class CustomerDataGrid extends DataGrid { - public $allColumns = []; + protected $itemsPerPage = 5; + + protected $index = 'customer_id'; //the column that needs to be treated as index column public function prepareQueryBuilder() { - $queryBuilder = DB::table('customers as cus')->addSelect('cus.id', 'cus.first_name', 'cus.email', 'cg.name')->leftJoin('customer_groups as cg', 'cus.customer_group_id', '=', 'cg.id'); + $queryBuilder = DB::table('customers')->addSelect('customers.id as customer_id', 'customers.email as customer_email', 'customer_groups.name as customer_group_name')->addSelect(DB::raw('CONCAT(customers.first_name, " ", customers.last_name) as customer_full_name'))->leftJoin('customer_groups', 'customers.customer_group_id', '=', 'customer_groups.id'); $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ - 'index' => 'cus.id', - 'alias' => 'customerId', - 'label' => 'ID', + 'index' => 'customer_id', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,10 +36,8 @@ class CustomerDataGrid extends AbsGrid ]); $this->addColumn([ - // 'column' => 'CONCAT(cus.first_name, " ", cus.last_name)', - 'index' => 'cus.first_name', - 'alias' => 'customerFullName', - 'label' => 'Name', + 'index' => 'customer_full_name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,9 +45,8 @@ class CustomerDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'cus.email', - 'alias' => 'customerEmail', - 'label' => 'Email', + 'index' => 'customer_email', + 'label' => trans('admin::app.datagrid.email'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -60,9 +54,8 @@ class CustomerDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'cg.name', - 'alias' => 'customerGroupName', - 'label' => 'Group', + 'index' => 'customer_group_name', + 'label' => trans('admin::app.datagrid.group'), 'type' => 'string', 'searchable' => false, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php index 64891c0d3..746333d90 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Currency Data Grid class + * CustomerDataGrid class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class CustomerGroupDataGrid extends AbsGrid +class CustomerGroupDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; //the column that needs to be treated as index column public function prepareQueryBuilder() { @@ -22,15 +22,10 @@ class CustomerGroupDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'groupId', 'label' => 'ID', 'type' => 'number', 'searchable' => false, @@ -39,9 +34,7 @@ class CustomerGroupDataGrid extends AbsGrid ]); $this->addColumn([ - // 'column' => 'CONCAT(cus.first_name, " ", cus.last_name)', 'index' => 'name', - 'alias' => 'groupName', 'label' => 'Name', 'type' => 'string', 'searchable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php index 015f0783e..c95c42c6f 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php @@ -2,36 +2,31 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Currency Data Grid class + * CustomerReviewDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class CustomerReviewDataGrid extends AbsGrid +class CustomerReviewDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'product_review_id'; //the column that needs to be treated as index column public function prepareQueryBuilder() { - $queryBuilder = DB::table('product_reviews as pr')->addSelect('pr.id', 'pr.title', 'pr.comment', 'pg.name', 'pr.status')->leftjoin('products_grid as pg', 'pr.product_id', '=', 'pg.id'); + $queryBuilder = DB::table('product_reviews as pr')->addSelect('pr.id as product_review_id', 'pr.title as product_review_title', 'pr.comment as product_review_comment', 'pg.name as product_review_name', 'pr.status as product_review_status')->leftjoin('products_grid as pg', 'pr.product_id', '=', 'pg.id'); $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ - 'index' => 'pr.id', - 'alias' => 'reviewId', - 'label' => 'ID', + 'index' => 'product_review_id', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,9 +34,8 @@ class CustomerReviewDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'pr.title', - 'alias' => 'reviewTitle', - 'label' => 'Title', + 'index' => 'product_review_title', + 'label' => trans('admin::app.datagrid.title'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -49,9 +43,8 @@ class CustomerReviewDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'pr.comment', - 'alias' => 'reviewComment', - 'label' => 'Comment', + 'index' => 'product_review_comment', + 'label' => trans('admin::app.datagrid.comment'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -59,9 +52,8 @@ class CustomerReviewDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'pg.name', - 'alias' => 'productName', - 'label' => 'Product', + 'index' => 'product_review_name', + 'label' => trans('admin::app.datagrid.product-name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -69,18 +61,17 @@ class CustomerReviewDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'pr.status', - 'alias' => 'reviewStatus', - 'label' => 'Status', + 'index' => 'product_review_status', + 'label' => trans('admin::app.datagrid.status'), 'type' => 'boolean', 'searchable' => true, 'sortable' => true, 'width' => '100px', 'closure' => true, 'wrapper' => function ($value) { - if($value == 'approved') + if ($value == 'approved') return 'Approved'; - else if($value == "pending") + else if ($value == "pending") return 'Pending'; }, ]); @@ -103,17 +94,19 @@ class CustomerReviewDataGrid extends AbsGrid public function prepareMassActions() { $this->addMassAction([ 'type' => 'delete', - 'action' => route('admin.catalog.products.massdelete'), + 'label' => 'Delete', + 'action' => route('admin.customer.review.massdelete'), 'method' => 'DELETE' ]); $this->addMassAction([ 'type' => 'update', - 'action' => route('admin.catalog.products.massupdate'), + 'label' => 'Update Status', + 'action' => route('admin.customer.review.massupdate'), 'method' => 'PUT', 'options' => [ - 0 => true, - 1 => false, + 'Disapprove' => 0, + 'Approve' => 1 ] ]); } diff --git a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php index 2b45a8497..7d6bd7234 100755 --- a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php @@ -2,36 +2,31 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * ExchangeRateDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class ExchangeRatesDataGrid extends AbsGrid +class ExchangeRatesDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'currency_exch_id'; public function prepareQueryBuilder() { - $queryBuilder = DB::table('currency_exchange_rates as cer')->addSelect('cer.id', 'curr.name', 'cer.rate')->leftJoin('currencies as curr', 'cer.target_currency', '=', 'curr.id'); + $queryBuilder = DB::table('currency_exchange_rates as cer')->addSelect('cer.id as currency_exch_id', 'curr.name as currency_exch_name', 'cer.rate as currency_exch_rate')->leftJoin('currencies as curr', 'cer.target_currency', '=', 'curr.id'); $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ - 'index' => 'cer.id', - 'alias' => 'exchId', - 'label' => 'ID', + 'index' => 'currency_exch_id', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,9 +34,8 @@ class ExchangeRatesDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'curr.name', - 'alias' => 'exchName', - 'label' => 'Currency Name', + 'index' => 'currency_exch_name', + 'label' => trans('admin::app.datagrid.currency-name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -49,9 +43,8 @@ class ExchangeRatesDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'cer.rate', - 'alias' => 'exchRate', - 'label' => 'Exchange Rate', + 'index' => 'currency_exch_rate', + 'label' => trans('admin::app.datagrid.exch-rate'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php index 668fe3bc3..56334ad3d 100755 --- a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * InventorySourcesDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class InventorySourcesDataGrid extends AbsGrid +class InventorySourcesDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class InventorySourcesDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'invId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class InventorySourcesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'code', - 'alias' => 'invCode', - 'label' => 'Code', + 'label' => trans('admin::app.datagrid.code'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +44,7 @@ class InventorySourcesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'name', - 'alias' => 'invName', - 'label' => 'Name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -60,8 +53,7 @@ class InventorySourcesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'priority', - 'alias' => 'invPriority', - 'label' => 'Priority', + 'label' => trans('admin::app.datagrid.priority'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -70,14 +62,13 @@ class InventorySourcesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'status', - 'alias' => 'invStatus', - 'label' => 'Status', + 'label' => trans('admin::app.datagrid.status'), 'type' => 'boolean', 'searchable' => true, 'sortable' => true, 'width' => '100px', - 'wrapper' => function($value){ - if($value == 1) + 'wrapper' => function($value) { + if ($value == 1) return 'Active'; else return 'Inactive'; diff --git a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php index 044321232..09900efbe 100755 --- a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * LocalesDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class LocalesDataGrid extends AbsGrid +class LocalesDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class LocalesDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'localeId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class LocalesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'code', - 'alias' => 'localeCode', - 'label' => 'Code', + 'label' => trans('admin::app.datagrid.code'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +44,7 @@ class LocalesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'name', - 'alias' => 'localeName', - 'label' => 'Name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/NewsLetterDataGrid.php b/packages/Webkul/Admin/src/DataGrids/NewsLetterDataGrid.php index 84d7e2dad..c90738484 100755 --- a/packages/Webkul/Admin/src/DataGrids/NewsLetterDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/NewsLetterDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * News Letter Grid class + * NewsLetterDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class NewsLetterDataGrid extends AbsGrid +class NewsLetterDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class NewsLetterDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'subsId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,14 +35,13 @@ class NewsLetterDataGrid extends AbsGrid $this->addColumn([ 'index' => 'is_subscribed', - 'alias' => 'subsCode', - 'label' => 'Subscribed', + 'label' => trans('admin::app.datagrid.subscribed'), 'type' => 'string', 'searchable' => true, 'sortable' => true, 'width' => '100px', - 'wrapper' => function($value){ - if($value == 1) + 'wrapper' => function($value) { + if ($value == 1) return 'True'; else return 'False'; @@ -56,8 +50,7 @@ class NewsLetterDataGrid extends AbsGrid $this->addColumn([ 'index' => 'email', - 'alias' => 'subsEmail', - 'label' => 'Email', + 'label' => trans('admin::app.datagrid.email'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php index b2913d2dc..ca73d218f 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php @@ -2,36 +2,31 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * OrderDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class OrderDataGrid extends AbsGrid +class OrderDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; public function prepareQueryBuilder() { - $queryBuilder = DB::table('orders')->select('id', 'base_grand_total', 'grand_total', 'created_at', 'channel_name', 'status')->addSelect(DB::raw('CONCAT(customer_first_name, " ", customer_last_name) as fullname')); + $queryBuilder = DB::table('orders')->select('id', 'base_grand_total', 'grand_total', 'created_at', 'channel_name', 'status')->addSelect(DB::raw('CONCAT(customer_first_name, " ", customer_last_name) as full_name')); $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'orderId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class OrderDataGrid extends AbsGrid $this->addColumn([ 'index' => 'base_grand_total', - 'alias' => 'baseGrandTotal', - 'label' => 'Base Total', + 'label' => trans('admin::app.datagrid.base-total'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -53,8 +47,7 @@ class OrderDataGrid extends AbsGrid $this->addColumn([ 'index' => 'grand_total', - 'alias' => 'grandTotal', - 'label' => 'Grand Total', + 'label' => trans('admin::app.datagrid.grand-total'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -66,8 +59,7 @@ class OrderDataGrid extends AbsGrid $this->addColumn([ 'index' => 'created_at', - 'alias' => 'orderDate', - 'label' => 'Order Date', + 'label' => trans('admin::app.datagrid.order-date'), 'type' => 'string', 'sortable' => true, 'searchable' => true, @@ -76,8 +68,7 @@ class OrderDataGrid extends AbsGrid $this->addColumn([ 'index' => 'channel_name', - 'alias' => 'channelName', - 'label' => 'Channel Name', + 'label' => trans('admin::app.datagrid.channel-name'), 'type' => 'string', 'sortable' => true, 'searchable' => false, @@ -86,35 +77,33 @@ class OrderDataGrid extends AbsGrid $this->addColumn([ 'index' => 'status', - 'alias' => 'status', - 'label' => 'Status', + 'label' => trans('admin::app.datagrid.status'), 'type' => 'string', 'sortable' => true, 'searchable' => false, 'width' => '100px', 'closure' => true, 'wrapper' => function ($value) { - if($value == 'processing') + if ($value == 'processing') return 'Processing'; - else if($value == 'completed') + else if ($value == 'completed') return 'Completed'; - else if($value == "canceled") + else if ($value == "canceled") return 'Canceled'; - else if($value == "closed") + else if ($value == "closed") return 'Closed'; - else if($value == "pending") + else if ($value == "pending") return 'Pending'; - else if($value == "pending_payment") + else if ($value == "pending_payment") return 'Pending Payment'; - else if($value == "fraud") + else if ($value == "fraud") return 'Fraud'; } ]); $this->addColumn([ - 'index' => 'fullname', - 'alias' => 'fullName', - 'label' => 'Billed To', + 'index' => 'full_name', + 'label' => trans('admin::app.datagrid.billed-to'), 'type' => 'string', 'searchable' => false, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php index b21410693..d3fb5a42c 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * OrderInvoicesDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class OrderInvoicesDataGrid extends AbsGrid +class OrderInvoicesDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class OrderInvoicesDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'invid', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class OrderInvoicesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'order_id', - 'alias' => 'orderId', - 'label' => 'Order ID', + 'label' => trans('admin::app.datagrid.order-id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -50,8 +44,7 @@ class OrderInvoicesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'grand_total', - 'alias' => 'invgrandtotal', - 'label' => 'Grand Total', + 'label' => trans('admin::app.datagrid.grand-total'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -60,8 +53,7 @@ class OrderInvoicesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'created_at', - 'alias' => 'invcreatedat', - 'label' => 'Invoice Date', + 'label' => trans('admin::app.datagrid.invoice-date'), 'type' => 'datetime', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php index 46d26af23..b1a1b8b46 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php @@ -2,36 +2,31 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Product Data Grid class + * OrderShipmentsDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class OrderShipmentsDataGrid extends AbsGrid +class OrderShipmentsDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'shipment_id'; public function prepareQueryBuilder() { - $queryBuilder = DB::table('shipments as ship')->select('ship.id', 'ship.order_id', 'ship.total_qty', 'is.name', 'ors.created_at as orderdate', 'ship.created_at')->addSelect(DB::raw('CONCAT(ors.customer_first_name, " ", ors.customer_last_name) as custname'))->leftJoin('orders as ors', 'ship.order_id', '=', 'ors.id')->leftJoin('inventory_sources as is', 'ship.inventory_source_id', '=', 'is.id'); + $queryBuilder = DB::table('shipments as ship')->select('ship.id as shipment_id', 'ship.order_id as shipment_order_id', 'ship.total_qty as shipment_total_qty', 'is.name as inventory_source_name', 'ors.created_at as orderdate', 'ship.created_at as shipment_created_at')->addSelect(DB::raw('CONCAT(ors.customer_first_name, " ", ors.customer_last_name) as custname'))->leftJoin('orders as ors', 'ship.order_id', '=', 'ors.id')->leftJoin('inventory_sources as is', 'ship.inventory_source_id', '=', 'is.id'); $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; //the column that needs to be treated as index column - } - public function addColumns() { $this->addColumn([ - 'index' => 'ship.id', - 'alias' => 'shipId', - 'label' => 'ID', + 'index' => 'shipment_id', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,9 +34,8 @@ class OrderShipmentsDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'ship.order_id', - 'alias' => 'orderId', - 'label' => 'Order ID', + 'index' => 'shipment_order_id', + 'label' => trans('admin::app.datagrid.order-id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -49,9 +43,8 @@ class OrderShipmentsDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'ship.total_qty', - 'alias' => 'shipTotalQty', - 'label' => 'Total Qty', + 'index' => 'shipment_total_qty', + 'label' => trans('admin::app.datagrid.total-qty'), 'type' => 'number', 'searchable' => true, 'sortable' => true, @@ -59,9 +52,8 @@ class OrderShipmentsDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'is.name', - 'alias' => 'shipInventoryName', - 'label' => 'Inventory Source', + 'index' => 'inventory_source_name', + 'label' => trans('admin::app.datagrid.inventory-source'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -70,8 +62,7 @@ class OrderShipmentsDataGrid extends AbsGrid $this->addColumn([ 'index' => 'orderdate', - 'alias' => 'shipOrderDate', - 'label' => 'Order Date', + 'label' => trans('admin::app.datagrid.order-date'), 'type' => 'datetime', 'sortable' => true, 'searchable' => true, @@ -79,9 +70,8 @@ class OrderShipmentsDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'ship.created_at', - 'alias' => 'shipDate', - 'label' => 'Shipment Date', + 'index' => 'shipment_created_at', + 'label' => trans('admin::app.datagrid.shipment-date'), 'type' => 'datetime', 'sortable' => true, 'searchable' => false, @@ -90,8 +80,7 @@ class OrderShipmentsDataGrid extends AbsGrid $this->addColumn([ 'index' => 'custname', - 'alias' => 'shipTO', - 'label' => 'Shipping To', + 'label' => trans('admin::app.datagrid.shipment-to'), 'type' => 'string', 'sortable' => true, 'searchable' => false, diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php old mode 100755 new mode 100644 index 1bd3dbc1f..60ce8d32e --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -2,208 +2,133 @@ namespace Webkul\Admin\DataGrids; -use Illuminate\View\View; -use Webkul\Ui\DataGrid\Facades\DataGrid; -use Webkul\Channel\Repositories\ChannelRepository; -use Webkul\Product\Repositories\ProductRepository; +use Webkul\Ui\DataGrid\DataGrid; +use DB; /** - * Product DataGrid + * ProductDataGrid Class * - * @author Prashant Singh @prashant-webkul + * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class ProductDataGrid +class ProductDataGrid extends DataGrid { + protected $index = 'product_id'; - /** - * The Data Grid implementation for Products - */ - public function createProductDataGrid() + public function prepareQueryBuilder() { - return DataGrid::make([ - 'name' => 'Products', - 'table' => 'products_grid as prods', - 'select' => 'prods.product_id', - 'perpage' => 10, - 'aliased' => false, //use this with false as default and true in case of joins + $queryBuilder = DB::table('products_grid')->addSelect('products_grid.product_id as product_id', 'products_grid.sku as product_sku', 'products_grid.name as product_name', 'products.type as product_type', 'products_grid.status as product_status', 'products_grid.price as product_price', 'products_grid.quantity as product_quantity')->leftJoin('products', 'products_grid.product_id', '=', 'products.id'); - 'massoperations' => [ - 0 => [ - 'type' => 'delete', //all lower case will be shifted in the configuration file for better control and increased fault tolerance - 'action' => route('admin.catalog.products.massdelete'), - 'method' => 'DELETE' - ], + $this->setQueryBuilder($queryBuilder); + } - 1 => [ - 'type' => 'update', //all lower case will be shifted in the configuration file for better control and increased fault tolerance - 'action' => route('admin.catalog.products.massupdate'), - 'method' => 'PUT', - 'options' => [ - 0 => 'In Active', - 1 => 'Active', - ] - ] - ], - - 'actions' => [ - [ - 'type' => 'Edit', - 'route' => 'admin.catalog.products.edit', - // 'confirm_text' => trans('ui::app.datagrid.massaction.edit', ['resource' => 'product']), - 'icon' => 'icon pencil-lg-icon' - ], [ - 'type' => 'Delete', - 'route' => 'admin.catalog.products.delete', - 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), - 'icon' => 'icon trash-icon' - ] - ], - - 'join' => [ - ], - - //use aliasing on secodary columns if join is performed - 'columns' => [ - //name, alias, type, label, sortable - [ - 'name' => 'prods.product_id', - 'alias' => 'id', - 'type' => 'string', - 'label' => 'ID', - 'sortable' => true, - ], [ - 'name' => 'prods.sku', - 'alias' => 'productSku', - 'type' => 'string', - 'label' => 'SKU', - 'sortable' => true, - ], [ - 'name' => 'prods.name', - 'alias' => 'ProductName', - 'type' => 'string', - 'label' => 'Name', - 'sortable' => true, - ], [ - 'name' => 'prods.type', - 'alias' => 'ProductType', - 'type' => 'string', - 'label' => 'Type', - 'sortable' => true, - ], [ - 'name' => 'prods.status', - 'alias' => 'ProductStatus', - 'type' => 'boolean', - 'label' => 'Status', - 'sortable' => true, - 'wrapper' => function ($value) { - if($value == 1) - return 'Active'; - else - return 'Inactive'; - }, - ], [ - 'name' => 'prods.price', - 'alias' => 'ProductPrice', - 'type' => 'string', - 'label' => 'Price', - 'sortable' => true, - 'wrapper' => function ($value) { - return core()->formatBasePrice($value); - }, - ], [ - 'name' => 'prods.attribute_family_name', - 'alias' => 'productattributefamilyname', - 'type' => 'string', - 'label' => 'Attribute Family', - 'sortable' => true, - ], [ - 'name' => 'prods.quantity', - 'alias' => 'ProductQuantity', - 'type' => 'string', - 'label' => 'Product Quantity', - 'sortable' => true, - ] - ], - - 'filterable' => [ - //column, alias, type, and label - [ - 'column' => 'prods.product_id', - 'alias' => 'productID', - 'type' => 'number', - 'label' => 'ID', - ], [ - 'column' => 'prods.sku', - 'alias' => 'productSku', - 'type' => 'string', - 'label' => 'SKU', - ], [ - 'column' => 'prods.name', - 'alias' => 'ProductName', - 'type' => 'string', - 'label' => 'Product Name', - ], [ - 'column' => 'prods.type', - 'alias' => 'ProductType', - 'type' => 'string', - 'label' => 'Product Type', - ], [ - 'column' => 'prods.status', - 'alias' => 'ProductStatus', - 'type' => 'boolean', - 'label' => 'Status' - ] - ], - //don't use aliasing in case of searchables - - 'searchable' => [ - //column, type and label - [ - 'column' => 'prods.product_id', - 'type' => 'number', - 'label' => 'ID', - ], [ - 'column' => 'prods.sku', - 'type' => 'string', - 'label' => 'SKU', - ], [ - 'column' => 'prods.name', - 'type' => 'string', - 'label' => 'Product Name', - ], [ - 'column' => 'prods.type', - 'type' => 'string', - 'label' => 'Product Type', - ] - ], - - //list of viable operators that will be used - 'operators' => [ - 'eq' => "=", - 'lt' => "<", - 'gt' => ">", - 'lte' => "<=", - 'gte' => ">=", - 'neqs' => "<>", - 'neqn' => "!=", - 'like' => "like", - 'nlike' => "not like", - ], - // 'css' => [] + public function addColumns() + { + $this->addColumn([ + 'index' => 'product_id', + 'label' => trans('admin::app.datagrid.id'), + 'type' => 'number', + 'searchable' => false, + 'sortable' => true, + 'width' => '40px' ]); + $this->addColumn([ + 'index' => 'product_sku', + 'label' => trans('admin::app.datagrid.sku'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'width' => '100px' + ]); + + $this->addColumn([ + 'index' => 'product_name', + 'label' => trans('admin::app.datagrid.name'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'width' => '100px' + ]); + + $this->addColumn([ + 'index' => 'product_type', + 'label' => trans('admin::app.datagrid.type'), + 'type' => 'string', + 'sortable' => true, + 'searchable' => true, + 'width' => '100px' + ]); + + $this->addColumn([ + 'index' => 'product_status', + 'label' => trans('admin::app.datagrid.status'), + 'type' => 'boolean', + 'sortable' => true, + 'searchable' => false, + 'width' => '100px', + 'wrapper' => function($value) { + if ($value == 1) + return 'Active'; + else + return 'Inactive'; + } + ]); + + $this->addColumn([ + 'index' => 'product_price', + 'label' => trans('admin::app.datagrid.price'), + 'type' => 'number', + 'sortable' => true, + 'searchable' => false, + 'width' => '100px', + 'wrapper' => function($value) { + return core()->formatBasePrice($value); + } + ]); + + $this->addColumn([ + 'index' => 'product_quantity', + 'label' => trans('admin::app.datagrid.qty'), + 'type' => 'number', + 'sortable' => true, + 'searchable' => false, + 'width' => '100px' + ]); } - public function render() - { - return $this->createProductDataGrid()->render(); + public function prepareActions() { + $this->addAction([ + 'type' => 'Edit', + 'route' => 'admin.catalog.products.edit', + 'icon' => 'icon pencil-lg-icon' + ]); + + $this->addAction([ + 'type' => 'Delete', + 'route' => 'admin.catalog.products.delete', + 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), + 'icon' => 'icon trash-icon' + ]); } - public function export() - { - $paginate = false; - return $this->createProductDataGrid()->render($paginate); - } + public function prepareMassActions() { + $this->addMassAction([ + 'type' => 'delete', + 'label' => 'Delete', + 'action' => route('admin.catalog.products.massdelete'), + 'method' => 'DELETE' + ]); + $this->addMassAction([ + 'type' => 'update', + 'label' => 'Update Status', + 'action' => route('admin.catalog.products.massupdate'), + 'method' => 'PUT', + 'options' => [ + 'Active' => 1, + 'Inactive' => 0 + ] + ]); + } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php index bc285dae5..88814b9f1 100755 --- a/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * News Letter Grid class + * RolesDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class RolesDataGrid extends AbsGrid +class RolesDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class RolesDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'roleId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class RolesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'name', - 'alias' => 'roleName', - 'label' => 'Name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +44,7 @@ class RolesDataGrid extends AbsGrid $this->addColumn([ 'index' => 'permission_type', - 'alias' => 'roleType', - 'label' => 'Permission Type', + 'label' => trans('admin::app.datagrid.permission-type'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php index a79da325f..74aef6d05 100755 --- a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php @@ -2,36 +2,31 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * News Letter Grid class + * SliderDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class SliderDataGrid extends AbsGrid +class SliderDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'slider_id'; public function prepareQueryBuilder() { - $queryBuilder = DB::table('sliders as sl')->addSelect('sl.id', 'sl.title', 'ch.name')->leftJoin('channels as ch', 'sl.channel_id', '=', 'ch.id'); + $queryBuilder = DB::table('sliders as sl')->addSelect('sl.id as slider_id', 'sl.title as slider_title', 'ch.name as channel_name')->leftJoin('channels as ch', 'sl.channel_id', '=', 'ch.id'); $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ - 'index' => 'sl.id', - 'alias' => 'sliderId', - 'label' => 'ID', + 'index' => 'slider_id', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,9 +34,8 @@ class SliderDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'sl.title', - 'alias' => 'sliderTitle', - 'label' => 'Tile', + 'index' => 'slider_title', + 'label' => trans('admin::app.datagrid.title'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -49,9 +43,8 @@ class SliderDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'ch.name', - 'alias' => 'channelName', - 'label' => 'Channel Name', + 'index' => 'channel_name', + 'label' => trans('admin::app.datagrid.channel-name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php index b71bd21eb..0098a80e6 100755 --- a/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Tax Category Grid class + * TaxCategoryDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class TaxCategoryDataGrid extends AbsGrid +class TaxCategoryDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class TaxCategoryDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'taxCatId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class TaxCategoryDataGrid extends AbsGrid $this->addColumn([ 'index' => 'name', - 'alias' => 'taxCatName', - 'label' => 'Name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +44,7 @@ class TaxCategoryDataGrid extends AbsGrid $this->addColumn([ 'index' => 'code', - 'alias' => 'taxCatCode', - 'label' => 'Code', + 'label' => trans('admin::app.datagrid.code'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php index 1598965b0..7beca667c 100755 --- a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php @@ -2,18 +2,18 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * Tax Rate Grid class + * TaxRateDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class TaxRateDataGrid extends AbsGrid +class TaxRateDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'id'; public function prepareQueryBuilder() { @@ -22,16 +22,11 @@ class TaxRateDataGrid extends AbsGrid $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ 'index' => 'id', - 'alias' => 'taxRateId', - 'label' => 'ID', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -40,8 +35,7 @@ class TaxRateDataGrid extends AbsGrid $this->addColumn([ 'index' => 'identifier', - 'alias' => 'taxRateName', - 'label' => 'Identifier', + 'label' => trans('admin::app.datagrid.identifier'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -50,8 +44,7 @@ class TaxRateDataGrid extends AbsGrid $this->addColumn([ 'index' => 'state', - 'alias' => 'taxRateState', - 'label' => 'State', + 'label' => trans('admin::app.datagrid.state'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -60,8 +53,7 @@ class TaxRateDataGrid extends AbsGrid $this->addColumn([ 'index' => 'country', - 'alias' => 'taxRateCountry', - 'label' => 'Country', + 'label' => trans('admin::app.datagrid.country'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -70,8 +62,7 @@ class TaxRateDataGrid extends AbsGrid $this->addColumn([ 'index' => 'tax_rate', - 'alias' => 'taxRate', - 'label' => 'Rate', + 'label' => trans('admin::app.datagrid.tax-rate'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/DataGrids/TestDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TestDataGrid.php deleted file mode 100644 index 441d3c646..000000000 --- a/packages/Webkul/Admin/src/DataGrids/TestDataGrid.php +++ /dev/null @@ -1,147 +0,0 @@ - @prashant-webkul - * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) - */ -class TestDataGrid extends AbsGrid -{ - public $allColumns = []; - - public function prepareQueryBuilder() - { - $queryBuilder = DB::table('products_grid')->addSelect('products_grid.product_id', 'products_grid.sku', 'products_grid.name', 'products.type', 'products_grid.status', 'products_grid.price', 'products_grid.quantity')->leftJoin('products', 'products_grid.product_id', '=', 'products.id'); - - $this->setQueryBuilder($queryBuilder); - } - - public function setIndex() { - $this->index = 'product_id'; //the column that needs to be treated as index column - } - - // public function setGridName() { - // $this->gridName = 'products_grid'; // should be the table name for getting proper index - // } - - public function addColumns() - { - $this->addColumn([ - 'index' => 'products_grid.product_id', - 'alias' => 'productid', - 'label' => 'ID', - 'type' => 'number', - 'searchable' => false, - 'sortable' => true, - 'width' => '40px' - ]); - - $this->addColumn([ - 'index' => 'products_grid.sku', - 'alias' => 'productsku', - 'label' => 'SKU', - 'type' => 'string', - 'searchable' => true, - 'sortable' => true, - 'width' => '100px' - ]); - - $this->addColumn([ - 'index' => 'products_grid.name', - 'alias' => 'productname', - 'label' => 'Name', - 'type' => 'string', - 'searchable' => true, - 'sortable' => true, - 'width' => '100px' - ]); - - $this->addColumn([ - 'index' => 'products.type', - 'alias' => 'producttype', - 'label' => 'Type', - 'type' => 'string', - 'sortable' => true, - 'searchable' => true, - 'width' => '100px' - ]); - - $this->addColumn([ - 'index' => 'products_grid.status', - 'alias' => 'productstatus', - 'label' => 'Status', - 'type' => 'boolean', - 'sortable' => true, - 'searchable' => false, - 'width' => '100px', - 'wrapper' => function($value) { - if($value == 1) - return 'Active'; - else - return 'Inactive'; - } - ]); - - $this->addColumn([ - 'index' => 'products_grid.price', - 'alias' => 'productprice', - 'label' => 'Price', - 'type' => 'number', - 'sortable' => true, - 'searchable' => false, - 'width' => '100px', - 'wrapper' => function($value) { - return core()->formatBasePrice($value); - } - ]); - - $this->addColumn([ - 'index' => 'products_grid.quantity', - 'alias' => 'productqty', - 'label' => 'Quantity', - 'type' => 'number', - 'sortable' => true, - 'searchable' => false, - 'width' => '100px' - ]); - } - - public function prepareActions() { - $this->addAction([ - 'type' => 'Edit', - 'route' => 'admin.catalog.products.edit', - 'icon' => 'icon pencil-lg-icon' - ]); - - $this->addAction([ - 'type' => 'Delete', - 'route' => 'admin.catalog.products.delete', - 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), - 'icon' => 'icon trash-icon' - ]); - } - - public function prepareMassActions() { - $this->addMassAction([ - 'type' => 'delete', - 'action' => route('admin.catalog.products.massdelete'), - 'method' => 'DELETE' - ]); - - $this->addMassAction([ - 'type' => 'update', - 'action' => route('admin.catalog.products.massupdate'), - 'method' => 'PUT', - 'options' => [ - 0 => true, - 1 => false, - ] - ]); - } -} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php index fe40caafd..263d263d4 100755 --- a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php @@ -2,36 +2,31 @@ namespace Webkul\Admin\DataGrids; -use Webkul\Ui\DataGrid\AbsGrid; +use Webkul\Ui\DataGrid\DataGrid; use DB; /** - * News Letter Grid class + * UserDataGrid Class * * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ -class UserDataGrid extends AbsGrid +class UserDataGrid extends DataGrid { - public $allColumns = []; + protected $index = 'user_id'; public function prepareQueryBuilder() { - $queryBuilder = DB::table('admins as u')->addSelect('u.id', 'u.name', 'u.status', 'u.email', 'ro.name')->leftJoin('roles as ro', 'u.role_id', '=', 'ro.id'); + $queryBuilder = DB::table('admins as u')->addSelect('u.id as user_id', 'u.name as user_name', 'u.status as user_status', 'u.email as user_email', 'ro.name as role_name')->leftJoin('roles as ro', 'u.role_id', '=', 'ro.id'); $this->setQueryBuilder($queryBuilder); } - public function setIndex() { - $this->index = 'id'; - } - public function addColumns() { $this->addColumn([ - 'index' => 'u.id', - 'alias' => 'adminId', - 'label' => 'ID', + 'index' => 'user_id', + 'label' => trans('admin::app.datagrid.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,9 +34,8 @@ class UserDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'u.name', - 'alias' => 'adminName', - 'label' => 'Name', + 'index' => 'user_name', + 'label' => trans('admin::app.datagrid.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -49,15 +43,14 @@ class UserDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'u.status', - 'alias' => 'adminStatus', - 'label' => 'Status', + 'index' => 'user_status', + 'label' => trans('admin::app.datagrid.status'), 'type' => 'boolean', 'searchable' => true, 'sortable' => true, 'width' => '100px', 'wrapper' => function($value) { - if($value == 1) { + if ($value == 1) { return 'Active'; } else { return 'Inactive'; @@ -66,9 +59,8 @@ class UserDataGrid extends AbsGrid ]); $this->addColumn([ - 'index' => 'u.email', - 'alias' => 'adminEmail', - 'label' => 'Email', + 'index' => 'user_email', + 'label' => trans('admin::app.datagrid.email'), 'type' => 'string', 'searchable' => true, 'sortable' => true, diff --git a/packages/Webkul/Admin/src/Exceptions/Handler.php b/packages/Webkul/Admin/src/Exceptions/Handler.php index 109c25392..b5e6c5759 100755 --- a/packages/Webkul/Admin/src/Exceptions/Handler.php +++ b/packages/Webkul/Admin/src/Exceptions/Handler.php @@ -35,7 +35,7 @@ class Handler extends ExceptionHandler } // else if ($exception instanceof ErrorException) { - // if(strpos($_SERVER['REQUEST_URI'], 'admin') !== false){ + // if (strpos($_SERVER['REQUEST_URI'], 'admin') !== false) { // return response()->view('admin::errors.500', [], 500); // }else { // return response()->view('shop::errors.500', [], 500); diff --git a/packages/Webkul/Admin/src/Exports/DataGridExport.php b/packages/Webkul/Admin/src/Exports/DataGridExport.php index 1694abaa1..42aa9254c 100755 --- a/packages/Webkul/Admin/src/Exports/DataGridExport.php +++ b/packages/Webkul/Admin/src/Exports/DataGridExport.php @@ -42,9 +42,11 @@ class DataGridExport implements FromView, ShouldAutoSize { $pagination = false; - return view('admin::export.export', [ - 'results' => $this->gridData->render($pagination)->results, - 'columns' => $this->gridData->render($pagination)->columns, - ]); + dd($this->gridData); + + // return view('admin::export.export', [ + // 'results' => $this->gridData->render($pagination)->results, + // 'columns' => $this->gridData->render($pagination)->columns, + // ]); } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php index 3f889fe02..873a94bc9 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php @@ -65,7 +65,7 @@ class ConfigurationController extends Controller { $tree = Tree::create(); - foreach(config('core') as $item) { + foreach (config('core') as $item) { $tree->add($item); } @@ -83,7 +83,7 @@ class ConfigurationController extends Controller { $slugs = $this->getDefaultConfigSlugs(); - if(count($slugs)) { + if (count($slugs)) { return redirect()->route('admin.configuration.index', $slugs); } @@ -99,7 +99,7 @@ class ConfigurationController extends Controller { $slugs = []; - if(!request()->route('slug')) { + if (! request()->route('slug')) { $firstItem = current($this->configTree->items); $secondItem = current($firstItem['children']); @@ -110,7 +110,7 @@ class ConfigurationController extends Controller 'slug2' => end($temp) ]; } else { - if(!request()->route('slug2')) { + if (! request()->route('slug2')) { $secondItem = current($this->configTree->items[request()->route('slug')]['children']); $temp = explode('.', $secondItem['key']); diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php index 92b81bc1e..bbb2bfaa6 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php @@ -103,7 +103,6 @@ class CustomerController extends Controller 'first_name' => 'string|required', 'last_name' => 'string|required', 'gender' => 'required', - 'phone' => 'nullable|numeric|unique:customers,phone', 'email' => 'required|unique:customers,email', 'date_of_birth' => 'date|before:today' ]); @@ -112,7 +111,9 @@ class CustomerController extends Controller $password = bcrypt(rand(100000,10000000)); - $data['password']=$password; + $data['password'] = $password; + + $data['is_verified'] = 1; $this->customer->create($data); diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php index 026de76fc..91f1f332c 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php @@ -129,7 +129,7 @@ class CustomerGroupController extends Controller { $group = $this->customerGroup->findOneByField('id', $id); - if($group->is_user_defined == 0) { + if ($group->is_user_defined == 0) { session()->flash('warning', trans('admin::app.customers.customers.group-default')); } else { session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer Group'])); diff --git a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php index 6b10629b8..216ad02c4 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php @@ -114,7 +114,7 @@ class DashboardController extends Controller public function getPercentageChange($previous, $current) { - if(!$previous) + if (! $previous) return $current ? 100 : 0; return ($current - $previous) / $previous * 100; @@ -291,7 +291,7 @@ class DashboardController extends Controller ? Carbon::createFromTimeString(request()->get('end') . " 23:59:59") : Carbon::now(); - if($this->endDate > Carbon::now()) + if ($this->endDate > Carbon::now()) $this->endDate = Carbon::now(); $this->lastStartDate = clone $this->startDate; diff --git a/packages/Webkul/Admin/src/Http/Controllers/ExportController.php b/packages/Webkul/Admin/src/Http/Controllers/ExportController.php index 6aae3d418..9b1485773 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/ExportController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/ExportController.php @@ -32,7 +32,11 @@ class ExportController extends Controller */ public function export() { - $results = unserialize(request()->all()['gridData']); + $results = request()->all()['gridData']; + + $data = json_decode($results, true); + + $results = (object) $data; $file_name = class_basename($results); diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php index 2b659d31e..f33aec45f 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php @@ -91,7 +91,7 @@ class InvoiceController extends Controller { $order = $this->order->find($orderId); - if(!$order->canInvoice()) { + if (! $order->canInvoice()) { session()->flash('error', 'Order invoice creation is not allowed.'); return redirect()->back(); @@ -105,13 +105,13 @@ class InvoiceController extends Controller $haveProductToInvoice = false; foreach ($data['invoice']['items'] as $itemId => $qty) { - if($qty) { + if ($qty) { $haveProductToInvoice = true; break; } } - if(!$haveProductToInvoice) { + if (! $haveProductToInvoice) { session()->flash('error', 'Invoice can not be created without products.'); return redirect()->back(); diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php index 27f1a29ab..542930b6f 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php @@ -78,7 +78,7 @@ class OrderController extends Controller { $result = $this->order->cancel($id); - if($result) { + if ($result) { session()->flash('success', trans('Order canceled successfully.')); } else { session()->flash('error', trans('Order can not be canceled.')); diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php index d40c1e84f..640f47d6e 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php @@ -91,7 +91,7 @@ class ShipmentController extends Controller { $order = $this->order->find($orderId); - if(!$order->channel || !$order->canShip()) { + if (! $order->channel || !$order->canShip()) { session()->flash('error', 'Shipment can not be created for this order.'); return redirect()->back(); @@ -111,7 +111,7 @@ class ShipmentController extends Controller { $order = $this->order->find($orderId); - if(!$order->canShip()) { + if (! $order->canShip()) { session()->flash('error', 'Order shipment creation is not allowed.'); return redirect()->back(); @@ -126,7 +126,7 @@ class ShipmentController extends Controller $data = request()->all(); - if(!$this->isInventoryValidate($data)) { + if (! $this->isInventoryValidate($data)) { session()->flash('error', 'Requested quantity is invalid or not available.'); return redirect()->back(); @@ -159,6 +159,7 @@ class ShipmentController extends Controller $inventory = $product->inventories() ->where('inventory_source_id', $data['shipment']['source']) + ->where('vendor_id', 0) ->first(); if ($orderItem->qty_to_ship < $qty || $inventory->qty < $qty) { diff --git a/packages/Webkul/Admin/src/Listeners/Product.php b/packages/Webkul/Admin/src/Listeners/Product.php index d28b0eef8..d2428ade5 100755 --- a/packages/Webkul/Admin/src/Listeners/Product.php +++ b/packages/Webkul/Admin/src/Listeners/Product.php @@ -47,7 +47,7 @@ class Product { public function afterProductCreated($product) { $result = $this->productCreated($product); - if($result) { + if ($result) { return true; } else { return false; @@ -76,13 +76,13 @@ class Product { $found = $this->productGrid->findOneByField('product_id', $product->id); //extra measure to stop duplicate entries - if($found == null) { + if ($found == null) { $this->productGrid->create($gridObject); - if($product->type == 'configurable') { + if ($product->type == 'configurable') { $variants = $product->variants()->get(); - foreach($variants as $variant) { + foreach ($variants as $variant) { $variantObj = [ 'product_id' => $variant->id, 'sku' => $variant->sku, @@ -130,7 +130,7 @@ class Product { public function productUpdated($product) { $productGridObject = $this->productGrid->findOneByField('product_id', $product->id); - if(!$productGridObject) { + if (! $productGridObject) { return false; } @@ -143,13 +143,13 @@ class Product { 'status' => $product->status, ]; - if($product->type == 'configurable') { + if ($product->type == 'configurable') { $gridObject['quantity'] = 0; $gridObject['price'] = 0; } else { $qty = 0; //inventories and inventory sources relation for the variants return empty or null collection objects only - foreach($product->inventories()->get() as $inventory_source) { + foreach ($product->inventories()->get() as $inventory_source) { $qty = $qty + $inventory_source->qty; } @@ -162,7 +162,7 @@ class Product { if ($product->type == 'configurable') { $variants = $product->variants()->get(); - foreach($variants as $variant) { + foreach ($variants as $variant) { $variantObj = [ 'product_id' => $variant->id, 'sku' => $variant->sku, @@ -176,7 +176,7 @@ class Product { $qty = 0; //inventories and inventory sources relation for the variants return empty or null collection objects only - foreach($variant->inventories()->get() as $inventory_source) { + foreach ($variant->inventories()->get() as $inventory_source) { $qty = $qty + $inventory_source->qty; } @@ -186,7 +186,7 @@ class Product { $productGridVariant = $this->productGrid->findOneByField('product_id', $variant->id); - if(isset($productGridVariant)) { + if (isset($productGridVariant)) { $this->productGrid->update($variantObj, $productGridVariant->id); } else { $variantObj = [ @@ -202,7 +202,7 @@ class Product { $qty = 0; //inventories and inventory sources relation for the variants return empty or null collection objects only - foreach($variant->inventories()->get() as $inventory_source) { + foreach ($variant->inventories()->get() as $inventory_source) { $qty = $qty + $inventory_source->qty; } @@ -224,7 +224,7 @@ class Product { public function sync() { $gridObject = []; - foreach($this->product->all() as $product) { + foreach ($this->product->all() as $product) { $gridObject = [ 'product_id' => $product->id, 'sku' => $product->sku, @@ -235,12 +235,12 @@ class Product { 'status' => $product->status ]; - if($product->type == 'configurable') { + if ($product->type == 'configurable') { $gridObject['quantity'] = 0; } else { $qty = 0; - foreach($product->toArray()['inventories'] as $inventorySource) { + foreach ($product->toArray()['inventories'] as $inventorySource) { $qty = $qty + $inventorySource['qty']; } @@ -251,7 +251,7 @@ class Product { $oldGridObject = $this->productGrid->findOneByField('product_id', $product->id); - if($oldGridObject) { + if ($oldGridObject) { $oldGridObject->update($gridObject); } else { $this->productGrid->create($gridObject); diff --git a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php index 8bfd68f32..c8d58685d 100755 --- a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php @@ -65,7 +65,7 @@ class AdminServiceProvider extends ServiceProvider view()->composer(['admin::catalog.products.create', 'admin::catalog.products.edit'], function ($view) { $accordian = Tree::create(); - foreach(config('product_form_accordians') as $item) { + foreach (config('product_form_accordians') as $item) { $accordian->add($item); } @@ -77,7 +77,7 @@ class AdminServiceProvider extends ServiceProvider view()->composer(['admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'], function ($view) { $tree = Tree::create(); - foreach(config('menu.admin') as $item) { + foreach (config('menu.admin') as $item) { if (bouncer()->hasPermission($item['key'])) { $tree->add($item, 'menu'); } @@ -114,12 +114,12 @@ class AdminServiceProvider extends ServiceProvider { static $tree; - if($tree) + if ($tree) return $tree; $tree = Tree::create(); - foreach(config('acl') as $item) { + foreach (config('acl') as $item) { $tree->add($item, 'acl'); } diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index d6d9e1379..c6a9b96df 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -8,6 +8,70 @@ return [ 'true' => 'True', 'false' => 'False' ], + + 'layouts' => [ + 'my-account' => 'My Account', + 'logout' => 'Logout', + 'visit-shop' => 'Visit Shop', + 'dashboard' => 'Dashboard', + 'sales' => 'Sales', + 'orders' => 'Orders', + 'shipments' => 'Shipments', + 'invoices' => 'Invoices', + 'catalog' => 'Catalog', + 'products' => 'Products', + 'categories' => 'Categories', + 'attributes' => 'Attributes', + 'attribute-families' => 'Attribute Families', + 'customers' => 'Customers', + 'groups' => 'Groups', + 'reviews' => 'Reviews', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', + 'configure' => 'Configure', + 'settings' => 'Settings', + 'locales' => 'Locales', + 'currencies' => 'Currencies', + 'exchange-rates' => 'Exchange Rates', + 'inventory-sources' => 'Inventory Sources', + 'channels' => 'Channels', + 'users' => 'Users', + 'roles' => 'Roles', + 'sliders' => 'Sliders', + 'taxes' => 'Taxes', + 'tax-categories' => 'Tax Categories', + 'tax-rates' => 'Tax Rates' + ], + + 'acl' => [ + 'dashboard' => 'Dashboard', + 'sales' => 'Sales', + 'orders' => 'Orders', + 'shipments' => 'Shipments', + 'invoices' => 'Invoices', + 'catalog' => 'Catalog', + 'products' => 'Products', + 'categories' => 'Categories', + 'attributes' => 'Attributes', + 'attribute-families' => 'Attribute Families', + 'customers' => 'Customers', + 'groups' => 'Groups', + 'reviews' => 'Reviews', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', + 'configure' => 'Configure', + 'settings' => 'Settings', + 'locales' => 'Locales', + 'currencies' => 'Currencies', + 'exchange-rates' => 'Exchange Rates', + 'inventory-sources' => 'Inventory Sources', + 'channels' => 'Channels', + 'users' => 'Users', + 'roles' => 'Roles', + 'sliders' => 'Sliders', + 'taxes' => 'Taxes', + 'tax-categories' => 'Tax Categories', + 'tax-rates' => 'Tax Rates' + ], + 'dashboard' => [ 'title' => 'Dashboard', 'from' => 'From', @@ -35,8 +99,51 @@ return [ 'method-error' => 'Error! Wrong method detected, please check mass action configuration', 'delete-success' => 'Selected index of :resource were successfully deleted', 'partial-action' => 'Some actions were not performed due restricted system constraints on :resource', - 'update-success' => 'Selected index of :resource were successfully updated' - ] + 'update-success' => 'Selected index of :resource were successfully updated', + ], + + 'id' => 'ID', + 'status' => 'Status', + 'code' => 'Code', + 'admin-name' => 'Name', + 'name' => 'Name', + 'fullname' => 'Full Name', + 'type' => 'Type', + 'required' => 'Required', + 'unique' => 'Unique', + 'per-locale' => 'Locale Based', + 'per-channel' => 'Channel Based', + 'position' => 'Position', + 'locale' => 'Locale', + 'hostname' => 'Hostname', + 'email' => 'Email', + 'group' => 'Group', + 'title' => 'Title', + 'comment' => 'Comment', + 'product-name' => 'Product', + 'currency-name' => 'Currency Name', + 'exch-rate' => 'Exchange Rate', + 'priority' => 'Priority', + 'subscribed' => 'Subscribed', + 'base-total' => 'Base Total', + 'grand-total' => 'Grand Total', + 'order-date' => 'Order Date', + 'channel-name' => 'Channel Name', + 'billed-to' => 'Billed To', + 'order-id' => 'Order Id', + 'invoice-date' => 'Invoice Date', + 'total-qty' => 'Total Qty', + 'inventory-source' => 'Inventory Source', + 'shipment-date' => 'Shipment Date', + 'shipment-to' => 'Shipping To', + 'sku' => 'SKU', + 'price' => 'Price', + 'qty' => 'Quantity', + 'permission-type' => 'Permission Type', + 'identifier' => 'Identifier', + 'state' => 'State', + 'country' => 'Country', + 'tax-rate' => 'Rate' ], 'account' => [ diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php index eacdb4017..387e0bfb9 100755 --- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php @@ -57,7 +57,7 @@ @{{ errors.first('admin_name') }} - @foreach(Webkul\Core\Models\Locale::all() as $locale) + @foreach (Webkul\Core\Models\Locale::all() as $locale)
@@ -173,7 +173,7 @@ {{ __('admin::app.catalog.attributes.admin_name') }} - @foreach(Webkul\Core\Models\Locale::all() as $locale) + @foreach (Webkul\Core\Models\Locale::all() as $locale) {{ $locale->name . ' (' . $locale->code . ')' }} @@ -194,7 +194,7 @@
- @foreach(Webkul\Core\Models\Locale::all() as $locale) + @foreach (Webkul\Core\Models\Locale::all() as $locale)
@@ -227,7 +227,7 @@ diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/cart/mini-cart.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/cart/mini-cart.blade.php index c904e9108..ac4e0a179 100755 --- a/packages/Webkul/Shop/src/Resources/views/checkout/cart/mini-cart.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/cart/mini-cart.blade.php @@ -2,7 +2,7 @@ getCart(); ?> -@if($cart) +@if ($cart) items; ?>