Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW - create a product from a free line in a document #22324

21 changes: 21 additions & 0 deletions htdocs/core/tpl/objectline_create.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,27 @@
}
echo '<input type="hidden" name="pbq" id="pbq" value="">';
echo '</span>';

if (isModEnabled('product') && $user->hasRight('produit', 'creer')) {
$url = '/product/card.php?leftmenu=product&action=create&type=0&backtopage='.urlencode($_SERVER["PHP_SELF"]);
$newbutton = '<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("NewProduct").'"></span>';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$tmpbacktopagejsfields = 'addproduct:id,search_id';
print dolButtonToOpenUrlInDialogPopup('addproduct', $langs->transnoentitiesnoconv('AddProduct'), $newbutton, $url, '', '', $tmpbacktopagejsfields);
} else {
//print ' <a href="'.DOL_URL_ROOT.$url.'">'.$newbutton.'</a>';
}
}
if (isModEnabled('service') && $user->hasRight('service', 'creer')) {
$url = '/product/card.php?leftmenu=product&action=create&type=1&backtopage='.urlencode($_SERVER["PHP_SELF"]);
$newbutton = '<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("NewService").'"></span>';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$tmpbacktopagejsfields = 'addproduct:id,search_id';
print dolButtonToOpenUrlInDialogPopup('addproduct', $langs->transnoentitiesnoconv('AddProduct'), $newbutton, $url, '', '', $tmpbacktopagejsfields);
} else {
//print ' <a href="'.DOL_URL_ROOT.$url.'">'.$newbutton.'</a>';
}
}
}

if (!empty($conf->global->MAIN_ADD_LINE_AT_POSITION)) {
Expand Down