diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 5ef4846abf7..288cba1c5b9 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -296,15 +296,17 @@ if ($action == 'create') { // User print ''.$langs->trans('MenuForUsers').''; - print ''; print ''; print ''; print ''; - print ''; + print ''; + print ajax_combobox('menuuser'); + print ''; print ''.$langs->trans('DetailUser').''; // Type - print ''.$langs->trans('Type').''; + print ''.$langs->trans('Position').''; if ($parent_rowid) { print $langs->trans('Left'); print ''; @@ -314,6 +316,7 @@ if ($action == 'create') { print ''; print ''; print ''; + print ajax_combobox('topleft'); } print ''.$langs->trans('DetailType').''; @@ -351,12 +354,6 @@ if ($action == 'create') { print ''.$langs->trans('Position').''; print ''.$langs->trans('DetailPosition').''; - // Target - print ''.$langs->trans('Target').''.$langs->trans('DetailTarget').''; - // Enabled print ''.$langs->trans('Enabled').''; print ''.$langs->trans('DetailEnabled').''; @@ -365,6 +362,14 @@ if ($action == 'create') { print ''.$langs->trans('Rights').''; print ''.$langs->trans('DetailRight').''; + // Target + print ''.$langs->trans('Target').''; + print ajax_combobox("target"); + print ''.$langs->trans('DetailTarget').''; + print ''; print dol_get_fiche_end(); @@ -393,7 +398,7 @@ if ($action == 'create') { print ''.$langs->trans('Id').''.$menu->id.''.$langs->trans('DetailId').''; // Module - print ''.$langs->trans('MenuModule').''.$menu->module.''.$langs->trans('DetailMenuModule').''; + print ''.$langs->trans('MenuModule').''.(empty($menu->module) ? 'Core' : $menu->module).''.$langs->trans('DetailMenuModule').''; // Handler if ($menu->menu_handler == 'all') { @@ -404,14 +409,17 @@ if ($action == 'create') { print ''.$langs->trans('MenuHandler').''.$handler.''.$langs->trans('DetailMenuHandler').''; // User - print ''.$langs->trans('MenuForUsers').''; print ''; print ''; print ''; - print ''.$langs->trans('DetailUser').''; + print ''; + print ajax_combobox('menuuser'); + print ''.$langs->trans('DetailUser').''; // Type - print ''.$langs->trans('Type').''; + print ''.$langs->trans('Position').''; print ''.$langs->trans(ucfirst($menu->type)).''.$langs->trans('DetailType').''; // Mainmenu code @@ -464,12 +472,6 @@ if ($action == 'create') { print ''.$langs->trans('Position').''; print ''.$langs->trans('DetailPosition').''; - // Target - print ''.$langs->trans('Target').''.$langs->trans('DetailTarget').''; - // Enabled print ''.$langs->trans('Enabled').''; print ''.$langs->trans('DetailEnabled'); @@ -486,6 +488,14 @@ if ($action == 'create') { } print ''; + // Target + print ''.$langs->trans('Target').''; + print ajax_combobox("target"); + print ''.$langs->trans('DetailTarget').''; + print ''; print dol_get_fiche_end(); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 2e996a66cfa..b35e8ff3909 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -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' => ''.$langs->trans("CloseAs").'', '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' => ''.$langs->trans("CloseAs").'', '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' => ' + + ' + ); } - - 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' => ' - - ' - ); } } @@ -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 ''.$langs->trans('Validate').''; + print ''.(empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')).''; } else { print ''.$langs->trans('Validate').''; } @@ -2875,14 +2889,22 @@ if ($action == 'create') { } } - // Close as accepted/refused - if ($object->statut == Propal::STATUS_VALIDATED) { - if ($usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; - print '>'.$langs->trans('SetAcceptedRefused').''; - } else { - print ''.$langs->trans('SetAcceptedRefused').''; + if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) { + // Close as accepted/refused + if ($object->statut == Propal::STATUS_VALIDATED) { + if ($usercanclose) { + print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; + print '>'.$langs->trans('SetAcceptedRefused').''; + } else { + print ''.$langs->trans('SetAcceptedRefused').''; + } + } + } else { + // Set not signed (close) + if ($object->statut == Propal::STATUS_DRAFT && $usercanclose) { + print 'global->MAIN_JUMP_TAG) ? '' : '#close') . '"'; + print '>' . $langs->trans('SetRefusedAndClose') . ''; } } diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 017c5fe3d02..fb0a60b567f 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -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')) ); } diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index a979e3e5a36..1efd1d27f95 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -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'), diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 8e8efc8d8f3..7114fdb5399 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -61,7 +61,7 @@ class box_propales extends ModeleBoxes $this->db = $db; - $this->hidden = !($user->hasRight('propale', 'lire')); + $this->hidden = !($user->hasRight('propal', 'read')); } /** diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a738bce9004..41279c8ae36 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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 .= '
'; $more .= '
'.$input['label'].'
'; - $more .= ''."\n"; } print ''; + + print ajax_combobox($htmlname); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8a5751d72b3..1bb48831113 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 66f85c3739c..a1b505da46a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -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&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&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 diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 1d7acf02c09..335e3ac575a 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -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 .= ''.$langs->trans("DefaultLang").': '; - $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 .= ''.$langs->trans("DefaultLang").': '; + $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang_thirdparties', 0, null, 1, 0, 0, '', 0, 0, 0, null, 1); } return $s; diff --git a/htdocs/index.php b/htdocs/index.php index 2a0a163f44e..97b82fb93ba 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -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"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cbec6cfc5ea..d82631cc8fa 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -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 diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index cab8fa37f16..a16dfc52ed2 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -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).

