Re: Views filter rooms by occupacy

LluĂ­s Forns <[email protected]> Tue, 20 Jan 2015 11:40:33 +0100
Newsgroups gmane.comp.php.drupal.support
Message-ID <CAGTZhB6=imC09PHb1gtqSiT9BVMcS-PS=FboLSzG687dkreX7w@mail.gmail.com>
--===============9066117991698720149==
Content-Type: multipart/alternative; boundary=f46d04389577bdb7ea050d131259

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

I use entity reference to connect them.

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 by date, I could call it using PHP, apply the date filter, and
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]> wrot=
e:
>
>> 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/ ]
>



--=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.

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

<div dir=3D"ltr">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 by 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 programatically just to get the nids.</div></div><div class=3D"=
gmail_extra"><br><div class=3D"gmail_quote">2015-01-20 6:20 GMT+01:00 muham=
med naushad <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]=
om" target=3D"_blank">[email protected]</a>&gt;</span>:<br><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div>I would recommend you to use c=
ustom module.=C2=A0</div><div><br></div><div>If you want to use the view pl=
ease mention how you connect these two content types?</div></div><div class=
=3D"gmail_extra"><br><div class=3D"gmail_quote"><div><div class=3D"h5">On M=
on, 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;</sp=
an> 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 class=3D=
"h5"><div dir=3D"ltr"><div>I have a site with 2 content types: rooms and re=
servations. I want to list all the rooms without a reservation for an inter=
val, and also for services, capacity, ....<br></div><div><br></div><div>I t=
ried 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 li=
sts 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 selec=
t 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?</di=
v><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 aj=
uda.<br></div>
</font></span></div></div>
<br></div></div><span class=3D"">--<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 class=
=3D"HOEnZb"><font color=3D"#888888"><br><br clear=3D"all"><div><br></div>--=
 <br><div><div dir=3D"ltr">Thanks<br>Muhammed Naushad<br>Web Developer<br><=
a href=3D"tel:%2B971529187882" value=3D"+971529187882" target=3D"_blank">+9=
71529187882</a>,<a href=3D"tel:%2B919744663973" value=3D"+919744663973" tar=
get=3D"_blank">+919744663973</a><br><a href=3D"http://stunningspider.com" t=
arget=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 class=3D"gmail_signature">*Ser freak no =C3=
=A9s imprescindible per ser inform=C3=A0tic, per=C3=B2 ajuda.<br>*La vida n=
o ha de ser feli=C3=A7, ha de ser plena.<br>*Abans d&#39;imprimir aquest mi=
ssatge, pensa en el medi ambient.</div>
</div>

--f46d04389577bdb7ea050d131259--

--===============9066117991698720149==
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/ ]
--===============9066117991698720149==--