hello,
I don't know if this is the rigt forum for this question, but i have not found a forum about the callendar funktion.
Can someone tell me how i can change the "first day of week" to Monday ??
thanx
hello,
I don't know if this is the rigt forum for this question, but i have not found a forum about the callendar funktion.
Can someone tell me how i can change the "first day of week" to Monday ??
thanx
Hi,
Sorry, but in french : http://wiki.crm-france.com/index.php...e_.C3.A0_lundi
thanks a lot
i will try to understand this.![]()
sorry but it doesn't work.
there are only 2 parts where i have to change something, i have done this but it doesn't work.![]()
That would work for Month view.
Last edited by Superman; 2006-11-16 at 04:31 PM.
Farkhad Rakhimzhanov
E-mail: farkhad@gmail.com
Skype: rakikama
SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
Book time against Cases, Project Tasks and Projects.
Create invoice regarding booked time, print it in PDF or HTML,
customize template as you like.
To change it in week and shared view, you have to edit modules/Calendar/Calendar.php
original version 4.5.0f pro, line 186:
Changed to:Code:else if ( $this->view == 'week' || $this->view == 'shared') { $days_in_week = 7; for($i=0;$i<$days_in_week;$i++) { $slice = new Slice('day',$this->date_time->get_day_by_index_this_week($i)); $this->slice_hash[$slice->start_time->get_mysql_date()] = $slice; array_push($this->slices_arr, $slice->start_time->get_mysql_date()); } }
Code:else if ( $this->view == 'week' || $this->view == 'shared') { $days_in_week = 7; // changed by simple for($i=1;$i<$days_in_week;$i++) { $slice = new Slice('day',$this->date_time->get_day_by_index_this_week($i)); $this->slice_hash[$slice->start_time->get_mysql_date()] = $slice; array_push($this->slices_arr, $slice->start_time->get_mysql_date()); } // added by simple $slice = new Slice('day',$this->date_time->get_first_day_of_next_week()); $this->slice_hash[$slice->start_time->get_mysql_date()] = $slice; array_push($this->slices_arr, $slice->start_time->get_mysql_date()); }
Cheers Pascal
Simplicity GmbH
Tried Simple's solution in SugarOS 4.0.0 and it doesnt work.
For SugarOS 4.0.0 I did following steps:
1. modules/Calendar/templates/templates_calendar.php:
2. modules/Calendar/Calendar.php:PHP Code:...
if ($view == 'week' || $view == 'shared') {
//$first_day = $date_time->get_day_by_index_this_week(0);
//$last_day = $date_time->get_day_by_index_this_week(6);
// begin farkhad
$first_day = $date_time->get_day_by_index_this_week(1);
$last_day = $date_time->get_day_by_index_this_week(7);
// end farkhad
...
3. modules/Calendar/DateTime.php:PHP Code:...
$first_day_of_month = $this->date_time->get_day_by_index_this_month(0);
$num_of_prev_days = $first_day_of_month->day_of_week;
// do 42 slices (6x7 grid)
// begin farkhad
if ($num_of_prev_days == 0) $num_of_prev_days = 7;
// end farkhad
//for($i=0;$i < 42;$i++)
// begin farkhad
for($i=1;$i < 43;$i++)
// end farkhad
{
$slice = new Slice('day',$this->date_time->get_day_by_index_this_month($i-$num_of_prev_days));
...
PHP Code:...
function get_first_day_of_next_week()
{
//$first_day = $this->get_day_by_index_this_week(0);
// begin farkhad
$first_day = $this->get_day_by_index_this_week(1);
// end farkhad
...
PHP Code:...
function get_first_day_of_last_week()
{
//$first_day = $this->get_day_by_index_this_week(0);
// begin farkhad
$first_day = $this->get_day_by_index_this_week(1);
// end farkhad
...
4. jscalendar/calendar-setup_3.js:PHP Code:...
function get_day_by_index_this_week($day_index)
{
$arr = array();
//if ( $day_index < 0 || $day_index > 6 )
// begin farkhad
if ( $day_index < 1 || $day_index > 7 )
// end farkhad
...
PHP Code://param_default("firstDay", 0); // 0 to "Sunday"
// begin farkhad
param_default("firstDay", 1); // 1 to "Monday"
// end farkhad
Farkhad Rakhimzhanov
E-mail: farkhad@gmail.com
Skype: rakikama
SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
Book time against Cases, Project Tasks and Projects.
Create invoice regarding booked time, print it in PDF or HTML,
customize template as you like.
Hi,
This almost works (tried it on 4.5) . On the week and shared view I get the message "day is outside of week range", the value being passed it still 0 for some reason. Everywhere else it looks good (tried solution from Superman)
Last edited by malcolmh; 2006-11-17 at 04:03 PM.
Cheers Malcolm
Genius4U Limited - Ingenious simple IT solutions for you / Genial einfache IT Lösungen für Sie
http://www.genius4u.com or http://www.genius4u.de
Judging by his image - is our superhero conflicted?
I also added the modifications from simplicity, now the week and shared view work as well, great work guys!Originally Posted by malcolmh
Cheers Malcolm
Genius4U Limited - Ingenious simple IT solutions for you / Genial einfache IT Lösungen für Sie
http://www.genius4u.com or http://www.genius4u.de
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks