Clean code
This commit is contained in:
parent
79177b0a11
commit
0aa90e82ea
@ -9307,11 +9307,12 @@ class Form
|
||||
*
|
||||
* @param string $save_label Alternative label for save button
|
||||
* @param string $cancel_label Alternative label for cancel button
|
||||
* @param array $morefields Add additional buttons between save and cancel
|
||||
* @param array $morebuttons Add additional buttons between save and cancel
|
||||
* @param bool $withoutdiv Option to remove enclosing centered div
|
||||
* @param string $morecss More CSS
|
||||
* @return string Html code with the buttons
|
||||
*/
|
||||
public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morefields = array(), $withoutdiv = 0)
|
||||
public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morebuttons = array(), $withoutdiv = 0, $morecss = '')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -9335,8 +9336,8 @@ class Form
|
||||
|
||||
!empty($save_label) ? $buttons[] = $save : '';
|
||||
|
||||
if (!empty($morefields)) {
|
||||
$buttons[] = $morefields;
|
||||
if (!empty($morebuttons)) {
|
||||
$buttons[] = $morebuttons;
|
||||
}
|
||||
|
||||
!empty($cancel_label) ? $buttons[] = $cancel : '';
|
||||
@ -9345,7 +9346,7 @@ class Form
|
||||
|
||||
foreach ($buttons as $button) {
|
||||
$addclass = empty($button['addclass']) ? '' : $button['addclass'];
|
||||
$retstring .= '<input type="submit" class="button button-'.$button['name'].' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
|
||||
$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
|
||||
}
|
||||
$retstring .= $withoutdiv ? '': '</div>';
|
||||
|
||||
|
||||
@ -2214,6 +2214,7 @@ if ($action == 'create') {
|
||||
$colspan++;
|
||||
}
|
||||
|
||||
print '<!-- line of expense report -->'."\n";
|
||||
print '<tr class="tredited">';
|
||||
|
||||
print '<td class="center">';
|
||||
@ -2333,8 +2334,10 @@ if ($action == 'create') {
|
||||
//print $line->fk_ecm_files;
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="rowid" value="'.$line->rowid.'">';
|
||||
print $form->buttonsSaveCancel();
|
||||
print $form->buttonsSaveCancel('Save', 'Cancel', array(), 0, 'small');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
@ -2344,9 +2347,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Add a new line
|
||||
if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED)
|
||||
&& $action != 'editline'
|
||||
&& $user->rights->expensereport->creer) {
|
||||
if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer) {
|
||||
$colspan = 11;
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
||||
$colspan++;
|
||||
|
||||
@ -2,7 +2,14 @@
|
||||
// Add line to upload new file
|
||||
print '<!-- expensereport_addfile.tpl.php -->'."\n";
|
||||
print '<tr class="truploadnewfilenow'.(empty($tredited) ? ' oddeven nohover' : ' '.$tredited).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' style="display: none"' : '').'>';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
|
||||
// Num line
|
||||
if ($action == 'editline') {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Upload section
|
||||
print '<td colspan="'.($action == 'editline' ? $colspan - 1 : $colspan).'">';
|
||||
|
||||
$modulepart = 'expensereport';
|
||||
$permission = $user->rights->expensereport->creer;
|
||||
|
||||
@ -13,7 +13,14 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) {
|
||||
|
||||
if ($nbFiles > 0) {
|
||||
print '<tr class="trattachnewfilenow'.(empty($tredited) ? ' oddeven nohover' : ' '.$tredited).'"'.(!GETPOSTISSET('sendit') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' style="display: none"' : '').'>';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
|
||||
// Num line
|
||||
if ($action == 'editline') {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Select image section
|
||||
print '<td colspan="'.($action == 'editline' ? $colspan - 1 : $colspan).'">';
|
||||
//print '<span class="opacitymedium">'.$langs->trans("AttachTheNewLineToTheDocument").'</span><br>';
|
||||
$modulepart = 'expensereport'; $maxheightmini = 48;
|
||||
$relativepath = (!empty($object->ref) ?dol_sanitizeFileName($object->ref) : '').'/';
|
||||
@ -112,8 +119,8 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) {
|
||||
if (!empty($filenamelinked) && $filenamelinked == $file['relativename']) {
|
||||
$checked = ' checked';
|
||||
}
|
||||
print '<div class="margintoponly minwidth150 maxwidth150"><input type="checkbox"'.$checked.' id="radio'.$filei.'" name="attachfile[]" class="checkboxattachfile" value="'.$file['relativename'].'">';
|
||||
print '<label class="wordbreak checkboxattachfilelabel" for="radio'.$filei.'"> '.$file['relativename'].'</label>';
|
||||
print '<div class="margintoponly minwidth150 maxwidth150 divoverflow"><input type="checkbox"'.$checked.' id="radio'.$filei.'" name="attachfile[]" class="checkboxattachfile valignmiddle" value="'.$file['relativename'].'">';
|
||||
print '<label class="wordbreak checkboxattachfilelabel paddingrightonly valignmiddle" for="radio'.$filei.'" title="'.dol_escape_htmltag($file['relativename']).'">'.$file['relativename'].'</label>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -274,6 +274,7 @@ NewInter=Nouvelle intervention
|
||||
OneLinePerTask=Une ligne par tâche
|
||||
OneLinePerPeriod=Une ligne par période
|
||||
OneLinePerTimeSpentLine=Une ligne pour chaque déclaration de temps passé
|
||||
AddDetailDateAndDuration=Avec date et durée dans la description de la ligne
|
||||
RefTaskParent=Réf. Tâche parent
|
||||
ProfitIsCalculatedWith=Le bénéfice est calculé sur la base de
|
||||
AddPersonToTask=Ajouter également aux tâches
|
||||
@ -281,3 +282,4 @@ UsageOrganizeEvent=Utilisation: Organisation d'événements
|
||||
PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classer le projet comme étant clos lorsque toutes ses tâches sont terminées (progression 100%%)
|
||||
PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Remarque : les projets existants avec toutes les tâches terminées à 100 %% ne seront pas affectés : vous devrez les fermer manuellement. Cette option n’affecte que les projets ouverts.
|
||||
SelectLinesOfTimeSpentToInvoice=Sélectionnez les lignes de temps consacré non facturées, puis l'action groupée "Générer la facture" pour les facturer
|
||||
ProjectTasksWithoutTimeSpent=Project tasks without time spent
|
||||
|
||||
@ -33,7 +33,7 @@ PropalStatusSigned=Signée (à facturer)
|
||||
PropalStatusNotSigned=Non signée (fermée)
|
||||
PropalStatusBilled=Facturée
|
||||
PropalStatusDraftShort=Brouillon
|
||||
PropalStatusValidatedShort=Validé (ouvert)
|
||||
PropalStatusValidatedShort=Ouvert
|
||||
PropalStatusClosedShort=Fermée
|
||||
PropalStatusSignedShort=Signée
|
||||
PropalStatusNotSignedShort=Non signée
|
||||
|
||||
@ -886,6 +886,13 @@ span.fa.fa-plus-circle.paddingleft {
|
||||
font-size: 1.5em; vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
.divoverflow {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
|
||||
/* Themes for badges */
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user