oh god, that reminded me of the time when i had finally finished setting up a client system which included 3 tablets, 4 printers and 2 tills, only to have it screw up on me last second and the following day was there official open day!!!
i recall staying onsite till 4:30am making everything from scratch again coz the database file got corrupted when i was transferring the file over to my backup hdd. and i had to be at work at 7 the same day!
How are you doing it?
My plan origionaly when weighing up going big time with reselling tills with samba was a ‘management’ entity screen(s). To create a full feature system with the management screen being used to turn features on and off and do all the on site admin protecting the automation for everything… Would be so much easier if had more control over user roll and management sections access.
Now you’re relating this to the other Topic about creating Users. The original post and topic-name indicates that we want more control over who can access what in terms of the Management section.
For example, when we click “Manage”, it takes us into Management…
But we have more power now. We can lockout Management Sections individually. So what if we make that gear button take us here instead:
@emre, any chance there is a trick to opening up an entire section, for example if we wanted to specify access to all of Automation, maybe accept syntax like Automation:* ?
It turns out we need to be more granular in our Management Module specification. We currently need to specify Section and Module as sectionName:moduleName …
Users:User List
Users:Role List
Automation:Actions
Automation:Rules
Automation:Automation Commands
Automation:Scripts
Entities:Entities
Accounts:Accounts
Products:Product List
Products:Menu List
Inventory:Inventory Items
Inventory:End of day Records
... etc ...
The sub-section is required. Without it, all of Management becomes opened up. So if you just use something like “Inventory” as the section with no :module after it, then it opens up like you have full admin rights to all sections.
So, our custom screen starts to look like this, which is a bit of a pain, but still not too bad …
Hmmm, might rethink that plan and have a go them if that is the case
So the button takes you into that section, what about getting back? Menu button in bottom right? Going back to nav screen?
Yes. Straight to the section specified, with all others locked out / disabled. Main Menu button is there in the bottom-right as usual, which takes you to main Nav Screen.
Hmmmm, perhaps if posible the ability to specify multiple modules in a list would allow an equivilent to the user roll level restriction via a single nav button.
Would mean allot less navigation to go between sections.
Creating equivilent manage buttons with values relative to the level of access.
ill open a new topic if it could be done, as I’m no sql master.
Add Product gives a input method the same as Add Employee but gives Product Name, Price, Category.
It then inputs it into the database in both tables Product and Menu (Puts the product in the Category which I have all the same for both Products and Menu)
it then takes the colour used for the button and adds it automatically… 1 button, 2 jobs.
It should check that the category exists in both otherwise it will return an error message.
gave it a shot, but where it looks for MenuItemId isnt created until after product made, so itll not be possible I don’t think…
function createProduct(p,r,u) {
// can get Product fed via function or
//use Data.Get to retrieve Program Settings
var prd = (typeof p === 'undefined' || p=='' ? Data.Get("Product") : p);
var prc = (typeof r === 'undefined' || r=='' ? Data.Get("Price") : r);
var ctg = (typeof c === 'undefined' || c=='' ? Data.Get("Category") : c);
var q="SELECT [ButtonColor] FROM [ScreenMenuItems] WHERE [ScreenMenuCategoryId]='" + ctg + "'";
var grp = sql.Query(q).First;
// more validation
prd = (typeof prd === 'undefined' ? '' : prd);
prc = (typeof prc === 'undefined' ? '' : prc);
ctg = (typeof ctg === 'undefined' ? '' : ctg);
//check for existing user with that name
var q="SELECT COUNT([Name]) AS [COUNT] FROM [MenuItems] WHERE [Name]='" + prd + "'";
var productCount = sql.Query(q).First;
if (prd!='' && prc!='' && ctg!='' && productCount==0) {
// run SQL to create the User
q = "INSERT INTO [MenuItems] ([GroupCode], [Name]) VALUES ('" + ctg + "', '" + prd + "')";
q = "INSERT INTO [xxxxxxx] ([xxxxxxxx],) VALUES ('" + ctg + "')";
q = "INSERT INTO [xxxxxxx] ([xxxxxxxx],) VALUES ('" + ctg + "')";
var r = sql.ExecSql(q);
} else {
dlg.AskQuestion('Product with that name already in use.','OK');
}
}