Using a negative value means field is not shown by default on list but can be selected for viewing).

It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
($user->rights->holiday->define_holiday ? 1 : 0) +EnabledDesc=Condition to have this field active.

Examples:
1
isModEnabled('MAIN_MODULE_MYMODULE')
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).

Using a negative value means field is not shown by default on list but can be selected for viewing).

It can be an expression, for example:
preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
$user->hasRights('holiday', 'define_holiday')?1:5 DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)

For document :
0 = not displayed
1 = display
2 = display only if not empty

For document lines :
0 = not displayed
1 = displayed in a column
3 = display in line description column after the description
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) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 46613047cb1..e25350f9e16 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2091,10 +2091,12 @@ if ($module == 'initmodule') { //print ''.$langs->trans("ModuleBuilderDesc2", 'conf/conf.php', $newdircustom).'
'; print '
'; - print ''.$langs->trans("ModuleName").' '; - print ' '.$form->textwithpicto('', $langs->trans("EnterNameOfModuleDesc")).'
'; + print '
'; - print ''.$langs->trans("IdModule").' '; + print '
'; + print ''.$langs->trans("IdModule").''; + print '
'; + print ''; print ''; print '   ('; 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 ''.$langs->trans("SeeReservedIDsRangeHere").''; print ')'; print ''; - print '
'; - print ''.$langs->trans("Version").'
'; - print ''.$langs->trans("Family").' '; + print '
'; + + print '
'; + print ''.$langs->trans("ModuleName").''; + print '
'; + print ''; + print ' '.$form->textwithpicto('', $langs->trans("EnterNameOfModuleDesc")); + print '
'; + + print '
'; + print ''.$langs->trans("Description").''; + print '
'; + print '
'; + print '
'; + + print '
'; + print ''.$langs->trans("Version").''; + print '
'; + print ''; + print '
'; + + print '
'; + print ''.$langs->trans("Family").''; + print '
'; print '
'; + print ''; print ajax_combobox("family"); - print ''.$langs->trans("Picto").' '; - print $form->textwithpicto('', $langs->trans("Example").': fa-generic, fa-globe, ... any font awesome code.
Advanced syntax is fa-fakey[_faprefix[_facolor[_fasize]]]'); - print '
'; - print ''.$langs->trans("Description").'
'; + print '
'; - print ''.$langs->trans("EditorName").'
'; - print ''.$langs->trans("EditorUrl").'
'; + print '
'; + print ''.$langs->trans("Picto").''; + print '
'; + print ''; + print $form->textwithpicto('', $langs->trans("Example").': fa-generic, fa-globe, ... any font awesome code.
Advanced syntax is fa-fakey[_faprefix[_facolor[_fasize]]]'); + print '
'; + + print '
'; + print ''.$langs->trans("EditorName").''; + print '
'; + print '
'; + print '
'; + + print '
'; + print ''.$langs->trans("EditorUrl").''; + print '
'; + print '
'; + print '
'; print '
'; print ''; @@ -2274,7 +2310,7 @@ if ($module == 'initmodule') { print ''; print '
'; - 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 '
'; @@ -2288,7 +2324,7 @@ if ($module == 'initmodule') { print ''; print ''; - print $langs->trans("Numero"); + print $langs->trans("IdModule"); print ''; print $moduleobj->numero; print ''; @@ -2298,11 +2334,17 @@ if ($module == 'initmodule') { print ''; print ''; - print $langs->trans("Name"); + print $langs->trans("ModuleName"); print ''; print $moduleobj->getName(); print ''; + print ''; + print $langs->trans("Description"); + print ''; + print $moduleobj->getDesc(); + print ''; + print ''; print $langs->trans("Version"); print ''; @@ -2323,12 +2365,6 @@ if ($module == 'initmodule') { print '   '.img_picto('', $moduleobj->picto, 'class="valignmiddle pictomodule paddingrightonly"'); print ''; - print ''; - print $langs->trans("Description"); - print ''; - print $moduleobj->getDesc(); - print ''; - print ''; print $langs->trans("EditorName"); print ''; @@ -2352,7 +2388,7 @@ if ($module == 'initmodule') { print '

'; // 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 ''; if (dol_is_file($dirread.'/'.$pathtofilereadme)) { @@ -2364,7 +2400,7 @@ if ($module == 'initmodule') { print '

'; // 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 ''; if (dol_is_file($dirread.'/'.$pathtochangelog)) { @@ -2556,7 +2592,7 @@ if ($module == 'initmodule') { print '
'; print '
'; print '
'; - print ''; + print ''; print '
'; print '
'; print '
'; @@ -2566,7 +2602,7 @@ if ($module == 'initmodule') { //print ' '; print $langs->trans("InitStructureFromExistingTable"); print ''; - print ''; + print ''; print '
'; print ''; @@ -3374,7 +3410,7 @@ if ($module == 'initmodule') { print '
'; //print '
'; //print '
'; - print ''; + print ''; /*print '
'; print '
'; print '
'; @@ -3384,7 +3420,7 @@ if ($module == 'initmodule') { //print ' '; print $langs->trans("InitStructureFromExistingTable"); print ''; - print ''; + print ''; print '
'; */ print ''; @@ -3465,18 +3501,18 @@ if ($module == 'initmodule') { print ''; 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 "\n"; if (count($menus)) { @@ -3535,7 +3571,15 @@ if ($module == 'initmodule') { print ''; print ''; - 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 ''; print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 54f1cbe4fc9..a09811b21fc 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -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',