Jump to content

Recommended Posts

Posted

I'm a bit stuck getting this going. When I browse to bulkYearMake.php I get the ever popular HTTP 500 Internal Server Error.

 

Any idea what might be causing it?

Posted

Have you modified the code?

 

Check the php error log (set up in php.ini if it's not already) and post any Warnings or Errors (ignore any Notices).

 

This should give us a clue as to what is going wrong.

Posted
Well that is odd. PHP logging was broken so I fixed that, go over to bulkYearMake.php and it's started working! Time to give this thing a bash, what would I need to do to get a 3 week timetable working? I'm going to start having a poke about with it now so if I suss it out before you reply I'll let you know :p
Posted
I would imagine that PHP logging being broken might have resulted in 500 errors (the script usually generates a few warnings whenever it runs!) - howtarp is the expert for n-weekly timetables, see post #38 for his instructions on 2-weekly, let us know if you need anything different for 3-weekly.
  • 2 years later...
Posted

Hi all,

 

I've been working on some changes to this handy script recently. I thought I would share them in case they are helpful to anyone else.

 

It should be able to take the output from sims and import it directly once you have configured the script for your needs.

 

  • JQuery DatePicker for start and end dates
  • period mappings stored in php file rather than editing csv.
  • Room id mappings stored in php file
  • Can cope with 2 week data.
  • consecutive periods are handled slightly differently to help with period mappings. This hasn't been tested yet as we don't do it.
  • made remove slashes in booking name an option - we don't want it.
  • Additional fields that are set as required. Search for the ADDITIONAL_FIELDS section
  • Security - need to be an admin
  • Added option to start on a Week B
  • Added option to Skip existing bookings

SIMStoMRBS1.4.zip

  • Thanks 2
  • 1 year later...
Posted

I know this is an old thread - so apologies for digging this up.

 

@Chris_Cookjust playing with MRBS 1.6.1 as we will be moving to a 2 week timetable from September.

 

I have edited the file so room and periods match my installation.

 

When I import my sims data it seems to want to import everything into the first available slot and then complains about clashes.

 

Which version of MRBS did you test your import routine with?

 

I can get version 1.3 working fine but it doesn't have the ability to start with Week2 (just covering my options as I have no idea it we will start with a Week2 after half term breaks etc...)

 

Cheers

Posted

Hi mdrabble, no worries.

 

I assume you mean its putting it in the same time/period slot?

 

I'm not sure on the version we use. I think I tried it against a couple of different versions. I'll try and check in the morning when I'm back in. I've noticed I added a variable called $mrbs_ver_1_4_8_or_older. You probably want this set to false if you haven't done so, but I don't think this would cause the issue your having. It seems to do something with the repeat type, which changed after MRBS 1.4.8.

 

My guess would be something around the $period_map array, check what you have in there matches the csv file you get out of sims. Its probably case sensitive.

 

We have noticed if you don't start a term on a monday, the script gets confused, and does half your week as A and the second half as B.

 

Hope this helps, let me know how you get on with it.

Posted
Hi mdrabble, no worries.

 

I assume you mean its putting it in the same time/period slot?

 

I'm not sure on the version we use. I think I tried it against a couple of different versions. I'll try and check in the morning when I'm back in. I've noticed I added a variable called $mrbs_ver_1_4_8_or_older. You probably want this set to false if you haven't done so, but I don't think this would cause the issue your having. It seems to do something with the repeat type, which changed after MRBS 1.4.8.

 

My guess would be something around the $period_map array, check what you have in there matches the csv file you get out of sims. Its probably case sensitive.

 

We have noticed if you don't start a term on a monday, the script gets confused, and does half your week as A and the second half as B.

 

Hope this helps, let me know how you get on with it.

 

Thanks for the reply.

 

Yep, changed the $mrbs to false and Im using the same periods etc.

 

Strangely, if I import a single week timetable it imports fine, it just the 2 week timetable it is having an issue with :confused:

 

This is a very small sample of the test csvfile I've tried importing - Week 1 is 1Mon, 1Mon:2 etc and Week 2 is 2Fri,2:Fri:1

 

IT5,1Mon,1Mon:2,12F-Ep1,DER,Ep,0
IT1,2Fri,2Fri:1,10A-WK2,SKV,It,20

 

I'll keep looking to see if a flash of inspiration comes to me :D

Posted

We are using 1.4.7. Its possible something has changed in 1.6.1. Its probably just a small change to fix it though.

 

Can you post your $period_map array, and a screen shot of the mrbs time table when it has gone wrong. Also, check you don't have a second period map set in the script, as that might confuse it.

 

I'm not sure if its the Week, day, or period that its not picking up. They are all calculated separately.

 

One difference we have is we use A and B weeks instead of 1 + 2. I don't think that should make a difference.

 

There is an echo statement around line 362 that is commented out. If you un-comment this, it may help show what its doing with the day. You could also add another echo statement around line 386 to print out $period[$item] and the result of explode(":", $period[$item])[1]. That might reveal something useful about the period.

  • Thanks 1
  • 4 months later...
Posted

Hello,

 

We're wondering if anyone can help with an issue on this?

 

We've set up the php file but whenever we run the csv import the session expires 'Your session has expired.' on edit_entry_handler.php. Booking a room normally doesn't result in this. Tried clearing cookies, multiple browsers etc.

We're using MRBS 1.7.1 with 'remote_user' authentication session (have also tried 'nt').

 

If anyone has any ideas we'd be grateful.

 

Thanks

  • 4 years later...
Posted

Hi,

 

I am looking to get this working but i am getting an error when i browse to the bulkYearMake.php

 

Uncaught exception 'Error' in /var/www/intranet/rooms/bulkYearMake.php at line 133

Call to undefined function checkAuthorised()

 

Any help would be appreciated.

 

Server Info

 

Configuration details

MRBS version MRBS 1.11.0

Database schema version 82

Database local schema version 1

$auth['type'] db

$auth['session'] php

Server details

Database (Ubuntu) 5.7.41-0ubuntu0.18.04.1

System Linux srvweb1 4.15.0-194-generic #205-Ubuntu SMP Fri Sep 16 19:49:27 UTC 2022 x86_64

Server time 11 Apr 2023, 12:44:45 BST

Server software Apache/2.4.29 (Ubuntu)

PHP 8.1.11

Extensions Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apcu, bz2, calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, posix, readline, session, shmop, sockets, sodium, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib

 

 

Posted

The "checkAuthorised()" function is not defined within bulkYearMake.php. I'm limited on my understanding of PHP, but I think this pulls from "defaultincludes.inc" and that then pulls from another file (likely functions.inc?).

 

Is your bulkYearMake.php in the same directory as "defaultincludes.inc"? If not it then this could be the issue, so I would test either moving it to the same directory or amending bulkYearMake.php to account for the different path.

Posted

I've had a look and "checkAuthorised()" is defined in mrbs_auth.inc. Looking at the mrbs_auth.inc for the current and older versions the function now seems to include different checks on the "level" of the page. My guess would be that this is failing as bulkYearMake.php is not a default part of the install so has no level assigned.

 

It looks like there is a bypass switch built into "mrbs_auth.inc", but I could be mistaken with my limited understanding. As a test you could try switching line 197 temporarily to "function checkAuthorised($page, $just_check=true)". If you can then access bulkYearMake after this you need to edit the mrbs_auth.inc to include a level for bulkYearMake.php. If it still doesn't work then you need to delve into the "checkAuthorised()" function to understand what it is doing and why it might be failing.

Posted

I have fixed the issue i was having by making the following changes to the bulkYearMake.php file.

 

Add namespace MRBS; directly under the <?php tag

 

namespace MRBS;

 

Edit the below

 

// Check the user is authorised for this page
checkAuthorised();


// Also need to know whether they have admin rights
$user = getUserName();
$required_level = (isset($max_level) ? $max_level : 2);
$is_admin = (authGetUserLevel($user) >= $required_level);

if (! $is_admin) {
die("Error: Accessed Denied");
}

 

to

 

// Check the user is authorised for this page
if (!checkAuthorised(this_page()))
{
 exit;
}

 

removing part of this code disables the check for admin however to restrict this to admins you can add the page name to mrbs_auth.inc around line 130

 

// These pages only contain admin features
   case 'add.php':                     // Adds a room
   case 'del.php':                     // Deletes a room
   case 'del_entries.php':             // Ajax page for bulk deletion of entries
   case 'edit_area.php':
   case 'edit_area_handler.php':
   case 'edit_room_handler.php':
   case 'import.php':
   case 'kiosk.php':
   case 'report.php':
   case 'bulkYearMake.php':
     $result = 2;
     break;

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...