예제 #1
0
        protected override void SetTabSpecific()
        {
            foreach (Core.Helpers.Elements.Tabs.Tab tab in this.Tabs)
            {
                switch (tab.Id)
                {
                case "Calendar":
                    Core.Helpers.Elements.Ajax.Element calendar = new Core.Helpers.Elements.Ajax.Element("Calendar");
                    calendar.Url = "/cover/slips/ajax/calendar/";
                    calendar.ShowLoadingMessage = true;
                    calendar.GetPath            = true;

                    tab.Content.SetVariable("AjaxCalendar", calendar.ToString());
                    break;

                case "Requests":
                    Core.Helpers.Elements.Search.SearchArea requestsSearch = new Core.Helpers.Elements.Search.SearchArea("Requests");
                    requestsSearch.AjaxUrl       = "/cover/slips/ajax/requests/";
                    requestsSearch.AjaxStatusUrl = "/cover/slips/ajax/requests/status/";
                    requestsSearch.GetSourcePath = true;
                    requestsSearch.AddCustomField("Date", null);
                    requestsSearch.AddButton("search.png", null, "doSearch('Requests');", "Click to search.");
                    requestsSearch.AddButton("refresh.png", null, "resetSearch('Requests');", "Click to reset the cover requests list below.");
                    requestsSearch.AddButton("printpaper.png", null, "printSlips();", "Print slips for all the cover requests listed below.");

                    tab.Content.SetVariable("SearchRequests", requestsSearch.ToString());
                    break;
                }
            }
        }
예제 #2
0
        protected override void SetTabSpecific()
        {
            foreach (Core.Helpers.Elements.Tabs.Tab tab in this.Tabs)
            {
                switch (tab.Id)
                {
                case "Calendar":
                    Core.Helpers.Elements.Ajax.Element calendar = new Core.Helpers.Elements.Ajax.Element("Calendar");
                    calendar.Url = "/cover/arrange/calendar/ajax/";
                    calendar.ShowLoadingMessage = true;
                    calendar.GetPath            = true;

                    tab.Content.SetVariable("AjaxCalendar", calendar.ToString());
                    break;
                }
            }
        }
