Fix table shown when there is no perm
Fix edit admin status of another admin
This commit is contained in:
parent
41cb13b1cc
commit
c6ccb92a51
@ -2421,10 +2421,15 @@ $formquestion = array_merge($formquestion, array(
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
if (! empty($object->lines) || ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines' && $action != 'editline'))
|
||||
{
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
}
|
||||
|
||||
if (! empty($object->lines))
|
||||
{
|
||||
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines')
|
||||
@ -2439,16 +2444,21 @@ $formquestion = array_merge($formquestion, array(
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
if (! empty($object->lines) || ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines' && $action != 'editline'))
|
||||
{
|
||||
print '</table>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Boutons Actions
|
||||
* Button Actions
|
||||
*/
|
||||
|
||||
if ($action != 'presend') {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
|
||||
@ -361,6 +361,60 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Lines
|
||||
*/
|
||||
|
||||
if (! empty($object->table_element_line))
|
||||
{
|
||||
// Show object lines
|
||||
$result = $object->getLinesArray();
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id . '">
|
||||
';
|
||||
|
||||
if (! empty($conf->use_javascript_ajax) && $object->status == 0) {
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')
|
||||
{
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||
}
|
||||
|
||||
if (! empty($object->lines))
|
||||
{
|
||||
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines')
|
||||
{
|
||||
if ($action != 'editline')
|
||||
{
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')
|
||||
{
|
||||
print '</table>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
|
||||
// Buttons for actions
|
||||
if ($action != 'presend' && $action != 'editline') {
|
||||
print '<div class="tabsAction">'."\n";
|
||||
|
||||
@ -2123,7 +2123,7 @@ else
|
||||
&& ($user->id != $object->id) // Don't downgrade ourself
|
||||
&& (
|
||||
(empty($conf->multicompany->enabled) && $nbAdmin >= 1)
|
||||
|| (! empty($conf->multicompany->enabled) && ($object->entity > 0 || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone
|
||||
|| (! empty($conf->multicompany->enabled) && (($object->entity > 0 || ($user->entity == 0 && $object->entity == 0)) || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone
|
||||
)
|
||||
)
|
||||
{
|
||||
@ -2543,7 +2543,7 @@ else
|
||||
if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
print "<tr>".'<td>'.$langs->trans("Entity").'</td>';
|
||||
print "<td>".$mc->select_entities($object->entity, 'entity', '', 0, 1); // last parameter 1 means, show also a choice 0=>'all entities'
|
||||
print "<td>".$mc->select_entities($object->entity, 'entity', '', 0, 1, false, false, 1); // last parameter 1 means, show also a choice 0=>'all entities'
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user