Amliorations mineures sur module dplacement

This commit is contained in:
Laurent Destailleur 2005-12-03 00:36:02 +00:00
parent 81d55d3e4a
commit 4421ae8ea0
3 changed files with 12 additions and 9 deletions

View File

@ -18,7 +18,6 @@
*
* $Id$
* $Source$
*
*/
/**
@ -63,6 +62,7 @@ if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
if ($id)
{
Header ( "Location: fiche.php?id=".$id);
exit;
}
else
{
@ -87,6 +87,7 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
if ($result > 0)
{
Header ( "Location: fiche.php?id=".$_POST["id"]);
exit;
}
else
{
@ -170,10 +171,10 @@ else
print '</td></tr>';
print '<tr><td>'.$langs->trans("Kilometers").'</td><td><input name="km" class="flat" size="10" value="'.$deplacement->km.'"></td></tr>';
print '<tr><td>&nbsp;</td><td><input type="submit" class="button" value="'.$langs->trans("Save").'">&nbsp;';
print '<tr><td align="center" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; ';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>';
print '</form><br>';
print '</form>';
print '</div>';
}
@ -208,7 +209,7 @@ else
print dolibarr_print_date($deplacement->date);
print '</td></tr>';
print '<tr><td>'.$langs->trans("Kilometers").'</td><td>'.$deplacement->km.'</td></tr>';
print "</table><br>";
print "</table>";
print '</div>';
}

View File

@ -19,7 +19,6 @@
*
* $Id$
* $Source$
*
*/
/**
@ -52,9 +51,11 @@ $offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT s.nom, s.idp, d.km,".$db->pdate("d.dated")." as dd, u.name, u.firstname, d.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE d.fk_soc = s.idp AND d.fk_user = u.rowid";
$sql = "SELECT s.nom, s.idp,"; // Ou
$sql.= " d.rowid, ".$db->pdate("d.dated")." as dd, d.km, "; // Comment
$sql.= " u.name, u.firstname"; // Qui
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u ";
$sql.= " WHERE d.fk_soc = s.idp AND d.fk_user = u.rowid";
if ($user->societe_id > 0)
{
@ -77,6 +78,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Date"),"index.php","d.dated","","&socidp=$socidp",'',$sortfield);
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","&socidp=$socidp",'',$sortfield);
print_liste_field_titre($langs->trans("Person"),"index.php","u.name","","&socidp=$socidp",'',$sortfield);
print_liste_field_titre($langs->trans("Distance"),"index.php","d.km","","&socidp=$socidp",'align="right"',$sortfield);
print "</tr>\n";
$var=true;
@ -91,6 +93,7 @@ if ($resql)
print '<td>'.dolibarr_print_date($objp->dd).'</td>';
print '<td>' . img_object($langs->trans("ShowCompany"),"company").' '.$soc->nom_url . '</a></td>';
print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$objp->firstname.' '.$objp->name.'</a></td>';
print '<td align="right">'.$objp->km.'</td>';
print "</tr>\n";
$i++;

View File

@ -17,7 +17,6 @@
*
* $Id$
* $Source$
*
*/
/**