[Feature] Recurring Ticket - Add Three Day and Biweekly to the Frequency options
This commit is contained in:
@@ -190,7 +190,9 @@
|
|||||||
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="frequency" required>
|
<select class="form-control select2" name="frequency" required>
|
||||||
|
<option>Three Days</option>
|
||||||
<option>Weekly</option>
|
<option>Weekly</option>
|
||||||
|
<option>Biweekly</option>
|
||||||
<option>Monthly</option>
|
<option>Monthly</option>
|
||||||
<option>Quarterly</option>
|
<option>Quarterly</option>
|
||||||
<option>Biannually</option>
|
<option>Biannually</option>
|
||||||
|
|||||||
@@ -212,7 +212,9 @@ ob_start();
|
|||||||
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="frequency">
|
<select class="form-control select2" name="frequency">
|
||||||
|
<option <?php if ($recurring_ticket_frequency == "Three Days") { echo "selected"; } ?>>Three Days</option>
|
||||||
<option <?php if ($recurring_ticket_frequency == "Weekly") { echo "selected"; } ?>>Weekly</option>
|
<option <?php if ($recurring_ticket_frequency == "Weekly") { echo "selected"; } ?>>Weekly</option>
|
||||||
|
<option <?php if ($recurring_ticket_frequency == "Biweekly") { echo "selected"; } ?>>Biweekly</option>
|
||||||
<option <?php if ($recurring_ticket_frequency == "Monthly") { echo "selected"; } ?>>Monthly</option>
|
<option <?php if ($recurring_ticket_frequency == "Monthly") { echo "selected"; } ?>>Monthly</option>
|
||||||
<option <?php if ($recurring_ticket_frequency == "Quarterly") { echo "selected"; } ?>>Quarterly</option>
|
<option <?php if ($recurring_ticket_frequency == "Quarterly") { echo "selected"; } ?>>Quarterly</option>
|
||||||
<option <?php if ($recurring_ticket_frequency == "Biannually") { echo "selected"; } ?>>Biannually</option>
|
<option <?php if ($recurring_ticket_frequency == "Biannually") { echo "selected"; } ?>>Biannually</option>
|
||||||
|
|||||||
@@ -406,10 +406,15 @@ if (mysqli_num_rows($sql_recurring_tickets) > 0) {
|
|||||||
addToMailQueue($data);
|
addToMailQueue($data);
|
||||||
|
|
||||||
// Set the next run date
|
// Set the next run date
|
||||||
if ($frequency == "weekly") {
|
if ($frequency == "three days") {
|
||||||
// Note: We seemingly have to initialize a new datetime for each loop to avoid stacking the dates
|
$now = new DateTime();
|
||||||
|
$next_run = date_add($now, date_interval_create_from_date_string('3 days'));
|
||||||
|
} elseif ($frequency == "weekly") {
|
||||||
$now = new DateTime();
|
$now = new DateTime();
|
||||||
$next_run = date_add($now, date_interval_create_from_date_string('1 week'));
|
$next_run = date_add($now, date_interval_create_from_date_string('1 week'));
|
||||||
|
} elseif ($frequency == "biweekly") {
|
||||||
|
$now = new DateTime();
|
||||||
|
$next_run = date_add($now, date_interval_create_from_date_string('2 weeks'));
|
||||||
} elseif ($frequency == "monthly") {
|
} elseif ($frequency == "monthly") {
|
||||||
$now = new DateTime();
|
$now = new DateTime();
|
||||||
$next_run = date_add($now, date_interval_create_from_date_string('1 month'));
|
$next_run = date_add($now, date_interval_create_from_date_string('1 month'));
|
||||||
|
|||||||
@@ -406,10 +406,15 @@ if (mysqli_num_rows($sql_recurring_tickets) > 0) {
|
|||||||
addToMailQueue($data);
|
addToMailQueue($data);
|
||||||
|
|
||||||
// Set the next run date
|
// Set the next run date
|
||||||
if ($frequency == "weekly") {
|
if ($frequency == "three days") {
|
||||||
// Note: We seemingly have to initialize a new datetime for each loop to avoid stacking the dates
|
$now = new DateTime();
|
||||||
|
$next_run = date_add($now, date_interval_create_from_date_string('3 days'));
|
||||||
|
} elseif ($frequency == "weekly") {
|
||||||
$now = new DateTime();
|
$now = new DateTime();
|
||||||
$next_run = date_add($now, date_interval_create_from_date_string('1 week'));
|
$next_run = date_add($now, date_interval_create_from_date_string('1 week'));
|
||||||
|
} elseif ($frequency == "biweekly") {
|
||||||
|
$now = new DateTime();
|
||||||
|
$next_run = date_add($now, date_interval_create_from_date_string('2 weeks'));
|
||||||
} elseif ($frequency == "monthly") {
|
} elseif ($frequency == "monthly") {
|
||||||
$now = new DateTime();
|
$now = new DateTime();
|
||||||
$next_run = date_add($now, date_interval_create_from_date_string('1 month'));
|
$next_run = date_add($now, date_interval_create_from_date_string('1 month'));
|
||||||
|
|||||||
Reference in New Issue
Block a user