Browse Source

remove unused code

Frédéric France 3 years ago
parent
commit
b7e539a90a
1 changed files with 28 additions and 73 deletions
  1. 28 73
      htdocs/holiday/document.php

+ 28 - 73
htdocs/holiday/document.php

@@ -6,7 +6,7 @@
  * Copyright (C) 2005       Simon TOSSER            <simon@kornog-computing.com>
  * Copyright (C) 2011-2012  Juanjo Menent           <jmenent@2byte.es>
  * Copyright (C) 2013       Cédric Salvador         <csalvador@gpcsolutions.fr>
- * Copyright (C) 2018       Frédéric France         <frederic.france@netlogic.fr>
+ * Copyright (C) 2018-2022  Frédéric France         <frederic.france@netlogic.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -124,8 +124,6 @@ $title = $langs->trans("Leave").' - '.$langs->trans("Files");
 
 llxHeader('', $title);
 
-$edit = false;
-
 if ($object->id) {
 	$valideur = new User($db);
 	$valideur->fetch($object->fk_validator);
@@ -176,51 +174,25 @@ if ($object->id) {
 	$starthalfday = ($object->halfday == -1 || $object->halfday == 2) ? 'afternoon' : 'morning';
 	$endhalfday = ($object->halfday == 1 || $object->halfday == 2) ? 'morning' : 'afternoon';
 
-	if (!$edit) {
-		print '<tr>';
-		print '<td>';
-		print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
-		print '</td>';
-		print '<td>'.dol_print_date($object->date_debut, 'day');
-		print ' &nbsp; &nbsp; ';
-		print '<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).'</span>';
-		print '</td>';
-		print '</tr>';
-	} else {
-		print '<tr>';
-		print '<td>';
-		print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
-		print '</td>';
-		print '<td>';
-		print $form->selectDate($object->date_debut, 'date_debut_');
-		print ' &nbsp; &nbsp; ';
-		print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ?GETPOST('starthalfday') : $starthalfday));
-		print '</td>';
-		print '</tr>';
-	}
+	print '<tr>';
+	print '<td>';
+	print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
+	print '</td>';
+	print '<td>'.dol_print_date($object->date_debut, 'day');
+	print ' &nbsp; &nbsp; ';
+	print '<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).'</span>';
+	print '</td>';
+	print '</tr>';
 
-	if (!$edit) {
-		print '<tr>';
-		print '<td>';
-		print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday"));
-		print '</td>';
-		print '<td>'.dol_print_date($object->date_fin, 'day');
-		print ' &nbsp; &nbsp; ';
-		print '<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).'</span>';
-		print '</td>';
-		print '</tr>';
-	} else {
-		print '<tr>';
-		print '<td>';
-		print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday"));
-		print '</td>';
-		print '<td>';
-		print $form->selectDate($object->date_fin, 'date_fin_');
-		print ' &nbsp; &nbsp; ';
-		print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday') ?GETPOST('endhalfday') : $endhalfday));
-		print '</td>';
-		print '</tr>';
-	}
+	print '<tr>';
+	print '<td>';
+	print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday"));
+	print '</td>';
+	print '<td>'.dol_print_date($object->date_fin, 'day');
+	print ' &nbsp; &nbsp; ';
+	print '<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).'</span>';
+	print '</td>';
+	print '</tr>';
 
 	// Nb days consumed
 	print '<tr>';
@@ -247,17 +219,10 @@ if ($object->id) {
 	}
 
 	// Description
-	if (!$edit) {
-		print '<tr>';
-		print '<td>'.$langs->trans('DescCP').'</td>';
-		print '<td>'.nl2br($object->description).'</td>';
-		print '</tr>';
-	} else {
-		print '<tr>';
-		print '<td>'.$langs->trans('DescCP').'</td>';
-		print '<td><textarea name="description" class="flat" rows="'.ROWS_3.'" cols="70">'.$object->description.'</textarea></td>';
-		print '</tr>';
-	}
+	print '<tr>';
+	print '<td>'.$langs->trans('DescCP').'</td>';
+	print '<td>'.nl2br($object->description).'</td>';
+	print '</tr>';
 
 	print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
 	print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.dol_print_size($totalsize, 1, 1).'</td></tr>';
@@ -274,8 +239,7 @@ if ($object->id) {
 	print '<table class="border tableforfield centpercent">'."\n";
 	print '<tbody>';
 
-	if (! empty($object->fk_user_create))
-	{
+	if (! empty($object->fk_user_create)) {
 		$userCreate=new User($db);
 		$userCreate->fetch($object->fk_user_create);
 		print '<tr>';
@@ -284,19 +248,10 @@ if ($object->id) {
 		print '</tr>';
 	}
 
-	if (!$edit) {
-		print '<tr>';
-		print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
-		print '<td>'.$valideur->getNomUrl(-1).'</td>';
-		print '</tr>';
-	} else {
-		print '<tr>';
-		print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
-		print '<td>';
-		print $form->select_dolusers($object->fk_user, "valideur", 1, ($user->admin ? '' : array($user->id)));	// By default, hierarchical parent
-		print '</td>';
-		print '</tr>';
-	}
+	print '<tr>';
+	print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
+	print '<td>'.$valideur->getNomUrl(-1).'</td>';
+	print '</tr>';
 
 	print '<tr>';
 	print '<td>'.$langs->trans('DateCreation').'</td>';