slash and burn trace statements, and fix areas on vector background layers
[potlatch2.git] / net / systemeD / potlatch2 / RelationSelectPanel.mxml
index 66b78b63e165df2cec84c12bdebb1dce9191705d..93193768833fa9474ccf5697d6e1114949faaf80 100644 (file)
         private var conn:Connection;
         private var relationList:Array;
         private var entity:Entity;
+               private var tags:Object;
 
-        public function init(e:Entity):void {
+        public function init(e:Entity, t:Object):void {
           entity = e;
+                 tags = t;
           PopUpManager.addPopUp(this, Application(Application.application), true);
           PopUpManager.centerPopUp(this);
     
           var titles:Array = [];
           conn = Connection.getConnectionInstance();
-          relationList = conn.getAllRelationIDs();
+          relationList = conn.getMatchingRelationIDs(tags);
           if (relationList.length == 0) {
-            warning.text = "No relations loaded";
+            warning.text = "No relations available";
           } else {
             warning.text = "These relations are available:";
           }
         }
         
         public function closeAndNewRelation():void {
-          var relation:Relation = conn.createRelation({}, [new RelationMember(entity, '')],
+          var relation:Relation = conn.createRelation(tags, [new RelationMember(entity, '')],
               MainUndoStack.getGlobalStack().addAction)
           PopUpManager.removePopUp(this);
-          trace("edit relation "+id);
           var panel:RelationEditorPanel = RelationEditorPanel(
               PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
           panel.setRelation(relation);