Changeset 4885
- Timestamp:
- 07/09/08 18:49:48 (4 months ago)
- Files:
-
- openmrs-modules/addresshierarchy/metadata/messages.properties (modified) (1 diff)
- openmrs-modules/addresshierarchy/metadata/moduleApplicationContext.xml (modified) (2 diffs)
- openmrs-modules/addresshierarchy/src/org/openmrs/module/addresshierarchy/extension/html/AdminList.java (modified) (1 diff)
- openmrs-modules/addresshierarchy/web/module/addresshierarchyForm.jsp (deleted)
- openmrs-modules/addresshierarchy/web/module/addresshierarchyTree.jsp (modified) (5 diffs)
- openmrs-modules/addresshierarchy/web/module/addresshierarchymanageForm.jsp (deleted)
- openmrs-modules/addresshierarchy/web/module/resources/autocomplete.css (deleted)
- openmrs-modules/addresshierarchy/web/module/resources/autocomplete.js (deleted)
- openmrs-modules/addresshierarchy/web/module/resources/controls.js (deleted)
- openmrs-modules/addresshierarchy/web/module/resources/effects.js (deleted)
- openmrs-modules/addresshierarchy/web/module/resources/prototype.js (deleted)
- openmrs-modules/addresshierarchy/web/src/org/openmrs/module/addresshierarchy/web/controller/AddressHierarchyCreate.java (deleted)
- openmrs-modules/addresshierarchy/web/src/org/openmrs/module/addresshierarchy/web/controller/AddressHierarchyFormController.java (deleted)
- openmrs-modules/addresshierarchy/web/src/org/openmrs/module/addresshierarchy/web/controller/AddressHierarchyManageFormController.java (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/addresshierarchy/metadata/messages.properties
r4834 r4885 1 1 @MODULE_ID@.title=Address Hierarchy Support Module 2 2 @MODULE_ID@.tree=Address Hiererchy Tree 3 @MODULE_ID@.manage=Manage Hierarchy4 @MODULE_ID@.create=Create Hierarchy5 @MODULE_ID@.edit=Edit Hierarchy6 @MODULE_ID@.delete=Delete Hierarchy7 @MODULE_ID@.createform.title=Create Location8 @MODULE_ID@.manageform.title=Manage Location9 @MODULE_ID@.location.country=Country10 @MODULE_ID@.location.state=State11 @MODULE_ID@.location.sublocation1=Sub Location 112 @MODULE_ID@.location.sublocation2=Sub Location 213 @MODULE_ID@.location.sublocation3=Sub Location 314 @MODULE_ID@.location.sublocation4=Sub Location 415 @MODULE_ID@.location.sublocation5=Sub Location 516 @MODULE_ID@.location.sublocation6=Sub Location 617 @MODULE_ID@.location.postalcode=Postal Code18 @MODULE_ID@.location.longitude=Longitude19 @MODULE_ID@.location.latitude=Latitudeopenmrs-modules/addresshierarchy/metadata/moduleApplicationContext.xml
r4834 r4885 9 9 <property name="mappings"> 10 10 <props> 11 <prop key="module/@MODULE_ID@/addresshierarchy.form">addresshierarchyForm</prop>12 <prop key="module/@MODULE_ID@/addresshierarchymanage.form">addresshierarchymanageForm</prop>13 11 14 12 </props> … … 46 44 <!-- Controllers --> 47 45 48 <bean id="addresshierarchyForm" class="org.openmrs.module.addresshierarchy.web.controller.AddressHierarchyFormController"> 49 <property name="commandName"><value>addresshierarchy</value></property> 50 <property name="commandClass"><value>org.openmrs.module.addresshierarchy.web.controller.AddressHierarchyFormController</value></property> 51 <property name="formView"><value>/module/@MODULE_ID@/addresshierarchyForm</value></property> 52 <property name="successView"><value>addresshierarchy.form</value></property> 53 </bean> 54 <bean id="addresshierarchymanageForm" class="org.openmrs.module.addresshierarchy.web.controller.AddressHierarchyManageFormController"> 55 <property name="commandName"><value>addresshierarchyManage</value></property> 56 <property name="commandClass"><value>org.openmrs.module.addresshierarchy.web.controller.AddressHierarchyManageFormController</value></property> 57 <property name="formView"><value>/module/@MODULE_ID@/addresshierarchymanageForm</value></property> 58 <property name="successView"><value>addresshierarchymanage.form</value></property> 59 </bean> 60 46 61 47 62 48 <!-- /Controllers --> openmrs-modules/addresshierarchy/src/org/openmrs/module/addresshierarchy/extension/html/AdminList.java
r4834 r4885 50 50 Map<String, String> map = new HashMap<String, String>(); 51 51 52 map.put("module/addresshierarchy/addresshierarchy.form", "addresshierarchy.create");53 map.put("module/addresshierarchy/addresshierarchymanage.form", "addresshierarchy.manage");54 52 map.put("module/addresshierarchy/addresshierarchyTree.htm", "addresshierarchy.tree"); 55 53 openmrs-modules/addresshierarchy/web/module/addresshierarchyTree.jsp
r4883 r4885 6 6 <openmrs:htmlInclude file="/dwr/interface/AddressHierarchy.js"/> 7 7 <openmrs:htmlInclude file="/moduleResources/addresshierarchy/jquery.js" /> 8 8 <style> 9 .dojoTree { 10 -x-system-font:caption; 11 font-family:-moz-use-system-font; 12 font-size:14px; 13 font-size-adjust:-moz-use-system-font; 14 font-stretch:-moz-use-system-font; 15 font-style:-moz-use-system-font; 16 font-variant:-moz-use-system-font; 17 font-weight:normal; 18 line-height:-moz-use-system-font; 19 overflow:auto; 20 } 21 </style> 9 22 10 23 <script type="text/javascript"> … … 22 35 var TreeBuilder = { 23 36 buildTreeNodes:function (dataObjs, treeParentNode){ 37 var arr=new Array("Start","Country","State","Sub Location1","Sub Location2","Sub Location3","Sub Location4","Sub Location5","Sub Location6","Postal Code","Longitude","Latitude"); 38 24 39 for(var i=0; i<dataObjs.length;i++){ 25 var node = dojo.widget.createWidget("TreeNode",{ 26 title:dataObjs[i].title , locationId:dataObjs[i].locationId , typeId:dataObjs[i].typeId , parentId:dataObjs[i].parentId 27 }); 40 var typ = dataObjs[i].typeId; 41 var dumm = parseInt(typ); 42 var titl = dataObjs[i].title+"( "+arr[dumm]+" )"; 43 var node = dojo.widget.createWidget("TreeNode",{ 44 title:titl ,locationName:dataObjs[i].title, locationId:dataObjs[i].locationId , typeId:dataObjs[i].typeId , parentId:dataObjs[i].parentId 45 }); 28 46 treeParentNode.addChild(node); 29 47 treeParentNode.registerChild(node,i); … … 71 89 else{ 72 90 var rad = this.controller; 73 AddressHierarchy.createLocation(titl,typeid,parent.locationId,function(data){ 74 var res = rad.createChild(parent, 0, { title: data[0], locationId : data[1],typeId : data[2], parentId : data[3] }); 91 AddressHierarchy.createLocation(titl,parseInt(dummy)-1,parent.locationId,function(data){ 92 var arr=new Array("Start","Country","State","Sub Location1","Sub Location2","Sub Location3","Sub Location4","Sub Location5","Sub Location6","Postal Code","Longitude","Latitude"); 93 var dumm = parseInt(data[2]); 94 var titl = data[0]+"( "+arr[dumm]+" )"; 95 var res = rad.createChild(parent, 0, { title: titl,locationName:data[0], locationId : data[1],typeId : data[2], parentId : data[3] }); 75 96 }) 76 97 … … 92 113 } 93 114 else{ 94 var name = node. title;115 var name = node.locationName; 95 116 var parid = node.parentId; 96 117 this.controller = dojo.widget.manager.getWidgetById(controllerId); … … 116 137 } 117 138 else{ 118 var oldname = node. title;139 var oldname = node.locationName; 119 140 var parid = node.parentId; 120 141 this.controller = dojo.widget.manager.getWidgetById(controllerId); 121 142 var rad = this.controller; 122 143 var newname = prompt("Enter the location name",oldname); 144 145 if(newname!=null){ 123 146 AddressHierarchy.editLocation(parid,oldname,newname, function(){ 124 node.edit({title:newname}); 125 }) 147 var arr=new Array("Start","Country","State","Sub Location1","Sub Location2","Sub Location3","Sub Location4","Sub Location5","Sub Location6","Postal Code","Longitude","Latitude"); 148 var dumm = parseInt(node.typeId); 149 var titl = newname+"( "+arr[dumm]+" )"; 150 node.edit({title:titl , locationName:newname}); 151 })} 126 152 } 127 153 }