mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
clean and update code
This commit is contained in:
parent
9315d9c423
commit
e5d8dec2f9
|
|
@ -30,8 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/receiptprinter.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("receiptprinter");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("admin","receiptprinter"));
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
|
@ -232,7 +232,6 @@ if ($mode == 'config' && $user->admin)
|
|||
print $langs->trans("ReceiptPrinterDesc")."<br><br>\n";
|
||||
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
$var=true;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Name").'</th>';
|
||||
print '<th>'.$langs->trans("Type").'</th>';
|
||||
|
|
@ -248,10 +247,11 @@ if ($mode == 'config' && $user->admin)
|
|||
if ($ret > 0) {
|
||||
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||
} else {
|
||||
for ($line=0; $line < $nbofprinters; $line++) {
|
||||
$var = !$var;
|
||||
for ($line=0; $line < $nbofprinters; $line++)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) {
|
||||
if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid)
|
||||
{
|
||||
print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
|
||||
print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
|
||||
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
|
||||
|
|
@ -329,11 +329,11 @@ if ($mode == 'config' && $user->admin)
|
|||
|
||||
print $langs->trans("ReceiptPrinterTypeDesc")."<br><br>\n";
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("CONNECTOR_DUMMY").':</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT").':</td><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("CONNECTOR_FILE_PRINT").':</td><td>'.$langs->trans("CONNECTOR_FILE_PRINT_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT").':</td><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT_HELP").'</td></tr>';
|
||||
//print '<tr '.$bc[1].'><td>'.$langs->trans("CONNECTOR_JAVA").':</td><td>'.$langs->trans("CONNECTOR_JAVA_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_DUMMY").':</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT").':</td><td>'.$langs->trans("CONNECTOR_NETWORK_PRINT_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_FILE_PRINT").':</td><td>'.$langs->trans("CONNECTOR_FILE_PRINT_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT").':</td><td>'.$langs->trans("CONNECTOR_WINDOWS_PRINT_HELP").'</td></tr>';
|
||||
//print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_JAVA").':</td><td>'.$langs->trans("CONNECTOR_JAVA_HELP").'</td></tr>';
|
||||
print '</table>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
|
@ -342,11 +342,11 @@ if ($mode == 'config' && $user->admin)
|
|||
dol_fiche_head();
|
||||
print $langs->trans("ReceiptPrinterProfileDesc")."<br><br>\n";
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("PROFILE_DEFAULT").':</td><td>'.$langs->trans("PROFILE_DEFAULT_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td>'.$langs->trans("PROFILE_SIMPLE").':</td><td>'.$langs->trans("PROFILE_SIMPLE_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("PROFILE_EPOSTEP").':</td><td>'.$langs->trans("PROFILE_EPOSTEP_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[0].'><td>'.$langs->trans("PROFILE_P822D").':</td><td>'.$langs->trans("PROFILE_P822D_HELP").'</td></tr>';
|
||||
print '<tr '.$bc[1].'><td>'.$langs->trans("PROFILE_STAR").':</td><td>'.$langs->trans("PROFILE_STAR_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_DEFAULT").':</td><td>'.$langs->trans("PROFILE_DEFAULT_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_SIMPLE").':</td><td>'.$langs->trans("PROFILE_SIMPLE_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_EPOSTEP").':</td><td>'.$langs->trans("PROFILE_EPOSTEP_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_P822D").':</td><td>'.$langs->trans("PROFILE_P822D_HELP").'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_STAR").':</td><td>'.$langs->trans("PROFILE_STAR_HELP").'</td></tr>';
|
||||
print '</table>';
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
|
@ -365,7 +365,6 @@ if ($mode == 'template' && $user->admin)
|
|||
|
||||
print $langs->trans("ReceiptPrinterTemplateDesc")."<br><br>\n";
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
$var=true;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Name").'</th>';
|
||||
print '<th>'.$langs->trans("Template").'</th>';
|
||||
|
|
@ -379,8 +378,8 @@ if ($mode == 'template' && $user->admin)
|
|||
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||
} else {
|
||||
$max = count($printer->listprinterstemplates);
|
||||
for ($line=0; $line < $max; $line++) {
|
||||
$var = !$var;
|
||||
for ($line=0; $line < $max; $line++)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) {
|
||||
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||
|
|
@ -419,14 +418,13 @@ if ($mode == 'template' && $user->admin)
|
|||
print '</form>';
|
||||
print '<div><p></div>';
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
$var=true;
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("Tag").'</th>';
|
||||
print '<th>'.$langs->trans("Description").'</th>';
|
||||
print "</tr>\n";
|
||||
$max = count($printer->tags);
|
||||
for ($tag=0; $tag < $max; $tag++) {
|
||||
$var = !$var;
|
||||
for ($tag=0; $tag < $max; $tag++)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><'.$printer->tags[$tag].'></td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php';
|
||||
if (! empty($conf->resouce->enabled)) require_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("resource");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("admin","resource"));
|
||||
|
||||
// Security check
|
||||
if (!$user->admin)
|
||||
|
|
@ -76,7 +76,6 @@ print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
|||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="updateoptions">';
|
||||
|
||||
$var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
|
||||
|
|
@ -85,7 +84,6 @@ print '<td></td>';
|
|||
|
||||
|
||||
// Utilisation formulaire Ajax sur choix produit
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="80%">'.$langs->trans("UseSearchToSelectResource").'</td>';
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
|
|
|
|||
|
|
@ -29,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
|||
|
||||
$action=GETPOST('action','aZ09');
|
||||
|
||||
$langs->load("users");
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("users","admin","other"));
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
|
@ -178,10 +177,6 @@ if ($action == 'maj_pattern')
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
|
@ -201,9 +196,6 @@ $head=security_prepare_head();
|
|||
dol_fiche_head($head, 'passwords', $langs->trans("Security"), -1);
|
||||
|
||||
|
||||
$var=false;
|
||||
|
||||
|
||||
// Choix du gestionnaire du generateur de mot de passe
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
|
@ -250,7 +242,6 @@ foreach ($arrayhandler as $key => $module)
|
|||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
$var = !$var;
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print ucfirst($key);
|
||||
print "</td><td>\n";
|
||||
|
|
@ -395,7 +386,6 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){
|
|||
|
||||
// Cryptage mot de passe
|
||||
print '<br>';
|
||||
$var=true;
|
||||
print "<form method=\"post\" action=\"" . $_SERVER["PHP_SELF"] . "\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"encrypt\">";
|
||||
|
|
|
|||
|
|
@ -28,9 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
$langs->load("users");
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("users","admin","other"));
|
||||
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
|
@ -107,8 +106,6 @@ dol_fiche_head($head, 'misc', $langs->trans("Security"), -1);
|
|||
|
||||
|
||||
// Other Options
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
|
||||
|
|
@ -116,7 +113,6 @@ print '<td align="right" width="100">'.$langs->trans("Status").'</td>';
|
|||
print '</tr>';
|
||||
|
||||
// Enable Captcha code
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="3">'.$langs->trans("UseCaptchaCode").'</td>';
|
||||
print '<td align="right">';
|
||||
|
|
@ -146,7 +142,6 @@ else
|
|||
print '</td></tr>';
|
||||
|
||||
// Enable advanced perms
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td colspan="3">'.$langs->trans("UseAdvancedPerms").'</td>';
|
||||
print '<td align="right">';
|
||||
|
|
@ -174,8 +169,6 @@ print '<br>';
|
|||
|
||||
|
||||
// Timeout
|
||||
$var=true;
|
||||
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
||||
|
|
|
|||
|
|
@ -25,12 +25,8 @@
|
|||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("products");
|
||||
$langs->load("admin");
|
||||
$langs->load("sms");
|
||||
$langs->load("other");
|
||||
$langs->load("errors");
|
||||
// Load traductions files requiredby by page
|
||||
$langs->loadLangs(array("companies","admin","products","sms","other","errors"));
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
|
@ -169,30 +165,25 @@ if ($action == 'edit')
|
|||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
clearstatcache();
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Disable
|
||||
|
||||
// Disable
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>';
|
||||
print $form->selectyesno('MAIN_DISABLE_ALL_SMS',$conf->global->MAIN_DISABLE_ALL_SMS,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Separator
|
||||
|
||||
// Separator
|
||||
print '<tr class="oddeven"><td colspan="2"> </td></tr>';
|
||||
|
||||
// Method
|
||||
|
||||
// Method
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
||||
if (count($listofmethods)) print $form->selectarray('MAIN_SMS_SENDMODE',$listofmethods,$conf->global->MAIN_SMS_SENDMODE,1);
|
||||
else print '<font class="error">'.$langs->trans("None").'</font>';
|
||||
print '</td></tr>';
|
||||
|
||||
// From
|
||||
|
||||
// From
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).'</td>';
|
||||
print '<td><input class="flat" name="MAIN_MAIL_SMS_FROM" size="32" value="' . $conf->global->MAIN_MAIL_SMS_FROM;
|
||||
print '"></td></tr>';
|
||||
|
|
@ -216,31 +207,26 @@ if ($action == 'edit')
|
|||
}
|
||||
else
|
||||
{
|
||||
$var=true;
|
||||
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a target="_blank" href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Disable
|
||||
|
||||
// Disable
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_SMS).'</td></tr>';
|
||||
|
||||
// Separator
|
||||
|
||||
// Separator
|
||||
print '<tr class="oddeven"><td colspan="2"> </td></tr>';
|
||||
|
||||
// Method
|
||||
|
||||
// Method
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
||||
$text=$listofmethods[$conf->global->MAIN_SMS_SENDMODE];
|
||||
if (empty($text)) $text=$langs->trans("Undefined").' '.img_warning();
|
||||
print $text;
|
||||
print '</td></tr>';
|
||||
|
||||
// From
|
||||
|
||||
// From
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).'</td>';
|
||||
print '<td>'.$conf->global->MAIN_MAIL_SMS_FROM;
|
||||
if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && ! isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) print ' '.img_warning($langs->trans("ErrorBadPhone"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user