[CS-Project-svn_notify] SF.net SVN: cs-project:[902] trunk/1.2/includes/setup/3.inc
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-07-22 01:16:06
|
Revision: 902 http://cs-project.svn.sourceforge.net/cs-project/?rev=902&view=rev Author: crazedsanity Date: 2008-07-22 01:16:04 +0000 (Tue, 22 Jul 2008) Log Message: ----------- Remove record type and log category stuff. /includes/setup/3.inc: * go(): -- remove call to create_record_type_data() * create_log_categories_and_classes(): -- don't add "logcat__" stuff to the internal data array (which is eventually written to the config file. * create_record_type_data() [DELETED]: -- unneeded method removed. Modified Paths: -------------- trunk/1.2/includes/setup/3.inc Modified: trunk/1.2/includes/setup/3.inc =================================================================== --- trunk/1.2/includes/setup/3.inc 2008-07-21 03:48:49 UTC (rev 901) +++ trunk/1.2/includes/setup/3.inc 2008-07-22 01:16:04 UTC (rev 902) @@ -155,7 +155,6 @@ //now that we've connected, start doing stuff. $retval = $this->set_version(); $retval .= "<BR>\n". $this->create_log_categories_and_classes(); - $retval .= "<BR>\n". $this->create_record_type_data(); $retval .= "<BR>\n". $this->create_attributes(); $retval .= "<BR>\n". $this->create_anonymous_contact_data(); $retval .= "<BR>\n". $this->create_status_records(); @@ -369,7 +368,6 @@ //good. $counter++; $this->totalRecords++; - $this->data['logcat__'. strtolower($name)] = $num; } else { throw new exception(__METHOD__ .": failed to create category record for (". $name .")::: ". $dberror ."<BR>\nSQL::: ". $sql); @@ -471,66 +469,6 @@ //========================================================================= - private function create_record_type_data() { - //format: - // {record_type_id} => array({name}, {module}) - $recordTypes = array( - 1 => array('Project', 'project'), - 2 => array('Task', 'task'), - 3 => array('Helpdesk', 'helpdesk') - ); - - $retval = 0; - foreach($recordTypes as $recTypeId => $subData) { - $insertArr = array( - 'record_type_id' => $recTypeId, - 'name' => $subData[0], - 'module' => $subData[1] - ); - $sql = "INSERT INTO record_type_table ". $this->gfObj->string_from_array($insertArr, 'insert', NULL, 'sql'); - $numrows = $this->db->exec($sql); - $dberror = $this->db->errorMsg(); - - if(!strlen($dberror) && $numrows == 1) { - $this->totalRecords++; - $retval++; - $this->data['rectype__'. $insertArr['module']] = $recTypeId; - } - else { - throw new exception(__METHOD__ .": failed to create record for ". $insertArr['name'] - .", dberror::: ". $dberror ."<BR>\nSQL::: ". $sql); - } - } - - if(count($recordTypes) == $retval) { - - $sql = "SELECT setval('record_type_table_record_type_id_seq'::text, (SELECT max(record_type_id) FROM record_type_table))"; - $numrows = $this->db->exec($sql); - $dberror = $this->db->errorMsg(); - - if(!strlen($dberror) && $numrows == 1) { - if($retval == count($recordTypes)) { - $retval = "Created all record types (". $retval .")"; - } - else { - throw new exception(__METHOD__ .": internal error (sanity check failed)"); - } - } - else { - throw new exception(__METHOD__ .": failed to reset sequence::: ". $dberror ."<BR>\nSQL::: ". $sql); - } - } - else { - throw new exception(__METHOD__ .": internal error"); - } - - return($retval); - }//end create_record_type_data() - //========================================================================= - - - - //========================================================================= private function create_attributes() { $attributes = array( 3 => array('phone', 'phone', 'Phone'), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |