Enhance the virtual business card feature
This commit is contained in:
parent
19bfb021e1
commit
83727d08ba
@ -202,45 +202,53 @@ print '</tr>';
|
||||
print '<tr>';
|
||||
print '<td class="tdtop nopaddingleftimp">';
|
||||
|
||||
print '<div class="centpercent center"><a id="lnk" href="javascript:hideoptions()"> '.$langs->trans("ShowAdvancedOptions").'...</a></div>';
|
||||
print '<div class="centpercent center margintoponly marginbottomonly">';
|
||||
print img_picto('', 'setup', 'class="pictofixedwidth"').'<a id="lnk">'.$langs->trans("ShowAdvancedOptions").'...</a>';
|
||||
print '</div>';
|
||||
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#lnk").click(function() {
|
||||
console.log("We click on link");
|
||||
hideoptions(this);
|
||||
});
|
||||
});
|
||||
|
||||
function hideoptions(){
|
||||
const lnk = document.getElementById("lnk");
|
||||
function hideoptions(domelem) {
|
||||
const div = document.getElementById("div_container_sub_exportoptions");
|
||||
|
||||
if (div.style.display === "none") {
|
||||
div.style.display = "block";
|
||||
lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("HideAdvancedoptions")).'";
|
||||
domelem.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("HideAdvancedoptions")).'";
|
||||
} else {
|
||||
div.style.display = "none";
|
||||
lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("ShowAdvancedOptions")).'...";
|
||||
domelem.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("ShowAdvancedOptions")).'...";
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
|
||||
|
||||
print '<div id="div_container_sub_exportoptions" style="display: none;">';
|
||||
print '<br>';
|
||||
|
||||
if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
print "<!-- Fieldset mysqldump -->\n";
|
||||
print '<fieldset id="mysql_options"><legend>'.$langs->trans("MySqlExportParameters").'</legend>';
|
||||
print '<fieldset id="mysql_options">';
|
||||
|
||||
print '<div class="formelementrow">'.$langs->trans("FullPathToMysqldumpCommand");
|
||||
print '<fieldset class="formelementrow"><legend>'.$langs->trans("FullPathToMysqldumpCommand").'</legend>';
|
||||
if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP)) {
|
||||
$fullpathofmysqldump = $db->getPathOfDump();
|
||||
} else {
|
||||
$fullpathofmysqldump = $conf->global->SYSTEMTOOLS_MYSQLDUMP;
|
||||
}
|
||||
print '<br>';
|
||||
print '<input type="text" name="mysqldump" style="width: 80%" value="'.$fullpathofmysqldump.'" /></div>';
|
||||
print '<input type="text" name="mysqldump" style="width: 80%" value="'.$fullpathofmysqldump.'">';
|
||||
print '</fieldset>';
|
||||
|
||||
print '<br>';
|
||||
print '<fieldset><legend>'.$langs->trans("ExportOptions").'</legend>';
|
||||
|
||||
if (!empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
|
||||
print '<div class="formelementrow">';
|
||||
print '<input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" checked />';
|
||||
print '<input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" checked>';
|
||||
print '<label for="checkbox_disable_fk">'.$langs->trans("CommandsToDisableForeignKeysForImport").' '.img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')).'</label>';
|
||||
print '</div>';
|
||||
}
|
||||
@ -261,7 +269,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
print '<br><br>';
|
||||
|
||||
print '<div class="formelementrow">';
|
||||
print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" checked="checked" />';
|
||||
print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" checked="checked">';
|
||||
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
|
||||
print '</div>';
|
||||
|
||||
@ -340,16 +348,19 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
|
||||
print '</fieldset>';
|
||||
print '</fieldset>';
|
||||
|
||||
// Export mysql bin
|
||||
print "<!-- Fieldset mysql_nobin -->\n";
|
||||
print '<fieldset id="mysql_nobin_options">';
|
||||
print '<legend>'.$langs->trans("MySqlExportParameters").'</legend>';
|
||||
|
||||
print '<fieldset>';
|
||||
print '<legend>'.$langs->trans("ExportOptions").'</legend>';
|
||||
|
||||
print '<div class="formelementrow">';
|
||||
print '<input type="checkbox" name="nobin_use_transaction" value="yes" id="checkbox_use_transaction" />';
|
||||
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (!empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
|
||||
print '<div class="formelementrow">';
|
||||
print '<input type="checkbox" name="nobin_disable_fk" value="yes" id="checkbox_disable_fk" checked />';
|
||||
@ -391,16 +402,18 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
|
||||
if (in_array($type, array('pgsql'))) {
|
||||
print "<!-- Fieldset pg_dump -->\n";
|
||||
print '<fieldset id="postgresql_options"><legend>'.$langs->trans("PostgreSqlExportParameters").'</legend>';
|
||||
print '<fieldset id="postgresql_options">';
|
||||
|
||||
print '<div class="formelementrow">'.$langs->trans("FullPathToPostgreSQLdumpCommand");
|
||||
|
||||
print '<fieldset class="formelementrow"><legend>'.$langs->trans("FullPathToPostgreSQLdumpCommand").'</legend>';
|
||||
if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP)) {
|
||||
$fullpathofpgdump = $db->getPathOfDump();
|
||||
} else {
|
||||
$fullpathofpgdump = $conf->global->SYSTEMTOOLS_POSTGRESQLDUMP;
|
||||
}
|
||||
print '<br>';
|
||||
print '<input type="text" name="postgresqldump" style="width: 80%" value="'.$fullpathofpgdump.'" /></div>';
|
||||
print '<input type="text" name="postgresqldump" style="width: 80%" value="'.$fullpathofpgdump.'" />';
|
||||
print '</fieldset>';
|
||||
|
||||
print '<br>';
|
||||
print '<fieldset>';
|
||||
@ -446,7 +459,7 @@ print '</table>';
|
||||
print '<!--<fieldset>';
|
||||
print '<legend>'.$langs->trans("Destination").'</legend> -->';
|
||||
print '<br>';
|
||||
print '<label for="filename_template" class="line-height-large">'.$langs->trans("FileNameToGenerate").'</label>';
|
||||
print '<label for="filename_template" class="line-height-large opacitymedium">'.$langs->trans("FileNameToGenerate").'</label>';
|
||||
print '<br>';
|
||||
$prefix = 'dump';
|
||||
$ext = '.sql';
|
||||
@ -614,7 +627,7 @@ print '<div id="backupfilesleft" class="fichehalfleft">';
|
||||
|
||||
print load_fiche_titre($title);
|
||||
|
||||
print '<label for="zipfilename_template" class="line-height-large paddingbottom">'.$langs->trans("FileNameToGenerate").'</label><br>';
|
||||
print '<label for="zipfilename_template" class="line-height-large paddingbottom opacitymedium">'.$langs->trans("FileNameToGenerate").'</label><br>';
|
||||
$prefix = 'documents';
|
||||
$ext = 'zip';
|
||||
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.dol_print_date(dol_now('gmt'), "dayhourlogsmall", 'tzuser');
|
||||
|
||||
@ -1223,5 +1223,6 @@ AddToContacts=Add address to my contacts
|
||||
LastAccess=Last access
|
||||
UploadAnImageToSeeAPhotoHere=Upload an image from the tab %s to see a photo here
|
||||
LastPasswordChangeDate=Last password change date
|
||||
PublicVirtualCardUrl=Virtual business card page
|
||||
PublicVirtualCardUrl=Virtual business card page URL
|
||||
PublicVirtualCard=Virtual business card
|
||||
TreeView=Tree view
|
||||
|
||||
@ -205,7 +205,7 @@ $arrayofjs = array();
|
||||
$arrayofcss = array();
|
||||
|
||||
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
||||
llxHeader($head, $langs->trans("UserProfile").' '.$object->getFullName($langs), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1, 1);
|
||||
llxHeader($head, $object->getFullName($langs).' - '.$langs->trans("PublicVirtualCard"), '', '', 0, 0, '', '', '', 'onlinepaymentbody'.(GETPOST('mode')=='preview' ? ' scalepreview nopointervent' : ''), $replacemainarea, 1, 1);
|
||||
|
||||
print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div class="center">'."\n";
|
||||
|
||||
@ -7538,6 +7538,33 @@ div.clipboardCPValue.hidewithsize {
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Virtual business card */
|
||||
/* ============================================================================== */
|
||||
|
||||
.virtualcard-div {
|
||||
overflow: hidden;
|
||||
vertical-align: top;
|
||||
/* background: #aaa; */
|
||||
}
|
||||
|
||||
#virtualcard-iframe {
|
||||
border: 40px solid #aaa;
|
||||
vertical-align: top;
|
||||
width: 10%;
|
||||
min-width: 100px;
|
||||
border-radius: 10px;
|
||||
aspect-ratio: 0.6;
|
||||
}
|
||||
.nopointervent {
|
||||
pointer-events: none;
|
||||
}
|
||||
.scalepreview {
|
||||
/* transform: scale(0.5); */
|
||||
zoom: 0.20;
|
||||
/* filter: blur(4px); */
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* CSS style used for small screen */
|
||||
|
||||
@ -7440,6 +7440,33 @@ div.clipboardCPValue.hidewithsize {
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Virtual business card */
|
||||
/* ============================================================================== */
|
||||
|
||||
.virtualcard-div {
|
||||
overflow: hidden;
|
||||
vertical-align: top;
|
||||
/* background: #aaa; */
|
||||
}
|
||||
|
||||
#virtualcard-iframe {
|
||||
border: 40px solid #aaa;
|
||||
vertical-align: top;
|
||||
width: 10%;
|
||||
min-width: 100px;
|
||||
border-radius: 10px;
|
||||
aspect-ratio: 0.6;
|
||||
}
|
||||
.nopointervent {
|
||||
pointer-events: none;
|
||||
}
|
||||
.scalepreview {
|
||||
/* transform: scale(0.5); */
|
||||
zoom: 0.20;
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* CSS style used for small screen */
|
||||
/* ============================================================================== */
|
||||
|
||||
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array("users", "companies"));
|
||||
$langs->loadLangs(array("users", "companies", "admin", "website"));
|
||||
|
||||
// Security check
|
||||
$id = GETPOST('id', 'int');
|
||||
@ -129,14 +129,6 @@ print '<div class="fichecenter">';
|
||||
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
|
||||
print '<hr>';
|
||||
//print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
*/
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("UserPublicPageDesc").'</span><br><br>';
|
||||
|
||||
$param = '&id='.((int) $object->id);
|
||||
@ -160,12 +152,16 @@ print '<input type="hidden" id="USER_ENABLE_PUBLIC" name="USER_ENABLE_PUBLIC" va
|
||||
print '<br><br>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
//print $langs->trans('FollowingLinksArePublic').'<br>';
|
||||
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('PublicVirtualCardUrl').'</span><br>';
|
||||
|
||||
@ -173,11 +169,41 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
|
||||
print '<div class="urllink">';
|
||||
print '<input type="text" id="publicurluser" class="quatrevingtpercentminusx" value="'.$fullexternaleurltovirtualcard.'">';
|
||||
print '<a target="_blank" rel="noopener noreferrer" href="'.$fullexternaleurltovirtualcard.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
print '<a target="_blank" rel="noopener noreferrer" href="'.$fullexternaleurltovirtualcard.'">'.img_picto('', 'globe', 'class="paddingleft marginrightonly paddingright"').$langs->trans("GoTo").'...</a>';
|
||||
print '</div>';
|
||||
print ajax_autoselect('publicurluser');
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
// Show/Hide options
|
||||
print '<div class="centpercent margintoponly marginbottomonly">';
|
||||
print img_picto('', 'setup', 'class="pictofixedwidth"').'<a id="lnk" href="#">'.$langs->trans("ShowAdvancedOptions").'...</a>';
|
||||
print '</div>';
|
||||
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#lnk").click(function() {
|
||||
console.log("We click on link");
|
||||
hideoptions(this);
|
||||
});
|
||||
});
|
||||
|
||||
function hideoptions(domelem) {
|
||||
const div = document.getElementById("div_container_sub_exportoptions");
|
||||
|
||||
if (div.style.display === "none") {
|
||||
div.style.display = "block";
|
||||
domelem.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("HideAdvancedoptions")).'";
|
||||
} else {
|
||||
div.style.display = "none";
|
||||
domelem.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("ShowAdvancedOptions")).'...";
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
|
||||
// Start div hide/Show
|
||||
print '<div id="div_container_sub_exportoptions" style="display: none;">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
@ -273,19 +299,33 @@ if (getDolUserInt('USER_ENABLE_PUBLIC', 0, $object)) {
|
||||
print '<div class="center">';
|
||||
print $form->buttonsSaveCancel("Save", ($dol_openinpopup ? "Cancel" : ""), array(), 0, '', $dol_openinpopup);
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '</div>'; // End hide/show
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Preview
|
||||
print '<div class="center">';
|
||||
print '<span class="opacitymedium">'.$langs->trans("Preview").'</span><br>';
|
||||
print '<div class="virtualcard-div">';
|
||||
print '<a target="_blank" rel="noopener noreferrer" href="'.$fullexternaleurltovirtualcard.'">';
|
||||
print '<iframe id="virtualcard-iframe" title="" class="center" src="'.$fullexternaleurltovirtualcard.'&mode=preview">';
|
||||
print '</iframe>';
|
||||
print '</a>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user