Error management
This commit is contained in:
parent
eaff7f6358
commit
c0a5c3f428
@ -1605,10 +1605,11 @@ else
|
|||||||
$formadmin = new FormAdmin($db);
|
$formadmin = new FormAdmin($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
|
|
||||||
if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || GETPOST("action") == 'create')
|
if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || GETPOST("action") == 'create')
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Sheet mode creation
|
* Mode creation
|
||||||
*/
|
*/
|
||||||
if ($user->rights->societe->creer)
|
if ($user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
@ -1635,7 +1636,7 @@ else
|
|||||||
elseif (GETPOST("action") == 'edit')
|
elseif (GETPOST("action") == 'edit')
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Company Fact Mode edition
|
* Mode edition
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set action type
|
// Set action type
|
||||||
@ -1666,11 +1667,16 @@ else
|
|||||||
// Display canvas
|
// Display canvas
|
||||||
$soccanvas->display_canvas();
|
$soccanvas->display_canvas();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
print $langs->trans("ErrorRecordNotFound");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Company Fact Sheet mode visu
|
* Mode view
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set action type
|
// Set action type
|
||||||
@ -1678,78 +1684,80 @@ else
|
|||||||
|
|
||||||
// Fetch object
|
// Fetch object
|
||||||
$result=$soccanvas->fetch($socid);
|
$result=$soccanvas->fetch($socid);
|
||||||
if ($result < 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$soccanvas->control->object->error);
|
// Card header
|
||||||
exit;
|
$head = societe_prepare_head($soccanvas->control->object);
|
||||||
}
|
$title = $soccanvas->getTitle();
|
||||||
|
dol_fiche_head($head, 'company', $title, 0, 'company');
|
||||||
|
|
||||||
// Card header
|
// Assign values
|
||||||
$head = societe_prepare_head($soccanvas->control->object);
|
$soccanvas->assign_values();
|
||||||
$title = $soccanvas->getTitle();
|
|
||||||
dol_fiche_head($head, 'company', $title, 0, 'company');
|
|
||||||
|
|
||||||
// Assign values
|
// Display canvas
|
||||||
$soccanvas->assign_values();
|
$soccanvas->display_canvas();
|
||||||
|
|
||||||
// Display canvas
|
/*
|
||||||
$soccanvas->display_canvas();
|
* Actions
|
||||||
|
*/
|
||||||
/*
|
if ($_GET["action"] == '')
|
||||||
* Actions
|
|
||||||
*/
|
|
||||||
if ($_GET["action"] == '')
|
|
||||||
{
|
|
||||||
print '<div class="tabsAction">';
|
|
||||||
|
|
||||||
if ($user->rights->societe->creer)
|
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$socid.'&action=edit&canvas='.$canvas.'">'.$langs->trans("Modify").'</a>';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
if ($user->rights->societe->creer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$socid.'&action=edit&canvas='.$canvas.'">'.$langs->trans("Modify").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->rights->societe->contact->creer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid.'&action=create&canvas='.$canvas.'">'.$langs->trans("AddContact").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->rights->societe->supprimer)
|
||||||
|
{
|
||||||
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?socid='.$socid.'&action=delete&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->societe->contact->creer)
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$socid.'&action=create&canvas='.$canvas.'">'.$langs->trans("AddContact").'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($user->rights->societe->supprimer)
|
print '<table width="100%"><tr><td valign="top" width="50%">';
|
||||||
{
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?socid='.$socid.'&action=delete&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
/*
|
||||||
|
* Documents generes
|
||||||
|
*/
|
||||||
|
$filedir=$conf->societe->dir_output.'/'.$socid;
|
||||||
|
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$socid;
|
||||||
|
$genallowed=$user->rights->societe->creer;
|
||||||
|
$delallowed=$user->rights->societe->supprimer;
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
|
||||||
|
$somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$soccanvas->control->object->default_lang);
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
// Contacts list
|
||||||
|
$result=show_contacts($conf,$langs,$db,$soccanvas->control->object);
|
||||||
|
|
||||||
|
// Projects list
|
||||||
|
$result=show_projects($conf,$langs,$db,$soccanvas->control->object);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
print $langs->trans("ErrorRecordNotFound");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<table width="100%"><tr><td valign="top" width="50%">';
|
|
||||||
print '<a name="builddoc"></a>'; // ancre
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Documents generes
|
|
||||||
*/
|
|
||||||
$filedir=$conf->societe->dir_output.'/'.$socid;
|
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$socid;
|
|
||||||
$genallowed=$user->rights->societe->creer;
|
|
||||||
$delallowed=$user->rights->societe->supprimer;
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$soccanvas->control->object->default_lang);
|
|
||||||
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
// Contacts list
|
|
||||||
$result=show_contacts($conf,$langs,$db,$soccanvas->control->object);
|
|
||||||
|
|
||||||
// Projects list
|
|
||||||
$result=show_projects($conf,$langs,$db,$soccanvas->control->object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user