The board of supervisors by resolution may direct that the functions of the officer under section 2 or 4, or both, be performed by the county department of social welfare; or, if the board has not so directed, a court of record may order that the prisoner’s earnings be collected and disbursed by the clerk of the court. The order shall remain in force until rescinded by the board or the court, whichever made it.