Changeset 72


Ignore:
Timestamp:
Jan 7, 2007 3:19:44 AM (6 years ago)
Author:
dkg
Message:

JPDD: added organizations (with descriptions), editable by admins.

Location:
trunk/jpdd
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/jpdd/class.dkg.row.php

    r71 r72  
    2929<fieldset><legend>New '.$sn.'</legend> 
    3030'.$dkg_site->getFormTokenHiddenInput().' 
    31 '.$this->getCreationFormInnards().' 
     31'.(method_exists($this, 'getCreationFormInnards') ? $this->getCreationFormInnards() : $this->getFormInnards()).' 
    3232<div style="clear:both;"><input type="submit" value="Make new '.$sn.'"/></div> 
    3333</form> 
     
    4242<fieldset><legend>Edit '.$sn.' '.$this->getLinkedTitle().'</legend> 
    4343'.$dkg_site->getFormTokenHiddenInput().' 
    44 '.$this->getEditFormInnards().' 
     44'.(method_exists($this, 'getEditFormInnards') ? $this->getEditFormInnards() : $this->getFormInnards()).' 
    4545<div style="clear:both;"><input type="submit" value="Save changes"/></div> 
    4646</form> 
     
    104104        } 
    105105 
    106         function getDescription($allowempty = false) { 
     106        function getDescription($allowempty = true) { 
    107107          global $dkg_site; 
    108108          if (!is_null($this->_description)) { 
     
    116116        } 
    117117 
    118         function getCreationFormInnards() { 
     118        function getFormInnards() { 
    119119      return ''; 
    120120    } 
     
    130130        $ret .= "\n".'<div><a href="'.$this->getEditPath().'">edit</a></div>'."\n"; 
    131131      } 
     132      $dd = $this->getDescription(); 
     133      if (!$dkg_site->isEmpty($dd)) { 
     134        $ret .= '<div>'.$dd.'</div>'; 
     135      } 
    132136      $ret .= $this->getDetailInnards(); 
    133137          return $ret; 
  • trunk/jpdd/class.jpdd.php

    r67 r72  
    1717                                              'filename' => 'class.jpdd.person.php', 
    1818                                              'table' => 'person')); 
     19      $this->addClassMapEntry('organization', array('classname' => 'JPDD_Organization',  
     20                                                    'filename' => 'class.jpdd.organization.php', 
     21                                                    'table' => 'organization')); 
    1922    } 
    2023 
  • trunk/jpdd/class.jpdd.workshop.php

    r71 r72  
    2525        } 
    2626 
    27         function getCreationFormInnards() { 
    28           return $this->getFormInnards(); 
    29         } 
    30         function getEditFormInnards() { 
    31           return $this->getFormInnards(); 
    32         } 
    3327        function getFormInnards() { 
    3428          global $jpdd; 
  • trunk/jpdd/sql/db.sql

    r71 r72  
    6969CREATE TABLE organization ( 
    7070    id serial NOT NULL, 
    71     title character varying NOT NULL 
     71    title character varying NOT NULL, 
     72    description text 
    7273); 
    7374 
     
    331332REVOKE ALL ON TABLE organization FROM dkg; 
    332333GRANT ALL ON TABLE organization TO dkg; 
    333 GRANT SELECT ON TABLE organization TO "www-data"; 
     334GRANT INSERT,SELECT,UPDATE ON TABLE organization TO "www-data"; 
     335 
     336 
     337-- 
     338-- Name: organization_id_seq; Type: ACL; Schema: public; Owner: dkg 
     339-- 
     340 
     341REVOKE ALL ON TABLE organization_id_seq FROM PUBLIC; 
     342REVOKE ALL ON TABLE organization_id_seq FROM dkg; 
     343GRANT ALL ON TABLE organization_id_seq TO dkg; 
     344GRANT SELECT,UPDATE ON TABLE organization_id_seq TO "www-data"; 
    334345 
    335346 
Note: See TracChangeset for help on using the changeset viewer.