Browse Source

possibility to choose last week or 4th week of month

experimental
Paweł Bukowski 2 years ago
parent
commit
cd8b171b1c
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      modules/CRM/Meeting/MeetingCommon_0.php

+ 3
- 2
modules/CRM/Meeting/MeetingCommon_0.php View File

@@ -232,6 +232,7 @@ class CRM_MeetingCommon extends ModuleCommon {
8=>__('Customize week'),
9=>__('Every two weeks'),
10=>__('Every month'),
12=>__('Every month (the same day of the week, e.g. last monday every month)'),
12=>__('Every month (the same day of the week, e.g. first monday every month)'),
11=>__('Every year')
);
@@ -647,14 +648,14 @@ class CRM_MeetingCommon extends ModuleCommon {
$tday = date('d', strtotime($r['date']));
if ($cday!=$tday && ($tday<=$numdays || $numdays!=$cday)) return null;
}
if ($r['recurrence_type']==12) {
if ($r['recurrence_type']==12 || $r['recurrence_type']==13) {
$evdate = strtotime($r['date']);
$cday = date('l', $iday);
$tday = date('l', $evdate);
if($cday!=$tday) return null;
$cmonth = date('Y-m H:i:s',$iday);
$tmonth = date('Y-m H:i:s',$evdate);
$cfive = ($cmonth==date('Y-m H:i:s',strtotime('fifth '.$cday.' of '.$cmonth)));
$cfive = ($cmonth==date('Y-m H:i:s',strtotime('fifth '.$cday.' of '.$cmonth))) && ($r['recurrence_type']==12);
//if first "monday" of event month is same as event date go and check first "monday" of currently selected month is same as current date - if not, skip
if((strtotime('first '.$cday.' of '.$tmonth)==$evdate && strtotime('first '.$cday.' of '.$cmonth)!=$iday) ||
(strtotime('second '.$cday.' of '.$tmonth)==$evdate && strtotime('second '.$cday.' of '.$cmonth)!=$iday) ||


Loading…
Cancel
Save