NEW Add link to edit property from search result of website pages

This commit is contained in:
Laurent Destailleur 2020-05-22 00:38:01 +02:00
parent 8a481b297c
commit 5d78f6dac5
4 changed files with 23 additions and 4 deletions

View File

@ -3170,7 +3170,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic',
'home', 'companies', 'products', 'commercial', 'invoicing', 'pencil-ruler', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic',
'error', 'warning', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda'
)

View File

@ -818,7 +818,7 @@ class Product extends CommonObject
}
/**
* Update a record into database.
* Update a record into database.
* If batch flag is set to on, we create records into llx_product_batch
*
* @param int $id Id of product

View File

@ -665,10 +665,10 @@ body[class*="colorblind-"] .text-success{
color : <?php print $textDanger; ?>
}
.editfielda span.fa-pencil-alt, .editfielda span.fa-trash, .editfieldlang {
.editfielda span.fa-pencil-alt, .editfielda span.fa-pencil-ruler, .editfielda span.fa-trash, .editfieldlang {
color: #ccc !important;
}
.editfielda span.fa-pencil-alt:hover, .editfielda span.fa-trash:hover, .editfieldlang:hover {
.editfielda span.fa-pencil-alt:hover, .editfielda span.fa-pencil-ruler:hover, .editfielda span.fa-trash:hover, .editfieldlang:hover {
color: var(--colortexttitle) !important;
}
.fawidth30 {

View File

@ -3629,6 +3629,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
print getTitleFieldOfList("Page", 0, $_SERVER['PHP_SELF'], 'pageurl', '', $param, '', $sortfield, $sortorder, '')."\n";
//print getTitleFieldOfList("Description", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print '</tr>';
@ -3651,6 +3652,24 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
print '<span class="opacitymedium">'.$answerrecord->description.'</span>';
print '</td>';
// Edit properties
print '<td>';
$param = '?action=replacesiteconfirm';
$param .= '&websiteid='.$website->id;
$param .= '&optioncontent='.GETPOST('optioncontent');
$param .= '&optionmeta='.GETPOST('optionmeta');
$param .= '&optionsitefiles='.GETPOST('optionsitefiles');
$param .= '&searchstring='.$searchkey;
$disabled = '';
$urltoedithtmlsource = $_SERVER["PHP_SELF"].'?action=editmeta&websiteid='.$website->id.'&pageid='.$answerrecord->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].$param);
if (empty($user->rights->website->write)) {
$disabled = ' disabled';
$urltoedithtmlsource = '';
}
print '<a class="editfielda '.$disabled.'" href="'.$urltoedithtmlsource.'" title="'.$langs->trans("EditPageMeta").'">'.img_picto($langs->trans("EditPageMeta"), 'pencil-ruler').'</a>';
print '</td>';
// Edit HTML source
print '<td>';
$param = '?action=replacesiteconfirm';
$param .= '&websiteid='.$website->id;