webman Posted December 17, 2010 Posted December 17, 2010 round2it: That sounds relatively simple. Which data were you thinking about - just toners & stock? 1
round2it Posted December 18, 2010 Posted December 18, 2010 round2it: That sounds relatively simple. Which data were you thinking about - just toners & stock? i was thinking about having a report so that i can say to departments x printer has used x amount of toners in x amount of time if this could be implimented it would be great. Thanks webman
sionide Posted December 20, 2010 Posted December 20, 2010 How come this hasn't been promoted to a "Edugeek Project" status yet?! It's great.. I'm trying to get a test db up on a virtual LAMP linux box. Uncaught fProgrammerException ----------------------------- {doc_root}/printers/consumables.php(120): include('{doc_root}/printe...') {doc_root}/printers/views/consumables/addedit.php(35): Consumable->getModels() {doc_root}/printers/inc/classes/Consumable.php(167): Consumable->buildModels() [internal function]: fActiveRecord->__call('buildModels', Array) {doc_root}/printers/inc/flourish/fActiveRecord.php(914): fORMRelated::buildRecords('Consumable', Array, Array, 'Model') {doc_root}/printers/inc/flourish/fORMRelated.php(209): fORMSchema::getRouteName(Object(fSchema), 'consumables', 'models', NULL, '*-to-many') {doc_root}/printers/inc/flourish/fORMSchema.php(179) The table consumables is not in a *-to-many relationship with the table models I keep getting this kind of error ^ on pages such as Add Consumble and "The table manufacturers is not in a *-to-many relationship with the table models" when viewing manufacturers.php Pretty sure I've got the "session" folder set up okay, but I think something is wrong with the relational links between the tables in my db - I tried making a completely fresh db by importing to .sql file but still getting the same issue. Any clues??
round2it Posted December 20, 2010 Posted December 20, 2010 (edited) How come this hasn't been promoted to a "Edugeek Project" status yet?! It's great.. I'm trying to get a test db up on a virtual LAMP linux box. Uncaught fProgrammerException ----------------------------- {doc_root}/printers/consumables.php(120): include('{doc_root}/printe...') {doc_root}/printers/views/consumables/addedit.php(35): Consumable->getModels() {doc_root}/printers/inc/classes/Consumable.php(167): Consumable->buildModels() [internal function]: fActiveRecord->__call('buildModels', Array) {doc_root}/printers/inc/flourish/fActiveRecord.php(914): fORMRelated::buildRecords('Consumable', Array, Array, 'Model') {doc_root}/printers/inc/flourish/fORMRelated.php(209): fORMSchema::getRouteName(Object(fSchema), 'consumables', 'models', NULL, '*-to-many') {doc_root}/printers/inc/flourish/fORMSchema.php(179) The table consumables is not in a *-to-many relationship with the table models I keep getting this kind of error ^ on pages such as Add Consumble and "The table manufacturers is not in a *-to-many relationship with the table models" when viewing manufacturers.php Pretty sure I've got the "session" folder set up okay, but I think something is wrong with the relational links between the tables in my db - I tried making a completely fresh db by importing to .sql file but still getting the same issue. Any clues?? im sure they guys can sort this out for you ive just installed on my machine at work added all my printers and stock i used the xampp route works perfectly for me at work and at home. but it was on windows and i agree this should be an edugeek project now it has so much potential clean tidy does eactly what it says on the tin. Edited December 20, 2010 by round2it
itgeek Posted December 20, 2010 Posted December 20, 2010 I think this is an excellent project. It would be good to have export to excel button on the reports section, I think the only thing that is missing is the ability to charge the departments for the toner, another idea wold be good to have something like this for projector lamps. Thanks
round2it Posted December 21, 2010 Posted December 21, 2010 great idea i am looking forward to see how it works out next term using printmaster
RabbieBurns Posted January 14, 2011 Author Posted January 14, 2011 Ive just started setting this up to put into production. I would like to add a little school logo onto the front page. Could someone point me in the right direction which file I could modify to inclde a simple small banner to sit above the Install Consumable and Consumables line? Cheers
webman Posted January 14, 2011 Posted January 14, 2011 RabbieBurns: You can do this in index.php - have a look here: https://gist.github.com/779363 1
RabbieBurns Posted January 14, 2011 Author Posted January 14, 2011 RabbieBurns: You can do this in index.php - have a look here: https://gist.github.com/779363 Awesome.. Thanks for that.. will have a play over the weekend.
itgeek Posted January 18, 2011 Posted January 18, 2011 Hi does this now allow you to charge for the toner for example diffrent departments? I would also like to add drums, one more request if it could export the reports to excel so I could give them to finance dept? Thanks
webman Posted January 18, 2011 Posted January 18, 2011 itgeek: Not officially. I noticed a few people have posted some changes in previous pages, so those would be your best bet at the moment; but I can't say whether or not that will do what you want it to
Edu-IT Posted February 14, 2011 Posted February 14, 2011 Will this work with MSSQL? Or does it not matter?
RabbieBurns Posted February 14, 2011 Author Posted February 14, 2011 @webman, a suggestion for version 3 or something.. we have multiple ppl in the IT dept, and it would be handy to be able attribute which member of staff handed out the toner. Would it be hard to maintain a table of staff, and then have it ask who you are when you install a toner? Is it something I could do?
round2it Posted March 7, 2011 Posted March 7, 2011 this option would be good but you can just copy the text from the page and paste into excel and then auto filter it it seems to work.
webman Posted March 7, 2011 Posted March 7, 2011 Will this work with MSSQL? Or does it not matter? The code library used for the project, Flourish, does support MSSQL. But, I've used a few custom queries which may or may not work with MSSQL. All I can say, is try it Would it be hard to maintain a table of staff, and then have it ask who you are when you install a toner? Should be easy enough. Retrieving a list of items in a DB table is really simple with the Flourish library. Hook up a drop-down box on the add toner form, and add a column in the events table to record who added it. To finish it off, modify the reports page to pull in the user. If you have a basic understanding of PHP you should be able to muddle through those changes 1
RabbieBurns Posted March 8, 2011 Author Posted March 8, 2011 Im sure I can hack something together, not sure when Ill get a chance to have a look as its working great now, and Ive finally educated the rest of the dept to use it.. Whats the mysql backup command I can use to backup the database again?
webman Posted March 8, 2011 Posted March 8, 2011 Whats the mysql backup command I can use to backup the database again? mysqldump -u username -p databasename > databasename.sql From memory
Ctorp Posted April 8, 2011 Posted April 8, 2011 First, I'd like to thank Craig for this tool. It's exactly what I was looking for. I actually used it to replace a PHP side-project I'd been working on infrequently to replace an Access DB that does the same thing. One thing I'm looking to implement that I don't see elsewhere is a field to add Last Ordered for each consumable, by which the list can be organized. This is used internally to keep track of when we will get new orders for some of our more impatient users. I added the field to the consumables table as a field titled last_order and was able to reference it in consumables\index.php on line 24: Last Ordered and line 54: echo '' . $c->model . ''; echo '' . $c->last_order . ''; However, my experience with Flourish is non-existent. I used the direct link to the descending order because fCRUD::printSortableColumn('consumables.LastOrder', 'Last Ordered') would only sort in ascending order. I am not sure where or how to pass the existing sort order to the session. Could you point me to how to do this? More importantly, I cannot figure out how to get the Last Ordered value to save to the db from consumables\addedit.php. When I tried to add the necessary code for updating this value, I tried various things, but eventually the only one that worked actually updated the consumable name instead of the last_order value so I scrapped it. Could someone also point me in the right direction for this? I'm assuming it will need its own function defined somewhere with Flourish, but again I have no experience with this API.
Ctorp Posted April 8, 2011 Posted April 8, 2011 (edited) After a bit more tinkering, I managed to make this work. It was entirely trial and error so I have no idea why it works, and the Session issue persists, but to add the "Last Ordered" field.. 1. I added a date field type to the consumables table in mysql 2. I updated Line 31 of consumables.php with: Last ordered 3. updated Lines 23 and 54 (respectively) of consumables\index.php with: echo '' . $c->last_order . ''; I *think* that is everything I did, but this was trial and error as I mentioned above so I shall bask in the fact that it works for a little while before I get impatient and break it again trying to figure out what I just did as far as Flourish was concerned. (BTW if anyone can help me with the Session issue, I'm still game to try to fix that) Edit: I also found on line 4 of inc\config.php where the consumable status can be altered, although it is global right now. A few simple if/else might be able to fix that. I set 0 as Critical, 1 as Low, and 3 or more as OK. Edited April 8, 2011 by Ctorp
webman Posted April 8, 2011 Posted April 8, 2011 Hi Ctorp, thanks for your comments about the project - I'm pleased it's useful for you and you managed to add an extra column. Also, thanks for posting your solution to it - hopefully it will help others wanting to achieve a similar thing. Can you please describe the session problem you have in more detail? I'm not sure what exactly isn't working, or what you want to be able to do.
Ctorp Posted April 8, 2011 Posted April 8, 2011 Hi Ctorp, thanks for your comments about the project - I'm pleased it's useful for you and you managed to add an extra column. Also, thanks for posting your solution to it - hopefully it will help others wanting to achieve a similar thing. Can you please describe the session problem you have in more detail? I'm not sure what exactly isn't working, or what you want to be able to do. The code in consumables\index.php at line 34 with: It seems to only set the ?dir php action to 'asc' (i.e. consumables.php?sort=consumables.LastOrder&dir=asc) and does not store that information in the session (cookie?) so that a subsequent follow of that link (the column header) will change the sort direction to 'desc'. I think I remember seeing something where fCRUD::printSortableColumn was defined that indicated which sort actions it would work with, but I am not entirely sure, and I gave up on it after breaking it in various ways. My next step is going to be to modify the reports page to optionally generate a filled-out re-order form that is in-line with the ones used at the facility where I work. If I get that working I can post it later. ^_^
webman Posted April 8, 2011 Posted April 8, 2011 Hi OK, I think I might have what you want here. You need to edit two files. In views/consumables/index.php: And in consumables.php, line ~36: $sort = fCRUD::getSortColumn(array('consumables.name', 'consumables.qty', 'consumables.last_order')); That last one is the line that says which columns can be sorted on. I tested that quickly and it seems to remember the sort setting when I re-visit the consumables page. Give it a go The Flourish documentation is pretty good if you need to utilise the classes/functions for extending the project for your own needs - Documentation - Flourish.
Ctorp Posted April 11, 2011 Posted April 11, 2011 Hi OK, I think I might have what you want here. You need to edit two files. In views/consumables/index.php: And in consumables.php, line ~36: $sort = fCRUD::getSortColumn(array('consumables.name', 'consumables.qty', 'consumables.last_order')); That last one is the line that says which columns can be sorted on. I tested that quickly and it seems to remember the sort setting when I re-visit the consumables page. Give it a go The Flourish documentation is pretty good if you need to utilise the classes/functions for extending the project for your own needs - Documentation - Flourish. hmm. That was actually one of the things I tried before, but it still only organizes that particular field by 'asc' direction no matter how many times it is clicked. I tried again and cleared the cache as well as using two separate browsers, but it will not change the value. The other fields will alternate as usual either way. Would you like me to pastebin my changed files?
Ctorp Posted April 15, 2011 Posted April 15, 2011 I'm enjoying working on this PrintMaster project. A few notes I still haven't figured out why I can't get sorting to work properly with the Last Order field, but I have forgone that for the moment and started writing a Reorder page for the toner inventory. I'm thinking it would be best if I set a specific "Reorder Point" field for each consumable then allow each consumable to populate this Reorder page based on whether the "qty" field is < the "reorder_pt" field. Also in the works is an "inactive" field for printers that still have consumables, but are not currently in service, so they do not populate the homepage consumable stock. A couple other improvements that I will look into (I currently am not sure how I could implement them) are a password protection for the inventory and the ability to "undo" the last consumed element in case someone uses it by accident (or in case it is taken from the inventory, but is found to be unneeded and returned). I will post back if/when I finish these things as I may be moving to another job before this can come to full fruition.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now