Trad: Traduction module déplacement
This commit is contained in:
parent
f55f6b6a07
commit
d8e072e529
@ -21,14 +21,24 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file htdocs/compta/deplacement/fiche.php
|
/**
|
||||||
|
\file htdocs/compta/deplacement/fiche.php
|
||||||
\brief Page fiche d'un déplacement
|
\brief Page fiche d'un déplacement
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
|
$langs->load("trips");
|
||||||
|
|
||||||
|
$id=isset($_GET["id"])?$_GET["id"]:$_POST["id"];
|
||||||
|
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes")
|
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes")
|
||||||
{
|
{
|
||||||
$deplacement = new Deplacement($db);
|
$deplacement = new Deplacement($db);
|
||||||
@ -80,39 +90,40 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "Error";
|
print $mesg=$langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Action create
|
||||||
|
*/
|
||||||
if ($_GET["action"] == 'create')
|
if ($_GET["action"] == 'create')
|
||||||
{
|
{
|
||||||
print "<form action=\"fiche.php\" method=\"post\">\n";
|
print "<form action=\"fiche.php\" method=\"post\">\n";
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
print '<div class="titre">Nouveau déplacement</div><br>';
|
print '<div class="titre">'.$langs->trans("NewTrip").'</div><br>';
|
||||||
|
|
||||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td width="20%">Personne</td><td>'.$user->fullname.'</td></tr>';
|
print '<tr><td width="20%">'.$langs->trans("Person").'</td><td>'.$user->fullname.'</td></tr>';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td>Société visitée</td><td>';
|
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
|
||||||
print $html->select_societes();
|
print $html->select_societes();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td>Date du déplacement</td><td>';
|
print '<td>'.$langs->trans("Date").'</td><td>';
|
||||||
print $html->select_date();
|
print $html->select_date();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>Kilomètres</td><td><input name="km" size="10" value=""></td></tr>';
|
print '<tr><td>'.$langs->trans("Kilometers").'</td><td><input name="km" size="10" value=""></td></tr>';
|
||||||
print '<tr><td> </td><td><input type="submit" value="'.$langs->trans("Save").'"> ';
|
print '<tr><td> </td><td><input type="submit" value="'.$langs->trans("Save").'"> ';
|
||||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -120,83 +131,92 @@ if ($_GET["action"] == 'create')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($_GET["id"])
|
if ($id)
|
||||||
{
|
{
|
||||||
$deplacement = new Deplacement($db);
|
$deplacement = new Deplacement($db);
|
||||||
$result = $deplacement->fetch($_GET["id"]);
|
$result = $deplacement->fetch($id);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
if ($mesg) print "$mesg<br>";
|
||||||
* Confirmation de la suppression du déplacement
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ($_GET["action"] == 'delete')
|
|
||||||
{
|
|
||||||
|
|
||||||
print_fiche_titre("Suppression déplacement ",$message);
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
$html = new Form($db);
|
|
||||||
$html->form_confirm("fiche.php?id=".$_GET["id"],"Supprimer ce déplacement","Etes-vous sûr de vouloir supprimer ce déplacement ?","confirm_delete");
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($_GET["action"] == 'edit')
|
if ($_GET["action"] == 'edit')
|
||||||
{
|
{
|
||||||
print_fiche_titre('Fiche déplacement', $mesg);
|
$h=0;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$deplacement->id";
|
||||||
|
$head[$h][1] = $langs->trans("TripCard");
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").' '.$deplacement->id);
|
||||||
|
|
||||||
print "<form action=\"fiche.php\" method=\"post\">\n";
|
print "<form action=\"fiche.php\" method=\"post\">\n";
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($deplacement->socid);
|
$soc->fetch($deplacement->socid);
|
||||||
|
|
||||||
print '<tr><td width="20%">Personne</td><td>'.$user->fullname.'</td></tr>';
|
print '<tr><td width="20%">'.$langs->trans("Personn").'</td><td>'.$user->fullname.'</td></tr>';
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print '<td>Société visitée</td><td>';
|
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
|
||||||
print $html->select_societes($soc->id);
|
print $html->select_societes($soc->id);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>Date du déplacement</td><td>';
|
print '<tr><td>'.$langs->trans("Date").'</td><td>';
|
||||||
print $html->select_date($deplacement->date);
|
print $html->select_date($deplacement->date);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td>Kilomètres</td><td><input name="km" size="10" value="'.$deplacement->km.'"></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> </td><td><input type="submit" value="'.$langs->trans("Save").'"> ';
|
print '<tr><td> </td><td><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form><br>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_fiche_titre('Fiche déplacement', $mesg);
|
$h=0;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/compta/deplacement/fiche.php?id=$deplacement->id";
|
||||||
|
$head[$h][1] = $langs->trans("TripCard");
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, $hselected, $langs->trans("Ref").' '.$deplacement->id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Confirmation de la suppression du déplacement
|
||||||
|
*/
|
||||||
|
if ($_GET["action"] == 'delete')
|
||||||
|
{
|
||||||
|
|
||||||
|
$html = new Form($db);
|
||||||
|
$html->form_confirm("fiche.php?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($deplacement->socid);
|
$soc->fetch($deplacement->socid);
|
||||||
|
|
||||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="3">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td width="20%">Personne</td><td>'.$user->fullname.'</td></tr>';
|
print '<tr><td width="20%">'.$langs->trans("Personn").'</td><td><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$user->id.'">'.$user->fullname.'</a></td></tr>';
|
||||||
print '<tr><td width="20%">Société visitée</td><td>'.$soc->nom_url.'</td></tr>';
|
print '<tr><td width="20%">'.$langs->trans("CompanyVisited").'</td><td>'.$soc->nom_url.'</td></tr>';
|
||||||
print '<tr><td>Date du déplacement</td><td>';
|
print '<tr><td>'.$langs->trans("Date").'</td><td>';
|
||||||
print dolibarr_print_date($deplacement->date);
|
print dolibarr_print_date($deplacement->date);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td>Kilomètres</td><td>'.$deplacement->km.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Kilometers").'</td><td>'.$deplacement->km.'</td></tr>';
|
||||||
print "</table>";
|
print "</table><br>";
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "Error:".$db->error();
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -206,19 +226,18 @@ else
|
|||||||
* Barre d'actions
|
* Barre d'actions
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($_GET["action"] != 'create')
|
if ($_GET["action"] != 'create' && $_GET["action"] != 'edit')
|
||||||
{
|
{
|
||||||
print '<a class="tabAction" href="fiche.php?action=edit&id='.$_GET["id"].'">'.$langs->trans('Edit').'</a>';
|
print '<a class="tabAction" href="fiche.php?action=edit&id='.$id.'">'.$langs->trans('Edit').'</a>';
|
||||||
print '<a class="butDelete" href="fiche.php?action=delete&id='.$_GET["id"].'">'.$langs->trans('Delete').'</a>';
|
print '<a class="butDelete" href="fiche.php?action=delete&id='.$id.'">'.$langs->trans('Delete').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter('$Date$ - $Revision$');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -72,6 +72,7 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
|
print_liste_field_titre($langs->trans("Ref"),"index.php","d.rowid","","&socidp=$socidp",'',$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Date"),"index.php","d.dated","","&socidp=$socidp",'',$sortfield);
|
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("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("Person"),"index.php","u.name","","&socidp=$socidp",'',$sortfield);
|
||||||
@ -85,11 +86,10 @@ if ($resql)
|
|||||||
$soc->fetch($objp->idp);
|
$soc->fetch($objp->idp);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td><a href="fiche.php?id='.$objp->rowid.'">'.dolibarr_print_date($objp->dd).'</a></td>';
|
print '<td><a href="fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowTrip"),"trip").' '.$objp->rowid.'</a></td>';
|
||||||
print '<td>' . $soc->nom_url . '</a></td>';
|
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">'.$objp->firstname.' '.$objp->name.'</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 "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -1,5 +1,11 @@
|
|||||||
# Dolibarr language file - en_US - trips
|
# Dolibarr language file - en_US - trips
|
||||||
Trip=Trip
|
Trip=Trip
|
||||||
Trips=Trips
|
Trips=Trips
|
||||||
|
TripCard=Trip card
|
||||||
AddTrip=Add trip
|
AddTrip=Add trip
|
||||||
ListOfTrips=List of trips
|
ListOfTrips=List of trips
|
||||||
|
NewTrip=New trip
|
||||||
|
CompanyVisited=Company/fundation visited
|
||||||
|
Kilometers=Kilometers
|
||||||
|
DeleteTrip=Delete trip
|
||||||
|
ConfirmDeleteTrip=Are you sure you want to delete this trip ?
|
||||||
|
|||||||
@ -1,5 +1,11 @@
|
|||||||
# Dolibarr language file - fr_FR - trips
|
# Dolibarr language file - fr_FR - trips
|
||||||
Trip=Déplacement
|
Trip=Déplacement
|
||||||
Trips=Déplacements
|
Trips=Déplacements
|
||||||
|
TripCard=Fiche déplacement
|
||||||
AddTrip=Ajouter déplacement
|
AddTrip=Ajouter déplacement
|
||||||
ListOfTrips=Liste des déplacements
|
ListOfTrips=Liste des déplacements
|
||||||
|
NewTrip=Nouveau déplacement
|
||||||
|
CompanyVisited=Société/Institution visitée
|
||||||
|
Kilometers=Kilomètres
|
||||||
|
DeleteTrip=Supprimer déplacement
|
||||||
|
ConfirmDeleteTrip=Êtes vous sur de vouloir supprimer ce déplacement ?
|
||||||
Loading…
Reference in New Issue
Block a user