meeting-room-booking-system / mrbs-code

MRBS application code
Other
127 stars 62 forks source link

Put Name on Email Send Out #1584

Open jberanek opened 8 years ago

jberanek commented 8 years ago

Hi There

I just would like to ask you. I've succesfully instlaled MRBS on our system. I just would like to address some issue. Will I be able to put Name on the email being send out to the user? Because its only displayed the email address. Example will this

When user book a room, the email will received as reservation@mycompany.com. I would like to displayed as My Company Booking System

I would be glad if you can assist me with this issues.

Thank You

Regards Hans

Reported by: *anonymous

Original Ticket: mrbs/support-requests/860

jberanek commented 8 years ago

Just write the address like this:

$mail_settings['from'] = '"My Company Booking System"<reservation@mycompany.com>';

Original comment by: campbell-m

jberanek commented 8 years ago

Hi Mr. Campbell

Thank you for your answer. Do i put this on config.php or in function_mail.php? And one last questions, I not be able to generate the report in CSV format. Everytime I run the report into CSV and open them in Microsoft Excel this thing come out

Original comment by: *anonymous

jberanek commented 8 years ago

You put that in the config file.

What version of Excel are you using and is it for Windows or Mac?

Original comment by: campbell-m

jberanek commented 8 years ago

Hi Mr Campbel, I'm using Microsoft Excel 2010 and its on Windows.

Original comment by: *anonymous

jberanek commented 8 years ago

Make sure you have the following settings in your config file:

$csv_row_sep = "\n";  // Separator between rows/records
$csv_col_sep = "\t";  // Separator between columns/fields
$csv_charset = 'utf-16';
$csv_bom = TRUE;

I have just tested it with these settings with Excel 2010 on Windows and it works for me. If it doesn't, try combinations of

$csv_charset = 'utf-8';

and

$csv_bom = FALSE;

Original comment by: campbell-m

jberanek commented 8 years ago

Hi Mr Campbell

This solved my the report. However my curiousty the report turn out to be messy. Please find the file attached. Are there any ways to make the tables properly allign just like the HTML Report?

Many Thanks

Regards Hans

Original comment by: *anonymous

jberanek commented 8 years ago

It looks like your column separator is still not suited to the Excel default. Have you got

$csv_col_sep = "\t";  // Separator between columns/fields

Original comment by: campbell-m

jberanek commented 8 years ago

Hi Mr Campbell

Yup, I've added the line of code as you written above. Here are my code which I update them on config.php

$csv_row_sep = "\n"; // Separator between rows/records $csv_col_sep = "\t"; // Separator between columns/fields $csv_charset = 'utf-8'; $csv_bom = FALSE;

However the CSV Report still show the same result.

Original comment by: *anonymous

jberanek commented 8 years ago

Can you post a file containing the first one or two lines of the CSV file - if it doesn't contain confidential data.

Original comment by: campbell-m

jberanek commented 8 years ago

Hi Mr Campbell,

Sure, please find the enclosed CSV for your convinience.

Thank You

Original comment by: *anonymous

jberanek commented 8 years ago

Thanks. It looks like there is a bug in MRBS. I am working on a fix.

Original comment by: campbell-m

jberanek commented 8 years ago

I think the problem occurs if your MRBS server is running Windows. I have fixed the problem in changeset 43abc59cf1c1 (though I am having trouble pushing that at the moment). If you are running MRBS 1.5.0 I've attached a new version of report.php which should fix the problem. Note that you will need the following settings in your config file in order to keep Excel happy:

$csv_row_sep = "\n";  // Separator between rows/records
$csv_col_sep = "\t";  // Separator between columns/fields
$csv_charset = 'utf-16';
$csv_bom = TRUE;

Original comment by: campbell-m

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/e3866666/5c5b/attachment/report.php

jberanek commented 8 years ago

Hi Mr Campbell

Thank you so so much. This resolve my issues. Thank you for your kind help. My last several questions is it possible to prevent users without admin privileges to generate report? and is it possible to make the users login using their email address instead their username? and lastly is it possible to take remove Type (Internal/External)?

