Merge pull request #259 from marc1706/ticket/258
[ticket/258] U_ACTION should be B3P_U_ACTION for calendar events
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @package Board3 Portal v2.1
|
* @package Board3 Portal v2.1
|
||||||
* @copyright (c) 2013 Board3 Group ( www.board3.de )
|
* @copyright (c) 2014 Board3 Group ( www.board3.de )
|
||||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -168,7 +168,7 @@ class calendar extends module_base
|
|||||||
$mini_cal_today = date('Ymd', $today_timestamp - date('Z'));
|
$mini_cal_today = date('Ymd', $today_timestamp - date('Z'));
|
||||||
$this->stamp = $today_timestamp;
|
$this->stamp = $today_timestamp;
|
||||||
$s_cal_month = ($this->mini_cal_month != 0) ? $this->mini_cal_month . ' month' : $mini_cal_today;
|
$s_cal_month = ($this->mini_cal_month != 0) ? $this->mini_cal_month . ' month' : $mini_cal_today;
|
||||||
$this->getMonth($s_cal_month);
|
$this->get_month($s_cal_month);
|
||||||
$mini_cal_count = $this->mini_cal_fdow;
|
$mini_cal_count = $this->mini_cal_fdow;
|
||||||
$mini_cal_this_year = $this->dateYYYY;
|
$mini_cal_this_year = $this->dateYYYY;
|
||||||
$mini_cal_this_month = $this->dateMM;
|
$mini_cal_this_month = $this->dateMM;
|
||||||
@@ -573,7 +573,7 @@ class calendar extends module_base
|
|||||||
'EVENT_URL' => (isset($events[$link_id]['url']) && $action != 'add') ? $events[$link_id]['url'] : '',
|
'EVENT_URL' => (isset($events[$link_id]['url']) && $action != 'add') ? $events[$link_id]['url'] : '',
|
||||||
|
|
||||||
//'U_BACK' => $u_action,
|
//'U_BACK' => $u_action,
|
||||||
'U_ACTION' => $u_action . '&id=' . $link_id,
|
'B3P_U_ACTION' => $u_action . '&id=' . $link_id,
|
||||||
|
|
||||||
'S_EDIT' => true,
|
'S_EDIT' => true,
|
||||||
));
|
));
|
||||||
@@ -644,22 +644,22 @@ class calendar extends module_base
|
|||||||
*
|
*
|
||||||
* @return string Converted time
|
* @return string Converted time
|
||||||
*/
|
*/
|
||||||
protected function makeTimestamp($date)
|
protected function make_timestamp($date)
|
||||||
{
|
{
|
||||||
$this->stamp = strtotime($date);
|
$this->stamp = strtotime($date);
|
||||||
return ($this->stamp);
|
return $this->stamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get date listed in array
|
* Get date listed in array
|
||||||
*
|
*
|
||||||
* @param string $callDate Date
|
* @param string $call_date Date
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
protected function getMonth($callDate)
|
protected function get_month($call_date)
|
||||||
{
|
{
|
||||||
$this->makeTimestamp($callDate);
|
$this->make_timestamp($call_date);
|
||||||
// last or first day of some months need to be treated in a special way
|
// last or first day of some months need to be treated in a special way
|
||||||
if (!empty($this->mini_cal_month))
|
if (!empty($this->mini_cal_month))
|
||||||
{
|
{
|
||||||
@@ -672,27 +672,15 @@ class calendar extends module_base
|
|||||||
// move back or forth the correct number of years
|
// move back or forth the correct number of years
|
||||||
while ($correct_month < 1 || $correct_month > self::MONTHS_PER_YEAR)
|
while ($correct_month < 1 || $correct_month > self::MONTHS_PER_YEAR)
|
||||||
{
|
{
|
||||||
if ($correct_month < 1)
|
$correct_month = ($correct_month < 1) ? $correct_month + self::MONTHS_PER_YEAR : $correct_month - self::MONTHS_PER_YEAR;
|
||||||
{
|
|
||||||
$correct_month = $correct_month + self::MONTHS_PER_YEAR;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$correct_month = $correct_month - self::MONTHS_PER_YEAR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix incorrect months
|
// fix incorrect months
|
||||||
while (date("n", $this->stamp) != $correct_month)
|
while (date("n", $this->stamp) != $correct_month)
|
||||||
{
|
{
|
||||||
if (date("n", $this->stamp) > $correct_month)
|
// Go back one day or move forward in order to
|
||||||
{
|
// get to the correct month
|
||||||
$this->stamp = $this->stamp - self::TIME_DAY; // go back one day
|
$this->stamp = (date("n", $this->stamp) > $correct_month) ? $this->stamp - self::TIME_DAY : $this->stamp + self::TIME_DAY;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->stamp = $this->stamp + self::TIME_DAY; // move forward one day
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->dateYYYY = date("Y", $this->stamp);
|
$this->dateYYYY = date("Y", $this->stamp);
|
||||||
@@ -703,7 +691,7 @@ class calendar extends module_base
|
|||||||
|
|
||||||
for ($i = 1; $i < $this->daysMonth + 1; $i++)
|
for ($i = 1; $i < $this->daysMonth + 1; $i++)
|
||||||
{
|
{
|
||||||
$this->makeTimestamp("$i {$this->ext_dateMM} {$this->dateYYYY}");
|
$this->make_timestamp("$i {$this->ext_dateMM} {$this->dateYYYY}");
|
||||||
$this->day[] = array(
|
$this->day[] = array(
|
||||||
'0' => "$i",
|
'0' => "$i",
|
||||||
'1' => $this->dateMM,
|
'1' => $this->dateMM,
|
||||||
|
|||||||
Reference in New Issue
Block a user