-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new setting for limiting new public bookings in the future (#1203).
- Loading branch information
1 parent
bc80d2c
commit 3d8d5af
Showing
4 changed files
with
115 additions
and
21 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
47 changes: 47 additions & 0 deletions
47
application/migrations/042_add_future_booking_limit_setting.php
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,47 @@ | ||
<?php defined('BASEPATH') or exit('No direct script access allowed'); | ||
|
||
/* ---------------------------------------------------------------------------- | ||
* Easy!Appointments - Open Source Web Scheduler | ||
* | ||
* @package EasyAppointments | ||
* @author A.Tselegidis <[email protected]> | ||
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis | ||
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3 | ||
* @link http://easyappointments.org | ||
* @since v1.4.0 | ||
* ---------------------------------------------------------------------------- */ | ||
|
||
/** | ||
* @property CI_DB_query_builder $db | ||
* @property CI_DB_forge $dbforge | ||
*/ | ||
class Migration_Add_future_booking_limit_setting extends CI_Migration { | ||
/** | ||
* Upgrade method. | ||
* | ||
* @throws Exception | ||
*/ | ||
public function up() | ||
{ | ||
if ( ! $this->db->get_where('settings', ['name' => 'future_booking_limit'])->num_rows()) | ||
{ | ||
$this->db->insert('settings', [ | ||
'name' => 'future_booking_limit', | ||
'value' => '90' // days | ||
]); | ||
} | ||
} | ||
|
||
/** | ||
* Downgrade method. | ||
* | ||
* @throws Exception | ||
*/ | ||
public function down() | ||
{ | ||
if ($this->db->get_where('settings', ['name' => 'future_booking_limit'])->num_rows()) | ||
{ | ||
$this->db->delete('settings', ['name' => 'future_booking_limit']); | ||
} | ||
} | ||
} |
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