19 if (empty($conf) || !is_object($conf))
21 print "Error, template page can't be called as URL";
25 $objectUrl = $object->getNomUrl(0,
'', 0, 1);
26 if ($object->element ==
'propal')
28 $objectUrl = DOL_URL_ROOT.
'/comm/propal/card.php?id='.$object->id;
33 <!-- START TEMPLATE IMPORT OBJECT LINKED LINES -->
36 $(document).ready(
function(){
37 $(
'.objectlinked_importbtn').click(
function (e) {
40 var page = $(
this).attr(
"href");
42 var fromelement = $(
this).attr(
"data-element");
43 var fromelementid = $(
this).attr(
"data-id");
45 if( page != undefined && fromelement != undefined && fromelementid != undefined)
47 var windowWidth = $(window).width()*0.8;
48 var windowHeight = $(window).height()*0.8;
50 var formId =
"ajaxloaded_tablelinesform_" + fromelement +
"_" + fromelementid;
51 $.get(page,
function (data) {
52 htmlLines = $(data).find(
'#tablelines') ;
56 var $dialog = $(
'<form id="' + formId +
'" action="<?php print $objectUrl; ?>" method="post" ></form>')
57 .load( page +
" #tablelines",
function() {
59 $(
"#" + formId +
" #tablelines").prop(
"id",
"ajaxloaded_tablelines");
61 $(
"#" + formId +
" .linecheckbox,#" + formId +
" .linecheckboxtoggle").prop(
"checked",
true);
64 $(
"#" + formId +
" .linecheckboxtoggle").click(
function(){
65 var checkBoxes = $(
"#" + formId +
" .linecheckbox");
66 checkBoxes.prop(
"checked", this.checked);
77 title:
"<?php echo $langs->transnoentities('LinesToImport'); ?>",
79 "<?php echo $langs->trans('Import'); ?>":
function() {
80 $( this ).dialog(
"close" );
81 $(
"#" + formId).append(
'<input type="hidden" name="action" value="import_lines_from_object" />');
82 $(
"#" + formId).append(
'<input type="hidden" name="fromelement" value="' + fromelement +
'" />');
83 $(
"#" + formId).append(
'<input type="hidden" name="fromelementid" value="' + fromelementid +
'" />');
84 $(
"#" + formId).submit();
86 "<?php echo $langs->trans("Cancel
"); ?>":
function() {
87 $( this ).dialog(
"close" );
92 $dialog.dialog(
'open');
96 $.jnotify(
"<?php echo $langs->trans('ErrorNoUrl'); ?>",
"error",
true);
107 <style
type=
"text/css">
108 .objectlinked_importbtn{
112 <!-- END TEMPLATE IMPORT OBJECT LINKED LINES -->
print
Draft customers invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type