Retrive the use_time_grid preference back to calendar preferences and fix its overflow issue

This commit is contained in:
Hadi Nategh 2015-10-02 14:31:16 +00:00
parent 74016fd47a
commit 72aaa6c546
2 changed files with 6 additions and 19 deletions

View File

@ -343,10 +343,7 @@ class calendar_hooks
'admin' => False,
'forced' => 'user',
),
//ATM:Disable the use_time_grid preference
//@TODO: the whole use_time_grid preference should be removed
// after we decided that is not neccessary to have it at all
/*'use_time_grid' => array(
'use_time_grid' => array(
'type' => 'select',
'label' => 'Views with fixed time intervals',
'name' => 'use_time_grid',
@ -355,7 +352,7 @@ class calendar_hooks
'xmlrpc' => True,
'admin' => False,
'forced' => 'all',
),*/
),
'link_title' => array(
'type' => 'multiselect',
'label' => 'Link title for events to show',

View File

@ -102,12 +102,6 @@ class calendar_uiviews extends calendar_ui
*/
var $use_time_grid=true;
/**
* Pref value of use_time_grid preference
* @var string
*/
var $use_time_grid_pref = '';
/**
* Can we display the whole day in a timeGrid of the size of the workday and just scroll to workday start
*
@ -176,10 +170,6 @@ class calendar_uiviews extends calendar_ui
$this->check_owners_access();
//ATM: Forces use_time_grid preference to use all views by ignoring the preference value
//@TODO: the whole use_time_grid preference should be removed (including dependent vars)
// after we decided that is not neccessary to have it at all
$this->use_time_grid_pref = 'all'; //$this->cal_prefs['use_time_grid'];
}
@ -620,7 +610,7 @@ class calendar_uiviews extends calendar_ui
{
if ($this->debug > 0) $this->bo->debug_message('uiviews::month(weeks=%1) date=%2',True,$weeks,$this->date);
$this->use_time_grid = !$this->use_time_grid_pref || $this->use_time_grid_pref == 'all'; // all views
$this->use_time_grid = !$this->cal_prefs['use_time_grid'] || $this->cal_prefs['use_time_grid'] == 'all'; // all views
// Merge print
if($weeks)
@ -802,7 +792,7 @@ class calendar_uiviews extends calendar_ui
function week($days=0,$home=false)
{
$this->use_time_grid = $days != 4 && !in_array($this->use_time_grid_pref,array('day','day4')) ||
$days == 4 && $this->use_time_grid_pref != 'day';
$days == 4 && $this->cal_prefs['use_time_grid'] != 'day';
if (!$days)
{
@ -1384,9 +1374,9 @@ class calendar_uiviews extends calendar_ui
function dayColWidget($day_ymd,$events,$pleft,$pwidth,$indent,$short_title=True,$on_off=False,$owner=0)
{
if ($this->debug > 1 || $this->debug==='dayColWidget') $this->bo->debug_message('uiviews::dayColWidget(%1,%2,left=%3,width=%4,)',False,$day_ymd,$events,$pleft,$pwidth);
$time_grid_overflow = !$this->use_time_grid?'overflow-y:auto;overflow-x:hidden;':'';
$html = $indent.'<div id="calColumn'.$this->calColumnCounter++.'" class="calendar_calDayCol" '.'data-sortable-id="'.$owner.'" style="left: '.$pleft.
'%;width: '.$pwidth.'%;">'."\n";
'%;width: '.$pwidth.'%;'.$time_grid_overflow.'">'."\n";
// Creation of the header-column with date, evtl. holiday-names and a matching background-color
$ts = $this->bo->date2ts((string)$day_ymd);