Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:gsoc09_pr [2009/08/14 00:33]
kethees
dev:gsoc09_pr [2009/08/14 01:21] (current)
kethees
Line 8: Line 8:
 Person Registry(PR) is a centralized location in SAHANA Disaster Management System to collect Individual and Group/Organization information. Its a place for data about people affiliated with SAHANA Disaster Management System. Person Registry(PR) is a centralized location in SAHANA Disaster Management System to collect Individual and Group/Organization information. Its a place for data about people affiliated with SAHANA Disaster Management System.
  
-There are several incidents where Individual or Group/Organization information can be used in SAHANA during disaster or pre deployment of SAHANA. The Individual or Group/Organization information can be used in other person oriented modules by using centralized person search functionality in PR. Each person may have multiple roles such missing person, disaster victim, logistic oriented person and etc. This functionality will avoid collecting reduntant data in SAHANA.+There are several incidents where Individual or Group/Organization information can be used in SAHANA during disaster or pre deployment of SAHANA. The Individual or Group/Organization information can be used in other person oriented modules by using centralized person search functionality in PR. Each person may have multiple roles such missing person, disaster victim, logistic oriented person and etc. This functionality will avoid collecting redundant data in SAHANA.
  
 == Core Functionality == == Core Functionality ==
Line 23: Line 23:
  
 == Future Enhancement(s) == == Future Enhancement(s) ==
-   * Tracking person roles such missing person, disaster victim, logistic oriented person and etc within PR. +   * Integrating Person Registry with other person oriented modules. 
 +   * Tracking person roles such missing person, disaster victim, logistic oriented person and etc within PR
 +   * Enhancing Person API and lib_chart.inc library functionalities.
  
-=== Person Library ===+===== Person API =====
  
 == Generate Person Box == == Generate Person Box ==
Line 32: Line 34:
  
 The function for person form is as follows: The function for person form is as follows:
- shn_form_person(); +<code php> 
 +shn_form_person(); 
 +</code>
 Above function will include form elements in your form Above function will include form elements in your form
- <input name="full_name" id="full_name" value="" disabled="disabled" tabindex="1" type="text"> +<code php> 
- <input name="person_id" value="" type="hidden"> +<input name="full_name" id="full_name" value="" disabled="disabled" tabindex="1" type="text"> 
- <input value="Add" onclick="popup_show(... " type="button">+<input name="person_id" value="" type="hidden"> 
 +<input value="Add" onclick="popup_show(... " type="button"
 +</code>
  
 In Add button click event person form is poped up with following form fields In Add button click event person form is poped up with following form fields
Line 48: Line 53:
 Person full_name and person_id are returned and assigned in save action of the popup form. Person full_name and person_id are returned and assigned in save action of the popup form.
  
- 
-== Person API == 
 Person Registry class files Person Registry class files
  
 data_class.php data_class.php
     * Contents all sql statements.     * Contents all sql statements.
 +
 person_class.php person_class.php
 +<code php>
     * $person = New Person();     * $person = New Person();
  
Line 61: Line 66:
     * $person->get_person($p_uuid);     * $person->get_person($p_uuid);
     * $person->delete_person($p_uuid);     * $person->delete_person($p_uuid);
 +</code>
  
 group_class.php group_class.php
 +<code php>
     * $group = New Group();     * $group = New Group();
  
Line 70: Line 77:
     * $group->get_group($g_uuid);     * $group->get_group($g_uuid);
     * $group->delete_group($g_uuid);     * $group->delete_group($g_uuid);
 +</code>
  
 address_class.php address_class.php
 +<code php>
     * $address = New Address();     * $address = New Address();
  
Line 77: Line 86:
     * $address->update_person_address();     * $address->update_person_address();
     * $address->get_person_address($p_uuid);     * $address->get_person_address($p_uuid);
 +</code>
  
 identity_class.php identity_class.php
 +<code php>
     * $identity = New Identity();     * $identity = New Identity();
  
Line 84: Line 95:
     * $identity->update_person_identity();     * $identity->update_person_identity();
     * $identity->get_person_identity($p_uuid);     * $identity->get_person_identity($p_uuid);
 +</code>
 +
 +===== Open Flash Chart Library =====
 +
 +This allows you to creat a chart with Flash capability. In order to use following function, you need to do is include lib_chart.inc library and call the shn_draw_chart() API function.
 +
 +== Chart API ==
 +
 +    * lib_chart.inc library includes following code snippets.
 +<code php>
 +   include_once $global['approot']. '/3rd/php-ofc-library/open_flash_chart_object.php';
 +   include_once $global['approot'] .'/3rd/php-ofc-library/open-flash-chart.php';
 +
 +   function shn_draw_chart($width, $height, $data_file_url)
 +   {
 +       $base = 'res/ofc/';
 +       open_flash_chart_object($width, $height,$data_file_url,true,$base);
 +   }
 +
 +</code>
 +
 +Sample $data_file_url formed via stream as follows.
 +
 +e.g:
 +<code php>
 +$url_gender = 'index.php?mod=pr&act=gender&stream=text';
 +</code>
 +
 +<code php>
 +   function shn_text_pr_gender(){
 +      $array = Data::get_pr_gender();
 +      $data = $array['data'];
 +      $label = $array['label'];
 +
 +      foreach($data as $d){
 +         $total += $d;
 +      }
 +      
 +      foreach($data as $key=>$d){
 +         $data[$key] = round(($d/$total*100),2);
 +      }
  
 +      $g = new graph();
 +      $g->bg_colour='#FFFFFF';
 +      $g->pie(60,'#505050','{font-size: 10px; color: #404040;');
 +      $g->pie_values( $data, $label );
 +      $g->pie_slice_colours( array('#31A43F','#A79810','#D21389') );
 +      $g->set_tool_tip( ' Label: #x_label#<br>Value: #val#%' );
 +      $g->title( 'Gender', '{font-size:14px; color: #d01f3c}' );
 +      echo $g->render();
 +   }
 +</code>
 == Ontology == == Ontology ==
     * [[dev:pr_class_diagram_1.03.png | Modified draft version of Person class diagram]]     * [[dev:pr_class_diagram_1.03.png | Modified draft version of Person class diagram]]

Navigation
QR Code
QR Code dev:gsoc09_pr (generated for current page)