Book a Room:空きスペースの時間貸しオンライン予約ができるかも

2017年10月3日

空きスペースなどを時間貸ししているサイト向けの WordPress 用プラグインの紹介です。
それは「Book a Room」です。
そのインストール手順から日本語化・使い方と設定などを解説していきます。

Book a Room

Screenshot of wordpress.org

Book a Room では、様々な空きスペースを時間貸しでオンライン予約ができます。
複数店舗を運営している場合にも一元管理が可能。
部屋を必要としないイベントなどの予約にも対応可。
オンライン予約受付日数を設定することもできます。

各部屋には、部屋付属の備品の設定や貸出可能な備品を設定可。

休業日や営業時間(開始時刻と終了時刻)を設定できます。

記事を作成もしくは更新時点でのバージョン:v 2.7.8.3
マルチサイトでの利用:可

インストール手順

下記の URL から ZIP ファイルを入手して、管理画面からアップロードして有効化するか
Book a Room – WordPress.org

もしくは、WordPress.org の公式プラグインディレクトリにリリースされているので、
管理画面から入手できます。

ダッシュボードから「プラグイン」メニューの「新規追加」を選択し、
プラグイン追加画面右上の検索窓に「Book a Room」と入力します。

WordPressプラグイン「Book a Room」のスクリーンショット

検索結果の一番左上に表示されると思うので、「今すぐインストール」をクリックします。
※一番左上に表示されない場合は、上記の画像から探して下さい。
インストールが完了したら、プラグインを「有効化」します。

プラグインのインストールに慣れていない方は、
下記の記事にて詳しく解説していますので、御覧ください。

WordPressプラグインのインストール手順を解説 – WordPress活用術

日本語化

Book a Room を有効化した際に日本語化されない場合には、
日本語化用の言語パックを translate.wordpress.org から入手できる場合があります。

WordPress と関連プロジェクト(テーマ・プラグイン)用の翻訳プラットフォームとして、
translate.wordpress.org (GlotPress) が導入されています。

※ボランティアで翻訳されている場合が多いので、
全てのプラグインで、必ずしも日本語化用の言語パックが用意されているわけでは無いです。
また、用意されていても 100% 翻訳されている保証もありません。

日本語化用の翻訳ファイルの探し方は、下記の記事を参照してください。

WordPress公式での日本語化用の翻訳ファイルの探し方 – WordPress活用術

専用テーブル

下記のテーブルを Book a Room 専用のテーブルとして作成し利用します。
テーブル作成時に $wpdb->prefix も使用しているので、マルチサイトにも対応。

bookaroom.php から CREATE TABLE 文を抜粋(記事用に一部修正)。

