showDetailBudget()
}
public function showDetailBudget():void
{
var i:Number
if (currentBudgetItem == null)
{
return;
}
oid_GUI.text = currentBudgetItem.@oid.toString();
code_GUI.text = currentBudgetItem.@code.toString();
texte_GUI.text = currentBudgetItem.@texte.toString();
var urlVariables:URLVariables = new URLVariables()
urlVariables.budget_id = currentBudgetItem.@oid.toString();
CTI_Utilitaires.startRequestHTTP("modules/activite/php/httpService_ACTI_budgetManager_getBudget.php", urlVariables, exec, true, this.parentApplication)
function exec(resultatService:XML):void
{
BUDGET_XML = resultatService
detailBox.percentWidth = 100
listBox.width = 0
}
}
public function setUpdated():void
{
budgetUpdated = true
}
private function askCancelBudget():void
{
if (budgetUpdated == false)
{
hideBudget()
return;
}
Alert.yesLabel = "OUI";
Alert.noLabel = "NON";
var alert:Alert = Alert.show("Les données ont été changées, désirez vous les annuler ?", "Gestion budgets", 3, this, alertClickHandler, question_class);
function alertClickHandler(event:CloseEvent):void
{
if (event.detail == Alert.YES)
{
hideBudget()
}
else
{
}
}
}
private function hideBudget():void
{
detailBox.width = 0
listBox.percentWidth = 100
currentBudgetItem = null;
budgetUpdated = false;
}
private function askDeleteBudget():void
{
Alert.yesLabel = "OUI";
Alert.noLabel = "NON";
var alert:Alert = Alert.show("Désirez vous vraiment supprimer le budget " + texte_GUI.text + " ?", "Gestion budgets", 3, this, alertClickHandler, question_class);
function alertClickHandler(event:CloseEvent):void
{
if (event.detail == Alert.YES)
{
deleteBudget()
}
else
{
}
}
}
public function deleteBudget():void
{
updateBudget("delete")
}
public function copyBudget():void
{
updateBudget("copy")
}
public function saveBudget():void
{
updateBudget("save")
}
public function updateBudget(action:String):void
{
trace(BUDGET_XML.toXMLString())
var urlVariables:URLVariables = new URLVariables()
urlVariables.action = action
BUDGET_XML.@oid = oid_GUI.text
BUDGET_XML.@code = code_GUI.text
BUDGET_XML.@texte = texte_GUI.text
urlVariables.xmldef = "" + BUDGET_XML.toXMLString();
CTI_Utilitaires.startRequestHTTP("modules/activite/php/httpService_ACTI_budgetManager_setBudget.php", urlVariables, exec, true, this.parentApplication)
function exec(resultatService:XML):void
{
getData()
detailBox.width = 0
listBox.percentWidth = 100
currentBudgetItem = null;
budgetUpdated = false;
}
}
]]>