Customization Frequently Asked Questions
Here are the most frequently asked questions concerning customization of Simple Groupware. General information about customizing can be found here.
How can I generate reports with or from Simple Groupware?
You can use the custom PHP include module to create a PHP based report, see this page.
You can also use a SQL query with sgsML, for example "<sgs-dir>/bin/modules/ schema_sys/nosql_processes.xml" (the query is in the "default_sql" attribute).
Another option might be to query the database directly with Eclipse Birt, Crystal Reports, JasperReports, etc.
How can I set individual permissions on each contact, bookmark, etc.?
You can edit the corresponding module, e.g. "<sgs-dir>/bin/modules/schema/contacts.xml", and replace:
<table ...
with:
<table enable_asset_rights="full" ...
This gives a new tab in the "edit" and "new" views to set additional permissions only affecting the corresponding dataset. The defaults are "read" and "write" permissions for everyone (anonymous). To set the defaults to the current username, you can use "owner_read" instead of "full". To enable only individual write permissions, you can use "owner_write" instead of "full".
How can I change a module only for a special folder?
You can edit the folder in "/Workspace/System/Tree" and fill the "Custom schema" field with some new sgsML describing the changes.
For example, customize a task folder:
<?xml version="1.0" encoding="utf-8"?>
<table>
<!-- Add new view for high priority tasks -->
<view name="highprio" displayname="High priority" template="display"
where="(priority='immediate' or priority='urgent')" before="details">
</view>
<!-- Add second description field -->
<field name="description2" displayname="Description 2" simple_type="textarea"
before="url">
<notin views="display|display2|calendar"/>
</field>
<!-- Disable project and milestone fields -->
<field name="project"/>
<field name="milestone"/>
<!-- Change description label -->
<field name="description" displayname="My custom label"
simple_type="textarea">
<notin views="display|display2|calendar"/>
</field>
</table>
The custom schema acts as a differential schema gets automatically merged with the schema defined by the corresponding module. So you can add new fields, change existing fields, hide fields, add new views, etc.
How can I put all datasets of a big folder into a separate table in the database? (better performance)
You can edit the folder in "/Workspace/System/Tree" and fill the "Custom schema" field with some sgsML referencing the new table. Then move all relevant datasets from the old table to the new one.
For example, move a E-mail folder:
<?xml version="1.0" encoding="utf-8"?> <table name="simple_emails_2"> </table>
In the SQL console run:
INSERT INTO simple_emails_2 SELECT * FROM simple_emails WHERE folder=<folder-id>;
and:
DELETE FROM simple_emails WHERE folder=<folder-id>;
Note: Folder merging does not work across different tables.
How can I forbid folder deletion but keep rights on creating, editing and deleting elements?
You can change the required rights from "write" to "admin" in "<sgs-dir>/bin/ajax.php" (server-side) and from "rights_writeable_folder" to "rights_admin" in "<sgs-dir>/bin/ext/js/functions.js".
replace:
static function folder_delete($folder) {
self::_require_access($folder, "write");
with:
static function folder_delete($folder) {
self::_require_access($folder, "admin");
replace:
if (!no_folder_operations && rights_writeable_folder) {
...
smenuitem("{t}Delete incl subfolders{/t}","folder_delete()");
with:
if (!no_folder_operations && rights_admin) {
...
smenuitem("{t}Delete incl subfolders{/t}","folder_delete()");