Sahana libraries’ limitation of a common interface

Brain dump by nilushan on August 27th 2009

In an attempt to make a reusable component for form handling in Logistics, that supports validation and performs form processing automatically, I went through a few difficulties that are prevailing in the current libraries.

The form library does not use a common interface,

eg. lib_form.inc

function shn_form_button($name, $button_opts = null, $extra_opts = null)
function shn_form_text($label, $name, $text_opts = null, $extra_opts = null )
function shn_form_hidden($hidden_vars)
function shn_form_checkbox($label, $name, $text_opts = null, $extra_opts = null)
function shn_form_select($options,$label, $name,$select_opts = “”, $extra_opts = null)
function shn_form_radio($options, $label, $name, $select_opts = “”, $extra_opts = null)
function shn_form_radio2($options, $label, $name, $checked, $extra_opts = null)
function shn_form_multi_select($name,$options, $label, $select_opts = “”, $extra_opts = null)
function shn_form_opt_checkbox($opt_field,$extra_opts=null)
function shn_form_textarea($label, $name, $text_opts=null, $extra_opts = null)
function shn_form_upload($label, $name, $extra_opts = null)
function shn_form_label($label, $caption, $extra_opts = null)
function shn_form_password($label, $name, $text_opts = null, $extra_opts = null)
function shn_form_date($label, $name, $extra_opts=null)

The function signatures are different in even the same kind of form elements. Since the form elements do not have a common interface, it is hard to use these functions in a generalized way.

I feel that a better approach would be something like in the Zend Framework. The form elements in Zend framework are as below.

class Zend_Form_Element_Button extends Zend_Form_Element_Submit
class Zend_Form_Element_Reset extends Zend_Form_Element_Submit

class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml
class Zend_Form_Element_File extends Zend_Form_Element_Xhtml
class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
class Zend_Form_Element_Hidden extends Zend_Form_Element_Xhtml
class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
class Zend_Form_Element_Text extends Zend_Form_Element_Xhtml
class Zend_Form_Element_Textarea extends Zend_Form_Element_Xhtml
class Zend_Form_Element_Password extends Zend_Form_Element_Xhtml

class Zend_Form_Element_Multiselect extends Zend_Form_Element_Select
class Zend_Form_Element_Select extends Zend_Form_Element_Multi

class Zend_Form_Element_Radio extends Zend_Form_Element_Multi
class Zend_Form_Element_MultiCheckbox extends Zend_Form_Element_Multi

class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml

abstract class Zend_Form_Element_Multi extends Zend_Form_Element_Xhtml

abstract class Zend_Form_Element_Xhtml extends Zend_Form_Element

They all inherit from the same type, therefore having a common interface.

Zend is a Object Oriented framework whereas Sahana is procedural, therefore it might be hard to enforce the use of a common interface for the same kind of elements in Sahana libraries

Additional enhancements are Functioning in SAHANA RMS, IMS modules

Brain dump by mahesh on August 26th 2009

Last couple of months we (The Respere Team) were implementing a Donor Management System for sarvodaya which provides some additional enhancements for existing Catalog, Inventory and request Management Modules. The additional enhancements that we have added are listed below.

Inventory Management Module

  • Inventory Ownership - Track an owner for Inventory. Advantage of tracking an owner is user can categorize Inventories as Organization inventory, Shelter inventory, etc….
  • Consolidated Items - Provides a UI to get little amount from several items and create a consolidated kit. Then the system keeps track on the newly created kits. (ex: 2 Books + 1 Pen + 1 Pencil = 1Educational Kit )
  • Buy Items - Provides a UI to use donated money to buy particular items to particular inventories

Request/Aid Management Module

  • Donor’s Organization - Capture Donor’s Organization details if the Donor is from a particular Organization
  • Integration with Inventory Management System - When a pledge is added to the system that      particular pledge displays as an Inventory Item and when a request is fulfilled requested item amount deducts from particular inventories

Additional reports that we have provided

  • Detailed Request Report
  • Request Summary
  • Detailed Pledges
  • Pledge Summary
  • Cash Pledge Report
  • Item Pledge Report
  • Donations Received
  • Disbursement
  • Inventory Report - Report about available items in inventories
  • Inventory History - Report about Item transition history between inventories

It is a great pleassure to announce that all of the above features are functioning in SAHANA right now and hope to add those features in the proposed Logistic module as well

New look for Sahana

Brain dump by dilantha on August 20th 2009

As Niranga mentioned in previous post our main goal was to remove the side menu bars and give some more room for the content. So now you can see there is more space left in the content than earlier.We can use it display the content more clearly or to add more functionalities.

Here are some screen shots of the new theme

Still we publish this as a demo version. There are lot more functionalities  to be added. So we are kindly request you to visit the site and give us your ideas about this theme .It will be really helpful for us to improve the quality of this. we have already received some comments and new ideas to improve the theme from various people in sahana community . Those will be considered when developing the second phase of the theme and we will start it nearly in the future.. :)

New Look for Sahana

Brain dump by niranga on August 20th 2009

According to a request of a new theme for Sahana by Tim McNamara, me and Dilantha designed a new theme. You can visit demo version of our theme at http://demo.respere.com/dnn/.

The main objective of the this theme is to provide maximum space for the content of the modules. In default Sahana theme the menu items acquire 200px from the entire content space. Because of that the space that can be used to display module content will be reduced. So if we can hide the menu items when we are not using them, we can have extra 200px for the content area.

As Tim suggested we removed the menu divs from the current location and placed the in the top of the site. Using Javascript we make those divs appear and disappear by mouse events. When the mouse moves over or clicks on the “Sections” heading, the Module Menu will be shown. The sub menu item has a special feature. That is it can be pinned or unpinned according to the users choice. If the user feels like he/she wants to use the sub menus frequently, he/she can “Pin” the sub menu.

We are expecting comments on our new theme, so we can develop this theme to fulfil everyones needs.

talksahana   © 2007   The Folk that Talk Sahana | Powered by WordPress