First, you're missing your articles for "dinner" and "San Jose temple". Also, it should be "at" instead of "in". Events are held at places, generally (unless the speaker wants to specify that it was inside of the place, but then they would probably use "inside of"). It should be something like:
I had food at the charity dinner at the San Jose temple with my friend John last week.
In regards to the modified part, they are both correct. I think the first is easier to say, but the second one is fine, too. If this is in a more formal document, it might be better to write as two sentences.
I had food at the charity dinner at the San Jose temple last week. I ate with my friend John.
Note that if you wanted to say you had dinner in San Jose, you would use "in". One has dinner "in" a region (neighborhood, city, state, etc.), but "at" a place (restaurant, hotel, home, etc.).