Fix: Fix TODO

Doxygen
This commit is contained in:
Laurent Destailleur 2012-02-25 16:24:36 +01:00
parent 45f2f7b449
commit e519bf0c40

View File

@ -211,6 +211,7 @@ class FormOther
* *
* @param string $selected pourcentage pre-selectionne * @param string $selected pourcentage pre-selectionne
* @param string $htmlname nom de la liste deroulante * @param string $htmlname nom de la liste deroulante
* @param int $disabled Disabled or not
* @param int $increment increment value * @param int $increment increment value
* @param int $start start value * @param int $start start value
* @param int $end end value * @param int $end end value
@ -279,11 +280,11 @@ class FormOther
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
* *
* @param string $selected Preselected value * @param string $selected Preselected value
* @param string $htmlname Name of combo list * @param string $htmlname Name of combo list (example: 'search_sale')
* @param User $user Object user * @param User $user Object user
* @return string Html combo list code * @return string Html combo list code
*/ */
function select_salesrepresentatives($selected=0,$htmlname='search_sale',$user) function select_salesrepresentatives($selected,$htmlname,$user)
{ {
global $conf; global $conf;
@ -359,7 +360,7 @@ class FormOther
if ($useempty) print '<option value="0">&nbsp;</option>'; if ($useempty) print '<option value="0">&nbsp;</option>';
$j=0; $j=0;
$level=0; $level=0;
PLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid); $this->_pLineSelect($j, 0, $tasksarray, $level, $selectedtask, $projectid);
print '</select>'; print '</select>';
} }
else else
@ -368,6 +369,86 @@ class FormOther
} }
} }
/**
* Write all lines of a project (if parent = 0)
*
* @param int &$inc Cursor counter
* @param int $parent Id parent
* @param Object $lines Line object
* @param int $level Level
* @param int $selectedtask Id selected task
* @param int $selectedproject Id selected project
* @return void
*/
private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0)
{
global $langs, $user, $conf;
$lastprojectid=0;
$numlines=count($lines);
for ($i = 0 ; $i < $numlines ; $i++)
{
if ($lines[$i]->fk_parent == $parent)
{
$var = !$var;
// Break on a new project
if ($parent == 0)
{
if ($lines[$i]->fk_project != $lastprojectid)
{
if ($i > 0 && $conf->browser->firefox) print '<option value="0" disabled="disabled">----------</option>';
print '<option value="'.$lines[$i]->fk_project.'_0"';
if ($selectedproject == $lines[$i]->fk_project) print ' selected="selected"';
print '>'; // Project -> Task
print $langs->trans("Project").' '.$lines[$i]->projectref;
if (empty($lines[$i]->public))
{
print ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')';
}
else
{
print ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')';
}
//print '-'.$parent.'-'.$lines[$i]->fk_project.'-'.$lastprojectid;
print "</option>\n";
$lastprojectid=$lines[$i]->fk_project;
$inc++;
}
}
// Print task
if ($lines[$i]->id > 0)
{
print '<option value="'.$lines[$i]->fk_project.'_'.$lines[$i]->id.'"';
if ($lines[$i]->id == $selectedtask) print ' selected="selected"';
print '>';
print $langs->trans("Project").' '.$lines[$i]->projectref;
if (empty($lines[$i]->public))
{
print ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')';
}
else
{
print ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')';
}
if ($lines[$i]->id) print ' > ';
for ($k = 0 ; $k < $level ; $k++)
{
print "&nbsp;&nbsp;&nbsp;";
}
print $lines[$i]->label."</option>\n";
$inc++;
}
$level++;
if ($lines[$i]->id) $this->_pLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject);
$level--;
}
}
}
/** /**
* Output a HTML code to select a color * Output a HTML code to select a color
@ -460,6 +541,7 @@ class FormOther
* @param string $name Nom de l'image * @param string $name Nom de l'image
* @param int $x Largeur de l'image en pixels * @param int $x Largeur de l'image en pixels
* @param int $y Hauteur de l'image en pixels * @param int $y Hauteur de l'image en pixels
* @return void
*/ */
function CreateColorIcon($color,$module,$name,$x='12',$y='12') function CreateColorIcon($color,$module,$name,$x='12',$y='12')
{ {
@ -576,6 +658,9 @@ class FormOther
* @param int $useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @param int $min_year Offset of minimum year into list (by default current year -10) * @param int $min_year Offset of minimum year into list (by default current year -10)
* @param int $max_year Offset of maximum year into list (by default current year + 5) * @param int $max_year Offset of maximum year into list (by default current year + 5)
* @param int $offset Offset
* @param int $invert Invert
* @param string $option Option
* @return void * @return void
*/ */
function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='') function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='')
@ -591,6 +676,9 @@ class FormOther
* @param int $useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @param int $min_year Offset of minimum year into list (by default current year -10) * @param int $min_year Offset of minimum year into list (by default current year -10)
* @param int $max_year Offset of maximum year into list (by default current year + 5) * @param int $max_year Offset of maximum year into list (by default current year + 5)
* @param int $offset Offset
* @param int $invert Invert
* @param string $option Option
* @return void * @return void
*/ */
function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='') function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='')
@ -636,12 +724,13 @@ class FormOther
* *
* @param int $page Page * @param int $page Page
* @param string $selected Id condition pre-selectionne * @param string $selected Id condition pre-selectionne
* @param int $socid Id of third party
* @param string $htmlname Nom du formulaire select * @param string $htmlname Nom du formulaire select
* @param string $origin Origine de l'appel pour pouvoir creer un retour * @param string $origin Origine de l'appel pour pouvoir creer un retour
* @param int $originid Id de l'origine * @param int $originid Id de l'origine
* @return void * @return void
*/ */
function form_address($page, $selected='', $socid, $htmlname='address_id', $origin='', $originid='') function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='')
{ {
global $langs,$conf; global $langs,$conf;
if ($htmlname != "none") if ($htmlname != "none")
@ -676,87 +765,4 @@ class FormOther
} }
/**
* Write all lines of a project (if parent = 0)
*
* @param int &$inc Cursor counter
* @param int $parent Id parent
* @param Object $lines Line object
* @param int $level Level
* @param int $selectedtask Id selected task
* @param int $selectedproject Id selected project
* @return void
* TODO why this function is here ?
*/
function PLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0)
{
global $langs, $user, $conf;
$lastprojectid=0;
$numlines=count($lines);
for ($i = 0 ; $i < $numlines ; $i++)
{
if ($lines[$i]->fk_parent == $parent)
{
$var = !$var;
// Break on a new project
if ($parent == 0)
{
if ($lines[$i]->fk_project != $lastprojectid)
{
if ($i > 0 && $conf->browser->firefox) print '<option value="0" disabled="disabled">----------</option>';
print '<option value="'.$lines[$i]->fk_project.'_0"';
if ($selectedproject == $lines[$i]->fk_project) print ' selected="selected"';
print '>'; // Project -> Task
print $langs->trans("Project").' '.$lines[$i]->projectref;
if (empty($lines[$i]->public))
{
print ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')';
}
else
{
print ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')';
}
//print '-'.$parent.'-'.$lines[$i]->fk_project.'-'.$lastprojectid;
print "</option>\n";
$lastprojectid=$lines[$i]->fk_project;
$inc++;
}
}
// Print task
if ($lines[$i]->id > 0)
{
print '<option value="'.$lines[$i]->fk_project.'_'.$lines[$i]->id.'"';
if ($lines[$i]->id == $selectedtask) print ' selected="selected"';
print '>';
print $langs->trans("Project").' '.$lines[$i]->projectref;
if (empty($lines[$i]->public))
{
print ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')';
}
else
{
print ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')';
}
if ($lines[$i]->id) print ' > ';
for ($k = 0 ; $k < $level ; $k++)
{
print "&nbsp;&nbsp;&nbsp;";
}
print $lines[$i]->label."</option>\n";
$inc++;
}
$level++;
if ($lines[$i]->id) PLineSelect($inc, $lines[$i]->id, $lines, $level, $selectedtask, $selectedproject);
$level--;
}
}
}
?> ?>