-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into #247-email-validation
- Loading branch information
Showing
47 changed files
with
2,285 additions
and
621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
|
||
namespace App\Events\Labels; | ||
|
||
use Carbon\Carbon; | ||
use HMS\Entities\Members\Box; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class BoxPrint implements LabelPrintEventInterface | ||
{ | ||
use SerializesModels; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $templateName; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
public $substitutions; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $copiesToPrint; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param Box $box | ||
* @param int $copiesToPrint | ||
*/ | ||
public function __construct(Box $box, | ||
$copiesToPrint = 1) | ||
{ | ||
$this->templateName = 'member_box'; | ||
$this->copiesToPrint = $copiesToPrint; | ||
|
||
// hack to offset the ID printing and give the look of right justification | ||
$idOffset = (5 - strlen($box->getId())) * 35; | ||
|
||
$this->substitutions = [ | ||
'memberName' => $box->getUser()->getFullname(), | ||
'username' => $box->getUser()->getUsername(), | ||
'lastDate' => Carbon::now()->toDateString(), | ||
'qrURL' => route('user.boxes', ['user' => $box->getUser()->getId()]), | ||
'idOffset' => 220 + $idOffset, | ||
'memberBoxId' => $box->getId(), | ||
]; | ||
} | ||
|
||
/** | ||
* Gets the value of templateName. | ||
* | ||
* @return string | ||
*/ | ||
public function getTemplateName() | ||
{ | ||
return $this->templateName; | ||
} | ||
|
||
/** | ||
* Gets the value of substitutions. | ||
* | ||
* @return array | ||
*/ | ||
public function getSubstitutions() | ||
{ | ||
return $this->substitutions; | ||
} | ||
|
||
/** | ||
* Gets the value of copiesToPrint. | ||
* | ||
* @return int | ||
*/ | ||
public function getCopiesToPrint() | ||
{ | ||
return $this->copiesToPrint; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace App\Events\Users; | ||
|
||
use HMS\Entities\User; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class UserPasswordChanged | ||
{ | ||
use SerializesModels; | ||
|
||
/** | ||
* @var User | ||
*/ | ||
public $user; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param User $user | ||
*/ | ||
public function __construct(User $user) | ||
{ | ||
$this->user = $user; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
<?php | ||
|
||
namespace HMS\Entities\Members; | ||
|
||
use Carbon\Carbon; | ||
use HMS\Entities\User; | ||
|
||
class Box | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @var Carbon | ||
*/ | ||
protected $boughtDate; | ||
|
||
/** | ||
* @var null|Carbon | ||
*/ | ||
protected $removedDate; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
protected $state; | ||
|
||
/** | ||
* @var User | ||
*/ | ||
protected $user; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @return Carbon | ||
*/ | ||
public function getBoughtDate() | ||
{ | ||
return $this->boughtDate; | ||
} | ||
|
||
/** | ||
* @param Carbon $boughtDate | ||
* | ||
* @return self | ||
*/ | ||
public function setBoughtDate(Carbon $boughtDate) | ||
{ | ||
$this->boughtDate = $boughtDate; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return null|Carbon | ||
*/ | ||
public function getRemovedDate() | ||
{ | ||
return $this->removedDate; | ||
} | ||
|
||
/** | ||
* @param null|Carbon $removedDate | ||
* | ||
* @return self | ||
*/ | ||
public function setRemovedDate(?Carbon $removedDate) | ||
{ | ||
$this->removedDate = $removedDate; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getState() | ||
{ | ||
return $this->state; | ||
} | ||
|
||
/** | ||
* Gets the value of state. | ||
* | ||
* @return string | ||
*/ | ||
public function getStateString() | ||
{ | ||
return BoxState::STATE_STRINGS[$this->state]; | ||
} | ||
|
||
/** | ||
* @param int $state | ||
* | ||
* @return self | ||
*/ | ||
public function setState($state) | ||
{ | ||
if (array_key_exists($state, BoxState::STATE_STRINGS)) { | ||
$this->state = $state; | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return self | ||
*/ | ||
public function setStateInUse() | ||
{ | ||
$this->state = BoxState::INUSE; | ||
$this->removedDate = null; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return self | ||
*/ | ||
public function setStateRemoved() | ||
{ | ||
$this->state = BoxState::REMOVED; | ||
$this->removedDate = Carbon::now(); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return self | ||
*/ | ||
public function setStateAbandoned() | ||
{ | ||
$this->state = BoxState::ABANDONED; | ||
$this->removedDate = Carbon::now(); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return User | ||
*/ | ||
public function getUser() | ||
{ | ||
return $this->user; | ||
} | ||
|
||
/** | ||
* @param User $user | ||
* | ||
* @return self | ||
*/ | ||
public function setUser(User $user) | ||
{ | ||
$this->user = $user; | ||
|
||
return $this; | ||
} | ||
} |
Oops, something went wrong.