forked from Wavyzz/dolibarr
Better tooltip on some setup pages
This commit is contained in:
@@ -48,18 +48,23 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
$helptext = '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||||
|
$helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';
|
||||||
|
$helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ';
|
||||||
|
//$helptext.='__YEAR__, __MONTH__, __DAY__'; // Not supported
|
||||||
|
|
||||||
// Editing global variables not related to a specific theme
|
// Editing global variables not related to a specific theme
|
||||||
$constantes = array(
|
$constantes = array(
|
||||||
'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))),
|
'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))),
|
||||||
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member',
|
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>array('type'=>'emailtemplate:member'),
|
||||||
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_AUTOREGISTER_MAIL
|
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>array('type'=>'emailtemplate:member'),
|
||||||
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_VALID
|
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>array('type'=>'emailtemplate:member'),
|
||||||
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_COTIS
|
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>array('type'=>'emailtemplate:member'),
|
||||||
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', // until Dolibarr 7 it was ADHERENT_MAIL_RESIL
|
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>array('type'=>'emailtemplate:member'),
|
||||||
'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>'emailtemplate:member',
|
'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>array('type'=>'emailtemplate:member'),
|
||||||
'ADHERENT_MAIL_FROM' =>'string',
|
'ADHERENT_MAIL_FROM' =>array('type'=>'string'),
|
||||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' =>'string',
|
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' =>array('type'=>'string'),
|
||||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL' =>'html',
|
'ADHERENT_AUTOREGISTER_NOTIF_MAIL' =>array('type'=>'html', 'tooltip'=>$helptext)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -147,12 +152,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="updateall">';
|
print '<input type="hidden" name="action" value="updateall">';
|
||||||
|
|
||||||
$helptext = '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
form_constantes($constantes, 3, '');
|
||||||
$helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';
|
|
||||||
$helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ';
|
|
||||||
//$helptext.='__YEAR__, __MONTH__, __DAY__'; // Not supported
|
|
||||||
|
|
||||||
form_constantes($constantes, 3, $helptext);
|
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@@ -1716,7 +1716,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Show constant
|
// Show label of parameter
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (empty($strictw3c)) {
|
if (empty($strictw3c)) {
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
@@ -1725,8 +1725,11 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu
|
|||||||
print '<input type="hidden" name="constname'.(empty($strictw3c) ? '' : '[]').'" value="'.$const.'">';
|
print '<input type="hidden" name="constname'.(empty($strictw3c) ? '' : '[]').'" value="'.$const.'">';
|
||||||
print '<input type="hidden" name="constnote_'.$obj->name.'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
|
print '<input type="hidden" name="constnote_'.$obj->name.'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
|
||||||
print '<input type="hidden" name="consttype_'.$obj->name.'" value="'.($obj->type ? $obj->type : 'string').'">';
|
print '<input type="hidden" name="consttype_'.$obj->name.'" value="'.($obj->type ? $obj->type : 'string').'">';
|
||||||
|
if (!empty($tableau[$key]['tooltip'])) {
|
||||||
print ($label ? $label : $langs->trans('Desc'.$const));
|
print $form->textwithpicto($label ? $label : $langs->trans('Desc'.$const), $tableau[$key]['tooltip']);
|
||||||
|
} else {
|
||||||
|
print ($label ? $label : $langs->trans('Desc'.$const));
|
||||||
|
}
|
||||||
|
|
||||||
if ($const == 'ADHERENT_MAILMAN_URL') {
|
if ($const == 'ADHERENT_MAILMAN_URL') {
|
||||||
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick1">'.img_down().'</a><br>';
|
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick1">'.img_down().'</a><br>';
|
||||||
|
|||||||
@@ -7642,16 +7642,17 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false)
|
|||||||
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are trunc and html sanitized (to use for help tooltip)
|
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are trunc and html sanitized (to use for help tooltip)
|
||||||
* @param array $exclude Array of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
* @param array $exclude Array of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||||
* @param Object $object Object for keys on object
|
* @param Object $object Object for keys on object
|
||||||
|
* @param array $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||||
* @return array Array of substitutions
|
* @return array Array of substitutions
|
||||||
* @see setSubstitFromObject()
|
* @see setSubstitFromObject()
|
||||||
*/
|
*/
|
||||||
function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $object = null)
|
function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $object = null, $include = null)
|
||||||
{
|
{
|
||||||
global $db, $conf, $mysoc, $user, $extrafields;
|
global $db, $conf, $mysoc, $user, $extrafields;
|
||||||
|
|
||||||
$substitutionarray = array();
|
$substitutionarray = array();
|
||||||
|
|
||||||
if (empty($exclude) || !in_array('user', $exclude)) {
|
if ((empty($exclude) || !in_array('user', $exclude)) && (empty($include) || in_array('user', $include))) {
|
||||||
// Add SIGNATURE into substitutionarray first, so, when we will make the substitution,
|
// Add SIGNATURE into substitutionarray first, so, when we will make the substitution,
|
||||||
// this will include signature content first and then replace var found into content of signature
|
// this will include signature content first and then replace var found into content of signature
|
||||||
//var_dump($onlykey);
|
//var_dump($onlykey);
|
||||||
@@ -7680,7 +7681,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((empty($exclude) || !in_array('mycompany', $exclude)) && is_object($mysoc)) {
|
if ((empty($exclude) || !in_array('mycompany', $exclude)) && is_object($mysoc) && (empty($include) || in_array('mycompany', $include))) {
|
||||||
$substitutionarray = array_merge($substitutionarray, array(
|
$substitutionarray = array_merge($substitutionarray, array(
|
||||||
'__MYCOMPANY_NAME__' => $mysoc->name,
|
'__MYCOMPANY_NAME__' => $mysoc->name,
|
||||||
'__MYCOMPANY_EMAIL__' => $mysoc->email,
|
'__MYCOMPANY_EMAIL__' => $mysoc->email,
|
||||||
@@ -7704,7 +7705,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($onlykey || is_object($object)) && (empty($exclude) || !in_array('object', $exclude))) {
|
if (($onlykey || is_object($object)) && (empty($exclude) || !in_array('object', $exclude)) && (empty($include) || in_array('object', $include))) {
|
||||||
if ($onlykey) {
|
if ($onlykey) {
|
||||||
$substitutionarray['__ID__'] = '__ID__';
|
$substitutionarray['__ID__'] = '__ID__';
|
||||||
$substitutionarray['__REF__'] = '__REF__';
|
$substitutionarray['__REF__'] = '__REF__';
|
||||||
@@ -7738,7 +7739,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__';
|
$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__';
|
||||||
$substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__';
|
$substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__';
|
||||||
}
|
}
|
||||||
if (isModEnabled('adherent') && (!is_object($object) || $object->element == 'adherent')) {
|
if (isModEnabled('adherent') && (!is_object($object) || $object->element == 'adherent') && (empty($exclude) || !in_array('member', $exclude)) && (empty($include) || in_array('member', $include))) {
|
||||||
$substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__';
|
$substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__';
|
||||||
$substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__';
|
$substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__';
|
||||||
$substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__';
|
$substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__';
|
||||||
@@ -7748,7 +7749,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/
|
$substitutionarray['__MEMBER_NOTE_PRIVATE__'] = '__MEMBER_NOTE_PRIVATE__';*/
|
||||||
}
|
}
|
||||||
// add variables subtitutions ticket
|
// add variables subtitutions ticket
|
||||||
if (isModEnabled('ticket') && (!is_object($object) || $object->element == 'ticket')) {
|
if (isModEnabled('ticket') && (!is_object($object) || $object->element == 'ticket') && (empty($exclude) || !in_array('ticket', $exclude)) && (empty($include) || in_array('ticket', $include))) {
|
||||||
$substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__';
|
$substitutionarray['__TICKET_TRACKID__'] = '__TICKET_TRACKID__';
|
||||||
$substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__';
|
$substitutionarray['__TICKET_SUBJECT__'] = '__TICKET_SUBJECT__';
|
||||||
$substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__';
|
$substitutionarray['__TICKET_TYPE__'] = '__TICKET_TYPE__';
|
||||||
@@ -7760,28 +7761,28 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__TICKET_USER_ASSIGN__'] = '__TICKET_USER_ASSIGN__';
|
$substitutionarray['__TICKET_USER_ASSIGN__'] = '__TICKET_USER_ASSIGN__';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isModEnabled('recruitment') && (!is_object($object) || $object->element == 'recruitmentcandidature')) {
|
if (isModEnabled('recruitment') && (!is_object($object) || $object->element == 'recruitmentcandidature') && (empty($exclude) || !in_array('recruitment', $exclude)) && (empty($include) || in_array('recruitment', $include))) {
|
||||||
$substitutionarray['__CANDIDATE_FULLNAME__'] = '__CANDIDATE_FULLNAME__';
|
$substitutionarray['__CANDIDATE_FULLNAME__'] = '__CANDIDATE_FULLNAME__';
|
||||||
$substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__';
|
$substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__';
|
||||||
$substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__';
|
$substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__';
|
||||||
}
|
}
|
||||||
if (isModEnabled('project')) { // Most objects
|
if (isModEnabled('project') && (empty($exclude) || !in_array('project', $exclude)) && (empty($include) || in_array('project', $include))) { // Most objects
|
||||||
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
|
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
|
||||||
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
|
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
|
||||||
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__';
|
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__';
|
||||||
/*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__';
|
/*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__';
|
||||||
$substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/
|
$substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/
|
||||||
}
|
}
|
||||||
if (isModEnabled('contrat') && (!is_object($object) || $object->element == 'contract')) {
|
if (isModEnabled('contrat') && (!is_object($object) || $object->element == 'contract') && (empty($exclude) || !in_array('contract', $exclude)) && (empty($include) || in_array('contract', $include))) {
|
||||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start';
|
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start';
|
||||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start';
|
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start';
|
||||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';
|
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';
|
||||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service';
|
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service';
|
||||||
}
|
}
|
||||||
if (isModEnabled("propal") && (!is_object($object) || $object->element == 'propal')) {
|
if (isModEnabled("propal") && (!is_object($object) || $object->element == 'propal') && (empty($exclude) || !in_array('propal', $exclude)) && (empty($include) || in_array('propal', $include))) {
|
||||||
$substitutionarray['__ONLINE_SIGN_URL__'] = 'ToOfferALinkForOnlineSignature';
|
$substitutionarray['__ONLINE_SIGN_URL__'] = 'ToOfferALinkForOnlineSignature';
|
||||||
}
|
}
|
||||||
if (isModEnabled("ficheinter") && (!is_object($object) || $object->element == 'fichinter')) {
|
if (isModEnabled("ficheinter") && (!is_object($object) || $object->element == 'fichinter') && (empty($exclude) || !in_array('intervention', $exclude)) && (empty($include) || in_array('intervention', $include))) {
|
||||||
$substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = 'ToOfferALinkForOnlineSignature';
|
$substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = 'ToOfferALinkForOnlineSignature';
|
||||||
}
|
}
|
||||||
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
|
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
|
||||||
@@ -8119,7 +8120,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($exclude) || !in_array('objectamount', $exclude)) {
|
if ((empty($exclude) || !in_array('objectamount', $exclude)) && (empty($include) || in_array('objectamount', $include))) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php';
|
||||||
|
|
||||||
$substitutionarray['__DATE_YMD__'] = is_object($object) ? (isset($object->date) ? dol_print_date($object->date, 'day', 0, $outputlangs) : null) : '';
|
$substitutionarray['__DATE_YMD__'] = is_object($object) ? (isset($object->date) ? dol_print_date($object->date, 'day', 0, $outputlangs) : null) : '';
|
||||||
@@ -8175,7 +8176,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($substitutionarray['__AMOUNT_FORMATED__']);
|
//var_dump($substitutionarray['__AMOUNT_FORMATED__']);
|
||||||
if (empty($exclude) || !in_array('date', $exclude)) {
|
if ((empty($exclude) || !in_array('date', $exclude)) && (empty($include) || in_array('date', $include))) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
@@ -8212,7 +8213,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
if (isModEnabled('multicompany')) {
|
if (isModEnabled('multicompany')) {
|
||||||
$substitutionarray = array_merge($substitutionarray, array('__ENTITY_ID__' => $conf->entity));
|
$substitutionarray = array_merge($substitutionarray, array('__ENTITY_ID__' => $conf->entity));
|
||||||
}
|
}
|
||||||
if (empty($exclude) || !in_array('system', $exclude)) {
|
if ((empty($exclude) || !in_array('system', $exclude)) && (empty($include) || in_array('user', $include))) {
|
||||||
$substitutionarray['__DOL_MAIN_URL_ROOT__'] = DOL_MAIN_URL_ROOT;
|
$substitutionarray['__DOL_MAIN_URL_ROOT__'] = DOL_MAIN_URL_ROOT;
|
||||||
$substitutionarray['__(AnyTranslationKey)__'] = $outputlangs->trans('TranslationOfKey');
|
$substitutionarray['__(AnyTranslationKey)__'] = $outputlangs->trans('TranslationOfKey');
|
||||||
$substitutionarray['__(AnyTranslationKey|langfile)__'] = $outputlangs->trans('TranslationOfKey').' (load also language file before)';
|
$substitutionarray['__(AnyTranslationKey|langfile)__'] = $outputlangs->trans('TranslationOfKey').' (load also language file before)';
|
||||||
|
|||||||
@@ -744,12 +744,13 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height)
|
|||||||
* @param Translate $outputlangs Output language
|
* @param Translate $outputlangs Output language
|
||||||
* @param array $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...)
|
* @param array $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...)
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip)
|
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip)
|
||||||
|
* @param array $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
|
||||||
* @return array Array of substitutions
|
* @return array Array of substitutions
|
||||||
*/
|
*/
|
||||||
function pdf_getSubstitutionArray($outputlangs, $exclude = null, $object = null, $onlykey = 0)
|
function pdf_getSubstitutionArray($outputlangs, $exclude = null, $object = null, $onlykey = 0, $include = null)
|
||||||
{
|
{
|
||||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, $onlykey, $exclude, $object);
|
$substitutionarray = getCommonSubstitutionArray($outputlangs, $onlykey, $exclude, $object, $include);
|
||||||
$substitutionarray['__FROM_NAME__'] = '__FROM_NAME__';
|
$substitutionarray['__FROM_NAME__'] = '__FROM_NAME__';
|
||||||
$substitutionarray['__FROM_EMAIL__'] = '__FROM_EMAIL__';
|
$substitutionarray['__FROM_EMAIL__'] = '__FROM_EMAIL__';
|
||||||
return $substitutionarray;
|
return $substitutionarray;
|
||||||
|
|||||||
@@ -109,8 +109,9 @@ print ajax_constantonoff("TAKEPOS_TICKET_VAT_GROUPPED", array(), $conf->entity,
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "browser" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
|
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "browser" || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") {
|
||||||
$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
|
$substitutionarray = pdf_getSubstitutionArray($langs, array('ticket', 'member', 'candidate'), null, 2, array('company', 'user', 'object', 'system'));
|
||||||
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
|
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
|
||||||
|
|
||||||
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||||
foreach ($substitutionarray as $key => $val) {
|
foreach ($substitutionarray as $key => $val) {
|
||||||
$htmltext .= $key.'<br>';
|
$htmltext .= $key.'<br>';
|
||||||
@@ -162,14 +163,6 @@ if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "browser" || getDolGlobalStrin
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto print tickets
|
|
||||||
print '<tr class="oddeven"><td>';
|
|
||||||
print $langs->trans("AutoPrintTickets");
|
|
||||||
print '<td colspan="2">';
|
|
||||||
print ajax_constantonoff("TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0);
|
|
||||||
print "</td></tr>\n";
|
|
||||||
|
|
||||||
|
|
||||||
// Show price without vat
|
// Show price without vat
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $langs->trans('ShowPriceHTOnReceipt');
|
print $langs->trans('ShowPriceHTOnReceipt');
|
||||||
@@ -207,6 +200,14 @@ if (getDolGlobalString('TAKEPOS_PRINT_WITHOUT_DETAILS')) {
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Auto print tickets
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $langs->trans("AutoPrintTickets");
|
||||||
|
print '<td colspan="2">';
|
||||||
|
print ajax_constantonoff("TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
* \brief Page to show a receipt.
|
* \brief Page to show a receipt.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Includes
|
||||||
if (!isset($action)) {
|
if (!isset($action)) {
|
||||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language
|
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language
|
||||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language
|
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language
|
||||||
@@ -57,7 +58,7 @@ $facid = GETPOST('facid', 'int');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$gift = GETPOST('gift', 'int');
|
$gift = GETPOST('gift', 'int');
|
||||||
|
|
||||||
if (empty($user->rights->takepos->run)) {
|
if (!$user->hasRight('takepos', 'run')) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user