Skip to content
Snippets Groups Projects
Commit 5ab3da7c authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Can define hour and minutes in intervention cards.

New: Can edit a validated intervention.
parent 6b6800f8
Branches
Tags
No related merge requests found
...@@ -19,6 +19,8 @@ For users: ...@@ -19,6 +19,8 @@ For users:
- Miscelanous bug fixes. - Miscelanous bug fixes.
- A lot of other enhancements to increase productivity. - A lot of other enhancements to increase productivity.
- All phone numbers show the clicktodial link if module is enabled. - All phone numbers show the clicktodial link if module is enabled.
- Can define hour and minutes in intervention cards.
- Can edit a validated intervention.
For translators: For translators:
- The errors language file contains only error or warning messages with - The errors language file contains only error or warning messages with
... ...
......
...@@ -75,7 +75,30 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes') ...@@ -75,7 +75,30 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes')
$fichinter->id = $_GET["id"]; $fichinter->id = $_GET["id"];
$fichinter->fetch($_GET["id"]); $fichinter->fetch($_GET["id"]);
$result = $fichinter->valid($user, $conf->fichinter->outputdir); $result = $fichinter->setValid($user, $conf->fichinter->outputdir);
if ($result >= 0)
{
$outputlangs = $langs;
if (! empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
$result=fichinter_create($db, $fichinter, $_REQUEST['model'], $outputlangs);
}
else
{
$mesg='<div class="error">'.$fichinter->error.'</div>';
}
}
if ($_REQUEST['action'] == 'confirm_modify' && $_REQUEST['confirm'] == 'yes')
{
$fichinter = new Fichinter($db);
$fichinter->id = $_GET["id"];
$fichinter->fetch($_GET["id"]);
$result = $fichinter->setDraft($user);
if ($result >= 0) if ($result >= 0)
{ {
$outputlangs = $langs; $outputlangs = $langs;
...@@ -109,7 +132,7 @@ if ($_POST["action"] == 'add') ...@@ -109,7 +132,7 @@ if ($_POST["action"] == 'add')
$result = $fichinter->create(); $result = $fichinter->create();
if ($result > 0) if ($result > 0)
{ {
$_GET["id"]=$result; // Force raffraichissement sur fiche venant d'etre cr��e $_GET["id"]=$result; // Force raffraichissement sur fiche venant d'etre cree
$fichinterid=$result; $fichinterid=$result;
} }
else else
...@@ -204,7 +227,7 @@ if ($_POST['action'] == "addligne" && $user->rights->ficheinter->creer) ...@@ -204,7 +227,7 @@ if ($_POST['action'] == "addligne" && $user->rights->ficheinter->creer)
$ret=$fichinter->fetch($_POST['fichinterid']); $ret=$fichinter->fetch($_POST['fichinterid']);
$desc=$_POST['np_desc']; $desc=$_POST['np_desc'];
$date_intervention = $db->idate(mktime(12, 1 , 1, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"])); $date_intervention = dolibarr_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']); $duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
$fichinter->addline( $fichinter->addline(
...@@ -242,9 +265,10 @@ if ($_POST['action'] == 'updateligne' && $user->rights->ficheinter->creer && $_P ...@@ -242,9 +265,10 @@ if ($_POST['action'] == 'updateligne' && $user->rights->ficheinter->creer && $_P
exit; exit;
} }
$desc=$_POST['desc']; $desc=$_POST['desc'];
$date_intervention = dolibarr_mktime(12, 1 , 1, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]); $date_intervention = dolibarr_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']); $duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
$fichinterline->datei=$date_intervention;
$fichinterline->desc=$desc; $fichinterline->desc=$desc;
$fichinterline->duration=$duration; $fichinterline->duration=$duration;
$result = $fichinterline->update(); $result = $fichinterline->update();
...@@ -510,27 +534,28 @@ elseif ($_GET["id"] > 0) ...@@ -510,27 +534,28 @@ elseif ($_GET["id"] > 0)
dolibarr_fiche_head($head, 'card', $langs->trans("InterventionCard")); dolibarr_fiche_head($head, 'card', $langs->trans("InterventionCard"));
/* // Confirmation de la suppression de la fiche d'intervention
* Confirmation de la suppression de la fiche d'intervention
*/
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete');
print '<br>'; print '<br>';
} }
/* // Confirmation de la validation de la fiche d'intervention
* Confirmation de la validation de la fiche d'intervention
*/
if ($_GET['action'] == 'validate') if ($_GET['action'] == 'validate')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate');
print '<br>'; print '<br>';
} }
/* // Confirmation de la validation de la fiche d'intervention
* Confirmation de la suppression d'une ligne d'intervention if ($_GET['action'] == 'modify')
*/ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify');
print '<br>';
}
// Confirmation de la suppression d'une ligne d'intervention
if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline');
...@@ -663,8 +688,8 @@ elseif ($_GET["id"] > 0) ...@@ -663,8 +688,8 @@ elseif ($_GET["id"] > 0)
{ {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Description').'</td>'; print '<td>'.$langs->trans('Description').'</td>';
print '<td>'.$langs->trans('Date').'</td>'; print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td>'.$langs->trans('Duration').'</td>'; print '<td align="right">'.$langs->trans('Duration').'</td>';
print '<td width="48" colspan="3">&nbsp;</td>'; print '<td width="48" colspan="3">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }
...@@ -682,8 +707,11 @@ elseif ($_GET["id"] > 0) ...@@ -682,8 +707,11 @@ elseif ($_GET["id"] > 0)
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
print nl2br($objp->description); print nl2br($objp->description);
print '<td width="150">'.dolibarr_print_date($objp->date_intervention,'day').'</td>'; // Date
print '<td width="150">'.ConvertSecondToTime($objp->duree).'</td>'; print '<td align="center" width="150">'.dolibarr_print_date($objp->date_intervention,'dayhour').'</td>';
// Duration
print '<td align="right" width="150">'.ConvertSecondToTime($objp->duree).'</td>';
print "</td>\n"; print "</td>\n";
...@@ -768,12 +796,12 @@ elseif ($_GET["id"] > 0) ...@@ -768,12 +796,12 @@ elseif ($_GET["id"] > 0)
print '</td>'; print '</td>';
// Date d'intervention // Date d'intervention
print '<td>'; print '<td align="center" nowrap="nowrap">';
$html->select_date($objp->date_intervention,'di',0,0,0,"date_intervention"); $html->select_date($objp->date_intervention,'di',1,1,0,"date_intervention");
print '</td>'; print '</td>';
// Duration // Duration
print '<td>'; print '<td align="right">';
$html->select_duree('duration',$objp->duree); $html->select_duree('duration',$objp->duree);
print '</td>'; print '</td>';
...@@ -803,8 +831,8 @@ elseif ($_GET["id"] > 0) ...@@ -803,8 +831,8 @@ elseif ($_GET["id"] > 0)
print '<td>'; print '<td>';
print '<a name="add"></a>'; // ancre print '<a name="add"></a>'; // ancre
print $langs->trans('Description').'</td>'; print $langs->trans('Description').'</td>';
print '<td>'.$langs->trans('Date').'</td>'; print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td>'.$langs->trans('Duration').'</td>'; print '<td align="right">'.$langs->trans('Duration').'</td>';
print '<td colspan="4">&nbsp;</td>'; print '<td colspan="4">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
...@@ -832,12 +860,14 @@ elseif ($_GET["id"] > 0) ...@@ -832,12 +860,14 @@ elseif ($_GET["id"] > 0)
print '</td>'; print '</td>';
// Date d'intervention // Date d'intervention
print '<td>'; print '<td align="center" nowrap="nowrap">';
$html->select_date(time(),'di',0,0,0,"addinter"); $timearray=dolibarr_getdate(mktime());
$timewithnohour=dolibarr_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
$html->select_date($timewithnohour,'di',1,1,0,"addinter");
print '</td>'; print '</td>';
// Dur�e // Dur�e
print '<td>'; print '<td align="right">';
$html->select_duree('duration'); $html->select_duree('duration');
print '</td>'; print '</td>';
...@@ -877,6 +907,22 @@ elseif ($_GET["id"] > 0) ...@@ -877,6 +907,22 @@ elseif ($_GET["id"] > 0)
print '>'.$langs->trans("Valid").'</a>'; print '>'.$langs->trans("Valid").'</a>';
} }
// Modify
if ($fichinter->statut == 1 && $user->rights->ficheinter->creer)
{
print '<a class="butAction" ';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_modify&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmModifyIntervention')).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="fiche.php?id='.$_GET["id"].'&action=modify"';
}
print '>'.$langs->trans("Modify").'</a>';
}
// Delete // Delete
if (($fichinter->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer) if (($fichinter->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer)
{ {
... ...
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
*/ */
/** \file htdocs/fichinter/fichinter.class.php /** \file htdocs/fichinter/fichinter.class.php
\ingroup ficheinter * \ingroup ficheinter
\brief Fichier de la classe des gestion des fiches interventions * \brief Fichier de la classe des gestion des fiches interventions
\version $Id$ * \version $Id$
*/ */
require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php"); require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php");
...@@ -46,9 +46,11 @@ class Fichinter extends CommonObject ...@@ -46,9 +46,11 @@ class Fichinter extends CommonObject
var $author; var $author;
var $ref; var $ref;
var $date; var $datec;
var $date_delivery; var $datev;
var $datem;
var $duree; var $duree;
var $statut; // 0=draft, 1=validated
var $description; var $description;
var $note_private; var $note_private;
var $note_public; var $note_public;
...@@ -146,7 +148,6 @@ class Fichinter extends CommonObject ...@@ -146,7 +148,6 @@ class Fichinter extends CommonObject
* Insertion dans la base * Insertion dans la base
*/ */
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET "; $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET ";
$sql .= " datei = ".$this->db->idate($this->date);
$sql .= ", description = '".addslashes($this->description)."'"; $sql .= ", description = '".addslashes($this->description)."'";
$sql .= ", duree = ".$this->duree; $sql .= ", duree = ".$this->duree;
$sql .= ", fk_projet = ".$this->projet_id; $sql .= ", fk_projet = ".$this->projet_id;
...@@ -171,7 +172,10 @@ class Fichinter extends CommonObject ...@@ -171,7 +172,10 @@ class Fichinter extends CommonObject
function fetch($rowid) function fetch($rowid)
{ {
$sql = "SELECT ref, description, fk_soc, fk_statut,"; $sql = "SELECT ref, description, fk_soc, fk_statut,";
$sql.= " ".$this->db->pdate(datei)." as di, duree, fk_projet, note_public, note_private, model_pdf"; $sql.= " ".$this->db->pdate("datec")." as datec,";
$sql.= " ".$this->db->pdate("date_valid")." as datev,";
$sql.= " ".$this->db->pdate("tms")." as datem,";
$sql.= " duree, fk_projet, note_public, note_private, model_pdf";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter";
$sql.= " WHERE rowid=".$rowid; $sql.= " WHERE rowid=".$rowid;
...@@ -188,8 +192,10 @@ class Fichinter extends CommonObject ...@@ -188,8 +192,10 @@ class Fichinter extends CommonObject
$this->description = $obj->description; $this->description = $obj->description;
$this->socid = $obj->fk_soc; $this->socid = $obj->fk_soc;
$this->statut = $obj->fk_statut; $this->statut = $obj->fk_statut;
$this->date = $obj->di;
$this->duree = $obj->duree; $this->duree = $obj->duree;
$this->datec = $obj->datec;
$this->datev = $obj->datev;
$this->datem = $obj->datem;
$this->projetidp = $obj->fk_projet; $this->projetidp = $obj->fk_projet;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
...@@ -209,22 +215,57 @@ class Fichinter extends CommonObject ...@@ -209,22 +215,57 @@ class Fichinter extends CommonObject
} }
} }
/**
* \brief Set status to draft
* \return int <0 if KO, >0 if OK
*/
function setDraft($user)
{
global $langs, $conf;
if ($this->statut != 0)
{
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
$sql.= " SET fk_statut = 0";
$sql.= " WHERE rowid = ".$this->id;
dolibarr_syslog("Fichinter::setDraft sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
$this->db->commit();
return 1;
}
else
{
$this->db->rollback();
$this->error=$this->db->lasterror();
dolibarr_syslog("Fichinter::setDraft ".$this->error,LOG_ERR);
return -1;
}
}
}
/** /**
* \brief Valide une fiche intervention * \brief Valide une fiche intervention
* \param user User qui valide * \param user User qui valide
* \return int <0 si ko, >0 si ok * \return int <0 if KO, >0 if OK
*/ */
function valid($user, $outputdir) function setValid($user, $outputdir)
{ {
global $langs, $conf; global $langs, $conf;
if ($this->statut != 1)
{
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
$sql.= " SET fk_statut = 1, date_valid=".$this->db->idate(mktime()).", fk_user_valid=".$user->id; $sql.= " SET fk_statut = 1, date_valid=".$this->db->idate(mktime()).", fk_user_valid=".$user->id;
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
dolibarr_syslog("Fichinter::valid sql=".$sql); dolibarr_syslog("Fichinter::setValid sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
...@@ -244,7 +285,7 @@ class Fichinter extends CommonObject ...@@ -244,7 +285,7 @@ class Fichinter extends CommonObject
{ {
$this->db->rollback(); $this->db->rollback();
$this->error=join(',',$this->errors); $this->error=join(',',$this->errors);
dolibarr_syslog("Fichinter::update ".$this->error,LOG_ERR); dolibarr_syslog("Fichinter::setValid ".$this->error,LOG_ERR);
return -1; return -1;
} }
} }
...@@ -252,10 +293,11 @@ class Fichinter extends CommonObject ...@@ -252,10 +293,11 @@ class Fichinter extends CommonObject
{ {
$this->db->rollback(); $this->db->rollback();
$this->error=$this->db->lasterror(); $this->error=$this->db->lasterror();
dolibarr_syslog("Fichinter::update ".$this->error,LOG_ERR); dolibarr_syslog("Fichinter::setValid ".$this->error,LOG_ERR);
return -1; return -1;
} }
} }
}
/** /**
* \brief Retourne le libelle du statut de l'intervantion * \brief Retourne le libelle du statut de l'intervantion
...@@ -810,7 +852,7 @@ class FichinterLigne ...@@ -810,7 +852,7 @@ class FichinterLigne
$sql.= ' (fk_fichinter, description, date, duree, rang)'; $sql.= ' (fk_fichinter, description, date, duree, rang)';
$sql.= " VALUES (".$this->fk_fichinter.","; $sql.= " VALUES (".$this->fk_fichinter.",";
$sql.= " '".addslashes($this->desc)."',"; $sql.= " '".addslashes($this->desc)."',";
$sql.= " ".$this->datei.","; $sql.= " ".$this->db->idate($this->datei).",";
$sql.= " ".$this->duration.","; $sql.= " ".$this->duration.",";
$sql.= ' '.$rangToUse; $sql.= ' '.$rangToUse;
$sql.= ')'; $sql.= ')';
...@@ -870,13 +912,15 @@ class FichinterLigne ...@@ -870,13 +912,15 @@ class FichinterLigne
} }
else else
{ {
$this->error=$this->db->lasterror();
dolibarr_syslog("FichinterLigne::update Error ".$this->error);
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
dolibarr_syslog("FichinterLigne::update Error ".$this->error); dolibarr_syslog("FichinterLigne::update Error ".$this->error);
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
... ...
......
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -44,7 +44,7 @@ if ($user->societe_id) $socid=$user->societe_id; ...@@ -44,7 +44,7 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $fichinterid,''); $result = restrictedArea($user, 'ficheinter', $fichinterid,'');
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="f.datei"; if (! $sortfield) $sortfield="fd.date";
if ($page == -1) { $page = 0 ; } if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
...@@ -60,12 +60,14 @@ $pagenext = $page + 1; ...@@ -60,12 +60,14 @@ $pagenext = $page + 1;
llxHeader(); llxHeader();
$sql = "SELECT s.nom,s.rowid as socid, f.ref, f.rowid as fichid, f.fk_statut,"; $sql = "SELECT";
$sql.= " fd.description, ".$db->pdate("fd.date")." as dp, fd.duree"; $sql.= " f.ref, f.rowid as fichid, f.fk_statut,";
$sql.= " fd.description, ".$db->pdate("fd.date")." as dp, fd.duree,";
$sql.= " s.nom,s.rowid as socid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f "; $sql.= ", ".MAIN_DB_PREFIX."fichinter as f)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
$sql.= " WHERE f.fk_soc = s.rowid "; $sql.= " WHERE f.fk_soc = s.rowid ";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
...@@ -73,7 +75,7 @@ if ($socid > 0) ...@@ -73,7 +75,7 @@ if ($socid > 0)
{ {
$sql .= " AND s.rowid = " . $socid; $sql .= " AND s.rowid = " . $socid;
} }
$sql.= " ORDER BY $sortfield $sortorder "; $sql.= " ORDER BY ".$sortfield." ".$sortorder;
$sql.= $db->plimit( $limit + 1 ,$offset); $sql.= $db->plimit( $limit + 1 ,$offset);
$result=$db->query($sql); $result=$db->query($sql);
...@@ -91,10 +93,10 @@ if ($result) ...@@ -91,10 +93,10 @@ if ($result)
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"),"index.php","f.ref","",$urlparam,'width="15%"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"),"index.php","f.ref","",$urlparam,'width="15%"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","",$urlparam,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","",$urlparam,'',$sortfield,$sortorder);
print '<td>'.$langs->trans("Description").'</td>'; print_liste_field_titre($langs->trans("Description"),"index.php","fd.description","",$urlparam,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),"index.php","f.datei","",$urlparam,'align="center"',$sortfield); print_liste_field_titre($langs->trans("Date"),"index.php","fd.date","",$urlparam,'align="center"',$sortfield,$sortorder);
print '<td align="right">'.$langs->trans("Duration").'</td>'; print_liste_field_titre($langs->trans("Duration"),"index.php","fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder);
print '<td align="right">'.$langs->trans("Status").'</td>'; print_liste_field_titre($langs->trans("Status"),"index.php","f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
$total = 0; $total = 0;
...@@ -106,7 +108,7 @@ if ($result) ...@@ -106,7 +108,7 @@ if ($result)
print "<td><a href=\"fiche.php?id=".$objp->fichid."\">".img_object($langs->trans("Show"),"task").' '.$objp->ref."</a></td>\n"; print "<td><a href=\"fiche.php?id=".$objp->fichid."\">".img_object($langs->trans("Show"),"task").' '.$objp->ref."</a></td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44)."</a></td>\n"; print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44)."</a></td>\n";
print '<td>'.nl2br($objp->description).'</td>'; print '<td>'.nl2br($objp->description).'</td>';
print '<td align="center">'.dolibarr_print_date($objp->dp)."</td>\n"; print '<td align="center">'.dolibarr_print_date($objp->dp,'dayhour')."</td>\n";
print '<td align="right">'.ConvertSecondToTime($objp->duree).'</td>'; print '<td align="right">'.ConvertSecondToTime($objp->duree).'</td>';
print '<td align="right">'.$fichinter_static->LibStatut($objp->fk_statut,5).'</td>'; print '<td align="right">'.$fichinter_static->LibStatut($objp->fk_statut,5).'</td>';
...@@ -114,7 +116,7 @@ if ($result) ...@@ -114,7 +116,7 @@ if ($result)
$total += $objp->duree; $total += $objp->duree;
$i++; $i++;
} }
print '<tr class="liste_total"><td colspan="3"></td><td>'.$langs->trans("Total").'</td>'; print '<tr class="liste_total"><td colspan="3"></td><td align="center">'.$langs->trans("Total").'</td>';
print '<td align="right" nowrap>'.ConvertSecondToTime($total).'</td><td></td>'; print '<td align="right" nowrap>'.ConvertSecondToTime($total).'</td><td></td>';
print '</tr>'; print '</tr>';
... ...
......
...@@ -16,6 +16,7 @@ ValidateIntervention=Validate intervention ...@@ -16,6 +16,7 @@ ValidateIntervention=Validate intervention
DeleteInterventionLine=Delete intervention line DeleteInterventionLine=Delete intervention line
ConfirmDeleteIntervention=Are you sure you want to delete this intervention ? ConfirmDeleteIntervention=Are you sure you want to delete this intervention ?
ConfirmValidateIntervention=Are you sure you want to validate this intervention ? ConfirmValidateIntervention=Are you sure you want to validate this intervention ?
ConfirmModifyIntervention=Are you sure you want to modify this intervention ?
ConfirmDeleteInterventionLine=Are you sure you want to delete this intervention line ? ConfirmDeleteInterventionLine=Are you sure you want to delete this intervention line ?
NameAndSignatureOfInternalContact=Name and signature of intervening : NameAndSignatureOfInternalContact=Name and signature of intervening :
NameAndSignatureOfExternalContact=Name and signature of customer : NameAndSignatureOfExternalContact=Name and signature of customer :
... ...
......
...@@ -16,6 +16,7 @@ ValidateIntervention=Valider intervention ...@@ -16,6 +16,7 @@ ValidateIntervention=Valider intervention
DeleteInterventionLine=Supprimer ligne d'intervention DeleteInterventionLine=Supprimer ligne d'intervention
ConfirmDeleteIntervention=Êtes-vous sûr de vouloir effacer cette intervention ? ConfirmDeleteIntervention=Êtes-vous sûr de vouloir effacer cette intervention ?
ConfirmValidateIntervention=Êtes-vous sûr de vouloir valider cette intervention ? ConfirmValidateIntervention=Êtes-vous sûr de vouloir valider cette intervention ?
ConfirmModifyIntervention=Êtes-vous sûr de vouloir modifier cette intervention ?
ConfirmDeleteInterventionLine=Êtes-vous sûr de vouloir effacer cette ligne ? ConfirmDeleteInterventionLine=Êtes-vous sûr de vouloir effacer cette ligne ?
NameAndSignatureOfInternalContact=Nom et signature de l'intervenant : NameAndSignatureOfInternalContact=Nom et signature de l'intervenant :
NameAndSignatureOfExternalContact=Nom et signature du client : NameAndSignatureOfExternalContact=Nom et signature du client :
... ...
......
...@@ -528,9 +528,9 @@ class DoliDb ...@@ -528,9 +528,9 @@ class DoliDb
/** /**
* \brief Formatage (par la base de donnes) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS) * \brief Formatage (par la base de donnees) d'un champ de la base au format TMS ou Date (YYYY-MM-DD HH:MM:SS)
* afin de retourner une donne toujours au format universel date TMS unix. * afin de retourner une donnee toujours au format universel date TMS unix.
* Fonction utiliser pour g�n�rer les SELECT. * Fonction a utiliser pour generer les SELECT.
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS' * \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
* \return date Date au format TMS. * \return date Date au format TMS.
* \TODO Remove unix_timestamp functions * \TODO Remove unix_timestamp functions
...@@ -542,8 +542,8 @@ class DoliDb ...@@ -542,8 +542,8 @@ class DoliDb
/** /**
* \brief Formatage (par PHP) d'une date vers format texte pour insertion dans champ date. * \brief Formatage (par PHP) d'une date vers format texte pour insertion dans champ date.
* Fonction utiliser pour g�n�rer les INSERT, UPDATE ou les clauses WHERE * Fonction a utiliser pour generer les INSERT, UPDATE ou les clauses WHERE
* \param param Date TMS convertir * \param param Date TMS to convert
* \return date Date au format texte YYYYMMDDHHMMSS. * \return date Date au format texte YYYYMMDDHHMMSS.
*/ */
function idate($param) function idate($param)
... ...
......
...@@ -646,11 +646,11 @@ function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1) ...@@ -646,11 +646,11 @@ function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1)
/** /**
\brief Returns formated date * \brief Returns formated date
\param fmt Format (Exemple: 'Y-m-d H:i:s') * \param fmt Format (Exemple: 'Y-m-d H:i:s')
\param timestamp Date. Exemple: Si timestamp=0 et gm=1, renvoi 01/01/1970 00:00:00 * \param timestamp Date. Exemple: Si timestamp=0 et gm=1, renvoi 01/01/1970 00:00:00
\param gm 1 if timestamp was built with gmmktime, 0 if timestamp was build with mktime * \param gm 1 if timestamp was built with gmmktime, 0 if timestamp was build with mktime
\return string Formated date * \return string Formated date
*/ */
function dolibarr_date($fmt, $timestamp, $gm=0) function dolibarr_date($fmt, $timestamp, $gm=0)
{ {
...@@ -672,8 +672,8 @@ function dolibarr_date($fmt, $timestamp, $gm=0) ...@@ -672,8 +672,8 @@ function dolibarr_date($fmt, $timestamp, $gm=0)
/** /**
\brief Affiche les informations d'un objet * \brief Affiche les informations d'un objet
\param object objet a afficher * \param object objet a afficher
*/ */
function dolibarr_print_object_info($object) function dolibarr_print_object_info($object)
{ {
... ...
......
...@@ -65,3 +65,5 @@ ALTER TABLE llx_paiementfourn_facturefourn ADD UNIQUE INDEX uk_paiementfourn_fac ...@@ -65,3 +65,5 @@ ALTER TABLE llx_paiementfourn_facturefourn ADD UNIQUE INDEX uk_paiementfourn_fac
update llx_expedition_methode set code='ENL', libelle='Enlevement' where code='enlevement'; update llx_expedition_methode set code='ENL', libelle='Enlevement' where code='enlevement';
update llx_expedition_methode set code='TRANS', libelle='Transporteur' where code='transporteur'; update llx_expedition_methode set code='TRANS', libelle='Transporteur' where code='transporteur';
alter table llx_fichinterdet modify date datetime;
...@@ -23,7 +23,7 @@ create table llx_fichinterdet ...@@ -23,7 +23,7 @@ create table llx_fichinterdet
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_fichinter integer, fk_fichinter integer,
date date, -- date de la ligne d'intervention date datetime, -- date de la ligne d'intervention
description text, -- description de la ligne d'intervention description text, -- description de la ligne d'intervention
duree integer, -- duree de la ligne d'intervention duree integer, -- duree de la ligne d'intervention
rang integer DEFAULT 0 -- ordre affichage sur la fiche rang integer DEFAULT 0 -- ordre affichage sur la fiche
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment