import custom.components.create_update.UpdateSR; import custom.components.details.AttachmentLink; import custom.components.details.ContactList; import custom.components.details.DetailsText; import custom.components.details.SplitLabel; import flash.events.Event; import flash.events.MouseEvent; import mx.controls.Image; import mx.controls.Spacer; import mx.events.FlexEvent; private var _baseURL:String; public function set baseURL(value:String):void{_baseURL = value;} public function get baseURL():String{return _baseURL;} private var _gridClick:Function; public function set gridClick(value:Function):void{_gridClick = value;} public function get gridClick():Function{return _gridClick;} [Bindable] private var _productChange:Function; public function set productChange(value:Function):void{_productChange = value;} public function get productChange():Function{return _productChange;} [Bindable] private var _productDefaults:Function; public function set productDefaults(value:Function):void{_productDefaults = value;} public function get productDefaults():Function{return _productDefaults;} [Bindable] private var _editServiceRequest:Function; public function set editServiceRequest(value:Function):void{_editServiceRequest = value;} public function get editServiceRequest():Function{return _editServiceRequest;} private var _user:String; public function set user(value:String):void{_user = value;} public function get user():String{return _user;} private var issueDetails:Object = new Object(); public function set details(issue:Object):void{ //Set Issue issueDetails = issue; //Set Properties properties = issue; //Set Contacts contacts = issue.contacts; //Set Description desc = issue; //Set or Hide Resolution if ( issue.resolution != null && issue.resolution != "") resolve = issue.resolution else display(resolution,false); //Set of hide Journals if ( issue.journals != null && issue.journals.length != 0 && issue.journals != "") journals = issue.journals; else display(updates,false); } public function set properties(issue:Object):void{ idLabel.text = issue.id; subject.text = issue.subject; setDateProperty(start,startLabel,issue.start_date); setDateProperty(due,dueLabel,issue.due_date); setProperty(product,productBox,issue.product); setProperty(version,versionBox,issue.version); setProperty(module,moduleBox,issue.product_module); related = issue.relations_list; } public function set related(relations:Object):void{ //Clear Relations relatedWrapper.removeAllChildren(); //Loop through Relations creating them and appending for each (var relation:Object in relations) relatedWrapper.addChild(new Relation(relation,_gridClick)); //Display if there are any relations.length == 0 ? display(relatedList,false) : display(relatedList,true); } public function set contacts(contacts:Object):void{ //Clear Contacts contactWrapper.removeAllChildren(); //Loop through contacts creating them and appending contactWrapper.addChild(new ContactList(contacts)); //Display if there are any contacts.length == 0 ? display(contactList,false) : display(contactList,true); } public function set desc(issue:Object):void{ //Clear Description description.removeAllChildren(); //Add Author and Date description.addChild(new SplitLabel(issue.created_on,issue.author.firstname + " " + issue.author.lastname)); //Add Description Text description.addChild(new DetailsText(issue.textilize_description,true)); //Loop through initial attachments for each (var attachment:Object in issue.initial_attachments) description.addChild(new AttachmentLink(String(attachment),_baseURL)); } public function set resolve(resolveText:String):void{ //Set Resolution Text resolutionText.htmlText = resolveText; //Display Resolution display(resolution,true); } public function set journals(journals:Object):void{ //Clear updates updates.removeAllChildren(); //Make Visible display(updates,true); //Loop Through Journals backwards to get newest first for ( var index:Number = journals.length-1; index >= 0; index-- ){ //Create a spacer 15px high to be placed after details list var space:Spacer = new Spacer();space.height=15; //Add Date and Author updates.addChild(new SplitLabel(journals[index].created_on,journals[index].user.firstname + " " + journals[index].user.lastname)); //Add Note updates.addChild(new DetailsText(journals[index].notes,false)); //Loop Through Details for each (var detail:Object in journals[index].details) { //Create Link if (String(detail).indexOf("