New: Adds an hide duration button in intervention module

Adds a way to set the visibility of the intervention time field from the administration interface of the "intervention" module
This commit is contained in:
Neil Orley 2017-09-07 11:58:22 +02:00
parent 451adb077f
commit b5c30ea679
3 changed files with 34 additions and 0 deletions

View File

@ -221,9 +221,24 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
$conf->entity);
if (!$res > 0) {
$error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
/*
* View
*/
@ -576,6 +591,23 @@ print '<input type="submit" class="button" value="' . $langs->trans("Modify") .
print '</td>';
print '</tr>';
print '</form>';
// Use duration
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
print '<tr class="oddeven">';
print '<td>';
print $langs->trans("UseDurationOnFichinter");
print '</td>';
print '<td align="center">';
print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"' . ($conf->global->FICHINTER_WITHOUT_DURATION?' checked':'') . '>';
print '</td>';
print '<td align="right">';
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
print '</td>';
print '</tr>';
print '</form>';
print '</table>';

View File

@ -48,6 +48,7 @@ TypeContact_fichinter_external_CUSTOMER=Following-up customer contact
PrintProductsOnFichinter=Print also lines of type "product" (not only services) on intervention card
PrintProductsOnFichinterDetails=interventions generated from orders
UseServicesDurationOnFichinter=Use services duration for interventions generated from orders
UseDurationOnFichinter=Hides the duration field for intervention records
InterventionStatistics=Statistics of interventions
NbOfinterventions=Nb of intervention cards
NumberOfInterventionsByMonth=Nb of intervention cards by month (date of validation)

View File

@ -48,6 +48,7 @@ TypeContact_fichinter_external_CUSTOMER=Contact client suivi de l'intervention
PrintProductsOnFichinter=Imprimer aussi les lignes de type "produit" (pas seulement de type service) sur les fiches d'intervention
PrintProductsOnFichinterDetails=interventions générées à partir des commandes
UseServicesDurationOnFichinter=Utiliser la durée des services dans les interventions créées depuis des commandes
UseDurationOnFichinter=Masquer le champ durée dans les fiches d'intervention
InterventionStatistics=Statistiques des interventions
NbOfinterventions=Nb de fiches d'intervention
NumberOfInterventionsByMonth=Nb de fiches d'intervention par mois (date de validation)