summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-11-23 14:52:53 +0100
committerFabio Bas <ctrlaltca@gmail.com>2013-11-23 14:52:53 +0100
commitc90614303d9993023a8fa218bd210e7e32802fa7 (patch)
treef2d4b80a400e456d5a1e4b6db89238108bd1e823 /framework/Wsat/pages
parent5909ef5a99fd98dbc1b25fcb4640c03fdef4cb53 (diff)
parentefde949d00b808f55710abbd3d82ceb490545116 (diff)
Merge branch 'jquery' of https://github.com/pradosoft/prado into jquery
Conflicts: framework/Wsat/pages/TWsatLogin.php framework/Wsat/themes/PradoSoft/main.css
Diffstat (limited to 'framework/Wsat/pages')
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.page20
-rw-r--r--framework/Wsat/pages/TWsatGenerateAR.php80
-rw-r--r--framework/Wsat/pages/TWsatLogin.page7
3 files changed, 67 insertions, 40 deletions
diff --git a/framework/Wsat/pages/TWsatGenerateAR.page b/framework/Wsat/pages/TWsatGenerateAR.page
index 3905d023..acd456fd 100644
--- a/framework/Wsat/pages/TWsatGenerateAR.page
+++ b/framework/Wsat/pages/TWsatGenerateAR.page
@@ -1,21 +1,31 @@
<com:TContent ID="Content">
- <div style="margin-left: 220px">
+ <div style="margin-left: 220px; font-size: 14px">
<div class="form_row">
- <com:TLabel Text="Table Name:" ForControl="table_name" style="margin-right: 14px" />
+ <com:TLabel Text="Table Name:" ForControl="table_name" style="margin-right: 24px" />
<com:TTextBox ID="table_name" Text="*" CssClass="in_text" />
+ <com:TRequiredFieldValidator ControlToValidate="table_name" Text="Table name cannot be blank." Display="Dynamic" />
</div>
<div class="form_row">
- <com:TLabel Text="Class Prefix:" ForControl="class_prefix" style="margin-right: 16px"/>
+ <com:TLabel Text="Class Prefix:" ForControl="class_prefix" style="margin-right: 25px"/>
<com:TTextBox ID="class_prefix" Text="AR_" CssClass="in_text" />
</div>
<div class="form_row">
- <com:TLabel Text="Output Folder:" ForControl="output_folder"/>
+ <com:TLabel Text="Output Folder:" ForControl="output_folder" style="margin-right: 8px"/>
<com:TTextBox ID="output_folder" Text="Application.App_Data.AR_Classes" CssClass="in_text" />
</div>
+
+ <div class="form_row">
+ <com:TLabel Text="Build Relations:" ForControl="build_rel"/>
+ <com:TCheckBox ID="build_rel" Checked="true" />
+ </div>
+
+ <com:TPanel ID="success_panel" Visible="false">
+ <com:TLabel ID="generation_msg" />
+ </com:TPanel>
<br/>
<div style="text-align: center">
- <com:TButton Text="Preview" OnClick="preview" />
+ <com:TButton Text="Preview" OnClick="preview" Visible="false" />
<com:TButton Text="Generate" OnClick="generate" />
</div>
</div>
diff --git a/framework/Wsat/pages/TWsatGenerateAR.php b/framework/Wsat/pages/TWsatGenerateAR.php
index 754cac5c..3d4291e2 100644
--- a/framework/Wsat/pages/TWsatGenerateAR.php
+++ b/framework/Wsat/pages/TWsatGenerateAR.php
@@ -1,33 +1,49 @@
-<?php
-
-/**
- * Description of Inicio
- *
- * @author daniels
- */
-Prado::using("System.Wsat.TWsatARGenerator");
-
-class TWsatGenerateAR extends TPage {
-
- public function onInit($param) {
- parent::onInit($param);
- }
-
- public function generate($sender) {
- $table_name = $this->table_name->Text;
-
- $ar_generator = new TWsatARGenerator();
- if ($table_name != "*") {
- $ar_generator->generate($table_name);
- } else {
- $ar_generator->generateAll();
- }
- }
-
- public function preview($sender) {
-
- }
-
-}
-
+<?php
+
+/**
+ * Description of Inicio
+ *
+ * @author daniels
+ */
+Prado::using("System.Wsat.TWsatARGenerator");
+
+class TWsatGenerateAR extends TPage {
+
+ public function generate($sender) {
+ if ($this->IsValid) {
+ $table_name = $this->table_name->Text;
+ $class_prefix = $this->class_prefix->Text;
+ $output_folder_ns = $this->output_folder->Text;
+
+ try {
+ $ar_generator = new TWsatARGenerator();
+ $ar_generator->setOpFile($output_folder_ns);
+ $ar_generator->setClasPrefix($class_prefix);
+
+ if ($this->build_rel->Checked) {
+ $ar_generator->buildRelations();
+ }
+ if ($table_name != "*") {
+ $ar_generator->generate($table_name);
+ } else {
+ $ar_generator->generateAll();
+ }
+ $this->success_panel->CssClass = "success_panel";
+ $this->generation_msg->Text = "The code has been generated successfully.";
+ } catch (Exception $ex) {
+ $this->success_panel->CssClass = "exception_panel";
+ $this->generation_msg->Text = $ex->getMessage();
+ }
+ $this->success_panel->Visible = true;
+ }
+ }
+
+ public function preview($sender) {
+// $ar_generator = new TWsatARGenerator();
+// $ar_generator->renderAllTablesInformation();
+ throw new THttpException(500, "Not implemented yet.");
+ }
+
+}
+
?> \ No newline at end of file
diff --git a/framework/Wsat/pages/TWsatLogin.page b/framework/Wsat/pages/TWsatLogin.page
index b256d719..d0a94f2a 100644
--- a/framework/Wsat/pages/TWsatLogin.page
+++ b/framework/Wsat/pages/TWsatLogin.page
@@ -29,9 +29,10 @@
<div class="login_form">
<com:TLabel Text="Please enter your password:" ForControl="password"/><br/>
<com:TTextBox ID="password" TextMode="Password" style="margin: 5px" /><br/>
- <com:TRequiredFieldValidator ControlToValidate="password" Text="Password cannot be blank." /><br/>
-
- <com:TButton Text="Enter" OnClick="login" />
+ <com:TRequiredFieldValidator ControlToValidate="password" ValidationGroup="loginGroup" Text="Password cannot be blank." /><br/>
+ <com:TCustomValidator ControlToValidate="password" ValidationGroup="loginGroup" OnServerValidate="validatePassword" Text="Incorrect password." />
+
+ <com:TButton Text="Enter" ValidationGroup="loginGroup" OnClick="login" />
</div>
<div id="footer">