Can't delete a project

This commit is contained in:
Laurent Destailleur 2015-06-05 15:39:23 +02:00
parent ee986b1a2b
commit 3fac108af2
3 changed files with 9 additions and 8 deletions

View File

@ -80,8 +80,9 @@ llxHeader("",$langs->trans("Contact"), $helpurl);
if ($object->id)
{
$head = contact_prepare_head($object);
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
dol_fiche_head($head, 'documents', $langs->trans("Contact"), 0, 'contact');
dol_fiche_head($head, 'documents', $title, 0, 'contact');
// Construit liste des fichiers

View File

@ -311,7 +311,7 @@ if (empty($reshook))
$result = $object->setValid($user);
if ($result <= 0)
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -320,7 +320,7 @@ if (empty($reshook))
$result = $object->setClose($user);
if ($result <= 0)
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -329,7 +329,7 @@ if (empty($reshook))
$result = $object->setValid($user);
if ($result <= 0)
{
setEventMessage($object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@ -339,14 +339,14 @@ if (empty($reshook))
$result=$object->delete($user);
if ($result > 0)
{
header("Location: index.php");
setEventMessage($langs->trans("RecordDeleted"), 'info');
header("Location: index.php");
exit;
}
else
{
dol_syslog($object->error,LOG_DEBUG);
setEventMessage($object->error,'errors');
setEventMessage($object->errors,'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}

View File

@ -515,7 +515,7 @@ class Project extends CommonObject
// Set fk_projet into elements to null
$listoftables=array(
'facture'=>'fk_projet','propal'=>'fk_projet','commande'=>'fk_projet','facture_fourn'=>'fk_projet','commande_fournisseur'=>'fk_projet',
'expensereport_det'=>'fk_projet','contrat'=>'fk_projet','fichinter'=>'fk_projet','don'=>'fk_project'
'expensereport_det'=>'fk_projet','contrat'=>'fk_projet','fichinter'=>'fk_projet','don'=>'fk_projet'
);
foreach($listoftables as $key => $value)
{