Skip to content

Commit

Permalink
[ bug #1231 ] PDF always generated in interventions
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 8, 2014
1 parent aad7885 commit 5b89bc1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
6 changes: 5 additions & 1 deletion ChangeLog
Expand Up @@ -15,7 +15,11 @@ Fix: Link to paypal was invalid into email text.
Fix: ref and date of supplier invoice.
Fix: Check on bank account.
Fix: Problem with file upload and download.

Fix: Page load not ending when large number of thirdparies. We
added option MAIN_DISABLE_AJAX_COMBOX to disable javascript
combo feature that is root cause of problem.
Fix: [ bug #1231 ] PDF always generated in interventions

***** ChangeLog for 3.5 compared to 3.4.* *****
For users:
- New: Add hidden option BANK_DISABLE_DIRECT_INPUT.
Expand Down
36 changes: 20 additions & 16 deletions htdocs/fichinter/fiche.php
Expand Up @@ -109,7 +109,8 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$result=fichinter_create($db, $object, GETPOST('model','alpha'), $outputlangs);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, GETPOST('model','alpha'), $outputlangs);

header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
Expand All @@ -134,7 +135,8 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->model:GETPOST('model','apha'), $outputlangs);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->model:GETPOST('model','apha'), $outputlangs);

header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
Expand Down Expand Up @@ -459,7 +461,7 @@
{
$db->commit();

fichinter_create($db, $object, $object->modelpdf, $outputlangs);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
Expand Down Expand Up @@ -529,7 +531,7 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);

header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
Expand Down Expand Up @@ -564,7 +566,7 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
}

/*
Expand All @@ -585,7 +587,8 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);

header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
exit;
}
Expand All @@ -604,7 +607,8 @@
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);

header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
exit;
}
Expand Down Expand Up @@ -781,7 +785,7 @@
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
if ($ret < 0) $error++;

if (! $error)
{
// Actions on extra fields (by external module or standard code)
Expand All @@ -799,7 +803,7 @@
}
else if ($reshook < 0) $error++;
}

if ($error) $action = 'edit_extras';
}

Expand Down Expand Up @@ -973,7 +977,7 @@
if (! empty($conf->projet->enabled))
{
$formproject=new FormProjets($db);

$langs->load("project");

print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';
Expand Down Expand Up @@ -1103,7 +1107,7 @@
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1);

}

// Confirmation validation
Expand All @@ -1127,21 +1131,21 @@
$text=$langs->trans('ConfirmValidateIntervention',$numref);

print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1);

}

// Confirmation de la validation de la fiche d'intervention
if ($action == 'modify')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1);

}

// Confirmation de la suppression d'une ligne d'intervention
if ($action == 'ask_deleteline')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.GETPOST('line_id','int'), $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);

}

print '<table class="border" width="100%">';
Expand Down Expand Up @@ -1286,9 +1290,9 @@
print '<input type="hidden" name="attribute" value="'.$key.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';

print $extrafields->showInputField($key,$value);

print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
}
Expand Down

0 comments on commit 5b89bc1

Please sign in to comment.