public Table getSearchTable(IWContext iwc) { // *** Search Table *** START - the uppermost table Table table = new Table(); table.setBorder(0); table.setCellpadding(0); table.setCellspacing(0); int col = 1; int row = 1; Image space1 = (Image) this.transGIF.clone(); space1.setWidth(6); // *** HEADING Search pupil *** table.add(space1, col, row); Text pupilTxt = new Text(localize(KEY_SEARCH_PUPIL_HEADING, "Search pupil")); pupilTxt.setFontStyle(STYLE_UNDERLINED_SMALL_HEADER); table.add(pupilTxt, col++, row); table.setRowHeight(row, "40"); table.setRowVerticalAlignment(row, Table.VERTICAL_ALIGN_BOTTOM); col = 1; row++; // User search module - configure and add SearchUserModule searchMod = getSearchUserModule(); table.add(searchMod, col++, row); // Get pupil if only one found try { searchMod.process(iwc); User oneChild = searchMod.getUser(); if (oneChild != null) { this.pupil = oneChild; } } catch (Exception e) { } return table; }
// public PresentationObject getVisitForm(IWContext iwc, User userVK) throws // java.rmi.RemoteException { public UIComponent getDoctorForm() { IWResourceBundle iwrb = this.getResourceBundle(_iwc); Form myForm = new Form(); myForm.setName(prmForm); Table table = new Table(3, 3); table.setCellpadding(0); table.setCellspacing(0); table.setBorder(0); table.setVerticalAlignment(1, 1, Table.VERTICAL_ALIGN_TOP); table.setVerticalAlignment(3, 1, Table.VERTICAL_ALIGN_TOP); table.setVerticalAlignment(1, 2, Table.VERTICAL_ALIGN_BOTTOM); table.setVerticalAlignment(1, 3, Table.VERTICAL_ALIGN_BOTTOM); table.setWidth(400); table.setWidth(2, 1, 15); table.setWidth(1, 1, 73); myForm.add(table); Age age = null; String doctorInfo = null; if (user != null && user.getDateOfBirth() != null) age = new Age(user.getDateOfBirth()); else if (user != null && user.getPersonalID() != null) age = new Age(PIDChecker.getInstance().getDateFromPersonalID(user.getPersonalID())); int userIDDr = 45; if (age != null && age.getYears() >= 70) { userIDDr = 46; // 45 41047 } PresentationObject picture = null; User doctor = null; int userImageID = -1; try { doctor = ((UserBusiness) IBOLookup.getServiceInstance(_iwc, UserBusiness.class)).getUser(userIDDr); } catch (Exception fe) { log(fe); } if (doctor != null) userImageID = doctor.getSystemImageID(); if (userImageID == -1) { Table fakeImageTable = new Table(1, 1); fakeImageTable.setAlignment(1, 1, Table.HORIZONTAL_ALIGN_CENTER); fakeImageTable.setBorder(4); fakeImageTable.setHeight(140); fakeImageTable.setWidth(100); String fakeImageColor = "#CCCCCC"; Text photoText = new Text(iwrb.getLocalizedString("managerview.photo_text", "Photo")); photoText.setBold(); photoText.setFontColor(fakeImageColor); photoText.setFontSize(Text.FONT_SIZE_12_STYLE_TAG); fakeImageTable.add(photoText, 1, 1); fakeImageTable.setBorderColor(fakeImageColor); picture = fakeImageTable; } else { Image image = new Image(); image.setImageID(userImageID); image.setWidth(73); picture = image; } table.add(picture, 1, 1); if (age != null && age.getYears() >= 70) { doctorInfo = "<b>Dr. Inga Pren</b><br>Allmänläkare<br>Telefon:<br>018-987624<br>Telefontid: Mån-ons, kl 08:30-10.00<br>Webbsida: <a href='http://www.flogsta.se' target='_new'>www.flogsta.se</a>"; } else { doctorInfo = "<b>Dr. Magne Syhl</b><br>Allmänläkare<br>Telefon:<br>018-987654<br>Telefontid: Mån-ons, kl 08-10.00<br>Webbsida: <a href='http://www.gimovc.se' target='_new'>www.gimovc.se</a>"; } table.add(doctorInfo, 3, 1); GenericButton message = getButton(new GenericButton("send_message", localize(prmSendMessage, "Send message"))); if (_messagePage != null) message.setPageToOpen(_messagePage); table.add(message, 3, 2); table.setHeight(3, 2, "25"); GenericButton visitbooking = getButton(new GenericButton("visit", localize(prmVisitBooking, "Book an appointment"))); if (_appointmentPage != null) visitbooking.setPageToOpen(_appointmentPage); SubmitButton smb = new SubmitButton(); smb.setStyleClass("ehealth_InterfaceButton"); smb.setValue("Skicka meddelande >"); smb.setPageToOpen(132); table.add(visitbooking, 3, 3); return myForm; }
private Layer getInfoLayer(int theCase) { Layer layerInfo = new Layer(Layer.DIV); // layerInfo.setOverflow("hidden"); // layerInfo.setVisibility("hidden"); layerInfo.setPositionType("relative"); layerInfo.setWidth("270"); layerInfo.setHeight("100"); layerInfo.setStyleClass("ehealth_row_outer_div"); Table tableInfo = new Table(1, 10); tableInfo.setNoWrap(); tableInfo.setCellpadding(0); tableInfo.setCellspacing(0); tableInfo.setBorder(0); // tableInfo.setWidth(200); int column = 1; tableInfo.setWidth(column, 1, "200"); // tableInfo.setWidth(column++, 1, "70"); Image transpImg = Table.getTransparentCell(_iwc); transpImg.setWidth(15); transpImg.setHeight(16); Layer layer = new Layer(Layer.DIV); layer.setOnMouseOver("setRowColor(this);"); layer.setPositionType("relative"); // layer.setHeight(20); layer.setStyleClass("ehealth_row_div"); Image corners = getBundle(_iwc).getImage("thirdLevel.gif"); corners.setBorder(0); corners.setHeight(16); corners.setWidth(19); layer.setBackgroundImage(corners); int theRow = 1; ArrayList cases = new ArrayList(); if (age != null && age.getYears() >= 70) { if (theCase == 1) { cases.add("Vårdplats:"); cases.add("Journalanteckningar:"); cases.add("Remisser och svar:"); // cases.add("Läkemedel:"); } else if (theCase == 2) { cases.add("Vårdplats:"); cases.add("Journalanteckningar:"); cases.add("Remisser och svar:"); } } else { if (theCase == 1) { cases.add("Vårdplats:"); cases.add("Journalanteckningar:"); // cases.add("Läkemedel:"); } else if (theCase == 2) { cases.add("Vårdplats:"); cases.add("Journalanteckningar:"); // cases.add("Läkemedel:"); } } Iterator iter = cases.iterator(); while (iter.hasNext()) { Layer layers = (Layer) layer.clone(); layers.setID("inf" + theCase + "_" + theRow); String text = (String) iter.next(); layers.add(text); tableInfo.add(layers, column, theRow); theRow++; } layerInfo.add(tableInfo); return layerInfo; }