
619 N.E.2d 871 (1993)
249 Ill. App.3d 924
189 Ill.Dec. 170
PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Fred COLLINS, Defendant-Appellee, (Illinois Department of Corrections, Intervenor-Appellant).
No. 3-93-0291.
Appellate Court of Illinois, Third District.
September 3, 1993.
*873 Michael A. Hurst, Asst. Atty. Gen. (argued), Chicago, for Ill. Dept. of Corrections.
Martin Abrams (argued), Chicago, for Fred Collins.
James Glasgow, Will County State's Atty., Joliet, for the People.
Presiding Justice McCUSKEY delivered the opinion of the court:
On April 5, 1993, the circuit court of Will County issued an order directing the Illinois Department of Corrections (IDOC) to transport the defendant, Fred Collins, to Will County for a hearing on his petition for post-conviction relief. The order further directed IDOC to remand custody of the defendant to the Will County sheriff for the duration of the hearing. IDOC appeals, arguing that the trial court abused its discretion in ordering the defendant brought to Will County.
For reasons which follow, we affirm that portion of the order requiring IDOC to transport the defendant to Will County for the hearing. However, we vacate that portion of the order directing IDOC to remand custody of the defendant to the Will County sheriff. Finally, we remand this case to the circuit court of Will County with the following directions: (1) set a new hearing date for the defendant's petition; and (2) issue a new order of habeas corpus ad testificandum stating that the defendant will remain in the custody of IDOC during the post-conviction proceedings.
The defendant and two others were convicted of the murder of George Bailey. The murder occurred in Stateville prison. All three defendants were sentenced to imprisonment for natural life. (People v. Harris (Collins) (1988), 123 Ill.2d 113, 122 Ill.Dec. 76, 526 N.E.2d 335.) The defendant brought a petition for post-conviction relief for which the trial court appointed counsel. During several changes in counsel appointments, IDOC moved the defendant among several different correctional facilities pursuant to the Interstate Corrections Compact (730 ILCS 5/3-4-4 et seq. (West 1992)). At all times relevant to this appeal, the defendant was incarcerated in a facility in Stillwater, Minnesota.
On March 5, 1993, the trial court ordered IDOC to produce the defendant in the circuit court of Will County on March 30, 1993, so that a hearing date could be set on the petition and to allow a meeting between the defendant and his newly appointed counsel. IDOC refused to produce the defendant on March 30. Instead, it filed motions seeking leave to intervene and asking the court to reconsider its order of March 5. The court granted IDOC leave to intervene but denied its motion to reconsider. The court again ordered IDOC to transfer the defendant to a facility in the vicinity of Will County for the purpose of allowing the defendant to confer with counsel. IDOC then moved for an emergency stay of the trial court's orders of March 5 and March 30.
On April 5, the trial court held a hearing on IDOC's motion to stay the previous orders of March 5 and March 30. IDOC argued that our decision in People v. Lego (1991), 212 Ill.App.3d 6, 155 Ill.Dec. 889, 570 N.E.2d 402, prohibited the court from ordering IDOC to produce the defendant unless his presence was necessary for a hearing. Rather than rule on IDOC's motion, the court again ordered IDOC to produce the defendant. The defendant was to be produced on April 22, 1993. The court also remanded the defendant to the custody of the Will County sheriff. The court additionally set the defendant's post-conviction petition for hearing on April 23, 1993. Finally, the court vacated its previous orders to the extent of their inconsistency with its April 5 order.
On April 20, 1993, IDOC filed a notice of interlocutory appeal and a motion asking this court to stay the trial court's order. *874 We granted IDOC's motion that same day. We note that the State is not a party to this appeal.
As a preliminary matter, the defendant argues that we have no jurisdiction over this appeal because the trial court's order was not a "final and appealable order". We disagree. We conclude that the order was in the nature of an injunction and therefore, an interlocutory appeal was proper. Supreme Court Rule 307(a)(1) provides that "[a]n appeal may be taken to the Appellate Court from an interlocutory order of court * * * granting, modifying, dissolving, or refusing to dissolve an injunction." (134 Ill.2d R. 307(a)(1).) To determine whether an act of the circuit court operates as an injunction under Rule 307(a)(1), the court must look to the substance of the action and not its form. (Bohn Aluminum & Brass Co. v. Barker (1973), 55 Ill.2d 177, 180, 303 N.E.2d 1.) In Illinois, "[a]ctions of the circuit courts having the force and effect of injunctions are still appealable even if called something else." (In re A Minor (1989), 127 Ill.2d 247, 260, 130 Ill.Dec. 225, 230, 537 N.E.2d 292, 297.) The courts have a policy of broadly construing the meaning of the term "injunction". (Minor, 127 Ill.2d at 261, 130 Ill.Dec. at 231, 537 N.E.2d at 298.) In H.T.A., Ltd. v. Luxion (1991), 211 Ill. App.3d 739, 156 Ill.Dec. 123, 570 N.E.2d 599, the court held that a temporary restraining order requiring one of the parties to accept replacement letters of credit was in the nature of an injunction and thus appealable. The order required the party to "`do a particular thing * * * which operates as a restraint upon a party in the exercise of his real or supposed rights.'" H.T.A., 211 Ill.App.3d at 743, 156 Ill.Dec. at 126, 570 N.E.2d at 602, quoting Minor, 127 Ill.2d at 261, 130 Ill.Dec. at 231, 537 N.E.2d at 298.
In the instant case the trial court ordered IDOC to transport the defendant to Will County for a hearing on his post-conviction petition. The court's order had the effect of requiring IDOC to do a particular thing under penalty of law and in contravention of IDOC's apparent authority. Thus, we conclude that the April 5 order was substantively an injunction and was therefore appealable under Rule 307(a)(1).
We now turn to the merits of the appeal. IDOC contends that the court abused its discretion in requiring the defendant to be brought to Will County. We disagree. Secondarily, IDOC argues that the court's action in setting a hearing for the defendant's post-conviction petition was merely a "pretense." IDOC asserts that the court's true motive for ordering the defendant's transportation to Illinois was for the convenience of the defendant's counsel. In support of its position, IDOC argues that our decision in Lego voids the court's order of April 5, 1993. Again, we disagree.
First, we will consider whether the trial court abused its discretion in the April 5 order. A court may order a defendant petitioning for post-conviction relief to be brought before the court for the hearing. (725 ILCS 5/122-6 (West 1992).) This may be accomplished by the issuance of an order of habeas corpus ad testificandum. (735 ILCS 5/10-135 (West 1992).) The decision to have an inmate present at his post-conviction hearing is within the sound discretion of the hearing judge. (People v. Stovall (1970), 47 Ill.2d 42, 47, 264 N.E.2d 174, 176.) Where the trial court has discretion, only a clear abuse of that discretion or the application of impermissible legal standards will justify reversal. A court of review must look to criteria on which the trial court should rely in determining whether the trial court abused its discretion. (Boatmen's National Bank v. Martin (1993), 155 Ill.2d 305, 314, 185 Ill.Dec. 509, 513-14, 614 N.E.2d 1194, 1198-99.) The trial court must determine in its discretion whether the inmate's interest in being present in court outweighs the State's interest in security and handling the inmate. Some relevant considerations include how substantial the matter is and whether the inmate's testimony is necessary. In re Marriage of Allison (1984), 126 Ill.App.3d 453, 459, 81 Ill.Dec. 610, 614, 467 N.E.2d 310, 314, citing Moeck v. Zajackowski (7th Cir.1976), 541 F.2d 177, 181.
*875 In Lego, we reversed an order which required IDOC to move a defendant from one facility to another solely for the convenience of the defendant's attorney, psychiatrist and investigator. Based on those facts, we held that the court had no authority to order IDOC to move the defendant from one facility to another. However, we also stated that the trial court always retains its power to "order the transfer of an inmate within the control of the IDOC * * * when an inmate is scheduled to testify or otherwise has a right to be present for hearing." (Emphasis added.) Lego, 212 Ill.App.3d at 8, 155 Ill.Dec. at 891, 570 N.E.2d at 404.
Here, we cannot say that the trial court abused its discretion when it ordered IDOC to bring the defendant to Will County for a hearing on the post-conviction petition. We can discern no clear abuse of discretion, nor did the trial court apply any impermissible legal criteria. The court's April 5 order on its face complies with our decision in Lego, regardless of the substance of its prior orders. The text of the April 5 order indicates that it was issued solely for the purpose of ensuring the defendant's presence at the hearing on the post-conviction petition. The court's order clearly complies with our holding in Lego. Therefore, we conclude that the trial court did not abuse its discretion in ordering IDOC to secure the defendant's presence at the hearing on the post-conviction petition.
Finally, we turn to that portion of the April 5 order requiring IDOC to surrender the defendant to the Will County sheriff. We vacate this portion of the order because we hold that the trial court's action exceeded its authority.
When a court issues an order of habeas corpus ad testificandum, the court is without authority to order the prisoner taken from the warden's custody and remanded to the county sheriff. (People v. Turney (1916), 273 Ill. 546, 559, 113 N.E. 105.) Rather, the warden has a duty to retain custody and return the inmate to a penitentiary after his testimony has concluded. (People v. Kersten (1915), 269 Ill. 597, 601, 109 N.E. 1012.) The assignment, location and housing of inmates is a matter within IDOC's discretion, into which courts may not intervene. (People v. Fowler (1958), 14 Ill.2d 252, 259, 151 N.E.2d 324, 328.) Here, the trial court's April 5 order required IDOC to remand custody of the defendant to the Will County sheriff. As our supreme court has indicated, the courts are without power to transfer inmates from one facility to another and may not remove an inmate from IDOC's lawful custody. Accordingly, we vacate that portion of the April 5 order.
In sum, (1) that portion of the court's order requiring IDOC to transport the defendant to Will County for the hearing on his post-conviction petition is affirmed; and (2) that portion of the order remanding the defendant to the custody of the Will County sheriff is vacated.
We remand this case to the circuit court of Will County with directions that it set a new hearing date for the defendant's post-conviction petition and issue another order of habeas corpus ad testificandum. The new order must state that the defendant will remain in the custody of IDOC during the post-conviction proceedings. As a result of our holding, we find it unnecessary to address the other contentions raised by the parties in this appeal.
Affirmed in part; vacated in part and remanded with directions.
STOUDER and LYTTON, JJ., concur.
