Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the date format #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Professional Development/manifest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
/*
Gibbon, Flexible & Open School System
Copyright (C) 2010, Ross Parker
Gibbon: the flexible, open school platform
Founded by Ross Parker at ICHK Secondary. Built by Ross Parker, Sandra Kuipers and the Gibbon community (https://gibbonedu.org/about/)
Copyright © 2010, Gibbon Foundation
Gibbon™, Gibbon Education Ltd. (Hong Kong)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -40,6 +42,7 @@
`eventFocus` varchar(60) NOT NULL,
`attendeeRole` varchar(60) NOT NULL,
`attendeeCount` int(10) NOT NULL,
`coverAmount` text NOT NULL,
`eventTitle` varchar(60) NOT NULL,
`eventDescription` text NOT NULL,
`eventLocation` text NOT NULL,
Expand Down
65 changes: 44 additions & 21 deletions Professional Development/moduleFunctions.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php


/*
Gibbon, Flexible & Open School System
Copyright (C) 2010, Ross Parker
Gibbon: the flexible, open school platform
Founded by Ross Parker at ICHK Secondary. Built by Ross Parker, Sandra Kuipers and the Gibbon community (https://gibbonedu.org/about/)
Copyright © 2010, Gibbon Foundation
Gibbon™, Gibbon Education Ltd. (Hong Kong)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -27,7 +27,6 @@
use Gibbon\Domain\System\SettingGateway;
use Gibbon\Domain\Departments\DepartmentGateway;
use Gibbon\Module\ProfessionalDevelopment\Data\SettingFactory;
use Gibbon\Module\ProfessionalDevelopment\Data\Setting;
use Gibbon\Module\ProfessionalDevelopment\Domain\RequestsGateway;
use Gibbon\Module\ProfessionalDevelopment\Domain\RequestLogGateway;
use Gibbon\Module\ProfessionalDevelopment\Domain\RequestCostGateway;
Expand Down Expand Up @@ -210,42 +209,50 @@ function toggleSection(&$row, $section, $icon) {
toggleSection($row, 'basicInfo', $on);

$row = $form->addRow()->addClass('basicInfo');
$row->addLabel('eventType', Format::bold(__('Event Type')));
$row->addLabel('eventTypeLabel', Format::bold(__('Event Type')));
$row->addTextfield('eventType')
->readonly();

$row = $form->addRow()->addClass('basicInfo');
$row->addLabel('eventFocus', Format::bold(__('Area of Focus')));
$row->addLabel('eventFocusLabel', Format::bold(__('Area of Focus')));
$row->addTextfield('eventFocus')
->readonly();

$row = $form->addRow()->addClass('basicInfo');
$row->addLabel('attendeeRole', Format::bold(__('Participant(s) Role')));
$row->addLabel('attendeeRoleLabel', Format::bold(__('Participant(s) Role')));
$row->addTextfield('attendeeRole')
->readonly();

$row = $form->addRow()->addClass('basicInfo');
$row->addLabel('attendeeCount', Format::bold(__('No. of Particpants')));
$row->addLabel('attendeeCountLabel', Format::bold(__('No. of Particpants')));
$row->addTextfield('attendeeCount')
->readonly();

$coverAmount = unserialize($pdRequest['coverAmount']);
$row = $form->addRow()->addClass('basicInfo');
$row->addLabel('eventTitle', Format::bold(__('Event Name')));
$row->addLabel('coverAmountLabel', Format::bold(__('Cover Amount')));
$row->addCheckbox('coverAmount')
->fromArray($coverAmount)
->readonly();


$row = $form->addRow()->addClass('basicInfo');
$row->addLabel('eventTitleLabel', Format::bold(__('Event Name')));
$row->addTextfield('eventTitle')
->readonly();

$row = $form->addRow()->addClass('basicInfo');
$row->addLabel('eventLocation', Format::bold(__('Location')));
$row->addLabel('eventLocationLabel', Format::bold(__('Location')));
$row->addTextfield('eventLocation')
->readonly();

$row = $form->addRow()->addClass('basicInfo');
$col = $row->addColumn();
$col->addLabel('eventDescription', Format::bold(__('Event Description')));
$col->addLabel('eventDescriptionLabel', Format::bold(__('Event Description')));
$col->addContent($pdRequest['eventDescription']);

$row = $form->addRow()->addClass('basicInfo');
$row->addLabel('status', Format::bold(__('Status')));
$row->addLabel('statusLabel', Format::bold(__('Status')));
$row->addTextfield('status')
->readOnly();

Expand All @@ -255,27 +262,27 @@ function toggleSection(&$row, $section, $icon) {

$row = $form->addRow()->addClass('furtherInfo');
$col = $row->addColumn();
$col->addLabel('personalRational', Format::bold(__('PERSONAL RATIONAL')));
$col->addLabel('personalRationalLabel', Format::bold(__('PERSONAL RATIONAL')));
$col->addContent($pdRequest['personalRational']);

$row = $form->addRow()->addClass('furtherInfo');
$col = $row->addColumn();
$col->addLabel('departmentImpact', Format::bold(__('DEPARTMENTAL AND SCHOOL IMPACT')));
$col->addLabel('departmentImpactLabel', Format::bold(__('DEPARTMENTAL AND SCHOOL IMPACT')));
$col->addContent($pdRequest['departmentImpact']);

$row = $form->addRow()->addClass('furtherInfo');
$col = $row->addColumn();
$col->addLabel('schoolSharing', Format::bold(__('SCHOOL SHARING')));
$col->addLabel('schoolSharingLabel', Format::bold(__('SCHOOL SHARING')));
$col->addContent($pdRequest['schoolSharing']);

$row = $form->addRow()->addClass('furtherInfo');
$row->addLabel('supportingEvidence', __m('Supporting Evidence (If applicable)'))->description(__m('Please upload any supporting evidence that you think might be useful in assessing your application'));
$row->addLabel('supportingEvidenceLabel', __m('Supporting Evidence (If applicable)'))->description(__m('Please upload any supporting evidence that you think might be useful in assessing your application'));
$row->addFileUpload('supportingEvidence')
->setAttachment('supportingEvidence', $gibbon->session->get('absoluteURL'), $pdRequest['supportingEvidence']);

$row = $form->addRow()->addClass('furtherInfo');
$col = $row->addColumn();
$col->addLabel('notes', Format::bold(__('Comments/Notes')));
$col->addLabel('notesLabel', Format::bold(__('Comments/Notes')));
$col->addContent($pdRequest['notes']);

$row = $form->addRow();
Expand Down Expand Up @@ -303,7 +310,7 @@ function toggleSection(&$row, $section, $icon) {

$row = $form->addRow()->addClass('participants');
$col = $row->addColumn();
$col->addLabel('teachers', Format::bold(__('Teachers/Staff')));
$col->addLabel('teacherLabel', Format::bold(__('Teachers/Staff')));

$requestPersonGateway = $container->get(RequestPersonGateway::class);
$peopleCriteria = $requestPersonGateway->newQueryCriteria()
Expand Down Expand Up @@ -394,15 +401,15 @@ function toggleSection(&$row, $section, $icon) {

if ($approveMode) {
$row = $form->addRow();
$row->addLabel('action', __('Action'));
$row->addLabel('requestStatusLabel', __('Update the Request Status'));
$row->addSelect('requestStatus')
->fromArray(['Approval', 'Rejection', 'Comment']);
}

if (!$readOnly) {
$row = $form->addRow();
$col = $row->addColumn();
$col->addLabel('comment', __('Comment'));
$col->addLabel('commentLabel', __('Comment'));
$col->addTextarea('comment');

$row = $form->addRow();
Expand Down Expand Up @@ -484,5 +491,21 @@ function getSettings(ContainerInterface $container, $guid) {
return $settingFactory->getSettings();
}

function getCoverAmountArray() {
$options = array();

$options = array(
'No Cover Required' => __('No Cover Required'),
'Tutor group' => __('Tutor group'),
'Duty' => __('Duty'),
'1-5 Periods (include year 12 & 13 classes)' => __('1-5 Periods (include year 12 & 13 classes)'),
'6-10 Periods (include year 12 & 13 classes)' => __('6-10 Periods (include year 12 & 13 classes)'),
'11-15 Periods (include year 12 & 13 classes)' => __('11-15 Periods (include year 12 & 13 classes)'),
'16 Periods + (include year 12 & 13 classes)' => __('16 Periods + (include year 12 & 13 classes)')
);

return $options;
}

?>

33 changes: 0 additions & 33 deletions Professional Development/name_delete.php

This file was deleted.

44 changes: 0 additions & 44 deletions Professional Development/name_deleteProcess.php

This file was deleted.

48 changes: 30 additions & 18 deletions Professional Development/requests_add.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
/*
Gibbon, Flexible & Open School System
Copyright (C) 2010, Ross Parker
Gibbon: the flexible, open school platform
Founded by Ross Parker at ICHK Secondary. Built by Ross Parker, Sandra Kuipers and the Gibbon community (https://gibbonedu.org/about/)
Copyright © 2010, Gibbon Foundation
Gibbon™, Gibbon Education Ltd. (Hong Kong)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -17,10 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Http\Url;
use Gibbon\Forms\Form;
use Gibbon\Services\Format;
use Gibbon\Domain\Staff\StaffGateway;
use Gibbon\Forms\DatabaseFormFactory;
use Gibbon\Domain\System\SettingGateway;
use Gibbon\Module\ProfessionalDevelopment\Domain\RequestsGateway;
Expand Down Expand Up @@ -101,7 +101,7 @@

$row = $form->addRow();
$row->addLabel('eventFocus', __('Area of Focus (conference or training)'));
$row->addSelect('eventFocus')->fromArray(['IB' => __('IB'), 'IGCSE' => __('IGCSE'), 'Other' => __('Other')])->required();
$row->addSelect('eventFocus')->fromArray(['IB' => __('IB'), 'IGCSE' => __('IGCSE'), 'SEN' => __('SEN'),'Other' => __('Other')])->required();

$form->toggleVisibilityByClass('eventFocus')->onSelect('eventFocus')->when('Other');
$row = $form->addRow()->addClass('eventFocus');
Expand All @@ -116,6 +116,15 @@
$row->addLabel('attendeeCount', __('No. of Particpants'))->description(__m('Total number of people joining the event'));
$row->addNumber('attendeeCount')->onlyInteger(true)->minimum(0)->maximum(999)->maxLength(3)->required();

//Cover Amount
$options = getCoverAmountArray();
$row = $form->addRow();
$row->addLabel('coverAmount', __('Cover Amount'))->description(__('Cover Required: If "yes", please provide an estimate of the amount of cover required. Please tick all that apply'));
$row->addCheckbox('coverAmount')
->fromArray($options)
->addClass('md:max-w-md')
->required();

$row = $form->addRow();
$row->addLabel('eventTitle', 'Event Name');
$row->addTextfield('eventTitle')
Expand Down Expand Up @@ -285,6 +294,8 @@
->displayLabel();

//Load values into form
$pdRequest['coverAmount'] = unserialize($pdRequest['coverAmount']);

$form->loadAllValuesFrom($pdRequest);

//Get Cost Data and add to CostBlocks
Expand Down Expand Up @@ -314,8 +325,8 @@

foreach ($days as $day) {
$dateBlocks->addBlock($day['professionalDevelopmentRequestDaysID'], [
'startDate' => Format::date($day['startDate']),
'endDate' => Format::date($day['endDate']),
'startDate' =>$day['startDate'],
'endDate' => $day['endDate'],
'professionalDevelopmentRequestDaysID' => $day['professionalDevelopmentRequestDaysID']
]);
}
Expand All @@ -329,9 +340,9 @@

foreach ($tripPeople as $person) {
$participantBlocks->addBlock($person['professionalDevelopmentRequestPersonID'], [
'gibbonPersonID' => $person['gibbonPersonID'],
'professionalDevelopmentRequestPersonID' => $person['professionalDevelopmentRequestPersonID']
]);
'gibbonPersonID' => $person['gibbonPersonID'],
'professionalDevelopmentRequestPersonID' => $person['professionalDevelopmentRequestPersonID']
]);
}

}
Expand All @@ -340,9 +351,16 @@
$form->addRow()->addHeading(__('Log'));
$col = $form->addRow()->addColumn();
$col->addLabel('changeSummary', __('Change Summary'))->description(__('Please briefly describe the changes you have made to this request. This summary will be added to the request log.'));
$col->addTextarea('changeSummary')->setRows(2)->required();
$col->addTextarea('changeSummary')->required()->setRows(2);
}

$form->addRow()->addHeading('Agreement', __('PLEASE READ'));
$form->addRow()->addContent("Please note that completion of this application will not always guarantee confirmation. When and if necessary, consideration will need to be given to the number of staff wishing to attend at any given time, support available to cover classes, limits to registrations available for individual schools, and perceived areas of need within the school. Please be assured, however, that all decisions will be discussed with you in a timely fashion. *No registration or airline/hotel booking will be executed if this application is not approved by the Head of School. The application should be submitted at least 15 working days prior to the conference/workshop’s registration deadline.");

$row = $form->addRow();
$row->addLabel('agreement', __('I acknowledge that I understand the points above and I have discussed this application with my Head of Department.'));
$row->addCheckbox('agreement')->description(__('Yes'))->required();

$row = $form->addRow('stickySubmit');
if (!$edit || $isDraft) {
$col = $row->addColumn()->addClass('items-center');
Expand All @@ -360,18 +378,12 @@
//This javascript is for the Date Blocks
var date = 'input[id*="Date"]';

$(document).on('click', '.addBlock', function () {
$(date).removeClass('hasDatepicker').datepicker({'timeFormat': 'H:i', onSelect: function(){$(this).blur();}, onClose: function(){$(this).change();} });
});

$(document).ready(function(){
$(date).removeClass('hasDatepicker').datepicker({onSelect: function(){$(this).blur();}, onClose: function(){$(this).change();} });


//Ensure that loaded dates have correct max and min dates.
$('input[id^=startDate]').each(function() {
var endDate = $('#' + $(this).prop('id').replace('start', 'end'));
});

});

$(document).on('change', 'input[id^=startDate]', function() {
Expand Down
6 changes: 4 additions & 2 deletions Professional Development/requests_addApprover.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
/*
Gibbon, Flexible & Open School System
Copyright (C) 2010, Ross Parker
Gibbon: the flexible, open school platform
Founded by Ross Parker at ICHK Secondary. Built by Ross Parker, Sandra Kuipers and the Gibbon community (https://gibbonedu.org/about/)
Copyright © 2010, Gibbon Foundation
Gibbon™, Gibbon Education Ltd. (Hong Kong)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Loading