Re: Views filter rooms by occupacy

LluĂ­s Forns <[email protected]> Wed, 21 Jan 2015 18:07:23 +0100
Newsgroups gmane.comp.php.drupal.support
Message-ID <CAGTZhB7QJ1unmLS4dFkmJ4==DdGa9+_HrL69gpmsws7XU5GhJQ@mail.gmail.com>
--===============7230437929498203936==
Content-Type: multipart/alternative; boundary=001a11c38a22ff94a8050d2c9742

--001a11c38a22ff94a8050d2c9742
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

At last it works. I created another view to list reservations by dates, and
I called this inside context filter to avoid selected nodes.

thanks

2015-01-20 11:40 GMT+01:00 Llu=C3=ADs Forns <[email protected]>:

> I use entity reference to connect them.
>
> I thing a way to achieve this is adding a context filter for NID and usin=
g
> PHP to select all rooms occupied and remove them. I have a view to select
> reservations by date, I could call it using PHP, apply the date filter, a=
nd
> get the nids to remove.
>
> My problem now is how to call a view programatically just to get the nids=
.
>
> 2015-01-20 6:20 GMT+01:00 muhammed naushad <[email protected]>:
>
>> I would recommend you to use custom module.
>>
>> If you want to use the view please mention how you connect these two
>> content types?
>>
>> On Mon, Jan 19, 2015 at 6:37 PM, Llu=C3=ADs Forns <[email protected]> wro=
te:
>>
>>> I have a site with 2 content types: rooms and reservations. I want to
>>> list all the rooms without a reservation for an interval, and also for
>>> services, capacity, ....
>>>
>>> I tried creating a view with a PHP filter to check free rooms, but then
>>> if the page lists 10 rooms, sometimes there are 7, 2, or 0; because the
>>> filter lists the 10 rooms and after remove the occupied ones.
>>>
>>> I have tried to create a "subview" filter to select nodes "not in (view
>>> of occupied rooms); but I haven't find a way to do so.
>>>
>>> Any idea of how to accomplish this?
>>>
>>> thanks
>>> --
>>> *Ser freak no =C3=A9s imprescindible per ser inform=C3=A0tic, per=C3=B2=
 ajuda.
>>>
>>> --
>>> [ Drupal support list | http://lists.drupal.org/ ]
>>>
>>
>>
>>
>> --
>> Thanks
>> Muhammed Naushad
>> Web Developer
>> +971529187882,+919744663973
>> http://stunningspider.com
>>
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>
>
>
> --
> *Ser freak no =C3=A9s imprescindible per ser inform=C3=A0tic, per=C3=B2 a=
juda.
> *La vida no ha de ser feli=C3=A7, ha de ser plena.
> *Abans d'imprimir aquest missatge, pensa en el medi ambient.
>



--=20
*Ser freak no =C3=A9s imprescindible per ser inform=C3=A0tic, per=C3=B2 aju=
da.
*La vida no ha de ser feli=C3=A7, ha de ser plena.
*Abans d'imprimir aquest missatge, pensa en el medi ambient.

--001a11c38a22ff94a8050d2c9742
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">At last it works. I created another view to list reservati=
ons by dates, and I called this inside context filter to avoid selected nod=
es.<div><br></div><div>thanks</div></div><div class=3D"gmail_extra"><br><di=
v class=3D"gmail_quote">2015-01-20 11:40 GMT+01:00 Llu=C3=ADs Forns <span d=
ir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">enboig=
@gmail.com</a>&gt;</span>:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"lt=
r">I use entity reference to connect them.<div><br></div><div>I thing a way=
 to achieve this is adding a context filter for NID and using PHP to select=
 all rooms occupied and remove them. I have a view to select reservations b=
y date, I could call it using PHP, apply the date filter, and get the nids =
to remove.</div><div><br></div><div>My problem now is how to call a view pr=
ogramatically just to get the nids.</div></div><div class=3D"gmail_extra"><=
div><div class=3D"h5"><br><div class=3D"gmail_quote">2015-01-20 6:20 GMT+01=
:00 muhammed naushad <span dir=3D"ltr">&lt;<a href=3D"mailto:naushunaushad2=
[email protected]" target=3D"_blank">[email protected]</a>&gt;</span>:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>I would recommend you=
 to use custom module.=C2=A0</div><div><br></div><div>If you want to use th=
e view please mention how you connect these two content types?</div></div><=
div class=3D"gmail_extra"><br><div class=3D"gmail_quote"><div><div>On Mon, =
Jan 19, 2015 at 6:37 PM, Llu=C3=ADs Forns <span dir=3D"ltr">&lt;<a href=3D"=
mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> =
wrote:<br></div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir=3D"=
ltr"><div>I have a site with 2 content types: rooms and reservations. I wan=
t to list all the rooms without a reservation for an interval, and also for=
 services, capacity, ....<br></div><div><br></div><div>I tried creating a v=
iew with a PHP filter to check free rooms, but then if the page lists 10 ro=
oms, sometimes there are 7, 2, or 0; because the filter lists the 10 rooms =
and after remove the occupied ones.<br clear=3D"all"><div><br></div><div>I =
have tried to create a &quot;subview&quot; filter to select nodes &quot;not=
 in (view of occupied rooms); but I haven&#39;t find a way to do so.</div><=
div><br></div><div>Any idea of how to accomplish this?</div><div><br></div>=
<div>thanks</div><span><font color=3D"#888888">-- <br><div>*Ser freak no =
=C3=A9s imprescindible per ser inform=C3=A0tic, per=C3=B2 ajuda.<br></div>
</font></span></div></div>
<br></div></div><span>--<br>
[ Drupal support list | <a href=3D"http://lists.drupal.org/" target=3D"_bla=
nk">http://lists.drupal.org/</a> ]<br></span></blockquote></div><span><font=
 color=3D"#888888"><br><br clear=3D"all"><div><br></div>-- <br><div><div di=
r=3D"ltr">Thanks<br>Muhammed Naushad<br>Web Developer<br><a href=3D"tel:%2B=
971529187882" value=3D"+971529187882" target=3D"_blank">+971529187882</a>,<=
a href=3D"tel:%2B919744663973" value=3D"+919744663973" target=3D"_blank">+9=
19744663973</a><br><a href=3D"http://stunningspider.com" target=3D"_blank">=
http://stunningspider.com</a></div></div>
</font></span></div>
<br>--<br>
[ Drupal support list | <a href=3D"http://lists.drupal.org/" target=3D"_bla=
nk">http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear=3D"a=
ll"><div><br></div>-- <br></div></div><div><div><div class=3D"h5">*Ser frea=
k no =C3=A9s imprescindible per ser inform=C3=A0tic, per=C3=B2 ajuda.<br></=
div></div><span class=3D"">*La vida no ha de ser feli=C3=A7, ha de ser plen=
a.<br>*Abans d&#39;imprimir aquest missatge, pensa en el medi ambient.</spa=
n></div>
</div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature">*Ser freak no =C3=A9s imprescindible per ser inform=C3=
=A0tic, per=C3=B2 ajuda.<br>*La vida no ha de ser feli=C3=A7, ha de ser ple=
na.<br>*Abans d&#39;imprimir aquest missatge, pensa en el medi ambient.</di=
v>
</div>

--001a11c38a22ff94a8050d2c9742--

--===============7230437929498203936==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
[ Drupal support list | http://lists.drupal.org/ ]
--===============7230437929498203936==--