00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 class Report_List: public list_base
00011 {
00012 public:
00013
00014 Report_List(cgiScript&sc,Session_Obj & session):list_base(sc,session){;}
00015 ~Report_List(){;}
00016 bool list_display( void )
00017 {
00018 bool breturn = true;
00019
00020 hotCol=-2;
00021 editLink = listTemplate.getParagraph("hotcolumn");
00022 editLink = editLink.replace("$prog$","ReportUI.meta");
00023 emitFilter( "ReportUI.meta",
00024 " <B>FILTER (by Name)</B>" );
00025 string heading =
00026 "<a class='sortcol' href='ReportUI.meta?sort=Id'>Id</a>|"
00027 "<a class='sortcol' href='ReportUI.meta?sort=Name'>Name</a>|"
00028 "<a class='sortcol' href='ReportUI.meta?sort=Category'>Category</a>|"
00029 "<a class='sortcol' href='ReportUI.meta?sort=Show_In_List'>Show In List</a>"
00030 ;
00031 emitHeadings(heading);
00032 getFilteredData( "Id, Name, Category, "
00033 "case Show_In_List when 1 then 'Yes' else 'No' end", "Report", "Name like '$filter$%'", "Category, Name" );
00034 emitData();
00035 emitNavigation("ReportUI.meta");
00036 emitEnd();
00037 return breturn;
00038 }
00039
00040 };
00041
00042 class Report_Conditioning_List: public list_base
00043 {
00044 public:
00045 ocString Parent_Id;
00046
00047 Report_Conditioning_List(cgiScript&sc, Session_Obj & session): list_base(sc,session){;}
00048 ~Report_Conditioning_List(){;}
00049
00050 bool list_display( void )
00051 {
00052 bool breturn = true;
00053 string sql = "select child.Id, "
00054 "child.Col, "
00055 "child.Sort_Pos, "
00056 "child.Col_Handler, "
00057 "child.Direction "
00058 "from Report_Conditioning child inner join "
00059 "Report parent on parent.Id = child.Report_Id " ;
00060 sql += " where child.Report_Id = ";
00061 sql += Parent_Id;
00062 sql += " order by child.Col ";
00063 hotCol=-2;
00064 editLink = listTemplate.getParagraph("hotcolumn");
00065 editLink = editLink.replace("$prog$","Report_Conditioning_Popup.cgi");
00066 string heading = "Id|"
00067 "Col|"
00068 "Sort_Pos|"
00069 "Col_Handler|"
00070 "Direction";
00071
00072 emitHeadings(heading);
00073 getData( sql );
00074 emitData();
00075 ocString list_new = listTemplate.getParagraph("list_new");
00076 ocString url = "Report_Conditioning_Popup.cgi?Report_Id=";
00077 url += Parent_Id;
00078 webIO << list_new.replace("$location",url.c_str()).replace("$item","Report Conditioning");
00079 emitEnd();
00080 return breturn;
00081 }
00082 };
00083
00084 class Report_form: public Report_Obj, public forms_base
00085 {
00086 public:
00087 Report_form(cgiScript & script):Report_Obj(),forms_base(script){setKey(*this);}
00088 virtual ~Report_form(){;}
00089
00090 void form_id_transfer( void )
00091 {
00092 llongFXfer( "Id", Id );
00093 }
00094 void form_data_transfer( void )
00095 {
00096 llongFXfer( "Template_Id", Template_Id);
00097 llongFXfer( "Composite_Query", Composite_Query);
00098 stringFXfer( "Name", Name);
00099 llongFXfer( "Media_Type", Media_Type);
00100 stringFXfer( "Category", Category);
00101 boolFXfer( "Show_In_List", Show_In_List);
00102 intFXfer( "Formatting_Modulus", Formatting_Modulus);
00103 intFXfer( "Items_Per_Page", Items_Per_Page);
00104 stringFXfer( "External_Program", External_Program);
00105 }
00106
00107 bool dbf_action( string mode, changeMap & changes )
00108 {
00109 changes["Template_Id"]="Template_Id";
00110 changes["Composite_Query"]="Composite_Query";
00111 return db_action( mode, changes );
00112 }
00113
00114
00115 bool form_display( void )
00116 {
00117 bool breturn = true;
00118 ocString sql;
00119 ocString paramLink = "<a href=\"javascript:jopen('Report_Parameters_ui.cgi";
00120 if( Id )
00121 {
00122 paramLink += "?Report_Id=";
00123 paramLink.append(Id);
00124 }
00125 paramLink += "')\">Manage Filter Parameters</a>";
00126 if( Id )
00127 {
00128 paramLink += " <a target=\"reportview\" href=\"";
00129 paramLink += External_Program.length()?External_Program:"Reports.cgi";
00130 paramLink += "?Id=";
00131 paramLink.append(Id);
00132 paramLink += "\">View / Test Report</a>";
00133 }
00134 script << makeTop("ReportUI.meta", "Reports" ) << paramLink ;
00135 script << "<br class='clearall'>" << endl;
00136 script << formTemplate.getParagraph("advanced_begin");
00137 script << makeStaticBox("Id", "Id", Id ,"8");
00138 script << "<br class='clearall'>" << endl;
00139 script << formTemplate.getParagraph("advanced_end");
00140 sql = "select Id, Name from Report_Templates";
00141 script << makeComboBox("Template_Id", "Template_Id", Template_Id ,sql);
00142
00143 script << "<a href=\"javascript:jopen('Report_Templates_Popup.cgi',"
00144 << "'scrollbars,resizable,width=500,height=300','_blank')\">Add Template</a>";
00145
00146 if( Template_Id )
00147 {
00148 script << " <a href=\"javascript:jopen('Report_Templates_Popup.cgi?Id="
00149 << Template_Id << "','scrollbars,resizable,width=500,height=300','_blank')\">Update Template</a>";
00150 }
00151 script << "<br class='clearall'>" << endl;
00152 sql = "select Id, Name from Composite_Query where Is_Workflow <= 0";
00153 script << makeComboBox("Composite_Query", "Composite_Query", Composite_Query ,sql);
00154
00155 script << "<a href=\"javascript:jopen('Composite_Query_Popup.cgi',"
00156 << "'scrollbars,resizable,width=500,height=300','_blank')\">Add Query</a>";
00157
00158
00159 if( Composite_Query )
00160 {
00161 script << " <a href=\"javascript:jopen('Composite_Query_Popup.cgi?Id="
00162 << Composite_Query << "','scrollbars,resizable,width=500,height=300','_blank')\">Update Query</a>";
00163 }
00164
00165 script << "<br class='clearall'>" << endl;
00166 script << makeTextBox("Name", "Name", Name ,"125","35");
00167 script << "<br class='clearall'>" << endl;
00168 sql = "select Id, Name from Report_Type";
00169 script << makeComboBox("Media_Type", "Media_Type", Media_Type ,sql,"Pick/Add Media Type");
00170
00171 script << "<a href=\"javascript:jopen('Report_Type_Popup.cgi',"
00172 << "'scrollbars,resizable,width=500,height=300','_blank')\">Add Media Type</a>";
00173
00174 if( Media_Type )
00175 {
00176 script << " <a href=\"javascript:jopen('Report_Type_Popup.cgi?Id="
00177 << Media_Type << "','scrollbars,resizable,width=500,height=300','_blank')\">Update Media Type</a>";
00178 }
00179 script << "<br class='clearall'>" << endl;
00180 script << makeTextBox("Category", "Category", Category ,"85","35");
00181 script << "<br class='clearall'>" << endl;
00182 script << makeBoolBox("Show_In_List", "Show_In_List", Show_In_List );
00183 script << "<br class='clearall'>" << endl;
00184 script << makeTextBox("Formatting_Modulus", "Formatting_Modulus", Formatting_Modulus ,"8","8");
00185 script << "<br class='clearall'>" << endl;
00186 script << makeTextBox("Items_Per_Page", "Items_Per_Page", Items_Per_Page ,"8","8");
00187 script << "<br class='clearall'>" << endl;
00188 script << makeTextBox("External Reporting Program", "External_Program", External_Program ,"125","35");
00189 script << "<br class='clearall'>" << endl;
00190 script << makeButtons( key() );
00191 if( key() && Composite_Query )
00192 {
00193 Report_Conditioning_List cList(script,oLogin.Session());
00194 cList.Parent_Id.append(key());
00195 cList.loadListTemplates("Templates/spawninglist.htmp");
00196 script << "<h6>Report Conditioning</h6>" << endl;
00197 cList.list_display();
00198 Query_Result_List qList(script,oLogin.Session());
00199 qList.Query_Id.append(Composite_Query);
00200 qList.loadListTemplates("Templates/spawninglist.htmp");
00201 script << "<h6>Query:</h6>" << endl;
00202 qList.list_display();
00203 }
00204 script << makeBottom( m_result ) << endl;
00205 return breturn;
00206 }
00207 };