Removed some FIXME

This commit is contained in:
Laurent Destailleur 2013-12-15 14:26:27 +01:00
parent bba2892752
commit ef2f8ea67d
12 changed files with 76 additions and 81 deletions

View File

@ -446,7 +446,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
} }
// Other checks // Other checks
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
$ok=0; $ok=0;
setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors'); setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors');
} }
if (isset($_POST["code"])) if (isset($_POST["code"]))
@ -456,8 +456,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=0; $ok=0;
setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors'); setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors');
} }
// FIXME regresion if code with not in numeric base /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
/*if (!is_numeric($_POST['code']))
{ {
$ok = 0; $ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />'; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
@ -1100,7 +1099,7 @@ if ($id)
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable = 0; if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable = 0;
else if ($obj->code == 'RECEP') $iserasable = 0; else if ($obj->code == 'RECEP') $iserasable = 0;
else if ($obj->code == 'EF0') $iserasable = 0; else if ($obj->code == 'EF0') $iserasable = 0;
} }
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0; if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;

View File

@ -167,7 +167,7 @@ if ($action == 'add_action')
$actioncomm->datep = $datep; $actioncomm->datep = $datep;
$actioncomm->datef = $datef; $actioncomm->datef = $datef;
$actioncomm->percentage = $percentage; $actioncomm->percentage = $percentage;
$actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * $actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) *
60; 60;
$usertodo=new User($db); $usertodo=new User($db);
@ -193,7 +193,7 @@ if ($action == 'add_action')
} }
// Special for module webcal and phenix // Special for module webcal and phenix
// FIXME external modules // TODO external modules
if (! empty($conf->webcalendar->enabled) && GETPOST('add_webcal') == 'on') $actioncomm->use_webcal=1; if (! empty($conf->webcalendar->enabled) && GETPOST('add_webcal') == 'on') $actioncomm->use_webcal=1;
if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1; if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1;
@ -484,7 +484,7 @@ if ($action == 'create')
// Full day // Full day
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
// Date start // Date start
$datep=$actioncomm->datep; $datep=$actioncomm->datep;
if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0); if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
@ -565,7 +565,7 @@ if ($action == 'create')
} }
else else
{ {
$events=array(); $events=array();
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
//For external user force the company to user company //For external user force the company to user company
@ -581,7 +581,7 @@ if ($action == 'create')
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>'; print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
$form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1); $form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1);
print '</td></tr>'; print '</td></tr>';
// Project // Project
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled))
@ -623,7 +623,7 @@ if ($action == 'create')
$doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$actioncomm->note),'',240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90); $doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$actioncomm->note),'',240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90);
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';
// Other attributes // Other attributes
$parameters=array(); $parameters=array();

View File

@ -42,6 +42,7 @@ $search_lastname=GETPOST('search_nom')?GETPOST('search_nom'):GETPOST('search_las
$search_firstname=GETPOST('search_firstname')?GETPOST('search_firstname'):GETPOST('search_firstname'); // For backward compatibility $search_firstname=GETPOST('search_firstname')?GETPOST('search_firstname'):GETPOST('search_firstname'); // For backward compatibility
$search_company=GETPOST('search_societe')?GETPOST('search_societe'):GETPOST('search_company'); // For backward compatibility $search_company=GETPOST('search_societe')?GETPOST('search_societe'):GETPOST('search_company'); // For backward compatibility
$contactname=GETPOST('contactname'); $contactname=GETPOST('contactname');
$begin=GETPOST('begin','alpha');
// Security check // Security check
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
@ -87,13 +88,7 @@ if ($socid) $sql.= " AND s.rowid = ".$socid;
if (dol_strlen($stcomm)) if (dol_strlen($stcomm))
{ {
$sql.= " AND s.fk_stcomm=$stcomm"; $sql.= " AND s.fk_stcomm=".$db->escape($stcomm);
}
// FIXME $begin not exist
if (dol_strlen($begin)) // filtre sur la premiere lettre du nom
{
$sql.= " AND upper(p.name) LIKE '".$begin."%'";
} }
if (! empty($search_lastname)) if (! empty($search_lastname))
@ -113,7 +108,7 @@ if (! empty($search_company))
if (! empty($contactname)) // acces a partir du module de recherche if (! empty($contactname)) // acces a partir du module de recherche
{ {
$sql.= " AND (p.name LIKE '%".$db->escape(strtolower($contactname))."%' OR lower(p.firstname) LIKE '%".$db->escape(strtolower($contactname))."%') "; $sql.= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
$sortfield = "p.name"; $sortfield = "p.name";
$sortorder = "ASC"; $sortorder = "ASC";
} }
@ -124,55 +119,57 @@ $sql.= $db->plimit($limit+1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses")); $param="&type=".$type;
print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], "&amp;type=$type",$sortfield,$sortorder,"",$num);
print '<table class="liste" width="100%">'; $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
print '<tr class="liste_titre">'; print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,"",$num);
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin,"&amp;type=$type","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin,"&amp;type=$type","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin,"&amp;type=$type","",$sortfield,$sortorder);
print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
print "</tr>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'?type='.$_GET["type"].'" method="GET">'; print '<table class="liste" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre"><input class="flat" name="search_lastname" size="12" value="'.$search_lastname.'"></td>'; print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder);
print '<td class="liste_titre"><input class="flat" name="search_firstname" size="12" value="'.$search_firstname.'"></td>'; print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder);
print '<td class="liste_titre"><input class="flat" name="search_company" size="12" value="'.$search_company.'"></td>'; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">'.$langs->trans("Email").'</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; print '<td class="liste_titre">'.$langs->trans("Phone").'</td>';
print "</tr>\n"; print "</tr>\n";
print '</form>';
$var=True; print '<form action="'.$_SERVER["PHP_SELF"].'?type='.$_GET["type"].'" method="GET">';
$i = 0; print '<tr class="liste_titre">';
while ($i < min($num,$limit)) print '<td class="liste_titre"><input class="flat" name="search_lastname" size="12" value="'.$search_lastname.'"></td>';
{ print '<td class="liste_titre"><input class="flat" name="search_firstname" size="12" value="'.$search_firstname.'"></td>';
$obj = $db->fetch_object($resql); print '<td class="liste_titre"><input class="flat" name="search_company" size="12" value="'.$search_company.'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print "</tr>\n";
print '</form>';
$var=!$var; $var=True;
$i = 0;
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
print "<tr ".$bc[$var].">"; $var=!$var;
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>';
print "<td>$obj->firstname</TD>";
print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;'; print "<tr ".$bc[$var].">";
print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->nom</a></td>\n"; print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>';
print "<td>$obj->firstname</TD>";
print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>'; print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;';
print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->nom</a></td>\n";
print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->rowid,'AC_TEL').'&nbsp;</td>'; print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>';
print "</tr>\n"; print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->rowid,'AC_TEL').'&nbsp;</td>';
$i++;
} print "</tr>\n";
print "</table></p>"; $i++;
$db->free($resql); }
print "</table></p>";
$db->free($resql);
} }
else else
{ {
@ -182,5 +179,4 @@ else
llxFooter(); llxFooter();
$db->close(); $db->close();
?>
?>

View File

@ -211,7 +211,6 @@ if ($object->id > 0)
} }
print ')'; print ')';
} }
// FIXME $facidnext not defined
/* /*
if ($facidnext > 0) if ($facidnext > 0)
{ {

View File

@ -1088,7 +1088,6 @@ else
} }
$servicepos=(GETPOST('servicepos')?GETPOST('servicepos'):1); // FIXME : not used ?
$colorb='666666'; $colorb='666666';
$arrayothercontracts=$object->getListOfContracts('others'); $arrayothercontracts=$object->getListOfContracts('others');

View File

@ -56,7 +56,7 @@ class box_activity extends ModeleBoxes
// FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software. // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software.
// FIXME: Removed number_format (not compatible with all languages) // FIXME: Removed number_format (not compatible with all languages)
// FIXME: Pb into some status // FIXME: Pb into some status
$this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME) $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous comments)
} }
/** /**

View File

@ -138,7 +138,7 @@ class Form
if (empty($typeofdata)) return 'ErrorBadParameter'; if (empty($typeofdata)) return 'ErrorBadParameter';
// When option to edit inline is activated // When option to edit inline is activated
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // FIXME add jquery timepicker if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker
{ {
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $success); $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $success);
} }

View File

@ -61,7 +61,7 @@ class DoliDBPgsql extends DoliDB
var $lastqueryerror; var $lastqueryerror;
var $lasterror; var $lasterror;
var $lasterrno; var $lasterrno;
var $unescapeslashquot=0; // By default we do not force the unescape of \'. This is used only to process sql with mysql escaped data. var $unescapeslashquot=0; // By default we do not force the unescape of \'. This is used only to process sql with mysql escaped data.
var $standard_conforming_strings=1; // Database has option standard_conforming_strings to on var $standard_conforming_strings=1; // Database has option standard_conforming_strings to on
@ -211,7 +211,7 @@ class DoliDBPgsql extends DoliDB
// tinyint type conversion // tinyint type conversion
$line=preg_replace('/tinyint\(?[0-9]*\)?/','smallint',$line); $line=preg_replace('/tinyint\(?[0-9]*\)?/','smallint',$line);
$line=preg_replace('/tinyint/i','smallint',$line); $line=preg_replace('/tinyint/i','smallint',$line);
// nuke unsigned // nuke unsigned
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line); $line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);
@ -234,13 +234,13 @@ class DoliDBPgsql extends DoliDB
$line=preg_replace('/^float/i','numeric',$line); $line=preg_replace('/^float/i','numeric',$line);
$line=preg_replace('/(\s*)float/i','\\1numeric',$line); $line=preg_replace('/(\s*)float/i','\\1numeric',$line);
//Check tms timestamp field case (in Mysql this field is defautled to now and //Check tms timestamp field case (in Mysql this field is defautled to now and
// on update defaulted by now // on update defaulted by now
$line=preg_replace('/(\s*)tms(\s*)timestamp/i','\\1tms timestamp without time zone DEFAULT now() NOT NULL',$line); $line=preg_replace('/(\s*)tms(\s*)timestamp/i','\\1tms timestamp without time zone DEFAULT now() NOT NULL',$line);
// nuke ON UPDATE CURRENT_TIMESTAMP // nuke ON UPDATE CURRENT_TIMESTAMP
$line=preg_replace('/(\s*)on(\s*)update(\s*)CURRENT_TIMESTAMP/i','\\1',$line); $line=preg_replace('/(\s*)on(\s*)update(\s*)CURRENT_TIMESTAMP/i','\\1',$line);
// unique index(field1,field2) // unique index(field1,field2)
if (preg_match('/unique index\s*\((\w+\s*,\s*\w+)\)/i',$line)) if (preg_match('/unique index\s*\((\w+\s*,\s*\w+)\)/i',$line))
{ {
@ -468,7 +468,7 @@ class DoliDBPgsql extends DoliDB
{ {
return ''; return '';
} }
/** /**
* Close database connexion * Close database connexion
* *
@ -1254,7 +1254,7 @@ class DoliDBPgsql extends DoliDB
$sql.="(".$field_desc['value'].")"; $sql.="(".$field_desc['value'].")";
} }
// FIXME May not work with pgsql. May need to run a second request. If it works, just remove the FIXME tag // TODO May not work with pgsql. May need to run a second request. If it works, just remove the comment
if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL"; if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL";
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);

View File

@ -220,7 +220,7 @@ class Export
if ($i > 0) $sql.=', '; if ($i > 0) $sql.=', ';
else $i++; else $i++;
if (strpos($key, ' as ')===false) { if (strpos($key, ' as ')===false) {
$newfield=$key.' as '.str_replace(array('.', '-'),'_',$key); $newfield=$key.' as '.str_replace(array('.', '-'),'_',$key);
} else { } else {
@ -327,7 +327,7 @@ class Export
*/ */
function conditionDate($Field, $Value, $Sens) function conditionDate($Field, $Value, $Sens)
{ {
// FIXME date_format is forbidden, not performant and no portable. Use instead BETWEEN // TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN
if (strlen($Value)==4) $Condition=" date_format(".$Field.",'%Y') ".$Sens." ".$Value; if (strlen($Value)==4) $Condition=" date_format(".$Field.",'%Y') ".$Sens." ".$Value;
elseif (strlen($Value)==6) $Condition=" date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'"; elseif (strlen($Value)==6) $Condition=" date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'";
else $Condition=" date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; else $Condition=" date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value;

View File

@ -102,7 +102,7 @@ if ($object->id > 0)
if ($action == 'delete') if ($action == 'delete')
{ {
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -153,7 +153,6 @@ if ($object->id > 0)
} }
print ')'; print ')';
} }
// FIXME $facidnext is not defined
/* /*
if ($facidnext > 0) if ($facidnext > 0)
{ {

View File

@ -97,7 +97,7 @@ if ($object->id)
if ($action == 'delete') if ($action == 'delete')
{ {
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
} }
print($mesg); print($mesg);
@ -162,7 +162,7 @@ if ($object->id)
{ {
// Affiche formulaire upload // Affiche formulaire upload
$formfile=new FormFile($db); $formfile=new FormFile($db);
$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("AddPhoto"), 1, 0, 1, 50, $object, '', false); // FIXME Regis: disabled for the moment $formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("AddPhoto"), 1, 0, 1, 50, $object, '', false); // ajax=false for the moment. true may not work.
} }
// Affiche photos // Affiche photos

View File

@ -76,7 +76,7 @@ if ($action == 'addrights' && $caneditperms)
{ {
$edituser = new User($db); $edituser = new User($db);
$edituser->fetch($id); $edituser->fetch($id);
//$edituser->addrights($rights, $module, '', $entity); // FIXME unused for the moment //$edituser->addrights($rights, $module, '', $entity); // TODO unused for the moment
$edituser->addrights($rights, $module); $edituser->addrights($rights, $module);
// Si on a touche a ses propres droits, on recharge // Si on a touche a ses propres droits, on recharge
@ -92,7 +92,7 @@ if ($action == 'delrights' && $caneditperms)
{ {
$edituser = new User($db); $edituser = new User($db);
$edituser->fetch($id); $edituser->fetch($id);
//$edituser->delrights($rights, $module, '', $entity); // FIXME unused for the moment //$edituser->delrights($rights, $module, '', $entity); // TODO unused for the moment
$edituser->delrights($rights, $module); $edituser->delrights($rights, $module);
// Si on a touche a ses propres droits, on recharge // Si on a touche a ses propres droits, on recharge
@ -177,13 +177,16 @@ $sql = "SELECT r.id, r.libelle, r.module";
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r,"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r,";
$sql.= " ".MAIN_DB_PREFIX."user_rights as ur"; $sql.= " ".MAIN_DB_PREFIX."user_rights as ur";
$sql.= " WHERE ur.fk_id = r.id"; $sql.= " WHERE ur.fk_id = r.id";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled))
{
if (1==2 && ! empty($conf->multicompany->transverse_mode)) { if (1==2 && ! empty($conf->multicompany->transverse_mode)) {
$sql.= " AND r.entity = ".(GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity); // FIXME unused for the moment $sql.= " AND r.entity = ".(GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity); // TODO unused for the moment
} else { } else {
$sql.= " AND r.entity = ".(! empty($fuser->entity) ? $fuser->entity : $conf->entity); $sql.= " AND r.entity = ".(! empty($fuser->entity) ? $fuser->entity : $conf->entity);
} }
} else { }
else
{
$sql.= " AND r.entity = ".$conf->entity; $sql.= " AND r.entity = ".$conf->entity;
} }
$sql.= " AND ur.fk_user = ".$fuser->id; $sql.= " AND ur.fk_user = ".$fuser->id;