|
|
|
|
|
|
|
|
|
Yh4PEEQ5ynciKTl2
Yh4PEEQ5ynciKTl2
|
|
Prepare labelled AF live presentation sample records
Prepare labelled AF live presentation sample records
|
|
<?php
// This script is executed only through the supplied tryafoncord.com demo session.
function presentationEnsure($class, $criteria, $data) {
$filter = [];
foreach ($criteria as $field => $value) { if ($filter) $filter[] = 'AND'; $filter[] = [$field, '=', $value]; }
$rows = $class::getAll(['filter' => $filter, 'limit' => 1]);
if ($rows) return reset($rows)[$class::fieldsGetPrimaryKey()];
return $class::save(array_merge($data, $criteria));
}
$ids = [];
$disabledBefore = \Components\Marketing\Automation\Progress::getDisabledIds();
\Components\Marketing\Automation\Progress::setDisabledIds(array_column(\Components\Marketing\Automation::getAll(), 'automation_id'));
try {
$ids['age'] = 1;
$ids['level'] = presentationEnsure('\Components\AF\Courses\Configuration\Levels', ['level_name' => 'A1 Beginner - Presentation Demo'], ['level_visible_public' => 1, 'level_requires_placement' => 0, 'age_group_id' => 1, 'level_short_description' => '<p>Start speaking French with confidence.</p>', 'level_objectives' => '<p>Introduce yourself, talk about your interests and practise everyday conversations.</p>']);
$ids['type'] = 2;
$ids['pace'] = 1;
$ids['session'] = presentationEnsure('\Components\AF\Courses\Configuration\Sessions', ['session_name' => 'October 2026 - Presentation Demo'], ['session_year' => '2026', 'session_start_date' => '2026-10-05', 'session_end_date' => '2026-12-18', 'session_visible_public' => 1, 'age_group_id' => 1, 'session_short_description' => 'Prepared for the live AF feature presentation on 8 October 2026.']);
$ids['target_session'] = presentationEnsure('\Components\AF\Courses\Configuration\Sessions', ['session_name' => 'January 2027 - Presentation Demo'], ['session_year' => '2027', 'session_start_date' => '2027-01-11', 'session_end_date' => '2027-03-19', 'session_visible_public' => 0, 'age_group_id' => 1]);
foreach (['Camille', 'Alex', 'Sophie', 'Jordan', 'Morgan'] as $name) {
$ids[$name] = presentationEnsure('\Components\Customers\Contacts', ['contact_email' => 'af-presentation-' . strtolower($name) . '@example.invalid'], ['contact_first_name' => $name, 'contact_last_name' => 'Presentation Demo', 'contact_type' => 'Individual', 'contact_email_marketing_status' => 'unsubscribed', 'contact_dob' => '1995-06-15', 'country_id' => 'AUS']);
}
\Components\Customers\Groups::addContactToGroup($ids['Camille'], ['/teachers/']);
foreach (['FRI', 'WED'] as $i => $suffix) {
$ids['course' . $i] = presentationEnsure('\Components\AF\Courses', ['course_code' => 'PRESENTATION-20261008-A1-' . $suffix], ['course_type' => 'collective', 'session_id' => $ids['session'], 'age_group_id' => 1, 'type_id' => 2, 'pace_id' => 1, 'course_levels' => [$ids['level']], 'product_title' => 'French for Beginners - Presentation Demo', 'product_price_base' => 320, 'product_inventory_level' => 10, 'product_is_offline' => 0, 'course_include_in_enrollment_statistics' => 1, 'course_membership_option' => 'shown', 'course_comment' => 'Prepared for the AF live presentation on 8 October 2026. All linked students are synthetic.']);
$ids['schedule' . $i] = presentationEnsure('\Components\AF\Courses\Schedules', ['course_id' => $ids['course' . $i]], ['schedule_start_date' => '2026-10-05', 'schedule_end_date' => '2026-12-16', 'schedule_start_time' => $i ? '18:00:00' : '10:00:00', 'schedule_end_time' => $i ? '20:00:00' : '12:00:00', 'schedule_location_type' => 'internal', 'location_id' => $i ? 7 : 3, 'teacher_id' => $ids['Camille'], 'schedule_day' => [$i ? 3 : 5]]);
presentationEnsure('\Components\AF\Courses\AdminTeachers', ['course_id' => $ids['course' . $i], 'admin_teacher_id' => $ids['Camille']], []);
$ids['product' . $i] = \Components\AF\Courses::getColumn($ids['course' . $i], 'product_id');
}
// The same contact's ended trial is retained for the conversion statistics.
foreach ([['Alex', 'trial', '2026-10-05 00:00:00'], ['Alex', 'standard', '2026-10-07 00:00:00'], ['Sophie', 'standard', '2026-10-07 00:00:00'], ['Jordan', 'trial', '2026-10-08 00:00:00'], ['Morgan', 'makeup', '2026-10-08 00:00:00']] as $row) {
$ids['enrollment_' . $row[0] . '_' . $row[1]] = presentationEnsure('\Components\AF\Enrollments', ['course_id' => $ids['course0'], 'contact_id' => $ids[$row[0]], 'enrollment_type' => $row[1]], ['enrollment_created_datetime' => $row[2], 'enrollment_comment' => 'Presentation Demo - ' . $row[1] . ' attendance']);
}
presentationEnsure('\Components\AF\Enrollments', ['course_id' => $ids['course1'], 'contact_id' => $ids['Sophie'], 'enrollment_type' => 'standard'], ['enrollment_created_datetime' => '2026-10-06 00:00:00']);
$ids['private'] = presentationEnsure('\Components\AF\Courses', ['course_code' => 'PRESENTATION-20261008-PRIVATE-ALEX'], ['course_type' => 'private', 'age_group_id' => 1, 'course_levels' => [$ids['level']], 'course_comment' => 'Presentation Demo - 6 classroom hours and 4 online hours share a 10-hour pool.']);
presentationEnsure('\Components\AF\Enrollments', ['course_id' => $ids['private'], 'contact_id' => $ids['Alex'], 'enrollment_type' => 'standard'], []);
foreach (['internal' => 6, 'remote' => 4] as $format => $hours) {
presentationEnsure('\Components\AF\Courses\Hours', ['course_id' => $ids['private'], 'hour_location_type' => $format, 'hour_type' => 'add'], ['hour_count' => $hours, 'hour_adjustment_reason' => 'Presentation Demo - sample prepaid hour balance', 'administrator_id' => \Components\Customers\Contacts::currentContactId(), 'hour_datetime' => '2026-10-05 00:00:00']);
}
foreach ([['2026-10-06', 'remote'], ['2026-10-08', 'internal'], ['2026-10-15', 'remote']] as $row) {
presentationEnsure('\Components\AF\Courses\Units', ['course_id' => $ids['private'], 'unit_date' => $row[0]], ['unit_start_time' => '14:00:00', 'unit_end_time' => '15:00:00', 'unit_location_type' => $row[1], 'location_id' => $row[1] === 'internal' ? 3 : null, 'teacher_id' => $ids['Camille'], 'unit_comment' => 'Presentation Demo - mixed delivery lesson']);
}
foreach (['required' => ['Workbook - Presentation Demo', 35], 'recommended' => ['Conversation Cards - Presentation Demo', 18]] as $type => $material) {
$ids['material_' . $type] = presentationEnsure('\Components\Commerce\Products', ['product_code' => 'PRESENTATION-MATERIAL-' . strtoupper($type)], ['product_title' => $material[0], 'product_price_base' => $material[1], 'product_brand_id' => 1, 'product_is_offline' => 0, 'product_is_shipping_required' => 0]);
presentationEnsure('\Components\AF\Courses\Materials', ['material_id' => $ids['material_' . $type], 'course_id' => $ids['course0']], ['material_type' => $type]);
}
$ids['work_type'] = presentationEnsure('\Components\AF\Teachers\Hours\Types', ['hour_type_title' => 'Administration - Presentation Demo'], ['hour_type_usage' => 'admin']);
presentationEnsure('\Components\AF\Teachers\Hours', ['hour_comment' => 'Presentation Demo - preparation and administration'], ['hour_date' => '2026-10-06', 'hour_start_time' => '09:00:00', 'hour_end_time' => '11:00:00', 'hour_type_id' => $ids['work_type'], 'teacher_id' => $ids['Camille'], 'hour_billing_status' => 'unpaid']);
$ids['exam_product'] = presentationEnsure('\Components\Commerce\Products', ['product_code' => 'PRESENTATION-TCF-2026'], ['product_title' => 'TCF - Presentation Demo', 'product_price_base' => 280, 'product_brand_id' => 1, 'product_is_offline' => 0, 'product_is_shipping_required' => 0, 'product_is_orderable_for_someone_else' => 1]);
$ids['exam_location'] = presentationEnsure('\Components\AF\Exams\Locations', ['location_name' => 'St Kilda Exam Centre - Presentation Demo'], []);
foreach (['2026-11-12', '2026-11-19'] as $i => $date) {
$ids['exam' . $i] = presentationEnsure('\Components\AF\Exams', ['exam_title' => 'TCF ' . ($i ? '19' : '12') . ' November - Presentation Demo'], ['exam_type_id' => -5, 'exam_start_date' => $date, 'exam_end_date' => $date, 'exam_registration_start_datetime' => '2026-10-01 00:00:00', 'exam_registration_end_datetime' => '2026-11-10 23:00:00', 'exam_capacity' => 20, 'exam_year' => '2026', 'product_id' => $ids['exam_product'], 'exam_requires_dob' => 1, 'exam_requires_gender' => 1, 'exam_requires_phone' => 1, 'exam_description' => '<p>Sample exam for the AF feature presentation. Two sessions share one product.</p>']);
presentationEnsure('\Components\AF\Exams\Dates', ['exam_id' => $ids['exam' . $i]], ['date_exam_date' => $date, 'date_start_time' => '09:00:00', 'date_end_time' => '12:00:00', 'date_exam_format' => 'written and oral', 'location_id' => $ids['exam_location'], 'teacher_id' => $ids['Camille']]);
}
foreach (['Alex', 'Sophie'] as $name) presentationEnsure('\Components\AF\Exams\Registrations', ['exam_id' => $ids['exam0'], 'contact_id' => $ids[$name]], ['exam_registration_created_datetime' => '2026-10-08 00:00:00']);
$ids['fee_product'] = presentationEnsure('\Components\Commerce\Products', ['product_code' => 'PRESENTATION-EXAM-FEE'], ['product_title' => 'Exam Administration Fee - Presentation Demo', 'product_price_base' => 25, 'product_brand_id' => 1, 'product_is_offline' => 0, 'product_is_shipping_required' => 0]);
$ids['fee'] = presentationEnsure('\Components\AF\Exams\Fees', ['product_id' => $ids['fee_product']], ['exam_fee_is_enabled' => 1, 'exam_fee_applies_to' => 'exams', 'exam_fee_entities' => [$ids['exam0'], $ids['exam1']]]);
\Components\AF\Exams::updateInventory($ids['exam0']);
$ids['books'] = [];
$ids['book_items'] = [];
foreach ([['Le Petit Prince - Presentation Demo', '9782070612758'], ['Grammaire progressive - Presentation Demo', '9782090381031'], ['Le Petit Prince duplicate - Presentation Demo', '9782070612758']] as $i => $book) {
$ids['books'][$i] = presentationEnsure('\Components\AF\Libraries\Documents', ['document_title' => $book[0]], ['document_type_id' => 1, 'document_isbn' => $book[1], 'document_year' => '2023', 'document_author' => $i === 1 ? 'Maia Gregoire' : 'Antoine de Saint-Exupery', 'document_synopsis' => 'Prepared for title / ISBN lookup, bulk renewal, merging and library reporting.']);
foreach ($i === 0 ? [1, 2] : [1] as $copy) {
$itemId = presentationEnsure('\Components\AF\Libraries\Documents\Items', ['document_item_code' => 'PRESENTATION-BOOK-' . ($i + 1) . '-' . $copy], ['document_id' => $ids['books'][$i], 'library_id' => 1, 'document_item_status' => $copy === 1 && $i < 2 ? 'borrowed' : 'available']);
$ids['book_items'][] = $itemId;
if ($copy === 1 && $i < 2) {
$borrower = $i ? $ids['Sophie'] : $ids['Alex'];
$borrowId = presentationEnsure('\Components\AF\Libraries\Documents\Borrowings', ['contact_id' => $borrower, 'borrowing_datetime' => '2026-10-06 00:00:00'], []);
presentationEnsure('\Components\AF\Libraries\Documents\Borrowings\Items', ['document_item_id' => $itemId, 'borrowing_id' => $borrowId], ['borrowing_item_expected_return_datetime' => '2026-10-27 00:00:00']);
}
}
}
echo json_encode($ids, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
} finally {
\Components\Marketing\Automation\Progress::setDisabledIds($disabledBefore);
}
<?php
// This script is executed only through the supplied tryafoncord.com demo session.
function presentationEnsure($class, $criteria, $data) {
$filter = [];
foreach ($criteria as $field => $value) { if ($filter) $filter[] = 'AND'; $filter[] = [$field, '=', $value]; }
$rows = $class::getAll(['filter' => $filter, 'limit' => 1]);
if ($rows) return reset($rows)[$class::fieldsGetPrimaryKey()];
return $class::save(array_merge($data, $criteria));
}
$ids = [];
$disabledBefore = \Components\Marketing\Automation\Progress::getDisabledIds();
\Components\Marketing\Automation\Progress::setDisabledIds(array_column(\Components\Marketing\Automation::getAll(), 'automation_id'));
try {
$ids['age'] = 1;
$ids['level'] = presentationEnsure('\Components\AF\Courses\Configuration\Levels', ['level_name' => 'A1 Beginner - Presentation Demo'], ['level_visible_public' => 1, 'level_requires_placement' => 0, 'age_group_id' => 1, 'level_short_description' => '<p>Start speaking French with confidence.</p>', 'level_objectives' => '<p>Introduce yourself, talk about your interests and practise everyday conversations.</p>']);
$ids['type'] = 2;
$ids['pace'] = 1;
$ids['session'] = presentationEnsure('\Components\AF\Courses\Configuration\Sessions', ['session_name' => 'October 2026 - Presentation Demo'], ['session_year' => '2026', 'session_start_date' => '2026-10-05', 'session_end_date' => '2026-12-18', 'session_visible_public' => 1, 'age_group_id' => 1, 'session_short_description' => 'Prepared for the live AF feature presentation on 8 October 2026.']);
$ids['target_session'] = presentationEnsure('\Components\AF\Courses\Configuration\Sessions', ['session_name' => 'January 2027 - Presentation Demo'], ['session_year' => '2027', 'session_start_date' => '2027-01-11', 'session_end_date' => '2027-03-19', 'session_visible_public' => 0, 'age_group_id' => 1]);
foreach (['Camille', 'Alex', 'Sophie', 'Jordan', 'Morgan'] as $name) {
$ids[$name] = presentationEnsure('\Components\Customers\Contacts', ['contact_email' => 'af-presentation-' . strtolower($name) . '@example.invalid'], ['contact_first_name' => $name, 'contact_last_name' => 'Presentation Demo', 'contact_type' => 'Individual', 'contact_email_marketing_status' => 'unsubscribed', 'contact_dob' => '1995-06-15', 'country_id' => 'AUS']);
}
\Components\Customers\Groups::addContactToGroup($ids['Camille'], ['/teachers/']);
foreach (['FRI', 'WED'] as $i => $suffix) {
$ids['course' . $i] = presentationEnsure('\Components\AF\Courses', ['course_code' => 'PRESENTATION-20261008-A1-' . $suffix], ['course_type' => 'collective', 'session_id' => $ids['session'], 'age_group_id' => 1, 'type_id' => 2, 'pace_id' => 1, 'course_levels' => [$ids['level']], 'product_title' => 'French for Beginners - Presentation Demo', 'product_price_base' => 320, 'product_inventory_level' => 10, 'product_is_offline' => 0, 'course_include_in_enrollment_statistics' => 1, 'course_membership_option' => 'shown', 'course_comment' => 'Prepared for the AF live presentation on 8 October 2026. All linked students are synthetic.']);
$ids['schedule' . $i] = presentationEnsure('\Components\AF\Courses\Schedules', ['course_id' => $ids['course' . $i]], ['schedule_start_date' => '2026-10-05', 'schedule_end_date' => '2026-12-16', 'schedule_start_time' => $i ? '18:00:00' : '10:00:00', 'schedule_end_time' => $i ? '20:00:00' : '12:00:00', 'schedule_location_type' => 'internal', 'location_id' => $i ? 7 : 3, 'teacher_id' => $ids['Camille'], 'schedule_day' => [$i ? 3 : 5]]);
presentationEnsure('\Components\AF\Courses\AdminTeachers', ['course_id' => $ids['course' . $i], 'admin_teacher_id' => $ids['Camille']], []);
$ids['product' . $i] = \Components\AF\Courses::getColumn($ids['course' . $i], 'product_id');
}
// The same contact's ended trial is retained for the conversion statistics.
foreach ([['Alex', 'trial', '2026-10-05 00:00:00'], ['Alex', 'standard', '2026-10-07 00:00:00'], ['Sophie', 'standard', '2026-10-07 00:00:00'], ['Jordan', 'trial', '2026-10-08 00:00:00'], ['Morgan', 'makeup', '2026-10-08 00:00:00']] as $row) {
$ids['enrollment_' . $row[0] . '_' . $row[1]] = presentationEnsure('\Components\AF\Enrollments', ['course_id' => $ids['course0'], 'contact_id' => $ids[$row[0]], 'enrollment_type' => $row[1]], ['enrollment_created_datetime' => $row[2], 'enrollment_comment' => 'Presentation Demo - ' . $row[1] . ' attendance']);
}
presentationEnsure('\Components\AF\Enrollments', ['course_id' => $ids['course1'], 'contact_id' => $ids['Sophie'], 'enrollment_type' => 'standard'], ['enrollment_created_datetime' => '2026-10-06 00:00:00']);
$ids['private'] = presentationEnsure('\Components\AF\Courses', ['course_code' => 'PRESENTATION-20261008-PRIVATE-ALEX'], ['course_type' => 'private', 'age_group_id' => 1, 'course_levels' => [$ids['level']], 'course_comment' => 'Presentation Demo - 6 classroom hours and 4 online hours share a 10-hour pool.']);
presentationEnsure('\Components\AF\Enrollments', ['course_id' => $ids['private'], 'contact_id' => $ids['Alex'], 'enrollment_type' => 'standard'], []);
foreach (['internal' => 6, 'remote' => 4] as $format => $hours) {
presentationEnsure('\Components\AF\Courses\Hours', ['course_id' => $ids['private'], 'hour_location_type' => $format, 'hour_type' => 'add'], ['hour_count' => $hours, 'hour_adjustment_reason' => 'Presentation Demo - sample prepaid hour balance', 'administrator_id' => \Components\Customers\Contacts::currentContactId(), 'hour_datetime' => '2026-10-05 00:00:00']);
}
foreach ([['2026-10-06', 'remote'], ['2026-10-08', 'internal'], ['2026-10-15', 'remote']] as $row) {
presentationEnsure('\Components\AF\Courses\Units', ['course_id' => $ids['private'], 'unit_date' => $row[0]], ['unit_start_time' => '14:00:00', 'unit_end_time' => '15:00:00', 'unit_location_type' => $row[1], 'location_id' => $row[1] === 'internal' ? 3 : null, 'teacher_id' => $ids['Camille'], 'unit_comment' => 'Presentation Demo - mixed delivery lesson']);
}
foreach (['required' => ['Workbook - Presentation Demo', 35], 'recommended' => ['Conversation Cards - Presentation Demo', 18]] as $type => $material) {
$ids['material_' . $type] = presentationEnsure('\Components\Commerce\Products', ['product_code' => 'PRESENTATION-MATERIAL-' . strtoupper($type)], ['product_title' => $material[0], 'product_price_base' => $material[1], 'product_brand_id' => 1, 'product_is_offline' => 0, 'product_is_shipping_required' => 0]);
presentationEnsure('\Components\AF\Courses\Materials', ['material_id' => $ids['material_' . $type], 'course_id' => $ids['course0']], ['material_type' => $type]);
}
$ids['work_type'] = presentationEnsure('\Components\AF\Teachers\Hours\Types', ['hour_type_title' => 'Administration - Presentation Demo'], ['hour_type_usage' => 'admin']);
presentationEnsure('\Components\AF\Teachers\Hours', ['hour_comment' => 'Presentation Demo - preparation and administration'], ['hour_date' => '2026-10-06', 'hour_start_time' => '09:00:00', 'hour_end_time' => '11:00:00', 'hour_type_id' => $ids['work_type'], 'teacher_id' => $ids['Camille'], 'hour_billing_status' => 'unpaid']);
$ids['exam_product'] = presentationEnsure('\Components\Commerce\Products', ['product_code' => 'PRESENTATION-TCF-2026'], ['product_title' => 'TCF - Presentation Demo', 'product_price_base' => 280, 'product_brand_id' => 1, 'product_is_offline' => 0, 'product_is_shipping_required' => 0, 'product_is_orderable_for_someone_else' => 1]);
$ids['exam_location'] = presentationEnsure('\Components\AF\Exams\Locations', ['location_name' => 'St Kilda Exam Centre - Presentation Demo'], []);
foreach (['2026-11-12', '2026-11-19'] as $i => $date) {
$ids['exam' . $i] = presentationEnsure('\Components\AF\Exams', ['exam_title' => 'TCF ' . ($i ? '19' : '12') . ' November - Presentation Demo'], ['exam_type_id' => -5, 'exam_start_date' => $date, 'exam_end_date' => $date, 'exam_registration_start_datetime' => '2026-10-01 00:00:00', 'exam_registration_end_datetime' => '2026-11-10 23:00:00', 'exam_capacity' => 20, 'exam_year' => '2026', 'product_id' => $ids['exam_product'], 'exam_requires_dob' => 1, 'exam_requires_gender' => 1, 'exam_requires_phone' => 1, 'exam_description' => '<p>Sample exam for the AF feature presentation. Two sessions share one product.</p>']);
presentationEnsure('\Components\AF\Exams\Dates', ['exam_id' => $ids['exam' . $i]], ['date_exam_date' => $date, 'date_start_time' => '09:00:00', 'date_end_time' => '12:00:00', 'date_exam_format' => 'written and oral', 'location_id' => $ids['exam_location'], 'teacher_id' => $ids['Camille']]);
}
foreach (['Alex', 'Sophie'] as $name) presentationEnsure('\Components\AF\Exams\Registrations', ['exam_id' => $ids['exam0'], 'contact_id' => $ids[$name]], ['exam_registration_created_datetime' => '2026-10-08 00:00:00']);
$ids['fee_product'] = presentationEnsure('\Components\Commerce\Products', ['product_code' => 'PRESENTATION-EXAM-FEE'], ['product_title' => 'Exam Administration Fee - Presentation Demo', 'product_price_base' => 25, 'product_brand_id' => 1, 'product_is_offline' => 0, 'product_is_shipping_required' => 0]);
$ids['fee'] = presentationEnsure('\Components\AF\Exams\Fees', ['product_id' => $ids['fee_product']], ['exam_fee_is_enabled' => 1, 'exam_fee_applies_to' => 'exams', 'exam_fee_entities' => [$ids['exam0'], $ids['exam1']]]);
\Components\AF\Exams::updateInventory($ids['exam0']);
$ids['books'] = [];
$ids['book_items'] = [];
foreach ([['Le Petit Prince - Presentation Demo', '9782070612758'], ['Grammaire progressive - Presentation Demo', '9782090381031'], ['Le Petit Prince duplicate - Presentation Demo', '9782070612758']] as $i => $book) {
$ids['books'][$i] = presentationEnsure('\Components\AF\Libraries\Documents', ['document_title' => $book[0]], ['document_type_id' => 1, 'document_isbn' => $book[1], 'document_year' => '2023', 'document_author' => $i === 1 ? 'Maia Gregoire' : 'Antoine de Saint-Exupery', 'document_synopsis' => 'Prepared for title / ISBN lookup, bulk renewal, merging and library reporting.']);
foreach ($i === 0 ? [1, 2] : [1] as $copy) {
$itemId = presentationEnsure('\Components\AF\Libraries\Documents\Items', ['document_item_code' => 'PRESENTATION-BOOK-' . ($i + 1) . '-' . $copy], ['document_id' => $ids['books'][$i], 'library_id' => 1, 'document_item_status' => $copy === 1 && $i < 2 ? 'borrowed' : 'available']);
$ids['book_items'][] = $itemId;
if ($copy === 1 && $i < 2) {
$borrower = $i ? $ids['Sophie'] : $ids['Alex'];
$borrowId = presentationEnsure('\Components\AF\Libraries\Documents\Borrowings', ['contact_id' => $borrower, 'borrowing_datetime' => '2026-10-06 00:00:00'], []);
presentationEnsure('\Components\AF\Libraries\Documents\Borrowings\Items', ['document_item_id' => $itemId, 'borrowing_id' => $borrowId], ['borrowing_item_expected_return_datetime' => '2026-10-27 00:00:00']);
}
}
}
echo json_encode($ids, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
} finally {
\Components\Marketing\Automation\Progress::setDisabledIds($disabledBefore);
}
|
|
2026-10-08 00:55:02
2026-10-08 00:55:02
|
|
|
|
|
|
This script sets up a batch of sample records in a French-language school's system, ready for a live demonstration. It doesn't delete or change anything existing — it only adds new items, and if an item with the same name already exists, it reuses that one instead of creating a duplicate. Here's what it will add:
**Course levels and terms**
- One beginner course level called "A1 Beginner - Presentation Demo", marked as publicly visible.
- Two course terms: "October 2026 - Presentation Demo" (publicly visible, running 5 Oct to 18 Dec 2026) and "January 2027 - Presentation Demo" (hidden from the public, running 11 Jan to 19 Mar 2027).
**People**
- Five fake student contacts (Camille, Alex, Sophie, Jordan, Morgan), all with the surname "Presentation Demo", all marked as not wanting marketing emails. Camille is also added to the teachers group, so she acts as the teacher.
**Group courses**
- Two beginner group courses called "French for Beginners - Presentation Demo", priced at $320 each with 10 places available. One runs Friday mornings, the other Wednesday evenings, both taught by Camille, starting 5 October 2026.
- Five student enrolments in the Friday course: Alex (a trial that later became a paid enrolment), Sophie and Jordan (trials), and Morgan (a make-up attendance). Sophie is also enrolled in the Wednesday course.
**Private course**
- One private course for Alex with a balance of 10 prepaid hours (6 in the classroom, 4 online), plus three one-hour lessons scheduled in October 2026, some in person and some online, all taught by Camille.
**Course materials**
- Two shop products: a "Workbook" at $35 (required) and "Conversation Cards" at $18 (recommended), both linked to the Friday course.
**Teacher hours**
- One unpaid two-hour admin entry for Camille on 6 October 2026.
**Exams**
- A shop product "TCF - Presentation Demo" at $280, an exam location called "St Kilda Exam Centre", and two TCF exam sessions (12 and 19 November 2026) with 20 places each. Alex and Sophie are registered for the first session, and a $25 exam administration fee is attached to both sessions.
**Library**
- Three library book records (including one duplicate title with the same ISBN, useful for testing merging), with four physical copies. Two copies are marked as borrowed — one by Alex and one by Sophie — due back 27 October 2026.
**One temporary change:** while the script runs, it pauses all automated marketing messages so nothing gets sent out during setup, then restores the previous setting when it finishes.
This script sets up a batch of sample records in a French-language school's system, ready for a live demonstration. It doesn't delete or change anything existing — it only adds new items, and if an item with the same name already exists, it reuses that one instead of creating a duplicate. Here's what it will add:
**Course levels and terms**
- One beginner course level called "A1 Beginner - Presentation Demo", marked as publicly visible.
- Two course terms: "October 2026 - Presentation Demo" (publicly visible, running 5 Oct to 18 Dec 2026) and "January 2027 - Presentation Demo" (hidden from the public, running 11 Jan to 19 Mar 2027).
**People**
- Five fake student contacts (Camille, Alex, Sophie, Jordan, Morgan), all with the surname "Presentation Demo", all marked as not wanting marketing emails. Camille is also added to the teachers group, so she acts as the teacher.
**Group courses**
- Two beginner group courses called "French for Beginners - Presentation Demo", priced at $320 each with 10 places available. One runs Friday mornings, the other Wednesday evenings, both taught by Camille, starting 5 October 2026.
- Five student enrolments in the Friday course: Alex (a trial that later became a paid enrolment), Sophie and Jordan (trials), and Morgan (a make-up attendance). Sophie is also enrolled in the Wednesday course.
**Private course**
- One private course for Alex with a balance of 10 prepaid hours (6 in the classroom, 4 online), plus three one-hour lessons scheduled in October 2026, some in person and some online, all taught by Camille.
**Course materials**
- Two shop products: a "Workbook" at $35 (required) and "Conversation Cards" at $18 (recommended), both linked to the Friday course.
**Teacher hours**
- One unpaid two-hour admin entry for Camille on 6 October 2026.
**Exams**
- A shop product "TCF - Presentation Demo" at $280, an exam location called "St Kilda Exam Centre", and two TCF exam sessions (12 and 19 November 2026) with 20 places each. Alex and Sophie are registered for the first session, and a $25 exam administration fee is attached to both sessions.
**Library**
- Three library book records (including one duplicate title with the same ISBN, useful for testing merging), with four physical copies. Two copies are marked as borrowed — one by Alex and one by Sophie — due back 27 October 2026.
**One temporary change:** while the script runs, it pauses all automated marketing messages so nothing gets sent out during setup, then restores the previous setting when it finishes.
|
|
|
|
|