Qual: Remove method SetBilled that is a duplicate of setStatus.
Fix: Better management of option SendInterventionRef.
This commit is contained in:
parent
2eb01cfbf9
commit
25cc27c857
@ -463,31 +463,6 @@ class Fichinter extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set intervetnion as billed
|
|
||||||
*
|
|
||||||
* @return int <0 si ko, >0 si ok
|
|
||||||
*/
|
|
||||||
function setBilled()
|
|
||||||
{
|
|
||||||
global $conf;
|
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'fichinter SET fk_statut = 2';
|
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
|
||||||
$sql.= " AND entity = ".$conf->entity;
|
|
||||||
$sql.= " AND fk_statut = 1";
|
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($this->db);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the label status
|
* Returns the label status
|
||||||
|
|||||||
@ -471,7 +471,22 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
|
|||||||
// Classify Billed
|
// Classify Billed
|
||||||
else if ($action == 'classifybilled' && $user->rights->ficheinter->creer)
|
else if ($action == 'classifybilled' && $user->rights->ficheinter->creer)
|
||||||
{
|
{
|
||||||
$result=$object->setBilled();
|
$result=$object->setStatut(2);
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$object->error.'</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Classify Billed
|
||||||
|
else if ($action == 'classifyunbilled' && $user->rights->ficheinter->creer)
|
||||||
|
{
|
||||||
|
$result=$object->setStatut(1);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
@ -485,7 +500,7 @@ else if ($action == 'classifybilled' && $user->rights->ficheinter->creer)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Mise a jour d'une ligne d'intervention
|
* Mise a jour d'une ligne d'intervention
|
||||||
*/
|
*/
|
||||||
else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save"))
|
else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save"))
|
||||||
{
|
{
|
||||||
$objectline = new FichinterLigne($db);
|
$objectline = new FichinterLigne($db);
|
||||||
@ -1289,12 +1304,12 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
print $extrafields->showInputField($key,$value);
|
print $extrafields->showInputField($key,$value);
|
||||||
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
print ' <input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $extrafields->showOutputField($key,$value);
|
print $extrafields->showOutputField($key,$value);
|
||||||
if ($object->statut == 0 && $user->rights->ficheinter->creer) print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras&attribute='.$key.'">'.img_picto('','edit').' '.$langs->trans('Modify').'</a>';
|
if ($object->statut == 0 && $user->rights->ficheinter->creer) print ' <a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras&attribute='.$key.'">'.img_picto('','edit').' '.$langs->trans('Modify').'</a>';
|
||||||
}
|
}
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
}
|
}
|
||||||
@ -1319,7 +1334,8 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
|
||||||
|
{
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="addinter" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="addinter" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
@ -1507,8 +1523,10 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
|
|
||||||
@ -1529,7 +1547,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Modify
|
// Modify
|
||||||
if ($object->statut == 1 && $user->rights->ficheinter->creer)
|
if ($object->statut == 1 && $user->rights->ficheinter->creer && empty($conf->global->FICHINTER_DISABLE_DETAILS))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?id='.$object->id.'&action=modify"';
|
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?id='.$object->id.'&action=modify"';
|
||||||
print '>'.$langs->trans("Modify").'</a></div>';
|
print '>'.$langs->trans("Modify").'</a></div>';
|
||||||
@ -1572,6 +1590,10 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'</a></div>';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifyunbilled">'.$langs->trans("ClassifyUnBilled").'</a></div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
@ -108,8 +108,11 @@ if ($result)
|
|||||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$urlparam,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$urlparam,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$urlparam,'',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$urlparam,'',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],'');
|
print_liste_field_titre('',$_SERVER["PHP_SELF"],'');
|
||||||
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
|
||||||
|
{
|
||||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fd.date","",$urlparam,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fd.date","",$urlparam,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder);
|
||||||
|
}
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -122,8 +125,11 @@ if ($result)
|
|||||||
print '<input type="text" class="flat" name="search_desc" value="'.$search_desc.'" size="12">';
|
print '<input type="text" class="flat" name="search_desc" value="'.$search_desc.'" size="12">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
|
||||||
|
{
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
|
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -150,8 +156,11 @@ if ($result)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->description,20)).'</td>';
|
print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->description,20)).'</td>';
|
||||||
print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).'</td>';
|
print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).'</td>';
|
||||||
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
|
||||||
|
{
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dp),'dayhour')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($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">'.$interventionstatic->LibStatut($objp->fk_statut,5).'</td>';
|
print '<td align="right">'.$interventionstatic->LibStatut($objp->fk_statut,5).'</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -159,9 +168,13 @@ if ($result)
|
|||||||
$total += $objp->duree;
|
$total += $objp->duree;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
$rowspan=3;
|
||||||
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
|
||||||
|
{
|
||||||
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>';
|
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>';
|
||||||
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td><td> </td>';
|
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td><td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|||||||
@ -25,6 +25,7 @@ NameAndSignatureOfExternalContact=Name and signature of customer :
|
|||||||
DocumentModelStandard=Standard document model for interventions
|
DocumentModelStandard=Standard document model for interventions
|
||||||
InterventionCardsAndInterventionLines=Interventions and lines of interventions
|
InterventionCardsAndInterventionLines=Interventions and lines of interventions
|
||||||
ClassifyBilled=Classify "Billed"
|
ClassifyBilled=Classify "Billed"
|
||||||
|
ClassifyUnBilled=Classify "Unbilled"
|
||||||
StatusInterInvoiced=Billed
|
StatusInterInvoiced=Billed
|
||||||
RelatedInterventions=Related interventions
|
RelatedInterventions=Related interventions
|
||||||
ShowIntervention=Show intervention
|
ShowIntervention=Show intervention
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user