Thank you once again

Regards Hans

Original comment by: *anonymous

jberanek commented 8 years ago

Good, glad it's working now. The answers to your other questions are:

(1) In mrbs_auth.inc, change the line

$page_level['report.php']                = ($auth['deny_public_access']) ? 1 : 0;

to

$page_level['report.php']                = 2;

(2) If you are using the 'db' authentication scheme then, without changing the MRBS code, the only way is to give them a username that is their email address

(3) You can remove it from the booking form by creating a custom CSS file (see systemdefaults.inc.php for instructions how) containing the rule:

#div_type {
  display: none;
}

However it will still appear on other pages.

Original comment by: campbell-m

jberanek commented 8 years ago

Hi.

After the upgrade to 1.5.0 i got similar problems.

The first problem was that the report if generated to csc gave jibberish text, look like chinese but cant be sure. If i added to config.

$csv_row_sep = "\n"; // Separator between rows/records $csv_col_sep = "\t"; // Separator between columns/fields $csv_charset = 'utf-16'; $csv_bom = TRUE;

it didnt help.

But if i change charset to utf-8 the text turns up fine in english. But the seprator doesnt work. everything comes up one the same column.

So i assume this has to do with the bug, so i downloaded the updated report.php posted in this thread and changed to utf-16. Everything works fine... or i thought that until now.

Reports shows up fine and i get the file as i want it but if i want to search for booking type in reports i get an fatal database error. If i search for anything else then it works.

The php log gives me this

Unknown column 'E.type' in 'where clause' I get this no no matter which booking type i search for.

Do you have any ideas?

Best Regards Björn

Original comment by: *anonymous

jberanek commented 8 years ago

Strange.

You could try this report.php, which is the latest from the default branch. I haven't tested it, so there may be some dependencies on other changes.

If you are still getting the problem then uncomment line 1493 and let me know what the full SQL is.

By the way, it makes no difference to this problem, but it's probably generally better to have $csv_bom = FALSE; if you are using utf-8.

Original comment by: campbell-m

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/e3866666/845f/attachment/report.php

jberanek commented 8 years ago

Hi.

Tried the new report.php It makes things worse, now i can only see the datepicker when i click on report.

I changed it back to the one that works best and that is the one posted earlier in this post. Turned on debug.

This is the output from the browser

DEBUG: SQL: SELECT E.*, UNIX_TIMESTAMP(E.timestamp) AS last_updated, A.area_name, R.room_name, A.approval_enabled, A.confirmation_enabled, A.enable_periods FROM mrbs_area A, mrbs_room R, mrbs_entry E WHERE E.room_id=R.id AND R.area_id=A.id AND E.start_time < 1468101600 AND E.end_time > 1462831200 AND ( BINARY `E.type`='I') ORDER BY area_name, sort_key, start_time

Fatalt fel: Databasen är inte tillgänglig för tillfället!

Original comment by: *anonymous

jberanek commented 8 years ago

I can't reproduce this and I can't see anything wrong with the SQL. What database and version are you using (the info is on the Help page).

Original comment by: campbell-m

jberanek commented 8 years ago

Hi Campell i finally solved it after hours of troubleshooting. The bug i was trying to fix with the CSV getting all wrong was fixed here in this release.

[43abc5] (50.7 kB) by Campbell Morrison Campbell Morrison Fixed bug in CSV reports when running on Windows (see SF Support Requests 860) 2016-01-13 14:21:34

But this gave me other problems, like not being able to filter by booking type so i upgraded the report.php one version at a time to figure out which one gave me the other problem.

Just before this bugfix this version gave me the problems. [bfe364] (50.2 kB) by Campbell Morrison Campbell Morrison Fixed bug in reports: the case sensitivity of types was not being recognised (see SF Support Requests #776)

In that version this files where also changed web/mysqli.inc and web/pgsql.inc I downloaded them and no more problems i can now create custom reports for any booking types.

So for me i think this solved it. Thanks for the help.

Original comment by: *anonymous