src/Eccube/Controller/Admin/Product/CategoryController.php 1 location
|
@@ 246-265 (lines=20) @@
|
| 243 |
|
/** |
| 244 |
|
* @Route("/%eccube_admin_route%/product/category/sort_no/move", name="admin_product_category_sort_no_move", methods={"POST"}) |
| 245 |
|
*/ |
| 246 |
|
public function moveSortNo(Request $request) |
| 247 |
|
{ |
| 248 |
|
if (!$request->isXmlHttpRequest()) { |
| 249 |
|
throw new BadRequestHttpException(); |
| 250 |
|
} |
| 251 |
|
|
| 252 |
|
if ($this->isTokenValid()) { |
| 253 |
|
$sortNos = $request->request->all(); |
| 254 |
|
foreach ($sortNos as $categoryId => $sortNo) { |
| 255 |
|
/* @var $Category \Eccube\Entity\Category */ |
| 256 |
|
$Category = $this->categoryRepository |
| 257 |
|
->find($categoryId); |
| 258 |
|
$Category->setSortNo($sortNo); |
| 259 |
|
$this->entityManager->persist($Category); |
| 260 |
|
} |
| 261 |
|
$this->entityManager->flush(); |
| 262 |
|
|
| 263 |
|
return new Response('Successful'); |
| 264 |
|
} |
| 265 |
|
} |
| 266 |
|
|
| 267 |
|
/** |
| 268 |
|
* カテゴリCSVの出力. |
src/Eccube/Controller/Admin/Product/ClassNameController.php 1 location
|
@@ 168-186 (lines=19) @@
|
| 165 |
|
/** |
| 166 |
|
* @Route("/%eccube_admin_route%/product/class_name/sort_no/move", name="admin_product_class_name_sort_no_move", methods={"POST"}) |
| 167 |
|
*/ |
| 168 |
|
public function moveSortNo(Request $request) |
| 169 |
|
{ |
| 170 |
|
if (!$request->isXmlHttpRequest()) { |
| 171 |
|
throw new BadRequestHttpException(); |
| 172 |
|
} |
| 173 |
|
|
| 174 |
|
if ($this->isTokenValid()) { |
| 175 |
|
$sortNos = $request->request->all(); |
| 176 |
|
foreach ($sortNos as $classNameId => $sortNo) { |
| 177 |
|
$ClassName = $this->classNameRepository |
| 178 |
|
->find($classNameId); |
| 179 |
|
$ClassName->setSortNo($sortNo); |
| 180 |
|
$this->entityManager->persist($ClassName); |
| 181 |
|
} |
| 182 |
|
$this->entityManager->flush(); |
| 183 |
|
|
| 184 |
|
return new Response(); |
| 185 |
|
} |
| 186 |
|
} |
| 187 |
|
} |
| 188 |
|
|
src/Eccube/Controller/Admin/Product/TagController.php 1 location
|
@@ 161-176 (lines=16) @@
|
| 158 |
|
/** |
| 159 |
|
* @Route("/%eccube_admin_route%/product/tag/sort_no/move", name="admin_product_tag_sort_no_move", methods={"POST"}) |
| 160 |
|
*/ |
| 161 |
|
public function moveSortNo(Request $request) |
| 162 |
|
{ |
| 163 |
|
if ($request->isXmlHttpRequest() && $this->isTokenValid()) { |
| 164 |
|
$sortNos = $request->request->all(); |
| 165 |
|
foreach ($sortNos as $tagId => $sortNo) { |
| 166 |
|
/* @var $Tag \Eccube\Entity\Tag */ |
| 167 |
|
$Tag = $this->tagRepository |
| 168 |
|
->find($tagId); |
| 169 |
|
$Tag->setSortNo($sortNo); |
| 170 |
|
$this->entityManager->persist($Tag); |
| 171 |
|
} |
| 172 |
|
$this->entityManager->flush(); |
| 173 |
|
} |
| 174 |
|
|
| 175 |
|
return new Response(); |
| 176 |
|
} |
| 177 |
|
|
| 178 |
|
protected function dispatchComplete(Request $request, FormInterface $form, Tag $Tag) |
| 179 |
|
{ |
src/Eccube/Controller/Admin/Setting/Shop/DeliveryController.php 1 location
|
@@ 349-366 (lines=18) @@
|
| 346 |
|
/** |
| 347 |
|
* @Route("/%eccube_admin_route%/setting/shop/delivery/sort_no/move", name="admin_setting_shop_delivery_sort_no_move", methods={"POST"}) |
| 348 |
|
*/ |
| 349 |
|
public function moveSortNo(Request $request) |
| 350 |
|
{ |
| 351 |
|
if (!$request->isXmlHttpRequest()) { |
| 352 |
|
throw new BadRequestHttpException(); |
| 353 |
|
} |
| 354 |
|
|
| 355 |
|
if ($this->isTokenValid()) { |
| 356 |
|
$sortNos = $request->request->all(); |
| 357 |
|
foreach ($sortNos as $deliveryId => $sortNo) { |
| 358 |
|
$Delivery = $this->deliveryRepository->find($deliveryId); |
| 359 |
|
$Delivery->setSortNo($sortNo); |
| 360 |
|
$this->entityManager->persist($Delivery); |
| 361 |
|
} |
| 362 |
|
$this->entityManager->flush(); |
| 363 |
|
} |
| 364 |
|
|
| 365 |
|
return $this->json('OK', 200); |
| 366 |
|
} |
| 367 |
|
} |
| 368 |
|
|
src/Eccube/Controller/Admin/Product/ClassCategoryController.php 1 location
|
@@ 249-267 (lines=19) @@
|
| 246 |
|
/** |
| 247 |
|
* @Route("/%eccube_admin_route%/product/class_category/sort_no/move", name="admin_product_class_category_sort_no_move", methods={"POST"}) |
| 248 |
|
*/ |
| 249 |
|
public function moveSortNo(Request $request) |
| 250 |
|
{ |
| 251 |
|
if (!$request->isXmlHttpRequest()) { |
| 252 |
|
throw new BadRequestHttpException(); |
| 253 |
|
} |
| 254 |
|
|
| 255 |
|
if ($this->isTokenValid()) { |
| 256 |
|
$sortNos = $request->request->all(); |
| 257 |
|
foreach ($sortNos as $categoryId => $sortNo) { |
| 258 |
|
$ClassCategory = $this->classCategoryRepository |
| 259 |
|
->find($categoryId); |
| 260 |
|
$ClassCategory->setSortNo($sortNo); |
| 261 |
|
$this->entityManager->persist($ClassCategory); |
| 262 |
|
} |
| 263 |
|
$this->entityManager->flush(); |
| 264 |
|
|
| 265 |
|
return new Response('Successful'); |
| 266 |
|
} |
| 267 |
|
} |
| 268 |
|
} |
| 269 |
|
|
src/Eccube/Controller/Admin/Setting/Shop/PaymentController.php 1 location
|
@@ 272-291 (lines=20) @@
|
| 269 |
|
* |
| 270 |
|
* @return Response |
| 271 |
|
*/ |
| 272 |
|
public function moveSortNo(Request $request) |
| 273 |
|
{ |
| 274 |
|
if (!$request->isXmlHttpRequest()) { |
| 275 |
|
throw new BadRequestHttpException(); |
| 276 |
|
} |
| 277 |
|
|
| 278 |
|
if ($this->isTokenValid()) { |
| 279 |
|
$sortNos = $request->request->all(); |
| 280 |
|
foreach ($sortNos as $paymentId => $sortNo) { |
| 281 |
|
/** @var Payment $Payment */ |
| 282 |
|
$Payment = $this->paymentRepository |
| 283 |
|
->find($paymentId); |
| 284 |
|
$Payment->setSortNo($sortNo); |
| 285 |
|
$this->entityManager->persist($Payment); |
| 286 |
|
} |
| 287 |
|
$this->entityManager->flush(); |
| 288 |
|
|
| 289 |
|
return new Response(); |
| 290 |
|
} |
| 291 |
|
} |
| 292 |
|
} |
| 293 |
|
|