Plugin Directory

Changeset 2912021


Ignore:
Timestamp:
05/13/2023 03:34:30 PM (3 years ago)
Author:
kerkenit
Message:

Added support for multiple churches

File:
1 edited

Legend:

Unmodified
Added
Removed
  • promissa/trunk/shortcodes/intentions.php

    r2912020 r2912021  
    3232        extract($atts_extended);
    3333        $itemCount = 0;
    34         $single_church = (isset($church_id) && !empty($church_id));
     34        $single_church = ((isset($church_id) && !empty($church_id))) && !str_contains($church_id, ',');
     35        $multiple_church =  ((isset($church_id) && !empty($church_id))) && str_contains($church_id, ',');
    3536        $intentions = NULL;
    3637        $nextWeekOffset = 1;
     
    8384        //varDump($toDate);
    8485        //varDump($fromDate, $toDate);
    85         if ($single_church) :
     86        if ($single_church || $multiple_church) :
    8687
    8788            //varDump($fromDate, $toDate);
    88             $intentions = ProMissaREST('Intenties', '?size=' . $limit . '&filter=church_ID,eq,' . html_entity_decode($church_id) . '&filter2=start,ge,' . $fromDate . '&filter2=start,le,' . $toDate);
     89            $intentions = ProMissaREST('Intenties', '?size=' . $limit . '&filter=church_ID,' . ($single_church ? 'eq' : 'in'). ',' . html_entity_decode($church_id) . '&filter2=start,ge,' . $fromDate . '&filter2=start,le,' . $toDate);
    8990
    9091            if (strpos($church_id, '&') !== -1) :
Note: See TracChangeset for help on using the changeset viewer.