CREATE TABLE bookaroom_amenities (
amenityID int(10) unsigned NOT NULL AUTO_INCREMENT,
amenityDesc varchar(128) NOT NULL,
amenity_isReservable tinyint(1) NOT NULL DEFAULT '0',
 PRIMARY KEY  (amenityID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# create table for branches
CREATE TABLE bookaroom_branches (
branchID int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
branchDesc varchar(64) CHARACTER SET latin1 NOT NULL,
branchAddress text CHARACTER SET latin1 NOT NULL,
branchMapLink varchar(255) CHARACTER SET latin1 NOT NULL,
branchImageURL text CHARACTER SET latin1,
branch_isPublic tinyint(1) NOT NULL,
branch_isSocial tinyint(1) NOT NULL DEFAULT '1',
branch_showSocial tinyint(1) NOT NULL DEFAULT '1',
branch_hasNoloc tinyint(1) NOT NULL DEFAULT '1',
branchOpen_0 time DEFAULT NULL,
branchOpen_1 time DEFAULT NULL,
branchOpen_2 time DEFAULT NULL,
branchOpen_3 time DEFAULT NULL,
branchOpen_4 time DEFAULT NULL,
branchOpen_5 time DEFAULT NULL,
branchOpen_6 time DEFAULT NULL,
branchClose_0 time DEFAULT NULL,
branchClose_1 time DEFAULT NULL,
branchClose_2 time DEFAULT NULL,
branchClose_3 time DEFAULT NULL,
branchClose_4 time DEFAULT NULL,
branchClose_5 time DEFAULT NULL,
branchClose_6 time DEFAULT NULL,
PRIMARY KEY  (branchID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# create table for citie list		
CREATE TABLE bookaroom_cityList (
cityID int(10) unsigned NOT NULL AUTO_INCREMENT,
cityDesc varchar(128) NOT NULL,
UNIQUE KEY cityID (cityID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# create table for closings
CREATE TABLE bookaroom_closings (
closingID int(10) unsigned NOT NULL AUTO_INCREMENT,
reoccuring tinyint(1) NOT NULL DEFAULT '0',
type enum('date','range','special') NOT NULL,
startDay tinyint(3) unsigned DEFAULT NULL,
startMonth tinyint(3) unsigned DEFAULT NULL,
startYear smallint(5) unsigned DEFAULT NULL,
endDay tinyint(3) unsigned DEFAULT NULL,
endMonth tinyint(3) unsigned DEFAULT NULL,
endYear smallint(5) unsigned DEFAULT NULL,
spWeek tinyint(3) unsigned DEFAULT NULL,
spDay tinyint(3) unsigned DEFAULT NULL,
spMonth smallint(6) DEFAULT NULL,
spYear smallint(5) unsigned DEFAULT NULL,
allClosed tinyint(1) NOT NULL,
roomsClosed text,
closingName varchar(128) NOT NULL,
username varchar(128) NOT NULL,
changed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY  (closingID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# create table for event age selection
CREATE TABLE bookaroom_eventAges (
ea_id int(11) NOT NULL AUTO_INCREMENT,
ea_eventID int(11) NOT NULL,
ea_ageID int(11) NOT NULL,
PRIMARY KEY  (ea_id),
KEY ea_eventID (ea_eventID,ea_ageID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# create table for event category selection
CREATE TABLE bookaroom_eventCats (
ec_id int(11) NOT NULL AUTO_INCREMENT,
ec_eventID int(11) NOT NULL,
ec_catID int(11) NOT NULL,
PRIMARY KEY  (ec_id),
KEY ec_eventID (ec_eventID,ec_catID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# create table for event Age groups
CREATE TABLE bookaroom_event_ages (
age_id int(11) unsigned NOT NULL AUTO_INCREMENT,
age_desc varchar(254) CHARACTER SET latin1 NOT NULL,
age_order int(10) unsigned NOT NULL,
age_active tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (age_id),
UNIQUE KEY age_id (age_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# create table for event Category groups
CREATE TABLE bookaroom_event_categories (
categories_id int(11) unsigned NOT NULL AUTO_INCREMENT,
categories_desc varchar(254) NOT NULL,
categories_order int(10) unsigned NOT NULL,
categories_active tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY  (categories_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# Create table for registrations
CREATE TABLE bookaroom_registrations (
reg_id int(10) unsigned NOT NULL AUTO_INCREMENT,
reg_fullName varchar(255) COLLATE utf8_unicode_ci NOT NULL,
reg_phone varchar(34) COLLATE utf8_unicode_ci DEFAULT NULL,
reg_email varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
reg_notes text COLLATE utf8_unicode_ci,
reg_eventID int(11) NOT NULL,
reg_dateReg timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (reg_id),
FULLTEXT KEY reg_fullName (reg_fullName)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# Create table for reservations
CREATE TABLE bookaroom_reservations (
res_id int(10) unsigned NOT NULL AUTO_INCREMENT,
res_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ev_desc text NOT NULL,
ev_maxReg int(10) unsigned DEFAULT NULL,
ev_amenity text,
ev_waitingList int(11) DEFAULT NULL,
ev_presenter varchar(255) DEFAULT NULL,
ev_privateNotes text,
ev_publicEmail varchar(128) DEFAULT NULL,
ev_publicName varchar(255) DEFAULT NULL,
ev_publicPhone varchar(15) DEFAULT NULL,
ev_noPublish tinyint(1) NOT NULL DEFAULT '0',
ev_regStartDate timestamp NULL DEFAULT NULL,
ev_regType enum('yes','no','staff') DEFAULT NULL,
ev_submitter varchar(255) NOT NULL,
ev_title varchar(255) DEFAULT NULL,
ev_website varchar(255) DEFAULT NULL,
ev_webText varchar(255) DEFAULT NULL,
me_amenity text NOT NULL,
me_contactAddress1 varchar(128) NOT NULL,
me_contactAddress2 varchar(128) DEFAULT NULL,
me_contactCity varchar(64) NOT NULL,
me_contactEmail varchar(255) NOT NULL,
me_contactName varchar(128) NOT NULL,
me_contactPhonePrimary varchar(15) NOT NULL,
me_contactPhoneSecondary varchar(15) DEFAULT NULL,
me_contactState varchar(255) NOT NULL,
me_contactWebsite varchar(255) DEFAULT NULL,
me_contactZip varchar(10) NOT NULL,
me_desc text NOT NULL,
me_eventName varchar(255) NOT NULL,
me_nonProfit tinyint(1) NOT NULL DEFAULT '0',
me_numAttend smallint(5) unsigned NOT NULL,
me_notes text NOT NULL,
me_status set('pending','pendPayment','approved','denied','archived') NOT NULL DEFAULT 'pending',
me_salt varchar(40) NOT NULL,
me_creditCardPaid tinyint(1) DEFAULT NULL,
me_libcardNum varchar(64) DEFAULT NULL,
me_social tinyint(1) DEFAULT NULL,
UNIQUE KEY res_id (res_id),
FULLTEXT KEY ev_presenter (ev_presenter,ev_privateNotes,ev_publicEmail,ev_publicName,ev_submitter,ev_title,ev_website,ev_webText,ev_desc),
FULLTEXT KEY me_contactEmail (me_contactEmail,me_contactName,me_desc,me_eventName,me_notes)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# Create table for deleted reservations
CREATE TABLE bookaroom_reservations_deleted (
del_id int(11) NOT NULL AUTO_INCREMENT,
del_changed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
res_id int(10) unsigned NOT NULL,
res_created timestamp NULL DEFAULT NULL,
ev_desc text NOT NULL,
ev_maxReg int(10) unsigned DEFAULT NULL,
ev_amenity text,
ev_waitingList int(11) DEFAULT NULL,
ev_presenter varchar(255) DEFAULT NULL,
ev_privateNotes text,
ev_publicEmail varchar(128) DEFAULT NULL,
ev_publicName varchar(255) DEFAULT NULL,
ev_publicPhone varchar(15) DEFAULT NULL,
ev_noPublish tinyint(1) NOT NULL DEFAULT '0',
ev_regStartDate timestamp NULL DEFAULT NULL,
ev_regType enum('yes','no','staff') DEFAULT NULL,
ev_submitter varchar(255) NOT NULL,
ev_title varchar(255) DEFAULT NULL,
ev_website varchar(255) DEFAULT NULL,
ev_webText varchar(255) DEFAULT NULL,
me_amenity text NOT NULL,
me_contactAddress1 varchar(128) NOT NULL,
me_contactAddress2 varchar(128) DEFAULT NULL,
me_contactCity varchar(64) NOT NULL,
me_contactEmail varchar(255) NOT NULL,
me_contactName varchar(128) NOT NULL,
me_contactPhonePrimary varchar(15) NOT NULL,
me_contactPhoneSecondary varchar(15) DEFAULT NULL,
me_contactState varchar(255) NOT NULL,
me_contactWebsite varchar(255) DEFAULT NULL,
me_contactZip varchar(10) NOT NULL,
me_desc text NOT NULL,
me_eventName varchar(255) NOT NULL,
me_nonProfit tinyint(1) NOT NULL DEFAULT '0',
me_numAttend smallint(5) unsigned NOT NULL,
me_notes text NOT NULL,
me_status set('pending','pendPayment','approved','denied','archived') NOT NULL DEFAULT 'pending',
PRIMARY KEY  (del_id),
FULLTEXT KEY ev_presenter (ev_presenter,ev_privateNotes,ev_publicEmail,ev_publicName,ev_submitter,ev_title,ev_website,ev_webText,ev_desc)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# Create table for meeting room containers. This is the top 
# level for rooms, and is used in case you have rooms that
# can be made of two or more other rooms.
CREATE TABLE bookaroom_roomConts (
roomCont_ID int(11) unsigned NOT NULL AUTO_INCREMENT,
roomCont_desc varchar(64) NOT NULL,
roomCont_branch int(11) NOT NULL,
roomCont_occ int(11) NOT NULL,
roomCont_isPublic tinyint(1) NOT NULL DEFAULT '1',
roomCont_hideDaily tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY  (roomCont_ID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# create tale for room container members (which rooms are
# in each room container
CREATE TABLE bookaroom_roomConts_members (
rcm_roomContID int(10) unsigned NOT NULL AUTO_INCREMENT,
rcm_roomID int(10) unsigned NOT NULL,
KEY rcm_roomContID (rcm_roomContID,rcm_roomID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# Create table for meeting rooms
CREATE TABLE bookaroom_rooms (
roomID int(11) unsigned NOT NULL AUTO_INCREMENT,
room_desc varchar(64) NOT NULL,
room_amenityArr text COMMENT 'This is a CSV array of amenities',
room_branchID int(11) unsigned NOT NULL,
PRIMARY KEY  (roomID),
KEY roomID (roomID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# Create table for times for each reservation
CREATE TABLE bookaroom_times (
ti_id int(10) unsigned NOT NULL AUTO_INCREMENT,
ti_type enum('event','meeting') NOT NULL,
ti_extID int(10) unsigned NOT NULL,
ti_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ti_startTime timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
ti_endTime timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
ti_roomID int(10) unsigned DEFAULT NULL,
ti_extraInfo text NOT NULL,
ti_noLocation_branch int(11) DEFAULT NULL,
ti_attendance int(11) unsigned DEFAULT NULL,
ti_attNotes text NOT NULL,
PRIMARY KEY  (ti_id),
KEY ti_type (ti_type),
KEY ti_id (ti_id,ti_type,ti_extID),
KEY ti_extID (ti_extID),
KEY ti_startTime (ti_startTime)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
# Create table for deleted times for each reservation
CREATE TABLE bookaroom_times_deleted (
del_id int(10) unsigned NOT NULL AUTO_INCREMENT,
del_changed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ti_id int(10) unsigned NOT NULL,
ti_type enum('event','meeting') NOT NULL,
ti_extID int(10) unsigned NOT NULL,
ti_created timestamp NULL DEFAULT NULL,
ti_startTime timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
ti_endTime timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
ti_roomID int(10) unsigned DEFAULT NULL,
ti_extraInfo text NOT NULL,
ti_noLocation_branch int(11) DEFAULT NULL,
ti_attendance int(11) DEFAULT NULL,
ti_attNotes int(11) DEFAULT NULL,
PRIMARY KEY  (del_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

使い方

色々と御自身で操作してみて下さい。

URL

Book a Room – WordPress.org

本ページはアフィリエイトプログラムによる収益を得ています