Skip to content
Michael Coleman edited this page Mar 29, 2015 · 6 revisions
  1. summary Some information for those who would like to contribute
  2. labels Phase-Implementation,Featured

Table of Contents

Introduction

There are several thing a contributor should take care. Since security is becoming more and more an issue we need to stick to some rules in order to make SI safer.

Table of Contents <wiki:toc max_depth="2"></wiki:toc>


Security

With the following commands the output can be sanitized/escaped.

Within Templates

|| |htmlsafe || escape html|| || |urlesafe || sanitises a whole url to be put into src or href. Will not allow javascript: urls.|| || |urlencode || escapes something to be put into a query string|| || |outhtml || sanitises raw html for output.||

Outside of Templates

|| htmlsafe() || escape html|| || urlesafe() || sanitises a whole url to be put into src or href. Will not allow javascript: urls.|| || urlencode() || escapes something to be put into a query string|| || outhtml() || sanitises raw html for output.||


Developer FAQs

How to display PHP errors on screen

Edit config/config.ini and set

In general you should always show all error messages while you develop. This helps us to get a better and more stable code.


How to write a SQL Patch

To add a sql patch in Simple Invoices follow the steps below:

  * Write the sql for this patch in a way that wont mess with anyone data
    * that includes not changing the encoding of rows etc.. 
  * Once you've got the sql for the patch written open up the file include/sql_patches.php and copy the format of the other sql patches to create
    * $sql_patch_name_ is the name of the patch
      * ie. $sql_patch_name_8 = "Edit default invoice template field lenght to 50"; 
      * $sql_patch_8 is the actual sql for the patch
      * ie. $sql_patch_8 = "ALTER TABLE si_defaults CHANGE def_inv_template def_inv_template VARCHAR( 50 ) DEFAULT NULL"; 
      * $sql_patch_update_ is the sql to insert a row into the sql patchmanger table to say that the patch has been applied
      * ie. $sql_patch_update_8 = "INSERT INTO si_sql_patchmanager ( sql_id ,sql_patch_ref , sql_patch , sql_release , sql_statement ) VALUES (,8,'$sql_patch_name_8',20060526,)"; 

file::/include/sql_patches.php

  * Once the patch has been written the database_sqlpatches.php file has to be update to check and run this patch
    * open the file and add your patch to the run code
    * copy the format used for the other patches ie. run_sql_patch(8,$sql_patch_name_8,$sql_patch_8,$sql_patch_update_8); 
    * edit the file to add the sql for sql patch code
    * copy the format used for the other patches
    * ie. check_sql_patch(8,$sql_patch_name_8); 

file::/database_sqlpatches.php

    * Now if you go to the Database Upgrade Manager page in Simple Invoices if will give you a list of all the patches that have and have not been applied, if alls well it should say that your newly added patch hasnt been applied. 
    * To run the sql patch to make sure it works click the UPDATE button in the Database Upgrade Manager screen and Simple Invoices will check which patches have been applied and applied the ones that havent been applied. If this works fine you can commit you sql patch to subversion 

Subversion access

If you have an intention of commiting code to Simple Invoices register in the dev mailinglist at http://dev.simpleinvoices.org/ and then email us with your gmail username and we will add you as a project member. In order to get your subversion password go to the page http://code.google.com/hosting/settings

Check Out

To checkout a copy of Simple Invoices in the command line. Use the following command:

  • when asked for your password use your google subversion password NOT your gmail password*



If you wish to check out subversion anonymously (which means you WONT be able to check the project in if you make any changes) but you will get the latest code

refer:

  * http://code.google.com/p/simpleinvoices/source/checkout

Commiting

 NOTE: you can only commit code into Simple Invoices if you have checked out the code using HTTPS and your gmail name

Before you commit some code please check always that there are at least no compile errors. You can do this by calling this command (under Linux):

And please check your httpd error log as well if you have some run-time errors like e.g. uninitialized variables.

Monitoring

Each time a commit it made to our svn and email automatically gets sent to our tracker at http://tracker.simpleinvoices.org/

Register yourself there if you want to know what code is commited and and issues have been solved etc.


3rd Party Libraries

SimpleInvoices leverages the following third party libraries for the Single Domain Version (SDV) and Multi Domain Version (MDV) (unless specifically indicated). Paths for the libraries may be different. SDV will have libraries in /include and /modules/include but MDV has all libraies in /include.

|| *Solution* || *License* || *Integration Notes* || ||http://www.jquery.com/|jquery || GPL || || ||jquery autocomplete || GPL || || ||jquery tabs || GPL || || ||jquery accordian menu] || GPL/MIT? || || ||jquery data selector || GPL/MIT? || || ||GreyBox || LGPL || || ||AJS JavaScript library || LGPL || || ||Open Rico Live Grid Plus || Apache 2.0 || || ||ADxMenu || CC || || ||TinyMCE || LGPL || || ||PHPReports || GPL || PHPReport mods - Rare PHPReport Error Fixes|| ||Javascript MD5 || BSD || || ||Smarty Template Engine || LGPL || || ||Tango icons || CC || || ||FamFamFam silk icons || CC || || ||PHPMailer || CC || Phpmailer and SMTP class files can just be replaced ||


3rd Party Libraries - SDV, version 2011.1 onwards

Note: this list is currently incomplete