Print IPP
This commit is contained in:
parent
e01a55876b
commit
9c8a9ff7dc
@ -1673,6 +1673,14 @@ else if ($action == 'remove_file')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print file
|
||||||
|
else if ($action == 'print_file' AND $user->rights->printipp->use)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php';
|
||||||
|
$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
|
||||||
|
$printer->print_file(GETPOST('file',alpha),GETPOST('printer',alpha));
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer)
|
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
if ($action == 'addcontact')
|
if ($action == 'addcontact')
|
||||||
@ -3421,9 +3429,11 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$object->id;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$object->id;
|
||||||
$genallowed=$user->rights->facture->creer;
|
$genallowed=$user->rights->facture->creer;
|
||||||
$delallowed=$user->rights->facture->supprimer;
|
$delallowed=$user->rights->facture->supprimer;
|
||||||
|
$printer = false;
|
||||||
|
if ($user->rights->printipp->use AND $conf->printipp->enabled) $printer = true;
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$printer);
|
||||||
$somethingshown=$formfile->numoffiles;
|
$somethingshown=$formfile->numoffiles;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -138,10 +138,33 @@ class dolprintIPP
|
|||||||
$ipp->setPrinterURI("ipp://localhost:631/printers/");
|
$ipp->setPrinterURI("ipp://localhost:631/printers/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo 'Jobs for : '.$this->userid.' module : '.$module.' Printer : '.$obj->printer_name.'<br />';
|
// Getting Jobs
|
||||||
echo "Getting Jobs: ".$ipp->getJobs(true,3,"completed",true)."<br />";
|
$ipp->getJobs(false,0,'completed',false);
|
||||||
|
print '<table width="100%" class="noborder">';
|
||||||
echo "<pre>";print_r($ipp->jobs_attributes); echo "</pre>";
|
print '<tr class="liste_titre">';
|
||||||
|
print "<td>Id</td>";
|
||||||
|
print "<td>Owner</td>";
|
||||||
|
print "<td>Printer</td>";
|
||||||
|
print "<td>File</td>";
|
||||||
|
print "<td>Status</td>";
|
||||||
|
print "<td>Cancel</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
$jobs = $ipp->jobs_attributes;
|
||||||
|
$var = True;
|
||||||
|
//print '<pre>'.print_r($jobs,true).'</pre>';
|
||||||
|
foreach ($jobs as $value )
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr $bc[$var]>";
|
||||||
|
print '<td>'.$value->job_id->_value0.'</td>';
|
||||||
|
print '<td>'.$value->job_originating_user_name->_value0.'</td>';
|
||||||
|
print '<td>'.$value->printer_uri->_value0.'</td>';
|
||||||
|
print '<td>'.$value->job_name->_value0.'</td>';
|
||||||
|
print '<td>'.$value->job_state->_value0.'</td>';
|
||||||
|
print '<td>'.$value->job_uri->_value0.'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
print "</table>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user