diff --git a/functions.php b/functions.php index d3a2ba11a1..733ac3eb40 100644 --- a/functions.php +++ b/functions.php @@ -19,6 +19,8 @@ along with this program. If not, see . */ +use Gibbon\Locale; +use Gibbon\UI\Icon; use Gibbon\Http\Url; use Gibbon\Forms\Form; use Gibbon\Services\Format; @@ -27,7 +29,6 @@ use Gibbon\Domain\System\AlertLevelGateway; use Gibbon\Domain\System\SettingGateway; use Gibbon\Forms\Input\Editor; -use Gibbon\Locale; function getIPAddress() { @@ -179,6 +180,21 @@ function __m(string $text, array $params = [], array $options = []) return $gibbon->locale->translate($text, $params, $options); } +/** + * Return an SVG icon from a specified icon library. + * Many of the icons come from: https://heroicons.com + * + * @param string $library One of: basic, solid, outline + * @param string $icon The name of an icon + * @param string $class Applies a class to the svg returned + * @param array $options Eg: strokeWidth for outline icons + * @return string + */ +function icon(string $library, string $icon, string $class = '', array $options = []) : string +{ + return Icon::get($library, $icon, $class, $options); +} + //$valueMode can be "value" or "id" according to what goes into option's value field //$selectMode can be "value" or "id" according to what is used to preselect an option //$honourDefault can TRUE or FALSE, and determines whether or not the default grade is selected @@ -362,8 +378,8 @@ function getFastFinder($connection2, $guid) { global $session; - $form = Form::create('fastFinder', Url::fromHandlerRoute('indexFindRedirect.php'), 'get'); - $form->setClass('blank fullWidth'); + $form = Form::createBlank('fastFinder', Url::fromHandlerRoute('indexFindRedirect.php'), 'get'); + $form->setClass('w-full'); $form->addHiddenValue('address', $session->get('address')); @@ -702,6 +718,9 @@ function msort($array, $id = 'id', $sort_ascending = true) /** * Returns preformatted HTML indicator of max file upload size * + * Deprecated. Built into FileUpload class now. + * + * @deprecated v28 * @since 2013 * @version v26 * @@ -709,33 +728,7 @@ function msort($array, $id = 'id', $sort_ascending = true) */ function getMaxUpload($multiple = false) { - // For backwards compatibilty - global $guid; - if ($multiple === $guid) { - $multiple = func_get_args()[1] ?? false; - } - - $output = ''; - $post = substr(ini_get('post_max_size'), 0, (strlen(ini_get('post_max_size')) - 1)); - $file = substr(ini_get('upload_max_filesize'), 0, (strlen(ini_get('upload_max_filesize')) - 1)); - - $output .= "
"; - if ($multiple == true) { - if ($post < $file) { - $output .= sprintf(__('Maximum size for all files: %1$sMB'), $post) . '
'; - } else { - $output .= sprintf(__('Maximum size for all files: %1$sMB'), $file) . '
'; - } - } else { - if ($post < $file) { - $output .= sprintf(__('Maximum file size: %1$sMB'), $post) . '
'; - } else { - $output .= sprintf(__('Maximum file size: %1$sMB'), $file) . '
'; - } - } - $output .= '
'; - - return $output; + return ''; } //Encode strring using htmlentities with the ENT_QUOTES option diff --git a/index.php b/index.php index c3aed9b2b9..8f633b9dc1 100644 --- a/index.php +++ b/index.php @@ -19,14 +19,13 @@ along with this program. If not, see . */ +use Gibbon\Http\Url; +use Gibbon\Domain\User\UserGateway; use Gibbon\Domain\System\HookGateway; use Gibbon\Domain\System\ModuleGateway; use Gibbon\Domain\System\SettingGateway; -use Gibbon\Domain\Students\StudentGateway; use Gibbon\Domain\Messenger\MessengerGateway; use Gibbon\Domain\DataUpdater\DataUpdaterGateway; -use Gibbon\Domain\User\UserGateway; -use Gibbon\Http\Url; /** * BOOTSTRAP @@ -288,7 +287,10 @@ 'config' => [ 'tinymce' => [ 'valid_elements' => $settingGateway->getSettingByScope('System', 'allowableHTML'), - ] + ], + 'htmx' => [ + 'unload_confirm' => __("Are you sure you want to leave this page? Information you've entered may not be saved."), + ], ], ]; @@ -301,16 +303,26 @@ // Set page scripts: head $page->scripts->addMultiple([ - 'lv' => 'lib/LiveValidation/livevalidation_standalone.compressed.js', + // 'lv' => 'lib/LiveValidation/livevalidation_standalone.compressed.js', 'jquery' => 'lib/jquery/jquery.js', + 'htmx' => 'lib/htmx/htmx.min.js', + 'core' => 'resources/assets/js/core.min.js', + +], ['context' => 'head']); + +$page->scripts->addMultiple([ 'jquery-migrate' => 'lib/jquery/jquery-migrate.min.js', 'jquery-ui' => 'lib/jquery-ui/js/jquery-ui.min.js', 'jquery-time' => 'lib/jquery-timepicker/jquery.timepicker.min.js', 'jquery-chained' => 'lib/chained/jquery.chained.min.js', - 'core' => 'resources/assets/js/core.min.js', - 'htmx' => 'lib/htmx/htmx.min.js', - -], ['context' => 'head']); + 'alpineFocus' => 'lib/htmx/alpine.focus.min.js', + 'alpineCollapse' => 'lib/htmx/alpine.collapse.min.js', + 'alpineValidate' => 'lib/htmx/alpine.validate.min.js', + 'alpine' => 'lib/htmx/alpine.min.js', +], ['context' => 'head', 'type' => 'defer']); + +// Set page scripts: foot - core +$page->scripts->add('core-config', 'window.Gibbon = '.json_encode($javascriptConfig).';', ['type' => 'inline']); // Set page scripts: foot - jquery $page->scripts->addMultiple([ @@ -318,19 +330,14 @@ 'jquery-form' => 'lib/jquery-form/jquery.form.js', 'jquery-autosize' => 'lib/jquery-autosize/jquery.autosize.min.js', 'jquery-token' => 'lib/jquery-tokeninput/src/jquery.tokeninput.js', -], ['context' => 'foot']); +], ['context' => 'foot', 'type' => 'defer']); // Set page scripts: foot - misc $page->scripts->addMultiple([ - 'tinymce' => 'lib/tinymce/tinymce.min.js', - 'alpineFocus' => 'lib/htmx/alpine.focus.min.js', - 'alpine' => 'lib/htmx/alpine.min.js', + 'core-setup' => 'resources/assets/js/setup.js', + 'tinymce' => 'lib/tinymce/tinymce.min.js', ], ['context' => 'foot', 'type' => 'defer']); -// Set page scripts: foot - core -$page->scripts->add('core-config', 'window.Gibbon = '.json_encode($javascriptConfig).';', ['type' => 'inline']); -$page->scripts->add('core-setup', 'resources/assets/js/setup.js'); - // Register scripts available to the core, but not included by default $page->scripts->add('chart', 'lib/Chart.js/3.0/chart.min.js', ['context' => 'head']); $page->scripts->register('instascan', 'lib/instascan/instascan.min.js', ['context' => 'head']); @@ -478,7 +485,8 @@ $menuItemActive = $item['active'] ? $item['actionName'] : $menuItemActive; } } - + + $session->set('menuModuleItems', $menuModuleItems); $session->set('menuModuleName', $currentModule); $session->set('menuItemActive', $menuItemActive); @@ -543,7 +551,8 @@ $page->addData([ 'menuMain' => $session->get('menuMainItems', []), 'menuModule' => $session->get('menuModuleItems', []), - 'menuItemActive' => $session->get('menuItemActive', []), + 'menuModuleName' => $session->get('menuModuleName', ''), + 'menuItemActive' => $session->get('menuItemActive', ''), ]); } diff --git a/index_fastFinder_ajax.php b/index_fastFinder_ajax.php index a46da4ff48..c1678cd81e 100644 --- a/index_fastFinder_ajax.php +++ b/index_fastFinder_ajax.php @@ -276,7 +276,7 @@ $name = preg_replace('/'.$searchTermSafe.'/i', '$0', $name); - $output .= ''.htmlPrep(__($type)).' - '.$name.''; + $output .= ''.htmlPrep(__($type)).' - '.$name.''; $outputCount++; } diff --git a/installer/install.php b/installer/install.php index faaeedd163..dd00f72596 100644 --- a/installer/install.php +++ b/installer/install.php @@ -188,7 +188,9 @@ // Show success message if the installation is a complete success. if ($message === null) { - $absoluteURL = $session->get('absoluteURL'); + if (!$absoluteURL = $installer->getSetting('absoluteURL')) { + $absoluteURL = $session->get('absoluteURL', InstallController::guessAbsoluteUrl()); + } $page->addSuccess(sprintf(__('Congratulations, your installation is complete. Feel free to %1$sgo to your Gibbon homepage%2$s and login with the username and password you created.'), "", '')); echo $page->fetchFromTemplate('ui/gettingStarted.twig.html', ['postInstall' => true]); } diff --git a/lib/htmx/alpine.collapse.min.js b/lib/htmx/alpine.collapse.min.js new file mode 100644 index 0000000000..a8653437ad --- /dev/null +++ b/lib/htmx/alpine.collapse.min.js @@ -0,0 +1 @@ +(()=>{function g(n){n.directive("collapse",e),e.inline=(t,{modifiers:i})=>{i.includes("min")&&(t._x_doShow=()=>{},t._x_doHide=()=>{})};function e(t,{modifiers:i}){let r=l(i,"duration",250)/1e3,h=l(i,"min",0),u=!i.includes("min");t._x_isShown||(t.style.height=`${h}px`),!t._x_isShown&&u&&(t.hidden=!0),t._x_isShown||(t.style.overflow="hidden");let c=(d,s)=>{let o=n.setStyles(d,s);return s.height?()=>{}:o},f={transitionProperty:"height",transitionDuration:`${r}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};t._x_transition={in(d=()=>{},s=()=>{}){u&&(t.hidden=!1),u&&(t.style.display=null);let o=t.getBoundingClientRect().height;t.style.height="auto";let a=t.getBoundingClientRect().height;o===a&&(o=h),n.transition(t,n.setStyles,{during:f,start:{height:o+"px"},end:{height:a+"px"}},()=>t._x_isShown=!0,()=>{Math.abs(t.getBoundingClientRect().height-a)<1&&(t.style.overflow=null)})},out(d=()=>{},s=()=>{}){let o=t.getBoundingClientRect().height;n.transition(t,c,{during:f,start:{height:o+"px"},end:{height:h+"px"}},()=>t.style.overflow="hidden",()=>{t._x_isShown=!1,t.style.height==`${h}px`&&u&&(t.style.display="none",t.hidden=!0)})}}}}function l(n,e,t){if(n.indexOf(e)===-1)return t;let i=n[n.indexOf(e)+1];if(!i)return t;if(e==="duration"){let r=i.match(/([0-9]+)ms/);if(r)return r[1]}if(e==="min"){let r=i.match(/([0-9]+)px/);if(r)return r[1]}return i}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(g)});})(); diff --git a/lib/htmx/alpine.validate.js b/lib/htmx/alpine.validate.js new file mode 100644 index 0000000000..e17c0f1008 --- /dev/null +++ b/lib/htmx/alpine.validate.js @@ -0,0 +1,360 @@ +(() => { + // src/index.js + var Plugin = function(Alpine) { + const DATA_ERROR = "data-error"; + const DATA_ERROR_MSG = `${DATA_ERROR}-msg`; + const ERROR_MSG_CLASS = "error-msg"; + const PLUGIN_NAME = "validate"; + const REQUIRED = "required"; + const INPUT = "input"; + const CHECKBOX = "checkbox"; + const RADIO = "radio"; + const GROUP = "group"; + const FORM = "form"; + const FIELDSET = "fieldset"; + const notType = (type) => `:not([type="${type}"])`; + const FIELD_SELECTOR = `${INPUT}${notType("search")}${notType("reset")}${notType("submit")},select,textarea`; + const HIDDEN = "hidden"; + const isHtmlElement = (el, type) => { + const isInstanceOfHTML = el instanceof HTMLElement; + return type ? isInstanceOfHTML && el.matches(type) : isInstanceOfHTML; + }; + const includes = (array, string) => Array.isArray(array) && array.includes(string); + const addEvent = (el, event, callback) => el.addEventListener(event, callback); + const getAttr = (el, attr) => el.getAttribute(attr); + const setAttr = (el, attr, value = "") => el.setAttribute(attr, value); + const getEl = (el, parent = document) => isHtmlElement(el) ? el : parent.querySelector(`#${el}`) || parent.querySelector(`[name ="${el}"]`); + const getForm = (el) => el && el.closest(FORM); + const getName = (el) => getAttr(el, "name") || getAttr(el, "id"); + const getMakeId = (el) => { + const id = getAttr(el, "id"); + if (id) + return id; + const randomId = `${el.tagName.toLowerCase()}-${Math.random().toString(36).substring(2, 9)}`; + setAttr(el, "id", randomId); + return randomId; + }; + const cleanText = (str) => String(str).trim(); + const getData = (strOrEl) => { + const el = getEl(strOrEl); + let data = formData.get(getForm(el)); + if (!data) + return false; + if (isHtmlElement(el, FORM)) + return Object.values(data); + if (isHtmlElement(el, FIELDSET)) { + const fields = el.querySelectorAll(FIELD_SELECTOR); + return Object.values(data).filter((val) => Array.from(fields).some((el2) => val.node === el2)); + } + if (isHtmlElement(el, FIELD_SELECTOR)) + return data[getName(el)]; + }; + const dateFormats = ["mmddyyyy", "ddmmyyyy", "yyyymmdd"]; + const yearLastDateRegex = /^(\d{1,2})[-/.](\d{1,2})[-/.](\d{4})$/; + const yearFirstDateRegex = /^(\d{4})[-/.](\d{1,2})[-/.](\d{1,2})$/; + function isDate(str, format = dateFormats[2]) { + const dateArray = str.split(/[-/.]/); + const formatIndexInArray = dateFormats.indexOf(format); + let mm, dd, yyyy; + if (yearLastDateRegex.test(str)) { + if (formatIndexInArray === 0) + [mm, dd, yyyy] = dateArray; + if (formatIndexInArray === 1) + [dd, mm, yyyy] = dateArray; + } else if (yearFirstDateRegex.test(str) && formatIndexInArray === 2) { + [yyyy, mm, dd] = dateArray; + } + const isoFormattedStr = `${yyyy}-${mm}-${dd}`; + const date = new Date(isoFormattedStr); + const timestamp = date.getTime(); + if (!typeof timestamp === "number" || Number.isNaN(timestamp)) + return false; + return date.toISOString().startsWith(isoFormattedStr); + } + const formData = new WeakMap(); + const formModifiers = new WeakMap(); + function updateFieldData(field, data, triggerErrorMsg) { + var _a; + const form = getForm(field); + const name = getName(field); + if (form && name) { + if (!formData.has(form)) { + formData.set(form, Alpine.reactive({})); + } + let tempData = formData.get(form); + const disabled = field.matches(":disabled"); + const required = ((_a = tempData[name]) == null ? void 0 : _a.required) || field.required; + data = { + ...tempData[name], + name, + node: field, + value: disabled ? "" : field.value, + required, + disabled, + ...data + }; + const value = data.value; + let valid = field.checkValidity(); + if (!data.disabled && valid) { + if (includes([CHECKBOX, RADIO], field.type)) { + if (data.required) + valid = field.checked; + let tempArray = data.array || []; + if (field.type === CHECKBOX) { + if (field.checked && !tempArray.includes(value)) + tempArray.push(value); + if (!field.checked) + tempArray = tempArray.filter((val) => val !== value); + } + if (field.type === RADIO && field.checked) + tempArray = [value]; + data.array = tempArray; + data.value = tempArray.toString(); + if (includes(data.mods, GROUP)) { + const min = data.exp || 1; + valid = tempArray.length >= min; + } + } else { + if (data.required) + valid = !!value.trim(); + if (valid && value) { + const format = data.mods.filter((val) => dateFormats.indexOf(val) !== -1)[0]; + for (let type of data.mods) { + if (typeof validate[type] === "function") { + valid = type === "date" ? isDate(value, format) : validate[type](value); + break; + } + } + if (data.exp === false) + valid = false; + } + } + } + data.valid = valid; + tempData[name] = data; + formData.set(form, tempData); + } + if (triggerErrorMsg) + toggleError(field, data.valid); + return data; + } + function updateData(el, data, triggerErrorMsg) { + if (isHtmlElement(el, FORM) || isHtmlElement(el, FIELDSET)) { + const data2 = getData(el); + data2.forEach((item) => { + return updateFieldData(item.node); + }); + } + if (isHtmlElement(el, FIELD_SELECTOR)) + return updateFieldData(el, data, triggerErrorMsg); + } + const validate = {}; + validate.email = (str) => /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(cleanText(str)); + validate.tel = (str) => /^((\+|0)\d{1,4})?[-\s.]?[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?(\d{1,2})$/.test(cleanText(str)); + validate.website = (str) => /^(https?:\/\/)?(www\.)?([-a-zA-Z0-9@:%._+~#=]+(-?[a-zA-Z0-9])*\.)+[\w]{2,}(\/\S*)?$/.test(cleanText(str)); + validate.url = (str) => /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_+.~#?&/=]*)/.test(cleanText(str)); + validate.number = (str) => !isNaN(parseFloat(str)) && isFinite(str); + validate.integer = (str) => validate.number(str) && Number.isInteger(Number(str)); + validate.wholenumber = (str) => validate.integer(str) && Number(str) > 0; + validate.date = (str) => isDate(str); + dateFormats.forEach((format) => { + validate.date[format] = (str) => isDate(str, format); + }); + let validateMagic = {}; + validateMagic.data = (el) => getData(el); + validateMagic.formData = (el) => formData.get(getForm(getEl(el))); + validateMagic.value = (el, value) => { + el = getEl(el); + const data = getData(el); + if (!data) + return false; + if (Array.isArray(data)) { + return data.reduce((result, item) => { + result[item.name] = item.value; + return result; + }, {}); + } + if (value) { + data.value = value; + el.value = value; + updateFieldData(el); + } + return data.value; + }; + validateMagic.updateData = (el, data, triggerErrorMsg) => updateData(getEl(el), data, triggerErrorMsg); + validateMagic.toggleError = (field, valid) => toggleError(getEl(field), valid); + validateMagic.submit = (e) => { + let invalid = 0; + getData(e.target).forEach((val) => { + val = updateData(val.node); + if (val.valid === false) { + invalid++; + if (invalid === 1) + val.node.focus(); + toggleError(val.node, false); + e.preventDefault(); + console.error(`${val.name} ${REQUIRED}`); + } + }); + }; + validateMagic.isComplete = (el) => { + const data = getData(el); + return Array.isArray(data) ? !data.some((val) => !val.valid) : data && data.valid; + }; + Object.keys(validate).forEach((key) => validateMagic = { ...validateMagic, [key]: validate[key] }); + Alpine.magic(PLUGIN_NAME, () => validateMagic); + Alpine.magic("formData", (el) => formData.get(getForm(getEl(el)))); + Alpine.directive(PLUGIN_NAME, (el, { modifiers, expression }, { evaluate }) => { + const watchElement = (element) => { + const observer = new MutationObserver((mutationsList) => { + for (const mutation of mutationsList) { + const target = mutation.target; + if (mutation.type === "attributes") { + const attr = mutation.attributeName; + if (target.matches(FIELD_SELECTOR) && ["disabled", "required", "value"].includes(attr)) { + updateData(target); + } + if (target.matches(FIELDSET) && attr === "disabled") { + updateData(target); + } + } + } + }); + observer.observe(element, { + attributes: true, + childList: true, + subtree: true + }); + return observer; + }; + const defaultData = (field) => { + const parentNode = field.closest(".field-parent") || includes(modifiers, GROUP) ? field.parentNode.parentNode : field.parentNode; + const mods = [...modifiers, field.type]; + const required = field.required || includes(mods, REQUIRED) || includes(mods, GROUP); + const disabled = field.matches(":disabled"); + return { + mods, + required, + disabled, + parentNode, + exp: expression && evaluate(expression) + }; + }; + function addEvents(field) { + const attrs = Array.from(field.attributes).map((attr) => attr.name); + const triggers = [ + "required", + ":required", + "pattern", + ":pattern", + ":disabled" + ]; + const hasTrigger = attrs.some((attr) => triggers.includes(attr) || attr.includes("x-validate")); + if (field.matches("[type=hidden]") || !hasTrigger) + return; + addErrorMsg(field); + const isClickField = includes([CHECKBOX, RADIO, "range"], field.type); + const eventType = isClickField ? "click" : isHtmlElement(field, "select") ? "change" : "blur"; + addEvent(field, eventType, checkIfValid); + if (includes(modifiers, INPUT) && !isClickField) + addEvent(field, INPUT, checkIfValid); + } + if (isHtmlElement(el, FORM)) { + watchElement(el); + if (!modifiers.includes("use-browser")) { + setAttr(el, "novalidate", "true"); + } + if (modifiers.includes("validate-on-submit")) { + el.addEventListener("submit", function(e) { + validateMagic.submit(e); + }); + } + formModifiers.set(el, modifiers); + const fields = el.querySelectorAll(FIELD_SELECTOR); + addEvent(el, "reset", () => { + el.reset(); + const data = getData(el); + setTimeout(() => { + data.forEach((field) => updateFieldData(field.node)); + }, 50); + }); + fields.forEach((field) => { + if (getName(field)) { + updateFieldData(field, defaultData(field)); + if (!field.getAttributeNames().some((attr) => attr.includes(`x-${PLUGIN_NAME}`))) { + addEvents(field); + } + } + }); + } + if (getName(el) && isHtmlElement(el, FIELD_SELECTOR)) { + const form = getForm(el); + const formMods = formModifiers.has(form) ? formModifiers.get(form) : []; + modifiers = [...modifiers, ...formMods]; + updateFieldData(el, defaultData(el)); + addEvents(el); + if (!form.hasAttribute("x-validate")) { + watchElement(el); + } + } + function checkIfValid(e) { + const field = this; + const mods = getData(field).mods; + const updatedData = updateFieldData(field, { exp: expression && evaluate(expression) }, true); + if (!updatedData.valid && !includes(mods, "bluronly") && e.type === "blur") { + addEvent(field, INPUT, checkIfValid); + } + if (!updatedData.valid && includes(mods, "refocus")) + field.focus(); + return updatedData.valid; + } + }); + function toggleError(field, valid) { + const parentNode = getData(field).parentNode; + const errorMsgNode = document.getElementById(getAttr(field, "aria-errormessage")); + setAttr(field, "aria-invalid", !valid); + if (valid) { + setAttr(errorMsgNode, HIDDEN); + parentNode.removeAttribute(DATA_ERROR); + } else { + errorMsgNode.removeAttribute(HIDDEN); + setAttr(parentNode, DATA_ERROR, errorMsgNode.textContent); + } + } + function findSiblingErrorMsgNode(el) { + while (el) { + el = el.nextElementSibling; + if (isHtmlElement(el, `.${ERROR_MSG_CLASS}`)) + return el; + if (isHtmlElement(el, FIELD_SELECTOR)) + return false; + } + return false; + } + function addErrorMsg(field) { + const fieldData = getData(field); + const targetNode = includes(fieldData.mods, GROUP) ? fieldData.parentNode : field; + const span = document.createElement("span"); + span.className = ERROR_MSG_CLASS; + const errorMsgNode = document.getElementById(`${ERROR_MSG_CLASS}-${getAttr(targetNode, "id")}`) || findSiblingErrorMsgNode(targetNode) || span; + const id = getMakeId(targetNode); + const errorMsgId = `${ERROR_MSG_CLASS}-${id}`; + if (getAttr(errorMsgNode, "id") !== errorMsgId) { + setAttr(errorMsgNode, "id", errorMsgId); + } + setAttr(errorMsgNode, HIDDEN); + const name = getName(field); + if (!errorMsgNode.innerHTML) + errorMsgNode.textContent = getAttr(targetNode, DATA_ERROR_MSG) || `${name.replace(/[-_]/g, " ")} ${REQUIRED}`; + setAttr(field, "aria-errormessage", errorMsgId); + if (!getEl(errorMsgId, getForm(field))) + targetNode.after(errorMsgNode); + } + }; + var src_default = Plugin; + + // builds/cdn.js + document.addEventListener("alpine:init", () => { + window.Alpine.plugin(src_default); + }); +})(); diff --git a/lib/htmx/alpine.validate.min.js b/lib/htmx/alpine.validate.min.js new file mode 100644 index 0000000000..c21d433465 --- /dev/null +++ b/lib/htmx/alpine.validate.min.js @@ -0,0 +1 @@ +(()=>{var et=function(w){let _="data-error",K=`${_}-msg`,S="error-msg",C="validate",z="required",I="input",Z="checkbox",H="radio",x="group",R="form",j="fieldset",G=t=>`:not([type="${t}"])`,v=`${I}${G("search")}${G("reset")}${G("submit")},select,textarea`,P="hidden",g=(t,e)=>{let r=t instanceof HTMLElement;return e?r&&t.matches(e):r},b=(t,e)=>Array.isArray(t)&&t.includes(e),O=(t,e,r)=>t.addEventListener(e,r),E=(t,e)=>t.getAttribute(e),h=(t,e,r="")=>t.setAttribute(e,r),A=(t,e=document)=>g(t)?t:e.querySelector(`#${t}`)||e.querySelector(`[name ="${t}"]`),D=t=>t&&t.closest(R),M=t=>E(t,"name")||E(t,"id"),Q=t=>{let e=E(t,"id");if(e)return e;let r=`${t.tagName.toLowerCase()}-${Math.random().toString(36).substring(2,9)}`;return h(t,"id",r),r},q=t=>String(t).trim(),p=t=>{let e=A(t),r=N.get(D(e));if(!r)return!1;if(g(e,R))return Object.values(r);if(g(e,j)){let a=e.querySelectorAll(v);return Object.values(r).filter(o=>Array.from(a).some(f=>o.node===f))}if(g(e,v))return r[M(e)]},L=["mmddyyyy","ddmmyyyy","yyyymmdd"],X=/^(\d{1,2})[-/.](\d{1,2})[-/.](\d{4})$/,J=/^(\d{4})[-/.](\d{1,2})[-/.](\d{1,2})$/;function U(t,e=L[2]){let r=t.split(/[-/.]/),a=L.indexOf(e),o,f,u;X.test(t)?(a===0&&([o,f,u]=r),a===1&&([f,o,u]=r)):J.test(t)&&a===2&&([u,o,f]=r);let y=`${u}-${o}-${f}`,s=new Date(y),n=s.getTime();return!typeof n==="number"||Number.isNaN(n)?!1:s.toISOString().startsWith(y)}let N=new WeakMap,B=new WeakMap;function $(t,e,r){var f;let a=D(t),o=M(t);if(a&&o){N.has(a)||N.set(a,w.reactive({}));let u=N.get(a),y=t.matches(":disabled"),s=((f=u[o])==null?void 0:f.required)||t.required;e={...u[o],name:o,node:t,value:y?"":t.value,required:s,disabled:y,...e};let n=e.value,i=t.checkValidity();if(!e.disabled&&i){if(b([Z,H],t.type)){e.required&&(i=t.checked);let c=e.array||[];if(t.type===Z&&(t.checked&&!c.includes(n)&&c.push(n),t.checked||(c=c.filter(d=>d!==n))),t.type===H&&t.checked&&(c=[n]),e.array=c,e.value=c.toString(),b(e.mods,x)){let d=e.exp||1;i=c.length>=d}}else if(e.required&&(i=!!n.trim()),i&&n){let c=e.mods.filter(d=>L.indexOf(d)!==-1)[0];for(let d of e.mods)if(typeof m[d]=="function"){i=d==="date"?U(n,c):m[d](n);break}e.exp===!1&&(i=!1)}}e.valid=i,u[o]=e,N.set(a,u)}return r&&W(t,e.valid),e}function T(t,e,r){if((g(t,R)||g(t,j))&&p(t).forEach(o=>$(o.node)),g(t,v))return $(t,e,r)}let m={};m.email=t=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(q(t)),m.tel=t=>/^((\+|0)\d{1,4})?[-\s.]?[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?\d[-\s.]?(\d{1,2})$/.test(q(t)),m.website=t=>/^(https?:\/\/)?(www\.)?([-a-zA-Z0-9@:%._+~#=]+(-?[a-zA-Z0-9])*\.)+[\w]{2,}(\/\S*)?$/.test(q(t)),m.url=t=>/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_+.~#?&/=]*)/.test(q(t)),m.number=t=>!isNaN(parseFloat(t))&&isFinite(t),m.integer=t=>m.number(t)&&Number.isInteger(Number(t)),m.wholenumber=t=>m.integer(t)&&Number(t)>0,m.date=t=>U(t),L.forEach(t=>{m.date[t]=e=>U(e,t)});let l={};l.data=t=>p(t),l.formData=t=>N.get(D(A(t))),l.value=(t,e)=>{t=A(t);let r=p(t);return r?Array.isArray(r)?r.reduce((a,o)=>(a[o.name]=o.value,a),{}):(e&&(r.value=e,t.value=e,$(t)),r.value):!1},l.updateData=(t,e,r)=>T(A(t),e,r),l.toggleError=(t,e)=>W(A(t),e),l.submit=t=>{let e=0;p(t.target).forEach(r=>{r=T(r.node),r.valid===!1&&(e++,e===1&&r.node.focus(),W(r.node,!1),t.preventDefault(),console.error(`${r.name} ${z}`))})},l.isComplete=t=>{let e=p(t);return Array.isArray(e)?!e.some(r=>!r.valid):e&&e.valid},Object.keys(m).forEach(t=>l={...l,[t]:m[t]}),w.magic(C,()=>l),w.magic("formData",t=>N.get(D(A(t)))),w.directive(C,(t,{modifiers:e,expression:r},{evaluate:a})=>{let o=s=>{let n=new MutationObserver(i=>{for(let c of i){let d=c.target;if(c.type==="attributes"){let k=c.attributeName;d.matches(v)&&["disabled","required","value"].includes(k)&&T(d),d.matches(j)&&k==="disabled"&&T(d)}}});return n.observe(s,{attributes:!0,childList:!0,subtree:!0}),n},f=s=>{let n=s.closest(".field-parent")||b(e,x)?s.parentNode.parentNode:s.parentNode,i=[...e,s.type],c=s.required||b(i,z)||b(i,x),d=s.matches(":disabled");return{mods:i,required:c,disabled:d,parentNode:n,exp:r&&a(r)}};function u(s){let n=Array.from(s.attributes).map(F=>F.name),i=["required",":required","pattern",":pattern",":disabled"],c=n.some(F=>i.includes(F)||F.includes("x-validate"));if(s.matches("[type=hidden]")||!c)return;tt(s);let d=b([Z,H,"range"],s.type),k=d?"click":g(s,"select")?"change":"blur";O(s,k,y),b(e,I)&&!d&&O(s,I,y)}if(g(t,R)){o(t),e.includes("use-browser")||h(t,"novalidate","true"),e.includes("validate-on-submit")&&t.addEventListener("submit",function(n){l.submit(n)}),B.set(t,e);let s=t.querySelectorAll(v);O(t,"reset",()=>{t.reset();let n=p(t);setTimeout(()=>{n.forEach(i=>$(i.node))},50)}),s.forEach(n=>{M(n)&&($(n,f(n)),n.getAttributeNames().some(i=>i.includes(`x-${C}`))||u(n))})}if(M(t)&&g(t,v)){let s=D(t),n=B.has(s)?B.get(s):[];e=[...e,...n],$(t,f(t)),u(t),s.hasAttribute("x-validate")||o(t)}function y(s){let n=this,i=p(n).mods,c=$(n,{exp:r&&a(r)},!0);return!c.valid&&!b(i,"bluronly")&&s.type==="blur"&&O(n,I,y),!c.valid&&b(i,"refocus")&&n.focus(),c.valid}});function W(t,e){let r=p(t).parentNode,a=document.getElementById(E(t,"aria-errormessage"));h(t,"aria-invalid",!e),e?(h(a,P),r.removeAttribute(_)):(a.removeAttribute(P),h(r,_,a.textContent))}function Y(t){for(;t;){if(t=t.nextElementSibling,g(t,`.${S}`))return t;if(g(t,v))return!1}return!1}function tt(t){let e=p(t),r=b(e.mods,x)?e.parentNode:t,a=document.createElement("span");a.className=S;let o=document.getElementById(`${S}-${E(r,"id")}`)||Y(r)||a,f=Q(r),u=`${S}-${f}`;E(o,"id")!==u&&h(o,"id",u),h(o,P);let y=M(t);o.innerHTML||(o.textContent=E(r,K)||`${y.replace(/[-_]/g," ")} ${z}`),h(t,"aria-errormessage",u),A(u,D(t))||r.after(o)}},V=et;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(V)});})(); diff --git a/modules/Activities/activities_attendance.php b/modules/Activities/activities_attendance.php index 3a571a3a89..021e9178c4 100644 --- a/modules/Activities/activities_attendance.php +++ b/modules/Activities/activities_attendance.php @@ -175,8 +175,8 @@ if (count($activitySessions) <= 0) { echo $page->getBlankSlate(); } else { - $form = Form::create('attendance', $session->get('absoluteURL').'/modules/'.$session->get('module').'/activities_attendanceProcess.php?gibbonActivityID='.$gibbonActivityID); - $form->setClass('blank block w-full'); + $form = Form::createBlank('attendance', $session->get('absoluteURL').'/modules/'.$session->get('module').'/activities_attendanceProcess.php?gibbonActivityID='.$gibbonActivityID); + $form->setClass('block w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonPersonID', $session->get('gibbonPersonID')); @@ -198,7 +198,7 @@ $header->addContent(__('Student'))->addClass('w-56 py-8'); $header->addContent(__('Attendance')); $header->addContent(sprintf(__('Sessions Recorded: %s of %s'), count($sessionAttendanceData), count($activitySessions))) - ->addClass('emphasis subdued right'); + ->addClass('italic subdued right'); $table = $row->addClass('doublescroll-container block ')->addColumn()->setClass('ml-56 border-l-2 border-gray-600 -mt-1') ->addTable()->setClass('mini colorOddEven w-full m-0 border-0 overflow-x-scroll rowHighlight'); @@ -302,7 +302,7 @@ $row = $form->addRow()->addClass('flex w-full')->addTable()->setClass('smallIntBorder w-full doublescroll-wrapper')->addRow(); $row->addContent(__('All highlighted columns will be updated when you press submit.')) - ->wrap('', ''); + ->wrap('', ''); $row->addSubmit(); echo $form->getOutput(); diff --git a/modules/Activities/activities_attendance_sheet.php b/modules/Activities/activities_attendance_sheet.php index c92350bd01..3571be856c 100644 --- a/modules/Activities/activities_attendance_sheet.php +++ b/modules/Activities/activities_attendance_sheet.php @@ -47,7 +47,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/activities_attendance_sheet.php"); diff --git a/modules/Activities/activities_manage.php b/modules/Activities/activities_manage.php index 473c04e176..1949c3087a 100644 --- a/modules/Activities/activities_manage.php +++ b/modules/Activities/activities_manage.php @@ -74,7 +74,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/activities_manage.php"); @@ -164,7 +164,7 @@ // COLUMNS $table->addColumn('name', __('Activity')) ->format(function($activity) { - return $activity['name'].'
'.$activity['type'].''; + return $activity['name'].'
'.$activity['type'].''; }); $table->addColumn('days', __('Days')) diff --git a/modules/Activities/activities_payment.php b/modules/Activities/activities_payment.php index 591aa7412b..886c87bfe5 100644 --- a/modules/Activities/activities_payment.php +++ b/modules/Activities/activities_payment.php @@ -51,9 +51,9 @@ } else { $lastPerson = ''; - $form = Form::create('generateInvoices', $session->get('absoluteURL').'/modules/'.$session->get('module').'/activities_paymentProcessBulk.php'); + $form = Form::createBlank('generateInvoices', $session->get('absoluteURL').'/modules/'.$session->get('module').'/activities_paymentProcessBulk.php'); $form->addConfirmation(__('Are you sure you wish to process this action? It cannot be undone.')); - $form->setClass('w-full blank bulkActionForm'); + $form->setClass('bulkActionForm'); $form->addHiddenValue('address', $session->get('address')); $data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID')); @@ -82,7 +82,7 @@ $header->addContent(__('Form Group')); $header->addContent(__('Student')); $header->addContent(__('Activity')); - $header->addContent(__('Cost'))->append('
'.$session->get('currency').''); + $header->addContent(__('Cost'))->append('
'.$session->get('currency').''); $header->addCheckbox('checkall')->setClass('floatNone textCenter checkall'); while ($student = $result->fetch()) { diff --git a/modules/Activities/activities_view.php b/modules/Activities/activities_view.php index 939d833a8c..4fd9b141bf 100644 --- a/modules/Activities/activities_view.php +++ b/modules/Activities/activities_view.php @@ -119,7 +119,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php','get'); $form->setTitle(__('Filter & Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/activities_view.php"); @@ -308,7 +308,7 @@ $table->addColumn('name', __('Activity')) ->context('primary') ->format(function ($activity) { - return $activity['name'].'
'.$activity['type'].''; + return $activity['name'].'
'.$activity['type'].''; }); $table->addColumn('provider', __('Provider')) @@ -336,7 +336,7 @@ $output .= Format::dateRangeReadable($activity['programStart'], $activity['programEnd']); } - $output .= '
'; + $output .= '
'; $output .= implode(', ', $activityGateway->selectWeekdayNamesByActivity($activity['gibbonActivityID'])->fetchAll(\PDO::FETCH_COLUMN)); $output .= ''; diff --git a/modules/Activities/report_activityChoices_byFormGroup.php b/modules/Activities/report_activityChoices_byFormGroup.php index 038b8eb37a..7cc62d0eec 100644 --- a/modules/Activities/report_activityChoices_byFormGroup.php +++ b/modules/Activities/report_activityChoices_byFormGroup.php @@ -43,7 +43,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_activityChoices_byFormGroup.php"); @@ -72,7 +72,7 @@ if ($result->rowCount() < 1) { echo $page->getBlankSlate(); } else { - echo ""; + echo "
"; echo ""; echo '
'; echo __('Student'); @@ -106,7 +106,7 @@ $resultActivities->execute($dataActivities); if ($resultActivities->rowCount() > 0) { - echo ''; + echo '
'; while ($activity = $resultActivities->fetch()) { $timespan = getActivityTimespan($connection2, $activity['gibbonActivityID'], $activity['gibbonSchoolYearTermIDList']); $timeStatus = ''; @@ -119,7 +119,7 @@ echo ''; echo ''; - echo "'; echo ''; diff --git a/modules/Activities/report_attendance_byDate.php b/modules/Activities/report_attendance_byDate.php index 41785ba9ba..721874702b 100644 --- a/modules/Activities/report_attendance_byDate.php +++ b/modules/Activities/report_attendance_byDate.php @@ -45,7 +45,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Choose Date')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/report_attendance_byDate.php'); $form->addHiddenValue('address', $session->get('address')); diff --git a/modules/Activities/report_participants.php b/modules/Activities/report_participants.php index b3ab4db1cc..38cfbe7fc6 100644 --- a/modules/Activities/report_participants.php +++ b/modules/Activities/report_participants.php @@ -45,7 +45,7 @@ $form->setTitle(__('Choose Activity')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_participants.php"); diff --git a/modules/Admissions/admissions_manage.php b/modules/Admissions/admissions_manage.php index 111fe9f22a..895112ec55 100644 --- a/modules/Admissions/admissions_manage.php +++ b/modules/Admissions/admissions_manage.php @@ -37,7 +37,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php','get'); $form->setTitle(__('Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/admissions_manage.php'); diff --git a/modules/Admissions/applicationFormSelect.php b/modules/Admissions/applicationFormSelect.php index bedddd17db..73427f18c8 100644 --- a/modules/Admissions/applicationFormSelect.php +++ b/modules/Admissions/applicationFormSelect.php @@ -82,8 +82,7 @@ } // FORM - $form = Form::create('admissionsAccount', $session->get('absoluteURL').'/modules/Admissions/applicationFormSelectProcess.php'); - $form->setClass('w-full blank'); + $form = Form::createBlank('admissionsAccount', $session->get('absoluteURL').'/modules/Admissions/applicationFormSelectProcess.php'); $form->setTitle(__($welcomeHeading, ['organisationNameShort' => $session->get('organisationNameShort')])); $form->setDescription(__($welcomeText)); @@ -91,14 +90,14 @@ // Display all available public forms foreach ($forms as $index => $applicationForm) { - $table = $form->addRow()->addTable()->setClass('w-full noIntBorder border rounded my-2 bg-blue-100 mb-2'); + $table = $form->addRow()->addTable()->setClass('w-full noIntBorder border rounded my-2 bg-blue-50 mb-2'); $row = $table->addRow(); $row->addLabel('gibbonFormID'.$index, __($applicationForm['name']))->description($applicationForm['description'])->setClass('block w-full p-6 font-medium text-sm text-gray-700'); $row->addRadio('gibbonFormID')->setID('gibbonFormID'.$index)->fromArray([$applicationForm['gibbonFormID'] => ''])->addClass('mr-6')->checked($index == 0 ? $applicationForm['gibbonFormID'] : false); } - $table = $form->addRow()->addTable()->setClass('w-full noIntBorder border rounded my-2 bg-blue-100 mb-2'); + $table = $form->addRow()->addTable()->setClass('w-full noIntBorder border rounded my-2 bg-blue-50 mb-2'); $row = $table->addRow(); $row->addLabel('gibbonFormID'.count($forms), __('Continue an Existing Application Form'))->description(__('If you already have an application form in progress or would like to check the status of an application form, select this option. You will receive an email with a link to access your existing forms.'))->setClass('block w-full p-6 font-medium text-sm text-gray-700'); diff --git a/modules/Admissions/applicationFormView.php b/modules/Admissions/applicationFormView.php index 0ac24b95a1..0ae36b2e8c 100644 --- a/modules/Admissions/applicationFormView.php +++ b/modules/Admissions/applicationFormView.php @@ -185,20 +185,18 @@ } // FORM - $form = Form::create('admissionsAccount', $session->get('absoluteURL').'/index.php?q=/modules/Admissions/applicationForm.php'); + $form = Form::createBlank('admissionsAccount', $session->get('absoluteURL').'/index.php?q=/modules/Admissions/applicationForm.php'); $form->setTitle(__('New Application Form')); $form->setDescription((count($submissions) > 0 ? __('You may continue submitting applications with the form below and they will be linked to your account data.').' ' : '').__('Some information has been pre-filled for you, feel free to change this information as needed.')); - $form->setClass('w-full blank'); - $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('accessID', $account['accessID'] ?? ''); // Display all available public forms $firstForm = current($forms); foreach ($forms as $index => $applicationForm) { - $table = $form->addRow()->addTable()->setClass('w-full noIntBorder border rounded my-2 bg-blue-100 mb-2'); + $table = $form->addRow()->addTable()->setClass('w-full noIntBorder border rounded my-2 bg-blue-50 mb-2'); $row = $table->addRow(); $row->addLabel('gibbonFormID'.$index, __($applicationForm['name']))->description($applicationForm['description'])->setClass('block w-full p-6 font-medium text-sm text-gray-700'); diff --git a/modules/Admissions/applications_manage.php b/modules/Admissions/applications_manage.php index cd6b90b96a..d8254c5fc9 100644 --- a/modules/Admissions/applications_manage.php +++ b/modules/Admissions/applications_manage.php @@ -43,7 +43,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setTitle(__('Search')); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/applications_manage.php'); @@ -93,8 +93,7 @@ $table->addHeaderAction('forms', __('Form Builder')) ->setURL('/modules/System Admin/formBuilder.php') ->setIcon('markbook') - ->displayLabel() - ->append(' | '); + ->displayLabel(); } $table->addHeaderAction('add', __('Add')) @@ -199,14 +198,9 @@ ->addParam('search', $search) ->addParam('gibbonAdmissionsApplicationID') ->format(function ($application, $actions) { - if ($application['status'] == 'Pending' or $application['status'] == 'Waiting List') { - $actions->addAction('accept', __('Accept')) - ->setIcon('iconTick') - ->setURL('/modules/Admissions/applications_manage_accept.php'); - - $actions->addAction('reject', __('Reject')) - ->setIcon('iconCross') - ->setURL('/modules/Admissions/applications_manage_reject.php'); + if ($application['status'] != 'Incomplete') { + $actions->addAction('edit', __('Edit')) + ->setURL('/modules/Admissions/applications_manage_edit.php'); } if ($application['status'] == 'Incomplete' && empty($application['owner'])) { @@ -217,17 +211,22 @@ ->addParam('accessID', $application['accessID']) ->setIcon('page_right'); } + + if ($application['status'] == 'Pending' or $application['status'] == 'Waiting List') { + $actions->addAction('accept', __('Accept')) + ->setIcon('iconTick') + ->setURL('/modules/Admissions/applications_manage_accept.php'); + + $actions->addAction('reject', __('Reject')) + ->setIcon('iconCross') + ->setURL('/modules/Admissions/applications_manage_reject.php'); + } if ($application['status'] == 'Accepted' || $application['status'] == 'Incomplete') { $actions->addAction('view', __('View & Print Application')) ->setURL('/modules/Admissions/applications_manage_view.php'); } - if ($application['status'] != 'Incomplete') { - $actions->addAction('edit', __('Edit')) - ->setURL('/modules/Admissions/applications_manage_edit.php'); - } - $actions->addAction('delete', __('Delete')) ->setURL('/modules/Admissions/applications_manage_delete.php'); }); diff --git a/modules/Admissions/applications_manage_edit.php b/modules/Admissions/applications_manage_edit.php index 506d25ad58..fe1323dad4 100644 --- a/modules/Admissions/applications_manage_edit.php +++ b/modules/Admissions/applications_manage_edit.php @@ -43,7 +43,7 @@ // Proceed! $gibbonSchoolYearID = $_REQUEST['gibbonSchoolYearID'] ?? $session->get('gibbonSchoolYearID'); $search = $_REQUEST['search'] ?? ''; - $tab = $_REQUEST['tab'] ?? 0; + $tab = $_REQUEST['tab'] ?? 1; $page->breadcrumbs ->add(__('Manage Applications'), 'applications_manage.php', ['gibbonSchoolYearID' => $gibbonSchoolYearID, 'search' => $search]) @@ -200,18 +200,62 @@ } } + // Tabs + $tabs = []; + + $tabs['Overview'] = [ + 'label' => __('Overview'), + 'content' => $officeForm->getOutput(), + ]; + + if (!empty($milestonesForm)) { + $tabs['Milestones'] = [ + 'label' => __('Milestones'), + 'content' => $milestonesForm->getOutput(), + ]; + } + if (!empty($editForm)) { + $tabs['Application Form'] = [ + 'label' => __('Application Form'), + 'content' => $editForm->getOutput(), + ]; + } + + if (!empty($uploadsTable)) { + $tabs['Documents'] = [ + 'label' => __('Documents'), + 'content' => $uploadsTable->getOutput(), + ]; + } + + if (!empty($accountForm) || !empty($familyTable)) { + $tabs['Family'] = [ + 'label' => __('Family'), + 'content' => $accountForm->getOutput().$familyTable->getOutput(), + ]; + } + + if (!empty($processForm)) { + $tabs['Process'] = [ + 'label' => __('Process'), + 'content' => $processForm->getOutput(), + ]; + } + + if (!empty($resultsForm)) { + $tabs['Results'] = [ + 'label' => __('Results'), + 'content' => $resultsForm->getOutput(), + ]; + } + // Display the tabbed view - echo $page->fetchFromTemplate('applicationEdit.twig.html', [ - 'defaultTab' => $tab, - 'officeForm' => $officeForm, - 'editForm' => $editForm, - 'milestonesForm' => $milestonesForm ?? null, - 'accountForm' => $accountForm ?? null, - 'processForm' => $processForm ?? null, - 'resultsForm' => $resultsForm ?? null, - 'formsTable' => $formsTable ?? null, - 'uploadsTable' => $uploadsTable ?? null, - 'familyTable' => $familyTable ?? null, + echo $page->fetchFromTemplate('ui/tabs.twig.html', [ + 'selected' => $tab, + 'tabs' => $tabs, + 'class' => 'mt-6', + 'outset' => false, + 'icons' => false, ]); } diff --git a/modules/Admissions/applications_manage_view.php b/modules/Admissions/applications_manage_view.php index 4fe74073f3..60acb378c9 100644 --- a/modules/Admissions/applications_manage_view.php +++ b/modules/Admissions/applications_manage_view.php @@ -110,7 +110,6 @@ ->addParam('gibbonAdmissionsApplicationID', $gibbonAdmissionsApplicationID) ->addParam('format', 'export') ->setTarget('_blank') - ->prepend(' | ') ->directLink() ->displayLabel(); } diff --git a/modules/Admissions/forms_manage.php b/modules/Admissions/forms_manage.php index 46e74d6fb1..125e4222e4 100644 --- a/modules/Admissions/forms_manage.php +++ b/modules/Admissions/forms_manage.php @@ -40,7 +40,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php','get'); $form->setTitle(__('Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/forms_manage.php'); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); diff --git a/modules/Admissions/report_students_left.php b/modules/Admissions/report_students_left.php index 26b08edf75..e11b9bc58d 100644 --- a/modules/Admissions/report_students_left.php +++ b/modules/Admissions/report_students_left.php @@ -45,7 +45,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setTitle(__('Choose Options')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_students_left.php"); diff --git a/modules/Admissions/report_students_new.php b/modules/Admissions/report_students_new.php index f67b9a14e5..823357f8a7 100644 --- a/modules/Admissions/report_students_new.php +++ b/modules/Admissions/report_students_new.php @@ -45,7 +45,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setTitle(__('Choose Options')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_students_new.php"); diff --git a/modules/Admissions/src/Forms/ApplicationMilestonesForm.php b/modules/Admissions/src/Forms/ApplicationMilestonesForm.php index 8c5c8be968..89002f84a2 100644 --- a/modules/Admissions/src/Forms/ApplicationMilestonesForm.php +++ b/modules/Admissions/src/Forms/ApplicationMilestonesForm.php @@ -61,17 +61,14 @@ public function createForm($urlParams, $milestones) $milestonesData = json_decode($milestones ?? '', true); // Build the form - $form = Form::create('applicationMilestones', $action); + $form = Form::createBlank('applicationMilestones', $action); $form->addHiddenValue('address', $this->session->get('address')); $form->addHiddenValues($urlParams); $form->addHiddenValue('tab', 1); - $form->setClass('w-full blank'); - $col = $form->addRow()->addColumn(); - - $checkIcon = $this->view->fetchFromTemplate('ui/icons.twig.html', ['icon' => 'check', 'iconClass' => 'w-6 h-6 fill-current mr-3 -my-2']); - $crossIcon = $this->view->fetchFromTemplate('ui/icons.twig.html', ['icon' => 'cross', 'iconClass' => 'w-6 h-6 fill-current mr-3 -my-2']); + $checkIcon = icon('basic', 'check', 'milestoneCheck size-6 fill-current mr-3 -my-2 text-green-600'); + $crossIcon = icon('basic', 'cross', 'milestoneCross size-6 fill-current mr-3 -my-2 text-red-700'); foreach ($milestonesList as $index => $milestone) { $data = $milestonesData[$milestone] ?? []; @@ -82,14 +79,17 @@ public function createForm($urlParams, $milestones) $dateInfo = Format::dateReadable($milestonesData[$milestone]['date']).' '.__('By').' '.Format::name('', $user['preferredName'], $user['surname'], 'Staff', false, true); } - $description = '
'.$checkIcon.''.$crossIcon.''.__($milestone).'
'.$dateInfo.'
'; - $col->addCheckbox("milestones[{$milestone}]") + $row = $form->addRow()->addClass('milestoneInput flex justify-between items-center border rounded p-4 my-2 '. ($checked ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700')); + + $row->addContent($checked ? $checkIcon : $crossIcon)->setClass('w-12'); + $row->addContent(__($milestone))->addClass('flex-1 text-base font-medium'); + $row->addContent($dateInfo)->addClass('flex-1 text-xs'); + + $row->addCheckbox("milestones[{$milestone}]") ->setValue('Y') ->checked($checked ? 'Y' : 'N') - ->description($description) ->alignRight() - ->setLabelClass('w-full flex items-center') - ->addClass('milestoneInput border rounded p-4 my-2 '. ($checked ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700')); + ->setClass('w-24'); } $form->addRow()->addSubmit(); diff --git a/modules/Admissions/src/Tables/ApplicationUploadsTable.php b/modules/Admissions/src/Tables/ApplicationUploadsTable.php index 5a7a817d9d..bb163d3d7a 100644 --- a/modules/Admissions/src/Tables/ApplicationUploadsTable.php +++ b/modules/Admissions/src/Tables/ApplicationUploadsTable.php @@ -60,12 +60,16 @@ public function createTable($gibbonFormID, $gibbonAdmissionsApplicationID) ->addClass('h-12') ->format(function($values) { $filePath = $this->session->get('absolutePath').'/'.$values['path']; - $icon = !empty($values['path']) && (!is_file($filePath) || filesize($filePath) == 0) ? 'cross' : 'check'; - $iconRequired = $values['required'] == 'Y' ? 'cross' : 'question'; - return $this->view->fetchFromTemplate('ui/icons.twig.html', [ - 'icon' => empty($values['path']) ? $iconRequired : $icon, - 'iconClass' => 'w-6 h-6 text-gray-500 fill-current ml-2 -my-2' - ]); + $fileMissing = !empty($values['path']) && (!is_file($filePath) || filesize($filePath) == 0); + $iconClass = 'size-6 fill-current ml-2 -my-2'; + + if ($fileMissing || (empty($values['path']) && $values['required'] == 'Y')) { + return icon('solid', 'cross', $iconClass.' text-red-700'); + } elseif (empty($values['path']) && $values['required'] != 'Y') { + return icon('solid', 'question-mark', $iconClass.' text-gray-500'); + } else { + return icon('solid', 'check', $iconClass.' text-green-600'); + } }); $table->addColumn('name', __('Document')) ->format(function($values) { diff --git a/modules/Admissions/studentEnrolment_manage.php b/modules/Admissions/studentEnrolment_manage.php index a25a3f3066..db2827fbea 100644 --- a/modules/Admissions/studentEnrolment_manage.php +++ b/modules/Admissions/studentEnrolment_manage.php @@ -49,7 +49,7 @@ echo ''; $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php','get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/studentEnrolment_manage.php'); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); @@ -101,7 +101,7 @@ $table->addColumn('formGroup', __('Form Group')) ->description(__('Roll Order')) ->format(function($row) { - return $row['formGroup'] . (!empty($row['rollOrder']) ? '
'.$row['rollOrder'].'' : ''); + return $row['formGroup'] . (!empty($row['rollOrder']) ? '
'.$row['rollOrder'].'' : ''); }); $table->addActionColumn() diff --git a/modules/Admissions/templates/applicationEdit.twig.html b/modules/Admissions/templates/applicationEdit.twig.html deleted file mode 100644 index a93ea1edc1..0000000000 --- a/modules/Admissions/templates/applicationEdit.twig.html +++ /dev/null @@ -1,94 +0,0 @@ -
- - -
- {% if officeForm %} - {{ officeForm.getOutput | raw }} - {% endif %} -
- - {% if milestonesForm %} -
- {{ milestonesForm.getOutput | raw }} -
- {% endif %} - -
- {% if editForm %} - {{ editForm.getOutput | raw }} - {% endif %} -
- - {% if uploadsTable %} -
- {{ uploadsTable.getOutput | raw }} -
- {% endif %} - - {% if accountForm or familyTable %} -
- {{ accountForm.getOutput | raw }} - {{ familyTable.getOutput | raw }} -
- {% endif %} - - {% if processForm %} -
- {{ processForm.getOutput | raw }} -
- {% endif %} - - {% if resultsForm %} -
- {{ resultsForm.getOutput | raw }} -
- {% endif %} -
- - diff --git a/modules/Admissions/templates/requiredDocuments.twig.html b/modules/Admissions/templates/requiredDocuments.twig.html index e1d06f45a6..74c402148f 100644 --- a/modules/Admissions/templates/requiredDocuments.twig.html +++ b/modules/Admissions/templates/requiredDocuments.twig.html @@ -12,13 +12,13 @@ {% for document in documents %} {% if document.path %} - + {% else %} {% endif %}
- {{ include('ui/icons.twig.html', {'icon': 'file' }) }} + {{ icon('large', 'file', 'size-8 fill-current') }}
diff --git a/modules/Attendance/attendance.php b/modules/Attendance/attendance.php index d15e722c80..ed89615f3e 100644 --- a/modules/Attendance/attendance.php +++ b/modules/Attendance/attendance.php @@ -53,7 +53,7 @@ $form->setTitle(__('View Daily Attendance')); $form->setFactory(DatabaseFormFactory::create($pdo)); -$form->setClass('noIntBorder fullWidth'); +$form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/' . $session->get('module') . '/attendance.php'); diff --git a/modules/Attendance/attendance_future_byPerson.php b/modules/Attendance/attendance_future_byPerson.php index ce851633dd..fe0a436b6d 100644 --- a/modules/Attendance/attendance_future_byPerson.php +++ b/modules/Attendance/attendance_future_byPerson.php @@ -83,7 +83,7 @@ $form = Form::create('attendanceSearch',$session->get('absoluteURL') . '/index.php','GET'); $form->setTitle(__('Choose Student')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q','/modules/'.$session->get('module').'/attendance_future_byPerson.php'); diff --git a/modules/Attendance/attendance_take_adHoc.php b/modules/Attendance/attendance_take_adHoc.php index 0c4ef4ed5b..62a507a5bd 100644 --- a/modules/Attendance/attendance_take_adHoc.php +++ b/modules/Attendance/attendance_take_adHoc.php @@ -52,7 +52,7 @@ $form = Form::create('filter', $session->get('absoluteURL') . '/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Choose Students')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Attendance/attendance_take_adHoc.php'); @@ -223,18 +223,23 @@ $form->addRow()->addAlert(__('Total students:').' '. $count, 'success')->setClass('right')->wrap('', ''); - $row = $form->addRow(); - // Drop-downs to change the whole group at once - $row->addButton(__('Change All').'?')->addData('toggle', '.change-all')->addClass('w-32 m-px sm:self-center'); - - $col = $row->addColumn()->setClass('change-all hidden flex flex-col sm:flex-row items-stretch sm:items-center'); - $col->addSelect('set-all-type')->fromArray($attendance->getAttendanceTypes())->addClass('m-px'); - $col->addSelect('set-all-reason')->fromArray($attendance->getAttendanceReasons())->addClass('m-px'); - $col->addTextField('set-all-comment')->maxLength(255)->addClass('m-px'); - $col->addButton(__('Apply'))->setID('set-all'); - - $row->addSubmit(); + $row = $form->addRow()->setAttribute('x-data', "{'changeAll': false}"); + $row->addButton(__('Change All').'?') + ->setAttribute('@click', 'changeAll = !changeAll') + ->addClass('flex-shrink m-px sm:self-center'); + + $col = $row->addColumn() + ->setClass('flex-grow flex flex-col sm:flex-row items-stretch sm:items-center') + ->setAttribute('x-show', 'changeAll') + ->setAttribute('x-cloak'); + + $col->addSelect('set-all-type')->fromArray($attendance->getAttendanceTypes())->groupAlign('left'); + $col->addSelect('set-all-reason')->fromArray($attendance->getAttendanceReasons())->groupAlign('middle'); + $col->addTextField('set-all-comment')->maxLength(255)->setClass('w-36 -ml-px')->groupAlign('middle'); + $col->addButton(__('Apply'))->setID('set-all')->groupAlign('right')->setAttribute('@click', 'changeAll = false'); + + $row->addSubmit()->addClass('flex-shrink'); echo $form->getOutput(); diff --git a/modules/Attendance/attendance_take_byCourseClass.php b/modules/Attendance/attendance_take_byCourseClass.php index e779319e2b..cc1ccee989 100644 --- a/modules/Attendance/attendance_take_byCourseClass.php +++ b/modules/Attendance/attendance_take_byCourseClass.php @@ -77,7 +77,7 @@ $form = Form::create('filter', $session->get('absoluteURL') . '/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/' . $session->get('module') . '/attendance_take_byCourseClass.php'); @@ -347,15 +347,22 @@ $row = $form->addRow(); // Drop-downs to change the whole group at once - $row->addButton(__('Change All').'?')->addData('toggle', '.change-all')->addClass('w-32 m-px sm:self-center'); - - $col = $row->addColumn()->setClass('change-all hidden flex flex-col sm:flex-row items-stretch sm:items-center'); - $col->addSelect('set-all-type')->fromArray($attendance->getAttendanceTypes())->addClass('m-px'); - $col->addSelect('set-all-reason')->fromArray($attendance->getAttendanceReasons())->addClass('m-px'); - $col->addTextField('set-all-comment')->maxLength(255)->addClass('m-px'); - $col->addButton(__('Apply'))->setID('set-all'); + $row = $form->addRow()->setAttribute('x-data', "{'changeAll': false}"); + $row->addButton(__('Change All').'?') + ->setAttribute('@click', 'changeAll = !changeAll') + ->addClass('flex-shrink m-px sm:self-center'); + + $col = $row->addColumn() + ->setClass('flex-grow flex flex-col sm:flex-row items-stretch sm:items-center') + ->setAttribute('x-show', 'changeAll') + ->setAttribute('x-cloak'); + + $col->addSelect('set-all-type')->fromArray($attendance->getAttendanceTypes())->groupAlign('left'); + $col->addSelect('set-all-reason')->fromArray($attendance->getAttendanceReasons())->groupAlign('middle'); + $col->addTextField('set-all-comment')->maxLength(255)->setClass('w-36 -ml-px')->groupAlign('middle'); + $col->addButton(__('Apply'))->setID('set-all')->groupAlign('right')->setAttribute('@click', 'changeAll = false'); - $row->addSubmit(); + $row->addSubmit()->addClass('flex-shrink'); echo $form->getOutput(); } diff --git a/modules/Attendance/attendance_take_byFormGroup.php b/modules/Attendance/attendance_take_byFormGroup.php index 7fe0bc2df1..ff8ed10593 100644 --- a/modules/Attendance/attendance_take_byFormGroup.php +++ b/modules/Attendance/attendance_take_byFormGroup.php @@ -68,7 +68,7 @@ $form = Form::create('filter', $session->get('absoluteURL') . '/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Attendance/attendance_take_byFormGroup.php'); @@ -260,15 +260,22 @@ $row = $form->addRow(); // Drop-downs to change the whole group at once - $row->addButton(__('Change All').'?')->addData('toggle', '.change-all')->addClass('w-32 m-px sm:self-center'); - - $col = $row->addColumn()->setClass('change-all hidden flex flex-col sm:flex-row items-stretch sm:items-center'); - $col->addSelect('set-all-type')->fromArray($attendance->getAttendanceTypes())->addClass('m-px'); - $col->addSelect('set-all-reason')->fromArray($attendance->getAttendanceReasons())->addClass('m-px'); - $col->addTextField('set-all-comment')->maxLength(255)->addClass('m-px'); - $col->addButton(__('Apply'))->setID('set-all'); - - $row->addSubmit(); + $row = $form->addRow()->setAttribute('x-data', "{'changeAll': false}"); + $row->addButton(__('Change All').'?') + ->setAttribute('@click', 'changeAll = !changeAll') + ->addClass('flex-shrink m-px sm:self-center'); + + $col = $row->addColumn() + ->setClass('flex-grow flex flex-col sm:flex-row items-stretch sm:items-center') + ->setAttribute('x-show', 'changeAll') + ->setAttribute('x-cloak'); + + $col->addSelect('set-all-type')->fromArray($attendance->getAttendanceTypes())->groupAlign('left'); + $col->addSelect('set-all-reason')->fromArray($attendance->getAttendanceReasons())->groupAlign('middle'); + $col->addTextField('set-all-comment')->maxLength(255)->setClass('w-36 -ml-px')->groupAlign('middle'); + $col->addButton(__('Apply'))->setID('set-all')->groupAlign('right')->setAttribute('@click', 'changeAll = false'); + + $row->addSubmit()->addClass('flex-shrink'); echo $form->getOutput(); } diff --git a/modules/Attendance/attendance_take_byPerson.php b/modules/Attendance/attendance_take_byPerson.php index b7fbedf7f4..96b05b8a72 100644 --- a/modules/Attendance/attendance_take_byPerson.php +++ b/modules/Attendance/attendance_take_byPerson.php @@ -51,7 +51,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setTitle(__('Choose Student')); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/attendance_take_byPerson.php'); diff --git a/modules/Attendance/css/module.css b/modules/Attendance/css/module.css index 0297280ba6..9331f6934f 100644 --- a/modules/Attendance/css/module.css +++ b/modules/Attendance/css/module.css @@ -116,7 +116,7 @@ td.center { .dayPartial { color: #d45602; - background: #ffd2a8 !important; + background: #ffedd5 !important; } .dayPartial { @@ -136,7 +136,7 @@ td.center { .highlightMessage, .dayMessage { color: #3B73AF; - background: #D0EAFD !important; + background: #DDF0FD !important; } .dayMessage, table.smallIntBorder td.dayMessage { diff --git a/modules/Attendance/report_consecutiveAbsences.php b/modules/Attendance/report_consecutiveAbsences.php index cf20ebf9c7..19bcbcc257 100644 --- a/modules/Attendance/report_consecutiveAbsences.php +++ b/modules/Attendance/report_consecutiveAbsences.php @@ -44,7 +44,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setTitle(__('Filter')); diff --git a/modules/Attendance/report_courseClassesNotRegistered_byDate.php b/modules/Attendance/report_courseClassesNotRegistered_byDate.php index 0c4715e891..65f5914908 100644 --- a/modules/Attendance/report_courseClassesNotRegistered_byDate.php +++ b/modules/Attendance/report_courseClassesNotRegistered_byDate.php @@ -73,7 +73,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_courseClassesNotRegistered_byDate.php"); @@ -147,7 +147,7 @@ echo "get('module').'/report_courseClassesNotRegistered_byDate_print.php&dateStart='.Format::date($dateStart).'&dateEnd='.Format::date($dateEnd)."'>".__('Print').""; echo '
'; - echo "
'; if (!empty($timeStatus)) { - echo ''; + echo ''; echo (time() < $timespan['start'])? __('Upcoming') : (time() > $timespan['end']? __('Ended') : __('Current')); echo ''; } else { diff --git a/modules/Activities/report_activityChoices_byStudent.php b/modules/Activities/report_activityChoices_byStudent.php index 4800e578ca..987f2ad257 100644 --- a/modules/Activities/report_activityChoices_byStudent.php +++ b/modules/Activities/report_activityChoices_byStudent.php @@ -41,7 +41,7 @@ $form = Form::create('action', $session->get('absoluteURL')."/index.php", "get"); $form->setTitle(__('Choose Student')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_activityChoices_byStudent.php"); diff --git a/modules/Activities/report_activityEnrollmentSummary.php b/modules/Activities/report_activityEnrollmentSummary.php index 9703c43213..06c794c979 100644 --- a/modules/Activities/report_activityEnrollmentSummary.php +++ b/modules/Activities/report_activityEnrollmentSummary.php @@ -77,7 +77,7 @@ $table->addColumn('name', __('Activity')) ->format(function($activity) { - return $activity['name'].'
'.$activity['type'].''; + return $activity['name'].'
'.$activity['type'].''; }); $table->addColumn('enrolment', __('Accepted'))->width('20%'); $table->addColumn('registered', __('Registered'))->description(__('Excludes "Not Accepted"'))->width('20%'); diff --git a/modules/Activities/report_activitySpread_formGroup.php b/modules/Activities/report_activitySpread_formGroup.php index 92b34363c7..c35c58f39b 100644 --- a/modules/Activities/report_activitySpread_formGroup.php +++ b/modules/Activities/report_activitySpread_formGroup.php @@ -51,7 +51,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_activitySpread_formGroup.php"); diff --git a/modules/Activities/report_activityType_formGroup.php b/modules/Activities/report_activityType_formGroup.php index 4906a7b589..e30478c330 100644 --- a/modules/Activities/report_activityType_formGroup.php +++ b/modules/Activities/report_activityType_formGroup.php @@ -52,7 +52,7 @@ $form->setTitle(__('Choose Form Group')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_activityType_formGroup.php"); diff --git a/modules/Activities/report_attendance.php b/modules/Activities/report_attendance.php index 35dc44078e..2a6fa62656 100644 --- a/modules/Activities/report_attendance.php +++ b/modules/Activities/report_attendance.php @@ -46,7 +46,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_attendance.php"); @@ -194,7 +194,7 @@ echo '
'; echo __('Attendance'); echo '"; + echo ""; printf(__('Sessions Recorded: %s of %s'), count($sessionAttendanceData), count($activitySessions)); echo '
"; + echo "
"; echo ""; echo '
'; echo __('Class'); diff --git a/modules/Attendance/report_courseClassesNotRegistered_byDate_print.php b/modules/Attendance/report_courseClassesNotRegistered_byDate_print.php index 7766bd6aec..9eef0ff84a 100644 --- a/modules/Attendance/report_courseClassesNotRegistered_byDate_print.php +++ b/modules/Attendance/report_courseClassesNotRegistered_byDate_print.php @@ -103,7 +103,7 @@ echo "".__('Print').""; echo ''; - echo ""; + echo "
"; echo ""; echo '
'; echo __('Class'); diff --git a/modules/Attendance/report_formGroupsNotRegistered_byDate.php b/modules/Attendance/report_formGroupsNotRegistered_byDate.php index d24e726428..49a525ba16 100644 --- a/modules/Attendance/report_formGroupsNotRegistered_byDate.php +++ b/modules/Attendance/report_formGroupsNotRegistered_byDate.php @@ -74,7 +74,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_formGroupsNotRegistered_byDate.php"); diff --git a/modules/Attendance/report_graph_byType.php b/modules/Attendance/report_graph_byType.php index 8d3881edad..0098edc02c 100644 --- a/modules/Attendance/report_graph_byType.php +++ b/modules/Attendance/report_graph_byType.php @@ -84,7 +84,7 @@ // Options & Filters $form = Form::create('attendanceTrends', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/report_graph_byType.php'); $form->setTitle(__('Choose Date')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); @@ -125,7 +125,7 @@ echo __('Report Data'); echo ''; - echo '

'.__('Click a legend item to toggle visibility.').'

'; + echo '

'.__('Click a legend item to toggle visibility.').'

'; //Produce array of attendance data $attendanceLogGateway = $container->get(AttendanceLogPersonGateway::class); diff --git a/modules/Attendance/report_studentHistory.php b/modules/Attendance/report_studentHistory.php index 026a7fa11a..8feb2a6bb4 100644 --- a/modules/Attendance/report_studentHistory.php +++ b/modules/Attendance/report_studentHistory.php @@ -54,7 +54,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setTitle(__('Choose Student')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_studentHistory.php"); @@ -154,7 +154,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setTitle(__('Choose')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_studentHistory.php"); diff --git a/modules/Attendance/report_studentsNotInClass_byDate.php b/modules/Attendance/report_studentsNotInClass_byDate.php index 24eb7941f7..2d40a0731d 100644 --- a/modules/Attendance/report_studentsNotInClass_byDate.php +++ b/modules/Attendance/report_studentsNotInClass_byDate.php @@ -50,7 +50,7 @@ $form->setTitle(__('Choose Date')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_studentsNotInClass_byDate.php"); diff --git a/modules/Attendance/report_studentsNotOnsite_byDate.php b/modules/Attendance/report_studentsNotOnsite_byDate.php index 25f3a5340c..b555c23682 100644 --- a/modules/Attendance/report_studentsNotOnsite_byDate.php +++ b/modules/Attendance/report_studentsNotOnsite_byDate.php @@ -51,7 +51,7 @@ $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Choose Date')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/" . $session->get('module') . "/report_studentsNotOnsite_byDate.php"); diff --git a/modules/Attendance/report_studentsNotPresent_byDate.php b/modules/Attendance/report_studentsNotPresent_byDate.php index f23c8ad9e9..3bc562bb33 100644 --- a/modules/Attendance/report_studentsNotPresent_byDate.php +++ b/modules/Attendance/report_studentsNotPresent_byDate.php @@ -51,7 +51,7 @@ $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Choose Date')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/" . $session->get('module') . "/report_studentsNotPresent_byDate.php"); diff --git a/modules/Attendance/report_summary_byDate.php b/modules/Attendance/report_summary_byDate.php index 340174bd79..33db748c89 100644 --- a/modules/Attendance/report_summary_byDate.php +++ b/modules/Attendance/report_summary_byDate.php @@ -74,7 +74,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_summary_byDate.php"); @@ -300,7 +300,7 @@ // echo "get('module').'/report_summary_byDate_print.php&dateStart='.Format::date($dateStart).'&dateEnd='.Format::date($dateEnd).'&gibbonCourseClassID='.$gibbonCourseClassID.'&gibbonFormGroupID='.$gibbonFormGroupID.'&gibbonAttendanceCodeID='. $gibbonAttendanceCodeID .'&group=' . $group . '&sort=' . $sort . "'>".__('Print').""; // echo ''; - echo ''; + echo '
'; echo ""; echo '
'; diff --git a/modules/Behaviour/behaviour_letters.php b/modules/Behaviour/behaviour_letters.php index 5d0d8e3557..7cc929af33 100644 --- a/modules/Behaviour/behaviour_letters.php +++ b/modules/Behaviour/behaviour_letters.php @@ -36,9 +36,9 @@ $gibbonPersonID = $_GET['gibbonPersonID'] ?? ''; - $form = Form::create('filter', $session->get('absoluteURL')."/index.php", 'get', 'noIntBorder fullWidth standardForm'); + $form = Form::create('filter', $session->get('absoluteURL')."/index.php", 'get', 'noIntBorder w-full standardForm'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Behaviour/behaviour_letters.php'); $form->setFactory(DatabaseFormFactory::create($pdo)); diff --git a/modules/Behaviour/behaviour_manage.php b/modules/Behaviour/behaviour_manage.php index fd21cf66cd..5998edd10a 100644 --- a/modules/Behaviour/behaviour_manage.php +++ b/modules/Behaviour/behaviour_manage.php @@ -50,13 +50,9 @@ $gibbonYearGroupID = $_GET['gibbonYearGroupID'] ?? ''; $type = $_GET['type'] ?? ''; - $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); - $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form = Form::createSearch(); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->addHiddenValue('q', "/modules/Behaviour/behaviour_manage.php"); - $row = $form->addRow(); $row->addLabel('gibbonPersonID',__('Student')); $row->addSelectStudent('gibbonPersonID', $session->get('gibbonSchoolYearID'))->selected($gibbonPersonID)->placeholder(); @@ -79,8 +75,7 @@ $row->addSelect('type')->fromArray($arrTypes)->selected($type)->placeholder(); - $row = $form->addRow(); - $row->addSearchSubmit($session, __('Clear Filters')); + $row = $form->addRow()->addSearchSubmit($session, __('Clear Filters')); echo $form->getOutput(); @@ -122,8 +117,7 @@ ->addParam('gibbonFormGroupID', $gibbonFormGroupID) ->addParam('gibbonYearGroupID', $gibbonYearGroupID) ->addParam('type', $type) - ->displayLabel() - ->append(' | '); + ->displayLabel(); $table->addHeaderAction('addMultiple', __('Add Multiple')) ->setURL('/modules/Behaviour/behaviour_manage_addMulti.php') @@ -137,21 +131,20 @@ if (!empty($policyLink)) { $table->addHeaderAction('policy', __('View Behaviour Policy')) ->setExternalURL($policyLink) - ->displayLabel() - ->prepend(' | '); + ->displayLabel(); } $table->addExpandableColumn('comment') ->format(function($beahviour) { $output = ''; if (!empty($beahviour['comment'])) { - $output .= ''.__('Incident').'
'; + $output .= Format::bold(__('Incident')).'
'; $output .= nl2br($beahviour['comment']).'
'; } if (!empty($beahviour['followUps'])) { foreach ($beahviour['followUps'] as $followUp) { - $output .= '
'.__('Follow Up By ').$followUp['firstName']._(' ').$followUp['surname'].'
'; + $output .= '
'.Format::bold(__('Follow Up By ').$followUp['firstName']._(' ').$followUp['surname']).'
'; $output .= nl2br($followUp['followUp']).'
'; } } @@ -182,11 +175,11 @@ $table->addColumn('type', __('Type')) ->context('secondary') ->width('5%') - ->format(function($beahviour) use ($session) { + ->format(function($beahviour) { if ($beahviour['type'] == 'Negative') { - return " "; + return icon('solid', 'cross', 'size-6 fill-current text-red-700'); } elseif ($beahviour['type'] == 'Positive') { - return " "; + return icon('solid', 'check', 'size-6 fill-current text-green-600'); } }); diff --git a/modules/Behaviour/behaviour_manage_add.php b/modules/Behaviour/behaviour_manage_add.php index 7c475762c4..16804cf9f5 100644 --- a/modules/Behaviour/behaviour_manage_add.php +++ b/modules/Behaviour/behaviour_manage_add.php @@ -78,7 +78,9 @@ $policyLink = $settingGateway->getSettingByScope('Behaviour', 'policyLink'); if (!empty($policyLink)) { $form->addHeaderAction('viewPolicy', __('View Behaviour Policy')) - ->setExternalURL($policyLink); + ->setExternalURL($policyLink) + ->setIcon('document') + ->displayLabel(); } if (!empty($gibbonPersonID) or !empty($gibbonFormGroupID) or !empty($gibbonYearGroupID) or !empty($type)) { $form->addHeaderAction('back', __('Back to Search Results')) @@ -88,8 +90,7 @@ ->addParam('gibbonPersonID', $_GET['gibbonPersonID']) ->addParam('gibbonFormGroupID', $_GET['gibbonFormGroupID']) ->addParam('gibbonYearGroupID', $_GET['gibbonYearGroupID']) - ->addParam('type', $_GET['type']) - ->prepend((!empty($policyLink)) ? ' | ' : ''); + ->addParam('type', $_GET['type']); } $form->addHiddenValue('address', "/modules/Behaviour/behaviour_manage_add.php"); @@ -148,13 +149,13 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('comment', __('Incident')); - $column->addTextArea('comment')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('comment')->setRows(5)->setClass('w-full'); //Follow Up $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('followup', __('Follow Up')); - $column->addTextArea('followUp')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('followUp')->setRows(5)->setClass('w-full'); // CUSTOM FIELDS $container->get(CustomFieldHandler::class)->addCustomFieldsToForm($form, 'Behaviour', []); diff --git a/modules/Behaviour/behaviour_manage_addMulti.php b/modules/Behaviour/behaviour_manage_addMulti.php index 024b4c5068..ce2504282a 100644 --- a/modules/Behaviour/behaviour_manage_addMulti.php +++ b/modules/Behaviour/behaviour_manage_addMulti.php @@ -59,7 +59,9 @@ $policyLink = $settingGateway->getSettingByScope('Behaviour', 'policyLink'); if (!empty($policyLink)) { $form->addHeaderAction('viewPolicy', __('View Behaviour Policy')) - ->setExternalURL($policyLink); + ->setExternalURL($policyLink) + ->setIcon('document') + ->displayLabel(); } if (!empty($gibbonPersonID) or !empty($gibbonFormGroupID) or !empty($gibbonYearGroupID) or !empty($type)) { $form->addHeaderAction('back', __('Back to Search Results')) @@ -69,8 +71,7 @@ ->addParam('gibbonPersonID', $_GET['gibbonPersonID']) ->addParam('gibbonFormGroupID', $_GET['gibbonFormGroupID']) ->addParam('gibbonYearGroupID', $_GET['gibbonYearGroupID']) - ->addParam('type', $_GET['type']) - ->prepend((!empty($policyLink)) ? ' | ' : ''); + ->addParam('type', $_GET['type']); } //Student @@ -146,7 +147,7 @@ $col->addLabel('comment', __('Incident')); $col->addTextArea('comment') ->setRows(5) - ->setClass('fullWidth'); + ->setClass('w-full'); //Follow Up $row = $form->addRow(); @@ -154,7 +155,7 @@ $col->addLabel('followup', __('Follow Up')); $col->addTextArea('followUp') ->setRows(5) - ->setClass('fullWidth'); + ->setClass('w-full'); // CUSTOM FIELDS $container->get(CustomFieldHandler::class)->addCustomFieldsToForm($form, 'Behaviour', []); diff --git a/modules/Behaviour/behaviour_manage_edit.php b/modules/Behaviour/behaviour_manage_edit.php index a1e1d8fe85..8612bbf13b 100644 --- a/modules/Behaviour/behaviour_manage_edit.php +++ b/modules/Behaviour/behaviour_manage_edit.php @@ -104,8 +104,7 @@ $form->addHeaderAction('view', __('View Behaviour Records')) ->setURL('/modules/Behaviour/behaviour_view_details.php') ->displayLabel() - ->addParam('gibbonPersonID', $gibbonPersonID) - ->prepend('  |  '); + ->addParam('gibbonPersonID', $gibbonPersonID); } $form->addHiddenValue('address', "/modules/Behaviour/behaviour_manage_add.php"); @@ -186,7 +185,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('comment', __('Incident')); - $column->addTextArea('comment')->setRows(5)->setClass('fullWidth')->setValue($values['comment']); + $column->addTextArea('comment')->setRows(5)->setClass('w-full')->setValue($values['comment']); } else { $row = $form->addRow(); @@ -225,7 +224,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('followUp', (empty($logs) ? __('Follow Up') : __('Further Follow Up'))); - $column->addTextArea('followUp')->setRows(8)->setClass('fullWidth'); + $column->addTextArea('followUp')->setRows(8)->setClass('w-full'); //Lesson link $lessons = array(); diff --git a/modules/Behaviour/behaviour_pattern.php b/modules/Behaviour/behaviour_pattern.php index a58d601f2c..1ce230889c 100644 --- a/modules/Behaviour/behaviour_pattern.php +++ b/modules/Behaviour/behaviour_pattern.php @@ -54,7 +54,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('q', "/modules/Behaviour/behaviour_pattern.php"); diff --git a/modules/Behaviour/behaviour_view.php b/modules/Behaviour/behaviour_view.php index 3add9e5a97..c97ddfb58c 100644 --- a/modules/Behaviour/behaviour_view.php +++ b/modules/Behaviour/behaviour_view.php @@ -42,7 +42,7 @@ if ($highestAction == 'View Behaviour Records_all' || $highestAction == 'View Behaviour Records_my') { $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Behaviour/behaviour_view.php'); $row = $form->addRow(); diff --git a/modules/Behaviour/moduleFunctions.php b/modules/Behaviour/moduleFunctions.php index 954b10cc2b..be5890476a 100644 --- a/modules/Behaviour/moduleFunctions.php +++ b/modules/Behaviour/moduleFunctions.php @@ -78,8 +78,8 @@ function getBehaviourRecord(ContainerInterface $container, $gibbonPersonID, $gib if (!empty($policyLink)) { $table->addHeaderAction('policy', __('View Behaviour Policy')) ->setExternalURL($policyLink) - ->displayLabel() - ->prepend(' | '); + ->setIcon('document') + ->displayLabel(); } } @@ -115,9 +115,9 @@ function getBehaviourRecord(ContainerInterface $container, $gibbonPersonID, $gib ->width('5%') ->format(function($behaviour) use ($session) { if ($behaviour['type'] == 'Negative') { - return " "; + return icon('solid', 'cross', 'size-6 fill-current text-red-700'); } elseif ($behaviour['type'] == 'Positive') { - return " "; + return icon('solid', 'check', 'size-6 fill-current text-green-600'); } }); diff --git a/modules/Data Updater/data_family_manage.php b/modules/Data Updater/data_family_manage.php index edf8845fb8..5ca60617d1 100644 --- a/modules/Data Updater/data_family_manage.php +++ b/modules/Data Updater/data_family_manage.php @@ -51,7 +51,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Data Updater/data_family_manage.php'); diff --git a/modules/Data Updater/data_family_manage_edit.php b/modules/Data Updater/data_family_manage_edit.php index d6914770b6..6a22e56859 100644 --- a/modules/Data Updater/data_family_manage_edit.php +++ b/modules/Data Updater/data_family_manage_edit.php @@ -81,7 +81,7 @@ $form = Form::createTable('updateFamily', $session->get('absoluteURL').'/modules/'.$session->get('module').'/data_family_manage_editProcess.php?gibbonFamilyUpdateID='.$gibbonFamilyUpdateID); - $form->setClass('fullWidth colorOddEven'); + $form->setClass('w-full colorOddEven'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonFamilyID', $oldValues['gibbonFamilyID']); diff --git a/modules/Data Updater/data_finance_manage.php b/modules/Data Updater/data_finance_manage.php index 1823f2cfb1..d2b9d2bbeb 100644 --- a/modules/Data Updater/data_finance_manage.php +++ b/modules/Data Updater/data_finance_manage.php @@ -51,7 +51,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Data Updater/data_finance_manage.php'); diff --git a/modules/Data Updater/data_finance_manage_edit.php b/modules/Data Updater/data_finance_manage_edit.php index 1073d2ce24..036db94ef1 100644 --- a/modules/Data Updater/data_finance_manage_edit.php +++ b/modules/Data Updater/data_finance_manage_edit.php @@ -88,7 +88,7 @@ $form = Form::createTable('updateFinance', $session->get('absoluteURL').'/modules/'.$session->get('module').'/data_finance_manage_editProcess.php?gibbonFinanceInvoiceeUpdateID='.$gibbonFinanceInvoiceeUpdateID); - $form->setClass('fullWidth colorOddEven'); + $form->setClass('w-full colorOddEven'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonFinanceInvoiceeID', $oldValues['gibbonFinanceInvoiceeID']); diff --git a/modules/Data Updater/data_medical_manage.php b/modules/Data Updater/data_medical_manage.php index 03ee10003e..f7a6c5f19d 100644 --- a/modules/Data Updater/data_medical_manage.php +++ b/modules/Data Updater/data_medical_manage.php @@ -51,7 +51,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Data Updater/data_medical_manage.php'); diff --git a/modules/Data Updater/data_medical_manage_edit.php b/modules/Data Updater/data_medical_manage_edit.php index d89422e882..02eb6747ab 100644 --- a/modules/Data Updater/data_medical_manage_edit.php +++ b/modules/Data Updater/data_medical_manage_edit.php @@ -106,7 +106,7 @@ $form = Form::createTable('updateMedical', $session->get('absoluteURL').'/modules/'.$session->get('module').'/data_medical_manage_editProcess.php?gibbonPersonMedicalUpdateID='.$gibbonPersonMedicalUpdateID); - $form->setClass('fullWidth colorOddEven'); + $form->setClass('w-full colorOddEven'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonPersonID', $newValues['gibbonPersonID']); $form->addHiddenValue('formExists', !empty($oldValues['gibbonPersonMedicalID'])); diff --git a/modules/Data Updater/data_personal.php b/modules/Data Updater/data_personal.php index 84218979c5..fe7ed33f0e 100644 --- a/modules/Data Updater/data_personal.php +++ b/modules/Data Updater/data_personal.php @@ -397,12 +397,11 @@ $row = $form->addRow()->onlyIf($isVisible('address1')); $row->addLabel('showAddresses', __('Enter Personal Address?')); - $row->addCheckbox('showAddresses') - ->setValue('Yes') - ->checked($addressSet) + $row->addYesNo('showAddresses') + ->setValue($addressSet ?? 'N') ->setDisabled(isset($requiredFields['address1']) && $requiredFields['address1'] == 'readonly'); - $form->toggleVisibilityByClass('address')->onCheckbox('showAddresses')->when('Yes'); + $form->toggleVisibilityByClass('address')->onClick('showAddresses')->when('Y'); $row = $form->addRow()->onlyIf($isVisible('address1'))->addClass('address'); $row->addAlert(__('Address information for an individual only needs to be set under the following conditions:'), 'warning') @@ -450,7 +449,7 @@ $adressee = Format::name($rowAddress['title'], $rowAddress['preferredName'], $rowAddress['surname'], $rowAddress['category']).' ('.$rowAddress['category'].')'; $row = $table->addRow()->addClass('address'); - $row->addTextField($addressCount.'-matchAddressLabel')->readOnly()->setValue($adressee)->setClass('fullWidth'); + $row->addTextField($addressCount.'-matchAddressLabel')->readOnly()->setValue($adressee)->setClass('w-full'); $row->addCheckbox($addressCount.'-matchAddress')->setValue($rowAddress['gibbonPersonID']); $addressCount++; diff --git a/modules/Data Updater/data_personal_manage.php b/modules/Data Updater/data_personal_manage.php index cd93e2685b..8b79a8d9f0 100644 --- a/modules/Data Updater/data_personal_manage.php +++ b/modules/Data Updater/data_personal_manage.php @@ -51,7 +51,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Data Updater/data_personal_manage.php'); diff --git a/modules/Data Updater/data_personal_manage_edit.php b/modules/Data Updater/data_personal_manage_edit.php index 14bc0c7511..7169ec24f0 100644 --- a/modules/Data Updater/data_personal_manage_edit.php +++ b/modules/Data Updater/data_personal_manage_edit.php @@ -161,7 +161,7 @@ $form = Form::createTable('updatePerson', $session->get('absoluteURL').'/modules/'.$session->get('module').'/data_personal_manage_editProcess.php?gibbonPersonUpdateID='.$gibbonPersonUpdateID); - $form->setClass('fullWidth colorOddEven'); + $form->setClass('w-full colorOddEven'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonPersonID', $oldValues['gibbonPersonID']); diff --git a/modules/Data Updater/data_staff_manage.php b/modules/Data Updater/data_staff_manage.php index d876ad6d9f..16cf5b3a88 100644 --- a/modules/Data Updater/data_staff_manage.php +++ b/modules/Data Updater/data_staff_manage.php @@ -51,7 +51,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Data Updater/data_staff_manage.php'); diff --git a/modules/Data Updater/data_staff_manage_edit.php b/modules/Data Updater/data_staff_manage_edit.php index 263a97323d..f5cd2ccca4 100644 --- a/modules/Data Updater/data_staff_manage_edit.php +++ b/modules/Data Updater/data_staff_manage_edit.php @@ -73,7 +73,7 @@ $form = Form::createTable('updateStaff', $session->get('absoluteURL').'/modules/'.$session->get('module').'/data_staff_manage_editProcess.php?gibbonStaffUpdateID='.$gibbonStaffUpdateID); - $form->setClass('fullWidth colorOddEven'); + $form->setClass('w-full colorOddEven'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonStaffID', $oldValues['gibbonStaffID']); diff --git a/modules/Data Updater/report_family_dataUpdaterHistory.php b/modules/Data Updater/report_family_dataUpdaterHistory.php index b9d564f29b..235d3f8059 100644 --- a/modules/Data Updater/report_family_dataUpdaterHistory.php +++ b/modules/Data Updater/report_family_dataUpdaterHistory.php @@ -145,7 +145,7 @@ $table->addColumn('familyAdults', __('Adults')) ->notSortable() ->format(function($row) use ($dataChecker, $requiredUpdatesByType) { - $output = ''; + $output = '
'; foreach ($row['familyAdults'] as $adult) { $output .= ''; $output .= ''; @@ -161,7 +161,7 @@ $table->addColumn('familyChildren', __('Children')) ->notSortable() ->format(function($row) use ($dataChecker, $requiredUpdatesByType) { - $output = '
'.Format::name($adult['title'], $adult['preferredName'], $adult['surname'], 'Parent').'
'; + $output = '
'; foreach ($row['familyChildren'] as $child) { $output .= ''; $output .= ''; diff --git a/modules/Departments/department.php b/modules/Departments/department.php index 3d4a59a461..fd4ddcef72 100644 --- a/modules/Departments/department.php +++ b/modules/Departments/department.php @@ -94,7 +94,7 @@ $gridRenderer = new GridView($container->get('twig')); $table = $container->get(DataTable::class)->setRenderer($gridRenderer); $table->setTitle(__('Staff')); - $table->addMetaData('gridClass', 'rounded-sm bg-blue-100 border py-2'); + $table->addMetaData('gridClass', 'rounded-sm bg-blue-50 border py-2'); $table->addMetaData('gridItemClass', 'w-1/2 sm:w-1/4 md:w-1/5 my-2 text-center'); $canViewProfile = isActionAccessible($guid, $connection2, '/modules/Staff/staff_view_details.php'); diff --git a/modules/Departments/department_course_class.php b/modules/Departments/department_course_class.php index 8e2b6fcede..e9474c7528 100644 --- a/modules/Departments/department_course_class.php +++ b/modules/Departments/department_course_class.php @@ -98,7 +98,7 @@ $menuItems[] = [ 'name' => __('Attendance'), 'url' => './index.php?q=/modules/Attendance/attendance_take_byCourseClass.php&gibbonCourseClassID='.$gibbonCourseClassID.'¤tDate='.$currentDate, - 'icon' => 'attendance_large.png', + 'icon' => 'users', ]; } // Planner @@ -106,7 +106,7 @@ $menuItems[] = [ 'name' => __('Planner'), 'url' => './index.php?q=/modules/Planner/planner.php&gibbonCourseClassID='.$gibbonCourseClassID.'&viewBy=class', - 'icon' => 'planner_large.png', + 'icon' => 'calendar', ]; } // Markbook @@ -114,7 +114,7 @@ $menuItems[] = [ 'name' => __('Markbook'), 'url' => './index.php?q=/modules/Markbook/markbook_view.php&gibbonCourseClassID='.$gibbonCourseClassID, - 'icon' => 'markbook_large.png', + 'icon' => 'markbook', ]; } // Homework @@ -123,7 +123,7 @@ $menuItems[] = [ 'name' => __($homeworkNamePlural), 'url' => './index.php?q=/modules/Planner/planner_deadlines.php&gibbonCourseClassIDFilter='.$gibbonCourseClassID, - 'icon' => 'homework_large.png', + 'icon' => 'homework', ]; } // Internal Assessment @@ -131,10 +131,10 @@ $menuItems[] = [ 'name' => __('Internal Assessment'), 'url' => './index.php?q=/modules/Formal Assessment/internalAssessment_write.php&gibbonCourseClassID='.$gibbonCourseClassID, - 'icon' => 'internalAssessment_large.png', + 'icon' => 'internal-assessment', ]; } - + // Menu Items Table if (!empty($menuItems)) { $gridRenderer = new GridView($container->get('twig')); @@ -142,21 +142,19 @@ $table->setTitle($row['courseLong']." - ".$row['classLong']); $table->setDescription(Format::courseClassName($row['course'], $row['class'])); - $table->addMetaData('gridClass', 'rounded-sm bg-gray-100 border py-2'); - $table->addMetaData('gridItemClass', 'w-1/2 sm:w-1/3 p-4 text-center'); + $table->addMetaData('gridClass', 'rounded-md bg-gray-100 border py-4 gap-6 sm:flex-nowrap justify-around'); + $table->addMetaData('gridItemClass', 'w-24 sm:flex-1 text-center text-gray-500 hover:text-gray-700'); $table->addMetaData('hidePagination', true); - $iconPath = $session->get('absoluteURL').'/themes/'.$session->get('gibbonThemeName').'/img/'; $table->addColumn('icon') - ->format(function ($menu) use ($iconPath) { - $img = sprintf('', $iconPath.$menu['icon'], $menu['name']); - return Format::link($menu['url'], $img); + ->format(function ($menu) { + return Format::link($menu['url'], icon('solid', $menu['icon'], 'size-8 sm:size-12'), ['class' => 'no-underline text-inherit']); }); $table->addColumn('name') ->setClass('font-bold text-xs') ->format(function ($menu) { - return Format::link($menu['url'], $menu['name']); + return Format::link($menu['url'], $menu['name'], ['class' => 'no-underline text-gray-700']); }); echo $table->render(new DataSet($menuItems)); @@ -221,7 +219,7 @@ ->fromQuery($pdo, $sql, $data) ->selected($gibbonCourseClassID) ->placeholder() - ->setClass('fullWidth'); + ->setClass('w-full'); $row->addSubmit(__('Go')); $sidebarExtra .= $form->getOutput(); diff --git a/modules/Departments/department_edit.php b/modules/Departments/department_edit.php index 4dd204b2fa..705ffa770c 100644 --- a/modules/Departments/department_edit.php +++ b/modules/Departments/department_edit.php @@ -75,7 +75,7 @@ if ($result->rowCount() == 0) { $form->addRow()->addAlert(__('There are no records to display.'), 'error'); } else { - $table = $form->addRow()->addTable()->addClass('fullWidth colorOddEven'); + $table = $form->addRow()->addTable()->addClass('w-full colorOddEven'); $row = $table->addHeaderRow(); $row->addContent(__('Name')); diff --git a/modules/Finance/billingSchedule_manage.php b/modules/Finance/billingSchedule_manage.php index 56bf61c45c..c8eb2ea9f0 100644 --- a/modules/Finance/billingSchedule_manage.php +++ b/modules/Finance/billingSchedule_manage.php @@ -45,8 +45,8 @@ echo __('Search'); echo ''; - $form = Form::create("searchBox", $session->get('absoluteURL') . "/index.php", "get", "noIntBorder fullWidth standardForm"); - $form->setClass('noIntBorder fullWidth'); + $form = Form::create("searchBox", $session->get('absoluteURL') . "/index.php", "get", "noIntBorder w-full standardForm"); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue("q", "/modules/Finance/billingSchedule_manage.php"); $row = $form->addRow(); diff --git a/modules/Finance/expenseRequest_manage.php b/modules/Finance/expenseRequest_manage.php index 857f09f91e..940ea14c01 100644 --- a/modules/Finance/expenseRequest_manage.php +++ b/modules/Finance/expenseRequest_manage.php @@ -142,7 +142,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('gibbonFinanceBudgetCycleID', $gibbonFinanceBudgetCycleID); $form->addHiddenValue('q', "/modules/".$session->get('module')."/expenseRequest_manage.php"); diff --git a/modules/Finance/expenseRequest_manage_add.php b/modules/Finance/expenseRequest_manage_add.php index 438573cf24..8e0152ee5f 100644 --- a/modules/Finance/expenseRequest_manage_add.php +++ b/modules/Finance/expenseRequest_manage_add.php @@ -142,7 +142,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('purchaseDetails', __('Purchase Details')); - $column->addTextArea('purchaseDetails')->setRows(8)->setClass('fullWidth'); + $column->addTextArea('purchaseDetails')->setRows(8)->setClass('w-full'); $row = $form->addRow(); $row->addFooter(); diff --git a/modules/Finance/expenseRequest_manage_reimburse.php b/modules/Finance/expenseRequest_manage_reimburse.php index 6e64b88df5..69a1b0f290 100644 --- a/modules/Finance/expenseRequest_manage_reimburse.php +++ b/modules/Finance/expenseRequest_manage_reimburse.php @@ -137,7 +137,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('body', __('Description')); - $column->addContent($values['body'])->setClass('fullWidth'); + $column->addContent($values['body'])->setClass('w-full'); $row = $form->addRow(); $row->addLabel('cost', __('Total Cost')); @@ -154,7 +154,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('purchaseDetails', __('Purchase Details')); - $column->addContent($values['purchaseDetails'])->setClass('fullWidth'); + $column->addContent($values['purchaseDetails'])->setClass('w-full'); $form->addRow()->addHeading('Log', __('Log')); @@ -164,7 +164,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('comment', __('Comment')); - $column->addTextArea('comment')->setRows(8)->setClass('fullWidth'); + $column->addTextArea('comment')->setRows(8)->setClass('w-full'); $form->toggleVisibilityByClass('payment')->onSelect('status')->when('Paid'); diff --git a/modules/Finance/expenseRequest_manage_view.php b/modules/Finance/expenseRequest_manage_view.php index e64beb3eb0..95558c3fa5 100644 --- a/modules/Finance/expenseRequest_manage_view.php +++ b/modules/Finance/expenseRequest_manage_view.php @@ -138,7 +138,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('body', __('Description')); - $column->addContent($values['body'])->setClass('fullWidth'); + $column->addContent($values['body'])->setClass('w-full'); $row = $form->addRow(); $row->addLabel('cost', __('Total Cost')); @@ -155,7 +155,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('purchaseDetails', __('Purchase Details')); - $column->addContent($values['purchaseDetails'])->setClass('fullWidth'); + $column->addContent($values['purchaseDetails'])->setClass('w-full'); $form->addRow()->addHeading('Log', __('Log')); @@ -165,7 +165,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('comment', __('Comment')); - $column->addTextArea('comment')->setRows(8)->setClass('fullWidth'); + $column->addTextArea('comment')->setRows(8)->setClass('w-full'); $row = $form->addRow(); $row->addFooter(); diff --git a/modules/Finance/expenses_manage.php b/modules/Finance/expenses_manage.php index 57ec540927..6bc5f4806f 100644 --- a/modules/Finance/expenses_manage.php +++ b/modules/Finance/expenses_manage.php @@ -166,7 +166,7 @@ echo ''; $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Finance/expenses_manage.php'); $form->addHiddenValue('gibbonFinanceBudgetCycleID', $gibbonFinanceBudgetCycleID); @@ -272,7 +272,7 @@ $row->addSubmit(__('Go')); } - $table = $form->addRow()->addTable()->setClass('colorOddEven fullWidth'); + $table = $form->addRow()->addTable()->setClass('colorOddEven w-full'); $header = $table->addHeaderRow(); $header->addContent(__('Title'))->append('
'.__('Budget').''); @@ -302,10 +302,10 @@ $row = $table->addRow()->addClass($rowClass); $row->addContent($expense['title']) ->wrap('', '') - ->append('
'.$expense['budget'].''); + ->append('
'.$expense['budget'].''); $row->addContent(Format::name('', $expense['preferredName'], $expense['surname'], 'Staff', false, true)); $row->addContent(__($expense['status'])) - ->append('
'.__($expense['paymentReimbursementStatus']).''); + ->append('
'.__($expense['paymentReimbursementStatus']).''); $row->addContent(number_format($expense['cost'], 2, '.', ',')); $row->addContent(Format::date(substr($expense['timestampCreator'], 0, 10))); diff --git a/modules/Finance/expenses_manage_add.php b/modules/Finance/expenses_manage_add.php index d1153327dc..33455f4d27 100644 --- a/modules/Finance/expenses_manage_add.php +++ b/modules/Finance/expenses_manage_add.php @@ -126,7 +126,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('purchaseDetails', __('Purchase Details')); - $column->addTextArea('purchaseDetails')->setRows(8)->setClass('fullWidth'); + $column->addTextArea('purchaseDetails')->setRows(8)->setClass('w-full'); $form->toggleVisibilityByClass('paymentInfo')->onSelect('status')->when('Paid'); diff --git a/modules/Finance/expenses_manage_approve.php b/modules/Finance/expenses_manage_approve.php index 329c601516..9d8d7454d2 100644 --- a/modules/Finance/expenses_manage_approve.php +++ b/modules/Finance/expenses_manage_approve.php @@ -243,7 +243,7 @@ $col = $form->addRow()->addColumn(); $col->addLabel('comment', __('Comment')); - $col->addTextArea('comment')->setRows(8)->setClass('fullWidth'); + $col->addTextArea('comment')->setRows(8)->setClass('w-full'); } $row = $form->addRow(); diff --git a/modules/Finance/expenses_manage_edit.php b/modules/Finance/expenses_manage_edit.php index 4a9cafb5ba..bf41a77263 100644 --- a/modules/Finance/expenses_manage_edit.php +++ b/modules/Finance/expenses_manage_edit.php @@ -292,7 +292,7 @@ $col = $form->addRow()->addColumn(); $col->addLabel('reimbursementComment', __('Reimbursement Comment')); - $col->addTextArea('reimbursementComment')->setRows(4)->setClass('fullWidth'); + $col->addTextArea('reimbursementComment')->setRows(4)->setClass('w-full'); } } diff --git a/modules/Finance/expenses_manage_print.php b/modules/Finance/expenses_manage_print.php index 80da50c5b4..70c5ba0307 100644 --- a/modules/Finance/expenses_manage_print.php +++ b/modules/Finance/expenses_manage_print.php @@ -131,7 +131,7 @@ echo ''; ?> -
'.Format::name('', $child['preferredName'], $child['surname'], 'Student').'
+

diff --git a/modules/Finance/expenses_manage_print_print.php b/modules/Finance/expenses_manage_print_print.php index 223c9a1298..de76951381 100644 --- a/modules/Finance/expenses_manage_print_print.php +++ b/modules/Finance/expenses_manage_print_print.php @@ -115,7 +115,7 @@ echo "".__('Print').""; echo ''; ?> - +

diff --git a/modules/Finance/expenses_manage_view.php b/modules/Finance/expenses_manage_view.php index a1cf7c1cf0..13bfeb85a9 100644 --- a/modules/Finance/expenses_manage_view.php +++ b/modules/Finance/expenses_manage_view.php @@ -134,7 +134,7 @@ $page->navigator->addSearchResultsAction(Url::fromModuleRoute('Finance', 'expenses_manage.php')->withQueryParams($params)); } ?> - +
@@ -282,7 +278,7 @@

@@ -159,10 +159,6 @@ ?> -

- +
@@ -291,7 +287,7 @@

- + get('currency') != '') { echo "".$session->get('currency').''; @@ -306,7 +302,7 @@

- +

- +
diff --git a/modules/Finance/fees_manage.php b/modules/Finance/fees_manage.php index f39dcfdb3a..a31a6bdb80 100644 --- a/modules/Finance/fees_manage.php +++ b/modules/Finance/fees_manage.php @@ -44,7 +44,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/fees_manage.php'); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); diff --git a/modules/Finance/invoicees_manage.php b/modules/Finance/invoicees_manage.php index ed277bd200..a152afbf52 100644 --- a/modules/Finance/invoicees_manage.php +++ b/modules/Finance/invoicees_manage.php @@ -64,7 +64,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filters')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', "/modules/".$session->get('module')."/invoicees_manage.php"); diff --git a/modules/Finance/invoices_manage.php b/modules/Finance/invoices_manage.php index d116ba8365..6deebd19cb 100644 --- a/modules/Finance/invoices_manage.php +++ b/modules/Finance/invoices_manage.php @@ -66,7 +66,7 @@ $form = Form::create('manageInvoices', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(FinanceFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Finance/invoices_manage.php'); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); @@ -143,12 +143,12 @@ $col = $form->createBulkActionColumn($bulkActions); $col->addSelectPaymentMethod('paymentType') - ->setClass('bulkPaid shortWidth displayNone') + ->setClass('bulkPaid shortWidth hidden') ->required() ->addValidationOption('onlyOnSubmit: true') ->placeholder(__('Payment Type').'...'); $col->addDate('paidDate') - ->setClass('bulkPaid shortWidth displayNone') + ->setClass('bulkPaid shortWidth hidden') ->required() ->addValidationOption('onlyOnSubmit: true') ->placeholder(__('Date Paid')); @@ -192,7 +192,7 @@ ->sortable(['surname', 'preferredName']) ->format(function($invoice) { $output = ''.Format::name('', $invoice['preferredName'], $invoice['surname'], 'Student', true).''; - $output .= '
'.__($invoice['invoiceTo']).''; + $output .= '
'.__($invoice['invoiceTo']).''; return $output; }); @@ -220,7 +220,7 @@ $output = Format::currency($totalFee); if (!empty($invoice['paidAmount'])) { $class = Format::number($invoice['paidAmount']) != Format::number($totalFee)? 'textOverBudget' : ''; - $output .= '
'.Format::currency($invoice['paidAmount']).''; + $output .= '
'.Format::currency($invoice['paidAmount']).''; } return $output; }); @@ -229,7 +229,7 @@ ->description(__('Due Date')) ->format(function ($invoice) { $output = !is_null($invoice['invoiceIssueDate'])? Format::date($invoice['invoiceIssueDate']) : __('N/A'); - $output .= '
'.Format::date($invoice['invoiceDueDate']).''; + $output .= '
'.Format::date($invoice['invoiceDueDate']).''; return $output; }); diff --git a/modules/Finance/invoices_manage_add_blockFeeAjax.php b/modules/Finance/invoices_manage_add_blockFeeAjax.php deleted file mode 100644 index c3b1be5ea1..0000000000 --- a/modules/Finance/invoices_manage_add_blockFeeAjax.php +++ /dev/null @@ -1,39 +0,0 @@ -. -*/ - -include '../../gibbon.php'; - -include './moduleFunctions.php'; - -$id = $_GET['id'] ?? ''; -$mode = $_GET['mode'] ?? ''; -$feeType = $_GET['feeType'] ?? ''; -$gibbonFinanceFeeID = $_GET['gibbonFinanceFeeID'] ?? ''; -$name = $_GET['name'] ?? ''; -$description = $_GET['description'] ?? ''; -$gibbonFinanceFeeCategoryID = $_GET['gibbonFinanceFeeCategoryID'] ?? ''; -$fee = $_GET['fee'] ?? ''; -$category = null; -if (isset($_GET['category'])) { - $category = $_GET['category'] ?? ''; -} - -makeFeeBlock($guid, $connection2, $id, $mode, $feeType, $gibbonFinanceFeeID, $name, $description, $gibbonFinanceFeeCategoryID, $fee, $category); diff --git a/modules/Finance/invoices_manage_edit.php b/modules/Finance/invoices_manage_edit.php index a7e4001c55..5be9f83779 100644 --- a/modules/Finance/invoices_manage_edit.php +++ b/modules/Finance/invoices_manage_edit.php @@ -198,9 +198,9 @@ ->required() ->placeholder(__('Value').(!empty($session->get('currency'))? ' ('.$session->get('currency').')' : '')); - $col = $blockTemplate->addRow()->addClass('showHide fullWidth')->addColumn(); + $col = $blockTemplate->addRow()->addClass('showHide w-full')->addColumn(); $col->addLabel('description', __('Description')); - $col->addTextArea('description')->setRows('auto')->setClass('fullWidth floatNone noMargin'); + $col->addTextArea('description')->setRows('auto')->setClass('w-full floatNone noMargin'); // Custom Blocks for Fees $row = $form->addRow(); diff --git a/modules/Finance/invoices_view.php b/modules/Finance/invoices_view.php index dd7a235a13..9bdb285899 100644 --- a/modules/Finance/invoices_view.php +++ b/modules/Finance/invoices_view.php @@ -72,7 +72,7 @@ $gibbonPersonID = (isset($_GET['search']))? $_GET['search'] : null; $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth standardForm'); + $form->setClass('noIntBorder w-full standardForm'); $form->addHiddenValue('q', '/modules/Finance/invoices_view.php'); $form->addHiddenValue('address', $session->get('address')); diff --git a/modules/Finance/moduleFunctions.php b/modules/Finance/moduleFunctions.php index 7aabbe9faa..96431c487e 100644 --- a/modules/Finance/moduleFunctions.php +++ b/modules/Finance/moduleFunctions.php @@ -654,123 +654,6 @@ function getNextBudgetCycleID($gibbonFinanceBudgetCycleID, $connection2) return $output; } -//Make the display for a block, according to the input provided, where $i is a unique number appended to the block's field ids. -//Mode can be add, edit -function makeFeeBlock($guid, $connection2, $i, $mode, $feeType, $gibbonFinanceFeeID, $name = '', $description = '', $gibbonFinanceFeeCategoryID = '', $fee = '', $category = '', $outerBlock = true) -{ - global $session; - - if ($outerBlock) { - echo "
"; - } - ?> - -
- - - - - - - - -
- - maxlength=100 id='name' name='name' type='text' style='float: none; border: 1px dotted #aaa; background: none; margin-left: 3px; margin-top: 0px; font-size: 140%; font-weight: bold; width: 350px' value='' placeholder=''>
- - - - - - - maxlength=13 id='fee' name='fee' type='text' style='float: none; border: 1px dotted #aaa; background: none; margin-left: 3px; margin-top: 2px; font-size: 110%; font-style: italic; width: 95px' value='' placeholder='get('currency') != '') { echo ' ('.$session->get('currency').')'; } ?>'> - -
-
- get('gibbonThemeName')."/img/garbage.png'/> "; - echo "
get('gibbonThemeName')."/img/plus.png\"); background-repeat: no-repeat'>

"; - ?> -
- '; - } - ?> - - -
- Description"; - if ($gibbonFinanceFeeID == null) { - echo "'; - } else { - echo "
".htmlPrep($description).'
'; - echo ""; - } - ?> -
-
- '; - } -} - function invoiceContents($guid, $connection2, $gibbonFinanceInvoiceID, $gibbonSchoolYearID, $currency = '', $email = false, $preview = false) { global $session, $container; diff --git a/modules/Finance/src/Forms/FinanceFormFactory.php b/modules/Finance/src/Forms/FinanceFormFactory.php index 33c84d8169..2c18cc98a7 100644 --- a/modules/Finance/src/Forms/FinanceFormFactory.php +++ b/modules/Finance/src/Forms/FinanceFormFactory.php @@ -250,7 +250,7 @@ public function createSelectMonth($name) public function createInvoiceEmailCheckboxes($checkboxName, $hiddenValueName, $values, $session) { - $table = $this->createTable()->setClass('fullWidth'); + $table = $this->createTable()->setClass('w-full'); // Company Emails if ($values['invoiceTo'] == 'Company') { @@ -301,7 +301,7 @@ public function createInvoiceEmailCheckboxes($checkboxName, $hiddenValueName, $v $row->onlyIf(empty($person['email'])) ->addContent(__('No email address.')) ->addClass('right') - ->wrap('', ''); + ->wrap('', ''); } } } diff --git a/modules/Form Groups/formGroups_details.php b/modules/Form Groups/formGroups_details.php index 8afd1bb6ef..9a49e93ef5 100644 --- a/modules/Form Groups/formGroups_details.php +++ b/modules/Form Groups/formGroups_details.php @@ -144,7 +144,7 @@ $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Filters')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/formGroups_details.php"); $form->addHiddenValue('gibbonFormGroupID', $gibbonFormGroupID); diff --git a/modules/Formal Assessment/externalAssessment.php b/modules/Formal Assessment/externalAssessment.php index 2fc1f26cb5..d89302fb7d 100644 --- a/modules/Formal Assessment/externalAssessment.php +++ b/modules/Formal Assessment/externalAssessment.php @@ -46,7 +46,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Formal Assessment/externalAssessment.php'); diff --git a/modules/Formal Assessment/externalAssessment_view.php b/modules/Formal Assessment/externalAssessment_view.php index e8b8d90885..058da54d9e 100644 --- a/modules/Formal Assessment/externalAssessment_view.php +++ b/modules/Formal Assessment/externalAssessment_view.php @@ -73,7 +73,7 @@ $gibbonPersonID = (isset($_GET['search']))? $_GET['search'] : null; $form = Form::create("filter", $session->get('absoluteURL')."/index.php", "get"); - $form->setClass('noIntBorder fullWidth standardForm'); + $form->setClass('noIntBorder w-full standardForm'); $form->addHiddenValue('q', '/modules/Formal Assessment/externalAssessment_view.php'); $form->addHiddenValue('address', $session->get('address')); diff --git a/modules/Formal Assessment/internalAssessment_view.php b/modules/Formal Assessment/internalAssessment_view.php index e282eb1b7b..5651a8c1bd 100644 --- a/modules/Formal Assessment/internalAssessment_view.php +++ b/modules/Formal Assessment/internalAssessment_view.php @@ -48,9 +48,9 @@ echo __('Choose A Student'); echo ''; - $form = Form::create("filter", $session->get('absoluteURL')."/index.php", "get", "noIntBorder fullWidth standardForm"); + $form = Form::create("filter", $session->get('absoluteURL')."/index.php", "get", "noIntBorder w-full standardForm"); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Formal Assessment/internalAssessment_view.php'); $form->addHiddenValue('address', $session->get('address')); @@ -118,7 +118,7 @@ echo ''; $form = Form::create("filter", $session->get('absoluteURL')."/index.php", "get"); - $form->setClass('noIntBorder fullWidth standardForm'); + $form->setClass('noIntBorder w-full standardForm'); $form->addHiddenValue('q', '/modules/Formal Assessment/internalAssessment_view.php'); $form->addHiddenValue('address', $session->get('address')); diff --git a/modules/Formal Assessment/internalAssessment_write_data.php b/modules/Formal Assessment/internalAssessment_write_data.php index a56bf7d465..d8f73ee01d 100644 --- a/modules/Formal Assessment/internalAssessment_write_data.php +++ b/modules/Formal Assessment/internalAssessment_write_data.php @@ -132,7 +132,7 @@ $form->addRow()->addHeading('Students', __('Students')); $form->addRow()->addAlert(__('There are no records to display.'), 'error'); } else { - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth colorOddEven noMargin noPadding noBorder'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full colorOddEven noMargin noPadding noBorder'); $completeText = !empty($values['completeDate'])? __('Marked on').' '.Format::date($values['completeDate']) : __('Unmarked'); $detailsText = $values['type']; @@ -144,8 +144,8 @@ $header->addTableCell(__('Student'))->rowSpan(2); $header->addTableCell($values['name']) ->setTitle($values['description']) - ->append('
'.$completeText.'') - ->append('
'.$detailsText.'') + ->append('
'.$completeText.'') + ->append('
'.$detailsText.'') ->setClass('textCenter') ->colSpan(3); diff --git a/modules/Formal Assessment/moduleFunctions.php b/modules/Formal Assessment/moduleFunctions.php index 9b2429fea3..a6319fb8ee 100644 --- a/modules/Formal Assessment/moduleFunctions.php +++ b/modules/Formal Assessment/moduleFunctions.php @@ -248,18 +248,21 @@ function sidebarExtra($guid, $connection2, $gibbonCourseClassID, $mode = 'manage } } - $form = Form::create('classSelect', $session->get('absoluteURL').'/index.php', 'get'); + $form = Form::createBlank('classSelect', $session->get('absoluteURL').'/index.php', 'get')->enableQuickSubmit(); $form->addHiddenValue('q', '/modules/Formal Assessment/internalAssessment_'.$mode.'.php'); $form->setTitle(__('Select Class')); - $form->setClass('smallIntBorder w-full'); - $row = $form->addRow(); + $row = $form->addRow()->addClass('flex'); $row->addSelect('gibbonCourseClassID') ->fromArray($classes) ->selected($gibbonCourseClassID) ->placeholder() + ->groupAlign('left') ->setClass('float-none w-full'); - $row->addSubmit(__('Go')); + $row->addSubmit(__('Go')) + ->setType('quickSubmit') + ->groupAlign('right') + ->setClass('flex'); $output .= $form->getOutput(); diff --git a/modules/Individual Needs/iep_view_myChildren.php b/modules/Individual Needs/iep_view_myChildren.php index 5a7230a909..4112b79946 100644 --- a/modules/Individual Needs/iep_view_myChildren.php +++ b/modules/Individual Needs/iep_view_myChildren.php @@ -70,7 +70,7 @@ echo ''; $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/iep_view_myChildren.php'); $form->addHiddenValue('address', $session->get('address')); @@ -115,7 +115,7 @@ echo ''; $row = $result->fetch(); ?> - +
"; - echo ''; - echo ''; - echo ''; - echo ''; - } else { - echo "
"; - if ($values['gibbonUnitID'] != '') { - echo "".__('Unit Overview').''; + $table->addHeaderAction('edit', __('Edit')) + ->setURL('/modules/Planner/planner_edit.php') + ->addParams($params) + ->displayLabel(); + + if (!empty($gibbonMarkbookColumnID)) { + $table->addHeaderAction('markbook', __('Markbook')) + ->setURL('/modules/Markbook/markbook_edit_data.php') + ->addParam('gibbonMarkbookColumnID', $gibbonMarkbookColumnID) + ->addParams($params) + ->displayLabel(); } - echo '
'; } - // Details Table - $table = DataTable::createDetails('overview'); - $col = $table->addColumn('Basic Information'); $col->addColumn('class', __('Class'))->format(Format::using('courseClassName', ['course', 'class'])); @@ -409,7 +380,7 @@ echo ''; echo '

diff --git a/modules/Individual Needs/in_edit.php b/modules/Individual Needs/in_edit.php index 8289f2aff8..0b2a1781e8 100644 --- a/modules/Individual Needs/in_edit.php +++ b/modules/Individual Needs/in_edit.php @@ -122,8 +122,7 @@ return $item['archiveTitle'].' ('.Format::date(substr($item['archiveTimestamp'], 0, 10)).')'; }, $archivedIEPs); - $form = Form::create('action', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module')."/in_edit.php&gibbonPersonID=$gibbonPersonID&search=$search&source=$source&gibbonINDescriptorID=$gibbonINDescriptorID&gibbonAlertLevelID=$gibbonAlertLevelID&gibbonFormGroupID=$gibbonFormGroupID&gibbonYearGroupID=$gibbonYearGroupID"); - $form->setClass('blank fullWidth'); + $form = Form::createBlank('action', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module')."/in_edit.php&gibbonPersonID=$gibbonPersonID&search=$search&source=$source&gibbonINDescriptorID=$gibbonINDescriptorID&gibbonAlertLevelID=$gibbonAlertLevelID&gibbonFormGroupID=$gibbonFormGroupID&gibbonYearGroupID=$gibbonYearGroupID"); $form->addHiddenValue('address', $session->get('address')); $col = $form->addRow()->addColumn()->addClass('flex justify-end items-center'); @@ -148,10 +147,9 @@ echo $table->render([$student]); - $form = Form::create('individualNeeds', $session->get('absoluteURL').'/modules/'.$session->get('module')."/in_editProcess.php?gibbonPersonID=$gibbonPersonID&search=$search&source=$source&gibbonINDescriptorID=$gibbonINDescriptorID&gibbonAlertLevelID=$gibbonAlertLevelID&gibbonFormGroupID=$gibbonFormGroupID&gibbonYearGroupID=$gibbonYearGroupID"); + $form = Form::createBlank('individualNeeds', $session->get('absoluteURL').'/modules/'.$session->get('module')."/in_editProcess.php?gibbonPersonID=$gibbonPersonID&search=$search&source=$source&gibbonINDescriptorID=$gibbonINDescriptorID&gibbonAlertLevelID=$gibbonAlertLevelID&gibbonFormGroupID=$gibbonFormGroupID&gibbonYearGroupID=$gibbonYearGroupID"); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('w-full blank'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonPersonID', $gibbonPersonID); @@ -173,7 +171,7 @@ $form->addRow()->addSubheading(__('Educational Assistants'))->setClass('mt-4 mb-2'); if (!empty($educationalAssistants)) { - $table = $form->addRow()->addTable()->addClass('smallIntBorder fullWidth colorOddEven'); + $table = $form->addRow()->addTable()->addClass('smallIntBorder w-full colorOddEven'); $header = $table->addHeaderRow(); $header->addContent(__('Name')); $header->addContent(__('Comment')); @@ -204,7 +202,7 @@ if (empty($gibbonINArchiveID) && $highestAction == 'Individual Needs Records_viewEdit') { $form->addRow()->addSubheading(__('Add New Assistants'))->setClass('mt-4 mb-2'); - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full'); $row = $table->addRow(); $row->addLabel('staff', __('Staff'))->addClass('w-1/2'); @@ -218,7 +216,7 @@ // DISPLAY AND EDIT IEP - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth mt-2'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full mt-2'); $table->addRow()->addHeading('Individual Education Plan', __('Individual Education Plan'))->setClass('mt-4 mb-2'); @@ -276,7 +274,7 @@ } if (empty($gibbonINArchiveID) && ($highestAction == 'Individual Needs Records_viewEdit' || $highestAction == 'Individual Needs Records_viewContribute')) { - $form->addRow()->addTable()->setClass('smallIntBorder fullWidth mt-2')->addRow()->addSubmit(); + $form->addRow()->addTable()->setClass('smallIntBorder w-full mt-2')->addRow()->addSubmit(); } echo $form->getOutput(); diff --git a/modules/Individual Needs/in_summary.php b/modules/Individual Needs/in_summary.php index 0ac3ac9d09..5f35067eb7 100644 --- a/modules/Individual Needs/in_summary.php +++ b/modules/Individual Needs/in_summary.php @@ -56,7 +56,7 @@ echo ''; $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('q', '/modules/Individual Needs/in_summary.php'); diff --git a/modules/Individual Needs/in_view.php b/modules/Individual Needs/in_view.php index 5525011037..733acbb733 100644 --- a/modules/Individual Needs/in_view.php +++ b/modules/Individual Needs/in_view.php @@ -53,7 +53,7 @@ echo ''; $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/in_view.php'); diff --git a/modules/Individual Needs/investigations_manage.php b/modules/Individual Needs/investigations_manage.php index 88d579a4e1..907b45e5e6 100644 --- a/modules/Individual Needs/investigations_manage.php +++ b/modules/Individual Needs/investigations_manage.php @@ -46,7 +46,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('q', "/modules/Individual Needs/investigations_manage.php"); diff --git a/modules/Individual Needs/investigations_manage_add.php b/modules/Individual Needs/investigations_manage_add.php index cbc1a76a2c..590e01e31b 100644 --- a/modules/Individual Needs/investigations_manage_add.php +++ b/modules/Individual Needs/investigations_manage_add.php @@ -83,13 +83,13 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('reason', __('Reason'))->description(__('Why should this student\'s individual needs be investigated?')); - $column->addTextArea('reason')->setRows(5)->setClass('fullWidth')->required(); + $column->addTextArea('reason')->setRows(5)->setClass('w-full')->required(); //Strategies Tried $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('strategiesTried', __('Strategies Tried')); - $column->addTextArea('strategiesTried')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('strategiesTried')->setRows(5)->setClass('w-full'); //Parents Informed? $row = $form->addRow(); @@ -103,12 +103,12 @@ $row = $form->addRow()->addClass('parentsInformedYes'); $column = $row->addColumn(); $column->addLabel('parentsResponseYes', __('Parent Response')); - $column->addTextArea('parentsResponseYes')->setName('parentsResponse')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('parentsResponseYes')->setName('parentsResponse')->setRows(5)->setClass('w-full'); $row = $form->addRow()->addClass('parentsInformedNo'); $column = $row->addColumn(); $column->addLabel('parentsResponseNo', __('Reason'))->description(__('Reasons why parents are not aware of the situation.')); - $column->addTextArea('parentsResponseNo')->setName('parentsResponse')->setRows(5)->setClass('fullWidth')->required(); + $column->addTextArea('parentsResponseNo')->setName('parentsResponse')->setRows(5)->setClass('w-full')->required(); $form->addRow()->addAlert(__("Submitting this referral will notify the student's form tutor for further investigation."), 'message'); diff --git a/modules/Individual Needs/investigations_manage_edit.php b/modules/Individual Needs/investigations_manage_edit.php index 64ebf7695f..38730affc4 100644 --- a/modules/Individual Needs/investigations_manage_edit.php +++ b/modules/Individual Needs/investigations_manage_edit.php @@ -109,13 +109,13 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('reason', __('Reason'))->description(__('Why should this student\'s individual needs be investigated?'));; - $column->addTextArea('reason')->setRows(5)->setClass('fullWidth')->required()->readonly(!$canEdit || $investigation['status'] != 'Referral'); + $column->addTextArea('reason')->setRows(5)->setClass('w-full')->required()->readonly(!$canEdit || $investigation['status'] != 'Referral'); //Strategies Tried $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('strategiesTried', __('Strategies Tried')); - $column->addTextArea('strategiesTried')->setRows(5)->setClass('fullWidth')->readonly(!$canEdit || $investigation['status'] != 'Referral'); + $column->addTextArea('strategiesTried')->setRows(5)->setClass('w-full')->readonly(!$canEdit || $investigation['status'] != 'Referral'); //Parents Informed? $row = $form->addRow(); @@ -129,12 +129,12 @@ $row = $form->addRow()->addClass('parentsInformedYes'); $column = $row->addColumn(); $column->addLabel('parentsResponseYes', __('Parent Response')); - $column->addTextArea('parentsResponseYes')->setName('parentsResponse')->setRows(5)->setClass('fullWidth')->readonly(!$canEdit || $investigation['status'] != 'Referral'); + $column->addTextArea('parentsResponseYes')->setName('parentsResponse')->setRows(5)->setClass('w-full')->readonly(!$canEdit || $investigation['status'] != 'Referral'); $row = $form->addRow()->addClass('parentsInformedNo'); $column = $row->addColumn(); $column->addLabel('parentsResponseNo', __('Reason'))->description(__('Reasons why parents are not aware of the situation.')); - $column->addTextArea('parentsResponseNo')->setName('parentsResponse')->setRows(5)->setClass('fullWidth')->readonly(!$canEdit || $investigation['status'] != 'Referral')->required(); + $column->addTextArea('parentsResponseNo')->setName('parentsResponse')->setRows(5)->setClass('w-full')->readonly(!$canEdit || $investigation['status'] != 'Referral')->required(); //Form Tutor Resolution if ($investigation['status'] == 'Resolved' || ($investigation['status'] == 'Referral' && $isTutor)) { @@ -153,7 +153,7 @@ $row = $form->addRow()->addClass('resolutionDetails'); $column = $row->addColumn(); $column->addLabel('resolutionDetails', __('Resolution Details')); - $column->addTextArea('resolutionDetails')->setRows(5)->setClass('fullWidth')->readonly(!$isTutor || $investigation['status'] != 'Referral'); + $column->addTextArea('resolutionDetails')->setRows(5)->setClass('w-full')->readonly(!$isTutor || $investigation['status'] != 'Referral'); //Not resolvable by tutor $resultClass = $investigationGateway->queryTeachersByInvestigation($investigation['gibbonSchoolYearID'], $investigation['gibbonPersonIDStudent']); diff --git a/modules/Individual Needs/investigations_submit_detail.php b/modules/Individual Needs/investigations_submit_detail.php index 55370f0ae3..dc32afb894 100644 --- a/modules/Individual Needs/investigations_submit_detail.php +++ b/modules/Individual Needs/investigations_submit_detail.php @@ -78,13 +78,13 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('reason', __('Reason'))->description(__('Why should this student\'s individual needs be investigated?'));; - $column->addTextArea('reason')->setRows(5)->setClass('fullWidth')->required()->readonly(); + $column->addTextArea('reason')->setRows(5)->setClass('w-full')->required()->readonly(); //Strategies Tried $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('strategiesTried', __('Strategies Tried')); - $column->addTextArea('strategiesTried')->setRows(5)->setClass('fullWidth')->readonly(); + $column->addTextArea('strategiesTried')->setRows(5)->setClass('w-full')->readonly(); //Parents Informed? $row = $form->addRow(); @@ -98,12 +98,12 @@ $row = $form->addRow()->addClass('parentsInformedYes'); $column = $row->addColumn(); $column->addLabel('parentsResponseYes', __('Parent Response')); - $column->addTextArea('parentsResponseYes')->setName('parentsResponse')->setRows(5)->setClass('fullWidth')->readonly(); + $column->addTextArea('parentsResponseYes')->setName('parentsResponse')->setRows(5)->setClass('w-full')->readonly(); $row = $form->addRow()->addClass('parentsInformedNo'); $column = $row->addColumn(); $column->addLabel('parentsResponseNo', __('Reason'))->description(__('Reasons why parents are not aware of the situation.')); - $column->addTextArea('parentsResponseNo')->setName('parentsResponse')->setRows(5)->setClass('fullWidth')->readonly()->required(); + $column->addTextArea('parentsResponseNo')->setName('parentsResponse')->setRows(5)->setClass('w-full')->readonly()->required(); $form->addRow()->addHeading('Contributor Input', __('Contributor Input')); @@ -178,7 +178,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('comment', __('Comment')); - $column->addTextArea('comment')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('comment')->setRows(5)->setClass('w-full'); $row = $form->addRow(); $row->addFooter(); diff --git a/modules/Library/library_browse.php b/modules/Library/library_browse.php index b59780dcfd..51bd4a0c47 100644 --- a/modules/Library/library_browse.php +++ b/modules/Library/library_browse.php @@ -73,15 +73,15 @@ }, array()); - $form = Form::create('searchForm', $session->get('absoluteURL') . '/index.php', 'get'); + $form = Form::createBlank('searchForm', $session->get('absoluteURL') . '/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('fullWidth blank border-transparent mb-6'); + $form->setClass('mb-6'); $form->addHiddenValue('q', '/modules/Library/library_browse.php'); $row = $form->addRow()->addLabel('Browse the Library', __('Browse the Library'))->addClass('text-2xl pb-2'); $row = $form->addRow()->addClass('grid sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-7 gap-4'); - $row->addTextField('everything')->setClass('fullWidth sm:col-span-2 md:col-span-4 lg:col-span-6')->setValue($everything)->placeholder('Search for a Book!'); + $row->addTextField('everything')->setClass('w-full sm:col-span-2 md:col-span-4 lg:col-span-6')->setValue($everything)->placeholder('Search for a Book!'); $row->addSearchSubmit($session, __('Clear Search'))->addClass('sm:col-start-3 md:col-start-5 lg:col-start-7'); $row = $form->addRow(); @@ -90,23 +90,23 @@ $col = $row->addColumn()->setClass('quarterWidth'); $col->addLabel('name', __('Title')); $col->setClass(''); - $col->addTextField('name')->setClass('fullWidth')->setValue($name); + $col->addTextField('name')->setClass('w-full')->setValue($name); $col = $row->addColumn()->setClass('quarterWidth'); $col->addLabel('producer', __('Author/Producer')); - $col->addTextField('producer')->setClass('fullWidth')->setValue($producer); + $col->addTextField('producer')->setClass('w-full')->setValue($producer); $form->toggleVisibilityByClass('allLocations')->onCheckbox('locationToggle')->when('on'); $col = $row->addColumn()->setClass('allLocations quarterWidth'); $col->addLabel('location', __('Location')); - $col->addSelectSpace('location')->setClass('fullWidth')->setValue($location)->placeHolder()->selected($location); + $col->addSelectSpace('location')->setClass('w-full')->setValue($location)->placeHolder()->selected($location); $col = $row->addColumn()->setClass('quarterWidth'); $col->addLabel('type', __('Type')); $col->addSelect('type') ->fromArray($types) - ->setClass('fullWidth') + ->setClass('w-full') ->selected($type) ->placeholder(); @@ -115,14 +115,14 @@ $col->addSelect('collection') ->fromArray($collections) ->chainedTo('type', $collectionsChained) - ->setClass('fullWidth') + ->setClass('w-full') ->selected($collection) ->placeholder(); - $col = $row->addColumn()->setClass('fullWidth'); + $col = $row->addColumn()->setClass('w-full'); $col->addLabel('readerAge', __('Readers Age')); $ageArray=range(2,21); - $col->addSelect('readerAge')->fromArray($ageArray)->setClass('fullWidth')->selected($readerAge)->placeholder(); + $col->addSelect('readerAge')->fromArray($ageArray)->setClass('w-full')->selected($readerAge)->placeholder(); $locationToggle = 'on'; $col = $row->addColumn()->setClass('quarterWidth'); @@ -222,4 +222,4 @@ ]); } -} \ No newline at end of file +} diff --git a/modules/Library/library_lending.php b/modules/Library/library_lending.php index 7e466d4c53..74abcae074 100644 --- a/modules/Library/library_lending.php +++ b/modules/Library/library_lending.php @@ -45,7 +45,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/library_lending.php'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/library_lending.php"); diff --git a/modules/Library/library_manage_catalog.php b/modules/Library/library_manage_catalog.php index ffe11e89a3..d358941831 100644 --- a/modules/Library/library_manage_catalog.php +++ b/modules/Library/library_manage_catalog.php @@ -48,7 +48,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setTitle(__('Search & Filter')); $form->addHiddenValue('q', "/modules/".$session->get('module')."/library_manage_catalog.php"); @@ -65,11 +65,11 @@ ->selected($gibbonLibraryTypeID) ->placeholder(); - $row = $form->addRow()->addClass('advancedOptions hidden'); + $row = $form->addRow()->advancedOptions(); $row->addLabel('gibbonSpaceID', __('Location')); $row->addSelectSpace('gibbonSpaceID')->selected($gibbonSpaceID)->placeholder(); - $row = $form->addRow()->addClass('advancedOptions hidden'); + $row = $form->addRow()->advancedOptions(); $row->addLabel('locationDetail', __('Location Detail')); $row->addTextField('locationDetail')->setValue($locationDetail)->placeholder(); @@ -83,27 +83,27 @@ 'Repair' => __('Repair'), 'Reserved' => __('Reserved') ); - $row = $form->addRow()->addClass('advancedOptions hidden'); + $row = $form->addRow()->advancedOptions(); $row->addLabel('status', __('Status')); $row->addSelect('status')->fromArray($statuses)->selected($status)->placeholder(); - $row = $form->addRow()->addClass('advancedOptions hidden'); + $row = $form->addRow()->advancedOptions(); $row->addLabel('gibbonPersonIDOwnership', __('Owner/User')); $row->addSelectUsers('gibbonPersonIDOwnership')->selected($gibbonPersonIDOwnership)->placeholder(); - $row = $form->addRow()->addClass('advancedOptions hidden'); + $row = $form->addRow()->advancedOptions(); $row->addLabel('typeSpecificFields', __('Type-Specific Fields')) ->description(__('For example, a computer\'s MAC address or a book\'s ISBN.')); $row->addScanner('typeSpecificFields') ->setValue($typeSpecificFields); - $row = $form->addRow()->addClass(empty($parentID) ? 'advancedOptions hidden' : 'advancedOptions'); + $row = $form->addRow()->advancedOptions(); $row->addLabel('parentID', __('Copies Of')); $row->addTextField('parentID')->setValue($parentID); - $col = $form->addRow()->setClass('advancedOptions hidden')->addColumn(); + $col = $form->addRow()->advancedOptions()->addColumn(); $col->addLabel('everything', __('All Fields')); - $col->addTextField('everything')->setClass('fullWidth')->setValue($everything); + $col->addTextField('everything')->setClass('w-full')->setValue($everything); $row = $form->addRow(); $row->addAdvancedOptionsToggle(); @@ -139,8 +139,7 @@ ->addParam('status', $status) ->addParam('gibbonPersonIDOwnership', $gibbonPersonIDOwnership) ->addParam('typeSpecificFields', $typeSpecificFields) - ->displayLabel() - ->prepend(' | '); + ->displayLabel(); $table->addColumn('id', __('School ID')) ->description(__('Type')) diff --git a/modules/Library/library_manage_catalog_fields_ajax.php b/modules/Library/library_manage_catalog_fields_ajax.php index 4d289582f0..a27a318ac9 100644 --- a/modules/Library/library_manage_catalog_fields_ajax.php +++ b/modules/Library/library_manage_catalog_fields_ajax.php @@ -41,7 +41,7 @@ $result = $pdo->executeQuery($data, $sql); $factory = FormFactory::create(); - $table = $factory->createTable('detailsTable')->setClass('fullWidth'); + $table = $factory->createTable('detailsTable')->setClass('w-full'); if ($result->rowCount() != 1) { $table->addRow()->addAlert(__('The specified record cannot be found.'), 'error'); diff --git a/modules/Library/library_manage_shelves.php b/modules/Library/library_manage_shelves.php index c60e7d505a..1abfb09c02 100644 --- a/modules/Library/library_manage_shelves.php +++ b/modules/Library/library_manage_shelves.php @@ -37,7 +37,7 @@ $page->breadcrumbs->add(__('Manage Library Shelves')); $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setTitle(__('Search & Filter')); $form->addHiddenValue('q', "/modules/".$session->get('module')."/library_manage_shelves.php"); diff --git a/modules/Library/library_shelves_editOrderAjax.php b/modules/Library/library_shelves_editOrderAjax.php index 97b80b3cd5..c078a3e600 100644 --- a/modules/Library/library_shelves_editOrderAjax.php +++ b/modules/Library/library_shelves_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order']; if (empty($order)) { exit; diff --git a/modules/Library/report_catalogSummary.php b/modules/Library/report_catalogSummary.php index 83bee31fb6..89c8d812b6 100644 --- a/modules/Library/report_catalogSummary.php +++ b/modules/Library/report_catalogSummary.php @@ -48,7 +48,7 @@ $form->setTitle(__('Search & Filter')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_catalogSummary.php"); diff --git a/modules/Library/report_studentBorrowingRecord.php b/modules/Library/report_studentBorrowingRecord.php index b081931611..a52574dbba 100644 --- a/modules/Library/report_studentBorrowingRecord.php +++ b/modules/Library/report_studentBorrowingRecord.php @@ -49,7 +49,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_studentBorrowingRecord.php"); diff --git a/modules/Library/report_viewOverdueItems.php b/modules/Library/report_viewOverdueItems.php index 58bfed340b..053a5ce122 100644 --- a/modules/Library/report_viewOverdueItems.php +++ b/modules/Library/report_viewOverdueItems.php @@ -46,7 +46,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_viewOverdueItems.php"); diff --git a/modules/Markbook/css/module.css b/modules/Markbook/css/module.css index 65b49d8b2e..b3a60044c5 100644 --- a/modules/Markbook/css/module.css +++ b/modules/Markbook/css/module.css @@ -268,6 +268,7 @@ select[id$="effortValue"] { border-right: 1px solid #666; margin:0; z-index: 1; + text-align: left; } .doublescroll-container td { diff --git a/modules/Markbook/markbook_edit.php b/modules/Markbook/markbook_edit.php index 37e72527b8..aecb0563c3 100644 --- a/modules/Markbook/markbook_edit.php +++ b/modules/Markbook/markbook_edit.php @@ -236,7 +236,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php?q=/modules/Markbook/markbook_edit_copy.php&gibbonCourseClassID='.$gibbonCourseClassID); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/applicationForm_manage.php'); diff --git a/modules/Markbook/markbook_edit_copy.php b/modules/Markbook/markbook_edit_copy.php index 4b2017d1a5..e4b957615c 100644 --- a/modules/Markbook/markbook_edit_copy.php +++ b/modules/Markbook/markbook_edit_copy.php @@ -111,11 +111,11 @@ echo '
'; $form = Form::create('action', $session->get('absoluteURL').'/modules/Markbook/markbook_edit_copyProcess.php?gibbonCourseClassID='.$gibbonCourseClassID.'&gibbonMarkbookCopyClassID='.$gibbonMarkbookCopyClassID); - $form->setClass('fullWidth'); + $form->setClass('w-full'); $form->addHiddenValue('address', $session->get('address')); - $table = $form->addRow()->addTable()->setClass('fullWidth colorOddEven noMargin noPadding noBorder'); + $table = $form->addRow()->addTable()->setClass('w-full colorOddEven noMargin noPadding noBorder'); $header = $table->addHeaderRow(); $header->addCheckAll()->checked(true); diff --git a/modules/Markbook/markbook_edit_data.php b/modules/Markbook/markbook_edit_data.php index e1fcffcab5..fb4ffa0741 100644 --- a/modules/Markbook/markbook_edit_data.php +++ b/modules/Markbook/markbook_edit_data.php @@ -355,7 +355,7 @@ function enterKey(){ ->addParam('width', '1100') ->addParam('height', '550'); - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth colorOddEven noMargin noPadding noBorder'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full colorOddEven noMargin noPadding noBorder'); $detailsText = ($values['unitName'] != '')? $values['unitName'].'
' : ''; $detailsText .= !empty($values['completeDate'])? __('Marked on').' '.Format::date($values['completeDate']) : __('Unmarked'); @@ -378,7 +378,7 @@ function enterKey(){ $header->addTableCell($values['name']) ->setTitle($values['description']) - ->append('
'.$detailsText.'') + ->append('
'.$detailsText.'') ->setClass('textCenter') ->colSpan(5); diff --git a/modules/Markbook/markbook_edit_targets.php b/modules/Markbook/markbook_edit_targets.php index 95d7613a8e..7bb01e4120 100644 --- a/modules/Markbook/markbook_edit_targets.php +++ b/modules/Markbook/markbook_edit_targets.php @@ -90,7 +90,7 @@ $row->addLabel('gibbonScaleIDTarget', __('Target Scale')); $row->addSelectGradeScale('gibbonScaleIDTarget')->selected($selectedGradeScale); - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth colorOddEven noMargin noPadding'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full colorOddEven noMargin noPadding'); $header = $table->addHeaderRow(); $header->addContent(__('Student')); diff --git a/modules/Markbook/markbook_view_allClassesAllData.php b/modules/Markbook/markbook_view_allClassesAllData.php index 533a174f98..03ff7ffc3a 100644 --- a/modules/Markbook/markbook_view_allClassesAllData.php +++ b/modules/Markbook/markbook_view_allClassesAllData.php @@ -26,6 +26,8 @@ use Gibbon\Domain\System\SettingGateway; use Gibbon\Module\Markbook\MarkbookView; use Gibbon\Services\Format; +use Gibbon\Tables\DataTable; +use Gibbon\Forms\Form; // Lock the file so other scripts cannot call it if (MARKBOOK_VIEW_LOCK !== sha1( $highestAction . $session->get('gibbonPersonID') ) . date('zWy') ) return; @@ -124,17 +126,6 @@ 'courseClass' => Format::courseClassName($class['course'], $class['class']), ])); - //Add multiple columns - if ($multiAdd) { - $params = [ - "gibbonCourseClassID" => $gibbonCourseClassID - ]; - $page->navigator->addHeaderAction('addMulti', __('Add Multiple Columns')) - ->setURL('/modules/Markbook/markbook_edit_addMulti.php') - ->addParams($params) - ->setIcon('page_new_multi') - ->displayLabel(); - } //Get class chooser echo classChooser($guid, $pdo, $gibbonCourseClassID); @@ -181,22 +172,100 @@ // Load the columns for the current page $markbook->loadColumnsFromDataSet($columns); - if ($markbook == NULL || $markbook->getColumnCountTotal() < 1) { - echo "
"; - if (isActionAccessible($guid, $connection2, '/modules/Markbook/markbook_edit.php') and $canEditThisClass) { - echo "get('module')."/markbook_edit_add.php&gibbonCourseClassID=$gibbonCourseClassID'>".__('Add').""; - if ($markbook->getSetting('enableColumnWeighting') == 'Y') { - if (isActionAccessible($guid, $connection2, '/modules/Markbook/weighting_manage.php') == true) { - echo " | get('module')."/weighting_manage.php&gibbonCourseClassID=$gibbonCourseClassID'>".__('Weightings').""; - } - } - } - echo '
'; - echo "
"; - echo __('There are no records to display.'); - echo '
'; + // Display Pagination + echo "
"; + + // Print table header info + echo '

'; + if (!empty($teacherList)) { + echo ''.sprintf(__('Class taught by %1$s'), implode(', ', $teacherList) ).'.
'; + } + if ($markbook->getColumnCountTotal() > $markbook->getColumnsPerPage()) { + echo __('To see more detail on an item (such as a comment or a grade), hover your mouse over it. To see more columns, use the Newer and Older links.'); + } else { + echo __('To see more detail on an item (such as a comment or a grade), hover your mouse over it.'); + } + + if ($markbook->hasExternalAssessments() == true) { + echo ' '.__('The Baseline column is populated based on student performance in external assessments, and can be used as a reference point for the grades in the markbook.'); + } + echo '

'; + + // Display the Top Links + if (isActionAccessible($guid, $connection2, '/modules/Markbook/markbook_edit.php') and $canEditThisClass) { + echo ''; + echo ''; + + $form = Form::create('links', ''); + + $form->addHeaderAction('add', __('Add')) + ->setURL('/modules/Markbook/markbook_edit_add.php') + ->addParam('gibbonCourseClassID', $gibbonCourseClassID) + ->displayLabel(); + + if ($multiAdd) { + $form->addHeaderAction('addMulti', __('Add Multiple')) + ->setURL('/modules/Markbook/markbook_edit_addMulti.php') + ->addParam('gibbonCourseClassID', $gibbonCourseClassID) + ->setIcon('page_new_multi') + ->displayLabel(); + } + + $form->addHeaderAction('target', __('Targets')) + ->setURL('/modules/Markbook/markbook_edit_targets.php') + ->addParam('gibbonCourseClassID', $gibbonCourseClassID) + ->displayLabel(); + + if ($markbook->getSetting('enableColumnWeighting') == 'Y' && isActionAccessible($guid, $connection2, '/modules/Markbook/weighting_manage.php') == true) { + $form->addHeaderAction('config', __('Weightings')) + ->setURL('/modules/Markbook/weighting_manage.php') + ->addParam('gibbonCourseClassID', $gibbonCourseClassID) + ->displayLabel(); + } + + if ($markbook->getColumnCountTotal() > $markbook->getColumnsPerPage()) { + $form->addHeaderAction('refresh', __('Reset Order')) + ->onClick('resetOrder()') + ->setURL('#') + ->displayLabel(); + } + + if ($markbook->getColumnCountTotal() > 0) { + $form->addHeaderAction('export', __('Export')) + ->setURL('/modules/Markbook/markbook_viewExportAll.php') + ->addParam('gibbonCourseClassID', $gibbonCourseClassID) + ->addParam('return', 'markbook_view.php') + ->directLink() + ->displayLabel(); + } + + echo $form->getOutput(); + } + echo '
'; + + if ($markbook == NULL || $markbook->getColumnCountTotal() < 1) { + echo Format::alert(__('There are no records to display.'), 'empty'); + return; } else { + + if (isActionAccessible($guid, $connection2, '/modules/Markbook/markbook_view.php') ) { + // Cache all personalized target data $markbook->cachePersonalizedTargets( $gibbonCourseClassID ); @@ -211,31 +280,7 @@ $markbook->cacheExternalAssessments( $courseName, $gibbonYearGroupIDList ); } - echo '

'; - echo __('Results'); - echo '

'; - - // Print table header info - echo '

'; - if (!empty($teacherList)) { - echo ''.sprintf(__('Class taught by %1$s'), implode(', ', $teacherList) ).'. '; - } - if ($markbook->getColumnCountTotal() > $markbook->getColumnsPerPage()) { - echo __('To see more detail on an item (such as a comment or a grade), hover your mouse over it. To see more columns, use the Newer and Older links.'); - } else { - echo __('To see more detail on an item (such as a comment or a grade), hover your mouse over it.'); - } - - if ($markbook->hasExternalAssessments() == true) { - echo ' '.__('The Baseline column is populated based on student performance in external assessments, and can be used as a reference point for the grades in the markbook.'); - } - echo '

'; - - // Display Pagination - echo "
"; - if (isActionAccessible($guid, $connection2, '/modules/Markbook/markbook_view.php') ) { - - echo "
"; + echo "
"; echo ( ($session->get('markbookTerm') == -1)? __("All Terms") : $session->get('markbookTermName') ) ." : "; @@ -261,46 +306,10 @@ echo '
'; } - // Display the Top Links - if (isActionAccessible($guid, $connection2, '/modules/Markbook/markbook_edit.php') and $canEditThisClass) { - echo "get('module')."/markbook_edit_add.php&gibbonCourseClassID=$gibbonCourseClassID'>".__('Add')." | "; - echo ''; - echo ''; - echo "".__('Reset Order')." | "; - echo "get('module')."/markbook_edit_targets.php&gibbonCourseClassID=$gibbonCourseClassID'>".__('Targets')." | "; - if ($markbook->getSetting('enableColumnWeighting') == 'Y') { - if (isActionAccessible($guid, $connection2, '/modules/Markbook/weighting_manage.php') == true) { - echo "get('module')."/weighting_manage.php&gibbonCourseClassID=$gibbonCourseClassID'>".__('Weightings')." | "; - } - } - echo "".__('Export to Excel').""; - - } else { - echo '
'; - } - echo '
'; - // Check to see if we have no columns to display. This can happen if the page number is incorrect. // Do this here so users still have access to buttons. if ($markbook->getColumnCountThisPage() <= 0) { - echo "
"; - echo __('There are no records to display.'); - echo '
'; + echo Format::alert(__('There are no records to display.'), 'empty'); return; } @@ -664,7 +673,7 @@ function resetOrderAction(order){ ++$count; echo "
'; + echo ''; if ($studentOrderBy == 'rollOrder' && !empty($rowStudents['rollOrder']) ) { echo $rowStudents['rollOrder'].') '; diff --git a/modules/Markbook/markbook_view_myMarks.php b/modules/Markbook/markbook_view_myMarks.php index c2cf4d2f9d..c03f9dba33 100644 --- a/modules/Markbook/markbook_view_myMarks.php +++ b/modules/Markbook/markbook_view_myMarks.php @@ -83,7 +83,7 @@ } $form = Form::create('filter', $session->get('absoluteURL').'/index.php','get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/markbook_view.php'); @@ -128,7 +128,7 @@ $details = isset($_GET['details'])? $_GET['details'] : 'Yes'; $form->addHiddenValue('details', 'No'); $showHide = $form->getFactory()->createCheckbox('details')->addClass('details')->setValue('Yes')->checked($details)->inline(true) - ->description(__('Show/Hide Details'))->wrap(' ', '   '); + ->description(__('Show/Hide Details'))->wrap(' ', '   '); $rowFilter = $form->addRow(); $rowFilter->addSearchSubmit($session, __('Clear Filters'))->prepend($showHide->getOutput()); diff --git a/modules/Markbook/markbook_view_viewMyChildrensClasses.php b/modules/Markbook/markbook_view_viewMyChildrensClasses.php index 942bc29303..ed10a5827d 100644 --- a/modules/Markbook/markbook_view_viewMyChildrensClasses.php +++ b/modules/Markbook/markbook_view_viewMyChildrensClasses.php @@ -78,7 +78,7 @@ $gibbonPersonID = (isset($_GET['search']))? $_GET['search'] : null; $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth standardForm'); + $form->setClass('noIntBorder w-full standardForm'); $form->addHiddenValue('q', '/modules/Markbook/markbook_view.php'); $form->addHiddenValue('address', $session->get('address')); @@ -152,7 +152,7 @@ } $form = Form::create('filter', $session->get('absoluteURL').'/index.php','get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/markbook_view.php'); $form->addHiddenValue('search', $gibbonPersonID); @@ -198,7 +198,7 @@ $details = isset($_GET['details'])? $_GET['details'] : 'Yes'; $form->addHiddenValue('details', 'No'); $showHide = $form->getFactory()->createCheckbox('details')->addClass('details')->setValue('Yes')->checked($details)->inline(true) - ->description(__('Show/Hide Details'))->wrap(' ', ''); + ->description(__('Show/Hide Details'))->wrap(' ', ''); $rowFilter = $form->addRow(); $rowFilter->addSearchSubmit($session, __('Clear Filters'), array('search'))->prepend($showHide->getOutput()); diff --git a/modules/Markbook/moduleFunctions.php b/modules/Markbook/moduleFunctions.php index 9d30cf9079..d0c4c664cf 100644 --- a/modules/Markbook/moduleFunctions.php +++ b/modules/Markbook/moduleFunctions.php @@ -40,17 +40,20 @@ function sidebarExtra($guid, $pdo, $gibbonPersonID, $gibbonCourseClassID = '', $ $output .= __('Choose A Class'); $output .= ''; - $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); + $form = Form::createBlank('searchForm', $session->get('absoluteURL').'/index.php', 'get')->enableQuickSubmit(); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('q', '/modules/Markbook/'.$basePage); - $form->setClass('smallIntBorder w-full'); - $row = $form->addRow(); + $row = $form->addRow()->addClass('flex'); $row->addSelectClass('gibbonCourseClassID', $session->get('gibbonSchoolYearID'), $gibbonPersonID) ->selected($gibbonCourseClassID) ->placeholder() - ->setClass('fullWidth'); - $row->addSubmit(__('Go')); + ->groupAlign('left') + ->setClass('flex-grow'); + $row->addSubmit(__('Go')) + ->setType('quickSubmit') + ->groupAlign('right') + ->setClass('flex'); $output .= $form->getOutput(); $output .= ''; @@ -69,22 +72,22 @@ function classChooser($guid, $pdo, $gibbonCourseClassID) $output = ''; - $output .= "

"; - $output .= __('Choose Class'); - $output .= '

'; + // $output .= "

"; + // $output .= __('Choose Class'); + // $output .= '

'; - $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); + $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get')->enableQuickSubmit(); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/markbook_view.php'); - $col = $form->addRow()->addColumn()->addClass('inline right'); + $col = $form->addRow(); // SEARCH $search = $_GET['search'] ?? ''; - $col->addContent(__('Search').':'); + $col->addContent(__('Search').':')->setClass('flex-shrink'); $col->addTextField('search') ->setClass('shortWidth') ->setValue($search); @@ -108,7 +111,7 @@ function classChooser($guid, $pdo, $gibbonCourseClassID) $result = $pdo->executeQuery($data, $sql); $terms = ($result->rowCount() > 0)? $result->fetchAll(\PDO::FETCH_KEY_PAIR) : array(); - $col->addContent(__('Term').':')->prepend('  '); + $col->addContent(__('Term').':')->setClass('flex-shrink'); $col->addSelect('gibbonSchoolYearTermID') ->fromArray(array('-1' => __('All Terms'))) ->fromArray($terms) @@ -136,7 +139,7 @@ function classChooser($guid, $pdo, $gibbonCourseClassID) 'surname' => __('Surname'), 'preferredName' => __('Preferred Name'), ); - $col->addContent(__('Sort By').':')->prepend('  '); + $col->addContent(__('Sort By').':')->setClass('flex-shrink'); $col->addSelect('markbookOrderBy')->fromArray($orderBy)->selected($selectOrderBy)->setClass('shortWidth'); $session->set('markbookOrderBy', $selectOrderBy); @@ -154,23 +157,23 @@ function classChooser($guid, $pdo, $gibbonCourseClassID) $filters['marked'] = __('Marked'); $filters['unmarked'] = __('Unmarked'); - $col->addContent(__('Show').':')->prepend('  '); + $col->addContent(__('Show').':')->setClass('flex-shrink'); $col->addSelect('markbookFilter') ->fromArray($filters) ->selected($selectFilter) ->setClass('shortWidth'); // CLASS - $col->addContent(__('Class').':')->prepend('  '); + $col->addContent(__('Class').':')->setClass('flex-shrink'); $col->addSelectClass('gibbonCourseClassID', $session->get('gibbonSchoolYearID'), $session->get('gibbonPersonID')) ->setClass('mediumWidth') ->selected($gibbonCourseClassID); - $col->addSubmit(__('Go')); + $col->addSubmit(__('Go'))->setClass('max-w-24'); if (!empty($search)) { $clearURL = $session->get('absoluteURL').'/index.php?q='.$session->get('address'); - $clearLink = sprintf('%s  ', $clearURL, __('Clear Search')); + $clearLink = sprintf('%s  ', $clearURL, __('Clear Search')); $form->addRow()->addContent($clearLink)->addClass('right'); } diff --git a/modules/Markbook/weighting_manage.php b/modules/Markbook/weighting_manage.php index 62dbcf5f77..0995b04f09 100644 --- a/modules/Markbook/weighting_manage.php +++ b/modules/Markbook/weighting_manage.php @@ -264,7 +264,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/modules/'.$session->get('module').'/weighting_manage_copyProcess.php?gibbonCourseClassID='.$gibbonCourseClassID); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $col = $form->addRow()->addColumn()->addClass('inline right'); $col->addContent(__('Copy from').' '.__('Class').':'); diff --git a/modules/Messenger/groups_manage.php b/modules/Messenger/groups_manage.php index fc7cdc6604..d35804a331 100644 --- a/modules/Messenger/groups_manage.php +++ b/modules/Messenger/groups_manage.php @@ -58,7 +58,7 @@ // SEARCH FORM $searchForm = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $searchForm->setClass('noIntBorder fullWidth'); + $searchForm->setClass('noIntBorder w-full'); $searchForm->addHiddenValue('address', $session->get('address')); $searchForm->addHiddenValue('q', '/modules/Messenger/groups_manage.php'); diff --git a/modules/Messenger/messageWall_view.php b/modules/Messenger/messageWall_view.php index b61e1e2244..a195513539 100644 --- a/modules/Messenger/messageWall_view.php +++ b/modules/Messenger/messageWall_view.php @@ -29,10 +29,9 @@ //Acess denied $page->addError(__('Your request failed because you do not have access to this action.')); } else { - $dateFormat = $session->get('i18n')['dateFormatPHP']; - $date = isset($_REQUEST['date'])? $_REQUEST['date'] : date($dateFormat); + $date = isset($_REQUEST['date'])? $_REQUEST['date'] : date('Y-m-d'); - $page->breadcrumbs->add(($date === date($dateFormat)) ? + $page->breadcrumbs->add(($date === date('Y-m-d')) ? __('Today\'s Messages').' ('.$date.')' : __('View Messages').' ('.$date.')'); @@ -55,24 +54,27 @@ } - $form = Form::create('action', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/messageWall_view.php'); - $form->setClass('blank fullWidth'); + $form = Form::createBlank('action', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/messageWall_view.php'); $form->addHiddenValue('address', $session->get('address')); $row = $form->addRow()->addClass('flex flex-wrap'); $link = $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/messageWall_view.php'; - $prevDay = DateTime::createFromFormat($dateFormat, $date)->modify('-1 day')->format($dateFormat); - $nextDay = DateTime::createFromFormat($dateFormat, $date)->modify('+1 day')->format($dateFormat); + $prevDay = DateTime::createFromFormat('Y-m-d', $date)->modify('-1 day')->format('Y-m-d'); + $nextDay = DateTime::createFromFormat('Y-m-d', $date)->modify('+1 day')->format('Y-m-d'); $col = $row->addColumn()->addClass('flex-1 flex items-center'); - $col->addButton(__('Previous Day'))->addClass('buttonLink mr-px rounded-l-sm hover:bg-gray-400')->onClick("window.location.href='{$link}&date={$prevDay}'"); - $col->addButton(__('Next Day'))->addClass('buttonLink rounded-r-sm hover:bg-gray-400')->onClick("window.location.href='{$link}&date={$nextDay}'"); + $col->addButton(__('Previous Day')) + ->groupAlign('left') + ->onClick("window.location.href='{$link}&date={$prevDay}'"); + $col->addButton(__('Next Day')) + ->groupAlign('right') + ->onClick("window.location.href='{$link}&date={$nextDay}'"); $col = $row->addColumn()->addClass('flex items-center justify-end'); - $col->addDate('date')->setValue($date)->setClass('shortWidth'); - $col->addSubmit(__('Go')); + $col->addDate('date')->setValue($date)->setClass('shortWidth')->groupAlign('left'); + $col->addSubmit(__('Go'))->groupAlign('right'); echo $form->getOutput(); diff --git a/modules/Messenger/messenger_manage.php b/modules/Messenger/messenger_manage.php index 74c94ed8f3..1965f85a11 100644 --- a/modules/Messenger/messenger_manage.php +++ b/modules/Messenger/messenger_manage.php @@ -48,7 +48,7 @@ ->fromPOST(); $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setTitle(__('Search')); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/messenger_manage.php'); @@ -83,8 +83,7 @@ ->setURL('/modules/Messenger/messenger_postQuickWall.php') ->setIcon('page_new') ->addParam('search', $search) - ->displayLabel() - ->prepend(' | '); + ->displayLabel(); } $table->modifyRows(function($values, $row) { @@ -276,7 +275,7 @@ if (!is_null($values['emailReceipt']) && $values['status'] == 'Sent') { $actions->addAction('send', __('View Send Report')) ->setURL('/modules/Messenger/messenger_manage_report.php') - ->setIcon('target'); + ->setIcon('document-check'); } }); diff --git a/modules/Messenger/messenger_manage_edit.php b/modules/Messenger/messenger_manage_edit.php index 0b9f2cabf4..b3309599cd 100644 --- a/modules/Messenger/messenger_manage_edit.php +++ b/modules/Messenger/messenger_manage_edit.php @@ -78,19 +78,17 @@ } ?> diff --git a/modules/Messenger/messenger_manage_report.php b/modules/Messenger/messenger_manage_report.php index e40b99c960..578cfc1bc5 100644 --- a/modules/Messenger/messenger_manage_report.php +++ b/modules/Messenger/messenger_manage_report.php @@ -56,34 +56,21 @@ if ($result->rowCount() < 1) { $page->addError(__('The specified record cannot be found.')); - } - else { + } else { $values = $result->fetch(); - ?> - - - return->addReturns(['error2' => 'Some elements of your request failed, but others were successful.']); // Create a reusable confirmation closure - $icon = ''; - $confirmationIndicator = function($recipient, $emailReceipt = false) use ($icon) { + $confirmationIndicator = function($recipient, $emailReceipt = false) { if ($emailReceipt == 'N') return ''; - if (empty($recipient['key'])) return __('N/A'); - return sprintf($icon, $recipient['confirmed'] == 'Y'? 'iconTick.png' : 'iconCross.png').' '.Format::small(Format::yesNo($recipient['confirmed'])); + if (empty($recipient['key'])) return ''; + + $icon = $recipient['confirmed'] == 'Y' + ? icon('solid', 'check', 'size-6 mr-2 fill-current text-green-600') + : icon('solid', 'cross', 'size-6 mr-2 fill-current text-red-700'); + + return Format::tooltip($icon, Format::yesNo($recipient['confirmed'])); }; $sender = false; @@ -127,14 +114,14 @@ } // Auto-submitting form to select the confirmation mode - $form = Form::create('filters', $session->get('absoluteURL') . '/index.php', 'get'); + $form = Form::create('filters', $session->get('absoluteURL') . '/index.php', 'get')->enableQuickSubmit()->setAttribute('hx-trigger', 'change from:#confirmationMode'); $form->addHiddenValue('q', '/modules/Messenger/messenger_manage_report.php'); $form->addHiddenValue('gibbonMessengerID', $gibbonMessengerID); $form->addHiddenValue('search', $search); $form->addHiddenValue('sidebar', 'true'); - $form->setClass('noIntBorder fullWidth auto-submit pb-1'); + $form->setClass('noIntBorder w-full pb-1'); $row = $form->addRow(); $row->addLabel('subjectLabel', __('Message')); @@ -164,267 +151,275 @@ echo $form->getOutput(); } - echo "
"; - //Tab links - echo ''; - - //Tab content - echo "
"; - - $data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'), 'today' => date('Y-m-d')); - $sql = "SELECT gibbonFormGroup.nameShort AS formGroup, gibbonPerson.gibbonPersonID, gibbonPerson.surname, gibbonPerson.preferredName, gibbonFamilyChild.gibbonFamilyID, parent1.email AS parent1email, parent1.surname AS parent1surname, parent1.preferredName AS parent1preferredName, parent1.gibbonPersonID AS parent1gibbonPersonID, parent2.email AS parent2email, parent2.surname AS parent2surname, parent2.preferredName AS parent2preferredName, parent2.gibbonPersonID AS parent2gibbonPersonID - FROM gibbonPerson - JOIN gibbonStudentEnrolment ON (gibbonStudentEnrolment.gibbonPersonID=gibbonPerson.gibbonPersonID) - JOIN gibbonFormGroup ON (gibbonStudentEnrolment.gibbonFormGroupID=gibbonFormGroup.gibbonFormGroupID) - LEFT JOIN gibbonFamilyChild ON (gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID) - LEFT JOIN gibbonFamilyAdult AS parent1Fam ON (parent1Fam.gibbonFamilyID=gibbonFamilyChild.gibbonFamilyID AND parent1Fam.contactPriority=1) - LEFT JOIN gibbonPerson AS parent1 ON (parent1Fam.gibbonPersonID=parent1.gibbonPersonID AND parent1.status='Full' AND NOT parent1.surname IS NULL) - LEFT JOIN gibbonFamilyAdult AS parent2Fam ON (parent2Fam.gibbonFamilyID=gibbonFamilyChild.gibbonFamilyID AND parent2Fam.contactPriority=2 AND parent2Fam.contactEmail='Y') - LEFT JOIN gibbonPerson AS parent2 ON (parent2Fam.gibbonPersonID=parent2.gibbonPersonID AND parent2.status='Full' AND NOT parent2.surname IS NULL) - WHERE gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID - AND gibbonPerson.status='Full' - AND (gibbonPerson.dateStart IS NULL OR gibbonPerson.dateStart<=:today) AND (gibbonPerson.dateEnd IS NULL OR gibbonPerson.dateEnd>=:today) - GROUP BY gibbonPerson.gibbonPersonID - ORDER BY formGroup, gibbonPerson.surname, gibbonPerson.preferredName, gibbonFamilyChild.gibbonFamilyID"; - $result = $connection2->prepare($sql); - $result->execute($data); - - if ($result->rowCount() < 1) { - echo $page->getBlankSlate(); - } else { - //Store receipt for this message data in an array - - $dataReceipts = array('gibbonMessengerID' => $gibbonMessengerID); - $sqlReceipts = "SELECT gibbonPersonID, gibbonMessengerReceiptID, confirmed, sent, `key`, gibbonPersonIDListStudent FROM gibbonMessengerReceipt WHERE gibbonMessengerID=:gibbonMessengerID"; - $resultReceipts = $connection2->prepare($sqlReceipts); - $resultReceipts->execute($dataReceipts); - $receipts = $resultReceipts->fetchAll(\PDO::FETCH_GROUP|\PDO::FETCH_UNIQUE); - - $form = BulkActionForm::create('resendByRecipient', $session->get('absoluteURL') . '/modules/' . $session->get('module') . '/messenger_manage_report_processBulk.php?gibbonMessengerID='.$gibbonMessengerID.'&search='.$search); - $form->addHiddenValue('address', $session->get('address')); - - if ($sender) { - $row = $form->addBulkActionRow(array('resend' => __('Resend')))->addClass('flex justify-end'); - $row->addSubmit(__('Go')); - } + // TABS + $tabs = []; + + + $data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'), 'today' => date('Y-m-d')); + $sql = "SELECT gibbonFormGroup.nameShort AS formGroup, gibbonPerson.gibbonPersonID, gibbonPerson.surname, gibbonPerson.preferredName, gibbonFamilyChild.gibbonFamilyID, parent1.email AS parent1email, parent1.surname AS parent1surname, parent1.preferredName AS parent1preferredName, parent1.gibbonPersonID AS parent1gibbonPersonID, parent2.email AS parent2email, parent2.surname AS parent2surname, parent2.preferredName AS parent2preferredName, parent2.gibbonPersonID AS parent2gibbonPersonID + FROM gibbonPerson + JOIN gibbonStudentEnrolment ON (gibbonStudentEnrolment.gibbonPersonID=gibbonPerson.gibbonPersonID) + JOIN gibbonFormGroup ON (gibbonStudentEnrolment.gibbonFormGroupID=gibbonFormGroup.gibbonFormGroupID) + LEFT JOIN gibbonFamilyChild ON (gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID) + LEFT JOIN gibbonFamilyAdult AS parent1Fam ON (parent1Fam.gibbonFamilyID=gibbonFamilyChild.gibbonFamilyID AND parent1Fam.contactPriority=1) + LEFT JOIN gibbonPerson AS parent1 ON (parent1Fam.gibbonPersonID=parent1.gibbonPersonID AND parent1.status='Full' AND NOT parent1.surname IS NULL) + LEFT JOIN gibbonFamilyAdult AS parent2Fam ON (parent2Fam.gibbonFamilyID=gibbonFamilyChild.gibbonFamilyID AND parent2Fam.contactPriority=2 AND parent2Fam.contactEmail='Y') + LEFT JOIN gibbonPerson AS parent2 ON (parent2Fam.gibbonPersonID=parent2.gibbonPersonID AND parent2.status='Full' AND NOT parent2.surname IS NULL) + WHERE gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID + AND gibbonPerson.status='Full' + AND (gibbonPerson.dateStart IS NULL OR gibbonPerson.dateStart<=:today) AND (gibbonPerson.dateEnd IS NULL OR gibbonPerson.dateEnd>=:today) + GROUP BY gibbonPerson.gibbonPersonID + ORDER BY formGroup, gibbonPerson.surname, gibbonPerson.preferredName, gibbonFamilyChild.gibbonFamilyID"; + $result = $connection2->prepare($sql); + $result->execute($data); + + if ($result->rowCount() < 1) { + // echo $page->getBlankSlate(); + } else { + //Store receipt for this message data in an array + + $dataReceipts = array('gibbonMessengerID' => $gibbonMessengerID); + $sqlReceipts = "SELECT gibbonPersonID, gibbonMessengerReceiptID, confirmed, sent, `key`, gibbonPersonIDListStudent FROM gibbonMessengerReceipt WHERE gibbonMessengerID=:gibbonMessengerID"; + $resultReceipts = $connection2->prepare($sqlReceipts); + $resultReceipts->execute($dataReceipts); + $receipts = $resultReceipts->fetchAll(\PDO::FETCH_GROUP|\PDO::FETCH_UNIQUE); + + $form = BulkActionForm::create('resendByRecipient', $session->get('absoluteURL') . '/modules/' . $session->get('module') . '/messenger_manage_report_processBulk.php?gibbonMessengerID='.$gibbonMessengerID.'&search='.$search); + $form->addHiddenValue('address', $session->get('address')); + + if ($sender) { + $row = $form->addBulkActionRow(array('resend' => __('Resend')))->addClass('flex justify-end'); + $row->addSubmit(__('Go')); + } - $formGroups = $result->fetchAll(\PDO::FETCH_GROUP); - $countTotal = 0; - - // Merge gibbonPersonIDListStudent into $receipts as an array - $receipts = array_map(function ($item) { - $item['gibbonPersonIDListStudent'] = (empty($item['gibbonPersonIDListStudent'])) ? null : explode(',', $item['gibbonPersonIDListStudent']); - return $item; - }, $receipts); - - foreach ($formGroups as $formGroupName => $recipients) { - $count = 0; - - // Filter the array for only those individuals involved in the message (student or parent) - $recipients = array_filter($recipients, function($recipient) use (&$receipts) { - if (array_key_exists($recipient['gibbonPersonID'], $receipts)) { - return true; - } - - if (array_key_exists($recipient['parent1gibbonPersonID'], $receipts) - && (is_null($receipts[$recipient['parent1gibbonPersonID']]['gibbonPersonIDListStudent']) || in_array($recipient['gibbonPersonID'], $receipts[$recipient['parent1gibbonPersonID']]['gibbonPersonIDListStudent']))) { - return true; - } - - if (array_key_exists($recipient['parent2gibbonPersonID'], $receipts) - && (is_null($receipts[$recipient['parent2gibbonPersonID']]['gibbonPersonIDListStudent']) || in_array($recipient['gibbonPersonID'], $receipts[$recipient['parent2gibbonPersonID']]['gibbonPersonIDListStudent']))) { - return true; - } - - return false; - }); - - //print_r($recipients);exit; - - // Skip this form group if there's no involved individuals - if (empty($recipients)) continue; - - $form->addRow()->addHeading($formGroupName); - $table = $form->addRow()->addTable()->setClass('colorOddEven fullWidth'); - - $header = $table->addHeaderRow(); - $header->addContent(__('Total Count')); - $header->addContent(__('Form Count')); - $header->addContent(__('Student'))->addClass('mediumWidth'); - $header->addContent(__('Parent 1'))->addClass('mediumWidth'); - $header->addContent(__('Parent 2'))->addClass('mediumWidth'); - - foreach ($recipients as $recipient) { - // print_r($recipient); - // echo "

"; - - $countTotal++; - $count++; - - $studentName = Format::name('', $recipient['preferredName'], $recipient['surname'], 'Student', true); - $parent1Name = Format::name('', $recipient['parent1preferredName'], $recipient['parent1surname'], 'Parent', true); - $parent2Name = Format::name('', $recipient['parent2preferredName'], $recipient['parent2surname'], 'Parent', true); - - //Tests for row completion, to set colour - $studentReceived = isset($receipts[$recipient['gibbonPersonID']]); - if ($studentReceived) { - $studentComplete = ($receipts[$recipient['gibbonPersonID']]['confirmed'] == "Y"); - } else { - $studentComplete = false; - } - - $parentReceived = (isset($receipts[$recipient['parent1gibbonPersonID']]) || isset($receipts[$recipient['parent2gibbonPersonID']])); - if ($parentReceived) { - $parentComplete = ((isset($receipts[$recipient['parent1gibbonPersonID']]) && $receipts[$recipient['parent1gibbonPersonID']]['confirmed'] == "Y") || (isset($receipts[$recipient['parent2gibbonPersonID']]) && $receipts[$recipient['parent2gibbonPersonID']]['confirmed'] == "Y")); - $bothParentsComplete = ((isset($receipts[$recipient['parent1gibbonPersonID']]) && $receipts[$recipient['parent1gibbonPersonID']]['confirmed'] == "Y") && (!isset($receipts[$recipient['parent2gibbonPersonID']]) || $receipts[$recipient['parent2gibbonPersonID']]['confirmed'] == "Y")); - } - else { - $parentComplete = false; - $bothParentsComplete = false; - } - $class = $values['emailReceipt'] == 'Y' ? 'error' : ''; - - if ($confirmationMode == 'All' && $studentComplete && $parentComplete) { - $class = 'current'; - } elseif ($confirmationMode == 'One' && $parentComplete) { - $class = 'current'; - } elseif ($confirmationMode == 'Both' && $bothParentsComplete) { - $class = 'current'; - } elseif ($confirmationMode == 'Any' && ($studentComplete || $parentComplete)) { - $class = 'current'; - } - - $row = $table->addRow()->setClass($class); - $row->addContent($countTotal); - $row->addContent($count); - - $studentReceipt = isset($receipts[$recipient['gibbonPersonID']])? $receipts[$recipient['gibbonPersonID']] : null; - $col = $row->addColumn()->addClass(!empty($studentReceipt) && $studentReceipt['confirmed'] != 'Y' && $studentReceipt['sent'] != 'Y' ? 'bg-orange-300' : ''); - $col->addContent(!empty($studentName)? $studentName : __('N/A')); - $col->addContent($confirmationIndicator($studentReceipt, $values['emailReceipt'])); - $col->onlyIf($sender == true && !empty($studentReceipt) && ($studentReceipt['confirmed'] == 'N' || $values['emailReceipt'] == 'N')) - ->addCheckbox('gibbonMessengerReceiptIDs[]') - ->setValue($studentReceipt['gibbonMessengerReceiptID'] ?? '') - ->setClass('') - ->alignLeft(); - - $parent1Receipt = isset($receipts[$recipient['parent1gibbonPersonID']])? $receipts[$recipient['parent1gibbonPersonID']] : null; - $col = $row->addColumn()->addClass(!empty($parent1Receipt) && $parent1Receipt['confirmed'] != 'Y' && $parent1Receipt['sent'] != 'Y' ? 'bg-orange-300' : ''); - $col->addContent(!empty($recipient['parent1surname'])? $parent1Name : __('N/A')); - $col->addContent($confirmationIndicator($parent1Receipt, $values['emailReceipt'])); - $col->onlyIf($sender == true && !empty($parent1Receipt) && ($parent1Receipt['confirmed'] == 'N' || $values['emailReceipt'] == 'N')) - ->addCheckbox('gibbonMessengerReceiptIDs[]') - ->setValue($parent1Receipt['gibbonMessengerReceiptID'] ?? '') - ->setClass('') - ->alignLeft(); - - $parent2Receipt = isset($receipts[$recipient['parent2gibbonPersonID']])? $receipts[$recipient['parent2gibbonPersonID']] : null; - $col = $row->addColumn()->addClass(!empty($parent2Receipt) && $parent2Receipt['confirmed'] != 'Y' && $parent2Receipt['sent'] != 'Y' ? 'bg-orange-300' : ''); - $col->addContent(!empty($recipient['parent2surname'])? $parent2Name : __('N/A')); - $col->addContent($confirmationIndicator($parent2Receipt, $values['emailReceipt'])); - $col->onlyIf($sender == true && !empty($parent2Receipt) && ($parent2Receipt['confirmed'] == 'N' || $values['emailReceipt'] == 'N')) - ->addCheckbox('gibbonMessengerReceiptIDs[]') - ->setValue($parent2Receipt['gibbonMessengerReceiptID'] ?? '') - ->setClass('') - ->alignLeft(); - } - } + $formGroups = $result->fetchAll(\PDO::FETCH_GROUP); + $countTotal = 0; + + // Merge gibbonPersonIDListStudent into $receipts as an array + $receipts = array_map(function ($item) { + $item['gibbonPersonIDListStudent'] = (empty($item['gibbonPersonIDListStudent'])) ? null : explode(',', $item['gibbonPersonIDListStudent']); + return $item; + }, $receipts); - if ($countTotal == 0) { - $table = $form->addRow()->addTable()->setClass('colorOddEven fullWidth'); - $table->addRow()->addTableCell(__('There are no records to display.'))->colSpan(8); + foreach ($formGroups as $formGroupName => $recipients) { + $count = 0; + + // Filter the array for only those individuals involved in the message (student or parent) + $recipients = array_filter($recipients, function($recipient) use (&$receipts) { + if (array_key_exists($recipient['gibbonPersonID'], $receipts)) { + return true; } - echo $form->getOutput(); - } - echo "
"; - echo "
"; - if (!is_null($gibbonMessengerID)) { - - $data = array('gibbonMessengerID' => $gibbonMessengerID); - $sql = "SELECT surname, preferredName, gibbonPerson.gibbonPersonID, gibbonMessenger.*, gibbonMessengerReceipt.*, gibbonRole.category as roleCategory - FROM gibbonMessengerReceipt - JOIN gibbonMessenger ON (gibbonMessengerReceipt.gibbonMessengerID=gibbonMessenger.gibbonMessengerID) - LEFT JOIN gibbonPerson ON (gibbonMessengerReceipt.gibbonPersonID=gibbonPerson.gibbonPersonID) - LEFT JOIN gibbonRole ON (gibbonRole.gibbonRoleID=gibbonPerson.gibbonRoleIDPrimary) - WHERE gibbonMessengerReceipt.gibbonMessengerID=:gibbonMessengerID ORDER BY FIELD(confirmed, 'Y','N',NULL), confirmedTimestamp, surname, preferredName, contactType"; - $result = $connection2->prepare($sql); - $result->execute($data); - - $form = BulkActionForm::create('resendByRecipient', $session->get('absoluteURL') . '/modules/' . $session->get('module') . '/messenger_manage_report_processBulk.php?gibbonMessengerID='.$gibbonMessengerID.'&search='.$search); - - $form->addHiddenValue('address', $session->get('address')); - - if ($sender) { - $row = $form->addBulkActionRow(array('resend' => __('Resend')))->addClass('flex justify-end');; - $row->addSubmit(__('Go')); + if (array_key_exists($recipient['parent1gibbonPersonID'], $receipts) + && (is_null($receipts[$recipient['parent1gibbonPersonID']]['gibbonPersonIDListStudent']) || in_array($recipient['gibbonPersonID'], $receipts[$recipient['parent1gibbonPersonID']]['gibbonPersonIDListStudent']))) { + return true; } - $table = $form->addRow()->addTable()->setClass('colorOddEven fullWidth'); - - $header = $table->addHeaderRow(); - $header->addContent(); - $header->addContent(__('Recipient')); - $header->addContent(__('Role')); - $header->addContent(__('Contact Type')); - $header->addContent(__('Contact Detail')); - $header->addContent(__('Sent')); - $header->addContent(__('Receipt Confirmed')); - $header->addContent(__('Timestamp')); - if ($sender == true) { - $header->addCheckAll(); - } - - - $recipients = $result->fetchAll(); - $recipientIDs = array_column($recipients, 'gibbonPersonID'); - - foreach ($recipients as $count => $recipient) { - $row = $table->addRow()->addClass($recipient['confirmed'] != 'Y' && $recipient['sent'] != 'Y' ? 'warning' : ''); - $row->addContent($count+1); - $row->addContent(($recipient['preferredName'] != '' && $recipient['surname'] != '') ? Format::name('', $recipient['preferredName'], $recipient['surname'], 'Student', true) : __('N/A')); - $row->addContent($recipient['roleCategory']); - $row->addContent($recipient['contactType']); - $row->addContent($recipient['contactDetail']); - $row->addContent(Format::yesNo($recipient['sent'])); - $row->addContent($confirmationIndicator($recipient)); - $row->addContent(!empty($recipient['confirmedTimestamp']) ? Format::date(substr($recipient['confirmedTimestamp'],0,10)).' '.substr($recipient['confirmedTimestamp'],11,5) : ''); - - if ($sender == true && $recipient['contactType'] == 'Email') { - $row->onlyIf($recipient['confirmed'] == 'N' || $values['emailReceipt'] == 'N') - ->addCheckbox('gibbonMessengerReceiptIDs[]') - ->setValue($recipient['gibbonMessengerReceiptID']) - ->addClass('bulkCheckbox') - ->alignCenter(); - - $row->onlyIf($recipient['confirmed'] != 'N' && $values['emailReceipt'] == 'Y')->addContent(); - } else { - $row->addContent(); - } - - if (is_null($recipient['key'])) $nonConfirm++; - else if ($recipient['confirmed'] == 'Y') $yesConfirm++; - else if ($recipient['confirmed'] == 'N') $noConfirm++; + if (array_key_exists($recipient['parent2gibbonPersonID'], $receipts) + && (is_null($receipts[$recipient['parent2gibbonPersonID']]['gibbonPersonIDListStudent']) || in_array($recipient['gibbonPersonID'], $receipts[$recipient['parent2gibbonPersonID']]['gibbonPersonIDListStudent']))) { + return true; } - if (count($recipients) == 0) { - $table->addRow()->addTableCell(__('There are no records to display.'))->colSpan(8); + return false; + }); + + //print_r($recipients);exit; + + // Skip this form group if there's no involved individuals + if (empty($recipients)) continue; + + $form->addRow()->addHeading($formGroupName); + $table = $form->addRow()->addTable()->setClass('colorOddEven w-full'); + + $header = $table->addHeaderRow(); + $header->addContent(__('Total Count')); + $header->addContent(__('Form Count')); + $header->addContent(__('Student'))->addClass('w-1/4'); + $header->addContent(__('Parent 1'))->addClass('w-1/4'); + $header->addContent(__('Parent 2'))->addClass('w-1/4'); + + foreach ($recipients as $recipient) { + // print_r($recipient); + // echo "

"; + + $countTotal++; + $count++; + + $studentName = Format::name('', $recipient['preferredName'], $recipient['surname'], 'Student', true); + $parent1Name = Format::name('', $recipient['parent1preferredName'], $recipient['parent1surname'], 'Parent', true); + $parent2Name = Format::name('', $recipient['parent2preferredName'], $recipient['parent2surname'], 'Parent', true); + + //Tests for row completion, to set colour + $studentReceived = isset($receipts[$recipient['gibbonPersonID']]); + if ($studentReceived) { + $studentComplete = ($receipts[$recipient['gibbonPersonID']]['confirmed'] == "Y"); } else { - $sendReport = ''.__('Total Messages:')." ".count($recipients)."
"; - $sendReport .= "".__('Messages not eligible for confirmation of receipt:')." $nonConfirm
"; - $sendReport .= "".__('Messages confirmed:').' '.$yesConfirm.'
'; - $sendReport .= "".__('Messages not yet confirmed:').' '.$noConfirm.'
'; + $studentComplete = false; + } - $form->addRow()->addClass('right')->addAlert($sendReport, 'success'); + $parentReceived = (isset($receipts[$recipient['parent1gibbonPersonID']]) || isset($receipts[$recipient['parent2gibbonPersonID']])); + if ($parentReceived) { + $parentComplete = ((isset($receipts[$recipient['parent1gibbonPersonID']]) && $receipts[$recipient['parent1gibbonPersonID']]['confirmed'] == "Y") || (isset($receipts[$recipient['parent2gibbonPersonID']]) && $receipts[$recipient['parent2gibbonPersonID']]['confirmed'] == "Y")); + $bothParentsComplete = ((isset($receipts[$recipient['parent1gibbonPersonID']]) && $receipts[$recipient['parent1gibbonPersonID']]['confirmed'] == "Y") && (!isset($receipts[$recipient['parent2gibbonPersonID']]) || $receipts[$recipient['parent2gibbonPersonID']]['confirmed'] == "Y")); } + else { + $parentComplete = false; + $bothParentsComplete = false; + } + $class = $values['emailReceipt'] == 'Y' ? 'error' : ''; + + if ($confirmationMode == 'All' && $studentComplete && $parentComplete) { + $class = 'current'; + } elseif ($confirmationMode == 'One' && $parentComplete) { + $class = 'current'; + } elseif ($confirmationMode == 'Both' && $bothParentsComplete) { + $class = 'current'; + } elseif ($confirmationMode == 'Any' && ($studentComplete || $parentComplete)) { + $class = 'current'; + } + + $row = $table->addRow()->setClass($class); + $row->addContent($countTotal); + $row->addContent($count); + + $studentReceipt = isset($receipts[$recipient['gibbonPersonID']])? $receipts[$recipient['gibbonPersonID']] : null; + $col = $row->addColumn()->addColumn()->setClass('flex items-center justify-start')->addClass(!empty($studentReceipt) && $studentReceipt['confirmed'] != 'Y' && $studentReceipt['sent'] != 'Y' ? 'bg-orange-300' : ''); + $col->addContent($confirmationIndicator($studentReceipt, $values['emailReceipt'])); + $col->onlyIf($sender == true && !empty($studentReceipt) && ($studentReceipt['confirmed'] == 'N' || $values['emailReceipt'] == 'N')) + ->addCheckbox('gibbonMessengerReceiptIDs[]') + ->setValue($studentReceipt['gibbonMessengerReceiptID'] ?? '') + ->setClass('') + ->alignLeft(); + $col->addContent(!empty($studentName)? $studentName : __('N/A'))->addClass('w-full'); + + $parent1Receipt = isset($receipts[$recipient['parent1gibbonPersonID']])? $receipts[$recipient['parent1gibbonPersonID']] : null; + $col = $row->addColumn()->addColumn()->setClass('flex items-center justify-start')->addClass(!empty($parent1Receipt) && $parent1Receipt['confirmed'] != 'Y' && $parent1Receipt['sent'] != 'Y' ? 'bg-orange-300' : ''); + $col->addContent($confirmationIndicator($parent1Receipt, $values['emailReceipt'])); + $col->onlyIf($sender == true && !empty($parent1Receipt) && ($parent1Receipt['confirmed'] == 'N' || $values['emailReceipt'] == 'N')) + ->addCheckbox('gibbonMessengerReceiptIDs[]') + ->setValue($parent1Receipt['gibbonMessengerReceiptID'] ?? '') + ->setClass('') + ->alignLeft(); + $col->addContent(!empty($recipient['parent1surname'])? $parent1Name : __('N/A'))->addClass('w-full'); + + $parent2Receipt = isset($receipts[$recipient['parent2gibbonPersonID']])? $receipts[$recipient['parent2gibbonPersonID']] : null; + $col = $row->addColumn()->addColumn()->setClass('flex items-center justify-start')->addClass(!empty($parent2Receipt) && $parent2Receipt['confirmed'] != 'Y' && $parent2Receipt['sent'] != 'Y' ? 'bg-orange-300' : ''); + $col->addContent($confirmationIndicator($parent2Receipt, $values['emailReceipt'])); + $col->onlyIf($sender == true && !empty($parent2Receipt) && ($parent2Receipt['confirmed'] == 'N' || $values['emailReceipt'] == 'N')) + ->addCheckbox('gibbonMessengerReceiptIDs[]') + ->setValue($parent2Receipt['gibbonMessengerReceiptID'] ?? '') + ->setClass('') + ->alignLeft(); + $col->addContent(!empty($recipient['parent2surname'])? $parent2Name : __('N/A'))->addClass('w-full'); + } + } + + if ($countTotal == 0) { + $table = $form->addRow()->addTable()->setClass('colorOddEven w-full'); + $table->addRow()->addTableCell(__('There are no records to display.'))->colSpan(8); + } + + $tabs['byFormGroup'] = [ + 'label' => __('By Form Group'), + 'content' => $form->getOutput(), + 'icon' => 'users', + ]; + } + + + if (!is_null($gibbonMessengerID)) { - echo $form->getOutput(); + $data = array('gibbonMessengerID' => $gibbonMessengerID); + $sql = "SELECT surname, preferredName, gibbonPerson.gibbonPersonID, gibbonMessenger.*, gibbonMessengerReceipt.*, gibbonRole.category as roleCategory + FROM gibbonMessengerReceipt + JOIN gibbonMessenger ON (gibbonMessengerReceipt.gibbonMessengerID=gibbonMessenger.gibbonMessengerID) + LEFT JOIN gibbonPerson ON (gibbonMessengerReceipt.gibbonPersonID=gibbonPerson.gibbonPersonID) + LEFT JOIN gibbonRole ON (gibbonRole.gibbonRoleID=gibbonPerson.gibbonRoleIDPrimary) + WHERE gibbonMessengerReceipt.gibbonMessengerID=:gibbonMessengerID ORDER BY FIELD(confirmed, 'Y','N',NULL), confirmedTimestamp, surname, preferredName, contactType"; + $result = $connection2->prepare($sql); + $result->execute($data); + + $form = BulkActionForm::create('resendByRecipient', $session->get('absoluteURL') . '/modules/' . $session->get('module') . '/messenger_manage_report_processBulk.php?gibbonMessengerID='.$gibbonMessengerID.'&search='.$search); + + $form->addHiddenValue('address', $session->get('address')); + + if ($sender) { + $row = $form->addBulkActionRow(array('resend' => __('Resend')))->addClass('flex justify-end');; + $row->addSubmit(__('Go')); + } + + $table = $form->addRow()->addTable()->setClass('colorOddEven w-full'); + + $header = $table->addHeaderRow(); + $header->addContent(); + $header->addContent(__('Recipient')); + $header->addContent(__('Role')); + $header->addContent(__('Contact Type')); + $header->addContent(__('Contact Detail')); + $header->addContent(__('Sent')); + $header->addContent(__('Receipt Confirmed')); + $header->addContent(__('Timestamp')); + if ($sender == true) { + $header->addCheckAll(); } - echo "
"; + + + $recipients = $result->fetchAll(); + $recipientIDs = array_column($recipients, 'gibbonPersonID'); + + foreach ($recipients as $count => $recipient) { + $row = $table->addRow()->addClass($recipient['confirmed'] != 'Y' && $recipient['sent'] != 'Y' ? 'warning' : ''); + $row->addContent($count+1); + $row->addContent(($recipient['preferredName'] != '' && $recipient['surname'] != '') ? Format::name('', $recipient['preferredName'], $recipient['surname'], 'Student', true) : __('N/A')); + $row->addContent($recipient['roleCategory']); + $row->addContent($recipient['contactType']); + $row->addContent($recipient['contactDetail']); + $row->addContent($recipient['sent'] == 'Y' ? __('Sent') : __('Undelivered') ); + $row->addContent($confirmationIndicator($recipient)); + $row->addContent(!empty($recipient['confirmedTimestamp']) ? Format::date(substr($recipient['confirmedTimestamp'],0,10)).' '.substr($recipient['confirmedTimestamp'],11,5) : ''); + + if ($sender == true && $recipient['contactType'] == 'Email') { + $row->onlyIf($recipient['confirmed'] == 'N' || $values['emailReceipt'] == 'N') + ->addCheckbox('gibbonMessengerReceiptIDs[]') + ->setValue($recipient['gibbonMessengerReceiptID']) + ->addClass('bulkCheckbox') + ->alignCenter(); + + $row->onlyIf($recipient['confirmed'] != 'N' && $values['emailReceipt'] == 'Y')->addContent(); + } else { + $row->addContent(); + } + + if (is_null($recipient['key'])) $nonConfirm++; + else if ($recipient['confirmed'] == 'Y') $yesConfirm++; + else if ($recipient['confirmed'] == 'N') $noConfirm++; + } + + if (count($recipients) == 0) { + $table->addRow()->addTableCell(__('There are no records to display.'))->colSpan(8); + } else { + $sendReport = ''.__('Total Messages:')." ".count($recipients)."
"; + $sendReport .= "".__('Messages not eligible for confirmation of receipt:')." $nonConfirm
"; + $sendReport .= "".__('Messages confirmed:').' '.$yesConfirm.'
'; + $sendReport .= "".__('Messages not yet confirmed:').' '.$noConfirm.'
'; + + $form->addRow()->addClass('right')->addAlert($sendReport, 'success'); + } + + $tabs['byRecipient'] = [ + 'label' => __('Recipient'), + 'content' => $form->getOutput(), + 'icon' => 'user', + ]; } - echo "
"; + + echo $page->fetchFromTemplate('ui/tabs.twig.html', [ + 'tabs' => $tabs, + 'class' => 'mt-6', + 'outset' => false, + 'icons' => true, + ]); + } + } } diff --git a/modules/Messenger/messenger_post.php b/modules/Messenger/messenger_post.php index d30efdddb3..af73fa4c64 100644 --- a/modules/Messenger/messenger_post.php +++ b/modules/Messenger/messenger_post.php @@ -71,19 +71,18 @@ ?> + diff --git a/modules/Messenger/messenger_send.php b/modules/Messenger/messenger_send.php index a36c8ac3de..ff320b0591 100644 --- a/modules/Messenger/messenger_send.php +++ b/modules/Messenger/messenger_send.php @@ -154,7 +154,7 @@ $row = $form->addRow('stickySubmit'); $col = $row->addColumn()->addClass('items-center'); - $col->addButton(__('Edit Draft'))->onClick('window.location="'.$editURL.'"')->addClass('email rounded-sm w-24 mr-2'); + $col->addButton(__('Edit Draft'))->onClick('window.location="'.$editURL.'"'); $row->addSubmit(__('Send')); } else { // If the message is sent, display the message status diff --git a/modules/Messenger/src/Forms/MessageForm.php b/modules/Messenger/src/Forms/MessageForm.php index 7e3a9e0486..8d4c2a4079 100644 --- a/modules/Messenger/src/Forms/MessageForm.php +++ b/modules/Messenger/src/Forms/MessageForm.php @@ -285,7 +285,7 @@ public function createForm($action, $gibbonMessengerID = null) foreach ($roles AS $role) { $arrRoles[$role['gibbonRoleID']] = __($role['name'])." (".__($role['category']).")"; } - $row = $form->addRow()->addClass('role bg-blue-100'); + $row = $form->addRow()->addClass('role bg-blue-50'); $row->addLabel('roles[]', __('Select Roles')); $row->addSelect('roles[]')->fromArray($arrRoles)->selectMultiple()->setSize(6)->required()->placeholder()->selected($selected); @@ -299,7 +299,7 @@ public function createForm($action, $gibbonMessengerID = null) $data = array(); $sql = 'SELECT DISTINCT category AS value, category AS name FROM gibbonRole ORDER BY category'; - $row = $form->addRow()->addClass('roleCategory bg-blue-100'); + $row = $form->addRow()->addClass('roleCategory bg-blue-50'); $row->addLabel('roleCategories[]', __('Select Role Categories')); $row->addSelect('roleCategories[]')->fromQuery($pdo, $sql, $data)->selectMultiple()->setSize(4)->required()->placeholder()->selected($selected); } else if ($sent && $values['messageWall'] == 'Y' && !empty($selectedRoleCategory) && isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_postQuickWall.php")) { @@ -330,20 +330,20 @@ public function createForm($action, $gibbonMessengerID = null) $data = array(); $sql = 'SELECT gibbonYearGroupID AS value, name FROM gibbonYearGroup ORDER BY sequenceNumber'; - $row = $form->addRow()->addClass('yearGroup bg-blue-100'); + $row = $form->addRow()->addClass('yearGroup bg-blue-50'); $row->addLabel('yearGroups[]', __('Select Year Groups')); $row->addSelect('yearGroups[]')->fromQuery($pdo, $sql, $data)->selectMultiple()->setSize(6)->required()->placeholder()->selected($selected); - $row = $form->addRow()->addClass('yearGroup bg-blue-100'); + $row = $form->addRow()->addClass('yearGroup bg-blue-50'); $row->addLabel('yearGroupsStaff', __('Include Staff?')); $row->addYesNo('yearGroupsStaff')->selected($selectedByRole['staff']); - $row = $form->addRow()->addClass('yearGroup bg-blue-100'); + $row = $form->addRow()->addClass('yearGroup bg-blue-50'); $row->addLabel('yearGroupsStudents', __('Include Students?')); $row->addYesNo('yearGroupsStudents')->selected($selectedByRole['students']); if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_yearGroups_parents")) { - $row = $form->addRow()->addClass('yearGroup bg-blue-100'); + $row = $form->addRow()->addClass('yearGroup bg-blue-50'); $row->addLabel('yearGroupsParents', __('Include Parents?')); $row->addYesNo('yearGroupsParents')->selected($selectedByRole['parents']); } @@ -374,20 +374,20 @@ public function createForm($action, $gibbonMessengerID = null) $sql="SELECT gibbonFormGroupID AS value, name FROM gibbonFormGroup JOIN gibbonStudentEnrolment ON (gibbonStudentEnrolment.gibbonFormGroupID=gibbonFormGroup.gibbonFormGroupID) WHERE gibbonPersonID=:gibbonPersonID AND gibbonFormGroup.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID ORDER BY name" ; } } - $row = $form->addRow()->addClass('formGroup bg-blue-100'); + $row = $form->addRow()->addClass('formGroup bg-blue-50'); $row->addLabel('formGroups[]', __('Select Form Groups')); $row->addSelect('formGroups[]')->fromQuery($pdo, $sql, $data)->selectMultiple()->setSize(6)->required()->placeholder()->selected($selected); - $row = $form->addRow()->addClass('formGroup bg-blue-100'); + $row = $form->addRow()->addClass('formGroup bg-blue-50'); $row->addLabel('formGroupsStaff', __('Include Staff?')); $row->addYesNo('formGroupsStaff')->selected($selectedByRole['staff']); - $row = $form->addRow()->addClass('formGroup bg-blue-100'); + $row = $form->addRow()->addClass('formGroup bg-blue-50'); $row->addLabel('formGroupsStudents', __('Include Students?')); $row->addYesNo('formGroupsStudents')->selected($selectedByRole['students']); if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_formGroups_parents")) { - $row = $form->addRow()->addClass('formGroup bg-blue-100'); + $row = $form->addRow()->addClass('formGroup bg-blue-50'); $row->addLabel('formGroupsParents', __('Include Parents?')); $row->addYesNo('formGroupsParents')->selected($selectedByRole['parents']); } @@ -416,20 +416,20 @@ public function createForm($action, $gibbonMessengerID = null) WHERE gibbonPersonID=:gibbonPersonID AND gibbonSchoolYearID=:gibbonSchoolYearID AND NOT role LIKE '%- Left' GROUP BY gibbonCourse.gibbonCourseID ORDER BY name"; } - $row = $form->addRow()->addClass('course bg-blue-100'); + $row = $form->addRow()->addClass('course bg-blue-50'); $row->addLabel('courses[]', __('Select Courses')); $row->addSelect('courses[]')->fromQuery($pdo, $sql, $data)->selectMultiple()->setSize(6)->required()->selected($selected); - $row = $form->addRow()->addClass('course bg-blue-100'); + $row = $form->addRow()->addClass('course bg-blue-50'); $row->addLabel('coursesStaff', __('Include Staff?')); $row->addYesNo('coursesStaff')->selected($selectedByRole['staff']); - $row = $form->addRow()->addClass('course bg-blue-100'); + $row = $form->addRow()->addClass('course bg-blue-50'); $row->addLabel('coursesStudents', __('Include Students?')); $row->addYesNo('coursesStudents')->selected($selectedByRole['students']); if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_courses_parents")) { - $row = $form->addRow()->addClass('course bg-blue-100'); + $row = $form->addRow()->addClass('course bg-blue-50'); $row->addLabel('coursesParents', __('Include Parents?')); $row->addYesNo('coursesParents')->selected($selectedByRole['parents']); } @@ -458,20 +458,20 @@ public function createForm($action, $gibbonMessengerID = null) WHERE gibbonPersonID=:gibbonPersonID AND gibbonSchoolYearID=:gibbonSchoolYearID AND NOT role LIKE '%- Left' ORDER BY gibbonCourseClass.name"; } - $row = $form->addRow()->addClass('class bg-blue-100'); + $row = $form->addRow()->addClass('class bg-blue-50'); $row->addLabel('classes[]', __('Select Classes')); $row->addSelect('classes[]')->fromQuery($pdo, $sql, $data)->selectMultiple()->setSize(6)->required()->selected($selected); - $row = $form->addRow()->addClass('class bg-blue-100'); + $row = $form->addRow()->addClass('class bg-blue-50'); $row->addLabel('classesStaff', __('Include Staff?')); $row->addYesNo('classesStaff')->selected($selectedByRole['staff']); - $row = $form->addRow()->addClass('class bg-blue-100'); + $row = $form->addRow()->addClass('class bg-blue-50'); $row->addLabel('classesStudents', __('Include Students?')); $row->addYesNo('classesStudents')->selected($selectedByRole['students']); if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_classes_parents")) { - $row = $form->addRow()->addClass('class bg-blue-100'); + $row = $form->addRow()->addClass('class bg-blue-50'); $row->addLabel('classesParents', __('Include Parents?')); $row->addYesNo('classesParents')->selected($selectedByRole['parents']); } @@ -499,20 +499,20 @@ public function createForm($action, $gibbonMessengerID = null) $sql = "SELECT gibbonActivity.gibbonActivityID as value, name FROM gibbonActivity JOIN gibbonActivityStudent ON (gibbonActivityStudent.gibbonActivityID=gibbonActivity.gibbonActivityID) WHERE gibbonPersonID=:gibbonPersonID AND gibbonSchoolYearID=:gibbonSchoolYearID AND status='Accepted' AND active='Y' ORDER BY name"; } } - $row = $form->addRow()->addClass('activity bg-blue-100'); + $row = $form->addRow()->addClass('activity bg-blue-50'); $row->addLabel('activities[]', __('Select Activities')); $row->addSelect('activities[]')->fromQuery($pdo, $sql, $data)->selectMultiple()->setSize(6)->required()->selected($selected); - $row = $form->addRow()->addClass('activity bg-blue-100'); + $row = $form->addRow()->addClass('activity bg-blue-50'); $row->addLabel('activitiesStaff', __('Include Staff?')); $row->addYesNo('activitiesStaff')->selected($selectedByRole['staff']); - $row = $form->addRow()->addClass('activity bg-blue-100'); + $row = $form->addRow()->addClass('activity bg-blue-50'); $row->addLabel('activitiesStudents', __('Include Students?')); $row->addYesNo('activitiesStudents')->selected($selectedByRole['students']); if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_activities_parents")) { - $row = $form->addRow()->addClass('activity bg-blue-100'); + $row = $form->addRow()->addClass('activity bg-blue-50'); $row->addLabel('activitiesParents', __('Include Parents?')); $row->addYesNo('activitiesParents')->selected($selectedByRole['parents']); } @@ -530,7 +530,7 @@ public function createForm($action, $gibbonMessengerID = null) $form->toggleVisibilityByClass('applicants')->onRadio('applicants')->when('Y'); $sql = "SELECT gibbonSchoolYearID as value, name FROM gibbonSchoolYear ORDER BY sequenceNumber DESC"; - $row = $form->addRow()->addClass('applicants bg-blue-100'); + $row = $form->addRow()->addClass('applicants bg-blue-50'); $row->addLabel('applicantList[]', __('Select Years')); $row->addSelect('applicantList[]')->fromQuery($pdo, $sql)->selectMultiple()->setSize(6)->required()->selected($selected); @@ -560,7 +560,7 @@ public function createForm($action, $gibbonMessengerID = null) $data = array('gibbonPersonID' => $this->session->get('gibbonPersonID')); $sql = "SELECT gibbonHouse.gibbonHouseID as value, name FROM gibbonHouse JOIN gibbonPerson ON (gibbonHouse.gibbonHouseID=gibbonPerson.gibbonHouseID) WHERE gibbonPersonID=:gibbonPersonID ORDER BY name"; } - $row = $form->addRow()->addClass('houses bg-blue-100'); + $row = $form->addRow()->addClass('houses bg-blue-50'); $row->addLabel('houseList[]', __('Select Houses')); $row->addSelect('houseList[]')->fromQuery($pdo, $sql, $data)->selectMultiple()->setSize(6)->required()->selected($selected); } @@ -585,20 +585,20 @@ public function createForm($action, $gibbonMessengerID = null) }, [])); sort($transportList, SORT_NATURAL); - $row = $form->addRow()->addClass('transport bg-blue-100'); + $row = $form->addRow()->addClass('transport bg-blue-50'); $row->addLabel('transports[]', __('Select Transport')); $row->addSelect('transports[]')->fromArray($transportList)->selectMultiple()->setSize(6)->required()->selected($selected); - $row = $form->addRow()->addClass('transport bg-blue-100'); + $row = $form->addRow()->addClass('transport bg-blue-50'); $row->addLabel('transportStaff', __('Include Staff?')); $row->addYesNo('transportStaff')->selected($selectedByRole['staff']); - $row = $form->addRow()->addClass('transport bg-blue-100'); + $row = $form->addRow()->addClass('transport bg-blue-50'); $row->addLabel('transportStudents', __('Include Students?')); $row->addYesNo('transportStudents')->selected($selectedByRole['students']); if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_transport_parents")) { - $row = $form->addRow()->addClass('transport bg-blue-100'); + $row = $form->addRow()->addClass('transport bg-blue-50'); $row->addLabel('transportParents', __('Include Parents?')); $row->addYesNo('transportParents')->selected($selectedByRole['parents']); } @@ -631,15 +631,15 @@ public function createForm($action, $gibbonMessengerID = null) }); $attendanceCodes = array_column($attendanceCodes, 'name'); - $row = $form->addRow()->addClass('attendance bg-blue-100'); + $row = $form->addRow()->addClass('attendance bg-blue-50'); $row->addLabel('attendanceStatus[]', __('Select Attendance Status')); $row->addSelect('attendanceStatus[]')->fromArray($attendanceCodes)->selectMultiple()->setSize(6)->required()->selected($selected); - $row = $form->addRow()->addClass('attendance bg-blue-100'); + $row = $form->addRow()->addClass('attendance bg-blue-50'); $row->addLabel('attendanceStudents', __('Include Students?')); $row->addYesNo('attendanceStudents')->selected($selectedByRole['students']); - $row = $form->addRow()->addClass('attendance bg-blue-100'); + $row = $form->addRow()->addClass('attendance bg-blue-50'); $row->addLabel('attendanceParents', __('Include Parents?')); $row->addYesNo('attendanceParents')->selected($selectedByRole['parents']); } @@ -667,20 +667,20 @@ public function createForm($action, $gibbonMessengerID = null) "; } - $row = $form->addRow()->addClass('messageGroup bg-blue-100'); + $row = $form->addRow()->addClass('messageGroup bg-blue-50'); $row->addLabel('groups[]', __('Select Groups')); $row->addSelect('groups[]')->fromQuery($pdo, $sql, $data)->selectMultiple()->setSize(6)->required()->selected($selected); - $row = $form->addRow()->addClass('messageGroup bg-blue-100'); + $row = $form->addRow()->addClass('messageGroup bg-blue-50'); $row->addLabel('groupsStaff', __('Include Staff?')); $row->addYesNo('groupsStaff')->selected($selectedByRole['staff']); - $row = $form->addRow()->addClass('messageGroup bg-blue-100'); + $row = $form->addRow()->addClass('messageGroup bg-blue-50'); $row->addLabel('groupsStudents', __('Include Students?')); $row->addYesNo('groupsStudents')->selected($selectedByRole['students']); if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_groups_parents")) { - $row = $form->addRow()->addClass('messageGroup bg-blue-100'); + $row = $form->addRow()->addClass('messageGroup bg-blue-50'); $row->addLabel('groupsParents', __('Include Parents?'))->description('Parents who are members, and parents of student members.'); $row->addYesNo('groupsParents')->selected($selectedByRole['parents']); } @@ -734,7 +734,7 @@ public function createForm($action, $gibbonMessengerID = null) }, array()); $selectedIndividuals = array_intersect_key($individuals, array_flip($selected)); - $row = $form->addRow()->addClass('individuals bg-blue-100'); + $row = $form->addRow()->addClass('individuals bg-blue-50'); $col = $row->addColumn(); $col->addLabel('individualList', __('Select Individuals')); $select = $col->addMultiSelect('individualList')->required(); @@ -760,9 +760,9 @@ public function createForm($action, $gibbonMessengerID = null) $form->toggleVisibilityByClass('noEmail')->onRadio('email')->when('N'); $row = $form->addRow('stickySubmit'); - $col = $row->addColumn()->addClass('items-center'); - $col->addButton(__('Save Draft'))->onClick('saveDraft()')->addClass('rounded-sm w-auto mr-2'); - $col = $row->addColumn()->addClass('items-center'); + $col = $row->addColumn()->setClass('flex-shrink items-center'); + $col->addButton(__('Save Draft'))->setAttribute('@click', 'checkDraft(); if ($validate.isComplete("messengerMessage")) { saveDraft() } else { invalid = true; }'); + $col = $row->addColumn()->setID('Submit')->addClass('items-center'); $col->addSubmit(__('Preview & Send'))->addClass('email'); $col->addSubmit()->addClass('noEmail'); } diff --git a/modules/Planner/conceptExplorer.php b/modules/Planner/conceptExplorer.php index 26dedcd781..0813550d74 100644 --- a/modules/Planner/conceptExplorer.php +++ b/modules/Planner/conceptExplorer.php @@ -58,7 +58,7 @@ $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Choose Concept')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/conceptExplorer.php'); diff --git a/modules/Planner/moduleFunctions.php b/modules/Planner/moduleFunctions.php index 035e26b2ab..59ee655e79 100644 --- a/modules/Planner/moduleFunctions.php +++ b/modules/Planner/moduleFunctions.php @@ -297,27 +297,30 @@ function sidebarExtra($guid, $connection2, $todayStamp, $gibbonPersonID, $dateSt $output = '
'; // Date Chooser - $form = Form::create('dateChooser', $session->get('absoluteURL').'/index.php', 'get'); + $form = Form::createBlank('dateChooser', $session->get('absoluteURL').'/index.php', 'get')->enableQuickSubmit(); $form->setTitle(__('Choose A Date')); - $form->setClass('smallIntBorder w-full'); $form->addHiddenValue('q', '/modules/Planner/planner.php'); $form->addHiddenValue('search', $gibbonPersonID); + $form->addHiddenValue('gibbonCourseClassID', $gibbonCourseClassID); - $row = $form->addRow(); + $row = $form->addRow()->addClass('flex'); $row->addDate('dateHuman', $session->get('gibbonSchoolYearID'), $gibbonPersonID) - ->setValue(Format::date($dateStamp ? date('Y-m-d', $dateStamp) : '')) + ->setValue(date('Y-m-d', $dateStamp)) ->setID('dateHuman') - ->setClass('float-none w-full'); - $row->addSubmit(__('Go')); + ->setClass('flex-grow') + ->groupAlign('left'); + $row->addSubmit(__('Go'), 'planner1') + ->setType('quickSubmit') + ->groupAlign('right') + ->setClass('flex'); $output .= $form->getOutput(); // Class Chooser - $form = Form::create('classChooser', $session->get('absoluteURL').'/index.php', 'get'); + $form = Form::createBlank('classChooser', $session->get('absoluteURL').'/index.php', 'get')->enableQuickSubmit(); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Choose A Class')); - $form->setClass('smallIntBorder w-full'); $form->addHiddenValue('q', '/modules/Planner/planner.php'); $form->addHiddenValue('search', $gibbonPersonID); @@ -345,14 +348,18 @@ function sidebarExtra($guid, $connection2, $todayStamp, $gibbonPersonID, $dateSt } } - $row = $form->addRow(); + $row = $form->addRow()->addClass('flex'); $row->addSelect('gibbonCourseClassID', $session->get('gibbonSchoolYearID'), $gibbonPersonID) ->setID('gibbonCourseClassIDSidebar') ->fromArray($classes) ->selected($gibbonCourseClassID) ->placeholder() - ->setClass('float-none w-full'); - $row->addSubmit(__('Go')); + ->setClass('flex-grow') + ->groupAlign('left'); + $row->addSubmit(__('Go'), 'planner2') + ->setType('quickSubmit') + ->groupAlign('right') + ->setClass('flex'); $output .= $form->getOutput(); $output .= '
'; @@ -422,22 +429,25 @@ function sidebarExtraUnits($guid, $connection2, $gibbonCourseID, $gibbonSchoolYe ]; } - $form = Form::create('courseChooser', $session->get('absoluteURL').'/index.php', 'get'); + $form = Form::createBlank('courseChooser', $session->get('absoluteURL').'/index.php', 'get')->enableQuickSubmit(); $form->setTitle(__('Choose A Course')); - $form->setClass('smallIntBorder w-full'); $form->addHiddenValue('q', '/modules/Planner/units.php'); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); $form->addHiddenValue('viewBy', 'class'); - $row = $form->addRow(); + $row = $form->addRow()->addClass('flex'); $row->addSelect('gibbonCourseID') ->setID('gibbonCourseIDSidebar') ->fromArray($courses) ->selected($gibbonCourseID) ->placeholder() - ->setClass('float-none w-full'); - $row->addSubmit(__('Go')); + ->groupAlign('left') + ->setClass('flex-grow'); + $row->addSubmit(__('Go'), 'units') + ->setType('quickSubmit') + ->groupAlign('right') + ->setClass('flex'); $output .= $form->getOutput(); } diff --git a/modules/Planner/outcomes.php b/modules/Planner/outcomes.php index fb6adeddfb..98df0f2f10 100644 --- a/modules/Planner/outcomes.php +++ b/modules/Planner/outcomes.php @@ -47,7 +47,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/outcomes.php'); diff --git a/modules/Planner/planner.php b/modules/Planner/planner.php index 2aa550bece..3564298245 100644 --- a/modules/Planner/planner.php +++ b/modules/Planner/planner.php @@ -23,6 +23,8 @@ use Gibbon\Forms\Form; use Gibbon\Services\Format; use Gibbon\Domain\Planner\PlannerEntryGateway; +use Gibbon\Module\Planner\Tables\LessonTable; +use Gibbon\Domain\Students\StudentGateway; //Module includes require_once __DIR__ . '/moduleFunctions.php'; @@ -44,22 +46,21 @@ $homeworkNameSingular = $settingGateway->getSettingByScope('Planner', 'homeworkNameSingular'); $homeworkNamePlural = $settingGateway->getSettingByScope('Planner', 'homeworkNamePlural'); + $gibbonSchoolYearID = $session->get('gibbonSchoolYearID'); //Proceed! //Get viewBy, date and class variables - $viewBy = null; - if (isset($_GET['viewBy'])) { - $viewBy = $_GET['viewBy'] ?? ''; - } - $subView = null; - if (isset($_GET['subView'])) { - $subView = $_GET['subView'] ?? ''; - } + $viewBy = $_GET['viewBy'] ?? ''; + $search = $_GET['search'] ?? ''; + $subView = $_GET['subView'] ?? ''; + if ($viewBy != 'date' and $viewBy != 'class') { $viewBy = 'date'; } + $gibbonCourseClassID = null; $date = null; $dateStamp = null; + if ($viewBy == 'date') { if (isset($_GET['date'])) { $date = $_GET['date'] ?? ''; @@ -84,1008 +85,102 @@ } [$todayYear, $todayMonth, $todayDay] = explode('-', $today); $todayStamp = mktime(12, 0, 0, $todayMonth, $todayDay, $todayYear); - $gibbonPersonIDArray = []; + + if ($viewBy == 'date' && isSchoolOpen($guid, date('Y-m-d', $dateStamp), $connection2) == false) { + $page->addWarning(__('School is closed on the specified day.')); + } + + if ($viewBy == 'class' && empty($gibbonCourseClassID)) { + $page->addError(__('You have not specified one or more required parameters.')); + return; + } //My children's classes if ($highestAction == 'Lesson Planner_viewMyChildrensClasses') { - $search = null; - if (isset($_GET['search'])) { - $search = $_GET['search'] ?? ''; - } + $page->breadcrumbs->add(__('My Children\'s Classes')); - //Test data access field for permission - - $data = array('gibbonPersonID' => $session->get('gibbonPersonID')); - $sql = "SELECT * FROM gibbonFamilyAdult WHERE gibbonPersonID=:gibbonPersonID AND childDataAccess='Y'"; - $result = $connection2->prepare($sql); - $result->execute($data); + $studentGateway = $container->get(StudentGateway::class); + $children = $studentGateway + ->selectActiveStudentsByFamilyAdult($gibbonSchoolYearID, $session->get('gibbonPersonID')) + ->fetchGroupedUnique(); - if ($result->rowCount() < 1) { - $page->addMessage(__('There are no records to display.')); + if (empty($children)) { + echo $page->getBlankSlate(); + } elseif (count($children) == 1) { + $gibbonPersonID = key($children); } else { - //Get child list - $count = 0; - $options = array(); - while ($row = $result->fetch()) { + $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); + $form->setTitle(__('Choose')); + $form->setClass('noIntBorder w-full'); - $dataChild = array('gibbonFamilyID' => $row['gibbonFamilyID'], 'gibbonSchoolYearID' => $session->get('gibbonSchoolYearID')); - $sqlChild = "SELECT * FROM gibbonFamilyChild JOIN gibbonPerson ON (gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID) JOIN gibbonStudentEnrolment ON (gibbonPerson.gibbonPersonID=gibbonStudentEnrolment.gibbonPersonID) JOIN gibbonFormGroup ON (gibbonStudentEnrolment.gibbonFormGroupID=gibbonFormGroup.gibbonFormGroupID) WHERE gibbonFamilyID=:gibbonFamilyID AND gibbonPerson.status='Full' AND (dateStart IS NULL OR dateStart<='".date('Y-m-d')."') AND (dateEnd IS NULL OR dateEnd>='".date('Y-m-d')."') AND gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID ORDER BY surname, preferredName "; - $resultChild = $connection2->prepare($sqlChild); - $resultChild->execute($dataChild); - while ($rowChild = $resultChild->fetch()) { - $options[$rowChild['gibbonPersonID']] = Format::name('', $rowChild['preferredName'], $rowChild['surname'], 'Student'); - $gibbonPersonIDArray[$count] = $rowChild['gibbonPersonID']; - ++$count; - } - } + $form->addHiddenValue('address', $session->get('address')); + $form->addHiddenValue('q', '/modules/'.$session->get('module').'/planner.php'); + $form->addHiddenValue('gibbonCourseClassID', $gibbonCourseClassID ?? ''); + $form->addHiddenValue('viewBy', !empty($gibbonCourseClassID) ? 'class' : 'date'); - if ($count == 0) { - $page->addMessage(__('There are no records to display.')); - } elseif ($count == 1) { - $search = $gibbonPersonIDArray[0]; - } else { - echo '

'; - echo __('Choose'); - echo '

'; - - $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); - - $form->setClass('noIntBorder fullWidth'); + $row = $form->addRow(); + $row->addLabel('search', __('Student')); + $row->addSelect('search') + ->fromArray(Format::nameListArray($children, 'Student')) + ->selected($search) + ->placeholder(); - $form->addHiddenValue('address', $session->get('address')); - $form->addHiddenValue('q', '/modules/'.$session->get('module').'/planner.php'); - if (isset($gibbonCourseClassID) && $gibbonCourseClassID != '') { - $form->addHiddenValue('gibbonCourseClassID', $gibbonCourseClassID); - $form->addHiddenValue('viewBy', 'class'); - } - else { - $form->addHiddenValue('viewBy', 'date'); - } + $row = $form->addRow(); + $row->addFooter(); + $row->addSearchSubmit($session); - $row = $form->addRow(); - $row->addLabel('search', __('Student')); - $row->addSelect('search')->fromArray($options)->selected($search)->placeholder(); - - $row = $form->addRow(); - $row->addFooter(); - $row->addSearchSubmit($session); - - echo $form->getOutput(); - } + echo $form->getOutput(); $gibbonPersonID = $search; + } - if ($search != '' and $count > 0) { - //Confirm access to this student - - $dataChild = array('gibbonPersonID' => $session->get('gibbonPersonID'), 'gibbonPersonID2' => $gibbonPersonID); - $sqlChild = "SELECT * FROM gibbonFamilyChild JOIN gibbonFamily ON (gibbonFamilyChild.gibbonFamilyID=gibbonFamily.gibbonFamilyID) JOIN gibbonFamilyAdult ON (gibbonFamilyAdult.gibbonFamilyID=gibbonFamily.gibbonFamilyID) JOIN gibbonPerson ON (gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE gibbonPerson.status='Full' AND (dateStart IS NULL OR dateStart<='".date('Y-m-d')."') AND (dateEnd IS NULL OR dateEnd>='".date('Y-m-d')."') AND gibbonFamilyChild.gibbonPersonID=:gibbonPersonID2 AND gibbonFamilyAdult.gibbonPersonID=:gibbonPersonID AND childDataAccess='Y'"; - $resultChild = $connection2->prepare($sqlChild); - $resultChild->execute($dataChild); - - if ($resultChild->rowCount() < 1) { - echo $page->getBlankSlate(); - } else { - $rowChild = $resultChild->fetch(); - - if ($count > 1) { - echo '

'; - echo __('Lessons'); - echo '

'; - } - - //Print planner - if ($viewBy == 'date') { - if (isSchoolOpen($guid, date('Y-m-d', $dateStamp), $connection2) == false) { - echo "
"; - echo __('School is closed on the specified day.'); - echo '
'; - } else { - - $data = array('date1' => $date, 'gibbonPersonID1' => $gibbonPersonID, 'date2' => $date, 'gibbonPersonID2' => $gibbonPersonID); - $sql = " - (SELECT - gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonPlannerEntry.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role, homeworkSubmission, homeworkCrowdAssess, date, gibbonPlannerEntryStudentHomework.homeworkDueDateTime AS myHomeworkDueDateTime - FROM gibbonPlannerEntry - JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) - JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) - JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) - LEFT JOIN gibbonPlannerEntryStudentHomework ON (gibbonPlannerEntryStudentHomework.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID AND gibbonPlannerEntryStudentHomework.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) - WHERE date=:date1 - AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID1 - AND NOT role='Student - Left' - AND NOT role='Teacher - Left') - UNION - (SELECT - gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonPlannerEntry.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role, homeworkSubmission, homeworkCrowdAssess, date, NULL AS myHomeworkDueDateTime - FROM gibbonPlannerEntry - JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) - JOIN gibbonPlannerEntryGuest ON (gibbonPlannerEntryGuest.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID) - JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) - WHERE date=:date2 - AND gibbonPlannerEntryGuest.gibbonPersonID=:gibbonPersonID2) - ORDER BY date, timeStart - "; - $result = $connection2->prepare($sql); - $result->execute($data); - - //Only show add if user has edit rights - if ($highestAction == 'Lesson Planner_viewAllEditMyClasses' or $highestAction == 'Lesson Planner_viewEditAllClasses') { - echo "
"; - echo "".__('Add').""; - echo '
'; - } - - if ($result->rowCount() < 1) { - echo $page->getBlankSlate(); - } else { - echo ""; - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo "'; - echo ''; - - $count = 0; - $rowNum = 'odd'; - while ($row = $result->fetch()) { - if (!($row['role'] == 'Student' and $row['viewableParents'] == 'N')) { - if ($count % 2 == 0) { - $rowNum = 'even'; - } else { - $rowNum = 'odd'; - } - ++$count; - - //Highlight class in progress - if ((date('H:i:s') > $row['timeStart']) and (date('H:i:s') < $row['timeEnd']) and ($date) == date('Y-m-d')) { - $rowNum = 'current'; - } - - //COLOR ROW BY STATUS! - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - } - echo '
'; - echo __('Class'); - echo ''; - echo __('Lesson').'
'; - echo "".__('Unit').''; - echo '
'; - echo __('Time'); - echo ''; - echo __($homeworkNameSingular); - echo ''; - echo __('Access'); - echo '"; - echo __('Actions'); - echo '
'; - echo $row['course'].'.'.$row['class']; - echo ''; - echo ''.$row['name'].'
'; - echo ""; - $unit = getUnit($connection2, $row['gibbonUnitID'], $row['gibbonCourseClassID']); - if (isset($unit[0])) { - echo $unit[0]; - if ($unit[1] != '') { - echo '
'.$unit[1].' '.__('Unit').''; - } - } - echo '
'; - echo '
'; - echo substr($row['timeStart'], 0, 5).'-'.substr($row['timeEnd'], 0, 5); - echo ''; - if ($row['homework'] == 'N' and $row['myHomeworkDueDateTime'] == '') { - echo __('No'); - } else { - if ($row['homework'] == 'Y') { - echo __('Yes').': '.__('Teacher Recorded').'
'; - if ($row['homeworkSubmission'] == 'Y') { - echo "+".__('Submission').'
'; - if ($row['homeworkCrowdAssess'] == 'Y') { - echo "+".__('Crowd Assessment').'
'; - } - } - } - if ($row['myHomeworkDueDateTime'] != '') { - echo __('Yes').': '.__('Student Recorded').'
'; - } - } - echo '
'; - if ($row['viewableStudents'] == 'Y') { - echo __('Students'); - } - if ($row['viewableStudents'] == 'Y' and $row['viewableParents'] == 'Y') { - echo ', '; - } - if ($row['viewableParents'] == 'Y') { - echo __('Parents'); - } - echo ''; - echo " "; - echo '
'; - } - } - } elseif ($viewBy == 'class') { - if ($gibbonCourseClassID == '') { - $page->addError(__('You have not specified one or more required parameters.')); - } else { - - $data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'),'gibbonCourseClassID' => $gibbonCourseClassID, 'gibbonPersonID' => $gibbonPersonID); - $sql = 'SELECT gibbonCourseClass.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class FROM gibbonCourseClassPerson JOIN gibbonCourseClass ON (gibbonCourseClassPerson.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID) WHERE gibbonCourse.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonCourseClass.gibbonCourseClassID=:gibbonCourseClassID AND gibbonPersonID=:gibbonPersonID'; - $result = $connection2->prepare($sql); - $result->execute($data); - - if ($result->rowCount() != 1) { - $page->addError(__('The selected record does not exist, or you do not have access to it.')); - } else { - $row = $result->fetch(); - - $data = array('gibbonCourseClassID1' => $gibbonCourseClassID, 'gibbonPersonID1' => $gibbonPersonID, 'gibbonCourseClassID2' => $gibbonCourseClassID, 'gibbonPersonID2' => $gibbonPersonID); - $sql = "(SELECT gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonPlannerEntry.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role, homeworkSubmission, homeworkCrowdAssess, date, gibbonPlannerEntryStudentHomework.homeworkDueDateTime AS myHomeworkDueDateTime FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) LEFT JOIN gibbonPlannerEntryStudentHomework ON (gibbonPlannerEntryStudentHomework.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID AND gibbonPlannerEntryStudentHomework.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID1 AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID1 AND NOT role='Student - Left' AND NOT role='Teacher - Left') UNION (SELECT gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonPlannerEntry.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role, homeworkSubmission, homeworkCrowdAssess, date, NULL AS myHomeworkDueDateTime FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonPlannerEntryGuest ON (gibbonPlannerEntryGuest.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID2 AND gibbonPlannerEntryGuest.gibbonPersonID=:gibbonPersonID2) ORDER BY date DESC, timeStart DESC"; - $result = $connection2->prepare($sql); - $result->execute($data); - - //Only show add if user has edit rights - if ($highestAction == 'Lesson Planner_viewAllEditMyClasses' or $highestAction == 'Lesson Planner_viewEditAllClasses') { - echo "
"; - echo "".__('Add').""; - echo '
'; - } - - if ($result->rowCount() < 1) { - echo $page->getBlankSlate(); - } else { - echo ""; - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo "'; - echo ''; - - $count = 0; - $rowNum = 'odd'; - while ($row = $result->fetch()) { - if (!($row['role'] == 'Student' and $row['viewableParents'] == 'N')) { - if ($count % 2 == 0) { - $rowNum = 'even'; - } else { - $rowNum = 'odd'; - } - ++$count; - - //Highlight class in progress - if ((date('Y-m-d') == $row['date']) and (date('H:i:s') > $row['timeStart']) and (date('H:i:s') < $row['timeEnd'])) { - $rowNum = 'current'; - } + if (!empty($gibbonPersonID) && !empty($children[$gibbonPersonID])) { + $student = $container->get(StudentGateway::class)->selectActiveStudentByPerson($gibbonSchoolYearID, $gibbonPersonID)->fetch(); - //COLOR ROW BY STATUS! - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - } - echo '
'; - echo __('Date'); - echo ''; - echo __('Lesson').'
'; - echo "".__('Unit').''; - echo '
'; - echo __('Time'); - echo ''; - echo __($homeworkNameSingular); - echo ''; - echo __('Access'); - echo '"; - echo __('Actions'); - echo '
'; - if (!(is_null($row['date']))) { - echo ''.Format::date($row['date']).'
'; - echo Format::dayOfWeekName($row['date']); - } - echo '
'; - echo ''.$row['name'].'
'; - if ($row['gibbonUnitID'] != '') { - $unit = getUnit($connection2, $row['gibbonUnitID'], $row['gibbonCourseClassID']); - if (!empty($unit[0])) { - echo ""; - echo $unit[0]; - if ($unit[1] != '') { - echo '
'.$unit[1].' '.__('Unit').''; - } - echo '
'; - } + if (empty($student)) { + echo $page->getBlankSlate(); + } else { + $table = $container->get(LessonTable::class)->create($gibbonSchoolYearID, $gibbonCourseClassID, $gibbonPersonID, $date, $viewBy); + $table->setTitle(__('Lessons')); - } - echo '
'; - if ($row['timeStart'] != '' and $row['timeEnd'] != '') { - echo substr($row['timeStart'], 0, 5).'-'.substr($row['timeEnd'], 0, 5); - } - echo ''; - if ($row['homework'] == 'N' and $row['myHomeworkDueDateTime'] == '') { - echo __('No'); - } else { - if ($row['homework'] == 'Y') { - echo __('Yes').': '.__('Teacher Recorded').'
'; - if ($row['homeworkSubmission'] == 'Y') { - echo "+".__('Submission').'
'; - if ($row['homeworkCrowdAssess'] == 'Y') { - echo "+".__('Crowd Assessment').'
'; - } - } - } - if ($row['myHomeworkDueDateTime'] != '') { - echo __('Yes').': '.__('Student Recorded').'
'; - } - } - echo '
'; - if ($row['viewableStudents'] == 'Y') { - echo __('Students'); - } - if ($row['viewableStudents'] == 'Y' and $row['viewableParents'] == 'Y') { - echo ', '; - } - if ($row['viewableParents'] == 'Y') { - echo __('Parents'); - } - echo ''; - echo " "; - echo '
'; - } - } - } - } - } + echo $table->getOutput(); } } + } //My Classes elseif ($highestAction == 'Lesson Planner_viewMyClasses' or $highestAction == 'Lesson Planner_viewAllEditMyClasses' or $highestAction == 'Lesson Planner_viewEditAllClasses' or $highestAction == 'Lesson Planner_viewOnly') { $gibbonPersonID = $session->get('gibbonPersonID'); + + $page->return->addReturns([ + 'success1' => __('Bump was successful. It is possible that some lessons have not been moved (if there was no space for them), but a reasonable effort has been made.'), + ]); + if ($viewBy == 'date') { $page->breadcrumbs->add(__('Planner for {classDesc}', [ 'classDesc' => Format::date($date), ])); - - if (isSchoolOpen($guid, date('Y-m-d', $dateStamp), $connection2) == false) { - echo "
"; - echo __('School is closed on the specified day.'); - echo '
'; - } else { - - try { - if ($highestAction == 'Lesson Planner_viewEditAllClasses' or $highestAction == 'Lesson Planner_viewOnly') { - $data = array('date' => $date); - $sql = "SELECT gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, 'Teacher' AS role, homeworkSubmission, homeworkCrowdAssess, date, gibbonPlannerEntry.gibbonCourseClassID, NULL AS myHomeworkDueDateTime FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE date=:date ORDER BY date, timeStart"; - } elseif ($highestAction == 'Lesson Planner_viewMyClasses' or $highestAction == 'Lesson Planner_viewAllEditMyClasses') { - $data = array('date1' => $date, 'gibbonPersonID1' => $gibbonPersonID, 'date2' => $date, 'gibbonPersonID2' => $gibbonPersonID); - $sql = "(SELECT gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role, homeworkSubmission, homeworkCrowdAssess, date, gibbonPlannerEntry.gibbonCourseClassID, gibbonPlannerEntryStudentHomework.homeworkDueDateTime AS myHomeworkDueDateTime FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) LEFT JOIN gibbonPlannerEntryStudentHomework ON (gibbonPlannerEntryStudentHomework.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID AND gibbonPlannerEntryStudentHomework.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) WHERE date=:date1 AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID1 AND NOT role='Student - Left' AND NOT role='Teacher - Left') UNION (SELECT gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role, homeworkSubmission, homeworkCrowdAssess, date, gibbonPlannerEntry.gibbonCourseClassID, NULL AS myHomeworkDueDateTime FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonPlannerEntryGuest ON (gibbonPlannerEntryGuest.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE date=:date2 AND gibbonPlannerEntryGuest.gibbonPersonID=:gibbonPersonID2) ORDER BY date, timeStart"; - } - $result = $connection2->prepare($sql); - $result->execute($data); - } catch (PDOException $e) { - } - - //Only show add if user has edit rights - if ($highestAction == 'Lesson Planner_viewEditMyClasses' or $highestAction == 'Lesson Planner_viewEditAllClasses' or $highestAction == 'Lesson Planner_viewAllEditMyClasses') { - echo "
"; - echo "".__('Add').""; - echo '
'; - } - - if ($result->rowCount() < 1) { - echo $page->getBlankSlate(); - } else { - echo ""; - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo "'; - echo ''; - - $count = 0; - $rowNum = 'odd'; - while ($row = $result->fetch()) { - if ((!($row['role'] == 'Student' and $row['viewableStudents'] == 'N')) and (!($row['role'] == 'Guest Student' and $row['viewableStudents'] == 'N'))) { - if ($count % 2 == 0) { - $rowNum = 'even'; - } else { - $rowNum = 'odd'; - } - ++$count; - - //Highlight class in progress - if ((date('H:i:s') > $row['timeStart']) and (date('H:i:s') < $row['timeEnd']) and ($date) == date('Y-m-d')) { - $rowNum = 'current'; - } - //Dull out past classes - if ((($row['date']) == date('Y-m-d') and (date('H:i:s') > $row['timeEnd'])) or ($row['date']) < date('Y-m-d')) { - $rowNum = 'past'; - } - - //COLOR ROW BY STATUS! - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - } - echo '
'; - echo __('Class'); - echo ''; - echo __('Lesson').'
'; - echo "".__('Unit').''; - echo '
'; - echo __('Time'); - echo ''; - echo __($homeworkNameSingular); - echo ''; - echo __('Access'); - echo '"; - echo __('Actions'); - echo '
'; - echo $row['course'].'.'.$row['class']; - echo ''; - echo ''.$row['name'].'
'; - echo ""; - $unit = getUnit($connection2, $row['gibbonUnitID'], $row['gibbonCourseClassID']); - if (isset($unit[0])) { - echo $unit[0]; - if ($unit[1] != '') { - echo '
'.$unit[1].' '.__('Unit').''; - } - } - echo '
'; - echo '
'; - echo substr($row['timeStart'], 0, 5).'-'.substr($row['timeEnd'], 0, 5); - echo ''; - if ($row['homework'] == 'N' and $row['myHomeworkDueDateTime'] == '') { - echo __('No'); - } else { - if ($row['homework'] == 'Y') { - echo __('Yes').': '.__('Teacher Recorded').'
'; - if ($row['homeworkSubmission'] == 'Y') { - echo "+".__('Submission').'
'; - if ($row['homeworkCrowdAssess'] == 'Y') { - echo "+".__('Crowd Assessment').'
'; - } - } - } - if ($row['myHomeworkDueDateTime'] != '') { - echo __('Yes').': '.__('Student Recorded').'
'; - } - } - echo '
'; - if ($row['viewableStudents'] == 'Y') { - echo __('Students'); - } - if ($row['viewableStudents'] == 'Y' and $row['viewableParents'] == 'Y') { - echo ', '; - } - if ($row['viewableParents'] == 'Y') { - echo __('Parents'); - } - echo ''; - echo " "; - if ($highestAction == 'Lesson Planner_viewAllEditMyClasses' or $highestAction == 'Lesson Planner_viewEditAllClasses') { - echo " "; - echo ""; - echo ""; - } - echo '
'; - } - } } elseif ($viewBy == 'class') { - if ($gibbonCourseClassID == '') { - $page->addError(__('You have not specified one or more required parameters.')); - } else { - if ($highestAction == 'Lesson Planner_viewEditAllClasses' or $highestAction == 'Lesson Planner_viewAllEditMyClasses' or $highestAction == 'Lesson Planner_viewOnly') { - - $data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'), 'gibbonCourseClassID' => $gibbonCourseClassID); - $sql = 'SELECT gibbonCourseClass.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class FROM gibbonCourseClass JOIN gibbonCourse ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID) WHERE gibbonCourse.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonCourseClass.gibbonCourseClassID=:gibbonCourseClassID'; - $result = $connection2->prepare($sql); - $result->execute($data); - $teacher = false; - - - $dataTeacher = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'), 'gibbonCourseClassID' => $gibbonCourseClassID, 'gibbonPersonID' => $session->get('gibbonPersonID')); - $sqlTeacher = 'SELECT gibbonCourseClass.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class FROM gibbonCourseClassPerson JOIN gibbonCourseClass ON (gibbonCourseClassPerson.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID) WHERE gibbonCourse.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonCourseClass.gibbonCourseClassID=:gibbonCourseClassID AND gibbonPersonID=:gibbonPersonID'; - $resultTeacher = $connection2->prepare($sqlTeacher); - $resultTeacher->execute($dataTeacher); - if ($resultTeacher->rowCount() > 0) { - $teacher = true; - } - } elseif ($highestAction == 'Lesson Planner_viewMyClasses') { - - $data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'), 'gibbonCourseClassID' => $gibbonCourseClassID, 'gibbonPersonID' => $session->get('gibbonPersonID')); - $sql = 'SELECT gibbonCourseClass.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class FROM gibbonCourseClassPerson JOIN gibbonCourseClass ON (gibbonCourseClassPerson.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID) WHERE gibbonCourse.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonCourseClass.gibbonCourseClassID=:gibbonCourseClassID AND gibbonPersonID=:gibbonPersonID'; - $result = $connection2->prepare($sql); - $result->execute($data); - } - - if ($result->rowCount() != 1) { - $page->addError(__('The selected record does not exist, or you do not have access to it.')); - } else { - $row = $result->fetch(); - - $page->breadcrumbs->add(__('Planner for {classDesc}', [ - 'classDesc' => $row['course'].'.'.$row['class'], - ])); - - $returns = array(); - $returns['success1'] = __('Bump was successful. It is possible that some lessons have not been moved (if there was no space for them), but a reasonable effort has been made.'); - $page->return->addReturns($returns); - - try { - if ($highestAction == 'Lesson Planner_viewEditAllClasses' or $highestAction == 'Lesson Planner_viewAllEditMyClasses' or $highestAction == 'Lesson Planner_viewOnly') { - if ($subView == 'lesson' or $subView == '') { - $data = array('gibbonCourseClassID' => $gibbonCourseClassID); - $sql = "SELECT gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, date, timeStart, timeEnd, viewableStudents, viewableParents, homework, 'Teacher' as role, homeworkSubmission, homeworkCrowdAssess, gibbonPlannerEntry.gibbonCourseClassID, NULL AS myHomeworkDueDateTime FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID ORDER BY date DESC, timeStart DESC"; - } else { - $data = array('gibbonCourseClassID' => $gibbonCourseClassID); - $sql = 'SELECT DISTINCT timeStart, timeEnd, date, gibbonTTColumnRow.name AS period, NULL AS myHomeworkDueDateTime FROM gibbonTTDayRowClass JOIN gibbonTTColumnRow ON (gibbonTTDayRowClass.gibbonTTColumnRowID=gibbonTTColumnRow.gibbonTTColumnRowID) JOIN gibbonTTColumn ON (gibbonTTColumnRow.gibbonTTColumnID=gibbonTTColumn.gibbonTTColumnID) JOIN gibbonTTDay ON (gibbonTTDayRowClass.gibbonTTDayID=gibbonTTDay.gibbonTTDayID) JOIN gibbonTTDayDate ON (gibbonTTDayDate.gibbonTTDayID=gibbonTTDay.gibbonTTDayID) WHERE gibbonCourseClassID=:gibbonCourseClassID ORDER BY date, timestart'; - } - } elseif ($highestAction == 'Lesson Planner_viewMyClasses') { - $data = array('gibbonCourseClassID' => $gibbonCourseClassID, 'gibbonPersonID' => $session->get('gibbonPersonID')); - $sql = "SELECT gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, date, timeStart, timeEnd, viewableStudents, viewableParents, homework, role, homeworkSubmission, homeworkCrowdAssess, gibbonPlannerEntry.gibbonCourseClassID, gibbonPlannerEntryStudentHomework.homeworkDueDateTime AS myHomeworkDueDateTime FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) LEFT JOIN gibbonPlannerEntryStudentHomework ON (gibbonPlannerEntryStudentHomework.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID AND gibbonPlannerEntryStudentHomework.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' ORDER BY date DESC, timeStart DESC"; - } - $result = $connection2->prepare($sql); - $result->execute($data); - } catch (PDOException $e) { - } - - //Only show add if user has edit rights - if ($highestAction == 'Lesson Planner_viewAllEditMyClasses' or $highestAction == 'Lesson Planner_viewEditAllClasses') { - echo "
"; - $style = ''; - if ($subView == 'lesson' or $subView == '') { - $style = "style='font-weight: bold'"; - } - echo "".__('Lesson View').' | '; - $style = ''; - if ($subView == 'year') { - $style = "style='font-weight: bold'"; - } - echo "".__('Year Overview').' | '; - echo "".__('Add').""; - echo '
'; - } - - if ($result->rowCount() < 1) { - echo $page->getBlankSlate(); - } else { - //PRINT LESSON VIEW - if ($subView == 'lesson' or $subView == '') { - echo ""; - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo "'; - echo ''; - - $count = 0; - $pastCount = 0; - $rowNum = 'odd'; - while ($row = $result->fetch()) { - if ((!($row['role'] == 'Student' and $row['viewableStudents'] == 'N')) and (!($row['role'] == 'Guest Student' and $row['viewableStudents'] == 'N'))) { - if ($count % 2 == 0) { - $rowNum = 'even'; - } else { - $rowNum = 'odd'; - } - ++$count; - - //Highlight class in progress - if ((date('Y-m-d') == $row['date']) and (date('H:i:s') > $row['timeStart']) and (date('H:i:s') < $row['timeEnd'])) { - $rowNum = 'current'; - } - - //Dull out past classes - if ((($row['date']) == date('Y-m-d') and (date('H:i:s') > $row['timeEnd'])) or ($row['date']) < date('Y-m-d')) { - $rowNum = 'past'; - if ($pastCount == 0) { - echo ""; - echo "'; - } - ++$pastCount; - } - - //COLOR ROW BY STATUS! - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - } - echo '
'; - echo __('Date'); - echo ''; - echo __('Lesson').'
'; - echo "".__('Unit').''; - echo '
'; - echo __('Time'); - echo ''; - echo __($homeworkNameSingular); - echo ''; - echo __('Access'); - echo '"; - echo __('Actions'); - echo '
"; - echo '
'; - if (!(is_null($row['date']))) { - echo ''.Format::date($row['date']).'
'; - echo Format::dayOfWeekName($row['date']); - } - echo '
'; - echo ''.$row['name'].'
'; - echo ""; - $unit = getUnit($connection2, $row['gibbonUnitID'], $row['gibbonCourseClassID']); - if (isset($unit[0])) { - echo $unit[0]; - if (isset($unit[1])) { - if ($unit[1] != '') { - echo '
'.$unit[1].' '.__('Unit').''; - } - } - } - echo '
'; - echo '
'; - if ($row['timeStart'] != '' and $row['timeEnd'] != '') { - echo substr($row['timeStart'], 0, 5).'-'.substr($row['timeEnd'], 0, 5); - } - echo ''; - if ($row['homework'] == 'N' and $row['myHomeworkDueDateTime'] == '') { - echo __('No'); - } else { - if ($row['homework'] == 'Y') { - echo __('Yes').': '.__('Teacher Recorded').'
'; - if ($row['homeworkSubmission'] == 'Y') { - echo "+".__('Submission').'
'; - if ($row['homeworkCrowdAssess'] == 'Y') { - echo "+".__('Crowd Assessment').'
'; - } - } - } - if ($row['myHomeworkDueDateTime'] != '') { - echo __('Yes').': '.__('Student Recorded').'
'; - } - } - echo '
'; - if ($row['viewableStudents'] == 'Y') { - echo __('Students'); - } - if ($row['viewableStudents'] == 'Y' and $row['viewableParents'] == 'Y') { - echo ', '; - } - if ($row['viewableParents'] == 'Y') { - echo __('Parents'); - } - echo ''; - echo " "; - if ((($highestAction == 'Lesson Planner_viewAllEditMyClasses' and $teacher == true) or $highestAction == 'Lesson Planner_viewEditAllClasses')) { - echo " "; - echo ""; - echo ""; - } - if ($highestAction == 'Lesson Planner_viewAllEditMyClasses' or $highestAction == 'Lesson Planner_viewEditAllClasses') { - echo ""; - } - echo '
'; - } - //PRINT YEAR OVERVIEW - else { - $count = 0; - $lessons = array(); - while ($rowNext = $result->fetch()) { - - $dataPlanner = array('date' => $rowNext['date'], 'timeStart' => $rowNext['timeStart'], 'timeEnd' => $rowNext['timeEnd'], 'gibbonCourseClassID' => $gibbonCourseClassID); - $sqlPlanner = 'SELECT * FROM gibbonPlannerEntry WHERE date=:date AND timeStart=:timeStart AND timeEnd=:timeEnd AND gibbonCourseClassID=:gibbonCourseClassID'; - $resultPlanner = $connection2->prepare($sqlPlanner); - $resultPlanner->execute($dataPlanner); - if ($resultPlanner->rowCount() == 0) { - $lessons[$count][0] = 'Unplanned'; - $lessons[$count][1] = $rowNext['date']; - $lessons[$count][2] = $rowNext['timeStart']; - $lessons[$count][3] = $rowNext['timeEnd']; - $lessons[$count][4] = $rowNext['period']; - $lessons[$count][6] = $rowNext['gibbonTTDayRowClassID'] ?? ''; - $lessons[$count][7] = $rowNext['gibbonTTDayDateID'] ?? ''; - $lessons[$count][11] = null; - $lessons[$count][12] = null; - $lessons[$count][13] = null; - } else { - $rowPlanner = $resultPlanner->fetch(); - $lessons[$count][0] = 'Planned'; - $lessons[$count][1] = $rowNext['date']; - $lessons[$count][2] = $rowNext['timeStart']; - $lessons[$count][3] = $rowNext['timeEnd']; - $lessons[$count][4] = $rowNext['period']; - $lessons[$count][5] = $rowPlanner['name']; - $lessons[$count][6] = false; - $lessons[$count][7] = false; - $lessons[$count][11] = $rowPlanner['gibbonUnitID']; - $lessons[$count][12] = $rowPlanner['gibbonPlannerEntryID']; - $lessons[$count][13] = $rowPlanner['gibbonCourseClassID']; - } - - //Check for special days - - $dataSpecial = array('date' => $rowNext['date']); - $sqlSpecial = 'SELECT * FROM gibbonSchoolYearSpecialDay WHERE date=:date'; - $resultSpecial = $connection2->prepare($sqlSpecial); - $resultSpecial->execute($dataSpecial); - - if ($resultSpecial->rowCount() == 1) { - $rowSpecial = $resultSpecial->fetch(); - $lessons[$count][8] = $rowSpecial['type']; - $lessons[$count][9] = $rowSpecial['schoolStart']; - $lessons[$count][10] = $rowSpecial['schoolEnd']; - } else { - $lessons[$count][8] = false; - $lessons[$count][9] = false; - $lessons[$count][10] = false; - } - - ++$count; - } - - if (count($lessons) < 1) { - echo $page->getBlankSlate(); - } else { - //Get term dates - $terms = array(); - $termCount = 0; - - $dataTerms = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID')); - $sqlTerms = 'SELECT * FROM gibbonSchoolYearTerm WHERE gibbonSchoolYearID=:gibbonSchoolYearID ORDER BY sequenceNumber'; - $resultTerms = $connection2->prepare($sqlTerms); - $resultTerms->execute($dataTerms); - - while ($rowTerms = $resultTerms->fetch()) { - $terms[$termCount][0] = $rowTerms['firstDay']; - $terms[$termCount][1] = __('Start of').' '.$rowTerms['nameShort']; - ++$termCount; - $terms[$termCount][0] = $rowTerms['lastDay']; - $terms[$termCount][1] = __('End of').' '.$rowTerms['nameShort']; - ++$termCount; - } - //Get school closure special days - $specials = array(); - $specialCount = 0; - - $dataSpecial = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID')); - $sqlSpecial = "SELECT gibbonSchoolYearSpecialDay.date, gibbonSchoolYearSpecialDay.name FROM gibbonSchoolYearSpecialDay JOIN gibbonSchoolYearTerm ON (gibbonSchoolYearSpecialDay.gibbonSchoolYearTermID=gibbonSchoolYearTerm.gibbonSchoolYearTermID) WHERE gibbonSchoolYearID=:gibbonSchoolYearID AND type='School Closure' ORDER BY date"; - $resultSpecial = $connection2->prepare($sqlSpecial); - $resultSpecial->execute($dataSpecial); - - $lastName = ''; - $currentName = ''; - $lastDate = ''; - $currentDate = ''; - $originalDate = ''; - while ($rowSpecial = $resultSpecial->fetch()) { - $currentName = $rowSpecial['name']; - $currentDate = $rowSpecial['date']; - if ($currentName != $lastName) { - $currentName = $rowSpecial['name']; - $specials[$specialCount][0] = $rowSpecial['date']; - $specials[$specialCount][1] = $rowSpecial['name']; - $specials[$specialCount][2] = Format::date($rowSpecial['date']); - $originalDate = Format::date($rowSpecial['date']); - ++$specialCount; - } else { - if ((strtotime($currentDate) - strtotime($lastDate)) == 86400) { - $specials[$specialCount - 1][2] = $originalDate.' - '.Format::date($rowSpecial['date']); - } else { - $currentName = $rowSpecial['name']; - $specials[$specialCount][0] = $rowSpecial['date']; - $specials[$specialCount][1] = $rowSpecial['name']; - $specials[$specialCount][2] = Format::date($rowSpecial['date']); - $originalDate = Format::date($rowSpecial['date']); - ++$specialCount; - } - } - $lastName = $rowSpecial['name']; - $lastDate = $rowSpecial['date']; - } - - echo ""; - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - $count = 0; - $termCount = 0; - $specialCount = 0; - $classCount = 0; - $rowNum = 'odd'; - $divide = false; //Have we passed gotten to today yet? - - foreach ($lessons as $lesson) { - if ($count % 2 == 0) { - $rowNum = 'even'; - } else { - $rowNum = 'odd'; - } - - $style = ''; - if ($lesson[1] >= date('Y-m-d') and $divide == false) { - $divide = true; - $style = "style='border-top: 2px solid #333'"; - } - - if ($divide == false) { - $rowNum = 'error'; - } - ++$count; - - //Spit out row for start of term - while ($termCount < (count($terms) - 1) && $lesson['1'] >= $terms[$termCount][0]) { - if (substr($terms[$termCount][1], 0, 3) == 'End' and $lesson['1'] == $terms[$termCount][0]) { - break; - } else { - echo ""; - echo ''; - echo ''; - echo ''; - ++$termCount; - } - } - - //Spit out row for special day - while ($lesson['1'] >= @$specials[$specialCount][0] and $specialCount < count($specials)) { - echo ""; - echo ''; - echo ''; - echo ''; - ++$specialCount; - } - - //COLOR ROW BY STATUS! - if ($lesson[8] != 'School Closure') { - - $times = $plannerEntryGateway->getPlannerTTByClassTimes($gibbonCourseClassID, $lesson[1], $lesson[2], $lesson[3]); - - echo ""; - echo ""; - echo "'; - echo "'; - echo "'; - echo "'; - echo ''; - ++$classCount; - } - - //Spit out row for end of term/year - while ($lesson['1'] >= @$terms[$termCount][0] and $termCount < count($terms) and substr($terms[$termCount][1], 0, 3) == 'End') { - echo ""; - echo ''; - echo ''; - echo ''; - ++$termCount; - } - } - - if (@$terms[$termCount][0] != '') { - echo ""; - echo ''; - echo ''; - echo ''; - } - echo '
'; - echo __('Lesson
Number'); - echo '
'; - echo __('Date'); - echo ''; - echo __('TT Period').'
'; - echo "".__('Time')." & ".__('Facility').""; - echo '
'; - echo __('Planned Lesson').'
'; - echo "".__('Unit').""; - echo '
'; - echo __('Actions'); - echo '
'; - echo ''.$terms[$termCount][1].''; - echo ''; - echo Format::date($terms[$termCount][0]); - echo '
'; - echo ''.$specials[$specialCount][1].''; - echo ''; - echo $specials[$specialCount][2]; - echo '
"; - echo "".__('Lesson')." ".($classCount + 1).""; - echo ""; - echo ''.Format::date($lesson['1']).'
'; - echo Format::dayOfWeekName($lesson['1']).'
'; - echo Format::monthName($lesson['1']).'
'; - if ($lesson[8] == 'Timing Change') { - echo ''.$lesson[8].'
('.substr($lesson[9], 0, 5).'-'.substr($lesson[10], 0, 5).')'; - } - echo '
"; - echo $lesson['4'].'
'; - echo "".substr($lesson['2'], 0, 5).' - '.substr($lesson['3'], 0, 5).''; - echo "
".($times['spaceName'] ?? '').""; - echo '
"; - if ($lesson['0'] == 'Planned') { - echo ''.$lesson['5'].'
'; - $unit = getUnit($connection2, $lesson[11], $lesson[13]); - if (isset($unit[0])) { - echo ""; - echo $unit[0]; - if (isset($unit[1])) { - if ($unit[1] != '') { - echo '
'.$unit[1].' Unit'; - } - } - echo '
'; - } - } - echo '
"; - if ($lesson['0'] == 'Unplanned') { - echo ""; - } else { - echo " "; - if ((($highestAction == 'Lesson Planner_viewAllEditMyClasses' and $teacher == true) or $highestAction == 'Lesson Planner_viewEditAllClasses')) { - echo " "; - echo ""; - echo ""; - echo ""; - } - } - echo '
'; - echo ''.$terms[$termCount][1].''; - echo ''; - echo Format::date($terms[$termCount][0]); - echo '
'; - echo ''.$terms[$termCount][1].''; - echo ''; - echo Format::date($terms[$termCount][0]); - echo '
'; - } - } - } - } + $planner = $plannerEntryGateway->getPlannerClassDetails($gibbonCourseClassID); + if (empty($planner)) { + $page->addError(__('The selected record does not exist, or you do not have access to it.')); + return; } + + $page->breadcrumbs->add(__('Planner for {classDesc}', [ + 'classDesc' => $planner['course'].'.'.$planner['class'], + ])); } + + $viewBy = $subView == 'year' ? 'year' : $viewBy; + + $table = $container->get(LessonTable::class)->create($gibbonSchoolYearID, $gibbonCourseClassID, $gibbonPersonID, $date, $viewBy); + echo $table->getOutput(); } } - if ($gibbonPersonID != '') { + + if (!empty($gibbonPersonID)) { //Print sidebar $session->set('sidebarExtra', sidebarExtra($guid, $connection2, $todayStamp, $gibbonPersonID, $dateStamp, $gibbonCourseClassID)); } diff --git a/modules/Planner/planner_add.php b/modules/Planner/planner_add.php index 2410cdc2a2..a3518c36b1 100644 --- a/modules/Planner/planner_add.php +++ b/modules/Planner/planner_add.php @@ -383,7 +383,6 @@ $row->addSelect('role')->fromArray($roles); $row = $form->addRow(); - $row->addFooter(); $row->addCheckbox('notify')->description(__('Notify all class participants')); $row->addSubmit(); diff --git a/modules/Planner/planner_addProcess.php b/modules/Planner/planner_addProcess.php index c3be201847..6f56ac9580 100644 --- a/modules/Planner/planner_addProcess.php +++ b/modules/Planner/planner_addProcess.php @@ -24,6 +24,7 @@ use Gibbon\Domain\System\NotificationGateway; use Gibbon\Data\Validator; use Gibbon\Forms\CustomFieldHandler; +use Gibbon\Forms\Builder\Storage\FormSessionStorage; include '../../gibbon.php'; @@ -267,6 +268,9 @@ header("Location: {$URL}"); exit(); } else { + // Clear autosave + $container->get(FormSessionStorage::class)->clear('plannerAdd'); + //Jump to Markbook? $markbook = $_POST['markbook'] ?? ''; if ($markbook == 'Y') { diff --git a/modules/Planner/planner_deadlines.php b/modules/Planner/planner_deadlines.php index 09f9243306..d7f783c86b 100644 --- a/modules/Planner/planner_deadlines.php +++ b/modules/Planner/planner_deadlines.php @@ -146,7 +146,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/planner_deadlines.php'); diff --git a/modules/Planner/planner_edit.php b/modules/Planner/planner_edit.php index 0165e12a94..20cc155796 100644 --- a/modules/Planner/planner_edit.php +++ b/modules/Planner/planner_edit.php @@ -426,7 +426,6 @@ $row->addSelect('role')->fromArray($roles); $row = $form->addRow(); - $row->addFooter(); $row->addCheckbox('notify')->description(__('Notify all class participants')); $row->addSubmit(); diff --git a/modules/Planner/planner_view_full.php b/modules/Planner/planner_view_full.php index 6cd25c8f6e..0e017f8092 100644 --- a/modules/Planner/planner_view_full.php +++ b/modules/Planner/planner_view_full.php @@ -32,6 +32,7 @@ use Gibbon\Tables\DataTable; use Gibbon\Forms\CustomFieldHandler; use Gibbon\Domain\Timetable\TimetableDayDateGateway; +use Gibbon\Http\Url; //Module includes require_once __DIR__ . '/moduleFunctions.php'; @@ -49,6 +50,7 @@ } else { $settingGateway = $container->get(SettingGateway::class); + $plannerEntryGateway = $container->get(PlannerEntryGateway::class); $homeworkNameSingular = $settingGateway->getSettingByScope('Planner', 'homeworkNameSingular'); $homeworkNamePlural = $settingGateway->getSettingByScope('Planner', 'homeworkNamePlural'); @@ -188,16 +190,11 @@ // planner's parameters $params = []; $params['gibbonPlannerEntryID'] = $gibbonPlannerEntryID; - if ($date != '') { - $params['date'] = $_GET['date'] ?? ''; - } - if ($viewBy != '') { - $params['viewBy'] = $_GET['viewBy'] ?? ''; - } - if ($gibbonCourseClassID != '') { - $params['gibbonCourseClassID'] = $gibbonCourseClassID; - } + $params['gibbonCourseClassID'] = $values['gibbonCourseClassID']; + $params['date'] = $values['date']; + $params['viewBy'] = $viewBy; $params['subView'] = $subView; + $params['search'] = $gibbonPersonID; $paramsVar = '&' . http_build_query($params); // for backward compatibile uses below (should be get rid of) $roleCategory = $session->get('gibbonRoleIDCurrentCategory'); @@ -240,98 +237,72 @@ } } echo ''; - echo "
"; + + echo '
'; + + + + $dataMarkbook = array('gibbonCourseClassID' => $values['gibbonCourseClassID'], 'gibbonPlannerEntryID' => $gibbonPlannerEntryID); + $sqlMarkbook = 'SELECT gibbonMarkbookColumnID FROM gibbonMarkbookColumn WHERE gibbonCourseClassID=:gibbonCourseClassID AND gibbonPlannerEntryID=:gibbonPlannerEntryID'; + $gibbonMarkbookColumnID = $pdo->selectOne($sqlMarkbook, $dataMarkbook); + + + // Details Table + $table = DataTable::createDetails('overview'); + if (strstr($values['role'], 'Guest') == false) { - //Links to previous and next lessons - echo "

"; - echo "".__('For this class:').'
'; - try { - if ($values['role'] == 'Teacher' or $highestAction == 'Lesson Planner_viewOnly') { - $dataPrevious = array('gibbonCourseClassID' => $values['gibbonCourseClassID'], 'date1' => $values['date'], 'date2' => $values['date'], 'timeStart' => $values['timeStart']); - $sqlPrevious = "SELECT gibbonPlannerEntry.gibbonCourseClassID, gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, 'Teacher' AS role FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID AND (date<:date1 OR (date=:date2 AND timeStart<:timeStart)) ORDER BY date DESC, timeStart DESC"; - } else { - if ($highestAction == 'Lesson Planner_viewMyChildrensClasses') { - $dataPrevious = array('gibbonCourseClassID' => $values['gibbonCourseClassID'], 'gibbonPersonID' => $gibbonPersonID, 'date1' => $values['date'], 'date2' => $values['date'], 'timeStart' => $values['timeStart']); - $sqlPrevious = "SELECT gibbonPlannerEntry.gibbonCourseClassID, gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' AND (date<:date1 OR (date=:date2 AND timeStart<:timeStart)) AND viewableParents='Y' ORDER BY date DESC, timeStart DESC"; - } else { - $dataPrevious = array('gibbonCourseClassID' => $values['gibbonCourseClassID'], 'gibbonPersonID' => $session->get('gibbonPersonID'), 'date1' => $values['date'], 'date2' => $values['date'], 'timeStart' => $values['timeStart']); - $sqlPrevious = "SELECT gibbonPlannerEntry.gibbonCourseClassID, gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' AND (date<:date1 OR (date=:date2 AND timeStart<:timeStart)) AND viewableStudents='Y' ORDER BY date DESC, timeStart DESC"; - } - } - $resultPrevious = $connection2->prepare($sqlPrevious); - $resultPrevious->execute($dataPrevious); - } catch (PDOException $e) { - } - if ($resultPrevious->rowCount() > 0) { - $rowPrevious = $resultPrevious->fetch(); - echo "".__('Previous Lesson').''; - } else { - echo __('Previous Lesson'); - } + $previousLesson = $plannerEntryGateway->getPreviousLesson($gibbonCourseClassID, $values['date'], $values['timeStart'], $values['role']); + $nextLesson = $plannerEntryGateway->getNextLesson($gibbonCourseClassID, $values['date'], $values['timeStart'], $values['role']); - echo ' | '; + $form = Form::createBlank('nav', ''); + $form->addHiddenValue('address', $session->get('address')); + $form->addClass('flex-grow flex justify-start items-end'); + + $navUrl = Url::fromModuleRoute('Planner', 'planner_view_full')->withQueryParams($params); + + $row = $form->addRow(); + $col = $row->addColumn()->addClass('flex-1 flex items-center'); + $col->addButton(__('Previous Lesson')) + ->groupAlign('left') + ->addClass('text-xs') + ->setAction(!empty($previousLesson) + ? $navUrl->withQueryParam('gibbonPlannerEntryID', $previousLesson['gibbonPlannerEntryID']) : ''); + $col->addButton(__('Next Lesson')) + ->groupAlign('right') + ->addClass('text-xs') + ->setAction(!empty($nextLesson) ? + $navUrl->withQueryParam('gibbonPlannerEntryID', $nextLesson['gibbonPlannerEntryID']) : ''); + + $table->addHeaderContent($form->getOutput()); + } - try { - if ($values['role'] == 'Teacher' or $highestAction == 'Lesson Planner_viewOnly') { - $dataNext = array('gibbonCourseClassID' => $values['gibbonCourseClassID'], 'date1' => $values['date'], 'date2' => $values['date'], 'timeStart' => $values['timeStart']); - $sqlNext = "SELECT gibbonPlannerEntry.gibbonCourseClassID, gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, 'Teacher' AS role FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID AND (date>:date1 OR (date=:date2 AND timeStart>:timeStart)) ORDER BY date, timeStart"; - } else { - if ($highestAction == 'Lesson Planner_viewMyChildrensClasses') { - $dataNext = array('gibbonCourseClassID' => $values['gibbonCourseClassID'], 'gibbonPersonID' => $gibbonPersonID, 'date1' => $values['date'], 'date2' => $values['date'], 'timeStart' => $values['timeStart']); - $sqlNext = "SELECT gibbonPlannerEntry.gibbonCourseClassID, gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' AND (date>:date1 OR (date=:date2 AND timeStart>:timeStart)) AND viewableParents='Y' ORDER BY date, timeStart"; - } else { - $dataNext = array('gibbonCourseClassID' => $values['gibbonCourseClassID'], 'gibbonPersonID' => $session->get('gibbonPersonID'), 'date1' => $values['date'], 'date2' => $values['date'], 'timeStart' => $values['timeStart']); - $sqlNext = "SELECT gibbonPlannerEntry.gibbonCourseClassID, gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, role FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonPlannerEntry.gibbonCourseClassID=:gibbonCourseClassID AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' AND (date>:date1 OR (date=:date2 AND timeStart>:timeStart)) AND viewableStudents='Y' ORDER BY date, timeStart"; - } - } - $resultNext = $connection2->prepare($sqlNext); - $resultNext->execute($dataNext); - } catch (PDOException $e) { - } - if ($resultNext->rowCount() > 0) { - $rowNext = $resultNext->fetch(); - echo "".__('Next Lesson').''; - } else { - echo __('Next Lesson'); - } - echo '

'; + if ($values['role'] == 'Teacher') { + $table->addHeaderContent(" ".__('Show Confidential Data').''); + } + + if (!empty($values['gibbonUnitID'])) { + $table->addHeaderAction('book-open', __('Unit Overview')) + ->setURL('/modules/Planner/planner_unitOverview.php') + ->addParam('gibbonUnitID', $values['gibbonUnitID']) + ->addParams($params) + ->displayLabel(); } - echo ''; - echo ''; if ($values['role'] == 'Teacher') { - echo "
"; - echo '
'; - if ($values['gibbonUnitID'] != '') { - echo "".__('Unit Overview').' | '; - } - echo "".__('Edit')." | "; - - $dataMarkbook = array('gibbonCourseClassID' => $values['gibbonCourseClassID'], 'gibbonPlannerEntryID' => $gibbonPlannerEntryID); - $sqlMarkbook = 'SELECT * FROM gibbonMarkbookColumn WHERE gibbonCourseClassID=:gibbonCourseClassID AND gibbonPlannerEntryID=:gibbonPlannerEntryID'; - $resultMarkbook = $connection2->prepare($sqlMarkbook); - $resultMarkbook->execute($dataMarkbook); - if ($resultMarkbook->rowCount() == 1) { - $rowMarkbook = $resultMarkbook->fetch(); - echo "".__('Linked Markbook')." | "; - } - echo ""; - echo " ".__('Show Confidential Data').''; - echo '
'; echo " - setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $row = $form->addRow(); diff --git a/modules/Planner/resources_manage.php b/modules/Planner/resources_manage.php index 63d9f72634..197e0fcef5 100644 --- a/modules/Planner/resources_manage.php +++ b/modules/Planner/resources_manage.php @@ -45,7 +45,7 @@ // FORM $form = Form::create('resourcesManage', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/resources_manage.php'); diff --git a/modules/Planner/resources_view.php b/modules/Planner/resources_view.php index 22a9988992..f0b2134cfb 100644 --- a/modules/Planner/resources_view.php +++ b/modules/Planner/resources_view.php @@ -52,7 +52,7 @@ $form = Form::create('resourcesView', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/resources_view.php'); diff --git a/modules/Planner/scopeAndSequence.php b/modules/Planner/scopeAndSequence.php index 645b724194..103f207d30 100644 --- a/modules/Planner/scopeAndSequence.php +++ b/modules/Planner/scopeAndSequence.php @@ -48,7 +48,7 @@ $form = Form::create('action', $session->get('absoluteURL')."/index.php?q=/modules/".$session->get('module')."/scopeAndSequence.php"); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $options = array(); diff --git a/modules/Planner/src/Forms/PlannerFormFactory.php b/modules/Planner/src/Forms/PlannerFormFactory.php index 1447f01a29..8ddf1f7ba1 100644 --- a/modules/Planner/src/Forms/PlannerFormFactory.php +++ b/modules/Planner/src/Forms/PlannerFormFactory.php @@ -229,7 +229,7 @@ public function createOutcomeBlockTemplate($allowOutcomeEditing) : OutputableInt ->setClass('w-3/4 readonly mt-1') ->readonly(); - $col = $blockTemplate->addRow()->addClass('showHide fullWidth')->addColumn(); + $col = $blockTemplate->addRow()->addClass('showHide w-full')->addColumn(); if ($allowOutcomeEditing == 'Y') { $col->addTextArea('outcomecontents')->setRows(10)->addData('tinymce'); } else { diff --git a/modules/Planner/src/Tables/LessonTable.php b/modules/Planner/src/Tables/LessonTable.php new file mode 100644 index 0000000000..e667d51f06 --- /dev/null +++ b/modules/Planner/src/Tables/LessonTable.php @@ -0,0 +1,396 @@ +. +*/ + +namespace Gibbon\Module\Planner\Tables; + +use Gibbon\Domain\DataSet; +use Gibbon\Services\Format; +use Gibbon\Tables\DataTable; +use Gibbon\Contracts\Services\Session; +use Gibbon\Contracts\Database\Connection; +use Gibbon\Domain\System\SettingGateway; +use Gibbon\Domain\Planner\PlannerEntryGateway; +use Gibbon\Domain\School\SchoolYearTermGateway; + +/** + * LessonTable + * + * Reusable DataTable class for displaying lesson plans. + * + * @version v28 + * @since v28 + */ +class LessonTable +{ + protected $session; + protected $db; + protected $settingGateway; + protected $plannerEntryGateway; + protected $schoolYearTermGateway; + + protected $homeworkNameSingular; + protected $homeworkNamePlural; + + public function __construct(Session $session, Connection $db, SettingGateway $settingGateway, PlannerEntryGateway $plannerEntryGateway, SchoolYearTermGateway $schoolYearTermGateway) + { + $this->session = $session; + $this->db = $db; + $this->settingGateway = $settingGateway; + $this->plannerEntryGateway = $plannerEntryGateway; + $this->schoolYearTermGateway = $schoolYearTermGateway; + + $this->homeworkNameSingular = $settingGateway->getSettingByScope('Planner', 'homeworkNameSingular'); + $this->homeworkNamePlural = $settingGateway->getSettingByScope('Planner', 'homeworkNamePlural'); + } + + public function create($gibbonSchoolYearID, $gibbonCourseClassID, $gibbonPersonID, $date, $viewBy = 'date') + { + $guid = $this->session->get('guid'); + $connection2 = $this->db->getConnection(); + + $highestAction = getHighestGroupedAction($guid, '/modules/Planner/planner.php', $connection2); + $roleCategory = $this->session->get('gibbonRoleIDCurrentCategory'); + $gibbonPersonIDSelf = $this->session->get('gibbonPersonID'); + + $viewingAs = $this->getViewingAs($highestAction, $roleCategory); + $editAccess = $this->getEditAccess($highestAction, $roleCategory); + + if ($editAccess || $highestAction == 'Lesson Planner_viewOnly') { + $gibbonPersonID = $viewBy == 'date' && $viewingAs == 'Teacher' ? $gibbonPersonIDSelf : null; + } else { + $gibbonPersonID = $gibbonPersonID ?? $gibbonPersonIDSelf; + } + + $criteria = $this->plannerEntryGateway->newQueryCriteria($viewBy != 'year') + ->sortBy('date', $viewBy == 'year' ? 'ASC' : 'DESC') + ->sortBy('timeStart', $viewBy != 'class' ? 'ASC' : 'DESC') + ->fromPOST(); + + if ($viewBy == 'year') { + $lessons = $this->plannerEntryGateway->queryPlannerTimeSlotsByClass($criteria, $gibbonSchoolYearID, $gibbonCourseClassID); + } else if ($viewBy == 'class') { + $lessons = $this->plannerEntryGateway->queryPlannerByClass($criteria, $gibbonSchoolYearID, $gibbonPersonID, $gibbonCourseClassID, $viewingAs); + } else { + $lessons = $this->plannerEntryGateway->queryPlannerByDate($criteria, $gibbonSchoolYearID, $gibbonPersonID, $date, $viewingAs); + } + + $lessonCount = 1; + $lessons->transform(function (&$values) use (&$lessonCount, $roleCategory, $gibbonPersonIDSelf) { + $teacherList = explode(',', $values['teacherIDs'] ?? ''); + $values['isTeacher'] = $roleCategory == 'Staff' && !empty($teacherList) && in_array($gibbonPersonIDSelf, $teacherList) === true; + $values['lessonNumber'] = __('Lesson').' '.$lessonCount; + $lessonCount++; + }); + + if ($viewBy == 'year') { + $lessons = $this->addSchoolClosureDates($gibbonSchoolYearID, $lessons->toArray()); + } + + $table = DataTable::createPaginated('lessonPlanner', $criteria)->withData($lessons); + + $table->addMetaData('blankSlate', $viewBy == 'class' ? __('There are no lessons for this class.') : __('There are no lessons on this date.')); + + $table->modifyRows(function ($values, $row) { + $now = date('H:i:s'); + $today = date('Y-m-d'); + + if (!empty($values['closure'])) { + $row->addClass('magic'); + } elseif ($now > $values['timeStart'] && $now < $values['timeEnd'] && $values['date'] == $today) { + $row->addClass('current'); + } else if ($values['date'] < $today || ($values['date'] == $today && $now > $values['timeEnd']) ) { + $row->addClass('dull'); + } + return $row; + }); + + if ($editAccess && ($viewBy == 'class' || $viewBy == 'year')) { + $table->addHeaderAction('lessonView', __('Lesson View')) + ->setURL('/modules/Planner/planner.php') + ->addParam('gibbonCourseClassID', $gibbonCourseClassID) + ->addParam('viewBy', 'class') + ->addParam('subView', 'lesson') + ->setIcon('book-open') + ->addClass($viewBy == 'class' ? 'ring-1 ring-blue-500 border-blue-500' : '') + ->displayLabel(); + + $table->addHeaderAction('yearOverview', __('Year Overview')) + ->setURL('/modules/Planner/planner.php') + ->addParam('gibbonCourseClassID', $gibbonCourseClassID) + ->addParam('viewBy', 'class') + ->addParam('subView', 'year') + ->setIcon('calendar') + ->addClass($viewBy == 'year' ? 'ring-1 ring-blue-500 border-blue-500' : '') + ->displayLabel(); + } + if ($editAccess) { + $table->addHeaderAction('add', __('Add')) + ->setURL('/modules/Planner/planner_add.php') + ->addParam('gibbonCourseClassID', $gibbonCourseClassID) + ->addParam('gibbonPersonID', $gibbonPersonID) + ->addParam('date', $date) + ->addParam('viewBy', $viewBy) + ->displayLabel(); + } + + if ($viewBy == 'year') { + $this->addYearOverviewColumns($table); + } else { + $this->addLessonViewColumns($table, $viewBy); + } + + $table->addActionColumn() + ->addParam('gibbonSchoolYearID', $gibbonSchoolYearID) + ->addParam('gibbonPersonID', $gibbonPersonID) + ->addParam('gibbonPlannerEntryID') + ->addParam('gibbonCourseClassID') + ->addParam('date') + ->addParam('timeStart') + ->addParam('timeEnd') + ->addParam('search', $gibbonPersonID) + ->addParam('viewBy', $viewBy == 'date' ? 'date' : 'class') + ->format(function ($values, $actions) use ($editAccess, $highestAction, $viewBy) { + $fullEditAccess = $editAccess && ($highestAction == 'Lesson Planner_viewEditAllClasses' || $values['isTeacher']); + + if (!empty($values['closure'])) return; + + if (empty($values['lesson'])) { + if ($fullEditAccess) { + $actions->addAction('add', __('Add')) + ->setURL('/modules/Planner/planner_add.php'); + return; + } + } + + if ($fullEditAccess) { + $actions->addAction('edit', __('Edit')) + ->setURL('/modules/Planner/planner_edit.php'); + + $actions->addAction('view', __('View')) + ->setURL('/modules/Planner/planner_view_full.php'); + } else { + $actions->addAction('view', __('View')) + ->setURL('/modules/Planner/planner_view_full.php'); + } + + if ($fullEditAccess && ($viewBy == 'class' || $viewBy == 'year')) { + $actions->addAction('copyforward', __('Bump')) + ->setURL('/modules/Planner/planner_bump.php'); + } + + if ($editAccess) { + $actions->addAction('duplicate', __('Duplicate')) + ->setURL('/modules/Planner/planner_duplicate.php'); + } + + if ($fullEditAccess) { + $actions->addAction('delete', __('Delete')) + ->setURL('/modules/Planner/planner_delete.php'); + } + }); + + return $table; + } + + protected function addLessonViewColumns(&$table, $viewBy) + { + if ($viewBy == 'class') { + $table->addColumn('date', __('Date')) + ->sortable(['date']) + ->context('primary') + ->format(function ($values) { + $output = Format::bold(Format::date($values['date'])).'
' + .Format::dayOfWeekName($values['date']); + + return $output; + }); + } else { + $table->addColumn('class', __('Class')) + ->sortable(['course', 'class']) + ->context('primary') + ->format(function ($values) { + return Format::bold(Format::courseClassName($values['course'], $values['class'])).'
' + .Format::small(Format::date($values['date'])); + }); + } + + $table->addColumn('lesson', __('Lesson')) + ->description(__('Unit')) + ->context('primary') + ->format(function ($values) { + return !empty($values['unit']) + ? Format::bold($values['lesson']).'
'.Format::small($values['unit']) + : Format::bold($values['lesson']); + }); + + $table->addColumn('timeStart', __('Time')) + ->context('secondary') + ->format(function ($values) { + return Format::timeRange($values['timeStart'], $values['timeEnd']); + }); + + $table->addColumn('homework', __($this->homeworkNameSingular)) + ->format(function ($values) { + $output = ''; + if ($values['homework'] == 'N' && empty($values['myHomeworkDueDateTime'])) { + $output .= __('No'); + } else { + if ($values['homework'] == 'Y') { + $output .= __('Yes').': '.__('Teacher Recorded').'
'; + if ($values['homeworkSubmission'] == 'Y') { + $output .= Format::small('+'.__('Submission')).'
'; + if ($values['homeworkCrowdAssess'] == 'Y') { + $output .= Format::small('+'.__('Crowd Assessment')).'
'; + } + } + } + if (!empty($values['myHomeworkDueDateTime'])) { + $output .= __('Yes').': '.__('Student Recorded').'
'; + } + } + + return $output; + }); + + $table->addColumn('viewableStudents', __('Access')) + ->format(function ($values) { + $viewableBy = []; + if ($values['viewableStudents'] == 'Y') $viewableBy[] = __('Students'); + if ($values['viewableParents'] == 'Y') $viewableBy[] = __('Parents'); + + return implode(', ', $viewableBy); + }); + } + + protected function addYearOverviewColumns(&$table) + { + $table->addColumn('lessonNumber', __('Lesson
Number')) + ->format(function ($values) { + return Format::bold($values['lessonNumber']); + }); + + $table->addColumn('date', __('Date')) + ->description(__('Month')) + ->sortable(['date']) + ->context('primary') + ->format(function ($values) { + if (!empty($values['closure'])) return $values['closure']; + + $output = Format::bold(Format::date($values['date'])).'

' + .Format::monthName($values['date']); + + return $output; + }); + + $table->addColumn('period', __('TT Period')) + ->description(__('Time')." & ".__('Facility')) + ->context('secondary') + ->format(function ($values) { + if (empty($values['period'])) return; + + return $values['period'].'
'.Format::small(Format::timeRange($values['timeStart'], $values['timeEnd'])).'
'.Format::small($values['spaceName']); + }); + + $table->addColumn('lesson', __('Planned Lesson')) + ->description(__('Unit')) + ->context('primary') + ->format(function ($values) { + if (empty($values['lesson'])) return; + + return !empty($values['unit']) + ? Format::bold($values['lesson']).'
'.Format::small($values['unit']) + : Format::bold($values['lesson']); + }); + } + + protected function addSchoolClosureDates($gibbonSchoolYearID, array $lessons) : array + { + $terms = $this->schoolYearTermGateway->selectTermDetailsBySchoolYear($gibbonSchoolYearID)->fetchGroupedUnique(); + $closures = $this->schoolYearTermGateway->selectSchoolClosuresByTerm(array_keys($terms), true)->fetchGroupedUnique(); + + $lessonData = []; + $lessonCount = count($lessons); + + foreach ($lessons as $lessonIndex => $lesson) { + + foreach ($terms as $termID => $term) { + if ($term['firstDay'] !== false && $lesson['date'] > $term['firstDay']) { + $lessonData[] = [ + 'lessonNumber' => __('Start of').' '.$term['name'], + 'closure' => Format::date($term['firstDay']), + ]; + $terms[$termID]['firstDay'] = false; + } + + if ($term['lastDay'] !== false && $lesson['date'] > $term['lastDay']) { + $lessonData[] = [ + 'lessonNumber' => __('End of').' '.$term['name'], + 'closure' => Format::date($term['lastDay']), + ]; + $terms[$termID]['lastDay'] = false; + } + } + + foreach ($closures as $firstDay => $closure) { + if ($closure !== false && $lesson['date'] > $firstDay) { + $lessonData[] = [ + 'lessonNumber' => $closure['name'], + 'closure' => Format::dateRange($closure['firstDay'], $closure['lastDay']), + ]; + $closures[$firstDay] = false; + } + } + + $lessonData[] = $lesson; + + if ($lessonIndex == $lessonCount-1) { + $finalTerm = end($terms); + if ($finalTerm['lastDay'] !== false) { + $lessonData[] = [ + 'lessonNumber' => __('End of').' '.$finalTerm['name'], + 'closure' => Format::date($finalTerm['lastDay']), + ]; + } + } + } + + + return $lessonData; + } + + protected function getViewingAs($highestAction, $roleCategory) + { + if ($highestAction == 'Lesson Planner_viewMyChildrensClasses' || $roleCategory == 'Parent') { + return 'Parent'; + } else if ($roleCategory == 'Student') { + return 'Student'; + } else if ($highestAction == 'Lesson Planner_viewAllEditMyClasses') { + return 'Teacher'; + } else if ($roleCategory == 'Student') { + return $roleCategory; + } + } + + protected function getEditAccess($highestAction, $roleCategory) + { + return $roleCategory == 'Staff' && ($highestAction == 'Lesson Planner_viewEditAllClasses' || $highestAction == 'Lesson Planner_viewAllEditMyClasses'); + } +} diff --git a/modules/Planner/units_edit_deploy.php b/modules/Planner/units_edit_deploy.php index 3e948d8064..8d50f63bf8 100644 --- a/modules/Planner/units_edit_deploy.php +++ b/modules/Planner/units_edit_deploy.php @@ -109,11 +109,11 @@ $lessonTimes = $plannerEntryGateway->queryPlannerTimeSlotsByClass($criteria, $gibbonSchoolYearID, $gibbonCourseClassID); - $form = Form::create('action', $session->get('absoluteURL').'/index.php?q=/modules/Planner/units_edit_deploy.php&step=2&'.http_build_query($urlParams)); + $form = Form::createBlank('action', $session->get('absoluteURL').'/index.php?q=/modules/Planner/units_edit_deploy.php&step=2&'.http_build_query($urlParams)); $form->setTitle(__('Step 1 - Select Lessons')); $form->setDescription(__('Use the table below to select the lessons you wish to deploy this unit to. Only lessons without existing plans can be included in the deployment.')); - $form->setClass('w-full blank bulkActionForm'); + $form->setClass('bulkActionForm'); $table = $form->addRow()->addDataTable('lessons', $criteria)->withData($lessonTimes); $table->addMetaData('hidePagination', true); diff --git a/modules/Planner/units_edit_working_add.php b/modules/Planner/units_edit_working_add.php index 657a9fdd26..53b8a94698 100644 --- a/modules/Planner/units_edit_working_add.php +++ b/modules/Planner/units_edit_working_add.php @@ -100,11 +100,11 @@ $lessonTimes = $plannerEntryGateway->queryPlannerTimeSlotsByClass($criteria, $gibbonSchoolYearID, $gibbonCourseClassID); - $form = Form::create('action', $session->get('absoluteURL').'/modules/Planner/units_edit_working_addProcess.php?'.http_build_query($urlParams)); + $form = Form::createBlank('action', $session->get('absoluteURL').'/modules/Planner/units_edit_working_addProcess.php?'.http_build_query($urlParams)); $form->setTitle(__('Choose Lessons')); $form->setDescription(__('Use the table below to select the lessons you wish to deploy this unit to. Only lessons without existing plans can be included in the deployment.')); - $form->setClass('w-full blank bulkActionForm'); + $form->setClass('bulkActionForm'); $form->addHiddenValue('address', $session->get('address')); $table = $form->addRow()->addDataTable('lessons', $criteria)->withData($lessonTimes); diff --git a/modules/Reports/archive_byReport_view.php b/modules/Reports/archive_byReport_view.php index 9f978822f4..9efd370604 100644 --- a/modules/Reports/archive_byReport_view.php +++ b/modules/Reports/archive_byReport_view.php @@ -52,7 +52,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('q', '/modules/Reports/archive_byReport_view.php'); diff --git a/modules/Reports/archive_byStudent.php b/modules/Reports/archive_byStudent.php index c5afab28d7..7e1c940e1f 100644 --- a/modules/Reports/archive_byStudent.php +++ b/modules/Reports/archive_byStudent.php @@ -52,7 +52,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('q', '/modules/Reports/archive_byStudent.php'); diff --git a/modules/Reports/archive_manage.php b/modules/Reports/archive_manage.php index 1f1daf0cb3..65c6bf738c 100644 --- a/modules/Reports/archive_manage.php +++ b/modules/Reports/archive_manage.php @@ -47,8 +47,7 @@ $table->addHeaderAction('add', __('Add')) ->setURL('/modules/Reports/archive_manage_add.php') - ->displayLabel() - ->append(' | '); + ->displayLabel(); $table->addHeaderAction('migrate', __('Migrate Reports')) ->setIcon('delivery2') diff --git a/modules/Reports/js/module.js b/modules/Reports/js/module.js index df03cf1059..ba84678835 100644 --- a/modules/Reports/js/module.js +++ b/modules/Reports/js/module.js @@ -17,7 +17,3 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ - -$(document).on('change', '.auto-submit', function () { - $(this).parents('form').submit(); -}); diff --git a/modules/Reports/progress_byDepartment.php b/modules/Reports/progress_byDepartment.php index 13297a176e..0c6de3c2a0 100644 --- a/modules/Reports/progress_byDepartment.php +++ b/modules/Reports/progress_byDepartment.php @@ -47,7 +47,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Reports/progress_byDepartment.php'); diff --git a/modules/Reports/progress_byPerson.php b/modules/Reports/progress_byPerson.php index 131797d18f..d4e3c5506a 100644 --- a/modules/Reports/progress_byPerson.php +++ b/modules/Reports/progress_byPerson.php @@ -50,7 +50,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Reports/progress_byPerson.php'); $form->addHiddenValue('gibbonReportingScopeID', $gibbonReportingScopeID); diff --git a/modules/Reports/progress_byProofReading.php b/modules/Reports/progress_byProofReading.php index 0a60eacc20..b33dcea9fa 100644 --- a/modules/Reports/progress_byProofReading.php +++ b/modules/Reports/progress_byProofReading.php @@ -49,7 +49,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Reports/progress_byProofReading.php'); diff --git a/modules/Reports/progress_byReportingCycle.php b/modules/Reports/progress_byReportingCycle.php index ccf1efe265..f380c00795 100644 --- a/modules/Reports/progress_byReportingCycle.php +++ b/modules/Reports/progress_byReportingCycle.php @@ -47,7 +47,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Reports/progress_byReportingCycle.php'); diff --git a/modules/Reports/progress_studentNameConflicts.php b/modules/Reports/progress_studentNameConflicts.php index 5f181f1b18..c78d8b41bb 100644 --- a/modules/Reports/progress_studentNameConflicts.php +++ b/modules/Reports/progress_studentNameConflicts.php @@ -48,7 +48,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Reports/progress_studentNameConflicts.php'); diff --git a/modules/Reports/reporting_access_manage.php b/modules/Reports/reporting_access_manage.php index 83945670a2..d334916772 100644 --- a/modules/Reports/reporting_access_manage.php +++ b/modules/Reports/reporting_access_manage.php @@ -47,7 +47,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Reports/reporting_access_manage.php'); diff --git a/modules/Reports/reporting_criteria_manage.php b/modules/Reports/reporting_criteria_manage.php index 02bda00e5e..0555522adc 100644 --- a/modules/Reports/reporting_criteria_manage.php +++ b/modules/Reports/reporting_criteria_manage.php @@ -57,7 +57,7 @@ // FORM $form = Form::create('archiveByReport', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('q', '/modules/Reports/reporting_criteria_manage.php'); @@ -170,8 +170,7 @@ $table->addHeaderAction('criteria', __('Manage Criteria Types')) ->setIcon('markbook') ->setURL('/modules/Reports/criteriaTypes_manage.php') - ->displayLabel() - ->prepend(' | '); + ->displayLabel(); if (empty($scopeTypeID)) { $table->addColumn('scopeTypeName', $reportingScope['scopeType']) diff --git a/modules/Reports/reporting_criteria_manage_editOrderAjax.php b/modules/Reports/reporting_criteria_manage_editOrderAjax.php index 9917b5425a..54fdbbf4cb 100644 --- a/modules/Reports/reporting_criteria_manage_editOrderAjax.php +++ b/modules/Reports/reporting_criteria_manage_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order']; if (empty($order) || empty($data['gibbonReportingCycleID'])) { exit; diff --git a/modules/Reports/reporting_cycles_manage.php b/modules/Reports/reporting_cycles_manage.php index e13d232b38..893b7d55e8 100644 --- a/modules/Reports/reporting_cycles_manage.php +++ b/modules/Reports/reporting_cycles_manage.php @@ -63,14 +63,10 @@ ->setURL('/modules/Reports/reporting_cycles_manage_edit.php'); $actions->addAction('scopes', __('Manage Scopes & Criteria')) - ->setIcon('markbook') //internalAssessment + ->setIcon('markbook') ->setClass('mx-1') ->setURL('/modules/Reports/reporting_scopes_manage.php'); - // $actions->addAction('access', __('Manage Access')) - // ->setIcon('key') - // ->setURL('/modules/Reports/reporting_access_manage.php'); - $actions->addAction('duplicate', __('Duplicate')) ->setIcon('copy') ->setURL('/modules/Reports/reporting_cycles_manage_duplicate.php'); diff --git a/modules/Reports/reporting_cycles_manage_editOrderAjax.php b/modules/Reports/reporting_cycles_manage_editOrderAjax.php index bdb1f3fc4f..df67dbb4be 100644 --- a/modules/Reports/reporting_cycles_manage_editOrderAjax.php +++ b/modules/Reports/reporting_cycles_manage_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order']; if (empty($order) || empty($data['gibbonSchoolYearID'])) { exit; diff --git a/modules/Reports/reporting_my.php b/modules/Reports/reporting_my.php index 6d4e0fcebd..cecaf1188b 100644 --- a/modules/Reports/reporting_my.php +++ b/modules/Reports/reporting_my.php @@ -43,7 +43,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('View As')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Reports/reporting_my.php'); diff --git a/modules/Reports/reporting_proofread.php b/modules/Reports/reporting_proofread.php index db5b48d09c..6e3682839f 100644 --- a/modules/Reports/reporting_proofread.php +++ b/modules/Reports/reporting_proofread.php @@ -59,7 +59,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('View')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Reports/reporting_proofread.php'); @@ -286,7 +286,7 @@ ->addDetails() ->addClass('border bg-gray-100 rounded mb-2 p-2') ->addClass($proof['status'] == 'Done' || $proof['status'] == 'Accepted' ? 'success bg-green-100' : '') - ->addClass($proof['status'] == 'Edited' ? 'message bg-blue-100' : '') + ->addClass($proof['status'] == 'Edited' ? 'message bg-blue-50' : '') ->setID('student'.str_pad($criteria['gibbonPersonIDStudent'], 10, '0', STR_PAD_LEFT)) ->summary($summaryText) ->opened(empty($proof['status']) || ($proofReview && $proof['status'] == 'Edited')); @@ -408,15 +408,15 @@ var details = $(this).parents('details').first(); if ($(this).val() == 'Done' || $(this).val() == 'Accepted') { - details.removeClass('message bg-blue-100').removeClass('error bg-red-100'); + details.removeClass('message bg-blue-50').removeClass('error bg-red-100'); details.addClass('success bg-green-100'); details.find('textarea').attr('readonly', true); } else if ($(this).val() == 'Edited' || $(this).val() == 'Revised') { details.removeClass('success bg-green-100').removeClass('error bg-red-100'); - details.addClass('message bg-blue-100'); + details.addClass('message bg-blue-50'); details.find('textarea').attr('readonly', false); } else if ($(this).val() == 'Declined') { - details.removeClass('success bg-green-100').removeClass('message bg-blue-100'); + details.removeClass('success bg-green-100').removeClass('message bg-blue-50'); details.addClass('error bg-red-100'); details.find('textarea').attr('readonly', false); } diff --git a/modules/Reports/reporting_scopes_manage.php b/modules/Reports/reporting_scopes_manage.php index 21262f677b..57fdbd1751 100644 --- a/modules/Reports/reporting_scopes_manage.php +++ b/modules/Reports/reporting_scopes_manage.php @@ -77,7 +77,6 @@ ->setURL('/modules/Reports/reporting_scopes_manage_edit.php'); $actions->addAction('access', __('Manage Access')) - ->setIcon('key') ->setURL('/modules/Reports/reporting_access_manage.php'); $actions->addAction('delete', __('Delete')) diff --git a/modules/Reports/reporting_scopes_manage_edit.php b/modules/Reports/reporting_scopes_manage_edit.php index aa4945a328..ce1d220592 100644 --- a/modules/Reports/reporting_scopes_manage_edit.php +++ b/modules/Reports/reporting_scopes_manage_edit.php @@ -131,8 +131,7 @@ ->setIcon('markbook') ->setURL('/modules/Reports/criteriaTypes_manage.php') ->addParam('referer', 'scopes') - ->displayLabel() - ->prepend(' | '); + ->displayLabel(); $table->addActionColumn() ->addParam('gibbonReportingCycleID', $urlParams['gibbonReportingCycleID']) diff --git a/modules/Reports/reporting_scopes_manage_editOrderAjax.php b/modules/Reports/reporting_scopes_manage_editOrderAjax.php index 0e5d5d696a..c91572907a 100644 --- a/modules/Reports/reporting_scopes_manage_editOrderAjax.php +++ b/modules/Reports/reporting_scopes_manage_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order']; if (empty($order) || empty($data['gibbonReportingCycleID'])) { exit; diff --git a/modules/Reports/reporting_write_byStudent.php b/modules/Reports/reporting_write_byStudent.php index 18a8a1d062..01d502d9d4 100644 --- a/modules/Reports/reporting_write_byStudent.php +++ b/modules/Reports/reporting_write_byStudent.php @@ -166,7 +166,7 @@ $form->addHiddenValue('allStudents', $urlParams['allStudents']); $form->addHiddenValue('gibbonPersonID', $gibbonPersonID); - $form->addRow()->addClass('reportStatus')->addContent($scopeDetails['name'])->wrap('

', '

'); + $form->addRow()->addClass('reportStatus')->addContent($scopeDetails['name'])->wrap('

', '

'); // HOOKS // Custom hooks can replace form fields by criteria type using a custom include. @@ -299,10 +299,10 @@ ->setDisabled(!$canWriteReport); if ($canWriteReport) { - $row = $form->addRow(); - $row->addSubmit(__('Save & Next')) - ->prepend(sprintf('',__('Save'))) + $col = $form->addRow()->addColumn()->setClass('flex items-center justify-end gap-2'); + $col->addButton(__('Save'))->onClick('save()') ->prepend(sprintf('', __('Unsaved Changes'))); + $col->addSubmit(__('Save & Next')); } echo $form->getOutput(); @@ -372,27 +372,25 @@ function updateStatus() { function displayStatus(){ if (readonly) { - $('.reportStatus div').addClass('bg-gray-300'); + $('.reportStatus div').addClass('dull'); $('.reportStatus h4').html(''); } else if (complete) { - $('#reportingWrite .standardForm').removeClass('border-blue-600').addClass('border-green-600'); - $('.reportStatus div').removeClass('bg-blue-200').addClass('bg-green-200'); + $('.reportStatus').parent().removeClass('border-blue-600').addClass('border-green-600'); + $('.reportStatus div').removeClass('message').addClass('success'); $('.reportStatus h4').html(''); } else if (edited) { - $('#reportingWrite .standardForm').removeClass('border-green-600').addClass('border-blue-600'); - $('.reportStatus div').removeClass('bg-green-200').addClass('bg-blue-200'); + $('.reportStatus').parent().removeClass('border-green-600').addClass('border-blue-600'); + $('.reportStatus div').removeClass('success').addClass('message'); $('.reportStatus h4').html(''); } else { - $('#reportingWrite .standardForm').removeClass('border-green-600'); - $('.reportStatus div').removeClass('bg-green-200'); + $('.reportStatus').parent().removeClass('border-green-600'); + $('.reportStatus div').removeClass('success'); } - $('input[value="Save & Next"]').toggle(complete); + $('button[value="Save & Next"]').toggle(complete); if (edited) { $('.unsavedChanges').show(); - $('#reportingWrite .standardForm').removeClass('border-green-600').addClass('border-blue-600'); - $('.reportStatus div').removeClass('bg-green-200').addClass('bg-blue-200'); $('.reportStatus h4').html($('.reportStatus h4').html() + ''); } } diff --git a/modules/Reports/reports_manage_edit.php b/modules/Reports/reports_manage_edit.php index 72049ad9b5..bc8051d563 100644 --- a/modules/Reports/reports_manage_edit.php +++ b/modules/Reports/reports_manage_edit.php @@ -111,9 +111,9 @@ $row = $form->addRow(); $row->addLabel('accessDate', __('Go Live Date'))->prepend('1. ')->append('
'.__('2. Reports are hidden until date is reached.')); - $col = $row->addColumn('accessDate')->setClass('inline'); - $col->addDate('accessDate')->setValue(substr($values['accessDate'], 0, 11))->addClass('mr-2'); - $col->addTime('accessTime')->setValue(substr($values['accessDate'], 11, 5)); + $col = $row->addColumn('accessDate')->setClass('inline gap-2'); + $col->addDate('accessDate')->setValue(substr($values['accessDate'], 0, 11))->addClass('flex-1'); + $col->addTime('accessTime')->setValue(substr($values['accessDate'], 11, 5))->addClass('flex-1'); $row = $form->addRow(); $row->addFooter(); diff --git a/modules/Reports/src/Forms/ReportingSidebarForm.php b/modules/Reports/src/Forms/ReportingSidebarForm.php index db8fe59e53..19c7ad9f25 100644 --- a/modules/Reports/src/Forms/ReportingSidebarForm.php +++ b/modules/Reports/src/Forms/ReportingSidebarForm.php @@ -52,28 +52,28 @@ public function createForm($urlParams) { $gibbonPersonID = $urlParams['gibbonPersonID'] ?? $this->session->get('gibbonPersonID'); - $form = parent::create('reportingSelector', $this->session->get('absoluteURL').'/index.php', 'get'); + $form = parent::createBlank('reportingSelector', $this->session->get('absoluteURL').'/index.php', 'get')->enableQuickSubmit()->setAttribute('hx-trigger', 'change from:.auto-submit'); $form->setFactory($this->databaseFormFactory); - $form->setClass('smallIntBorder w-full mt-4'); + $form->setClass('w-full mt-2'); $form->addHiddenValue('q', '/modules/Reports/reporting_write.php'); $form->addHiddenValue('gibbonPersonID', $gibbonPersonID); $form->addHiddenValue('allStudents', $urlParams['allStudents'] ?? ''); $form->addHiddenValue('gibbonPersonIDStudent', $urlParams['gibbonPersonIDStudent'] ?? ''); - $row = $form->addRow(); - $row->addLabel('gibbonSchoolYearID', __('School Year'))->addClass('sm:text-xxs'); + $row = $form->addRow()->addClass('py-1'); + $row->addLabel('gibbonSchoolYearID', __('School Year'))->addClass('sm:text-xs/6'); $row->addSelectSchoolYear('gibbonSchoolYearID', 'Recent') - ->setClass('auto-submit w-64 lg:w-40') + ->setClass('auto-submit flex-grow') ->selected($urlParams['gibbonSchoolYearID']) ->placeholder(null); $reportingCycles = $this->reportingCycleGateway->selectReportingCyclesBySchoolYear($urlParams['gibbonSchoolYearID']); - $row = $form->addRow(); - $row->addLabel('gibbonReportingCycleID', __('Reporting Cycle'))->addClass('sm:text-xxs'); + $row = $form->addRow()->addClass('py-1'); + $row->addLabel('gibbonReportingCycleID', __('Reporting Cycle'))->addClass('sm:text-xs/6'); $row->addSelect('gibbonReportingCycleID') ->fromResults($reportingCycles) - ->setClass('auto-submit w-64 lg:w-40') + ->setClass('auto-submit flex-grow') ->selected($urlParams['gibbonReportingCycleID']) ->placeholder(); @@ -81,11 +81,11 @@ public function createForm($urlParams) $criteria = $this->reportingCriteriaGateway->newQueryCriteria()->sortBy(['sequenceNumber', 'nameOrder']); $criteriaGroups = $this->reportingCriteriaGateway->queryReportingCriteriaGroupsByCycle($criteria, $urlParams['gibbonReportingCycleID']); - $row = $form->addRow(); - $row->addLabel('criteriaSelector', __('Scope'))->addClass('sm:text-xxs'); + $row = $form->addRow()->addClass('py-1'); + $row->addLabel('criteriaSelector', __('Scope'))->addClass('sm:text-xs/6'); $row->addSelect('criteriaSelector') ->fromDataSet($criteriaGroups, 'value', 'name', 'scopeName') - ->setClass('auto-submit w-64 lg:w-40') + ->setClass('auto-submit flex-grow') ->selected($urlParams['gibbonReportingScopeID'].'-'.$urlParams['scopeTypeID']) ->placeholder(); } else { diff --git a/modules/Reports/templates_assets_components_edit.php b/modules/Reports/templates_assets_components_edit.php index 1310156023..0ee64bb4be 100644 --- a/modules/Reports/templates_assets_components_edit.php +++ b/modules/Reports/templates_assets_components_edit.php @@ -65,8 +65,7 @@ ->setIcon('help') ->addClass('underline') ->displayLabel() - ->modalWindow() - ->append(' | '); + ->modalWindow(); $form->addHeaderAction('view', __('Preview')) ->setURL('/modules/Reports/templates_assets_components_preview.php') diff --git a/modules/Reports/templates_manage.php b/modules/Reports/templates_manage.php index c905ac9245..e4f406fb7a 100644 --- a/modules/Reports/templates_manage.php +++ b/modules/Reports/templates_manage.php @@ -47,8 +47,7 @@ $table->addHeaderAction('add', __('Add')) ->setURL('/modules/Reports/templates_manage_add.php') - ->displayLabel() - ->append(' | '); + ->displayLabel(); $table->addHeaderAction('fonts', __('Manage Assets')) ->setIcon('delivery2') diff --git a/modules/Reports/templates_manage_editOrderAjax.php b/modules/Reports/templates_manage_editOrderAjax.php index ffb247c568..161187b963 100644 --- a/modules/Reports/templates_manage_editOrderAjax.php +++ b/modules/Reports/templates_manage_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order']; if (empty($order) || empty($data['gibbonReportTemplateID'])) { exit; diff --git a/modules/Rubrics/moduleFunctions.php b/modules/Rubrics/moduleFunctions.php index 915afb137c..a6fbd18ef9 100644 --- a/modules/Rubrics/moduleFunctions.php +++ b/modules/Rubrics/moduleFunctions.php @@ -75,7 +75,7 @@ function rubricEdit($guid, $connection2, $gibbonRubricID, $scaleName = '', $sear $form = Form::createTable('editRubric', $session->get('absoluteURL').'/modules/'.$session->get('module').'/rubrics_edit_editCellProcess.php?gibbonRubricID='.$gibbonRubricID.'&search='.$search.'&filter2='.$filter2); - $form->setClass('rubricTable fullWidth'); + $form->setClass('rubricTable w-full'); $form->addHiddenValue('address', $session->get('address')); $row = $form->addRow()->addClass(); @@ -90,7 +90,7 @@ function rubricEdit($guid, $connection2, $gibbonRubricID, $scaleName = '', $sear $gradeScaleGrade = $gradeScales[$columns[$n]['gibbonScaleGradeID']]; $col->addContent(''.$gradeScaleGrade['descriptor'].'') ->append(' ('.$gradeScaleGrade['value'].')') - ->append('
'.__($scaleName).' '.__('Scale').''); + ->append('
'.__($scaleName).' '.__('Scale').''); } else { $col->addContent($columns[$n]['title'])->wrap('', ''); } @@ -109,7 +109,7 @@ function rubricEdit($guid, $connection2, $gibbonRubricID, $scaleName = '', $sear $outcome = $outcomes[$rows[$i]['gibbonOutcomeID']]; $col->addContent(''.__($outcome['name']).'') ->append(!empty($outcome['category'])? (' -
'.$outcome['category'].'
') : '') - ->append('
'.$outcome['scope'].' '.__('Outcome').''); + ->append('
'.$outcome['scope'].' '.__('Outcome').''); $rows[$i]['title'] = $outcome['name']; } else { $col->addContent($rows[$i]['title'])->wrap('', ''); @@ -314,7 +314,7 @@ function rubricView($guid, $connection2, $gibbonRubricID, $mark, $gibbonPersonID } $form = Form::createTable('viewRubric', $session->get('absoluteURL').'/index.php'); - $form->setClass('rubricTable fullWidth'); + $form->setClass('rubricTable w-full'); $row = $form->addRow()->addClass(); $row->addContent()->addClass(''); @@ -334,7 +334,7 @@ function rubricView($guid, $connection2, $gibbonRubricID, $mark, $gibbonPersonID $gradeScaleGrade = $gradeScales[$columns[$n]['gibbonScaleGradeID']]; $column->addContent(''.$gradeScaleGrade['descriptor'].'') ->append(' ('.$gradeScaleGrade['value'].')') - ->append('
'.__($gradeScaleGrade['name']).' '.__('Scale').''); + ->append('
'.__($gradeScaleGrade['name']).' '.__('Scale').''); } else { $column->addContent($columns[$n]['title'])->wrap('', ''); } @@ -351,7 +351,7 @@ function rubricView($guid, $connection2, $gibbonRubricID, $mark, $gibbonPersonID $outcome = $outcomes[$rows[$i]['gibbonOutcomeID']]; $content = $col->addContent(''.__($outcome['name']).'') ->append(!empty($outcome['category'])? (' -
'.$outcome['category'].'
') : '') - ->append('
'.$outcome['scope'].' '.__('Outcome').'') + ->append('
'.$outcome['scope'].' '.__('Outcome').'') ->wrap('', ''); // Highlight unit outcomes with a checkmark if (isset($unitOutcomes[$rows[$i]['gibbonOutcomeID']])) { diff --git a/modules/Rubrics/rubrics.php b/modules/Rubrics/rubrics.php index cfb602b99d..23309c0c8e 100644 --- a/modules/Rubrics/rubrics.php +++ b/modules/Rubrics/rubrics.php @@ -57,7 +57,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/rubrics.php'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $row = $form->addRow(); $row->addLabel('search', __('Search For'))->description(__('Rubric name.')); diff --git a/modules/Rubrics/rubrics_view.php b/modules/Rubrics/rubrics_view.php index 5356362e30..b13e57cc82 100644 --- a/modules/Rubrics/rubrics_view.php +++ b/modules/Rubrics/rubrics_view.php @@ -51,7 +51,7 @@ // SEARCH $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/rubrics_view.php'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $row = $form->addRow(); $row->addLabel('search', __('Search For'))->description(__('Rubric name.')); diff --git a/modules/School Admin/department_manage_editOrderAjax.php b/modules/School Admin/department_manage_editOrderAjax.php index 8e7526d1a1..e4cdc43718 100644 --- a/modules/School Admin/department_manage_editOrderAjax.php +++ b/modules/School Admin/department_manage_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order']; if (empty($order)) { exit; diff --git a/modules/School Admin/formGroup_manage.php b/modules/School Admin/formGroup_manage.php index bd7dbbb16b..9f0c54d58d 100644 --- a/modules/School Admin/formGroup_manage.php +++ b/modules/School Admin/formGroup_manage.php @@ -69,8 +69,7 @@ ->setIcon('copy') ->onClick('return confirm("'.__('Are you sure you want to continue?').' '.__('This operation cannot be undone.').'");') ->displayLabel() - ->directLink() - ->append(' | '); + ->directLink(); } $table->addHeaderAction('add', __('Add')) diff --git a/modules/School Admin/formalAssessmentSettings.php b/modules/School Admin/formalAssessmentSettings.php index d36d3c4ab5..ced01e1866 100644 --- a/modules/School Admin/formalAssessmentSettings.php +++ b/modules/School Admin/formalAssessmentSettings.php @@ -45,7 +45,7 @@ $form->addRow()->addHeading('Primary External Assessement', __('Primary External Assessement'))->append(__('These settings allow a particular type of external assessment to be associated with each year group. The selected assessment will be used as the primary assessment to be used as a baseline for comparison (for example, within the Markbook). You are required to select a particular field category from which to draw data (if no category is chosen, the data will not be saved).')); $row = $form->addRow()->setClass('break'); - $row->addContent(__('Year Group')); + $row->addContent(__('Year Group'))->setClass('w-24'); $row->addContent(__('External Assessment')); $row->addContent(__('Field Set')); @@ -87,18 +87,16 @@ $selectedField = (isset($primaryExternalAssessmentByYearGroup[$id]))? $primaryExternalAssessmentByYearGroup[$id] : ''; $row = $form->addRow(); - $row->addContent($yearGroup['name']); + $row->addContent($yearGroup['name'])->setClass('w-24'); $row->addSelect('gibbonExternalAssessmentID['.$id.']') ->setID('gibbonExternalAssessmentID'.$id) - ->setClass('mediumWidth') ->placeholder() ->fromArray($externalAssessments) ->selected($selectedID); $row->addSelect('category['.$id.']') ->setID('category'.$id) - ->setClass('mediumWidth') ->placeholder() ->fromArray($externalAssessmentsFieldSetNames) ->selected($selectedField) diff --git a/modules/School Admin/space_manage.php b/modules/School Admin/space_manage.php index d0486f54d1..ffec1474b3 100644 --- a/modules/School Admin/space_manage.php +++ b/modules/School Admin/space_manage.php @@ -46,7 +46,7 @@ echo ''; $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/space_manage.php'); diff --git a/modules/School Admin/yearGroup_manage_editOrderAjax.php b/modules/School Admin/yearGroup_manage_editOrderAjax.php index b809086f74..760922afda 100644 --- a/modules/School Admin/yearGroup_manage_editOrderAjax.php +++ b/modules/School Admin/yearGroup_manage_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order'] ?? []; if (empty($order)) { exit; diff --git a/modules/Staff/absences_manage.php b/modules/Staff/absences_manage.php index 96aed45053..3c274d35ce 100644 --- a/modules/Staff/absences_manage.php +++ b/modules/Staff/absences_manage.php @@ -46,7 +46,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Staff/absences_manage.php'); @@ -112,8 +112,7 @@ $table->addHeaderAction('view', __('View')) ->setIcon('planner') ->setURL('/modules/Staff/report_absences_summary.php') - ->displayLabel() - ->append(' | '); + ->displayLabel(); } $table->addHeaderAction('add', __('New Absence')) diff --git a/modules/Staff/absences_view_byPerson.php b/modules/Staff/absences_view_byPerson.php index 5f01cd5656..fc21abcde1 100644 --- a/modules/Staff/absences_view_byPerson.php +++ b/modules/Staff/absences_view_byPerson.php @@ -57,7 +57,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Staff/absences_view_byPerson.php'); diff --git a/modules/Staff/applicationForm_manage.php b/modules/Staff/applicationForm_manage.php index 151797c4a1..5a3dbc162c 100644 --- a/modules/Staff/applicationForm_manage.php +++ b/modules/Staff/applicationForm_manage.php @@ -48,7 +48,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', "/modules/".$session->get('module')."/applicationForm_manage.php"); @@ -96,7 +96,7 @@ } else { $output = Format::name('', $row['applicationPreferredName'], $row['applicationSurname'], 'Staff', true, true); } - return $output.'
'.Format::dateTime($row['timestamp']).''; + return $output.'
'.Format::dateTime($row['timestamp']).''; }); $table->addColumn('jobTitle', __('Position')); @@ -107,7 +107,7 @@ ->format(function($row) { $output = ''.__($row['status']).''; if ($row['status'] == 'Pending') { - $output .= '
'.trim(str_replace(',', '
', $row['milestones'])).'
'; + $output .= '
'.trim(str_replace(',', '
', $row['milestones'])).'
'; } return $output; }); diff --git a/modules/Staff/applicationForm_manage_edit.php b/modules/Staff/applicationForm_manage_edit.php index 578b2b113c..4ab87d691e 100644 --- a/modules/Staff/applicationForm_manage_edit.php +++ b/modules/Staff/applicationForm_manage_edit.php @@ -71,8 +71,7 @@ $form->addHeaderAction('back', __('Back to Search Results')) ->setURL('/modules/Staff/applicationForm_manage.php') ->addParam('search', $search) - ->displayLabel() - ->append(' | '); + ->displayLabel(); } $form->addHeaderAction('print', __('Print')) @@ -135,7 +134,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('notes', __('Notes')); - $column->addTextArea('notes')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('notes')->setRows(5)->setClass('w-full'); $form->addRow()->addHeading('Job Related Information', __('Job Related Information')); diff --git a/modules/Staff/coverage_manage.php b/modules/Staff/coverage_manage.php index 40a3c92583..17601a7f04 100644 --- a/modules/Staff/coverage_manage.php +++ b/modules/Staff/coverage_manage.php @@ -44,7 +44,7 @@ // SEARCH FORM $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/Staff/coverage_manage.php'); diff --git a/modules/Staff/coverage_planner.php b/modules/Staff/coverage_planner.php index cb7aec3855..f58f638e6b 100644 --- a/modules/Staff/coverage_planner.php +++ b/modules/Staff/coverage_planner.php @@ -46,8 +46,7 @@ // DATE SELECTOR $link = $session->get('absoluteURL').'/index.php?q=/modules/Staff/coverage_planner.php'; - $form = Form::create('dateNav', $link); - $form->setClass('blank fullWidth'); + $form = Form::createBlank('dateNav', $link); $form->addHiddenValue('address', $session->get('address')); $row = $form->addRow()->addClass('flex flex-wrap'); @@ -57,13 +56,13 @@ $nextDay = $date->modify('+1 day')->format('Y-m-d'); $col = $row->addColumn()->setClass('flex-1 flex items-center '); - $col->addButton(__('Previous Day'))->addClass(' rounded-l-sm')->onClick("window.location.href='{$link}&date={$lastDay}'"); - $col->addButton(__('Today'))->addClass('ml-px')->onClick("window.location.href='{$link}&date={$thisDay}'"); - $col->addButton(__('Next Day'))->addClass('ml-px rounded-r-sm')->onClick("window.location.href='{$link}&date={$nextDay}'"); + $col->addButton(__('Previous Day'))->groupAlign('left')->onClick("window.location.href='{$link}&date={$lastDay}'"); + $col->addButton(__('Today'))->groupAlign('middle')->onClick("window.location.href='{$link}&date={$thisDay}'"); + $col->addButton(__('Next Day'))->groupAlign('right')->onClick("window.location.href='{$link}&date={$nextDay}'"); $col = $row->addColumn()->addClass('flex items-center justify-end'); - $col->addDate('date')->setValue($date->format('Y-m-d'))->setClass('shortWidth'); - $col->addSubmit(__('Go')); + $col->addDate('date')->setValue($date->format('Y-m-d'))->setClass('shortWidth')->groupAlign('left'); + $col->addSubmit(__('Go'))->groupAlign('right'); echo $form->getOutput(); diff --git a/modules/Staff/coverage_planner_assign.php b/modules/Staff/coverage_planner_assign.php index d834bd55e5..5838abd88f 100644 --- a/modules/Staff/coverage_planner_assign.php +++ b/modules/Staff/coverage_planner_assign.php @@ -122,10 +122,10 @@ ->fromPOST(); // FORM - $form = Form::create('staffCoverage', $session->get('absoluteURL').'/modules/Staff/coverage_planner_assignProcess.php'); + $form = Form::createBlank('staffCoverage', $session->get('absoluteURL').'/modules/Staff/coverage_planner_assignProcess.php'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('blank bulkActionForm'); + $form->setClass('bulkActionForm'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonStaffCoverageID', $coverage['gibbonStaffCoverageID']); diff --git a/modules/Staff/coverage_requestAjax.php b/modules/Staff/coverage_requestAjax.php index 011d9c6e92..477b654a22 100644 --- a/modules/Staff/coverage_requestAjax.php +++ b/modules/Staff/coverage_requestAjax.php @@ -43,8 +43,8 @@ $timeEnd = $_POST['timeEnd'] ?? ''; // FORM - $form = $container->get(CoverageRequestForm::class)->createForm($gibbonPersonID, $dateStart, $dateEnd, $allDay, $timeStart, $timeEnd); - $form->setClass('blank standardForm flex-1'); + $form = $container->get(CoverageRequestForm::class)->createBlank($gibbonPersonID, $dateStart, $dateEnd, $allDay, $timeStart, $timeEnd); + $form->setClass('flex-1'); $form->setAction('ajax'); echo $form->getOutput(); diff --git a/modules/Staff/report_absences_summary.php b/modules/Staff/report_absences_summary.php index 96798bacc2..a631e69533 100644 --- a/modules/Staff/report_absences_summary.php +++ b/modules/Staff/report_absences_summary.php @@ -86,7 +86,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Staff/report_absences_summary.php'); diff --git a/modules/Staff/report_absences_weekly.php b/modules/Staff/report_absences_weekly.php index dafb512520..84f8a64eb1 100644 --- a/modules/Staff/report_absences_weekly.php +++ b/modules/Staff/report_absences_weekly.php @@ -44,8 +44,7 @@ $staffAbsenceTypeGateway = $container->get(StaffAbsenceTypeGateway::class); // DATE SELECTOR - $form = Form::create('action', $session->get('absoluteURL').'/index.php?q=/modules/Staff/report_absences_weekly.php'); - $form->setClass('blank fullWidth'); + $form = Form::createBlank('action', $session->get('absoluteURL').'/index.php?q=/modules/Staff/report_absences_weekly.php'); $form->addHiddenValue('address', $session->get('address')); $row = $form->addRow()->addClass('flex flex-wrap'); diff --git a/modules/Staff/report_coverage_summary.php b/modules/Staff/report_coverage_summary.php index b1a0d07603..f2c9bcc9a7 100644 --- a/modules/Staff/report_coverage_summary.php +++ b/modules/Staff/report_coverage_summary.php @@ -90,7 +90,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Staff/report_coverage_summary.php'); diff --git a/modules/Staff/report_subs_availability.php b/modules/Staff/report_subs_availability.php index 8af6dcae6e..73103c330f 100644 --- a/modules/Staff/report_subs_availability.php +++ b/modules/Staff/report_subs_availability.php @@ -60,7 +60,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('sidebar', $_GET['sidebar'] ?? ''); diff --git a/modules/Staff/report_subs_availabilityWeekly.php b/modules/Staff/report_subs_availabilityWeekly.php index 08b69d94a4..5cbef9a1a2 100644 --- a/modules/Staff/report_subs_availabilityWeekly.php +++ b/modules/Staff/report_subs_availabilityWeekly.php @@ -46,8 +46,7 @@ $allStaff = $_GET['allStaff'] ?? $settingGateway->getSettingByScope('Staff', 'coverageInternal'); // DATE SELECTOR - $form = Form::create('action', $session->get('absoluteURL').'/index.php?q=/modules/Staff/report_subs_availabilityWeekly.php&sidebar=false'); - $form->setClass('blank fullWidth'); + $form = Form::createBlank('action', $session->get('absoluteURL').'/index.php?q=/modules/Staff/report_subs_availabilityWeekly.php&sidebar=false'); $form->addHiddenValue('address', $session->get('address')); $row = $form->addRow()->addClass('flex flex-wrap'); diff --git a/modules/Staff/src/Tables/AbsenceFormats.php b/modules/Staff/src/Tables/AbsenceFormats.php index 9f05a941ef..add081e6aa 100644 --- a/modules/Staff/src/Tables/AbsenceFormats.php +++ b/modules/Staff/src/Tables/AbsenceFormats.php @@ -108,7 +108,7 @@ public static function typeAndReason($absence) $output .= '
'.Format::small($absence['reason']); } if ($absence['status'] != 'Approved') { - $output .= '
'.__($absence['status']).''; + $output .= '
'.__($absence['status']).''; } return $output; } diff --git a/modules/Staff/staff_manage.php b/modules/Staff/staff_manage.php index c93de8ef33..bb1b8725e8 100644 --- a/modules/Staff/staff_manage.php +++ b/modules/Staff/staff_manage.php @@ -50,7 +50,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL')."/index.php", 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', "/modules/".$session->get('module')."/staff_manage.php"); diff --git a/modules/Staff/staff_manage_edit_contract_add.php b/modules/Staff/staff_manage_edit_contract_add.php index a42d0e1fa3..6c85d56875 100644 --- a/modules/Staff/staff_manage_edit_contract_add.php +++ b/modules/Staff/staff_manage_edit_contract_add.php @@ -154,12 +154,12 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('education', __('Education Benefits')); - $column->addTextArea('education')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('education')->setRows(5)->setClass('w-full'); $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('notes', __('Notes')); - $column->addTextArea('notes')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('notes')->setRows(5)->setClass('w-full'); $fileUploader = new Gibbon\FileUploader($pdo, $session); $row = $form->addRow(); diff --git a/modules/Staff/staff_manage_edit_contract_edit.php b/modules/Staff/staff_manage_edit_contract_edit.php index cc9f643c36..5020e23661 100644 --- a/modules/Staff/staff_manage_edit_contract_edit.php +++ b/modules/Staff/staff_manage_edit_contract_edit.php @@ -150,12 +150,12 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('education', __('Education Benefits')); - $column->addTextArea('education')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('education')->setRows(5)->setClass('w-full'); $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('notes', __('Notes')); - $column->addTextArea('notes')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('notes')->setRows(5)->setClass('w-full'); $fileUploader = new Gibbon\FileUploader($pdo, $session); $row = $form->addRow(); diff --git a/modules/Staff/staff_view.php b/modules/Staff/staff_view.php index be5d7b2ab2..d223722a81 100644 --- a/modules/Staff/staff_view.php +++ b/modules/Staff/staff_view.php @@ -77,7 +77,7 @@ $form = Form::create('filters', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/Staff/staff_view.php'); @@ -179,8 +179,7 @@ $table->addHeaderAction('add', __('Add')) ->setURL('/modules/Staff/staff_manage_add.php') ->addParam('search', $urlParams['search']) - ->displayLabel() - ->prepend('  |  '); + ->displayLabel(); } $table->addMetaData('filterOptions', [ @@ -275,7 +274,7 @@ ->addParam('allStaff', $urlParams['allStaff']) ->addParam('search', $criteria->getSearchText(true)) ->format(function ($person, $actions) { - $actions->addAction('view', __('View Details')) + $actions->addAction('profile', __('View')) ->setURL('/modules/Staff/staff_view_details.php'); }); } diff --git a/modules/Staff/staff_view_details.php b/modules/Staff/staff_view_details.php index 49012292b8..21dd0cf458 100644 --- a/modules/Staff/staff_view_details.php +++ b/modules/Staff/staff_view_details.php @@ -182,8 +182,7 @@ $table->addHeaderAction('edit', __('Edit User')) ->setURL('/modules/User Admin/user_manage_edit.php') ->addParam('gibbonPersonID', $gibbonPersonID) - ->displayLabel() - ->append(' | '); + ->displayLabel(); } if (isActionAccessible($guid, $connection2, '/modules/Staff/staff_manage.php')) { @@ -255,8 +254,7 @@ ->setURL('/modules/Timetable/tt_manage_subscription.php') ->addParam('gibbonPersonID', $gibbonPersonID) ->setIcon('download') - ->displayLabel() - ->prepend(' | '); + ->displayLabel(); } echo $table->render(['' => '']); @@ -284,8 +282,7 @@ $table->addHeaderAction('edit', __('Edit User')) ->setURL('/modules/User Admin/user_manage_edit.php') ->addParam('gibbonPersonID', $gibbonPersonID) - ->displayLabel() - ->append(' | '); + ->displayLabel(); } if (isActionAccessible($guid, $connection2, '/modules/Staff/staff_manage.php')) { @@ -527,7 +524,7 @@ $table->addColumn('name', __('Activity')) ->format(function ($activity) { - return $activity['name'].'
'.$activity['type'].''; + return $activity['name'].'
'.$activity['type'].''; }); $table->addColumn('role', __('Role')) ->format(function ($activity) { diff --git a/modules/Staff/substitutes_manage.php b/modules/Staff/substitutes_manage.php index cea73cc375..ef10d30899 100644 --- a/modules/Staff/substitutes_manage.php +++ b/modules/Staff/substitutes_manage.php @@ -45,7 +45,7 @@ // SEARCH FORM $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Search')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/substitutes_manage.php'); diff --git a/modules/Staff/templates/dutySchedule.twig.html b/modules/Staff/templates/dutySchedule.twig.html index 4d2df3d1ee..a47d7e22cc 100644 --- a/modules/Staff/templates/dutySchedule.twig.html +++ b/modules/Staff/templates/dutySchedule.twig.html @@ -17,7 +17,7 @@
{{ weekdayName }}
{% for person in dutyItem.roster %} -
+
{% if person.image_240 is not empty %} diff --git a/modules/Students/applicationForm.php b/modules/Students/applicationForm.php index 4b8db1ef79..6d85971393 100644 --- a/modules/Students/applicationForm.php +++ b/modules/Students/applicationForm.php @@ -312,7 +312,7 @@ $row = $form->addRow()->setClass('senDetailsRow'); $column = $row->addColumn(); $column->addLabel('senDetails', __('SEN Details'))->description(__('Provide any comments or information concerning your child\'s development and SEN history.')); - $column->addTextArea('senDetails')->setRows(5)->required()->setClass('fullWidth'); + $column->addTextArea('senDetails')->setRows(5)->required()->setClass('w-full'); } else { $form->addHiddenValue('sen', 'N'); @@ -326,7 +326,7 @@ $col = $form->addRow()->setClass('medicalDetailsRow')->addColumn(); $col->addLabel('medicalInformation', __('Medical Information'))->description(__('Please indicate any medical conditions.')); - $col->addTextArea('medicalInformation')->setRows(5)->required()->setClass('fullWidth'); + $col->addTextArea('medicalInformation')->setRows(5)->required()->setClass('w-full'); // STUDENT EDUCATION $heading = $form->addRow()->addSubheading(__('Student Education')); @@ -720,7 +720,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('languageChoiceExperience', __('Language Choice Experience'))->description(__('Has the applicant studied the selected language before? If so, please describe the level and type of experience.')); - $column->addTextArea('languageChoiceExperience')->required()->setRows(5)->setClass('fullWidth'); + $column->addTextArea('languageChoiceExperience')->required()->setRows(5)->setClass('w-full'); } } diff --git a/modules/Students/applicationForm_manage.php b/modules/Students/applicationForm_manage.php index c570cafaf9..91637e13ee 100644 --- a/modules/Students/applicationForm_manage.php +++ b/modules/Students/applicationForm_manage.php @@ -56,7 +56,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/applicationForm_manage.php'); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); diff --git a/modules/Students/applicationForm_manage_edit.php b/modules/Students/applicationForm_manage_edit.php index cbe22a2afa..e9606019e5 100644 --- a/modules/Students/applicationForm_manage_edit.php +++ b/modules/Students/applicationForm_manage_edit.php @@ -105,7 +105,7 @@ $row = $form->addRow(); $row->addHeading('For Office Use', __('For Office Use')); - $row->addContent(__('Fix Block Caps'))->wrap('', ''); + $row->addContent(__('Fix Block Caps'))->wrap('', ''); $row = $form->addRow(); $row->addLabel('gibbonApplicationFormID', __('Application ID')); @@ -257,7 +257,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('notes', __('Notes')); - $column->addTextArea('notes')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('notes')->setRows(5)->setClass('w-full'); // SIBLING APPLICATIONS $heading = $form->addRow()->addSubheading(__('Sibling Applications')); @@ -427,7 +427,7 @@ $row = $form->addRow()->setClass('senDetailsRow'); $column = $row->addColumn(); $column->addLabel('', __('SEN Details'))->description(__('Provide any comments or information concerning your child\'s development and SEN history.')); - $column->addTextArea('senDetails')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('senDetails')->setRows(5)->setClass('w-full'); } else { $form->addHiddenValue('sen', 'N'); @@ -436,7 +436,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('', __('Medical Information'))->description(__('Please indicate any medical conditions.')); - $column->addTextArea('medicalInformation')->setRows(5)->setClass('fullWidth'); + $column->addTextArea('medicalInformation')->setRows(5)->setClass('w-full'); // STUDENT EDUCATION @@ -716,7 +716,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('languageChoiceExperience', __('Language Choice Experience'))->description(__('Has the applicant studied the selected language before? If so, please describe the level and type of experience.')); - $column->addTextArea('languageChoiceExperience')->required()->setRows(5)->setClass('fullWidth'); + $column->addTextArea('languageChoiceExperience')->required()->setRows(5)->setClass('w-full'); } } diff --git a/modules/Students/firstAidRecord.php b/modules/Students/firstAidRecord.php index 44c9355447..bd0b6b49b5 100644 --- a/modules/Students/firstAidRecord.php +++ b/modules/Students/firstAidRecord.php @@ -52,7 +52,7 @@ $form->setTitle(__('Filter')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/firstAidRecord.php"); diff --git a/modules/Students/firstAidRecord_add.php b/modules/Students/firstAidRecord_add.php index e2e520708b..60968183a7 100644 --- a/modules/Students/firstAidRecord_add.php +++ b/modules/Students/firstAidRecord_add.php @@ -81,12 +81,12 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('description', __('Description')); - $column->addTextArea('description')->setRows(8)->setClass('fullWidth')->setValue($firstAidDescriptionTemplate); + $column->addTextArea('description')->setRows(8)->setClass('w-full')->setValue($firstAidDescriptionTemplate); $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('actionTaken', __('Action Taken')); - $column->addTextArea('actionTaken')->setRows(8)->setClass('fullWidth'); + $column->addTextArea('actionTaken')->setRows(8)->setClass('w-full'); $row = $form->addRow()->addHeading('Follow Up', __('Follow Up')); @@ -97,7 +97,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('followUp', __('Follow Up'))->description(__('If you are the student\'s teacher, please include details such as: the location & lesson, what lead up to the incident, what was the incident, what did you do.')); - $column->addTextArea('followUp')->setRows(8)->setClass('fullWidth'); + $column->addTextArea('followUp')->setRows(8)->setClass('w-full'); // CUSTOM FIELDS $container->get(CustomFieldHandler::class)->addCustomFieldsToForm($form, 'First Aid', []); diff --git a/modules/Students/firstAidRecord_edit.php b/modules/Students/firstAidRecord_edit.php index be8bf70de7..06ae6d278e 100644 --- a/modules/Students/firstAidRecord_edit.php +++ b/modules/Students/firstAidRecord_edit.php @@ -103,12 +103,12 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('description', __('Description')); - $column->addTextArea('description')->setValue($values['description'])->setRows(8)->setClass('fullWidth')->readonly(); + $column->addTextArea('description')->setValue($values['description'])->setRows(8)->setClass('w-full')->readonly(); $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('actionTaken', __('Action Taken')); - $column->addTextArea('actionTaken')->setValue($values['actionTaken'])->setRows(8)->setClass('fullWidth')->readonly(); + $column->addTextArea('actionTaken')->setValue($values['actionTaken'])->setRows(8)->setClass('w-full')->readonly(); $row = $form->addRow()->addHeading('Follow Up', __('Follow Up')); @@ -123,7 +123,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('followUp0', __("Follow Up by {name} at {date}", ['name' => Format::name('', $values['preferredNameFirstAider'], $values['surnameFirstAider']), 'date' => Format::dateTimeReadable($values['timestamp'])])); - $column->addContent($values['followUp'])->setClass('fullWidth'); + $column->addContent($values['followUp'])->setClass('w-full'); } //Print new-style followup as log @@ -140,7 +140,7 @@ $row = $form->addRow(); $column = $row->addColumn(); $column->addLabel('followUp', (empty($logs) ? __('Follow Up') : __('Further Follow Up')) .' / '.__('Notes'))->description(__('If you are the student\'s teacher, please include details such as: the location & lesson, what lead up to the incident, what was the incident, what did you do.')); - $column->addTextArea('followUp')->setRows(8)->setClass('fullWidth'); + $column->addTextArea('followUp')->setRows(8)->setClass('w-full'); // CUSTOM FIELDS diff --git a/modules/Students/medicalForm_manage.php b/modules/Students/medicalForm_manage.php index 92d8e0b867..bb64e19b47 100644 --- a/modules/Students/medicalForm_manage.php +++ b/modules/Students/medicalForm_manage.php @@ -47,7 +47,7 @@ echo ''; $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/medicalForm_manage.php'); diff --git a/modules/Students/report_familyAddress_byStudent.php b/modules/Students/report_familyAddress_byStudent.php index 5ba72a4d04..160ce3d362 100644 --- a/modules/Students/report_familyAddress_byStudent.php +++ b/modules/Students/report_familyAddress_byStudent.php @@ -50,7 +50,7 @@ $form = Form::create('action', $session->get('absoluteURL')."/index.php?q=/modules/Students/report_familyAddress_byStudent.php"); $form->setTitle(__('Choose Students')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $row = $form->addRow(); $row->addLabel('gibbonPersonID', __('Students')); diff --git a/modules/Students/report_formGroupSummary.php b/modules/Students/report_formGroupSummary.php index 1085991fcf..c5c1bfaf02 100644 --- a/modules/Students/report_formGroupSummary.php +++ b/modules/Students/report_formGroupSummary.php @@ -66,7 +66,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_formGroupSummary.php"); diff --git a/modules/Students/report_student_emergencySummary.php b/modules/Students/report_student_emergencySummary.php index f0308ca7df..217d5fc5f2 100644 --- a/modules/Students/report_student_emergencySummary.php +++ b/modules/Students/report_student_emergencySummary.php @@ -62,7 +62,7 @@ $form = Form::create('action', $session->get('absoluteURL')."/index.php?q=/modules/Students/report_student_emergencySummary.php"); $form->setTitle(__('Choose Students')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $row = $form->addRow(); $row->addLabel('gibbonPersonID', __('Students')); diff --git a/modules/Students/report_student_medicalSummary.php b/modules/Students/report_student_medicalSummary.php index 3e69efd2e3..7995213a5d 100644 --- a/modules/Students/report_student_medicalSummary.php +++ b/modules/Students/report_student_medicalSummary.php @@ -64,7 +64,7 @@ $form = Form::create('action', $session->get('absoluteURL')."/index.php?q=/modules/Students/report_student_medicalSummary.php"); $form->setTitle(__('Choose Students')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $row = $form->addRow(); $row->addLabel('gibbonPersonID', __('Students')); diff --git a/modules/Students/report_student_personalDocumentSummary.php b/modules/Students/report_student_personalDocumentSummary.php index f9a6f4a732..0842c0caea 100644 --- a/modules/Students/report_student_personalDocumentSummary.php +++ b/modules/Students/report_student_personalDocumentSummary.php @@ -54,7 +54,7 @@ $form->setTitle(__('Choose Students')); $form->setDescription(__('This report prints a summary of personal documents including passports and ID cards for the selected students.')); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $row = $form->addRow(); $row->addLabel('gibbonPersonID', __('Students')); diff --git a/modules/Students/report_students_IDCards.php b/modules/Students/report_students_IDCards.php index 6bdc079d90..8fb09a9410 100644 --- a/modules/Students/report_students_IDCards.php +++ b/modules/Students/report_students_IDCards.php @@ -46,7 +46,7 @@ $form = Form::create('action', $session->get('absoluteURL')."/index.php?q=/modules/Students/report_students_IDCards.php"); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $row = $form->addRow(); $row->addLabel('gibbonPersonID', __('Students')); diff --git a/modules/Students/report_students_byFormGroup.php b/modules/Students/report_students_byFormGroup.php index a2f52fe2ba..9b85352549 100644 --- a/modules/Students/report_students_byFormGroup.php +++ b/modules/Students/report_students_byFormGroup.php @@ -46,7 +46,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Choose Form Group')) ->setFactory(DatabaseFormFactory::create($pdo)) - ->setClass('noIntBorder fullWidth'); + ->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/report_students_byFormGroup.php"); diff --git a/modules/Students/student_view.php b/modules/Students/student_view.php index 058225cfe8..b87cab5fdd 100644 --- a/modules/Students/student_view.php +++ b/modules/Students/student_view.php @@ -103,7 +103,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/student_view.php'); $searchDescription = $canViewFullProfile @@ -171,7 +171,7 @@ ->addParam('sort', $sort) ->addParam('allStudents', $canViewFullProfile ? $allStudents : '') ->format(function ($row, $actions) { - $actions->addAction('view', __('View Details')) + $actions->addAction('profile', __('View')) ->setURL('/modules/Students/student_view_details.php'); }); diff --git a/modules/Students/student_view_details.php b/modules/Students/student_view_details.php index 43b2f1e550..a7b3554cde 100644 --- a/modules/Students/student_view_details.php +++ b/modules/Students/student_view_details.php @@ -570,8 +570,7 @@ ->addParam('gibbonSchoolYearID', $session->get('gibbonSchoolYearID')) ->addParam('type', $role) ->addParam('allUsers', $allStudents) - ->displayLabel() - ->append(' | '); + ->displayLabel(); } } @@ -592,8 +591,7 @@ ->setURL('/modules/Timetable/tt_manage_subscription.php') ->addParam('gibbonPersonID', $gibbonPersonID) ->setIcon('download') - ->displayLabel() - ->prepend(' | '); + ->displayLabel(); } echo $table->render([['' => '']]); @@ -1401,7 +1399,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setTitle(__('Filter')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/student_view_details.php'); $form->addHiddenValue('gibbonPersonID', $gibbonPersonID); @@ -1594,7 +1592,7 @@ echo '

'; $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/student_view_details.php'); $form->addHiddenValue('gibbonPersonID', $gibbonPersonID); @@ -1643,7 +1641,7 @@ $details = isset($_GET['details'])? $_GET['details'] : 'Yes'; $form->addHiddenValue('details', 'No'); $showHide = $form->getFactory()->createCheckbox('details')->addClass('details')->setValue('Yes')->checked($details)->inline(true) - ->description(__('Show/Hide Details'))->wrap(' ', ''); + ->description(__('Show/Hide Details'))->wrap(' ', ''); $rowFilter = $form->addRow(); $rowFilter->addSearchSubmit($session, __('Clear Filters'), array('gibbonPersonID', 'allStudents', 'search', 'subpage'))->prepend($showHide->getOutput()); diff --git a/modules/System Admin/dataRetention.php b/modules/System Admin/dataRetention.php index 86d0088e5b..1f3bc1a1a7 100644 --- a/modules/System Admin/dataRetention.php +++ b/modules/System Admin/dataRetention.php @@ -63,7 +63,7 @@ ->description($description) ->alignRight() ->setLabelClass('w-full') - ->addClass('border rounded p-6 my-2 bg-blue-100'); + ->addClass('border rounded p-6 my-2 bg-blue-50'); } $row = $form->addRow(); diff --git a/modules/System Admin/emailTemplates_manage.php b/modules/System Admin/emailTemplates_manage.php index 0d74b403d3..d181a72f1c 100644 --- a/modules/System Admin/emailTemplates_manage.php +++ b/modules/System Admin/emailTemplates_manage.php @@ -49,11 +49,12 @@ $actions = $table->addActionColumn() ->addParam('gibbonEmailTemplateID') ->format(function ($values, $actions) { + $actions->addAction('edit', __('Edit')) + ->setURL('/modules/System Admin/emailTemplates_manage_edit.php'); + $actions->addAction('duplicate', __('Duplicate')) ->setIcon('copy') ->setURL('/modules/System Admin/emailTemplates_manage_duplicate.php'); - $actions->addAction('edit', __('Edit')) - ->setURL('/modules/System Admin/emailTemplates_manage_edit.php'); if ($values['type'] == 'Custom') { $actions->addAction('delete', __('Delete')) diff --git a/modules/System Admin/formBuilder.php b/modules/System Admin/formBuilder.php index f3429b2167..b46a33941e 100644 --- a/modules/System Admin/formBuilder.php +++ b/modules/System Admin/formBuilder.php @@ -62,14 +62,14 @@ $table->addActionColumn() ->addParam('gibbonFormID') ->format(function ($form, $actions) { + $actions->addAction('edit', __('Edit')) + ->setURL('/modules/System Admin/formBuilder_edit.php'); + if ($form['pages'] > 0) { $actions->addAction('view', __('Preview')) ->setURL('/modules/System Admin/formBuilder_preview.php'); } - $actions->addAction('edit', __('Edit')) - ->setURL('/modules/System Admin/formBuilder_edit.php'); - if ($form['pages'] > 0) { $actions->addAction('design', __('Design')) ->setIcon('markbook') diff --git a/modules/System Admin/formBuilder_editOrderAjax.php b/modules/System Admin/formBuilder_editOrderAjax.php index dc8ba521d5..af6561a956 100644 --- a/modules/System Admin/formBuilder_editOrderAjax.php +++ b/modules/System Admin/formBuilder_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order']; if (empty($order) || empty($data['gibbonFormID'])) { exit; diff --git a/modules/System Admin/formBuilder_page_add.php b/modules/System Admin/formBuilder_page_add.php index 93df5c3832..b5aced31a8 100644 --- a/modules/System Admin/formBuilder_page_add.php +++ b/modules/System Admin/formBuilder_page_add.php @@ -49,6 +49,10 @@ $form = Form::create('formsManage', $session->get('absoluteURL').'/modules/System Admin/formBuilder_page_addProcess.php'); $form->setFactory(DatabaseFormFactory::create($pdo)); + + if ($redirect == 'design') { + $form->removeMeta(); + } $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('gibbonFormID', $gibbonFormID); diff --git a/modules/System Admin/formBuilder_page_design.php b/modules/System Admin/formBuilder_page_design.php index 3487b05d7b..9ea1059cf1 100644 --- a/modules/System Admin/formBuilder_page_design.php +++ b/modules/System Admin/formBuilder_page_design.php @@ -126,7 +126,7 @@ } if ($element = $row->getElement($field['fieldName'])) { - $element->addClass('flex-1'); + $element->addClass('flex-grow'); } $row->addContent((new Action('edit', __('Edit'))) @@ -140,7 +140,7 @@ ->addParam('gibbonFormFieldID', $field['gibbonFormFieldID']) ->addParams($urlParams) ->getOutput() - ); + )->setClass('flex-1 relative flex justify-end items-center gap-2 text-right'); } // $formFields->clearTriggers(); diff --git a/modules/System Admin/formBuilder_page_editOrderAjax.php b/modules/System Admin/formBuilder_page_editOrderAjax.php index 9b527c6c20..b6dba50037 100644 --- a/modules/System Admin/formBuilder_page_editOrderAjax.php +++ b/modules/System Admin/formBuilder_page_editOrderAjax.php @@ -30,7 +30,7 @@ } else { // Proceed! $data = $_POST['data'] ?? []; - $order = json_decode($_POST['order']); + $order = $_POST['order']; if (empty($order) || empty($data['gibbonFormPageID'])) { exit; diff --git a/modules/System Admin/formBuilder_page_edit_field_add.php b/modules/System Admin/formBuilder_page_edit_field_add.php index d5439f7824..eb2cef18a0 100644 --- a/modules/System Admin/formBuilder_page_edit_field_add.php +++ b/modules/System Admin/formBuilder_page_edit_field_add.php @@ -58,6 +58,7 @@ $form = Form::create('formFieldAdd', $session->get('absoluteURL').'/modules/System Admin/formBuilder_page_edit_field_addProcess.php'); $form->setFactory(DatabaseFormFactory::create($pdo)); + $form->removeMeta(); $form->addHiddenValue('address', '/modules/System Admin/formBuilder_page_edit.php'); $form->addHiddenValue('fieldGroup', $fieldGroup); @@ -223,7 +224,7 @@ ->description($description) ->alignLeft() ->setLabelClass('w-full p-4') - ->addClass('items-center border rounded pl-4 my-2 bg-blue-100'); + ->addClass('items-center border rounded pl-4 my-2 bg-blue-50'); } } } diff --git a/modules/System Admin/formBuilder_page_edit_field_edit.php b/modules/System Admin/formBuilder_page_edit_field_edit.php index 7d249dd1ad..4cae38c963 100644 --- a/modules/System Admin/formBuilder_page_edit_field_edit.php +++ b/modules/System Admin/formBuilder_page_edit_field_edit.php @@ -56,6 +56,7 @@ } $form = Form::create('formsManage', $session->get('absoluteURL').'/modules/System Admin/formBuilder_page_edit_field_editProcess.php'); + $form->removeMeta(); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValues($urlParams); diff --git a/modules/System Admin/i18n_manage.php b/modules/System Admin/i18n_manage.php index a3e7b3af49..a4042d375e 100644 --- a/modules/System Admin/i18n_manage.php +++ b/modules/System Admin/i18n_manage.php @@ -54,11 +54,9 @@ $i18n['isInstalled'] = i18nFileExists($session->get('absolutePath'), $i18n['code']); }); - $form = Form::create('i18n_manage', $session->get('absoluteURL').'/modules/'.$session->get('module').'/i18n_manageProcess.php'); + $form = Form::createBlank('i18n_manage', $session->get('absoluteURL').'/modules/'.$session->get('module').'/i18n_manageProcess.php'); $form->setTitle(__('Installed')); - $form->setClass('fullWidth'); $form->addHiddenValue('address', $session->get('address')); - $form->setClass('w-full blank'); // DATA TABLE $table = $form->addRow()->addDataTable('i18n_installed', $criteria)->withData($languages); @@ -112,7 +110,7 @@ } }); - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth standardForm'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full standardForm'); $table->addRow()->addSubmit(); $installedCount = array_reduce($languages->toArray(), function ($count, $i18n) { diff --git a/modules/System Admin/import_run.php b/modules/System Admin/import_run.php index 5d50782587..732133097a 100644 --- a/modules/System Admin/import_run.php +++ b/modules/System Admin/import_run.php @@ -236,8 +236,7 @@ echo "var columnDataFunction = " . Importer::COLUMN_DATA_FUNCTION .";"; echo ""; - $form = Form::create('importStep2', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/import_run.php&type='.$type.'&step=3'); - $form->setClass('w-full blank'); + $form = Form::createBlank('importStep2', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/import_run.php&type='.$type.'&step=3'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('mode', $mode); @@ -256,7 +255,7 @@ $lastColumnValue = $importType->getPrimaryKey(); } - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full'); $row = $table->addRow(); $row->addLabel('syncField', __('Sync').'?')->description(__('Only rows with a matching database ID will be imported.')); @@ -277,7 +276,7 @@ // COLUMN SELECTION if (!empty($importType->getAllFields())) { - $table = $form->addRow()->addTable()->setClass('colorOddEven fullWidth'); + $table = $form->addRow()->addTable()->setClass('colorOddEven w-full'); $header = $table->addHeaderRow(); $header->addContent(__('Field Name')); @@ -382,7 +381,7 @@ $form->addRow()->addContent(' '); // CSV PREVIEW - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full'); $row = $table->addRow(); $row->addLabel('csvData', __('Data')); @@ -509,8 +508,7 @@ echo $page->fetchFromTemplate('importer.twig.html', $results); if ($step==3) { - $form = Form::create('importStep2', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/import_run.php&type='.$type.'&step=4'); - $form->setClass('w-full blank'); + $form = Form::createBlank('importStep2', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/import_run.php&type='.$type.'&step=4'); $form->addHiddenValue('address', $session->get('address')); $form->addHiddenValue('mode', $mode); @@ -523,7 +521,7 @@ $form->addHiddenValue('filename', $_POST['filename'] ?? ''); // CSV PREVIEW - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full'); $row = $table->addRow(); $row->addLabel('csvData', __('Data')); diff --git a/modules/System Admin/logs_view.php b/modules/System Admin/logs_view.php index c7fb95d811..4f8cd81fe1 100644 --- a/modules/System Admin/logs_view.php +++ b/modules/System Admin/logs_view.php @@ -43,7 +43,7 @@ $form->setFactory(DatabaseFormFactory::create($pdo)); $form->setTitle(__('Filters')); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/logs_view.php'); $sql = "SELECT DISTINCT title AS value, title AS name FROM gibbonLog ORDER BY title"; diff --git a/modules/System Admin/notificationSettings.php b/modules/System Admin/notificationSettings.php index 4fb9ec0256..79a0649f1e 100644 --- a/modules/System Admin/notificationSettings.php +++ b/modules/System Admin/notificationSettings.php @@ -45,7 +45,7 @@ $nameFormat = function ($row) use ($session) { $output = __($row['event']); if ($row['type'] == 'CLI') { - $output .= " "; + $output .= Format::tooltip(icon('solid', 'config', 'size-5 ml-2 fill-current text-gray-400 float-right'), __('This is a CLI notification event. It will only run if the corresponding CLI script has been setup on the server.')); } return $output; }; diff --git a/modules/System Admin/stringReplacement_manage.php b/modules/System Admin/stringReplacement_manage.php index 90af623b57..1c008202e7 100644 --- a/modules/System Admin/stringReplacement_manage.php +++ b/modules/System Admin/stringReplacement_manage.php @@ -46,7 +46,7 @@ echo ''; $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/stringReplacement_manage.php'); diff --git a/modules/System Admin/systemCheck.php b/modules/System Admin/systemCheck.php index 5fc906baa2..76991fc78c 100644 --- a/modules/System Admin/systemCheck.php +++ b/modules/System Admin/systemCheck.php @@ -35,8 +35,8 @@ $versionDB = $container->get(SettingGateway::class)->getSettingByScope('System', 'version'); - $trueIcon = ""; - $falseIcon = ""; + $trueIcon = icon('solid', 'check', 'size-6 ml-2 fill-current text-green-600'); + $falseIcon = icon('solid', 'cross', 'size-6 ml-2 fill-current text-red-700'); $versionTitle = __('%s Version'); $versionMessage = __('%s requires %s version %s or higher'); @@ -72,34 +72,34 @@ ]), 'error'); } - $form = Form::createTable('systemCheck', "")->setClass('smallIntBorder w-full'); + $form = Form::create('systemCheck', ""); $form->addRow()->addHeading('System Requirements', __('System Requirements')); $row = $form->addRow(); $row->addLabel('phpVersionLabel', sprintf($versionTitle, 'PHP'))->description(sprintf($versionMessage, __('Gibbon').' v'.$version, 'PHP', $phpRequirement)); - $row->addTextField('phpVersion')->setValue($phpVersion)->readonly(); - $row->addContent((version_compare($phpVersion, $phpRequirement, '>='))? $trueIcon : $falseIcon); + $row->addTextField('phpVersion')->setValue($phpVersion)->readonly() + ->append((version_compare($phpVersion, $phpRequirement, '>='))? $trueIcon : $falseIcon); $row = $form->addRow(); $row->addLabel('mysqlVersionLabel', sprintf($versionTitle, 'MySQL'))->description(sprintf($versionMessage, __('Gibbon').' v'.$version, 'MySQL', $mysqlRequirement)); - $row->addTextField('mysqlVersion')->setValue($mysqlVersion)->readonly(); - $row->addContent((version_compare($mysqlVersion, $mysqlRequirement, '>='))? $trueIcon : $falseIcon); + $row->addTextField('mysqlVersion')->setValue($mysqlVersion)->readonly() + ->append((version_compare($mysqlVersion, $mysqlRequirement, '>='))? $trueIcon : $falseIcon); $row = $form->addRow(); $row->addLabel('mysqlCollationLabel', __('MySQL Collation'))->description(sprintf( __('Database collation should be set to %s'), 'utf8_general_ci or utf8mb3_general_ci')); - $row->addTextField('mysqlCollation')->setValue($mysqlCollation)->readonly(); - $row->addContent(($mysqlCollation == 'utf8_general_ci' || $mysqlCollation == 'utf8mb3_general_ci')? $trueIcon : $falseIcon); + $row->addTextField('mysqlCollation')->setValue($mysqlCollation)->readonly() + ->append(($mysqlCollation == 'utf8_general_ci' || $mysqlCollation == 'utf8mb3_general_ci')? $trueIcon : $falseIcon); $row = $form->addRow(); $row->addLabel('pdoSupportLabel', __('MySQL PDO Support')); - $row->addTextField('pdoSupport')->setValue((@extension_loaded('pdo_mysql'))? __('Installed') : __('Not Installed'))->readonly(); - $row->addContent((@extension_loaded('pdo') && extension_loaded('pdo_mysql'))? $trueIcon : $falseIcon); + $row->addTextField('pdoSupport')->setValue((@extension_loaded('pdo_mysql'))? __('Installed') : __('Not Installed'))->readonly() + ->append((@extension_loaded('pdo') && extension_loaded('pdo_mysql'))? $trueIcon : $falseIcon); $row = $form->addRow(); $row->addLabel('backgroundProcessingLabel', __('Background Processing'))->description(__('Requires PHP exec() function access')); - $row->addTextField('backgroundProcessing')->setValue($backgroundProcessing ? __('Enabled') : __('Not Available'))->readonly(); - $row->addContent((@extension_loaded('pdo') && extension_loaded('pdo_mysql'))? $trueIcon : $falseIcon); + $row->addTextField('backgroundProcessing')->setValue($backgroundProcessing ? __('Enabled') : __('Not Available'))->readonly() + ->append((@extension_loaded('pdo') && extension_loaded('pdo_mysql'))? $trueIcon : $falseIcon); // APACHE MODULES if ($apacheVersion !== false) { @@ -110,8 +110,8 @@ $active = @in_array($moduleName, $apacheModules); $row = $form->addRow(); $row->addLabel('moduleLabel', $moduleName); - $row->addTextField('module')->setValue(($active)? __('Enabled') : __('N/A'))->readonly(); - $row->addContent(($active)? $trueIcon : $falseIcon); + $row->addTextField('module')->setValue(($active)? __('Enabled') : __('N/A'))->readonly() + ->append(($active)? $trueIcon : $falseIcon); } } @@ -125,8 +125,8 @@ $installed = @extension_loaded($extension); $row = $form->addRow(); $row->addLabel('extensionLabel', $extension); - $row->addTextField('extension')->setValue(($installed)? __('Installed') : __('Not Installed'))->readonly(); - $row->addContent(($installed)? $trueIcon : $falseIcon); + $row->addTextField('extension')->setValue(($installed)? __('Installed') : __('Not Installed'))->readonly() + ->append(($installed)? $trueIcon : $falseIcon); } } @@ -151,8 +151,8 @@ $row = $form->addRow(); $row->addLabel('settingLabel', ''.$setting.' '.$operator.' '.$compare.''); - $row->addTextField('setting')->setValue($value)->readonly(); - $row->addContent($isValid? $trueIcon : $falseIcon); + $row->addTextField('setting')->setValue($value)->readonly() + ->append($isValid? $trueIcon : $falseIcon); } } @@ -161,18 +161,18 @@ $row = $form->addRow(); $row->addLabel('systemWriteLabel', __('System not publicly writeable')); - $row->addTextArea('systemWrite')->setValue(sprintf(__('%s files checked (%s publicly writeable)'), $fileCount, $publicWriteCount))->setRows(1)->addClass('w-64 max-w-1/2 text-left')->readonly(); - $row->addContent($publicWriteCount == 0? $trueIcon : $falseIcon); + $row->addTextArea('systemWrite')->setValue(sprintf(__('%s files checked (%s publicly writeable)'), $fileCount, $publicWriteCount))->setRows(1)->addClass(' max-w-1/2 text-left')->readonly() + ->append($publicWriteCount == 0? $trueIcon : $falseIcon); $row = $form->addRow(); $row->addLabel('systemWriteLabel', __('Uploads folder not publicly accessible')); - $row->addTextArea('systemWrite')->setValue($session->get('absoluteURL').'/uploads')->setRows(1)->addClass('w-64 max-w-1/2 text-left')->readonly(); - $row->addContent($statusCheck? $trueIcon : $falseIcon); + $row->addTextArea('systemWrite')->setValue($session->get('absoluteURL').'/uploads')->setRows(1)->addClass(' max-w-1/2 text-left')->readonly() + ->append($statusCheck? $trueIcon : $falseIcon); $row = $form->addRow(); $row->addLabel('uploadsFolderLabel', __('Uploads folder server writeable')); - $row->addTextField('uploadsFolder')->setValue($session->get('absoluteURL').'/uploads')->readonly(); - $row->addContent(is_writable($session->get('absolutePath').'/uploads')? $trueIcon : $falseIcon); + $row->addTextField('uploadsFolder')->setValue($session->get('absoluteURL').'/uploads')->readonly() + ->append(is_writable($session->get('absolutePath').'/uploads')? $trueIcon : $falseIcon); echo $form->getOutput(); } diff --git a/modules/System Admin/systemSettings.php b/modules/System Admin/systemSettings.php index 11f0720c2b..eb9bb215f5 100644 --- a/modules/System Admin/systemSettings.php +++ b/modules/System Admin/systemSettings.php @@ -50,7 +50,7 @@ $setting = $settingGateway->getSettingByScope('System', 'absoluteURL', true); $row = $form->addRow(); $row->addLabel($setting['name'], __($setting['nameDisplay']))->description(__($setting['description'])); - $row->addURL($setting['name'])->setValue($setting['value'])->maxLength(100)->required(); + $row->addTextField($setting['name'])->setValue($setting['value'])->maxLength(100)->required(); $setting = $settingGateway->getSettingByScope('System', 'absolutePath', true); $row = $form->addRow(); diff --git a/modules/System Admin/templates/icons.twig.html b/modules/System Admin/templates/icons.twig.html deleted file mode 100644 index 6481316ea8..0000000000 --- a/modules/System Admin/templates/icons.twig.html +++ /dev/null @@ -1,18 +0,0 @@ -{##} -{% if icon == 'docs' %} - -{% elseif icon == 'forums' %} - -{% elseif icon == 'license' %} - -{% elseif icon == 'support' %} - -{% endif %} diff --git a/modules/System Admin/theme_manage.php b/modules/System Admin/theme_manage.php index 7caaf65031..35bb7766db 100644 --- a/modules/System Admin/theme_manage.php +++ b/modules/System Admin/theme_manage.php @@ -102,11 +102,10 @@ }, array()); // INSTALLED THEMES - $form = Form::create('theme_manage', $session->get('absoluteURL').'/modules/'.$session->get('module').'/theme_manageProcess.php'); + $form = Form::createBlank('theme_manage', $session->get('absoluteURL').'/modules/'.$session->get('module').'/theme_manageProcess.php'); - $form->setClass('fullWidth'); + $form->setClass('w-full'); $form->addHiddenValue('address', $session->get('address')); - $form->setClass('w-full blank'); // DATA TABLE $table = $form->addRow()->addDataTable('themeManage', $criteria)->withData($themes); @@ -148,7 +147,7 @@ } }); - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth standardForm'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full standardForm'); $table->addRow()->addSubmit(); echo $form->getOutput(); diff --git a/modules/System Admin/thirdPartySettings.php b/modules/System Admin/thirdPartySettings.php index 984a3c935f..f51c423d73 100644 --- a/modules/System Admin/thirdPartySettings.php +++ b/modules/System Admin/thirdPartySettings.php @@ -172,8 +172,8 @@ $row = $form->addRow()->addClass('paymentTest'); $row->addLabel('paymentTest', __('Test Payment'))->description(__('You can use this tool to make a small payment in {currency} to test your gateway configuration.', ['currency' => $session->get('currency')])); $col = $row->addColumn(); - $col->addCurrency('paymentTest')->setValue(10)->addClass('w-full'); - $col->addButton(__('Go'), 'testPayment()')->addClass('-ml-px w-24'); + $col->addCurrency('paymentTest')->setValue(10)->groupAlign('left'); + $col->addButton(__('Send'), 'testPayment()')->groupAlign('right')->setIcon('arrow-right-circle'); } // SMS @@ -241,8 +241,8 @@ $row = $form->addRow()->addClass('smsTest'); $row->addLabel('smsTest', __('Test SMS'))->description(__('You can use this tool to send an sms to test your SMS Gateway configuration.')); $col = $row->addColumn(); - $col->addPhoneNumber('smsTest')->setValue($session->get('sms'))->addClass('w-full'); - $col->addButton(__('Go'), 'testSMS()')->addClass('-ml-px w-24'); + $col->addPhoneNumber('smsTest')->setValue($session->get('sms'))->groupAlign('left'); + $col->addButton(__('Send'), 'testSMS()')->groupAlign('right')->setIcon('arrow-right-circle'); } // SMTP MAIL @@ -291,8 +291,8 @@ $row = $form->addRow()->addClass('emailTest'); $row->addLabel('emailTest', __('Test Email'))->description(__('You can use this tool to send an email to test your SMTP configuration.')); $col = $row->addColumn(); - $col->addEmail('emailTest')->setValue($session->get('email'))->addClass('w-full'); - $col->addButton(__('Go'), 'testEmail()')->addClass('-ml-px w-24'); + $col->addEmail('emailTest')->setValue($session->get('email'))->groupAlign('left'); + $col->addButton(__('Send'), 'testEmail()')->groupAlign('right')->setIcon('arrow-right-circle'); $row = $form->addRow(); diff --git a/modules/Timetable Admin/courseEnrolment_manage.php b/modules/Timetable Admin/courseEnrolment_manage.php index 29fc93c05e..568d1522a1 100644 --- a/modules/Timetable Admin/courseEnrolment_manage.php +++ b/modules/Timetable Admin/courseEnrolment_manage.php @@ -58,7 +58,7 @@ $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/courseEnrolment_manage.php'); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); diff --git a/modules/Timetable Admin/courseEnrolment_manage_byPerson.php b/modules/Timetable Admin/courseEnrolment_manage_byPerson.php index eb2875e5b1..7fbe87aabb 100644 --- a/modules/Timetable Admin/courseEnrolment_manage_byPerson.php +++ b/modules/Timetable Admin/courseEnrolment_manage_byPerson.php @@ -55,7 +55,7 @@ echo ''; $form = Form::create('searchForm', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/courseEnrolment_manage_byPerson.php'); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); diff --git a/modules/Timetable Admin/courseEnrolment_sync.php b/modules/Timetable Admin/courseEnrolment_sync.php index fc0386f5be..c8c1dc996b 100644 --- a/modules/Timetable Admin/courseEnrolment_sync.php +++ b/modules/Timetable Admin/courseEnrolment_sync.php @@ -69,8 +69,7 @@ $table->addHeaderAction('add', __('Add')) ->setURL('/modules/Timetable Admin/courseEnrolment_sync_add.php') ->addParam('gibbonSchoolYearID', $gibbonSchoolYearID) - ->displayLabel() - ->append(' | '); + ->displayLabel(); $table->addHeaderAction('sync', __('Sync All')) ->setURL('/modules/Timetable Admin/courseEnrolment_sync_run.php') diff --git a/modules/Timetable Admin/courseEnrolment_sync_edit.php b/modules/Timetable Admin/courseEnrolment_sync_edit.php index cf72a1e8c5..366698bfd2 100644 --- a/modules/Timetable Admin/courseEnrolment_sync_edit.php +++ b/modules/Timetable Admin/courseEnrolment_sync_edit.php @@ -42,8 +42,7 @@ return; } - $form = Form::create('courseEnrolmentSyncEdit', $session->get('absoluteURL').'/modules/'.$session->get('module').'/courseEnrolment_sync_addEditProcess.php'); - $form->setClass('w-full blank'); + $form = Form::createBlank('courseEnrolmentSyncEdit', $session->get('absoluteURL').'/modules/'.$session->get('module').'/courseEnrolment_sync_addEditProcess.php'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('address', $session->get('address')); @@ -93,7 +92,7 @@ }); $form->addRow()->addHeading($courseName); - $table = $form->addRow()->addTable()->setClass('smallIntBorder colorOddEven fullWidth standardForm'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder colorOddEven w-full standardForm'); $header = $table->addHeaderRow(); $header->addCheckbox('checkall'.$course['gibbonCourseID'])->checked(!empty($optionsSelected))->setClass(); @@ -105,16 +104,15 @@ $row = $table->addRow(); $row->addCheckbox('syncEnabled['.$class['gibbonCourseClassID'].']') ->checked(!empty($class['syncTo'])) - ->setClass($course['gibbonCourseID']) - ->description('  '); + ->setClass($course['gibbonCourseID'].' w-12'); $row->addLabel('syncEnabled['.$class['gibbonCourseClassID'].']', $class['courseNameShort'].'.'.$class['classShortName']) ->setTitle($class['courseNameShort']) - ->setClass('mediumWidth'); + ->setClass('w-36'); $row->addContent((empty($class['syncTo'])? ''.__('No match found').'' : '') ) - ->setClass('shortWidth right'); + ->setClass('w-1/3 text-right'); $row->addSelectFormGroup('syncTo['.$class['gibbonCourseClassID'].']', $gibbonSchoolYearID) ->selected($class['syncTo']) - ->setClass('mediumWidth'); + ->setClass('flex-1'); } // Checkall by course @@ -128,7 +126,7 @@ } } - $table = $form->addRow()->addTable()->setClass('smallIntBorder colorOddEven fullWidth standardForm'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder colorOddEven w-full standardForm'); $row = $table->addRow(); $row->addFooter(); diff --git a/modules/Timetable Admin/courseEnrolment_sync_run.php b/modules/Timetable Admin/courseEnrolment_sync_run.php index 6e04ce232e..b852d625a5 100644 --- a/modules/Timetable Admin/courseEnrolment_sync_run.php +++ b/modules/Timetable Admin/courseEnrolment_sync_run.php @@ -71,8 +71,7 @@ return; } - $form = Form::create('courseEnrolmentSyncRun', $session->get('absoluteURL').'/modules/'.$session->get('module').'/courseEnrolment_sync_runProcess.php'); - $form->setClass('w-full blank'); + $form = Form::createBlank('courseEnrolmentSyncRun', $session->get('absoluteURL').'/modules/'.$session->get('module').'/courseEnrolment_sync_runProcess.php'); $form->setFactory(DatabaseFormFactory::create($pdo)); $form->addHiddenValue('address', $session->get('address')); @@ -81,7 +80,7 @@ // Checkall options $row = $form->addRow()->addContent('

'.__('Options').'

'); - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full'); $row = $table->addRow(); $row->addLabel('includeStudents', __('Include Students')); @@ -141,7 +140,7 @@ } else { $enrolableCount += $enrolmentResult->rowCount(); - $table = $form->addRow()->addTable()->setClass('smallIntBorder colorOddEven fullWidth standardForm'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder colorOddEven w-full standardForm'); $header = $table->addHeaderRow(); $header->addCheckbox('checkall'.$classMap['gibbonYearGroupID'])->checked(true); $header->addContent(__('Name')); @@ -176,7 +175,7 @@ // Only display a submit button if a sync is required if ($enrolableCount > 0) { - $table = $form->addRow()->addTable()->setClass('smallIntBorder colorOddEven fullWidth standardForm'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder colorOddEven w-full standardForm'); $table->addRow()->addSubmit(__('Proceed')); } diff --git a/modules/Timetable Admin/course_manage.php b/modules/Timetable Admin/course_manage.php index 55c377a0d2..1dd108a157 100644 --- a/modules/Timetable Admin/course_manage.php +++ b/modules/Timetable Admin/course_manage.php @@ -58,7 +58,7 @@ $form = Form::create('action', $session->get('absoluteURL').'/index.php','get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', "/modules/".$session->get('module')."/course_manage.php"); $form->addHiddenValue('gibbonSchoolYearID', $gibbonSchoolYearID); @@ -94,8 +94,7 @@ ->setIcon('copy') ->onCLick('return confirm("'.__('Are you sure you want to do this? All courses and classes, but not their participants, will be copied.').'");') ->displayLabel() - ->directLink() - ->append(' | '); + ->directLink(); } $table->addHeaderAction('add', __('Add')) diff --git a/modules/Timetable Admin/course_rollover.php b/modules/Timetable Admin/course_rollover.php index c34bb52e1b..a5e2cfa379 100644 --- a/modules/Timetable Admin/course_rollover.php +++ b/modules/Timetable Admin/course_rollover.php @@ -138,12 +138,11 @@ return $currentCourse; }, $currentCourses); - $form = Form::create('courseRollover', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/course_rollover.php&step=3'); - $form->setClass('w-full blank'); + $form = Form::createBlank('courseRollover', $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/course_rollover.php&step=3'); $form->addHiddenValue('nextYear', $nextYearID); - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth mb-4'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full mb-4'); $row = $table->addRow(); $row->addLabel('rollStudents', __('Include Students')); $row->addCheckbox('rollStudents')->checked('on'); @@ -155,7 +154,7 @@ $form->addRow()->addSubheading(__('Map Classes')); $form->addRow()->addContent(__('Determine which classes from this year roll to which classes in next year, and which not to rollover at all.'))->wrap('

', '

'); - $table = $form->addRow()->addTable()->setClass('colorOddEven fullWidth rowHighlight'); + $table = $form->addRow()->addTable()->setClass('colorOddEven w-full rowHighlight'); $header = $table->addHeaderRow(); $header->addContent(__('Class')); @@ -173,7 +172,7 @@ ->setClass('mediumWidth'); } - $table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth'); + $table = $form->addRow()->addTable()->setClass('smallIntBorder w-full'); $row = $table->addRow(); $row->addFooter(); $row->addSubmit(__('Proceed')); diff --git a/modules/Timetable Admin/report_classEnrolment_byFormGroup.php b/modules/Timetable Admin/report_classEnrolment_byFormGroup.php index e2c5cd0a06..941720fd54 100644 --- a/modules/Timetable Admin/report_classEnrolment_byFormGroup.php +++ b/modules/Timetable Admin/report_classEnrolment_byFormGroup.php @@ -43,7 +43,7 @@ $form = Form::create('filter', $session->get('absoluteURL').'/index.php', 'get'); $form->setFactory(DatabaseFormFactory::create($pdo)); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/report_classEnrolment_byFormGroup.php'); diff --git a/modules/Timetable Admin/ttDates.php b/modules/Timetable Admin/ttDates.php index fdfe7baa79..b99f40f900 100644 --- a/modules/Timetable Admin/ttDates.php +++ b/modules/Timetable Admin/ttDates.php @@ -95,7 +95,7 @@ $count = 1; - $table = $form->addRow()->addTable()->setClass('fullWidth'); + $table = $form->addRow()->addTable()->setClass('w-full'); $row = $table->addHeaderRow(); for ($i = 1; $i < 8; ++$i) { @@ -103,9 +103,9 @@ $dowShort = date('D', strtotime("Sunday +$i days")); $script = ''; @@ -171,7 +171,7 @@ JOIN gibbonTT ON (gibbonTTDay.gibbonTTID=gibbonTT.gibbonTTID) WHERE gibbonTT.gibbonSchoolYearID=:gibbonSchoolYearID ORDER BY gibbonTT.name, gibbonTTDay.name"; - $table = $form->addRow()->addTable()->setClass('fullWidth smallIntBorder'); + $table = $form->addRow()->addTable()->setClass('w-full smallIntBorder'); $row = $table->addRow(); $row->addLabel('gibbonTTDayID', __('Day')); $row->addSelect('gibbonTTDayID')->fromQuery($pdo, $sql, $data)->addClass('mediumWidth'); diff --git a/modules/Timetable Admin/tt_edit.php b/modules/Timetable Admin/tt_edit.php index 2bf09a3c37..3b8ef18c87 100644 --- a/modules/Timetable Admin/tt_edit.php +++ b/modules/Timetable Admin/tt_edit.php @@ -135,8 +135,7 @@ ->setURL('/modules/Timetable Admin/tt_edit_byClass.php') ->addParam('gibbonSchoolYearID', $gibbonSchoolYearID) ->addParam('gibbonTTID', $gibbonTTID) - ->displayLabel() - ->append('  |  '); + ->displayLabel(); $table->addHeaderAction('add', __('Add')) ->setURL('/modules/Timetable Admin/tt_edit_day_add.php') diff --git a/modules/Timetable Admin/tt_edit_day_edit_class.php b/modules/Timetable Admin/tt_edit_day_edit_class.php index 03286be7e9..f1c8a4b6bd 100644 --- a/modules/Timetable Admin/tt_edit_day_edit_class.php +++ b/modules/Timetable Admin/tt_edit_day_edit_class.php @@ -96,7 +96,7 @@ ->setURL('/modules/Timetable Admin/tt_edit_day_edit_class_delete.php'); $actions->addAction('exceptions', __('Exceptions')) - ->setIcon('attendance') + ->setIcon('user-minus') ->setURL('/modules/Timetable Admin/tt_edit_day_edit_class_exception.php'); }); diff --git a/modules/Timetable/moduleFunctions.php b/modules/Timetable/moduleFunctions.php index ed224adbf1..391562aaeb 100644 --- a/modules/Timetable/moduleFunctions.php +++ b/modules/Timetable/moduleFunctions.php @@ -490,60 +490,6 @@ function renderTT($guid, $connection2, $gibbonPersonID, $gibbonTTID, $title = '' $gibbonTTID = $row['gibbonTTID']; $nameShortDisplay = $row['nameShortDisplay']; //Store day short name display setting for later - if ($title != false) { - $output .= '

'.$row['name'].'

'; - } - - $urlParams = [ - 'q' => $q, - 'gibbonPersonID' => $gibbonPersonID, - 'gibbonTTID' => $row['gibbonTTID'], - 'schoolCalendar' => $session->get('viewCalendarSchool'), - 'personalCalendar' => $session->get('viewCalendarPersonal'), - 'spaceBookingCalendar' => $session->get('viewCalendarSpaceBooking'), - 'narrow' => $narrow, - 'fromTT' => 'Y', - ]; - - $apiEndpoint = Url::fromHandlerRoute('index_tt_ajax.php')->withQueryParams($urlParams); - - $output .= "
"; - - $output .= "
"; - - $output .= "'; - - $output .= '
'; //Check which days are school days $daysInWeek = 0; @@ -600,6 +546,77 @@ function renderTT($guid, $connection2, $gibbonPersonID, $gibbonTTID, $title = '' //Count forward to the end of the week $endDayStamp = $startDayStamp + (86400 * ($daysInWeek - 1)); + + if ($title != false) { + $output .= '

'.$row['name'].'

'; + } + + $urlParams = [ + 'q' => $q, + 'gibbonPersonID' => $gibbonPersonID, + 'gibbonTTID' => $row['gibbonTTID'], + 'schoolCalendar' => $session->get('viewCalendarSchool'), + 'personalCalendar' => $session->get('viewCalendarPersonal'), + 'spaceBookingCalendar' => $session->get('viewCalendarSpaceBooking'), + 'narrow' => $narrow, + 'fromTT' => 'Y', + ]; + + $apiEndpoint = Url::fromHandlerRoute('index_tt_ajax.php')->withQueryParams($urlParams); + + $output .= "
"; + + $output .= "
"; + + $output .= "'; + + $output .= '
'; + + + $schoolCalendarAlpha = 0.85; $ttAlpha = 1.0; @@ -1032,14 +1049,14 @@ function renderTT($guid, $connection2, $gibbonPersonID, $gibbonTTID, $title = '' $output .= "
"; $countTime = 0; $time = $timeStart; - $output .= "
"; + $output .= "
"; $output .= substr($time, 0, 5).'
'; $output .= '
'; $time = date('H:i:s', strtotime($time) + 3600); $spinControl = 0; while ($time <= $timeEnd and $spinControl < (23 - substr($timeStart, 0, 2))) { ++$countTime; - $output .= "
"; + $output .= "
"; $output .= substr($time, 0, 5).'
'; $output .= '
'; $time = date('H:i:s', strtotime($time) + 3600); @@ -1123,12 +1140,12 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta { global $session; - $schoolCalendarAlpha = 0.90; + $schoolCalendarAlpha = 1.0; $ttAlpha = 1.0; - if ($session->get('viewCalendarSchool') != 'N' or $session->get('viewCalendarPersonal') != 'N' or $session->get('viewCalendarSpaceBooking') != 'N') { - $ttAlpha = 0.75; - } + // if ($session->get('viewCalendarSchool') != 'N' or $session->get('viewCalendarPersonal') != 'N' or $session->get('viewCalendarSpaceBooking') != 'N') { + // $ttAlpha = 0.75; + // } $date = date('Y-m-d', ($startDayStamp + (86400 * $count))); @@ -1181,7 +1198,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta if ($schoolOpen == false || $offTimetable == true) { $output .= "
"; $output .= "
"; - $output .= "
"; + $output .= "
"; $output .= "
"; $output .= $offTimetable ? __('School Day').'

'.__('Off Timetable') : __('School Closed'); $output .= '

'.($specialDay['name'] ?? ''); @@ -1206,7 +1223,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta } $height = 30; $top = (($maxAllDays * -31) - 8 + ($allDay * 30)).'px'; - $output .= "
"; + $output .= "
"; $output .= "".$label.''; $output .= '
'; ++$allDay; @@ -1223,7 +1240,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $title = "title='".$event[0].' ('.date('H:i', $event[2]).' to '.date('H:i', $event[3]).")'"; } $top = (ceil(($event[2] - strtotime(date('Y-m-d', $startDayStamp + (86400 * $count)).' '.$gridTimeStart)) / 60 )).'px'; - $output .= "
"; + $output .= "
"; $output .= "".$label.''; $output .= '
'; } @@ -1236,7 +1253,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta if ($eventsPersonal != false) { $height = 0; $top = 0; - $bg = "rgba(103,153,207,$schoolCalendarAlpha)"; + $bg = "rgba(103,153,207,0.9)"; foreach ($eventsPersonal as $event) { if (date('Y-m-d', $event[2]) == date('Y-m-d', ($startDayStamp + (86400 * $count)))) { if ($event[1] == 'All Day') { @@ -1248,7 +1265,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta } $height = 30; $top = (($maxAllDays * -31) - 8 + ($allDay * 30)).'px'; - $output .= "
"; + $output .= "
"; $output .= !empty($event[5]) ? "".$label.'' : $label; @@ -1267,7 +1284,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $title = "title='".htmlPrep($event[0]).' ('.date('H:i', $event[2]).' to '.date('H:i', $event[3]).")'"; } $top = (ceil(($event[2] - strtotime(date('Y-m-d', $startDayStamp + (86400 * $count)).' '.$gridTimeStart)) / 60 )).'px'; - $output .= "
"; + $output .= "
"; $output .= !empty($event[5]) ? "".$label.'' : $label; @@ -1304,7 +1321,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $label .= '
'.Format::small(Format::truncate($event[7], 60)); } - $output .= "
"; + $output .= "
"; $output .= $label; $output .= '
'; ++$zCount; @@ -1420,7 +1437,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $class = 'ttPeriodCurrent bg-green-100'; } - $output .= "
"; + $output .= "
"; if ($height > 15 and $height < 30) { $output .= $rowPeriods['name'].'
'; } elseif ($height >= 30) { @@ -1592,7 +1609,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta if ($resultTeacher->rowCount() > 0) { $teachers = $resultTeacher->fetchAll(); - $title .= __('Teacher').': '.Format::nameList($teachers, 'Staff', false, false, ', ').'
' ; + $title .= __('Teacher').': '.Format::nameList($teachers, 'Staff', false, false, ', ')."
" ; } } @@ -1621,7 +1638,6 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta } } } - $title = substr($title, 0, -3); $title .= "'"; $class2 = 'ttPeriod'; $bg = ''; @@ -1646,7 +1662,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta if ($height < 60) { $fontSize = '85%'; } - $output .= "
"; + $output .= "
"; if ($height >= 45) { if ($isCovering) { $output .= ''.__('Covering').' '.$rowPeriods['nameShort'].'
'; @@ -1704,7 +1720,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta //Add planner link icons for staff looking at own TT. if ($self == true and $roleCategory == 'Staff') { if ($height >= 30) { - $output .= "
"; + $output .= "
"; //Check for lesson plan $bgImg = 'none'; @@ -1719,11 +1735,17 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta if ($resultPlan->rowCount() == 1) { $rowPlan = $resultPlan->fetch(); - $output .= " htmlPrep($rowPlan['name'])])."' src='".$session->get('absoluteURL').'/themes/'.$session->get('gibbonThemeName')."/img/iconTick.png'/>"; + $output .= " htmlPrep($rowPlan['name'])])."' href='".$session->get('absoluteURL').'/index.php?q=/modules/Planner/planner_view_full.php&viewBy=class&gibbonCourseClassID='.$rowPeriods['gibbonCourseClassID'].'&gibbonPlannerEntryID='.$rowPlan['gibbonPlannerEntryID']."'>"; + $output .= icon('solid', 'check', 'size-7 text-blue-500 hover:text-blue-800'); + $output .= ''; } elseif ($resultPlan->rowCount() == 0) { - $output .= "".__(get('gibbonThemeName')."/img/page_new.png' title='".__('Add lesson plan')."'/>"; + $output .= ""; + $output .= icon('solid', 'add', 'size-7 text-gray-600 hover:text-gray-800'); + $output .= ''; } else { - $output .= "
".__('Multiple').'
'; + $output .= ""; + $output .= icon('solid', 'add-multi', 'size-7 text-gray-600 hover:text-gray-800'); + $output .= ''; } } $output .= '
'; @@ -1733,7 +1755,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta } //Add planner link icons for any one else's TT else { - $output .= "
"; + $output .= "
"; //Check for lesson plan $bgImg = 'none'; @@ -1747,7 +1769,9 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta } if ($resultPlan->rowCount() == 1) { $rowPlan = $resultPlan->fetch(); - $output .= "get('gibbonThemeName')."/img/plus.png'/>"; + $output .= ""; + $output .= icon('solid', 'zoom', 'size-7 text-gray-600 hover:text-gray-800'); + $output .=""; } elseif ($resultPlan->rowCount() > 1) { $output .= "
".__('Multiple').'
'; } @@ -1758,12 +1782,14 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta } //Show exception editing elseif ($edit) { - $output .= "
"; + $output .= "'; ++$zCount; @@ -1801,7 +1827,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $bg = 'background: #dfcbf6 !important;'; } $top = (ceil(($event[2] - strtotime(date('Y-m-d', $startDayStamp + (86400 * $count)).' '.$gridTimeStart)) / 60 )).'px'; - $output .= "
"; + $output .= "
"; if ($height >= 26) { $output .= __('Activity').'
'; } @@ -1847,7 +1873,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $bg = 'background: #FDE68A !important;'; $top = (ceil(($event[2] - strtotime(date('Y-m-d', $startDayStamp + (86400 * $count)).' '.$gridTimeStart)) / 60 )).'px'; - $output .= "
"; + $output .= "
"; if ($height >= 26) { $output .= __('Staff Duty').'
'; } @@ -1882,7 +1908,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta } $height = 30; $top = (($maxAllDays * -31) - 8 + ($allDay * 30)).'px'; - $output .= "
"; + $output .= "
"; $output .= "".$label.''; $output .= '
'; ++$allDay; @@ -1899,7 +1925,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $title = "title='".htmlPrep($event[0]).' ('.date('H:i', $event[2]).' to '.date('H:i', $event[3]).")'"; } $top = (ceil(($event[2] - strtotime(date('Y-m-d', $startDayStamp + (86400 * $count)).' '.$gridTimeStart)) / 60 )).'px'; - $output .= "
"; + $output .= "
"; $output .= "".$label.''; $output .= '
'; } @@ -1926,7 +1952,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta } $height = 30; $top = (($maxAllDays * -31) - 8 + ($allDay * 30)).'px'; - $output .= "
"; + $output .= "
"; $output .= !empty($event[5]) ? "".$label.'' : $label; @@ -1945,7 +1971,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $title = "title='".htmlPrep($event[0]).' ('.date('H:i', $event[2]).' to '.date('H:i', $event[3]).")'"; } $top = (ceil(($event[2] - strtotime(date('Y-m-d', $startDayStamp + (86400 * $count)).' '.$gridTimeStart)) / 60 )).'px'; - $output .= "
"; + $output .= "
"; $output .= !empty($event[5]) ? "".$label.'' : $label; @@ -1983,7 +2009,7 @@ function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDaySta $label .= '
'.Format::small(Format::truncate($event[7], 60)); } - $output .= "
"; + $output .= "
"; $output .= $label; $output .= '
'; ++$zCount; @@ -2115,15 +2141,23 @@ function renderTTSpace($guid, $connection2, $gibbonSpaceID, $gibbonTTID, $title // $output .= ""; $output .= "
"; - $output .= ""; - $output .= ""; - $output .= ""; - $output .= "
"; - - $output .= " "; + $output .= ""; + + $output .= ""; + + $output .= ""; + + $output .= ''; + $output .= "
"; + + $output .= " "; $output .= ''; $output .= ''; @@ -2301,7 +2335,7 @@ function renderTTSpace($guid, $connection2, $gibbonSpaceID, $gibbonTTID, $title if ($session->get('viewCalendarSpaceBooking') == 'Y') { $checked = 'checked'; } - $output .= "".__('Bookings').' '; + $output .= "".__('Bookings').' '; $output .= ""; @@ -2457,7 +2491,7 @@ function renderTTSpace($guid, $connection2, $gibbonSpaceID, $gibbonTTID, $title if ($rowClosure['type'] == 'School Closure') { $dayOut .= "
"; $dayOut .= "
"; - $dayOut .= "
"; + $dayOut .= "
"; $dayOut .= "
"; $dayOut .= ''.$rowClosure['type'].'

'.$rowClosure['name'].'
'; $dayOut .= '
'; @@ -2477,7 +2511,7 @@ function renderTTSpace($guid, $connection2, $gibbonSpaceID, $gibbonTTID, $title if ($dayOut == '') { $dayOut .= "
"; $dayOut .= "
"; - $dayOut .= "
"; + $dayOut .= "
"; $dayOut .= "
"; $dayOut .= "".__('School Closed').''; $dayOut .= '
'; @@ -2632,7 +2666,7 @@ function renderTTSpaceDay($guid, $connection2, $gibbonTTID, $startDayStamp, $cou $class = 'ttPeriodCurrent'; } - $output .= "
"; + $output .= "
"; if ($height > 15 and $height < 30) { $output .= $rowPeriods['name'].'
'; } elseif ($height >= 30) { @@ -2646,7 +2680,9 @@ function ($event) use ($date, $effectiveStart, $effectiveEnd) { }); if (empty($overlappingBookings)) { - $output .= "get('gibbonThemeName')."/img/page_new.png' width=20 height=20/>"; + $output .= ""; + $output .= icon('solid', 'add', 'size-6 text-gray-600 hover:text-gray-800'); + $output .= ""; } } } @@ -2756,7 +2792,6 @@ function ($event) use ($date, $effectiveStart, $effectiveEnd) { } } - $title = substr($title, 0, -3); $title .= "'"; $class2 = 'ttPeriod'; $bg = ''; @@ -2771,7 +2806,7 @@ function ($event) use ($date, $effectiveStart, $effectiveEnd) { } //Create div to represent period - $output .= "
"; + $output .= "'; @@ -2858,7 +2899,7 @@ function ($event) use ($date, $effectiveStart, $effectiveEnd) { $bg = 'background: #dfcbf6 !important;'; } $top = (ceil(($event[2] - strtotime(date('Y-m-d', $startDayStamp + (86400 * $count)).' '.$gridTimeStart)) / 60 )).'px'; - $output .= "
"; + $output .= "
"; if ($height >= 26) { $output .= __('Activity').'
'; } @@ -2909,7 +2950,7 @@ function ($event) use ($date, $effectiveStart, $effectiveEnd) { if ($height > 56) { $label .= '
'.Format::small(Format::truncate($event[7], 60)); } - $output .= "
"; + $output .= "
"; $output .= $label; $output .= '
'; ++$zCount; diff --git a/modules/Timetable/spaceBooking_manage_add.php b/modules/Timetable/spaceBooking_manage_add.php index 2a44c60485..9fdab2a4c6 100644 --- a/modules/Timetable/spaceBooking_manage_add.php +++ b/modules/Timetable/spaceBooking_manage_add.php @@ -206,6 +206,7 @@ if ($repeat == 'No') { $gibbonCourseClassID = null; + $offTimetable = false; $available = isSpaceFree($guid, $connection2, $foreignKey, $foreignKeyID, $date, $timeStart, $timeEnd, $gibbonCourseClassID); if (!$available && !empty($gibbonCourseClassID)) { diff --git a/modules/Timetable/tt.php b/modules/Timetable/tt.php index 4bcab8adcd..67c7c24759 100644 --- a/modules/Timetable/tt.php +++ b/modules/Timetable/tt.php @@ -60,7 +60,7 @@ $form = Form::create('ttView', $session->get('absoluteURL').'/index.php', 'get'); - $form->setClass('noIntBorder fullWidth'); + $form->setClass('noIntBorder w-full'); $form->setTitle(__('Search')); $form->addHiddenValue('q', '/modules/'.$session->get('module').'/tt.php'); diff --git a/modules/Timetable/tt_manage_subscription.php b/modules/Timetable/tt_manage_subscription.php index 4222a602a1..b3cf1386af 100644 --- a/modules/Timetable/tt_manage_subscription.php +++ b/modules/Timetable/tt_manage_subscription.php @@ -50,7 +50,7 @@ } ?> - {% endif %}
diff --git a/resources/templates/components/form.twig.html b/resources/templates/components/form.twig.html index 5f4117e949..5e5900c49f 100644 --- a/resources/templates/components/form.twig.html +++ b/resources/templates/components/form.twig.html @@ -8,8 +8,18 @@ For info about editing, see: https://twig.symfony.com/doc/2.x/ -->#} -{% if form.getAction != 'ajax' %} -
+{% set standardLayout = "noIntBorder" not in form.getClass and "blank" not in form.getClass %} +{% set useSections = "noIntBorder" not in form.getClass %} + +{% if quickSave and form.getAction %} + + +
+
{{ __('Saving') }} ...
+
+
+{% elseif form.getAction != 'ajax' %} + {% endif %} {% if form.hasPages %} @@ -41,10 +51,10 @@

{{ form.getTitle }}

{% endif %} {% block header %} -
+
{% if form.getHeader %}

{{ form.getTitle }}

-
+
{% for action in form.getHeader %} {{ action.getOutput|raw }} {% endfor %} @@ -57,86 +67,145 @@

{{ form.getTitle }}

{% endfor %} - {% set renderStyle = "standardForm" in form.getClass or "noIntBorder" in form.getClass and "blank" not in form.getClass ? 'flex' : 'table' %} - {% if form.getRows|length > 0 %} -
+
+ +
{% for section, rows in form.getRowsByHeading %} {% set sectionLoop = loop %} + {% if useSections %} +
+ {% endif %} + {% for num, row in rows %} {% set rowLoop = loop %} - {% if true or renderStyle == 'flex' %} - {% set rowClass = 'flex flex-col sm:flex-row justify-between sm:items-center content-center p-0' %} - {% endif %} - - {% set firstElement = (row.getElements|first) %} - {% if firstElement.isInstanceOf('Gibbon\\Forms\\Layout\\Heading') and firstElement.getTag == 'h3' %} - {% set rowClass = "blank" not in form.getClass ? rowClass ~ ' bg-gray-300' : rowClass ~ ' my-2' %} - {% endif %} + {% set rowClass = 'flex flex-col sm:flex-row justify-between content-center p-0 gap-2 sm:gap-4' %} + {% set rowClass = section == 'submit' ? rowClass ~ ' sm:items-center' : rowClass ~ ' sm:items-start' %} -
+
+ + {% if quickSave and section == 'submit' %} + + {{ __('Press {shortcut} to {action}', {shortcut: '⌘ Cmd + S', action: __('quick save')} )|raw }} + + {% endif %} {% if "draggableRow" in row.getClass %} -
+
{% endif %} {% for element in row.getElements %} - {% set colspan = loop.last and loop.length < totalColumns ? (totalColumns + 1 - loop.length) : 0 %} {% if element.isInstanceOf('Gibbon\\Forms\\Layout\\Heading') %} {% set class = 'flex-grow justify-center' %} {% elseif element.isInstanceOf('Gibbon\\Forms\\Layout\\Label') %} - {% set class = 'flex flex-col flex-grow justify-center -mb-1 sm:mb-0' %} + {% set class = 'sm:w-2/5 flex flex-col justify-center sm:mb-0' %} {% elseif element.isInstanceOf('Gibbon\\Forms\\Layout\\Column') %} - {% set class = loop.last and loop.length == 2 ? 'w-full max-w-full sm:max-w-sm flex justify-end' : 'w-full ' %} - {% elseif loop.last and loop.length == 2 and renderStyle == 'flex' %} - {% set class = 'w-full max-w-full sm:max-w-sm flex justify-end items-center' %} + {% set class = loop.last and loop.length == 2 ? 'flex-1 relative flex justify-end items-center' : '' %} + {% elseif loop.last and (loop.length == 2 or "noIntBorder" in form.getClass) %} + {% set class = 'flex-1 relative flex justify-end items-center' %} {% else %} - {% set class = loop.last and loop.length > 2 ? '' : 'flex-1' %} - {% endif %} - - {% if renderStyle == 'table' and element.isInstanceOf('Gibbon\\Forms\\Layout\\Label') %} - {% set class = class ~ " lg:w-2/5" %} - {% endif %} - - {% if "standardForm" in form.getClass %} - {% set class = class ~ " px-4 py-4" %} - {% elseif "blank" not in form.getClass %} - {% set class = class ~ " px-3 py-2" %} + {% set class = '' %} {% endif %} {% set hasClass = element.instanceOf('Gibbon\\Forms\\Layout\\Element') or element.instanceOf('Gibbon\\Forms\\Layout\\Row') %} -
- {{ element.getOutput|replace({'standardWidth': renderStyle == 'flex' ? 'w-full' : '' })|raw }} + {% set class = hasClass ? class ~ ' ' ~ element.getClass : class %} +
+ + {% if standardLayout and element.getAttribute('id') == 'Submit' %} + {{ __('Unsaved Changes') }} - {% if element.instanceOf('Gibbon\\Forms\\ValidatableInterface') %} - + {{ __('Incorrect or missing information') }} {% endif %} + + {{ element.getOutput|raw }}
{% endfor %}
{% endfor %} + + {% if useSections %} +
+ {% endif %} + {% endfor %} -
+
+ + {% if form.hasMeta and form.getMeta.getElementCount > 0 %} + + {% endif %} + +
{% endif %} {% if postScript %} -

{{ postScript|raw }}

+

{{ postScript|raw }}

{% endif %} -{% if form.getAction %} +{% if form.getAction != 'ajax' %} {% endif %} diff --git a/resources/templates/components/formBlank.twig.html b/resources/templates/components/formBlank.twig.html new file mode 100644 index 0000000000..727a41a145 --- /dev/null +++ b/resources/templates/components/formBlank.twig.html @@ -0,0 +1,73 @@ +{##} + +
+ + {% if form.getTitle and not form.getHeader %} +

{{ form.getTitle }}

+ {% endif %} + + {% if form.getDescription %} +

{{ form.getDescription|raw }}

+ {% endif %} + + {% block header %} +
+ {% if form.getHeader %} +

{{ form.getTitle }}

+
+ {% for action in form.getHeader %} + {{ action.getOutput|raw }} + {% endfor %} +
+ {% endif %} +
+ {% endblock header %} + + {% for values in form.getHiddenValues %} + + {% endfor %} + + {% if form.getRows|length > 0 %} +
+ + {% for num, row in form.getRows %} + + {% set rowLoop = loop %} + +
+ + {% for element in row.getElements %} + + {% set hasClass = element.instanceOf('Gibbon\\Forms\\Layout\\Element') or element.instanceOf('Gibbon\\Forms\\Layout\\Row') %} +
+ {{ element.getOutput|raw }} + + {% if element.instanceOf('Gibbon\\Forms\\ValidatableInterface') %} + + {% endif %} +
+ {% endfor %} + +
+ {% endfor %} + +
+ {% endif %} + + + +
diff --git a/resources/templates/components/formSearch.twig.html b/resources/templates/components/formSearch.twig.html new file mode 100644 index 0000000000..f60370073a --- /dev/null +++ b/resources/templates/components/formSearch.twig.html @@ -0,0 +1,83 @@ +{##} + +
+ + {% if form.getTitle and not form.getHeader %} +

{{ form.getTitle }}

+ {% endif %} + + {% if form.getDescription %} +

{{ form.getDescription|raw }}

+ {% endif %} + + {% block header %} +
+ {% if form.getHeader %} +

{{ form.getTitle }}

+
+ {% for action in form.getHeader %} + {{ action.getOutput|raw }} + {% endfor %} +
+ {% endif %} +
+ {% endblock header %} + + {% for values in form.getHiddenValues %} + + {% endfor %} + + {% if form.getRows|length > 0 %} +
+ + {% for num, row in form.getRows %} + + {% set rowLoop = loop %} + {% set rowClass = 'flex flex-col sm:flex-row justify-between content-center p-0 gap-2 sm:gap-6 sm:py-2' %} + +
+ + {% for element in row.getElements %} + + {% if element.isInstanceOf('Gibbon\\Forms\\Layout\\Label') %} + {% set class = 'sm:w-2/5 flex flex-col justify-center sm:mb-0 text-xs ' %} + {% elseif loop.last %} + {% set class = 'flex-1 relative flex justify-end items-center' %} + {% else %} + {% set class = '' %} + {% endif %} + + {% set class = class ~ ' ' ~ element.getAttribute('class') %} + +
+ {{ element.getOutput|raw }} + + {% if element.instanceOf('Gibbon\\Forms\\ValidatableInterface') %} + + {% endif %} +
+ {% endfor %} + +
+ {% endfor %} + +
+ {% endif %} + + + +
diff --git a/resources/templates/components/formTable.twig.html b/resources/templates/components/formTable.twig.html index 6a0b918a62..f514376230 100644 --- a/resources/templates/components/formTable.twig.html +++ b/resources/templates/components/formTable.twig.html @@ -10,7 +10,7 @@ {% do form.addClass('formTable')%} -
+ {% if form.getTitle %}

{{ form.getTitle }}

@@ -24,9 +24,7 @@

{{ form.getTitle }}

{% endfor %} - {% set renderStyle = "blank" not in form.getClass ? 'blank' : 'table' %} - - +
{% for row in form.getRows %} {% set rowLoop = loop %} @@ -40,6 +38,8 @@

{{ form.getTitle }}

{% set class = ' bg-gray-300' %} {% elseif element.isInstanceOf('Gibbon\\Forms\\Layout\\Label') %} {% set class = '-mb-1 sm:mb-0' %} + {% elseif loop.last and loop.length == 1 %} + {% set class = 'flex-1 relative flex justify-end items-center' %} {% endif %}
diff --git a/resources/templates/components/gridTable.twig.html b/resources/templates/components/gridTable.twig.html index c6c7595430..802942481c 100644 --- a/resources/templates/components/gridTable.twig.html +++ b/resources/templates/components/gridTable.twig.html @@ -25,11 +25,12 @@ {% else %} -
-
- {{ gridHeader|raw }} -
+
+ {{ gridHeader|raw }} +
+
+ {% for rowIndex, rowData in rows %} {{ rowData.row.getPrepended|raw }} @@ -53,12 +54,14 @@ {% endfor %} -
- {{ gridFooter|raw }} -
+
{% endif %} +
+ {{ gridFooter|raw }} +
+ {{ block("footer") }}
diff --git a/resources/templates/components/paginatedTable.twig.html b/resources/templates/components/paginatedTable.twig.html index 02c78f3c7f..2f1030acfc 100644 --- a/resources/templates/components/paginatedTable.twig.html +++ b/resources/templates/components/paginatedTable.twig.html @@ -41,22 +41,22 @@ {% if dataSet.getTotalCount > 0 and not hidePagination %}
- {% if pageSize %} -
+ {% if pageSize and dataSet.getResultCount > 20 %} +
{{ pageSize|raw }}
{% endif %} {% if filterOptions %} -
+
{{ filterOptions|raw }}
{% endif %} {% if filterCriteria and filterOptions %} - {% endif %} {% endblock pagination %} @@ -141,7 +160,7 @@ {% block bulkActions %} {% if bulkActions %} -
'; } if ($grades == false) { - $gradesOutput .= "
"; - $gradesOutput .= __('There are no records to display.'); - $gradesOutput .= '
'; + $gradesOutput .= Format::alert(__('There are no records to display.'), 'empty'); } } @@ -739,104 +655,66 @@ protected function renderChildDashboard($gibbonPersonID, $dateStart) } } - // GET HOOKS INTO DASHBOARD + // TABS + $tabs = []; + + if (!empty($plannerOutput) || !empty($gradesOutput) || !empty($deadlinesOutput)) { + $tabs['Planner'] = [ + 'label' => __('Planner'), + 'content' => $plannerOutput.$gradesOutput.$deadlinesOutput, + 'icon' => 'book-open', + ]; + } + + if (!empty($timetableOutput)) { + $tabs['Timetable'] = [ + 'label' => __('Timetable'), + 'content' => $timetableOutput, + 'icon' => 'calendar', + ]; + } + + if (!empty($activitiesOutput)) { + $tabs['Activities'] = [ + 'label' => __('Activities'), + 'content' => $activitiesOutput, + 'icon' => 'star', + ]; + } + + // Dashboard Hooks $hooks = $this->getContainer()->get(HookGateway::class)->getAccessibleHooksByType('Parental Dashboard', $this->session->get('gibbonRoleIDCurrent')); + foreach ($hooks as $hookData) { - if ($classes == false and $grades == false and $deadlines == false and $timetable == false and $activities == false and count($hooks) < 1) { - $return .= "
"; - $return .= __('There are no records to display.'); - $return .= '
'; - } else { - $parentDashboardDefaultTab = $this->settingGateway->getSettingByScope('School Admin', 'parentDashboardDefaultTab'); - $parentDashboardDefaultTabCount = null; + // Set the module for this hook for translations + $this->session->set('module', $hookData['sourceModuleName']); + $include = $this->session->get('absolutePath').'/modules/'.$hookData['sourceModuleName'].'/'.$hookData['sourceModuleInclude']; - $return .= "
"; - $return .= '
    '; - $tabCountExtraReset = 0; - if ($classes != false or $grades != false or $deadlines != false) { - $return .= "
  • ".__('Learning').'
  • '; - $tabCountExtraReset++; - if ($parentDashboardDefaultTab == 'Planner') - $parentDashboardDefaultTabCount = $tabCountExtraReset; - } - if ($timetable != false) { - $return .= "
  • ".__('Timetable').'
  • '; - $tabCountExtraReset++; - if ($parentDashboardDefaultTab == 'Timetable') - $parentDashboardDefaultTabCount = $tabCountExtraReset; - } - if ($activities != false) { - $return .= "
  • ".__('Activities').'
  • '; - $tabCountExtraReset++; - if ($parentDashboardDefaultTab == 'Activities') - $parentDashboardDefaultTabCount = $tabCountExtraReset; - } - $tabCountExtra = $tabCountExtraReset; - foreach ($hooks as $hook) { - ++$tabCountExtra; - $return .= "
  • ".__($hook['name'], [], $hook['sourceModuleName']).'
  • '; + if (!file_exists($include)) { + $hookOutput = Format::alert(__('The selected page cannot be displayed due to a hook error.'), 'error'); + } else { + $hookOutput = include $include; } - $return .= '
'; - $tabCountExtraReset = 0; - if ($classes != false or $grades != false or $deadlines != false) { - $return .= "
"; - $return .= $plannerOutput; - $return .= $gradesOutput; - $return .= $deadlinesOutput; - $return .= '
'; - $tabCountExtraReset++; - } - if ($timetable != false) { - $return .= "
"; - $return .= $timetableOutput; - $return .= '
'; - $tabCountExtraReset++; - } - if ($activities != false) { - $return .= "
"; - $return .= $activitiesOutput; - $return .= '
'; - $tabCountExtraReset++; - } - $tabCountExtra = $tabCountExtraReset; - foreach ($hooks as $hook) { - // Set the module for this hook for translations - $this->session->set('module', $hook['sourceModuleName']); - - if ($parentDashboardDefaultTab == $hook['name']) - $parentDashboardDefaultTabCount = $tabCountExtra+1; - ++$tabCountExtra; - $return .= "
"; - $include = $this->session->get('absolutePath').'/modules/'.$hook['sourceModuleName'].'/'.$hook['sourceModuleInclude']; - if (!file_exists($include)) { - $return .= "
"; - $return .= __('The selected page cannot be displayed due to a hook error.'); - $return .= '
'; - } else { - $return .= include $include; - } - $return .= '
'; - } - $return .= '
'; + $tabs[$hookData['name']] = [ + 'label' => __($hookData['name'], [], $hookData['sourceModuleName']), + 'content' => $hookOutput, + 'icon' => $hookData['name'], + ]; } - $defaultTab = preg_replace('/[^0-9]/', '', $_GET['tab'] ?? 0); - - if (!isset($_GET['tab']) && !empty($parentDashboardDefaultTabCount)) { - $defaultTab = $parentDashboardDefaultTabCount-1; - } - $return .= "'; + // Set the default tab + $parentDashboardDefaultTab = $this->settingGateway->getSettingByScope('School Admin', 'parentDashboardDefaultTab'); + $defaultTab = !isset($_GET['tab']) && !empty($parentDashboardDefaultTab) + ? array_search($parentDashboardDefaultTab, array_keys($tabs))+1 + : preg_replace('/[^0-9]/', '', $_GET['tab'] ?? 1); + + $return .= $this->view->fetchFromTemplate('ui/tabs.twig.html', [ + 'selected' => $defaultTab ?? 1, + 'tabs' => $tabs, + 'outset' => false, + 'icons' => true, + ]); return $return; } diff --git a/src/UI/Dashboard/StaffDashboard.php b/src/UI/Dashboard/StaffDashboard.php index 62c8a98e4c..e41a4def94 100644 --- a/src/UI/Dashboard/StaffDashboard.php +++ b/src/UI/Dashboard/StaffDashboard.php @@ -22,6 +22,7 @@ namespace Gibbon\UI\Dashboard; use Gibbon\Http\Url; +use Gibbon\View\View; use Gibbon\Services\Format; use Gibbon\Data\Validator; use Gibbon\Forms\OutputableInterface; @@ -33,6 +34,8 @@ use League\Container\ContainerAwareTrait; use League\Container\ContainerAwareInterface; use Gibbon\Domain\System\HookGateway; +use Gibbon\Tables\Prefab\TodaysLessonsTable; +use Gibbon\Tables\Prefab\BehaviourTable; /** * Staff Dashboard View Composer @@ -69,18 +72,25 @@ class StaffDashboard implements OutputableInterface, ContainerAwareInterface */ private $settingGateway; + /** + * @var View + */ + private $view; + public function __construct( Connection $db, Session $session, FormGroupTable $formGroupTable, EnrolmentTable $enrolmentTable, - SettingGateway $settingGateway + SettingGateway $settingGateway, + View $view ) { $this->db = $db; $this->session = $session; $this->formGroupTable = $formGroupTable; $this->enrolmentTable = $enrolmentTable; $this->settingGateway = $settingGateway; + $this->view = $view; } public function getOutput() @@ -88,7 +98,7 @@ public function getOutput() $output = '

'. __('Staff Dashboard'). '

'. - "
"; + "
"; $dashboardContents = $this->renderDashboard(); @@ -113,142 +123,15 @@ protected function renderDashboard() $return = false; - $homeworkNameSingular = $this->settingGateway->getSettingByScope('Planner', 'homeworkNameSingular'); - - //GET PLANNER $planner = false; - $date = date('Y-m-d'); - try { - $data = array('gibbonSchoolYearID' => $this->session->get('gibbonSchoolYearID'), 'date' => $date, 'gibbonPersonID' => $this->session->get('gibbonPersonID'), 'gibbonSchoolYearID2' => $this->session->get('gibbonSchoolYearID'), 'date2' => $date, 'gibbonPersonID2' => $this->session->get('gibbonPersonID')); - $sql = "(SELECT gibbonCourseClass.gibbonCourseClassID, gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonPlannerEntry.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, gibbonPlannerEntry.timeStart, gibbonPlannerEntry.timeEnd, viewableStudents, viewableParents, homework, homeworkSubmission, homeworkCrowdAssess, role, date, summary, gibbonPlannerEntryStudentHomework.homeworkDueDateTime AS myHomeworkDueDateTime - FROM gibbonPlannerEntry - JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) - JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) - JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) - LEFT JOIN gibbonPlannerEntryStudentHomework ON (gibbonPlannerEntryStudentHomework.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID AND gibbonPlannerEntryStudentHomework.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) - - LEFT JOIN ( - SELECT gibbonTTDayRowClass.gibbonCourseClassID, gibbonTTDayRowClass.gibbonTTDayRowClassID, gibbonTTColumnRow.timeStart, gibbonTTColumnRow.timeEnd FROM gibbonTTDayDate JOIN gibbonTTDayRowClass ON (gibbonTTDayDate.gibbonTTDayID=gibbonTTDayRowClass.gibbonTTDayID) JOIN gibbonTTColumnRow ON (gibbonTTColumnRow.gibbonTTColumnRowID=gibbonTTDayRowClass.gibbonTTColumnRowID) WHERE gibbonTTDayDate.date=:date) - AS gibbonTTDayRowClassSubset ON (gibbonTTDayRowClassSubset.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID AND gibbonTTDayRowClassSubset.timeStart=gibbonPlannerEntry.timeStart AND gibbonTTDayRowClassSubset.timeEnd=gibbonPlannerEntry.timeEnd) - LEFT JOIN gibbonTTDayRowClassException ON (gibbonTTDayRowClassException.gibbonTTDayRowClassID=gibbonTTDayRowClassSubset.gibbonTTDayRowClassID AND gibbonTTDayRowClassException.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) - - WHERE gibbonSchoolYearID=:gibbonSchoolYearID AND date=:date AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' - GROUP BY gibbonPlannerEntry.gibbonPlannerEntryID, gibbonCourseClassPerson.gibbonCourseClassPersonID - HAVING COUNT(gibbonTTDayRowClassExceptionID) = 0 - - ) - UNION - (SELECT gibbonCourseClass.gibbonCourseClassID, gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonPlannerEntry.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, homeworkSubmission, homeworkCrowdAssess, role, date, summary, NULL AS myHomeworkDueDateTime - FROM gibbonPlannerEntry - JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) - JOIN gibbonPlannerEntryGuest ON (gibbonPlannerEntryGuest.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID) - JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) - WHERE gibbonSchoolYearID=:gibbonSchoolYearID2 AND date=:date2 AND gibbonPlannerEntryGuest.gibbonPersonID=:gibbonPersonID2 - ) - - ORDER BY date, timeStart, course, class"; - $result = $connection2->prepare($sql); - $result->execute($data); - } catch (\PDOException $e) { - } - $planner .= '

'; - $planner .= __("Today's Lessons"); - $planner .= '

'; - if ($result->rowCount() < 1) { - $planner .= "
"; - $planner .= __('There are no records to display.'); - $planner .= '
'; - } else { - $planner .= "
"; - $planner .= "".__('View Planner').''; - $planner .= '
'; - - $planner .= ""; - $planner .= ""; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - - $count = 0; - $rowNum = 'odd'; - while ($row = $result->fetch()) { - if (!($row['role'] == 'Student' and $row['viewableStudents'] == 'N')) { - if ($count % 2 == 0) { - $rowNum = 'even'; - } else { - $rowNum = 'odd'; - } - ++$count; - - //Highlight class in progress - if ((date('H:i:s') > $row['timeStart']) and (date('H:i:s') < $row['timeEnd']) and ($date) == date('Y-m-d')) { - $rowNum = 'current'; - } - - //COLOR ROW BY STATUS! - $planner .= ""; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - } - } - $planner .= '
'; - $planner .= __('Class').'
'; - $planner .= '
'; - $planner .= __('Lesson').'
'; - $planner .= "".__('Unit').''; - $planner .= '
'; - $planner .= __($homeworkNameSingular); - $planner .= ''; - $planner .= __('Summary'); - $planner .= ''; - $planner .= __('Action'); - $planner .= '
'; - $planner .= $row['course'].'.'.$row['class'].'
'; - $planner .= "".substr($row['timeStart'], 0, 5).'-'.substr($row['timeEnd'], 0, 5).''; - $planner .= '
'; - $planner .= ''.$row['name'].'
'; - $planner .= "
"; - $unit = getUnit($connection2, $row['gibbonUnitID'], $row['gibbonCourseClassID']); - if (isset($unit[0])) { - $planner .= $unit[0]; - if ($unit[1] != '') { - $planner .= '
'.$unit[1].' '.__('Unit').''; - } - } - $planner .= '
'; - $planner .= '
'; - if ($row['homework'] == 'N' and $row['myHomeworkDueDateTime'] == '') { - $planner .= __('No'); - } else { - if ($row['homework'] == 'Y') { - $planner .= __('Yes').': '.__('Teacher Recorded').'
'; - if ($row['homeworkSubmission'] == 'Y') { - $planner .= "+".__('Submission').'
'; - if ($row['homeworkCrowdAssess'] == 'Y') { - $planner .= "+".__('Crowd Assessment').'
'; - } - } - } - if ($row['myHomeworkDueDateTime'] != '') { - $planner .= __('Yes').': '.__('Student Recorded').'
'; - } - } - $planner .= '
'; - $planner .= Format::truncate($row['summary'], 360); - $planner .= ''; - $planner .= "withQueryParams([ - 'viewBy' => 'class', - 'gibbonCourseClassID' => $row['gibbonCourseClassID'], - 'gibbonPlannerEntryID' => $row['gibbonPlannerEntryID'], - ])."'>"; - $planner .= '
'; + + // PLANNER + if (isActionAccessible($guid, $connection2, '/modules/Planner/planner.php')) { + $planner = $this + ->getContainer() + ->get(TodaysLessonsTable::class) + ->create($session->get('gibbonSchoolYearID'), $this->session->get('gibbonPersonID'), 'Teacher') + ->getOutput(); } //GET TIMETABLE @@ -296,8 +179,7 @@ protected function renderDashboard() ->setURL('/modules/Attendance/attendance_take_byFormGroup.php') ->addParam('gibbonFormGroupID', $rowFormGroups['gibbonFormGroupID']) ->setIcon('attendance') - ->displayLabel() - ->append(' | '); + ->displayLabel(); } $formGroupTable->addHeaderAction('export', __('Export to Excel')) @@ -308,254 +190,84 @@ protected function renderDashboard() $formGroups[$count][2] = $formGroupTable->getOutput(); + // BEHAVIOUR $behaviourView = isActionAccessible($guid, $connection2, '/modules/Behaviour/behaviour_view.php'); if ($behaviourView) { - //Behaviour - $formGroups[$count][3] = ''; - $plural = 's'; - if ($resultFormGroups->rowCount() == 1) { - $plural = ''; - } - try { - $dataBehaviour = array('gibbonSchoolYearID' => $this->session->get('gibbonSchoolYearID'), 'gibbonSchoolYearID2' => $this->session->get('gibbonSchoolYearID'), 'gibbonFormGroupID' => $formGroups[$count][0]); - $sqlBehaviour = 'SELECT gibbonBehaviour.*, student.surname AS surnameStudent, student.preferredName AS preferredNameStudent, creator.surname AS surnameCreator, creator.preferredName AS preferredNameCreator, creator.title FROM gibbonBehaviour JOIN gibbonPerson AS student ON (gibbonBehaviour.gibbonPersonID=student.gibbonPersonID) JOIN gibbonStudentEnrolment ON (gibbonStudentEnrolment.gibbonPersonID=student.gibbonPersonID) JOIN gibbonPerson AS creator ON (gibbonBehaviour.gibbonPersonIDCreator=creator.gibbonPersonID) WHERE gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonBehaviour.gibbonSchoolYearID=:gibbonSchoolYearID2 AND gibbonFormGroupID=:gibbonFormGroupID ORDER BY timestamp DESC'; - $resultBehaviour = $connection2->prepare($sqlBehaviour); - $resultBehaviour->execute($dataBehaviour); - } catch (\PDOException $e) {} - - if (isActionAccessible($guid, $connection2, '/modules/Behaviour/behaviour_manage_add.php')) { - $formGroups[$count][3] .= "
"; - $formGroups[$count][3] .= "withQueryParams([ - 'gibbonPersonID' => '', - 'gibbonFormGroupID' => '', - 'gibbonYearGroupID' => '', - 'type' => '', - ]) . "'>".__('Add').""; - $policyLink = $this->settingGateway->getSettingByScope('Behaviour', 'policyLink'); - if ($policyLink != '') { - $formGroups[$count][3] .= " | ".__('View Behaviour Policy').''; - } - $formGroups[$count][3] .= '
'; - } - - if ($resultBehaviour->rowCount() < 1) { - $formGroups[$count][3] .= "
"; - $formGroups[$count][3] .= __('There are no records to display.'); - $formGroups[$count][3] .= '
'; - } else { - $formGroups[$count][3] .= ""; - $formGroups[$count][3] .= ""; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - - $count2 = 0; - $rowNum = 'odd'; - while ($rowBehaviour = $resultBehaviour->fetch()) { - if ($count2 % 2 == 0) { - $rowNum = 'even'; - } else { - $rowNum = 'odd'; - } - ++$count2; - - //COLOR ROW BY STATUS! - $formGroups[$count][3] .= ""; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= "'; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - if ($rowBehaviour['comment'] != '') { - if ($rowBehaviour['type'] == 'Positive') { - $bg = 'background-color: #D4F6DC;'; - } else { - $bg = 'background-color: #F6CECB;'; - } - $formGroups[$count][3] .= ""; - $formGroups[$count][3] .= "'; - $formGroups[$count][3] .= ''; - } - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= ''; - } - $formGroups[$count][3] .= '
'; - $formGroups[$count][3] .= __('Student & Date'); - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= __('Type'); - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= __('Descriptor'); - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= __('Level'); - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= __('Teacher'); - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= __('Action'); - $formGroups[$count][3] .= '
'; - $formGroups[$count][3] .= ''.Format::name('', $rowBehaviour['preferredNameStudent'], $rowBehaviour['surnameStudent'], 'Student', false).'
'; - if (substr($rowBehaviour['timestamp'], 0, 10) > $rowBehaviour['date']) { - $formGroups[$count][3] .= __('Date Updated').': '.Format::date(substr($rowBehaviour['timestamp'], 0, 10)).'
'; - $formGroups[$count][3] .= __('Incident Date').': '.Format::date($rowBehaviour['date']).'
'; - } else { - $formGroups[$count][3] .= Format::date($rowBehaviour['date']).'
'; - } - $formGroups[$count][3] .= '
"; - if ($rowBehaviour['type'] == 'Negative') { - $formGroups[$count][3] .= " "; - } elseif ($rowBehaviour['type'] == 'Positive') { - $formGroups[$count][3] .= " "; - } - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= trim($rowBehaviour['descriptor'] ?? ''); - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= trim($rowBehaviour['level'] ?? ''); - $formGroups[$count][3] .= ''; - $formGroups[$count][3] .= Format::name($rowBehaviour['title'], $rowBehaviour['preferredNameCreator'], $rowBehaviour['surnameCreator'], 'Staff', false).'
'; - $formGroups[$count][3] .= '
'; - $formGroups[$count][3] .= "'; - if ($rowBehaviour['comment'] != '') { - $formGroups[$count][3] .= "".__("; - } - $formGroups[$count][3] .= '
"; - $formGroups[$count][3] .= $rowBehaviour['comment']; - $formGroups[$count][3] .= '
'; - } + $table = $this->getContainer()->get(BehaviourTable::class)->create($this->session->get('gibbonSchoolYearID'), $formGroups[$count][0]); + $formGroups[$count][3] = $table->getOutput(); } ++$count; ++$formGroupCount; } - // GET HOOKS INTO DASHBOARD - $hooks = $this->getContainer()->get(HookGateway::class)->getAccessibleHooksByType('Staff Dashboard', $this->session->get('gibbonRoleIDCurrent')); + // TABS + $tabs = []; - if ($planner == false and $timetable == false and count($hooks) < 1) { - $return .= "
"; - $return .= __('There are no records to display.'); - $return .= '
'; - } else { - $staffDashboardDefaultTab = $this->settingGateway->getSettingByScope('School Admin', 'staffDashboardDefaultTab'); - $staffDashboardDefaultTabCount = null; - - $return .= "
"; - $return .= '
    '; - $tabCount = 1; - if ($planner != false or $timetable != false) { - $return .= "
  • ".__('Planner').'
  • '; - if ($staffDashboardDefaultTab == 'Planner') - $staffDashboardDefaultTabCount = $tabCount; - ++$tabCount; - } - if (count($formGroups) > 0) { - foreach ($formGroups as $formGroup) { - $return .= "
  • ".$formGroup[1].'
  • '; - ++$tabCount; - if ($behaviourView) { - $return .= "
  • ".$formGroup[1].' '.__('Behaviour').'
  • '; - ++$tabCount; - } - } - } + if (!empty($planner) || !empty($timetable)) { + $tabs['Planner'] = [ + 'label' => __('Planner'), + 'content' => $planner.$timetable, + 'icon' => 'book-open', + ]; + } - if (isActionAccessible($guid, $connection2, '/modules/Admissions/report_students_left.php') || isActionAccessible($guid, $connection2, '/modules/Admissions/report_students_new.php')) { - $return .= "
  • ".__('Enrolment').'
  • '; - if ($staffDashboardDefaultTab == 'Enrolment') { - $staffDashboardDefaultTabCount = $tabCount; - } - ++$tabCount; + if (count($formGroups) > 0) { + foreach ($formGroups as $index => $formGroup) { + $tabs['Form Group Info'.$index] = [ + 'label' => $formGroup[1], + 'content' => $formGroup[2], + 'icon' => 'user-group', + ]; + $tabs['Form Group Behaviour'.$index] = [ + 'label' => $formGroup[1].' '.__('Behaviour'), + 'content' => $formGroup[3], + 'icon' => 'chat-bubble-text', + ]; } + } - foreach ($hooks as $hook) { - $return .= "
  • ".__($hook['name'], [], $hook['sourceModuleName']).'
  • '; - if ($staffDashboardDefaultTab == $hook['name']) - $staffDashboardDefaultTabCount = $tabCount; - ++$tabCount; - } - $return .= '
'; - - $tabCount = 1; - if ($planner != false or $timetable != false) { - $return .= "
"; - $return .= $planner; - $return .= $timetable; - $return .= '
'; - ++$tabCount; - } + if (isActionAccessible($guid, $connection2, '/modules/Admissions/report_students_left.php') || isActionAccessible($guid, $connection2, '/modules/Admissions/report_students_new.php')) { + $tabs['Enrolment'] = [ + 'label' => __('Enrolment'), + 'content' => $this->enrolmentTable->getOutput(), + 'icon' => 'academic-cap', + ]; + } - if (count($formGroups) > 0) { - foreach ($formGroups as $formGroup) { - $return .= "
"; - $return .= $formGroup[2]; - $return .= '
'; - ++$tabCount; - - if ($behaviourView) { - $return .= "
"; - $return .= $formGroup[3]; - $return .= '
'; - ++$tabCount; - } - } - } + // Dashboard Hooks + $hooks = $this->getContainer()->get(HookGateway::class)->getAccessibleHooksByType('Staff Dashboard', $this->session->get('gibbonRoleIDCurrent')); + foreach ($hooks as $hookData) { - // Enrolment tab - if (isActionAccessible($guid, $connection2, '/modules/Admissions/report_students_left.php') || isActionAccessible($guid, $connection2, '/modules/Admissions/report_students_new.php')) { - $return .= "
"; - $return .= $this->enrolmentTable->getOutput(); - $return .= '
'; - ++$tabCount; - } + // Set the module for this hook for translations + $this->session->set('module', $hookData['sourceModuleName']); + $include = $this->session->get('absolutePath').'/modules/'.$hookData['sourceModuleName'].'/'.$hookData['sourceModuleInclude']; - foreach ($hooks as $hook) { - // Set the module for this hook for translations - $this->session->set('module', $hook['sourceModuleName']); - - $return .= "
"; - $include = $this->session->get('absolutePath').'/modules/'.$hook['sourceModuleName'].'/'.$hook['sourceModuleInclude']; - if (!file_exists($include)) { - $return .= "
"; - $return .= __('The selected page cannot be displayed due to a hook error.'); - $return .= '
'; - } else { - $return .= include $include; - } - ++$tabCount; - $return .= '
'; + if (!file_exists($include)) { + $hookOutput = Format::alert(__('The selected page cannot be displayed due to a hook error.'), 'error'); + } else { + $hookOutput = include $include; } - $return .= '
'; - } - $defaultTab = preg_replace('/[^0-9]/', '', $_GET['tab'] ?? 0); - - if (!isset($_GET['tab']) && !empty($staffDashboardDefaultTabCount)) { - $defaultTab = $staffDashboardDefaultTabCount-1; + $tabs[$hookData['name']] = [ + 'label' => __($hookData['name'], [], $hookData['sourceModuleName']), + 'content' => $hookOutput, + 'icon' => $hookData['name'], + ]; } - - $return .= "'; + + // Set the default tab + $staffDashboardDefaultTab = $this->settingGateway->getSettingByScope('School Admin', 'staffDashboardDefaultTab'); + $defaultTab = !isset($_GET['tab']) && !empty($staffDashboardDefaultTab) + ? array_search($staffDashboardDefaultTab, array_keys($tabs))+1 + : preg_replace('/[^0-9]/', '', $_GET['tab'] ?? 1); + + $return .= $this->view->fetchFromTemplate('ui/tabs.twig.html', [ + 'selected' => $defaultTab ?? 1, + 'tabs' => $tabs, + 'outset' => true, + 'icons' => true, + ]); return $return; } diff --git a/src/UI/Dashboard/StudentDashboard.php b/src/UI/Dashboard/StudentDashboard.php index 3c6a773557..c2c15f6ae6 100644 --- a/src/UI/Dashboard/StudentDashboard.php +++ b/src/UI/Dashboard/StudentDashboard.php @@ -22,6 +22,7 @@ namespace Gibbon\UI\Dashboard; use Gibbon\Http\Url; +use Gibbon\View\View; use Gibbon\Services\Format; use Gibbon\Data\Validator; use Gibbon\Forms\OutputableInterface; @@ -31,6 +32,7 @@ use League\Container\ContainerAwareInterface; use League\Container\ContainerAwareTrait; use Gibbon\Domain\System\HookGateway; +use Gibbon\Tables\Prefab\TodaysLessonsTable; /** * Student Dashboard View Composer @@ -46,15 +48,17 @@ class StudentDashboard implements OutputableInterface, ContainerAwareInterface protected $session; protected $settingGateway; - public function __construct( - Connection $db, - Session $session, - SettingGateway $settingGateway - ) + /** + * @var View + */ + private $view; + + public function __construct(Connection $db, Session $session, SettingGateway $settingGateway, View $view) { $this->db = $db; $this->session = $session; $this->settingGateway = $settingGateway; + $this->view = $view; } public function getOutput() @@ -62,7 +66,7 @@ public function getOutput() $output = '

'. __('Student Dashboard'). '

'. - "
"; + "
"; $dashboardContents = $this->renderDashboard(); @@ -89,132 +93,15 @@ protected function renderDashboard() $return = false; - //GET PLANNER $planner = false; - if (isActionAccessible($guid, $connection2, '/modules/Planner/planner.php')) { - $date = date('Y-m-d'); - try { - $data = array('gibbonSchoolYearID' => $this->session->get('gibbonSchoolYearID'), 'date' => $date, 'gibbonPersonID' => $this->session->get('gibbonPersonID'), 'gibbonSchoolYearID2' => $this->session->get('gibbonSchoolYearID'), 'date2' => $date, 'gibbonPersonID2' => $this->session->get('gibbonPersonID')); - $sql = "(SELECT gibbonCourseClass.gibbonCourseClassID, gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonPlannerEntry.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, homeworkSubmission, homeworkCrowdAssess, role, date, summary, gibbonPlannerEntryStudentHomework.homeworkDueDateTime AS myHomeworkDueDateTime FROM gibbonPlannerEntry - JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) - JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) - JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) - LEFT JOIN gibbonPlannerEntryStudentHomework ON (gibbonPlannerEntryStudentHomework.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID AND gibbonPlannerEntryStudentHomework.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) - LEFT JOIN ( - SELECT gibbonTTDayRowClass.gibbonCourseClassID, gibbonTTDayRowClass.gibbonTTDayRowClassID FROM gibbonTTDayDate JOIN gibbonTTDayRowClass ON (gibbonTTDayDate.gibbonTTDayID=gibbonTTDayRowClass.gibbonTTDayID) WHERE gibbonTTDayDate.date=:date) AS gibbonTTDayRowClassSubset ON (gibbonTTDayRowClassSubset.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) - LEFT JOIN gibbonTTDayRowClassException ON (gibbonTTDayRowClassException.gibbonTTDayRowClassID=gibbonTTDayRowClassSubset.gibbonTTDayRowClassID AND gibbonTTDayRowClassException.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) - - WHERE gibbonSchoolYearID=:gibbonSchoolYearID AND date=:date - AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' - GROUP BY gibbonPlannerEntry.gibbonPlannerEntryID, gibbonCourseClassPerson.gibbonCourseClassPersonID - HAVING COUNT(gibbonTTDayRowClassExceptionID) = 0 - ) - UNION - (SELECT gibbonCourseClass.gibbonCourseClassID, gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonPlannerEntry.gibbonCourseClassID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, timeStart, timeEnd, viewableStudents, viewableParents, homework, homeworkSubmission, homeworkCrowdAssess, role, date, summary, NULL AS myHomeworkDueDateTime FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonPlannerEntryGuest ON (gibbonPlannerEntryGuest.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonSchoolYearID=:gibbonSchoolYearID2 AND date=:date2 AND gibbonPlannerEntryGuest.gibbonPersonID=:gibbonPersonID2) ORDER BY date, timeStart, course, class"; - $result = $connection2->prepare($sql); - $result->execute($data); - } catch (\PDOException $e) { - } - $planner .= '

'; - $planner .= __("Today's Lessons"); - $planner .= '

'; - if ($result->rowCount() < 1) { - $planner .= "
"; - $planner .= __('There are no records to display.'); - $planner .= '
'; - } else { - $planner .= "
"; - $planner .= "".__('View Planner').''; - $planner .= '
'; - - $planner .= ""; - $planner .= ""; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - - $count = 0; - $rowNum = 'odd'; - while ($row = $result->fetch()) { - if (!($row['role'] == 'Student' and $row['viewableStudents'] == 'N')) { - if ($count % 2 == 0) { - $rowNum = 'even'; - } else { - $rowNum = 'odd'; - } - ++$count; - - //Highlight class in progress - if ((date('H:i:s') > $row['timeStart']) and (date('H:i:s') < $row['timeEnd']) and ($date) == date('Y-m-d')) { - $rowNum = 'current'; - } - - //COLOR ROW BY STATUS! - $planner .= ""; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - $planner .= ''; - } - } - $planner .= '
'; - $planner .= __('Class').'
'; - $planner .= '
'; - $planner .= __('Lesson').'
'; - $planner .= "".__('Unit').''; - $planner .= '
'; - $planner .= __($homeworkNameSingular); - $planner .= ''; - $planner .= __('Summary'); - $planner .= ''; - $planner .= __('Action'); - $planner .= '
'; - $planner .= $row['course'].'.'.$row['class'].'
'; - $planner .= "".substr($row['timeStart'], 0, 5).'-'.substr($row['timeEnd'], 0, 5).''; - $planner .= '
'; - $planner .= ''.$row['name'].'
'; - $planner .= "
"; - $unit = getUnit($connection2, $row['gibbonUnitID'], $row['gibbonCourseClassID']); - if (isset($unit[0])) { - $planner .= $unit[0]; - if ($unit[1] != '') { - $planner .= '
'.$unit[1].' '.__('Unit').''; - } - } - $planner .= '
'; - $planner .= '
'; - if ($row['homework'] == 'N' and $row['myHomeworkDueDateTime'] == '') { - $planner .= __('No'); - } else { - if ($row['homework'] == 'Y') { - $planner .= __('Yes').': '.__('Teacher Recorded').'
'; - if ($row['homeworkSubmission'] == 'Y') { - $planner .= "+".__('Submission').'
'; - if ($row['homeworkCrowdAssess'] == 'Y') { - $planner .= "+".__('Crowd Assessment').'
'; - } - } - } - if ($row['myHomeworkDueDateTime'] != '') { - $planner .= __('Yes').': '.__('Student Recorded').'
'; - } - } - $planner .= '
'; - $planner .= Format::truncate($row['summary'], 360); - $planner .= ''; - $planner .= "withQueryParams([ - 'viewBy' => 'class', - 'gibbonCourseClassID' => $row['gibbonCourseClassID'], - 'gibbonPlannerEntryID' => $row['gibbonPlannerEntryID'], - ])."'>"; - $planner .= '
'; - } + // PLANNER + if (isActionAccessible($guid, $connection2, '/modules/Planner/planner.php')) { + $planner = $this + ->getContainer() + ->get(TodaysLessonsTable::class) + ->create($session->get('gibbonSchoolYearID'), $this->session->get('gibbonPersonID'), 'Student') + ->getOutput(); } //GET TIMETABLE @@ -237,77 +124,50 @@ protected function renderDashboard() $timetable .= '
'; } - //GET HOOKS INTO DASHBOARD - $hooks = $this->getContainer()->get(HookGateway::class)->getAccessibleHooksByType('Student Dashboard', $this->session->get('gibbonRoleIDCurrent')); + // TABS + $tabs = []; - if ($planner == false and $timetable == false and count($hooks) < 1) { - $return .= "
"; - $return .= __('There are no records to display.'); - $return .= '
'; - } else { - $studentDashboardDefaultTab = $this->settingGateway->getSettingByScope('School Admin', 'studentDashboardDefaultTab'); - $studentDashboardDefaultTabCount = null; + if (!empty($planner) || !empty($timetable)) { + $tabs['Planner'] = [ + 'label' => __('Planner'), + 'content' => $planner.$timetable, + 'icon' => 'book-open', + ]; + } - $return .= "
"; - $return .= '
    '; - $tabCount = 1; - if ($planner != false or $timetable != false) { - $return .= "
  • ".__('Planner').'
  • '; - if ($studentDashboardDefaultTab == 'Planner') - $studentDashboardDefaultTabCount = $tabCount; - ++$tabCount; - } - foreach ($hooks as $hook) { - $return .= "
  • ".__($hook['name'], [], $hook['sourceModuleName']).'
  • '; - if ($studentDashboardDefaultTab == $hook['name']) - $studentDashboardDefaultTabCount = $tabCount; - ++$tabCount; - } - $return .= '
'; + // Dashboard Hooks + $hooks = $this->getContainer()->get(HookGateway::class)->getAccessibleHooksByType('Student Dashboard', $this->session->get('gibbonRoleIDCurrent')); + foreach ($hooks as $hookData) { - $tabCount = 1; - if ($planner != false or $timetable != false) { - $return .= "
"; - $return .= $planner; - $return .= $timetable; - $return .= '
'; - ++$tabCount; - } - foreach ($hooks as $hook) { - // Set the module for this hook for translations - $this->session->set('module', $hook['sourceModuleName']); + // Set the module for this hook for translations + $this->session->set('module', $hookData['sourceModuleName']); + $include = $this->session->get('absolutePath').'/modules/'.$hookData['sourceModuleName'].'/'.$hookData['sourceModuleInclude']; - $return .= "
"; - $include = $this->session->get('absolutePath').'/modules/'.$hook['sourceModuleName'].'/'.$hook['sourceModuleInclude']; - if (!file_exists($include)) { - $return .= "
"; - $return .= __('The selected page cannot be displayed due to a hook error.'); - $return .= '
'; - } else { - $return .= include $include; - } - ++$tabCount; - $return .= '
'; + if (!file_exists($include)) { + $hookOutput = Format::alert(__('The selected page cannot be displayed due to a hook error.'), 'error'); + } else { + $hookOutput = include $include; } - $return .= '
'; - } - - $defaultTab = preg_replace('/[^0-9]/', '', $_GET['tab'] ?? 0); - if (!isset($_GET['tab']) && !is_null($studentDashboardDefaultTabCount)) { - $defaultTab = $studentDashboardDefaultTabCount-1; + $tabs[$hookData['name']] = [ + 'label' => __($hookData['name'], [], $hookData['sourceModuleName']), + 'content' => $hookOutput, + 'icon' => $hookData['name'], + ]; } - $return .= "'; + + // Set the default tab + $studentDashboardDefaultTab = $this->settingGateway->getSettingByScope('School Admin', 'studentDashboardDefaultTab'); + $defaultTab = !isset($_GET['tab']) && !empty($studentDashboardDefaultTab) + ? array_search($studentDashboardDefaultTab, array_keys($tabs))+1 + : preg_replace('/[^0-9]/', '', $_GET['tab'] ?? 1); + + $return .= $this->view->fetchFromTemplate('ui/tabs.twig.html', [ + 'selected' => $defaultTab ?? 1, + 'tabs' => $tabs, + 'outset' => true, + 'icons' => true, + ]); return $return; } diff --git a/src/UI/Icon.php b/src/UI/Icon.php new file mode 100644 index 0000000000..2e4ceb130d --- /dev/null +++ b/src/UI/Icon.php @@ -0,0 +1,80 @@ +. +*/ + +namespace Gibbon\UI; + +use Gibbon\View\Component; + +/** + * Easy access to SVG icons. + * + * @version v28 + * @since v28 + */ +class Icon +{ + protected static $libraries = [ + 'Basic', + 'Solid', + 'Outline', + 'Large', + ]; + + /** + * Return an SVG icon from a specified icon library. + * Many of the icons come from: https://heroicons.com + * + * @param string $library One of: basic, solid, outline + * @param string $icon The name of an icon + * @param string $class Applies a class to the svg returned + * @param array $options Eg: strokeWidth for outline icons + * @return string + */ + public static function get(string $library, string $icon, string $class = '', array $options = []) : string + { + if (!$path = static::getLibraryPath($library)) { + return ''; + } + + return Component::render($path, [ + 'icon' => strtolower($icon), + 'class' => $class , //.' pointer-events-none' + 'options' => $options, + ]); + } + + /** + * Validate and get the path to a set of icons. + * + * @param string $library + * @return string + */ + protected static function getLibraryPath(string $library) : string + { + $library = ucfirst(strtolower($library)); + + if (!in_array($library, static::$libraries)) { + return false; + } + + return 'UI/Icons/Icons'.$library; + } +} diff --git a/src/UI/Icons/IconsBasic.template.php b/src/UI/Icons/IconsBasic.template.php new file mode 100644 index 0000000000..836afb6065 --- /dev/null +++ b/src/UI/Icons/IconsBasic.template.php @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/UI/Icons/IconsLarge.template.php b/src/UI/Icons/IconsLarge.template.php new file mode 100644 index 0000000000..b65def0d19 --- /dev/null +++ b/src/UI/Icons/IconsLarge.template.php @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/UI/Icons/IconsOutline.template.php b/src/UI/Icons/IconsOutline.template.php new file mode 100644 index 0000000000..ee722e7071 --- /dev/null +++ b/src/UI/Icons/IconsOutline.template.php @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/UI/Icons/IconsSolid.template.php b/src/UI/Icons/IconsSolid.template.php new file mode 100644 index 0000000000..d506eef029 --- /dev/null +++ b/src/UI/Icons/IconsSolid.template.php @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/View/Component.php b/src/View/Component.php index 98aac7997d..6d9283f6aa 100644 --- a/src/View/Component.php +++ b/src/View/Component.php @@ -58,13 +58,13 @@ public static function render(string $view, array $context = []): string { static::$path = empty(static::$path) ? realpath(__DIR__.'/../').'/' : static::$path; - $view = str_replace(['Gibbon\\', '\\', '..'], ['', '/', ''], $view); + $view = str_replace(['Gibbon\\', '\\', '..'], ['', '/', ''], ltrim($view, '/')); if (!file_exists($file = static::$path.$view.'.template.php')) { throw new \Exception(sprintf('The component %s could not be found.', $file)); } - extract(array_merge($context, static::$environment)); + extract(static::safeExtract(array_merge($context, static::$environment))); ob_start(); @@ -72,4 +72,13 @@ public static function render(string $view, array $context = []): string return ob_get_clean(); } + + private static function safeExtract($array) + { + $safeKeys = array_map(function ($key) { + return preg_replace('/[^a-zA-Z0-9]/', '_', $key); + }, array_keys($array)); + + return array_combine($safeKeys, array_values($array)); + } } diff --git a/tests/acceptance/Activities/ManageActivitiesCept.php b/tests/acceptance/Activities/ManageActivitiesCept.php index b5dc3b5606..c238e75fec 100644 --- a/tests/acceptance/Activities/ManageActivitiesCept.php +++ b/tests/acceptance/Activities/ManageActivitiesCept.php @@ -42,7 +42,7 @@ $I->loginAsAdmin(); $I->amOnModulePage('Activities', 'activities_manage.php'); $I->click("Delete", "//td[contains(text(),'T2 Test Activity')]//.."); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/Data Updater/UpdateFamilyDataCept.php b/tests/acceptance/Data Updater/UpdateFamilyDataCept.php index 48f71492f9..a02eee4d7d 100644 --- a/tests/acceptance/Data Updater/UpdateFamilyDataCept.php +++ b/tests/acceptance/Data Updater/UpdateFamilyDataCept.php @@ -57,7 +57,7 @@ // Delete ------------------------------------------------ $I->amOnModulePage('Data Updater', 'data_family_manage_delete.php', array('gibbonFamilyUpdateID' => $gibbonFamilyUpdateID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); // Reset Data ------------------------------------------------ diff --git a/tests/acceptance/Data Updater/UpdateFinanceDataCept.php b/tests/acceptance/Data Updater/UpdateFinanceDataCept.php index cc12040df0..2ea1af3e10 100644 --- a/tests/acceptance/Data Updater/UpdateFinanceDataCept.php +++ b/tests/acceptance/Data Updater/UpdateFinanceDataCept.php @@ -18,7 +18,7 @@ $I->selectOption('invoiceTo', 'Family'); -$I->click('#content form[method="post"] input[type=submit]'); +$I->click('#content form[method="post"] [type=submit]'); $I->seeSuccessMessage(); $gibbonFinanceInvoiceeID = $I->grabValueFromURL('gibbonFinanceInvoiceeID'); @@ -68,7 +68,7 @@ // Delete ------------------------------------------------ $I->amOnModulePage('Data Updater', 'data_finance_manage_delete.php', array('gibbonFinanceInvoiceeUpdateID' => $gibbonFinanceInvoiceeUpdateID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); @@ -77,7 +77,7 @@ $I->selectOption('invoiceTo', 'Family'); -$I->click('#content form[method="post"] input[type=submit]'); +$I->click('#content form[method="post"] [type=submit]'); $I->seeSuccessMessage(); $gibbonFinanceInvoiceeUpdateID = $I->grabValueFrom("input[type='hidden'][name='existing']"); @@ -96,5 +96,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('Data Updater', 'data_finance_manage_delete.php', array('gibbonFinanceInvoiceeUpdateID' => $gibbonFinanceInvoiceeUpdateID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/Data Updater/UpdateMedicalDataCept.php b/tests/acceptance/Data Updater/UpdateMedicalDataCept.php index b137e1b9e3..bce7d907ee 100644 --- a/tests/acceptance/Data Updater/UpdateMedicalDataCept.php +++ b/tests/acceptance/Data Updater/UpdateMedicalDataCept.php @@ -45,7 +45,7 @@ // Delete ------------------------------------------------ $I->amOnModulePage('Data Updater', 'data_medical_manage_delete.php', array('gibbonPersonMedicalUpdateID' => $gibbonPersonMedicalUpdateID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); @@ -91,5 +91,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('Data Updater', 'data_medical_manage_delete.php', array('gibbonPersonMedicalUpdateID' => $gibbonPersonMedicalUpdateID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/Data Updater/UpdatePersonalDataCept.php b/tests/acceptance/Data Updater/UpdatePersonalDataCept.php index df36008c4b..37a389c024 100644 --- a/tests/acceptance/Data Updater/UpdatePersonalDataCept.php +++ b/tests/acceptance/Data Updater/UpdatePersonalDataCept.php @@ -125,7 +125,7 @@ // Delete ------------------------------------------------ $I->amOnModulePage('Data Updater', 'data_personal_manage_delete.php', array('gibbonPersonUpdateID' => $gibbonPersonUpdateID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); // Restore Original Settings ----------------------------------- diff --git a/tests/acceptance/Finance/ManageBudgetCyclesCept.php b/tests/acceptance/Finance/ManageBudgetCyclesCept.php index f4f20df7c6..10dfbddb68 100644 --- a/tests/acceptance/Finance/ManageBudgetCyclesCept.php +++ b/tests/acceptance/Finance/ManageBudgetCyclesCept.php @@ -41,5 +41,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('Finance', 'budgetCycles_manage_delete.php', array('gibbonFinanceBudgetCycleID' => $gibbonFinanceBudgetCycleID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/Markbook/AddAndEditMarkbookColumnCept.php b/tests/acceptance/Markbook/AddAndEditMarkbookColumnCept.php index 31e2be54f8..5e7d59e5de 100644 --- a/tests/acceptance/Markbook/AddAndEditMarkbookColumnCept.php +++ b/tests/acceptance/Markbook/AddAndEditMarkbookColumnCept.php @@ -129,7 +129,7 @@ $urlParams = array('gibbonCourseClassID' => $gibbonCourseClassID, 'gibbonMarkbookColumnID' => $gibbonMarkbookColumnID); $I->amOnModulePage('Markbook', 'markbook_edit_delete.php', $urlParams ); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); // Force Cleanup (for failed tests) ------------------------------ diff --git a/tests/acceptance/Planner/CreateLinkedMarkbookCept.php b/tests/acceptance/Planner/CreateLinkedMarkbookCept.php index 4114943248..3ef9672226 100644 --- a/tests/acceptance/Planner/CreateLinkedMarkbookCept.php +++ b/tests/acceptance/Planner/CreateLinkedMarkbookCept.php @@ -57,7 +57,7 @@ $urlParams = array('gibbonCourseClassID' => $gibbonCourseClassID, 'gibbonMarkbookColumnID' => $gibbonMarkbookColumnID); $I->amOnModulePage('Markbook', 'markbook_edit_delete.php', $urlParams ); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); // Delete Planner ------------------------------------------------ @@ -65,7 +65,7 @@ $urlParams = array('gibbonCourseClassID' => $gibbonCourseClassID, 'gibbonPlannerEntryID' => $gibbonPlannerEntryID, 'viewBy' => 'class'); $I->amOnModulePage('Planner', 'planner_delete.php', $urlParams ); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); // Force Cleanup (for failed tests) ------------------------------ diff --git a/tests/acceptance/School Admin/DepartmentsManageCept.php b/tests/acceptance/School Admin/DepartmentsManageCept.php index e30acac8c7..b1ef9af6e5 100644 --- a/tests/acceptance/School Admin/DepartmentsManageCept.php +++ b/tests/acceptance/School Admin/DepartmentsManageCept.php @@ -41,5 +41,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'department_manage_delete.php', array('gibbonDepartmentID' => $gibbonDepartmentID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/School Admin/ExternalAssessmentsManageCept.php b/tests/acceptance/School Admin/ExternalAssessmentsManageCept.php index 9627c2c9f6..e4159136bb 100644 --- a/tests/acceptance/School Admin/ExternalAssessmentsManageCept.php +++ b/tests/acceptance/School Admin/ExternalAssessmentsManageCept.php @@ -57,11 +57,11 @@ // Delete Field ------------------------------------------ $I->amOnModulePage('School Admin', 'externalAssessments_manage_edit_field_delete.php', array('gibbonExternalAssessmentID' => $gibbonExternalAssessmentID, 'gibbonExternalAssessmentFieldID' => $gibbonExternalAssessmentFieldID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'externalAssessments_manage_delete.php', array('gibbonExternalAssessmentID' => $gibbonExternalAssessmentID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/School Admin/FacilitiesManageCept.php b/tests/acceptance/School Admin/FacilitiesManageCept.php index 8009fc1499..8974c9cac9 100644 --- a/tests/acceptance/School Admin/FacilitiesManageCept.php +++ b/tests/acceptance/School Admin/FacilitiesManageCept.php @@ -59,5 +59,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'space_manage_delete.php', array('gibbonSpaceID' => $gibbonSpaceID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/School Admin/FileExtensionsManageCept.php b/tests/acceptance/School Admin/FileExtensionsManageCept.php index ca74bbb5aa..1aba276172 100644 --- a/tests/acceptance/School Admin/FileExtensionsManageCept.php +++ b/tests/acceptance/School Admin/FileExtensionsManageCept.php @@ -48,5 +48,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'fileExtensions_manage_delete.php', array('gibbonFileExtensionID' => $gibbonFileExtensionID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/School Admin/FormGroupsManageCept.php b/tests/acceptance/School Admin/FormGroupsManageCept.php index 2bbcc46b81..37d0d9458f 100644 --- a/tests/acceptance/School Admin/FormGroupsManageCept.php +++ b/tests/acceptance/School Admin/FormGroupsManageCept.php @@ -50,5 +50,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'formGroup_manage_delete.php', array('gibbonFormGroupID' => $gibbonFormGroupID, 'gibbonSchoolYearID' => $gibbonSchoolYearID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/School Admin/GradeScalesManageCept.php b/tests/acceptance/School Admin/GradeScalesManageCept.php index 45d41980ed..0ba0b4bd62 100644 --- a/tests/acceptance/School Admin/GradeScalesManageCept.php +++ b/tests/acceptance/School Admin/GradeScalesManageCept.php @@ -73,11 +73,11 @@ // Delete Grade ------------------------------------------ $I->amOnModulePage('School Admin', 'gradeScales_manage_edit_grade_delete.php', array('gibbonScaleID' => $gibbonScaleID, 'gibbonScaleGradeID' => $gibbonScaleGradeID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); // Delete Scale ------------------------------------------ $I->amOnModulePage('School Admin', 'gradeScales_manage_delete.php', array('gibbonScaleID' => $gibbonScaleID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/School Admin/HousesManageCept.php b/tests/acceptance/School Admin/HousesManageCept.php index fba375f771..e087b3892a 100644 --- a/tests/acceptance/School Admin/HousesManageCept.php +++ b/tests/acceptance/School Admin/HousesManageCept.php @@ -35,5 +35,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'house_manage_delete.php', array('gibbonHouseID' => $gibbonHouseID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/School Admin/SchoolYearsManageCept.php b/tests/acceptance/School Admin/SchoolYearsManageCept.php index 43a5ac0982..f5d9419089 100644 --- a/tests/acceptance/School Admin/SchoolYearsManageCept.php +++ b/tests/acceptance/School Admin/SchoolYearsManageCept.php @@ -39,5 +39,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'schoolYear_manage_delete.php', array('gibbonSchoolYearID' => $gibbonSchoolYearID)); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); diff --git a/tests/acceptance/School Admin/TermsManageCept.php b/tests/acceptance/School Admin/TermsManageCept.php index d1ae133867..1b076fff20 100644 --- a/tests/acceptance/School Admin/TermsManageCept.php +++ b/tests/acceptance/School Admin/TermsManageCept.php @@ -43,5 +43,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'schoolYearTerm_manage_delete.php', array('gibbonSchoolYearTermID' => $gibbonSchoolYearTermID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/School Admin/YearGroupsManageCept.php b/tests/acceptance/School Admin/YearGroupsManageCept.php index 142f4e7f68..8b6e42fcc2 100644 --- a/tests/acceptance/School Admin/YearGroupsManageCept.php +++ b/tests/acceptance/School Admin/YearGroupsManageCept.php @@ -37,5 +37,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('School Admin', 'yearGroup_manage_delete.php', array('gibbonYearGroupID' => $gibbonYearGroupID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/Students/ApplicationFormAlternateCept.php b/tests/acceptance/Students/ApplicationFormAlternateCept.php index b656452e1f..245a589b5b 100644 --- a/tests/acceptance/Students/ApplicationFormAlternateCept.php +++ b/tests/acceptance/Students/ApplicationFormAlternateCept.php @@ -143,7 +143,7 @@ $urlParams = array('gibbonApplicationFormID' => $gibbonApplicationFormID, 'gibbonSchoolYearID' => $gibbonSchoolYearID); $I->amOnModulePage('Students', 'applicationForm_manage_delete.php', $urlParams ); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); // Restore Original Settings ----------------------------------- diff --git a/tests/acceptance/Students/ApplicationFormByParentCept.php b/tests/acceptance/Students/ApplicationFormByParentCept.php index 4a1747d46f..7278a3d34a 100644 --- a/tests/acceptance/Students/ApplicationFormByParentCept.php +++ b/tests/acceptance/Students/ApplicationFormByParentCept.php @@ -153,7 +153,7 @@ $urlParams = array('gibbonApplicationFormID' => $gibbonApplicationFormID, 'gibbonSchoolYearID' => $gibbonSchoolYearID); $I->amOnModulePage('Students', 'applicationForm_manage_delete.php', $urlParams ); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); // Restore Original Settings ----------------------------------- diff --git a/tests/acceptance/Students/ApplicationFormByUserCept.php b/tests/acceptance/Students/ApplicationFormByUserCept.php index bc956e344c..ee6ec5bb45 100644 --- a/tests/acceptance/Students/ApplicationFormByUserCept.php +++ b/tests/acceptance/Students/ApplicationFormByUserCept.php @@ -185,7 +185,7 @@ $urlParams = array('gibbonApplicationFormID' => $gibbonApplicationFormID, 'gibbonSchoolYearID' => $gibbonSchoolYearID); $I->amOnModulePage('Students', 'applicationForm_manage_delete.php', $urlParams ); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); // Restore Original Settings ----------------------------------- diff --git a/tests/acceptance/Students/ApplicationFormCept.php b/tests/acceptance/Students/ApplicationFormCept.php index a0e0650c01..b4c4d6903a 100644 --- a/tests/acceptance/Students/ApplicationFormCept.php +++ b/tests/acceptance/Students/ApplicationFormCept.php @@ -211,7 +211,7 @@ $urlParams = array('gibbonApplicationFormID' => $gibbonApplicationFormID, 'gibbonSchoolYearID' => $gibbonSchoolYearID); $I->amOnModulePage('Students', 'applicationForm_manage_delete.php', $urlParams ); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); // Delete Files ------------------------------------------------ diff --git a/tests/acceptance/System Admin/CustomFieldsManageCept.php b/tests/acceptance/System Admin/CustomFieldsManageCept.php index b3f8276772..20ffc531ce 100644 --- a/tests/acceptance/System Admin/CustomFieldsManageCept.php +++ b/tests/acceptance/System Admin/CustomFieldsManageCept.php @@ -54,5 +54,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('System Admin', 'customFields_delete.php', array('gibbonCustomFieldID' => $gibbonCustomFieldID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/System Admin/StringReplacementCept.php b/tests/acceptance/System Admin/StringReplacementCept.php index 9ecc7a097c..8bc5ee168f 100644 --- a/tests/acceptance/System Admin/StringReplacementCept.php +++ b/tests/acceptance/System Admin/StringReplacementCept.php @@ -41,5 +41,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('System Admin', 'stringReplacement_manage_delete.php', array('gibbonStringID' => $gibbonStringID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/Timetable Admin/CoursesManageCept.php b/tests/acceptance/Timetable Admin/CoursesManageCept.php index e4e2103344..b44b5b5af6 100644 --- a/tests/acceptance/Timetable Admin/CoursesManageCept.php +++ b/tests/acceptance/Timetable Admin/CoursesManageCept.php @@ -78,12 +78,12 @@ // Delete Class ------------------------------------------- $I->amOnModulePage('Timetable Admin', 'course_manage_class_delete.php', array('gibbonCourseClassID' => $gibbonCourseClassID, 'gibbonCourseID' => $gibbonCourseID, 'gibbonSchoolYearID' => $gibbonSchoolYearID)); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); // Delete ------------------------------------------------ $I->amOnModulePage('Timetable Admin', 'course_manage_delete.php', array('gibbonCourseID' => $gibbonCourseID, 'gibbonSchoolYearID' => $gibbonSchoolYearID, 'search' => '')); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); diff --git a/tests/acceptance/User Admin/DataUpdaterSettingsCept.php b/tests/acceptance/User Admin/DataUpdaterSettingsCept.php index f98d7030db..005ed705a4 100644 --- a/tests/acceptance/User Admin/DataUpdaterSettingsCept.php +++ b/tests/acceptance/User Admin/DataUpdaterSettingsCept.php @@ -40,7 +40,7 @@ $I->selectOption('settings[Staff][emergency2Relationship]', 'required'); $I->selectOption('settings[Staff][vehicleRegistration]', 'required'); -$I->click('#dataUpdaterSettingsFields input[type=submit]'); +$I->click('#dataUpdaterSettingsFields [type=submit]'); // Verify Results ---------------------------------------------- diff --git a/tests/acceptance/User Admin/DistrictsManageCept.php b/tests/acceptance/User Admin/DistrictsManageCept.php index 1bf7094817..de5d0e0056 100644 --- a/tests/acceptance/User Admin/DistrictsManageCept.php +++ b/tests/acceptance/User Admin/DistrictsManageCept.php @@ -33,5 +33,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('User Admin', 'district_manage_delete.php', array('gibbonDistrictID' => $gibbonDistrictID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/User Admin/FamiliesManageCept.php b/tests/acceptance/User Admin/FamiliesManageCept.php index f30034f0e9..f6b11f307d 100644 --- a/tests/acceptance/User Admin/FamiliesManageCept.php +++ b/tests/acceptance/User Admin/FamiliesManageCept.php @@ -47,5 +47,5 @@ // Delete ------------------------------------------------ $I->amOnModulePage('User Admin', 'family_manage_delete.php', array('gibbonFamilyID' => $gibbonFamilyID)); -$I->click('Yes'); +$I->click('Delete'); $I->seeSuccessMessage(); diff --git a/tests/acceptance/User Admin/RoleManageCept.php b/tests/acceptance/User Admin/RoleManageCept.php index 2055565171..047245c7bf 100644 --- a/tests/acceptance/User Admin/RoleManageCept.php +++ b/tests/acceptance/User Admin/RoleManageCept.php @@ -47,6 +47,6 @@ // Delete ------------------------------------------------ $I->amOnModulePage('User Admin', 'role_manage_delete.php', array('gibbonRoleID' => $gibbonRoleID)); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); diff --git a/tests/acceptance/User Admin/UsersManageCept.php b/tests/acceptance/User Admin/UsersManageCept.php index 39de8efec9..e7006271ba 100644 --- a/tests/acceptance/User Admin/UsersManageCept.php +++ b/tests/acceptance/User Admin/UsersManageCept.php @@ -185,7 +185,7 @@ // Delete ------------------------------------------------ $I->amOnModulePage('User Admin', 'user_manage_delete.php', array('gibbonPersonID' => $gibbonPersonID, 'search' => '')); -$I->click('Yes'); +$I->click('Delete'); $I->see('Your request was completed successfully.', '.success'); // Restore Original Settings ----------------------------------- diff --git a/tests/unit/Forms/FormRendererTest.php b/tests/unit/Forms/FormRendererTest.php deleted file mode 100644 index 9e871175ab..0000000000 --- a/tests/unit/Forms/FormRendererTest.php +++ /dev/null @@ -1,29 +0,0 @@ -assertInstanceOf( - FormRenderer::class, - FormRenderer::create() - ); - } -} diff --git a/tests/unit/Forms/FormTest.php b/tests/unit/Forms/FormTest.php index 8b38fd3002..298aae0388 100644 --- a/tests/unit/Forms/FormTest.php +++ b/tests/unit/Forms/FormTest.php @@ -15,6 +15,7 @@ use Gibbon\Forms\View\FormRendererInterface; use Gibbon\Services\ViewServiceProvider; use League\Container\Container; +use Gibbon\Forms\View\FormView; /** * @covers Form @@ -49,7 +50,13 @@ public function setUp(): void $container->share('twig', function () { $absolutePath = realpath(__DIR__ . '/../../../'); $loader = new \Twig\Loader\FilesystemLoader($absolutePath.'/resources/templates'); - return new \Twig\Environment($loader); + + $twig = new \Twig\Environment($loader); + $twig->addFunction(new \Twig\TwigFunction('__', function ($string, $domain = null) { + return $string; + })); + + return $twig; }); $service = new ViewServiceProvider(); @@ -137,7 +144,7 @@ public function testCanSetRenderer() ->setID('testID') ->setAction('testAction'); - $newRenderer = FormRenderer::create(); + $newRenderer = $this->createMock(FormView::class); $form->setRenderer($newRenderer); $this->assertSame($newRenderer, $form->getRenderer()); diff --git a/themes/Default/css/main.css b/themes/Default/css/main.css index 2ac3ebcc07..f0737d33d2 100644 --- a/themes/Default/css/main.css +++ b/themes/Default/css/main.css @@ -23,79 +23,27 @@ Theme fundamentals based on Mollio, copyright Daemon Pty Limited 2006, http://ww Used under "GNU Creative Commons License", http://creativecommons.org/licenses/GPL/2.0/ */ -[x-cloak] { display: none !important; } - -/* LAYOUT */ - -div.trail { - text-align: left; - font-size: 70%; - margin: 10px 0px 10px -18px; - height: 16px; - padding-top: 7px; - padding-left: 20px; - font-weight: normal; - color: #3b73af; -} - -div.trailEnd, -div.trailHead, -div.trailHead a { - display: inline-block; - white-space: nowrap; - font-weight: normal; - color: #3b73af; -} - -div.trailEnd { - padding-left: 3px; -} - - /* LINKS */ -a { - background: transparent; - color: #c00; - text-decoration: inherit; -} -a:not([class]) { - text-decoration: underline; -} - -a:hover:not([class]), -a:active:not([class]) { - color: #069; -} - -a.active { - font-weight: bold; - color: #600; -} - -a img { - color: #ffffff; - border-color: none; -} /* TYPOGRAPHY */ p { margin: 0px 0px 15px 0px; - font-size: 13px; + font-size: 14px; } ul, ol { margin: 0 0 1px; - font-size: 13px; -} -h1, -h2, -h3, -h4, -h5, -h6 { + font-size: 14px; +} +h1:not([class]), +h2:not([class]), +h3:not([class]), +h4:not([class]), +h5:not([class]), +h6:not([class]) { margin: 20px 0 10px 0; color: #444; background-color: none; @@ -104,34 +52,25 @@ h6 { text-transform: uppercase; padding-bottom: 5px; } -h1 { +h1:not([class]) { font-size: 17pt; } -h2 { +h2:not([class]) { font-size: 14pt; } -#sidebar h2, -div.sidebarExtra h2 { - font-size: 14pt; - border-left: none; - background: none; -} -#sidebar p:last-of-type { - margin-bottom: 0; -} -h3 { +h3:not([class]) { font-size: 13pt; } -h4 { +h4:not([class]) { margin-top: 30px; margin-bottom: 10px; font-size: 11pt; } -h5, -h6 { +h5:not([class]), +h6:not([class]) { margin-top: 10px; margin-bottom: 10px; font-size: 11pt; @@ -197,18 +136,18 @@ table { color: #666; font-size: 12px; text-shadow: none; - background-color: #fafafa; + background-color: #fefefe; margin: 0px; border: #ccc 1px solid; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; border-spacing: 0px; } table th { padding: 1rem 0.75rem; border-bottom: 1px solid #ccc; - background-color: #ebebeb; + background-color: #f3f4f6; text-align: left; } table .heading td:not(:first-child) { @@ -219,7 +158,7 @@ table tr { text-align: center; } table td:first-child { - text-align: left; + /* text-align: left; */ border-left: 0; } @@ -227,16 +166,16 @@ table td { text-align: left; padding: 12px; border-bottom: 1px solid #dfdfdf; - border-left: 1px solid #dfdfdf; + /* border-left: 1px solid #dfdfdf; */ } .odd, table.colorOddEven tr:not([class]) { - background-color: #fefefe; + /* background-color: #fefefe; */ } .even, table.colorOddEven tr:nth-of-type(odd):not([class]) { - background-color: #f9f9f9; + /* background-color: #f9f9f9; */ } table tr:last-child > td { @@ -254,24 +193,24 @@ div.right { } table tr:first-child th:first-child { - -moz-border-radius-topleft: 3px; - -webkit-border-top-left-radius: 3px; - border-top-left-radius: 3px; + -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; } table tr:first-child th:last-child { - -moz-border-radius-topright: 3px; - -webkit-border-top-right-radius: 3px; - border-top-right-radius: 3px; + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; } table tr:last-child td:first-child { - -moz-border-radius-bottomleft: 3px; - -webkit-border-bottom-left-radius: 3px; - border-bottom-left-radius: 3px; + -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; } table tr:last-child td:last-child { - -moz-border-radius-bottomright: 3px; - -webkit-border-bottom-right-radius: 3px; - border-bottom-right-radius: 3px; + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; } /* ALT TABLE STYLES */ @@ -287,7 +226,7 @@ table.noIntBorder td:last-child { text-align: left; } table.smallIntBorder { - background-color: #fafafa; + background-color: #fefefe; position: relative; } table.smallIntBorder td { @@ -295,7 +234,7 @@ table.smallIntBorder td { padding: 0.5rem !important ; } table.smallIntBorder td:last-child { - text-align: left; + /* text-align: left; */ } tr.break td { background-color: #eaebec; @@ -330,170 +269,29 @@ table.blank > tbody > tr > td { } /* FORMS */ -input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), -textarea { - -webkit-appearance: none; - -webkit-border-radius: 0.125rem; - border-radius: 0.125rem; -} - -input[type="text"], -input[type="password"], -input[type="file"] { - border-width: 1px; - height: 36px; - font-size: 14px; - box-sizing: border-box; -} - -input[readonly], -textarea[readonly], -select[readonly] { - border: none; - background: none; -} - -textarea[readonly] { - font-family: inherit; - resize: none; -} - -textarea { - border-width: 1px; - float: right; - font-size: 14px; - box-sizing: border-box; -} - -select { - border-width: 1px; - height: 36px; - float: right; - font-size: 14px; - box-sizing: border-box; - -webkit-border-radius: 0; - border-radius: 0; -} - -input[type="button"] { - border: 1px solid #222222; - background-color: #eeeeee; - height: 36px; - min-width: 55px; - color: #444444; - font-weight: bold; - margin: 2px; - font-size: 14px; -} - -input[type="button"].buttonAsLink { - border: none; - background: none; - color: #c00; - height: 36px; - font-size: 14px; -} -input[type="button"]:hover.buttonAsLink { - border-bottom: 1px solid #c00; -} - -input[type="submit"] { - border: 1px solid #222222; - background-color: #444444; - height: 36px; - min-width: 55px; - color: #ffffff; - font-weight: bold; - margin: 2px; - font-size: 14px; -} - -.bg-purple[type="submit"] { - border: 1px solid #8c60c8; - background-color: #8c60c8; -} - -.bg-purple[type="submit"]:hover { - border: 1px solid #9d75d9; - background-color: #9d75d9; -} - -input[type="reset"] { - border: 1px solid #222222; - background-color: #eeeeee; - height: 36px; - min-width: 55px; - color: #444444; - font-weight: bold; - margin: 2px; - font-size: 14px; -} - -input[type="submit"]:hover { - color: #eeeeee; -} - -input[type="submit"].buttonLink, -input[type="button"].buttonLink { - background: none; - color: #c00; - border: none; - font-weight: normal; - font-size: 14px; - text-decoration: underline; - padding-left: 0.5rem; - padding-right: 0.5rem; -} - -input[type="submit"].buttonLink:hover, -input[type="button"].buttonLink:hover { - cursor: pointer; - background: none; - color: #069; - border: none; - font-weight: normal; - font-size: 14px; -} input[type="checkbox"][disabled] { - opacity: 1; + opacity: 0.35; } button, input[type="submit"], input[type="button"] { cursor: pointer; -} - -button.active { - background-color: #dedede; -} -input[type="submit"].active, -input[type="button"].active { - background-color: #bbbbbb; + background-color: inherit; } button[disabled], input[disabled], textarea[disabled] { cursor: initial; - filter: alpha(opacity = 65); - -webkit-box-shadow: none; - box-shadow: none; - opacity: 0.45; -} + --tw-border-opacity: 0.5; + --tw-ring-opacity: 0.5; + --tw-text-opacity: 0.5; +} */ /* PAGINATION */ -.paginationTop { - text-align: right; - font-size: 12px; - margin: 15px 0px 0px 0px; -} -.paginationBottom { - text-align: right; - font-size: 12px; - margin: 0px 0px 15px 0px; -} + .linkTop { text-align: right; font-size: 12px; @@ -591,7 +389,7 @@ a.edButtonHTML { a.edButtonHTML { margin-right: 15px; } -a, +/* a, #adminmenu a, a.edButtonPreview, a.edButtonHTML, @@ -603,13 +401,13 @@ a.edButtonHTML, color: #21759b; text-decoration: none; color: #c00; -} +} */ .ui-tooltip, .arrow:after { - background: rgba(25, 25, 25, 0.9) !important; + background: hsl(0 3% 23%) !important; border: none !important; - box-shadow: 2px 2px 4px rgba(25, 25, 25, 0.9) !important; + box-shadow: 1px 1px 2px rgba(25, 25, 25, 0.4) !important; } .ui-tooltip { padding: 10px 20px !important; @@ -652,7 +450,7 @@ a.edButtonHTML, } ul.ui-tabs-nav { - font-size: 13px; + font-size: 14px; border-radius: 0px !important ; background: none !important ; border: none !important ; @@ -740,18 +538,17 @@ th.ttCalendarBar { width: 100%; text-align: right !important; background-image: none !important; - background-color: #f2f2f2 !important; } span.ttSchoolCalendar { color: #fff; font-weight: bold; margin: 0px -2px 0px 5px; - background-color: rgb(18, 138, 0); + background-color: rgba(18, 138, 0, 0.85); padding: 5px 7px; border: 1px solid #555; } div.ttSchoolCalendar { - background-color: rgb(18, 138, 0); + background-color: rgba(18, 138, 0, 0.85); color: #fff; font-weight: bold; } @@ -759,12 +556,12 @@ span.ttPersonalCalendar { color: #fff; font-weight: bold; margin: 0px -2px 0px 5px; - background-color: rgb(103, 153, 207); + background-color: rgba(103, 153, 207, 0.9); padding: 5px 7px; border: 1px solid #555; } div.ttPersonalCalendar { - background-color: rgb(103, 153, 207); + background-color: rgba(103, 153, 207, 0.9); color: #fff; font-weight: bold; } @@ -772,12 +569,12 @@ span.ttSpaceBookingCalendar { color: #fff; font-weight: bold; margin: 0px -2px 0px 5px; - background-color: #f0851f; + background-color: rgba(240, 133, 31, 0.9); padding: 5px 7px; border: 1px solid #555; } div.ttSpaceBookingCalendar { - background-color: #f0851f; + background-color: rgba(240, 133, 31, 0.9); color: #fff; font-weight: bold; } @@ -867,57 +664,6 @@ div.resourceAddSlider { margin-bottom: -5px; } -/* v12 NEW CLASSES */ -p.emphasis, -span.emphasis { - font-style: italic; -} -span.small { - font-size: 100%; -} - -input.standardWidth, -textarea.standardWidth, -select.standardWidth, -div.standardWidth, -table.standardWidth { - width: 300px; -} -.fullWidth { - width: 100%; -} -div.blockOuter { - text-align: center; -} -h1.bigTop, -h2.bigTop, -h3.bigTop, -h4.bigTop, -h5.bigTop, -h6.bigTop { - margin-top: 50px !important; -} - -/* v13 NEW CLASSES */ -td.wordWrap { - overflow-wrap: break-word; - word-wrap: break-word; - word-break: break-word !important; -} - -/* v14 NEW CLASSES */ - -select[multiple] { - height: auto; -} - -.shortWidth { - width: 148px; -} - -.mediumWidth { - width: 230px; -} table tr.heading td { padding: 15px 5px 15px 5px; @@ -947,7 +693,7 @@ table.columnHighlight .hover:not(:first-child) { .input-box { float: right; display: table; - border: 1px solid #bfbfbf; + border: 1px solid #b1afaf; background-color: #ffffff; box-sizing: border-box; } @@ -962,7 +708,7 @@ table.columnHighlight .hover:not(:first-child) { .input-box .inline-button { display: table-cell; - border-left: 1px solid #bfbfbf; + border-left: 1px solid #b1afaf; background: #fafafa; background: -moz-linear-gradient(top, #fbfbfb, #fafafa); width: 48px; @@ -1036,12 +782,8 @@ td.standardWidth { position: relative; } -.displayInlineBlock { - display: inline-block; -} - /* Fixes an odd colspan-related width bug in Chrome */ -td.fullWidth[colspan] { +td.w-full[colspan] { width: auto; } @@ -1132,52 +874,36 @@ table.smallIntBorder td.noPadding { /* v16 NEW CLASSES */ -.displayNone { - display: none; -} - /* Gibbon Data Table CSS - Will be moved to core.css */ .dataTable .sortable:not(.sorting):hover:after, +.dataTable .sortable.sorting::before, .dataTable .sortASC:after, .dataTable .sortDESC:after { content: ""; - width: 0px; - height: 0px; - border: 5px solid transparent; + background-position: left center; + background-repeat: no-repeat; + background-size: 100%; + width: 1.2rem; + height: 1.2rem; position: absolute; - top: 15px; + top: 30%; right: 6px; } -.dataTable .sortable:not(.sorting):hover:after { - border-bottom: 5px solid #666666; +.dataTable .sortable:not(.sorting):hover:after, +.dataTable .sortable.sorting::before { + background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0icmdiKDEyMywgMTI5LCAxNDIpIj4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMC41MyAzLjQ3YS43NS43NSAwIDAgMC0xLjA2IDBMNi4yMiA2LjcyYS43NS43NSAwIDAgMCAxLjA2IDEuMDZMMTAgNS4wNmwyLjcyIDIuNzJhLjc1Ljc1IDAgMSAwIDEuMDYtMS4wNmwtMy4yNS0zLjI1Wm0tNC4zMSA5LjgxIDMuMjUgMy4yNWEuNzUuNzUgMCAwIDAgMS4wNiAwbDMuMjUtMy4yNWEuNzUuNzUgMCAxIDAtMS4wNi0xLjA2TDEwIDE0Ljk0bC0yLjcyLTIuNzJhLjc1Ljc1IDAgMCAwLTEuMDYgMS4wNloiIGNsaXAtcnVsZT0iZXZlbm9kZCIgLz4KPC9zdmc+Cg=='); opacity: 0.4; } .dataTable .sortASC:after { - border-bottom: 5px solid #666666; + background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0icmdiKDEyMywgMTI5LCAxNDIpIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNTMgMy40N2EuNzUuNzUgMCAwIDAtMS4wNiAwTDYuMjIgNi43MmEuNzUuNzUgMCAwIDAgMS4wNiAxLjA2TDEwIDUuMDZsMi43MiAyLjcyYS43NS43NSAwIDEgMCAxLjA2LTEuMDZsLTMuMjUtMy4yNVoiICAvPgo8L3N2Zz4='); } .dataTable .sortDESC:after { - border-top: 5px solid #666666; - top: 18px; -} - -.dataTable select.filters, -.dataTable select.limit { - -webkit-appearance: none; -} - -.caret::after { - content: ""; - width: 0; - height: 0; - border: 5px solid transparent; - border-top: 5px solid #666666; - position: absolute; + background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0icmdiKDEyMywgMTI5LCAxNDIpIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi4yLDEzLjNsMy4yLDMuMmMuMy4zLjguMywxLjEsMGwzLjItMy4yYy4zLS4zLjMtLjgsMC0xLjFzLS44LS4zLTEuMSwwYzAsMCwwLDAsMCwwbC0yLjcsMi43LTIuNy0yLjdjLS4zLS4zLS44LS4zLTEuMSwwLS4zLjMtLjMuNywwLDFaIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIC8+Cjwvc3ZnPg=='); } - .dataTable .expandable, .dataTable .draggable { border-right: 0px !important; @@ -1195,37 +921,37 @@ table.smallIntBorder td.noPadding { } .dataTable .expander { - display: block; - padding: 15px 10px; cursor: pointer; + position: relative; } .dataTable .expander:before { content: ""; - border: solid #999; - border-width: 0 2px 2px 0; - display: inline-block; - padding: 4px; - transform: rotate(-45deg); - -webkit-transform: rotate(-45deg); + background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0icmdiKDEyMywgMTI5LCAxNDIpIj4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04LjIyIDUuMjJhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0LjI1IDQuMjVhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNC4yNSA0LjI1YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTEuOTQgMTAgOC4yMiA2LjI4YS43NS43NSAwIDAgMSAwLTEuMDZaIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIC8+Cjwvc3ZnPgo='); + background-position: left center; + background-repeat: no-repeat; + background-size: 95%; + position: absolute; + height: 100%; + width: 100%; + left: 0; + top: 0; + opacity: 0.5; + transform: rotate(0); + -webkit-transform: rotate(0); transition: transform 0.2s; pointer-events: none; } .dataTable .expander:hover:before { - border-color: #444; + opacity: 1; } .dataTable .expander.expanded:before { - transform: rotate(45deg); - -webkit-transform: rotate(45deg); + transform: rotate(90deg); + -webkit-transform: rotate(90deg); } -.whitespace-nowrap { - white-space: nowrap; -} - - @-moz-keyframes spin { from { -moz-transform: rotate(0deg); @@ -1253,18 +979,22 @@ table.smallIntBorder td.noPadding { } } +.submitted { + position: relative; +} .submitted::before { content: " "; - display: inline-block; - background: url("../img/refresh.png") no-repeat 0 0; - background-size: 100%; + display: inline-flex; + background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iY3VycmVudENvbG9yIiBjbGFzcz0ic2l6ZS00Ij4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMy44MzYgMi40NzdhLjc1Ljc1IDAgMCAxIC43NS43NXYzLjE4MmEuNzUuNzUgMCAwIDEtLjc1Ljc1aC0zLjE4MmEuNzUuNzUgMCAwIDEgMC0xLjVoMS4zN2wtLjg0LS44NDFhNC41IDQuNSAwIDAgMC03LjA4LjkzMi43NS43NSAwIDAgMS0xLjMtLjc1IDYgNiAwIDAgMSA5LjQ0LTEuMjQybC44NDIuODRWMy4yMjdhLjc1Ljc1IDAgMCAxIC43NS0uNzVabS0uOTExIDcuNUEuNzUuNzUgMCAwIDEgMTMuMTk5IDExYTYgNiAwIDAgMS05LjQ0IDEuMjQxbC0uODQtLjg0djEuMzcxYS43NS43NSAwIDAgMS0xLjUgMFY5LjU5MWEuNzUuNzUgMCAwIDEgLjc1LS43NUg1LjM1YS43NS43NSAwIDAgMSAwIDEuNUgzLjk4bC44NDEuODQxYTQuNSA0LjUgMCAwIDAgNy4wOC0uOTMyLjc1Ljc1IDAgMCAxIDEuMDI1LS4yNzNaIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIC8+Cjwvc3ZnPgo=') no-repeat 0 0; + background-size: 1.4rem; + background-position: center center; animation: spin 2s infinite linear; - position: relative; - top: 3px; - right: 5px; - height: 14px; - width: 14px; - opacity: 0.65; + position: absolute; + top: 0; + right: 0; + height: 100%; + width: 100%; + opacity: 0.60; } /* multi-part form: progress indicator classes */ @@ -1335,16 +1065,20 @@ table.smallIntBorder td.noPadding { background: linear-gradient(to left top, #402568 2%, #935ee1 65%, #a871ec) no-repeat fixed; } -.body-gradient-fuchsia { - background: radial-gradient(80% 1000px at 20% 500px, #ef99c7 0%, #794d95 100%) no-repeat fixed ; +.body-gradient-indigo { + background: radial-gradient(80% 1000px at 20% 500px, #818cf8 0%, #4f46e5 100%) no-repeat fixed ; } .body-gradient-blue { - background: radial-gradient(80% 1000px at 20% 500px, #63B3ED 0%, #3182CE 100%) no-repeat fixed ; + background: radial-gradient(80% 1000px at 20% 500px, #60a5fa 0%, #2563eb 100%) no-repeat fixed ; } -.body-gradient-indigo { - background: radial-gradient(80% 1000px at 20% 500px, #7F9CF5 0%, #5A67D8 100%) no-repeat fixed ; +.body-gradient-sky { + background: radial-gradient(80% 1000px at 20% 500px, #7dc7ea 0%, #0ea5e9 100%) no-repeat fixed ; +} + +.body-gradient-teal { + background: radial-gradient(80% 1000px at 20% 500px, #2dd4bf 0%, #0d9488 100%) no-repeat fixed ; } .body-gradient-green { @@ -1352,29 +1086,25 @@ table.smallIntBorder td.noPadding { } .body-gradient-yellow { - background: radial-gradient(80% 1000px at 20% 500px, #ECC94B 0%, #D69E2E 100%) no-repeat fixed ; + background: radial-gradient(80% 1000px at 20% 500px, #facc15 0%, #f59e0b 100%) no-repeat fixed ; } .body-gradient-orange { - background: radial-gradient(80% 1000px at 20% 500px, #F6AD55 0%, #DD6B20 100%) no-repeat fixed ; + background: radial-gradient(80% 1000px at 20% 500px, #fb923c 0%, #ea580c 100%) no-repeat fixed ; } .body-gradient-red { - background: radial-gradient(80% 1000px at 20% 500px, #FC8181 0%, #E53E3E 100%) no-repeat fixed ; + background: radial-gradient(80% 1000px at 20% 500px, #e16363 0%, #b91c1c 100%) no-repeat fixed ; } .body-gradient-pink { background: radial-gradient(80% 1000px at 20% 500px, #F687B3 0%, #D53F8C 100%) no-repeat fixed ; } -.standardForm:not(.blank) .formRow:not(:last-child) { - border-bottom-width: 1px; -} - -.\-bottom-px { - bottom: -1px; +.body-gradient-fuchsia { + background: radial-gradient(80% 1000px at 20% 500px, #df8aee 0%, #a143aa 100%) no-repeat fixed ; } -.shadow-top { - box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.1), 0 -2px 2px -1px rgba(0, 0, 0, 0.1); +.standardForm:not(.blank) .formRow:not(:last-child) { + border-bottom-width: 1px; } diff --git a/themes/Default/manifest.php b/themes/Default/manifest.php index d400c0e73d..919121d896 100644 --- a/themes/Default/manifest.php +++ b/themes/Default/manifest.php @@ -32,11 +32,14 @@ // Optionally define a set of theme colours that this theme supports. $themeColours = [ 'purple' => __('Purple'), - 'blue' => __('Blue'), 'indigo' => __('Indigo'), + 'blue' => __('Blue'), + 'sky' => __('Sky'), + 'teal' => __('Teal'), 'green' => __('Green'), 'yellow' => __('Yellow'), 'orange' => __('Orange'), 'red' => __('Red'), 'pink' => __('Pink'), + 'fuchsia' => __('Violet'), ];