Thread: [Cs-project-svn_notify] SF.net SVN: cs-project: [628] trunk
Brought to you by:
crazedsanity
From: <cra...@us...> - 2007-11-20 16:59:07
|
Revision: 628 http://cs-project.svn.sourceforge.net/cs-project/?rev=628&view=rev Author: crazedsanity Date: 2007-11-20 08:58:45 -0800 (Tue, 20 Nov 2007) Log Message: ----------- added svn:eol-style (native) Property Changed: ---------------- trunk/LICENSE trunk/VERSION trunk/upgrade/upgrade.xml trunk/upgrade/upgradeTo1.1.0-BETA10.php trunk/upgrade/upgradeTo1.1.0-BETA12.php trunk/upgrade/upgradeTo1.1.0-BETA13.php trunk/upgrade/upgradeTo1.1.0-BETA2.php trunk/upgrade/upgradeTo1.1.0-BETA3.php trunk/upgrade/upgradeTo1.1.0-BETA4.php trunk/upgrade/upgradeTo1.1.0-BETA7.php Property changes on: trunk/LICENSE ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/VERSION ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/upgrade/upgrade.xml ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/upgrade/upgradeTo1.1.0-BETA10.php ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/upgrade/upgradeTo1.1.0-BETA12.php ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/upgrade/upgradeTo1.1.0-BETA13.php ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/upgrade/upgradeTo1.1.0-BETA2.php ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/upgrade/upgradeTo1.1.0-BETA3.php ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/upgrade/upgradeTo1.1.0-BETA4.php ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/upgrade/upgradeTo1.1.0-BETA7.php ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-11-20 18:31:55
|
Revision: 642 http://cs-project.svn.sourceforge.net/cs-project/?rev=642&view=rev Author: crazedsanity Date: 2007-11-20 10:31:53 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Upgrade script for fixing a problematic constraint. Added Paths: ----------- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql trunk/upgrade/upgradeTo1.1.0-BETA14.php Copied: trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql (from rev 641, trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA13.sql) =================================================================== --- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql (rev 0) +++ trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql 2007-11-20 18:31:53 UTC (rev 642) @@ -0,0 +1,12 @@ +-- +-- SVN INFORMATION::: +-- +-- SVN Signature::::::: $Id$ +-- Last Committted::::: $Date$ +-- Last Committed Path: $HeadURL$ +-- + +ALTER TABLE contact_email_table DROP CONSTRAINT "contact_email_table_contact_id_fkey"; +ALTER TABLE ONLY contact_email_table + ADD CONSTRAINT contact_email_table_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact_table(contact_id) + DEFERRABLE INITIALLY DEFERRED; Copied: trunk/upgrade/upgradeTo1.1.0-BETA14.php (from rev 641, trunk/upgrade/upgradeTo1.1.0-BETA13.php) =================================================================== --- trunk/upgrade/upgradeTo1.1.0-BETA14.php (rev 0) +++ trunk/upgrade/upgradeTo1.1.0-BETA14.php 2007-11-20 18:31:53 UTC (rev 642) @@ -0,0 +1,55 @@ +<?php +/* + * Created on Oct 29, 2007 + */ + + +class upgrade_to_1_1_0_BETA13 extends dbAbstract { + + private $logsObj; + + //========================================================================= + public function __construct(cs_phpDB &$db) { + if(!$db->is_connected()) { + throw new exception(__METHOD__ .": database is not connected"); + } + $this->db = $db; + + $this->logsObj = new logsClass($this->db, 'Upgrade'); + + $this->gfObj = new cs_globalFunctions; + $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; + }//end __construct() + //========================================================================= + + + + //========================================================================= + public function run_upgrade() { + + + $this->db->beginTrans(__METHOD__); + + $this->run_schema_changes(); + + $this->db->commitTrans(__METHOD__); + + }//end run_upgrade() + //========================================================================= + + + + //========================================================================= + private function run_schema_changes() { + + $this->gfObj->debug_print(__METHOD__ .": running SQL file..."); + $this->run_sql_file(dirname(__FILE__) .'/../docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql'); + + $details = "Executed SQL file, '". $this->lastSQLFile ."'. Encoded contents::: ". + base64_encode($this->fsObj->read($this->lastSQLFile)); + $this->logsObj->log_by_class($details, 'system'); + }//end run_schema_changes() + //========================================================================= +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-11-20 19:02:41
|
Revision: 646 http://cs-project.svn.sourceforge.net/cs-project/?rev=646&view=rev Author: crazedsanity Date: 2007-11-20 11:02:33 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Remove changes & upgrades that require the contact_id in contact_email_table to be deferrable + initially deferred (fixed in the code). Modified Paths: -------------- trunk/docs/schema/cs_project.schema.sql trunk/docs/sql/setup/03__indexes_etc.sql Removed Paths: ------------- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql trunk/upgrade/upgradeTo1.1.0-BETA14.php Modified: trunk/docs/schema/cs_project.schema.sql =================================================================== --- trunk/docs/schema/cs_project.schema.sql 2007-11-20 18:58:07 UTC (rev 645) +++ trunk/docs/schema/cs_project.schema.sql 2007-11-20 19:02:33 UTC (rev 646) @@ -2004,8 +2004,7 @@ -- ALTER TABLE ONLY contact_email_table - ADD CONSTRAINT contact_email_table_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact_table(contact_id) - DEFERRABLE INITIALLY DEFERRED; + ADD CONSTRAINT contact_email_table_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact_table(contact_id); -- Modified: trunk/docs/sql/setup/03__indexes_etc.sql =================================================================== --- trunk/docs/sql/setup/03__indexes_etc.sql 2007-11-20 18:58:07 UTC (rev 645) +++ trunk/docs/sql/setup/03__indexes_etc.sql 2007-11-20 19:02:33 UTC (rev 646) @@ -466,8 +466,7 @@ -- ALTER TABLE ONLY contact_email_table - ADD CONSTRAINT contact_email_table_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact_table(contact_id) - DEFERRABLE INITIALLY DEFERRED; + ADD CONSTRAINT contact_email_table_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact_table(contact_id); -- Deleted: trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql =================================================================== --- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql 2007-11-20 18:58:07 UTC (rev 645) +++ trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql 2007-11-20 19:02:33 UTC (rev 646) @@ -1,12 +0,0 @@ --- --- SVN INFORMATION::: --- --- SVN Signature::::::: $Id$ --- Last Committted::::: $Date$ --- Last Committed Path: $HeadURL$ --- - -ALTER TABLE contact_email_table DROP CONSTRAINT "contact_email_table_contact_id_fkey"; -ALTER TABLE ONLY contact_email_table - ADD CONSTRAINT contact_email_table_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact_table(contact_id) - DEFERRABLE INITIALLY DEFERRED; Deleted: trunk/upgrade/upgradeTo1.1.0-BETA14.php =================================================================== --- trunk/upgrade/upgradeTo1.1.0-BETA14.php 2007-11-20 18:58:07 UTC (rev 645) +++ trunk/upgrade/upgradeTo1.1.0-BETA14.php 2007-11-20 19:02:33 UTC (rev 646) @@ -1,55 +0,0 @@ -<?php -/* - * Created on Oct 29, 2007 - */ - - -class upgrade_to_1_1_0_BETA13 extends dbAbstract { - - private $logsObj; - - //========================================================================= - public function __construct(cs_phpDB &$db) { - if(!$db->is_connected()) { - throw new exception(__METHOD__ .": database is not connected"); - } - $this->db = $db; - - $this->logsObj = new logsClass($this->db, 'Upgrade'); - - $this->gfObj = new cs_globalFunctions; - $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; - }//end __construct() - //========================================================================= - - - - //========================================================================= - public function run_upgrade() { - - - $this->db->beginTrans(__METHOD__); - - $this->run_schema_changes(); - - $this->db->commitTrans(__METHOD__); - - }//end run_upgrade() - //========================================================================= - - - - //========================================================================= - private function run_schema_changes() { - - $this->gfObj->debug_print(__METHOD__ .": running SQL file..."); - $this->run_sql_file(dirname(__FILE__) .'/../docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql'); - - $details = "Executed SQL file, '". $this->lastSQLFile ."'. Encoded contents::: ". - base64_encode($this->fsObj->read($this->lastSQLFile)); - $this->logsObj->log_by_class($details, 'system'); - }//end run_schema_changes() - //========================================================================= -} - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-11-20 19:55:56
|
Revision: 647 http://cs-project.svn.sourceforge.net/cs-project/?rev=647&view=rev Author: crazedsanity Date: 2007-11-20 11:55:31 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Database modifications to set priority based on associated tags (issue #77). Added Paths: ----------- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql trunk/upgrade/upgradeTo1.1.0-BETA14.php Copied: trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql (from rev 646, trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA13.sql) =================================================================== --- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql (rev 0) +++ trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql 2007-11-20 19:55:31 UTC (rev 647) @@ -0,0 +1,13 @@ +-- +-- SVN INFORMATION::: +-- +-- SVN Signature::::::: $Id$ +-- Last Committted::::: $Date$ +-- Last Committed Path: $HeadURL$ +-- + + +ALTER TABLE tag_name_table ADD COLUMN modifier int; +UPDATE tag_name_table SET modifier = -1; +ALTER TABLE tag_name_table ALTER COLUMN SET DEFAULT -1; +ALTER TABLE tag_name_table SET NOT NULL; Copied: trunk/upgrade/upgradeTo1.1.0-BETA14.php (from rev 646, trunk/upgrade/upgradeTo1.1.0-BETA13.php) =================================================================== --- trunk/upgrade/upgradeTo1.1.0-BETA14.php (rev 0) +++ trunk/upgrade/upgradeTo1.1.0-BETA14.php 2007-11-20 19:55:31 UTC (rev 647) @@ -0,0 +1,57 @@ +<?php +/* + * Created on Nov 20, 2007 + */ + + +class upgrade_to_1_1_0_BETA14 extends dbAbstract { + + private $logsObj; + + //========================================================================= + public function __construct(cs_phpDB &$db) { + if(!$db->is_connected()) { + throw new exception(__METHOD__ .": database is not connected"); + } + $this->db = $db; + + $this->logsObj = new logsClass($this->db, 'Upgrade'); + + $this->gfObj = new cs_globalFunctions; + $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; + }//end __construct() + //========================================================================= + + + + //========================================================================= + public function run_upgrade() { + + + $this->db->beginTrans(__METHOD__); + + $this->run_schema_changes(); + $this->update_tag_modifiers(); + + + $this->db->commitTrans(__METHOD__); + + }//end run_upgrade() + //========================================================================= + + + + //========================================================================= + private function run_schema_changes() { + + $this->gfObj->debug_print(__METHOD__ .": running SQL file..."); + $this->run_sql_file(dirname(__FILE__) .'/../docs/sql/upgrades/upgradeTo1.1.0-BETA14.sql'); + + $details = "Executed SQL file, '". $this->lastSQLFile ."'. Encoded contents::: ". + base64_encode($this->fsObj->read($this->lastSQLFile)); + $this->logsObj->log_by_class($details, 'system'); + }//end run_schema_changes() + //========================================================================= +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-11-21 20:34:26
|
Revision: 664 http://cs-project.svn.sourceforge.net/cs-project/?rev=664&view=rev Author: crazedsanity Date: 2007-11-21 12:34:21 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Formatting of helpdesk issue body & notes without "pre" tags. Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/includes/extern/helpdesk.inc trunk/templates/content/helpdesk/view.content.tmpl trunk/templates/extern/helpdesk/view.content.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2007-11-21 19:03:03 UTC (rev 663) +++ trunk/includes/content/helpdesk.inc 2007-11-21 20:34:21 UTC (rev 664) @@ -247,12 +247,16 @@ $page->add_template_var("select_category_list", $categoryList); //convert the returned data into htmlentities so brackets show properly. - $helpdeskData['subject'] = $bbCodeParser->parseString(cleanString($helpdeskData['subject'], "htmlentity_plus_brackets")); + $helpdeskData['subject'] = $bbCodeParser->parseString(cleanString($helpdeskData['subject'], "htmlentity_plus_brackets"), TRUE); + $helpdeskData['subject'] = preg_replace('/\s\s/', ' ', $helpdeskData['subject']); + $helpdeskData['subject'] = preg_replace('/\S\s\s/', ' ', $helpdeskData['subject']); + + $helpdeskData['name'] = cleanString($helpdeskData['name'], "htmlentity_plus_brackets"); $helpdeskData['solution'] = cleanString($helpdeskData['solution'], "htmlentity_plus_brackets"); //make the wrapping SANE. - $helpdeskData['subject'] = wordwrap($helpdeskData['subject'], FORMAT_WORDWRAP); + #$helpdeskData['subject'] = wordwrap($helpdeskData['subject'], FORMAT_WORDWRAP); //show the buttons appropriate to their membership level & ownership. //if they're the owner, show the "solution" section. @@ -367,6 +371,9 @@ foreach($myNotes as $repArr) { $repArr['body'] = $bbCodeParser->parseString(cleanString($repArr['body'], "htmlentity_plus_brackets")); $repArr['subject'] = cleanString($repArr['subject'], "htmlentity_plus_brackets"); + $repArr['subject'] = preg_replace('/\s\s/', ' ', $repArr['subject']); + $repArr['subject'] = preg_replace('/\S\s\s/', ' ', $repArr['subject']); + $repArr['solutionIndicator'] = ""; if($repArr['is_solution'] == 't') { Modified: trunk/includes/extern/helpdesk.inc =================================================================== --- trunk/includes/extern/helpdesk.inc 2007-11-21 19:03:03 UTC (rev 663) +++ trunk/includes/extern/helpdesk.inc 2007-11-21 20:34:21 UTC (rev 664) @@ -147,7 +147,9 @@ //make the wrapping SANE. $helpdeskData['subject'] = wordwrap($helpdeskData['subject'], FORMAT_WORDWRAP); - $helpdeskData['subject'] = $bbCodeParser->parseString($helpdeskData['subject'],FALSE); + $helpdeskData['subject'] = $bbCodeParser->parseString($helpdeskData['subject'], TRUE); + $helpdeskData['subject'] = preg_replace('/\s\s/', ' ', $helpdeskData['subject']); + $helpdeskData['subject'] = preg_replace('/\S\s\s/', ' ', $helpdeskData['subject']); //add everything to the page as a template var... foreach($helpdeskData as $field=>$value) { @@ -177,7 +179,10 @@ $baseRow = $page->templateRows['issueNotes']; foreach($myNotes as $repArr) { $repArr['body'] = cleanString($repArr['body'], "htmlentity_plus_brackets"); - $repArr['body'] = $bbCodeParser->parseString($repArr['body'], FALSE); + $repArr['body'] = $bbCodeParser->parseString($repArr['body'], TRUE); + $repArr['body'] = preg_replace('/\s\s/', ' ', $repArr['body']); + $repArr['body'] = preg_replace('/\S\s\s/', ' ', $repArr['body']); + $repArr['subject'] = cleanString($repArr['subject'], "htmlentity_plus_brackets"); $repArr['solutionIndicator'] = ""; Modified: trunk/templates/content/helpdesk/view.content.tmpl =================================================================== --- trunk/templates/content/helpdesk/view.content.tmpl 2007-11-21 19:03:03 UTC (rev 663) +++ trunk/templates/content/helpdesk/view.content.tmpl 2007-11-21 20:34:21 UTC (rev 664) @@ -142,7 +142,7 @@ <th style="border-bottom:solid #000 1px;" align="right">Issue Text:</th> - <td style="border-bottom:solid #000 1px;" width="650" colspan="2" nowrap><pre>{subject}</pre></td> + <td style="border-bottom:solid #000 1px;" width="650" colspan="2" nowrap><code>{subject}</code></td> </tr> <tr> <th style="border-bottom:solid #000 1px;" align="right">Notes:<BR><font size="-3"><i>(Includes previous/current<BR>solution(s), if available)</i></font></th> Modified: trunk/templates/extern/helpdesk/view.content.tmpl =================================================================== --- trunk/templates/extern/helpdesk/view.content.tmpl 2007-11-21 19:03:03 UTC (rev 663) +++ trunk/templates/extern/helpdesk/view.content.tmpl 2007-11-21 20:34:21 UTC (rev 664) @@ -37,17 +37,17 @@ <th style="border-bottom:solid #000 1px;" align="right" valign="top">Issue Text:</th> - <td style="border-bottom:solid #000 1px;" width="650" colspan="2"><pre>{subject}</pre></td> + <td style="border-bottom:solid #000 1px;" width="650" colspan="2"><code>{subject}</code></td> </tr> <tr> <th style="border-bottom:solid #000 1px;" align="right">Notes:<BR><font size="-3"><i>(Includes previous/current<BR>solution(s), if available)</i></font></th> <td style="border-bottom:solid #000 1px;" colspan="2"> <!-- BEGIN issueNotes --><div style="border-top:dashed #000 1px;">%%solutionIndicator%% <u> [#%%note_id%%] <b>%%subject%%</b> (%%fname%%@%%created%%)</u></div> - <div style="width:100%; overflow:auto"><pre style="font-size:10px;">%%body%%</pre></div> + <div style="width:100%; overflow:auto"><code style="font-size:10px;">%%body%%</code></div> <!-- END issueNotes --> </td> </tr> -<!-- BEGIN remark_row --> + <tr> <td colspan="3"><h3 style="display:inline">Email:</h3> @@ -72,7 +72,7 @@ <input name="action" value="Remark" type="submit"> </td> </tr> -<!-- END remxark_row --> + </tbody> </table> </form> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-11-21 20:52:01
|
Revision: 665 http://cs-project.svn.sourceforge.net/cs-project/?rev=665&view=rev Author: crazedsanity Date: 2007-11-21 12:51:59 -0800 (Wed, 21 Nov 2007) Log Message: ----------- More formatting of issue body & notes. Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/includes/extern/helpdesk.inc trunk/templates/extern/helpdesk/view.content.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2007-11-21 20:34:21 UTC (rev 664) +++ trunk/includes/content/helpdesk.inc 2007-11-21 20:51:59 UTC (rev 665) @@ -247,7 +247,7 @@ $page->add_template_var("select_category_list", $categoryList); //convert the returned data into htmlentities so brackets show properly. - $helpdeskData['subject'] = $bbCodeParser->parseString(cleanString($helpdeskData['subject'], "htmlentity_plus_brackets"), TRUE); + $helpdeskData['subject'] = $bbCodeParser->parseString(cleanString($helpdeskData['subject'], "htmlentity_plus_brackets")); $helpdeskData['subject'] = preg_replace('/\s\s/', ' ', $helpdeskData['subject']); $helpdeskData['subject'] = preg_replace('/\S\s\s/', ' ', $helpdeskData['subject']); Modified: trunk/includes/extern/helpdesk.inc =================================================================== --- trunk/includes/extern/helpdesk.inc 2007-11-21 20:34:21 UTC (rev 664) +++ trunk/includes/extern/helpdesk.inc 2007-11-21 20:51:59 UTC (rev 665) @@ -146,8 +146,9 @@ unset($helpdeskData['notes']); //make the wrapping SANE. - $helpdeskData['subject'] = wordwrap($helpdeskData['subject'], FORMAT_WORDWRAP); - $helpdeskData['subject'] = $bbCodeParser->parseString($helpdeskData['subject'], TRUE); + #$helpdeskData['subject'] = wordwrap($helpdeskData['subject'], FORMAT_WORDWRAP); + $helpdeskData['subject'] = cleanString($helpdeskData['subject'], "htmlentity_plus_brackets"); + $helpdeskData['subject'] = $bbCodeParser->parseString($helpdeskData['subject']); $helpdeskData['subject'] = preg_replace('/\s\s/', ' ', $helpdeskData['subject']); $helpdeskData['subject'] = preg_replace('/\S\s\s/', ' ', $helpdeskData['subject']); @@ -179,7 +180,7 @@ $baseRow = $page->templateRows['issueNotes']; foreach($myNotes as $repArr) { $repArr['body'] = cleanString($repArr['body'], "htmlentity_plus_brackets"); - $repArr['body'] = $bbCodeParser->parseString($repArr['body'], TRUE); + $repArr['body'] = $bbCodeParser->parseString($repArr['body'], FALSE); $repArr['body'] = preg_replace('/\s\s/', ' ', $repArr['body']); $repArr['body'] = preg_replace('/\S\s\s/', ' ', $repArr['body']); Modified: trunk/templates/extern/helpdesk/view.content.tmpl =================================================================== --- trunk/templates/extern/helpdesk/view.content.tmpl 2007-11-21 20:34:21 UTC (rev 664) +++ trunk/templates/extern/helpdesk/view.content.tmpl 2007-11-21 20:51:59 UTC (rev 665) @@ -43,7 +43,8 @@ <th style="border-bottom:solid #000 1px;" align="right">Notes:<BR><font size="-3"><i>(Includes previous/current<BR>solution(s), if available)</i></font></th> <td style="border-bottom:solid #000 1px;" colspan="2"> <!-- BEGIN issueNotes --><div style="border-top:dashed #000 1px;">%%solutionIndicator%% <u> [#%%note_id%%] <b>%%subject%%</b> (%%fname%%@%%created%%)</u></div> - <div style="width:100%; overflow:auto"><code style="font-size:10px;">%%body%%</code></div> + + <BR><div style="width:100%; overflow:auto"><code style="font-size:10px;">%%body%%</code></div> <!-- END issueNotes --> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-11-21 22:40:56
|
Revision: 671 http://cs-project.svn.sourceforge.net/cs-project/?rev=671&view=rev Author: crazedsanity Date: 2007-11-21 14:20:25 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Updated tag listing. Modified Paths: -------------- trunk/templates/content/tags/index.content.tmpl Added Paths: ----------- trunk/public_html/images/bullet-round.png Added: trunk/public_html/images/bullet-round.png =================================================================== (Binary files differ) Property changes on: trunk/public_html/images/bullet-round.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/templates/content/tags/index.content.tmpl =================================================================== --- trunk/templates/content/tags/index.content.tmpl 2007-11-21 21:40:05 UTC (rev 670) +++ trunk/templates/content/tags/index.content.tmpl 2007-11-21 22:20:25 UTC (rev 671) @@ -6,14 +6,24 @@ <tr> <td> <b>Available Tags:</b><BR> - <ul> + <table border="0" cellpadding="1" cellspacing="0"> <!-- BEGIN availableTagsList --> - <li><a href="{PHP_SELF}?showTag=%%tagNameId%%">(%%tagNameId%%) %%tagName%%</a></li> + <tr> + <td nowrap style="padding-left:5px;"> + <img src="/images/bullet-round.png" border="0"> + <a href="{PHP_SELF}?showTag=%%tagNameId%%"> %%tagName%%</a> + </td> + </tr> <!-- END availableTagsList --> - <!-- BEGIN availableTagsList_noLink --> - <li>(%%tagNameId%%) %%tagName%%</li> - <!-- END availableTagsList_noLink --> - </ul> + <!-- BEGIN availableTagsList_selected --> + <tr> + <td nowrap style="padding-left:5px;"> + <img src="/images/bullet-round.png" border="0"> + <b> %%tagName%%</b> + </td> + </tr> + <!-- END availableTagsList_selected --> + </table> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-11-23 21:34:50
|
Revision: 686 http://cs-project.svn.sourceforge.net/cs-project/?rev=686&view=rev Author: crazedsanity Date: 2007-11-23 13:34:48 -0800 (Fri, 23 Nov 2007) Log Message: ----------- Fix note display to be unified (hopefully). Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/includes/extern/helpdesk.inc trunk/templates/content/project/view/related_note.content.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2007-11-23 21:26:18 UTC (rev 685) +++ trunk/includes/content/helpdesk.inc 2007-11-23 21:34:48 UTC (rev 686) @@ -370,8 +370,6 @@ $baseRow = $page->templateRows['issueNotes']; foreach($myNotes as $repArr) { $repArr['body'] = $bbCodeParser->parseString($repArr['body']); - $repArr['body'] = preg_replace('/\s\s/', ' ', $repArr['body']); - $repArr['body'] = preg_replace('/\S\s\s/', ' ', $repArr['body']); $repArr['subject'] = cleanString($repArr['subject'], "htmlentity_plus_brackets"); Modified: trunk/includes/extern/helpdesk.inc =================================================================== --- trunk/includes/extern/helpdesk.inc 2007-11-23 21:26:18 UTC (rev 685) +++ trunk/includes/extern/helpdesk.inc 2007-11-23 21:34:48 UTC (rev 686) @@ -149,7 +149,6 @@ #$helpdeskData['subject'] = wordwrap($helpdeskData['subject'], FORMAT_WORDWRAP); $helpdeskData['subject'] = cleanString($helpdeskData['subject'], "htmlentity_plus_brackets"); $helpdeskData['subject'] = $bbCodeParser->parseString($helpdeskData['subject'], TRUE); - $helpdeskData['subject'] = preg_replace('/\s\s/', ' ', $helpdeskData['subject']); $helpdeskData['subject'] = preg_replace('/\S\s\s/', ' ', $helpdeskData['subject']); //add everything to the page as a template var... Modified: trunk/templates/content/project/view/related_note.content.tmpl =================================================================== --- trunk/templates/content/project/view/related_note.content.tmpl 2007-11-23 21:26:18 UTC (rev 685) +++ trunk/templates/content/project/view/related_note.content.tmpl 2007-11-23 21:34:48 UTC (rev 686) @@ -9,7 +9,7 @@ <td width="100%"><a href="/content/notes/view?ID=%%id%%"><img src="/images/pixel_blue.gif" alt="" border="0" width="7"></a> <a name="note_%%id%%"></a> <a href="/content/notes/view?ID=%%id%%" target="_top"> <u>[%%updated%%: <b>%%fname%% %%lname%%</b>]</u> %%subject%%</a><BR> - <pre style="text-decoration:normal;font-size:10pt;">%%body%%</pre></td> + <code style="text-decoration:normal;font-size:10pt;">%%body%%</code></td> </tr> <!-- END related_note_row --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-14 01:06:08
|
Revision: 691 http://cs-project.svn.sourceforge.net/cs-project/?rev=691&view=rev Author: crazedsanity Date: 2007-12-13 17:05:59 -0800 (Thu, 13 Dec 2007) Log Message: ----------- SQL & class changes. /docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql: * added "description" to invoice status records * insert available status records. * set default for invoice_status_id on invoice_table. /lib/invoice.class.php: * MAIN::: -- updated comments at top to explain what the class is for. -- created some private members. -- created constants (table & sequence names). * create_invoice() [NEW]: -- public method to create an invoice * get_inserted_invoice_id() [NEW,PRIVATE]: -- private method for getting value of the invoice_id sequence. /lib/invoiceItem.class.php: * MAIN::: -- extends invoice instead of dbAbstract. /lib/invoiceTransaction.class.php: * MAIN::: -- extends invoice instead of dbAbstract. Modified Paths: -------------- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql trunk/lib/invoice.class.php trunk/lib/invoiceItem.class.php trunk/lib/invoiceTransaction.class.php Modified: trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql =================================================================== --- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql 2007-12-13 23:42:23 UTC (rev 690) +++ trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql 2007-12-14 01:05:59 UTC (rev 691) @@ -10,9 +10,15 @@ CREATE TABLE invoice_status_table ( invoice_status_id integer NOT NULL PRIMARY KEY, name text NOT NULL UNIQUE, + description text NOT NULL UNIQUE, is_updateable boolean NOT NULL DEFAULT FALSE ); +-- NOTE: by setting the invoice_status_id, we ensure they always get set properly, and new ones can't be readily inserted without specifying that too. +INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (-1, 'W/0', 'Write Off', FALSE); +INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (0, 'New', 'Open, pending changes', TRUE); +INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (1, 'OK', 'Completed', FALSE); + CREATE TABLE invoice_table ( invoice_id integer NOT NULL PRIMARY KEY, poc text, @@ -24,7 +30,7 @@ city text, state text, zip text, - invoice_status_id integer NOT NULL REFERENCES invoice_status_table(invoice_status_id), + invoice_status_id integer NOT NULL DEFAULT 0 REFERENCES invoice_status_table(invoice_status_id), creator_contact_id integer NOT NULL REFERENCES contact_table(contact_id), billing_contact_id integer NOT NULL REFERENCES contact_table(contact_id), is_proforma boolean NOT NULL DEFAULT FALSE, Modified: trunk/lib/invoice.class.php =================================================================== --- trunk/lib/invoice.class.php 2007-12-13 23:42:23 UTC (rev 690) +++ trunk/lib/invoice.class.php 2007-12-14 01:05:59 UTC (rev 691) @@ -1,5 +1,8 @@ <?php /* + * This class was built to handle creation, searching, and updates of invoices. + * For searches involving items on the invoice, use invoiceItem{}. + * invoices is handled by * * SVN INFORMATION::: * ------------------ @@ -18,6 +21,20 @@ protected $gfObj; protected $logsObj; + private $invoiceId = NULL; + private $creatorContactId = NULL; + private $billingContactId = NULL; + + //set some internal things that should NEVER be changed after initialization. + const mainTable = 'invoice_table'; + const mainTableSeq = 'invoice_table_invoice_id_seq'; + + const itemTable = 'invoice_item_table'; + const itemTableSeq = 'invoice_item_table_invoice_item_id_seq'; + + const transTable = 'invoice_transaction_table'; + const transTableSeq = 'invoice_transaction_table_invoice_transaction_id_seq'; + //========================================================================= public function __construct(cs_phpDB $db) { $this->db = $db; @@ -30,8 +47,69 @@ //========================================================================= + /** + * Method to handle creating the main invoice record. + */ + public function create_invoice(array $invoiceData, $isProforma=FALSE) { + $cleanFields = array( + 'poc','company', 'address1', 'address2', 'phone', 'fax', 'city', + 'state', 'zip' + ); + + $insertArr = array(); + foreach($invoiceData as $name=>$value) { + $insertArr[$name] = $this->gfObj->cleanString($value, 'sql'); + } + + if($isProforma === TRUE) { + $insertArr['is_proforma'] = 't'; + } + + $insertString = $this->gfObj->string_from_array($insertArr, 'insert', NULL, 'sql'); + + $sql = "INSERT INTO ". $this->mainTable .' '. $insertString; + + if($this->run_sql($sql)) { + //pull the new invoice id. + $retval = $this->get_inserted_invoice_id(); + } + else { + throw new exception(__METHOD__ .': failed to insert new invoice: '. $this->lastError ."<BR>\nSQL::: ". $sql); + } + + return($retval); + + }//end create_invoice() + //========================================================================= + + + + //========================================================================= + /** + * Add a line item to the invoice; should be an instance of invoiceItem{}. + */ public function add_item(invoiceItem $item) { }//end add_item() //========================================================================= + + + + //========================================================================= + /** + * Retrieve the invoice_id that was last inserted. + */ + private function get_inserted_invoice_id() { + $sql = "SELECT currval('". $this->mainTableSeq ."'::text)"; + if($this->run_sql($sql)) { + $data = $this->db->farray(); + $retval = $data[0]; + } + else { + throw new exception(__METHOD__ .": failed to retrieve last invoice_id: ". $this->lastError); + } + + return($retval); + }//end get_inserted_invoice_id() + //========================================================================= } ?> Modified: trunk/lib/invoiceItem.class.php =================================================================== --- trunk/lib/invoiceItem.class.php 2007-12-13 23:42:23 UTC (rev 690) +++ trunk/lib/invoiceItem.class.php 2007-12-14 01:05:59 UTC (rev 691) @@ -14,7 +14,7 @@ //TODO: log everything! -class invoiceItem extends dbAbstract { +class invoiceItem extends invoice { protected $gfObj; protected $logsObj; Modified: trunk/lib/invoiceTransaction.class.php =================================================================== --- trunk/lib/invoiceTransaction.class.php 2007-12-13 23:42:23 UTC (rev 690) +++ trunk/lib/invoiceTransaction.class.php 2007-12-14 01:05:59 UTC (rev 691) @@ -13,7 +13,7 @@ //TODO: log everything! -class invoiceTransaction extends dbAbstract { +class invoiceTransaction extends invoice { protected $gfObj; protected $logsObj; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-14 01:53:10
|
Revision: 692 http://cs-project.svn.sourceforge.net/cs-project/?rev=692&view=rev Author: crazedsanity Date: 2007-12-13 17:53:03 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Files for xofrevlis to test invoice template parsing with... Modified Paths: -------------- trunk/public_html/.htaccess Added Paths: ----------- trunk/includes/test.inc trunk/public_html/test trunk/public_html/test.php trunk/templates/test/ Copied: trunk/includes/test.inc (from rev 690, trunk/includes/extern.inc) =================================================================== --- trunk/includes/test.inc (rev 0) +++ trunk/includes/test.inc 2007-12-14 01:53:03 UTC (rev 692) @@ -0,0 +1,79 @@ +<?php +/* + * Created on Dec 13, 2007 + * + * SVN INFORMATION::: + * ------------------ + * Last Author::::::::: $Author$ + * Current Revision:::: $Revision$ + * Repository Location: $HeadURL$ + * Last Updated:::::::: $Date$ + + */ + + +$invoiceData = array( + 'invoice_id' => '10015', + 'poc' => 'Johnny Jackson', + 'company' => 'Llama Soft, Inc.', + 'address1' => '1555 North Georgia Ave.', + 'address2' => 'Suite 1411', + 'phone' => '(701) 555-3389 ext. 1911', + 'fax' => '(701) 555-9193', + 'city' => 'St. Louis', + 'state' => 'Missouri', + 'zip' => '55454' +); + +$invoiceItemData = array( + 91 => array( + 'invoice_item_id' => 91, + 'invoice_id' => 10015, + 'description' => 'Contract Downpayment', + 'unit_price' => 3000, + 'quantity' => 1 + ), + 93 => array( + 'invoice_item_id' => 93, + 'invoice_id' => 10015, + 'description' => 'Remote Software Development', + 'unit_price' => 75, + 'quantity' => 40 + ), + 94 => array( + 'invoice_item_id' => 94, + 'invoice_id' => 10015, + 'description' => 'Remote Software Development (overtime hours)', + 'unit_price' => 112.5, + 'quantity' => 12 + ) +); + + +$gf = new cs_globalFunctions; +$gf->debugPrintOpt = 1; + +$gf->debug_print("Here is the main invoice data::: ". $gf->debug_print($invoiceData,0)); + +$blockRows = $page->rip_all_block_rows(); + +if(!count($blockRows)) { + $gf->debug_print("Here's what I could find for block rows (should be more than just an empty array)::: ". $gf->debug_print($page->get_block_row_defs('content'),0)); + throw new exception("You forgot to give me valid block rows for parsing invoice items!"); +} +else { + $gf->debug_print("Here's the items that will be parsed into the rows::: ". $gf->debug_print($invoiceItemData,0)); + foreach($invoiceData as $index=>$value) { + $page->add_template_var($index, $value); + } + + //I have no idea how this will work when I don't know what the name of the block row is. + $tmplRow = array_pop($blockRows); + $allParsedRows = ""; + + foreach($invoiceItemData as $itemId=>$subData) { + $allParsedRows .= $page->gfObj->mini_parser($tmplRow, $subData, '{', '}'); + } +} + +?> Modified: trunk/public_html/.htaccess =================================================================== --- trunk/public_html/.htaccess 2007-12-14 01:05:59 UTC (rev 691) +++ trunk/public_html/.htaccess 2007-12-14 01:53:03 UTC (rev 692) @@ -17,4 +17,7 @@ </files> <files help> ForceType application/x-httpd-php +</files> +<files test> + ForceType application/x-httpd-php </files> \ No newline at end of file Copied: trunk/public_html/test (from rev 690, trunk/public_html/extern) =================================================================== --- trunk/public_html/test (rev 0) +++ trunk/public_html/test 2007-12-14 01:53:03 UTC (rev 692) @@ -0,0 +1,20 @@ +<?php +/* + * Created on Mar 10, 2006 + * by + * Dan Falconer + */ + + +require_once(dirname(__FILE__) ."/../lib/site_config.php"); + +$db = new cs_phpDB; +$db->connect(get_config_db_params()); +$session = new Session($db); + +$GLOBALS['DEBUGPRINTOPT'] = DEBUGPRINTOPT; + +$contentObj = new contentSystem(); +$contentObj->handle_session($session); +$contentObj->finish(); +?> Added: trunk/public_html/test.php =================================================================== --- trunk/public_html/test.php (rev 0) +++ trunk/public_html/test.php 2007-12-14 01:53:03 UTC (rev 692) @@ -0,0 +1 @@ +link test \ No newline at end of file Property changes on: trunk/public_html/test.php ___________________________________________________________________ Name: svn:special + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-18 02:24:11
|
Revision: 697 http://cs-project.svn.sourceforge.net/cs-project/?rev=697&view=rev Author: crazedsanity Date: 2007-12-17 18:24:03 -0800 (Mon, 17 Dec 2007) Log Message: ----------- Remove invoice stuff (now in it's own branch). Modified Paths: -------------- trunk/lib/invoice.class.php trunk/lib/invoiceItem.class.php trunk/public_html/.htaccess Removed Paths: ------------- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql trunk/includes/test.inc trunk/lib/invoiceTransaction.class.php trunk/public_html/test trunk/public_html/test.php trunk/templates/test/ Deleted: trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql =================================================================== --- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql 2007-12-18 02:21:31 UTC (rev 696) +++ trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql 2007-12-18 02:24:03 UTC (rev 697) @@ -1,59 +0,0 @@ --- --- SVN INFORMATION::: --- --- SVN Signature::::::::: $Id$ --- Last Committted Date:: $Date$ --- Last Committed Path::: $HeadURL$ --- - - -CREATE TABLE invoice_status_table ( - invoice_status_id integer NOT NULL PRIMARY KEY, - name text NOT NULL UNIQUE, - description text NOT NULL UNIQUE, - is_updateable boolean NOT NULL DEFAULT FALSE -); - --- NOTE: by setting the invoice_status_id, we ensure they always get set properly, and new ones can't be readily inserted without specifying that too. -INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (-1, 'W/0', 'Write Off', FALSE); -INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (0, 'New', 'Open, pending changes', TRUE); -INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (1, 'OK', 'Completed', FALSE); - -CREATE TABLE invoice_table ( - invoice_id integer NOT NULL PRIMARY KEY, - poc text, - company text, - address1 text, - address2 text, - phone text, - fax text, - city text, - state text, - zip text, - invoice_status_id integer NOT NULL DEFAULT 0 REFERENCES invoice_status_table(invoice_status_id), - creator_contact_id integer NOT NULL REFERENCES contact_table(contact_id), - billing_contact_id integer NOT NULL REFERENCES contact_table(contact_id), - is_proforma boolean NOT NULL DEFAULT FALSE, - date_created date NOT NULL DEFAULT CURRENT_DATE -); - - -CREATE TABLE invoice_item_table ( - invoice_item_id integer NOT NULL PRIMARY KEY, - invoice_id integer NOT NULL REFERENCES invoice_table(invoice_id), - description text NOT NULL, - unit_price decimal(10,2), - quantity integer NOT NULL DEFAULT 1 -); - - - -CREATE TABLE invoice_transaction_table ( - invoice_transaction_id integer NOT NULL PRIMARY KEY, - invoice_id integer NOT NULL REFERENCES invoice_table(invoice_id), - auth_string text NOT NULL, - number text NOT NULL, - date_created date NOT NULL DEFAULT CURRENT_DATE -); - - Deleted: trunk/includes/test.inc =================================================================== --- trunk/includes/test.inc 2007-12-18 02:21:31 UTC (rev 696) +++ trunk/includes/test.inc 2007-12-18 02:24:03 UTC (rev 697) @@ -1,79 +0,0 @@ -<?php -/* - * Created on Dec 13, 2007 - * - * SVN INFORMATION::: - * ------------------ - * Last Author::::::::: $Author$ - * Current Revision:::: $Revision$ - * Repository Location: $HeadURL$ - * Last Updated:::::::: $Date$ - - */ - - -$invoiceData = array( - 'invoice_id' => '10015', - 'poc' => 'Johnny Jackson', - 'company' => 'Llama Soft, Inc.', - 'address1' => '1555 North Georgia Ave.', - 'address2' => 'Suite 1411', - 'phone' => '(701) 555-3389 ext. 1911', - 'fax' => '(701) 555-9193', - 'city' => 'St. Louis', - 'state' => 'Missouri', - 'zip' => '55454' -); - -$invoiceItemData = array( - 91 => array( - 'invoice_item_id' => 91, - 'invoice_id' => 10015, - 'description' => 'Contract Downpayment', - 'unit_price' => 3000, - 'quantity' => 1 - ), - 93 => array( - 'invoice_item_id' => 93, - 'invoice_id' => 10015, - 'description' => 'Remote Software Development', - 'unit_price' => 75, - 'quantity' => 40 - ), - 94 => array( - 'invoice_item_id' => 94, - 'invoice_id' => 10015, - 'description' => 'Remote Software Development (overtime hours)', - 'unit_price' => 112.5, - 'quantity' => 12 - ) -); - - -$gf = new cs_globalFunctions; -$gf->debugPrintOpt = 1; - -$gf->debug_print("Here is the main invoice data::: ". $gf->debug_print($invoiceData,0)); - -$blockRows = $page->rip_all_block_rows(); - -if(!count($blockRows)) { - $gf->debug_print("Here's what I could find for block rows (should be more than just an empty array)::: ". $gf->debug_print($page->get_block_row_defs('content'),0)); - throw new exception("You forgot to give me valid block rows for parsing invoice items!"); -} -else { - $gf->debug_print("Here's the items that will be parsed into the rows::: ". $gf->debug_print($invoiceItemData,0)); - foreach($invoiceData as $index=>$value) { - $page->add_template_var($index, $value); - } - - //I have no idea how this will work when I don't know what the name of the block row is. - $tmplRow = array_pop($blockRows); - $allParsedRows = ""; - - foreach($invoiceItemData as $itemId=>$subData) { - $allParsedRows .= $page->gfObj->mini_parser($tmplRow, $subData, '{', '}'); - } -} - -?> Modified: trunk/lib/invoice.class.php =================================================================== --- trunk/lib/invoice.class.php 2007-12-18 02:21:31 UTC (rev 696) +++ trunk/lib/invoice.class.php 2007-12-18 02:24:03 UTC (rev 697) @@ -1,8 +1,5 @@ <?php /* - * This class was built to handle creation, searching, and updates of invoices. - * For searches involving items on the invoice, use invoiceItem{}. - * invoices is handled by * * SVN INFORMATION::: * ------------------ @@ -21,95 +18,20 @@ protected $gfObj; protected $logsObj; - private $invoiceId = NULL; - private $creatorContactId = NULL; - private $billingContactId = NULL; - - //set some internal things that should NEVER be changed after initialization. - const mainTable = 'invoice_table'; - const mainTableSeq = 'invoice_table_invoice_id_seq'; - - const itemTable = 'invoice_item_table'; - const itemTableSeq = 'invoice_item_table_invoice_item_id_seq'; - - const transTable = 'invoice_transaction_table'; - const transTableSeq = 'invoice_transaction_table_invoice_transaction_id_seq'; - //========================================================================= public function __construct(cs_phpDB $db) { $this->db = $db; $this->gfObj = new cs_globalFunctions; $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; - $this->logsObj = new logsClass($this->db, 'Invoice'); + $this->logsObj = new logsClass($this->db, 'Authentication Token'); }//end __construct() //========================================================================= //========================================================================= - /** - * Method to handle creating the main invoice record. - */ - public function create_invoice(array $invoiceData, $isProforma=FALSE) { - $cleanFields = array( - 'poc','company', 'address1', 'address2', 'phone', 'fax', 'city', - 'state', 'zip' - ); - - $insertArr = array(); - foreach($invoiceData as $name=>$value) { - $insertArr[$name] = $this->gfObj->cleanString($value, 'sql'); - } - - if($isProforma === TRUE) { - $insertArr['is_proforma'] = 't'; - } - - $insertString = $this->gfObj->string_from_array($insertArr, 'insert', NULL, 'sql'); - - $sql = "INSERT INTO ". $this->mainTable .' '. $insertString; - - if($this->run_sql($sql)) { - //pull the new invoice id. - $retval = $this->get_inserted_invoice_id(); - } - else { - throw new exception(__METHOD__ .': failed to insert new invoice: '. $this->lastError ."<BR>\nSQL::: ". $sql); - } - - return($retval); - - }//end create_invoice() - //========================================================================= - - - - //========================================================================= - /** - * Add a line item to the invoice; should be an instance of invoiceItem{}. - */ public function add_item(invoiceItem $item) { }//end add_item() //========================================================================= - - - - //========================================================================= - /** - * Retrieve the invoice_id that was last inserted. - */ - private function get_inserted_invoice_id() { - $sql = "SELECT currval('". $this->mainTableSeq ."'::text)"; - if($this->run_sql($sql)) { - $data = $this->db->farray(); - $retval = $data[0]; - } - else { - throw new exception(__METHOD__ .": failed to retrieve last invoice_id: ". $this->lastError); - } - - return($retval); - }//end get_inserted_invoice_id() - //========================================================================= } ?> Modified: trunk/lib/invoiceItem.class.php =================================================================== --- trunk/lib/invoiceItem.class.php 2007-12-18 02:21:31 UTC (rev 696) +++ trunk/lib/invoiceItem.class.php 2007-12-18 02:24:03 UTC (rev 697) @@ -14,7 +14,7 @@ //TODO: log everything! -class invoiceItem extends invoice { +class invoiceItem extends dbAbstract { protected $gfObj; protected $logsObj; @@ -24,7 +24,7 @@ $this->db = $db; $this->gfObj = new cs_globalFunctions; $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; - $this->logsObj = new logsClass($this->db, 'Invoice Item'); + $this->logsObj = new logsClass($this->db, 'Authentication Token'); }//end __construct() //========================================================================= Deleted: trunk/lib/invoiceTransaction.class.php =================================================================== --- trunk/lib/invoiceTransaction.class.php 2007-12-18 02:21:31 UTC (rev 696) +++ trunk/lib/invoiceTransaction.class.php 2007-12-18 02:24:03 UTC (rev 697) @@ -1,30 +0,0 @@ -<?php -/* - * - * SVN INFORMATION::: - * ------------------ - * SVN Signature::::::: $Id$ - * Last Author::::::::: $Author$ - * Current Revision:::: $Revision$ - * Repository Location: $HeadURL$ - * Last Updated:::::::: $Date$ - * - */ - -//TODO: log everything! - -class invoiceTransaction extends invoice { - - protected $gfObj; - protected $logsObj; - - //========================================================================= - public function __construct(cs_phpDB $db) { - $this->db = $db; - $this->gfObj = new cs_globalFunctions; - $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; - $this->logsObj = new logsClass($this->db, 'Invoice Transaction'); - }//end __construct() - //========================================================================= -} -?> Modified: trunk/public_html/.htaccess =================================================================== --- trunk/public_html/.htaccess 2007-12-18 02:21:31 UTC (rev 696) +++ trunk/public_html/.htaccess 2007-12-18 02:24:03 UTC (rev 697) @@ -17,7 +17,4 @@ </files> <files help> ForceType application/x-httpd-php -</files> -<files test> - ForceType application/x-httpd-php </files> \ No newline at end of file Deleted: trunk/public_html/test =================================================================== --- trunk/public_html/test 2007-12-18 02:21:31 UTC (rev 696) +++ trunk/public_html/test 2007-12-18 02:24:03 UTC (rev 697) @@ -1,20 +0,0 @@ -<?php -/* - * Created on Mar 10, 2006 - * by - * Dan Falconer - */ - - -require_once(dirname(__FILE__) ."/../lib/site_config.php"); - -$db = new cs_phpDB; -$db->connect(get_config_db_params()); -$session = new Session($db); - -$GLOBALS['DEBUGPRINTOPT'] = DEBUGPRINTOPT; - -$contentObj = new contentSystem(); -$contentObj->handle_session($session); -$contentObj->finish(); -?> Deleted: trunk/public_html/test.php =================================================================== --- trunk/public_html/test.php 2007-12-18 02:21:31 UTC (rev 696) +++ trunk/public_html/test.php 2007-12-18 02:24:03 UTC (rev 697) @@ -1 +0,0 @@ -link test \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-18 21:44:38
|
Revision: 701 http://cs-project.svn.sourceforge.net/cs-project/?rev=701&view=rev Author: crazedsanity Date: 2007-12-18 13:44:28 -0800 (Tue, 18 Dec 2007) Log Message: ----------- Ability to change helpdesk issue name (issue #70). Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/templates/content/helpdesk/view.content.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2007-12-18 03:15:44 UTC (rev 700) +++ trunk/includes/content/helpdesk.inc 2007-12-18 21:44:28 UTC (rev 701) @@ -23,13 +23,29 @@ $_POST['updates']['parentRecordId'] = $_POST['updates']['project_id']; unset($_POST['updates']['project_id']); - //that means we've gotta update everything sent... right? + + //if they've changed the name, we gotta log it. + //TODO: probably log this within helpdeskClass::update(). + if(isset($_POST['updates']['name'])) { + //retrieve the old info. + $oldData = $proj->helpdeskObj->get_record($_POST['id']); + + if($oldData['name'] !== $_POST['updates']['name']) { + $addRemark = 'Updated [b]name[/b] from ([b][i]'. $oldData['name'] .'[/i][/b])'; + } + } + $doNotAcceptFields = array("solution", "remark"); foreach($doNotAcceptFields as $unsetThis) { unset($_POST['updates'][$unsetThis]); } $result = $proj->helpdeskObj->update_record($helpdeskId, $_POST['updates']); + if(strlen($addRemark)) { + $proj->helpdeskObj->remark($_POST['id'], $addRemark); + } + + //tell them what happened. if($result == 1) { set_message_wrapper(array( Modified: trunk/templates/content/helpdesk/view.content.tmpl =================================================================== --- trunk/templates/content/helpdesk/view.content.tmpl 2007-12-18 03:15:44 UTC (rev 700) +++ trunk/templates/content/helpdesk/view.content.tmpl 2007-12-18 21:44:28 UTC (rev 701) @@ -109,7 +109,10 @@ <tr> <th align="right">Title: </th> - <td colspan="2">{name}</td> + <td colspan="2"> + <div id="name_text" style="display:inline">{name} [<a href="#" onClick="enableInput('name');">Edit</a>]</div> + <div id="name_inputDiv" style="display:none"><input id="name_input" name="updates[name]" type="text" value="{name}" size="80" disabled></div> + </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-18 22:04:21
|
Revision: 702 http://cs-project.svn.sourceforge.net/cs-project/?rev=702&view=rev Author: crazedsanity Date: 2007-12-18 14:04:15 -0800 (Tue, 18 Dec 2007) Log Message: ----------- Fix order of tags when viewing issue (#123). /includes/content/helpdesk.inc: * set second arg for helpdeskClass::get_category_list() to TRUE. /lib/helpdeskClass.php: * get_category_list(): -- ARG CHANGE: NEW ARG: #2 ($orderByMod=FALSE) -- ability to pass arg #2 to tagClass::get_tag_list(). /lib/tagClass.php: * get_tag_list(): -- ARG CHANGE: #2 ($orderByMod=FALSE) -- changed default for $orderByMod to false. Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/lib/helpdeskClass.php trunk/lib/tagClass.php Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2007-12-18 21:44:28 UTC (rev 701) +++ trunk/includes/content/helpdesk.inc 2007-12-18 22:04:15 UTC (rev 702) @@ -221,7 +221,7 @@ $page->set_all_block_rows("content"); //show the "category" selection. - $categoryList = $proj->helpdeskObj->get_category_list('bug'); + $categoryList = $proj->helpdeskObj->get_category_list('bug', TRUE); $page->add_template_var("select_tags", $categoryList); // Modified: trunk/lib/helpdeskClass.php =================================================================== --- trunk/lib/helpdeskClass.php 2007-12-18 21:44:28 UTC (rev 701) +++ trunk/lib/helpdeskClass.php 2007-12-18 22:04:15 UTC (rev 702) @@ -410,10 +410,10 @@ /** * This returns a list of available TAGS (the "helpdesk_cat" table is deprecated) */ - function get_category_list($selectThis=NULL) { + function get_category_list($selectThis=NULL, $orderByMod=FALSE) { //create a list of tags. $object = new tagClass($this->db); - $mainTagList = $object->get_tag_list(TRUE); + $mainTagList = $object->get_tag_list(TRUE, $orderByMod); //create the "replacement array" and such. $tagList = array(); Modified: trunk/lib/tagClass.php =================================================================== --- trunk/lib/tagClass.php 2007-12-18 21:44:28 UTC (rev 701) +++ trunk/lib/tagClass.php 2007-12-18 22:04:15 UTC (rev 702) @@ -53,7 +53,7 @@ * @return (array) PASS: contains tag_name_id=>name array. * @return (exception) database error or no rows. */ - public function get_tag_list($getAllData=FALSE, $orderByMod=TRUE) { + public function get_tag_list($getAllData=FALSE, $orderByMod=FALSE) { $orderBy = "ORDER BY lower(name)"; if($orderByMod) { $orderBy = "ORDER BY modifier, lower(name)"; @@ -148,7 +148,8 @@ $sqlArr = array ( 'record_id' => cleanString($recordId, 'numeric') ); - $sql = "SELECT tag_name_id, name FROM tag_name_table INNER JOIN tag_table USING (tag_name_id) WHERE ". string_from_array($sqlArr, 'select'); + $sql = "SELECT tag_name_id, name FROM tag_name_table INNER JOIN tag_table USING (tag_name_id) " . + "WHERE ". string_from_array($sqlArr, 'select') .' ORDER BY lower(name)'; $numrows = $this->db->exec($sql); $dberror = $this->db->errorMsg(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-18 22:19:23
|
Revision: 704 http://cs-project.svn.sourceforge.net/cs-project/?rev=704&view=rev Author: crazedsanity Date: 2007-12-18 14:19:20 -0800 (Tue, 18 Dec 2007) Log Message: ----------- Display ancestry link list instead of just project name on summary (#101). Modified Paths: -------------- trunk/includes/content/summary.inc trunk/templates/content/summary/index.content.tmpl Modified: trunk/includes/content/summary.inc =================================================================== --- trunk/includes/content/summary.inc 2007-12-18 22:09:28 UTC (rev 703) +++ trunk/includes/content/summary.inc 2007-12-18 22:19:20 UTC (rev 704) @@ -130,7 +130,6 @@ function process_row(&$page, $projectArr, $expandArr, $baseRow, $level=0) { //loop through the array... $linkLevel = $level+1; - //pre-pad subprojects, so they appear indented. if($level > 0) { @@ -140,7 +139,16 @@ } } if(is_array($projectArr)) { + + $projObj = new projectClass($page->db); + foreach($projectArr as $id=>$subArr) { + + $subArr['linkList'] = $projObj->get_ancestry_link_list($id); + if(!strlen($subArr['linkList'])) { + $subArr['linkList'] = $subArr['name']; + } + //parse stuff into the template row... $rowColor1 = swapValue($rowColor1, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); $rowColor2 = swapValue($rowColor2,"#D5D5D5", "#C2C2C2"); Modified: trunk/templates/content/summary/index.content.tmpl =================================================================== --- trunk/templates/content/summary/index.content.tmpl 2007-12-18 22:09:28 UTC (rev 703) +++ trunk/templates/content/summary/index.content.tmpl 2007-12-18 22:19:20 UTC (rev 704) @@ -21,7 +21,7 @@ onmouseout="this.style.backgroundColor ='%%rowColor2%%'" onclick="location.href = '/content/project/view?ID=%%id%%'"> - <td><a href="/content/project/view/?ID=%%id%%">%%name%%</a> </td> + <td><a href="/content/project/view/?ID=%%id%%">%%linkList%%</a> </td> <td>%%status_text%% </td> <td align="right" nowrap>%%progress%%%</td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-18 22:52:20
|
Revision: 705 http://cs-project.svn.sourceforge.net/cs-project/?rev=705&view=rev Author: crazedsanity Date: 2007-12-18 14:52:16 -0800 (Tue, 18 Dec 2007) Log Message: ----------- Use block rows to display input or text for open/closed issue (#119). Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/templates/content/helpdesk/view.content.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2007-12-18 22:19:20 UTC (rev 704) +++ trunk/includes/content/helpdesk.inc 2007-12-18 22:52:16 UTC (rev 705) @@ -279,9 +279,13 @@ $assignedStr = $helpdeskData['leader_contact_id']; if($helpdeskData['status_id'] == 4) { //allow the current user to re-open this issue. + $doNotRipRows[] = "assigned_text"; + $doNotRipRows[] = "priority_text"; $doNotRipRows[] = "reopen_button"; } else { + $doNotRipRows[] = "assigned_optionList"; + $doNotRipRows[] = "priority_optionList"; if(($assignedStr == $_SESSION['contact_id']) || ($assignedStr == "" || is_null($assignedStr))) { //well, we can show 'em the update/modify button. $doNotRipRows[] = "update_button"; Modified: trunk/templates/content/helpdesk/view.content.tmpl =================================================================== --- trunk/templates/content/helpdesk/view.content.tmpl 2007-12-18 22:19:20 UTC (rev 704) +++ trunk/templates/content/helpdesk/view.content.tmpl 2007-12-18 22:52:16 UTC (rev 705) @@ -26,19 +26,27 @@ <tr> <td style="border-left:solid #000 1px;border-top:solid #000 1px;">Assigned: </td> <td style="border-right:solid #000 1px;border-top:solid #000 1px;" nowrap> + <!-- BEGIN assigned_optionList --> <select name="updates[leader_contact_id]"> {user_assign_list} </select> [<b>{assigned}</b>] + <!-- END assigned_optionList --> + <!-- BEGIN assigned_text --><b>{assigned}</b> + <!-- END assigned_text --> </td> </tr> <tr> <td style="border-left:solid #000 1px;">Priority: </td> <td style="border-right:solid #000 1px"> + <!-- BEGIN priority_optionList --> <select name="updates[priority]"> {select_priority_list} </select> + <!-- END priority_optionList --> + <!-- BEGIN priority_text --> {priority} + <!-- END priority_text --> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-19 00:01:42
|
Revision: 706 http://cs-project.svn.sourceforge.net/cs-project/?rev=706&view=rev Author: crazedsanity Date: 2007-12-18 16:01:38 -0800 (Tue, 18 Dec 2007) Log Message: ----------- Display currently logged-in user (#71). Modified Paths: -------------- trunk/includes/content.inc trunk/templates/infobar.shared.tmpl Modified: trunk/includes/content.inc =================================================================== --- trunk/includes/content.inc 2007-12-18 22:52:16 UTC (rev 705) +++ trunk/includes/content.inc 2007-12-19 00:01:38 UTC (rev 706) @@ -39,6 +39,17 @@ $user = new userClass($page->db, $_SESSION['uid']); +if(is_numeric($_SESSION['login_contact_id'])) { + $contactObj = new contactClass($page->db); + $contactObj->set_contact_id($_SESSION['login_contact_id']); + $contactData = $contactObj->get_contact(); + + $page->add_template_var('LOGGED_USERNAME', $_SESSION['login_username']); + $page->add_template_var('LOGGED_CONTACT_ID', $_SESSION['login_contact_id']); + $page->add_template_var('LOGGED_CONTACT_NAME', $contactData['fname'] .' '. $contactData['lname']); + $page->add_template_var('LOGGED_COMPANY', $contactData['company']); +} + if(!$page->ui->get_cache("userData/settings")) { $page->ui->set_cache("userData/settings", $user->get_settings()); } Modified: trunk/templates/infobar.shared.tmpl =================================================================== --- trunk/templates/infobar.shared.tmpl 2007-12-18 22:52:16 UTC (rev 705) +++ trunk/templates/infobar.shared.tmpl 2007-12-19 00:01:38 UTC (rev 706) @@ -1,27 +1,48 @@ <table cellpadding=0 cellspacing=0 border=0> <tr> - <td rowspan=2 valign=top nowrap><a href="/content/{module}" target='_top'> - <img src='/images/logo.gif' alt='CS-Project {cs-content_version}' border='0'></a><BR> - <font size="-7">version {cs-project_version}</font> + <td> + <table border="0"> + <tr> + <td valign=top nowrap><a href="/content/{module}" target='_top'> + <img src='/images/logo.gif' alt='CS-Project {cs-content_version}' border='0'></a><BR> + <font size="-7">version {cs-project_version}</font> + </td> + + <td width="100%"> + <h2 style="display:inline;"><u>Current User</u></h2><BR> + <h3 style="display:inline;">{LOGGED_COMPANY}</h3><br> + <h4 style="display:inline;">{LOGGED_CONTACT_NAME} (<a href="/content/contacts/view/{LOGGED_CONTACT_ID}">{LOGGED_USERNAME}</a>)</h4> + </td> + </tr> + </table> </td> - <td rowspan=2><img src='/images/pixel_clear.gif' border='0' width=3 height=10></td> - <td rowspan=2 colspan=30><img src='/images/pixel_clear.gif' border='0' height=25></td> </tr> <tr> - {tabs} - - <td valign=top align="right"><img src='/images/tab_left_inactive.gif' border='0' height="100%"></td> - <td id='notselected' valign=top><a id='notselected' href='/login.php?logout=1' target='_top'>Logout</a></td> - <td valign=top><img src='/images/tab_right_inactive.gif' border='0' height="100%"> </td> - - <form action="/content" method=get> - <td valign=top align="right"><img src='/images/tab_left_inactive.gif' border='0' height="100%"></td> - <td id='notselected' valign=top><input type=hidden name='module' value='projects'> - <input type="hidden" name="version" value="{cs-project_version}"> - <select name=changeGroup onchange='document.forms[0].submit()'> - {group_option_list} - </select></form> + <td> + <table border="0" cellpadding=0 cellspacing=0> + <tr> + {tabs} + + <td valign=top align="right"><img src='/images/tab_left_inactive.gif' border='0' height="100%"></td> + + <td id='notselected' valign=top><a id='notselected' href='/login.php?logout=1' target='_top'>Logout</a></td> + + <td valign=top><img src='/images/tab_right_inactive.gif' border='0' height="100%"> </td> + + <td valign=top align="right"><img src='/images/tab_left_inactive.gif' border='0' height="100%"></td> + + <td id='notselected' valign=top><input type=hidden name='module' value='projects'> + <form action="/content" method=get> + <input type="hidden" name="version" value="{cs-project_version}"> + <select name=changeGroup onchange='document.forms[0].submit()'> + {group_option_list} + </select> + </form> + </td> + + <td valign=top><img src='/images/tab_right_inactive.gif' border='0' height="100%"> </td> + </tr> + </table> </td> - <td valign=top><img src='/images/tab_right_inactive.gif' border='0' height="100%"> </td> </tr> </table> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-27 00:04:27
|
Revision: 714 http://cs-project.svn.sourceforge.net/cs-project/?rev=714&view=rev Author: crazedsanity Date: 2007-12-26 16:04:23 -0800 (Wed, 26 Dec 2007) Log Message: ----------- Remove ability to add/remove tags on closed issues (#119). Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/templates/content/helpdesk/view.content.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2007-12-19 18:52:52 UTC (rev 713) +++ trunk/includes/content/helpdesk.inc 2007-12-27 00:04:23 UTC (rev 714) @@ -278,14 +278,16 @@ //if they're the owner, show the "solution" section. $assignedStr = $helpdeskData['leader_contact_id']; if($helpdeskData['status_id'] == 4) { - //allow the current user to re-open this issue. + //CLOSED: allow the current user to re-open this issue. $doNotRipRows[] = "assigned_text"; $doNotRipRows[] = "priority_text"; $doNotRipRows[] = "reopen_button"; } else { + //NOT closed... $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"; @@ -353,7 +355,14 @@ $myTagList = $proj->tagObj->get_tags_for_record($helpdeskData['record_id']); if(is_array($myTagList)) { - $baseRow = $page->templateRows['removeable_tag']; + if($helpdeskData['status_id'] == 4) { + $tagListVar = 'text_tags'; + $baseRow = $page->templateRows['text_tags']; + } + else { + $tagListVar = 'removeable_tag'; + $baseRow = $page->templateRows['removeable_tag']; + } $myTagRow = ""; $tCount = 0; foreach($myTagList as $tagNameId=>$tagName) { @@ -371,12 +380,8 @@ ); $myTagRow .= mini_parser($baseRow, $repArr, '%%', '%%'); } + $page->add_template_var($tagListVar, $myTagRow); } - else { - //tell 'em there's no tags! - $myTagRow = ""; - } - $page->add_template_var('removeable_tag', $myTagRow); //Display tags that can be added. $availableTagsList = $proj->tagObj->get_available_tags_for_record($helpdeskData['record_id'], 3); Modified: trunk/templates/content/helpdesk/view.content.tmpl =================================================================== --- trunk/templates/content/helpdesk/view.content.tmpl 2007-12-19 18:52:52 UTC (rev 713) +++ trunk/templates/content/helpdesk/view.content.tmpl 2007-12-27 00:04:23 UTC (rev 714) @@ -149,19 +149,24 @@ </th> <td colspan="2"> + <!-- BEGIN editable_tags --> <!-- BEGIN removeable_tag --><a href="/content/tags/remove/%%tag_name_id%%/{record_id}">%%name%%</a>%%separator%% <!-- END removeable_tag --> - - <BR> - + + <BR> + <select> <!-- BEGIN addTag_option --> <option value='%%value%%'%%selectedString%% onClick="location.href='/content/tags/add/%%value%%/{record_id}'">%%display%%</option> <!-- END addTag_option --> {add_tag_list} </select> <i><font color="red">(NOTE: this will *immediately* add a tag -- don't do it if you've changed something!)</font></i><BR> - <input type="text" name="newTag" value=""><input type="button" value="Add New Tag" - onClick="this.value='Creating Tag...';document.main.newTag.readonly=true;document.hiddenAddTagForm.new_tag.value=document.main.newTag.value;document.hiddenAddTagForm.submit()"></td> + <input type="text" name="newTag" value=""><input type="button" value="Add New Tag" + onClick="this.value='Creating Tag...';document.main.newTag.readonly=true;document.hiddenAddTagForm.new_tag.value=document.main.newTag.value;document.hiddenAddTagForm.submit()"> + <!-- END editable_tags --> + <!-- BEGIN text_tags --><b>%%name%%</b>%%separator%% + <!-- END text_tags --> + </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-27 16:35:51
|
Revision: 717 http://cs-project.svn.sourceforge.net/cs-project/?rev=717&view=rev Author: crazedsanity Date: 2007-12-27 08:35:48 -0800 (Thu, 27 Dec 2007) Log Message: ----------- Reverse r697 to re-add invoices. SVN COMMAND::: merge -r697:696 https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk Modified Paths: -------------- trunk/lib/invoice.class.php trunk/lib/invoiceItem.class.php trunk/public_html/.htaccess Added Paths: ----------- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql trunk/includes/test.inc trunk/lib/invoiceTransaction.class.php trunk/public_html/test trunk/public_html/test.php trunk/templates/test/ Copied: trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql (from rev 696, trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql) =================================================================== --- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql (rev 0) +++ trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql 2007-12-27 16:35:48 UTC (rev 717) @@ -0,0 +1,59 @@ +-- +-- SVN INFORMATION::: +-- +-- SVN Signature::::::::: $Id$ +-- Last Committted Date:: $Date$ +-- Last Committed Path::: $HeadURL$ +-- + + +CREATE TABLE invoice_status_table ( + invoice_status_id integer NOT NULL PRIMARY KEY, + name text NOT NULL UNIQUE, + description text NOT NULL UNIQUE, + is_updateable boolean NOT NULL DEFAULT FALSE +); + +-- NOTE: by setting the invoice_status_id, we ensure they always get set properly, and new ones can't be readily inserted without specifying that too. +INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (-1, 'W/0', 'Write Off', FALSE); +INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (0, 'New', 'Open, pending changes', TRUE); +INSERT INTO invoice_status_table (invoice_status_id, name, description, is_updateable) VALUES (1, 'OK', 'Completed', FALSE); + +CREATE TABLE invoice_table ( + invoice_id integer NOT NULL PRIMARY KEY, + poc text, + company text, + address1 text, + address2 text, + phone text, + fax text, + city text, + state text, + zip text, + invoice_status_id integer NOT NULL DEFAULT 0 REFERENCES invoice_status_table(invoice_status_id), + creator_contact_id integer NOT NULL REFERENCES contact_table(contact_id), + billing_contact_id integer NOT NULL REFERENCES contact_table(contact_id), + is_proforma boolean NOT NULL DEFAULT FALSE, + date_created date NOT NULL DEFAULT CURRENT_DATE +); + + +CREATE TABLE invoice_item_table ( + invoice_item_id integer NOT NULL PRIMARY KEY, + invoice_id integer NOT NULL REFERENCES invoice_table(invoice_id), + description text NOT NULL, + unit_price decimal(10,2), + quantity integer NOT NULL DEFAULT 1 +); + + + +CREATE TABLE invoice_transaction_table ( + invoice_transaction_id integer NOT NULL PRIMARY KEY, + invoice_id integer NOT NULL REFERENCES invoice_table(invoice_id), + auth_string text NOT NULL, + number text NOT NULL, + date_created date NOT NULL DEFAULT CURRENT_DATE +); + + Property changes on: trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql ___________________________________________________________________ Name: svn:keywords + Id HeadURL Date Revision Author Name: svn:eol-style + native Copied: trunk/includes/test.inc (from rev 696, trunk/includes/test.inc) =================================================================== --- trunk/includes/test.inc (rev 0) +++ trunk/includes/test.inc 2007-12-27 16:35:48 UTC (rev 717) @@ -0,0 +1,79 @@ +<?php +/* + * Created on Dec 13, 2007 + * + * SVN INFORMATION::: + * ------------------ + * Last Author::::::::: $Author$ + * Current Revision:::: $Revision$ + * Repository Location: $HeadURL$ + * Last Updated:::::::: $Date$ + + */ + + +$invoiceData = array( + 'invoice_id' => '10015', + 'poc' => 'Johnny Jackson', + 'company' => 'Llama Soft, Inc.', + 'address1' => '1555 North Georgia Ave.', + 'address2' => 'Suite 1411', + 'phone' => '(701) 555-3389 ext. 1911', + 'fax' => '(701) 555-9193', + 'city' => 'St. Louis', + 'state' => 'Missouri', + 'zip' => '55454' +); + +$invoiceItemData = array( + 91 => array( + 'invoice_item_id' => 91, + 'invoice_id' => 10015, + 'description' => 'Contract Downpayment', + 'unit_price' => 3000, + 'quantity' => 1 + ), + 93 => array( + 'invoice_item_id' => 93, + 'invoice_id' => 10015, + 'description' => 'Remote Software Development', + 'unit_price' => 75, + 'quantity' => 40 + ), + 94 => array( + 'invoice_item_id' => 94, + 'invoice_id' => 10015, + 'description' => 'Remote Software Development (overtime hours)', + 'unit_price' => 112.5, + 'quantity' => 12 + ) +); + + +$gf = new cs_globalFunctions; +$gf->debugPrintOpt = 1; + +$gf->debug_print("Here is the main invoice data::: ". $gf->debug_print($invoiceData,0)); + +$blockRows = $page->rip_all_block_rows(); + +if(!count($blockRows)) { + $gf->debug_print("Here's what I could find for block rows (should be more than just an empty array)::: ". $gf->debug_print($page->get_block_row_defs('content'),0)); + throw new exception("You forgot to give me valid block rows for parsing invoice items!"); +} +else { + $gf->debug_print("Here's the items that will be parsed into the rows::: ". $gf->debug_print($invoiceItemData,0)); + foreach($invoiceData as $index=>$value) { + $page->add_template_var($index, $value); + } + + //I have no idea how this will work when I don't know what the name of the block row is. + $tmplRow = array_pop($blockRows); + $allParsedRows = ""; + + foreach($invoiceItemData as $itemId=>$subData) { + $allParsedRows .= $page->gfObj->mini_parser($tmplRow, $subData, '{', '}'); + } +} + +?> Property changes on: trunk/includes/test.inc ___________________________________________________________________ Name: svn:eol + native Name: svn:keywords + Id HeadURL Date Revision Author Name: svn:eol-style + native Modified: trunk/lib/invoice.class.php =================================================================== --- trunk/lib/invoice.class.php 2007-12-27 00:07:36 UTC (rev 716) +++ trunk/lib/invoice.class.php 2007-12-27 16:35:48 UTC (rev 717) @@ -1,5 +1,8 @@ <?php /* + * This class was built to handle creation, searching, and updates of invoices. + * For searches involving items on the invoice, use invoiceItem{}. + * invoices is handled by * * SVN INFORMATION::: * ------------------ @@ -18,20 +21,95 @@ protected $gfObj; protected $logsObj; + private $invoiceId = NULL; + private $creatorContactId = NULL; + private $billingContactId = NULL; + + //set some internal things that should NEVER be changed after initialization. + const mainTable = 'invoice_table'; + const mainTableSeq = 'invoice_table_invoice_id_seq'; + + const itemTable = 'invoice_item_table'; + const itemTableSeq = 'invoice_item_table_invoice_item_id_seq'; + + const transTable = 'invoice_transaction_table'; + const transTableSeq = 'invoice_transaction_table_invoice_transaction_id_seq'; + //========================================================================= public function __construct(cs_phpDB $db) { $this->db = $db; $this->gfObj = new cs_globalFunctions; $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; - $this->logsObj = new logsClass($this->db, 'Authentication Token'); + $this->logsObj = new logsClass($this->db, 'Invoice'); }//end __construct() //========================================================================= //========================================================================= + /** + * Method to handle creating the main invoice record. + */ + public function create_invoice(array $invoiceData, $isProforma=FALSE) { + $cleanFields = array( + 'poc','company', 'address1', 'address2', 'phone', 'fax', 'city', + 'state', 'zip' + ); + + $insertArr = array(); + foreach($invoiceData as $name=>$value) { + $insertArr[$name] = $this->gfObj->cleanString($value, 'sql'); + } + + if($isProforma === TRUE) { + $insertArr['is_proforma'] = 't'; + } + + $insertString = $this->gfObj->string_from_array($insertArr, 'insert', NULL, 'sql'); + + $sql = "INSERT INTO ". $this->mainTable .' '. $insertString; + + if($this->run_sql($sql)) { + //pull the new invoice id. + $retval = $this->get_inserted_invoice_id(); + } + else { + throw new exception(__METHOD__ .': failed to insert new invoice: '. $this->lastError ."<BR>\nSQL::: ". $sql); + } + + return($retval); + + }//end create_invoice() + //========================================================================= + + + + //========================================================================= + /** + * Add a line item to the invoice; should be an instance of invoiceItem{}. + */ public function add_item(invoiceItem $item) { }//end add_item() //========================================================================= + + + + //========================================================================= + /** + * Retrieve the invoice_id that was last inserted. + */ + private function get_inserted_invoice_id() { + $sql = "SELECT currval('". $this->mainTableSeq ."'::text)"; + if($this->run_sql($sql)) { + $data = $this->db->farray(); + $retval = $data[0]; + } + else { + throw new exception(__METHOD__ .": failed to retrieve last invoice_id: ". $this->lastError); + } + + return($retval); + }//end get_inserted_invoice_id() + //========================================================================= } ?> Modified: trunk/lib/invoiceItem.class.php =================================================================== --- trunk/lib/invoiceItem.class.php 2007-12-27 00:07:36 UTC (rev 716) +++ trunk/lib/invoiceItem.class.php 2007-12-27 16:35:48 UTC (rev 717) @@ -14,7 +14,7 @@ //TODO: log everything! -class invoiceItem extends dbAbstract { +class invoiceItem extends invoice { protected $gfObj; protected $logsObj; @@ -24,7 +24,7 @@ $this->db = $db; $this->gfObj = new cs_globalFunctions; $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; - $this->logsObj = new logsClass($this->db, 'Authentication Token'); + $this->logsObj = new logsClass($this->db, 'Invoice Item'); }//end __construct() //========================================================================= Copied: trunk/lib/invoiceTransaction.class.php (from rev 696, trunk/lib/invoiceTransaction.class.php) =================================================================== --- trunk/lib/invoiceTransaction.class.php (rev 0) +++ trunk/lib/invoiceTransaction.class.php 2007-12-27 16:35:48 UTC (rev 717) @@ -0,0 +1,30 @@ +<?php +/* + * + * SVN INFORMATION::: + * ------------------ + * SVN Signature::::::: $Id$ + * Last Author::::::::: $Author$ + * Current Revision:::: $Revision$ + * Repository Location: $HeadURL$ + * Last Updated:::::::: $Date$ + * + */ + +//TODO: log everything! + +class invoiceTransaction extends invoice { + + protected $gfObj; + protected $logsObj; + + //========================================================================= + public function __construct(cs_phpDB $db) { + $this->db = $db; + $this->gfObj = new cs_globalFunctions; + $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; + $this->logsObj = new logsClass($this->db, 'Invoice Transaction'); + }//end __construct() + //========================================================================= +} +?> Property changes on: trunk/lib/invoiceTransaction.class.php ___________________________________________________________________ Name: svn:keywords + Id HeadURL Date Revision Author Name: svn:eol-style + native Modified: trunk/public_html/.htaccess =================================================================== --- trunk/public_html/.htaccess 2007-12-27 00:07:36 UTC (rev 716) +++ trunk/public_html/.htaccess 2007-12-27 16:35:48 UTC (rev 717) @@ -17,4 +17,7 @@ </files> <files help> ForceType application/x-httpd-php +</files> +<files test> + ForceType application/x-httpd-php </files> \ No newline at end of file Copied: trunk/public_html/test (from rev 696, trunk/public_html/test) =================================================================== --- trunk/public_html/test (rev 0) +++ trunk/public_html/test 2007-12-27 16:35:48 UTC (rev 717) @@ -0,0 +1,20 @@ +<?php +/* + * Created on Mar 10, 2006 + * by + * Dan Falconer + */ + + +require_once(dirname(__FILE__) ."/../lib/site_config.php"); + +$db = new cs_phpDB; +$db->connect(get_config_db_params()); +$session = new Session($db); + +$GLOBALS['DEBUGPRINTOPT'] = DEBUGPRINTOPT; + +$contentObj = new contentSystem(); +$contentObj->handle_session($session); +$contentObj->finish(); +?> Property changes on: trunk/public_html/test ___________________________________________________________________ Name: svn:eol + native Name: svn:executable + * Name: svn:eol-style + native Copied: trunk/public_html/test.php (from rev 696, trunk/public_html/test.php) =================================================================== --- trunk/public_html/test.php (rev 0) +++ trunk/public_html/test.php 2007-12-27 16:35:48 UTC (rev 717) @@ -0,0 +1 @@ +link test \ No newline at end of file Property changes on: trunk/public_html/test.php ___________________________________________________________________ Name: svn:special + * Copied: trunk/templates/test (from rev 696, trunk/templates/test) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-27 16:38:27
|
Revision: 718 http://cs-project.svn.sourceforge.net/cs-project/?rev=718&view=rev Author: crazedsanity Date: 2007-12-27 08:38:24 -0800 (Thu, 27 Dec 2007) Log Message: ----------- Pull invoice changes from the branch into the main line of development. NOTE: changed version to 1.2.0-ALPHA1, so I know this won't be added to 1.1 SVN COMMAND::: merge -r697:HEAD https://cs-project.svn.sourceforge.net/svnroot/cs-project/branches/invoices Modified Paths: -------------- trunk/VERSION trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql trunk/lib/invoice.class.php trunk/lib/invoiceItem.class.php trunk/lib/invoiceTransaction.class.php Added Paths: ----------- trunk/lib/invoiceViewer.class.php Modified: trunk/VERSION =================================================================== --- trunk/VERSION 2007-12-27 16:35:48 UTC (rev 717) +++ trunk/VERSION 2007-12-27 16:38:24 UTC (rev 718) @@ -1,4 +1,4 @@ $Id:VERSION 628 2007-11-20 16:58:45Z crazedsanity $ -VERSION: 1.1.0 +VERSION: 1.2.0-ALPHA1 $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/VERSION $ Modified: trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql =================================================================== --- trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql 2007-12-27 16:35:48 UTC (rev 717) +++ trunk/docs/sql/upgrades/upgradeTo1.1.0-BETA16.sql 2007-12-27 16:38:24 UTC (rev 718) @@ -42,7 +42,7 @@ invoice_item_id integer NOT NULL PRIMARY KEY, invoice_id integer NOT NULL REFERENCES invoice_table(invoice_id), description text NOT NULL, - unit_price decimal(10,2), + unit_price decimal(5,2), quantity integer NOT NULL DEFAULT 1 ); @@ -52,7 +52,10 @@ invoice_transaction_id integer NOT NULL PRIMARY KEY, invoice_id integer NOT NULL REFERENCES invoice_table(invoice_id), auth_string text NOT NULL, + name text text NOT NULL, number text NOT NULL, + trans_date date NOT NULL, + amount decimal(10,2) NOT NULL, date_created date NOT NULL DEFAULT CURRENT_DATE ); Modified: trunk/lib/invoice.class.php =================================================================== --- trunk/lib/invoice.class.php 2007-12-27 16:35:48 UTC (rev 717) +++ trunk/lib/invoice.class.php 2007-12-27 16:38:24 UTC (rev 718) @@ -16,6 +16,7 @@ //TODO: log everything! + class invoice extends dbAbstract { protected $gfObj; @@ -29,9 +30,6 @@ const mainTable = 'invoice_table'; const mainTableSeq = 'invoice_table_invoice_id_seq'; - const itemTable = 'invoice_item_table'; - const itemTableSeq = 'invoice_item_table_invoice_item_id_seq'; - const transTable = 'invoice_transaction_table'; const transTableSeq = 'invoice_transaction_table_invoice_transaction_id_seq'; @@ -86,9 +84,18 @@ //========================================================================= /** - * Add a line item to the invoice; should be an instance of invoiceItem{}. + * Add a line item to the invoice. */ - public function add_item(invoiceItem $item) { + public function add_item(array $data) { + if(is_numeric($this->invoiceId)) { + $invoiceItem = new invoiceItem($this->db, $this->invoiceId); + $retval = $invoiceItem->create_item($data); + } + else { + throw new exception(__METHOD__ .': no invoice created!'); + } + + return($retval); }//end add_item() //========================================================================= @@ -108,6 +115,8 @@ throw new exception(__METHOD__ .": failed to retrieve last invoice_id: ". $this->lastError); } + $this->invoiceId = $retval; + return($retval); }//end get_inserted_invoice_id() //========================================================================= Modified: trunk/lib/invoiceItem.class.php =================================================================== --- trunk/lib/invoiceItem.class.php 2007-12-27 16:35:48 UTC (rev 717) +++ trunk/lib/invoiceItem.class.php 2007-12-27 16:38:24 UTC (rev 718) @@ -19,20 +19,94 @@ protected $gfObj; protected $logsObj; + const itemTable = 'invoice_item_table'; + const itemTableSeq = 'invoice_item_table_invoice_item_id_seq'; + + private $invoiceId; + //========================================================================= - public function __construct(cs_phpDB $db) { + public function __construct(cs_phpDB $db, $invoiceId=NULL) { $this->db = $db; $this->gfObj = new cs_globalFunctions; $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; $this->logsObj = new logsClass($this->db, 'Invoice Item'); + + $this->set_invoice_id($invoiceId); }//end __construct() //========================================================================= //========================================================================= - public function create_item(array $data) { - }//end create_item() + /** + * Set value of internal invoiceId. + */ + protected function set_invoice_id($invoiceId) { + if(is_numeric($invoiceId)) { + $this->invoiceId = $invoiceId; + } + else { + throw new exception(__METHOD__ .': invalid data ('. $invoiceId .')'); + } + }//end set_invoice_id() //========================================================================= + + + + //========================================================================= + /** + * Insert item into the database. + */ + public function insert_item(array $data) { + if(is_numeric($this->invoiceId)) { + $fields = array( + 'description' => 'sql', + 'unit_price' => 'float', + 'quantity' => 'int' + ); + + $invoiceArr = array(); + foreach($fields as $name=>$cleanType) { + if(isset($data[$name]) && strlen($this->gfObj->cleanString($data[$name], $cleanType))) { + $insertArr[$name] = $this->gfObj->cleanString($data[$name], $cleanType); + } + else { + throw new exception(__METHOD__ .': invalid data for '. $name .': ('. $data['name'] .')'); + } + } + + $insertArr['invoice_id'] = $this->invoiceId; + $sql = 'INSERT INTO '. $this->itemTable .' '. $this->gfObj->string_from_array($insertArr, 'insert', NULL, 'sql'); + if($this->run_sql($sql) && !strlen($this->lastError)) { + $retval = $this->get_last_inserted_item(); + } + else { + throw new exception(__METHOD__ .': failed to insert item: '. $this->lastError); + } + } + else { + throw new exception(__METHOD__ .': no invoiceId set!'); + } + + return($retval); + }//end insert_item() + //========================================================================= + + + + //========================================================================= + private function get_last_inserted_item() { + $sql = "SELECT currval('". $this->itemTableSeq ."'::text)"; + if($this->run_sql($sql)) { + $data = $this->db->farray(); + $retval = $data[0]; + } + else { + throw new exception(__METHOD__ .': failed to retrieve last invoice_item_id: '. $this->lastError); + } + + return($retval); + }//end get_last_inserted_item() + //========================================================================= } ?> Modified: trunk/lib/invoiceTransaction.class.php =================================================================== --- trunk/lib/invoiceTransaction.class.php 2007-12-27 16:35:48 UTC (rev 717) +++ trunk/lib/invoiceTransaction.class.php 2007-12-27 16:38:24 UTC (rev 718) @@ -18,13 +18,96 @@ protected $gfObj; protected $logsObj; + private $invoiceId; + + const dbTable = 'invoice_transaction_table'; + const dbSeqName = 'invoice_transaction_table_invoice_transaction_id_seq'; + //========================================================================= - public function __construct(cs_phpDB $db) { + public function __construct(cs_phpDB $db, $invoiceId) { $this->db = $db; $this->gfObj = new cs_globalFunctions; $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; $this->logsObj = new logsClass($this->db, 'Invoice Transaction'); + $this->set_invoice_id($invoiceId); }//end __construct() //========================================================================= + + + + //========================================================================= + /** + * Method to set internal invoiceId value. + */ + private function set_invoice_id($invoiceId) { + if(is_numeric($invoiceId)) { + $this->invoiceId = $invoiceId; + } + else { + throw new exception(_METHOD__ .': invalid data for invoice!'); + } + }//end set_invoice_id() + //========================================================================= + + + + //========================================================================= + /** + * Insert invoice transaction record into the database. + */ + public function create_invoice_transaction(array $data) { + if(is_numeric($this->invoiceId)) { + $fields = array( + 'auth_string' => 'sql', + 'name' => 'sql', + 'number' => 'sql', + 'trans_date' => 'date', + 'amount' => 'float' + ); + + $insertArr = array(); + foreach($fields as $name=>$cleanType) { + if(isset($data[$name]) && strlen($this->gfObj->cleanString($data[$name], $cleanType))) { + $insertArr[$name] = $this->gfObj->cleanString($data[$name], $cleanType); + } + else { + throw new exception(__METHOD__ .': invalid data for '. $name .': ('. $data['name'] .')'); + } + } + + $insertArr['invoice_id'] = $this->invoiceId; + $sql = 'INSERT INTO '. $this->dbTable .' '. $this->gfObj->string_from_array($insertArr, 'insert', NULL, 'sql'); + if($this->run_sql($sql) && !strlen($this->lastError)) { + $retval = $this->get_last_inserted_item(); + } + else { + throw new exception(__METHOD__ .': failed to insert item: '. $this->lastError); + } + } + else { + throw new exception(__METHOD__ .': no invoice_id set!'); + } + }//end create_invoice_transaction() + //========================================================================= + + + + //========================================================================= + /** + * Retrieve last invoice_transaction_id inserted. + */ + private function get_last_inserted_transaction_id() { + $sql = "SELECT currval('". $this->dbSeqName ."'::text)"; + if($this->run_sql($sql)) { + $data = $this->db->farray(); + $retval = $data[0]; + } + else { + throw new exception(__METHOD__ .': failed to retrieve last invoice_transaction_id: '. $this->lastError); + } + + return($retval); + }//end get_last_inserted_transaction_id() + //========================================================================= } ?> Copied: trunk/lib/invoiceViewer.class.php (from rev 717, branches/invoices/lib/invoiceViewer.class.php) =================================================================== --- trunk/lib/invoiceViewer.class.php (rev 0) +++ trunk/lib/invoiceViewer.class.php 2007-12-27 16:38:24 UTC (rev 718) @@ -0,0 +1,36 @@ +<?php +/* + * This class was built to handle creation, searching, and updates of invoices. + * For searches involving items on the invoice, use invoiceItem{}. + * invoices is handled by + * + * SVN INFORMATION::: + * ------------------ + * SVN Signature::::::: $Id$ + * Last Author::::::::: $Author$ + * Current Revision:::: $Revision$ + * Repository Location: $HeadURL$ + * Last Updated:::::::: $Date$ + * + */ + +//TODO: log everything! + + +class invoiceViewer extends invoice { + + protected $gfObj; + protected $logsObj; + + + + //========================================================================= + public function __construct(cs_phpDB $db) { + $this->db = $db; + $this->gfObj = new cs_globalFunctions; + $this->gfObj->debugPrintOpt = DEBUGPRINTOPT; + $this->logsObj = new logsClass($this->db, 'Invoice Viewer'); + }//end __construct() + //========================================================================= +} +?> Property changes on: trunk/lib/invoiceViewer.class.php ___________________________________________________________________ Name: svn:keywords + Id HeadURL Date Revision Author Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-27 20:41:16
|
Revision: 720 http://cs-project.svn.sourceforge.net/cs-project/?rev=720&view=rev Author: crazedsanity Date: 2007-12-27 12:41:08 -0800 (Thu, 27 Dec 2007) Log Message: ----------- Fixes for new cs-content (v0.10.7). Modified Paths: -------------- trunk/includes/content/contacts.inc trunk/lib/globalFunctions.php trunk/templates/system/404.shared.tmpl Modified: trunk/includes/content/contacts.inc =================================================================== --- trunk/includes/content/contacts.inc 2007-12-27 16:39:22 UTC (rev 719) +++ trunk/includes/content/contacts.inc 2007-12-27 20:41:08 UTC (rev 720) @@ -14,6 +14,7 @@ $contactObj = new contactClass($page->db); +$page->allow_invalid_urls(TRUE); if($_POST) { if(strlen($_POST['action']) && is_numeric($_POST['contact_id'])) { Modified: trunk/lib/globalFunctions.php =================================================================== --- trunk/lib/globalFunctions.php 2007-12-27 16:39:22 UTC (rev 719) +++ trunk/lib/globalFunctions.php 2007-12-27 20:41:08 UTC (rev 720) @@ -17,7 +17,7 @@ function get_required_external_lib_versions($projectName=NULL) { //format: {className} => array({projectName} => {exactVersion}) $requirements = array( - 'contentSystem' => array('cs-content', '0.10.6'), + 'contentSystem' => array('cs-content', '0.10.7'), 'XMLParser' => array('cs-phpxml', '0.5.5'), 'arrayToPath' => array('cs-arrayToPath', '0.2.2') ); Modified: trunk/templates/system/404.shared.tmpl =================================================================== --- trunk/templates/system/404.shared.tmpl 2007-12-27 16:39:22 UTC (rev 719) +++ trunk/templates/system/404.shared.tmpl 2007-12-27 20:41:08 UTC (rev 720) @@ -58,7 +58,10 @@ the page doesnt' exist, then stop fishing for page URLs.<BR><BR> Of course, if the page <b>should</b> exist, or you got here from some link... - well, you should probably tell somebody about it. Right?</p> + well, you should probably tell somebody about it. Right?<BR><BR> + + <i>{details}</i> + </p> </td> </tr> </tbody> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-27 21:54:45
|
Revision: 726 http://cs-project.svn.sourceforge.net/cs-project/?rev=726&view=rev Author: crazedsanity Date: 2007-12-27 13:54:43 -0800 (Thu, 27 Dec 2007) Log Message: ----------- Rename main login content file for cs-content (trunk, eventually 0.10.8). Modified Paths: -------------- trunk/includes/login.inc Added Paths: ----------- trunk/templates/login.content.tmpl Removed Paths: ------------- trunk/templates/login.tmpl Modified: trunk/includes/login.inc =================================================================== --- trunk/includes/login.inc 2007-12-27 21:52:45 UTC (rev 725) +++ trunk/includes/login.inc 2007-12-27 21:54:43 UTC (rev 726) @@ -57,7 +57,4 @@ if($_GET['destination']) { $_SESSION['loginDestination'] = urlencode($_GET['destination']); } -//show the default page. -$page->change_content(html_file_to_string("login.tmpl")); - ?> \ No newline at end of file Copied: trunk/templates/login.content.tmpl (from rev 720, trunk/templates/login.tmpl) =================================================================== --- trunk/templates/login.content.tmpl (rev 0) +++ trunk/templates/login.content.tmpl 2007-12-27 21:54:43 UTC (rev 726) @@ -0,0 +1,67 @@ +<head> + <link rel=stylesheet type='text/css' href='/css/common.css'> + <title>Login Page [{PROJ_NAME}]</title> +</head> +<body bgcolor="#D5D5D5" {background}><center> + +{error_msg} + +<table cellspacing="0" cellpadding="3" border="0"> + <tr> + <td> + <form action='/login.php' method='post' name='frm' onSubmit="this.login.value='Logging in...';this.login.disabled=true;"> + <input type='hidden' name'loginform' value='1'> + <table cellspacing=1 cellpadding=5 bgcolor="#D5D5D5" border=0> + + <tr> + <td colspan="2"> + <br><br><img src='/images/logo.gif' border='0'> + </td> + </tr> + + <tr> + <td>Username</td> + + <td><input type='text' name='username' style="border:1px solid #000;"></td> + </tr> + + <tr> + <td>Password</td> + + <td><input type='password' name='password' style="border:1px solid #000;"></td> + </tr> + + <tr> + <td> </td> + + <td> + <input name="login" type='submit' value='Login' style="border:1px solid #000;"> + <a href="/help/lost_password">Lost Password?</a> + </td> + </tr> + + </table> + </form> + </td> + </tr> + + <tr> + <th style="border:solid #000 2px;">Helpful Links:</th> + </tr> + + <tr> + <td style="border:solid #000 2px;border-top:none;"> + <ul> + <li><a href="/extern/helpdesk">View Helpdesk Issues</a></li> + <li><a href="/extern/helpdesk/create">Submit New Issue</a></li> + </ul> + </td> + </tr> +</table> + +</center> + + + +</body> +</html> \ No newline at end of file Deleted: trunk/templates/login.tmpl =================================================================== --- trunk/templates/login.tmpl 2007-12-27 21:52:45 UTC (rev 725) +++ trunk/templates/login.tmpl 2007-12-27 21:54:43 UTC (rev 726) @@ -1,67 +0,0 @@ -<head> - <link rel=stylesheet type='text/css' href='/css/common.css'> - <title>Login Page [{PROJ_NAME}]</title> -</head> -<body bgcolor="#D5D5D5" {background}><center> - -{error_msg} - -<table cellspacing="0" cellpadding="3" border="0"> - <tr> - <td> - <form action='/login.php' method='post' name='frm' onSubmit="this.login.value='Logging in...';this.login.disabled=true;"> - <input type='hidden' name'loginform' value='1'> - <table cellspacing=1 cellpadding=5 bgcolor="#D5D5D5" border=0> - - <tr> - <td colspan="2"> - <br><br><img src='/images/logo.gif' border='0'> - </td> - </tr> - - <tr> - <td>Username</td> - - <td><input type='text' name='username' style="border:1px solid #000;"></td> - </tr> - - <tr> - <td>Password</td> - - <td><input type='password' name='password' style="border:1px solid #000;"></td> - </tr> - - <tr> - <td> </td> - - <td> - <input name="login" type='submit' value='Login' style="border:1px solid #000;"> - <a href="/help/lost_password">Lost Password?</a> - </td> - </tr> - - </table> - </form> - </td> - </tr> - - <tr> - <th style="border:solid #000 2px;">Helpful Links:</th> - </tr> - - <tr> - <td style="border:solid #000 2px;border-top:none;"> - <ul> - <li><a href="/extern/helpdesk">View Helpdesk Issues</a></li> - <li><a href="/extern/helpdesk/create">Submit New Issue</a></li> - </ul> - </td> - </tr> -</table> - -</center> - - - -</body> -</html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-28 01:53:36
|
Revision: 732 http://cs-project.svn.sourceforge.net/cs-project/?rev=732&view=rev Author: crazedsanity Date: 2007-12-27 17:53:34 -0800 (Thu, 27 Dec 2007) Log Message: ----------- Include tag images. YAY! Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/includes/content/tags.inc trunk/templates/content/helpdesk/view.content.tmpl trunk/templates/content/tags/index.content.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2007-12-28 01:53:11 UTC (rev 731) +++ trunk/includes/content/helpdesk.inc 2007-12-28 01:53:34 UTC (rev 732) @@ -353,7 +353,7 @@ - $myTagList = $proj->tagObj->get_tags_for_record($helpdeskData['record_id']); + $myTagList = $proj->tagObj->get_tags_for_record($helpdeskData['record_id'], TRUE); if(is_array($myTagList)) { if($helpdeskData['status_id'] == 4) { $tagListVar = 'text_tags'; @@ -365,7 +365,8 @@ } $myTagRow = ""; $tCount = 0; - foreach($myTagList as $tagNameId=>$tagName) { + foreach($myTagList as $tagNameId=>$tagData) { + $tagName = $tagData['name']; //don't show a separator for the end piece. $tCount++; @@ -376,7 +377,8 @@ $repArr = array( 'tag_name_id' => $tagNameId, 'name' => $tagName, - 'separator' => $separator + 'separator' => $separator, + 'imgHtml' => $tagData['imgHtml'] ); $myTagRow .= mini_parser($baseRow, $repArr, '%%', '%%'); } Modified: trunk/includes/content/tags.inc =================================================================== --- trunk/includes/content/tags.inc 2007-12-28 01:53:11 UTC (rev 731) +++ trunk/includes/content/tags.inc 2007-12-28 01:53:34 UTC (rev 732) @@ -280,6 +280,7 @@ //display the list of available tags. $tagListBaseRow = $page->templateRows['availableTagsList']; + $showIconRow = $page->templateRows['availableTagsList__tagIcon']; $myRow = ""; foreach($myTagList as $tagNameId=>$data) { $tagName = $data['name']; @@ -292,7 +293,12 @@ 'tagNameId' => $tagNameId, 'tagName' => $tagName ); - $myRow .= mini_parser($tagListBaseRow, $repArr, '%%', '%%'); + $tmpRow = mini_parser($tagListBaseRow, $repArr, '%%', '%%'); + if(strlen($data['icon_name'])) { + $parsedIconDisplay = mini_parser($showIconRow, array('icon_name' => $data['icon_name']), '%%', '%%'); + $tmpRow = mini_parser($tmpRow, array('availableTagsList__tagIcon'=>$parsedIconDisplay), '{', '}'); + } + $myRow .= $tmpRow; } $page->add_template_var("availableTagsList", $myRow); } Modified: trunk/templates/content/helpdesk/view.content.tmpl =================================================================== --- trunk/templates/content/helpdesk/view.content.tmpl 2007-12-28 01:53:11 UTC (rev 731) +++ trunk/templates/content/helpdesk/view.content.tmpl 2007-12-28 01:53:34 UTC (rev 732) @@ -150,7 +150,7 @@ <td colspan="2"> <!-- BEGIN editable_tags --> - <!-- BEGIN removeable_tag --><a href="/content/tags/remove/%%tag_name_id%%/{record_id}">%%name%%</a>%%separator%% + <!-- BEGIN removeable_tag --><a href="/content/tags/remove/%%tag_name_id%%/{record_id}">%%name%%%%imgHtml%%</a>%%separator%% <!-- END removeable_tag --> <BR> @@ -164,7 +164,7 @@ <input type="text" name="newTag" value=""><input type="button" value="Add New Tag" onClick="this.value='Creating Tag...';document.main.newTag.readonly=true;document.hiddenAddTagForm.new_tag.value=document.main.newTag.value;document.hiddenAddTagForm.submit()"> <!-- END editable_tags --> - <!-- BEGIN text_tags --><b>%%name%%</b>%%separator%% + <!-- BEGIN text_tags --><b>%%name%%%%imgHtml%%</b>%%separator%% <!-- END text_tags --> </td> Modified: trunk/templates/content/tags/index.content.tmpl =================================================================== --- trunk/templates/content/tags/index.content.tmpl 2007-12-28 01:53:11 UTC (rev 731) +++ trunk/templates/content/tags/index.content.tmpl 2007-12-28 01:53:34 UTC (rev 732) @@ -12,6 +12,8 @@ <td nowrap style="padding-left:5px;"> <img src="/images/bullet-round.png" border="0"> <a href="{PHP_SELF}?showTag=%%tagNameId%%"> %%tagName%%</a> + <!-- BEGIN availableTagsList__tagIcon --><img src="/images/tags/%%icon_name%%.gif" border="0"> + <!-- END availableTagsList__tagIcon --> </td> </tr> <!-- END availableTagsList --> @@ -20,6 +22,7 @@ <td nowrap style="padding-left:5px;"> <img src="/images/bullet-round.png" border="0"> <font size="+1"><b>%%tagName%%</b></font> + {availableTagsList__tagIcon} </td> </tr> <!-- END availableTagsList_noLink --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-01-30 00:34:43
|
Revision: 746 http://cs-project.svn.sourceforge.net/cs-project/?rev=746&view=rev Author: crazedsanity Date: 2008-01-29 16:34:39 -0800 (Tue, 29 Jan 2008) Log Message: ----------- Fix upgrade script, update version to ALPHA2 Modified Paths: -------------- trunk/VERSION trunk/upgrade/upgradeTo1.2.0-ALPHA2.php Modified: trunk/VERSION =================================================================== --- trunk/VERSION 2008-01-29 22:38:41 UTC (rev 745) +++ trunk/VERSION 2008-01-30 00:34:39 UTC (rev 746) @@ -1,4 +1,4 @@ $Id:VERSION 628 2007-11-20 16:58:45Z crazedsanity $ -VERSION: 1.2.0-ALPHA1 +VERSION: 1.2.0-ALPHA2 $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/VERSION $ Modified: trunk/upgrade/upgradeTo1.2.0-ALPHA2.php =================================================================== --- trunk/upgrade/upgradeTo1.2.0-ALPHA2.php 2008-01-29 22:38:41 UTC (rev 745) +++ trunk/upgrade/upgradeTo1.2.0-ALPHA2.php 2008-01-30 00:34:39 UTC (rev 746) @@ -74,7 +74,7 @@ foreach($iconMods as $name=>$icon) { if(isset($allTags[$name])) { //update. - $sql = "UPDATE tag_name_table SET icon_name='". $icon ."' WHERE id=". $allTags[$name]; + $sql = "UPDATE tag_name_table SET icon_name='". $icon ."' WHERE tag_name_id=". $allTags[$name]['tag_name_id']; } else { //insert. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-01-31 21:36:40
|
Revision: 764 http://cs-project.svn.sourceforge.net/cs-project/?rev=764&view=rev Author: crazedsanity Date: 2008-01-31 13:36:37 -0800 (Thu, 31 Jan 2008) Log Message: ----------- Merged changes from the "ajax_test" branch: * AJAX CHANGES: -- add/remove tags on helpdesk records (list updated, select list updated) -- switching currently selected tag (tag list updated, details of tag + associated records) * FIXES::: -- fix viewing note (due to change with cs-content) -- only show note names in project view -- fix upgrade script for ALPHA2 (so the upgrade works) -- remove unnecessary call when retrieving notes for project. Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/includes/content/tags.inc trunk/lib/projectClass.php trunk/public_html/js/cs-project.js trunk/templates/content/helpdesk/view.content.tmpl trunk/templates/content/project/view/related_note.content.tmpl trunk/templates/content/tags/index.content.tmpl trunk/templates/header.shared.tmpl Added Paths: ----------- trunk/includes/content/shared.inc trunk/public_html/xajax/ trunk/public_html/xajax/lib/ trunk/public_html/xajax/lib/activex_off.js trunk/public_html/xajax/tests/ trunk/public_html/xajax/tests/HTTPStatusTest.php trunk/public_html/xajax/tests/catchAllFunctionTest.php trunk/public_html/xajax/tests/changeEventTest.php trunk/public_html/xajax/tests/charEncodingTest.php trunk/public_html/xajax/tests/confirmTest.php trunk/public_html/xajax/tests/createFormInputTest.php trunk/public_html/xajax/tests/customResponseClassTest.php trunk/public_html/xajax/tests/disabledFormElementsTest.php trunk/public_html/xajax/tests/errorHandlingTest.php trunk/public_html/xajax/tests/eventHandlerTest.php trunk/public_html/xajax/tests/formSubmissionTest.php trunk/public_html/xajax/tests/includeExternalScriptTest.php trunk/public_html/xajax/tests/index.php trunk/public_html/xajax/tests/largeResponseTest.php trunk/public_html/xajax/tests/myExternalFunction.js trunk/public_html/xajax/tests/myExternalFunction.php trunk/public_html/xajax/tests/phpWhitespaceTest.php trunk/public_html/xajax/tests/preFunctionTest.php trunk/public_html/xajax/tests/redirectTest.php trunk/public_html/xajax/tests/registerExternalFunctionTest.php trunk/public_html/xajax/tests/scriptCallTest.php trunk/public_html/xajax/tests/searchReplaceTest.php trunk/public_html/xajax/tests/xajaxResponseTest.php trunk/public_html/xajax/xajax.inc.php trunk/public_html/xajax/xajaxCompress.php trunk/public_html/xajax/xajaxResponse.inc.php trunk/public_html/xajax/xajax_js/ trunk/public_html/xajax/xajax_js/xajax.js trunk/public_html/xajax/xajax_js/xajax_uncompressed.js trunk/templates/content/notes/view.content.tmpl Removed Paths: ------------- trunk/public_html/xajax/lib/ trunk/public_html/xajax/lib/activex_off.js trunk/public_html/xajax/tests/ trunk/public_html/xajax/tests/HTTPStatusTest.php trunk/public_html/xajax/tests/catchAllFunctionTest.php trunk/public_html/xajax/tests/changeEventTest.php trunk/public_html/xajax/tests/charEncodingTest.php trunk/public_html/xajax/tests/confirmTest.php trunk/public_html/xajax/tests/createFormInputTest.php trunk/public_html/xajax/tests/customResponseClassTest.php trunk/public_html/xajax/tests/disabledFormElementsTest.php trunk/public_html/xajax/tests/errorHandlingTest.php trunk/public_html/xajax/tests/eventHandlerTest.php trunk/public_html/xajax/tests/formSubmissionTest.php trunk/public_html/xajax/tests/includeExternalScriptTest.php trunk/public_html/xajax/tests/index.php trunk/public_html/xajax/tests/largeResponseTest.php trunk/public_html/xajax/tests/myExternalFunction.js trunk/public_html/xajax/tests/myExternalFunction.php trunk/public_html/xajax/tests/phpWhitespaceTest.php trunk/public_html/xajax/tests/preFunctionTest.php trunk/public_html/xajax/tests/redirectTest.php trunk/public_html/xajax/tests/registerExternalFunctionTest.php trunk/public_html/xajax/tests/scriptCallTest.php trunk/public_html/xajax/tests/searchReplaceTest.php trunk/public_html/xajax/tests/xajaxResponseTest.php trunk/public_html/xajax/xajax.inc.php trunk/public_html/xajax/xajaxCompress.php trunk/public_html/xajax/xajaxResponse.inc.php trunk/public_html/xajax/xajax_js/ trunk/public_html/xajax/xajax_js/xajax.js trunk/public_html/xajax/xajax_js/xajax_uncompressed.js trunk/templates/content/notes/index.shared.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/includes/content/helpdesk.inc 2008-01-31 21:36:37 UTC (rev 764) @@ -7,6 +7,10 @@ * 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']); $helpdeskId = $_POST['id']; @@ -171,14 +175,6 @@ )); } } - else { - //the didn't post enough... - set_message_wrapper(array( - "title" => "FAILED TO CREATE ISSUE!", - "message" => "Unable to create the message... [$retval]", - "type" => "error" - )); - } //build the redirection URL. $url = $baseUrl; @@ -187,20 +183,22 @@ if(preg_match('/view/', $urlSection) && !is_numeric($urlExtrasArr['ID'])) { unset($urlSection); } - if(isset($urlSection) && !preg_match('/\?/', $url)) { - if(!preg_match('/$\//', $url)) { - $urlSection = "/". $urlSection; + else { + if(isset($urlSection) && !preg_match('/\?/', $url)) { + if(!preg_match('/$\//', $url)) { + $urlSection = "/". $urlSection; + } + $url .= $urlSection; } - $url .= $urlSection; - } - if(!$byPassUrlExtras && count($urlExtrasArr) > 0) { - $urlExtrasStr = string_from_array($urlExtrasArr, "url"); - if($urlExtrasStr !== 0) { - $url .= "?". $urlExtrasStr .'&random='. time(); + if(!$byPassUrlExtras && count($urlExtrasArr) > 0) { + $urlExtrasStr = string_from_array($urlExtrasArr, "url"); + if($urlExtrasStr !== 0) { + $url .= "?". $urlExtrasStr .'&random='. time(); + } } + conditional_header($url); + exit; } - conditional_header($url); - exit; } else { $helpdeskId = $_GET['ID']; @@ -353,44 +351,16 @@ - $myTagList = $proj->tagObj->get_tags_for_record($helpdeskData['record_id'], TRUE); - if(is_array($myTagList)) { - if($helpdeskData['status_id'] == 4) { - $tagListVar = 'text_tags'; - $baseRow = $page->templateRows['text_tags']; - } - else { - $tagListVar = 'removeable_tag'; - $baseRow = $page->templateRows['removeable_tag']; - } - $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, '%%', '%%'); - } - $page->add_template_var($tagListVar, $myTagRow); + $useTextTags = FALSE; + if($helpdeskData['status_id'] == 4) { + $useTextTags = TRUE; } + generate_tag_list($helpdeskData['record_id'], $useTextTags); + + //Display tags that can be added. - $availableTagsList = $proj->tagObj->get_available_tags_for_record($helpdeskData['record_id'], 3); - if(is_array($availableTagsList) && count($availableTagsList) > 0) { - $myTagsList = array_as_option_list($availableTagsList,NULL,'select',$page->templateRows['addTag_option']); - $page->add_template_var("add_tag_list", $myTagsList); - } + generate_addable_tags($helpdeskData['record_id']); //now parse the note rows. if(is_array($myNotes) && count($myNotes)) { @@ -509,4 +479,184 @@ } } } + +//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: trunk/includes/content/shared.inc (from rev 763, branches/ajax_test/includes/content/shared.inc) =================================================================== --- trunk/includes/content/shared.inc (rev 0) +++ trunk/includes/content/shared.inc 2008-01-31 21:36:37 UTC (rev 764) @@ -0,0 +1,57 @@ +<?php +/* + * Created on Jan 29, 2008 + * + * To change the template for this generated file go to + * Window - Preferences - PHPeclipse - PHP - Code Templates + */ + + +require_once(dirname(__FILE__) ."/../../public_html/xajax/xajax.inc.php"); + + + + + +$GLOBALS['objects'] = array(); +$GLOBALS['objects']['page'] =& $page; +$GLOBALS['objects']['proj'] =& $proj; +$GLOBALS['objects']['tag'] =& $proj->tagObj; + + +/** + * Handles creation of javascript functions; AJAX callback functions + * should start with "ajax__", and can then be referenced in the HTML + * with the prefix "xajax_ajax__". If the callback function is named + * "ajax__function()", the javascript call would be "xajax_ajax__function()". + * + * NOTE: Because PHP lowercases function names when calling get_defined_functions(), + * javascript calls must use the lowercase version; i.e. if the callback + * is named "ajax__showMeStuff()", the javascript would be + * "xajax_ajax__showmestuff()". + */ +function addAjax() { + $xajax = new xajax($_SERVER['PHP_SELF']); + + //automatically register all functions starting with "ajax__" + $funcList = get_defined_functions(); + $funcList = $funcList['user']; + foreach($funcList as $name) { + if(preg_match('/^ajax__/', $name)) { + $xajax->registerFunction($name); + } + } + + $xajax->processRequests(); + + //since Xajax prints things, capture it in a buffer so it can be added as a template var. + ob_start(); + $xajax->printJavascript('/xajax'); + $xajaxHeaders = ob_get_contents(); + ob_end_clean(); + + $page = $GLOBALS['objects']['page']; + $page->add_template_var('XAJAX_HEADERS', $xajaxHeaders); +}//end addAjax() + +?> Modified: trunk/includes/content/tags.inc =================================================================== --- trunk/includes/content/tags.inc 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/includes/content/tags.inc 2008-01-31 21:36:37 UTC (rev 764) @@ -16,94 +16,10 @@ $sessionCache = new sessionCache("settings"); -if($page->ftsSections[2] == 'add') { - //okay, they're adding a tag: the URL should look - // something like: /content/tags/add/helpdesk/2/555 - // where helpdesk is the source section, and 2 is that tag_name_id to attach record_id #555 to. - - //okay... let's do some pre-checking. - $tagNameId = $page->ftsSections[3]; - $recordId = $page->ftsSections[4]; - - - //set a default message. - $messageArr = array( - 'title' => 'Failed to Add Tag', - 'message' => "Either no tag was specified, or the tag was invalid.", - 'type' => 'error' - ); - - //here's where to go. - $goBack = $_SERVER['HTTP_REFERER']; - - if(is_numeric($tagNameId) && is_numeric($recordId)) { - $tagList = $proj->tagObj->get_tag_list(); - - //okay, let's do the do. - $result = $proj->tagObj->add_tag($recordId, $tagNameId); - - if($result == 1) { - //it worked. - $messageArr = array( - 'title' => 'Tag Added Successfully', - 'message' => "Successfully tagged record with \"". $tagList[$tagNameId] ."\"", - 'type' => 'status' - ); - } - } - else { - set_message_wrapper(array( - 'title' => 'Failed to Add Tag', - 'message' => "Either no tag was specified, or the tag was invalid.", - 'type' => 'error' - )); - } - set_message_wrapper($messageArr); - conditional_header($goBack); - exit; -} -elseif($page->ftsSections[2] == 'remove') { - //here's where to go. - $goBack = $_SERVER['HTTP_REFERER']; - - //set some vars. - $tagNameId = $page->ftsSections[3]; - $recordId = $page->ftsSections[4]; - $tagList = $proj->tagObj->get_tag_list(); - - //default message to display. - $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 = $proj->tagObj->remove_tag($recordId,$tagNameId); - - //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 .")"; - } - } - - set_message_wrapper($messageArr); - conditional_header($goBack); - - exit; -} -elseif($_POST) { +addAjax(); + +if($_POST) { //got post vars. Check them, then reload. - debug_print($_POST); $goHere = $_SERVER['PHP_SELF']; if($_POST['action'] == 'update') { @@ -113,8 +29,6 @@ //check for pre-existing tags of that name. $myTagList = $proj->tagObj->get_tag_list(); $existingTagNameId = array_search($_POST['new_tag'], $myTagList); - debug_print($myTagList); - debug_print($existingTagNameId); if(is_numeric($existingTagNameId)) { $newTagNameId = $existingTagNameId; @@ -155,16 +69,19 @@ $goHere = $_POST['goBack'] ."&newTag=$newTagNameId"; } - //do the redirect to remove POST headers. - conditional_header($goHere); - exit; + if(strlen($goHere)) { + + //do the redirect to remove POST headers. + conditional_header($goHere); + exit; + } } //get the list of tags, regardless of whether we'll show 'em all or not. $myTagList = $proj->tagObj->get_tag_list(TRUE, FALSE); $showData = TRUE; -#$showTagNameId = $sessionCache->get_cache('tagNameId'); +$showTagNameId = $sessionCache->get_cache('tagNameId'); if($_GET['move']) { @@ -244,29 +161,36 @@ //retrieve the (possibly updated) setting $showTagNameId = $sessionCache->get_cache('tagNameId'); -if($showData) { +if($showData) { + #showCurrentTag($showTagNameId); + updateTagList($showTagNameId); + showCurrentTag($showTagNameId); + showRecordList($showTagNameId); +} + + +//AJAX FUNCTIONS... + +function showRecordList($showTagNameId) { + $tagObj = $GLOBALS['objects']['tag']; + $page = $GLOBALS['objects']['page']; + //get data for this tag. - $data = $proj->tagObj->get_records_for_tag($showTagNameId); + $data = $tagObj->get_records_for_tag($showTagNameId); - //set some vars. - $page->add_template_var("tagName", $myTagList[$showTagNameId]['name']); - $page->add_template_var('tagModifier', $myTagList[$showTagNameId]['modifier']); - $page->add_template_var("tagRecordCount", count($data)); - $page->add_template_var("showTagNameId", $showTagNameId); + if(!isset($page->templateRows['associatedRecords'])) { + $page->set_all_block_rows(); + } + $parseTmpl = $page->templateRows['associatedRecords']; - $page->add_template_var('modifier_option_list', create_priority_option_list($myTagList[$showTagNameId]['modifier'], 5, -5)); - - create_page_title($page, array('title' => "Tag #". $showTagNameId . ": ". $myTagList[$showTagNameId]['name'])); - - //rip all block rows. - $page->set_all_block_rows('content'); - //now list all records for this tag (assign the "no records" row, then check). $tagRow = $page->templateRows['tag_row__noRecords']; if(count($data)) { //got data. $tagRow = ""; $baseRow = $page->templateRows['tag_row']; + $rowColor1 = NULL; + $rowColor2 = NULL; foreach($data as $index=>$subData) { //add some things for alternating row colors. $subData['rowColor'] = swapValue($rowColor1, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); @@ -276,8 +200,74 @@ $tagRow .= mini_parser($baseRow, $subData, '%%', '%%'); } } - $page->add_template_var('tag_row', $tagRow); + $repArr = array( + 'tag_row' => $tagRow, + 'currentTagData' => $page->templateRows['currentTagData'], + 'associatedRecords' => $page->templateRows['associatedRecords'], + 'tag_row__noRecords' => "" + ); + + $retval = mini_parser($parseTmpl, $repArr, '{', '}'); + foreach($repArr as $index=>$value) { + $page->add_template_var($index, $value); + } + + #$page->add_template_var('tag_row', $tagRow); + #$page->add_template_var('currentTagData', $page->templateRows['currentTagData']); + #$page->add_template_var('associatedRecords', $page->templateRows['associatedRecords']); + + return($retval); +}//end showRecordList() + + +function showCurrentTag($showTagNameId) { + + $page = $GLOBALS['objects']['page']; + $tagObj = $GLOBALS['objects']['tag']; + + $myTagList = $tagObj->get_tag_list(TRUE, FALSE); + + //get data for this tag. + $data = $tagObj->get_records_for_tag($showTagNameId); + + if(!isset($page->templateRows['currentTagData_header'])) { + $page->set_all_block_rows(); + } + $parseTemplate = $page->templateRows['currentTagData_header']; + + $repArr = array( + 'tagName' => $myTagList[$showTagNameId]['name'], + 'tagModifier' => $myTagList[$showTagNameId]['modifier'], + 'tagRecordCount' => count($data), + 'showTagNameId' => $showTagNameId, + 'modifier_option_list' => create_priority_option_list($myTagList[$showTagNameId]['modifier'], 5, -5) + ); + + $retval = mini_parser($parseTemplate, $repArr, '{', '}'); + + foreach($repArr as $tmplVar=>$value) { + $page->add_template_var($tmplVar, $value); + } + + $page->add_template_var('currentTagData_header', $page->templateRows['currentTagData_header']); + + return($retval); +}//end showCurrentTag() + + +function updateTagList($showTagNameId) { + $page = $GLOBALS['objects']['page']; + $tagObj = $GLOBALS['objects']['tag']; + + $myTagList = $tagObj->get_tag_list(TRUE, FALSE); + create_page_title($page, array('title' => "Tag #". $showTagNameId . ": ". $myTagList[$showTagNameId]['name'])); + + //rip all block rows. + $page->set_all_block_rows('content'); + + $recordList = showRecordList($showTagNameId); + //display the list of available tags. $tagListBaseRow = $page->templateRows['availableTagsList']; $showIconRow = $page->templateRows['availableTagsList__tagIcon']; @@ -296,11 +286,39 @@ $tmpRow = mini_parser($tagListBaseRow, $repArr, '%%', '%%'); if(strlen($data['icon_name'])) { $parsedIconDisplay = mini_parser($showIconRow, array('icon_name' => $data['icon_name']), '%%', '%%'); - $tmpRow = mini_parser($tmpRow, array('availableTagsList__tagIcon'=>$parsedIconDisplay), '{', '}'); } + else { + $parsedIconDisplay = ""; + } + $tmpRow = mini_parser($tmpRow, array('availableTagsList__tagIcon'=>$parsedIconDisplay), '{', '}'); $myRow .= $tmpRow; } $page->add_template_var("availableTagsList", $myRow); -} + $retval = mini_parser($myRow, array('tag_row'=>$recordList), '{', '}'); + + return($retval); +}//end updateTagList() + +function ajax__showTagRecords($tagNameId) { + $objResponse = new xajaxResponse(); + + //update the list of tags. + $tagList = updateTagList($tagNameId); + $objResponse->addAssign('tagList', 'innerHTML', $tagList); + + //now update the data for the current tag. + $currentTagData = showCurrentTag($tagNameId); + $objResponse->addAssign('currentTagData_header', 'innerHTML', $currentTagData); + + //update associated record list. + $objResponse->addAssign('associatedRecords', 'innerHTML', showRecordList($tagNameId)); + + //store in the session, so if they reload, the selected tag will remain. + $sessionCache = new sessionCache("settings"); + $sessionCache->set_cache('tagNameId', $tagNameId); + + return($objResponse); +}//end ajax__showTagRecords() + ?> \ No newline at end of file Modified: trunk/lib/projectClass.php =================================================================== --- trunk/lib/projectClass.php 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/lib/projectClass.php 2008-01-31 21:36:37 UTC (rev 764) @@ -300,8 +300,6 @@ function get_notes() { $this->noteObj->projectId = $this->projectId; $retval = $this->noteObj->get_notes(array('record_id'=>$this->internalRecordId)); - - $userList = $this->list_users(); return($retval); }//end get_notes() //========================================================================= Modified: trunk/public_html/js/cs-project.js =================================================================== --- trunk/public_html/js/cs-project.js 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/public_html/js/cs-project.js 2008-01-31 21:36:37 UTC (rev 764) @@ -334,3 +334,38 @@ checksumInputObj.readonly = true; }//end cs_confirmLostPass() + +function clearErrorMessage() { + var name = 'MAIN_error_message'; + document.getElementById(name).innerHTML=""; +}//end clearErrorMessage() + + +/** + * Overload the xajax call to be able to do things like clearing out the + * div that contains set messages... + */ +function checkAjax() { + var retval = false; + if(this.xajaxLoaded) { + retval = true; + } + return retval; +} +var clearMessageTimeoutID; +if(checkAjax()) { + //keep around the old call function + xajax.realCall = xajax.call; + //override the call function to bend to our wicked ways + xajax.call = function(sFunction, aArgs, sRequestType) + { + //clear out the message. + if(this.clearMessageTimeoutID) { + clearTimeout(this.clearMessageTimeoutID); + } + this.clearMessageTimeoutID = setTimeout("clearErrorMessage();", 10000); + + //call the old call function + return this.realCall(sFunction, aArgs, sRequestType); + } +} \ No newline at end of file Copied: trunk/public_html/xajax (from rev 763, branches/ajax_test/public_html/xajax) Copied: trunk/public_html/xajax/lib (from rev 763, branches/ajax_test/public_html/xajax/lib) Deleted: trunk/public_html/xajax/lib/activex_off.js =================================================================== --- branches/ajax_test/public_html/xajax/lib/activex_off.js 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/public_html/xajax/lib/activex_off.js 2008-01-31 21:36:37 UTC (rev 764) @@ -1,119 +0,0 @@ -/***** -A drop in replacement for XMLHttpRequest object - -Usage: - Add to between the <head> tags, - <!--[if IE]><script type="text/javascript" src="activex_off.js"></script><![endif]--> - -*****/ -var useBackupXMLObject = false; - -xajax.oldGetRequestObject = xajax.getRequestObject; -xajax.getRequestObject = function() { - var req = null; - if (useBackupXMLObject == false) - { - this.temp = this.DebugMessage; - this.DebugMessage = function() {}; - req = this.oldGetRequestObject(); - this.DebugMessage = this.temp; - this.temp = null; - if (req) - return req; - useBackupXMLObject = true; - } - try { - req = new BackupXMLObject(); - } catch (e) {} - return req; -} - -function stringify(obj) -{ - if (typeof obj == 'string') - return "'"+obj+"'"; - first = true; - objstring = "{"; - for (i in obj) - { - if (first) - first = false; - else - objstring += ","; - objstring += i+":" + stringify(obj[i]); - } - objstring += "}"; - return objstring; -} - -xajax.realCall = xajax.call; -xajax.call = null; -xajax.pageLoaded = false; -xajax.call = function(func, params) -{ - if (this.pageLoaded) - { - return this.realCall.apply(this, arguments); - } - state = document.readyState; - if (state == 'complete' || state == 4) { - this.pageLoaded = true; - this.call = this.realCall; - return this.realCall.apply(this, arguments); - } else { - paramstring = stringify(params); - setTimeout("xajax.call('"+func+"',"+paramstring+");",100); - return true; - } -} - -function BackupXMLObject() { - this.uri = null; - this.async = null; - this.status = null; - this.readyState = 0; - this.responseText = ''; - this.statusText = null; - this.requestType = null; - this.responseXML = null; - this.onreadystatechange = function(){}; - this.xmlisland = null; - - this.open = function(requestType, uri, async) - { - this.requestType = requestType.toLowerCase(); - this.uri = uri; - this.async = async; - } - - this.setRequestHeader = function(headerKey, headerValue) - { - if (this.requestType == 'post') - throw new Error(); - } - - this.send = function(postData) - { - xmlislandId = 'xml'+(new Date().getTime()); - var xmlisland = document.createElement("xml"); - xmlisland.id = xmlislandId; - xmlisland.maker = this; - xmlisland.src = this.uri; - document.body.appendChild(xmlisland); - xmlisland.XMLDocument.onreadystatechange = function() { - xmlisland.maker.readyState = xmlisland.XMLDocument.readyState; - xmlisland.maker.responseXML = xmlisland.XMLDocument; - xmlisland.maker.status = 200; - if (xmlisland.XMLDocument && xmlisland.XMLDocument.documentElement) - xmlisland.maker.responseText = xmlisland.XMLDocument.documentElement.xml; - xmlisland.maker.onreadystatechange(); - if (xmlisland.XMLDocument.readyState == 4) - { - document.body.removeChild(xmlisland); - delete xmlisland; - xmlisland = null; - } - } - } - -} Copied: trunk/public_html/xajax/lib/activex_off.js (from rev 763, branches/ajax_test/public_html/xajax/lib/activex_off.js) =================================================================== --- trunk/public_html/xajax/lib/activex_off.js (rev 0) +++ trunk/public_html/xajax/lib/activex_off.js 2008-01-31 21:36:37 UTC (rev 764) @@ -0,0 +1,119 @@ +/***** +A drop in replacement for XMLHttpRequest object + +Usage: + Add to between the <head> tags, + <!--[if IE]><script type="text/javascript" src="activex_off.js"></script><![endif]--> + +*****/ +var useBackupXMLObject = false; + +xajax.oldGetRequestObject = xajax.getRequestObject; +xajax.getRequestObject = function() { + var req = null; + if (useBackupXMLObject == false) + { + this.temp = this.DebugMessage; + this.DebugMessage = function() {}; + req = this.oldGetRequestObject(); + this.DebugMessage = this.temp; + this.temp = null; + if (req) + return req; + useBackupXMLObject = true; + } + try { + req = new BackupXMLObject(); + } catch (e) {} + return req; +} + +function stringify(obj) +{ + if (typeof obj == 'string') + return "'"+obj+"'"; + first = true; + objstring = "{"; + for (i in obj) + { + if (first) + first = false; + else + objstring += ","; + objstring += i+":" + stringify(obj[i]); + } + objstring += "}"; + return objstring; +} + +xajax.realCall = xajax.call; +xajax.call = null; +xajax.pageLoaded = false; +xajax.call = function(func, params) +{ + if (this.pageLoaded) + { + return this.realCall.apply(this, arguments); + } + state = document.readyState; + if (state == 'complete' || state == 4) { + this.pageLoaded = true; + this.call = this.realCall; + return this.realCall.apply(this, arguments); + } else { + paramstring = stringify(params); + setTimeout("xajax.call('"+func+"',"+paramstring+");",100); + return true; + } +} + +function BackupXMLObject() { + this.uri = null; + this.async = null; + this.status = null; + this.readyState = 0; + this.responseText = ''; + this.statusText = null; + this.requestType = null; + this.responseXML = null; + this.onreadystatechange = function(){}; + this.xmlisland = null; + + this.open = function(requestType, uri, async) + { + this.requestType = requestType.toLowerCase(); + this.uri = uri; + this.async = async; + } + + this.setRequestHeader = function(headerKey, headerValue) + { + if (this.requestType == 'post') + throw new Error(); + } + + this.send = function(postData) + { + xmlislandId = 'xml'+(new Date().getTime()); + var xmlisland = document.createElement("xml"); + xmlisland.id = xmlislandId; + xmlisland.maker = this; + xmlisland.src = this.uri; + document.body.appendChild(xmlisland); + xmlisland.XMLDocument.onreadystatechange = function() { + xmlisland.maker.readyState = xmlisland.XMLDocument.readyState; + xmlisland.maker.responseXML = xmlisland.XMLDocument; + xmlisland.maker.status = 200; + if (xmlisland.XMLDocument && xmlisland.XMLDocument.documentElement) + xmlisland.maker.responseText = xmlisland.XMLDocument.documentElement.xml; + xmlisland.maker.onreadystatechange(); + if (xmlisland.XMLDocument.readyState == 4) + { + document.body.removeChild(xmlisland); + delete xmlisland; + xmlisland = null; + } + } + } + +} Copied: trunk/public_html/xajax/tests (from rev 763, branches/ajax_test/public_html/xajax/tests) Deleted: trunk/public_html/xajax/tests/HTTPStatusTest.php =================================================================== --- branches/ajax_test/public_html/xajax/tests/HTTPStatusTest.php 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/public_html/xajax/tests/HTTPStatusTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -1,41 +0,0 @@ -<?php -require_once("../xajax.inc.php"); - -function returnStatus($number) -{ - if ($number == 500) { - header("HTTP/1.1 500 Internal Server Error"); - echo "Testing a server error..."; - } - if ($number == 404) { - header("HTTP/1.1 404 Not Found"); - echo "Testing an unknown URL..."; - } - exit; -} -$xajax = new xajax(); -//$xajax->debugOn(); -$xajax->registerFunction("returnStatus"); -$xajax->processRequests(); -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>HTTP Status Test | xajax Tests</title> -<?php $xajax->printJavascript("../") ?> -</head> -<body> - -<h2><a href="index.php">xajax Tests</a></h2> -<h1>HTTP Status Test</h1> - -<form id="testForm1" onsubmit="return false;"> -<p><input type="submit" value="Return a 500 Internal Server Error" onclick="xajax_returnStatus(500); return false;" /></p> -<p><input type="submit" value="Return a 404 Not Found Error" onclick="xajax_returnStatus(404); return false;" /></p> -</form> - -<div id="submittedDiv"></div> - -</body> -</html> \ No newline at end of file Copied: trunk/public_html/xajax/tests/HTTPStatusTest.php (from rev 763, branches/ajax_test/public_html/xajax/tests/HTTPStatusTest.php) =================================================================== --- trunk/public_html/xajax/tests/HTTPStatusTest.php (rev 0) +++ trunk/public_html/xajax/tests/HTTPStatusTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -0,0 +1,41 @@ +<?php +require_once("../xajax.inc.php"); + +function returnStatus($number) +{ + if ($number == 500) { + header("HTTP/1.1 500 Internal Server Error"); + echo "Testing a server error..."; + } + if ($number == 404) { + header("HTTP/1.1 404 Not Found"); + echo "Testing an unknown URL..."; + } + exit; +} +$xajax = new xajax(); +//$xajax->debugOn(); +$xajax->registerFunction("returnStatus"); +$xajax->processRequests(); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>HTTP Status Test | xajax Tests</title> +<?php $xajax->printJavascript("../") ?> +</head> +<body> + +<h2><a href="index.php">xajax Tests</a></h2> +<h1>HTTP Status Test</h1> + +<form id="testForm1" onsubmit="return false;"> +<p><input type="submit" value="Return a 500 Internal Server Error" onclick="xajax_returnStatus(500); return false;" /></p> +<p><input type="submit" value="Return a 404 Not Found Error" onclick="xajax_returnStatus(404); return false;" /></p> +</form> + +<div id="submittedDiv"></div> + +</body> +</html> \ No newline at end of file Deleted: trunk/public_html/xajax/tests/catchAllFunctionTest.php =================================================================== --- branches/ajax_test/public_html/xajax/tests/catchAllFunctionTest.php 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/public_html/xajax/tests/catchAllFunctionTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -1,50 +0,0 @@ -<?php -require_once("../xajax.inc.php"); - -function test2ndFunction($formData, $objResponse) -{ - $objResponse->addAlert("formData: " . print_r($formData, true)); - $objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true))); - return $objResponse->getXML(); -} - -function myCatchAllFunction($funcName, $args) -{ - $objResponse = new xajaxResponse(); - $objResponse->addAlert("This is from the catch all function"); -// return $objResponse; - return test2ndFunction($args[0], $objResponse); -} - -function testForm($formData) -{ - $objResponse = new xajaxResponse(); - $objResponse->addAlert("This is from the regular function"); - return test2ndFunction($formData, $objResponse); -} -$xajax = new xajax(); -$xajax->registerCatchAllFunction("myCatchAllFunction"); -//$xajax->registerFunction("testForm"); -$xajax->processRequests(); -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Catch-all Function Test | xajax Tests</title> -<?php $xajax->printJavascript("../") ?> -</head> -<body> - -<h2><a href="index.php">xajax Tests</a></h2> -<h1>Catch-all Function Test</h1> - -<form id="testForm1" onsubmit="return false;"> -<p><input type="text" id="textBox1" name="textBox1" value="This is some text" /></p> -<p><input type="submit" value="Submit Normal" onclick="xajax.call('testForm', [xajax.getFormValues('testForm1')]); return false;" /></p> -</form> - -<div id="submittedDiv"></div> - -</body> -</html> \ No newline at end of file Copied: trunk/public_html/xajax/tests/catchAllFunctionTest.php (from rev 763, branches/ajax_test/public_html/xajax/tests/catchAllFunctionTest.php) =================================================================== --- trunk/public_html/xajax/tests/catchAllFunctionTest.php (rev 0) +++ trunk/public_html/xajax/tests/catchAllFunctionTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -0,0 +1,50 @@ +<?php +require_once("../xajax.inc.php"); + +function test2ndFunction($formData, $objResponse) +{ + $objResponse->addAlert("formData: " . print_r($formData, true)); + $objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true))); + return $objResponse->getXML(); +} + +function myCatchAllFunction($funcName, $args) +{ + $objResponse = new xajaxResponse(); + $objResponse->addAlert("This is from the catch all function"); +// return $objResponse; + return test2ndFunction($args[0], $objResponse); +} + +function testForm($formData) +{ + $objResponse = new xajaxResponse(); + $objResponse->addAlert("This is from the regular function"); + return test2ndFunction($formData, $objResponse); +} +$xajax = new xajax(); +$xajax->registerCatchAllFunction("myCatchAllFunction"); +//$xajax->registerFunction("testForm"); +$xajax->processRequests(); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Catch-all Function Test | xajax Tests</title> +<?php $xajax->printJavascript("../") ?> +</head> +<body> + +<h2><a href="index.php">xajax Tests</a></h2> +<h1>Catch-all Function Test</h1> + +<form id="testForm1" onsubmit="return false;"> +<p><input type="text" id="textBox1" name="textBox1" value="This is some text" /></p> +<p><input type="submit" value="Submit Normal" onclick="xajax.call('testForm', [xajax.getFormValues('testForm1')]); return false;" /></p> +</form> + +<div id="submittedDiv"></div> + +</body> +</html> \ No newline at end of file Deleted: trunk/public_html/xajax/tests/changeEventTest.php =================================================================== --- branches/ajax_test/public_html/xajax/tests/changeEventTest.php 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/public_html/xajax/tests/changeEventTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -1,38 +0,0 @@ -<?php -require_once("../xajax.inc.php"); - -function addEvent($sId,$sCode) -{ - $objResponse = new xajaxResponse(); - $objResponse->addEvent($sId, "onclick", $sCode); - return $objResponse->getXML(); -} - -$xajax = new xajax(); -//$xajax->debugOn(); -$xajax->registerFunction("addEvent"); -$xajax->processRequests(); -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Change Event Test | xajax Tests</title> -<?php $xajax->printJavascript("../") ?> -</head> -<body> - -<h2><a href="index.php">xajax Tests</a></h2> -<h1>Change Event Test </h1> - -<div id="myDiv"" style="padding: 3px; display: table; border: 1px outset black; font-size: large; margin-bottom: 10px;">Click Me</div> - -<form id="testForm1" onsubmit="return false;"> -<div><input type="submit" value="Set onclick to something" onclick="xajax_addEvent('myDiv','alert(\'Something\');'); return false;" /></div> -<div><input type="submit" value="Set onclick to something else" onclick="xajax_addEvent('myDiv','alert(\'Something Else\');'); return false;" /></div> -</form> - -<div id="submittedDiv"></div> - -</body> -</html> \ No newline at end of file Copied: trunk/public_html/xajax/tests/changeEventTest.php (from rev 763, branches/ajax_test/public_html/xajax/tests/changeEventTest.php) =================================================================== --- trunk/public_html/xajax/tests/changeEventTest.php (rev 0) +++ trunk/public_html/xajax/tests/changeEventTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -0,0 +1,38 @@ +<?php +require_once("../xajax.inc.php"); + +function addEvent($sId,$sCode) +{ + $objResponse = new xajaxResponse(); + $objResponse->addEvent($sId, "onclick", $sCode); + return $objResponse->getXML(); +} + +$xajax = new xajax(); +//$xajax->debugOn(); +$xajax->registerFunction("addEvent"); +$xajax->processRequests(); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Change Event Test | xajax Tests</title> +<?php $xajax->printJavascript("../") ?> +</head> +<body> + +<h2><a href="index.php">xajax Tests</a></h2> +<h1>Change Event Test </h1> + +<div id="myDiv"" style="padding: 3px; display: table; border: 1px outset black; font-size: large; margin-bottom: 10px;">Click Me</div> + +<form id="testForm1" onsubmit="return false;"> +<div><input type="submit" value="Set onclick to something" onclick="xajax_addEvent('myDiv','alert(\'Something\');'); return false;" /></div> +<div><input type="submit" value="Set onclick to something else" onclick="xajax_addEvent('myDiv','alert(\'Something Else\');'); return false;" /></div> +</form> + +<div id="submittedDiv"></div> + +</body> +</html> \ No newline at end of file Deleted: trunk/public_html/xajax/tests/charEncodingTest.php =================================================================== --- branches/ajax_test/public_html/xajax/tests/charEncodingTest.php 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/public_html/xajax/tests/charEncodingTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -1,130 +0,0 @@ -<?php -require_once("../xajax.inc.php"); - -function setOptions($formData) -{ - $_SESSION['useEncoding'] = $formData['useEncoding']; - $_SESSION['htmlEntities'] = (boolean)$formData['htmlEntities']; - $_SESSION['decodeUTF8'] = (boolean)$formData['decodeUTF8']; - $objResponse = new xajaxResponse(); - $objResponse->addAlert("Your options have been saved."); - return $objResponse; -} - -function testForm($strText, $formData, $arrArray) -{ - global $useEncoding, $htmlEntities; - $objResponse = new xajaxResponse($useEncoding, $htmlEntities); - $data = "Text:\n" . $strText; - $data .= "\n\nFormData:\n" . print_r($formData, true); - $data .= "\n\nArray:\n" .print_r($arrArray, true); - $objResponse->addAlert($data); - $objResponse->addAssign("submittedDiv", "innerHTML", "<pre>".$data."</pre>"); - return $objResponse->getXML(); -} - -$useEncoding = "UTF-8"; -$htmlEntities = false; -$decodeUTF8 = false; - -session_start(); -session_name("xajaxCharEncodingTest"); - -if (@$_GET['refresh'] == "yes") { - session_destroy(); - header("location: charEncodingTest.php"); - exit(); -} - -if (isset($_SESSION['useEncoding'])) { - $useEncoding = $_SESSION['useEncoding']; -} -if (isset($_SESSION['htmlEntities'])) { - $htmlEntities = $_SESSION['htmlEntities']; -} -if (isset($_SESSION['decodeUTF8'])) { - $decodeUTF8 = $_SESSION['decodeUTF8']; -} - -$xajax = new xajax(); -$xajax->setCharEncoding($useEncoding); -if ($htmlEntities) { - $xajax->outputEntitiesOn(); -} -if ($decodeUTF8) { - $xajax->decodeUTF8InputOn(); -} -//$xajax->debugOn(); -$xajax->registerFunction("setOptions"); -$xajax->registerFunction("testForm"); -$xajax->processRequests(); -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Character Encoding Test | xajax Tests</title> -<?php $xajax->printJavascript("../") ?> -<script type="text/javascript"> -function getTestArray() -{ - var text = xajax.$('textField1').value; - var testArray = new Array(); - testArray[0] = text; - testArray[1] = text; - testArray[2] = new Array(); - testArray[2][0] = text; - testArray[2][1] = text; - testArray[3] = new Array(); - testArray[3][0] = text; - testArray[3][1] = text; - testArray[3][2] = new Array(); - testArray[3][2][0] = text; - testArray[3][2][1] = text; - - return testArray; -} - -function callXajax() -{ - var txt = xajax.$('textField1').value; - var frm = xajax.getFormValues('testForm1'); - var arr = getTestArray(); - xajax_testForm(txt,frm,arr); -} -</script> -</head> -<body> - -<h2><a href="index.php">xajax Tests</a></h2> -<h1>Character Encoding Test</h1> - -<h2>Options Form</h2> - -<p><strong>NOTE:</strong> if you change these options, make sure you click the Save Options button or the options won't be used.</p> - -<form id="optionsForm" onsubmit="return false;"> -<p>Encoding: <input type="text" value="<?php echo $useEncoding ?>" name="useEncoding" /><br /> -Output HTML Entities? <input type="radio" name="htmlEntities" value="1" <?php if ($htmlEntities) echo ' checked="checked"' ?>/> Yes - <input type="radio" name="htmlEntities" value="0" <?php if (!$htmlEntities) echo ' checked="checked"' ?>/> No<br /> -Decode UTF-8 Input? <input type="radio" name="decodeUTF8" value="1" <?php if ($decodeUTF8) echo ' checked="checked"' ?>/> Yes - <input type="radio" name="decodeUTF8" value="0" <?php if (!$decodeUTF8) echo ' checked="checked"' ?>/> No<br /> -<p><input type="submit" value="Save Options" onclick="xajax_setOptions(xajax.getFormValues('optionsForm')); return false;" /></p> -</form> - -<p><a href="charEncodingTest.php?refresh=yes">Clear and Refresh</a></p> - -<h2>Text Test Form</h2> - -<p><a href="http://www.i18nguy.com/unicode-example.html" target="_blank">Here are some Unicode examples</a> you can paste into the text box below. You can see <a href="http://www.unicode.org/iuc/iuc10/languages.html" target="_blank">more examples and a list of standard encoding schemes here</a>.</p> - -<form id="testForm1" onsubmit="return false;"> -<p><input type="text" value="Enter test text here" id="textField1" name="textField1" size="60" /></p> -<p><input type="submit" value="Submit Text" onclick="callXajax(); return false;" /></p> -</form> - -<div id="submittedDiv"></div> -<div id="debugDiv"></div> - -</body> -</html> \ No newline at end of file Copied: trunk/public_html/xajax/tests/charEncodingTest.php (from rev 763, branches/ajax_test/public_html/xajax/tests/charEncodingTest.php) =================================================================== --- trunk/public_html/xajax/tests/charEncodingTest.php (rev 0) +++ trunk/public_html/xajax/tests/charEncodingTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -0,0 +1,130 @@ +<?php +require_once("../xajax.inc.php"); + +function setOptions($formData) +{ + $_SESSION['useEncoding'] = $formData['useEncoding']; + $_SESSION['htmlEntities'] = (boolean)$formData['htmlEntities']; + $_SESSION['decodeUTF8'] = (boolean)$formData['decodeUTF8']; + $objResponse = new xajaxResponse(); + $objResponse->addAlert("Your options have been saved."); + return $objResponse; +} + +function testForm($strText, $formData, $arrArray) +{ + global $useEncoding, $htmlEntities; + $objResponse = new xajaxResponse($useEncoding, $htmlEntities); + $data = "Text:\n" . $strText; + $data .= "\n\nFormData:\n" . print_r($formData, true); + $data .= "\n\nArray:\n" .print_r($arrArray, true); + $objResponse->addAlert($data); + $objResponse->addAssign("submittedDiv", "innerHTML", "<pre>".$data."</pre>"); + return $objResponse->getXML(); +} + +$useEncoding = "UTF-8"; +$htmlEntities = false; +$decodeUTF8 = false; + +session_start(); +session_name("xajaxCharEncodingTest"); + +if (@$_GET['refresh'] == "yes") { + session_destroy(); + header("location: charEncodingTest.php"); + exit(); +} + +if (isset($_SESSION['useEncoding'])) { + $useEncoding = $_SESSION['useEncoding']; +} +if (isset($_SESSION['htmlEntities'])) { + $htmlEntities = $_SESSION['htmlEntities']; +} +if (isset($_SESSION['decodeUTF8'])) { + $decodeUTF8 = $_SESSION['decodeUTF8']; +} + +$xajax = new xajax(); +$xajax->setCharEncoding($useEncoding); +if ($htmlEntities) { + $xajax->outputEntitiesOn(); +} +if ($decodeUTF8) { + $xajax->decodeUTF8InputOn(); +} +//$xajax->debugOn(); +$xajax->registerFunction("setOptions"); +$xajax->registerFunction("testForm"); +$xajax->processRequests(); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Character Encoding Test | xajax Tests</title> +<?php $xajax->printJavascript("../") ?> +<script type="text/javascript"> +function getTestArray() +{ + var text = xajax.$('textField1').value; + var testArray = new Array(); + testArray[0] = text; + testArray[1] = text; + testArray[2] = new Array(); + testArray[2][0] = text; + testArray[2][1] = text; + testArray[3] = new Array(); + testArray[3][0] = text; + testArray[3][1] = text; + testArray[3][2] = new Array(); + testArray[3][2][0] = text; + testArray[3][2][1] = text; + + return testArray; +} + +function callXajax() +{ + var txt = xajax.$('textField1').value; + var frm = xajax.getFormValues('testForm1'); + var arr = getTestArray(); + xajax_testForm(txt,frm,arr); +} +</script> +</head> +<body> + +<h2><a href="index.php">xajax Tests</a></h2> +<h1>Character Encoding Test</h1> + +<h2>Options Form</h2> + +<p><strong>NOTE:</strong> if you change these options, make sure you click the Save Options button or the options won't be used.</p> + +<form id="optionsForm" onsubmit="return false;"> +<p>Encoding: <input type="text" value="<?php echo $useEncoding ?>" name="useEncoding" /><br /> +Output HTML Entities? <input type="radio" name="htmlEntities" value="1" <?php if ($htmlEntities) echo ' checked="checked"' ?>/> Yes + <input type="radio" name="htmlEntities" value="0" <?php if (!$htmlEntities) echo ' checked="checked"' ?>/> No<br /> +Decode UTF-8 Input? <input type="radio" name="decodeUTF8" value="1" <?php if ($decodeUTF8) echo ' checked="checked"' ?>/> Yes + <input type="radio" name="decodeUTF8" value="0" <?php if (!$decodeUTF8) echo ' checked="checked"' ?>/> No<br /> +<p><input type="submit" value="Save Options" onclick="xajax_setOptions(xajax.getFormValues('optionsForm')); return false;" /></p> +</form> + +<p><a href="charEncodingTest.php?refresh=yes">Clear and Refresh</a></p> + +<h2>Text Test Form</h2> + +<p><a href="http://www.i18nguy.com/unicode-example.html" target="_blank">Here are some Unicode examples</a> you can paste into the text box below. You can see <a href="http://www.unicode.org/iuc/iuc10/languages.html" target="_blank">more examples and a list of standard encoding schemes here</a>.</p> + +<form id="testForm1" onsubmit="return false;"> +<p><input type="text" value="Enter test text here" id="textField1" name="textField1" size="60" /></p> +<p><input type="submit" value="Submit Text" onclick="callXajax(); return false;" /></p> +</form> + +<div id="submittedDiv"></div> +<div id="debugDiv"></div> + +</body> +</html> \ No newline at end of file Deleted: trunk/public_html/xajax/tests/confirmTest.php =================================================================== --- branches/ajax_test/public_html/xajax/tests/confirmTest.php 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/public_html/xajax/tests/confirmTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -1,37 +0,0 @@ -<?php -require_once("../xajax.inc.php"); - -function confirmTest() -{ - $objResponse = new xajaxResponse(); - $objResponse->addAlert("Here is an alert."); - $objResponse->addConfirmCommands(2, "Are you sure you want to show two (2) more alerts?"); - $objResponse->addAlert("This will only happen if the user presses OK."); - $objResponse->addAlert("This also will only happen if the user presses OK."); - $objResponse->addAlert("This will always happen."); - return $objResponse->getXML(); -} - -$xajax = new xajax(); -//$xajax->debugOn(); -$xajax->registerFunction("confirmTest"); -$xajax->processRequests(); -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Confirm Commands Test | xajax Tests</title> -<?php $xajax->printJavascript("../") ?> -</head> -<body> - -<h2><a href="index.php">xajax Tests</a></h2> -<h1>Confirm Commands Test</h1> - -<form id="testForm1" onsubmit="return false;"> -<p><input type="submit" value="Perform Test" onclick="xajax_confirmTest(); return false;" /></p> -</form> - -</body> -</html> \ No newline at end of file Copied: trunk/public_html/xajax/tests/confirmTest.php (from rev 763, branches/ajax_test/public_html/xajax/tests/confirmTest.php) =================================================================== --- trunk/public_html/xajax/tests/confirmTest.php (rev 0) +++ trunk/public_html/xajax/tests/confirmTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -0,0 +1,37 @@ +<?php +require_once("../xajax.inc.php"); + +function confirmTest() +{ + $objResponse = new xajaxResponse(); + $objResponse->addAlert("Here is an alert."); + $objResponse->addConfirmCommands(2, "Are you sure you want to show two (2) more alerts?"); + $objResponse->addAlert("This will only happen if the user presses OK."); + $objResponse->addAlert("This also will only happen if the user presses OK."); + $objResponse->addAlert("This will always happen."); + return $objResponse->getXML(); +} + +$xajax = new xajax(); +//$xajax->debugOn(); +$xajax->registerFunction("confirmTest"); +$xajax->processRequests(); +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Confirm Commands Test | xajax Tests</title> +<?php $xajax->printJavascript("../") ?> +</head> +<body> + +<h2><a href="index.php">xajax Tests</a></h2> +<h1>Confirm Commands Test</h1> + +<form id="testForm1" onsubmit="return false;"> +<p><input type="submit" value="Perform Test" onclick="xajax_confirmTest(); return false;" /></p> +</form> + +</body> +</html> \ No newline at end of file Deleted: trunk/public_html/xajax/tests/createFormInputTest.php =================================================================== --- branches/ajax_test/public_html/xajax/tests/createFormInputTest.php 2008-01-31 21:13:26 UTC (rev 763) +++ trunk/public_html/xajax/tests/createFormInputTest.php 2008-01-31 21:36:37 UTC (rev 764) @@ -1,129 +0,0 @@ -<?php -require_once("../xajax.inc.php"); - -// tests the select form -function testForm($formData) -{ - $objResponse = new xajaxResponse(); - $objResponse->addAlert("formData: " . print_r($formData, true)); - $objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true))); - return $objResponse->getXML(); -} - -// adds an option to the select -function addInput($aInputData) -{ - $sId = $aInputData['inputId']; - $sName = $aInputData['inputName']; - $sType = $aInputData['inputType']; - $sValue = $aInputData['inputValue']; - - $objResponse = new xajaxResponse(); - $objResponse->addAlert("inputData: " . print_r($aInputData, true)); - $objResponse->addCreateInput("testForm1", $sType, $sName, $sId); - $objResponse->addAssign($sId, "value", $sValue); - return $objResponse->getXML(); -} - -// adds an option to the select -function insertInput($aInputData) -{ - $sId = $aInputData['inputId']; - $sName = $aInputData['inputName']; - $sType = $aInputData['inputType']; - $sValue = $aInputData['inputValue']; - $sBefore = $aInputData['inputBefore']; - - $objResponse = new xajaxResponse(); - $objResponse->addAlert("inputData: " . print_r($aInputData, true)); - $objResponse->addInsertInput($sBefore, $sType, $sName, $sId); - $objResponse->addAssign($sId, "value", $sValue); - return $objResponse->getXML(); -} - -// adds an option to the select -function insertInputAfter($aInputData) -{ - $sId = $aInputData['inputId']; - $sName = $aInputData['inputName']; - $sType = $aInputData['inputType']; - $sValue = $aInputData['inputValue']; - $sAfter = $aInputData['inputAfter']; - - $objResponse = new xajaxResponse(); - $objResponse->addAlert("inputData: " . print_r($aInputData, true)); - $objResponse->addInsertInputAfter($sAfter, $sType, $sName, $sId); - $objResponse->addAssign($sId, "value", $sValue); - return $objResponse->getXML(); -} - -function removeInput($aInputData) -{ - $sId = $aInputData['inputId']; - - $objResponse = new xajaxResponse(); - - $objResponse->addRemove($sId); - - return $objResponse->getXML(); -} - -$xajax = new xajax(); -//$xajax->debugOn(); -$xajax->registerFunction("testForm"); -$xajax->registerFunction("addInput"); -$xajax->registerFunction("insertInput"); -$xajax->registerFunction("insertInputAfter"); -$xajax->registerFunction("removeInput"); - -$xajax->processRequests(); -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>Create Form Input Test| xajax Tests</title> - <?php $xajax->printJavascript("../", "xajax_js/xajax_uncompressed.js") ?> - </head> - <body> - <h2><a href="index.php">xajax Tests</a></h2> - <h1>Create Form Input Test</h1> - - <div> - <form id="testForm1" onsubmit="return false;"> - <div><input type="submit" value="submit" onclick="xajax_testForm(xajax.getFormValues('testForm1')); return false;" /></div> - </form> - </div> - - <div style="margin-top: 20px;"> - <form id="testForm2" onsubmit="return false;"> - <div>type:</div> - <select id="inputType" name="inputType"> - <option value="text" selected="selected">text</option> - <option value="password">password</option> - <option value="hidden">hidden</option> - <option value="radio">radio</option> - <option value="checkbox">checkbox</option> - </select> - <div>Id:</div> - <input type="text" id="inputId" name="inputId" value="input1" /> - <div>Name:</div> - <input type="text" id="inputName" name="inputName" value="input1" /> - <div>Value:</div> - <input type="text" id="inputValue" name="inputValue" value="1" /> - - <div> - <input type="submit" value="Add" onclick="xajax_addInput(xajax.getFormValues('testForm2')); return false;" /> - <input type="submit" v... [truncated message content] |
From: <cra...@us...> - 2008-01-31 22:50:22
|
Revision: 766 http://cs-project.svn.sourceforge.net/cs-project/?rev=766&view=rev Author: crazedsanity Date: 2008-01-31 14:50:11 -0800 (Thu, 31 Jan 2008) Log Message: ----------- Re-generation of tag list now contains outer table (like initial generation). Modified Paths: -------------- trunk/includes/content/tags.inc trunk/templates/content/tags/index.content.tmpl Modified: trunk/includes/content/tags.inc =================================================================== --- trunk/includes/content/tags.inc 2008-01-31 21:49:44 UTC (rev 765) +++ trunk/includes/content/tags.inc 2008-01-31 22:50:11 UTC (rev 766) @@ -271,6 +271,7 @@ //display the list of available tags. $tagListBaseRow = $page->templateRows['availableTagsList']; $showIconRow = $page->templateRows['availableTagsList__tagIcon']; + $outerTemplate = $page->templateRows['tagList']; $myRow = ""; foreach($myTagList as $tagNameId=>$data) { $tagName = $data['name']; @@ -294,7 +295,10 @@ $myRow .= $tmpRow; } $page->add_template_var("availableTagsList", $myRow); + $page->add_template_var('tagList', $outerTemplate); + $retval = mini_parser($myRow, array('tag_row'=>$recordList), '{', '}'); + $retval = mini_parser($outerTemplate, array('availableTagsList' => $retval), '{', '}'); return($retval); }//end updateTagList() Modified: trunk/templates/content/tags/index.content.tmpl =================================================================== --- trunk/templates/content/tags/index.content.tmpl 2008-01-31 21:49:44 UTC (rev 765) +++ trunk/templates/content/tags/index.content.tmpl 2008-01-31 22:50:11 UTC (rev 766) @@ -4,6 +4,7 @@ <td> <b>Available Tags:</b><BR> <div id="tagList"> + <!-- BEGIN tagList --> <table border=1 cellpadding=3 cellspacing=0> <tr> <td> @@ -26,6 +27,7 @@ </td> </tr> </table> + <!-- END tagList --> </div> <table> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |