TITLE: Can you construct a mapping space from local data? (looking for reference)
QUESTION [7 upvotes]: I'd to know if/where there is a reference for the following construction.
Let C_*(maps(M, T)) denote the singular chains on the space of continuous maps from an n-manifold M to some target space T.  Our goal is to construct C_*(maps(M, T)) out of local information.  More specifically, let B be any n-manifold homeomorphic to the n-ball, and let c: \boundary(B) -> T be some fixed map.  Define L_*(B, c) to be the singular chains on the space of all maps B -> T which restrict to c on the boundary of B.  We want to construct C_*(maps(M, T)) (up to homotopy) out of {L_*(B, c)}, where B ranges through all n-balls and c ranges through all boundary conditions.
This can be done as follows.  Let D be the category of all decompositions of M.  An object x of D is decomposition of M into n-balls.  There is a (unique) morphism x -> y if and only if x is a refinement of y (i.e. the balls of x are subdivisions of the balls of y).  Let D_T be a similar category, where the objects are decompositions of M into balls with the additional structure of a map from the (n-1)-skeleton of the decomposition to T, and the morphisms (anti-refinements of decompositions) are required to respect this additional structure.
We can define a functor F from D_T to the category of chain complexes.  Define F(x) to be the tensor product of all L_*(B, c), where B ranges over all n-balls of x and c is determined by the map of the (n-1)-skeleton of x to T.  Then (theorem) C_*(maps(M, T)) is homotopy equivalent to the homotopy colimit of F.
I doubt the above construction is new, but I haven't come across it anywhere.  Hence the question in the first sentence above.
EDIT: It looks like the special case, where T is n-connected and we use the undecorated category D instead of D_T, exists in some form(s) in the literature (see Oscar Randal-Williams' answer below).  So I'm particularly interested in the case where no assumptions about the connectivity of T are made.

REPLY [3 votes]: This seems to be Theorem 3.8.6 in Lurie's DAG-VI, which he says is also in Paolo Salvatore, "Configuration spaces with summable labels", Cohomological Methods in Homotopy Theory. Progress in Mathematics 196, 2001, 375-396. They work on the space level instead of chains.
It is worth noting that Lurie has a condition for the theorem to hold: that T is dim(M)-connected, and he says that it does not hold without this assumption.