cs-project-svn_notify Mailing List for CS-Project (Page 4)
Brought to you by:
crazedsanity
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(65) |
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(34) |
Feb
(82) |
Mar
(21) |
Apr
(12) |
May
(16) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(1) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
(5) |
Sep
(12) |
Oct
(11) |
Nov
(4) |
Dec
(15) |
2010 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <cra...@us...> - 2009-07-30 14:24:03
|
Revision: 966 http://cs-project.svn.sourceforge.net/cs-project/?rev=966&view=rev Author: crazedsanity Date: 2009-07-30 14:23:57 +0000 (Thu, 30 Jul 2009) Log Message: ----------- Converted a couple of *.png files to *.gif & updated templates to reflect it. Modified Paths: -------------- trunk/1.2/templates/content/helpdesk/view.content.tmpl trunk/1.2/templates/content/related_task.shared.tmpl trunk/1.2/templates/content/tags/index.content.tmpl Added Paths: ----------- trunk/1.2/public_html/images/bullet-round.gif trunk/1.2/public_html/images/icon-help.gif Removed Paths: ------------- trunk/1.2/public_html/images/bullet-round.png trunk/1.2/public_html/images/icon-help.png Added: trunk/1.2/public_html/images/bullet-round.gif =================================================================== (Binary files differ) Property changes on: trunk/1.2/public_html/images/bullet-round.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/1.2/public_html/images/bullet-round.png =================================================================== (Binary files differ) Added: trunk/1.2/public_html/images/icon-help.gif =================================================================== (Binary files differ) Property changes on: trunk/1.2/public_html/images/icon-help.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/1.2/public_html/images/icon-help.png =================================================================== (Binary files differ) Modified: trunk/1.2/templates/content/helpdesk/view.content.tmpl =================================================================== --- trunk/1.2/templates/content/helpdesk/view.content.tmpl 2009-02-12 16:39:25 UTC (rev 965) +++ trunk/1.2/templates/content/helpdesk/view.content.tmpl 2009-07-30 14:23:57 UTC (rev 966) @@ -20,7 +20,7 @@ <td>{public_id} [<b><a href="/extern/helpdesk/view?ID={public_id}">External Link</a></b>] <a href="/help/helpdesk/external_link" target="_blank"> - <img src="/images/icon-help.png" border="0"></a></td> + <img src="/images/icon-help.gif" border="0"></a></td> <td rowspan="4" align="left" nowrap> <!-- BEGIN access_block --> @@ -30,7 +30,7 @@ <td style="border-left:solid #000 1px;border-top:solid #000 1px;">Assigned: <a href="/help/helpdesk/assigned" target="_blank"> - <img src="/images/icon-help.png" border="0"></a> + <img src="/images/icon-help.gif" border="0"></a> </td> <td style="border-right:solid #000 1px;border-top:solid #000 1px;" nowrap> @@ -47,7 +47,7 @@ <tr> <td style="border-left:solid #000 1px;">Priority: <a href="/help/helpdesk/priority" target="_blank"> - <img src="/images/icon-help.png" border="0"></a> + <img src="/images/icon-help.gif" border="0"></a> </td> <td style="border-right:solid #000 1px"> @@ -65,7 +65,7 @@ Attached to project: <a href="/help/helpdesk/project_linkage" target="_blank"> - <img src="/images/icon-help.png" border="0"></a> + <img src="/images/icon-help.gif" border="0"></a> <br>[ <b>{ancestryLinkList}</b> ] </td> @@ -97,7 +97,7 @@ <tr> <th colspan="2" style="background-color:#FFF"> Notified Users <a href="/help/helpdesk/notified_users" target="_blank"> - <img src="/images/icon-help.png" border="0"></a> + <img src="/images/icon-help.gif" border="0"></a> </th> </tr> <tr> @@ -149,7 +149,7 @@ <tr> <th align="right">Tags: <a href="/help/tag" target="_blank"> - <img src="/images/icon-help.png" border="0"></a> + <img src="/images/icon-help.gif" border="0"></a> </th> <td colspan="2"> @@ -226,7 +226,7 @@ <a href="/help/helpdesk/submit_buttons" target="_blank"> - <img src="/images/icon-help.png" border="0"></a> + <img src="/images/icon-help.gif" border="0"></a> <BR> Is this a <b>Solution</b>? Modified: trunk/1.2/templates/content/related_task.shared.tmpl =================================================================== --- trunk/1.2/templates/content/related_task.shared.tmpl 2009-02-12 16:39:25 UTC (rev 965) +++ trunk/1.2/templates/content/related_task.shared.tmpl 2009-07-30 14:23:57 UTC (rev 966) @@ -4,7 +4,7 @@ <b>Related Tasks: </b> (<a href='/content/task/create?parentPublicId={public_id}&module={module}' target=_top>Create</a>): <a href="/help/task" target="_blank"> - <img src="/images/icon-help.png" border="0"></a> + <img src="/images/icon-help.gif" border="0"></a> <!-- BEGIN taskPrefWarning --> <BR><font color="red"><b>Warning:</b></font> Not all issues will be displayed, due to your <a href="/content/settings">preferences</a>. <!-- END taskPrefWarning --> @@ -36,4 +36,4 @@ </tr> <!-- END related_task_row --> -</table> \ No newline at end of file +</table> Modified: trunk/1.2/templates/content/tags/index.content.tmpl =================================================================== --- trunk/1.2/templates/content/tags/index.content.tmpl 2009-02-12 16:39:25 UTC (rev 965) +++ trunk/1.2/templates/content/tags/index.content.tmpl 2009-07-30 14:23:57 UTC (rev 966) @@ -10,7 +10,7 @@ <td> <!-- BEGIN availableTagsList --> <div id="listedTag_%%tagNameId%%" style="padding-left:5px;"> - <img src="/images/bullet-round.png" border="0"> + <img src="/images/bullet-round.gif" border="0"> <a href="javascript:void(xajax_ajax__showtagrecords(%%tagNameId%%));"> %%tagName%%</a> <!-- BEGIN availableTagsList__tagIcon --> <img src="/images/tags/%%icon_name%%.gif" border="0"> @@ -19,7 +19,7 @@ <!-- END availableTagsList --> <!-- BEGIN availableTagsList_noLink --> <div id="noListedTags" style="padding-left:5px;"> - <img src="/images/bullet-round.png" border="0"> + <img src="/images/bullet-round.gif" border="0"> <font size="+1"><b>%%tagName%%</b></font> {availableTagsList__tagIcon} </div> @@ -60,7 +60,7 @@ </tr> <tr> <td><b>Modifier:</b> - <a href="/help/tag/modifier" target="_blank"><img src="/images/icon-help.png" border="0"></a></td> + <a href="/help/tag/modifier" target="_blank"><img src="/images/icon-help.gif" border="0"></a></td> <td> <select name="modifier" onChange="this.form.submit();"> {modifier_option_list} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-12 16:39:28
|
Revision: 965 http://cs-project.svn.sourceforge.net/cs-project/?rev=965&view=rev Author: crazedsanity Date: 2009-02-12 16:39:25 +0000 (Thu, 12 Feb 2009) Log Message: ----------- Formatting, set assigned user when solving (#252), minor wording fix (#195). /lib/helpdeskClass.php: * solve(): -- set the assigned user to be the current user (#252). /templates/content/project/view/index.content.tmpl: * valign=top for related tasks/notes and issues. /templates/content/project/view/related_issue.content.tmpl: * change "preferences" to "issues" (typo)(#195) Modified Paths: -------------- trunk/1.2/lib/helpdeskClass.php trunk/1.2/templates/content/project/view/index.content.tmpl trunk/1.2/templates/content/project/view/related_issue.content.tmpl Modified: trunk/1.2/lib/helpdeskClass.php =================================================================== --- trunk/1.2/lib/helpdeskClass.php 2009-02-10 17:52:09 UTC (rev 964) +++ trunk/1.2/lib/helpdeskClass.php 2009-02-12 16:39:25 UTC (rev 965) @@ -263,6 +263,12 @@ "status_id" => 4 ); + //If it's not assigned, assign it to the current user. + $oldData = $this->get_record($this->helpdeskId); + if(is_null($oldData['leader_contact_id']) && is_numeric($_SESSION['contact_id'])) { + $updatesArr['leader_contact_id'] = $_SESSION['contact_id']; + } + $retval = $this->update_record($this->helpdeskId, $updatesArr); //log the action. Modified: trunk/1.2/templates/content/project/view/index.content.tmpl =================================================================== --- trunk/1.2/templates/content/project/view/index.content.tmpl 2009-02-10 17:52:09 UTC (rev 964) +++ trunk/1.2/templates/content/project/view/index.content.tmpl 2009-02-12 16:39:25 UTC (rev 965) @@ -118,12 +118,12 @@ </td> </tr> <tr> - <td width="50%"> + <td width="50%" valign="top"> <div id="related_task" width="100%">{related_task}</div> <div id="related_note" style="padding-top:1em;">{related_note}</div> </td> - <td width="50%"> + <td width="50%" valign="top"> <div id="related_issue">{related_issue}</div> </td> </tr> Modified: trunk/1.2/templates/content/project/view/related_issue.content.tmpl =================================================================== --- trunk/1.2/templates/content/project/view/related_issue.content.tmpl 2009-02-10 17:52:09 UTC (rev 964) +++ trunk/1.2/templates/content/project/view/related_issue.content.tmpl 2009-02-12 16:39:25 UTC (rev 965) @@ -2,7 +2,7 @@ <tr> <td colspan="6"><b>Related Helpdesk Issues</b> (<a href="/content/helpdesk/create?proj={public_id}&goBack=1">Create</a>): <!-- BEGIN helpdeskPrefWarning --> - <BR><font color="red"><b>Warning:</b></font> Not all preferences will be displayed, due to your <a href="/content/settings">Preferences</a>. + <BR><font color="red"><b>Warning:</b></font> Not all issues will be displayed, due to your <a href="/content/settings">Preferences</a>. <!-- END helpdeskPrefWarning --> <hr></td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 17:52:16
|
Revision: 964 http://cs-project.svn.sourceforge.net/cs-project/?rev=964&view=rev Author: crazedsanity Date: 2009-02-10 17:52:09 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Remove the setup filename instead of it's location (and only if it exists). Modified Paths: -------------- trunk/1.2/lib/config.class.php Modified: trunk/1.2/lib/config.class.php =================================================================== --- trunk/1.2/lib/config.class.php 2009-02-10 17:43:56 UTC (rev 963) +++ trunk/1.2/lib/config.class.php 2009-02-10 17:52:09 UTC (rev 964) @@ -302,7 +302,12 @@ //------------------------------------------------------------------------- public function remove_setup_config() { - return($this->fs->rm(SETUP_FILE_LOCATION)); + $retval = false; + if(file_exists(constant('SETUP_FILENAME'))) { + $retval = $this->fs->rm(constant('SETUP_FILENAME')); + } + + return($retval); }//end remove_setup_config() //------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 17:44:02
|
Revision: 963 http://cs-project.svn.sourceforge.net/cs-project/?rev=963&view=rev Author: crazedsanity Date: 2009-02-10 17:43:56 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Fix check for writability of lib to rw, implement tests for external libs. /includes/setup/1.inc: * remove unnecessary (completed) TODO * check "rw" directory instead of lib (now we write config to the rw dir) * NOTE::: if the rw directory isn't writable, config{} throws an exception that can't be caught here. Until such time as the error can be caught or some other workaround is added, the error will not be a nice one. /includes/setup/5.inc: * add unit tests for cs-arrayToPath, cs-content, and cs-phpxml. Modified Paths: -------------- trunk/1.2/includes/setup/1.inc trunk/1.2/includes/setup/5.inc Modified: trunk/1.2/includes/setup/1.inc =================================================================== --- trunk/1.2/includes/setup/1.inc 2009-02-10 17:14:40 UTC (rev 962) +++ trunk/1.2/includes/setup/1.inc 2009-02-10 17:43:56 UTC (rev 963) @@ -6,8 +6,6 @@ $requiredFields = array('dbname', 'host', 'port', 'user', 'password'); -//TODO: consider adding a check that the /lib directory is writable, to avoid errors later on. - if($_POST) { reset_all_steps(FALSE); store_setup_data(1, $_POST['fields']); @@ -42,11 +40,11 @@ } else { //check if the /lib dir is writeable, so they've been warned. - $fsObj = new cs_fileSystem(dirname(__FILE__) .'/../../lib'); + $fsObj = new cs_fileSystem(dirname(__FILE__) .'/../../rw'); if(!$fsObj->is_writable(NULL)) { $page->set_message_wrapper(array( 'title' => "Warning", - 'message' => "The lib directory of your install isn't writable. Please correct this <BR>\n" . + 'message' => "The 'rw' directory of your install isn't writable. Please correct this <BR>\n" . "before continuing, as setup will not be able create the config.xml file.", 'type' => 'notice' )); Modified: trunk/1.2/includes/setup/5.inc =================================================================== --- trunk/1.2/includes/setup/5.inc 2009-02-10 17:14:40 UTC (rev 962) +++ trunk/1.2/includes/setup/5.inc 2009-02-10 17:43:56 UTC (rev 963) @@ -28,6 +28,9 @@ $test = &new TestSuite("All Tests"); $test->addTestFile(dirname(__FILE__) .'/../../lib/_unitTests_/cs-content_tests.php'); + $test->addTestFile(dirname(__FILE__) .'/../../lib/cs-arrayToPath/tests/testOfA2P.php'); + $test->addTestFile(dirname(__FILE__) .'/../../lib/cs-content/tests/testOfCSContent.php'); + $test->addTestFile(dirname(__FILE__) .'/../../lib/cs-phpxml/tests/testOfCSPHPXML.php'); $display = new HtmlReporter(); $test->run($display); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 17:14:45
|
Revision: 962 http://cs-project.svn.sourceforge.net/cs-project/?rev=962&view=rev Author: crazedsanity Date: 2009-02-10 17:14:40 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Update setup to handle new config, fix accidental redirection after setup. /includes/setup.inc: * only redirect if DATABASE__DBNAME is set AND there's no "setup" array under $_SESSION. /includes/setup/5.inc: * Change message contents when POST is discovered * remove commented-out code * log unit test results. * __finalStep::write_config(): -- add tags for SITE_ROOT & such (from the config::convert_to_sections()) -- add attributes for setting things to global/constant as needed. -- move all config settings to /config/main instead of being directly under /config. -- add attribute "usecssiteconfig" to the root tag. /lib/config.class.php: * move call to get_config_contents() into the "if" tag that runs only when the config file exists. /lib/_unitTests_/cs-content_tests.php: * remove extra space from expected value to avoid test failure. Modified Paths: -------------- trunk/1.2/includes/setup/5.inc trunk/1.2/includes/setup.inc trunk/1.2/lib/_unitTests_/cs-content_tests.php trunk/1.2/lib/config.class.php Modified: trunk/1.2/includes/setup/5.inc =================================================================== --- trunk/1.2/includes/setup/5.inc 2009-02-10 16:06:42 UTC (rev 961) +++ trunk/1.2/includes/setup/5.inc 2009-02-10 17:14:40 UTC (rev 962) @@ -10,29 +10,45 @@ $writeConfigResult = $obj->write_config($page); $page->set_message_wrapper(array( - 'title' => "Reloaded... ", + 'title' => "Setup Complete", 'message' => $writeConfigResult, 'type' => "status", - 'linkURL' => '/login' + 'linkText' => "Proceed To Login", + 'linkURL' => '/setup/5?removeData=1' )); $page->conditional_header("/setup/5", TRUE); } +elseif($_GET['removeData'] == 1) { + unset($_SESSION['setup']); + $page->conditional_header('/login.php'); +} else { if(get_setup_data(5, 'result')) { $page->clear_content(); - #$page->set_block_row('content', 'submitButton'); $test = &new TestSuite("All Tests"); $test->addTestFile(dirname(__FILE__) .'/../../lib/_unitTests_/cs-content_tests.php'); - #$test->addTestFile(dirname(__FILE__) .'/../../lib/_unitTests_/cs-arrayToPath_tests.php'); - #$test->addTestFile(dirname(__FILE__) .'/../../lib/_unitTests_/cs-phpxml_tests.php'); $display = new HtmlReporter(); $test->run($display); $page->gfObj->debug_print("Passes: (". $display->getPassCount() .")"); - } - else { + //log our result into the database. + $db = new cs_phpDB; + $db->connect(get_config_db_params()); + + $log = new logsClass($db, 'SETUP'); + $log->log_by_class('UNIT TEST DATA::: passes='. $display->getPassCount() .', fails='. $display->getFailCount() .', exceptions='. $display->getExceptionCount(), 'Information'); + + if(!is_array($_SESSION['message'])) { + $page->set_message_wrapper(array( + 'title' => "Setup Complete", + 'message' => "Setup has been completed successfully. If you would like to remove setup data and proceed to login, click the link below.", + 'type' => 'status', + 'linkText' => "Proceed to Login", + 'linkURL' => "/setup/5?removeData=1" + )); + } } } @@ -74,15 +90,49 @@ } //now that we've built the array successfully, now let's turn it into XML. - $xmlCreator = new cs_phpxmlCreator('config/main'); + $xmlCreator = new cs_phpxmlCreator('config'); + $tagPath = "/config/main"; + $xmlCreator->add_tag($tagPath); + $xmlCreator->add_attribute($tagPath, array('fix'=>"sanitizeDirs")); + $xmlCreator->set_tag_as_multiple($tagPath); + + //Special values (including vars that cs_siteConfig{} handles) + $specialValues = array( + 'site_root' => '{_DIRNAMEOFFILE_}/..', + 'document_root' => '{MAIN/SITE_ROOT}', + 'libdir' => '{MAIN/SITE_ROOT}/lib', + 'tmpldir' => '{MAIN/SITE_ROOT}/templates', + 'seq_helpdesk' => 'special__helpdesk_public_id_seq', + 'seq_project' => 'special__project_public_id_seq', + 'seq_main' => 'record_table_record_id_seq', + 'table_todocomment' => 'task_comment_table', + 'format_wordwrap' => '90' + ); + $defineAsGlobal=array('site_root', 'libdir', 'tmpldir'); + foreach($specialValues as $index=>$value) { + $xmlCreator->add_tag($tagPath .'/'. $index, $value); + $attributes = array('setconstant'=>1); + if(array_search($index, $defineAsGlobal)) { + $attributes['setglobal']=1; + } + $xmlCreator->add_attribute($tagPath .'/'. $index, $attributes); + } + + $skipSetConstant = array('version_string', 'workingonit'); foreach($myData as $index=>$value) { - $xmlCreator->add_tag($index, $value); + $xmlCreator->add_tag($tagPath ."/". $index, $value); + $attributes=array(); + if(!strlen(array_search($index, $skipSetConstant))) { + $attributes['setconstant']=1; + } + $xmlCreator->add_attribute($tagPath .'/'. $index, $attributes); } $extraAttributes = array( - 'generated' => date('Y-m-d H:m:s'), - 'version' => $myData['version_string'] + 'generated' => date('Y-m-d H:m:s'), + 'version' => $myData['version_string'], + 'usecssiteconfig' => 1 ); - $xmlCreator->add_attribute('/config/main', $extraAttributes); + $xmlCreator->add_attribute('/config', $extraAttributes); //now, create an XML string... $xmlString = $xmlCreator->create_xml_string(); Modified: trunk/1.2/includes/setup.inc =================================================================== --- trunk/1.2/includes/setup.inc 2009-02-10 16:06:42 UTC (rev 961) +++ trunk/1.2/includes/setup.inc 2009-02-10 17:14:40 UTC (rev 962) @@ -22,7 +22,7 @@ $configObj = new config(NULL, FALSE); $configData = $configObj->read_config_file(FALSE); -if(strlen($configData['DATABASE__DBNAME'])) { +if(strlen($configData['DATABASE__DBNAME']) && !is_array($_SESSION['setup'])) { //setup already complete. Stop 'em. $page->set_message_wrapper(array( 'title' => "Setup Unavailable", Modified: trunk/1.2/lib/_unitTests_/cs-content_tests.php =================================================================== --- trunk/1.2/lib/_unitTests_/cs-content_tests.php 2009-02-10 16:06:42 UTC (rev 961) +++ trunk/1.2/lib/_unitTests_/cs-content_tests.php 2009-02-10 17:14:40 UTC (rev 962) @@ -95,7 +95,7 @@ ), 'styles' => array( 'select' => "field1='value1' AND field2='value2'", - 'insert' => "(field1, field2) VALUES ('value1', 'value2')", + 'insert' => "(field1, field2) VALUES ('value1','value2')", 'update' => "field1='value1', field2='value2'" ) ), @@ -113,7 +113,7 @@ foreach($testData as $name=>$data) { foreach($data['styles'] as $styleName => $expectedOutput) { $realOutput = $this->gfObj->string_from_array($data['input'], $styleName, NULL, 'sql'); - $this->assertEqual($realOutput, $expectedOutput, "invalid output for style (".$styleName ."): ". $realOutput); + $this->assertEqual($realOutput, $expectedOutput); } } }//end testSQLCreation() Modified: trunk/1.2/lib/config.class.php =================================================================== --- trunk/1.2/lib/config.class.php 2009-02-10 16:06:42 UTC (rev 961) +++ trunk/1.2/lib/config.class.php 2009-02-10 17:14:40 UTC (rev 962) @@ -48,11 +48,9 @@ $this->gf->debug_print(__METHOD__ .": converting to use sections..."); $this->convert_to_sections(); } - parent::__construct($this->fs->realcwd .'/'. $this->fileName); + $this->config = $this->get_config_contents(TRUE); } - - $this->config = $this->get_config_contents(TRUE); }//end __construct() //------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 16:06:45
|
Revision: 961 http://cs-project.svn.sourceforge.net/cs-project/?rev=961&view=rev Author: crazedsanity Date: 2009-02-10 16:06:42 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Fix exception when no configuration file exists... /lib/config.class.php: * __construct(): -- only call parent::__construct() if the config file exists. Modified Paths: -------------- trunk/1.2/lib/config.class.php Modified: trunk/1.2/lib/config.class.php =================================================================== --- trunk/1.2/lib/config.class.php 2009-02-10 16:05:35 UTC (rev 960) +++ trunk/1.2/lib/config.class.php 2009-02-10 16:06:42 UTC (rev 961) @@ -48,10 +48,10 @@ $this->gf->debug_print(__METHOD__ .": converting to use sections..."); $this->convert_to_sections(); } + + parent::__construct($this->fs->realcwd .'/'. $this->fileName); } - parent::__construct($this->fs->realcwd .'/'. $this->fileName); - $this->config = $this->get_config_contents(TRUE); }//end __construct() //------------------------------------------------------------------------- @@ -166,7 +166,7 @@ */ if(file_exists(OLD_CONFIG_FILE_LOCATION)) { //copy old file to new location... - $fs = new cs_fileSystemClass(dirname(__FILE__) .'/../'); + $fs = new cs_fileSystem(dirname(__FILE__) .'/../'); $moveRes = $fs->move_file(OLD_CONFIG_FILE_LOCATION, CONFIG_FILE_LOCATION); if(!$moveRes) { throw new exception(__METHOD__ .": failed to move existing config into new location (". $moveRes .")"); @@ -251,7 +251,7 @@ if($checkOwnership === TRUE) { //read the object. - $xmlParser = new xmlParser($this->fs->read(SETUP_FILE_LOCATION)); + $xmlParser = new cs_phpxmlParser($this->fs->read(SETUP_FILE_LOCATION)); $configData = $xmlParser->get_tree(TRUE); $configData = $configData['CONFIG']; @@ -281,7 +281,7 @@ //------------------------------------------------------------------------- private function create_setup_config() { - $xmlCreator = new xmlCreator('config'); + $xmlCreator = new cs_phpxmlCreator('config'); $attributes = array( 'creation' => time() ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 16:05:39
|
Revision: 960 http://cs-project.svn.sourceforge.net/cs-project/?rev=960&view=rev Author: crazedsanity Date: 2009-02-10 16:05:35 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Fixed another old class name. Modified Paths: -------------- trunk/1.2/includes/setup.inc Modified: trunk/1.2/includes/setup.inc =================================================================== --- trunk/1.2/includes/setup.inc 2009-02-10 16:05:13 UTC (rev 959) +++ trunk/1.2/includes/setup.inc 2009-02-10 16:05:35 UTC (rev 960) @@ -150,7 +150,7 @@ //============================================================================= function read_version_file() { $retval = NULL; - $fsObj = new cs_fileSystemClass(dirname(__FILE__) .'/..'); + $fsObj = new cs_fileSystem(dirname(__FILE__) .'/..'); //okay, all files present: check the version in the VERSION file. $lines = $fsObj->read('VERSION', TRUE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 16:05:20
|
Revision: 959 http://cs-project.svn.sourceforge.net/cs-project/?rev=959&view=rev Author: crazedsanity Date: 2009-02-10 16:05:13 +0000 (Tue, 10 Feb 2009) Log Message: ----------- More updating of class names. Modified Paths: -------------- trunk/1.2/includes/setup/1.inc trunk/1.2/includes/setup/2.inc trunk/1.2/includes/setup/5.inc Modified: trunk/1.2/includes/setup/1.inc =================================================================== --- trunk/1.2/includes/setup/1.inc 2009-02-10 16:04:50 UTC (rev 958) +++ trunk/1.2/includes/setup/1.inc 2009-02-10 16:05:13 UTC (rev 959) @@ -42,7 +42,7 @@ } else { //check if the /lib dir is writeable, so they've been warned. - $fsObj = new cs_fileSystemClass(dirname(__FILE__) .'/../../lib'); + $fsObj = new cs_fileSystem(dirname(__FILE__) .'/../../lib'); if(!$fsObj->is_writable(NULL)) { $page->set_message_wrapper(array( 'title' => "Warning", Modified: trunk/1.2/includes/setup/2.inc =================================================================== --- trunk/1.2/includes/setup/2.inc 2009-02-10 16:04:50 UTC (rev 958) +++ trunk/1.2/includes/setup/2.inc 2009-02-10 16:05:13 UTC (rev 959) @@ -68,7 +68,7 @@ //========================================================================= public function __construct(cs_phpDB &$db, cs_genericPage &$page) { $this->db = $db; - $this->fsObj = new cs_fileSystemClass(dirname(__FILE__) .'/../../docs/sql/setup'); + $this->fsObj = new cs_fileSystem(dirname(__FILE__) .'/../../docs/sql/setup'); $this->gfObj = new cs_globalFunctions; $this->page = $page; Modified: trunk/1.2/includes/setup/5.inc =================================================================== --- trunk/1.2/includes/setup/5.inc 2009-02-10 16:04:50 UTC (rev 958) +++ trunk/1.2/includes/setup/5.inc 2009-02-10 16:05:13 UTC (rev 959) @@ -51,7 +51,7 @@ unset($this->stepData[5]); $this->gfObj = new cs_globalFunctions; - $this->fsObj = new cs_fileSystemClass(dirname(__FILE__) ."/../../". CONFIG_DIRECTORY); + $this->fsObj = new cs_fileSystem(dirname(__FILE__) ."/../../". CONFIG_DIRECTORY); }//end __construct() //========================================================================= @@ -74,7 +74,7 @@ } //now that we've built the array successfully, now let's turn it into XML. - $xmlCreator = new xmlCreator('config'); + $xmlCreator = new cs_phpxmlCreator('config/main'); foreach($myData as $index=>$value) { $xmlCreator->add_tag($index, $value); } @@ -82,7 +82,7 @@ 'generated' => date('Y-m-d H:m:s'), 'version' => $myData['version_string'] ); - $xmlCreator->add_attribute('/config', $extraAttributes); + $xmlCreator->add_attribute('/config/main', $extraAttributes); //now, create an XML string... $xmlString = $xmlCreator->create_xml_string(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 16:04:53
|
Revision: 958 http://cs-project.svn.sourceforge.net/cs-project/?rev=958&view=rev Author: crazedsanity Date: 2009-02-10 16:04:50 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Update class names. Modified Paths: -------------- trunk/1.2/lib/_unitTests_/cs-content_tests.php trunk/1.2/lib/abstractClasses/dbAbstract.class.php trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA4.php Modified: trunk/1.2/lib/_unitTests_/cs-content_tests.php =================================================================== --- trunk/1.2/lib/_unitTests_/cs-content_tests.php 2009-02-10 15:59:16 UTC (rev 957) +++ trunk/1.2/lib/_unitTests_/cs-content_tests.php 2009-02-10 16:04:50 UTC (rev 958) @@ -10,7 +10,7 @@ function setUp() { $this->gfObj = new cs_globalFunctions; - $this->fsObj = new cs_fileSystemClass; + $this->fsObj = new cs_fileSystem; $this->contentObj = new contentSystem; }//end setUp() @@ -32,7 +32,7 @@ function testFileReading() { unset($this->fsObj); - $this->fsObj = new cs_fileSystemClass(dirname(__FILE__)); + $this->fsObj = new cs_fileSystem(dirname(__FILE__)); $dirData = $this->fsObj->ls(); if($this->assertTrue(is_array($dirData)) && $this->assertTrue(isset($dirData['data'])) && $this->assertTrue($dirData['data']['type'] == 'dir')) { Modified: trunk/1.2/lib/abstractClasses/dbAbstract.class.php =================================================================== --- trunk/1.2/lib/abstractClasses/dbAbstract.class.php 2009-02-10 15:59:16 UTC (rev 957) +++ trunk/1.2/lib/abstractClasses/dbAbstract.class.php 2009-02-10 16:04:50 UTC (rev 958) @@ -65,7 +65,7 @@ //========================================================================= final public function run_sql_file($filename) { if(!is_object($this->fsObj)) { - $this->fsObj = new cs_fileSystemClass; + $this->fsObj = new cs_fileSystem; } $this->lastSQLFile = $filename; Modified: trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA4.php =================================================================== --- trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA4.php 2009-02-10 15:59:16 UTC (rev 957) +++ trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA4.php 2009-02-10 16:04:50 UTC (rev 958) @@ -104,7 +104,7 @@ //========================================================================= public function update_config_file() { - $fs = new cs_fileSystemClass(dirname(__FILE__) .'/../'); + $fs = new cs_fileSystem(dirname(__FILE__) .'/../'); $sampleXmlObj = new cs_phpxmlParser($fs->read('docs/samples/sample_config.xml')); $siteXmlObj = new cs_phpxmlParser($fs->read(CONFIG_FILE_LOCATION)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 15:59:27
|
Revision: 957 http://cs-project.svn.sourceforge.net/cs-project/?rev=957&view=rev Author: crazedsanity Date: 2009-02-10 15:59:16 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Updated upgrade script to use proper class names for XML stuff. Modified Paths: -------------- trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA4.php Modified: trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA4.php =================================================================== --- trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA4.php 2009-02-10 15:56:45 UTC (rev 956) +++ trunk/1.2/upgrade/upgradeTo1.2.0-ALPHA4.php 2009-02-10 15:59:16 UTC (rev 957) @@ -105,10 +105,10 @@ //========================================================================= public function update_config_file() { $fs = new cs_fileSystemClass(dirname(__FILE__) .'/../'); - $sampleXmlObj = new XMLParser($fs->read('docs/samples/sample_config.xml')); - $siteXmlObj = new XMLParser($fs->read(CONFIG_FILE_LOCATION)); + $sampleXmlObj = new cs_phpxmlParser($fs->read('docs/samples/sample_config.xml')); + $siteXmlObj = new cs_phpxmlParser($fs->read(CONFIG_FILE_LOCATION)); - $updateXml = new xmlCreator(); + $updateXml = new cs_phpxmlCreator(); $updateXml->load_xmlparser_data($siteXmlObj); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-10 15:56:48
|
Revision: 956 http://cs-project.svn.sourceforge.net/cs-project/?rev=956&view=rev Author: crazedsanity Date: 2009-02-10 15:56:45 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Remove old tests that aren't used. Removed Paths: ------------- trunk/1.2/lib/_unitTests_/cs-arrayToPath_tests.php trunk/1.2/lib/_unitTests_/cs-phpxml_tests.php Deleted: trunk/1.2/lib/_unitTests_/cs-arrayToPath_tests.php =================================================================== --- trunk/1.2/lib/_unitTests_/cs-arrayToPath_tests.php 2009-02-09 20:38:40 UTC (rev 955) +++ trunk/1.2/lib/_unitTests_/cs-arrayToPath_tests.php 2009-02-10 15:56:45 UTC (rev 956) @@ -1,14 +0,0 @@ -<?php -/* - * Created on Sep 20, 2007 - * - */ - -class Test_csarrayToPath extends UnitTestCase { - function testVersion() { - - } - -} - -?> Deleted: trunk/1.2/lib/_unitTests_/cs-phpxml_tests.php =================================================================== --- trunk/1.2/lib/_unitTests_/cs-phpxml_tests.php 2009-02-09 20:38:40 UTC (rev 955) +++ trunk/1.2/lib/_unitTests_/cs-phpxml_tests.php 2009-02-10 15:56:45 UTC (rev 956) @@ -1,21 +0,0 @@ -<?php -/* - * Created on Sep 20, 2007 - * - */ - -class Test_csphpxml extends UnitTestCase { - - function setUp() { - $this->xmlParser = new XMLParser(file_get_contents(dirname(__FILE__) .'/data/test.xml')); - $this->assertTrue(is_object($this->xmlParser)); - - $this->xmlBuilder = new xmlBuilder(NULL); - $this->assertTrue(is_object($this->xmlBuilder)); - - $this->xmlCreator = new xmlCreator(); - } - -} - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-09 20:38:44
|
Revision: 955 http://cs-project.svn.sourceforge.net/cs-project/?rev=955&view=rev Author: crazedsanity Date: 2009-02-09 20:38:40 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Fix missing template issue (#253), remove old commented code, cs-content v1.0A8 /includes/content/project/index.inc: * remove call to html_file_to_string() for grep's sake. /includes/extern/helpdesk.inc: * remove call to html_file_to_string() for grep's sake. /lib/config.class.php: * convert_to_sections(): -- remove leading slashes from config vars (#253) /lib/globalFunctions.php: * get_required_external_lib_versions(): -- update to cs-content v1.0-ALPHA8 * html_file_to_string(): -- throw an exception about missing template files instead of setting a message (it can cause misleading messages)(#253). Modified Paths: -------------- trunk/1.2/includes/content/project/index.inc trunk/1.2/includes/extern/helpdesk.inc trunk/1.2/lib/config.class.php trunk/1.2/lib/globalFunctions.php Modified: trunk/1.2/includes/content/project/index.inc =================================================================== --- trunk/1.2/includes/content/project/index.inc 2009-02-09 19:13:13 UTC (rev 954) +++ trunk/1.2/includes/content/project/index.inc 2009-02-09 20:38:40 UTC (rev 955) @@ -29,7 +29,6 @@ } $page->ui->set_cache("expandArr", $expandArr); - #$page->change_content(html_file_to_string("modules/project/project_main.tmpl")); $page->set_all_block_rows("content"); //set some template vars for the filtering. Modified: trunk/1.2/includes/extern/helpdesk.inc =================================================================== --- trunk/1.2/includes/extern/helpdesk.inc 2009-02-09 19:13:13 UTC (rev 954) +++ trunk/1.2/includes/extern/helpdesk.inc 2009-02-09 20:38:40 UTC (rev 955) @@ -211,7 +211,6 @@ //================================================================================================================ $titleSub = "Show All"; //change the content of the page properly. - #$page->change_content(html_file_to_string("modules/helpdesk/helpdesk_main.tmpl")); $page->set_all_block_rows("content", array("helpdesk_search")); $filterData = $page->ui->get_cache("filter"); Modified: trunk/1.2/lib/config.class.php =================================================================== --- trunk/1.2/lib/config.class.php 2009-02-09 19:13:13 UTC (rev 954) +++ trunk/1.2/lib/config.class.php 2009-02-09 20:38:40 UTC (rev 955) @@ -346,11 +346,11 @@ $dataArray['SITE_ROOT']['value'] = '{_DIRNAMEOFFILE_}/..'; $dataArray['SITE_ROOT']['attributes']['cleanpath'] = 1; - //Set some other special values... - { - $dataArray['DOCUMENT_ROOT']['value'] = '{/MAIN/SITE_ROOT}'; - $dataArray['LIBDIR']['value'] = '{/MAIN/SITE_ROOT}/lib'; - $dataArray['TMPLDIR']['value'] = '{/MAIN/SITE_ROOT}/templates'; + + {//Set some other special values... + $dataArray['DOCUMENT_ROOT']['value'] = '{MAIN/SITE_ROOT}'; + $dataArray['LIBDIR']['value'] = '{MAIN/SITE_ROOT}/lib'; + $dataArray['TMPLDIR']['value'] = '{MAIN/SITE_ROOT}/templates'; $dataArray['SEQ_HELPDESK']['value'] = 'special__helpdesk_public_id_seq'; $dataArray['SEQ_PROJECT']['value'] = 'special__project_public_id_seq'; $dataArray['SEQ_MAIN']['value'] = 'record_table_record_id_seq'; Modified: trunk/1.2/lib/globalFunctions.php =================================================================== --- trunk/1.2/lib/globalFunctions.php 2009-02-09 19:13:13 UTC (rev 954) +++ trunk/1.2/lib/globalFunctions.php 2009-02-09 20:38:40 UTC (rev 955) @@ -17,7 +17,7 @@ function get_required_external_lib_versions($projectName=NULL) { //format: {className} => array({projectName} => {exactVersion}) $requirements = array( - 'contentSystem' => array('cs-content', '1.0.0-ALPHA7'), + 'contentSystem' => array('cs-content', '1.0.0-ALPHA8'), 'cs_phpxmlParser' => array('cs-phpxml', '1.0.0-ALPHA4'), 'cs_arrayToPath' => array('cs-arrayToPath', '1.0.0') ); @@ -110,12 +110,8 @@ cs_debug_backtrace(1); //Could not find the file requested to stringify. //Sending warning to user and logging it. - - set_message( - "Warning!", - "Could not find all files necessary to create this page.<br>Please call technical support.<BR>\nfile=[". $file ."]", - "","status" - ); + + throw new exception(__FUNCTION__ .": template file does not exist (". $file ."), output from template_file_exists=(". $filename .")"); return(NULL); } @@ -1356,7 +1352,13 @@ if(file_exists($filename)) { $retval = $filename; - } + } + else { + + $gf = new cs_globalFunctions; + $gf->debug_print(__FUNCTION__ .": TMPLDIR=(". $GLOBALS['TMPLDIR'] ."), filename=(". $filename .")"); + exit; + } return($retval); }//end template_file_exists() //================================================================================================================ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-09 19:13:16
|
Revision: 954 http://cs-project.svn.sourceforge.net/cs-project/?rev=954&view=rev Author: crazedsanity Date: 2009-02-09 19:13:13 +0000 (Mon, 09 Feb 2009) Log Message: ----------- *** RELEASE 1.2.0-ALPHA11 *** CHANGE LOG::: * fix inability to solve issues introduced in 1.2.0-ALPHA10 (#250) * implement cs_siteConfig (#251) * minor superficial code changes * removed some commented-out code & some old debugging stuff. SVN COMMANDS::: merge --depth=infinity -r949:HEAD https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/1.2 Modified Paths: -------------- releases/1.2/VERSION releases/1.2/includes/content/helpdesk/view.inc releases/1.2/lib/config.class.php releases/1.2/lib/helpdeskClass.php releases/1.2/lib/site_config.php Modified: releases/1.2/VERSION =================================================================== --- releases/1.2/VERSION 2009-02-09 19:08:54 UTC (rev 953) +++ releases/1.2/VERSION 2009-02-09 19:13:13 UTC (rev 954) @@ -1,4 +1,4 @@ $Id:VERSION 628 2007-11-20 16:58:45Z crazedsanity $ -VERSION: 1.2.0-ALPHA10 +VERSION: 1.2.0-ALPHA11 $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/VERSION $ Modified: releases/1.2/includes/content/helpdesk/view.inc =================================================================== --- releases/1.2/includes/content/helpdesk/view.inc 2009-02-09 19:08:54 UTC (rev 953) +++ releases/1.2/includes/content/helpdesk/view.inc 2009-02-09 19:13:13 UTC (rev 954) @@ -78,8 +78,6 @@ $useRespondLink = FALSE; if($_POST['isSolution']) { //IT'S A SOLUTION - //solve it & make sure they know if it was good or not. - #$result = $proj->helpdeskObj->solve($helpdeskId, $_POST['solution']); $remarks[] = array( 'remark' => $_POST['remark'], 'isSolution' => true @@ -155,9 +153,6 @@ ); } - #$page->gfObj->debug_print($_POST,1); - #$page->gfObj->debug_print($setMessage,1); - #exit; $page->set_message_wrapper($setMessage); } elseif($action == "re-open") { @@ -197,20 +192,7 @@ unset($_SESSION['goBackLink']); } - if($action == "create") { - create_page_title($page, array('title' => "Create a Helpdesk Issue")); - $page->set_all_block_rows("content"); - - //show the "category" selection. - $categoryList = $proj->helpdeskObj->get_category_list('bug', TRUE); - $page->add_template_var("select_tags", $categoryList); - - // - $page->add_template_var("email", $_SESSION['email']); - $page->add_template_var("linked_proj", cleanString($_GET['proj']),"numeric"); - - } - elseif($action == "view" && !is_numeric($helpdeskId)) { + if($action == "view" && !is_numeric($helpdeskId)) { //missing ID: throw a message & send 'em packin'. set_message_wrapper(array( "title" => "Invalid ID Specified", @@ -269,20 +251,6 @@ $doNotRipRows[] = "assigned_optionList"; $doNotRipRows[] = "priority_optionList"; $doNotRipRows[] = "editable_tags"; - if(($assignedStr == $_SESSION['contact_id']) || ($assignedStr == "" || is_null($assignedStr))) { - //well, we can show 'em the update/modify button. - $doNotRipRows[] = "update_button"; - if($_SESSION['contact_id'] == $assignedStr) { - //they're the owner... show 'em more options. - $doNotRipRows[] = "solution_row"; - $doNotRipRows[] = "owner_options"; - } - //if they're the owner, show 'em more options... - } - elseif($_SESSION['isGroupOwner']) { - //we got an OWNER!!! - $doNotRipRows[] = "owner_options"; - } $doNotRipRows[] = "remark_row"; $doNotRipRows[] = "buttons_row"; $doNotRipRows[] = 'accessBlock__modifyButton'; @@ -295,9 +263,6 @@ //keep the set of data allows it to be linked to a project. $doNotRipRows[] = "edit_project_selection"; - - //TODO: implement a link for updating project associations. - #$page->add_template_var("select_project_list", $proj->create_project_option_list($helpdeskData['ancestry'], NULL)); } $doNotRipRows[] = 'update_button'; Modified: releases/1.2/lib/config.class.php =================================================================== --- releases/1.2/lib/config.class.php 2009-02-09 19:08:54 UTC (rev 953) +++ releases/1.2/lib/config.class.php 2009-02-09 19:13:13 UTC (rev 954) @@ -1,6 +1,8 @@ <?php -class config { +require_once(dirname(__FILE__) .'/cs-content/cs_siteConfig.class.php'); + +class config extends cs_siteConfig { private $data; @@ -11,7 +13,7 @@ private $siteStatus; private $setupRequired = FALSE; private $fileName; - private $config; + protected $config; //------------------------------------------------------------------------- public function __construct($fileName=NULL) { @@ -36,6 +38,20 @@ if(!$this->fs->is_writable(CONFIG_DIRECTORY)) { throw new exception(__METHOD__ .": the config directory (". CONFIG_DIRECTORY .") isn't writable!"); } + + if($this->fileExists) { + //check to see if it all config items are directly under the root, or if they're already in sections. + $xml = new cs_phpxmlParser($this->fs->read($this->fileName)); + $checkThis = $xml->get_attribute('/CONFIG', 'USECSSITECONFIG'); + + if(!strlen($checkThis)) { + $this->gf->debug_print(__METHOD__ .": converting to use sections..."); + $this->convert_to_sections(); + } + } + + parent::__construct($this->fs->realcwd .'/'. $this->fileName); + $this->config = $this->get_config_contents(TRUE); }//end __construct() //------------------------------------------------------------------------- @@ -55,10 +71,10 @@ if($simple) { $config = $xmlParser->get_tree(TRUE); - $config = $config['CONFIG']; + $config = $config['CONFIG']['MAIN']; } else { - $config = $xmlParser->get_path('/CONFIG'); + $config = $xmlParser->get_path('/CONFIG/MAIN'); unset($config['type'], $config['attributes']); } @@ -66,7 +82,7 @@ $myConfig = $config; if(!$simple) { $myConfig = $xmlParser->get_tree(TRUE); - $myConfig = $myConfig['CONFIG']; + $myConfig = $myConfig['CONFIG']['MAIN']; } $conditionallySet = array('VERSION_STRING', 'WORKINGONIT'); foreach($myConfig as $index=>$value) { @@ -76,9 +92,6 @@ define($index, $value); } } - else { - define($index, $value); - } } } } @@ -95,27 +108,11 @@ //------------------------------------------------------------------------- /** - * Read the XML config file & return it's simplified contents + * Read the XML config file & return it's simplified contents (just a + * wrapper for get_config_contents(); kept for backwards-compatibility) */ public function read_config_file($defineConstants=TRUE, $setEverything=TRUE) { - $config = $this->get_config_contents(TRUE); - - if(!is_null($config) && $defineConstants) { - $conditionallySet = array('VERSION_STRING', 'WORKINGONIT'); - foreach($config as $index=>$value) { - if(in_array($index, $conditionallySet)) { - //only set this part if we're told to. - if($setEverything) { - define($index, $value); - } - } - else { - define($index, $value); - } - } - } - - return($config); + return($this->get_config_contents(TRUE)); }//end read_config_file() //------------------------------------------------------------------------- @@ -310,5 +307,89 @@ return($this->fs->rm(SETUP_FILE_LOCATION)); }//end remove_setup_config() //------------------------------------------------------------------------- + + + + //------------------------------------------------------------------------- + /** + * Convert sections to be in a format that cs_siteConfig{} expects them to + * be in. + */ + private function convert_to_sections() { + + //make a copy of the old data. + $backupFilename = $this->fileName .".backup_convertToSections__". date("YmdHis"); + $this->fs->create_file($backupFilename); + $this->fs->write($this->fs->read($this->fileName)); + + $xml = new cs_phpxmlParser($this->fs->read($this->fileName)); + $rootElement = $xml->get_root_element(); + + $creator=new cs_phpxmlCreator($rootElement); + + $dataArray = $xml->get_tree(); + $dataArray = $dataArray[$rootElement]; + + + $rootAttribs = $dataArray['attributes']; + + //remove unnecessary indexes. + unset($dataArray['type'], $dataArray['attributes']); + + if(!is_array($rootAttribs)) { + $rootAttribs = array(); + } + $rootAttribs['USECSSITECONFIG'] = 1; + $creator->add_attribute('/'. $rootElement, $rootAttribs); + + //set special value for SITE_ROOT + $dataArray['SITE_ROOT']['value'] = '{_DIRNAMEOFFILE_}/..'; + $dataArray['SITE_ROOT']['attributes']['cleanpath'] = 1; + + //Set some other special values... + { + $dataArray['DOCUMENT_ROOT']['value'] = '{/MAIN/SITE_ROOT}'; + $dataArray['LIBDIR']['value'] = '{/MAIN/SITE_ROOT}/lib'; + $dataArray['TMPLDIR']['value'] = '{/MAIN/SITE_ROOT}/templates'; + $dataArray['SEQ_HELPDESK']['value'] = 'special__helpdesk_public_id_seq'; + $dataArray['SEQ_PROJECT']['value'] = 'special__project_public_id_seq'; + $dataArray['SEQ_MAIN']['value'] = 'record_table_record_id_seq'; + $dataArray['TABLE_TODOCOMMENT']['value'] = 'task_comment_table'; + $dataArray['FORMAT_WORDWRAP']['value'] = '90'; + } + + //define what items should also be GLOBAL. + $defineAsGlobal = array('SITE_ROOT', 'LIBDIR', 'TMPLDIR'); + + //skip some things that should NOT be automatically set as constants. + $skipSetConstant = array('VERSION_STRING', 'WORKINGONIT'); + + //create the main section that our old settings will go under. + $mainPath = '/'. $rootElement .'/MAIN'; + $creator->add_tag($mainPath); + $creator->set_tag_as_multiple($mainPath); + $creator->add_attribute($mainPath, array('FIX'=>'sanitizeDirs')); + + + //now add all the old settings. + foreach($dataArray as $index=>$data) { + if(!is_array($data['attributes'])) { + $data['attributes'] = array(); + } + if(!in_array($index, $skipSetConstant)) { + $data['attributes']['setconstant']=1; + } + if(in_array($index, $defineAsGlobal)) { + $data['attributes']['setglobal']=1; + } + $creator->add_tag($mainPath .'/'. $index, $data['value'], $data['attributes']); + } + + + //now write changes to the file. + $this->fs->truncate_file($this->fileName); + $this->fs->write($creator->create_xml_string(), $this->fileName); + }//end convert_to_sections() + //------------------------------------------------------------------------- }//end config{} ?> \ No newline at end of file Modified: releases/1.2/lib/helpdeskClass.php =================================================================== --- releases/1.2/lib/helpdeskClass.php 2009-02-09 19:08:54 UTC (rev 953) +++ releases/1.2/lib/helpdeskClass.php 2009-02-09 19:13:13 UTC (rev 954) @@ -153,85 +153,85 @@ $retval = -1; } else { - //start a transaction so if one part fails, they all fail. - $this->db->beginTrans(); - - $tmp = $this->get_record($helpdeskId); - $noteObj = new noteClass($this->db); - $noteData = array( - 'record_id' => $tmp['record_id'], + //start a transaction so if one part fails, they all fail. + $this->db->beginTrans(); - //TODO: allow user to specify subject! - 'subject' => 'Comment', - 'body' => $remark, - 'is_solution' => cleanString($isSolution, 'boolean_strict') - ); - $retval = $noteObj->create_note($noteData); - - if(is_numeric($noteObj->lastContactId) && $noteObj->lastContactId > 0) { - $this->lastContactId = $noteObj->lastContactId; - $recordContactLink = new recordContactLink($this->db); - $recordContactLink->add_link($tmp['record_id'], $noteObj->lastContactId); - } - - if($retval > 0) { - //send the submitter an email - $newRemarks = $remark; - $emailTemplate = html_file_to_string("email/helpdesk.tmpl"); - $linkAction = "view"; - - if($useRespondLink) { - $linkAction = "respond"; - } - $parseArr = array( - "newRemark" => $newRemarks, - "linkAction" => $linkAction, - "linkExtra" => "&check=". $this->create_md5($helpdeskId) + $this->helpdeskId = $helpdeskId; + $tmp = $this->get_record($helpdeskId); + $noteObj = new noteClass($this->db); + $noteData = array( + 'record_id' => $tmp['record_id'], + + //TODO: allow user to specify subject! + 'subject' => 'Comment', + 'body' => $remark, + 'is_solution' => cleanString($isSolution, 'boolean_strict') ); - $parseArr = array_merge($tmp, $parseArr); + $retval = $noteObj->create_note($noteData); - //set the list of recipients. - $recipientsArr = array(); - $myUserClass = new userClass($this->db,NULL); - $assignedUserData = $myUserClass->get_user_info($tmp['assigned']); - $recipientsArr[] = $assignedUserData['email']; - if(strlen($_SESSION['login_email']) && $_SESSION['login_email'] != $tmp['email']) { - $recipientsArr[] = $_SESSION['login_email']; + if(is_numeric($noteObj->lastContactId) && $noteObj->lastContactId > 0) { + $this->lastContactId = $noteObj->lastContactId; + $recordContactLink = new recordContactLink($this->db); + $recordContactLink->add_link($tmp['record_id'], $noteObj->lastContactId); } - $recipientsArr[] = $tmp['email']; - //okay, now send the email. The function "send_email()" should be ensuring that all values in - // the recipients array are valid, and there's no dups. - $subject = "Helpdesk Issue #". $helpdeskId ." -- ". $tmp['name']; - $sendEmailRes = send_email($recipientsArr, $subject, $emailTemplate, $parseArr); - - //log who we sent the emails to. - $details = 'Sent notification(s) of for [helpdesk_id='. $helpdeskId .'] remark to: '. $sendEmailRes; - $this->logsObj->log_by_class($details, 'information', NULL, $this->recordTypeId, $helpdeskId); - - if($isSolution && strlen(constant('HELPDESK_ISSUE_ANNOUNCE_EMAIL'))) { - $subject = '[ALERT] Helpdesk Issue #'. $helpdeskId .' was SOLVED'; - if(strlen($_SESSION['login_username'])) { - $subject .= ' by '. $_SESSION['login_username']; + if($retval > 0) { + //send the submitter an email + $newRemarks = $remark; + $emailTemplate = html_file_to_string("email/helpdesk.tmpl"); + $linkAction = "view"; + + if($useRespondLink) { + $linkAction = "respond"; } - $subject .= " -- ". $tmp['name']; - $sendEmailRes = send_email(HELPDESK_ISSUE_ANNOUNCE_EMAIL, $subject, $emailTemplate, $parseArr); - $details = 'Sent notifications of SOLUTION for [helpdesk_id='. $helpdeskId .'] to: '. $sendEmailRes; - $this->logsObj->log_by_class($details, 'information'); + $parseArr = array( + "newRemark" => $newRemarks, + "linkAction" => $linkAction, + "linkExtra" => "&check=". $this->create_md5($helpdeskId) + ); + $parseArr = array_merge($tmp, $parseArr); - $this->solve(); + //set the list of recipients. + $recipientsArr = array(); + $myUserClass = new userClass($this->db,NULL); + $assignedUserData = $myUserClass->get_user_info($tmp['assigned']); + $recipientsArr[] = $assignedUserData['email']; + if(strlen($_SESSION['login_email']) && $_SESSION['login_email'] != $tmp['email']) { + $recipientsArr[] = $_SESSION['login_email']; + } + $recipientsArr[] = $tmp['email']; + + //okay, now send the email. The function "send_email()" should be ensuring that all values in + // the recipients array are valid, and there's no dups. + $subject = "Helpdesk Issue #". $helpdeskId ." -- ". $tmp['name']; + $sendEmailRes = send_email($recipientsArr, $subject, $emailTemplate, $parseArr); + + //log who we sent the emails to. + $details = 'Sent notification(s) of for [helpdesk_id='. $helpdeskId .'] remark to: '. $sendEmailRes; + $this->logsObj->log_by_class($details, 'information', NULL, $this->recordTypeId, $helpdeskId); + + if($isSolution) { + $this->solve(); + } + if($isSolution && strlen(constant('HELPDESK_ISSUE_ANNOUNCE_EMAIL'))) { + $subject = '[ALERT] Helpdesk Issue #'. $helpdeskId .' was SOLVED'; + if(strlen($_SESSION['login_username'])) { + $subject .= ' by '. $_SESSION['login_username']; + } + $subject .= " -- ". $tmp['name']; + $sendEmailRes = send_email(HELPDESK_ISSUE_ANNOUNCE_EMAIL, $subject, $emailTemplate, $parseArr); + $details = 'Sent notifications of SOLUTION for [helpdesk_id='. $helpdeskId .'] to: '. $sendEmailRes; + $this->logsObj->log_by_class($details, 'information'); + } + $this->db->commitTrans(); } - $this->db->commitTrans(); + else { + $this->rollbackTrans(); + //something went wrong. + $this->logsObj->log_by_class(__METHOD__ .": failed to remark on [helpdesk_id=". $helpdeskId ."] (". $retval .")", 'error'); + } } - else { - $this->rollbackTrans(); - //something went wrong. - $this->logsObj->log_by_class(__METHOD__ .": failed to remark on [helpdesk_id=". $helpdeskId ."] (". $retval .")", 'error'); - } - } - $this->gfObj->debug_print(__METHOD__ .": result=(". $retval .")",1); - return($retval); }//end remark() Modified: releases/1.2/lib/site_config.php =================================================================== --- releases/1.2/lib/site_config.php 2009-02-09 19:08:54 UTC (rev 953) +++ releases/1.2/lib/site_config.php 2009-02-09 19:13:13 UTC (rev 954) @@ -44,7 +44,7 @@ //attempt to log the problem; if it happens too early, we can't do much about it. try { - print "<pre><h3>FATAL EXCEPTION ENCOUNTERED: </h3>". $exception->getMessage() ."</pre>"; + print "<pre><h3>FATAL EXCEPTION ENCOUNTERED: </h3>". $exception->getMessage() ."</pre>"; include_once(dirname(__FILE__) ."/globalFunctions.php"); if(function_exists('get_config_db_params') && class_exists('cs_phpDB') && class_exists('logsClass')) { $db = new cs_phpDB; @@ -104,19 +104,6 @@ } -if($_SERVER['DOCUMENT_ROOT']) { - //it was called from the web... - $GLOBALS['SITE_ROOT'] = $_SERVER['DOCUMENT_ROOT']; - $GLOBALS['SITE_ROOT'] = str_replace("/public_html", "", $GLOBALS['SITE_ROOT']); -} -else { - //called from the command line. - $GLOBALS['SITE_ROOT'] = $_SERVER['HOME']; -} - -$GLOBALS['LIBDIR']=$GLOBALS['SITE_ROOT'] . "/lib"; -$GLOBALS['TMPLDIR']=$GLOBALS['SITE_ROOT'] . "/templates"; - //define an array of status_id's that are "NOT ENDED". $GLOBALS['STATUS_NOTENDED'] = array(0,1,2,6); @@ -130,13 +117,6 @@ ); -//define some constants... -define('SEQ_HELPDESK', 'special__helpdesk_public_id_seq'); -define('SEQ_PROJECT', 'special__project_public_id_seq'); -define('SEQ_MAIN', 'record_table_record_id_seq'); -define('TABLE_TODOCOMMENT', 'task_comment_table'); -define('FORMAT_WORDWRAP', 90); - //========================================================================= /** * Special PHP5 function: last-ditch effort to include all files necessary to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-09 19:09:01
|
Revision: 953 http://cs-project.svn.sourceforge.net/cs-project/?rev=953&view=rev Author: crazedsanity Date: 2009-02-09 19:08:54 +0000 (Mon, 09 Feb 2009) Log Message: ----------- *** RELEASE 1.2.0-ALPHA11 *** CHANGE LOG::: * fix inability to solve issues introduced in 1.2.0-ALPHA10 (#250) * implement cs_siteConfig (#251) * minor superficial code changes * removed some commented-out code & some old debugging stuff. Modified Paths: -------------- trunk/1.2/VERSION Modified: trunk/1.2/VERSION =================================================================== --- trunk/1.2/VERSION 2009-02-09 19:07:48 UTC (rev 952) +++ trunk/1.2/VERSION 2009-02-09 19:08:54 UTC (rev 953) @@ -1,4 +1,4 @@ $Id:VERSION 628 2007-11-20 16:58:45Z crazedsanity $ -VERSION: 1.2.0-ALPHA10 +VERSION: 1.2.0-ALPHA11 $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/VERSION $ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-09 19:07:56
|
Revision: 952 http://cs-project.svn.sourceforge.net/cs-project/?rev=952&view=rev Author: crazedsanity Date: 2009-02-09 19:07:48 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Implement cs_siteConfig{} for consolidating configuration parameters (#251). /lib/config.class.php: * MAIN::: -- now extends cs_siteConfig -- $config is now protected (cs_siteConfig uses it...) * __construct(): -- if the file exists and the root element doesn't have "USECSSITECONFIG" set, it calls the new method convert_to_sections(). * get_config_contents(): -- references changed to look at CONFIG/MAIN -- no longer sets constants for anything but VERSION_STRING and WORKINGONIT. * read_config_file(): -- all logic removed, as it has ALWAYS been used to do exactly what get_config_contents() was used for; it is kept for reasons of backwards-compatibility... (may be removed after I update setup) * convert_to_sections() [NEW]: -- method to convert the config into sections that are useful for cs_siteConfig(). It's done here to avoid problems during the upgrade process and to avoid extra code to do what cs_siteConfig already does. /lib/site_config.php: * removed an extra tab within the exception_handler(). * removed code that set: DOCUMENT_ROOT, SITE_ROOT, LIBDIR, TMPLDIR, SEQ_HELPDESK, SEQ_PROJECT, SEQ_MAIN, TABLE_TODOCOMMENT, and FORMAT_WORDWRAP; these settings are in the config.xml file and are set as globals/constants there (as needed) Modified Paths: -------------- trunk/1.2/lib/config.class.php trunk/1.2/lib/site_config.php Modified: trunk/1.2/lib/config.class.php =================================================================== --- trunk/1.2/lib/config.class.php 2009-02-09 15:56:00 UTC (rev 951) +++ trunk/1.2/lib/config.class.php 2009-02-09 19:07:48 UTC (rev 952) @@ -1,6 +1,8 @@ <?php -class config { +require_once(dirname(__FILE__) .'/cs-content/cs_siteConfig.class.php'); + +class config extends cs_siteConfig { private $data; @@ -11,7 +13,7 @@ private $siteStatus; private $setupRequired = FALSE; private $fileName; - private $config; + protected $config; //------------------------------------------------------------------------- public function __construct($fileName=NULL) { @@ -36,6 +38,20 @@ if(!$this->fs->is_writable(CONFIG_DIRECTORY)) { throw new exception(__METHOD__ .": the config directory (". CONFIG_DIRECTORY .") isn't writable!"); } + + if($this->fileExists) { + //check to see if it all config items are directly under the root, or if they're already in sections. + $xml = new cs_phpxmlParser($this->fs->read($this->fileName)); + $checkThis = $xml->get_attribute('/CONFIG', 'USECSSITECONFIG'); + + if(!strlen($checkThis)) { + $this->gf->debug_print(__METHOD__ .": converting to use sections..."); + $this->convert_to_sections(); + } + } + + parent::__construct($this->fs->realcwd .'/'. $this->fileName); + $this->config = $this->get_config_contents(TRUE); }//end __construct() //------------------------------------------------------------------------- @@ -55,10 +71,10 @@ if($simple) { $config = $xmlParser->get_tree(TRUE); - $config = $config['CONFIG']; + $config = $config['CONFIG']['MAIN']; } else { - $config = $xmlParser->get_path('/CONFIG'); + $config = $xmlParser->get_path('/CONFIG/MAIN'); unset($config['type'], $config['attributes']); } @@ -66,7 +82,7 @@ $myConfig = $config; if(!$simple) { $myConfig = $xmlParser->get_tree(TRUE); - $myConfig = $myConfig['CONFIG']; + $myConfig = $myConfig['CONFIG']['MAIN']; } $conditionallySet = array('VERSION_STRING', 'WORKINGONIT'); foreach($myConfig as $index=>$value) { @@ -76,9 +92,6 @@ define($index, $value); } } - else { - define($index, $value); - } } } } @@ -95,27 +108,11 @@ //------------------------------------------------------------------------- /** - * Read the XML config file & return it's simplified contents + * Read the XML config file & return it's simplified contents (just a + * wrapper for get_config_contents(); kept for backwards-compatibility) */ public function read_config_file($defineConstants=TRUE, $setEverything=TRUE) { - $config = $this->get_config_contents(TRUE); - - if(!is_null($config) && $defineConstants) { - $conditionallySet = array('VERSION_STRING', 'WORKINGONIT'); - foreach($config as $index=>$value) { - if(in_array($index, $conditionallySet)) { - //only set this part if we're told to. - if($setEverything) { - define($index, $value); - } - } - else { - define($index, $value); - } - } - } - - return($config); + return($this->get_config_contents(TRUE)); }//end read_config_file() //------------------------------------------------------------------------- @@ -310,5 +307,89 @@ return($this->fs->rm(SETUP_FILE_LOCATION)); }//end remove_setup_config() //------------------------------------------------------------------------- + + + + //------------------------------------------------------------------------- + /** + * Convert sections to be in a format that cs_siteConfig{} expects them to + * be in. + */ + private function convert_to_sections() { + + //make a copy of the old data. + $backupFilename = $this->fileName .".backup_convertToSections__". date("YmdHis"); + $this->fs->create_file($backupFilename); + $this->fs->write($this->fs->read($this->fileName)); + + $xml = new cs_phpxmlParser($this->fs->read($this->fileName)); + $rootElement = $xml->get_root_element(); + + $creator=new cs_phpxmlCreator($rootElement); + + $dataArray = $xml->get_tree(); + $dataArray = $dataArray[$rootElement]; + + + $rootAttribs = $dataArray['attributes']; + + //remove unnecessary indexes. + unset($dataArray['type'], $dataArray['attributes']); + + if(!is_array($rootAttribs)) { + $rootAttribs = array(); + } + $rootAttribs['USECSSITECONFIG'] = 1; + $creator->add_attribute('/'. $rootElement, $rootAttribs); + + //set special value for SITE_ROOT + $dataArray['SITE_ROOT']['value'] = '{_DIRNAMEOFFILE_}/..'; + $dataArray['SITE_ROOT']['attributes']['cleanpath'] = 1; + + //Set some other special values... + { + $dataArray['DOCUMENT_ROOT']['value'] = '{/MAIN/SITE_ROOT}'; + $dataArray['LIBDIR']['value'] = '{/MAIN/SITE_ROOT}/lib'; + $dataArray['TMPLDIR']['value'] = '{/MAIN/SITE_ROOT}/templates'; + $dataArray['SEQ_HELPDESK']['value'] = 'special__helpdesk_public_id_seq'; + $dataArray['SEQ_PROJECT']['value'] = 'special__project_public_id_seq'; + $dataArray['SEQ_MAIN']['value'] = 'record_table_record_id_seq'; + $dataArray['TABLE_TODOCOMMENT']['value'] = 'task_comment_table'; + $dataArray['FORMAT_WORDWRAP']['value'] = '90'; + } + + //define what items should also be GLOBAL. + $defineAsGlobal = array('SITE_ROOT', 'LIBDIR', 'TMPLDIR'); + + //skip some things that should NOT be automatically set as constants. + $skipSetConstant = array('VERSION_STRING', 'WORKINGONIT'); + + //create the main section that our old settings will go under. + $mainPath = '/'. $rootElement .'/MAIN'; + $creator->add_tag($mainPath); + $creator->set_tag_as_multiple($mainPath); + $creator->add_attribute($mainPath, array('FIX'=>'sanitizeDirs')); + + + //now add all the old settings. + foreach($dataArray as $index=>$data) { + if(!is_array($data['attributes'])) { + $data['attributes'] = array(); + } + if(!in_array($index, $skipSetConstant)) { + $data['attributes']['setconstant']=1; + } + if(in_array($index, $defineAsGlobal)) { + $data['attributes']['setglobal']=1; + } + $creator->add_tag($mainPath .'/'. $index, $data['value'], $data['attributes']); + } + + + //now write changes to the file. + $this->fs->truncate_file($this->fileName); + $this->fs->write($creator->create_xml_string(), $this->fileName); + }//end convert_to_sections() + //------------------------------------------------------------------------- }//end config{} ?> \ No newline at end of file Modified: trunk/1.2/lib/site_config.php =================================================================== --- trunk/1.2/lib/site_config.php 2009-02-09 15:56:00 UTC (rev 951) +++ trunk/1.2/lib/site_config.php 2009-02-09 19:07:48 UTC (rev 952) @@ -44,7 +44,7 @@ //attempt to log the problem; if it happens too early, we can't do much about it. try { - print "<pre><h3>FATAL EXCEPTION ENCOUNTERED: </h3>". $exception->getMessage() ."</pre>"; + print "<pre><h3>FATAL EXCEPTION ENCOUNTERED: </h3>". $exception->getMessage() ."</pre>"; include_once(dirname(__FILE__) ."/globalFunctions.php"); if(function_exists('get_config_db_params') && class_exists('cs_phpDB') && class_exists('logsClass')) { $db = new cs_phpDB; @@ -104,19 +104,6 @@ } -if($_SERVER['DOCUMENT_ROOT']) { - //it was called from the web... - $GLOBALS['SITE_ROOT'] = $_SERVER['DOCUMENT_ROOT']; - $GLOBALS['SITE_ROOT'] = str_replace("/public_html", "", $GLOBALS['SITE_ROOT']); -} -else { - //called from the command line. - $GLOBALS['SITE_ROOT'] = $_SERVER['HOME']; -} - -$GLOBALS['LIBDIR']=$GLOBALS['SITE_ROOT'] . "/lib"; -$GLOBALS['TMPLDIR']=$GLOBALS['SITE_ROOT'] . "/templates"; - //define an array of status_id's that are "NOT ENDED". $GLOBALS['STATUS_NOTENDED'] = array(0,1,2,6); @@ -130,13 +117,6 @@ ); -//define some constants... -define('SEQ_HELPDESK', 'special__helpdesk_public_id_seq'); -define('SEQ_PROJECT', 'special__project_public_id_seq'); -define('SEQ_MAIN', 'record_table_record_id_seq'); -define('TABLE_TODOCOMMENT', 'task_comment_table'); -define('FORMAT_WORDWRAP', 90); - //========================================================================= /** * Special PHP5 function: last-ditch effort to include all files necessary to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-09 15:56:05
|
Revision: 951 http://cs-project.svn.sourceforge.net/cs-project/?rev=951&view=rev Author: crazedsanity Date: 2009-02-09 15:56:00 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Fix indenting for remark (no logic changes). Modified Paths: -------------- trunk/1.2/lib/helpdeskClass.php Modified: trunk/1.2/lib/helpdeskClass.php =================================================================== --- trunk/1.2/lib/helpdeskClass.php 2009-02-09 15:54:29 UTC (rev 950) +++ trunk/1.2/lib/helpdeskClass.php 2009-02-09 15:56:00 UTC (rev 951) @@ -153,84 +153,84 @@ $retval = -1; } else { - //start a transaction so if one part fails, they all fail. - $this->db->beginTrans(); - - $this->helpdeskId = $helpdeskId; - $tmp = $this->get_record($helpdeskId); - $noteObj = new noteClass($this->db); - $noteData = array( - 'record_id' => $tmp['record_id'], + //start a transaction so if one part fails, they all fail. + $this->db->beginTrans(); - //TODO: allow user to specify subject! - 'subject' => 'Comment', - 'body' => $remark, - 'is_solution' => cleanString($isSolution, 'boolean_strict') - ); - $retval = $noteObj->create_note($noteData); - - if(is_numeric($noteObj->lastContactId) && $noteObj->lastContactId > 0) { - $this->lastContactId = $noteObj->lastContactId; - $recordContactLink = new recordContactLink($this->db); - $recordContactLink->add_link($tmp['record_id'], $noteObj->lastContactId); - } - - if($retval > 0) { - //send the submitter an email - $newRemarks = $remark; - $emailTemplate = html_file_to_string("email/helpdesk.tmpl"); - $linkAction = "view"; - - if($useRespondLink) { - $linkAction = "respond"; - } - $parseArr = array( - "newRemark" => $newRemarks, - "linkAction" => $linkAction, - "linkExtra" => "&check=". $this->create_md5($helpdeskId) + $this->helpdeskId = $helpdeskId; + $tmp = $this->get_record($helpdeskId); + $noteObj = new noteClass($this->db); + $noteData = array( + 'record_id' => $tmp['record_id'], + + //TODO: allow user to specify subject! + 'subject' => 'Comment', + 'body' => $remark, + 'is_solution' => cleanString($isSolution, 'boolean_strict') ); - $parseArr = array_merge($tmp, $parseArr); + $retval = $noteObj->create_note($noteData); - //set the list of recipients. - $recipientsArr = array(); - $myUserClass = new userClass($this->db,NULL); - $assignedUserData = $myUserClass->get_user_info($tmp['assigned']); - $recipientsArr[] = $assignedUserData['email']; - if(strlen($_SESSION['login_email']) && $_SESSION['login_email'] != $tmp['email']) { - $recipientsArr[] = $_SESSION['login_email']; + if(is_numeric($noteObj->lastContactId) && $noteObj->lastContactId > 0) { + $this->lastContactId = $noteObj->lastContactId; + $recordContactLink = new recordContactLink($this->db); + $recordContactLink->add_link($tmp['record_id'], $noteObj->lastContactId); } - $recipientsArr[] = $tmp['email']; - //okay, now send the email. The function "send_email()" should be ensuring that all values in - // the recipients array are valid, and there's no dups. - $subject = "Helpdesk Issue #". $helpdeskId ." -- ". $tmp['name']; - $sendEmailRes = send_email($recipientsArr, $subject, $emailTemplate, $parseArr); - - //log who we sent the emails to. - $details = 'Sent notification(s) of for [helpdesk_id='. $helpdeskId .'] remark to: '. $sendEmailRes; - $this->logsObj->log_by_class($details, 'information', NULL, $this->recordTypeId, $helpdeskId); - - if($isSolution) { - $this->solve(); - } - if($isSolution && strlen(constant('HELPDESK_ISSUE_ANNOUNCE_EMAIL'))) { - $subject = '[ALERT] Helpdesk Issue #'. $helpdeskId .' was SOLVED'; - if(strlen($_SESSION['login_username'])) { - $subject .= ' by '. $_SESSION['login_username']; + if($retval > 0) { + //send the submitter an email + $newRemarks = $remark; + $emailTemplate = html_file_to_string("email/helpdesk.tmpl"); + $linkAction = "view"; + + if($useRespondLink) { + $linkAction = "respond"; } - $subject .= " -- ". $tmp['name']; - $sendEmailRes = send_email(HELPDESK_ISSUE_ANNOUNCE_EMAIL, $subject, $emailTemplate, $parseArr); - $details = 'Sent notifications of SOLUTION for [helpdesk_id='. $helpdeskId .'] to: '. $sendEmailRes; - $this->logsObj->log_by_class($details, 'information'); + $parseArr = array( + "newRemark" => $newRemarks, + "linkAction" => $linkAction, + "linkExtra" => "&check=". $this->create_md5($helpdeskId) + ); + $parseArr = array_merge($tmp, $parseArr); + + //set the list of recipients. + $recipientsArr = array(); + $myUserClass = new userClass($this->db,NULL); + $assignedUserData = $myUserClass->get_user_info($tmp['assigned']); + $recipientsArr[] = $assignedUserData['email']; + if(strlen($_SESSION['login_email']) && $_SESSION['login_email'] != $tmp['email']) { + $recipientsArr[] = $_SESSION['login_email']; + } + $recipientsArr[] = $tmp['email']; + + //okay, now send the email. The function "send_email()" should be ensuring that all values in + // the recipients array are valid, and there's no dups. + $subject = "Helpdesk Issue #". $helpdeskId ." -- ". $tmp['name']; + $sendEmailRes = send_email($recipientsArr, $subject, $emailTemplate, $parseArr); + + //log who we sent the emails to. + $details = 'Sent notification(s) of for [helpdesk_id='. $helpdeskId .'] remark to: '. $sendEmailRes; + $this->logsObj->log_by_class($details, 'information', NULL, $this->recordTypeId, $helpdeskId); + + if($isSolution) { + $this->solve(); + } + if($isSolution && strlen(constant('HELPDESK_ISSUE_ANNOUNCE_EMAIL'))) { + $subject = '[ALERT] Helpdesk Issue #'. $helpdeskId .' was SOLVED'; + if(strlen($_SESSION['login_username'])) { + $subject .= ' by '. $_SESSION['login_username']; + } + $subject .= " -- ". $tmp['name']; + $sendEmailRes = send_email(HELPDESK_ISSUE_ANNOUNCE_EMAIL, $subject, $emailTemplate, $parseArr); + $details = 'Sent notifications of SOLUTION for [helpdesk_id='. $helpdeskId .'] to: '. $sendEmailRes; + $this->logsObj->log_by_class($details, 'information'); + } + $this->db->commitTrans(); } - $this->db->commitTrans(); + else { + $this->rollbackTrans(); + //something went wrong. + $this->logsObj->log_by_class(__METHOD__ .": failed to remark on [helpdesk_id=". $helpdeskId ."] (". $retval .")", 'error'); + } } - else { - $this->rollbackTrans(); - //something went wrong. - $this->logsObj->log_by_class(__METHOD__ .": failed to remark on [helpdesk_id=". $helpdeskId ."] (". $retval .")", 'error'); - } - } return($retval); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-09 15:54:31
|
Revision: 950 http://cs-project.svn.sourceforge.net/cs-project/?rev=950&view=rev Author: crazedsanity Date: 2009-02-09 15:54:29 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Fix problem where issues unable to be solved (#250) & remove unneeded code. /includes/content/helpdesk/view.inc: * removed some commented-out code that was unnecessary when solving. * removed debugging code for consolidating submit button & setting message... * removed the "action==create" section; that's a different include altogether * removed code regarding "owner" code (the block rows within the check don't even exist anymore, so it doesn't make any difference) * remove code for updating project associations (commented-out) /lib/helpdeskClass.php: * remark(): -- set $this->helpdeskId for solve(). -- only check $isSolution to determine if solve() should be called -- remove solve() from email check. -- remove debug_print() before return statement. Modified Paths: -------------- trunk/1.2/includes/content/helpdesk/view.inc trunk/1.2/lib/helpdeskClass.php Modified: trunk/1.2/includes/content/helpdesk/view.inc =================================================================== --- trunk/1.2/includes/content/helpdesk/view.inc 2009-02-07 19:54:15 UTC (rev 949) +++ trunk/1.2/includes/content/helpdesk/view.inc 2009-02-09 15:54:29 UTC (rev 950) @@ -78,8 +78,6 @@ $useRespondLink = FALSE; if($_POST['isSolution']) { //IT'S A SOLUTION - //solve it & make sure they know if it was good or not. - #$result = $proj->helpdeskObj->solve($helpdeskId, $_POST['solution']); $remarks[] = array( 'remark' => $_POST['remark'], 'isSolution' => true @@ -155,9 +153,6 @@ ); } - #$page->gfObj->debug_print($_POST,1); - #$page->gfObj->debug_print($setMessage,1); - #exit; $page->set_message_wrapper($setMessage); } elseif($action == "re-open") { @@ -197,20 +192,7 @@ unset($_SESSION['goBackLink']); } - if($action == "create") { - create_page_title($page, array('title' => "Create a Helpdesk Issue")); - $page->set_all_block_rows("content"); - - //show the "category" selection. - $categoryList = $proj->helpdeskObj->get_category_list('bug', TRUE); - $page->add_template_var("select_tags", $categoryList); - - // - $page->add_template_var("email", $_SESSION['email']); - $page->add_template_var("linked_proj", cleanString($_GET['proj']),"numeric"); - - } - elseif($action == "view" && !is_numeric($helpdeskId)) { + if($action == "view" && !is_numeric($helpdeskId)) { //missing ID: throw a message & send 'em packin'. set_message_wrapper(array( "title" => "Invalid ID Specified", @@ -269,20 +251,6 @@ $doNotRipRows[] = "assigned_optionList"; $doNotRipRows[] = "priority_optionList"; $doNotRipRows[] = "editable_tags"; - if(($assignedStr == $_SESSION['contact_id']) || ($assignedStr == "" || is_null($assignedStr))) { - //well, we can show 'em the update/modify button. - $doNotRipRows[] = "update_button"; - if($_SESSION['contact_id'] == $assignedStr) { - //they're the owner... show 'em more options. - $doNotRipRows[] = "solution_row"; - $doNotRipRows[] = "owner_options"; - } - //if they're the owner, show 'em more options... - } - elseif($_SESSION['isGroupOwner']) { - //we got an OWNER!!! - $doNotRipRows[] = "owner_options"; - } $doNotRipRows[] = "remark_row"; $doNotRipRows[] = "buttons_row"; $doNotRipRows[] = 'accessBlock__modifyButton'; @@ -295,9 +263,6 @@ //keep the set of data allows it to be linked to a project. $doNotRipRows[] = "edit_project_selection"; - - //TODO: implement a link for updating project associations. - #$page->add_template_var("select_project_list", $proj->create_project_option_list($helpdeskData['ancestry'], NULL)); } $doNotRipRows[] = 'update_button'; Modified: trunk/1.2/lib/helpdeskClass.php =================================================================== --- trunk/1.2/lib/helpdeskClass.php 2009-02-07 19:54:15 UTC (rev 949) +++ trunk/1.2/lib/helpdeskClass.php 2009-02-09 15:54:29 UTC (rev 950) @@ -156,6 +156,7 @@ //start a transaction so if one part fails, they all fail. $this->db->beginTrans(); + $this->helpdeskId = $helpdeskId; $tmp = $this->get_record($helpdeskId); $noteObj = new noteClass($this->db); $noteData = array( @@ -209,6 +210,9 @@ $details = 'Sent notification(s) of for [helpdesk_id='. $helpdeskId .'] remark to: '. $sendEmailRes; $this->logsObj->log_by_class($details, 'information', NULL, $this->recordTypeId, $helpdeskId); + if($isSolution) { + $this->solve(); + } if($isSolution && strlen(constant('HELPDESK_ISSUE_ANNOUNCE_EMAIL'))) { $subject = '[ALERT] Helpdesk Issue #'. $helpdeskId .' was SOLVED'; if(strlen($_SESSION['login_username'])) { @@ -218,8 +222,6 @@ $sendEmailRes = send_email(HELPDESK_ISSUE_ANNOUNCE_EMAIL, $subject, $emailTemplate, $parseArr); $details = 'Sent notifications of SOLUTION for [helpdesk_id='. $helpdeskId .'] to: '. $sendEmailRes; $this->logsObj->log_by_class($details, 'information'); - - $this->solve(); } $this->db->commitTrans(); } @@ -230,8 +232,6 @@ } } - $this->gfObj->debug_print(__METHOD__ .": result=(". $retval .")",1); - return($retval); }//end remark() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-07 19:54:21
|
Revision: 949 http://cs-project.svn.sourceforge.net/cs-project/?rev=949&view=rev Author: crazedsanity Date: 2009-02-07 19:54:15 +0000 (Sat, 07 Feb 2009) Log Message: ----------- *** RELEASE 1.2.0-ALPHA10 *** NOTE::: change log combined from 1.2.0-ALPHA9, which was rolled-back from the repository. SUMMARY OF CHANGES::: * Make the "select multiple" box for project associated users stand out more. * Credits file to show who's contributed to the project. * Fix typecast problem in SQL (#234) * New external libraries: -- cs-arrayToPath v1.0 -- cs-content v1.0-ALPHA7 -- cs-phpxml v2.0-ALPHA4 -- cs-versionparse v0.1.2 (NEW) * Fixed tabs to not have spaces under corners * Admin link is a new tab (instead of a link beneath settings) * Fix problem wherein an ajax call leaves unused template vars visible (#239) * Consolidate code for solve vs. remark (#240). * Single action button for helpdesk issues (#99) * Split include scripts into several smaller bits (#244) * Fix problem error when linking an unlinked issue to a project (#248). * Fix display issue with notes deforming the page layout (#249). * Remove some old test files SVN COMMANDS::: svn export https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/1.0 cs-content --force svn export https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk cs-arrayToPath --force svn export https://cs-phpxml.svn.sourceforge.net/svnroot/cs-phpxml/trunk cs-phpxml --force svn export https://cs-versionparse.svn.sourceforge.net/svnroot/cs-versionparse/trunk/0.1 cs-versionparse svn merge https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/1.0 Modified Paths: -------------- releases/1.2/VERSION releases/1.2/includes/content/tags.inc releases/1.2/includes/content.inc releases/1.2/includes/login.inc releases/1.2/lib/config.class.php releases/1.2/lib/cs-arrayToPath/VERSION releases/1.2/lib/cs-content/VERSION releases/1.2/lib/cs-content/cs_bbCodeParser.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__mysql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__pgsql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__sqlite.class.php releases/1.2/lib/cs-content/sample_files/public_html/content releases/1.2/lib/cs-content/sample_files/public_html/index.php releases/1.2/lib/cs-phpxml/VERSION releases/1.2/lib/globalFunctions.php releases/1.2/lib/helpdeskClass.php releases/1.2/lib/mainRecordClass.php releases/1.2/lib/session_class.php releases/1.2/lib/site_config.php releases/1.2/lib/upgradeClass.php releases/1.2/public_html/css/common.css releases/1.2/templates/content/helpdesk/view.content.tmpl releases/1.2/templates/header.shared.tmpl releases/1.2/templates/infobar.shared.tmpl releases/1.2/templates/main.shared.tmpl releases/1.2/templates/tabs.shared.tmpl Added Paths: ----------- releases/1.2/CREDITS releases/1.2/includes/content/contacts/ releases/1.2/includes/content/contacts/index.inc releases/1.2/includes/content/contacts/view.inc releases/1.2/includes/content/helpdesk/ releases/1.2/includes/content/helpdesk/create.inc releases/1.2/includes/content/helpdesk/index.inc releases/1.2/includes/content/helpdesk/shared.inc releases/1.2/includes/content/helpdesk/view.inc releases/1.2/includes/content/project/ releases/1.2/includes/content/project/create.inc releases/1.2/includes/content/project/index.inc releases/1.2/includes/content/project/shared.inc releases/1.2/includes/content/project/view.inc releases/1.2/lib/cs-arrayToPath/CREDITS releases/1.2/lib/cs-arrayToPath/cs_arrayToPath.class.php releases/1.2/lib/cs-arrayToPath/tests/ releases/1.2/lib/cs-arrayToPath/tests/example_test.php releases/1.2/lib/cs-arrayToPath/tests/testOfA2P.php releases/1.2/lib/cs-content/CREDITS releases/1.2/lib/cs-content/abstract/ releases/1.2/lib/cs-content/abstract/cs_content.abstract.class.php releases/1.2/lib/cs-content/abstract/cs_phpDB.abstract.class.php releases/1.2/lib/cs-content/contentSystem.class.php releases/1.2/lib/cs-content/cs_fileSystem.class.php releases/1.2/lib/cs-content/cs_genericPage.class.php releases/1.2/lib/cs-content/cs_globalFunctions.class.php releases/1.2/lib/cs-content/cs_phpDB.class.php releases/1.2/lib/cs-content/cs_session.class.php releases/1.2/lib/cs-content/cs_siteConfig.class.php releases/1.2/lib/cs-content/cs_tabs.class.php releases/1.2/lib/cs-content/required/ releases/1.2/lib/cs-content/required/template.inc releases/1.2/lib/cs-content/tests/ releases/1.2/lib/cs-content/tests/example_test.php releases/1.2/lib/cs-content/tests/files/ releases/1.2/lib/cs-content/tests/files/gptest_all-together.txt releases/1.2/lib/cs-content/tests/files/sampleConfig.xml releases/1.2/lib/cs-content/tests/files/templates/ releases/1.2/lib/cs-content/tests/files/templates/content.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/footer.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/infobar.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/main.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/menubar.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/title.shared.tmpl releases/1.2/lib/cs-content/tests/testOfCSContent.php releases/1.2/lib/cs-phpxml/CREDITS releases/1.2/lib/cs-phpxml/cs_phpxml.abstract.class.php releases/1.2/lib/cs-phpxml/cs_phpxmlBuilder.class.php releases/1.2/lib/cs-phpxml/cs_phpxmlCreator.class.php releases/1.2/lib/cs-phpxml/cs_phpxmlParser.class.php releases/1.2/lib/cs-phpxml/tests/ releases/1.2/lib/cs-phpxml/tests/example_test.php releases/1.2/lib/cs-phpxml/tests/files/ releases/1.2/lib/cs-phpxml/tests/files/test1.xml releases/1.2/lib/cs-phpxml/tests/testOfCSPHPXML.php releases/1.2/lib/cs-versionparse/ releases/1.2/lib/cs-versionparse/CREDITS releases/1.2/lib/cs-versionparse/LICENSE releases/1.2/lib/cs-versionparse/VERSION releases/1.2/lib/cs-versionparse/cs_version.abstract.class.php releases/1.2/lib/cs-versionparse/tests/ releases/1.2/lib/cs-versionparse/tests/example_test.php releases/1.2/lib/cs-versionparse/tests/files/ releases/1.2/lib/cs-versionparse/tests/files/version1 releases/1.2/lib/cs-versionparse/tests/files/version2 releases/1.2/lib/cs-versionparse/tests/files/version3 releases/1.2/lib/cs-versionparse/tests/testOfCSVersionParse.php Removed Paths: ------------- releases/1.2/includes/content/contacts/index.inc releases/1.2/includes/content/contacts/view.inc releases/1.2/includes/content/contacts.inc releases/1.2/includes/content/helpdesk/create.inc releases/1.2/includes/content/helpdesk/index.inc releases/1.2/includes/content/helpdesk/shared.inc releases/1.2/includes/content/helpdesk/view.inc releases/1.2/includes/content/helpdesk.inc releases/1.2/includes/content/project/create.inc releases/1.2/includes/content/project/index.inc releases/1.2/includes/content/project/shared.inc releases/1.2/includes/content/project/view.inc releases/1.2/includes/content/project.inc releases/1.2/includes/test.inc releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php releases/1.2/lib/cs-arrayToPath/cs_versionAbstract.class.php releases/1.2/lib/cs-content/contentSystemClass.php releases/1.2/lib/cs-content/cs_fileSystemClass.php releases/1.2/lib/cs-content/cs_genericPageClass.php releases/1.2/lib/cs-content/cs_globalFunctions.php releases/1.2/lib/cs-content/cs_phpDB.php releases/1.2/lib/cs-content/cs_sessionClass.php releases/1.2/lib/cs-content/cs_tabsClass.php releases/1.2/lib/cs-content/cs_versionAbstract.class.php releases/1.2/lib/cs-content/template.inc releases/1.2/lib/cs-phpxml/xmlAbstract.class.php releases/1.2/lib/cs-phpxml/xmlBuilderClass.php releases/1.2/lib/cs-phpxml/xmlCreatorClass.php releases/1.2/lib/cs-phpxml/xmlParserClass.php releases/1.2/public_html/test releases/1.2/public_html/test.php releases/1.2/templates/test/ Copied: releases/1.2/CREDITS (from rev 948, trunk/1.2/CREDITS) =================================================================== --- releases/1.2/CREDITS (rev 0) +++ releases/1.2/CREDITS 2009-02-07 19:54:15 UTC (rev 949) @@ -0,0 +1,3 @@ + +Lead Developer: Dan Falconer (cra...@us...) + Modified: releases/1.2/VERSION =================================================================== --- releases/1.2/VERSION 2009-02-06 21:20:53 UTC (rev 948) +++ releases/1.2/VERSION 2009-02-07 19:54:15 UTC (rev 949) @@ -1,4 +1,4 @@ $Id:VERSION 628 2007-11-20 16:58:45Z crazedsanity $ -VERSION: 1.2.0-ALPHA8 +VERSION: 1.2.0-ALPHA10 $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/VERSION $ Deleted: releases/1.2/includes/content/contacts/index.inc =================================================================== --- trunk/1.2/includes/content/contacts/index.inc 2009-02-06 21:20:53 UTC (rev 948) +++ releases/1.2/includes/content/contacts/index.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -1,104 +0,0 @@ -<?php -/* - * Created on Oct 15, 2007 - * - * SVN INFORMATION::: - * ------------------ - * Last Author: $Author$ - * Current Revision: $Revision$ - * Repository Location: $HeadURL$ - * Last Updated: $Date$ - */ - -require_once(dirname(__FILE__) .'/../../../lib/contactClass.php'); - -$contactObj = new contactClass($page->db); - -$page->allow_invalid_urls(TRUE); - - if(count($sectionArr) == 4 && $sectionArr[2] == 'view') { - $contactId = $sectionArr[3]; - } - - if(is_numeric($contactId)) { - - try{ - $page->rip_all_block_rows(); - - - $contactObj->set_contact_id($contactId); - $contactDetails = $contactObj->get_contact(); - - $userDetails = $user->get_user_info(array('contact_id'=>$contactId)); - if(is_array($userDetails)) { - $contactDetails['username'] = $userDetails['username']; - $page->add_template_var('display_username', $page->templateRows['display_username']); - } - - - //set the main details. - foreach($contactDetails as $name=>$value) { - $page->add_template_var($name, $value); - } - - $addableAttribs = $contactObj->get_attribute_list(2); - $page->add_template_var('attributeOptionList', $page->gfObj->array_as_option_list($addableAttribs)); - - $contactAttributes = $contactObj->get_contact_attributes(); - $attributeFormRows = ""; - $baseRow = $page->templateRows['attributeRow']; - foreach($contactAttributes as $name=>$value) { - $displayValue = $value; - if(!strlen($value) || !strlen(preg_replace('/ /', '', $value))) { - $displayValue = "<font color='red'><b>[EMPTY]</b></font>"; - } - $repArr=array( - 'name' => $name, - 'displayValue' => $displayValue, - 'value' => $value - ); - - $attributeFormRows .= $page->gfObj->mini_parser($baseRow, $repArr, '{', '}'); - } - $page->add_template_var('attributeRow', $attributeFormRows); - - $emailList = $contactObj->get_contact_email_list(); - $emailRow = ""; - foreach($emailList as $id=>$value) { - $repArr = array( - 'contact_email_id' => $id, - 'email' => $value, - 'isPrimary' => "" - ); - if($id == $contactDetails['contact_email_id']) { - $repArr['isPrimary'] = 'checked'; - } - $emailRow .= $page->mini_parser($page->templateRows['contactEmailAddress'], $repArr, '%%', '%%'); - } - $page->add_template_var('contactEmailAddress', $emailRow); - } - catch(exception $e) { - $page->set_message_wrapper(array( - 'title' => "Error Encountered", - 'message' => "Failed to retrieve data: ". $e->getMessage(), - 'type' => "fatal" - )); - } - } - else { - $page->rip_all_block_rows(); - $contactListing = $contactObj->get_all_contacts(); - - $baseRow = $page->templateRows['dataRow']; - - $myRow = ""; - foreach($contactListing as $conId=>$data) { - $data['rowColor'] = swapValue($rowColor1, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); - $data['rowColor2'] = swapValue($rowColor2,"#D5D5D5", "#C2C2C2"); - $myRow .= $page->mini_parser($baseRow, $data, '{', '}'); - } - $page->add_template_var('dataRow', $myRow); - } - - -?> Copied: releases/1.2/includes/content/contacts/index.inc (from rev 948, trunk/1.2/includes/content/contacts/index.inc) =================================================================== --- releases/1.2/includes/content/contacts/index.inc (rev 0) +++ releases/1.2/includes/content/contacts/index.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -0,0 +1,104 @@ +<?php +/* + * Created on Oct 15, 2007 + * + * SVN INFORMATION::: + * ------------------ + * Last Author: $Author$ + * Current Revision: $Revision$ + * Repository Location: $HeadURL$ + * Last Updated: $Date$ + */ + +require_once(dirname(__FILE__) .'/../../../lib/contactClass.php'); + +$contactObj = new contactClass($page->db); + +$page->allow_invalid_urls(TRUE); + + if(count($sectionArr) == 4 && $sectionArr[2] == 'view') { + $contactId = $sectionArr[3]; + } + + if(is_numeric($contactId)) { + + try{ + $page->rip_all_block_rows(); + + + $contactObj->set_contact_id($contactId); + $contactDetails = $contactObj->get_contact(); + + $userDetails = $user->get_user_info(array('contact_id'=>$contactId)); + if(is_array($userDetails)) { + $contactDetails['username'] = $userDetails['username']; + $page->add_template_var('display_username', $page->templateRows['display_username']); + } + + + //set the main details. + foreach($contactDetails as $name=>$value) { + $page->add_template_var($name, $value); + } + + $addableAttribs = $contactObj->get_attribute_list(2); + $page->add_template_var('attributeOptionList', $page->gfObj->array_as_option_list($addableAttribs)); + + $contactAttributes = $contactObj->get_contact_attributes(); + $attributeFormRows = ""; + $baseRow = $page->templateRows['attributeRow']; + foreach($contactAttributes as $name=>$value) { + $displayValue = $value; + if(!strlen($value) || !strlen(preg_replace('/ /', '', $value))) { + $displayValue = "<font color='red'><b>[EMPTY]</b></font>"; + } + $repArr=array( + 'name' => $name, + 'displayValue' => $displayValue, + 'value' => $value + ); + + $attributeFormRows .= $page->gfObj->mini_parser($baseRow, $repArr, '{', '}'); + } + $page->add_template_var('attributeRow', $attributeFormRows); + + $emailList = $contactObj->get_contact_email_list(); + $emailRow = ""; + foreach($emailList as $id=>$value) { + $repArr = array( + 'contact_email_id' => $id, + 'email' => $value, + 'isPrimary' => "" + ); + if($id == $contactDetails['contact_email_id']) { + $repArr['isPrimary'] = 'checked'; + } + $emailRow .= $page->mini_parser($page->templateRows['contactEmailAddress'], $repArr, '%%', '%%'); + } + $page->add_template_var('contactEmailAddress', $emailRow); + } + catch(exception $e) { + $page->set_message_wrapper(array( + 'title' => "Error Encountered", + 'message' => "Failed to retrieve data: ". $e->getMessage(), + 'type' => "fatal" + )); + } + } + else { + $page->rip_all_block_rows(); + $contactListing = $contactObj->get_all_contacts(); + + $baseRow = $page->templateRows['dataRow']; + + $myRow = ""; + foreach($contactListing as $conId=>$data) { + $data['rowColor'] = swapValue($rowColor1, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); + $data['rowColor2'] = swapValue($rowColor2,"#D5D5D5", "#C2C2C2"); + $myRow .= $page->mini_parser($baseRow, $data, '{', '}'); + } + $page->add_template_var('dataRow', $myRow); + } + + +?> Deleted: releases/1.2/includes/content/contacts/view.inc =================================================================== --- trunk/1.2/includes/content/contacts/view.inc 2009-02-06 21:20:53 UTC (rev 948) +++ releases/1.2/includes/content/contacts/view.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -1,242 +0,0 @@ -<?php -/* - * Created on Oct 15, 2007 - * - * SVN INFORMATION::: - * ------------------ - * Last Author: $Author$ - * Current Revision: $Revision$ - * Repository Location: $HeadURL$ - * Last Updated: $Date$ - */ - -require_once(dirname(__FILE__) .'/../../../lib/contactClass.php'); - -$contactObj = new contactClass($page->db); - -$page->allow_invalid_urls(TRUE); - -if($_POST) { - if(strlen($_POST['action']) && is_numeric($_POST['contact_id'])) { - $contactObj->set_contact_id($_POST['contact_id']); - - $messageArr = array( - 'title' => "Update Results", - 'message' => "", - 'type' => 'status' - ); - - switch($_POST['action']) { - - case 'update': { - $contactObj->db->beginTrans("_POST_updateAction"); - - $totalUpdates = 0; - $totalFailures = 0; - - $updatesArr = array(); - - if(strlen($_POST['new_contact_email'])) { - $isPrimary = FALSE; - if(!is_numeric($_POST['contactData']['contact_email_id'])) { - $isPrimary = TRUE; - unset($_POST['contactData']['contact_email_id']); - if(!count($_POST['contactData'])) { - unset($_POST['contactData']); - } - } - - if($contactObj->create_contact_email($_POST['new_contact_email'], $isPrimary)) { - $totalUpdates++; - $res = "Successfully added new email"; - if($isPrimary) { - $res .= " and set as primary address"; - } - add_update_result($updatesArr, $res); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to create new email address..."); - } - } - - if(is_array($_POST['contactData'])) { - if($contactObj->update_contact_data($_POST['contactData'])) { - $totalUpdates++; - add_update_result($updatesArr, "Successfully updated contact data"); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to update contact data"); - } - } - - if(is_array($_POST['attributes'])) { - if($contactObj->mass_update_contact_attributes($_POST['attributes'])) { - $totalUpdates++; - add_update_result($updatesArr, "Successfully updated attributes"); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to update attributes"); - } - } - - if(is_array($_POST['delAttrib'])) { - foreach($_POST['delAttrib'] as $name) { - if($contactObj->delete_contact_attribute($name)) { - $totalUpdates++; - add_update_result($updatesArr, "Successfully deleted: <b>". $name ."</b>"); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to delete attribute \"<b>". $name ."</b>\""); - break; - } - } - } - - if(is_array($_POST['addAttribute']) && count($_POST['addAttribute']) == 2) { - if($contactObj->create_contact_attribute($_POST['addAttribute']['name'], $_POST['addAttribute']['value'])) { - $totalUpdates++; - add_update_result($updatesArr, "Successfully added attribute (". $_POST['addAttribute']['name'] .")"); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to add attribute (". $_POST['addAttribute']['name'] .")"); - } - } - - $messageArr['message'] = create_update_result($updatesArr); - $page->set_message_wrapper($messageArr); - - $contactObj->db->commitTrans(); - - } - break; - - default: { - $page->set_message_wrapper(array( - 'title' => "Invalid Action", - 'message' => "The requested action, [". $_POST['action'] ."], is invalid.", - 'type' => "error" - )); - } - } - } - else { - $page->set_message_wrapper(array( - 'title' => "Insufficient Information", - 'message' => "The requested update could not be handled due to insufficient information.", - 'type' => "error" - )); - } - - $page->conditional_header('/content/contacts/view/'. $_POST['contact_id']); -} -else { - if(count($sectionArr) == 4 && $sectionArr[2] == 'view') { - $contactId = $sectionArr[3]; - } - - if(is_numeric($contactId)) { - try{ - $page->rip_all_block_rows(); - - - $contactObj->set_contact_id($contactId); - $contactDetails = $contactObj->get_contact(); - - $userDetails = $user->get_user_info(array('contact_id'=>$contactId)); - if(is_array($userDetails)) { - $contactDetails['username'] = $userDetails['username']; - $page->add_template_var('display_username', $page->templateRows['display_username']); - } - - - //set the main details. - foreach($contactDetails as $name=>$value) { - $page->add_template_var($name, $value); - } - - $addableAttribs = $contactObj->get_attribute_list(2); - $page->add_template_var('attributeOptionList', $page->gfObj->array_as_option_list($addableAttribs)); - - $contactAttributes = $contactObj->get_contact_attributes(); - $attributeFormRows = ""; - $baseRow = $page->templateRows['attributeRow']; - foreach($contactAttributes as $name=>$value) { - $displayValue = $value; - if(!strlen($value) || !strlen(preg_replace('/ /', '', $value))) { - $displayValue = "<font color='red'><b>[EMPTY]</b></font>"; - } - $repArr=array( - 'name' => $name, - 'displayValue' => $displayValue, - 'value' => $value - ); - - $attributeFormRows .= $page->gfObj->mini_parser($baseRow, $repArr, '{', '}'); - } - $page->add_template_var('attributeRow', $attributeFormRows); - - $emailList = $contactObj->get_contact_email_list(); - $emailRow = ""; - foreach($emailList as $id=>$value) { - $repArr = array( - 'contact_email_id' => $id, - 'email' => $value, - 'isPrimary' => "" - ); - if($id == $contactDetails['contact_email_id']) { - $repArr['isPrimary'] = 'checked'; - } - $emailRow .= $page->mini_parser($page->templateRows['contactEmailAddress'], $repArr, '%%', '%%'); - } - $page->add_template_var('contactEmailAddress', $emailRow); - } - catch(exception $e) { - $page->set_message_wrapper(array( - 'title' => "Error Encountered", - 'message' => "Failed to retrieve data: ". $e->getMessage(), - 'type' => "fatal" - )); - } - } - else { - $page->rip_all_block_rows(); - $contactListing = $contactObj->get_all_contacts(); - - $baseRow = $page->templateRows['dataRow']; - - $myRow = ""; - foreach($contactListing as $conId=>$data) { - $data['rowColor'] = swapValue($rowColor1, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); - $data['rowColor2'] = swapValue($rowColor2,"#D5D5D5", "#C2C2C2"); - $myRow .= $page->mini_parser($baseRow, $data, '{', '}'); - } - $page->add_template_var('dataRow', $myRow); - } -} - - -function add_update_result(array &$updateResults, $newResult) { - $updateResults[] = $newResult; -}//end add_update_result() - - -function create_update_result(array $updateResults) { - #$retval = "Result of updates: <ul>"; - $retval = ""; - $gf = new cs_globalFunctions; - foreach($updateResults as $result) { - $retval = $gf->create_list($retval, "<li>". $result ."</li>", "\n"); - } - $retval = "Result of updates: <ul>". $retval; - $retval .= "</ul>"; - return($retval); -}//end create_update_result() - - - -?> Copied: releases/1.2/includes/content/contacts/view.inc (from rev 948, trunk/1.2/includes/content/contacts/view.inc) =================================================================== --- releases/1.2/includes/content/contacts/view.inc (rev 0) +++ releases/1.2/includes/content/contacts/view.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -0,0 +1,242 @@ +<?php +/* + * Created on Oct 15, 2007 + * + * SVN INFORMATION::: + * ------------------ + * Last Author: $Author$ + * Current Revision: $Revision$ + * Repository Location: $HeadURL$ + * Last Updated: $Date$ + */ + +require_once(dirname(__FILE__) .'/../../../lib/contactClass.php'); + +$contactObj = new contactClass($page->db); + +$page->allow_invalid_urls(TRUE); + +if($_POST) { + if(strlen($_POST['action']) && is_numeric($_POST['contact_id'])) { + $contactObj->set_contact_id($_POST['contact_id']); + + $messageArr = array( + 'title' => "Update Results", + 'message' => "", + 'type' => 'status' + ); + + switch($_POST['action']) { + + case 'update': { + $contactObj->db->beginTrans("_POST_updateAction"); + + $totalUpdates = 0; + $totalFailures = 0; + + $updatesArr = array(); + + if(strlen($_POST['new_contact_email'])) { + $isPrimary = FALSE; + if(!is_numeric($_POST['contactData']['contact_email_id'])) { + $isPrimary = TRUE; + unset($_POST['contactData']['contact_email_id']); + if(!count($_POST['contactData'])) { + unset($_POST['contactData']); + } + } + + if($contactObj->create_contact_email($_POST['new_contact_email'], $isPrimary)) { + $totalUpdates++; + $res = "Successfully added new email"; + if($isPrimary) { + $res .= " and set as primary address"; + } + add_update_result($updatesArr, $res); + } + else { + $totalFailures++; + add_update_result($updatesArr, "FAILED to create new email address..."); + } + } + + if(is_array($_POST['contactData'])) { + if($contactObj->update_contact_data($_POST['contactData'])) { + $totalUpdates++; + add_update_result($updatesArr, "Successfully updated contact data"); + } + else { + $totalFailures++; + add_update_result($updatesArr, "FAILED to update contact data"); + } + } + + if(is_array($_POST['attributes'])) { + if($contactObj->mass_update_contact_attributes($_POST['attributes'])) { + $totalUpdates++; + add_update_result($updatesArr, "Successfully updated attributes"); + } + else { + $totalFailures++; + add_update_result($updatesArr, "FAILED to update attributes"); + } + } + + if(is_array($_POST['delAttrib'])) { + foreach($_POST['delAttrib'] as $name) { + if($contactObj->delete_contact_attribute($name)) { + $totalUpdates++; + add_update_result($updatesArr, "Successfully deleted: <b>". $name ."</b>"); + } + else { + $totalFailures++; + add_update_result($updatesArr, "FAILED to delete attribute \"<b>". $name ."</b>\""); + break; + } + } + } + + if(is_array($_POST['addAttribute']) && count($_POST['addAttribute']) == 2) { + if($contactObj->create_contact_attribute($_POST['addAttribute']['name'], $_POST['addAttribute']['value'])) { + $totalUpdates++; + add_update_result($updatesArr, "Successfully added attribute (". $_POST['addAttribute']['name'] .")"); + } + else { + $totalFailures++; + add_update_result($updatesArr, "FAILED to add attribute (". $_POST['addAttribute']['name'] .")"); + } + } + + $messageArr['message'] = create_update_result($updatesArr); + $page->set_message_wrapper($messageArr); + + $contactObj->db->commitTrans(); + + } + break; + + default: { + $page->set_message_wrapper(array( + 'title' => "Invalid Action", + 'message' => "The requested action, [". $_POST['action'] ."], is invalid.", + 'type' => "error" + )); + } + } + } + else { + $page->set_message_wrapper(array( + 'title' => "Insufficient Information", + 'message' => "The requested update could not be handled due to insufficient information.", + 'type' => "error" + )); + } + + $page->conditional_header('/content/contacts/view/'. $_POST['contact_id']); +} +else { + if(count($sectionArr) == 4 && $sectionArr[2] == 'view') { + $contactId = $sectionArr[3]; + } + + if(is_numeric($contactId)) { + try{ + $page->rip_all_block_rows(); + + + $contactObj->set_contact_id($contactId); + $contactDetails = $contactObj->get_contact(); + + $userDetails = $user->get_user_info(array('contact_id'=>$contactId)); + if(is_array($userDetails)) { + $contactDetails['username'] = $userDetails['username']; + $page->add_template_var('display_username', $page->templateRows['display_username']); + } + + + //set the main details. + foreach($contactDetails as $name=>$value) { + $page->add_template_var($name, $value); + } + + $addableAttribs = $contactObj->get_attribute_list(2); + $page->add_template_var('attributeOptionList', $page->gfObj->array_as_option_list($addableAttribs)); + + $contactAttributes = $contactObj->get_contact_attributes(); + $attributeFormRows = ""; + $baseRow = $page->templateRows['attributeRow']; + foreach($contactAttributes as $name=>$value) { + $displayValue = $value; + if(!strlen($value) || !strlen(preg_replace('/ /', '', $value))) { + $displayValue = "<font color='red'><b>[EMPTY]</b></font>"; + } + $repArr=array( + 'name' => $name, + 'displayValue' => $displayValue, + 'value' => $value + ); + + $attributeFormRows .= $page->gfObj->mini_parser($baseRow, $repArr, '{', '}'); + } + $page->add_template_var('attributeRow', $attributeFormRows); + + $emailList = $contactObj->get_contact_email_list(); + $emailRow = ""; + foreach($emailList as $id=>$value) { + $repArr = array( + 'contact_email_id' => $id, + 'email' => $value, + 'isPrimary' => "" + ); + if($id == $contactDetails['contact_email_id']) { + $repArr['isPrimary'] = 'checked'; + } + $emailRow .= $page->mini_parser($page->templateRows['contactEmailAddress'], $repArr, '%%', '%%'); + } + $page->add_template_var('contactEmailAddress', $emailRow); + } + catch(exception $e) { + $page->set_message_wrapper(array( + 'title' => "Error Encountered", + 'message' => "Failed to retrieve data: ". $e->getMessage(), + 'type' => "fatal" + )); + } + } + else { + $page->rip_all_block_rows(); + $contactListing = $contactObj->get_all_contacts(); + + $baseRow = $page->templateRows['dataRow']; + + $myRow = ""; + foreach($contactListing as $conId=>$data) { + $data['rowColor'] = swapValue($rowColor1, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); + $data['rowColor2'] = swapValue($rowColor2,"#D5D5D5", "#C2C2C2"); + $myRow .= $page->mini_parser($baseRow, $data, '{', '}'); + } + $page->add_template_var('dataRow', $myRow); + } +} + + +function add_update_result(array &$updateResults, $newResult) { + $updateResults[] = $newResult; +}//end add_update_result() + + +function create_update_result(array $updateResults) { + #$retval = "Result of updates: <ul>"; + $retval = ""; + $gf = new cs_globalFunctions; + foreach($updateResults as $result) { + $retval = $gf->create_list($retval, "<li>". $result ."</li>", "\n"); + } + $retval = "Result of updates: <ul>". $retval; + $retval .= "</ul>"; + return($retval); +}//end create_update_result() + + + +?> Deleted: releases/1.2/includes/content/contacts.inc =================================================================== --- releases/1.2/includes/content/contacts.inc 2009-02-06 21:20:53 UTC (rev 948) +++ releases/1.2/includes/content/contacts.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -1,242 +0,0 @@ -<?php -/* - * Created on Oct 15, 2007 - * - * SVN INFORMATION::: - * ------------------ - * Last Author: $Author$ - * Current Revision: $Revision$ - * Repository Location: $HeadURL$ - * Last Updated: $Date$ - */ - -require_once(dirname(__FILE__) .'/../../lib/contactClass.php'); - -$contactObj = new contactClass($page->db); - -$page->allow_invalid_urls(TRUE); - -if($_POST) { - if(strlen($_POST['action']) && is_numeric($_POST['contact_id'])) { - $contactObj->set_contact_id($_POST['contact_id']); - - $messageArr = array( - 'title' => "Update Results", - 'message' => "", - 'type' => 'status' - ); - - switch($_POST['action']) { - - case 'update': { - $contactObj->db->beginTrans("_POST_updateAction"); - - $totalUpdates = 0; - $totalFailures = 0; - - $updatesArr = array(); - - if(strlen($_POST['new_contact_email'])) { - $isPrimary = FALSE; - if(!is_numeric($_POST['contactData']['contact_email_id'])) { - $isPrimary = TRUE; - unset($_POST['contactData']['contact_email_id']); - if(!count($_POST['contactData'])) { - unset($_POST['contactData']); - } - } - - if($contactObj->create_contact_email($_POST['new_contact_email'], $isPrimary)) { - $totalUpdates++; - $res = "Successfully added new email"; - if($isPrimary) { - $res .= " and set as primary address"; - } - add_update_result($updatesArr, $res); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to create new email address..."); - } - } - - if(is_array($_POST['contactData'])) { - if($contactObj->update_contact_data($_POST['contactData'])) { - $totalUpdates++; - add_update_result($updatesArr, "Successfully updated contact data"); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to update contact data"); - } - } - - if(is_array($_POST['attributes'])) { - if($contactObj->mass_update_contact_attributes($_POST['attributes'])) { - $totalUpdates++; - add_update_result($updatesArr, "Successfully updated attributes"); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to update attributes"); - } - } - - if(is_array($_POST['delAttrib'])) { - foreach($_POST['delAttrib'] as $name) { - if($contactObj->delete_contact_attribute($name)) { - $totalUpdates++; - add_update_result($updatesArr, "Successfully deleted: <b>". $name ."</b>"); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to delete attribute \"<b>". $name ."</b>\""); - break; - } - } - } - - if(is_array($_POST['addAttribute']) && count($_POST['addAttribute']) == 2) { - if($contactObj->create_contact_attribute($_POST['addAttribute']['name'], $_POST['addAttribute']['value'])) { - $totalUpdates++; - add_update_result($updatesArr, "Successfully added attribute (". $_POST['addAttribute']['name'] .")"); - } - else { - $totalFailures++; - add_update_result($updatesArr, "FAILED to add attribute (". $_POST['addAttribute']['name'] .")"); - } - } - - $messageArr['message'] = create_update_result($updatesArr); - $page->set_message_wrapper($messageArr); - - $contactObj->db->commitTrans(); - - } - break; - - default: { - $page->set_message_wrapper(array( - 'title' => "Invalid Action", - 'message' => "The requested action, [". $_POST['action'] ."], is invalid.", - 'type' => "error" - )); - } - } - } - else { - $page->set_message_wrapper(array( - 'title' => "Insufficient Information", - 'message' => "The requested update could not be handled due to insufficient information.", - 'type' => "error" - )); - } - - $page->conditional_header('/content/contacts/view/'. $_POST['contact_id']); -} -else { - if(count($sectionArr) == 4 && $sectionArr[2] == 'view') { - $contactId = $sectionArr[3]; - } - - if(is_numeric($contactId)) { - try{ - $page->rip_all_block_rows(); - - - $contactObj->set_contact_id($contactId); - $contactDetails = $contactObj->get_contact(); - - $userDetails = $user->get_user_info(array('contact_id'=>$contactId)); - if(is_array($userDetails)) { - $contactDetails['username'] = $userDetails['username']; - $page->add_template_var('display_username', $page->templateRows['display_username']); - } - - - //set the main details. - foreach($contactDetails as $name=>$value) { - $page->add_template_var($name, $value); - } - - $addableAttribs = $contactObj->get_attribute_list(2); - $page->add_template_var('attributeOptionList', $page->gfObj->array_as_option_list($addableAttribs)); - - $contactAttributes = $contactObj->get_contact_attributes(); - $attributeFormRows = ""; - $baseRow = $page->templateRows['attributeRow']; - foreach($contactAttributes as $name=>$value) { - $displayValue = $value; - if(!strlen($value) || !strlen(preg_replace('/ /', '', $value))) { - $displayValue = "<font color='red'><b>[EMPTY]</b></font>"; - } - $repArr=array( - 'name' => $name, - 'displayValue' => $displayValue, - 'value' => $value - ); - - $attributeFormRows .= $page->gfObj->mini_parser($baseRow, $repArr, '{', '}'); - } - $page->add_template_var('attributeRow', $attributeFormRows); - - $emailList = $contactObj->get_contact_email_list(); - $emailRow = ""; - foreach($emailList as $id=>$value) { - $repArr = array( - 'contact_email_id' => $id, - 'email' => $value, - 'isPrimary' => "" - ); - if($id == $contactDetails['contact_email_id']) { - $repArr['isPrimary'] = 'checked'; - } - $emailRow .= $page->mini_parser($page->templateRows['contactEmailAddress'], $repArr, '%%', '%%'); - } - $page->add_template_var('contactEmailAddress', $emailRow); - } - catch(exception $e) { - $page->set_message_wrapper(array( - 'title' => "Error Encountered", - 'message' => "Failed to retrieve data: ". $e->getMessage(), - 'type' => "fatal" - )); - } - } - else { - $page->rip_all_block_rows(); - $contactListing = $contactObj->get_all_contacts(); - - $baseRow = $page->templateRows['dataRow']; - - $myRow = ""; - foreach($contactListing as $conId=>$data) { - $data['rowColor'] = swapValue($rowColor1, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); - $data['rowColor2'] = swapValue($rowColor2,"#D5D5D5", "#C2C2C2"); - $myRow .= $page->mini_parser($baseRow, $data, '{', '}'); - } - $page->add_template_var('dataRow', $myRow); - } -} - - -function add_update_result(array &$updateResults, $newResult) { - $updateResults[] = $newResult; -}//end add_update_result() - - -function create_update_result(array $updateResults) { - #$retval = "Result of updates: <ul>"; - $retval = ""; - $gf = new cs_globalFunctions; - foreach($updateResults as $result) { - $retval = $gf->create_list($retval, "<li>". $result ."</li>", "\n"); - } - $retval = "Result of updates: <ul>". $retval; - $retval .= "</ul>"; - return($retval); -}//end create_update_result() - - - -?> Deleted: releases/1.2/includes/content/helpdesk/create.inc =================================================================== --- trunk/1.2/includes/content/helpdesk/create.inc 2009-02-06 21:20:53 UTC (rev 948) +++ releases/1.2/includes/content/helpdesk/create.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -1,63 +0,0 @@ -<?php -/* - * SVN INFORMATION::: - * ------------------ - * Last Author: $Author:crazedsanity $ - * Current Revision: $Revision:637 $ - * Repository Location: $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/includes/content/helpdesk.inc $ - * Last Updated: $Date:2007-11-20 11:04:33 -0600 (Tue, 20 Nov 2007) $ - */ - - -if($_POST) { - //CREATING NEW RECORD!!! - $dataArr = $_POST['data']; - $result = $proj->helpdeskObj->create_record($dataArr); - - if($result > 0) { - //TODO: implement email portion. - set_message_wrapper(array( - "title" => "Success", - "message" => "Helpdesk issue #". $result ." created successfully. You should receive an email confirmation shortly", - "type" => "notice" - )); - - //only go back to helpdesk if we're supposed to. - if($_SESSION['goBackLink']) { - $byPassUrlExtras = TRUE; - $baseUrl = $_SESSION['goBackLink']; - } - else { - $helpdeskId = $result; - $urlExtrasArr['ID'] = $result; - } - } - else { - //something bad happened. - set_message_wrapper(array( - "title" => "", - "message" => "", - "type" => "error" - )); - } - - //redirect them. - $url = "/content/helpdesk/view?ID=". $result; - if($_SESSION['goBackLink']) { - $url = $_SESSION['goBackLink']; - } - $page->gfObj->conditional_header($url); -} -else { - create_page_title($page, array('title' => "Create a Helpdesk Issue")); - $page->set_all_block_rows("content"); - - //show the "category" selection. - $categoryList = $proj->helpdeskObj->get_category_list('bug', TRUE); - $page->add_template_var("select_tags", $categoryList); - - // - $page->add_template_var("email", $_SESSION['email']); - $page->add_template_var("linked_proj", cleanString($_GET['proj']),"numeric"); -} -?> \ No newline at end of file Copied: releases/1.2/includes/content/helpdesk/create.inc (from rev 948, trunk/1.2/includes/content/helpdesk/create.inc) =================================================================== --- releases/1.2/includes/content/helpdesk/create.inc (rev 0) +++ releases/1.2/includes/content/helpdesk/create.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -0,0 +1,63 @@ +<?php +/* + * SVN INFORMATION::: + * ------------------ + * Last Author: $Author:crazedsanity $ + * Current Revision: $Revision:637 $ + * Repository Location: $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/includes/content/helpdesk.inc $ + * Last Updated: $Date:2007-11-20 11:04:33 -0600 (Tue, 20 Nov 2007) $ + */ + + +if($_POST) { + //CREATING NEW RECORD!!! + $dataArr = $_POST['data']; + $result = $proj->helpdeskObj->create_record($dataArr); + + if($result > 0) { + //TODO: implement email portion. + set_message_wrapper(array( + "title" => "Success", + "message" => "Helpdesk issue #". $result ." created successfully. You should receive an email confirmation shortly", + "type" => "notice" + )); + + //only go back to helpdesk if we're supposed to. + if($_SESSION['goBackLink']) { + $byPassUrlExtras = TRUE; + $baseUrl = $_SESSION['goBackLink']; + } + else { + $helpdeskId = $result; + $urlExtrasArr['ID'] = $result; + } + } + else { + //something bad happened. + set_message_wrapper(array( + "title" => "", + "message" => "", + "type" => "error" + )); + } + + //redirect them. + $url = "/content/helpdesk/view?ID=". $result; + if($_SESSION['goBackLink']) { + $url = $_SESSION['goBackLink']; + } + $page->gfObj->conditional_header($url); +} +else { + create_page_title($page, array('title' => "Create a Helpdesk Issue")); + $page->set_all_block_rows("content"); + + //show the "category" selection. + $categoryList = $proj->helpdeskObj->get_category_list('bug', TRUE); + $page->add_template_var("select_tags", $categoryList); + + // + $page->add_template_var("email", $_SESSION['email']); + $page->add_template_var("linked_proj", cleanString($_GET['proj']),"numeric"); +} +?> \ No newline at end of file Deleted: releases/1.2/includes/content/helpdesk/index.inc =================================================================== --- trunk/1.2/includes/content/helpdesk/index.inc 2009-02-06 21:20:53 UTC (rev 948) +++ releases/1.2/includes/content/helpdesk/index.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -1,108 +0,0 @@ -<?php -/* - * SVN INFORMATION::: - * ------------------ - * Last Author: $Author:crazedsanity $ - * Current Revision: $Revision:637 $ - * Repository Location: $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/includes/content/helpdesk.inc $ - * Last Updated: $Date:2007-11-20 11:04:33 -0600 (Tue, 20 Nov 2007) $ - */ - - - $helpdeskId = $_GET['ID']; - $action = $page->ftsSections[2]; - - if(is_numeric($page->ui->get_cache("project/linkToIssue"))) { - $page->ui->unset_cache("project/linkToIssue"); - } - - - //remove the link in the session that they should return to if not requested. - if($_SESSION['goBackLink'] && !$_GET['goBack']) { - unset($_SESSION['goBackLink']); - } - - - //DISPLAY ALL AVAILABLE HELPDESK ISSUES. - //change the content of the page properly. - $page->set_all_block_rows("content", array("helpdesk_search")); - - $filterData = $page->ui->get_cache("helpdesk/filter"); - if(is_array($filterData)) { - $page->add_template_var("filter_keyword", $filterData['keyword']); - $page->add_template_var("filter_field_". $filterData['field'] ."_selected", "selected"); - } - else { - //no filter array... set one. - $filterData = array(); - $page->ui->set_cache("helpdesk/filter", $filterData); - } - $page->add_template_var("filter_status_id_". $filterData['status_id'] ."_selected", "selected"); - - if($filterData['status_id'] == 'all') { - $primaryFilterArr = NULL; - } - elseif(is_numeric($filterData['status_id'])) { - //the data will already show only items with the given status, so don't add that to the filter again. - $primaryFilterArr = array("status_id" => $filterData['status_id']); - } - else { - $primaryFilterArr = array(); - } - $filter = $filterData; - unset($filter['status_id'], $filter['status']); - - //pull the recordset. - $helpdeskArr = $proj->helpdeskObj->get_records($primaryFilterArr, $currentSortArr, $filter); - - $issueCount = 0; - if(is_array($helpdeskArr)) { - $issueCount = count($helpdeskArr); - } - $page->add_template_var("numRows", $issueCount); - //if there's an array, show it... - if(is_array($helpdeskArr) && count($helpdeskArr) > 0) { - //got good data. - $baseRow = $page->templateRows['helpdesk_row']; - foreach($helpdeskArr as $helpdeskId=>$subData) { - unset($deleteLink); - - - swapValue($bgColor, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); - swapValue($bgColor2, "#d5d5d5", "#c2c2c2"); - - $subData['bgColor'] = $bgColor; - $subData['bgColor2']= $bgColor2; - - //define the text fields, so they can be cleaned & truncated. - $previewLength = 110; - $textFieldArr = array("name", "subject"); - foreach($textFieldArr as $cleanThisField) { - //truncate them... - $subData[$cleanThisField] = truncate_string($subData[$cleanThisField], $previewLength, "... [more]", TRUE); - - //now clean 'em (clean after to avoid truncating html special characters. - $subData[$cleanThisField] = cleanString($subData[$cleanThisField], "htmlentity"); - - //more special parsing to ensure GenericPage{} doesn't make the $ (and random characters after it) disappear. - $subData[$cleanThisField] = str_replace('$', '\$', $subData[$cleanThisField]); - } - - //parse bbCode in preview... - $subData['subject'] = $bbCodeParser->parseString($subData['subject']); - - //truncate the email address... - $subData['email'] = truncate_string($subData['email'], 20, "...", TRUE); - - $subData['helpdesk_id'] = $helpdeskId; - unset($subData['id']); - - //show the "created" and "updated" strings properly... - $subData['created'] = parse_date_string($subData['div1'],TRUE); - $subData['updated'] = parse_date_string($subData['div2'],TRUE); - $finalRow .= mini_parser($baseRow, $subData, "%%", "%%"); - } - $page->add_template_var("helpdesk_row", $finalRow); - } - -?> \ No newline at end of file Copied: releases/1.2/includes/content/helpdesk/index.inc (from rev 948, trunk/1.2/includes/content/helpdesk/index.inc) =================================================================== --- releases/1.2/includes/content/helpdesk/index.inc (rev 0) +++ releases/1.2/includes/content/helpdesk/index.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -0,0 +1,108 @@ +<?php +/* + * SVN INFORMATION::: + * ------------------ + * Last Author: $Author:crazedsanity $ + * Current Revision: $Revision:637 $ + * Repository Location: $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/includes/content/helpdesk.inc $ + * Last Updated: $Date:2007-11-20 11:04:33 -0600 (Tue, 20 Nov 2007) $ + */ + + + $helpdeskId = $_GET['ID']; + $action = $page->ftsSections[2]; + + if(is_numeric($page->ui->get_cache("project/linkToIssue"))) { + $page->ui->unset_cache("project/linkToIssue"); + } + + + //remove the link in the session that they should return to if not requested. + if($_SESSION['goBackLink'] && !$_GET['goBack']) { + unset($_SESSION['goBackLink']); + } + + + //DISPLAY ALL AVAILABLE HELPDESK ISSUES. + //change the content of the page properly. + $page->set_all_block_rows("content", array("helpdesk_search")); + + $filterData = $page->ui->get_cache("helpdesk/filter"); + if(is_array($filterData)) { + $page->add_template_var("filter_keyword", $filterData['keyword']); + $page->add_template_var("filter_field_". $filterData['field'] ."_selected", "selected"); + } + else { + //no filter array... set one. + $filterData = array(); + $page->ui->set_cache("helpdesk/filter", $filterData); + } + $page->add_template_var("filter_status_id_". $filterData['status_id'] ."_selected", "selected"); + + if($filterData['status_id'] == 'all') { + $primaryFilterArr = NULL; + } + elseif(is_numeric($filterData['status_id'])) { + //the data will already show only items with the given status, so don't add that to the filter again. + $primaryFilterArr = array("status_id" => $filterData['status_id']); + } + else { + $primaryFilterArr = array(); + } + $filter = $filterData; + unset($filter['status_id'], $filter['status']); + + //pull the recordset. + $helpdeskArr = $proj->helpdeskObj->get_records($primaryFilterArr, $currentSortArr, $filter); + + $issueCount = 0; + if(is_array($helpdeskArr)) { + $issueCount = count($helpdeskArr); + } + $page->add_template_var("numRows", $issueCount); + //if there's an array, show it... + if(is_array($helpdeskArr) && count($helpdeskArr) > 0) { + //got good data. + $baseRow = $page->templateRows['helpdesk_row']; + foreach($helpdeskArr as $helpdeskId=>$subData) { + unset($deleteLink); + + + swapValue($bgColor, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); + swapValue($bgColor2, "#d5d5d5", "#c2c2c2"); + + $subData['bgColor'] = $bgColor; + $subData['bgColor2']= $bgColor2; + + //define the text fields, so they can be cleaned & truncated. + $previewLength = 110; + $textFieldArr = array("name", "subject"); + foreach($textFieldArr as $cleanThisField) { + //truncate them... + $subData[$cleanThisField] = truncate_string($subData[$cleanThisField], $previewLength, "... [more]", TRUE); + + //now clean 'em (clean after to avoid truncating html special characters. + $subData[$cleanThisField] = cleanString($subData[$cleanThisField], "htmlentity"); + + //more special parsing to ensure GenericPage{} doesn't make the $ (and random characters after it) disappear. + $subData[$cleanThisField] = str_replace('$', '\$', $subData[$cleanThisField]); + } + + //parse bbCode in preview... + $subData['subject'] = $bbCodeParser->parseString($subData['subject']); + + //truncate the email address... + $subData['email'] = truncate_string($subData['email'], 20, "...", TRUE); + + $subData['helpdesk_id'] = $helpdeskId; + unset($subData['id']); + + //show the "created" and "updated" strings properly... + $subData['created'] = parse_date_string($subData['div1'],TRUE); + $subData['updated'] = parse_date_string($subData['div2'],TRUE); + $finalRow .= mini_parser($baseRow, $subData, "%%", "%%"); + } + $page->add_template_var("helpdesk_row", $finalRow); + } + +?> \ No newline at end of file Deleted: releases/1.2/includes/content/helpdesk/shared.inc =================================================================== --- trunk/1.2/includes/content/helpdesk/shared.inc 2009-02-06 21:20:53 UTC (rev 948) +++ releases/1.2/includes/content/helpdesk/shared.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -1,212 +0,0 @@ -<?php -/* - * SVN INFORMATION::: - * ------------------ - * Last Author: $Author:crazedsanity $ - * Current Revision: $Revision:637 $ - * Repository Location: $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/includes/content/helpdesk.inc $ - * Last Updated: $Date:2007-11-20 11:04:33 -0600 (Tue, 20 Nov 2007) $ - */ - - - -if($_POST) { - $action = strtolower($_POST['action']); - if(strlen($action)) { - if($action == "filter") { - if($_POST['reset_filter']) { - $page->ui->unset_cache("helpdesk/filter"); - $result = "unset"; - } - else { - //store the filter. - $page->ui->set_cache("helpdesk/filter", $_POST['filter']); - $result = "set"; - } - unset($extra); - $page->gfObj->conditional_header("/content/helpdesk"); - } - } -} - - -//call the function to add AJAX stuff... -addAjax(); - -//AJAX FUNCTIONS - -function ajax__removeTag($tagNameId, $recordId) { - ob_start(); - $tagObj = $GLOBALS['objects']['tag']; - $page = $GLOBALS['objects']['page']; - $objResponse = new xajaxResponse(); - - $messageArr = array( - 'title' => 'Unable to Remove Tag', - 'message' => "There was an unknown error while attempting to remove the tag.", - 'type' => 'error' - ); - - if(is_numeric($tagNameId) && is_numeric($recordId)) { - $result = $tagObj->remove_tag($recordId,$tagNameId); - $tagList = $tagObj->get_tag_list(); - - //check the results. - if($result==1) { - //Cool. Tell 'em the tag was removed. - $messageArr = array( - 'title' => 'Tag Successfully Removed', - 'message' => "We removed \"". $tagList[$tagNameId] ."\".", - 'type' => 'status' - ); - } - else { - //already got most of the array, just change the actual message. - $messageArr['message'] = "Result of trying to remove tag: (". $result .")"; - } - } - - $newTagList = generate_tag_list($recordId); - - if(strlen($newTagList)) { - $returnThis = $newTagList; - } - else { - $returnThis = "invalid response from generate_tag_list($recordId)"; - } - - $page->set_message_wrapper($messageArr); - $objResponse->addAssign('MAIN_error_message', 'innerHTML', $page->process_set_message()); - - $objResponse->addAssign('tagList', 'innerHTML', $returnThis); - $objResponse->addAssign('addTagOptionList', 'innerHTML', generate_addable_tags($recordId)); - - - ob_end_clean(); - return($objResponse); -}//end ajax__removeTag() - - - -function ajax__addTag($tagNameId, $recordId) { - ob_start(); - - $tagObj = $GLOBALS['objects']['tag']; - $page = $GLOBALS['objects']['page']; - $objResponse = new xajaxResponse(); - - $result = $tagObj->add_tag($recordId, $tagNameId); - - $objResponse->addAssign('tagList', 'innerHTML', generate_tag_list($recordId)); - $objResponse->addAssign('addTagOptionList', 'innerHTML', generate_addable_tags($recordId)); - - //display a message saying it worked. - if($result == 1) { - $tagList = $tagObj->get_tag_list(); - $messageArr = array( - 'title' => 'Tag Added Successfully', - 'message' => "Successfully tagged record with \"". $tagList[$tagNameId] ."\"", - 'type' => 'status' - ); - } - else { - $messageArr = array( - 'title' => 'Failed to Add Tag', - 'message' => "Result of adding tag was (". $result .")", - 'type' => 'error' - ); - } - $page->set_message_wrapper($messageArr); - $objResponse->addAssign('MAIN_error_message', 'innerHTML', $page->process_set_message()); - - - return($objResponse); - ob_end_clean(); - -}//end ajax__addTag() - - -function generate_tag_list($recordId, $useTextRows=FALSE) { - $page = $GLOBALS['objects']['page']; - $tagObj = $GLOBALS['objects']['tag']; - - if(!is_numeric($recordId)) { - return("invalid recordId=(". $recordId .")"); - } - elseif(!(is_object($tagObj) && get_class($tagObj) == 'tagClass')) { - return("didn't get tagClass object"); - } - elseif(!(is_object($page) && get_class($page) == 'cs_genericPage')) { - return("invalid page object: (". get_class($page) .")"); - } - - - $myTagList = $tagObj->get_tags_for_record($recordId, TRUE); - if(is_array($myTagList)) { - if($useTextRows) { - $tagListVar = 'text_tags'; - } - else { - $tagListVar = 'removeable_tag'; - } - - if(!isset($page->templateRows[$tagListVar])) { - $page->set_all_block_rows(); - } - $baseRow = $page->templateRows[$tagListVar]; - - $myTagRow = ""; - $tCount = 0; - foreach($myTagList as $tagNameId=>$tagData) { - $tagName = $tagData['name']; - - //don't show a separator for the end piece. - $tCount++; - $separator = ' || '; - if($tCount == count($myTagList)) { - $separator = ""; - } - $repArr = array( - 'tag_name_id' => $tagNameId, - 'name' => $tagName, - 'separator' => $separator, - 'imgHtml' => $tagData['imgHtml'] - ); - $myTagRow .= mini_parser($baseRow, $repArr, '%%', '%%'); - } - $myTagRow = mini_parser($myTagRow, array('record_id'=>$recordId), '{', '}'); - $page->add_template_var($tagListVar, $myTagRow); - - if(strlen($myTagRow)) { - $retval = $myTagRow; - } - else { - $retval = __METHOD__ .": No data parsed..?"; - throw new exception($retval); - } - } - else { - $retval = ""; - } - - return($retval); -}//end generate_tag_list() - - -function generate_addable_tags($recordId) { - $tagObj = $GLOBALS['objects']['tag']; - $page = $GLOBALS['objects']['page']; - $availableTagsList = $tagObj->get_available_tags_for_record($recordId, 3); - $retval = NULL; - if(is_array($availableTagsList) && count($availableTagsList) > 0) { - $myTagsList = array_as_option_list($availableTagsList,NULL,'select',$page->templateRows['addTag_option']); - $myTagsList = '<select>'. $myTagsList .'</select>'; - $myTagsList = mini_parser($myTagsList, array('record_id' => $recordId), '{', '}'); - $page->add_template_var("add_tag_list", $myTagsList); - $retval = $myTagsList; - } - return($retval); -} - - -?> \ No newline at end of file Copied: releases/1.2/includes/content/helpdesk/shared.inc (from rev 948, trunk/1.2/includes/content/helpdesk/shared.inc) =================================================================== --- releases/1.2/includes/content/helpdesk/shared.inc (rev 0) +++ releases/1.2/includes/content/helpdesk/shared.inc 2009-02-07 19:54:15 UTC (rev 949) @@ -0,0 +1,212 @@ +<?php +/* + * SVN INFORMATION::: + * ------------------ + * Last Author: $Author:crazedsanity $ + * Current Revision: $Revision:637 $ + * Repository Location: $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/includes/content/helpdesk.inc $ + * Last Updated: $Date:2007-11-20 11:04:33 -0600 (Tue, 20 Nov 2007) $ + */ + + + +if($_POST) { + $action = strtolower($_POST['action']); + if(strlen($action)) { + if($action == "filter") { + if($_POST['reset_filter']) { + $page->ui->unset_cache("helpdesk/filter"); + $result = "unset"; + } + else { + //store the filter. + $page->ui->set_cache("helpdesk/filter", $_POST['filter']); + $result = "set"; + } + unset($extra); + $page->gfObj->conditional_header("/content/helpdesk"); + } + } +} + + +//call the function to add AJAX stuff... +addAjax(); + +//AJAX FUNCTIONS + +function ajax__removeTag($tagNameId, $recordId) { + ob_start(); + $tagObj = $GLOBALS['objects']['tag']; + $page = $GLOBALS['objects']['page']; + $objResponse = new xajaxResponse(); + + $messageArr = array( + 'title' => 'Unable to Remove Tag', + 'message' => "There was an unknown error while attempting to remove the tag.", + 'type' => 'error' + ); + + if(is_numeric($tagNameId) && is_numeric($recordId)) { + $result = $tagObj->remove_tag($recordId,$tagNameId); + $tagList = $tagObj->get_tag_list(); + + //check the results. + if($result==1) { + //Cool. Tell 'em the tag was removed. + $messageArr = array( + 'title' => 'Tag Successfully Removed', + 'message' => "We removed \"". $tagList[$tagNameId] ."\".", + 'type' => 'status' + ); + } + else { + //already got most of the array, just change the actual message. + $messageArr['message'] = "Result of trying to remove tag: (". $result .")"; + } + } + + $newTagList = generate_tag_list($recordId); + + if(strlen($newTagList)) { + $returnThis = $newTagList; + } + else { + $returnThis = "invalid response from generate_tag_list($recordId)"; + } + + $page->set_message_wrapper($messageArr); + $objResponse->addAssign('MAIN_error_message', 'innerHTML', $page->process_set_message()); + + $objResponse->addAssign('tagList', 'innerHTML', $returnThis); + $objResponse->addAssign('addTagOptionList', 'innerHTML', generate_addable_tags($recordId)); + + + ob_end_clean(); + return($objResponse); +}//end ajax__removeTag() + + + +function ajax__addTag($tagNameId, $recordId) { + ob_start(); + + $tagObj = $GLOBALS['objects']['tag']; + $page = $GLOBALS['objects']['page']; + $objResponse = new xajaxResponse(); + + $result = $tagObj->add_tag($recordId, $tagNameId); + + $objRes... [truncated message content] |
From: <cra...@us...> - 2009-02-06 21:20:58
|
Revision: 948 http://cs-project.svn.sourceforge.net/cs-project/?rev=948&view=rev Author: crazedsanity Date: 2009-02-06 21:20:53 +0000 (Fri, 06 Feb 2009) Log Message: ----------- *** RELEASE 1.2.0-ALPHA10 *** NOTE::: change log combined from 1.2.0-ALPHA9, which was rolled-back from the repository. SUMMARY OF CHANGES::: * Make the "select multiple" box for project associated users stand out more. * Credits file to show who's contributed to the project. * Fix typecast problem in SQL (#234) * New external libraries: -- cs-arrayToPath v1.0 -- cs-content v1.0-ALPHA7 -- cs-phpxml v2.0-ALPHA4 -- cs-versionparse v0.1.2 (NEW) * Fixed tabs to not have spaces under corners * Admin link is a new tab (instead of a link beneath settings) * Fix problem wherein an ajax call leaves unused template vars visible (#239) * Consolidate code for solve vs. remark (#240). * Single action button for helpdesk issues (#99) * Split include scripts into several smaller bits (#244) * Fix problem error when linking an unlinked issue to a project (#248). * Fix display issue with notes deforming the page layout (#249). * Remove some old test files Modified Paths: -------------- trunk/1.2/VERSION Modified: trunk/1.2/VERSION =================================================================== --- trunk/1.2/VERSION 2009-02-06 21:19:05 UTC (rev 947) +++ trunk/1.2/VERSION 2009-02-06 21:20:53 UTC (rev 948) @@ -1,4 +1,4 @@ $Id:VERSION 628 2007-11-20 16:58:45Z crazedsanity $ -VERSION: 1.2.0-ALPHA9 +VERSION: 1.2.0-ALPHA10 $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/VERSION $ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-06 21:19:11
|
Revision: 947 http://cs-project.svn.sourceforge.net/cs-project/?rev=947&view=rev Author: crazedsanity Date: 2009-02-06 21:19:05 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Upgrade cs-phpxml to v1.0-ALPHA4 Modified Paths: -------------- trunk/1.2/lib/globalFunctions.php Modified: trunk/1.2/lib/globalFunctions.php =================================================================== --- trunk/1.2/lib/globalFunctions.php 2009-02-06 21:15:47 UTC (rev 946) +++ trunk/1.2/lib/globalFunctions.php 2009-02-06 21:19:05 UTC (rev 947) @@ -18,7 +18,7 @@ //format: {className} => array({projectName} => {exactVersion}) $requirements = array( 'contentSystem' => array('cs-content', '1.0.0-ALPHA7'), - 'cs_phpxmlParser' => array('cs-phpxml', '1.0.0-ALPHA3'), + 'cs_phpxmlParser' => array('cs-phpxml', '1.0.0-ALPHA4'), 'cs_arrayToPath' => array('cs-arrayToPath', '1.0.0') ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-06 21:15:51
|
Revision: 946 http://cs-project.svn.sourceforge.net/cs-project/?rev=946&view=rev Author: crazedsanity Date: 2009-02-06 21:15:47 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Fix old naming of required classes (from cs-phpxml & cs-content). /lib/upgradeClass.php: * read_upgrade_config_file(): -- changed reference from xmlParser to cs_phpxmlParser * update_config_file(): -- cs_fileSystemClass -->> cs_fileSystem -- XMLParser -->> cs_phpxmlParser -- XMLCreator -->> cs_phpxmlCreator Modified Paths: -------------- trunk/1.2/lib/upgradeClass.php Modified: trunk/1.2/lib/upgradeClass.php =================================================================== --- trunk/1.2/lib/upgradeClass.php 2009-02-06 21:06:25 UTC (rev 945) +++ trunk/1.2/lib/upgradeClass.php 2009-02-06 21:15:47 UTC (rev 946) @@ -174,7 +174,7 @@ $xmlString = $this->fsObj->read("upgrade/upgrade.xml"); //parse the file. - $xmlParser = new xmlParser($xmlString); + $xmlParser = new cs_phpxmlParser($xmlString); $config = $xmlParser->get_tree(TRUE); $this->config = $config['UPGRADE']; @@ -626,9 +626,9 @@ private function update_config_file($index, $value) { $gf = new cs_globalFunctions; $myConfigFile = CONFIG_FILE_LOCATION; - $fs = new cs_fileSystemClass(dirname(__FILE__) .'/../'); - $xmlParser = new XMLParser($fs->read($myConfigFile)); - $xmlCreator = new XMLCreator; + $fs = new cs_fileSystem(dirname(__FILE__) .'/../'); + $xmlParser = new cs_phpxmlParser($fs->read($myConfigFile)); + $xmlCreator = new cs_phpxmlCreator; $xmlCreator->load_xmlparser_data($xmlParser); //update the given index. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-06 21:06:35
|
Revision: 945 http://cs-project.svn.sourceforge.net/cs-project/?rev=945&view=rev Author: crazedsanity Date: 2009-02-06 21:06:25 +0000 (Fri, 06 Feb 2009) Log Message: ----------- REVERSE-MERGE of last commits; 1.2.0-ALPHA9 has unexpected fatal errors. SVN COMMANDS::: merge --depth=infinity -r944:941 https://cs-project.svn.sourceforge.net/svnroot/cs-project/releases/1.2 Added Paths: ----------- releases/1.2/lib/cs-arrayToPath/ releases/1.2/lib/cs-arrayToPath/LICENSE releases/1.2/lib/cs-arrayToPath/VERSION releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php releases/1.2/lib/cs-arrayToPath/cs_versionAbstract.class.php releases/1.2/lib/cs-content/ releases/1.2/lib/cs-content/LICENSE releases/1.2/lib/cs-content/README.txt releases/1.2/lib/cs-content/VERSION releases/1.2/lib/cs-content/contentSystemClass.php releases/1.2/lib/cs-content/cs_bbCodeParser.class.php releases/1.2/lib/cs-content/cs_fileSystemClass.php releases/1.2/lib/cs-content/cs_genericPageClass.php releases/1.2/lib/cs-content/cs_globalFunctions.php releases/1.2/lib/cs-content/cs_phpDB.php releases/1.2/lib/cs-content/cs_sessionClass.php releases/1.2/lib/cs-content/cs_tabsClass.php releases/1.2/lib/cs-content/cs_versionAbstract.class.php releases/1.2/lib/cs-content/db_types/ releases/1.2/lib/cs-content/db_types/cs_phpDB__mysql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__pgsql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__sqlite.class.php releases/1.2/lib/cs-content/sample_files/ releases/1.2/lib/cs-content/sample_files/public_html/ releases/1.2/lib/cs-content/sample_files/public_html/.htaccess releases/1.2/lib/cs-content/sample_files/public_html/content releases/1.2/lib/cs-content/sample_files/public_html/index.php releases/1.2/lib/cs-content/sample_files/templates/ releases/1.2/lib/cs-content/sample_files/templates/content/ releases/1.2/lib/cs-content/sample_files/templates/content/index.content.tmpl releases/1.2/lib/cs-content/sample_files/templates/footer.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/header.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/infobar.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/main.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/menu.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/ releases/1.2/lib/cs-content/sample_files/templates/system/404.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/construction.content.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/db_error.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/message_box.tmpl releases/1.2/lib/cs-content/template.inc releases/1.2/lib/cs-phpxml/ releases/1.2/lib/cs-phpxml/LICENSE releases/1.2/lib/cs-phpxml/README.txt releases/1.2/lib/cs-phpxml/VERSION releases/1.2/lib/cs-phpxml/xmlAbstract.class.php releases/1.2/lib/cs-phpxml/xmlBuilderClass.php releases/1.2/lib/cs-phpxml/xmlCreatorClass.php releases/1.2/lib/cs-phpxml/xmlParserClass.php Removed Paths: ------------- releases/1.2/lib/cs-arrayToPath/ releases/1.2/lib/cs-arrayToPath/LICENSE releases/1.2/lib/cs-arrayToPath/VERSION releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php releases/1.2/lib/cs-arrayToPath/cs_versionAbstract.class.php releases/1.2/lib/cs-content/ releases/1.2/lib/cs-content/LICENSE releases/1.2/lib/cs-content/README.txt releases/1.2/lib/cs-content/VERSION releases/1.2/lib/cs-content/contentSystemClass.php releases/1.2/lib/cs-content/cs_bbCodeParser.class.php releases/1.2/lib/cs-content/cs_fileSystemClass.php releases/1.2/lib/cs-content/cs_genericPageClass.php releases/1.2/lib/cs-content/cs_globalFunctions.php releases/1.2/lib/cs-content/cs_phpDB.php releases/1.2/lib/cs-content/cs_sessionClass.php releases/1.2/lib/cs-content/cs_tabsClass.php releases/1.2/lib/cs-content/cs_versionAbstract.class.php releases/1.2/lib/cs-content/db_types/ releases/1.2/lib/cs-content/db_types/cs_phpDB__mysql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__pgsql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__sqlite.class.php releases/1.2/lib/cs-content/sample_files/ releases/1.2/lib/cs-content/sample_files/public_html/ releases/1.2/lib/cs-content/sample_files/public_html/.htaccess releases/1.2/lib/cs-content/sample_files/public_html/content releases/1.2/lib/cs-content/sample_files/public_html/index.php releases/1.2/lib/cs-content/sample_files/templates/ releases/1.2/lib/cs-content/sample_files/templates/content/ releases/1.2/lib/cs-content/sample_files/templates/content/index.content.tmpl releases/1.2/lib/cs-content/sample_files/templates/footer.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/header.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/infobar.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/main.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/menu.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/ releases/1.2/lib/cs-content/sample_files/templates/system/404.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/construction.content.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/db_error.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/message_box.tmpl releases/1.2/lib/cs-content/template.inc releases/1.2/lib/cs-phpxml/ releases/1.2/lib/cs-phpxml/LICENSE releases/1.2/lib/cs-phpxml/README.txt releases/1.2/lib/cs-phpxml/VERSION releases/1.2/lib/cs-phpxml/xmlAbstract.class.php releases/1.2/lib/cs-phpxml/xmlBuilderClass.php releases/1.2/lib/cs-phpxml/xmlCreatorClass.php releases/1.2/lib/cs-phpxml/xmlParserClass.php releases/1.2/lib/cs-versionparse/ Deleted: releases/1.2/lib/cs-arrayToPath/LICENSE =================================================================== --- releases/1.2/lib/cs-arrayToPath/LICENSE 2009-02-06 20:47:43 UTC (rev 941) +++ releases/1.2/lib/cs-arrayToPath/LICENSE 2009-02-06 21:06:25 UTC (rev 945) @@ -1,291 +0,0 @@ -NOTE: a full HTML version of this license can be found at: -http://www.opensource.org/licenses/gpl-license.php - -It has been reproduced below without any HTML. -========================================================================== - -The GNU General Public License (GPL) - -Version 2, June 1991 - - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - -NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS Copied: releases/1.2/lib/cs-arrayToPath/LICENSE (from rev 941, releases/1.2/lib/cs-arrayToPath/LICENSE) =================================================================== --- releases/1.2/lib/cs-arrayToPath/LICENSE (rev 0) +++ releases/1.2/lib/cs-arrayToPath/LICENSE 2009-02-06 21:06:25 UTC (rev 945) @@ -0,0 +1,291 @@ +NOTE: a full HTML version of this license can be found at: +http://www.opensource.org/licenses/gpl-license.php + +It has been reproduced below without any HTML. +========================================================================== + +The GNU General Public License (GPL) + +Version 2, June 1991 + + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Deleted: releases/1.2/lib/cs-arrayToPath/VERSION =================================================================== --- releases/1.2/lib/cs-arrayToPath/VERSION 2009-02-06 20:47:43 UTC (rev 941) +++ releases/1.2/lib/cs-arrayToPath/VERSION 2009-02-06 21:06:25 UTC (rev 945) @@ -1,5 +0,0 @@ -## Stores the current version of the cs-content system, and it's source. Please do NOT modify this file. - -VERSION: 0.2.2 -PROJECT: cs-arrayToPath -$HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/VERSION $ \ No newline at end of file Copied: releases/1.2/lib/cs-arrayToPath/VERSION (from rev 941, releases/1.2/lib/cs-arrayToPath/VERSION) =================================================================== --- releases/1.2/lib/cs-arrayToPath/VERSION (rev 0) +++ releases/1.2/lib/cs-arrayToPath/VERSION 2009-02-06 21:06:25 UTC (rev 945) @@ -0,0 +1,5 @@ +## Stores the current version of the cs-content system, and it's source. Please do NOT modify this file. + +VERSION: 0.2.2 +PROJECT: cs-arrayToPath +$HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/VERSION $ \ No newline at end of file Deleted: releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php =================================================================== --- releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php 2009-02-06 20:47:43 UTC (rev 941) +++ releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php 2009-02-06 21:06:25 UTC (rev 945) @@ -1,379 +0,0 @@ -<?php -/* - * Created on Nov 20, 2006 - * - * SVN INFORMATION::: - * ------------------- - * Last Author::::::::: $Author: crazedsanity $ - * Current Revision:::: $Revision: 17 $ - * Repository Location: $HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/arrayToPathClass.php $ - * Last Updated:::::::: $Date: 2007-09-12 14:24:46 -0500 (Wed, 12 Sep 2007) $ - * - * - * Basically traverses an array as though it were a filesystem. In the given example, it looks - * more complex than necessary, but the "NEW WAY" is very programatic, whereas the "OLD WAY" is - * just that: OLD. Also, the new way is very extensible, and is handy when performing a LOT of - * complex operations on an array. - * Example: - * OLD WAY: - * $my_data = $array['path']['to']['your']['hidden']['data']; - * $my_vault = $array['path']['to']['your']['hidden']['vault']; - * $my_other = $array['path']['to']['your']['hidden']['other']; - * - * $array['path']['to']['my'] = array(); - * $array['path']['to']['my']['data'] = array(); - * $array['path']['to']['my']['data']['is'] = "here"; - * NEW WAY: - * $arrayToPath = new arrayToPath($array); - * $my_data = $arrayToPath('/path/to/your/hidden/data'); - * $my_vault = $arrayToPath('/path/to/your/hidden/vault'); - * $my_other = $arrayToPath('/path/to/your/hidden/other'); - * - * $arrayToPath->set_data('/path/to/my/data/is', 'here'); - */ - - -require_once(dirname(__FILE__) .'/cs_versionAbstract.class.php'); - -class arrayToPath extends cs_a2p_versionAbstract { - - private $prefix = NULL; //the first directory to use. - private $data; - private $iteration = 0; - - //====================================================================================== - /** - * The constructor. - * - * @param $array (array) The data that will be used when - * - * TODO::: there is a strange recursion issue when $prefix is non-null: prefix is presently hardwired as NULL for now... - */ - public function __construct($array, $prefix=NULL) { - if($array === 'unit_test') { - //it's a unit test. - $this->isTest = TRUE; - } - else { - $this->get_version(); - $prefix=NULL; - if(!is_array($array)) { - //I don't deal with non-arrays. Idiot. - exit('arrayToPath{}->__construct(): got an invalid datatype.'); - } - //create a reference to the data, so if it changes, the class doesn't have to be re-initialized. - $this->data = $array; - - //now set the prefix ONLY if the prefix is valid. - if(!is_null($prefix) && strlen($prefix)) { - //got a good prefix, so use it. - $this->prefix = $prefix; - } - } - }//end __construct() - //====================================================================================== - - - //====================================================================================== - /** - * Takes a path & returns the appropriate index in the session. - * - * @param $path <str> path to the appropriate section in the session. - * - * @return <NULL> FAIL: unable to find requested index. - * @return <mixed> PASS: this is the value of the index. - */ - public function get_data($path=NULL) { - $myIndexList = array(); - $path = $this->fix_path($path); - - if(is_null($path) || (strlen($path) < 1)) { - //they just want ALL THE DATA. - $retval = $this->data; - } - else { - //get the list of indices in our data that we have to traverse. - $myIndexList = $this->explode_path($path); - - //set an initial retval. - $retval = $this->get_data_segment($this->data, $myIndexList[0]); - unset($myIndexList[0]); - - if(count($myIndexList) > 0) { - foreach($myIndexList as $indexName) { - $retval = $this->get_data_segment($retval, $indexName); - if(is_null($retval)) { - //hmm... well, if it's null, it's nothing which can have a sub-index. Stop here. - break; - } - } - } - } - - return($retval); - - }//end get_data() - //====================================================================================== - - - - //====================================================================================== - /** - * Returns a given index from a piece of data, used by get_data(). - */ - private function get_data_segment($fromThis, $indexName) { - if(is_array($fromThis)) { - //it's an array. - $retval = $fromThis[$indexName]; - } - elseif(is_object($fromThis)) { - //it's an object. - $retval = $fromThis->$indexName; - } - return($retval); - }//end get_data_segment() - //====================================================================================== - - - - //====================================================================================== - /** - * Pre-pends the internal $this->prefix onto the given path. - * - * @param $path <str> path to append $this->prefix onto. - * - * @return <str> PASS: this is the path with our prefix added. - */ - private function fix_path($path) { - if(is_null($path) && is_null($this->prefix)) { - //all data is null. don't bother changing it. - $retval = NULL; - } - else { - //remove slashes at the beginning or end of the path. - $path = preg_replace('/\/$/', '', $path); - - if(preg_match('/\/$/', $this->prefix)) { - //remove the trailing slash. - $this->prefix = preg_replace('/$\//', '', $this->prefix); - } - if(preg_match('/^\//', $this->prefix)) { - $this->prefix = preg_replace('/^\//', '', $this->prefix); - } - $path = preg_replace('/\/$/', '', $path); - - //should we add our prefix? - if(preg_match('/^\//', $path)) { - $retval = $path; - } - else { - $retval = $this->prefix ."/". $path; - } - - //remove a trailing slash, if present, before returning. - $retval = preg_replace('/\/$/', '', $retval); - } - - return($retval); - - }//end fix_path() - //====================================================================================== - - - - //====================================================================================== - /** - * Sets data into the given path, with options to override our internal prefix, and to - * force-overwrite data if it's not an array. - * - * @param $path <str> path to set the data into. - * @param $data <mixed> what to set into the given path. - * - * @return 0 FAIL: old data doesn't match new data. - * @return 1 PASS: everything lines-up. - */ - public function set_data($path, $data) { - //get the list of indices in the session that we have to traverse. - $myIndexList = $this->explode_path($path); - - $retval = 0; - //Use an internal iterator to go through the little bits of the session & set the - // data where it's supposed to be. - if($path === '/' || count($myIndexList) == 0) { - //setting the data. - $this->data = $data; - $retval = 1; - } - elseif(count($myIndexList) == 1) { - //that should be simple: set the index to be $data. - $this->data[$myIndexList[0]] = $data; - $retval = 1; - } - elseif(count($myIndexList) > 1) { - $this->internal_iterator($this->data, $path, $data); - $retval = 1; - } - - return($retval); - }//end set_data() - //====================================================================================== - - - //====================================================================================== - /** - * Iterates through the session to create the values for set_data(). This method passes - * AND returns the $array argument by reference. - * - * @param &$array (array) iterate through this. - * @param $path (array) numbered array of keys, representing a path through the - * internal data to go through to set $data. - * @param $data (mixed) data to set into the path referenced in $indexList. - * - * @return <void> - */ - protected function &internal_iterator(&$array, $path, $data) { - //make sure it doesn't call itself to death. ;) - $this->iteration++; - - if($this->iteration > 1000) { - throw new exception("arrayToPath{}: too many iterations, path=($path)"); - } - - $retval = 0; - $indexList = $this->explode_path($path); - $myIndex = array_shift($indexList); - $path = $this->string_from_array($indexList); - - if(is_array($array) && !strlen($path)) { - if(isset($myIndex)) { - //set the final piece of the array. - $array[$myIndex] = $data; - } - else { - //something is broken. - throw new exception("arrayToPath{}->internal_iterator(): no index ($myIndex) to follow at the end of the path."); - } - } - elseif(is_array($array) && strlen($path)) { - if((count($indexList) == 0) || (is_array($indexList) && count($indexList) > 1)) { - if(!is_array($array[$myIndex])) { - $array[$myIndex] = array(); - } - $array = &$array[$myIndex]; - $newPath = $this->string_from_array($indexList); - - $this->internal_iterator($array, $path, $data); - } - elseif(is_array($indexList) && count($indexList) == 1) { - if(!is_array($array[$myIndex])) { - $array[$myIndex] = array(); - } - $array = &$array[$myIndex]; - $this->internal_iterator($array, $indexList[0], $data); - } - else { - //not sure what to do but throw an exception. - throw new exception("arrayToPath{}->internal_iterator(): unknown error ('not sure what to do'): ($array)"); - } - } - elseif(is_object($array)) { - //can't handle objects...? - throw new exception("arrayToPath{}->internal_iterator(): can't handle objects...?"); - } - else { - //something is... er... broken. - throw new exception("arrayToPath{}->internal_iterator(): found unknown data type in path ($array)"); - } - - //decrement the iteration, so methods using it can call it multiple times without worrying about accidentally hitting the limit. - $this->iteration--; - }//end internal_iterator() - //====================================================================================== - - - - - //====================================================================================== - /** - * Will unset the final index in the $path var. I.E. to unset $this->array['x']['y'], - * call unset_data('/x/y') - * - * @param $path (str) path to unset data; The last item in the path will be removed. - */ - public function unset_data($path) { - //explode the path. - $pathArr = $this->explode_path($path); - $removeThis = array_pop($pathArr); - $path = $this->string_from_array($pathArr); - - //retrieve the data... - $myData = $this->get_data($path); - - if(is_array($myData)) { - //now remove the bit of data as requested. - unset($myData[$removeThis]); - //update the path with our new data. - $retval = $this->set_data($path, $myData); - } - else { - //throw a terrible error. - throw new exception("unset_data(): data ($myData) wasn't an array! ($path)"); - } - - return($retval); - }//end unset_data() - //====================================================================================== - - - - //====================================================================================== - /** - * Performs all the work of exploding the path and fixing it. - * - * @param $path <string> Path to work with. - * @return <array> PASS: array contains exploded path. - */ - public function explode_path($path) { - $path = preg_replace('/\/\//', '/', $path); - $path = $this->fix_path($path); - $retval = explode('/', $path); - - //if the initial index is blank, just remove it. - if($retval[0] == '' || strlen($retval[0]) < 1) { - //it was blank! KILL IT! - $checkItOut = array_shift($retval); - } - - return($retval); - }//end explode_path() - //====================================================================================== - - - - //====================================================================================== - public function reload_data($array) { - //call the constructor on it, and pass along the CURRENT prefix, so it doesn't get reset. - $this->__construct($array, $this->prefix); - }//end reload_data() - //====================================================================================== - - - - //====================================================================================== - private function string_from_array(array $array) { - $retval = ""; - foreach($array as $index) { - if(strlen($retval)) { - $retval .= "/". $index; - } - else { - $retval = $index; - } - } - return($retval); - }//end string_from_array() - //====================================================================================== - -}//end arrayToPath{} - -?> Copied: releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php (from rev 941, releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php) =================================================================== --- releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php (rev 0) +++ releases/1.2/lib/cs-arrayToPath/arrayToPathClass.php 2009-02-06 21:06:25 UTC (rev 945) @@ -0,0 +1,379 @@ +<?php +/* + * Created on Nov 20, 2006 + * + * SVN INFORMATION::: + * ------------------- + * Last Author::::::::: $Author: crazedsanity $ + * Current Revision:::: $Revision: 17 $ + * Repository Location: $HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/arrayToPathClass.php $ + * Last Updated:::::::: $Date: 2007-09-12 14:24:46 -0500 (Wed, 12 Sep 2007) $ + * + * + * Basically traverses an array as though it were a filesystem. In the given example, it looks + * more complex than necessary, but the "NEW WAY" is very programatic, whereas the "OLD WAY" is + * just that: OLD. Also, the new way is very extensible, and is handy when performing a LOT of + * complex operations on an array. + * Example: + * OLD WAY: + * $my_data = $array['path']['to']['your']['hidden']['data']; + * $my_vault = $array['path']['to']['your']['hidden']['vault']; + * $my_other = $array['path']['to']['your']['hidden']['other']; + * + * $array['path']['to']['my'] = array(); + * $array['path']['to']['my']['data'] = array(); + * $array['path']['to']['my']['data']['is'] = "here"; + * NEW WAY: + * $arrayToPath = new arrayToPath($array); + * $my_data = $arrayToPath('/path/to/your/hidden/data'); + * $my_vault = $arrayToPath('/path/to/your/hidden/vault'); + * $my_other = $arrayToPath('/path/to/your/hidden/other'); + * + * $arrayToPath->set_data('/path/to/my/data/is', 'here'); + */ + + +require_once(dirname(__FILE__) .'/cs_versionAbstract.class.php'); + +class arrayToPath extends cs_a2p_versionAbstract { + + private $prefix = NULL; //the first directory to use. + private $data; + private $iteration = 0; + + //====================================================================================== + /** + * The constructor. + * + * @param $array (array) The data that will be used when + * + * TODO::: there is a strange recursion issue when $prefix is non-null: prefix is presently hardwired as NULL for now... + */ + public function __construct($array, $prefix=NULL) { + if($array === 'unit_test') { + //it's a unit test. + $this->isTest = TRUE; + } + else { + $this->get_version(); + $prefix=NULL; + if(!is_array($array)) { + //I don't deal with non-arrays. Idiot. + exit('arrayToPath{}->__construct(): got an invalid datatype.'); + } + //create a reference to the data, so if it changes, the class doesn't have to be re-initialized. + $this->data = $array; + + //now set the prefix ONLY if the prefix is valid. + if(!is_null($prefix) && strlen($prefix)) { + //got a good prefix, so use it. + $this->prefix = $prefix; + } + } + }//end __construct() + //====================================================================================== + + + //====================================================================================== + /** + * Takes a path & returns the appropriate index in the session. + * + * @param $path <str> path to the appropriate section in the session. + * + * @return <NULL> FAIL: unable to find requested index. + * @return <mixed> PASS: this is the value of the index. + */ + public function get_data($path=NULL) { + $myIndexList = array(); + $path = $this->fix_path($path); + + if(is_null($path) || (strlen($path) < 1)) { + //they just want ALL THE DATA. + $retval = $this->data; + } + else { + //get the list of indices in our data that we have to traverse. + $myIndexList = $this->explode_path($path); + + //set an initial retval. + $retval = $this->get_data_segment($this->data, $myIndexList[0]); + unset($myIndexList[0]); + + if(count($myIndexList) > 0) { + foreach($myIndexList as $indexName) { + $retval = $this->get_data_segment($retval, $indexName); + if(is_null($retval)) { + //hmm... well, if it's null, it's nothing which can have a sub-index. Stop here. + break; + } + } + } + } + + return($retval); + + }//end get_data() + //====================================================================================== + + + + //====================================================================================== + /** + * Returns a given index from a piece of data, used by get_data(). + */ + private function get_data_segment($fromThis, $indexName) { + if(is_array($fromThis)) { + //it's an array. + $retval = $fromThis[$indexName]; + } + elseif(is_object($fromThis)) { + //it's an object. + $retval = $fromThis->$indexName; + } + return($retval); + }//end get_data_segment() + //====================================================================================== + + + + //====================================================================================== + /** + * Pre-pends the internal $this->prefix onto the given path. + * + * @param $path <str> path to append $this->prefix onto. + * + * @return <str> PASS: this is the path with our prefix added. + */ + private function fix_path($path) { + if(is_null($path) && is_null($this->prefix)) { + //all data is null. don't bother changing it. + $retval = NULL; + } + else { + //remove slashes at the beginning or end of the path. + $path = preg_replace('/\/$/', '', $path); + + if(preg_match('/\/$/', $this->prefix)) { + //remove the trailing slash. + $this->prefix = preg_replace('/$\//', '', $this->prefix); + } + if(preg_match('/^\//', $this->prefix)) { + $this->prefix = preg_replace('/^\//', '', $this->prefix); + } + $path = preg_replace('/\/$/', '', $path); + + //should we add our prefix? + if(preg_match('/^\//', $path)) { + $retval = $path; + } + else { + $retval = $this->prefix ."/". $path; + } + + //remove a trailing slash, if present, before returning. + $retval = preg_replace('/\/$/', '', $retval); + } + + return($retval); + + }//end fix_path() + //====================================================================================== + + + + //====================================================================================== + /** + * Sets data into the given path, with options to override our internal prefix, and to + * force-overwrite data if it's not an array. + * + * @param $path <str> path to set the data into. + * @param $data <mixed> what to set into the given path. + * + * @return 0 FAIL: old data doesn't match new data. + * @return 1 PASS: everything lines-up. + */ + public function set_data($path, $data) { + //get the list of indices in the session that we have to traverse. + $myIndexList = $this->explode_path($path); + + $retval = 0; + //Use an internal iterator to go through the little bits of the session & set the + // data where it's supposed to be. + if($path === '/' || count($myIndexList) == 0) { + //setting the data. + $this->data = $data; + $retval = 1; + } + elseif(count($myIndexList) == 1) { + //that should be simple: set the index to be $data. + $this->data[$myIndexList[0]] = $data; + $retval = 1; + } + elseif(count($myIndexList) > 1) { + $this->internal_iterator($this->data, $path, $data); + $retval = 1; + } + + return($retval); + }//end set_data() + //====================================================================================== + + + //====================================================================================== + /** + * Iterates through the session to create the values for set_data(). This method passes + * AND returns the $array argument by reference. + * + * @param &$array (array) iterate through this. + * @param $path (array) numbered array of keys, representing a path through the + * internal data to go through to set $data. + * @param $data (mixed) data to set into the path referenced in $indexList. + * + * @return <void> + */ + protected function &internal_iterator(&$array, $path, $data) { + //make sure it doesn't call itself to death. ;) + $this->iteration++; + + if($this->iteration > 1000) { + throw new exception("arrayToPath{}: too many iterations, path=($path)"); + } + + $retval = 0; + $indexList = $this->explode_path($path); + $myIndex = array_shift($indexList); + $path = $this->string_from_array($indexList); + + if(is_array($a... [truncated message content] |
From: <cra...@us...> - 2009-02-06 20:57:27
|
Revision: 944 http://cs-project.svn.sourceforge.net/cs-project/?rev=944&view=rev Author: crazedsanity Date: 2009-02-06 20:57:19 +0000 (Fri, 06 Feb 2009) Log Message: ----------- New versions of libraries for version 1.2.0-ALPHA9 Added Paths: ----------- releases/1.2/lib/cs-arrayToPath/ releases/1.2/lib/cs-arrayToPath/CREDITS releases/1.2/lib/cs-arrayToPath/LICENSE releases/1.2/lib/cs-arrayToPath/VERSION releases/1.2/lib/cs-arrayToPath/cs_arrayToPath.class.php releases/1.2/lib/cs-arrayToPath/tests/ releases/1.2/lib/cs-arrayToPath/tests/example_test.php releases/1.2/lib/cs-arrayToPath/tests/testOfA2P.php releases/1.2/lib/cs-content/ releases/1.2/lib/cs-content/CREDITS releases/1.2/lib/cs-content/LICENSE releases/1.2/lib/cs-content/README.txt releases/1.2/lib/cs-content/VERSION releases/1.2/lib/cs-content/abstract/ releases/1.2/lib/cs-content/abstract/cs_content.abstract.class.php releases/1.2/lib/cs-content/abstract/cs_phpDB.abstract.class.php releases/1.2/lib/cs-content/contentSystem.class.php releases/1.2/lib/cs-content/cs_bbCodeParser.class.php releases/1.2/lib/cs-content/cs_fileSystem.class.php releases/1.2/lib/cs-content/cs_genericPage.class.php releases/1.2/lib/cs-content/cs_globalFunctions.class.php releases/1.2/lib/cs-content/cs_phpDB.class.php releases/1.2/lib/cs-content/cs_session.class.php releases/1.2/lib/cs-content/cs_siteConfig.class.php releases/1.2/lib/cs-content/cs_tabs.class.php releases/1.2/lib/cs-content/db_types/ releases/1.2/lib/cs-content/db_types/cs_phpDB__mysql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__pgsql.class.php releases/1.2/lib/cs-content/db_types/cs_phpDB__sqlite.class.php releases/1.2/lib/cs-content/required/ releases/1.2/lib/cs-content/required/template.inc releases/1.2/lib/cs-content/sample_files/ releases/1.2/lib/cs-content/sample_files/public_html/ releases/1.2/lib/cs-content/sample_files/public_html/.htaccess releases/1.2/lib/cs-content/sample_files/public_html/content releases/1.2/lib/cs-content/sample_files/public_html/index.php releases/1.2/lib/cs-content/sample_files/templates/ releases/1.2/lib/cs-content/sample_files/templates/content/ releases/1.2/lib/cs-content/sample_files/templates/content/index.content.tmpl releases/1.2/lib/cs-content/sample_files/templates/footer.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/header.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/infobar.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/main.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/menu.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/ releases/1.2/lib/cs-content/sample_files/templates/system/404.shared.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/construction.content.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/db_error.tmpl releases/1.2/lib/cs-content/sample_files/templates/system/message_box.tmpl releases/1.2/lib/cs-content/tests/ releases/1.2/lib/cs-content/tests/example_test.php releases/1.2/lib/cs-content/tests/files/ releases/1.2/lib/cs-content/tests/files/gptest_all-together.txt releases/1.2/lib/cs-content/tests/files/sampleConfig.xml releases/1.2/lib/cs-content/tests/files/templates/ releases/1.2/lib/cs-content/tests/files/templates/content.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/footer.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/infobar.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/main.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/menubar.shared.tmpl releases/1.2/lib/cs-content/tests/files/templates/title.shared.tmpl releases/1.2/lib/cs-content/tests/testOfCSContent.php releases/1.2/lib/cs-phpxml/ releases/1.2/lib/cs-phpxml/CREDITS releases/1.2/lib/cs-phpxml/LICENSE releases/1.2/lib/cs-phpxml/README.txt releases/1.2/lib/cs-phpxml/VERSION releases/1.2/lib/cs-phpxml/cs_phpxml.abstract.class.php releases/1.2/lib/cs-phpxml/cs_phpxmlBuilder.class.php releases/1.2/lib/cs-phpxml/cs_phpxmlCreator.class.php releases/1.2/lib/cs-phpxml/cs_phpxmlParser.class.php releases/1.2/lib/cs-phpxml/tests/ releases/1.2/lib/cs-phpxml/tests/example_test.php releases/1.2/lib/cs-phpxml/tests/files/ releases/1.2/lib/cs-phpxml/tests/files/test1.xml releases/1.2/lib/cs-phpxml/tests/testOfCSPHPXML.php releases/1.2/lib/cs-versionparse/ releases/1.2/lib/cs-versionparse/CREDITS releases/1.2/lib/cs-versionparse/LICENSE releases/1.2/lib/cs-versionparse/VERSION releases/1.2/lib/cs-versionparse/cs_version.abstract.class.php releases/1.2/lib/cs-versionparse/tests/ releases/1.2/lib/cs-versionparse/tests/example_test.php releases/1.2/lib/cs-versionparse/tests/files/ releases/1.2/lib/cs-versionparse/tests/files/version1 releases/1.2/lib/cs-versionparse/tests/files/version2 releases/1.2/lib/cs-versionparse/tests/files/version3 releases/1.2/lib/cs-versionparse/tests/testOfCSVersionParse.php Added: releases/1.2/lib/cs-arrayToPath/CREDITS =================================================================== --- releases/1.2/lib/cs-arrayToPath/CREDITS (rev 0) +++ releases/1.2/lib/cs-arrayToPath/CREDITS 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,3 @@ + +Lead Developer: Dan Falconer (cra...@us...) + Added: releases/1.2/lib/cs-arrayToPath/LICENSE =================================================================== --- releases/1.2/lib/cs-arrayToPath/LICENSE (rev 0) +++ releases/1.2/lib/cs-arrayToPath/LICENSE 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,291 @@ +NOTE: a full HTML version of this license can be found at: +http://www.opensource.org/licenses/gpl-license.php + +It has been reproduced below without any HTML. +========================================================================== + +The GNU General Public License (GPL) + +Version 2, June 1991 + + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Added: releases/1.2/lib/cs-arrayToPath/VERSION =================================================================== --- releases/1.2/lib/cs-arrayToPath/VERSION (rev 0) +++ releases/1.2/lib/cs-arrayToPath/VERSION 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,5 @@ +## Stores the current version of the cs-content system, and it's source. Please do NOT modify this file. + +VERSION: 1.0 +PROJECT: cs-arrayToPath +$HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/VERSION $ \ No newline at end of file Added: releases/1.2/lib/cs-arrayToPath/cs_arrayToPath.class.php =================================================================== --- releases/1.2/lib/cs-arrayToPath/cs_arrayToPath.class.php (rev 0) +++ releases/1.2/lib/cs-arrayToPath/cs_arrayToPath.class.php 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,385 @@ +<?php +/* + * Created on Nov 20, 2006 + * + * SVN INFORMATION::: + * ------------------- + * Last Author::::::::: $Author: crazedsanity $ + * Current Revision:::: $Revision: 25 $ + * Repository Location: $HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/cs_arrayToPath.class.php $ + * Last Updated:::::::: $Date: 2009-01-25 17:17:49 -0600 (Sun, 25 Jan 2009) $ + * + * + * Basically traverses an array as though it were a filesystem. In the given example, it looks + * more complex than necessary, but the "NEW WAY" is very programatic, whereas the "OLD WAY" is + * just that: OLD. Also, the new way is very extensible, and is handy when performing a LOT of + * complex operations on an array. + * Example: + * OLD WAY: + * $my_data = $array['path']['to']['your']['hidden']['data']; + * $my_vault = $array['path']['to']['your']['hidden']['vault']; + * $my_other = $array['path']['to']['your']['hidden']['other']; + * + * $array['path']['to']['my'] = array(); + * $array['path']['to']['my']['data'] = array(); + * $array['path']['to']['my']['data']['is'] = "here"; + * NEW WAY: + * $arrayToPath = new arrayToPath($array); + * $my_data = $arrayToPath('/path/to/your/hidden/data'); + * $my_vault = $arrayToPath('/path/to/your/hidden/vault'); + * $my_other = $arrayToPath('/path/to/your/hidden/other'); + * + * $arrayToPath->set_data('/path/to/my/data/is', 'here'); + */ + + +require_once(dirname(__FILE__) .'/../cs-versionparse/cs_version.abstract.class.php'); + +class cs_arrayToPath extends cs_versionAbstract { + + private $prefix = NULL; //the first directory to use. + private $data; + private $iteration = 0; + + //====================================================================================== + /** + * The constructor. + * + * @param $array (array) The data that will be used when + * + * TODO::: there is a strange recursion issue when $prefix is non-null: prefix is presently hardwired as NULL for now... + */ + public function __construct($array) { + $this->set_version_file_location(dirname(__FILE__) . '/VERSION'); + if($array === 'unit_test') { + //it's a unit test. + $this->isTest = TRUE; + } + else { + $this->get_version(); + if(!is_array($array)) { + //I don't deal with non-arrays. Idiot. + exit('arrayToPath{}->__construct(): got an invalid datatype.'); + } + //create a reference to the data, so if it changes, the class doesn't have to be re-initialized. + $this->data = $array; + } + }//end __construct() + //====================================================================================== + + + //====================================================================================== + /** + * Takes a path & returns the appropriate index in the session. + * + * @param $path <str> path to the appropriate section in the session. + * + * @return <NULL> FAIL: unable to find requested index. + * @return <mixed> PASS: this is the value of the index. + */ + public function get_data($path=NULL) { + $myIndexList = array(); + $path = $this->fix_path($path); + + if(is_null($path) || (strlen($path) < 1)) { + //they just want ALL THE DATA. + $retval = $this->data; + } + else { + //get the list of indices in our data that we have to traverse. + $myIndexList = $this->explode_path($path); + + //set an initial retval. + $retval = $this->get_data_segment($this->data, $myIndexList[0]); + unset($myIndexList[0]); + + if(count($myIndexList) > 0) { + foreach($myIndexList as $indexName) { + $retval = $this->get_data_segment($retval, $indexName); + if(is_null($retval)) { + //hmm... well, if it's null, it's nothing which can have a sub-index. Stop here. + break; + } + } + } + } + + return($retval); + + }//end get_data() + //====================================================================================== + + + + //====================================================================================== + /** + * Returns a given index from a piece of data, used by get_data(). + */ + private function get_data_segment($fromThis, $indexName) { + if(is_array($fromThis)) { + //it's an array. + $retval = $fromThis[$indexName]; + } + elseif(is_object($fromThis)) { + //it's an object. + $retval = $fromThis->$indexName; + } + return($retval); + }//end get_data_segment() + //====================================================================================== + + + + //====================================================================================== + /** + * Fixes issues with extra slashes and such. + * + * @param $path <str> path to fix + * + * @return <str> PASS: this is the fixed path + */ + private function fix_path($path) { + $retval = $path; + if(!is_null($path) && strlen($path)) { + + $retval = preg_replace('/[\/]{2,}/', '/', $retval); + if(strlen($retval) && preg_match('/\./', $retval)) { + + $pieces = explode('/', $retval); + + $finalPieces = array(); + for($i=0; $i < count($pieces); $i++) { + $dirName = $pieces[$i]; + if($dirName == '.') { + //do nothing; don't bother appending. + } + elseif($dirName == '..') { + $rippedIndex = array_pop($finalPieces); + } + else { + $finalPieces[] = $dirName; + } + } + + #$retval = $this->gf->string_from_array($finalPieces, NULL, '/'); + $retval = ""; + foreach($finalPieces as $bit) { + if(strlen($retval)) { + $retval .= '/'. $bit; + } + else { + $retval = '/'. $bit; + } + } + } + + //remove slashes at the beginning or end of the path. + $retval = preg_replace('/\/$/', '', $retval); + + //remove a trailing slash, if present, before returning. + $retval = preg_replace('/\/$/', '', $retval); + } + + return($retval); + + }//end fix_path() + //====================================================================================== + + + + //====================================================================================== + /** + * Sets data into the given path, with options to override our internal prefix, and to + * force-overwrite data if it's not an array. + * + * @param $path <str> path to set the data into. + * @param $data <mixed> what to set into the given path. + * + * @return 0 FAIL: old data doesn't match new data. + * @return 1 PASS: everything lines-up. + */ + public function set_data($path, $data) { + //get the list of indices in the session that we have to traverse. + $myIndexList = $this->explode_path($path); + + $retval = 0; + //Use an internal iterator to go through the little bits of the session & set the + // data where it's supposed to be. + if($path === '/' || count($myIndexList) == 0) { + //setting the data. + $this->data = $data; + $retval = 1; + } + elseif(count($myIndexList) == 1) { + //that should be simple: set the index to be $data. + $this->data[$myIndexList[0]] = $data; + $retval = 1; + } + elseif(count($myIndexList) > 1) { + $this->internal_iterator($this->data, $path, $data); + $retval = 1; + } + + return($retval); + }//end set_data() + //====================================================================================== + + + //====================================================================================== + /** + * Iterates through the session to create the values for set_data(). This method passes + * AND returns the $array argument by reference. + * + * @param &$array (array) iterate through this. + * @param $path (array) numbered array of keys, representing a path through the + * internal data to go through to set $data. + * @param $data (mixed) data to set into the path referenced in $indexList. + * + * @return <void> + */ + protected function &internal_iterator(&$array, $path, $data) { + //make sure it doesn't call itself to death. ;) + $this->iteration++; + + if($this->iteration > 1000) { + throw new exception("arrayToPath{}: too many iterations, path=($path)"); + } + + $retval = 0; + $indexList = $this->explode_path($path); + $myIndex = array_shift($indexList); + $path = $this->string_from_array($indexList); + + if(is_array($array) && !strlen($path)) { + if(isset($myIndex)) { + //set the final piece of the array. + $array[$myIndex] = $data; + } + else { + //something is broken. + throw new exception("arrayToPath{}->internal_iterator(): no index ($myIndex) to follow at the end of the path."); + } + } + elseif(is_array($array) && strlen($path)) { + if((count($indexList) == 0) || (is_array($indexList) && count($indexList) > 1)) { + if(!is_array($array[$myIndex])) { + $array[$myIndex] = array(); + } + $array = &$array[$myIndex]; + $newPath = $this->string_from_array($indexList); + + $this->internal_iterator($array, $path, $data); + } + elseif(is_array($indexList) && count($indexList) == 1) { + if(!is_array($array[$myIndex])) { + $array[$myIndex] = array(); + } + $array = &$array[$myIndex]; + $this->internal_iterator($array, $indexList[0], $data); + } + else { + //not sure what to do but throw an exception. + throw new exception("arrayToPath{}->internal_iterator(): unknown error ('not sure what to do'): ($array)"); + } + } + elseif(is_object($array)) { + //can't handle objects...? + throw new exception("arrayToPath{}->internal_iterator(): can't handle objects...?"); + } + else { + //something is... er... broken. + throw new exception("arrayToPath{}->internal_iterator(): found unknown data type in path ($array)"); + } + + //decrement the iteration, so methods using it can call it multiple times without worrying about accidentally hitting the limit. + $this->iteration--; + }//end internal_iterator() + //====================================================================================== + + + + + //====================================================================================== + /** + * Will unset the final index in the $path var. I.E. to unset $this->array['x']['y'], + * call unset_data('/x/y') + * + * @param $path (str) path to unset data; The last item in the path will be removed. + */ + public function unset_data($path) { + //explode the path. + $pathArr = $this->explode_path($path); + $removeThis = array_pop($pathArr); + $path = $this->string_from_array($pathArr); + + //retrieve the data... + $myData = $this->get_data($path); + + if(is_array($myData)) { + //now remove the bit of data as requested. + unset($myData[$removeThis]); + //update the path with our new data. + $retval = $this->set_data($path, $myData); + } + else { + //throw a terrible error. + throw new exception("unset_data(): data ($myData) wasn't an array! ($path)"); + } + + return($retval); + }//end unset_data() + //====================================================================================== + + + + //====================================================================================== + /** + * Performs all the work of exploding the path and fixing it. + * + * @param $path <string> Path to work with. + * @return <array> PASS: array contains exploded path. + */ + public function explode_path($path) { + $path = preg_replace('/\/\//', '/', $path); + $path = $this->fix_path($path); + $retval = explode('/', $path); + + //if the initial index is blank, just remove it. + if($retval[0] == '' || strlen($retval[0]) < 1) { + //it was blank! KILL IT! + $checkItOut = array_shift($retval); + } + + return($retval); + }//end explode_path() + //====================================================================================== + + + + //====================================================================================== + public function reload_data($array) { + //call the constructor on it, and pass along the CURRENT prefix, so it doesn't get reset. + $this->__construct($array); + }//end reload_data() + //====================================================================================== + + + + //====================================================================================== + private function string_from_array(array $array) { + $retval = ""; + foreach($array as $index) { + if(strlen($retval)) { + $retval .= "/". $index; + } + else { + $retval = $index; + } + } + return($retval); + }//end string_from_array() + //====================================================================================== + +}//end arrayToPath{} + +?> Added: releases/1.2/lib/cs-arrayToPath/tests/example_test.php =================================================================== --- releases/1.2/lib/cs-arrayToPath/tests/example_test.php (rev 0) +++ releases/1.2/lib/cs-arrayToPath/tests/example_test.php 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,19 @@ +<?php +/* + * Created on Jan 25, 2009 + * + * FILE INFORMATION: + * + * $HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/tests/example_test.php $ + * $Id: example_test.php 23 2009-01-25 21:25:10Z crazedsanity $ + * $LastChangedDate: 2009-01-25 15:25:10 -0600 (Sun, 25 Jan 2009) $ + * $LastChangedBy: crazedsanity $ + * $LastChangedRevision: 23 $ + */ + + +require_once(dirname(__FILE__) .'/testOfA2P.php'); + +$test = &new TestOfA2P(); +$test->run(new HtmlReporter()) +?> Added: releases/1.2/lib/cs-arrayToPath/tests/testOfA2P.php =================================================================== --- releases/1.2/lib/cs-arrayToPath/tests/testOfA2P.php (rev 0) +++ releases/1.2/lib/cs-arrayToPath/tests/testOfA2P.php 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,75 @@ +<?php +/* + * Created on Jan 25, 2009 + * + * FILE INFORMATION: + * + * $HeadURL: https://cs-arraytopath.svn.sourceforge.net/svnroot/cs-arraytopath/trunk/tests/testOfA2P.php $ + * $Id: testOfA2P.php 25 2009-01-25 23:17:49Z crazedsanity $ + * $LastChangedDate: 2009-01-25 17:17:49 -0600 (Sun, 25 Jan 2009) $ + * $LastChangedBy: crazedsanity $ + * $LastChangedRevision: 25 $ + */ + +require_once(dirname(__FILE__) .'/../cs_arrayToPath.class.php'); + +class testOfA2P extends UnitTestCase { + + //------------------------------------------------------------------------- + function setUp() { + $this->a2p = new cs_arrayToPath(array()); + $this->gfObj = new cs_globalFunctions; + }//end setUp() + //------------------------------------------------------------------------- + + + + //------------------------------------------------------------------------- + function tearDown() { + }//end tearDown() + //------------------------------------------------------------------------- + + + + //------------------------------------------------------------------------- + function test_basics() { + //make sure nothing is in the object initialially. + $this->assertEqual(array(), $this->a2p->get_data()); + + $newData = array( + 'look at me' => '23dasdvcv3q3qeedasd' + ); + $this->a2p->reload_data($newData); + $this->assertNotEqual(array(), $this->a2p->get_data()); + + + //load a complex array & test to ensure the returned value is the same. + $newData = array( + 'x' => array( + 'y' => array( + 'z' => array( + 'fiNal' => 'asdfadsfadfadsfasdf' + ) + ), + '_y_' => null, + '-' => null + ), + 'a nother path2 Stuff -+=~!@#$' + ); + $this->a2p->reload_data($newData); + $this->assertEqual($newData, $this->a2p->get_data()); + $this->assertEqual($newData['x']['y']['z']['fiNal'], $this->a2p->get_data('/x/y/z/fiNal')); + + $this->a2p->set_data('/x/y/z/fiNal', null); + $this->assertNotEqual($this->a2p->get_data('/x/y/z/fiNal'), $newData['x']['y']['z']['fiNal']); + + //ensure paths with dots are ok. + $this->assertEqual($this->a2p->get_data('/x/y/z/fiNal'), $this->a2p->get_data('/x/y/z/g/q/x/../../../fiNal')); + + //make sure extra slashes are okay. + $this->assertEqual($this->a2p->get_data('/x/y/z/fiNal'), $this->a2p->get_data('/x/y//z///fiNal//')); + }//end test_basics() + //------------------------------------------------------------------------- + +}//end testOfA2P{} +?> Added: releases/1.2/lib/cs-content/CREDITS =================================================================== --- releases/1.2/lib/cs-content/CREDITS (rev 0) +++ releases/1.2/lib/cs-content/CREDITS 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,3 @@ + +Lead Developer: Dan Falconer (cra...@us...) + Added: releases/1.2/lib/cs-content/LICENSE =================================================================== --- releases/1.2/lib/cs-content/LICENSE (rev 0) +++ releases/1.2/lib/cs-content/LICENSE 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,291 @@ +NOTE: a full HTML version of this license can be found at: +http://www.opensource.org/licenses/gpl-license.php + +It has been reproduced below without any HTML. +========================================================================== + +The GNU General Public License (GPL) + +Version 2, June 1991 + + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + +NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Added: releases/1.2/lib/cs-content/README.txt =================================================================== --- releases/1.2/lib/cs-content/README.txt (rev 0) +++ releases/1.2/lib/cs-content/README.txt 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,5 @@ +Documentation is now located at: +[https://cs-content.svn.sourceforge.net/svnroot/cs-content/documentation]. It +has been moved to avoid unnecessarily large downloads. + +$Id: README.txt 267 2008-04-29 15:27:28Z crazedsanity $ \ No newline at end of file Added: releases/1.2/lib/cs-content/VERSION =================================================================== --- releases/1.2/lib/cs-content/VERSION (rev 0) +++ releases/1.2/lib/cs-content/VERSION 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,5 @@ +## Stores the current version of the cs-content system, and it's source. Please do NOT modify this file. + +VERSION: 1.0-ALPHA7 +PROJECT: cs-content +$HeadURL: https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/1.0/VERSION $ \ No newline at end of file Added: releases/1.2/lib/cs-content/abstract/cs_content.abstract.class.php =================================================================== --- releases/1.2/lib/cs-content/abstract/cs_content.abstract.class.php (rev 0) +++ releases/1.2/lib/cs-content/abstract/cs_content.abstract.class.php 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,36 @@ +<?php +/* + * Created on Jan 29, 2009 + * + * FILE INFORMATION: + * + * $HeadURL: https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/1.0/abstract/cs_content.abstract.class.php $ + * $Id: cs_content.abstract.class.php 335 2009-01-29 21:25:58Z crazedsanity $ + * $LastChangedDate: 2009-01-29 15:25:58 -0600 (Thu, 29 Jan 2009) $ + * $LastChangedBy: crazedsanity $ + * $LastChangedRevision: 335 $ + */ + +require_once(dirname(__FILE__) ."/../../cs-versionparse/cs_version.abstract.class.php"); + + +abstract class cs_contentAbstract extends cs_versionAbstract { + + //------------------------------------------------------------------------- + function __construct($makeGfObj=true) { + $this->set_version_file_location(dirname(__FILE__) . '/../VERSION'); + $this->get_version(); + $this->get_project(); + + if($makeGfObj === true) { + //make a cs_globalFunctions{} object. + require_once(dirname(__FILE__) ."/../cs_globalFunctions.class.php"); + $this->gfObj = new cs_globalFunctions(); + } + }//end __construct() + //------------------------------------------------------------------------- + + + +} +?> \ No newline at end of file Added: releases/1.2/lib/cs-content/abstract/cs_phpDB.abstract.class.php =================================================================== --- releases/1.2/lib/cs-content/abstract/cs_phpDB.abstract.class.php (rev 0) +++ releases/1.2/lib/cs-content/abstract/cs_phpDB.abstract.class.php 2009-02-06 20:57:19 UTC (rev 944) @@ -0,0 +1,166 @@ +<?php +/* + * Created on Jan 29, 2009 + * + * FILE INFORMATION: + * + * $HeadURL: https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/1.0/abstract/cs_phpDB.abstract.class.php $ + * $Id: cs_phpDB.abstract.class.php 330 2009-01-29 19:44:01Z crazedsanity $ + * $LastChangedDate: 2009-01-29 13:44:01 -0600 (Thu, 29 Jan 2009) $ + * $LastChangedBy: crazedsanity $ + * $LastChangedRevision: 330 $ + */ + +abstract class cs_phpDBAbstract { + + /** Internal result set pointer. */ + protected $result = NULL; + + /** Internal error code. */ + protected $errorCode = 0; + + /** Status of the current transaction. */ + protected $transStatus = NULL; + + /** Whether there is a transaction in progress or not. */ + protected $inTrans = FALSE; + + /** Holds the last query performed. */ + protected $lastQuery = NULL; + + /** List of queries that have been run */ + protected $queryList=array(); + + /** How many seconds to wait for a query before cancelling it. */ + protected $timeOutSeconds = NULL; + + /** Internal check to determine if a connection has been established. */ + protected $isConnected=FALSE; + + /** Internal check to determine if the parameters have been set. */ + protected $paramsAreSet=FALSE; + + /** Resource handle. */ + protected $connectionID = -1; + + /** Hostname or IP to connect to */ + protected $host; + + /** Port to connect to (default for Postgres is 5432) */ + protected $port; + + /** Name of the database */ + protected $dbname; + + /** Username to connect to the database */ + protected $user; + + /** password to connect to the database */ + protected $password; + + /** Row counter for looping through records */ + protected $row = -1; + + /** cs_globalFunctions object, for string stuff. */ + protected $gfObj; + + /** Internal check to ensure the object has been properly created. */ + protected $isInitialized=FALSE; + + /** List of prepared statements, indexed off the name, with the sub-array being fieldname=>dataType. */ + protected $preparedStatements = array(); + + /** Set to TRUE to save all queries into an array. */ + protected $useQueryList=FALSE; + + /** array that essentially remembers how many times beginTrans() was called. */ + protected $transactionTree = NULL; + + + + //Define some abstract methods so they MUST be provided in order for things to work. + abstract public function set_db_info(array $params); + abstract public function close(); + abstract public function connect(array $dbParams=NULL, $forceNewConnection=FALSE); + abstract public function exec($query); + abstract public function errorMsg($setMessage=null, $logError=null); + abstract public function fobject(); + abstract public function farray(); + abstract public function farray_fieldnames($index=null, $numbered=null,$unsetIndex=1); + abstr... [truncated message content] |
From: <cra...@us...> - 2009-02-06 20:51:49
|
Revision: 943 http://cs-project.svn.sourceforge.net/cs-project/?rev=943&view=rev Author: crazedsanity Date: 2009-02-06 20:51:48 +0000 (Fri, 06 Feb 2009) Log Message: ----------- remove cs-content & cs-phpxml to make way for new versions. Removed Paths: ------------- releases/1.2/lib/cs-content/ releases/1.2/lib/cs-phpxml/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-02-06 20:51:12
|
Revision: 942 http://cs-project.svn.sourceforge.net/cs-project/?rev=942&view=rev Author: crazedsanity Date: 2009-02-06 20:51:07 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Remove cs-arrayToPath (need to re-export new version) Removed Paths: ------------- releases/1.2/lib/cs-arrayToPath/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |