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

Improved copying values from the phone and email fields. #17277

Open
wants to merge 4 commits into
base: developer
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion layouts/basic/modules/Vtiger/Modals/RecordsList.tpl
Expand Up @@ -100,7 +100,7 @@
</td>
{foreach item=LISTVIEW_HEADER from=$LISTVIEW_HEADERS}
{assign var=LISTVIEW_HEADERNAME value=$LISTVIEW_HEADER->getFieldName()}
<td class="{$WIDTHTYPE} text-nowrap" data-field="{$LISTVIEW_HEADERNAME}"
<td class="listViewEntryValue {$WIDTHTYPE} text-nowrap position-relative" data-field="{$LISTVIEW_HEADERNAME}"
data-type="{$LISTVIEW_HEADER->getFieldDataType()}">
{if $LISTVIEW_HEADER->get('fromOutsideList') eq true}
{$LISTVIEW_HEADER->getDisplayValue($LISTVIEW_ENTRY->get($LISTVIEW_HEADERNAME))}
Expand Down
2 changes: 1 addition & 1 deletion layouts/basic/modules/Vtiger/RecordPopover.tpl
Expand Up @@ -33,7 +33,7 @@
</h5>
<div class="c-popover--link__body px-2 pb-1">
{foreach item=FIELD_MODEL key=FIELD_NAME from=$FIELDS}
<div class="u-white-space-nowrap u-text-ellipsis--no-hover">
<div class="c-popover--link__value-content u-white-space-nowrap u-text-ellipsis--no-hover">
{assign var=ICON value=$FIELD_MODEL->get('icon')}
{if $ICON}
{\App\Layout\Media::getImageHtml($ICON)}
Expand Down
2 changes: 1 addition & 1 deletion layouts/basic/modules/Vtiger/RelatedListContents.tpl
Expand Up @@ -145,7 +145,7 @@
{/if}
{assign var=COUNT value=$COUNT+1}
{assign var=RELATED_HEADERNAME value=$HEADER_FIELD->getFieldName()}
<td class="{$WIDTHTYPE}" data-field-type="{$HEADER_FIELD->getFieldDataType()}" nowrap
<td class="listViewEntryValue {$WIDTHTYPE}" data-field-type="{$HEADER_FIELD->getFieldDataType()}" nowrap
{if $smarty.foreach.listHeaderForeach.iteration eq $RELATED_HEADER_COUNT} colspan="2" {/if}>
{if empty($HEADER_FIELD->get('source_field_name')) && ($HEADER_FIELD->isNameField() eq true or $HEADER_FIELD->getUIType() eq '4') && $RELATED_MODULE->isListViewNameFieldNavigationEnabled() && $RELATED_RECORD->isViewable()}
<a class="modCT_{$RELATED_MODULE_NAME} js-list__field js-popover-tooltip--record" data-js="width" title="" href="{$RELATED_RECORD->getDetailViewUrl()}">
Expand Down
2 changes: 1 addition & 1 deletion layouts/basic/modules/Vtiger/SummaryWidgetsContent.tpl
Expand Up @@ -39,7 +39,7 @@
{foreach item=HEADER_FIELD from=$RELATED_HEADERS}
{$COUNT = $COUNT+1}
{assign var=RELATED_HEADERNAME value=$HEADER_FIELD->getFieldName()}
<td class="text-left {$WIDTHTYPE}
<td class="listViewEntryValue text-left {$WIDTHTYPE}
{if $RELATED_HEADERNAME && $HEADER_FIELD->getFieldDataType() eq 'documentsFileUpload' && $HEADER_FIELD->isEditable() && $RELATED_RECORD->isEditable() && 'I' === $RELATED_RECORD->getValueByField('filelocationtype') } js-drop-container{/if}"
data-id="{$RELATED_RECORD->getId()}"
data-module="{$RELATED_MODULE->getName()}"
Expand Down
2 changes: 1 addition & 1 deletion modules/Vtiger/uitypes/Email.php
Expand Up @@ -46,7 +46,7 @@ public function getDisplayValue($value, $record = false, $recordModel = false, $
$icon = $button = '';
if ('Base' !== \App\Mail::getMailComposer()) {
$icon = '<span class="fa-solid fa-envelope" aria-hidden="true"></span> ';
$button = "<button type=\"button\" class=\"btn btn-primary btn-xs ml-1 clipboard\" data-copy-attribute=\"clipboard-text\" data-clipboard-text=\"{$value}\" title=\"" . \App\Language::translate('BTN_COPY_TO_CLIPBOARD', $recordModel->getModuleName()) . '"><span class="fa-regular fa-copy"></span></button>';
$button = "<button type=\"button\" class=\"btn btn-primary btn-xs float-right clipboard\" data-copy-attribute=\"clipboard-text\" data-clipboard-text=\"{$value}\" title=\"" . \App\Language::translate('BTN_COPY_TO_CLIPBOARD', $recordModel->getModuleName()) . '"><span class="fa-regular fa-copy"></span></button>';
}
return "<a class=\"u-cursor-pointer js-email-compose \" {$data} data-js=\"click|container\">{$icon}{$value}</a>$button";
}
Expand Down
4 changes: 2 additions & 2 deletions modules/Vtiger/uitypes/Phone.php
Expand Up @@ -86,7 +86,7 @@ public function getDisplayValue($value, $record = false, $recordModel = false, $
if (!\App\Integrations\Pbx::isActive()) {
return '<a href="' . $href . '" class="js-popover-tooltip" title="' . $label . ' ' . trim($title) . '">' . $international . '</a>' . $extra;
}
$button = "<button type=\"button\" class=\"btn btn-primary btn-xs ml-1 clipboard\" data-copy-attribute=\"clipboard-text\" data-clipboard-text=\"{$international}\" title=\"" . \App\Language::translate('BTN_COPY_TO_CLIPBOARD', $recordModel->getModuleName()) . '"><span class="fa-regular fa-copy"></span></button>';
$button = "<button type=\"button\" class=\"btn btn-primary btn-xs float-right clipboard\" data-copy-attribute=\"clipboard-text\" data-clipboard-text=\"{$international}\" title=\"" . \App\Language::translate('BTN_COPY_TO_CLIPBOARD', $recordModel->getModuleName()) . '"><span class="fa-regular fa-copy"></span></button>';
$data = 'data-phone="' . preg_replace('/(?<!^)\+|[^\d+]+/', '', $international) . '"';
if ($record) {
$data .= ' data-record="' . $record . '"';
Expand All @@ -109,7 +109,7 @@ public function getTextParserDisplayValue($value, Vtiger_Record_Model $recordMod
$international = $phoneUtil->format($swissNumberProto, \libphonenumber\PhoneNumberFormat::INTERNATIONAL);
$href = $phoneUtil->format($swissNumberProto, $format);
} catch (\libphonenumber\NumberParseException $e) {
\App\Log::info($e->__toString(), __CLASS__);
\App\Log::info($e->__toString(), __CLASS__);
}
if (\libphonenumber\PhoneNumberFormat::RFC3966 !== $format) {
$href = 'tel:' . $href;
Expand Down
Expand Up @@ -2836,7 +2836,6 @@ jQuery.Class(
// Not detail view page
return;
}
App.Fields.Text.registerCopyClipboard(detailViewContainer);
this.registerWidgetProductAndServices();
this.registerSetReadRecord(detailViewContainer);
this.getForm().validationEngine(app.validationEngineOptionsForRecord);
Expand All @@ -2849,6 +2848,7 @@ jQuery.Class(
this.registerSendPdfFromPdfViewer(detailViewContainer);
this.registerKeyboardShortcutsEvent(detailViewContainer);
App.Components.ActivityNotifier.register(detailViewContainer);
App.Fields.Text.registerCopyClipboard(detailViewContainer.find('#detailView'));
}
}
);
12 changes: 12 additions & 0 deletions public_html/layouts/basic/styles/_Style.scss
Expand Up @@ -1570,14 +1570,26 @@ td.listViewEntryValue .row input {
margin-bottom: 0;
}
@media only screen and (min-width: 1200px) {
.c-popover--link__body .c-popover--link__value-content .clipboard,
.listViewEntries .listViewEntryValue .clipboard,
.detailViewTable .fieldValue .clipboard {
display: none;
}
.c-popover--link__body .c-popover--link__value-content:hover .clipboard,
.listViewEntries .listViewEntryValue:hover .clipboard,
.detailViewTable .fieldValue:hover .clipboard {
display: inline-block;
}
.c-detail-widget .fieldValue:hover .clipboard,
.listViewEntries .listViewEntryValue:hover .clipboard {
position: absolute;
}
.listViewEntries .listViewEntryValue:hover .clipboard {
right: 11px;
}
.c-detail-widget .fieldValue:hover .clipboard {
right: 36px;
}
}
.listViewContentDiv {
position: relative;
Expand Down