AC calorimetric studies of phase transitions in porous substrates. Superfluid helium and liquid crystals