19if (empty($conf) || !is_object($conf)) {
20 print
"Error, template page can't be called as URL";
24$objectUrl = $object->getNomUrl(0,
'', 0, 1);
25if ($object->element ==
'propal') {
26 $objectUrl = DOL_URL_ROOT.
'/comm/propal/card.php?id='.$object->id;
31<!-- START TEMPLATE IMPORT OBJECT LINKED LINES -->
34$(document).ready(
function(){
35 $(
'.objectlinked_importbtn').click(
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="fromelementid" value="' + fromelementid +
'" />');
82 $(
"#" + formId).submit();
84 "<?php echo $langs->trans("Cancel
"); ?>":
function() {
85 $(
this ).dialog(
"close" );
90 $dialog.dialog(
'open');
94 $.jnotify(
"<?php echo $langs->trans('ErrorNoUrl'); ?>",
"error",
true);
105<style
type=
"text/css">
106.objectlinked_importbtn{
110<!-- END TEMPLATE IMPORT OBJECT LINKED LINES -->
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type