Debug v19
This commit is contained in:
parent
1d589fd74e
commit
552e745908
5 changed files with 25 additions and 13 deletions
|
|
@ -11441,7 +11441,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||
/**
|
||||
* Function dolGetButtonAction
|
||||
*
|
||||
* @param string $label Label or tooltip of button if $tet is provided. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text.
|
||||
* @param string $label Label or tooltip of button if $text is provided. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text.
|
||||
* @param string $text Optional : short label on button. Can be escaped HTML content or full simple text.
|
||||
* @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ...
|
||||
* @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> )
|
||||
|
|
@ -11450,7 +11450,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||
* 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
* 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
* );
|
||||
* @param string $id Attribute id of button
|
||||
* @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method.
|
||||
* @param int|boolean $userRight User action right
|
||||
* // phpcs:disable
|
||||
* @param array $params = [ // Various params for future : recommended rather than adding more function arguments
|
||||
|
|
|
|||
|
|
@ -345,9 +345,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
$formconfirm = '';
|
||||
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||
// Confirmation to delete (using preloaded confirm popup)
|
||||
if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 'action-delete');
|
||||
}
|
||||
// Confirmation to delete line
|
||||
if ($action == 'deleteline') {
|
||||
|
|
@ -571,9 +571,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
}
|
||||
*/
|
||||
|
||||
// Delete
|
||||
// Delete (with preloaded confirm popup)
|
||||
$deleteUrl = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken();
|
||||
$buttonId = 'action-delete-no-ajax';
|
||||
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can use preloaded confirm if not jmobile
|
||||
$deleteUrl = '';
|
||||
$buttonId = 'action-delete';
|
||||
}
|
||||
$params = array();
|
||||
print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete, $params);
|
||||
print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $deleteUrl, $buttonId, $permissiontodelete, $params);
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1612,7 +1612,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
|
||||
$params = array('backtopage' => $_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
|
||||
print dolGetButtonAction($langs->trans("Create"), '', 'default', $arrayforbutaction, '', 1, $params);
|
||||
print dolGetButtonAction('', $langs->trans("Create"), 'default', $arrayforbutaction, '', 1, $params);
|
||||
}
|
||||
|
||||
// Clone
|
||||
|
|
|
|||
|
|
@ -266,8 +266,8 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) {
|
|||
$formconfirm = '';
|
||||
|
||||
// Confirm deleting resource line
|
||||
if ($action == 'delete') {
|
||||
$formconfirm = $form->formconfirm("card.php?&id=".$object->id, $langs->trans("DeleteResource"), $langs->trans("ConfirmDeleteResource"), "confirm_delete_resource", '', '', 1);
|
||||
if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("DeleteResource"), $langs->trans("ConfirmDeleteResource"), "confirm_delete_resource", '', 0, "action-delete");
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
|
|
@ -347,8 +347,14 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) {
|
|||
print '</div>';
|
||||
}
|
||||
}
|
||||
if ($action != "delete" && $action != "create" && $action != "edit") {
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
if ($action != "create" && $action != "edit") {
|
||||
$deleteUrl = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken();
|
||||
$buttonId = 'action-delete-no-ajax';
|
||||
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile
|
||||
$deleteUrl = '';
|
||||
$buttonId = 'action-delete';
|
||||
}
|
||||
print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $deleteUrl, $buttonId, $permissiontodelete);
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -3142,7 +3142,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
|||
$deleteUrl = '';
|
||||
$buttonId = 'action-delete';
|
||||
}
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteUrl, $buttonId, $permissiontodelete);
|
||||
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $deleteUrl, $buttonId, $permissiontodelete);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue