Merge remote-tracking branch 'upstream/develop' into loaddolibarrenv

This commit is contained in:
Frédéric France 2022-09-07 20:37:29 +02:00
commit 07e761d115
15 changed files with 279 additions and 194 deletions

View File

@ -296,15 +296,17 @@ if ($action == 'create') {
// User
print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td>';
print '<td><select class="flat" name="user">';
print '<td><select class="flat" name="user" id="menuuser">';
print '<option value="2" selected>'.$langs->trans("AllMenus").'</option>';
print '<option value="0">'.$langs->trans('Internal').'</option>';
print '<option value="1">'.$langs->trans('External').'</option>';
print '</select></td>';
print '</select>';
print ajax_combobox('menuuser');
print '</td>';
print '<td>'.$langs->trans('DetailUser').'</td></tr>';
// Type
print '<tr><td class="fieldrequired">'.$langs->trans('Type').'</td><td>';
print '<tr><td class="fieldrequired">'.$langs->trans('Position').'</td><td>';
if ($parent_rowid) {
print $langs->trans('Left');
print '<input type="hidden" name="type" value="left">';
@ -314,6 +316,7 @@ if ($action == 'create') {
print '<option value="top"'.(GETPOST("type") == 'top' ? ' selected' : '').'>'.$langs->trans('Top').'</option>';
print '<option value="left"'.(GETPOST("type") == 'left' ? ' selected' : '').'>'.$langs->trans('Left').'</option>';
print '</select>';
print ajax_combobox('topleft');
}
print '</td><td>'.$langs->trans('DetailType').'</td></tr>';
@ -351,12 +354,6 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans('Position').'</td>';
print '<td><input type="text" class="width100" name="position" value="'.dol_escape_htmltag(GETPOSTISSET("position") ? GETPOST("position", 'int') : 100).'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
// Target
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
print '<option value=""'.(isset($menu->target) && $menu->target == "" ? ' selected' : '').'>&nbsp;</option>';
print '<option value="_blank"'.(isset($menu->target) && $menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
print '</select></td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
// Enabled
print '<tr><td>'.$langs->trans('Enabled').'</td>';
print '<td><input type="text" class="minwidth500" name="enabled" value="'.(GETPOSTISSET('enabled') ? GETPOST("enabled", 'alphanohtml') : '1').'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
@ -365,6 +362,14 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans('Rights').'</td>';
print '<td><input type="text" class="minwidth500" name="perms" value="'.(GETPOSTISSET('perms') ? GETPOST('perms', 'alphanohtml') : '1').'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
// Target
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target" id="target">';
print '<option value=""'.(isset($menu->target) && $menu->target == "" ? ' selected' : '').'>&nbsp;</option>';
print '<option value="_blank"'.(isset($menu->target) && $menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
print '</select>';
print ajax_combobox("target");
print '</td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
print '</table>';
print dol_get_fiche_end();
@ -393,7 +398,7 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans('Id').'</td><td>'.$menu->id.'</td><td>'.$langs->trans('DetailId').'</td></tr>';
// Module
print '<tr><td>'.$langs->trans('MenuModule').'</td><td>'.$menu->module.'</td><td>'.$langs->trans('DetailMenuModule').'</td></tr>';
print '<tr><td>'.$langs->trans('MenuModule').'</td><td>'.(empty($menu->module) ? 'Core' : $menu->module).'</td><td><span class="opacitymedium">'.$langs->trans('DetailMenuModule').'</span></td></tr>';
// Handler
if ($menu->menu_handler == 'all') {
@ -404,14 +409,17 @@ if ($action == 'create') {
print '<tr><td class="fieldrequired">'.$langs->trans('MenuHandler').'</td><td>'.$handler.'</td><td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
// User
print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td><td><select class="flat" name="user">';
print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td><td>';
print '<select class="flat" name="user" id="menuuser">';
print '<option value="2"'.($menu->user == 2 ? ' selected' : '').'>'.$langs->trans("AllMenus").'</option>';
print '<option value="0"'.($menu->user == 0 ? ' selected' : '').'>'.$langs->trans('Internal').'</option>';
print '<option value="1"'.($menu->user == 1 ? ' selected' : '').'>'.$langs->trans('External').'</option>';
print '</select></td><td>'.$langs->trans('DetailUser').'</td></tr>';
print '</select>';
print ajax_combobox('menuuser');
print '</td><td>'.$langs->trans('DetailUser').'</td></tr>';
// Type
print '<tr><td class="fieldrequired">'.$langs->trans('Type').'</td>';
print '<tr><td class="fieldrequired">'.$langs->trans('Position').'</td>';
print '<td>'.$langs->trans(ucfirst($menu->type)).'</td><td>'.$langs->trans('DetailType').'</td></tr>';
// Mainmenu code
@ -464,12 +472,6 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans('Position').'</td>';
print '<td><input type="text" class="minwidth100" name="position" value="'.$menu->position.'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
// Target
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
print '<option value=""'.($menu->target == "" ? ' selected' : '').'>&nbsp;</option>';
print '<option value="_blank"'.($menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
print '</select></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
// Enabled
print '<tr><td>'.$langs->trans('Enabled').'</td>';
print '<td><input type="text" class="minwidth500" name="enabled" value="'.dol_escape_htmltag($menu->enabled).'"></td><td>'.$langs->trans('DetailEnabled');
@ -486,6 +488,14 @@ if ($action == 'create') {
}
print '</td></tr>';
// Target
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" id="target" name="target">';
print '<option value=""'.($menu->target == "" ? ' selected' : '').'>&nbsp;</option>';
print '<option value="_blank"'.($menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
print '</select>';
print ajax_combobox("target");
print '</td><td>'.$langs->trans('DetailTarget').'</td></tr>';
print '</table>';
print dol_get_fiche_end();

View File

@ -274,6 +274,9 @@ if (empty($reshook)) {
// Validation
$idwarehouse = GETPOST('idwarehouse', 'int');
$result = $object->valid($user);
if ( $result > 0 && ! empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) ) {
$result = $object->closeProposal($user, $object::STATUS_SIGNED);
}
if ($result >= 0) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
@ -678,7 +681,7 @@ if (empty($reshook)) {
$action = 'closeas';
} elseif (GETPOST('statut', 'int') == $object::STATUS_SIGNED || GETPOST('statut', 'int') == $object::STATUS_NOTSIGNED) {
// prevent browser refresh from closing proposal several times
if ($object->statut == $object::STATUS_VALIDATED) {
if ($object->statut == $object::STATUS_VALIDATED || ( ! empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) && $object->statut == $object::STATUS_DRAFT)) {
$db->begin();
$result = $object->closeProposal($user, GETPOST('statut', 'int'), GETPOST('note_private', 'restricthtml'));
@ -752,7 +755,7 @@ if (empty($reshook)) {
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) {
$db->begin();
$result = $object->reopen($user, 1);
$result = $object->reopen($user, empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
@ -2051,131 +2054,138 @@ if ($action == 'create') {
if ($action == 'closeas') {
//Form to close proposal (signed or not)
$formquestion = array(
array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED))),
array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '') // Field to complete private note (not replace)
);
$formquestion = array();
if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
}
$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
// This is a hidden option:
// Suggestion to create invoice during proposal signature is not enabled by default.
// Such choice should be managed by the workflow module and trigger. This option generates conflicts with some setup.
// It may also break step of creating an order when invoicing must be done from orders and not from proposal
$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)) {
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)) {
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
$object->fetchObjectLinked();
$object->fetchObjectLinked();
$eligibleForDepositGeneration = true;
$eligibleForDepositGeneration = true;
if (array_key_exists('facture', $object->linkedObjects)) {
foreach ($object->linkedObjects['facture'] as $invoice) {
if ($invoice->type == Facture::TYPE_DEPOSIT) {
$eligibleForDepositGeneration = false;
break;
if (array_key_exists('facture', $object->linkedObjects)) {
foreach ($object->linkedObjects['facture'] as $invoice) {
if ($invoice->type == Facture::TYPE_DEPOSIT) {
$eligibleForDepositGeneration = false;
break;
}
}
}
}
if ($eligibleForDepositGeneration && array_key_exists('commande', $object->linkedObjects)) {
foreach ($object->linkedObjects['commande'] as $order) {
$order->fetchObjectLinked();
if ($eligibleForDepositGeneration && array_key_exists('commande', $object->linkedObjects)) {
foreach ($object->linkedObjects['commande'] as $order) {
$order->fetchObjectLinked();
if (array_key_exists('facture', $order->linkedObjects)) {
foreach ($order->linkedObjects['facture'] as $invoice) {
if ($invoice->type == Facture::TYPE_DEPOSIT) {
$eligibleForDepositGeneration = false;
break 2;
if (array_key_exists('facture', $order->linkedObjects)) {
foreach ($order->linkedObjects['facture'] as $invoice) {
if ($invoice->type == Facture::TYPE_DEPOSIT) {
$eligibleForDepositGeneration = false;
break 2;
}
}
}
}
}
}
if ($eligibleForDepositGeneration) {
$formquestion[] = array(
'type' => 'checkbox',
'tdclass' => 'showonlyifsigned',
'name' => 'generate_deposit',
'label' => $form->textwithpicto($langs->trans('GenerateDeposit', $object->deposit_percent), $langs->trans('DepositGenerationPermittedByThePaymentTermsSelected'))
);
if ($eligibleForDepositGeneration) {
$formquestion[] = array(
'type' => 'checkbox',
'tdclass' => 'showonlyifsigned',
'name' => 'generate_deposit',
'morecss' => 'margintoponly marginbottomonly',
'label' => $form->textwithpicto($langs->trans('GenerateDeposit', $object->deposit_percent), $langs->trans('DepositGenerationPermittedByThePaymentTermsSelected'))
);
$formquestion[] = array(
'type' => 'date',
'tdclass' => 'fieldrequired showonlyifgeneratedeposit',
'name' => 'datef',
'label' => $langs->trans('DateInvoice'),
'value' => dol_now(),
'datenow' => true
);
if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) {
$formquestion[] = array(
'type' => 'date',
'tdclass' => 'fieldrequired showonlyifgeneratedeposit',
'name' => 'date_pointoftax',
'label' => $langs->trans('DatePointOfTax'),
'name' => 'datef',
'label' => $langs->trans('DateInvoice'),
'value' => dol_now(),
'datenow' => true
);
if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) {
$formquestion[] = array(
'type' => 'date',
'tdclass' => 'fieldrequired showonlyifgeneratedeposit',
'name' => 'date_pointoftax',
'label' => $langs->trans('DatePointOfTax'),
'value' => dol_now(),
'datenow' => true
);
}
$paymentTermsSelect = $form->getSelectConditionsPaiements(0, 'cond_reglement_id', -1, 0, 1, 'minwidth200');
$formquestion[] = array(
'type' => 'other',
'tdclass' => 'fieldrequired showonlyifgeneratedeposit',
'name' => 'cond_reglement_id',
'label' => $langs->trans('PaymentTerm'),
'value' => $paymentTermsSelect
);
$formquestion[] = array(
'type' => 'checkbox',
'tdclass' => 'showonlyifgeneratedeposit',
'name' => 'validate_generated_deposit',
'morecss' => 'margintoponly marginbottomonly',
'label' => $langs->trans('ValidateGeneratedDeposit')
);
$formquestion[] = array(
'type' => 'onecolumn',
'value' => '
<script>
let signedValue = ' . $object::STATUS_SIGNED . ';
$(document).ready(function() {
$("[name=generate_deposit]").change(function () {
let $self = $(this);
let $target = $(".showonlyifgeneratedeposit").parent(".tagtr");
if (! $self.parents(".tagtr").is(":hidden") && $self.is(":checked")) {
$target.show();
} else {
$target.hide();
}
return true;
});
$("#statut").change(function() {
let $target = $(".showonlyifsigned").parent(".tagtr");
if ($(this).val() == signedValue) {
$target.show();
} else {
$target.hide();
}
$("[name=generate_deposit]").trigger("change");
return true;
});
$("#statut").trigger("change");
});
</script>
'
);
}
ob_start();
$form->select_conditions_paiements(0, 'cond_reglement_id', -1, 0, 0, 'minwidth200');
$paymentTermsSelect = ob_get_clean();
$formquestion[] = array(
'type' => 'other',
'tdclass' => 'fieldrequired showonlyifgeneratedeposit',
'name' => 'cond_reglement_id',
'label' => $langs->trans('PaymentTerm'),
'value' => $paymentTermsSelect
);
$formquestion[] = array(
'type' => 'checkbox',
'tdclass' => 'showonlyifgeneratedeposit',
'name' => 'validate_generated_deposit',
'label' => $langs->trans('ValidateGeneratedDeposit')
);
$formquestion[] = array(
'type' => 'onecolumn',
'value' => '
<script>
let signedValue = ' . $object::STATUS_SIGNED . ';
$(document).ready(function() {
$("[name=generate_deposit]").change(function () {
let $self = $(this);
let $target = $(".showonlyifgeneratedeposit").parent(".tagtr");
if (! $self.parents(".tagtr").is(":hidden") && $self.is(":checked")) {
$target.show();
} else {
$target.hide();
}
return true;
});
$("#statut").change(function() {
let $target = $(".showonlyifsigned").parent(".tagtr");
if ($(this).val() == signedValue) {
$target.show();
} else {
$target.hide();
}
$("[name=generate_deposit]").trigger("change");
return true;
});
$("#statut").trigger("change");
});
</script>
'
);
}
}
@ -2187,7 +2197,11 @@ if ($action == 'create') {
));
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
} else {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
}
} elseif ($action == 'delete') {
// Confirm delete
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
@ -2794,7 +2808,7 @@ if ($action == 'create') {
if (($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)
|| ($object->statut == Propal::STATUS_DRAFT && !empty($conf->global->PROPAL_ENABLE_NEGATIVE) && count($object->lines) > 0)) {
if ($usercanvalidate) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate&token='.newToken().'">'.$langs->trans('Validate').'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate&token='.newToken().'">'.(empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')).'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Validate').'</a>';
}
@ -2875,14 +2889,22 @@ if ($action == 'create') {
}
}
// Close as accepted/refused
if ($object->statut == Propal::STATUS_VALIDATED) {
if ($usercanclose) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
// Close as accepted/refused
if ($object->statut == Propal::STATUS_VALIDATED) {
if ($usercanclose) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
}
}
} else {
// Set not signed (close)
if ($object->statut == Propal::STATUS_DRAFT && $usercanclose) {
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token='.newToken().'&action=closeas&token='.newToken() . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close') . '"';
print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
}
}

View File

@ -64,7 +64,7 @@ class box_activity extends ModeleBoxes
$this->hidden = !((isModEnabled('facture') && $user->hasRight('facture', 'read'))
|| (isModEnabled('commande') && $user->hasRight('commande', 'read'))
|| (isModEnabled('propal') && $user->hasRight('propale', 'read'))
|| (isModEnabled('propal') && $user->hasRight('propal', 'read'))
);
}

View File

@ -124,7 +124,7 @@ class box_dolibarr_state_board extends ModeleBoxes
'contacts' => isModEnabled('societe') && $user->hasRight('societe', 'contact', 'lire'),
'products' => isModEnabled('product') && $user->hasRight('produit', 'lire'),
'services' => isModEnabled('service') && $user->hasRight('service', 'lire'),
'proposals' => isModEnabled('propal') && $user->hasRight('propale', 'lire'),
'proposals' => isModEnabled('propal') && $user->hasRight('propal', 'read'),
'orders' => isModEnabled('commande') && $user->hasRight('commande', 'lire'),
'invoices' => isModEnabled('facture') && $user->hasRight('facture', 'lire'),
'donations' => isModEnabled('don') && $user->hasRight('don', 'lire'),

View File

@ -61,7 +61,7 @@ class box_propales extends ModeleBoxes
$this->db = $db;
$this->hidden = !($user->hasRight('propale', 'lire'));
$this->hidden = !($user->hasRight('propal', 'read'));
}
/**

View File

@ -4040,6 +4040,7 @@ class Form
* 0 : use default deposit percentage from entry
* > 0 : force deposit percentage (for example, from company object)
* @return void
* @deprecated
*/
public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1)
{
@ -5013,7 +5014,7 @@ class Form
} elseif ($input['type'] == 'checkbox') {
$more .= '<div class="tagtr">';
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
$more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
$more .= ' checked';
}

View File

@ -343,6 +343,8 @@ class FormAdmin
print '</option>'."\n";
}
print '</select>';
print ajax_combobox($htmlname);
}

View File

@ -5118,8 +5118,12 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
$out .= '>';
}
if ($tooltip) {
// You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
$tmptooltip = explode(':', $tooltip);
// You can also use 'TranslationString:keyfortooltiponclick' for a tooltip on click.
if (preg_match('/:\w+$/', $tooltip)) {
$tmptooltip = explode(':', $tooltip);
} else {
$tmptooltip = array($tooltip);
}
$out .= $form->textwithpicto($langs->trans($name), $langs->trans($tmptooltip[0]), 1, 'help', '', 0, 3, (empty($tmptooltip[1]) ? '' : 'extra_'.str_replace('.', '_', $field).'_'.$tmptooltip[1]));
} else {
$out .= $langs->trans($name);

View File

@ -234,7 +234,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|| isModEnabled('contrat')
|| isModEnabled('ficheinter')
) ? 1 : 0,
'perms'=>($user->hasRight('propal', 'lire')
'perms'=>($user->hasRight('propal', 'read')
|| $user->hasRight('commande', 'lire')
|| $user->hasRight('supplier_proposal', 'lire')
|| $user->hasRight('fournisseur', 'lire')
@ -1294,18 +1294,18 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left
// Customer proposal
if (isModEnabled('propal')) {
$langs->load("propal");
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propale', 'lire'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/comm/propal/card.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propale', 'creer'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propale', 'lire'));
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Proposals"), 0, $user->hasRight('propal', 'read'), '', $mainmenu, 'propals', 100, '', '', '', img_picto('', 'propal', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/comm/propal/card.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->hasRight('propal', 'write'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->hasRight('propal', 'read'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "propals") {
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propale', 'lire'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propale', 'lire'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propale', 'lire'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propale', 'lire'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propale', 'lire'));
//$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->hasRight('propale', 'lire'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=0", $langs->trans("PropalsDraft"), 2, $user->hasRight('propal', 'read'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=1", $langs->trans("PropalsOpened"), 2, $user->hasRight('propal', 'read'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2", $langs->trans("PropalStatusSigned"), 2, $user->hasRight('propal', 'read'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=3", $langs->trans("PropalStatusNotSigned"), 2, $user->hasRight('propal', 'read'));
$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=4", $langs->trans("PropalStatusBilled"), 2, $user->hasRight('propal', 'read'));
//$newmenu->add("/comm/propal/list.php?leftmenu=propals&search_status=2,3,4", $langs->trans("PropalStatusClosedShort"), 2, $user->hasRight('propal', 'read'));
}
$newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propale', 'lire'));
$newmenu->add("/comm/propal/stats/index.php?leftmenu=propals", $langs->trans("Statistics"), 1, $user->hasRight('propal', 'read'));
}
// Customers orders

View File

@ -317,11 +317,11 @@ class mailing_thirdparties extends MailingTargets
$s .= ajax_combobox("filter_status_thirdparties");
if (!empty($conf->global->MAIN_MULTILANGS)) {
// Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
$s .= '<span class="opacitymedium">'.$langs->trans("DefaultLang").':</span> ';
$s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang_thirdparties', 0, null, 1, 0, 0, '', 0, 0, 0, null, 1);
// Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
$s .= '<span class="opacitymedium">'.$langs->trans("DefaultLang").':</span> ';
$s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang_thirdparties', 0, null, 1, 0, 0, '', 0, 0, 0, null, 1);
}
return $s;

View File

@ -176,7 +176,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
}
// Number of commercial customer proposals open (expired)
if (isModEnabled('propal') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('propale', 'lire')) {
if (isModEnabled('propal') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('propal', 'read')) {
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$board = new Propal($db);
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");

View File

@ -1767,7 +1767,7 @@ DetailMenuHandler=Menu handler where to show new menu
DetailMenuModule=Module name if menu entry come from a module
DetailType=Type of menu (top or left)
DetailTitre=Menu label or label code for translation
DetailUrl=URL where menu send you (Absolute URL link or external link with http://)
DetailUrl=URL where menu send you (Relative URL link or external link with https://)
DetailEnabled=Condition to show or not entry
DetailRight=Condition to display unauthorized grey menus
DetailLangs=Lang file name for label code translation

View File

@ -50,6 +50,7 @@ PathToModulePackage=Path to zip of module/application package
PathToModuleDocumentation=Path to file of module/application documentation (%s)
SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed.
FileNotYetGenerated=File not yet generated
GenerateCode=Generate code
RegenerateClassAndSql=Force update of .class and .sql files
RegenerateMissingFiles=Generate missing files
SpecificationFile=File of documentation
@ -88,8 +89,8 @@ ListOfMenusEntries=List of menu entries
ListOfDictionariesEntries=List of dictionaries entries
ListOfPermissionsDefined=List of defined permissions
SeeExamples=See examples here
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION)
VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update).<br><br>Using a negative value means field is not shown by default on list but can be selected for viewing).<br><br>It can be an expression, for example:<br>preg_match('/public/', $_SERVER['PHP_SELF'])?0:1<br>($user->rights->holiday->define_holiday ? 1 : 0)
EnabledDesc=Condition to have this field active.<br><br>Examples:<br>1<br>isModEnabled('MAIN_MODULE_MYMODULE')<br>getDolGlobalString('MYMODULE_OPTION')==2
VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update).<br><br>Using a negative value means field is not shown by default on list but can be selected for viewing).<br><br>It can be an expression, for example:<br>preg_match('/public/', $_SERVER['PHP_SELF'])?0:1<br>$user->hasRights('holiday', 'define_holiday')?1:5
DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.<br>Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)<br><br><strong>For document :</strong><br>0 = not displayed <br>1 = display<br>2 = display only if not empty<br><br><strong>For document lines :</strong><br>0 = not displayed <br>1 = displayed in a column<br>3 = display in line description column after the description<br>4 = display in description column after the description only if not empty
DisplayOnPdf=Display on PDF
IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0)

