Skip to content

Commit

Permalink
issue fixes
Browse files Browse the repository at this point in the history
issue fixes
  • Loading branch information
BigAndini committed Mar 5, 2015
1 parent 1f09c38 commit 7792407
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 15 deletions.
10 changes: 9 additions & 1 deletion module/Admin/src/Admin/Controller/DeadlineController.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ public function deleteAction()
$deadline = $em->getRepository("ersEntity\Entity\Deadline")
->findOneBy(array('id' => $id));
$productprices = $deadline->getProductPrices();


$qb = $em->getRepository("ersEntity\Entity\PaymentType")->createQueryBuilder('n');
$paymenttypes = $qb->where(
$qb->expr()->orX(
$qb->expr()->eq('n.activeFrom_id', $id),
$qb->expr()->eq('n.activeUntil_id', $id)
))->getQuery()->getResult();

$request = $this->getRequest();
if ($request->isPost()) {
$del = $request->getPost('del', 'No');
Expand All @@ -127,6 +134,7 @@ public function deleteAction()
'id' => $id,
'deadline' => $deadline,
'productprices' => $productprices,
'paymenttypes' => $paymenttypes,
);
}
}
1 change: 1 addition & 0 deletions module/Admin/src/Admin/Form/Agegroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function __construct($name = null)
$this->add(array(
'name' => 'name',
'attributes' => array(
'required' => 'required',
'type' => 'text',
'class' => 'form-control form-element',
'placeholder' => 'Name...',
Expand Down
31 changes: 23 additions & 8 deletions module/Admin/view/admin/deadline/delete.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,31 @@ $this->headTitle($title);
?>
<h1><?php echo $this->escapeHtml($title); ?></h1>

<?php if(count($productprices) != 0): ?>
<p>Please delete these ProductPrices according to this deadline first.</p>
<?php if(count($productprices) != 0 || count($paymenttypes) != 0): ?>
<?php if(count($productprices) != 0): ?>
<p>Please delete these ProductPrices according to this deadline first.</p>

<ul>
<?php foreach($productprices as $price): ?>
<li>
<?php echo $price->getProduct()->getName().': ';?>
<?php echo $this->currencyFormat($price->getCharge(), 'EUR', null, 'de_DE'); ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if(count($paymenttypes) != 0): ?>
<p>Please delete these PaymentTypes according to this deadline first.</p>

<?php foreach($productprices as $price): ?>
<p>
<?php echo $price->getProduct()->getName().': ';?>
<?php echo $this->currencyFormat($price->getCharge(), 'EUR', null, 'de_DE'); ?>
</p>
<?php endforeach; ?>

<ul>
<?php foreach($paymenttypes as $type): ?>
<li>
<?php echo $type->getName(); ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>

<?php else: ?>
<p>Are you sure that you want to delete price limit
Expand Down
2 changes: 1 addition & 1 deletion module/Admin/view/admin/order/detail.phtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$title = 'Order No. '.$order->getId().' ('.$order->getStatus().')';
$title = 'Order '.$order->getCode()->getValue().' ('.$order->getStatus().')';
$this->headTitle($title);
?>

Expand Down
4 changes: 4 additions & 0 deletions module/Admin/view/admin/order/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ $this->headTitle($title);

<table class="table">
<tr>
<th>Code</th>
<th>Date</th>
<th>Purchaser</th>
<th>Price</th>
<th>Status</th>
<th>&nbsp;</th>
</tr>
<?php foreach ($orders as $order) : ?>
<tr>
<td><?php echo $order->getCode()->getValue(); ?></td>
<td><?php echo $order->getCreated()->format('d.m.Y H:i:s'); ?></td>
<td>
<?php echo $order->getPurchaser()->getPrename().' '.$order->getPurchaser()->getSurname(); ?>
<br />
Expand Down
16 changes: 11 additions & 5 deletions module/ersEntity/src/ersEntity/Entity/Agegroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Agegroup implements InputFilterAwareInterface
/**
* @ORM\Column(type="string", length=45)
*/
protected $displayName;
protected $name;

/**
* @ORM\Column(type="datetime")
Expand Down Expand Up @@ -149,7 +149,7 @@ public function getAgegroup()
*/
public function setName($name)
{
$this->displayName = $name;
$this->name = $name;

return $this;
}
Expand All @@ -161,7 +161,7 @@ public function setName($name)
*/
public function getName()
{
return $this->displayName;
return $this->name;
}

/**
Expand Down Expand Up @@ -277,6 +277,12 @@ public function getInputFilter()
),
'validators' => array(),
),
array(
'name' => 'name',
'required' => true,
'filters' => array(),
'validators' => array(),
),
array(
'name' => 'agegroup',
'required' => false,
Expand Down Expand Up @@ -331,7 +337,7 @@ public function populate(array $data = array())
*/
public function getArrayCopy(array $fields = array())
{
$dataFields = array('id', 'agegroup', 'displayName', 'updated', 'created');
$dataFields = array('id', 'agegroup', 'name', 'updated', 'created');
$relationFields = array();
$copiedFields = array();
foreach ($relationFields as $relationField) {
Expand Down Expand Up @@ -364,6 +370,6 @@ public function getArrayCopy(array $fields = array())

public function __sleep()
{
return array('id', 'agegroup', 'displayName', 'updated', 'created');
return array('id', 'agegroup', 'name', 'updated', 'created');
}
}

0 comments on commit 7792407

Please sign in to comment.