00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <iostream>
00013 #include <iomanip>
00014 #include "cgiTemplates.h"
00015 #include "connectstring"
00016 #include "forms.h"
00017 #include "ocTypes.h"
00018 #include "ocString.h"
00019 #include "read_write_base.hpp"
00020 #include "forms_base.hpp"
00021 #include "list_base.hpp"
00022 #include "cgiTemplates.h"
00023 #include "Report_Conditioning.hpp"
00024 #include "list_base.hpp"
00025 #include "openLogin.h"
00026
00027
00028 using namespace std;
00029 openLogin oLogin;
00030
00031 #include "InfoPoints.hpp"
00032
00033 class Report_Conditioning_form: public Report_Conditioning_Obj, public forms_base
00034 {
00035 string colHandlers;
00036 string directions;
00037 string formats;
00038 string spawningEvents;
00039 public:
00040 Report_Conditioning_form(cgiScript & script):Report_Conditioning_Obj(),forms_base(script)
00041 {
00042 setKey(*this);
00043 colHandlers = "NONE=NONE,SUM=SUM,AVG=AVG,GROUP=GROUP,SPAWN REPORT=SPAWN,LOOKUP=LOOKUP";
00044 directions = "NONE=NONE,ASC=ASC,DESC=DESC";
00045 formats = "STRING=STRING,CURRENCY=CURRENCY,DECIMAL=DECIMAL,INTEGER=INTEGER,TIME=TIME,DATE=DATE,DATETIME=DATETIME";
00046
00047 spawningEvents = "Commence=0,Pre-Row=1,Field=2,Post-Field=3,Post-Row=4,Complete=5";
00048 }
00049 virtual ~Report_Conditioning_form(){;}
00050
00051 void form_id_transfer( void )
00052 {
00053 llongFXfer( "Id", Id );
00054 }
00055 void form_data_transfer( void )
00056 {
00057 llongFXfer( "Report_Id", Report_Id);
00058 intFXfer( "Col", Col);
00059
00060 stringFXfer( "Col_Handler", Col_Handler);
00061 stringFXfer( "Direction", Direction);
00062
00063 stringFXfer( "Tuple_Section", Tuple_Section);
00064 llongFXfer( "spawnedReport", spawnedReport);
00065 stringFXfer( "spawnedTuplePretext", spawnedTuplePretext);
00066 stringFXfer( "spawnedTuplePosttext", spawnedTuplePosttext);
00067 intFXfer( "spawningEvent", spawningEvent);
00068 }
00069
00070 bool dbf_action( string mode, changeMap & changes )
00071 {
00072 return db_action( mode, changes );
00073 }
00074
00075
00076 bool form_display( void )
00077 {
00078 bool breturn = true;
00079 ocString sql;
00080 script << makeTop("Report_Conditioning_Popup.cgi", "Report_Conditioning");
00081 script << makeHiddenBox("Id", Id );
00082 script << makeHiddenBox("Report_Id", Report_Id );
00083
00084
00085 script << "<br class='clearall'>" << endl;
00086 script << makeTextBox("Col", "Col", Col , "4" );
00087 script << "<br class='clearall'>" << endl;
00088
00089 script << makeManualComboBox("Col Handler", "Col_Handler", Col_Handler ,colHandlers.c_str() );
00090 script << "<br class='clearall'>" << endl;
00091
00092 script << makeManualComboBox("Format", "Format", Format ,formats.c_str() );
00093 script << "<br class='clearall'>" << endl;
00094 script << makeTextBox("Tuple Section", "Tuple_Section", Tuple_Section ,"25");
00095 script << "<br class='clearall'>" << endl;
00096 sql = "select Id, Name from Report order by Name";
00097 script << makeComboBox("Spawned Report<br>Only for Spawn Report Handler", "spawnedReport", spawnedReport ,sql);
00098 script << "<br class='clearall'>" << endl;
00099 script << makeTextArea("Spawned Report Tuple Pre-text<br>(Or id, name SQL lookup query for LOOKUP)", "spawnedTuplePretext", spawnedTuplePretext ,"5","55");
00100 script << "<br class='clearall'>" << endl;
00101 script << makeTextArea("spawned Tuple Post-text", "spawnedTuplePosttext", spawnedTuplePosttext ,"5","55");
00102 script << "<br class='clearall'>" << endl;
00103 script << makeManualComboBox("spawningEvent", "spawningEvent", spawningEvent,
00104 spawningEvents );
00105 script << makeButtons( key() );
00106 script << "<br><ul>\
00107 <li>commence_event - event just before any data is displayed \
00108 <li>prerow_event - Before any data on the current row is displayed \
00109 want to check for groups and sums on the previous rows \
00110 <li>field_event - The field on a row of data is being rendered, give the handler an opportunity to do this \
00111 <li>postfield_event - After current field is displayed \
00112 <li>postrow_event - After all data on the row is displayed \
00113 <li>complete_event - After all data is displayed \
00114 </ul>" << endl;
00115 script << "<a style='color:#283;text-decoration:underline;' href=\"javascript:jopen('intranet.meta/reportHelp?view=Report_Conditioning',"
00116 "'scrollbars,resizable,width=575,height=300','Help')\">Help</a>" << endl;
00117 script << makeBottom( m_result ) << endl;
00118 return breturn;
00119 }
00120 };
00121
00122
00123 int main( int argcount, char ** args )
00124 {
00125 cgiScript script( "text/html", false );
00126 Report_Conditioning_form myFrm(script);
00127
00128 infoPoints iPoints;
00129 if( iPoints.idToken.length() )
00130 {
00131 oLogin.token = iPoints.idToken;
00132 }
00133
00134 if( oLogin.testLoginStatus() )
00135 {
00136 script.closeHeader();
00137 cgiTemplates pgTemplate;
00138 pgTemplate.load("Templates/childPane.htmp");
00139
00140 script << ocString(pgTemplate.getParagraph("top"))
00141 .replaceAll("$heading$","Report_Conditioning");
00142
00143 myFrm.loadControlTemplates("Templates/childdivform.htmp");
00144 myFrm.form_action();
00145 myFrm.form_display();
00146 ocString end = pgTemplate.getParagraph("bottom");
00147 script << end;
00148 }
00149 else
00150 {
00151 script.Redirect("/");
00152 }
00153 }
00154
00155 #include "read_write_base.cpp"
00156 #include "forms_base.cpp"