This commit is contained in:
Laurent Destailleur 2012-01-08 00:15:36 +01:00
parent ad7aee9fc2
commit ad232fa38c
4 changed files with 74 additions and 70 deletions

View File

@ -462,11 +462,12 @@ class ActionComm extends CommonObject
} }
/** /**
* Load all objects with filters * Load all objects with filters
* @param socid Filter by thirdparty *
* @param fk_element Id of element action is linked to * @param int $socid Filter by thirdparty
* @param elementtype Type of element action is linked to * @param int $fk_element Id of element action is linked to
* @param filter Other filter * @param string $elementtype Type of element action is linked to
* @param filter Other filter
*/ */
function getActions($socid=0, $fk_element=0, $elementtype='', $filter='') function getActions($socid=0, $fk_element=0, $elementtype='', $filter='')
{ {
@ -511,8 +512,9 @@ class ActionComm extends CommonObject
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* @param user Objet user *
* @return int <0 if KO, >0 if OK * @param User $user Objet user
* @return int <0 if KO, >0 if OK
*/ */
function load_board($user) function load_board($user)
{ {
@ -603,9 +605,9 @@ class ActionComm extends CommonObject
/** /**
* Return label of status * Return label of status
* *
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @param hidenastatus 1=Show nothing if status is "Not applicable" * @param int $hidenastatus 1=Show nothing if status is "Not applicable"
* @return string String with status * @return string String with status
*/ */
function getLibStatut($mode,$hidenastatus=0) function getLibStatut($mode,$hidenastatus=0)
{ {
@ -615,10 +617,10 @@ class ActionComm extends CommonObject
/** /**
* Return label of action status * Return label of action status
* *
* @param percent Percent * @param int $percent Percent
* @param mode 0=Long label, 1=Short label, 2=Picto+Short label, 3=Picto, 4=Picto+Short label, 5=Short label+Picto, 6=Very short label+Picto * @param int $mode 0=Long label, 1=Short label, 2=Picto+Short label, 3=Picto, 4=Picto+Short label, 5=Short label+Picto, 6=Very short label+Picto
* @param hidenastatus 1=Show nothing if status is "Not applicable" * @param int $hidenastatus 1=Show nothing if status is "Not applicable"
* @return string Label * @return string Label
*/ */
function LibStatut($percent,$mode,$hidenastatus=0) function LibStatut($percent,$mode,$hidenastatus=0)
{ {
@ -680,12 +682,12 @@ class ActionComm extends CommonObject
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* Utilise $this->id, $this->code et $this->label * Utilise $this->id, $this->code et $this->label
* *
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param maxlength Nombre de caracteres max dans libelle * @param int $maxlength Nombre de caracteres max dans libelle
* @param classname Force style class on a link * @param string $classname Force style class on a link
* @param option ''=Link to action,'birthday'=Link to contact * @param string $option ''=Link to action,'birthday'=Link to contact
* @param overwritepicto 1=Overwrite picto * @param int $overwritepicto 1=Overwrite picto
* @return string Chaine avec URL * @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='') function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
{ {
@ -726,12 +728,12 @@ class ActionComm extends CommonObject
/** /**
* Export events from database into a cal file. * Export events from database into a cal file.
* *
* @param format 'vcal', 'ical/ics', 'rss' * @param string $format 'vcal', 'ical/ics', 'rss'
* @param type 'event' or 'journal' * @param string $type 'event' or 'journal'
* @param cachedelay Do not rebuild file if date older than cachedelay seconds * @param int $cachedelay Do not rebuild file if date older than cachedelay seconds
* @param filename Force filename * @param string $filename Force filename
* @param filters Array of filters * @param filters Array of filters
* @return int <0 if error, nb of events in new file if ok * @return int <0 if error, nb of events in new file if ok
*/ */
function build_exportfile($format,$type,$cachedelay,$filename,$filters) function build_exportfile($format,$type,$cachedelay,$filename,$filters)
{ {

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2006 Roman Ozana <ozana@omdesign.cz> /* Copyright (C) 2006 Roman Ozana <ozana@omdesign.cz>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -41,13 +41,13 @@ class ical
/** /**
* Read text file, icalender text file * Read text file, icalender text file
* *
* @param string $file * @param string $file File
* @return string * @return string
*/ */
function read_file($file) function read_file($file)
{ {
$this->file = $file; $this->file = $file;
$file_text = join ("", file ($file)); //load file $file_text = join("", file ($file)); //load file
$file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text); $file_text = preg_replace("/[\r\n]{1,} ([:;])/","\\1",$file_text);
return $file_text; // return all text return $file_text; // return all text
@ -76,8 +76,8 @@ class ical
/** /**
* Translate Calendar * Translate Calendar
* *
* @param string $uri * @param string $uri Url
* @return array * @return array
*/ */
function parse($uri) function parse($uri)
{ {
@ -157,9 +157,9 @@ class ical
/** /**
* Add to $this->ical array one value and key. Type is VTODO, VEVENT, VFREEBUSY, VCALENDAR ... . * Add to $this->ical array one value and key. Type is VTODO, VEVENT, VFREEBUSY, VCALENDAR ... .
* *
* @param string $type * @param string $type Type
* @param string $key * @param string $key Key
* @param string $value * @param string $value Value
*/ */
function add_to_array($type, $key, $value) function add_to_array($type, $key, $value)
{ {
@ -216,8 +216,8 @@ class ical
/** /**
* Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value"); * Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");
* *
* @param string $text * @param string $text Text
* @return array * @return array
*/ */
function retun_key_value($text) function retun_key_value($text)
{ {
@ -238,8 +238,8 @@ class ical
/** /**
* Parse RRULE return array * Parse RRULE return array
* *
* @param string $value * @param string $value string
* @return array * @return array
*/ */
function ical_rrule($value) function ical_rrule($value)
{ {
@ -254,8 +254,8 @@ class ical
/** /**
* Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) * Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS)
* *
* @param unknown_type $ical_date * @param string $ical_date String date
* @return timestamp * @return timestamp
*/ */
function ical_date_to_unix($ical_date) function ical_date_to_unix($ical_date)
{ {
@ -275,9 +275,9 @@ class ical
/** /**
* Return unix date from iCal date format * Return unix date from iCal date format
* *
* @param string $key * @param string $key Key
* @param string $value * @param string $value Value
* @return array * @return array
*/ */
function ical_dt_date($key, $value) function ical_dt_date($key, $value)
{ {
@ -321,9 +321,9 @@ class ical
/** /**
* Compare two unix timestamp * Compare two unix timestamp
* *
* @param array $a * @param array $a Operand a
* @param array $b * @param array $b Operand b
* @return integer * @return integer
*/ */
function ical_dtstart_compare($a, $b) function ical_dtstart_compare($a, $b)
{ {
@ -351,7 +351,7 @@ class ical
} }
/** /**
* Return todo array (not sort todo array) * Return to do array (not sort to do array)
* *
* @return array * @return array
*/ */

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
@ -427,8 +427,8 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="add_action">'; print '<input type="hidden" name="action" value="add_action">';
if (GETPOST("backtopage")) print '<input type="hidden" name="backtopage" value="'.(GETPOST("backtopage") != 1 ? GETPOST("backtopage") : $_SERVER["HTTP_REFERER"]).'">'; if (GETPOST("backtopage")) print '<input type="hidden" name="backtopage" value="'.(GETPOST("backtopage") != 1 ? GETPOST("backtopage") : $_SERVER["HTTP_REFERER"]).'">';
if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre ($langs->trans("AddActionRendezVous")); if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous"));
else print_fiche_titre ($langs->trans("AddAnAction")); else print_fiche_titre($langs->trans("AddAnAction"));
dol_htmloutput_mesg($mesg); dol_htmloutput_mesg($mesg);
@ -986,8 +986,9 @@ llxFooter();
/** /**
* \brief Ajoute une ligne de tableau a 2 colonnes pour avoir l'option synchro calendrier * Ajoute une ligne de tableau a 2 colonnes pour avoir l'option synchro calendrier
* \return int Retourne le nombre de lignes ajoutees *
* @return int Retourne le nombre de lignes ajoutees
*/ */
function add_row_for_calendar_link() function add_row_for_calendar_link()
{ {

View File

@ -653,13 +653,13 @@ if (empty($action) || $action == 'show_month') // View by month
{ {
$style='cal_other_month'; $style='cal_other_month';
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
show_day_events ($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW, $maxnbofchar, $newparam); show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW, $maxnbofchar, $newparam);
echo " </td>\n"; echo " </td>\n";
} }
/* Show days of the current month */ /* Show days of the current month */
elseif(($tmpday <= $max_day_in_month)) elseif(($tmpday <= $max_day_in_month))
{ {
$curtime = dol_mktime (0, 0, 0, $month, $tmpday, $year); $curtime = dol_mktime(0, 0, 0, $month, $tmpday, $year);
$style='cal_current_month'; $style='cal_current_month';
$today=0; $today=0;
@ -714,7 +714,7 @@ elseif ($action == 'show_week') // View by week
if(($tmpday <= $max_day_in_month)) if(($tmpday <= $max_day_in_month))
{ {
// Show days of the current week // Show days of the current week
$curtime = dol_mktime (0, 0, 0, $month, $tmpday, $year); $curtime = dol_mktime(0, 0, 0, $month, $tmpday, $year);
$style='cal_current_month'; $style='cal_current_month';
$today=0; $today=0;
@ -763,7 +763,7 @@ else // View by day
echo " <tr>\n"; echo " <tr>\n";
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">'; echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
$maxnbofchar=80; $maxnbofchar=80;
show_day_events ($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo "</td>\n"; echo "</td>\n";
echo " </tr>\n"; echo " </tr>\n";
echo '</table>'; echo '</table>';
@ -791,18 +791,19 @@ llxFooter();
/** /**
* Show event of a particular day * Show event of a particular day
* @param $db Database handler *
* @param $day Day * @param DoliDB $db Database handler
* @param $month Month * @param int $day Day
* @param $year Year * @param int $month Month
* @param $monthshown Current month shown in calendar view * @param int $year Year
* @param $style Style to use for this day * @param int $monthshown Current month shown in calendar view
* @param $eventarray Array of events * @param string $style Style to use for this day
* @param $maxPrint Nb of actions to show each day on month view (0 means non limit) * @param array $eventarray Array of events
* @param $maxnbofchar Nb of characters to show for event line * @param int $maxPrint Nb of actions to show each day on month view (0 means non limit)
* @param $newparam Parameters on current URL * @param int $maxnbofchar Nb of characters to show for event line
* @param $showinfo Add extended information (used by day view) * @param string $newparam Parameters on current URL
* @param $minheight Minimum height for each event. 60px by default. * @param int $showinfo Add extended information (used by day view)
* @param int $minheight Minimum height for each event. 60px by default.
*/ */
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxPrint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60) function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxPrint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60)
{ {
@ -814,7 +815,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($_GET["maxprint"] == 'on') $maxPrint=0; // Force to remove limits if ($_GET["maxprint"] == 'on') $maxPrint=0; // Force to remove limits
print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n"; print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n";
$curtime = dol_mktime (0, 0, 0, $month, $day, $year); $curtime = dol_mktime(0, 0, 0, $month, $day, $year);
print '<table class="nobordernopadding" width="100%">'; print '<table class="nobordernopadding" width="100%">';
print '<tr style="background: #EEEEEE"><td align="left" nowrap="nowrap">'; print '<tr style="background: #EEEEEE"><td align="left" nowrap="nowrap">';
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?'; print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?';