Skip to content

Commit

Permalink
added name column to models
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoRazorX committed Apr 6, 2021
1 parent fe7f2d7 commit 223e3ac
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions fsmaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,13 @@ public function getModelClassName() {
<view>
<columns>
<group name="data" numcolumns="12">
<column name="code" order="100">
<column name="code" display="none" order="100">
<widget type="text" fieldname="id" />
</column>
<column name="creation-date" order="110">
<column name="name" order="110">
<widget type="text" fieldname="name" />
</column>
<column name="creation-date" order="120">
<widget type="datetime" fieldname="creationdate" readonly="dinamic" />
</column>
</group>
Expand Down Expand Up @@ -229,6 +232,9 @@ protected function createViews() {
protected function createViews'.$modelName.'(string $viewName = "List'.$modelName.'") {
$this->addView($viewName, "'.$modelName.'", "'.$title.'");
$this->addOrderBy($viewName, ["id"], "id");
$this->addOrderBy($viewName, ["name"], "name", 1);
$this->addSearchFields($viewName, ["id", "name"]);
}
}');
$xmlviewFilename = $this->isCoreFolder() ? 'Core/XMLView/List'.$modelName.'.xml' : 'XMLView/List'.$modelName.'.xml';
Expand All @@ -243,7 +249,10 @@ protected function createViews'.$modelName.'(string $viewName = "List'.$modelNam
<column name="code" order="100">
<widget type="text" fieldname="id" />
</column>
<column name="creation-date" display="right" order="110">
<column name="name" order="110">
<widget type="text" fieldname="name" />
</column>
<column name="creation-date" display="right" order="120">
<widget type="datetime" fieldname="creationdate" />
</column>
</columns>
Expand Down Expand Up @@ -275,6 +284,7 @@ class '.$name.' extends \\FacturaScripts\\Core\\Model\\Base\\ModelClass
public $creationdate;
public $id;
public $name;
public function clear() {
$this->creationdate = \date(self::DATETIME_STYLE);
Expand All @@ -297,6 +307,10 @@ public static function tableName() {
<name>id</name>
<type>serial</type>
</column>
<column>
<name>name</name>
<type>character varying(100)</type>
</column>
<column>
<name>creationdate</name>
<type>timestamp</type>
Expand Down

0 comments on commit 223e3ac

Please sign in to comment.