forked from Wavyzz/dolibarr
NEW clone skill object (#26526)
This commit is contained in:
committed by
GitHub
parent
c18588550b
commit
d549b06295
@@ -175,6 +175,16 @@ if (empty($reshook)) {
|
||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO';
|
||||
$trackid = 'skill' . $object->id;
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
|
||||
|
||||
if ($action == 'confirm_clone' && $confirm != 'yes') {
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
|
||||
$id = $result->id;
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -377,11 +387,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if ($action == 'deleteline') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
||||
}
|
||||
// Clone confirmation
|
||||
if ($action == 'clone') {
|
||||
// Create an array for form
|
||||
$formquestion = array();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
// Confirmation clone
|
||||
if ($action === 'clone') {
|
||||
$formquestion = array(
|
||||
array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label),
|
||||
);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->label), 'confirm_clone', $formquestion, 'yes', 1, 280);
|
||||
}
|
||||
|
||||
// Confirmation of action xxxx
|
||||
@@ -465,6 +476,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, '');
|
||||
}
|
||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user