View File

@ -2091,10 +2091,12 @@ if ($module == 'initmodule') {
//print '<span class="opacitymedium">'.$langs->trans("ModuleBuilderDesc2", 'conf/conf.php', $newdircustom).'</span><br>';
print '<br>';
print '<span class="opacitymedium">'.$langs->trans("ModuleName").'</span> <input type="text" name="modulename" value="'.dol_escape_htmltag($modulename).'" autofocus>';
print ' '.$form->textwithpicto('', $langs->trans("EnterNameOfModuleDesc")).'<br>';
print '<div class="tagtable">';
print '<span class="opacitymedium">'.$langs->trans("IdModule").'</span> <input type="text" name="idmodule" class="width75" value="500000" placeholder="'.dol_escape_htmltag($langs->trans("IdModule")).'">';
print '<div class="tagtr"><div class="tagtd">';
print '<span class="opacitymedium">'.$langs->trans("IdModule").'</span>';
print '</div><div class="tagtd">';
print '<input type="text" name="idmodule" class="width75" value="500000" placeholder="'.dol_escape_htmltag($langs->trans("IdModule")).'">';
print '<span class="opacitymedium">';
print ' &nbsp; (';
print dolButtonToOpenUrlInDialogPopup('popup_modules_id', $langs->transnoentitiesnoconv("SeeIDsInUse"), $langs->transnoentitiesnoconv("SeeIDsInUse"), '/admin/system/modules.php?mainmenu=home&leftmenu=admintools_info', '', '');
@ -2102,9 +2104,30 @@ if ($module == 'initmodule') {
print '<a href="https://wiki.dolibarr.org/index.php/List_of_modules_id" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeReservedIDsRangeHere").'</a>';
print ')';
print '</span>';
print '<br>';
print '<span class="opacitymedium">'.$langs->trans("Version").'</span> <input type="text" name="version" class="width75" value="1.0" placeholder="'.dol_escape_htmltag($langs->trans("Version")).'"><br>';
print '<span class="opacitymedium">'.$langs->trans("Family").'</span> ';
print '</div></div>';
print '<div class="tagtr"><div class="tagtd">';
print '<span class="opacitymedium">'.$langs->trans("ModuleName").'</span>';
print '</div><div class="tagtd">';
print '<input type="text" name="modulename" value="'.dol_escape_htmltag($modulename).'" autofocus>';
print ' '.$form->textwithpicto('', $langs->trans("EnterNameOfModuleDesc"));
print '</div></div>';
print '<div class="tagtr"><div class="tagtd">';
print '<span class="opacitymedium">'.$langs->trans("Description").'</span>';
print '</div><div class="tagtd">';
print '<input type="text" name="description" value="" class="minwidth500"><br>';
print '</div></div>';
print '<div class="tagtr"><div class="tagtd">';
print '<span class="opacitymedium">'.$langs->trans("Version").'</span>';
print '</div><div class="tagtd">';
print '<input type="text" name="version" class="width75" value="1.0" placeholder="'.dol_escape_htmltag($langs->trans("Version")).'">';
print '</div></div>';
print '<div class="tagtr"><div class="tagtd">';
print '<span class="opacitymedium">'.$langs->trans("Family").'</span>';
print '</div><div class="tagtd">';
print '<select name="family" id="family" class="minwidth400">';
print '<option value="hr">'.$langs->trans("ModuleFamilyHr").'</option>';
print '<option value="crm">'.$langs->trans("ModuleFamilyCrm").'</option>';
@ -2118,15 +2141,28 @@ if ($module == 'initmodule') {
print '<option value="interface">'.$langs->trans("ModuleFamilyInterface").'</option>';
print '<option value="base">'.$langs->trans("ModuleFamilyBase").'</option>';
print '<option value="other" selected="">'.$langs->trans("ModuleFamilyOther").'</option>';
print '</select><br>';
print '</select>';
print ajax_combobox("family");
print '<span class="opacitymedium">'.$langs->trans("Picto").'</span> <input type="text" name="idpicto" value="fa-generic" placeholder="'.dol_escape_htmltag($langs->trans("Picto")).'">';
print $form->textwithpicto('', $langs->trans("Example").': fa-generic, fa-globe, ... any font awesome code.<br>Advanced syntax is fa-fakey[_faprefix[_facolor[_fasize]]]');
print '<br>';
print '<span class="opacitymedium">'.$langs->trans("Description").'</span> <input type="text" name="description" value="" class="minwidth500"><br>';
print '</div></div>';
print '<span class="opacitymedium">'.$langs->trans("EditorName").'</span> <input type="text" name="editorname" value="'.$mysoc->name.'" placeholder="'.dol_escape_htmltag($langs->trans("EditorName")).'"><br>';
print '<span class="opacitymedium">'.$langs->trans("EditorUrl").'</span> <input type="text" name="editorurl" value="'.$mysoc->url.'" placeholder="'.dol_escape_htmltag($langs->trans("EditorUrl")).'"><br>';
print '<div class="tagtr"><div class="tagtd">';
print '<span class="opacitymedium">'.$langs->trans("Picto").'</span>';
print '</div><div class="tagtd">';
print '<input type="text" name="idpicto" value="fa-generic" placeholder="'.dol_escape_htmltag($langs->trans("Picto")).'">';
print $form->textwithpicto('', $langs->trans("Example").': fa-generic, fa-globe, ... any font awesome code.<br>Advanced syntax is fa-fakey[_faprefix[_facolor[_fasize]]]');
print '</div></div>';
print '<div class="tagtr"><div class="tagtd">';
print '<span class="opacitymedium">'.$langs->trans("EditorName").'</span>';
print '</div><div class="tagtd">';
print '<input type="text" name="editorname" value="'.$mysoc->name.'" placeholder="'.dol_escape_htmltag($langs->trans("EditorName")).'"><br>';
print '</div></div>';
print '<div class="tagtr"><div class="tagtd">';
print '<span class="opacitymedium">'.$langs->trans("EditorUrl").'</span>';
print '</div><div class="tagtd">';
print '<input type="text" name="editorurl" value="'.$mysoc->url.'" placeholder="'.dol_escape_htmltag($langs->trans("EditorUrl")).'"><br>';
print '</div></div>';
print '<br><input type="submit" class="button" name="create" value="'.dol_escape_htmltag($langs->trans("Create")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
print '</form>';
@ -2274,7 +2310,7 @@ if ($module == 'initmodule') {
print '</table>';
print '<br>';
print load_fiche_titre($form->textwithpicto($langs->trans("DescriptorFile"), $pathtofile), '', '');
print load_fiche_titre($form->textwithpicto($langs->trans("DescriptorFile"), $langs->transnoentitiesnoconv("File").' '.$pathtofile), '', '');
if (!empty($moduleobj)) {
print '<div class="underbanner clearboth"></div>';
@ -2288,7 +2324,7 @@ if ($module == 'initmodule') {
print '</td></tr>';
print '<tr><td>';
print $langs->trans("Numero");
print $langs->trans("IdModule");
print '</td><td>';
print $moduleobj->numero;
print '<span class="opacitymedium">';
@ -2298,11 +2334,17 @@ if ($module == 'initmodule') {
print '</td></tr>';
print '<tr><td>';
print $langs->trans("Name");
print $langs->trans("ModuleName");
print '</td><td>';
print $moduleobj->getName();
print '</td></tr>';
print '<tr><td>';
print $langs->trans("Description");
print '</td><td>';
print $moduleobj->getDesc();
print '</td></tr>';
print '<tr><td>';
print $langs->trans("Version");
print '</td><td>';
@ -2323,12 +2365,6 @@ if ($module == 'initmodule') {
print ' &nbsp; '.img_picto('', $moduleobj->picto, 'class="valignmiddle pictomodule paddingrightonly"');
print '</td></tr>';
print '<tr><td>';
print $langs->trans("Description");
print '</td><td>';
print $moduleobj->getDesc();
print '</td></tr>';
print '<tr><td>';
print $langs->trans("EditorName");
print '</td><td>';
@ -2352,7 +2388,7 @@ if ($module == 'initmodule') {
print '<br><br>';
// Readme file
print load_fiche_titre($form->textwithpicto($langs->trans("ReadmeFile"), $pathtofilereadme), '', '');
print load_fiche_titre($form->textwithpicto($langs->trans("ReadmeFile"), $langs->transnoentitiesnoconv("File").' '.$pathtofilereadme), '', '');
print '<!-- readme file -->';
if (dol_is_file($dirread.'/'.$pathtofilereadme)) {
@ -2364,7 +2400,7 @@ if ($module == 'initmodule') {
print '<br><br>';
// ChangeLog
print load_fiche_titre($form->textwithpicto($langs->trans("ChangeLog"), $pathtochangelog), '', '');
print load_fiche_titre($form->textwithpicto($langs->trans("ChangeLog"), $langs->transnoentitiesnoconv("File").' '.$pathtochangelog), '', '');
print '<!-- changelog file -->';
if (dol_is_file($dirread.'/'.$pathtochangelog)) {
@ -2556,7 +2592,7 @@ if ($module == 'initmodule') {
print '<input type="text" name="objectname" maxlength="64" value="'.dol_escape_htmltag(GETPOST('objectname', 'alpha') ? GETPOST('objectname', 'alpha') : $modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'" autofocus><br>';
print '<input type="checkbox" name="includerefgeneration" id="includerefgeneration" value="includerefgeneration"> <label for="includerefgeneration">'.$form->textwithpicto($langs->trans("IncludeRefGeneration"), $langs->trans("IncludeRefGenerationHelp")).'</label><br>';
print '<input type="checkbox" name="includedocgeneration" id="includedocgeneration" value="includedocgeneration"> <label for="includedocgeneration">'.$form->textwithpicto($langs->trans("IncludeDocGeneration"), $langs->trans("IncludeDocGenerationHelp")).'</label><br>';
print '<input type="submit" class="button smallpaddingimp" name="create" value="'.dol_escape_htmltag($langs->trans("Generate")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
print '<input type="submit" class="button smallpaddingimp" name="create" value="'.dol_escape_htmltag($langs->trans("GenerateCode")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
print '<br>';
print '<br>';
print '<br>';
@ -2566,7 +2602,7 @@ if ($module == 'initmodule') {
//print '<input type="checkbox" name="initfromtablecheck"> ';
print $langs->trans("InitStructureFromExistingTable");
print '<input type="text" name="initfromtablename" value="" placeholder="'.$langs->trans("TableName").'">';
print '<input type="submit" class="button smallpaddingimp" name="createtablearray" value="'.dol_escape_htmltag($langs->trans("Generate")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
print '<input type="submit" class="button smallpaddingimp" name="createtablearray" value="'.dol_escape_htmltag($langs->trans("GenerateCode")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
print '<br>';
print '</form>';
@ -3374,7 +3410,7 @@ if ($module == 'initmodule') {
print '<input type="text" name="dicname" maxlength="64" value="'.dol_escape_htmltag(GETPOST('dicname', 'alpha') ? GETPOST('dicname', 'alpha') : $modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("DicKey")).'" autofocus><br>';
//print '<input type="checkbox" name="includerefgeneration" id="includerefgeneration" value="includerefgeneration"> <label for="includerefgeneration">'.$form->textwithpicto($langs->trans("IncludeRefGeneration"), $langs->trans("IncludeRefGenerationHelp")).'</label><br>';
//print '<input type="checkbox" name="includedocgeneration" id="includedocgeneration" value="includedocgeneration"> <label for="includedocgeneration">'.$form->textwithpicto($langs->trans("IncludeDocGeneration"), $langs->trans("IncludeDocGenerationHelp")).'</label><br>';
print '<input type="submit" class="button smallpaddingimp" name="create" value="'.dol_escape_htmltag($langs->trans("Generate")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
print '<input type="submit" class="button smallpaddingimp" name="create" value="'.dol_escape_htmltag($langs->trans("GenerateCode")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
/*print '<br>';
print '<br>';
print '<br>';
@ -3384,7 +3420,7 @@ if ($module == 'initmodule') {
//print '<input type="checkbox" name="initfromtablecheck"> ';
print $langs->trans("InitStructureFromExistingTable");
print '<input type="text" name="initfromtablename" value="" placeholder="'.$langs->trans("TableName").'">';
print '<input type="submit" class="button smallpaddingimp" name="createtablearray" value="'.dol_escape_htmltag($langs->trans("Generate")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
print '<input type="submit" class="button smallpaddingimp" name="createtablearray" value="'.dol_escape_htmltag($langs->trans("GenerateCode")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
print '<br>';
*/
print '</form>';
@ -3465,18 +3501,18 @@ if ($module == 'initmodule') {
print '<tr class="liste_titre">';
print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'thsticky ');
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("LinkToParentMenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("RelativeURL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("URL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->transnoentitiesnoconv('DetailUrl'));
print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("UserType", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans('DetailEnabled'));
print_liste_field_titre("Rights", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->trans('DetailRight'));
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, '', $langs->trans('DetailTarget'));
print_liste_field_titre("MenuForUsers", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ', $langs->trans('DetailUser'));
print "</tr>\n";
if (count($menus)) {
@ -3535,7 +3571,15 @@ if ($module == 'initmodule') {
print '</td>';
print '<td class="right">';
print dol_escape_htmltag($menu['user']);
if ($menu['user'] == 2) {
print $langs->trans("AllMenus");
} elseif ($menu['user'] == 0) {
print $langs->trans('Internal');
} elseif ($menu['user'] == 1) {
print $langs->trans('External');
} else {
print $menu['user']; // should not happen
}
print '</td>';
print '</tr>';

View File

@ -713,6 +713,7 @@ class User extends CommonObject
'order' => 'commande',
//'product' => 'produit', // We must check $user->rights->produit...
'project' => 'projet',
'propale' => 'propal',
'shipping' => 'expedition',
'task' => 'task@projet',
'fichinter' => 'ficheinter',