Add "Import and Edit" and "Import Only" options in the Settings menu for admin roles.
This for KV's OE version on or later than March, 12, 2020.
You must have server access
"Import and Edit" option is similar to previous version of Import in which it allows admin users to import: chemical containers ("packages"), storages list, user list, and supplier offers. For chemical containers ("packages"), this function will check if the database has the chemicals based on provided barcode. If the barcode is not found, it will add new container. If the barcode is found, it will change the provided info for that container.
"Import Only": only allow importing of chemical containers AND it will NOT check for existing container.
Right now, this function will only turned on for MIT and Baylor University.
To add your own institution, you need:
Creating lib_customization.your-school-name.php
with your-school-name is short or abbreviation of your school name. Use lib_customization.mit.php
for an example
Add the following line inside lib_customization.your-school-name.php
after $default_g_settings["order_system"]="fundp";
:
Modify lib_global_settings.php
by:
Change this: define("customization",""); // Customization to use: f.e.: ".sample" for use of "lib_customization.sample.php", and "" for "lib_customization.php"
To: define("customization",".your-school-name"); // Customization to use: f.e.: ".sample" for use of "lib_customization.sample.php", and "" for "lib_customization.php"
. Notice there is a period (.) in front of "your-school-name".
Modify sidenav.php
by:
Right before this line: showSideLink(array("url" => "import_edit.php","text" => s("import_edit_tab_sep"), "target" => "mainpage", ));
. On this line: if (in_array($g_settings["customization"], array("baylor", "mit"), true)) {
add "your-school-name"
(the same as "your-school-name" set in lib_customization.your-school-name.php
) right at the end of the array list of institutions. For example:
Edit file lib_global_setting.php
:
from
to
with:
300 (seconds = 5 min) is the time that user is banned from logging in
10: is the number of retries
Edit file lib_global_setting.php
from
to
edit filephp.ini
(in Linux, /etc/php.ini)
with xxx = desired memory in megabytes
2. edit file.htaccess
(in the folder install oe)
with xxx = desired memory in megabytes
For OE original barcode, add Prefix ESC
For existing barcode, (specifically for Tao Tronic scanner: https://smile.amazon.com/TaoTronics-Wireless-Cordless-Handheld-Barcode/dp/B00E0G2M6U/ref=sr_1_4?ie=UTF8&qid=1482003832&sr=8-4&keywords=taotronic+scanner ) add Prefix: [l_shift_on]+[Home]+[l_shift_off]
Chance is you miss php-mbstring and php-gd packages
Install these packaged and restart apache (httpd in CentOS 7) should fix this issue
In CentOS 7, you can install the two above packages by running :
Restart your server (in Centos 7):
Go to OE folder, change …/lib/barcode_terminal.js
, line 174-185, content:
From
To:
Because this is on javascript file on the client browser, it is best to close the browser and restart the browser on the client/terminal computer
Edit lib_global_funcs.php
Change:
to:
2. Restart server
Edit lib_global_funcs.php
by adding autofocus
after id=\"db_name\"
. Around line ~1180
Original:
to:
Backup current OE files
Download the appropriate files from: https://sourceforge.net/projects/enventory/files/?source=navbar
Unzip the file
Copy the content of the folder into your current [OE_folder] and overwrite the old files
Copy the “List of files that have been modified to specific need (different than the original files of oe)” from the backed up OE to the new [OE_folder]
Restart httpd and mariadb (or mysqld) services
Go to web browser and access OE url
Login as root into a database of interest and perform upgrade if necessary (you will have to do this again for all of the databases if major upgrade is required
Create the label by re-design the original file chemical_storage.label
(in /oe/forms/dymo/). You can open and edit ".label" files by using Dymo software: https://www.dymo.com/en-US/online-support/dymo-user-guides
Name these files as chemical_storage1.label
, chemical_storage2.label
, etc.
Save these files in the same location: /oe/forms/dymo/
Edit file edit.js
(in /oe/lib/)
From:
To:
The code block above will show 2 labels in the popup window. You can add more label by copy the block for "Second label", make sure to change:
- variable name for the window (window2
in the example above)
- moveby
specifications
Pic:
Original file:
Modified file:
2. Restart the apache service: in CentOS7 use this in the command line:
Edit file lib_edit.php
(in /oe/)
From:
Pic:
To (remove style=\"display:none\"
)
2. Restart the http/apache service
Install phpMyAdmin by following the instruction from: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-with-apache-on-a-centos-7-server
Note: if you want remote access then follow step 4 in this tutorial: http://www.krizna.com/centos/install-phpmyadmin-centos-7/
2. Log in into phpMyAdmin using Web browser: http://your.ip.address/phpMyAdmin/ (or https://) with root user
3. Choose the Database in which the containers belong to:
For example in this case, I choose Database storage
4. Create new storage location in OE as usual, see:
5. Identify the storage_id
of the new and old locations by choosing Table storage
in Database “xyz”.
Note: In this example, accidentally, the name of the database (“storage”) is the same as the name of the table. However, the database name can be anything but the table name is always “storage”
Another way of doing this is to use “Console” function in phpMyAdmin
Type in:
You should see similar to:
With the screen above, you should be able to see the storage_name
and the corresponding storage_id
The next few steps is demonstration for changing all of the chemical in “315-R (Personal)” (storage_id=1) into “305-test” (storage_id=9)
In the Console:
6. To check how many chemical, type:
Note: hit Ctrl+Enter to execute command in Console
7. To change, type:
Done
Install phpMyAdmin (See above)
Look up person_id
by going into [Database]/person
Show chemical borrow by that person (i.e. a person with person_id=8)
3. Return by:
Look up person_id
by going into [Database]/person
Show chemical owned by that person (i.e. a person with person_id=7)
3. Change, in this case, to no owner (NULL)
In the following example, show person_id
of user with username=julia
First choose the desired database on the tree folder from the left
Use:
Explain:
LIKE 'FH-2206%'
: show the storage_id
of the storage location with name starting with FH-2206
LIKE '%FH-2206%'
would mean find anything with storage name containing FH-2206
LIKE 'FH-2206%'
would mean find anything with storage name ending with FH-2206
Explain: the above command is used to
Select all of the chemical in the database that match: owner_person_id=15 AND with storage_id is NOT 18
Explain: see above for explanation of the criteria.
Explain:
GROUP BY storage_name
: is added so that duplicates are only shown once
Explain: the command above change responsible people to no one for all of the chemicals being owned by person_id=13 AND in all of the storage_id listed
The below command will search for all the barcode that is assigned to more than 1 container (chemical_storage). This search ignores disposed container as well as container without barcodes (chemical_storage_disabled IS NULL AND chemical_storage_barcode != ""
)
To select info from the list of duplicated barcodes. In this case, created by a specific user and created after some specific timestamp
WARNING!!! BE VERY CAREFUL BEFORE DOING THIS!
This will remove all of the containers, including info about manufactures, order date, barcode, owner, location, etc. However, info about molecule (MW, structures, safety, etc) and database related such as users will be reserved.
This is particularly helpful when you need to update a large amount of chemicals via text import.
Login into your server via ssh
Login into myswl using root account or user account with administrator priviledge for the database that you want to change. Replace “root” with the username if desired
3. Show database and then choose the database of interest. test
is the name of the database in this example
4. Remove the chemical container by running the following command
5. (Optional): Run the command below if you want to reset the id counter (chemical_storage_id
as well as autogenerated barcode)
6. Log out of mysql, restart httpd and mariadb services
7. Go back to OE website and import new tab-separated text file
Update (Oct 11, 2019): new function to delete multiple containers based on barcode has been added into Settings section. Only users with admin permission would see this option.
If you have existing barcodes for your chemical containers, use the following settings
Login into OE with the database that you want to modify, using an admin account, (or root account, or an account with sufficient permission)
Navigate to Settings/Global Settings/Inventory
Important: when switching to this setting, you have to generate your own storage(locations) barcodes as well as user barcodes. See below for way to automatically generate location and user barcodes.
Issue: if the existing barcode column is the last column in the tab-separated text file, when imported into OE, the “\n” will also be imported as part of the barcode. This lead to terminal window does not work with existing barcode. Use the following methods to remove this trailing “\n” character
Login into your server via ssh
Login into mysql using root account or user account with administrator priviledge for the database that you want to change. Replace “root” with the username if desired
3. Show database and then choose the database of interest. “test” is the name of the database in this example:
4. Remove the chemical container by running the following command
5. Log out of mysql, restart httpd and mariadb services
Update (as of 2019-08-01, for Khoi’s modified version): functions “Autogenerate barcode” has been added into Settings for Admin roles. Users with admin permission can login into OE web interface, go to Settings/Autogenerate barcode
and click the corresponding button to autogenerate storage and/or user barcodes.
Issue: when switching to using pre-existing barcode instead of using OE-generated barcodes, the system won’t work well if no existing barcode for storages and users are added. Use the code below in mysql to automatically add barcodes for storage using OE-generated code.
While these barcodes look the same, they have to be generated in order for terminal to work
Login into your server via ssh
Login into mysql using root account or user account with administrator privilege for the database that you want to change. Replace “root” with the username if desired
3. Show database and then choose the database of interest. “test” is the name of the database in this example:
4. You can check if the new generated barcode first by running this in phpMyAdmin (easier to see result). See explanation below for the complicated function. Compared the “new_barcode” with the autogenerated barcode to make sure the function work well.
5. Update the “storage” table, by setting “storage_barcode” field. “storage_barcode” field is a binary so cast() was used. Note, this whole function inside cast() is to convert “storage_id” field to EAN8 barcode. See here for more info on how to make EAN8 barcode: http://www.barcodeisland.com/ean8.phtml
Explain: default in OE, the barcode for storage is “92xxxxxy” with the last digit “y” (digit number 8 on 1-based) is the check sum of the first 7 digits. The “xxxxx” labeled in red is the “storage_id” left padded with “0” (number zero).
For example: if “storage_id”=1 => “storage_barcode”=92000018
Exit mysql:
Update (as of 2019-08-01, for Khoi’s modified version): functions “Autogenerate barcode” has been added into Settings for Admin roles. Users with admin permission can login into OE web interface, go to Settings/Autogenerate barcode
and click the corresponding button to autogenerate storage and/or user barcodes.
Issue: when switching to using pre-existing barcode instead of using OE-generated barcodes, the system won’t work well if no existing barcode for storages and users are added. Use the code below in mysql to automatically add barcodes for USER using OE-generated barcode.
While these barcodes look the same, they have to be generated in order for terminal to work
Login into your server via ssh
Login into mysql using root account or user account with administrator privilege for the database that you want to change. Replace “root” with the username if desired
3. Show database and then choose the database of interest. “test” is the name of the database in this example:
4. You can check if the new generated barcode first by running this in phpMyAdmin (easier to see result). See explanation below for the complicated function. Compared the “new_barcode” with the autogenerated barcode to make sure the function work well.
5. Update the “storage” table, by setting storage_barcode
field. storage_barcode
field is a binary so cast() was used. Note, this whole function inside cast() is to convert storage_id
field to EAN8 barcode. See here for more info on how to make EAN8 barcode: http://www.barcodeisland.com/ean8.phtml
Explain: default in OE, the barcode for PERSON is “91xxxxxy” with the last digit “y” (digit number 8 on 1-based) is the check sum of the first 7 digits. The “xxxxx” labeled in red is the “person_id” left padded with “0” (number zero).
For example: if “person_id”=1 => “person_barcode”=91000019
6. Exit mysql:
In the default setting of OE, the exact location of a chemical belonging to a different group is masked. This setting will help you to allow some specific person or everyone to be able to see locations of chemicals outside of your own groups
Login into the server via ssh and then convert to root user or use sudo command. The following is using sudo command
It is a good idea to save an original copy of this file first. Modify the file lib_output.php
inside open enventory folder. In this example, the open enventory folder is named “oe”. The specific location of your folder might change. Change the path accordingly.
3. Change the content of the file as follow. Note, this is on line 2584 so google to search for some term in vi; otherwise you will need to scroll a lot.
Original content:
To let EVERYONE see the locations:
To let a specific user to see the location, change the content as follow. In this example, the person name is “special_person”
Below guide is referenced from:
Prepare the excel file with one column as storage with the same name as those found in OE. Export to csv file, csv file does not have to have the same column but it is best to have the first 2 columns is the storage name and barcode
Login into mysql as root user using:
2. Show all databases and choose the correct database to modify (in this example “test” is the name of the database):
3. Create a temporary table (in this example temp_storage
is the name of the database, storage and barcode are the 2 headlines of the 2 columns):
4. Load csv data file into temp_storage
table (in this example test
is the name of the database; “ignore 1 lines” because the csv file head 1 line headline):
5. Update storage table
6. Remove the temporary table
Copy csv files into /var/lib/mysql
Open phpMyAdmin console.
Choose the right databases
4. Run ALL of these commands AT ONCE (Ctrl-Enter to run command(s) in phpMyAdmin console)
If you find a blank page after clicking the check mark :
This will create n number of window for different styles of label when click on this Print Dymo Label
button (). Also, this code will close these pop-up windows automatically after 30 seconds (30000 miliseconds)
This will make this button () always show up even if the dymo plugin for browser is not detected.