Merge pull request #27199 from cfoellmann/19/PR/respect-disabledraft

QUAL respect DISABLEDRAFT on project edit
This commit is contained in:
Laurent Destailleur
2023-12-22 10:56:39 +01:00
committed by GitHub

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2023 Charlene Benke <charlene@patas_monkey.com>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -977,7 +978,11 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
// Status
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td><td>';
print '<select class="flat" name="status" id="status">';
foreach ($object->labelStatusShort as $key => $val) {
$statuses = $object->labelStatusShort;
if (getDolGlobalString('MAIN_DISABLEDRAFTSTATUS') || getDolGlobalString('MAIN_DISABLEDRAFTSTATUS_PROJECT')) {
unset($statuses[$object::STATUS_DRAFT]);
}
foreach ($statuses as $key => $val) {
print '<option value="'.$key.'"'.((GETPOSTISSET('status') ? GETPOST('status') : $object->statut) == $key ? ' selected="selected"' : '').'>'.$langs->trans($val).'</option>';
}
print '</select>';