21 print
"Error, template page can't be called as URL";
25$objectUrl =
$object->getNomUrl(0,
'',
'0', 1);
26if (
$object->element ==
'propal') {
27 $objectUrl = DOL_URL_ROOT.
'/comm/propal/card.php?id='.
$object->id;
32<!-- START TEMPLATE IMPORT OBJECT LINKED LINES -->
36 $(document).on(
'click',
'.objectlinked_importbtn',
function(e) {
38 var page = $(
this).attr(
"href");
40 var fromelement = $(
this).attr(
"data-element");
41 var fromelementid = $(
this).attr(
"data-id");
43 if( page != undefined && fromelement != undefined && fromelementid != undefined)
45 var windowWidth = $(window).width()*0.8;
46 var windowHeight = $(window).height()*0.8;
48 var formId =
"ajaxloaded_tablelinesform_" + fromelement +
"_" + fromelementid;
49 $.get(page,
function (data) {
50 htmlLines = $(data).find(
'#tablelines') ;
54 var $dialog = $(
'<form id="' + formId +
'" action="<?php print $objectUrl; ?>" method="post" ></form>')
55 .load( page +
" #tablelines",
function() {
57 $(
"#" + formId +
" #tablelines").prop(
"id",
"ajaxloaded_tablelines");
59 $(
"#" + formId +
" .linecheckbox,#" + formId +
" .linecheckboxtoggle").prop(
"checked",
true);
62 $(
"#" + formId +
" .linecheckboxtoggle").click(
function(){
63 var checkBoxes = $(
"#" + formId +
" .linecheckbox");
64 checkBoxes.prop(
"checked", this.checked);
75 title:
"<?php echo $langs->transnoentities('LinesToImport'); ?>",
77 "<?php echo $langs->trans('Import'); ?>":
function() {
78 $(
this ).dialog(
"close" );
79 $(
"#" + formId).append(
'<input type="hidden" name="action" value="import_lines_from_object" />');
80 $(
"#" + formId).append(
'<input type="hidden" name="fromelement" value="' + fromelement +
'" />');
81 $(
"#" + formId).append(
'<input type="hidden" name="token" value="<?php print dol_escape_htmltag(newToken()); ?>" />');
82 $(
"#" + formId).append(
'<input type="hidden" name="fromelementid" value="' + fromelementid +
'" />');
83 $(
"#" + formId).trigger(
'submit');
85 "<?php echo $langs->trans("Cancel
"); ?>":
function() {
86 $(
this ).dialog(
"close" );
91 $dialog.dialog(
'open');
95 $.jnotify(
"<?php echo $langs->trans('ErrorNoUrl'); ?>",
"error",
true);
106<style
type=
"text/css">
107.objectlinked_importbtn{
111<!-- END TEMPLATE IMPORT OBJECT LINKED LINES -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type