Can't delete a project
This commit is contained in:
parent
ee986b1a2b
commit
b98999c9d9
@ -201,12 +201,12 @@ if (empty($reshook))
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0)
|
||||
if ($ret < 0)
|
||||
{
|
||||
$error++;
|
||||
$action = 'create';
|
||||
}
|
||||
|
||||
|
||||
if (! GETPOST("lastname"))
|
||||
{
|
||||
$error++; $errors[]=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label"));
|
||||
@ -1105,18 +1105,14 @@ else
|
||||
{
|
||||
if ($user->rights->societe->contact->creer)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
if (! $object->user_id && $user->rights->user->user->creer)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
}
|
||||
|
||||
if ($user->rights->societe->contact->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete'.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
// Activer
|
||||
if ($object->statut == 0 && $user->rights->societe->contact->creer)
|
||||
{
|
||||
@ -1126,6 +1122,12 @@ else
|
||||
if ($object->statut == 1 && $user->rights->societe->contact->creer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a>';
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->rights->societe->contact->supprimer)
|
||||
{
|
||||
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete'.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user