Beware: Some new tables and data get created / modified when some extensions get installed.
5,701 02/03/2013 02:03:14 pm
Re: Reset full system (Delete all entries)? (7 replies, posted in Setup)
5,702 02/03/2013 02:01:40 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Please check that the logged in user has an email entry in his record in the users table and then see if the $_SESSION["wa_current_user"]->email gets populated.
Unless we try having both Reply-to in header and using the -f parameter with no error, we cannot include the code in the base repo as it has to ensure that existing installs with no postfix and just sendmail will still work.
5,703 02/03/2013 12:02:38 am
Re: email of quotes (38 replies, posted in Accounts Receivable)
What happens if both the headers method and the -f method are used together for Reply-to - does the mail deliver as desired? Make sure the users table has the email of the logged in user and try $_SESSION["wa_current_user"]->email and see if it appears correctly.
The RFC2822 uses CRLF and FA's class.mail.inc uses LF only.
Article 3.6.2 in the RFC2822 states:
..... an optional reply-to field MAY also be
included, which contains the field name "Reply-To" and a
comma-separated list of one or more addresses.from = "From:" mailbox-list CRLF
sender = "Sender:" mailbox CRLF
reply-to = "Reply-To:" address-list CRLF
.....
Maybe some non compliant versions of Postfix may need the additional parameters like -f.....
Caveat - in some mail systems:
It turns out that a internet/dos style newline (\r\n) in the headers were converted to \r\r\n (ie: something mindlessly replaced all \n with \r\n without seeing if \n was already preceded by \r)
_________________________
[size=8]Composed/Posted with WYSIWYG BBCode Editor[/size]
5,704 02/02/2013 05:34:32 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Final solution:
1. Fix the reply to header variable as in Post 20 of this thread.
2. Make sure the real_name field in the users table for the logged in use is populated. Otherwise take the fix from Post 25 in this thread.
5,705 02/02/2013 05:29:53 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Only 2 files use the $_SESSION["wa_current_user"]->loginname variable:
Line 82 in includes/errors.inc:
$user = @$_SESSION["wa_current_user"]->loginname;
and Line 55 in reporting/includes/printer_class.inc:
$ctrl = "H".$server."\nP". substr($_SESSION["wa_current_user"]->loginname,0,31)
It is always the same as $_SESSION["wa_current_user"]->username - would the devs want to standardize?.
5,706 02/02/2013 05:10:12 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
@ed10: While I was documenting the code trace back to where the variables were set, you beat me to it!
You can actually dump the specific session variable:
echo print_r($_SESSION["wa_current_user"], true);
at the location of the send() and see what is the output!
Line 95 in admin/db/users_db.inc in function get_users_by_login():
$sql = "SELECT * FROM ".TB_PREF."users WHERE user_id=".db_escape($user_id);
Hence all fields must be available and in your instance, the real_name field may not have been set, though in the email instance, the username may be okay.
5,707 02/02/2013 05:06:45 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
In includes/session.inc, outside of the class definition, in the function login_timeout() line 402 is:
$_SESSION["wa_current_user"] = new current_user();
Class current_user is defined in includes/current_user.inc, having class variables $loginname, $name and $username all set to empty strings in the constructor at line 42.
current_user::login() method on successful authorisation at line 81:
$myrow = get_user_by_login($loginname);
and sets the current_user class variables
$this->name = $myrow["real_name"];
$this->pos = $myrow["pos"];
$this->loginname = $loginname;
$this->username = $this->loginname;
$this->prefs = new user_prefs($myrow);
$this->user = @$myrow["id"];
If the session variable user is available, ordinarily from the above code, the session variable name should also be available.
When a login timeout occurs, this may not get executed fully and some session variables may get unset (needs to be checked).
Somewhere the session variablenameis getting set to an empty string after having been logged in, if it is empty.
Hence check by replacing the line 269 in reporting/includes/pdf_report.inc with any of the following:
$this->user = $_SESSION["wa_current_user"]->loginname;
// or
$this->user = $_SESSION["wa_current_user"]->username;
and see what happens!
5,708 02/02/2013 04:39:32 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
The said variable:
$_SESSION["wa_current_user"]->name
appears in:
reporting/includes/pdf_report.inc
reporting/includes/excel_report.inc
admin/db/maintenance_db.inc
themes/aqua/renderer.php
themes/cool/renderer.php
themes/default/renderer.php
A few months ago, some repeating code in all the renderer.php files were siphoned out elsewhere to a single function and at that time the variable may have vanished from being set or when changes to includes/session.inc were made over time.
Therefore while retaining the variable $_SESSION["wa_current_user"]->name in the said files, it may be required to set the field real_name from the users table if the user is logged in - in the includes/session.inc file.
Come to think of it, thereal_namein theuserstable does not seem to be used anywhere! Optional field that may not have any value at all!
5,709 02/02/2013 04:04:20 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Line 269 in reporting/includes/pdf_report.inc, the function Info() sets:
$this->user = $_SESSION["wa_current_user"]->name;
Since it is taken from session variable, and the function Info() is not called anywhere within the FrontReport class at all, it is called by it's instance in each report.
Each report file repXXX.php has some function(s) that make an instance like $rep = new FrontReport(.... followed by $rep->Info($params, $cols, $headers, $aligns); This will set the $user FrontReport class variable
The FrontReport class method End() in lines 993-995 includes:
require_once($path_to_root . "/reporting/includes/class.mail.inc");
mail = new email(str_replace(",", "", $this->company['coy_name']),
$this->company['email']);
This method End() is called at the very end of each repXXX.php file.
All seems fine and hence the syntax to set the $this->user is wrong.
includes/session.inc provides the correct syntax:
$user = $_SESSION["wa_current_user"]->user;
Therefore Line 269 in reporting/includes/pdf_report.inc should be::
$this->user = $_SESSION["wa_current_user"]->user;
5,710 02/02/2013 03:32:43 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Line 47 of reporting/includes/class.mail.inc:
$this->header = "From: $name <$mail>\n";
may be replaced with:
$this->header = "From: $name <$mail>\nReply-to: $name <$mail>\n";
The $add_params variable in the class.mail.inc file remains unused. Quote from the PHP manual for mail():
additional_parameters (optional) : The additional_parameters parameter can be used to pass additional flags as command line options to the program configured to be used when sending mail, as defined by the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.
The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users.
The $this-user in the other files may have an issue of scope of being an included file's variable.
5,711 02/02/2013 03:03:54 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
From the PHP mail() manual:
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);
?>
If the $this->user correctly enters the from header variable, it can be made to enter the same value into a $reply-to variable and used as above.
There is a $sender variable that gets populated as well?
Or just use the from header directly for the 'Reply-to' header.
5,712 02/02/2013 09:11:20 am
Re: Function "Payments to supplier": Exchange rate ignored? (2 replies, posted in Accounts Payable)
Exchange Rate is 1 for home currency. Recalculate all the others (done by getting the current exchanges rates and adjusting as required) and create currencies you use but are currently absent ad acquire / fix their exchange rates.
5,713 02/02/2013 09:07:38 am
Re: email of quotes (38 replies, posted in Accounts Receivable)
How did you fix the return path? Was it the addition of a reply-to header in the script or in the class.mail.inc ?
$this->user is the currently logged in user whose email should be in the users table.
5,714 02/01/2013 07:40:06 am
Re: email of quotes (38 replies, posted in Accounts Receivable)
It is possible that the comma may be a delimiter somewhere and may need to be stripped out of the Name. Also was checking for consistency and alternatives to the existing mailer like the integration in similar context.
For your specific requirement, you may want to dump the variables just before the send() occurs in both the caller instance and in the class method as well.
5,715 01/31/2013 08:15:20 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Anyone integrated PHPMailer in the place of the existing class.mail.inc ? This will enable sending using a relay SMTP server like gmail.
class.mail.inc is called and instantiated only in sales/includes/db/sales_order_db.inc and reporting/includes/pdf_report.inc. Hence such integration with PHPMailer would be easy.
Lines 994-996 in reporting/includes/pdf_report.inc:
$mail = new email(str_replace(",", "", $this->company['coy_name']),
$this->company['email']);
$mail->charset = $this->encoding;
Line 104 in sales/includes/db/sales_order_db.inc:
$mail = new email($company['coy_name'], $company['email']);
The charset is missing and the coy_name is not stripped of commas in the latter case.
The latter should be:
$mail = new email(str_replace(",", "", $this->company['coy_name']), $this->company['email']);
Better still would be to move the stripping of the commas to the class method constructor itself by inserting the following in line 47 of reporting/includes/class.mail.inc:
$name = str_replace(",", "", $name);
and removing the str_replace from both files that use the class.
5,716 01/30/2013 02:24:36 pm
Re: Buttons missing from Sales, Purchase, etc. tables (14 replies, posted in Report Bugs here)
It is possible that your folder permissions failed to allow the webserver process to create the said file. Just create a an empty faillog.php file in the webroot with permissions and ownerships that allow the webserver to write to it.
5,717 01/30/2013 02:19:16 pm
Re: Upgrade from 2.3.13 to 2.3.14 (3 replies, posted in Installation)
Just zip it up and archive it. Remove the install folder as there is no install needed.
If you used the file diffs then there would be no install folder.
5,718 01/29/2013 06:51:07 am
Re: Creating Items for Domain Names (11 replies, posted in Items and Inventory)
Possibly yes - just like the domains you sell to others.
5,719 01/29/2013 02:34:02 am
Re: Upgrade from 2.3.13 to 2.3.14 (3 replies, posted in Installation)
Please see Post 6 of the Release Announcement and take the diff files set from there. Just overwrite your existing ones. No DB Changes.
Incorporate new variables and new options for existing variables from the config.default.php into your existing config.php with appropriate values.
Check for any new entries in the #_sys_prefs table in the en_US-new.sql file compared with your existing db being used and add them in.
5,720 01/29/2013 02:28:32 am
Re: Creating Items for Domain Names (11 replies, posted in Items and Inventory)
"Sell" internal domains to yourself for possibly $0/-.
5,721 01/29/2013 02:25:57 am
Re: How to translate words from the database (11 replies, posted in Translations)
Placed content in Wiki
5,722 01/29/2013 01:48:54 am
Re: How to translate words from the database (11 replies, posted in Translations)
Do not, in general, use php $ variables inside the translation text directly.
Check the 3166/3167 Mercurial for sprintf for example workarounds. Otherwise the litteral varable name will be parsed instead. Make sure every possible variable value has a translation in the .po/.mo files.
The lines (they seem okay in hindsight):
label_cell(_($myrow["name"]));// here the _() is put
label_cell(_($parent_text));// here the _() is put
label_cell(_($bs_text));// here the _() is put
should possibly be (%d for numbers and %s for strings) where every possible value of :
label_cell(sprintf(_("%s"), $myrow["name"]));// here the _() is put
label_cell(sprintf(_("%s"), $parent_text));// here the _() is put
label_cell(sprintf(_("%s"), $bs_text));// here the _() is put
Even this may not work as intended since %s will be parsed as is and there is no preceeding or succeeding text to be translated. An eval() may have to be done on a cocatenated string containing the variable.
Try the following as well:
label_cell(_(sprintf("%s", $myrow["name"])));// here the _() is put
label_cell(_(sprintf("%s", $parent_text)));// here the _() is put
label_cell(_(sprintf("%s", $bs_text)));// here the _() is put
Maybe a check to see if $parent_text is empty before translation would be all that is needed:
label_cell($empty(trim($parent_text)) ? "" : _($parent_text));// here the _() is put
5,723 01/29/2013 01:36:25 am
Re: How to make a link popup a window? (32 replies, posted in FA Modifications)
Did you mean:
if ($editkey) {
set_editor('customer', $name, $editkey);
set_editor('item', $name, $editkey);
}
5,724 01/28/2013 02:57:27 pm
Re: Hard coded items unable to translate (7 replies, posted in Translations)
Thanks Joe - HG 3166/3167 fixes it.
5,725 01/28/2013 02:20:10 pm
Re: Release 2.3.14 (10 replies, posted in Announcements)
A matching empty.po for both FA and FA install is attached for hg 3165.