Update of /cvsroot/compiere/webStore/src/java/org/compiere/ifm/app/pages In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22337/src/java/org/compiere/ifm/app/pages Modified Files: Tag: pbs_payment ContactDetail.java CreateEditContact.java Search.java ContactList.java Log Message: Index: ContactDetail.java =================================================================== RCS file: /cvsroot/compiere/webStore/src/java/org/compiere/ifm/app/pages/Attic/ContactDetail.java,v retrieving revision 1.1.2.18 retrieving revision 1.1.2.19 diff -C2 -d -r1.1.2.18 -r1.1.2.19 *** ContactDetail.java 21 Nov 2006 09:24:16 -0000 1.1.2.18 --- ContactDetail.java 23 Mar 2007 12:42:08 -0000 1.1.2.19 *************** *** 224,227 **** --- 224,229 ---- } contactDetails.getLocations().clear(); + + if(primaryLocation != null) contactDetails.addLocation(primaryLocation); res = pstmt.executeQuery(); Index: CreateEditContact.java =================================================================== RCS file: /cvsroot/compiere/webStore/src/java/org/compiere/ifm/app/pages/Attic/CreateEditContact.java,v retrieving revision 1.1.2.29 retrieving revision 1.1.2.30 diff -C2 -d -r1.1.2.29 -r1.1.2.30 *** CreateEditContact.java 21 Nov 2006 09:24:16 -0000 1.1.2.29 --- CreateEditContact.java 23 Mar 2007 12:42:08 -0000 1.1.2.30 *************** *** 102,115 **** phonesModel = new ListDataModel(getContactDetail().getPhones()); locationsModel = new ListDataModel(getContactDetail().getLocations()); okToContinueWithDuplicate=false; setDuplicate(false); } public String delAddress_action() { ! ((PO) contactDetail.getLocations().get( ! getLocationsModel().getRowIndex())).delete(); contactDetail.getLocations().remove(getLocationsModel().getRowIndex()); return null; } public String newAddress_action() { --- 102,125 ---- phonesModel = new ListDataModel(getContactDetail().getPhones()); locationsModel = new ListDataModel(getContactDetail().getLocations()); + okToContinueWithDuplicate=false; setDuplicate(false); } + + public String delAddress_action() { ! //befor deleting location make sure that there is at least one primary adr. ! if(((M_IFM_Contact_Location) contactDetail.getLocations().get(getLocationsModel().getRowIndex())).isPrimarylocation()==true){ ! message =" You can't delete primary location, a contact has to have a primary location."; ! return null; ! } ! ! ! ((PO) contactDetail.getLocations().get(getLocationsModel().getRowIndex())).delete(); contactDetail.getLocations().remove(getLocationsModel().getRowIndex()); return null; } + public String newAddress_action() { *************** *** 432,436 **** public void addLocation() { M_IFM_Contact_Location location = new M_IFM_Contact_Location(getCtx(), null); ! location.setLocationname("Address "+(getContactDetail().getLocations().size()+1)); getContactDetail().getLocations().add(location); --- 442,452 ---- public void addLocation() { M_IFM_Contact_Location location = new M_IFM_Contact_Location(getCtx(), null); ! ! if(getContactDetail().getLocations().size()==0){ //if it is the first contact then make it defaukt to primary ! location.setPrimarylocation(true); ! } ! ! location.setLocationname("Address "+(getContactDetail().getLocations().size()+1)); ! getContactDetail().getLocations().add(location); *************** *** 519,529 **** public Collection getCurrentRegions(){ - int countryID = ((M_IFM_Contact_Location)FacesContext - .getCurrentInstance().getExternalContext() - .getRequestMap().get("currentRow")).getC_Country_ID(); ! MRegion[] regs = MRegion.getRegions(getCtx(),countryID); Collection coll = new ArrayList(regs.length); for(int i = 0 ; i<regs.length; i++){ coll.add(new SelectItem(new Integer(regs[i].getC_Region_ID()),regs[i].getName())); } --- 535,557 ---- public Collection getCurrentRegions(){ ! int countryID=0; ! ! M_IFM_Contact_Location lo = ((M_IFM_Contact_Location)FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("currentRow")); ! ! if(lo != null) ! countryID=lo.getC_Country_ID(); ! ! /*if(countryID==-1){ ! WebOrg m_DefaultOrg = SiteEnv.getDefaultOrg(getCtx()); ! if (m_DefaultOrg != null && m_DefaultOrg.getC_Country_ID() > 0) ! countryID=m_DefaultOrg.getC_Country_ID(); ! }*/ ! ! MRegion[] regs = MRegion.getRegions(getCtx(),countryID); Collection coll = new ArrayList(regs.length); for(int i = 0 ; i<regs.length; i++){ + + if(regs[i].getName() != null) coll.add(new SelectItem(new Integer(regs[i].getC_Region_ID()),regs[i].getName())); } Index: Search.java =================================================================== RCS file: /cvsroot/compiere/webStore/src/java/org/compiere/ifm/app/pages/Attic/Search.java,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -C2 -d -r1.1.2.12 -r1.1.2.13 *** Search.java 21 Nov 2006 09:24:16 -0000 1.1.2.12 --- Search.java 23 Mar 2007 12:42:08 -0000 1.1.2.13 *************** *** 85,90 **** else contacts = ContactSearch.advancedSearchContacts(ctx,wuser,query,selectionSearch); } ! catch (RuntimeException e){ ! setMessage(e.getMessage()); return "backSearch"; //reload search.jsp } --- 85,90 ---- else contacts = ContactSearch.advancedSearchContacts(ctx,wuser,query,selectionSearch); } ! catch (Exception e){ ! setMessage("Error: "+e); return "backSearch"; //reload search.jsp } Index: ContactList.java =================================================================== RCS file: /cvsroot/compiere/webStore/src/java/org/compiere/ifm/app/pages/Attic/ContactList.java,v retrieving revision 1.1.2.16 retrieving revision 1.1.2.17 diff -C2 -d -r1.1.2.16 -r1.1.2.17 *** ContactList.java 8 Jan 2007 14:36:33 -0000 1.1.2.16 --- ContactList.java 23 Mar 2007 12:42:08 -0000 1.1.2.17 *************** *** 159,162 **** --- 159,180 ---- return "contactDetail"; } + + public String contactFileList_action() { + + ContactDetail detail = (ContactDetail) getBean("ContactDetail"); + detail.setContactDetail( (M_IFM_Contacts) getContactList().get(getContactListModel().getRowIndex()+fromindex)); + ContactSearch.loadAllDetails(detail.getContactDetail()); + setContactListTable(null); + + detail.setAccess(); + + FileList list = (FileList) getBean("FileList"); + ContactSearch.loadFileList(detail.getContactDetail()); + return "fileList"; + + } + + + /** * @return Returns the contactList. |