예제 #3
0
		protected override void SetTabSpecific() {
			foreach (Core.Helpers.Elements.Tabs.Tab tab in this.Tabs) {
				switch (tab.Id) {
					case "Name":
						Core.Helpers.Elements.Forms.BasicForm nameForm = new Core.Helpers.Elements.Forms.BasicForm();
						nameForm.Id = "Name";
						nameForm.FieldWidths = 250;
						nameForm.HasTopSpace = true;
						nameForm.PostUrl = "/staff/modify/update/teaching/name/";

						nameForm.AddHiddenField("StaffId", null, this._staffId.ToString());

						nameForm.AddButton(null, "Reset", null, 6, Core.Helpers.Elements.Forms.ButtonTypes.Reset);
						nameForm.AddButton(null, "Update", null, 5, Core.Helpers.Elements.Forms.ButtonTypes.Submit);

						if (!string.IsNullOrEmpty(this._alert)) {
							switch (this._alert) {
								case "nameallblank":
									Core.Helpers.Elements.Alerts.Alert nameAllBlankAlert = new Core.Helpers.Elements.Alerts.Alert("NameAllBlank");
									nameAllBlankAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Red;
									nameAllBlankAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Name/nameallblank.html").ToString();
									nameAllBlankAlert.NoScript = false;
									nameAllBlankAlert.ShowCloseBox = false;
									nameAllBlankAlert.StartHidden = false;

									nameForm.RightPane.Contents = nameAllBlankAlert.ToString();
									break;
								case "nameincomplete":
									Core.Helpers.Elements.Alerts.Alert nameIncompleteAlert = new Core.Helpers.Elements.Alerts.Alert("NameIncomplete");
									nameIncompleteAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Red;
									nameIncompleteAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Name/nameincomplete.html").ToString();
									nameIncompleteAlert.NoScript = false;
									nameIncompleteAlert.ShowCloseBox = false;
									nameIncompleteAlert.StartHidden = false;

									nameForm.RightPane.Contents = nameIncompleteAlert.ToString();
									break;
								case "namesuccess":
									Core.Helpers.Elements.Alerts.Alert nameSuccessAlert = new Core.Helpers.Elements.Alerts.Alert("NameSuccess");
									nameSuccessAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Green;
									nameSuccessAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Name/namesuccess.html").ToString();
									nameSuccessAlert.NoScript = false;
									nameSuccessAlert.ShowCloseBox = false;
									nameSuccessAlert.StartHidden = false;

									nameForm.RightPane.Contents = nameSuccessAlert.ToString();
									break;
								case "namenew":
									Core.Helpers.Elements.Alerts.Alert newStaffMemberAlert = new Core.Helpers.Elements.Alerts.Alert("NewStaffMember");
									newStaffMemberAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Green;
									newStaffMemberAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Name/new.html").ToString();
									newStaffMemberAlert.NoScript = false;
									newStaffMemberAlert.ShowCloseBox = false;
									newStaffMemberAlert.StartHidden = false;

									nameForm.RightPane.Contents = newStaffMemberAlert.ToString();
									break;
								default:
									nameForm.RightPane.Contents = " ";
									break;
							}
						}
						else
							nameForm.RightPane.Contents = " ";

						Core.Helpers.Elements.Forms.Row titleRow = nameForm.AddRow();
						titleRow.Description = "<strong>Title</strong>";
						titleRow.SetToTextField("Title", null, this._name.Title, 1, 0, false, false);

						Core.Helpers.Elements.Forms.Row forenameRow = nameForm.AddRow();
						forenameRow.Description = "<strong>Forename</strong>";
						forenameRow.SetToTextField("Forename", null, this._name.Forename, 2, 0, false, false);

						Core.Helpers.Elements.Forms.Row surnameRow = nameForm.AddRow();
						surnameRow.Description = "<strong>Surname</strong>";
						surnameRow.SetToTextField("Surname", null, this._name.Surname, 3, 0, false, false);

						Core.Helpers.Elements.Forms.Row holdingNameRow = nameForm.AddRow();
						holdingNameRow.Description = "<strong>Holding Name</strong>";
						holdingNameRow.SetToTextField("HoldingName", null, this._name.HoldingName, 4, 0, false, true);

						tab.Content.SetVariable("NameForm", nameForm.ToString());
						break;
					case "Entitlement":
						Core.Helpers.Elements.Forms.BasicForm entitlementForm = new Core.Helpers.Elements.Forms.BasicForm();
						entitlementForm.Id = "Entitlement";
						entitlementForm.HasTopSpace = true;
						entitlementForm.FieldWidths = 250;
						entitlementForm.PostUrl = "/staff/modify/update/teaching/entitlement/";

						entitlementForm.AddHiddenField("StaffId", null, this._staffId.ToString());

						entitlementForm.AddButton(null, "Reset", null, 3, Core.Helpers.Elements.Forms.ButtonTypes.Reset);
						entitlementForm.AddButton(null, "Update", null, 2, Core.Helpers.Elements.Forms.ButtonTypes.Submit);

						if (!string.IsNullOrEmpty(this._alert)) {
							switch (this._alert) {
								case "entitlementbad":
									Core.Helpers.Elements.Alerts.Alert entitlementBadAlert = new Core.Helpers.Elements.Alerts.Alert("EntitlementBad");
									entitlementBadAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Red;
									entitlementBadAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Entitlement/entitlementbad.html").ToString();
									entitlementBadAlert.NoScript = false;
									entitlementBadAlert.ShowCloseBox = false;
									entitlementBadAlert.StartHidden = false;

									entitlementForm.RightPane.Contents = entitlementBadAlert.ToString();
									break;
								case "entitlementsuccess":
									Core.Helpers.Elements.Alerts.Alert entitlementSuccessAlert = new Core.Helpers.Elements.Alerts.Alert("EntitlementSuccess");
									entitlementSuccessAlert.Colour = Core.Helpers.Elements.Alerts.Colours.Green;
									entitlementSuccessAlert.Message = new Core.Helpers.Constructor("/Alerts/Specific/Staff/Modify/Teaching/Entitlement/entitlementsuccess.html").ToString();
									entitlementSuccessAlert.NoScript = false;
									entitlementSuccessAlert.ShowCloseBox = false;
									entitlementSuccessAlert.StartHidden = false;

									entitlementForm.RightPane.Contents = entitlementSuccessAlert.ToString();
									break;
							}
						}
						else
							entitlementForm.RightPane.Contents = "&nbsp;";

						Core.Helpers.Elements.Forms.Row entitlementRow = entitlementForm.AddRow();
						entitlementRow.Description = "<strong>Entitlement Value</strong>";
						entitlementRow.SetToTextField("Entitlement", null, this._entitlement.ToString(), 1, Core.WebServer.PleaseTakes.Session.CurrentInstance.School.Settings.Timetabling.Layout.NoPeriods.ToString().Length, false, false);

						tab.Content.SetVariable("EntitlementForm", entitlementForm.ToString());
						tab.Content.SetVariable("MaxPeriods", Core.WebServer.PleaseTakes.Session.CurrentInstance.School.Settings.Timetabling.Layout.NoPeriods.ToString());
						break;
					case "Account":
						tab.Content.SetVariable("AccountForm", this.InitialiseAccountForm().ToString());
						break;
					case "Department":
						Core.Helpers.Elements.Search.SearchArea departmentSearch = new Core.Helpers.Elements.Search.SearchArea("Department");
						departmentSearch.AjaxUrl = "/staff/modify/ajax/teaching/department/" + this._staffId + "/search/";
						departmentSearch.AjaxStatusUrl = "/staff/modify/ajax/teaching/department/status/";
						departmentSearch.AddButton("search.png", null, "doSearch('Department');", "Click here to search for departments.");
						departmentSearch.AddButton("refresh.png", null, "resetSearch('Department');", "Click here to reset the department search.");

						tab.Content.SetVariable("DepartmentSearchArea", departmentSearch.ToString());
						break;
					case "Timetable":
						Core.Helpers.Elements.Ajax.Element ajaxTimetableArea = new Core.Helpers.Elements.Ajax.Element("Timetable");
						ajaxTimetableArea.ShowLoadingMessage = true;
						ajaxTimetableArea.GetPath = true;
						ajaxTimetableArea.Url = "/staff/modify/ajax/teaching/timetable/" + this._staffId + "/";

						Core.Helpers.Elements.Alerts.Alert statusAlert = this.GetTimetableStatusMessage();

						if (statusAlert == null)
							tab.Content.DeleteVariable("UpdateAlert");
						else
							tab.Content.SetVariable("UpdateAlert", statusAlert.ToString());

						tab.Content.SetVariable("AjaxTimetable", ajaxTimetableArea.ToString());
						break;
				}
			}
		}