Print IPP
This commit is contained in:
parent
33e6654454
commit
4c29eaecd1
@ -1103,11 +1103,13 @@ else if ($action == 'remove_file')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print file
|
// Print file
|
||||||
else if ($action == 'print_file' AND $user->rights->printipp->use)
|
else if ($action == 'print_file' AND $user->rights->printipp->read)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php';
|
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 = 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));
|
$printer->print_file(GETPOST('file',alpha),GETPOST('printer',alpha));
|
||||||
|
setEventMessage($langs->trans("FileWasSentToPrinter", GETPOST('file')));
|
||||||
|
$action='';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2363,7 +2365,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
|||||||
$genallowed=$user->rights->commande->creer;
|
$genallowed=$user->rights->commande->creer;
|
||||||
$delallowed=$user->rights->commande->supprimer;
|
$delallowed=$user->rights->commande->supprimer;
|
||||||
$printer = false;
|
$printer = false;
|
||||||
if ($user->rights->printipp->use AND $conf->printipp->enabled) $printer = true;
|
if ($user->rights->printipp->read AND $conf->printipp->enabled) $printer = true;
|
||||||
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$printer);
|
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$printer);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -1674,7 +1674,7 @@ else if ($action == 'remove_file')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print file
|
// Print file
|
||||||
else if ($action == 'print_file' AND $user->rights->printipp->use)
|
else if ($action == 'print_file' AND $user->rights->printipp->read)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php';
|
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 = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
|
||||||
@ -3430,7 +3430,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$genallowed=$user->rights->facture->creer;
|
$genallowed=$user->rights->facture->creer;
|
||||||
$delallowed=$user->rights->facture->supprimer;
|
$delallowed=$user->rights->facture->supprimer;
|
||||||
$printer = false;
|
$printer = false;
|
||||||
if ($user->rights->printipp->use AND $conf->printipp->enabled) $printer = true;
|
if ($user->rights->printipp->read 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,$printer);
|
print $formfile->showdocuments('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$printer);
|
||||||
|
|||||||
@ -95,7 +95,7 @@ class modPrintIPP extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Printer';
|
$this->rights[$r][1] = 'Printer';
|
||||||
$this->rights[$r][2] = 'r';
|
$this->rights[$r][2] = 'r';
|
||||||
$this->rights[$r][3] = 1;
|
$this->rights[$r][3] = 1;
|
||||||
$this->rights[$r][4] = 'use';
|
$this->rights[$r][4] = 'read';
|
||||||
|
|
||||||
// Main menu entries
|
// Main menu entries
|
||||||
$this->menus = array(); // List of menus to add
|
$this->menus = array(); // List of menus to add
|
||||||
@ -110,7 +110,7 @@ class modPrintIPP extends DolibarrModules
|
|||||||
'langs'=>'printipp', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
'langs'=>'printipp', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||||
'position'=>100,
|
'position'=>100,
|
||||||
'enabled'=>'$conf->printipp->enabled',
|
'enabled'=>'$conf->printipp->enabled',
|
||||||
'perms'=>'$user->rights->printipp->use', // Use 'perms'=>'1' if you want your menu with no permission rules
|
'perms'=>'$user->rights->printipp->read', // Use 'perms'=>'1' if you want your menu with no permission rules
|
||||||
'target'=>'',
|
'target'=>'',
|
||||||
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,12 @@ if (!$mode) $mode='config';
|
|||||||
if ($action == 'setvalue' && $user->admin)
|
if ($action == 'setvalue' && $user->admin)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
if (GETPOST('PRINTIPP_ENABLED','alpha') == '1') $result=dolibarr_set_const($db, "PRINTIPP_ENABLED",1,'yesno',0,'',$conf->entity);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$result=dolibarr_del_const($db, "PRINTIPP_ENABLED",$conf->entity);
|
||||||
|
}
|
||||||
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "PRINTIPP_HOST",GETPOST('PRINTIPP_HOST','alpha'),'chaine',0,'',$conf->entity);
|
$result=dolibarr_set_const($db, "PRINTIPP_HOST",GETPOST('PRINTIPP_HOST','alpha'),'chaine',0,'',$conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "PRINTIPP_PORT",GETPOST('PRINTIPP_PORT','alpha'),'chaine',0,'',$conf->entity);
|
$result=dolibarr_set_const($db, "PRINTIPP_PORT",GETPOST('PRINTIPP_PORT','alpha'),'chaine',0,'',$conf->entity);
|
||||||
@ -101,6 +107,27 @@ if ($mode=='config'&& $user->admin)
|
|||||||
print '<td>'.$langs->trans("Value").'</td>';
|
print '<td>'.$langs->trans("Value").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||||
|
print $langs->trans("PRINTIPP_ENABLED").'</td><td colspan="2" align="left">';
|
||||||
|
|
||||||
|
if (! empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print ajax_constantonoff('PRINTIPP_ENABLED');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (empty($conf->global->PRINTIPP_ENABLED))
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_PRINTIPP_ENABLED">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_PRINTIPP_ENABLED">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
print '<tr '.$bc[$var].'><td class="fieldrequired">';
|
||||||
print $langs->trans("PRINTIPP_HOST").'</td><td>';
|
print $langs->trans("PRINTIPP_HOST").'</td><td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user